:root {
  --blue-950: #102a6e;
  --blue-900: #173fb3;
  --blue-800: #1749cc;
  --blue-700: #2457e6;
  --blue-100: #dfe9ff;
  --blue-50: #edf3ff;
  --ink-950: #172033;
  --ink-900: #182238;
  --ink-800: #253047;
  --ink-700: #475467;
  --ink-600: #667085;
  --ink-500: #8a94a6;
  --ink-400: #98a2b3;
  --line: #e4e9f1;
  --line-strong: #d7deea;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --green: #16865d;
  --green-bg: #eaf8f1;
  --amber: #a86500;
  --amber-bg: #fff5df;
  --red: #c63c32;
  --red-bg: #fff0ef;
  --violet: #6246c9;
  --violet-bg: #f1efff;
  --shadow-sm: 0 8px 24px rgba(27, 47, 83, 0.06);
  --shadow-md: 0 18px 48px rgba(27, 47, 83, 0.11);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink-950);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; min-height: 100%; scroll-behavior: smooth; }

body { min-height: 100vh; margin: 0; background: var(--canvas); color: var(--ink-950); }

button, input, select, textarea { font: inherit; }

button { cursor: pointer; }

button:disabled { cursor: not-allowed; opacity: .52; }

:focus-visible { outline: 3px solid rgba(36, 87, 230, .32); outline-offset: 2px; }

[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 8px;
  left: 8px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  color: var(--blue-700);
  box-shadow: var(--shadow-md);
}

.skip-link:focus { transform: translateY(0); }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #3269f1, #1741b7);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: -.5px;
  box-shadow: 0 10px 24px rgba(36, 87, 230, .22);
}
.brand strong { display: block; font-size: 18px; letter-spacing: .04em; }
.brand small { display: block; margin-top: 1px; color: var(--ink-500); font-size: 8px; font-weight: 750; letter-spacing: .17em; }
.brand-on-dark strong { color: #fff; }
.brand-on-dark small { color: rgba(255,255,255,.57); }
.brand-on-dark .brand-mark { background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.2); box-shadow: none; }

