:root {
  --ink: #1b2730;
  --ink-soft: #42515c;
  --muted: #71808a;
  --canvas: #f3f5f4;
  --surface: #ffffff;
  --line: #dce2df;
  --line-soft: #e9edeb;
  --sidebar: #18252e;
  --sidebar-soft: #243640;
  --green: #24705d;
  --green-soft: #e5f2ed;
  --gold: #a96a1f;
  --gold-soft: #fff3df;
  --coral: #a84c41;
  --coral-soft: #fbeae7;
  --blue: #3f6f91;
  --blue-soft: #e8f1f7;
  --red: #a53e3e;
  --red-soft: #fcecec;
  --radius: 8px;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 18px; }
body { min-width: 320px; margin: 0; background: var(--canvas); }
button, input, textarea, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; width: 244px; height: 100vh; flex: 0 0 244px; display: flex; flex-direction: column; padding: 24px 15px 18px; color: #edf3f1; background: var(--sidebar); }
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 0 9px 25px; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 7px; color: #183027; background: #a9dbc9; font-size: 12px; font-weight: 800; }
.brand-lockup strong { display: block; font-size: 14px; }
.brand-lockup span { display: block; margin-top: 3px; color: #91a5ad; font-size: 11px; text-transform: uppercase; }
.workspace-switcher { padding: 0 7px 23px; }
.side-label, .eyebrow { color: #87969f; font-size: 11px; font-weight: 750; text-transform: uppercase; }
.workspace-button { display: flex; width: 100%; min-height: 42px; align-items: center; gap: 8px; margin-top: 8px; padding: 9px; border: 1px solid #38505c; border-radius: 7px; color: #f3f7f5; background: var(--sidebar-soft); text-align: left; cursor: pointer; }
.workspace-button span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-button svg { width: 14px; height: 14px; margin-left: auto; color: #91a5ad; }
.workspace-dot, .status-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #9aa8ae; }
.status-dot.online, .workspace-dot { background: #62c19c; box-shadow: 0 0 0 3px rgba(98, 193, 156, .13); }
.primary-nav { display: grid; gap: 4px; }
.primary-nav { scrollbar-width: none; }
.primary-nav::-webkit-scrollbar { display: none; }
.nav-item { display: flex; min-height: 42px; align-items: center; gap: 10px; padding: 0 11px; border-radius: 7px; color: #a9b8be; font-size: 12px; transition: color .16s ease, background .16s ease; }
.nav-item svg { width: 16px; height: 16px; stroke-width: 1.8; }
.nav-item:hover { color: #fff; background: #21343e; }
.nav-item.active { color: #fff; background: #2a414b; box-shadow: inset 3px 0 0 #76c7aa; }
.nav-count { min-width: 20px; margin-left: auto; color: #a9dbc9; font-size: 11px; font-weight: 750; text-align: right; }
.sidebar-footer { margin-top: auto; padding: 17px 9px 0; border-top: 1px solid #30454f; }
.sidebar-settings-link { margin: 0 -9px 14px; }
.platform-status { display: flex; align-items: center; gap: 8px; color: #bac7cb; font-size: 11px; }
.version { margin-top: 10px; color: #718992; font-size: 11px; }

.main-content { width: min(1480px, calc(100% - 244px)); margin: 0 auto; padding: 28px 38px 56px; }
.main-content > [hidden] { display: none !important; }
.settings-page { margin-top: 0; }
.settings-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.breadcrumb { display: flex; gap: 7px; color: var(--muted); font-size: 11px; }
h1 { margin-top: 7px; color: var(--ink); font-size: 29px; line-height: 1.2; }
h2 { color: var(--ink); font-size: 17px; line-height: 1.3; }
.page-subtitle { margin-top: 6px; color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.live-badge { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid #cae0d8; border-radius: 999px; color: var(--green); background: #f3faf7; font-size: 11px; font-weight: 750; white-space: nowrap; }
.live-badge { min-height: 28px; }
.icon-button { display: grid; width: 35px; height: 35px; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--surface); cursor: pointer; }
.icon-button:hover { color: var(--ink); border-color: #b8c4bf; }
.icon-button svg { width: 16px; height: 16px; }
.avatar { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 50%; color: #fff; background: #40525c; font-size: 12px; font-weight: 750; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-block { min-height: 116px; padding: 15px 16px; border: 1px solid var(--line); border-top: 3px solid #9ba8a2; border-radius: var(--radius); background: var(--surface); }
.stat-block.accent-green { border-top-color: #5bab8f; }
.stat-block.accent-gold { border-top-color: #d09a4b; }
.stat-block.accent-coral { border-top-color: #ca766b; }
.stat-block.accent-blue { border-top-color: #72a0bd; }
.stat-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.stat-label svg { width: 15px; height: 15px; color: #94a19b; }
.stat-value { margin-top: 12px; color: var(--ink); font-size: 27px; font-weight: 780; line-height: 1; }
.stat-note { margin-top: 6px; color: #8a9791; font-size: 11px; }

.section-block { margin-top: 18px; }
.content-grid, .run-grid, .lead-layout, .knowledge-layout { display: grid; gap: 18px; }
.content-grid { grid-template-columns: minmax(0, 1.4fr) minmax(310px, .72fr); }
.run-grid { grid-template-columns: minmax(310px, .72fr) minmax(0, 1.4fr); }
.lead-layout { grid-template-columns: minmax(0, 1.55fr) minmax(330px, .75fr); }
.knowledge-layout { grid-template-columns: minmax(0, 1.45fr) minmax(330px, .75fr); }
.knowledge-layout.knowledge-browse-layout { grid-template-columns: minmax(0, 1fr); }
.knowledge-metric-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.knowledge-metric { min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-top: 3px solid var(--green); border-radius: 7px; background: var(--surface); }
.knowledge-metric-total { border-top-color: var(--green); }
.knowledge-metric-verified { border-top-color: var(--blue); }
.knowledge-metric-platform { border-top-color: var(--coral); }
.knowledge-metric-system { border-top-color: var(--gold); }
.knowledge-metric > span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.knowledge-metric > span svg { width: 15px; height: 15px; }
.knowledge-metric > strong { display: block; margin-top: 8px; color: var(--ink); font-size: 24px; line-height: 1; }
.knowledge-metric > small { display: block; margin-top: 7px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.campaign-panel, .funnel-panel, .timeline-panel, .preview-panel, .interaction-panel { padding: 21px; }
.panel-heading, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-heading { margin-bottom: 18px; }
.panel-heading.compact { margin-bottom: 15px; }
.panel-heading h2, .section-heading h2 { margin-top: 4px; }
.section-heading { align-items: flex-end; margin-bottom: 13px; }
.section-note, .knowledge-summary { color: var(--muted); font-size: 11px; }
.panel-kicker, .review-state, .run-id { padding: 5px 8px; border-radius: 5px; color: #68767e; background: #f0f3f2; font-size: 11px; font-weight: 750; white-space: nowrap; }
.review-state { display: inline-flex; align-items: center; gap: 5px; }
.review-state .active-progress-icon { width: 12px; height: 12px; }
.run-id { max-width: 158px; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 500; }

.task-form, .mini-form { display: grid; gap: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.campaign-task-strip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, .42fr) auto; align-items: center; gap: 14px; margin: -2px 0 17px; padding: 12px; border: 1px solid #8fc9b8; border-left: 4px solid var(--green); border-radius: 6px; background: #f4fbf8; }
.campaign-task-strip[hidden] { display: none; }
.campaign-task-main { display: flex; min-width: 0; align-items: center; gap: 9px; }
.campaign-task-icon { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; color: var(--green); background: var(--green-soft); }
.campaign-task-icon svg { width: 15px; height: 15px; }
.campaign-task-copy { min-width: 0; }
.campaign-task-copy > div { display: flex; min-width: 0; align-items: center; gap: 7px; }
.campaign-task-copy strong { min-width: 0; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.campaign-task-copy > span { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.campaign-task-error { margin-top: 4px; color: var(--muted); font-size: 11px; }
.campaign-task-error[hidden] { display: none; }
.campaign-task-error summary { cursor: pointer; line-height: 1.4; }
.campaign-task-error p { margin: 5px 0 0; color: var(--ink-soft); line-height: 1.5; overflow-wrap: anywhere; }
.campaign-task-error-hint { color: var(--blue) !important; }
.campaign-task-error-hint[hidden], .campaign-task-error-targets[hidden] { display: none; }
.campaign-task-error-targets { display: grid; gap: 3px; margin: 5px 0 0; padding: 0; list-style: none; }
.campaign-task-error-targets li { display: flex; gap: 6px; color: var(--ink-soft); line-height: 1.5; overflow-wrap: anywhere; }
.campaign-task-error-targets strong { flex: none; color: var(--ink); }
#campaign-task-state { flex: 0 0 auto; }
.campaign-task-progress { display: grid; grid-template-columns: minmax(70px, 1fr) auto; align-items: center; gap: 7px; }
.campaign-task-progress-track { height: 5px; overflow: hidden; background: #e8edeb; }
.campaign-task-progress-track span { display: block; width: 0; height: 100%; background: var(--green); transition: width .2s ease; }
.campaign-task-progress strong { min-width: 28px; color: var(--muted); font-size: 11px; text-align: right; }
.campaign-task-actions { display: flex; align-items: center; gap: 5px; }
.task-icon-button { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-soft); background: #fff; cursor: pointer; }
.task-icon-button:hover { color: var(--green); border-color: #9bb9ae; background: #f7fbf9; }
.task-icon-button.task-delete-button:hover { color: var(--red); border-color: #d9a9a9; background: #fff7f7; }
.task-icon-button:disabled { opacity: .5; cursor: wait; }
.task-icon-button[hidden] { display: none; }
.task-icon-button svg { width: 14px; height: 14px; }
.campaign-builder-mode-button { min-height: 36px; flex: 0 0 auto; padding-right: 11px; padding-left: 11px; white-space: nowrap; }
.campaign-builder-mode-button svg { width: 15px; height: 15px; }
.campaign-task-strip[data-view="draft"] { grid-template-columns: minmax(0, 1fr); border-color: #dbc48d; border-left-color: #a97825; background: #fffaf0; }
.campaign-task-strip[data-view="draft"] .campaign-task-icon { color: #8a641f; background: var(--gold-soft); }
.campaign-task-strip[data-view="draft"] .campaign-task-progress,
.campaign-task-strip[data-view="draft"] .campaign-task-actions { display: none; }
.status-chip.status-draft { color: #856121; background: var(--gold-soft); }
.mode-control-group { gap: 7px; }
.mode-segmented { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #f1f4f2; }
.mode-segmented label { position: relative; display: block; width: 100%; min-width: 0; cursor: pointer; }
.mode-segmented input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mode-segmented span { display: flex; width: 100%; min-height: 34px; align-items: center; justify-content: center; padding: 5px 7px; border-radius: 4px; color: #68766f; font-size: 11px; text-align: center; }
.mode-segmented input:checked + span { color: var(--green); background: #fff; box-shadow: 0 1px 3px rgba(32, 52, 45, .12); font-weight: 750; }
.settings-panel { max-width: 980px; padding: 20px; }
.settings-form { display: grid; gap: 14px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.model-selection-grid { grid-template-columns: 1fr; gap: 10px; }
.settings-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 2px; }
.settings-footer .form-hint { margin: 0; }
.settings-setup-fields[hidden], .settings-footer[hidden] { display: none !important; }
.connected-copy { display: flex; min-width: 0; align-items: center; gap: 10px; }
.connected-copy svg { width: 19px; height: 19px; flex: 0 0 19px; }
.connected-copy strong, .connected-copy span { display: block; }
.connected-copy strong { font-size: 11px; }
.connected-copy span { margin-top: 3px; color: #5f8b72; font-size: 11px; }
.disconnect-button { display: inline-flex; min-height: 32px; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid #a8cdb5; border-radius: 5px; color: #2b6b50; background: #fff; cursor: pointer; white-space: nowrap; }
.disconnect-button:hover { border-color: #7daf91; background: #f7fcf8; }
.disconnect-button svg { width: 14px; height: 14px; }
.settings-model-selection { padding-top: 16px; border-top: 1px solid var(--line-soft); }
.model-selection-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.model-selection-heading strong { display: block; color: var(--ink); font-size: 12px; }
.model-selection-heading span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.model-selection-heading svg { width: 16px; height: 16px; color: var(--green); }
.selection-save-status { margin: 10px 0 0; }
.field { display: grid; min-width: 0; gap: 6px; }
.field > span, .control-group legend { color: #4f5f68; font-size: 11px; font-weight: 750; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 6px; outline: none; color: var(--ink); background: #fafbfa; font-size: 12px; transition: border .16s ease, box-shadow .16s ease; }
.field input, .field select { height: 39px; padding: 0 10px; }
.field textarea { min-height: 74px; padding: 9px 10px; resize: vertical; line-height: 1.6; }
.audience-inline-control { min-width: 0; height: 39px; }
.audience-inline-control > input,
.audience-inline-control > select { width: 100%; }
.audience-inline-control > input[hidden],
.audience-inline-control > select[hidden] { display: none; }
.field-state { display: block; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.field-state-healthy, .field-state-preview { color: var(--green); }
.field-state-paused, .field-state-failed { color: var(--red); }
.field-state-untested, .field-state-progress { color: var(--blue); }
.field-state-neutral { color: var(--muted); }
.trend-keyword-field textarea { min-height: 62px; }
.trend-evidence-panel { min-width: 0; margin-top: 2px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.trend-evidence-panel[hidden] { display: none; }
.trend-evidence-heading { display: flex; min-width: 0; align-items: flex-end; justify-content: space-between; gap: 12px; }
.trend-evidence-heading h3 { margin: 4px 0 0; color: var(--ink); font-size: 14px; line-height: 1.35; }
.trend-evidence-time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.trend-evidence-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 12px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.trend-status { display: grid; min-width: 0; gap: 2px; padding: 9px 10px; }
.trend-status + .trend-status { border-left: 1px solid var(--line-soft); }
.trend-status strong { color: var(--ink); font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.trend-status-state strong { font-size: 12px; }
.trend-status small { min-width: 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.trend-status code { color: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.trend-status-created strong { color: var(--green); }
.trend-status-updated strong { color: var(--blue); }
.trend-status-failed strong { color: var(--red); }
.trend-evidence-table-wrap { width: 100%; overflow-x: auto; }
.trend-evidence-table { width: 100%; min-width: 850px; border-collapse: collapse; table-layout: fixed; }
.trend-evidence-table th { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; font-weight: 700; text-align: left; }
.trend-evidence-table td { min-width: 0; padding: 10px 8px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); font-size: 11px; line-height: 1.5; vertical-align: top; overflow-wrap: anywhere; }
.trend-evidence-table tr:last-child td { border-bottom: 0; }
.trend-evidence-table th:nth-child(1), .trend-evidence-table td:nth-child(1) { width: 25%; }
.trend-evidence-table th:nth-child(2), .trend-evidence-table td:nth-child(2) { width: 11%; }
.trend-evidence-table th:nth-child(3), .trend-evidence-table td:nth-child(3) { width: 11%; }
.trend-evidence-table th:nth-child(4), .trend-evidence-table td:nth-child(4) { width: 22%; }
.trend-evidence-table th:nth-child(5), .trend-evidence-table td:nth-child(5) { width: 11%; }
.trend-evidence-table th:nth-child(6), .trend-evidence-table td:nth-child(6) { width: 14%; }
.trend-evidence-table th:nth-child(7), .trend-evidence-table td:nth-child(7) { width: 6%; }
.trend-evidence-table td > strong, .trend-evidence-table td > small { display: block; }
.trend-evidence-table td > strong { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.trend-evidence-table td > small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.trend-evidence-excerpt { display: -webkit-box; margin: 6px 0 0; overflow: hidden; color: var(--ink-soft); font-size: 11px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.trend-keyword-value { color: var(--green); font-weight: 700; }
.trend-interactions { font-variant-numeric: tabular-nums; }
.trend-detail-chip { display: inline-flex; min-height: 24px; align-items: center; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.trend-detail-complete { color: var(--green); background: var(--green-soft); }
.trend-detail-card { color: var(--muted); background: var(--surface-subtle); }
.trend-source-link { color: var(--green); font-weight: 700; text-decoration: none; }
.trend-source-link:hover { text-decoration: underline; }
.trend-evidence-failures { margin-top: 10px; padding: 10px 0 0 11px; border-left: 3px solid var(--red); }
.trend-evidence-failures[hidden] { display: none; }
.trend-evidence-failures > strong { color: var(--red); font-size: 11px; }
.trend-evidence-failures ul { display: grid; gap: 5px; margin: 7px 0 0; padding: 0; list-style: none; }
.trend-evidence-failures li { display: grid; grid-template-columns: minmax(110px, .35fr) minmax(0, 1fr); gap: 10px; color: var(--ink-soft); font-size: 11px; }
.trend-evidence-failures li span { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.trend-evidence-failures li small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.trend-evidence-overlay[hidden] { display: none !important; }
.trend-evidence-overlay { position: fixed; z-index: 118; inset: 0; display: grid; align-items: center; padding: 24px; background: rgb(22 31 27 / 42%); }
.trend-evidence-dialog { width: min(1180px, 100%); max-height: calc(100vh - 48px); margin: 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 20px 54px rgb(22 31 27 / 22%); }
.trend-evidence-dialog-heading { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px 12px 22px; border-bottom: 1px solid var(--line-soft); }
.trend-evidence-dialog-heading h2 { margin: 3px 0 0; color: var(--ink); font-size: 18px; }
.trend-evidence-dialog .trend-evidence-panel { max-height: calc(100vh - 118px); margin: 0; padding: 18px 22px 24px; overflow: auto; border-top: 0; }
.trend-evidence-task-meta { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
body.trend-evidence-open { overflow: hidden; }
.campaign-account-matrix-bar { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 10px 8px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-subtle); }
.campaign-account-matrix-copy { display: grid; min-width: 0; gap: 3px; }
.campaign-account-matrix-copy span { color: var(--muted); font-size: 11px; font-weight: 750; }
.campaign-account-matrix-copy strong { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.campaign-account-matrix-bar .secondary-button { flex: 0 0 auto; }
.campaign-account-config-section { display: grid; gap: 13px; padding: 14px 0 2px; border-top: 1px solid var(--line-soft); }
.campaign-account-config-section[data-empty="true"] { opacity: .58; }
.campaign-account-config-heading { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 14px; }
.campaign-account-config-heading h3, .campaign-execution-settings-heading h3 { margin-top: 3px; color: var(--ink); font-size: 14px; }
.campaign-account-config-actions { display: flex; align-items: center; gap: 5px; }
.campaign-execution-settings { padding-top: 15px; border-top: 1px solid var(--line); }
.campaign-execution-settings[open] { display: grid; gap: 12px; }
.campaign-execution-settings-heading { min-width: 0; }
.campaign-schedule-preview { margin: 0; overflow: visible; text-overflow: clip; white-space: normal; }
.campaign-channel-control { margin: 0; }
.campaign-account-matrix-overlay { position: fixed; z-index: 122; inset: 0; display: grid; place-items: center; padding: 24px; background: rgb(22 31 27 / 42%); }
.campaign-account-matrix-overlay[hidden] { display: none; }
.campaign-account-matrix-dialog { display: flex; width: min(900px, 100%); max-height: min(760px, calc(100vh - 48px)); flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 20px 54px rgb(22 31 27 / 22%); }
.campaign-account-matrix-dialog-heading { display: flex; min-height: 74px; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.campaign-account-matrix-dialog-heading h2 { margin-top: 3px; color: var(--ink); font-size: 18px; }
.campaign-account-matrix-dialog-heading p { margin-top: 5px; color: var(--muted); font-size: 11px; }
.campaign-account-option { position: relative; display: grid; min-width: 0; min-height: 64px; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 8px; padding: 9px 31px 9px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-soft); background: var(--surface); text-align: left; cursor: pointer; }
.campaign-account-option:hover { border-color: #a8cabc; background: var(--surface-subtle); }
.campaign-account-option.is-selected { border-color: #69a58f; background: var(--green-soft); }
.campaign-account-option.is-active { box-shadow: inset 3px 0 0 var(--green); }
.campaign-account-option:disabled { cursor: default; opacity: .46; }
.campaign-account-option-avatar { position: relative; display: grid; width: 32px; height: 32px; place-items: center; overflow: hidden; border: 1px solid rgb(54 137 101 / 16%); border-radius: 6px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 800; }
.campaign-account-option-avatar img { position: absolute; width: 100%; height: 100%; inset: 0; object-fit: cover; }
.campaign-account-option-copy { display: grid; min-width: 0; gap: 3px; }
.campaign-account-option strong, .campaign-account-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campaign-account-option strong { font-size: 11px; }
.campaign-account-option small { color: var(--muted); font-size: 11px; }
.campaign-account-option-toggle { position: absolute; top: 7px; right: 7px; display: grid; width: 26px; height: 26px; place-items: center; padding: 0; border: 0; border-radius: 5px; color: var(--green); background: transparent; cursor: pointer; }
.campaign-account-option-toggle:hover:not(:disabled) { background: rgb(54 137 101 / 10%); }
.campaign-account-option-toggle:disabled { cursor: default; opacity: .38; }
.campaign-account-option-toggle svg { width: 15px; height: 15px; }
.campaign-current-account-field { align-items: start; }
.campaign-account-current-option, .campaign-account-current-option:hover { width: min(210px, 100%); border-color: #69a58f; color: var(--ink-soft); background: var(--green-soft); box-shadow: inset 3px 0 0 var(--green); cursor: default; }
.campaign-account-current-option .campaign-account-option-toggle { pointer-events: none; }
.campaign-account-empty { display: grid; min-height: 88px; grid-column: 1 / -1; place-items: center; border: 1px dashed var(--line); border-radius: 7px; color: var(--muted); font-size: 12px; }
.campaign-account-matrix-heading-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.campaign-account-matrix-body { display: grid; gap: 16px; padding: 16px 18px; overflow-y: auto; }
.campaign-account-matrix-group > header { display: flex; min-height: 26px; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.campaign-account-matrix-group h3 { color: var(--ink); font-size: 13px; }
.campaign-account-matrix-group small { color: var(--muted); font-size: 11px; }
.campaign-account-matrix-group small[hidden] { display: none; }
.campaign-account-selected-list { display: grid; gap: 6px; }
.campaign-account-selected-item { display: grid; min-height: 56px; grid-template-columns: 20px 22px 32px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 9px; border: 1px solid #69a58f; border-radius: 7px; background: var(--green-soft); }
.campaign-account-selected-item.is-dragging { opacity: .4; }
.campaign-account-drag-handle { display: grid; place-items: center; color: var(--muted); cursor: grab; }
.campaign-account-drag-handle svg { width: 15px; height: 15px; }
.campaign-account-seq { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-size: 11px; font-weight: 800; }
.campaign-account-selected-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 2px; }
.campaign-account-selected-actions button { display: grid; width: 26px; height: 26px; place-items: center; border: 0; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; }
.campaign-account-selected-actions button:hover:not(:disabled) { color: var(--green); background: rgb(54 137 101 / 12%); }
.campaign-account-selected-actions button:disabled { opacity: .3; cursor: default; }
.campaign-account-selected-actions svg { width: 14px; height: 14px; }
.campaign-account-available-list { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.campaign-account-available-item { display: grid; min-height: 56px; grid-template-columns: 32px minmax(0, 1fr) 24px; align-items: center; gap: 9px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-soft); background: var(--surface); text-align: left; cursor: pointer; }
.campaign-account-available-item:hover { border-color: #a8cabc; background: var(--surface-subtle); }
.campaign-account-add-icon { display: grid; place-items: center; color: var(--green); }
.campaign-account-add-icon svg { width: 15px; height: 15px; }
.campaign-account-matrix-hint { margin-right: auto; color: var(--muted); font-size: 11px; }
.campaign-account-matrix-actions { display: flex; min-height: 64px; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
body.campaign-account-matrix-open { overflow: hidden; }
.campaign-task-list { display: grid; max-height: 230px; margin: 0 -20px 16px; overflow-y: auto; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.campaign-task-list[hidden] { display: none; }
.campaign-task-list-item { display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; min-height: 58px; align-items: center; gap: 9px; padding: 9px 20px; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); background: var(--surface); text-align: left; cursor: pointer; }
.campaign-task-list-item:last-child { border-bottom: 0; }
.campaign-task-list-item:hover { background: var(--surface-subtle); }
.campaign-task-list-item.active { box-shadow: inset 3px 0 0 var(--green); background: var(--green-soft); }
.campaign-task-list-copy { display: grid; min-width: 0; gap: 3px; }
.campaign-task-list-copy strong, .campaign-task-list-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campaign-task-list-copy strong { font-size: 12px; }
.campaign-task-list-copy small { color: var(--muted); font-size: 11px; }
.campaign-task-list-item > svg { width: 15px; height: 15px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; white-space: nowrap; }
.campaign-target-matrix { min-width: 0; margin-bottom: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.campaign-target-matrix[hidden] { display: none; }
.campaign-target-matrix-heading { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 16px; }
.campaign-target-matrix-heading h2 { margin: 3px 0 0; color: var(--ink); font-size: 16px; }
.campaign-target-matrix-actions { display: flex; align-items: center; gap: 5px; }
.campaign-task-operation-state { display: flex; min-height: 42px; align-items: center; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--line-soft); color: var(--blue); background: var(--blue-soft); }
.campaign-task-operation-state[hidden] { display: none; }
.campaign-task-operation-state > svg { width: 16px; height: 16px; flex: 0 0 16px; }
.campaign-task-operation-state > span { min-width: 0; }
.campaign-task-operation-state strong, .campaign-task-operation-state small { display: block; letter-spacing: 0; }
.campaign-task-operation-state strong { font-size: 11px; }
.campaign-task-operation-state small { margin-top: 2px; color: var(--ink-soft); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.campaign-task-operation-state[data-state="submitting"], .campaign-task-operation-state[data-state="queued"], .campaign-task-operation-state[data-state="running"] { color: var(--gold); background: var(--gold-soft); }
.campaign-task-operation-state[data-state="submitting"] > svg, .campaign-task-operation-state[data-state="queued"] > svg, .campaign-task-operation-state[data-state="running"] > svg { animation: auth-spin .8s linear infinite; }
.campaign-task-operation-state[data-state="accepted"] { color: var(--blue); background: var(--blue-soft); }
.campaign-task-operation-state[data-state="accepted"] > svg { animation: auth-spin .8s linear infinite; }
.campaign-task-operation-state[data-state="failed"] { color: var(--red); background: var(--red-soft); }
.status-chip.status-operation, .review-state.status-operation { color: #735317; border-color: #ddbd73; background: var(--gold-soft); }
.status-chip.status-operation::before { background: var(--gold); }
.timeline-operation-state { display: grid; grid-template-columns: 18px max-content minmax(0, 1fr); align-items: center; gap: 8px; min-height: 38px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); color: #735317; background: var(--gold-soft); }
.timeline-operation-state > svg { width: 15px; height: 15px; animation: auth-spin .8s linear infinite; }
.timeline-operation-state strong { font-size: 11px; letter-spacing: 0; }
.timeline-operation-state span { min-width: 0; color: var(--ink-soft); font-size: 11px; letter-spacing: 0; overflow-wrap: anywhere; }
.timeline-operation-state[data-state="failed"] { color: var(--red); background: var(--red-soft); }
.timeline-operation-state[data-state="failed"] > svg { animation: none; }
.campaign-target-table-wrap { width: 100%; overflow-x: auto; border-top: 1px solid var(--line-soft); }
.campaign-target-table { width: 100%; min-width: 840px; border-collapse: collapse; table-layout: fixed; }
.campaign-target-table th { padding: 9px 12px; color: var(--muted); background: var(--surface-subtle); font-size: 11px; font-weight: 700; text-align: left; }
.campaign-target-table td { min-width: 0; padding: 11px 12px; border-top: 1px solid var(--line-soft); color: var(--ink-soft); font-size: 11px; vertical-align: middle; }
.campaign-target-table tbody tr:first-child td { border-top: 0; }
.campaign-target-table th:nth-child(1) { width: 17%; }
.campaign-target-table th:nth-child(2) { width: 17%; }
.campaign-target-table th:nth-child(3) { width: 29%; }
.campaign-target-table th:nth-child(4) { width: 15%; }
.campaign-target-table th:nth-child(5) { width: 13%; }
.campaign-target-table th:nth-child(6) { width: 9%; }
.campaign-target-row.active { box-shadow: inset 3px 0 0 var(--green); background: var(--green-soft); }
.campaign-target-row > td:first-child strong, .campaign-target-row > td:first-child small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campaign-target-row > td:first-child strong { color: var(--ink); font-size: 12px; }
.campaign-target-row > td:first-child small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.campaign-target-title { display: block; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.campaign-target-row .icon-button { margin-left: auto; }
.control-group { display: grid; gap: 8px; }
.check-grid { display: grid; gap: 7px; }
.channel-checks { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.format-checks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.check-option { position: relative; min-width: 0; cursor: pointer; }
.check-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.check-option span { display: flex; min-height: 36px; align-items: center; justify-content: center; padding: 6px 7px; border: 1px solid var(--line); border-radius: 6px; color: #65737b; background: #fafbfa; font-size: 11px; text-align: center; transition: color .14s ease, border .14s ease, background .14s ease; }
.check-option input:checked + span { color: var(--green); border-color: #8ebdac; background: var(--green-soft); font-weight: 750; }
.video-resolution-field { padding-top: 2px; }
.video-resolution-field select:disabled { color: #7b8781; border-color: #d8dfdc; background: #f1f4f3; cursor: not-allowed; }
.field-state.video-resolution-state { overflow: visible; text-overflow: clip; white-space: normal; }
.video-resolution-field[data-state="ready"] .video-resolution-state { color: var(--green); }
.video-resolution-field[data-state="error"] .video-resolution-state { color: var(--red); }
.video-resolution-field[data-state="missing"] .video-resolution-state { color: #856121; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 2px; }
.form-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.campaign-point-quote { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 52px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: #f7faf8; }
.campaign-point-quote > svg { width: 18px; height: 18px; color: var(--green); }
.campaign-point-quote div { display: grid; gap: 2px; min-width: 0; }
.campaign-point-quote strong { font-size: 13px; }
.campaign-point-quote span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.campaign-point-quote[data-state="insufficient"] { border-color: #dfbfc1; background: var(--red-soft); }
.campaign-point-quote[data-state="insufficient"] > svg, .campaign-point-quote[data-state="error"] > svg { color: var(--red); }
.form-hint { display: inline-flex; align-items: center; gap: 7px; color: #829089; font-size: 11px; line-height: 1.5; }
.form-hint svg { width: 14px; height: 14px; flex: 0 0 14px; }
#topic-research-result[data-state="collecting"] { color: var(--blue); }
#topic-research-result[data-state="succeeded"] { color: var(--green); }
#topic-research-result[data-state="warning"] { color: var(--gold); }
#topic-research-result[data-state="failed"] { color: var(--red); }
#topic-research-result[data-state="collecting"] svg { animation: auth-spin 1s linear infinite; }
.primary-button, .secondary-button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border-radius: 6px; font-size: 11px; font-weight: 750; cursor: pointer; transition: background .14s ease, border .14s ease, transform .14s ease; }
.primary-button { border: 1px solid var(--green); color: #fff; background: var(--green); }
.primary-button:hover { background: #195d4d; transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line); color: #53626a; background: #fff; }
.secondary-button:hover { color: var(--ink); border-color: #b8c4bf; }
.primary-button:disabled, .secondary-button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.primary-button svg, .secondary-button svg { width: 14px; height: 14px; }
.full-button { width: 100%; }
.compact-button { min-height: 34px; }
.field-label-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; }
.field-label-row > span { min-width: 0; }
.ai-idea-button { min-height: 30px; padding: 0 10px; font-size: 11px; }
.ai-idea-button svg { width: 13px; height: 13px; }
#brief::placeholder { color: #7f8c87; opacity: 1; }
#brief:focus::placeholder { opacity: 0; }
.campaign-counter-field { position: relative; min-width: 0; }
.campaign-counter-field > input, .campaign-counter-field > textarea { width: 100%; padding-right: 52px; }
.campaign-counter-field > textarea { padding-bottom: 22px; }
.field-counter { position: absolute; right: 9px; bottom: 7px; min-width: 31px; padding: 2px 4px; border-radius: 3px; color: #0f745c; background: rgb(255 255 255 / 90%); font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 700; line-height: 1.1; text-align: right; letter-spacing: 0; pointer-events: none; }
.field-counter.is-limit, .field-counter.is-over { color: #d60000; font-weight: 800; }

.funnel-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.funnel-list li { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; min-height: 61px; }
.funnel-list li:not(:last-child)::after { position: absolute; top: 26px; bottom: 3px; left: 14px; width: 1px; background: #d9e5e0; content: ""; }
.funnel-index { position: relative; z-index: 1; display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid #b7d7ca; border-radius: 50%; color: var(--green); background: #f3faf7; font-size: 11px; font-weight: 800; }
.funnel-list strong { display: block; padding-top: 2px; color: var(--ink); font-size: 12px; }
.funnel-list p { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.funnel-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.funnel-footer div { padding: 10px; border-radius: 6px; background: #f6f8f7; }
.funnel-footer span, .funnel-footer strong { display: block; }
.funnel-footer span { color: var(--muted); font-size: 11px; }
.funnel-footer strong { margin-top: 4px; color: var(--ink-soft); font-size: 11px; }

.timeline { min-height: 350px; padding: 4px 2px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 9px; min-height: 54px; }
.timeline-item:not(:last-child)::after { position: absolute; top: 20px; bottom: 0; left: 8px; width: 1px; background: #dfe6e3; content: ""; }
.timeline-marker { position: relative; z-index: 1; display: grid; width: 17px; height: 17px; margin-top: 1px; place-items: center; border: 2px solid #c4ceca; border-radius: 50%; color: #fff; background: #fff; }
.timeline-marker svg { width: 9px; height: 9px; }
.timeline-item.succeeded .timeline-marker { border-color: #68b396; background: #68b396; }
.timeline-item.failed .timeline-marker { border-color: #c85d5d; background: #c85d5d; }
.timeline-item.running .timeline-marker { border-color: #cc9146; color: #cc9146; background: #fffaf1; }
.timeline-item.progress-warning .timeline-marker { border-color: #cc9146; color: #cc9146; background: #fffaf1; }
.timeline-item.progress-warning .timeline-status { color: #9a681f; }
.timeline-item.progress-waiting .timeline-marker { border-color: #93a39c; color: #718079; background: #f4f6f5; }
.timeline-item.progress-waiting .timeline-status { color: #718079; }
.timeline-item.active-progress .timeline-marker svg, .active-progress-icon { animation: auth-spin .8s linear infinite; }
.timeline-title { color: var(--ink); font-size: 11px; font-weight: 750; }
.timeline-capability { margin-top: 3px; color: #8a9690; font-size: 11px; word-break: break-all; }
.timeline-status { color: #8e9a94; font-size: 11px; }
.timeline-timing { color: #6f7c76; font-variant-numeric: tabular-nums; opacity: 0.75; }
.timeline-item.succeeded .timeline-status { color: var(--green); }
.timeline-item.succeeded.progress-warning .timeline-status { color: #9a681f; }
.timeline-item.succeeded.progress-waiting .timeline-status { color: #718079; }
.timeline-item.succeeded.progress-failed .timeline-marker { border-color: #c85d5d; color: #fff; background: #c85d5d; }
.timeline-item.succeeded.progress-failed .timeline-status { color: var(--red); }
.timeline-item.failed .timeline-status { color: var(--red); }
.timeline-diagnostics { grid-column: 2 / -1; margin: 2px 0 12px; border: 1px solid #efd7d7; border-radius: 5px; background: #fffafa; }
.timeline-diagnostics > summary { display: flex; min-height: 30px; align-items: center; gap: 6px; padding: 0 9px; color: #a33f3f; cursor: pointer; font-size: 11px; font-weight: 700; list-style: none; }
.timeline-diagnostics > summary::-webkit-details-marker { display: none; }
.timeline-diagnostics > summary::before { content: "▸"; font-size: 11px; }
.timeline-diagnostics[open] > summary::before { content: "▾"; }
.timeline-diagnostics-body { display: grid; gap: 6px; padding: 0 9px 9px; color: #5f6864; font-size: 11px; }
.timeline-diagnostics-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 8px; line-height: 1.45; }
.timeline-diagnostics-row strong { color: #8a3c3c; font-weight: 700; }
.timeline-diagnostics-code { color: #47524e; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; word-break: break-word; }
.timeline-diagnostics-copy { justify-self: start; min-height: 26px; padding: 0 8px; font-size: 11px; }
.empty-state { display: flex; min-height: 250px; align-items: center; justify-content: center; gap: 8px; padding: 18px; color: #929f99; font-size: 11px; text-align: center; }
.empty-state svg { width: 18px; height: 18px; color: #abb6b1; }
.compact-empty { min-height: 180px; }
.knowledge-archived-empty { flex-direction: column; gap: 6px; }
.knowledge-archived-empty span { font-size: 12px; color: #5f6b66; }
.knowledge-archived-empty strong { color: #2f6f4f; font-size: 15px; }
.knowledge-archived-empty small { max-width: 380px; line-height: 1.6; color: #929f99; }

.preview-panel { display: flex; min-height: 430px; flex-direction: column; }
.preview-content { flex: 1; min-height: 315px; }
.draft-preview { display: grid; gap: 13px; }
.preview-headline { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.preview-headline > div { min-width: 0; }
.preview-headline span { color: var(--muted); font-size: 11px; }
.preview-headline strong { display: block; margin-top: 5px; color: var(--ink); font-size: 16px; line-height: 1.45; }
.quality-pass, .quality-warning, .quality-fail { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 5px; font-size: 11px; font-weight: 750; }
.quality-pass { color: var(--green) !important; background: var(--green-soft); }
.quality-warning { color: #8a641f !important; background: var(--gold-soft); }
.quality-fail { color: var(--red) !important; background: var(--red-soft); }
.quality-neutral { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 5px; color: #718079 !important; background: #f1f4f3; font-size: 11px; font-weight: 750; }
.quality-pass svg, .quality-warning svg, .quality-fail svg, .quality-neutral svg { width: 13px; height: 13px; }
.grounding-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 7px 10px; padding: 11px 12px; border-left: 3px solid #a9b4af; color: var(--ink-soft); background: #f7f8f7; font-size: 11px; }
.grounding-row > svg { width: 15px; height: 15px; }
.grounding-row > div:nth-child(2) { min-width: 0; }
.grounding-row strong, .grounding-row > div:nth-child(2) span { display: block; }
.grounding-row strong { color: var(--ink); font-size: 12px; }
.grounding-row > div:nth-child(2) span { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.grounding-row > small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.grounding-row.grounding-grounded { border-left-color: #71af97; color: #34715b; background: #f1f8f5; }
.grounding-row.grounding-missing_verified_evidence { border-left-color: #cf7777; color: #9e3e3e; background: #fff4f4; }
.grounding-actions { display: flex; grid-column: 2 / -1; flex-wrap: wrap; gap: 6px; }
.grounding-actions .icon-text-button { min-height: 30px; background: rgb(255 255 255 / 72%); }
.quality-report { padding: 13px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.quality-report-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quality-report-heading > div { min-width: 0; }
.quality-report-heading span { display: block; color: var(--muted); font-size: 11px; }
.quality-report-heading strong { display: block; margin-top: 4px; color: var(--ink); font-size: 12px; }
.quality-pending-state { display: flex; align-items: flex-start; gap: 10px; margin-top: 13px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 6px; color: var(--muted); background: var(--surface-subtle); }
.quality-pending-state > svg { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 1px; }
.quality-pending-state div { min-width: 0; }
.quality-pending-state strong, .quality-pending-state span { display: block; overflow-wrap: anywhere; }
.quality-pending-state strong { color: var(--ink-soft); font-size: 11px; }
.quality-pending-state span { margin-top: 4px; font-size: 11px; line-height: 1.5; }
.quality-dimension-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 13px; }
.quality-waiver { margin-top: 12px; padding: 11px 12px; border: 1px solid #e2c98f; border-radius: 6px; background: #fffaf0; }
.quality-waiver-heading { display: flex; align-items: flex-start; gap: 9px; }
.quality-waiver-heading > svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; color: #a97c25; }
.quality-waiver-heading div { min-width: 0; }
.quality-waiver-heading strong { display: block; color: #7d5a11; font-size: 11px; }
.quality-waiver-heading span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.quality-waiver-list { margin: 9px 0 0; padding-left: 17px; color: var(--ink-soft); font-size: 11px; line-height: 1.7; }
.quality-waiver-list li { overflow-wrap: anywhere; }
.quality-waiver-ack { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: #7d5a11; font-size: 11px; cursor: pointer; }
.quality-waiver-ack input { width: 13px; height: 13px; accent-color: #a97c25; cursor: pointer; }
.media-quality-pipeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.media-quality-pipeline-item { min-width: 0; padding: 8px 9px; border: 1px solid var(--line-soft); border-radius: 5px; background: var(--surface-subtle); }
.media-quality-pipeline-item > span, .media-quality-pipeline-item > strong, .media-quality-pipeline-item > small { display: block; overflow-wrap: anywhere; }
.media-quality-pipeline-item > span { color: var(--muted); font-size: 11px; }
.media-quality-pipeline-item > strong { margin-top: 4px; font-size: 11px; }
.media-quality-pipeline-item > small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.quality-pipeline-passed { color: var(--green); }
.quality-pipeline-warning, .quality-pipeline-checking, .quality-pipeline-repairing, .quality-pipeline-generating, .quality-pipeline-submitting { color: var(--gold); }
.quality-pipeline-blocked { color: var(--red); }
.quality-dimension { min-width: 0; padding: 11px; border: 1px solid var(--line-soft); border-radius: 6px; background: #fafbfa; }
.quality-dimension-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.quality-dimension-heading > div { min-width: 0; }
.quality-dimension-heading span { display: block; color: var(--muted); font-size: 11px; }
.quality-dimension-heading strong { margin-top: 5px; }
.quality-dimension-heading small { max-width: 56%; color: var(--muted); font-size: 11px; line-height: 1.45; text-align: right; }
.quality-dimension .quality-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quality-dimension .quality-issue-list { overflow: visible; }
.media-review-panel { display: grid; gap: 11px; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.media-review-heading, .media-review-heading > div, .media-review-heading > div > div { min-width: 0; }
.media-review-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.media-review-heading > div { display: flex; align-items: flex-start; gap: 8px; }
.media-review-heading svg { width: 16px; height: 16px; flex: 0 0 16px; color: #856121; }
.media-review-heading strong, .media-review-heading span { display: block; }
.media-review-heading strong { color: var(--ink); font-size: 12px; }
.media-review-heading span { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.media-review-heading code { color: var(--muted); font-size: 11px; white-space: nowrap; }
.media-review-check-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.media-review-check { display: grid; min-width: 0; grid-template-columns: 16px minmax(0, 1fr); align-items: start; gap: 7px; padding: 9px; border: 1px solid #e2cea5; border-radius: 5px; color: #856121; background: #fff9ee; cursor: pointer; }
.media-review-check input { width: 14px; height: 14px; margin: 1px 0 0; accent-color: var(--green); }
.media-review-check span, .media-review-check strong, .media-review-check small { display: block; min-width: 0; }
.media-review-check strong { color: var(--ink-soft); font-size: 11px; line-height: 1.4; }
.media-review-check small { margin-top: 3px; color: #856121; font-size: 11px; }
.media-review-check:has(input:checked) { border-color: #9fc8ba; color: var(--green); background: #f1f8f5; }
.media-review-check:has(input:checked) small { color: var(--green); }
.media-review-check-readonly { cursor: default; }
.media-review-check-readonly > span:first-child { display: grid; width: 16px; height: 16px; place-items: center; }
.media-review-check-readonly > span:first-child svg { width: 14px; height: 14px; }
.media-review-check-readonly.media-review-check-passed { border-color: #9fc8ba; color: var(--green); background: #f1f8f5; }
.media-review-check-readonly.media-review-check-passed small { color: var(--green); }
.media-review-fields { display: grid; grid-template-columns: minmax(150px, .35fr) minmax(0, 1fr); align-items: start; gap: 9px; }
.media-review-fields input[readonly] { color: var(--ink-soft); background: #f1f4f3; }
.media-review-note { min-width: 0; }
.media-review-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.media-review-actions > span { margin-right: auto; color: var(--muted); font-size: 11px; }
.icon-text-button { display: inline-flex; min-height: 34px; flex: 0 0 auto; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-soft); background: #fff; font-size: 11px; font-weight: 750; cursor: pointer; }
.icon-text-button:hover { border-color: #9bb9ae; color: var(--green); background: #f7fbf9; }
.icon-text-button:disabled { opacity: .55; cursor: wait; }
.icon-text-button svg { width: 13px; height: 13px; }
.quality-check-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 11px; }
.quality-check { display: flex; min-width: 0; align-items: center; gap: 5px; padding: 6px 7px; border-left: 2px solid #ccd4d0; color: #6e7a75; background: #f7f8f7; font-size: 11px; line-height: 1.35; }
.quality-check svg { width: 11px; height: 11px; flex: 0 0 auto; }
.quality-check-passed { border-color: #71af97; color: #34715b; background: #f1f8f5; }
.quality-check-warning { border-color: #d2aa62; color: #856121; background: #fff9ee; }
.quality-check-blocked { border-color: #cf7777; color: #9e3e3e; background: #fff4f4; }
.quality-check-not_applicable { border-color: #ccd4d0; color: #718079; background: #f1f4f3; }
.quality-issue-list { display: grid; gap: 0; margin: 11px 0 0; padding: 0; list-style: none; }
.quality-issue { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 9px; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.quality-issue > span { align-self: start; padding: 3px 5px; border-radius: 4px; color: #856121; background: var(--gold-soft); font-size: 11px; font-weight: 750; text-align: center; }
.quality-issue-high > span { color: var(--red); background: var(--red-soft); }
.quality-issue strong { color: var(--ink); font-size: 11px; line-height: 1.45; }
.quality-issue p { margin-top: 3px; color: #7d8984; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.quality-issue small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.quality-clear { display: flex; align-items: center; gap: 7px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line-soft); color: var(--green); font-size: 11px; }
.quality-clear svg { width: 14px; height: 14px; }
.quality-clear-warning { color: #856121; }
.quality-clear-blocked { color: var(--red); }
.quality-clear-not_applicable { color: #718079; }
.quality-more { padding-top: 8px; color: var(--muted); font-size: 11px; text-align: right; }
.image-pack-preview { display: grid; min-width: 0; gap: 10px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.image-pack-heading, .image-pack-heading > div { display: flex; align-items: center; gap: 7px; }
.image-pack-heading { justify-content: space-between; }
.image-pack-heading svg { width: 14px; height: 14px; color: var(--green); }
.image-pack-heading strong { color: var(--ink); font-size: 11px; }
.image-pack-heading span { color: var(--muted); font-size: 11px; }
.image-preview-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.image-preview-page { position: relative; min-width: 0; margin: 0; }
.image-preview-open { position: relative; display: block; width: 100%; padding: 0; overflow: hidden; border: 0; border-radius: 6px; background: #f4f6f5; cursor: zoom-in; }
.image-preview-open img { display: block; width: 100%; aspect-ratio: 1242 / 1660; border: 1px solid var(--line-soft); border-radius: 6px; object-fit: cover; background: #f4f6f5; transition: transform .16s ease; }
.image-media-state { position: absolute; inset: 0 0 23px; display: none; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-soft); border-radius: 6px; color: var(--muted); background: #f4f6f5; font-size: 11px; pointer-events: none; }
.image-media-state svg { width: 14px; height: 14px; animation: spin .9s linear infinite; }
.image-preview-page[data-media-state="loading"] .image-media-state { display: flex; }
.image-preview-page[data-media-state="error"] .image-media-state { display: flex; color: var(--red); background: var(--red-soft); }
.image-preview-page[data-media-state="error"] .image-media-state svg { animation: none; }
.image-preview-page[data-media-state="error"] .image-media-state span { font-size: 0; }
.image-preview-page[data-media-state="error"] .image-media-state span::after { content: "图片加载失败"; font-size: 11px; }
.image-preview-open > span { position: absolute; right: 7px; bottom: 7px; display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid rgb(255 255 255 / 58%); border-radius: 6px; color: #fff; background: rgb(22 31 27 / 68%); opacity: 0; transition: opacity .16s ease; }
.image-preview-open > span svg { width: 14px; height: 14px; }
.image-preview-open:hover img { transform: scale(1.015); }
.image-preview-open:hover > span, .image-preview-open:focus-visible > span { opacity: 1; }
.image-preview-page figcaption { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; align-items: center; padding: 5px 1px 0; }
.image-preview-page figcaption span { color: var(--green); font-size: 11px; font-weight: 750; white-space: nowrap; }
.image-preview-page figcaption strong { overflow: hidden; color: var(--ink-soft); font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.variant-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.variant-item { min-width: 0; padding: 11px; border: 1px solid var(--line-soft); border-radius: 6px; background: #fafbfa; }
.variant-item > div { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.variant-item small { color: var(--muted); font-size: 11px; }
.variant-item strong { display: block; margin-top: 8px; color: var(--ink); font-size: 11px; line-height: 1.5; }
.variant-item p { display: -webkit-box; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.source-badge, .channel-mini, .scope-badge, .priority-badge, .status-chip { display: inline-flex; align-items: center; border-radius: 4px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.source-badge { padding: 3px 5px; color: var(--blue); background: var(--blue-soft); }
.video-plan { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 11px; border: 1px solid #ead9bf; border-radius: 6px; background: #fffaf2; }
.video-plan > div { display: flex; align-items: center; gap: 7px; color: #805722; }
.video-plan svg { width: 14px; height: 14px; }
.video-plan strong { font-size: 11px; }
.video-plan span { color: #8c7555; font-size: 11px; }
.video-output-section { display: grid; min-width: 0; gap: 10px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.video-pack-heading, .video-pack-heading > div { display: flex; align-items: center; gap: 7px; }
.video-pack-heading { justify-content: space-between; }
.video-pack-heading svg { width: 14px; height: 14px; color: var(--green); }
.video-pack-heading strong { color: var(--ink); font-size: 11px; }
.video-pack-heading span { color: var(--muted); font-size: 11px; }
.video-output { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); align-items: center; gap: 15px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.video-player-shell { position: relative; width: min(100%, 320px); aspect-ratio: 9 / 16; background: #111815; }
.video-player { display: block; width: min(100%, 320px); aspect-ratio: 9 / 16; border: 0; border-radius: 0; object-fit: contain; background: #111815; }
.video-media-state { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 7px; padding: 18px; color: #e7ece9; background: rgb(17 24 21 / 88%); font-size: 11px; text-align: center; }
.video-media-state > svg { width: 17px; height: 17px; flex: 0 0 auto; }
.video-media-state button { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 5px 8px; border: 1px solid rgb(255 255 255 / 30%); border-radius: 5px; color: #fff; background: transparent; cursor: pointer; }
.video-media-state button svg { width: 13px; height: 13px; }
.video-output[data-media-state="loading"] .video-media-loading { display: flex; }
.video-output[data-media-state="loading"] .video-media-loading svg { animation: spin .9s linear infinite; }
.video-output[data-media-state="error"] .video-media-error, .video-output[data-media-state="stalled"] .video-media-error { display: flex; flex-direction: column; }
.media-empty-state { display: flex; min-height: 120px; align-items: center; justify-content: center; gap: 8px; border: 1px dashed var(--line); color: var(--muted); background: #fafbfa; font-size: 11px; }
.media-empty-state svg { width: 18px; height: 18px; }
.video-player:fullscreen { width: min(56.25vh, 100vw); height: min(177.78vw, 100vh); max-width: 100vw; max-height: 100vh; aspect-ratio: 9 / 16; margin: auto; object-fit: contain; background: #111815; }
.video-player:-webkit-full-screen { width: min(56.25vh, 100vw); height: min(177.78vw, 100vh); max-width: 100vw; max-height: 100vh; aspect-ratio: 9 / 16; margin: auto; object-fit: contain; background: #111815; }
.video-output-meta { min-width: 0; }
.video-output-meta span, .video-output-meta small { display: block; color: var(--muted); font-size: 11px; }
.video-output-meta strong { display: block; margin: 6px 0; color: var(--ink); font-size: 13px; }
.video-output-shortfall { display: flex; align-items: center; gap: 7px; padding: 9px 10px; border-left: 3px solid #d2aa62; color: #856121; background: #fff9ee; font-size: 11px; line-height: 1.45; }
.video-output-shortfall svg { width: 14px; height: 14px; flex: 0 0 auto; }
.distribution-list { display: flex; flex-wrap: wrap; gap: 6px; }
.distribution-list span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 5px; color: #5f6d74; background: #f0f3f2; font-size: 11px; }
.distribution-list svg { width: 12px; height: 12px; }
.published-note-link { color: var(--green); font-weight: 700; text-decoration: none; }
.published-note-link:hover { text-decoration: underline; }
.preview-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line-soft); }
.preview-actions[hidden] { display: none; }
.review-state.status-queued, .review-state.status-running, .review-state.status-waiting_approval { color: var(--gold); background: var(--gold-soft); }
.review-state.status-scheduled { color: var(--blue); background: var(--blue-soft); }
.review-state.status-succeeded { color: var(--green); background: var(--green-soft); }

.channel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.channel-card { padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.channel-card-top { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.channel-logo { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 7px; color: #fff; background: #40525c; font-size: 13px; font-weight: 800; }
.channel-xiaohongshu { background: #b94a48; }
.channel-douyin { background: #24353d; }
.channel-wechat_video { background: #3b8c66; }
.channel-kuaishou { background: #c9702d; }
.channel-bilibili { background: #4b8dab; }
.channel-weibo { background: #b85e36; }
.channel-card strong, .channel-card span { display: block; }
.channel-card strong { color: var(--ink); font-size: 12px; }
.channel-card-top > div:nth-child(2) span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.connector-state { display: inline-flex !important; align-items: center; gap: 5px; color: var(--green); font-size: 11px; font-weight: 750; white-space: nowrap; }
.connector-state .status-dot { width: 6px; height: 6px; flex-basis: 6px; }
.channel-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; }
.channel-card-bottom span { display: inline-flex; align-items: center; gap: 5px; }
.channel-card-bottom svg { width: 12px; height: 12px; }
.section-heading-actions { display: flex; align-items: center; gap: 10px; }
.channel-account-layout { display: grid; grid-template-columns: minmax(270px, .72fr) minmax(0, 1.28fr); gap: 14px; margin-top: 14px; }
.channel-account-list-panel, .channel-account-editor-panel { min-width: 0; padding: 18px; }
.channel-account-capacity { display: flex; min-height: 38px; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line-soft); color: var(--ink-muted); font-size: 12px; }
.channel-account-capacity[data-capacity-state="full"] { color: #8f5f16; font-weight: 750; }
.channel-account-capacity[data-capacity-state="over"] { color: var(--red); font-weight: 750; }
.channel-account-select-all { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.channel-account-select-all input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); cursor: pointer; }
.channel-account-select-all input:disabled { cursor: not-allowed; opacity: .5; }
.channel-account-list { max-height: 632px; overflow-y: auto; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.channel-account-list .empty-inline { border: 0; border-radius: 0; }
.channel-account-row-shell { display: grid; grid-template-columns: 34px minmax(0, 1fr) 38px; align-items: stretch; border-bottom: 1px solid var(--line-soft); background: #fff; }
.channel-account-row-shell:last-child { border-bottom: 0; }
.channel-account-row-shell:hover { background: #fafbfa; }
.channel-account-row-shell.active { background: #f0f8f5; box-shadow: inset 3px 0 0 #62a98f; }
.channel-account-row-shell.batch-selected { background: #f4faf7; }
.channel-account-select { display: grid; min-width: 34px; place-items: center; cursor: pointer; }
.channel-account-select input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); cursor: pointer; }
.channel-account-select input:disabled { cursor: not-allowed; opacity: .5; }
.channel-account-row { display: grid; width: 100%; grid-template-columns: 36px minmax(0, 1fr) auto 14px; align-items: center; gap: 9px; min-height: 66px; padding: 9px 6px 9px 8px; border: 0; color: var(--ink-soft); background: transparent; text-align: left; cursor: pointer; }
.channel-account-row:hover, .channel-account-row.active { background: transparent; }
.channel-account-delete-button { align-self: center; display: inline-grid; width: 32px; height: 32px; place-items: center; border: 1px solid transparent; border-radius: 6px; color: #9a6767; background: transparent; cursor: pointer; }
.channel-account-delete-button:hover { border-color: #efcaca; color: var(--red); background: var(--red-soft); }
.channel-account-delete-button:disabled { opacity: .4; cursor: not-allowed; }
.channel-account-delete-button svg { width: 15px; height: 15px; }
.channel-account-delete-button[aria-busy="true"] svg { animation: auth-spin .8s linear infinite; }
.channel-account-row-mark { position: relative; display: grid; width: 36px; height: 36px; overflow: hidden; place-items: center; border-radius: 6px; color: #fff; background: #b94a48; font-size: 11px; font-style: normal; font-weight: 800; }
.channel-account-pending-shell { background: #f7fbff; }
.channel-account-pending-shell.active { background: #eef7ff; box-shadow: inset 3px 0 0 #5b91bd; }
.channel-account-pending-mark { color: var(--blue); background: var(--blue-soft); }
.channel-account-pending-mark svg { width: 18px; height: 18px; }
.channel-account-pending-spinner { align-self: center; display: grid; width: 32px; height: 32px; place-items: center; color: var(--blue); }
.channel-account-pending-spinner svg { width: 16px; height: 16px; animation: auth-spin .8s linear infinite; }
.channel-account-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.channel-account-row-copy { min-width: 0; }
.channel-account-row-copy > span { display: flex; min-width: 0; align-items: center; gap: 5px; }
.channel-account-row-copy strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.publish-account-badge { flex: 0 0 auto; padding: 2px 4px; color: var(--green); background: var(--green-soft); font-size: 11px; font-style: normal; font-weight: 750; }
.channel-account-row-copy small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.channel-account-row-copy > .channel-account-capability-mini-list { display: flex; flex-wrap: wrap; gap: 3px 5px; margin-top: 6px; }
.channel-capability-mini { display: inline-flex; min-width: 30px; align-items: center; gap: 3px; color: #75817b; font-size: 11px; line-height: 15px; white-space: nowrap; }
.channel-capability-mini > i { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #a8b0ac; }
.channel-capability-mini.channel-capability-available { color: #28705c; }
.channel-capability-mini.channel-capability-available > i { background: #399b79; }
.channel-capability-mini.channel-capability-unavailable { color: #a34b48; }
.channel-capability-mini.channel-capability-unavailable > i { background: #cc6661; }
.channel-capability-mini.channel-capability-unknown { color: #7d7160; }
.channel-capability-mini.channel-capability-unknown > i { background: #b19a77; }
.channel-capability-mini.channel-capability-stale { color: #8f5f16; }
.channel-capability-mini.channel-capability-stale > i { background: #c38a32; }
.channel-capability-mini.channel-capability-refreshing { color: #28705c; }
.channel-capability-mini.channel-capability-refreshing > i { background: #399b79; }
.channel-capability-mini.channel-capability-not_configured { color: #96a09a; }
.channel-capability-mini.channel-capability-not_configured > i { background: #c3ccc6; }
.channel-account-row > svg { width: 14px; height: 14px; color: #9aa6a0; }
.account-state-badge { display: inline-flex; min-height: 22px; flex: 0 0 auto; align-items: center; padding: 0 6px; border-radius: 4px; color: #69766f; background: #eef1f0; font-size: 11px; font-weight: 750; white-space: nowrap; }
.account-state-healthy { color: var(--green); background: var(--green-soft); }
.account-state-failed { color: var(--red); background: var(--red-soft); }
.account-state-warning { color: #8f5f16; background: #fff4dc; }
.account-state-untested, .account-state-progress { color: var(--blue); background: var(--blue-soft); }
.account-state-neutral { color: #69766f; background: #eef1f0; }
.channel-account-health-alert[data-status="refreshing"] { border-color: #b8ddcc; color: #246b55; background: #effaf5; }
.channel-account-health-alert[data-status="degraded"], .channel-account-health-alert[data-status="stale"] { border-color: #ecd19e; color: #71511d; background: #fff9ec; }
.channel-account-health-alert[data-refreshing="true"] .channel-account-health-icon svg { animation: channel-account-health-spin 1.2s linear infinite; }
.channel-account-detail-health-meta { min-height: 16px; margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 16px; }
.channel-account-detail-health-meta[data-state="degraded"], .channel-account-detail-health-meta[data-state="stale"] { color: #8f5f16; }
@keyframes channel-account-health-spin { to { transform: rotate(360deg); } }
.account-editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.account-editor-heading h2 { margin-top: 4px; }
.account-editor-actions { display: flex; align-items: center; gap: 5px; }

.lead-table-panel, .knowledge-list-panel, .run-list-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; min-width: 640px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
.data-table th { color: #77847e; background: #f7f8f7; font-size: 11px; font-weight: 750; }
.data-table td { color: var(--ink-soft); font-size: 11px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td strong, .data-table td small { display: block; }
.data-table td strong { color: var(--ink); font-size: 11px; }
.data-table td small { max-width: 150px; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.contact-value { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.priority-badge { min-width: 22px; justify-content: center; padding: 4px 5px; }
.priority-hot { color: var(--coral); background: var(--coral-soft); }
.priority-warm { color: var(--gold); background: var(--gold-soft); }
.priority-cold { color: var(--blue); background: var(--blue-soft); }
.table-select { max-width: 86px; height: 30px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-soft); background: #fff; font-size: 11px; }
.table-empty { padding: 35px !important; color: #94a09a !important; font-size: 11px !important; text-align: center !important; }
.operational-state { margin: 0 14px 12px; padding: 9px 11px; border: 1px solid var(--line-soft); border-radius: 6px; color: var(--muted); background: var(--surface-subtle); font-size: 12px; line-height: 1.45; }
.operational-state[hidden] { display: none; }
.operational-state[data-state="error"] { color: var(--red); border-color: #efcaca; background: var(--red-soft); }
.operational-state[data-state="forbidden"] { color: var(--gold); border-color: #e2cea5; background: var(--gold-soft); }
.operational-state[data-state="loading"] { color: var(--blue); border-color: #c9dce9; background: var(--blue-soft); }
.interaction-sync-status { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.interaction-sync-status[data-state="error"] { color: var(--red); }
.interaction-sync-status[data-state="success"] { color: var(--green); }
.is-permission-disabled { cursor: not-allowed !important; opacity: .55; }
.consent-row { display: flex; align-items: flex-start; gap: 7px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.consent-row input { margin: 1px 0 0; accent-color: var(--green); }
.reply-result { padding: 11px; border: 1px solid #cde1d9; border-radius: 6px; color: #3f5c53; background: #f2faf7; }
.reply-result[hidden] { display: none; }
.reply-result > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.reply-result span { color: #6f857d; font-size: 11px; }
.reply-result strong { font-size: 11px; }
.reply-result p { margin-top: 7px; font-size: 11px; line-height: 1.6; }
.interaction-queue-panel { margin-top: 18px; overflow: hidden; }
.interaction-queue-meta { color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.45; }
.interaction-queue-actions { display: flex; align-items: center; gap: 12px; }
.lead-context-bar { display: flex; min-height: 38px; align-items: center; justify-content: space-between; gap: 12px; margin: -8px 0 14px; padding: 8px 11px; border: 1px solid var(--line-soft); border-radius: 7px; background: var(--surface-subtle); }
.realtime-view-status { color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.realtime-view-status[data-state="error"] { color: var(--red); }
.realtime-view-status[data-state="ready"] { color: var(--green); }
.interaction-table { min-width: 820px; }
.interaction-message { display: -webkit-box; max-width: 230px; overflow: hidden; color: var(--ink); line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.interaction-reply { display: -webkit-box; max-width: 250px; overflow: hidden; color: var(--ink-soft); line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.interaction-delivery-list, .interaction-delivery-status-list { display: grid; gap: 9px; min-width: 220px; }
.interaction-delivery-action { min-width: 0; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.interaction-delivery-action:first-child { padding-top: 0; }
.interaction-delivery-action:last-child { padding-bottom: 0; border-bottom: 0; }
.interaction-delivery-heading { display: flex; min-height: 20px; align-items: center; flex-wrap: wrap; gap: 6px; }
.interaction-delivery-heading > strong { color: var(--ink); font-size: 11px; }
.interaction-delivery-heading .interaction-status { margin-left: auto; font-size: 11px; }
.interaction-delivery-trigger { color: var(--muted); font-size: 11px; }
.interaction-delivery-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.interaction-delivery-status > strong { color: var(--ink-soft); font-size: 11px; }
.interaction-delivery-status .interaction-status { font-size: 11px; }
.interaction-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.interaction-actions .secondary-button, .interaction-actions .primary-button { min-height: 32px; padding: 0 9px; font-size: 12px; }
.interaction-status { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.interaction-status.status-pending_approval, .interaction-status.status-draft { color: var(--gold); }
.interaction-status.status-sent { color: var(--green); }
.interaction-status.status-blocked, .interaction-status.status-rejected { color: var(--red); }
.interaction-status.status-approved { color: var(--blue); }
.interaction-handoff { display: block; margin-top: 4px; color: var(--coral); font-size: 11px; }
.interaction-queue-footer { display: flex; justify-content: center; padding: 12px 14px 2px; }
.interaction-queue-footer .secondary-button[hidden] { display: none; }
.interaction-policy-form { display: grid; gap: 11px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.interaction-policy-heading { display: flex; min-width: 0; align-items: center; gap: 7px; }
.interaction-policy-heading svg { width: 16px; height: 16px; color: var(--green); }
.interaction-policy-heading strong { color: var(--ink); font-size: 13px; }
.interaction-policy-heading span { margin-left: auto; color: var(--muted); font-size: 11px; }
.interaction-policy-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.interaction-reply-form { display: grid; grid-template-columns: minmax(150px, 1fr) 32px; align-items: end; gap: 6px; }
.interaction-reply-form textarea { min-width: 0; min-height: 72px; resize: vertical; }
.interaction-reply-form .task-icon-button { width: 32px; height: 32px; }

.filter-bar { display: flex; gap: 5px; padding: 11px 12px; border-bottom: 1px solid var(--line-soft); overflow-x: auto; }
.filter-button { min-height: 30px; padding: 0 10px; border: 1px solid transparent; border-radius: 5px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.filter-button:hover { background: #f3f5f4; }
.filter-button.active { color: var(--green); border-color: #bdd7cd; background: var(--green-soft); }
.knowledge-search { display: flex; min-width: 168px; height: 30px; align-items: center; gap: 6px; margin-left: auto; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.knowledge-search svg { width: 14px; height: 14px; flex: 0 0 14px; color: var(--muted); }
.knowledge-search input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.knowledge-list { max-height: 482px; overflow-y: auto; }
.knowledge-browse-layout .knowledge-list { height: clamp(520px, calc(100vh - 310px), 760px); max-height: none; }
.knowledge-list-footer { display: flex; justify-content: center; padding: 10px 12px; border-top: 1px solid var(--line-soft); }
.knowledge-list-footer .secondary-button[hidden] { display: none; }
.knowledge-error-state { gap: 8px; padding: 42px 18px; }
.knowledge-error-state small { max-width: 560px; color: var(--muted); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.knowledge-error-state .secondary-button { margin-top: 4px; }
.knowledge-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; padding: 13px; border-bottom: 1px solid var(--line-soft); }
.knowledge-row:last-child { border-bottom: 0; }
.knowledge-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 6px; color: var(--green); background: var(--green-soft); }
.knowledge-icon svg { width: 15px; height: 15px; }
.knowledge-main { min-width: 0; }
.knowledge-title { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.knowledge-title strong { color: var(--ink); font-size: 11px; }
.scope-badge, .channel-mini { padding: 3px 5px; }
.scope-platform { color: var(--blue); background: var(--blue-soft); }
.scope-system { color: var(--gold); background: var(--gold-soft); }
.scope-brand { color: var(--coral); background: var(--coral-soft); }
.channel-mini { color: #6e7479; background: #eef1f0; }
.knowledge-main p { display: -webkit-box; margin-top: 6px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.knowledge-meta { display: flex; gap: 8px; margin-top: 6px; color: #909b96; font-size: 11px; }
.review-warning { color: var(--gold); }
.knowledge-status { padding-top: 2px; color: var(--green); font-size: 11px; font-weight: 750; white-space: nowrap; }
.knowledge-status.status-draft { color: var(--gold); }
.knowledge-row-actions { display: flex; min-width: 86px; align-items: flex-end; flex-direction: column; gap: 9px; }
.knowledge-view-button { min-height: 32px; gap: 6px; padding: 0 10px; font-size: 12px; }
.knowledge-view-button svg { width: 15px; height: 15px; }
.knowledge-detail-view { display: grid; gap: 18px; }
.knowledge-detail-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.knowledge-detail-badges .knowledge-status { padding: 3px 7px; border-radius: 5px; background: var(--green-soft); }
.knowledge-detail-badges .knowledge-status.status-draft { background: var(--gold-soft); }
.knowledge-detail-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-subtle); }
.knowledge-detail-meta > div { min-width: 0; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.knowledge-detail-meta > div:not(:nth-child(3n + 1)) { border-left: 1px solid var(--line-soft); }
.knowledge-detail-meta > div:nth-last-child(-n + 3) { border-bottom: 0; }
.knowledge-detail-meta dt { color: var(--muted); font-size: 11px; }
.knowledge-detail-meta dd { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--ink); font-size: 13px; line-height: 1.5; }
.knowledge-detail-meta code { color: var(--ink-soft); font-size: 11px; }
.knowledge-detail-body { min-width: 0; }
.knowledge-detail-body h3 { margin: 0 0 9px; color: var(--ink); font-size: 14px; }
.knowledge-detail-body > div { min-height: 180px; padding: 16px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-soft); background: #fff; font-size: 14px; line-height: 1.85; overflow-wrap: anywhere; white-space: pre-wrap; }
.knowledge-detail-tags { display: grid; gap: 8px; }
.knowledge-detail-tags > strong { color: var(--ink); font-size: 12px; }
.knowledge-detail-tags > div { display: flex; flex-wrap: wrap; gap: 6px; }
.knowledge-detail-tags span { padding: 4px 7px; border-radius: 5px; color: var(--ink-soft); background: var(--surface-subtle); font-size: 11px; }

.provider-video-panel { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.draft-editor { margin-top: 12px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.draft-editor > summary { display: flex; min-height: 44px; align-items: center; gap: 8px; color: var(--ink); cursor: pointer; list-style: none; }
.draft-editor > summary::-webkit-details-marker { display: none; }
.draft-editor > summary svg { width: 16px; height: 16px; color: var(--green); }
.draft-editor > summary span { font-size: 13px; font-weight: 750; }
.draft-editor > summary small { margin-left: auto; color: var(--muted); font-size: 11px; }
.draft-editor form { display: grid; gap: 10px; padding: 0 0 14px; }
.draft-editor textarea { resize: vertical; }
.draft-editor-actions { display: flex; justify-content: flex-end; }
.provider-video-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.provider-video-heading > div { display: flex; min-width: 0; align-items: center; gap: 8px; }
.provider-video-heading svg { width: 17px; height: 17px; color: var(--green); }
.provider-video-heading strong { color: var(--ink); font-size: 14px; }
.provider-video-heading span { color: var(--muted); font-size: 12px; }
.provider-video-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 9px; }
.provider-video-form .field { min-width: 0; }
.provider-video-remake { border-top: 1px solid var(--line-soft); }
.provider-video-remake > summary { display: flex; min-height: 42px; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 750; cursor: pointer; list-style: none; }
.provider-video-remake > summary::-webkit-details-marker { display: none; }
.provider-video-remake > summary svg { width: 15px; height: 15px; color: var(--green); }
.provider-video-remake > summary svg:last-child { margin-left: auto; transition: transform .16s ease; }
.provider-video-remake[open] > summary svg:last-child { transform: rotate(180deg); }
.provider-video-form-advanced { grid-template-columns: minmax(180px, 1fr) minmax(120px, .45fr) minmax(100px, .35fr) auto; padding: 0 0 12px; }
.video-caption-attachment { margin-top: 12px; }
.provider-video-task { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 12px; border-left: 3px solid var(--green); background: var(--surface-subtle); }
.provider-video-task[data-feedback-tone="warning"] { border-left-color: var(--gold); background: var(--warning-soft); }
.provider-video-task[data-feedback-tone="waiting"] { border-left-color: var(--line-strong); }
.provider-video-task[data-status="failed"], .provider-video-task[data-status="submission_unknown"], .provider-video-task[data-status="cancel_unknown"] { border-left-color: var(--red); }
.provider-video-task > div { min-width: 0; }
.provider-video-task strong, .provider-video-task span { display: block; }
.provider-video-task strong { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 13px; }
.provider-video-task strong .active-progress-icon { width: 15px; height: 15px; flex: 0 0 15px; color: var(--gold); }
.provider-video-task span { margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.scene-quality-audit { display: grid; min-width: 0; gap: 9px; padding: 11px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.scene-quality-audit-heading, .scene-quality-audit-heading > div, .scene-quality-audit-heading > div > div { min-width: 0; }
.scene-quality-audit-heading > div { display: flex; align-items: flex-start; gap: 8px; }
.scene-quality-audit-heading svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--green); }
.scene-quality-audit-heading strong, .scene-quality-audit-heading span { display: block; }
.scene-quality-audit-heading strong { color: var(--ink); font-size: 11px; }
.scene-quality-audit-heading span { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.scene-quality-audit-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.scene-quality-audit-item { position: relative; min-width: 0; padding: 9px 10px; border-left: 3px solid #a9b4af; background: #f7f8f7; }
.scene-quality-audit-item[data-scene-audit-status="passed"] { border-left-color: #71af97; background: #f1f8f5; }
.scene-quality-audit-item[data-scene-audit-status="blocked"] { border-left-color: #cf7777; background: #fff4f4; }
.scene-quality-audit-item[data-scene-audit-status="running"] { border-left-color: #d2aa62; background: #fff9ee; }
.scene-quality-audit-item-heading { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; }
.scene-quality-audit-item-heading > strong { overflow-wrap: anywhere; color: var(--ink); font-size: 11px; }
.scene-quality-audit-item-heading > span { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 750; }
.scene-quality-audit-item-heading > span svg { width: 11px; height: 11px; }
.scene-quality-audit-item[data-scene-audit-status="passed"] .scene-quality-audit-item-heading > span { color: var(--green); }
.scene-quality-audit-item[data-scene-audit-status="blocked"] .scene-quality-audit-item-heading > span { color: var(--red); }
.scene-quality-audit-item[data-scene-audit-status="running"] .scene-quality-audit-item-heading > span { color: #856121; }
.scene-quality-audit-item[data-scene-audit-status="running"] .scene-quality-audit-item-heading > span svg { animation: auth-spin .8s linear infinite; }
.scene-quality-audit-item ul { display: grid; gap: 5px; margin: 8px 0 0; padding: 0; list-style: none; }
.scene-quality-audit-item li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 6px; padding-top: 5px; border-top: 1px solid rgb(158 62 62 / 14%); }
.scene-quality-audit-item li span { padding: 2px 4px; color: var(--red); background: rgb(255 255 255 / 70%); font-size: 11px; font-weight: 750; white-space: nowrap; }
.scene-quality-audit-item li strong { color: var(--ink-soft); font-size: 11px; font-weight: 650; line-height: 1.45; overflow-wrap: anywhere; }
.scene-quality-audit-item p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.scene-quality-audit-item code { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; text-align: right; }
.scene-targeted-retry { display: grid; min-width: 0; grid-template-columns: 16px minmax(0, 1fr); align-items: center; gap: 8px; padding: 8px 10px; border-left: 3px solid #d2aa62; color: #856121; background: #fff9ee; }
.scene-targeted-retry[data-targeted-retry-status="succeeded"] { border-left-color: #71af97; color: var(--green); background: #f1f8f5; }
.scene-targeted-retry[data-targeted-retry-status="exhausted"], .scene-targeted-retry[data-targeted-retry-status="failed"] { border-left-color: #cf7777; color: var(--red); background: #fff4f4; }
.scene-targeted-retry > svg { width: 14px; height: 14px; }
.scene-targeted-retry[data-targeted-retry-status="queued"] > svg, .scene-targeted-retry[data-targeted-retry-status="running"] > svg { animation: auth-spin .8s linear infinite; }
.scene-targeted-retry strong, .scene-targeted-retry span { display: block; }
.scene-targeted-retry strong { color: inherit; font-size: 11px; }
.scene-targeted-retry span { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.video-output-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.run-row { display: grid; width: 100%; grid-template-columns: 9px minmax(220px, 1.3fr) minmax(90px, .5fr) 72px 84px 16px; align-items: center; gap: 10px; min-height: 57px; padding: 8px 13px; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); background: #fff; text-align: left; cursor: pointer; }
.run-row:last-child { border-bottom: 0; }
.run-row:hover { background: #fafbfa; }
.run-row.is-selected, .run-row[aria-current="true"] { box-shadow: inset 3px 0 0 var(--green); background: var(--green-soft); }
.run-row[aria-busy="true"] { cursor: wait; }
.run-row-campaign { background: #fbfdfc; }
.run-row-campaign .run-workflow { color: var(--green); }
.run-state-dot { width: 7px; height: 7px; border-radius: 50%; background: #a9b4af; }
.run-state-dot.state-succeeded { background: #5eae91; }
.run-state-dot.state-waiting_approval { background: #cc9146; }
.run-state-dot.state-failed { background: #c85d5d; }
.run-row > .run-state-loader { width: 12px; height: 12px; justify-self: center; color: #cc9146; animation: auth-spin .8s linear infinite; }
.run-copy { min-width: 0; }
.run-copy strong, .run-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-copy strong { color: var(--ink); font-size: 11px; }
.run-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.run-workflow, .run-row time { min-width: 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.status-chip { width: max-content; padding: 4px 6px; color: #66746d; background: #eef1f0; }
.status-chip.status-queued, .status-chip.status-running { color: var(--gold); background: var(--gold-soft); }
.status-chip.status-scheduled, .status-chip.status-paused { color: var(--blue); background: var(--blue-soft); }
.status-chip.status-succeeded { color: var(--green); background: var(--green-soft); }
.status-chip.status-waiting_approval { color: var(--gold); background: var(--gold-soft); }
.status-chip.status-failed, .status-chip.status-dead_letter, .status-chip.status-rejected { color: var(--red); background: var(--red-soft); }
.run-row > svg { width: 14px; height: 14px; color: #9ca7a2; }
.text-link { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: 11px; font-weight: 750; }
.text-link svg { width: 12px; height: 12px; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: 360px; padding: 11px 14px; border: 1px solid #c8ded5; border-radius: 6px; color: #235b4c; background: #f1faf6; box-shadow: 0 10px 28px rgba(24, 37, 46, .15); font-size: 11px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.toast[data-tone="error"] { color: var(--red); border-color: #e6c4c4; background: #fff4f4; }
.toast[data-tone="danger"] { color: var(--red); border-color: #e6c4c4; background: #fff4f4; }
.toast.visible { opacity: 1; transform: translateY(0); }
.campaign-create-progress-overlay[hidden] { display: none !important; }
.campaign-create-progress-overlay { position: fixed; z-index: 124; inset: 0; display: grid; padding: 20px; place-items: center; background: rgb(22 31 27 / 48%); }
.campaign-create-progress-dialog { width: min(100%, 460px); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 22px 60px rgb(22 31 27 / 26%); }
.campaign-create-progress-heading { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--line-soft); }
.campaign-create-progress-heading h2 { margin-top: 3px; color: var(--ink); font-size: 18px; }
.campaign-create-progress-content { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: start; gap: 14px; padding: 22px 20px 24px; }
.campaign-create-progress-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 8px; color: var(--green); background: var(--green-soft); }
.campaign-create-progress-icon svg { width: 22px; height: 22px; }
.campaign-create-progress-overlay[data-state="creating"] .campaign-create-progress-icon svg { animation: auth-spin .8s linear infinite; }
.campaign-create-progress-overlay[data-state="succeeded"] .campaign-create-progress-icon { color: var(--green); background: var(--green-soft); }
.campaign-create-progress-overlay[data-state="failed"] .campaign-create-progress-icon { color: var(--red); background: var(--red-soft); }
.campaign-create-progress-copy { min-width: 0; }
.campaign-create-progress-copy strong { display: block; color: var(--ink); font-size: 15px; line-height: 22px; }
.campaign-create-progress-copy p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 19px; overflow-wrap: anywhere; }
.campaign-create-progress-track { height: 4px; margin-top: 16px; overflow: hidden; border-radius: 2px; background: #e7eeeb; }
.campaign-create-progress-track span { display: block; width: 38%; height: 100%; border-radius: inherit; background: var(--green); transition: width .22s ease; }
.campaign-create-progress-overlay[data-state="succeeded"] .campaign-create-progress-track span { width: 100%; }
.campaign-create-progress-overlay[data-state="failed"] .campaign-create-progress-track span { width: 100%; background: var(--red); }
body.campaign-create-progress-open { overflow: hidden; }
.campaign-idea-progress-overlay[hidden] { display: none !important; }
.campaign-idea-progress-overlay { position: fixed; z-index: 125; inset: 0; display: grid; padding: 20px; place-items: center; background: rgb(22 31 27 / 48%); }
.campaign-idea-progress-dialog { width: min(100%, 460px); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 22px 60px rgb(22 31 27 / 26%); }
.campaign-idea-progress-heading { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--line-soft); }
.campaign-idea-progress-heading h2 { margin-top: 3px; color: var(--ink); font-size: 18px; }
.campaign-idea-progress-content { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: start; gap: 14px; padding: 22px 20px 24px; }
.campaign-idea-progress-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 8px; color: var(--green); background: var(--green-soft); }
.campaign-idea-progress-icon svg { width: 22px; height: 22px; }
.campaign-idea-progress-overlay[data-state="generating"] .campaign-idea-progress-icon svg { animation: auth-spin .8s linear infinite; }
.campaign-idea-progress-overlay[data-state="succeeded"] .campaign-idea-progress-icon { color: var(--green); background: var(--green-soft); }
.campaign-idea-progress-overlay[data-state="failed"] .campaign-idea-progress-icon { color: var(--red); background: var(--red-soft); }
.campaign-idea-progress-copy { min-width: 0; }
.campaign-idea-progress-copy strong { display: block; color: var(--ink); font-size: 15px; line-height: 22px; }
.campaign-idea-progress-copy p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 19px; overflow-wrap: anywhere; }
.campaign-idea-progress-track { height: 4px; margin-top: 16px; overflow: hidden; border-radius: 2px; background: #e7eeeb; }
.campaign-idea-progress-track span { display: block; width: 12%; height: 100%; border-radius: inherit; background: var(--green); transition: width .22s ease; }
.campaign-idea-progress-overlay[data-state="succeeded"] .campaign-idea-progress-track span { width: 100%; }
.campaign-idea-progress-overlay[data-state="failed"] .campaign-idea-progress-track span { width: 100%; background: var(--red); }
body.campaign-idea-progress-open { overflow: hidden; }
.lead-account-progress-overlay[hidden] { display: none !important; }
.lead-account-progress-overlay { position: fixed; z-index: 124; inset: 0; display: grid; padding: 20px; place-items: center; background: rgb(22 31 27 / 48%); }
.lead-account-progress-dialog { width: min(100%, 460px); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 22px 60px rgb(22 31 27 / 26%); }
.lead-account-progress-heading { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--line-soft); }
.lead-account-progress-heading h2 { margin-top: 3px; color: var(--ink); font-size: 18px; }
.lead-account-progress-content { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: start; gap: 14px; padding: 22px 20px 24px; }
.lead-account-progress-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 8px; color: var(--green); background: var(--green-soft); }
.lead-account-progress-icon svg { width: 22px; height: 22px; }
.lead-account-progress-overlay[data-state="syncing"] .lead-account-progress-icon svg { animation: auth-spin .8s linear infinite; }
.lead-account-progress-overlay[data-state="succeeded"] .lead-account-progress-icon { color: var(--green); background: var(--green-soft); }
.lead-account-progress-overlay[data-state="failed"] .lead-account-progress-icon { color: var(--red); background: var(--red-soft); }
.lead-account-progress-copy { min-width: 0; }
.lead-account-progress-copy strong { display: block; color: var(--ink); font-size: 15px; line-height: 22px; }
.lead-account-progress-copy p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 19px; overflow-wrap: anywhere; }
.lead-account-progress-track { height: 4px; margin-top: 16px; overflow: hidden; border-radius: 2px; background: #e7eeeb; }
.lead-account-progress-track span { display: block; width: 12%; height: 100%; border-radius: inherit; background: var(--green); transition: width .22s ease; }
.lead-account-progress-overlay[data-state="succeeded"] .lead-account-progress-track span { width: 100%; }
.lead-account-progress-overlay[data-state="failed"] .lead-account-progress-track span { width: 100%; background: var(--red); }
body.lead-account-progress-open, body.knowledge-rag-progress-open { overflow: hidden; }
body.channel-account-progress-open { overflow: hidden; }
.app-confirm-overlay[hidden] { display: none !important; }
.app-confirm-overlay { position: fixed; z-index: 120; inset: 0; display: grid; padding: 20px; place-items: center; background: rgb(22 31 27 / 42%); }
.app-confirm-dialog { width: min(100%, 420px); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 20px 54px rgb(22 31 27 / 22%); }
.app-confirm-heading { display: flex; min-height: 54px; align-items: center; justify-content: space-between; padding: 0 14px 0 18px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 12px; font-weight: 750; }
.app-confirm-content { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: start; gap: 14px; padding: 22px 20px; }
.app-confirm-content h2 { margin: 0; color: var(--ink); font-size: 18px; line-height: 26px; }
.app-confirm-content p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 21px; overflow-wrap: anywhere; }
.app-confirm-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 8px; color: var(--green); background: var(--green-soft); }
.app-confirm-icon svg { width: 21px; height: 21px; }
.app-confirm-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px 18px; }
.app-confirm-overlay[data-tone="danger"] .app-confirm-icon { color: var(--red); background: #fff0ef; }
.app-confirm-overlay[data-tone="danger"] #app-confirm-submit { border-color: var(--red); background: var(--red); }
body.app-confirm-open { overflow: hidden; }
.review-detail-overlay[hidden] { display: none !important; }
.review-detail-overlay { position: fixed; z-index: 119; inset: 0; display: grid; padding: 24px; place-items: center; background: rgb(22 31 27 / 48%); }
.review-detail-dialog { display: flex; width: min(920px, 100%); max-height: calc(100vh - 48px); overflow: hidden; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 20px 54px rgb(22 31 27 / 24%); }
.review-detail-heading { display: flex; min-height: 66px; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 16px 11px 20px; border-bottom: 1px solid var(--line-soft); }
.review-detail-heading h2 { margin: 3px 0 0; font-size: 18px; }
.review-detail-content { min-height: 180px; overflow: auto; padding: 18px 20px 22px; }
.reference-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--ink-soft); font-size: 12px; }
.reference-summary code { color: var(--muted); font-size: 11px; }
.reference-list { display: grid; gap: 9px; }
.reference-item { padding: 13px 14px; border: 1px solid var(--line-soft); border-left: 3px solid #71af97; border-radius: 6px; background: var(--surface-subtle); }
.reference-item-rejected { border-left-color: #a9b4af; }
.reference-item-rejected > div svg, .reference-item-rejected > div span { color: var(--muted); }
.reference-item > div { display: flex; min-width: 0; align-items: center; gap: 7px; }
.reference-item > div svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--green); }
.reference-item > div strong { min-width: 0; overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.reference-item > div span { margin-left: auto; color: var(--green); font-size: 11px; white-space: nowrap; }
.reference-item p { margin: 8px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.reference-item small { display: block; margin-top: 8px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; overflow-wrap: anywhere; }
.review-detail-empty { display: grid; min-height: 220px; place-items: center; align-content: center; gap: 8px; color: var(--muted); text-align: center; }
.review-detail-empty svg { width: 28px; height: 28px; }
.review-detail-empty strong { color: var(--ink); font-size: 16px; }
.original-image-view { display: grid; min-height: 0; margin: 0; place-items: center; gap: 12px; }
.original-image-view img { display: block; width: auto; max-width: 100%; max-height: calc(100vh - 180px); object-fit: contain; }
.original-image-view figcaption { display: flex; width: 100%; justify-content: flex-end; }
body.review-detail-open { overflow: hidden; }
.live-badge[data-stage]:not([data-stage="closed_loop"]) { color: #6f7c76; border-color: #d6ddda; background: #f5f7f6; }
.live-badge[data-stage="awaiting_publish"], .live-badge[data-stage="awaiting_interaction"] { color: #8a641f; border-color: #e2cea5; background: var(--gold-soft); }
.empty-inline { grid-column: 1 / -1; padding: 28px; border: 1px dashed var(--line); border-radius: 7px; color: var(--muted); font-size: 11px; text-align: center; }

@media (max-width: 1180px) {
  .main-content { padding: 25px 24px 48px; }
  .content-grid, .run-grid, .lead-layout, .knowledge-layout { grid-template-columns: 1fr; }
  .funnel-panel { min-height: 0; }
  .channel-checks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .trend-evidence-overlay { align-items: stretch; padding: 0; }
  .trend-evidence-dialog { width: 100%; max-height: 100vh; border: 0; border-radius: 0; }
  .trend-evidence-dialog .trend-evidence-panel { max-height: calc(100vh - 68px); padding: 15px 14px 24px; }
  .review-detail-overlay { align-items: stretch; padding: 0; }
  .review-detail-dialog { width: 100%; max-height: 100vh; border: 0; border-radius: 0; }
  .review-detail-content { padding: 15px 14px 22px; }
  .app-shell { display: block; }
  .sidebar { position: relative; width: 100%; height: auto; min-height: 0; padding: 13px 14px; }
  .brand-lockup { padding: 0 3px 11px; }
  .workspace-switcher { display: none; }
  .sidebar-footer { display: block; margin-top: 6px; padding: 0; border-top: 0; }
  .sidebar-settings-link { margin: 3px 0 0; }
  .platform-status, .version { display: none; }
  .primary-nav { display: flex; gap: 3px; padding-bottom: 1px; overflow-x: auto; }
  .nav-item { min-width: max-content; min-height: 35px; padding: 0 9px; font-size: 11px; }
  .nav-item.active { box-shadow: inset 0 -2px 0 #76c7aa; }
  .main-content { width: 100%; padding: 21px 14px 36px; }
  .topbar { align-items: flex-start; flex-direction: column; margin-bottom: 19px; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  h1 { font-size: 24px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-block { min-height: 104px; padding: 12px; }
  .stat-value { font-size: 24px; }
.campaign-panel, .funnel-panel, .timeline-panel, .preview-panel, .interaction-panel, .interaction-queue-panel { padding: 16px 14px; }
  .field-row { grid-template-columns: 1fr; }
  .campaign-task-strip { grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 9px 10px; }
  .campaign-task-main { grid-column: 1; grid-row: 1; }
  .campaign-task-actions { grid-column: 2; grid-row: 1; }
  .task-icon-button { width: 44px; height: 44px; flex-basis: 44px; }
  .campaign-task-progress { grid-column: 1 / -1; grid-row: 2; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-footer { align-items: flex-start; flex-direction: column; }
.settings-footer .primary-button { width: 100%; }
  .disconnect-button { justify-content: center; }
  .settings-page-header { align-items: flex-start; flex-direction: column; margin-bottom: 19px; }
  .channel-grid { grid-template-columns: 1fr; }
  .channel-account-layout { grid-template-columns: 1fr; }
  .account-editor-heading { flex-wrap: wrap; }
  .variant-grid { grid-template-columns: 1fr; }
  .image-pack-heading { align-items: flex-start; flex-direction: column; }
  .image-preview-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .form-footer, .preview-headline, .video-plan { align-items: flex-start; flex-direction: column; }
  .video-output { grid-template-columns: 1fr; }
  .video-player { width: min(100%, 240px); }
  .quality-dimension-grid { grid-template-columns: 1fr; }
  .media-quality-pipeline { grid-template-columns: 1fr; }
  .quality-dimension-heading { align-items: flex-start; flex-direction: column; }
  .quality-dimension-heading small { max-width: none; text-align: left; }
  .media-review-check-list { grid-template-columns: 1fr; }
  .media-review-fields { grid-template-columns: 1fr; }
  .media-review-actions { align-items: stretch; flex-direction: column; }
  .media-review-actions .primary-button { width: 100%; }
  .primary-button, .secondary-button { min-height: 40px; }
  .form-footer .primary-button { width: 100%; }
  .form-footer .form-actions { width: 100%; }
  .form-footer .form-actions .secondary-button { flex: 1 1 auto; }
  .preview-actions { flex-direction: column-reverse; }
  .preview-actions .primary-button, .preview-actions .secondary-button { width: 100%; }
  .grounding-row { grid-template-columns: 18px minmax(0, 1fr); align-items: flex-start; }
  .grounding-row > small, .grounding-actions { grid-column: 2; }
  .grounding-actions .icon-text-button { width: 100%; }
  .quality-report-heading { align-items: flex-start; }
  .quality-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .knowledge-row { grid-template-columns: 32px minmax(0, 1fr); }
  .knowledge-status { grid-column: 2; padding-top: 0; }
  .knowledge-row-actions { grid-column: 2; min-width: 0; align-items: center; justify-content: space-between; flex-direction: row; }
  .table-wrap { overflow: visible; }
  .data-table { display: block; min-width: 0; }
  .data-table thead { display: none; }
  .data-table tbody { display: block; }
  .data-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 14px; padding: 13px 14px; border-bottom: 1px solid var(--line-soft); }
  .data-table tbody tr:last-child { border-bottom: 0; }
  .data-table td { display: block; min-width: 0; padding: 0; border: 0; }
  .data-table td::before { display: block; margin-bottom: 4px; color: #86928c; font-size: 11px; font-weight: 750; content: attr(data-label); }
  .data-table .table-empty { display: block; grid-column: 1 / -1; }
  .run-row { grid-template-columns: 9px minmax(0, 1fr) auto 16px; min-width: 0; }
  .run-workflow, .run-row time { display: none; }
  .toast { right: 14px; bottom: 14px; left: 14px; max-width: none; }
}

@media (max-width: 520px) {
  .mode-segmented span { min-height: 38px; padding: 5px 3px; font-size: 11px; line-height: 1.35; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-block { min-height: 92px; }
  .channel-checks, .format-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .funnel-footer { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .knowledge-status-stack { width: 100%; max-width: none; align-items: flex-start; text-align: left; }
  .section-heading-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .section-heading .secondary-button { width: 100%; }
  .app-confirm-overlay { padding: 14px; }
  .app-confirm-actions { align-items: stretch; flex-direction: column-reverse; }
  .app-confirm-actions > button { width: 100%; }
  .channel-account-list-panel, .channel-account-editor-panel { padding: 14px; }
  .channel-account-row-shell { grid-template-columns: 34px minmax(0, 1fr) 38px; }
  .channel-account-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .channel-account-row > svg { display: none; }
  .channel-card-top { grid-template-columns: 38px minmax(0, 1fr); }
  .connector-state { grid-column: 2; }
  .quality-report-heading { flex-direction: column; }
  .quality-report-heading .icon-text-button { width: 100%; }
  .quality-check-grid { grid-template-columns: 1fr; }
}

/* Professional workbench layout, adapted from agent-template@3d34c5c. */
:root {
  --ink: #202824;
  --ink-soft: #4f5d56;
  --muted: #6d7972;
  --canvas: #f4f6f4;
  --surface: #ffffff;
  --surface-subtle: #f8faf8;
  --line: #d8dfda;
  --line-soft: #e8ece9;
  --sidebar: #e9eeea;
  --sidebar-soft: #f7f9f7;
  --green: #165f55;
  --green-strong: #0f4a42;
  --green-soft: #e2f1ec;
  --gold: #9a6a22;
  --gold-soft: #f8eedc;
  --coral: #b84e59;
  --coral-soft: #fae8ea;
  --blue: #356f91;
  --blue-soft: #e5f0f6;
  --red: #a64242;
  --red-soft: #f8e8e8;
  --radius: 8px;
  --sidebar-width: 224px;
  --mobile-nav-height: 64px;
  color: var(--ink);
  background: var(--canvas);
  font-family: "PingFang SC", "Microsoft YaHei", Inter, system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
}

html { scroll-padding-top: 0; }
body { min-width: 320px; color: var(--ink); background: var(--canvas); font-size: 15px; line-height: 1.5; }
button, input, textarea, select { color: inherit; font: inherit; letter-spacing: 0; }
/* Keep production controls visually stable while they receive focus. */
button:focus, a:focus, input:focus, textarea:focus, select:focus, label:has(input:focus) { outline: none; }
[hidden] { display: none !important; }

.app-shell { display: block; min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 60;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  height: 100vh;
  flex-direction: column;
  padding: 14px 10px 12px;
  border-right: 1px solid var(--line);
  color: var(--ink);
  background: var(--sidebar);
}
.brand-lockup { display: flex; min-height: 58px; align-items: center; gap: 10px; padding: 4px 6px 14px; }
.brand-mark, .mobile-brand-mark { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 8px; color: #fff; background: var(--green); font-size: 15px; font-weight: 800; }
.brand-lockup > div:nth-child(2) { min-width: 0; }
.brand-lockup strong { display: block; overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.brand-lockup span { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; text-transform: none; white-space: nowrap; }
.icon-button.mobile-nav-close { display: none; margin-left: auto; }
.primary-nav { display: grid; gap: 3px; overflow-y: auto; }
.nav-item { display: flex; min-height: 42px; align-items: center; gap: 10px; padding: 0 11px; border-radius: 7px; color: var(--ink-soft); font-size: 14px; font-weight: 560; transition: color .16s ease, background .16s ease; }
.nav-item svg { width: 17px; height: 17px; color: var(--green); stroke-width: 1.9; }
.nav-item:hover { color: var(--ink); background: rgb(255 255 255 / 62%); }
.nav-item.active { color: var(--ink); background: var(--surface); box-shadow: inset 3px 0 0 var(--green); font-weight: 700; }
.nav-count { min-width: 22px; margin-left: auto; color: var(--green); font-size: 12px; font-weight: 750; text-align: right; }
.sidebar-footer { margin-top: auto; padding: 10px 0 0; border-top: 1px solid var(--line); }
.sidebar-settings-link { margin: 0; }
.sidebar-session { display: grid; min-width: 0; grid-template-columns: 34px minmax(0, 1fr) 34px; align-items: center; gap: 9px; margin-top: 8px; padding: 9px 7px 0; border-top: 1px solid var(--line); }
.session-avatar { position: relative; display: grid; width: 34px; height: 34px; flex: 0 0 34px; overflow: hidden; place-items: center; border-radius: 7px; color: #fff; background: var(--green); font-size: 13px; font-weight: 800; }
.session-avatar img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.session-copy { min-width: 0; }
.session-copy strong, .session-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-copy strong { color: var(--ink); font-size: 13px; font-weight: 700; }
.session-copy small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.session-logout { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.session-logout:hover { color: var(--red); background: var(--red-soft); }
.session-logout svg { width: 17px; height: 17px; }
.main-content { width: auto; max-width: none; min-height: 100vh; margin: 0 0 0 var(--sidebar-width); padding: 0; }
.workspace-page { width: 100%; padding: 24px 28px 48px; }
.main-content > [hidden] { display: none !important; }

.page-header { display: flex; min-height: 68px; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-header-copy { border-left: 3px solid var(--green); padding: 1px 0 2px 13px; }
.page-heading { display: flex; align-items: center; gap: 9px; }
.page-heading > svg { width: 23px; height: 23px; flex: 0 0 auto; color: var(--green); }
.page-header h1 { margin: 0; color: var(--ink); font-size: 28px; font-weight: 750; line-height: 34px; }
.page-header p { margin: 5px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 21px; }
.page-actions { display: flex; min-height: 40px; align-items: center; gap: 8px; }
.icon-button { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-soft); background: var(--surface); cursor: pointer; }
.icon-button:hover { color: var(--green); border-color: #aac3ba; background: var(--surface-subtle); }
.live-badge { min-height: 36px; border-color: #bad7cd; border-radius: 8px; color: var(--green); background: #f1f8f5; font-size: 13px; }
.live-badge { min-height: 30px; }

.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 0; }
.stat-block { min-height: 132px; padding: 17px 18px; border: 1px solid var(--line); border-top: 3px solid #9ba8a2; border-radius: var(--radius); background: var(--surface); }
.stat-block.accent-teal { border-top-color: #277d75; }
.stat-label { color: var(--ink-soft); font-size: 13px; }
.stat-value { margin-top: 14px; font-size: 30px; }
.stat-note { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.55; }

.content-grid, .run-grid, .lead-layout, .knowledge-layout { display: grid; gap: 18px; }
.content-grid { grid-template-columns: minmax(0, 1.42fr) minmax(310px, .72fr); }
.run-grid { grid-template-columns: minmax(300px, .7fr) minmax(0, 1.38fr); }
.lead-layout { grid-template-columns: minmax(0, 1.55fr) minmax(330px, .75fr); }
.knowledge-layout { grid-template-columns: minmax(0, 1.45fr) minmax(330px, .75fr); }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.campaign-panel, .funnel-panel, .timeline-panel, .preview-panel, .interaction-panel { padding: 21px; }
.section-heading { align-items: flex-end; margin: 2px 0 14px; }
.section-heading h2, .panel-heading h2 { color: var(--ink); font-size: 18px; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: 0; text-transform: uppercase; }
.section-note, .knowledge-summary { color: var(--ink-soft); font-size: 13px; }
.knowledge-brand-status { margin-top: 6px; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.knowledge-brand-status[data-status="empty"], .knowledge-brand-status[data-status="pending_verification"] { color: #8a5b16; }
.knowledge-brand-status[data-status="ready"] { color: var(--green); }
.knowledge-rag-status { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.knowledge-rag-status[data-status="ready"] { color: var(--green); }
.knowledge-rag-status[data-status="partial"], .knowledge-rag-status[data-status="degraded"] { color: #8a5b16; }
.knowledge-status-stack { display: flex; max-width: min(54%, 640px); align-items: flex-end; flex-direction: column; text-align: right; }
.knowledge-rag-row { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.knowledge-rag-reindex-button { min-height: 30px; padding: 0 9px; }
.panel-kicker, .review-state, .run-id { color: var(--ink-soft); background: #eef2ef; font-size: 12px; }
.recent-runs-section { margin-top: 22px; }
.operational-pagination { display: flex; min-height: 48px; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 12px; }
.operational-pagination .task-icon-button:disabled { opacity: .45; cursor: not-allowed; }

.business-closure-section { padding-top: 21px; border-top: 1px solid var(--line); }
.business-closure-heading { align-items: center; }
.business-closure-state { display: inline-flex; min-height: 36px; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-soft); background: var(--surface); font-size: 13px; font-weight: 700; }
.business-closure-state[data-status="closed_loop"] { color: var(--green); border-color: #bad7cd; background: var(--green-soft); }
.business-publication-band { display: grid; min-width: 0; grid-template-columns: 40px minmax(0, 1fr) minmax(190px, auto); align-items: center; gap: 13px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.business-publication-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 7px; color: var(--green); background: var(--green-soft); }
.business-publication-icon svg { width: 20px; height: 20px; }
.business-publication-copy, .business-publication-receipt { min-width: 0; }
.business-publication-copy small, .business-publication-copy strong, .business-publication-copy span, .business-publication-receipt small, .business-publication-receipt code, .business-publication-receipt span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.business-publication-copy small, .business-publication-receipt small { color: var(--muted); font-size: 11px; }
.business-publication-copy strong { margin-top: 3px; color: var(--ink); font-size: 15px; }
.business-publication-copy span, .business-publication-receipt span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.business-publication-receipt { padding-left: 15px; border-left: 1px solid var(--line-soft); }
.business-publication-receipt code { margin-top: 4px; color: var(--ink-soft); font-size: 12px; }
.business-funnel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 12px 0; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); list-style: none; }
.business-funnel li { position: relative; display: flex; min-width: 0; min-height: 88px; }
.business-funnel li + li { border-left: 1px solid var(--line-soft); }
.business-funnel li + li::before { position: absolute; top: 50%; left: -6px; width: 11px; height: 11px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--surface); content: ""; transform: translateY(-50%) rotate(45deg); }
.business-funnel-step { display: grid; width: 100%; min-width: 0; min-height: 88px; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: minmax(2.7em, auto) auto; column-gap: 9px; align-content: center; padding: 13px 14px; color: inherit; text-decoration: none; }
.business-funnel-step > span { display: grid; width: 30px; height: 30px; grid-row: 1 / 3; place-items: center; align-self: center; border-radius: 6px; color: var(--green); background: var(--surface-subtle); }
.business-funnel svg { width: 16px; height: 16px; }
.business-funnel small { min-width: 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.35; text-overflow: ellipsis; }
.business-funnel strong { margin-top: 2px; color: var(--ink); font-size: 21px; line-height: 1; }
.business-source-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.business-source-band > span { display: grid; min-width: 0; grid-template-columns: 20px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; padding: 11px 13px; }
.business-source-band > span + span { border-left: 1px solid var(--line-soft); }
.business-source-band svg { width: 17px; height: 17px; grid-row: 1 / 3; align-self: center; color: var(--green); }
.business-source-band strong, .business-source-band small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.business-source-band strong { color: var(--ink); font-size: 12px; }
.business-source-band small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.field > span, .control-group legend, .field-label { color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.field input, .field textarea, .field select, .control-input { border-color: var(--line); border-radius: 7px; color: var(--ink); background: var(--surface); font-size: 14px; }
.field input, .field select, .control-input { height: 42px; padding: 0 11px; }
.field textarea { padding: 10px 11px; font-size: 14px; line-height: 1.65; }
.field-state { color: var(--muted); font-size: 12px; line-height: 1.5; }
.mode-segmented span, .check-option span { min-height: 38px; color: var(--ink-soft); font-size: 13px; }
.mode-segmented input:checked + span, .check-option input:checked + span { color: var(--green); }
.form-hint, .consent-row { color: var(--muted); font-size: 12px; line-height: 1.6; }
.primary-button, .secondary-button { min-height: 40px; padding: 0 14px; border-radius: 7px; font-size: 14px; font-weight: 700; }
.primary-button { border-color: var(--green); background: var(--green); }
.primary-button:hover { background: var(--green-strong); }
.secondary-button { color: var(--ink-soft); background: var(--surface); }
.danger-text { color: var(--red); }
.task-icon-button { width: 44px; height: 44px; flex-basis: 44px; }
.task-icon-button { border-radius: 7px; }

.campaign-task-copy strong, .timeline-title, .funnel-list strong, .channel-account-row-copy strong, .data-table td strong, .knowledge-title strong, .run-copy strong { font-size: 14px; }
.campaign-task-copy > span, .campaign-task-error, .campaign-task-progress strong, .funnel-list p, .funnel-footer span, .funnel-footer strong, .timeline-capability, .timeline-status, .channel-card-bottom, .channel-account-row-copy small, .data-table td small, .knowledge-main p, .knowledge-meta, .knowledge-status, .run-copy small, .run-workflow, .run-row time { font-size: 12px; }
.funnel-index, .quality-pass, .quality-warning, .quality-fail, .quality-check, .quality-issue > span, .quality-issue p, .quality-issue small, .quality-clear, .quality-more, .variant-item small, .video-plan span, .video-output-meta span, .video-output-meta small, .distribution-list span, .channel-card-top > div:nth-child(2) span, .reply-result span { font-size: 12px; }
.preview-headline span, .grounding-row, .quality-report-heading span, .icon-text-button, .variant-item p, .reply-result p { font-size: 13px; }
.quality-issue strong, .variant-item strong, .video-plan strong, .reply-result strong { font-size: 14px; }
.grounding-row small { font-size: 12px; }
.campaign-task-strip { padding: 13px 12px; }
.campaign-task-icon { width: 36px; height: 36px; flex-basis: 36px; border-radius: 7px; }
.status-chip, .scope-badge, .channel-mini, .priority-badge, .account-state-badge, .connector-state { font-size: 12px; }
.timeline { min-height: 360px; }
.timeline-item { min-height: 62px; }
.empty-state, .empty-inline, .table-empty { font-size: 13px !important; }
.channel-card, .channel-account-list-panel, .channel-account-editor-panel, .reply-result { border-radius: 8px; }
.publish-account-badge { font-size: 11px; }
.data-table th { color: var(--ink-soft); font-size: 13px; }
.data-table td { color: var(--ink-soft); font-size: 14px; }
.data-table td::before { font-size: 12px; }
.table-select { height: 34px; font-size: 13px; }
.contact-value { font-size: 13px; }
.filter-button { min-height: 34px; font-size: 13px; }
.text-link { font-size: 13px; }
.toast { z-index: 100; padding: 12px 15px; border-radius: 7px; font-size: 14px; }

.auth-pending, .auth-required { overflow: hidden; }
.auth-pending .app-shell, .auth-required .app-shell { display: none; }
.auth-gate { position: fixed; z-index: 200; inset: 0; display: grid; min-height: 100svh; place-items: center; padding: 24px; background: var(--canvas); }
.auth-gate[hidden] { display: none; }
.auth-panel { width: min(100%, 390px); padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 18px 48px rgb(24 37 46 / 10%); }
.auth-brand { display: flex; align-items: center; gap: 11px; padding-bottom: 22px; border-bottom: 1px solid var(--line-soft); }
.auth-brand > div { min-width: 0; }
.auth-brand strong, .auth-brand > div > span { display: block; }
.auth-brand strong { color: var(--ink); font-size: 15px; }
.auth-brand > div > span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.auth-heading { padding: 24px 0 20px; }
.auth-heading h1 { margin: 0; font-size: 24px; line-height: 1.3; }
.auth-heading p { margin-top: 6px; color: var(--ink-soft); font-size: 13px; }
.auth-loading { display: flex; min-height: 44px; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 13px; }
.auth-loading svg, #login-button:disabled svg { width: 18px; height: 18px; animation: auth-spin .8s linear infinite; }
.auth-form { display: grid; gap: 15px; }
.auth-form .field { display: grid; gap: 7px; }
.auth-form .field input { width: 100%; }
.auth-form .full-button { width: 100%; justify-content: center; margin-top: 2px; }
.auth-error { padding: 10px 11px; border-left: 3px solid var(--red); color: var(--red); background: var(--red-soft); font-size: 13px; line-height: 1.5; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.provider-page-note { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 18px; padding: 12px 14px; border-left: 3px solid var(--gold); color: #6e572f; background: var(--gold-soft); font-size: 13px; line-height: 1.6; }
.provider-page-note svg, .provider-error-banner svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; }
.capability-list { max-width: 1180px; }
.capability-slot { margin-bottom: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); transition: border-color .16s ease, box-shadow .16s ease; }
.capability-slot.is-connected { border-color: #8fc6b3; background: #f4faf7; box-shadow: 0 0 0 1px rgb(22 95 85 / 7%); }
.capability-slot-header { display: flex; min-height: 72px; align-items: center; gap: 16px; padding: 15px 18px; }
.capability-slot-title { display: flex; min-width: 220px; flex: 0 1 280px; align-items: center; gap: 12px; }
.capability-slot-title > div { min-width: 0; }
.capability-slot-title h2 { margin: 0; font-size: 16px; line-height: 1.35; }
.capability-slot-title > div > span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.capability-slot-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 8px; color: var(--green); background: var(--green-soft); }
.capability-slot-icon svg { width: 21px; height: 21px; }
.capability-slot-status { display: flex; min-width: 0; flex: 1; align-items: center; gap: 9px; }
.capability-status-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #9aa59f; }
.capability-status-dot.is-live { background: var(--green); box-shadow: 0 0 0 3px rgb(22 95 85 / 12%); }
.capability-status-copy { min-width: 80px; flex: 1; overflow: hidden; color: var(--ink-soft); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.is-connected .capability-status-copy { color: var(--green); font-weight: 700; }
.capability-slot-status strong { color: var(--green); font-size: 13px; white-space: nowrap; }
.capability-slot-status small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.capability-slot-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.capability-slot-form { display: grid; gap: 14px; padding: 16px 18px 18px; border-top: 1px solid var(--line); background: var(--surface-subtle); }
.provider-form-row { display: grid; gap: 7px; }
.vendor-card { display: grid; width: min(100%, 320px); gap: 3px; padding: 11px 13px; border: 1px solid #8fb9ab; border-radius: 8px; color: var(--green); background: var(--green-soft); }
.vendor-card span { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; }
.vendor-card small { color: var(--ink-soft); font-size: 12px; }
.provider-endpoint { display: flex; min-height: 42px; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-soft); background: #f1f4f2; padding: 0 11px; }
.provider-endpoint code { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.provider-key-row { display: flex; align-items: flex-start; gap: 10px; }
.secret-field { position: relative; display: block; min-width: 0; flex: 1; }
.secret-field .control-input { width: 100%; padding-right: 44px; }
.secret-field > button { position: absolute; top: 4px; right: 4px; display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 6px; color: var(--muted); background: transparent; cursor: pointer; }
.secret-field > button:hover { color: var(--ink); background: #edf1ee; }
.secret-field > button svg { width: 17px; height: 17px; }
.provider-error-banner { display: flex; min-height: 42px; align-items: flex-start; gap: 9px; margin-bottom: 14px; padding: 10px 12px; border: 1px solid #e3c2c5; border-radius: 8px; color: var(--red); background: var(--red-soft); font-size: 13px; line-height: 1.55; }
.capability-slot > .provider-error-banner { margin: 0 18px 14px; }
.capability-models { padding: 4px 18px 17px; }
.capability-models + .capability-models { padding-top: 17px; border-top: 1px solid var(--line); }
.model-select-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.model-select-heading strong { font-size: 14px; }
.model-select-heading span { color: var(--muted); font-size: 12px; }
.model-select-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.model-select-item { display: flex; min-width: 0; min-height: 42px; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); cursor: pointer; }
.model-select-item:hover { border-color: #aac3ba; background: var(--surface-subtle); }
.model-select-item.is-selected { border-color: var(--green); background: var(--green-soft); box-shadow: inset 3px 0 0 var(--green); }
.model-select-item input { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--green); }
.model-select-item code { min-width: 0; flex: 1; overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.model-selected-badge { flex: 0 0 auto; padding: 3px 6px; border-radius: 5px; color: var(--green); background: #d4ebe2; font-size: 11px; font-weight: 700; }
.provider-empty-state { grid-column: 1 / -1; display: flex; min-height: 48px; align-items: center; justify-content: center; gap: 8px; color: var(--gold); background: var(--gold-soft); font-size: 13px; }
.knowledge-retrieval-slot.is-partial { border-color: #d6bd85; background: #fffaf0; }
.knowledge-retrieval-slot.is-degraded:not(.is-connected) { border-color: #ddc99f; background: #fffbf3; }
.rag-capability-summary { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 9px; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--ink-soft); background: var(--surface-subtle); font-size: 13px; line-height: 1.65; }
.rag-capability-summary svg { width: 17px; height: 17px; margin-top: 2px; color: var(--green); }
.rag-capability-summary p { min-width: 0; margin: 0; }
.knowledge-retrieval-models { padding-top: 15px; border-top: 1px solid var(--line); }
.rag-model-display { min-height: 50px; }
.rag-model-row { display: grid; min-height: 50px; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 10px; border-left: 3px solid var(--green); background: var(--surface-subtle); }
.rag-model-row[data-status="partial"] { border-left-color: var(--gold); }
.rag-model-row[data-status="degraded"], .rag-model-row[data-status="disabled"] { border-left-color: var(--red); }
.rag-model-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 6px; color: var(--green); background: var(--green-soft); }
.rag-model-icon svg { width: 17px; height: 17px; }
.rag-model-row code { min-width: 0; overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.rag-service-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 12px 0 0; border-top: 1px solid var(--line-soft); }
.rag-service-metrics > div { min-width: 0; padding: 11px 13px 0; }
.rag-service-metrics > div:first-child { padding-left: 0; }
.rag-service-metrics > div + div { border-left: 1px solid var(--line-soft); }
.rag-service-metrics dt { color: var(--muted); font-size: 11px; }
.rag-service-metrics dd { margin: 4px 0 0; overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

.analytics-section { padding-top: 21px; border-top: 1px solid var(--line); }
.analytics-heading-row { align-items: center; }
.analytics-heading-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.analytics-state-pill { display: inline-flex; min-height: 38px; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-soft); background: var(--surface); font-size: 13px; font-weight: 700; white-space: nowrap; }
.analytics-state-pill[data-status="ready"], .analytics-state-pill[data-status="partial"] { color: var(--green); border-color: #bad7cd; background: var(--green-soft); }
.analytics-state-pill[data-status="error"] { color: var(--red); border-color: #e3c2c5; background: var(--red-soft); }
.analytics-select-label { display: flex; min-height: 38px; align-items: center; gap: 8px; padding-left: 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--surface); font-size: 12px; white-space: nowrap; }
.analytics-select-label select { min-width: 112px; height: 36px; border: 0; outline: 0; color: var(--ink-soft); background: transparent; padding: 0 28px 0 2px; font-size: 13px; cursor: pointer; }
.analytics-select-label.compact { min-height: 36px; }
.analytics-select-label.compact select { height: 34px; min-width: 92px; }
.analytics-health-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.analytics-health-band > span { display: grid; min-width: 0; grid-template-columns: 20px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; padding: 12px 14px; }
.analytics-health-band > span + span { border-left: 1px solid var(--line-soft); }
.analytics-health-band svg { width: 18px; height: 18px; grid-row: 1 / 3; align-self: center; color: var(--green); }
.analytics-health-band strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.analytics-health-band small { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.analytics-metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.analytics-metric { min-width: 0; min-height: 108px; padding: 14px; border: 1px solid var(--line); border-top: 2px solid #7eb6a2; border-radius: 7px; background: var(--surface); }
.analytics-metric > span { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 13px; }
.analytics-metric > span svg { width: 16px; height: 16px; color: var(--green); }
.analytics-metric > strong { display: block; margin-top: 11px; overflow: hidden; color: var(--ink); font-size: 26px; line-height: 1; text-overflow: ellipsis; }
.analytics-metric > small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.analytics-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .72fr); gap: 14px; margin-top: 14px; }
.analytics-ranking-panel, .analytics-recommendation-panel { min-width: 0; padding: 18px; }
.analytics-table-wrap { min-width: 0; overflow-x: auto; }
.analytics-table { min-width: 560px; }
.analytics-table td:first-child { max-width: 260px; }
.analytics-table td:first-child strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analytics-recommendation-list { display: grid; gap: 9px; }
.analytics-recommendation { padding: 12px 0 12px 12px; border-left: 3px solid var(--green); border-bottom: 1px solid var(--line-soft); }
.analytics-recommendation:last-child { border-bottom: 0; }
.analytics-recommendation[data-status="insufficient_data"] { border-left-color: var(--gold); }
.analytics-recommendation > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.analytics-recommendation > div span { color: var(--green); font-size: 12px; font-weight: 700; }
.analytics-recommendation > div code { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.analytics-recommendation strong { display: block; margin-top: 7px; color: var(--ink); font-size: 14px; line-height: 1.45; }
.analytics-recommendation p { margin-top: 5px; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.analytics-recommendation small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.mobile-topbar, .mobile-nav { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid, .run-grid, .lead-layout, .knowledge-layout, .analytics-layout { grid-template-columns: 1fr; }
  .analytics-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .business-source-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .business-source-band > span:nth-child(3) { border-top: 1px solid var(--line-soft); border-left: 0; }
  .business-source-band > span:nth-child(4) { border-top: 1px solid var(--line-soft); }
  .channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .capability-slot-status small { display: none; }
  .model-select-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1020px) and (min-width: 761px) {
  :root { --sidebar-width: 204px; }
  .workspace-page { padding-right: 20px; padding-left: 20px; }
  .capability-slot-header { flex-wrap: wrap; }
  .capability-slot-title { min-width: 0; flex: 1; }
  .capability-slot-status { order: 3; width: 100%; flex-basis: 100%; }
  .campaign-account-available-list { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  body.nav-open { overflow: hidden; }
  .sidebar { z-index: 90; width: min(286px, 86vw); height: 100svh; transform: translateX(-105%); transition: transform .18s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .icon-button.mobile-nav-close { display: grid; }
  .primary-nav { display: grid; overflow: visible; }
  .sidebar-footer { display: block; margin-top: auto; padding-top: 10px; }
  .nav-backdrop { position: fixed; z-index: 80; inset: 0; display: block; border: 0; background: rgb(22 31 27 / 38%); }
  .nav-backdrop[hidden] { display: none; }
  .mobile-topbar { position: fixed; z-index: 50; inset: 0 0 auto; display: flex; height: 52px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgb(248 250 248 / 96%); padding: 0 10px; backdrop-filter: blur(10px); }
  .mobile-topbar strong { font-size: 14px; }
  .mobile-brand-mark { width: 32px; height: 32px; flex-basis: 32px; font-size: 13px; }
  .main-content { min-height: 100svh; margin-left: 0; padding: 52px 0 var(--mobile-nav-height); }
  .workspace-page { padding: 16px 12px 30px; scroll-margin-top: 68px; }
  .mobile-nav { position: fixed; z-index: 50; inset: auto 0 0; display: grid; height: var(--mobile-nav-height); grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); background: rgb(250 251 250 / 97%); padding-bottom: env(safe-area-inset-bottom); }
  .mobile-nav .nav-item { display: grid; min-width: 0; min-height: 0; place-items: center; align-content: center; gap: 3px; padding: 0; border-radius: 0; color: var(--muted); font-size: 11px; font-weight: 600; box-shadow: none; }
  .mobile-nav .nav-item svg { width: 20px; height: 20px; color: currentColor; }
  .mobile-nav .nav-item.active { color: var(--green); background: transparent; box-shadow: inset 0 3px 0 var(--green); }
  .page-header { display: block; min-height: 0; margin-bottom: 17px; }
  .page-header h1 { font-size: 24px; line-height: 30px; }
  .page-header p { font-size: 13px; }
  .page-actions { margin-top: 11px; }
  .lead-context-bar { align-items: flex-start; flex-direction: column; margin-top: -3px; }
  .lead-context-bar .analytics-select-label { width: 100%; }
  .lead-context-bar select { width: 100%; }
  .interaction-queue-actions { align-items: flex-start; flex-direction: column; gap: 7px; }
  .interaction-queue-actions .interaction-queue-meta { white-space: normal; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat-block { min-height: 118px; padding: 14px; }
.campaign-panel, .funnel-panel, .timeline-panel, .preview-panel, .interaction-panel { padding: 16px 14px; }
  .campaign-panel > .panel-heading { align-items: center; flex-wrap: wrap; }
  .campaign-builder-mode-button { min-height: 34px; margin-left: auto; }
  .field-row, .field-row-three { grid-template-columns: 1fr; }
  .campaign-account-matrix-bar { align-items: stretch; flex-direction: column; }
  .campaign-account-matrix-bar .secondary-button { width: 100%; }
  .campaign-account-config-heading { align-items: flex-start; flex-wrap: wrap; }
  .campaign-account-config-actions { width: 100%; min-width: 0; justify-content: flex-end; }
  .campaign-account-matrix-overlay { padding: 0; }
  .campaign-account-matrix-dialog { width: 100%; max-height: 100svh; height: 100svh; border: 0; border-radius: 0; }
  .campaign-account-available-list { grid-template-columns: 1fr; }
  .campaign-account-matrix-hint { display: none; }
  .campaign-account-matrix-actions { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .campaign-task-list { margin-right: -14px; margin-left: -14px; }
  .campaign-task-list-item { padding-right: 14px; padding-left: 14px; }
  .campaign-target-matrix-heading { min-height: 0; align-items: flex-start; flex-direction: column; gap: 6px; padding: 13px 12px; }
  .campaign-target-matrix-actions { align-self: stretch; justify-content: flex-end; }
  .campaign-target-table-wrap { overflow-x: visible; }
  .campaign-target-table { min-width: 0; table-layout: auto; }
  .campaign-target-table thead { display: none; }
  .campaign-target-table tbody { display: grid; }
  .campaign-target-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 12px; padding: 13px 12px; border-top: 1px solid var(--line-soft); }
  .campaign-target-table tr:first-child { border-top: 0; }
  .campaign-target-table td, .campaign-target-table td:nth-child(n) { display: grid; width: auto; min-width: 0; gap: 3px; padding: 0; border: 0; }
  .campaign-target-table td:nth-child(3) { grid-column: 1 / -1; }
  .campaign-target-table td:nth-child(1)::before { content: "发布账号"; }
  .campaign-target-table td:nth-child(2)::before { content: "内容角度"; }
  .campaign-target-table td:nth-child(3)::before { content: "内容标题"; }
  .campaign-target-table td:nth-child(4)::before { content: "生成状态"; }
  .campaign-target-table td:nth-child(5)::before { content: "审核状态"; }
  .campaign-target-table td:nth-child(-n + 5)::before { color: var(--muted); font-size: 11px; font-weight: 700; }
  .campaign-target-table td:nth-child(6) { align-self: end; justify-self: end; }
  .trend-evidence-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .trend-evidence-time { white-space: normal; }
  .trend-evidence-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trend-status:nth-child(3) { border-left: 0; border-top: 1px solid var(--line-soft); }
  .trend-status:nth-child(4) { border-top: 1px solid var(--line-soft); }
  .trend-evidence-table-wrap { overflow-x: visible; }
  .trend-evidence-table { min-width: 0; table-layout: auto; }
  .trend-evidence-table thead { display: none; }
  .trend-evidence-table tbody { display: grid; }
  .trend-evidence-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 12px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
  .trend-evidence-table tr:last-child { border-bottom: 0; }
  .trend-evidence-table td, .trend-evidence-table td:nth-child(n) { display: grid; width: auto; min-width: 0; gap: 3px; padding: 0; border: 0; }
  .trend-evidence-table td:first-child, .trend-evidence-table td:nth-child(4) { grid-column: 1 / -1; }
  .trend-evidence-table td::before { color: var(--muted); font-size: 11px; font-weight: 700; content: attr(data-label); }
  .trend-evidence-table td > strong { white-space: normal; overflow-wrap: anywhere; }
  .trend-evidence-table .table-empty { display: block; grid-column: 1 / -1; }
  .trend-evidence-table .table-empty::before { display: none; }
  .trend-evidence-failures li { grid-template-columns: 1fr; gap: 2px; }
  .channel-account-layout, .channel-grid { grid-template-columns: 1fr; }
  .capability-slot-header { flex-wrap: wrap; gap: 10px; padding: 14px; }
  .capability-slot-title { min-width: 0; flex: 1; }
  .capability-slot-status { order: 3; width: 100%; flex-basis: 100%; }
  .capability-slot-status small { display: inline; }
  .capability-slot-actions { margin-left: auto; }
  .capability-slot-actions .secondary-button { min-height: 38px; padding: 0 10px; }
  .capability-slot-form { padding: 14px; }
  .capability-slot > .provider-error-banner { margin-right: 14px; margin-left: 14px; }
  .provider-key-row { flex-direction: column; }
  .provider-key-row .primary-button { width: 100%; }
  .model-select-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .analytics-heading-actions { width: 100%; align-items: stretch; }
  .analytics-state-pill { justify-content: center; }
  .analytics-select-label { min-width: 0; flex: 1; justify-content: space-between; }
  .analytics-select-label select { min-width: 0; flex: 1; }
  .analytics-health-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-health-band > span:nth-child(3) { border-left: 0; border-top: 1px solid var(--line-soft); }
  .analytics-health-band > span:nth-child(4) { border-top: 1px solid var(--line-soft); }
  .analytics-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .business-publication-band { grid-template-columns: 40px minmax(0, 1fr); }
  .business-publication-receipt { grid-column: 2; padding: 10px 0 0; border-top: 1px solid var(--line-soft); border-left: 0; }
  .business-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .business-funnel li + li { border-left: 0; }
  .business-funnel li:nth-child(even) { border-left: 1px solid var(--line-soft); }
  .business-funnel li:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
  .business-funnel li + li::before { display: none; }
  .filter-bar { flex-wrap: wrap; overflow-x: visible; }
  .knowledge-search { width: 100%; margin-left: 0; }
  .knowledge-metric-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .knowledge-browse-layout .knowledge-list { height: auto; min-height: 420px; max-height: 65svh; }
  .knowledge-row-actions { grid-column: 2; min-width: 0; align-items: center; justify-content: space-between; flex-direction: row; }
  .knowledge-detail-meta { grid-template-columns: 1fr; }
  .knowledge-detail-meta > div, .knowledge-detail-meta > div:not(:nth-child(3n + 1)), .knowledge-detail-meta > div:nth-last-child(-n + 3) { border-right: 0; border-bottom: 1px solid var(--line-soft); border-left: 0; }
  .knowledge-detail-meta > div:last-child { border-bottom: 0; }
  .analytics-ranking-panel, .analytics-recommendation-panel { padding: 15px 14px; }
  .analytics-table { min-width: 0; }
  .video-output-grid, .provider-video-form, .provider-video-form-advanced { grid-template-columns: 1fr; }
  .provider-video-form .secondary-button { width: 100%; }
  .provider-video-task { grid-template-columns: minmax(0, 1fr) 36px; }
  .scene-quality-audit-list { grid-template-columns: 1fr; }
  .interaction-policy-toggles { grid-template-columns: 1fr; }
  .interaction-reply-form { grid-template-columns: minmax(0, 1fr) 36px; }
  .draft-editor-actions .primary-button { width: 100%; }
  .toast { right: 12px; bottom: calc(var(--mobile-nav-height) + 10px); left: 12px; max-width: none; }
}

@media (max-width: 460px) {
  .stats-grid, .model-select-grid, .account-policy-grid { grid-template-columns: 1fr; }
  .analytics-heading-actions { flex-direction: column; }
  .analytics-health-band { grid-template-columns: 1fr; }
  .analytics-health-band > span + span { border-top: 1px solid var(--line-soft); border-left: 0; }
  .analytics-metric-grid { grid-template-columns: 1fr; }
  .knowledge-metric { padding: 12px; }
  .knowledge-metric > strong { font-size: 21px; }
  .business-closure-heading { align-items: flex-start; }
  .business-closure-state { width: 100%; justify-content: center; }
  .business-publication-band { grid-template-columns: 34px minmax(0, 1fr); padding: 12px; }
  .business-publication-icon { width: 34px; height: 34px; }
  .business-funnel, .business-source-band { grid-template-columns: 1fr; }
  .business-funnel li:nth-child(even), .business-source-band > span + span { border-left: 0; }
  .business-funnel li + li, .business-source-band > span + span { border-top: 1px solid var(--line-soft); }
  .stat-block { min-height: 104px; }
  .mode-segmented span { padding: 5px 3px; font-size: 12px; }
  .capability-slot-status strong, .capability-slot-status small { display: none; }
  .rag-service-metrics { grid-template-columns: 1fr; }
  .rag-service-metrics > div, .rag-service-metrics > div:first-child { padding: 9px 0; }
  .rag-service-metrics > div + div { border-top: 1px solid var(--line-soft); border-left: 0; }
  .auth-gate { align-items: stretch; padding: 0; background: var(--surface); }
  .auth-panel { width: 100%; padding: 24px 20px; border: 0; box-shadow: none; }
}

.xhs-login-panel[hidden], .channel-account-detail[hidden], .channel-account-empty[hidden], .xhs-qr-placeholder[hidden] { display: none !important; }
.channel-account-empty { display: grid; min-height: 420px; align-content: center; justify-items: center; gap: 8px; color: var(--muted); text-align: center; }
.channel-account-empty > svg { width: 44px; height: 44px; margin-bottom: 4px; }
.channel-account-empty strong { color: var(--ink); font-size: 16px; }
.channel-account-empty p { margin: 0; font-size: 13px; }
.xhs-login-panel { display: grid; min-height: 420px; align-content: center; justify-items: center; gap: 18px; padding: 24px 12px 8px; text-align: center; }
.xhs-qr-frame { display: grid; width: min(100%, 240px); aspect-ratio: 1; overflow: hidden; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.xhs-qr-frame img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.xhs-qr-frame.is-interactive { width: min(100%, 620px); aspect-ratio: 16 / 10; cursor: crosshair; touch-action: none; }
/* The frame is stretched to the browser's own aspect ratio, so filling it keeps
   pointer coordinates a straight 1:1 mapping onto the remote viewport. */
.xhs-qr-frame.is-interactive img { padding: 0; object-fit: fill; }
/* A frozen last-good frame is pixel-identical to a live one; drain it so the
   operator can see the picture stopped instead of trusting a dead image. */
.xhs-qr-frame.is-stale { cursor: not-allowed; border-color: #b7791f; }
.xhs-qr-frame.is-stale img { filter: grayscale(1) brightness(0.82); opacity: 0.55; }
.xhs-qr-frame.is-interactive:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; }
.xhs-qr-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: #96a49d; background: #f4f7f5; }
.xhs-qr-placeholder svg { width: 62px; height: 62px; }
.xhs-login-copy { display: grid; max-width: 360px; gap: 5px; }
.xhs-login-copy strong { color: var(--ink); font-size: 16px; }
.xhs-login-copy p, .xhs-login-copy time { margin: 0; color: var(--muted); font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.xhs-login-copy time { min-height: 20px; }
.channel-account-detail { display: grid; min-height: 420px; align-content: start; gap: 20px; padding-top: 24px; }
.channel-account-identity { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 14px; }
.channel-account-identity > div { min-width: 0; }
.channel-account-identity strong, .channel-account-identity span { display: block; overflow-wrap: anywhere; }
.channel-account-identity strong { color: var(--ink); font-size: 18px; line-height: 25px; }
.channel-account-identity > div > span { margin-top: 5px; color: var(--muted); font-size: 13px; }
.channel-account-detail-avatar { position: relative; display: grid; width: 72px; height: 72px; overflow: hidden; place-items: center; border-radius: 8px; color: #fff; background: #b94a48; font-size: 22px; font-weight: 800; }
.channel-account-detail-avatar > svg { width: 30px; height: 30px; }
.channel-account-detail-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.channel-account-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.channel-account-facts > div { min-width: 0; padding: 14px; border: 1px solid var(--line-soft); border-radius: 7px; background: #f8faf9; }
.channel-account-facts dt { color: var(--muted); font-size: 12px; }
.channel-account-facts dd { margin: 6px 0 0; color: var(--ink); font-size: 14px; font-weight: 750; overflow-wrap: anywhere; }
.channel-account-health-alert { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 12px; border: 1px solid #ecd19e; border-radius: 7px; color: #71511d; background: #fff9ec; }
.channel-account-health-alert[hidden] { display: none; }
.channel-account-health-alert[data-status="verification_failed"], .channel-account-health-alert[data-status="login_expired"] { border-color: #efcaca; color: #8f3431; background: #fff5f4; }
.channel-account-health-alert[data-status="processing"] { border-color: #bdd5e7; color: #316483; background: #f2f8fc; }
.channel-account-health-icon { display: grid; width: 30px; height: 30px; place-items: center; color: currentColor; background: rgb(255 255 255 / 72%); }
.channel-account-health-icon svg { width: 16px; height: 16px; }
.channel-account-health-alert strong { display: block; font-size: 12px; line-height: 18px; }
.channel-account-health-alert p { margin: 3px 0 0; font-size: 11px; line-height: 17px; overflow-wrap: anywhere; }
.channel-account-health-alert small { display: block; margin-top: 5px; color: currentColor; font-size: 11px; line-height: 16px; opacity: .8; overflow-wrap: anywhere; }
.channel-account-health-alert[data-status="available"] { border-color: #b8ddcc; color: #246b55; background: #effaf5; }
.compact-icon-button { width: 30px; min-height: 30px; padding: 0; }
.compact-icon-button svg { width: 14px; height: 14px; }
.channel-account-capabilities { min-width: 0; }
.channel-account-capabilities-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.channel-account-capabilities-heading strong { color: var(--ink); font-size: 13px; }
.channel-account-capabilities-heading span { color: var(--muted); font-size: 11px; text-align: right; }
.channel-account-capability-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.channel-account-capability { display: grid; min-width: 0; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: start; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.channel-account-capability-icon { display: grid; width: 24px; height: 24px; place-items: center; color: #76827c; background: #eef1f0; }
.channel-account-capability-icon svg { width: 13px; height: 13px; }
.channel-account-capability > div { min-width: 0; }
.channel-account-capability strong { display: block; color: var(--ink); font-size: 12px; line-height: 18px; }
.channel-account-capability p { margin: 2px 0 0; color: var(--muted); font-size: 11px; line-height: 16px; overflow-wrap: anywhere; }
.channel-account-capability small { display: block; margin-top: 4px; color: #748078; font-size: 11px; line-height: 16px; overflow-wrap: anywhere; }
.channel-account-capability em { margin-top: 2px; color: #75817b; font-size: 11px; font-style: normal; font-weight: 750; white-space: nowrap; }
.channel-account-capability.channel-capability-available .channel-account-capability-icon { color: #28705c; background: #e7f4ef; }
.channel-account-capability.channel-capability-available em { color: #28705c; }
.channel-account-capability.channel-capability-unavailable .channel-account-capability-icon { color: #a34b48; background: #faeceb; }
.channel-account-capability.channel-capability-unavailable em { color: #a34b48; }
.channel-account-capability.channel-capability-unknown .channel-account-capability-icon { color: #7d7160; background: #f4f0e9; }
.channel-account-capability.channel-capability-unknown em { color: #7d7160; }
.channel-account-capability.channel-capability-not_configured .channel-account-capability-icon { color: #96a09a; background: #f2f4f2; }
.channel-account-capability.channel-capability-not_configured em { color: #96a09a; }
.channel-account-capability.channel-capability-stale .channel-account-capability-icon { color: #8f5f16; background: #fff4dc; }
.channel-account-capability.channel-capability-stale em { color: #8f5f16; }
.channel-account-capability.channel-capability-refreshing .channel-account-capability-icon { color: #8f5f16; background: #fff4dc; }
.channel-account-capability.channel-capability-refreshing em { color: #8f5f16; }
.channel-account-capability.channel-capability-degraded .channel-account-capability-icon { color: #8f5f16; background: #fff4dc; }
.channel-account-capability.channel-capability-degraded em { color: #8f5f16; }
.channel-account-command-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.channel-account-publish-button[data-enabled="true"] { color: var(--green); border-color: #9fc8ba; background: var(--green-soft); }
.interaction-panel .analytics-select-label { min-width: 0; }
.interaction-panel .analytics-select-label select { min-width: 110px; }
.channel-account-add-button { width: 100%; margin-top: 14px; }
.channel-account-add-button[aria-disabled="true"][data-capacity-state="full"]:not(:disabled),
.channel-account-add-button[aria-disabled="true"][data-capacity-state="over"]:not(:disabled) { opacity: .55; cursor: not-allowed; transform: none; }
.channel-account-add-button[aria-disabled="true"][data-capacity-state="full"]:not(:disabled):hover,
.channel-account-add-button[aria-disabled="true"][data-capacity-state="over"]:not(:disabled):hover { color: #53626a; border-color: var(--line); background: #fff; }
.danger-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 7px; padding: 0 16px; border: 1px solid #d9a7a5; border-radius: 6px; color: #9b3633; background: #fff; font-size: 13px; font-weight: 750; cursor: pointer; }
.danger-button:hover { border-color: #c47976; background: #fff7f6; }
.danger-button:disabled { opacity: .55; cursor: not-allowed; }
.danger-button svg { width: 17px; height: 17px; }

@media (max-width: 600px) {
  .xhs-login-panel, .channel-account-detail { min-height: 360px; }
  .xhs-qr-frame { width: min(100%, 210px); }
  .channel-account-facts { grid-template-columns: 1fr; }
  .channel-account-capabilities-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .channel-account-capabilities-heading span { text-align: left; }
  .channel-account-capability-list { grid-template-columns: 1fr; }
  .channel-account-command-bar > button { width: 100%; }
  .interaction-panel .panel-heading { align-items: stretch; flex-direction: column; }
  .interaction-panel .analytics-select-label { width: 100%; justify-content: space-between; }
  .interaction-panel .analytics-select-label select { min-width: 0; flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .timeline-item.active-progress .timeline-marker svg, .active-progress-icon { animation-duration: 1.6s !important; }
}

/* Lead center: dense scan surface with an explicit handoff workspace. */
.section-heading-actions { display: flex; align-items: center; gap: 8px; }
.lead-summary-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--line-soft); overflow: hidden; }
.lead-summary-band > span { display: flex; min-height: 64px; flex-direction: column; justify-content: center; gap: 4px; padding: 10px 14px; background: var(--surface); }
.lead-summary-band small { color: var(--muted); font-size: 11px; }
.lead-summary-band strong { color: var(--ink); font-size: 22px; line-height: 1; }
.lead-filter-bar { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(120px, .6fr)); gap: 9px; align-items: end; padding: 0 14px 13px; border-bottom: 1px solid var(--line-soft); }
.lead-search-field { display: flex; height: 42px; min-height: 42px; align-items: center; gap: 8px; overflow: hidden; padding: 0 0 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--surface); }
.lead-search-field svg { width: 15px; height: 15px; flex: 0 0 auto; }
.lead-search-field input { width: 100%; min-width: 0; flex: 1 1 auto; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; }
.lead-search-reset { display: inline-flex; min-width: 76px; min-height: 0; align-self: stretch; flex: 0 0 auto; align-items: center; justify-content: center; padding: 0 11px; border: 0; border-left: 1px solid var(--line); border-radius: 0; color: var(--ink-soft); background: var(--surface-subtle); font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0; cursor: pointer; transition: border-color .16s ease, color .16s ease, background .16s ease; }
.lead-search-reset:hover { border-left-color: #8fb9ab; color: var(--green); background: var(--green-soft); }
.compact-field { gap: 4px; }
.compact-field span { font-size: 11px; }
.lead-pagination { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px 0; color: var(--muted); font-size: 12px; }
.business-funnel-step { cursor: pointer; transition: background .16s ease; }
.business-funnel-step:hover { outline: 0; background: var(--surface-subtle); }
.lead-detail-overlay { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(17, 32, 27, .34); }
.lead-detail-overlay[hidden] { display: none; }
.lead-detail-dialog { display: flex; width: min(760px, 100%); max-height: min(900px, 92vh); flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 22px 70px rgba(17, 32, 27, .22); }
.lead-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 21px 22px 15px; border-bottom: 1px solid var(--line-soft); }
.lead-detail-heading h2 { margin-top: 4px; color: var(--ink); font-size: 20px; }
.lead-detail-heading p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.lead-detail-content { overflow: auto; padding: 18px 22px 22px; }
.lead-detail-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-bottom: 17px; }
.lead-detail-fact { min-width: 0; padding: 11px 12px; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--surface-subtle); }
.lead-detail-fact small, .lead-detail-fact strong { display: block; }
.lead-detail-fact small { color: var(--muted); font-size: 11px; }
.lead-detail-fact strong { margin-top: 5px; overflow-wrap: anywhere; color: var(--ink); font-size: 13px; }
.lead-detail-section { padding: 16px 0; border-top: 1px solid var(--line-soft); }
.lead-detail-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.lead-detail-section-heading strong { color: var(--ink); font-size: 14px; }
.lead-detail-section-heading span { color: var(--muted); font-size: 11px; }
.lead-detail-timeline { display: grid; gap: 0; }
.lead-timeline-item { position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; padding: 0 0 14px; }
.lead-timeline-item:last-child { padding-bottom: 0; }
.lead-timeline-item::before { position: absolute; top: 10px; bottom: -2px; left: 5px; width: 1px; background: var(--line); content: ""; }
.lead-timeline-item:last-child::before { display: none; }
.lead-timeline-dot { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 3px; border: 2px solid var(--surface); border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.lead-timeline-copy strong, .lead-timeline-copy p, .lead-timeline-copy small { display: block; }
.lead-timeline-copy strong { color: var(--ink-soft); font-size: 12px; }
.lead-timeline-copy p { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.lead-timeline-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.lead-timeline-time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.lead-detail-form { padding-top: 16px; border-top: 1px solid var(--line-soft); }
.lead-detail-form-actions { display: flex; min-height: 40px; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.lead-detail-form-actions span { color: var(--muted); font-size: 11px; }

@media (max-width: 760px) {
  .lead-summary-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-filter-bar { grid-template-columns: 1fr 1fr; }
  .lead-search-field { grid-column: 1 / -1; }
  .lead-detail-overlay { padding: 0; }
  .lead-detail-dialog { width: 100%; max-height: 100vh; height: 100%; border: 0; border-radius: 0; }
  .lead-detail-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .lead-filter-bar { grid-template-columns: 1fr; }
  .lead-detail-overview { grid-template-columns: 1fr; }
  .lead-detail-heading, .lead-detail-content { padding-right: 15px; padding-left: 15px; }
  .lead-detail-form-actions { align-items: stretch; flex-direction: column; }
  .lead-detail-form-actions .primary-button { width: 100%; }
}

/* Workspace account surface ------------------------------------------------ */
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 4px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
}
.settings-tab {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  margin-bottom: -1px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  border-radius: 7px 7px 0 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.settings-tab svg { width: 16px; height: 16px; }
.settings-tab:hover { color: var(--ink); background: var(--surface-subtle); }
.settings-tab.active, .settings-tab[aria-selected="true"] {
  border-color: var(--line);
  border-bottom-color: var(--surface);
  color: var(--green);
  background: var(--surface);
}
[data-settings-panel][hidden] { display: none !important; }

.service-points-readonly {
  max-width: 1180px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.service-points-readonly .account-security-header { justify-content: space-between; }
.service-points-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 20px;
  border: 1px solid var(--line);
  background: var(--line);
}
.service-points-summary > div { min-height: 92px; padding: 17px; background: var(--surface); }
.service-points-summary span { display: block; color: var(--muted); font-size: 12px; }
.service-points-summary strong { display: block; margin-top: 10px; color: var(--ink); font-size: 24px; letter-spacing: .02em; }
.service-points-ledger-wrap { padding: 0 20px 20px; }
.service-points-ledger-wrap .section-subheading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.service-points-ledger-wrap h3 { font-size: 15px; }
.service-points-ledger-wrap .section-subheading span { color: var(--muted); font-size: 12px; }
.service-points-ledger { border-top: 1px solid var(--line); }
.service-points-ledger-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 170px; gap: 14px; align-items: center; min-height: 44px; border-bottom: 1px solid var(--line); font-size: 12px; }
.service-points-ledger-row strong[data-direction="release"], .service-points-ledger-row strong[data-direction="refund"], .service-points-ledger-row strong[data-direction="allocation"] { color: var(--green); }
.service-points-ledger-row strong[data-direction="reserve"], .service-points-ledger-row strong[data-direction="charge"] { color: var(--red); }
.service-points-ledger-row time { color: var(--muted); text-align: right; }

.account-security {
  max-width: 1180px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.account-security-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}
.account-security-heading { display: flex; min-width: 0; align-items: center; gap: 12px; }
.account-security-heading > div { min-width: 0; }
.account-security-heading h2 { margin-top: 2px; font-size: 18px; }
.account-security-heading p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.account-security-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 8px;
  color: var(--green);
  background: var(--green-soft);
}
.account-security-icon svg { width: 21px; height: 21px; }
.account-security-form-actions svg { width: 15px; height: 15px; }
.account-security .provider-error-banner { margin: 14px 20px 0; }
.account-security-grid { display: grid; grid-template-columns: minmax(280px, .82fr) minmax(420px, 1.18fr); }
.account-security-section { min-width: 0; padding: 20px; }
.account-security-section + .account-security-section { border-left: 1px solid var(--line); }
.account-sessions-section { grid-column: 1 / -1; border-top: 1px solid var(--line); border-left: 0 !important; }
.account-security-section-heading { display: flex; min-height: 31px; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.account-security-section-heading > div { min-width: 0; }
.account-security-section-heading h3 { margin-top: 3px; color: var(--ink); font-size: 15px; }
.account-security-section-heading > svg { width: 18px; height: 18px; color: var(--muted); }
.account-security-status, .account-session-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.account-security-status[data-status="ready"], .account-security-status.is-ready { color: var(--green); }
.account-security-status[data-status="error"] { color: var(--red); }
.account-identity-summary { display: flex; min-width: 0; align-items: center; gap: 13px; }
.account-security-avatar {
  position: relative;
  display: grid;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  overflow: hidden;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-size: 22px;
  font-weight: 800;
}
.account-security-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.account-security-avatar-upload { cursor: pointer; }
.account-avatar-upload-hint { position: absolute; z-index: 1; inset: 0; display: flex !important; align-items: center; justify-content: center; color: #fff; background: rgb(10 45 39 / 68%); opacity: 0; transition: opacity .16s ease; }
.account-avatar-upload-hint svg { width: 20px; height: 20px; }
.account-security-avatar-upload:hover .account-avatar-upload-hint, .account-security-avatar-upload:focus-within .account-avatar-upload-hint { opacity: 1; }
.account-security-avatar-upload input { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; opacity: 0; }
.account-identity-copy { min-width: 0; }
.account-identity-copy strong, .account-identity-copy span, .account-identity-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-identity-copy strong { color: var(--ink); font-size: 16px; }
.account-identity-copy span { margin-top: 4px; color: var(--ink-soft); font-size: 13px; }
.account-identity-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.account-security-muted { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.account-profile-form { display: grid; gap: 9px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.account-profile-form .field { display: grid; gap: 7px; }
.account-profile-form .field > span { color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.account-profile-actions { display: flex; min-height: 36px; align-items: center; justify-content: space-between; gap: 10px; }
.account-profile-actions .account-security-message { min-width: 0; margin: 0; padding: 6px 8px; font-size: 11px; }
.account-profile-actions .secondary-button { flex: 0 0 auto; min-height: 36px; }
.account-password-form { display: grid; gap: 13px; }
.account-password-form .field { display: grid; min-width: 0; gap: 7px; }
.account-password-form .field-row { gap: 10px; }
.account-password-form .control-input { width: 100%; }
.account-password-field > label { color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.account-password-field .secret-field { width: 100%; }
.account-password-toggle[aria-pressed="true"] { color: var(--green); background: var(--green-soft); }
.account-password-toggle:disabled { opacity: .55; cursor: not-allowed; }
.account-password-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.account-password-code-row .secondary-button { min-height: 42px; white-space: nowrap; }
.account-password-code-row .secondary-button svg { width: 16px; height: 16px; }
.account-password-code-state { min-height: 0; margin-top: -7px; }
.account-password-code-state:empty { display: none; }
.account-security-message { padding: 9px 11px; border-left: 3px solid var(--green); color: var(--green); background: var(--green-soft); font-size: 12px; line-height: 1.5; }
.account-security-message[data-status="error"] { border-left-color: var(--red); color: var(--red); background: var(--red-soft); }
.account-security-form-actions { display: flex; min-height: 40px; align-items: center; justify-content: space-between; gap: 12px; }
.account-security-form-actions .account-security-muted { margin: 0; }
.account-security-form-actions .primary-button { flex: 0 0 auto; }
.account-session-list { display: grid; gap: 8px; }
.account-session-item {
  display: grid;
  min-width: 0;
  min-height: 62px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface-subtle);
}
.account-session-item > svg, .account-session-icon { width: 18px; height: 18px; color: var(--muted); }
.account-session-icon { display: grid; place-items: center; }
.account-session-icon svg { width: 18px; height: 18px; }
.account-session-item > div { min-width: 0; }
.account-session-copy strong, .account-session-copy span, .account-session-copy small, .account-session-copy time { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-session-copy strong { color: var(--ink); font-size: 13px; }
.account-session-copy span, .account-session-copy small, .account-session-copy time { margin-top: 3px; color: var(--muted); font-size: 11px; }
.account-session-item.is-current { border-color: #90c7b4; background: #edf8f3; box-shadow: inset 3px 0 0 var(--green); }
.account-session-item.is-current > svg, .account-session-item.is-current .account-session-icon { color: var(--green); }
.account-session-item.is-current .account-session-copy strong { color: var(--green-strong); }
.account-session-actions { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 8px; }
.account-current-badge { flex: 0 0 auto; padding: 3px 7px; border-radius: 5px; color: var(--green); background: #d3ebe1; font-size: 11px; font-weight: 750; white-space: nowrap; }
.account-session-item #account-revoke-others, .account-session-revoke-others { min-height: 34px; padding: 0 10px; border-color: #9fc9ba; color: var(--green); background: var(--surface); font-size: 12px; }
.account-session-item #account-revoke-others:hover, .account-session-revoke-others:hover { border-color: var(--green); background: #f8fcfa; }
.account-session-item .icon-button { width: 32px; height: 32px; }

/* Email-only authentication ------------------------------------------------- */
.auth-panel { width: min(100%, 460px); max-height: calc(100svh - 32px); overflow-y: auto; }
.auth-method-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; margin: 0 0 20px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-subtle); }
.auth-method-tab { display: inline-flex; min-width: 0; min-height: 38px; align-items: center; justify-content: center; gap: 6px; padding: 0 9px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.auth-method-tab svg { width: 15px; height: 15px; }
.auth-method-tab:hover { color: var(--ink); background: var(--surface); }
.auth-method-tab.is-active, .auth-method-tab[aria-selected="true"] { color: var(--green); background: var(--surface); box-shadow: 0 1px 3px rgb(24 37 46 / 8%); }
.auth-form[hidden] { display: none !important; }
.auth-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 9px; }
.auth-code-row .secondary-button { min-height: 42px; white-space: nowrap; }
.auth-login-links { display: flex; align-items: center; justify-content: center; }
.auth-inline-link { padding: 3px 4px; border: 0; color: var(--green); background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.auth-inline-link:hover { text-decoration: underline; }
.auth-consent-note { margin: -2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; }
#login-code-state, #register-code-state { display: block; margin-top: 7px; }
#login-code-state[hidden], #register-code-state[hidden] { display: none; }
.auth-agreement-check { display: flex; min-width: 0; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 12px; line-height: 1.55; cursor: pointer; }
.auth-agreement-check input { width: 16px; height: 16px; flex: 0 0 16px; margin: 1px 0 0; accent-color: var(--green); }
.auth-success { padding: 10px 11px; border-left: 3px solid var(--green); color: var(--green); background: var(--green-soft); font-size: 13px; line-height: 1.5; }

@media (max-width: 960px) {
  .account-security-header { align-items: flex-start; flex-direction: column; gap: 13px; }
  .account-security-grid { grid-template-columns: 1fr; }
  .account-security-section + .account-security-section { border-top: 1px solid var(--line); border-left: 0; }
  .account-sessions-section { grid-column: auto; }
  .service-points-readonly .account-security-header { align-items: flex-start; }
}

@media (max-width: 520px) {
  .settings-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .settings-tab { flex: 0 0 auto; }
  .account-security-header, .account-security-section { padding: 15px; }
  .service-points-summary { grid-template-columns: 1fr; margin: 15px; }
  .service-points-ledger-wrap { padding: 0 15px 15px; }
  .service-points-ledger-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 8px 0; }
  .service-points-ledger-row time { grid-column: 1 / -1; text-align: left; }
  .account-security .provider-error-banner { margin-right: 15px; margin-left: 15px; }
  .account-security-form-actions { align-items: stretch; flex-direction: column; }
  .account-security-form-actions .primary-button { width: 100%; justify-content: center; }
  .account-password-form .field-row { grid-template-columns: 1fr; }
  .account-password-code-row { grid-template-columns: 1fr; align-items: stretch; }
  .account-password-code-row .secondary-button { width: 100%; justify-content: center; }
  .account-session-item { grid-template-columns: 30px minmax(0, 1fr) auto; padding: 9px; }
  .account-session-item.is-current .account-session-actions { grid-column: 2 / -1; width: 100%; justify-content: flex-start; }
  .auth-panel { max-height: 100svh; padding-right: 20px; padding-left: 20px; }
  .auth-method-tab { min-height: 38px; padding: 0 6px; }
  .auth-code-row { grid-template-columns: 1fr; align-items: stretch; }
  .auth-code-row .secondary-button { width: 100%; justify-content: center; }
}

/* Desktop workspace polish -------------------------------------------------
   Keep this layer presentation-only: page data, workflows, and mobile
   breakpoints continue to be owned by their existing modules above. */
@media (min-width: 961px) {
  html { scroll-behavior: auto; }
  body {
    min-width: 1080px;
    color: #1d2924;
    background: #f5f7f6;
    font-size: 13px;
    line-height: 1.5;
  }

  .sidebar {
    width: 232px;
    flex-basis: 232px;
    padding: 22px 14px 18px;
    border-right: 1px solid #d9e1dd;
    color: #22312b;
    background: #edf2ef;
  }
  .brand-lockup { padding: 0 8px 22px; }
  .brand-mark {
    width: 38px;
    height: 38px;
    color: #fff;
    background: #176552;
    font-size: 15px;
  }
  .brand-lockup strong { color: #1d2924; font-size: 14px; }
  .brand-lockup span { color: #77857f; font-size: 11px; letter-spacing: 0; text-transform: none; }
  .primary-nav { gap: 5px; }
  .nav-item {
    min-height: 44px;
    gap: 11px;
    padding: 0 12px;
    color: #52635c;
    font-size: 13px;
    font-weight: 650;
  }
  .nav-item:hover { color: #174f42; background: #e2ebe7; }
  .nav-item.active {
    color: #174f42;
    background: #fff;
    box-shadow: inset 3px 0 0 #1f8068, 0 1px 3px rgb(30 58 48 / 8%);
  }
  .nav-count { color: #28745f; font-size: 11px; }
  .sidebar-footer { border-top-color: #d6dfda; }
  .sidebar-session { color: #24322d; }

  .main-content {
    width: auto;
    max-width: none;
    margin: 0 0 0 232px;
    padding: 30px clamp(28px, 2.2vw, 52px) 64px;
  }
  .workspace-page {
    width: 100%;
    max-width: none;
    margin: 0;
    animation: desktop-page-enter .14s ease-out;
  }
  .page-header {
    position: relative;
    min-height: 74px;
    align-items: flex-start;
    margin-bottom: 22px;
    padding: 0 0 18px 16px;
    border-bottom: 1px solid #dde4e0;
    border-left: 3px solid #25735f;
  }
  .page-heading { gap: 9px; }
  .page-heading svg { width: 22px; height: 22px; color: #28745f; }
  .page-heading h1, .page-header h1 { margin: 0; font-size: 27px; line-height: 1.2; letter-spacing: 0; }
  .page-header-copy > p, .page-header p { margin-top: 6px; color: #687770; font-size: 13px; }
  .page-actions { min-height: 38px; gap: 9px; }

  .workspace-page[data-loading="true"] > .page-header::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #2c8c72 45%, transparent 78%);
    background-size: 220% 100%;
    content: "";
    animation: desktop-page-loading 1.15s linear infinite;
  }
  .realtime-view-status[data-state="loading"]::before {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border: 2px solid #b8d7cd;
    border-top-color: #24705d;
    border-radius: 50%;
    content: "";
    vertical-align: -1px;
    animation: auth-spin .75s linear infinite;
  }

  .panel, .stat-block, .analytics-metric, .knowledge-metric,
  .channel-account-card, .account-security, .service-points-readonly {
    border-color: #dbe3df;
    box-shadow: 0 1px 2px rgb(27 51 42 / 4%);
  }
  .panel { border-radius: 7px; }
  .panel-heading, .section-heading { gap: 16px; }
  .panel-heading h2, .section-heading h2 { font-size: 18px; }
  .eyebrow { font-size: 11px; letter-spacing: .04em; }
  .stats-grid { gap: 12px; margin-bottom: 22px; }
  .stat-block { min-height: 122px; padding: 17px 18px; }
  .stat-label { font-size: 13px; }
  .stat-value { margin-top: 13px; font-size: 29px; }
  .stat-note { margin-top: 8px; font-size: 12px; line-height: 1.5; }

  .primary-button, .secondary-button, .icon-text-button, .compact-button,
  .filter-button, .disconnect-button {
    min-height: 38px;
    font-size: 13px;
    transition: border-color .14s ease, background-color .14s ease, color .14s ease, box-shadow .14s ease;
  }
  /* The primary action was the same weight as every button beside it, so on a
     dense page nothing told the operator where to go next. */
  .primary-button { box-shadow: 0 1px 2px rgb(20 78 62 / 18%); font-weight: 700; }
  .primary-button:hover { box-shadow: 0 2px 6px rgb(20 78 62 / 22%); }
  .icon-button { transition: border-color .14s ease, background-color .14s ease, color .14s ease, box-shadow .14s ease; }
  button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid #31856e;
    outline-offset: 2px;
  }
  button:not(:disabled):active { transform: translateY(1px); }

  .field > span, .control-group legend { color: #405149; font-size: 13px; }
  .field input, .field textarea, .field select, .control-input, select {
    font-size: 14px;
  }
  .field input, .field select { min-height: 42px; }
  /* Validation state and hints tell the operator why a form will not submit.
     At 10px that sat below the threshold most people can read at a glance, so
     the form looked broken rather than merely incomplete. */
  .field-state, .form-hint { font-size: 12px; line-height: 1.55; }
  .field-state-paused, .field-state-failed { font-weight: 650; }

  .data-table th {
    padding-top: 11px;
    padding-bottom: 11px;
    color: #5d6e66;
    background: #f4f7f5;
    font-size: 12px;
  }
  .data-table td { padding-top: 13px; padding-bottom: 13px; font-size: 13px; }
  .data-table tbody tr { transition: background-color .12s ease; }
  .data-table tbody tr:hover { background: #f5faf7; }
  .table-empty, .empty-inline { font-size: 13px; }

  .status-chip, .quality-pass, .quality-warning, .quality-fail, .quality-neutral,
  .panel-kicker, .review-state { font-size: 12px; }
  .toast { font-size: 14px; }

  /* Legibility floor -------------------------------------------------------
     The modules above this layer still declare 8-11px in places, and whatever
     they own that this layer never restates falls through to that size. These
     are the surfaces an operator reads to answer "what happened and what do I
     do now", so they get an explicit floor instead of inheriting one. */
  .campaign-task-copy > span,
  .campaign-task-progress strong,
  .timeline-capability,
  .timeline-status,
  .timeline-diagnostics-copy,
  .timeline-operation-state span,
  .campaign-task-operation-state small,
  .channel-account-row-copy small,
  .connected-copy span,
  .knowledge-meta,
  .knowledge-status,
  .run-copy small,
  .run-workflow,
  .run-row time,
  .funnel-footer span,
  .funnel-index,
  .grounding-row > small,
  .variant-item small,
  .video-plan span,
  .video-output-meta span,
  .video-output-meta small,
  .distribution-list span,
  .media-quality-pipeline-item > span,
  .media-quality-pipeline-item > small,
  .media-review-check small,
  .media-review-actions > span,
  .quality-waiver-list,
  .campaign-account-option small,
  .trend-evidence-table td > small,
  .preview-headline span,
  .stat-note,
  .section-note,
  .knowledge-summary { font-size: 12px; line-height: 1.55; }

  /* A failure the operator cannot read is a failure they cannot act on: this
     was 9px and grey, the least prominent text on a page reporting a break. */
  .campaign-task-error { font-size: 13px; line-height: 1.55; }
  .campaign-task-error summary { color: var(--red); font-weight: 650; }
  .campaign-task-error p,
  .campaign-task-error-targets li { font-size: 13px; }

  /* Row titles carry the identity of the thing being acted on. */
  .campaign-task-copy strong,
  .timeline-title,
  .channel-account-row-copy strong,
  .knowledge-title strong,
  .run-copy strong,
  .funnel-list strong { font-size: 14px; }

  /* Empty states read as a rendering fault when they are bare text. */
  .empty-state, .empty-state p, .knowledge-empty { font-size: 13px; line-height: 1.6; }

  /* Quality report: the panel reports ~24 checks, of which the operator only
     needs to act on the failing ones. Passing checks collapse so the failures
     are not outnumbered 20-to-4 on screen, and the raw rule identifiers move
     behind a disclosure instead of being the most eye-catching line. */
  .quality-check-passed { margin-top: 10px; border-top: 1px solid var(--line-soft); }
  .quality-check-passed > summary {
    display: flex; align-items: center; gap: 7px; padding: 9px 0;
    color: var(--green); font-size: 13px; font-weight: 650; cursor: pointer; list-style: none;
  }
  .quality-check-passed > summary::-webkit-details-marker { display: none; }
  .quality-check-passed > summary svg { width: 15px; height: 15px; }
  .quality-check-passed > summary svg:last-child { margin-left: auto; transition: transform 0.15s ease; }
  .quality-check-passed[open] > summary svg:last-child { transform: rotate(180deg); }
  .quality-check-passed .quality-check-grid { margin-top: 0; padding-bottom: 9px; }

  .quality-issue-suggestion {
    display: flex; align-items: flex-start; gap: 6px; margin-top: 5px;
    color: var(--ink-soft); font-family: inherit; font-size: 13px; line-height: 1.55;
  }
  .quality-issue-suggestion svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 2px; color: #856121; }
  .quality-issue-trace { margin-top: 5px; }
  .quality-issue-trace > summary {
    color: var(--muted); font-size: 12px; cursor: pointer;
    list-style: none; width: fit-content;
  }
  .quality-issue-trace > summary::-webkit-details-marker { display: none; }
  .quality-issue-trace > summary:hover { color: var(--ink-soft); }
  .quality-issue-trace code {
    display: block; margin-top: 4px; padding: 6px 8px; border-radius: 5px;
    background: var(--surface-muted, rgba(16, 32, 26, 0.045));
    color: #6d7a74; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px; line-height: 1.5; overflow-wrap: anywhere;
  }

  details.quality-more { padding-top: 0; text-align: left; }
  details.quality-more > summary {
    display: flex; align-items: center; gap: 6px; padding: 9px 0;
    border-top: 1px solid var(--line-soft);
    color: var(--ink-soft); font-size: 13px; font-weight: 600; cursor: pointer; list-style: none;
  }
  details.quality-more > summary::-webkit-details-marker { display: none; }
  details.quality-more > summary svg { width: 15px; height: 15px; margin-left: auto; transition: transform 0.15s ease; }
  details.quality-more[open] > summary svg { transform: rotate(180deg); }
  details.quality-more .quality-issue-list { margin-top: 0; }
}

@media (min-width: 1440px) {
  .page-header-copy { max-width: 780px; }
  .section-heading { min-height: 42px; align-items: center; }

  #overview .section-block { margin-top: 26px; }
  #overview .analytics-layout {
    grid-template-columns: minmax(0, 1.72fr) minmax(360px, .68fr);
    gap: 20px;
  }
  #overview .analytics-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  #campaign .content-grid {
    grid-template-columns: minmax(760px, 1.72fr) minmax(340px, .62fr);
    align-items: start;
    gap: 20px;
  }
  #campaign .campaign-panel { padding: 24px 26px; }
  #campaign .funnel-panel {
    position: sticky;
    top: 28px;
    align-self: start;
    padding: 22px;
  }

  #runs .campaign-target-matrix {
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #dbe3df;
    border-radius: 7px;
    box-shadow: 0 1px 2px rgb(27 51 42 / 4%);
  }
  #runs .campaign-target-matrix-heading { background: #fbfcfb; }
  #runs .run-grid {
    grid-template-columns: clamp(360px, 28vw, 560px) minmax(0, 1fr);
    align-items: start;
    gap: 20px;
  }
  #runs .timeline-panel,
  #runs .preview-panel { min-width: 0; }
  #runs .timeline-panel {
    padding: 22px 20px;
    background: #fbfcfb;
  }
  #runs .preview-panel {
    min-height: 560px;
    padding: 22px 24px;
  }
  #runs .panel-heading.compact {
    padding-bottom: 14px;
    border-bottom: 1px solid #e5ebe7;
  }
  #runs .recent-runs-section { margin-top: 26px; padding-top: 2px; }

  #channels .channel-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
  #channels .channel-card {
    min-height: 118px;
    padding: 16px;
    transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
  }
  #channels .channel-card:hover {
    border-color: #bfd0c8;
    box-shadow: 0 4px 14px rgb(27 51 42 / 7%);
    transform: translateY(-1px);
  }
  #channels .channel-account-layout {
    grid-template-columns: clamp(340px, 25vw, 470px) minmax(0, 1fr);
    gap: 20px;
    margin-top: 20px;
  }
  #channels .channel-account-list-panel,
  #channels .channel-account-editor-panel { padding: 22px; }

  #leads .lead-layout {
    grid-template-columns: minmax(0, 1.82fr) minmax(390px, .68fr);
    gap: 20px;
  }
  #leads .lead-filter-bar { padding: 4px 16px 16px; }
  #leads .interaction-queue-panel { margin-top: 20px; }

  #knowledge .knowledge-metric-band { gap: 12px; margin-bottom: 18px; }
  #knowledge .knowledge-metric { padding: 16px 17px; }
  #knowledge .knowledge-search { min-width: 280px; height: 38px; padding: 0 11px; }
  #knowledge .knowledge-search input { font-size: 13px; }
  #knowledge .knowledge-browse-layout .knowledge-list {
    height: clamp(580px, calc(100vh - 315px), 860px);
  }
  #knowledge .knowledge-list:has(> .empty-state:only-child) {
    height: auto;
    min-height: 260px;
  }
  #knowledge .knowledge-list:has(> .empty-state:only-child) > .empty-state {
    min-height: 260px;
  }
  #knowledge .knowledge-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 13px;
    padding: 16px 18px;
    transition: background-color .12s ease;
  }
  #knowledge .knowledge-row:hover { background: #f7faf8; }
  #knowledge .knowledge-icon { width: 40px; height: 40px; }

  #settings .capability-list,
  #settings .service-points-readonly,
  #settings .account-security { max-width: none; }
  #settings .settings-tabs { margin-bottom: 22px; }
  #settings .capability-slot-header { padding-right: 22px; padding-left: 22px; }
  #settings .capability-slot-form { padding: 18px 22px 22px; }
  #settings .service-points-summary { margin: 22px; }
  #settings .service-points-ledger-wrap { padding: 0 22px 22px; }

  .table-wrap,
  .analytics-table-wrap { scrollbar-gutter: stable; }
  .data-table thead th,
  .analytics-table thead th { position: sticky; z-index: 2; top: 0; }
}

@media (min-width: 1680px) {
  #settings .account-security-grid {
    grid-template-columns: minmax(300px, .62fr) minmax(520px, 1.08fr) minmax(360px, .78fr);
  }
  #settings .account-sessions-section {
    grid-column: auto;
    border-top: 0;
    border-left: 1px solid var(--line) !important;
  }
}

@keyframes desktop-page-enter {
  from { opacity: .72; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes desktop-page-loading {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-page, .workspace-page[data-loading="true"] > .page-header::after,
  .realtime-view-status[data-state="loading"]::before { animation: none !important; }
}

/* Text density: this console showed 35 decorative English eyebrows, a prose
   subtitle under every page title, and a paragraph under each funnel step —
   none of it load-bearing, all of it competing with the numbers an operator is
   actually scanning. Every eyebrow sits beside a Chinese heading that already
   says the same thing.

   Taken out of the visual flow but left in the accessibility tree rather than
   display:none, which would drop them from screen readers too. Several
   eyebrows are also written by JS, so the elements must keep existing. */
.eyebrow, .page-header p, .funnel-list p {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.funnel-list li { min-height: 44px; }

/* Progressive disclosure on the campaign form. Only 4 of its 21 controls are
   actually required; the rest default to "AI 自动决定" or to values nobody
   changes during a demo. Showing all 21 at once is what makes this page read
   as heavy, not the wording of any single label. Collapsed by default so the
   required path is the only thing on screen. */
.campaign-advanced, .campaign-execution-settings { border-top: 1px solid var(--line-soft); }
.campaign-advanced > summary, .campaign-execution-settings > summary {
  display: flex; min-height: 44px; align-items: center; gap: 8px;
  color: var(--ink); cursor: pointer; list-style: none;
}
.campaign-advanced > summary::-webkit-details-marker,
.campaign-execution-settings > summary::-webkit-details-marker { display: none; }
.campaign-advanced > summary svg, .campaign-execution-settings > summary svg {
  width: 16px; height: 16px; color: var(--green);
}
.campaign-advanced > summary > span, .campaign-execution-settings > summary > span {
  font-size: 13px; font-weight: 750;
}
.campaign-advanced > summary small, .campaign-execution-settings > summary small {
  margin-left: auto; overflow: hidden; color: var(--muted); font-size: 11px;
  text-overflow: ellipsis; white-space: nowrap;
}
.campaign-advanced > summary::after, .campaign-execution-settings > summary::after {
  content: "▸"; flex: 0 0 auto; color: var(--muted); font-size: 11px;
}
.campaign-advanced[open] > summary::after,
.campaign-execution-settings[open] > summary::after { content: "▾"; }
.campaign-advanced-body { display: grid; gap: 13px; padding: 2px 0 14px; }