.eyebrow { margin: 0 0 5px; color: var(--blue-700); font-size: 10px; font-weight: 850; letter-spacing: .17em; }
.eyebrow.light { color: #9bbdff; }

/* Login */
.login-view {
  position: relative;
  display: grid;
  min-height: 100vh;
  overflow: hidden;
  place-items: center;
  padding: 44px;
  background:
    radial-gradient(circle at 15% 15%, rgba(53, 113, 255, .45), transparent 28%),
    linear-gradient(135deg, #081b4b 0%, #103283 45%, #1854d8 100%);
}
.login-view::before {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  mask-image: linear-gradient(to right, #000, transparent 76%);
}
.login-orb { position: absolute; border-radius: 50%; background: rgba(116, 191, 255, .12); filter: blur(2px); }
.login-orb-one { top: -150px; right: 6%; width: 420px; height: 420px; }
.login-orb-two { bottom: -240px; left: 25%; width: 560px; height: 560px; }
.login-shell { position: relative; z-index: 1; display: grid; width: min(1120px, 100%); grid-template-columns: minmax(0, 1.15fr) minmax(380px, .72fr); gap: 82px; align-items: center; }
.login-intro { color: #fff; }
.login-intro .brand { margin-bottom: 70px; }
.login-intro h1 { max-width: 670px; margin: 17px 0 22px; font-size: clamp(37px, 4.4vw, 63px); line-height: 1.18; letter-spacing: -.045em; }
.login-description { max-width: 580px; color: rgba(255,255,255,.72); font-size: 17px; line-height: 1.8; }
.login-points { display: grid; gap: 13px; margin: 38px 0 0; padding: 0; color: rgba(255,255,255,.86); list-style: none; }
.login-points li { display: flex; align-items: center; gap: 11px; }
.login-points span { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; background: rgba(116, 231, 191, .15); color: #84e1bb; font-size: 12px; }
.login-card { padding: 38px 38px 32px; border: 1px solid rgba(255,255,255,.55); border-radius: 28px; background: rgba(255,255,255,.97); box-shadow: 0 30px 90px rgba(0, 16, 58, .34); backdrop-filter: blur(18px); }
.environment-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 999px; background: var(--green-bg); color: var(--green); font-size: 11px; font-weight: 750; }
.environment-badge i, .sync-state i { width: 7px; height: 7px; border-radius: 50%; background: #1aa06d; box-shadow: 0 0 0 5px rgba(26,160,109,.11); }
.login-card h2 { margin: 22px 0 8px; font-size: 28px; letter-spacing: -.03em; }
.login-card-head > p { margin: 0 0 28px; color: var(--ink-500); font-size: 14px; }
.field { display: grid; gap: 8px; margin-bottom: 18px; color: var(--ink-700); font-size: 13px; font-weight: 680; }
.field.compact { margin: 14px 0 0; }
.field input, .field select, .field textarea, .input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-900);
  padding: 11px 13px;
  transition: border-color .16s, box-shadow .16s;
}
.field textarea { min-height: 112px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--blue-700); box-shadow: 0 0 0 4px rgba(36,87,230,.09); outline: none; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 62px; }
.password-toggle { position: absolute; top: 50%; right: 7px; transform: translateY(-50%); border: 0; background: transparent; color: var(--blue-700); font-size: 12px; font-weight: 700; }
.form-error { min-height: 19px; margin: -5px 0 8px; color: var(--red); font-size: 12px; }
.login-hint { margin: 14px 0 0; color: var(--ink-500); font-size: 11px; text-align: center; }
.connection-settings { margin-top: 21px; border-top: 1px solid var(--line); padding-top: 17px; color: var(--ink-600); font-size: 12px; }
.connection-settings summary { cursor: pointer; font-weight: 650; }
.demo-notice { display: flex; gap: 10px; margin-top: 18px; padding: 12px; border-radius: 12px; background: #f6f8fc; color: var(--ink-600); }
.demo-notice > span { display: grid; width: 19px; height: 19px; flex: 0 0 19px; place-items: center; border-radius: 50%; background: var(--blue-50); color: var(--blue-700); font-size: 11px; font-weight: 800; }
.demo-notice p { margin: 0; font-size: 11px; line-height: 1.55; }

/* App frame */
.app-shell { display: grid; min-height: 100vh; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; z-index: 50; top: 0; display: flex; height: 100vh; flex-direction: column; border-right: 1px solid var(--line); background: #fff; padding: 26px 19px 18px; }
.sidebar-brand { padding: 0 9px 26px; }
.main-nav { display: flex; min-height: 0; flex: 1; flex-direction: column; overflow-y: auto; }
.nav-label { margin: 8px 12px 9px; color: #a0a8b8; font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.nav-label-spaced { margin-top: 25px; }
.nav-item { position: relative; display: flex; width: 100%; min-height: 46px; align-items: center; gap: 12px; margin: 2px 0; border: 0; border-radius: 12px; background: transparent; color: var(--ink-600); padding: 8px 11px; text-align: left; transition: background .15s, color .15s; }
.nav-item:hover { background: #f5f7fb; color: var(--ink-900); }
.nav-item.active { background: var(--blue-50); color: var(--blue-700); font-weight: 720; }
.nav-item.active::before { position: absolute; left: -19px; width: 3px; height: 24px; border-radius: 0 3px 3px 0; background: var(--blue-700); content: ""; }
.nav-icon { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; background: #f2f4f8; color: var(--ink-600); font-size: 11px; font-weight: 800; }
.nav-item.active .nav-icon { background: #dce7ff; color: var(--blue-700); }
.nav-count { min-width: 21px; margin-left: auto; border-radius: 999px; background: var(--amber-bg); color: var(--amber); padding: 3px 7px; font-size: 10px; font-weight: 750; text-align: center; }
.sidebar-runtime { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #f8faff; }
.runtime-head { display: flex; align-items: center; justify-content: space-between; color: var(--ink-500); font-size: 10px; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 5px rgba(168,101,0,.09); }
.pulse-dot.online { background: #1aa06d; box-shadow: 0 0 0 5px rgba(26,160,109,.1); }
.pulse-dot.offline { background: var(--red); box-shadow: 0 0 0 5px rgba(198,60,50,.1); }
.sidebar-runtime strong { display: block; margin-top: 11px; font-size: 12px; }
.sidebar-runtime p { margin: 5px 0 9px; color: var(--ink-500); font-size: 10px; line-height: 1.5; }
.text-button { border: 0; background: transparent; color: var(--blue-700); padding: 0; font-size: 10px; font-weight: 720; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; margin-top: 13px; padding: 13px 5px 0; border-top: 1px solid var(--line); }
.user-avatar, .avatar-button { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border: 0; border-radius: 50%; background: linear-gradient(145deg, #3269f1, #173fb3); color: #fff; font-size: 12px; font-weight: 750; }
.user-meta { min-width: 0; flex: 1; }
.user-meta strong, .user-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta strong { font-size: 11px; }
.user-meta small { margin-top: 2px; color: var(--ink-500); font-size: 9px; }
.icon-button { border: 0; background: transparent; color: var(--ink-500); padding: 7px; font-size: 9px; }
.app-main { min-width: 0; }
.topbar { position: sticky; z-index: 35; top: 0; display: flex; min-height: 86px; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.91); padding: 14px clamp(22px, 3.2vw, 48px); backdrop-filter: blur(16px); }
.page-heading { min-width: 0; flex: 1; }
.page-heading h1 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.topbar-actions { display: flex; align-items: center; gap: 11px; }
.tenant-picker { display: grid; min-width: 210px; gap: 3px; color: var(--ink-500); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tenant-picker select { width: 100%; max-width: 280px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink-800); padding: 8px 30px 8px 10px; font: inherit; font-size: 10px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.tenant-picker select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,73,204,.1); outline: 0; }
.tenant-picker select:invalid { color: var(--amber); }
.sync-state { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-500); font-size: 10px; }
.sync-state.offline i { background: var(--red); box-shadow: 0 0 0 5px rgba(198,60,50,.1); }
.menu-button { display: none; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink-700); padding: 9px 11px; font-size: 11px; font-weight: 700; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 28px clamp(22px, 3.2vw, 48px) 56px; }
.loading-state, .empty-state { display: grid; min-height: 340px; place-items: center; align-content: center; color: var(--ink-500); text-align: center; }
.loading-state p, .empty-state p { margin: 13px 0 0; font-size: 12px; }
.spinner { width: 30px; height: 30px; border: 3px solid #dfe6f4; border-top-color: var(--blue-700); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Common content */
.page-stack { display: grid; gap: 22px; }
.section { display: grid; gap: 14px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 15px; }
.section-title { margin: 0; font-size: 17px; letter-spacing: -.015em; }
.section-caption { margin: 5px 0 0; color: var(--ink-500); font-size: 11px; line-height: 1.55; }
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.button { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 10px; padding: 9px 14px; font-size: 11px; font-weight: 720; transition: transform .12s, background .15s, border-color .15s; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary { background: var(--blue-700); color: #fff; box-shadow: 0 8px 18px rgba(36,87,230,.16); }
.button-primary:hover { background: #194bd4; }
.button-secondary { background: var(--blue-50); color: var(--blue-700); }
.button-secondary:hover { background: #dfe9ff; }
.button-quiet { border-color: var(--line-strong); background: #fff; color: var(--ink-700); }
.button-quiet:hover { border-color: #bdc8d9; background: #fafbfc; }
.button-danger { background: var(--red); color: #fff; }
.button-danger-soft { background: var(--red-bg); color: var(--red); }
.button-small { min-height: 32px; padding: 6px 10px; border-radius: 8px; font-size: 10px; }
.button-wide { width: 100%; min-height: 48px; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { display: inline-flex; min-height: 25px; align-items: center; gap: 6px; border-radius: 999px; background: #f1f4f9; color: var(--ink-600); padding: 4px 9px; font-size: 9px; font-weight: 700; line-height: 1.3; }
.chip::before { width: 6px; height: 6px; border-radius: 50%; background: #aeb6c3; content: ""; }
.chip-blue { background: var(--blue-50); color: var(--blue-700); }
.chip-blue::before { background: var(--blue-700); }
.chip-green { background: var(--green-bg); color: var(--green); }
.chip-green::before { background: #1aa06d; }
.chip-amber { background: var(--amber-bg); color: var(--amber); }
.chip-amber::before { background: #e69918; }
.chip-red { background: var(--red-bg); color: var(--red); }
.chip-red::before { background: var(--red); }
.chip-violet { background: var(--violet-bg); color: var(--violet); }
.chip-violet::before { background: var(--violet); }
.chip-neutral::before { display: none; }
.callout { display: flex; align-items: flex-start; gap: 12px; border: 1px solid #d7e3ff; border-radius: 13px; background: #f3f7ff; padding: 13px 15px; color: #38517c; font-size: 11px; line-height: 1.65; }
.callout strong { color: var(--blue-900); }
.callout-icon { display: grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; border-radius: 50%; background: #dce7ff; color: var(--blue-700); font-size: 10px; font-weight: 800; }
.callout.warning { border-color: #f1ddae; background: #fffaf0; color: #76551a; }
.callout.warning .callout-icon { background: var(--amber-bg); color: var(--amber); }
.callout.danger { border-color: #f0cdca; background: #fff7f6; color: #81443f; }
.callout.danger .callout-icon { background: var(--red-bg); color: var(--red); }

/* Overview */
.hero { position: relative; display: grid; min-height: 240px; overflow: hidden; grid-template-columns: minmax(0, 1fr) 330px; border-radius: var(--radius-xl); background: linear-gradient(135deg, var(--blue-950) 0%, var(--blue-800) 62%, #2d69ef 100%); color: #fff; box-shadow: 0 18px 42px rgba(29,72,183,.2); }
.hero::before, .hero::after { position: absolute; border-radius: 50%; background: rgba(126,178,255,.16); content: ""; }
.hero::before { top: -130px; right: 120px; width: 330px; height: 330px; }
.hero::after { right: -80px; bottom: -170px; width: 400px; height: 400px; background: rgba(103,221,240,.1); }
.hero-content { position: relative; z-index: 1; padding: 34px 37px; }
.hero .chip { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.11); color: rgba(255,255,255,.9); }
.hero .chip::before { background: #77e2b8; }
.hero h2 { max-width: 650px; margin: 18px 0 10px; font-size: clamp(25px, 3vw, 37px); line-height: 1.25; letter-spacing: -.035em; }
.hero p { max-width: 650px; margin: 0; color: rgba(255,255,255,.68); font-size: 12px; line-height: 1.75; }
.hero .button-row { margin-top: 24px; }
.hero .button-primary { background: #fff; color: var(--blue-900); box-shadow: none; }
.hero .button-secondary { border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1); color: #fff; }
.hero-safety { position: relative; z-index: 1; display: grid; align-content: center; margin: 25px; border: 1px solid rgba(255,255,255,.18); border-radius: 18px; background: rgba(6,27,77,.22); padding: 22px; backdrop-filter: blur(8px); }
.hero-safety-label { color: rgba(255,255,255,.52); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.hero-safety strong { margin: 9px 0 7px; font-size: 15px; }
.hero-safety p { font-size: 10px; }
.safety-flow { display: flex; align-items: center; gap: 6px; margin-top: 17px; }
.safety-step { display: grid; height: 37px; min-width: 52px; flex: 1; place-items: center; border-radius: 9px; background: rgba(255,255,255,.11); color: rgba(255,255,255,.85); font-size: 9px; font-weight: 700; }
.safety-arrow { color: rgba(255,255,255,.38); font-size: 10px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { position: relative; overflow: hidden; min-height: 132px; padding: 19px 20px 17px; }
.metric-head { display: flex; align-items: center; justify-content: space-between; color: var(--ink-600); font-size: 10px; }
.metric-trend { color: var(--green); font-size: 9px; font-weight: 700; }
.metric-value { margin-top: 19px; color: var(--ink-900); font-size: 31px; font-weight: 790; line-height: 1; letter-spacing: -.035em; }
.metric-unit { margin-left: 5px; color: var(--ink-500); font-size: 10px; font-weight: 500; }
.metric-line { position: absolute; right: 0; bottom: 0; left: 0; height: 4px; background: var(--blue-700); }
.metric-card.violet .metric-line { background: #7357d9; }
.metric-card.amber .metric-line { background: #e69918; }
.metric-card.green .metric-line { background: #1aa06d; }
.overview-columns { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: 16px; }
.workflow-card { padding: 5px 24px; }
.workflow-row { display: grid; min-height: 92px; grid-template-columns: 37px minmax(0, 1fr); }
.workflow-rail { display: flex; flex-direction: column; align-items: center; }
.workflow-node { position: relative; z-index: 1; display: grid; width: 28px; height: 28px; margin-top: 20px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: #fff; color: var(--ink-500); font-size: 9px; font-weight: 800; }
.workflow-node.completed { border-color: #1aa06d; background: #1aa06d; color: #fff; }
.workflow-node.waiting { border-color: #e6a432; background: #fff8ea; color: var(--amber); }
.workflow-node.scheduled, .workflow-node.running { border-color: var(--blue-700); background: var(--blue-50); color: var(--blue-700); }
.workflow-connector { width: 1px; min-height: 63px; flex: 1; background: var(--line); }
.workflow-main { min-width: 0; padding: 17px 0 15px 13px; border-bottom: 1px solid #edf0f5; }
.workflow-row:last-child .workflow-main { border-bottom: 0; }
.workflow-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.workflow-title-row strong { font-size: 12px; }
.workflow-description { margin: 5px 0 8px; color: var(--ink-500); font-size: 10px; }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-track { width: 110px; height: 5px; overflow: hidden; border-radius: 999px; background: #edf0f5; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--blue-700); }
.progress-row small { color: var(--ink-500); font-size: 9px; }
.queue-card { padding: 8px 20px; }
.queue-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 11px; align-items: center; min-height: 72px; border-bottom: 1px solid #edf0f5; }
.queue-item:last-child { border-bottom: 0; }
.channel-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--green-bg); color: var(--green); font-size: 10px; font-weight: 780; }
.channel-mark.xiaohongshu { background: var(--red-bg); color: var(--red); }
.channel-mark.channels { background: var(--violet-bg); color: var(--violet); }
.queue-title { overflow: hidden; margin: 0; font-size: 11px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.queue-meta { margin: 5px 0 0; color: var(--ink-500); font-size: 9px; }

/* Tables, sources and tasks */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 13px; }
.toolbar-left, .toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-button { border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-600); padding: 7px 11px; font-size: 10px; font-weight: 680; }
.filter-button.active { border-color: #bfd0ff; background: var(--blue-50); color: var(--blue-700); }
.search-wrap { position: relative; }
.search-wrap input { width: min(260px, 45vw); min-height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 8px 31px; color: var(--ink-900); }
.search-wrap::before { position: absolute; top: 11px; left: 12px; color: var(--ink-400); content: "⌕"; }
.data-card { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: #fafbfc; color: var(--ink-500); padding: 12px 15px; font-size: 9px; font-weight: 750; letter-spacing: .05em; text-align: left; }
.data-table td { border-top: 1px solid #edf0f5; color: var(--ink-700); padding: 15px; font-size: 10px; vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfcfe; }
.cell-title { display: flex; align-items: center; gap: 11px; }
.cell-title-mark { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 10px; background: var(--blue-50); color: var(--blue-700); font-size: 11px; font-weight: 790; }
.cell-title strong, .cell-title small { display: block; }
.cell-title strong { max-width: 330px; overflow: hidden; color: var(--ink-900); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.cell-title small { max-width: 330px; overflow: hidden; margin-top: 4px; color: var(--ink-500); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.switch { position: relative; display: inline-flex; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { position: relative; width: 37px; height: 21px; border-radius: 999px; background: #c8d0dc; transition: background .2s; }
.switch-track::after { position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.15); content: ""; transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--blue-700); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 3px solid rgba(36,87,230,.28); outline-offset: 2px; }
.health-bar { display: flex; align-items: center; gap: 8px; }
.health-track { width: 54px; height: 5px; overflow: hidden; border-radius: 999px; background: #edf0f5; }
.health-fill { height: 100%; border-radius: 999px; background: #1aa06d; }
.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.summary-tile { padding: 16px 17px; }
.summary-tile p { margin: 0; color: var(--ink-500); font-size: 9px; }
.summary-tile strong { display: block; margin-top: 8px; font-size: 24px; letter-spacing: -.03em; }
.summary-tile strong small { margin-left: 4px; color: var(--ink-500); font-size: 9px; font-weight: 500; }
.mobile-card-list { display: none; }
.complaint-table-wrap { overflow-x: auto; }
.complaint-table { min-width: 1080px; }
.complaint-description { max-width: 340px; margin: 9px 0 0; color: var(--ink-700); line-height: 1.6; white-space: normal; }
.complaint-contact { max-width: 180px; overflow-wrap: anywhere; }
.complaint-reference { color: var(--ink-600); font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.complaint-reference a { color: var(--blue-700); font-weight: 680; text-decoration: none; }
.complaint-reference a:hover { text-decoration: underline; }
.complaint-resolution { display: block; margin-top: 7px; color: var(--green); font-size: 9px; line-height: 1.55; white-space: normal; }

/* Review */
.review-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(285px, .62fr); gap: 16px; align-items: start; }
.article-preview { overflow: hidden; }
.article-cover { position: relative; min-height: 180px; overflow: hidden; background: linear-gradient(135deg, #102a6e, #2457e6); color: #fff; padding: 30px; }
.article-cover::after { position: absolute; top: -70px; right: -55px; width: 250px; height: 250px; border-radius: 50%; background: rgba(255,255,255,.09); content: ""; }
.article-cover .chip { border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1); color: #fff; }
.article-cover h2 { position: relative; z-index: 1; max-width: 650px; margin: 18px 0 8px; font-size: 27px; line-height: 1.35; letter-spacing: -.035em; }
.article-cover p { position: relative; z-index: 1; margin: 0; color: rgba(255,255,255,.68); font-size: 11px; }
.article-content { padding: 30px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 24px; border-bottom: 1px solid var(--line); padding-bottom: 19px; color: var(--ink-500); font-size: 10px; }
.article-section { margin: 0 0 25px; }
.article-section h3 { margin: 0 0 11px; color: var(--ink-900); font-size: 16px; }
.article-section p { margin: 0 0 12px; color: var(--ink-700); font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: 13px; line-height: 1.95; }
.source-list { display: grid; gap: 8px; margin-top: 15px; }
.source-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; color: var(--ink-600); font-size: 10px; }
.source-reference-list { display: grid; gap: 9px; margin-top: 15px; }
.source-reference { display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid #d7e3ff; border-radius: 11px; background: #f8faff; color: inherit; padding: 12px 14px; text-decoration: none; transition: border-color .15s, background .15s, transform .12s; }
.source-reference:hover { transform: translateY(-1px); border-color: #abc1f6; background: var(--blue-50); }
.source-reference > span:first-child { min-width: 0; }
.source-reference strong, .source-reference small { display: block; }
.source-reference strong { overflow: hidden; color: var(--ink-900); font-size: 11px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.source-reference small { margin-top: 4px; color: var(--ink-500); font-size: 9px; }
.source-reference-action { flex: 0 0 auto; color: var(--blue-700); font-size: 9px; font-weight: 720; }
.source-institution-summary { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 17px; }
.source-institution-summary h4 { margin: 0; color: var(--ink-700); font-size: 11px; }
.review-panel { position: sticky; top: 106px; padding: 20px; }
.review-panel h2 { margin: 0; font-size: 16px; }
.review-panel > p { margin: 6px 0 18px; color: var(--ink-500); font-size: 10px; line-height: 1.6; }
.check-list { display: grid; gap: 9px; }
.check-item { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 9px; align-items: start; border: 1px solid var(--line); border-radius: 11px; padding: 11px; cursor: pointer; }
.check-item:hover { border-color: #c7d4ed; }
.check-item input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--blue-700); }
.check-item strong { display: block; color: var(--ink-800); font-size: 10px; line-height: 1.45; }
.check-item small { display: block; margin-top: 3px; color: var(--ink-500); font-size: 9px; }
.review-actions { display: grid; gap: 8px; margin-top: 17px; border-top: 1px solid var(--line); padding-top: 17px; }
.review-actions .button { width: 100%; }
.review-footnote { margin-top: 13px; color: var(--ink-500); font-size: 9px; line-height: 1.55; text-align: center; }
.back-button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--blue-700); padding: 0; font-size: 10px; font-weight: 700; }
.article-plain-content p { white-space: pre-wrap; }
.content-editor, .media-workbench { padding: 22px; }
.campaign-brief { padding: 22px; }
.campaign-brief-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.campaign-brief-grid > div { min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; padding: 12px; }
.campaign-brief-grid span, .campaign-note > span { display: block; color: var(--ink-500); font-size: 9px; font-weight: 720; }
.campaign-brief-grid strong { display: block; margin-top: 6px; color: var(--ink-800); font-size: 10px; line-height: 1.55; }
.campaign-note { margin-top: 12px; border-left: 3px solid var(--blue-700); border-radius: 0 10px 10px 0; background: var(--blue-50); padding: 12px 14px; }
.campaign-note p { margin: 6px 0 0; color: var(--ink-700); font-size: 10px; line-height: 1.7; }
.campaign-note ul { margin: 7px 0 0; padding-left: 18px; color: var(--ink-700); font-size: 10px; line-height: 1.7; }
.campaign-validation { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.content-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.content-editor-head h2 { margin: 0; font-size: 16px; }
.content-editor-head p { margin: 6px 0 0; color: var(--ink-500); font-size: 10px; line-height: 1.55; }
.content-editor-grid { grid-template-columns: 1fr; }
.field-wide { grid-column: 1 / -1; }
.field-counter { float: right; color: var(--ink-500); font-size: 10px; font-weight: 650; }
.field-counter.over { color: var(--red); }
.platform-fieldset { margin: 2px 0 0; border: 0; padding: 0; }
.platform-fieldset legend { margin-bottom: 9px; color: var(--ink-700); font-size: 12px; font-weight: 720; }
.platform-fieldset > p { margin: 9px 0 0; color: var(--ink-500); font-size: 9px; line-height: 1.55; }
.platform-choice-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.platform-choice { display: flex; align-items: flex-start; gap: 9px; border: 1px solid var(--line); border-radius: 11px; padding: 11px; cursor: pointer; }
.platform-choice:has(input:checked) { border-color: #bfd0ff; background: var(--blue-50); }
.platform-choice input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--blue-700); }
.platform-choice strong, .platform-choice small { display: block; }
.platform-choice strong { font-size: 10px; }
.platform-choice small { margin-top: 3px; color: var(--ink-500); font-size: 8px; line-height: 1.45; }
.content-editor-actions { display: flex; justify-content: flex-end; margin-top: 17px; border-top: 1px solid var(--line); padding-top: 15px; }
.media-agent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.media-agent-card { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe; padding: 14px; }
.media-agent-head { display: flex; align-items: center; gap: 10px; }
.media-agent-head > div { min-width: 0; flex: 1; }
.media-agent-head h3 { margin: 0; font-size: 12px; }
.media-agent-head p { margin: 3px 0 0; color: var(--ink-500); font-size: 9px; }
.media-agent-icon { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 10px; background: var(--violet-bg); color: var(--violet); font-size: 11px; font-weight: 800; }
.media-preview { position: relative; display: grid; min-height: 230px; overflow: hidden; place-items: center; margin: 13px 0; border: 1px solid var(--line); border-radius: 12px; background: #eef2f8; }
.media-preview img, .media-preview video { display: block; width: 100%; max-height: 380px; object-fit: contain; background: #111827; }
.media-preview-grid { display: block; min-height: 0; padding: 10px; }
.media-asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.media-asset-grid a { position: relative; display: block; overflow: hidden; border: 1px solid #d9e0eb; border-radius: 9px; background: #fff; }
.media-asset-grid a:hover { border-color: var(--blue-700); }
.media-asset-grid img { width: 100%; max-height: none; aspect-ratio: 3 / 4; background: #fff; object-fit: cover; }
.media-asset-grid a > span { position: absolute; top: 6px; left: 6px; display: grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: rgba(7,29,52,.82); color: #fff; font-size: 8px; font-weight: 800; }
.media-placeholder { display: grid; gap: 6px; place-items: center; padding: 24px; color: var(--ink-600); text-align: center; }
.media-placeholder strong { font-size: 11px; }
.media-placeholder span { color: var(--ink-500); font-size: 9px; }
.ai-media-label { position: absolute; right: 9px; bottom: 9px; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; background: rgba(16,32,62,.78); color: #fff; padding: 5px 8px; font-size: 8px; font-weight: 720; backdrop-filter: blur(6px); }
.media-agent-meta { display: grid; gap: 4px; margin-bottom: 11px; color: var(--ink-500); font-size: 9px; line-height: 1.45; }
.media-agent-card .row-actions { justify-content: flex-start; }
.inline-error { margin: 8px 0; border-radius: 9px; background: var(--red-bg); color: var(--red); padding: 8px 10px; font-size: 9px; line-height: 1.5; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .58fr); gap: 16px; align-items: start; }
.settings-card { padding: 22px; }
.settings-card h2 { margin: 0; font-size: 15px; }
.settings-card > p { margin: 6px 0 20px; color: var(--ink-500); font-size: 10px; line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.automation-list, .account-list { display: grid; gap: 9px; }
.automation-item, .account-item { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 13px; }
.automation-item > div, .account-item > div { min-width: 0; flex: 1; }
.automation-item strong, .account-item strong { display: block; font-size: 11px; }
.automation-item p, .account-item p { margin: 4px 0 0; color: var(--ink-500); font-size: 9px; line-height: 1.45; }
.account-logo { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 11px; background: var(--green-bg); color: var(--green); font-size: 11px; font-weight: 800; }
.account-logo.redbook { background: var(--red-bg); color: var(--red); }
.account-logo.channels { background: var(--violet-bg); color: var(--violet); }
.settings-save-bar { position: sticky; z-index: 10; bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #cad8f7; border-radius: 14px; background: rgba(255,255,255,.95); box-shadow: var(--shadow-md); padding: 12px 14px; backdrop-filter: blur(12px); }
.settings-save-bar p { margin: 0; color: var(--ink-600); font-size: 10px; }
.capability-list { display: grid; gap: 10px; }
.capability-item { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; gap: 10px; align-items: center; border-bottom: 1px solid #edf0f5; padding: 4px 0 13px; }
.capability-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.capability-item > i { width: 8px; height: 8px; border-radius: 50%; background: #aeb6c3; }
.capability-item > i.green { background: #1aa06d; }
.capability-item > i.amber { background: #e69918; }
.capability-item strong { display: block; font-size: 10px; }
.capability-item small { display: block; margin-top: 3px; color: var(--ink-500); font-size: 9px; }
.onboarding-steps { display: grid; gap: 7px; margin: 0 0 18px; padding-left: 21px; color: var(--ink-600); font-size: 10px; line-height: 1.55; }
.identity-result { margin-top: 14px; border: 1px solid #c9ddce; border-radius: 12px; background: #f3fbf6; padding: 13px; }
.identity-result > span { display: block; color: var(--green); font-size: 9px; font-weight: 720; }
.identity-result code { display: block; overflow-wrap: anywhere; margin-top: 7px; color: var(--ink-900); font-size: 11px; }
.identity-result p { margin: 8px 0 0; color: var(--ink-600); font-size: 9px; line-height: 1.55; }

/* Dialog and toast */
.modal { width: min(480px, calc(100vw - 30px)); max-height: calc(100vh - 30px); overflow: auto; border: 0; border-radius: 20px; background: transparent; padding: 0; box-shadow: var(--shadow-md); }
.modal::backdrop { background: rgba(13,25,49,.52); backdrop-filter: blur(3px); }
.modal-card { position: relative; margin: 0; background: #fff; padding: 28px; }
.modal-close { position: absolute; top: 14px; right: 14px; display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 50%; background: #f2f4f8; color: var(--ink-600); font-size: 18px; }
.modal-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--blue-50); color: var(--blue-700); font-size: 16px; font-weight: 800; }
.modal-icon.danger { background: var(--red-bg); color: var(--red); }
.modal-icon.warning { background: var(--amber-bg); color: var(--amber); }
.modal h2 { margin: 16px 40px 9px 0; font-size: 20px; }
.modal-body { color: var(--ink-600); font-size: 11px; line-height: 1.7; white-space: pre-line; }
.modal-fields { margin-top: 17px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 23px; }
.receipt-list { display: grid; gap: 8px; margin: 13px 0 0; }
.receipt-row { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.receipt-row span:first-child { color: var(--ink-500); }
.receipt-row span:last-child { overflow-wrap: anywhere; color: var(--ink-800); font-weight: 650; }
.toast-region { position: fixed; z-index: 1000; right: 22px; bottom: 22px; display: grid; width: min(360px, calc(100vw - 44px)); gap: 9px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow-md); padding: 13px 15px; color: var(--ink-700); font-size: 11px; line-height: 1.5; animation: toast-in .22s ease-out; }
.toast::before { display: grid; width: 20px; height: 20px; flex: 0 0 20px; place-items: center; border-radius: 50%; background: var(--green-bg); color: var(--green); content: "✓"; font-size: 10px; font-weight: 800; }
.toast.error::before { background: var(--red-bg); color: var(--red); content: "!"; }
.toast.warning::before { background: var(--amber-bg); color: var(--amber); content: "!"; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* Responsive */
@media (max-width: 1050px) {
  .login-shell { grid-template-columns: 1fr minmax(360px, .8fr); gap: 45px; }
  .login-intro h1 { font-size: 42px; }
  .hero { grid-template-columns: 1fr 280px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-columns, .settings-grid { grid-template-columns: 1fr; }
  .review-panel { position: static; }
  .campaign-brief-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .login-view { padding: 26px 18px; }
  .login-shell { width: min(480px, 100%); grid-template-columns: 1fr; }
  .login-intro { display: none; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 80; left: 0; transform: translateX(-105%); width: 250px; transition: transform .2s ease; box-shadow: var(--shadow-md); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; z-index: 75; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: rgba(13,25,49,.45); }
  .menu-button { display: inline-flex; }
  .sync-state { display: none; }
  .tenant-picker { min-width: 170px; }
  .topbar { min-height: 76px; padding: 12px 18px; }
  .content { padding: 22px 18px 42px; }
  .hero { grid-template-columns: 1fr; }
  .hero-safety { margin: 0 25px 25px; }
  .review-grid { grid-template-columns: 1fr; }
  .media-agent-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-card.desktop-table { display: none; }
  .mobile-card-list { display: grid; gap: 10px; }
  .mobile-data-card { padding: 15px; }
  .mobile-data-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
  .mobile-data-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; }
  .mobile-data-meta span { display: block; color: var(--ink-500); font-size: 9px; }
  .mobile-data-meta strong { display: block; margin-top: 4px; color: var(--ink-800); font-size: 10px; }
  .mobile-data-card .row-actions { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .login-card { padding: 28px 22px 24px; border-radius: 22px; }
  .topbar-actions .button-quiet { display: none; }
  .tenant-picker { min-width: 138px; }
  .tenant-picker span { display: none; }
  .tenant-picker select { max-width: 150px; }
  .page-heading h1 { font-size: 18px; }
  .campaign-brief-grid, .media-asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-content { padding: 28px 24px; }
  .hero-safety { margin: 0 20px 20px; }
  .hero h2 { font-size: 27px; }
  .metrics-grid, .summary-strip { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 115px; padding: 16px; }
  .overview-columns { grid-template-columns: minmax(0, 1fr); }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-right, .search-wrap input { width: 100%; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .article-cover, .article-content { padding: 23px 20px; }
  .article-cover h2 { font-size: 22px; }
  .source-reference { align-items: flex-start; flex-direction: column; }
  .source-reference strong { white-space: normal; }
  .form-grid { grid-template-columns: 1fr; }
  .platform-choice-list { grid-template-columns: 1fr; }
  .content-editor, .media-workbench { padding: 18px; }
  .content-editor-head { flex-direction: column; }
  .media-preview { min-height: 190px; }
  .settings-save-bar { align-items: stretch; flex-direction: column; }
  .settings-save-bar .button { width: 100%; }
  .modal-card { padding: 24px 20px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
