:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --page: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --surface-3: #e5e9ed;
  --ink: #17212b;
  --muted: #5d6975;
  --subtle: #7b8793;
  --line: #d9dfe5;
  --line-strong: #bdc7d1;
  --nav: #171c22;
  --nav-2: #222a33;
  --accent: #e85d2a;
  --accent-strong: #c74417;
  --accent-soft: #fff0e9;
  --green: #197a55;
  --green-soft: #e6f5ee;
  --blue: #2b64b1;
  --blue-soft: #e9f1fc;
  --purple: #7654a6;
  --purple-soft: #f1ebf8;
  --warning: #a05a09;
  --warning-soft: #fff3da;
  --danger: #b4233a;
  --danger-soft: #fff0f2;
  --radius: 8px;
  --focus: 0 0 0 3px rgba(232, 93, 42, .24);
  --topbar-height: 62px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--page); }
body { min-height: 100dvh; margin: 0; color: var(--ink); background: var(--page); overflow-x: hidden; }
button, input, textarea, select { font: inherit; }
button, a, label, select { -webkit-tap-highlight-color: transparent; }
button, a, label:has(input), select { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: none; box-shadow: var(--focus); }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ol, ul, blockquote { margin: 0; }
button { border: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(240px, 310px) minmax(0, 1fr) auto;
  align-items: center;
  min-height: var(--topbar-height);
  padding: 0 22px;
  color: #f8fafc;
  border-bottom: 1px solid #303943;
  background: rgba(23, 28, 34, .97);
  backdrop-filter: blur(14px);
}

.brand { display: inline-flex; align-items: center; gap: 13px; width: fit-content; min-height: 44px; font-size: 13px; font-weight: 700; }
.brand img { display: block; width: 108px; height: 32px; object-fit: contain; filter: brightness(0) invert(1); }
.brand span { padding-left: 13px; border-left: 1px solid rgba(255, 255, 255, .18); white-space: nowrap; }
.topnav { display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; }
.topnav a { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 12px; border-radius: 6px; color: #aeb7c1; font-size: 12px; font-weight: 650; transition: color .18s ease, background .18s ease; }
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.topnav a.is-active { color: #fff; background: var(--nav-2); box-shadow: inset 0 -2px 0 #ff7a47; }
.topnav svg { width: 16px; height: 16px; stroke-width: 1.9; }
.runtime-state { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 106px; min-height: 44px; color: #bac3cc; font-size: 12px; }
.runtime-dot { width: 7px; height: 7px; border-radius: 50%; background: #e2a63b; box-shadow: 0 0 0 4px rgba(226, 166, 59, .12); }
.runtime-state.is-ready .runtime-dot { background: #43b581; box-shadow: 0 0 0 4px rgba(67, 181, 129, .12); }
.runtime-state.is-error .runtime-dot { background: #ee6a7f; box-shadow: 0 0 0 4px rgba(238, 106, 127, .12); }

.workbench-shell { display: grid; grid-template-columns: 284px minmax(0, 1fr); width: min(100%, 1560px); min-height: calc(100dvh - var(--topbar-height)); margin: 0 auto; }
.archive-pane { position: sticky; top: var(--topbar-height); align-self: start; min-height: calc(100dvh - var(--topbar-height)); padding: 24px 18px 48px; border-right: 1px solid var(--line); background: #eef1f4; }
.analysis-pane { min-width: 0; padding: 30px clamp(24px, 4vw, 62px) 72px; }
.eyebrow { color: var(--accent-strong); font-size: 10px; font-weight: 800; line-height: 1.4; text-transform: uppercase; letter-spacing: 0; }
.archive-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.archive-heading h2 { margin-top: 3px; font-size: 20px; line-height: 1.25; }
.icon-button { display: inline-grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; border: 1px solid transparent; border-radius: 6px; color: var(--muted); background: transparent; transition: color .18s ease, border-color .18s ease, background .18s ease; }
.icon-button:hover { color: var(--ink); border-color: var(--line); background: var(--surface); }
.icon-button svg { width: 18px; height: 18px; stroke-width: 1.9; }

.search-field { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 7px; min-height: 44px; margin-top: 20px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); transition: border-color .18s ease, box-shadow .18s ease; }
.search-field:has(input:focus) { border-color: var(--accent); box-shadow: var(--focus); }
.search-field svg { width: 16px; height: 16px; color: var(--subtle); }
.search-field input { min-width: 0; width: 100%; height: 42px; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-field input::placeholder { color: #89939d; }
.filter-group { min-width: 0; margin: 20px 0 0; padding: 0; border: 0; }
.filter-group legend, .select-field > span { margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 750; line-height: 1.4; }
.filter-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.filter-button { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; min-height: 38px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: transparent; font-size: 12px; text-align: left; transition: color .18s ease, border-color .18s ease, background .18s ease; }
.filter-button:hover { color: var(--ink); border-color: var(--line-strong); background: rgba(255, 255, 255, .66); }
.filter-button.is-active { color: var(--accent-strong); border-color: rgba(232, 93, 42, .4); background: var(--accent-soft); font-weight: 700; }
.filter-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-button b { min-width: 20px; font-size: 10px; font-weight: 750; text-align: right; font-variant-numeric: tabular-nums; }
.select-field { display: grid; margin-top: 18px; }
.select-field select, .form-field select { width: 100%; min-height: 44px; padding: 0 34px 0 11px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: var(--surface); }
.archive-summary-row { display: flex; align-items: center; justify-content: space-between; min-height: 50px; margin-top: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.archive-summary-row .icon-button { width: 38px; height: 38px; }
.archive-list { display: grid; }
.archive-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; width: 100%; min-height: 82px; padding: 13px 2px; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; transition: background .18s ease, padding .18s ease; }
.archive-item:hover, .archive-item.is-active { padding-right: 9px; padding-left: 9px; background: rgba(255, 255, 255, .72); }
.archive-item.is-active { box-shadow: inset 3px 0 0 var(--accent); }
.archive-item strong { min-width: 0; overflow: hidden; font-size: 13px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.archive-item time { grid-column: 1; color: var(--subtle); font-size: 10px; font-variant-numeric: tabular-nums; }
.archive-item .archive-stage { grid-column: 2; grid-row: 1 / span 2; align-self: center; min-width: 34px; padding: 4px 6px; border-radius: 4px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 800; text-align: center; }
.archive-item.is-processing .archive-stage { color: var(--warning); background: var(--warning-soft); }
.archive-item.is-failed .archive-stage { color: var(--danger); background: var(--danger-soft); }
.archive-empty { padding: 24px 4px; color: var(--subtle); font-size: 12px; line-height: 1.6; text-align: center; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.page-heading h1 { margin-top: 5px; font-size: clamp(26px, 3vw, 38px); line-height: 1.15; letter-spacing: 0; text-wrap: balance; }
.page-heading p:not(.eyebrow) { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.secondary-command, .primary-command, .text-command { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; border-radius: 6px; font-weight: 700; transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .12s ease; }
.secondary-command { padding: 0 13px; border: 1px solid var(--line-strong); color: var(--ink); background: var(--surface); font-size: 12px; }
.secondary-command:hover { border-color: #9eaab5; background: #fafbfc; }
.primary-command { min-height: 48px; padding: 0 20px; color: #fff; background: var(--accent); font-size: 13px; }
.primary-command:hover:not(:disabled) { background: var(--accent-strong); box-shadow: 0 8px 20px rgba(199, 68, 23, .19); }
.primary-command:active:not(:disabled), .secondary-command:active, .text-command:active { transform: translateY(1px); }
.primary-command:disabled { cursor: wait; opacity: .56; }
.text-command { min-height: 40px; padding: 0 9px; color: var(--blue); background: transparent; font-size: 12px; }
.text-command:hover { background: var(--blue-soft); }
.secondary-command svg, .primary-command svg, .text-command svg { width: 16px; height: 16px; stroke-width: 1.9; }

.intake-band { padding: 26px 0 30px; border-bottom: 1px solid var(--line); }
.intake-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.intake-title-row h2 { font-size: 18px; line-height: 1.3; }
.intake-title-row p { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.process-steps { display: grid; grid-template-columns: repeat(4, minmax(64px, 1fr)); gap: 0; min-width: 340px; padding: 0; list-style: none; }
.process-steps li { position: relative; display: flex; align-items: center; gap: 6px; min-height: 32px; color: var(--subtle); font-size: 10px; font-weight: 700; }
.process-steps li::after { position: absolute; right: 7px; left: 31px; bottom: 1px; height: 2px; content: ""; background: var(--line); }
.process-steps li:last-child::after { display: none; }
.process-steps span { display: grid; place-items: center; flex: 0 0 auto; width: 23px; height: 23px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); font-size: 9px; font-variant-numeric: tabular-nums; }
.process-steps li.is-current, .process-steps li.is-done { color: var(--accent-strong); }
.process-steps li.is-current span, .process-steps li.is-done span { border-color: var(--accent); color: #fff; background: var(--accent); }
.process-steps li.is-done::after { background: var(--accent); }

.analysis-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 18px; margin-top: 22px; }
.form-error { grid-column: 1 / -1; padding: 12px 14px; border-left: 3px solid var(--danger); border-radius: 4px; color: var(--danger); background: var(--danger-soft); font-size: 12px; line-height: 1.55; }
.source-fieldset { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; }
.source-fieldset legend { margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 750; }
.segmented-control { display: grid; grid-template-columns: repeat(2, 1fr); width: min(100%, 340px); padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.segmented-control label { min-width: 0; }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 10px; border-radius: 5px; color: var(--muted); font-size: 12px; font-weight: 650; transition: color .18s ease, background .18s ease, box-shadow .18s ease; }
.segmented-control input:checked + span { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgba(29, 39, 49, .11); }
.segmented-control input:focus-visible + span { box-shadow: var(--focus); }
.segmented-control svg { width: 16px; height: 16px; }
.source-input { grid-column: 1 / -1; }
.source-input > label:not(.upload-zone), .form-field > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 750; line-height: 1.4; }
.form-field b { color: var(--accent-strong); }
.form-field em { margin-left: 5px; color: var(--subtle); font-size: 10px; font-style: normal; font-weight: 500; }
.source-input > label em { margin-left: 5px; color: var(--accent-strong); font-size: 9px; font-style: normal; font-weight: 750; }
.url-input-wrap { display: grid; grid-template-columns: 23px minmax(0, 1fr); align-items: start; min-height: 78px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); transition: border-color .18s ease, box-shadow .18s ease; }
.url-input-wrap:has(textarea:focus) { border-color: var(--accent); box-shadow: var(--focus); }
.url-input-wrap svg { width: 16px; height: 16px; margin-top: 3px; color: var(--subtle); }
.url-input-wrap textarea { min-width: 0; width: 100%; min-height: 56px; padding: 0; resize: vertical; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.field-hint { display: flex; justify-content: space-between; gap: 12px; }
.field-hint strong { flex: 0 0 auto; color: var(--accent-strong); font-size: 10px; font-variant-numeric: tabular-nums; }
.field-hint { min-height: 18px; margin-top: 5px; color: var(--subtle); font-size: 10px; line-height: 1.5; }
.upload-zone { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 78px; padding: 12px 14px; border: 1px dashed #aeb9c3; border-radius: 7px; background: rgba(255, 255, 255, .68); transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.upload-zone:hover, .upload-zone.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone:has(input:focus-visible) { box-shadow: var(--focus); }
.upload-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 6px; color: var(--accent-strong); background: var(--accent-soft); }
.upload-icon svg { width: 21px; height: 21px; }
.upload-copy { display: grid; min-width: 0; gap: 3px; }
.upload-copy strong { min-width: 0; overflow: hidden; font-size: 13px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.upload-copy small { color: var(--subtle); font-size: 10px; line-height: 1.4; }
.choose-file { min-width: 84px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; color: var(--blue); background: var(--surface); font-size: 11px; font-weight: 700; text-align: center; }
.field-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-field { min-width: 0; }
.form-field input, .form-field textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: var(--surface); transition: border-color .18s ease, box-shadow .18s ease; }
.form-field input { min-height: 44px; padding: 0 11px; font-size: 13px; }
.form-field textarea { min-height: 152px; padding: 11px 12px; resize: vertical; font-size: 13px; line-height: 1.65; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--accent); }
.form-field input[aria-invalid="true"], .form-field textarea[aria-invalid="true"] { border-color: var(--danger); background: #fffafb; }
.transcript-field { position: relative; grid-column: 1 / -1; }
.transcript-field small { position: absolute; right: 10px; bottom: 8px; padding: 2px 5px; color: var(--subtle); background: rgba(255, 255, 255, .91); font-size: 9px; font-variant-numeric: tabular-nums; }
.form-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 2px; }

.empty-result { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 260px; color: var(--muted); }

.queue-overview { margin-top: 22px; padding: 18px 0 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.queue-overview > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 10px; }
.queue-overview > header span { color: var(--muted); font-size: 9px; font-weight: 750; }
.queue-overview > header h2 { margin-top: 2px; font-size: 16px; line-height: 1.35; }
.queue-overview > header > strong { color: var(--accent-strong); font-size: 11px; font-variant-numeric: tabular-nums; }
.queue-list { display: grid; }
.queue-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, .7fr) 44px; align-items: center; gap: 14px; min-height: 68px; border-top: 1px solid var(--line); }
.queue-main { min-width: 0; padding: 10px 0; color: var(--ink); background: transparent; text-align: left; }
.queue-main strong, .queue-main small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-main strong { font-size: 12px; line-height: 1.4; }
.queue-main small { margin-top: 4px; color: var(--subtle); font-size: 9px; }
.queue-state { min-width: 0; }
.queue-state > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; }
.queue-state > div strong { color: var(--ink); font-size: 9px; font-variant-numeric: tabular-nums; }
.queue-track { display: block; height: 5px; margin-top: 7px; overflow: hidden; border-radius: 3px; background: var(--surface-3); }
.queue-track i { display: block; width: var(--queue-progress, 0%); height: 100%; border-radius: inherit; background: var(--accent); transition: width .3s ease; }
.queue-row.is-retrying .queue-track i { background: #d98a20; }
.queue-row.is-failed .queue-state > div, .queue-row.is-failed .queue-state > div strong { color: var(--danger); }
.queue-row.is-failed .queue-track i { background: var(--danger); }
.queue-retry { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 6px; color: var(--danger); background: var(--surface); }
.queue-retry:hover { border-color: #e0a4ae; background: var(--danger-soft); }
.queue-retry svg { width: 16px; height: 16px; }
.queue-indicator { display: grid; place-items: center; width: 44px; height: 44px; color: var(--accent); }
.queue-indicator svg { width: 17px; height: 17px; }
.empty-result > span { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 8px; color: var(--subtle); background: rgba(255, 255, 255, .6); }
.empty-result svg { width: 25px; height: 25px; stroke-width: 1.5; }
.empty-result h2 { color: var(--ink); font-size: 16px; line-height: 1.4; }
.empty-result p { margin-top: 4px; font-size: 11px; line-height: 1.55; }

.result-workspace { padding-top: 28px; }
.result-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.result-title-wrap { min-width: 0; }
.record-badges { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.record-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border-radius: 4px; font-size: 10px; font-weight: 750; }
.record-badge.is-category { color: var(--purple); background: var(--purple-soft); }
.record-badge.is-stage { color: var(--blue); background: var(--blue-soft); }
.record-badge.is-engine { color: var(--green); background: var(--green-soft); }
.result-header h2 { margin-top: 7px; font-size: clamp(21px, 2.5vw, 30px); line-height: 1.25; letter-spacing: 0; overflow-wrap: anywhere; }
.result-header p { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.result-actions { display: flex; align-items: center; flex: 0 0 auto; flex-wrap: nowrap; gap: 8px; }
.result-actions .secondary-command { min-width: 96px; white-space: nowrap; }
.rewrite-command { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 14px; border-radius: 6px; color: #fff; background: var(--accent); font-size: 12px; font-weight: 750; transition: background .18s ease, box-shadow .18s ease; }
.rewrite-command:hover:not(:disabled) { background: var(--accent-strong); box-shadow: 0 7px 18px rgba(199, 68, 23, .18); }
.rewrite-command:disabled { cursor: wait; opacity: .58; }
.rewrite-command svg { width: 16px; height: 16px; stroke-width: 1.9; }
.engine-warning { margin-top: 16px; padding: 10px 12px; border-left: 3px solid #d98a20; border-radius: 4px; color: var(--warning); background: var(--warning-soft); font-size: 11px; line-height: 1.55; }

.source-review { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); gap: 24px; margin-top: 22px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.media-preview { min-width: 0; min-height: 158px; overflow: hidden; border-radius: 7px; color: #d6dee7; background: #202832; }
.media-preview video { display: block; width: 100%; height: 100%; min-height: 158px; max-height: 320px; object-fit: contain; background: #11161c; }
.media-placeholder { display: grid; place-items: center; align-content: center; gap: 9px; min-height: 158px; padding: 20px; text-align: center; }
.media-placeholder svg { width: 30px; height: 30px; stroke-width: 1.4; }
.media-placeholder strong { max-width: 100%; overflow-wrap: anywhere; font-size: 12px; line-height: 1.45; }
.media-placeholder a { color: #ffb08f; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.transcript-review { min-width: 0; }
.transcript-evidence { display: flex; align-items: center; gap: 8px; margin-top: 7px; color: var(--subtle); font-size: 9px; }
.transcript-evidence span { padding: 3px 6px; border-radius: 3px; color: var(--green); background: var(--green-soft); font-weight: 750; }
.transcript-evidence a { color: var(--blue); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.section-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-label-row h3 { font-size: 13px; line-height: 1.4; }
.transcript-review p { display: -webkit-box; margin-top: 11px; overflow: hidden; color: #3f4b57; font-size: 13px; line-height: 1.75; -webkit-box-orient: vertical; -webkit-line-clamp: 5; }
.transcript-segment { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 9px; padding: 8px 0; border-top: 1px solid var(--line); }
.transcript-segment:first-child { padding-top: 0; border-top: 0; }
.transcript-segment time { color: var(--accent-strong); font-size: 9px; font-weight: 800; font-variant-numeric: tabular-nums; }
.transcript-segment > span { min-width: 0; color: #3f4b57; font-size: 11px; line-height: 1.65; }
.transcript-review.is-expanded p { display: block; max-height: 340px; overflow: auto; padding-right: 7px; }

.deep-analysis-pending { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 13px; margin-top: 20px; padding: 16px; border: 1px solid #e9c78f; border-radius: 7px; color: var(--warning); background: var(--warning-soft); }
.deep-analysis-pending > span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 6px; background: rgba(255, 255, 255, .72); }
.deep-analysis-pending svg { width: 20px; height: 20px; }
.deep-analysis-pending h3 { font-size: 13px; line-height: 1.4; }
.deep-analysis-pending p { margin-top: 4px; font-size: 10px; line-height: 1.6; }

.stage-strip { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(430px, 1.2fr); gap: 26px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.stage-answer > span { color: var(--muted); font-size: 10px; font-weight: 750; }
.stage-answer strong { display: block; margin-top: 6px; color: var(--accent-strong); font-size: 24px; line-height: 1.2; }
.stage-answer p { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.stage-ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; gap: 4px; min-width: 0; }
.stage-node { position: relative; display: grid; place-items: center; min-width: 0; min-height: 64px; padding: 7px 4px; border: 1px solid var(--line); border-radius: 6px; color: var(--subtle); background: var(--surface); text-align: center; }
.stage-node strong { font-size: 13px; line-height: 1.2; }
.stage-node span { margin-top: 4px; font-size: 9px; line-height: 1.2; white-space: nowrap; }
.stage-node.is-active { color: #fff; border-color: var(--accent); background: var(--accent); box-shadow: 0 8px 18px rgba(199, 68, 23, .16); }

.audience-profile { display: grid; grid-template-columns: minmax(220px, .55fr) minmax(0, 1.45fr); gap: 18px 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.audience-profile-heading > div > span { color: var(--muted); font-size: 10px; font-weight: 750; }
.audience-profile-heading h3 { margin-top: 5px; color: var(--accent-strong); font-size: 20px; line-height: 1.3; }
.audience-profile-heading p { margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.audience-group-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.audience-group { display: grid; place-items: center; align-content: center; min-width: 0; min-height: 54px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--subtle); background: var(--surface); text-align: center; }
.audience-group strong { max-width: 100%; overflow: hidden; font-size: 10px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.audience-group span { margin-top: 3px; font-size: 8px; line-height: 1.2; }
.audience-group.is-primary { color: #fff; border-color: var(--accent); background: var(--accent); }
.audience-group.is-secondary { color: var(--blue); border-color: #b9cdea; background: var(--blue-soft); }
.audience-dimensions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.audience-dimensions > div { min-width: 0; padding: 12px 14px; border-left: 1px solid var(--line); }
.audience-dimensions > div:first-child { border-left: 0; }
.audience-dimensions dt { color: var(--subtle); font-size: 9px; font-weight: 750; }
.audience-dimensions dd { margin: 4px 0 0; color: var(--ink); font-size: 12px; font-weight: 750; line-height: 1.4; }
.audience-dimensions small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }

.view-tabs { display: flex; gap: 24px; min-height: 58px; border-bottom: 1px solid var(--line); }
.view-tabs button { position: relative; min-height: 58px; padding: 0 2px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 750; }
.view-tabs button::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; content: ""; background: transparent; }
.view-tabs button[aria-selected="true"] { color: var(--ink); }
.view-tabs button[aria-selected="true"]::after { background: var(--accent); }
.breakdown-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.breakdown-block { min-width: 0; padding: 22px 24px 22px 0; border-bottom: 1px solid var(--line); }
.breakdown-block:nth-child(odd) { border-right: 1px solid var(--line); }
.breakdown-block:nth-child(even) { padding-right: 0; padding-left: 24px; }
.breakdown-block.is-wide { grid-column: 1 / -1; padding-right: 0; border-right: 0; }
.content-structure-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.structure-stage { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.structure-stage figure { position: relative; height: 150px; margin: -13px -13px 12px; overflow: hidden; border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; background: #1d2630; }
.structure-stage figure img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.structure-stage figcaption { position: absolute; right: 7px; bottom: 7px; padding: 3px 6px; border-radius: 3px; color: #fff; background: rgba(15, 20, 27, .78); font-size: 8px; font-weight: 750; }
.structure-stage header { display: flex; align-items: center; gap: 7px; min-height: 24px; }
.structure-stage header > span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 4px; color: var(--accent-strong); background: var(--accent-soft); font-size: 9px; font-weight: 850; }
.structure-stage header strong { min-width: 0; font-size: 11px; line-height: 1.35; }
.structure-stage header em { margin-left: auto; padding: 3px 5px; border-radius: 3px; color: var(--purple); background: var(--purple-soft); font-size: 8px; font-style: normal; white-space: nowrap; }
.structure-stage blockquote { margin: 10px 0 0; color: #2e3b47; font-size: 11px; font-weight: 650; line-height: 1.55; }
.structure-stage p { margin-top: 7px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.structure-stage small { display: block; margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--line); color: var(--blue); font-size: 8px; line-height: 1.45; }
.selling-point-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.selling-point-list span { padding: 3px 5px; border-radius: 3px; color: var(--green); background: var(--green-soft); font-size: 8px; font-weight: 700; }
.block-number { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 5px; color: var(--accent-strong); background: var(--accent-soft); font-size: 10px; font-weight: 850; }
.breakdown-block h3 { display: inline; margin-left: 7px; font-size: 14px; line-height: 1.45; }
.analysis-quote { margin-top: 13px; padding: 12px 14px; border-left: 3px solid var(--accent); color: #303b46; background: #f0f2f4; font-size: 13px; font-weight: 650; line-height: 1.65; }
.block-explanation { margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.tactic-list { display: grid; margin-top: 10px; }
.tactic-row { display: grid; grid-template-columns: minmax(84px, .35fr) minmax(0, 1.65fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.tactic-row:first-child { border-top: 0; }
.tactic-row strong { font-size: 11px; line-height: 1.5; }
.tactic-row p { color: var(--muted); font-size: 11px; line-height: 1.6; }
.comment-os-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.comment-os-list span { padding: 5px 7px; border-radius: 4px; color: var(--blue); background: var(--blue-soft); font-size: 10px; line-height: 1.4; }
.boundary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 14px; }
.boundary-column { min-width: 0; padding: 14px; border-radius: 6px; }
.boundary-column.is-changeable { color: var(--green); background: var(--green-soft); }
.boundary-column.is-fixed { color: var(--danger); background: var(--danger-soft); }
.boundary-column h4 { margin: 0; font-size: 11px; line-height: 1.4; }
.boundary-column ul { display: grid; gap: 7px; margin: 9px 0 0; padding-left: 17px; }
.boundary-column li { color: #3e4a56; font-size: 11px; line-height: 1.55; }

.rewrite-panel { padding-top: 22px; }
.rewrite-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.rewrite-heading h3 { font-size: 16px; line-height: 1.4; }
.rewrite-heading p { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.rewrite-structure { display: grid; justify-items: end; gap: 6px; max-width: 54%; }
.rewrite-structure > strong { color: var(--muted); font-size: 9px; }
.structure-flow { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.structure-flow span { display: inline-flex; align-items: center; min-height: 26px; padding: 0 8px; border-radius: 4px; color: var(--purple); background: var(--purple-soft); font-size: 9px; font-weight: 700; }
.rewrite-lines { display: grid; }
.rewrite-line { display: grid; grid-template-columns: 86px minmax(0, 1fr) minmax(180px, .72fr); gap: 16px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.rewrite-part { display: grid; gap: 5px; }
.rewrite-part strong { font-size: 10px; line-height: 1.4; }
.rewrite-part span { width: fit-content; padding: 3px 6px; border-radius: 4px; color: var(--accent-strong); background: var(--accent-soft); font-size: 9px; }
.rewrite-copy { color: #25313c; font-size: 13px; font-weight: 650; line-height: 1.65; }
.rewrite-os { padding: 10px 11px; border-radius: 5px; color: var(--blue); background: var(--blue-soft); font-size: 10px; line-height: 1.55; }
.rewrite-os strong { display: block; margin-bottom: 3px; color: #244f88; font-size: 9px; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; max-width: min(360px, calc(100% - 44px)); padding: 11px 14px; border-radius: 6px; color: #fff; background: #222a33; box-shadow: 0 12px 34px rgba(16, 24, 32, .24); font-size: 12px; line-height: 1.45; }
.spin { animation: spin .8s linear infinite; }

@media (max-width: 1100px) {
  .topbar { grid-template-columns: minmax(210px, 1fr) auto; }
  .topnav { display: none; }
  .workbench-shell { grid-template-columns: 250px minmax(0, 1fr); }
  .analysis-pane { padding-right: 28px; padding-left: 28px; }
  .intake-title-row { display: grid; }
  .process-steps { min-width: 0; width: 100%; }
  .stage-strip { grid-template-columns: 1fr; }
  .content-structure-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  :root { --topbar-height: 58px; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; min-height: var(--topbar-height); padding: 0 14px; }
  .brand img { width: 94px; height: 29px; }
  .brand span { display: none; }
  .runtime-state { min-width: 92px; font-size: 11px; }
  .workbench-shell { display: block; }
  .archive-pane { position: static; min-height: 0; padding: 17px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .archive-heading, .search-field, .select-field, .archive-summary-row { display: none; }
  .filter-group { margin: 0; }
  .filter-group legend { margin-bottom: 7px; }
  .filter-list { display: flex; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .filter-list::-webkit-scrollbar { display: none; }
  .filter-button { flex: 0 0 auto; min-width: 74px; }
  .archive-list { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .archive-list::-webkit-scrollbar { display: none; }
  .archive-item { flex: 0 0 220px; min-height: 66px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255, 255, 255, .72); }
  .archive-item:hover, .archive-item.is-active { padding: 9px 10px; }
  .archive-empty { width: 100%; padding: 10px 0 2px; text-align: left; }
  .analysis-pane { padding: 22px 16px 54px; }
  .page-heading { align-items: flex-start; gap: 14px; }
  .page-heading h1 { font-size: 25px; }
  .page-heading p:not(.eyebrow) { max-width: 270px; font-size: 12px; }
  .page-heading .secondary-command { width: 44px; padding: 0; }
  .page-heading .secondary-command span { display: none; }
  .analysis-form { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .form-field { grid-column: 1; }
  .process-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .process-steps li { display: grid; justify-items: center; gap: 3px; text-align: center; }
  .process-steps li::after { right: -35%; left: 65%; top: 11px; bottom: auto; }
  .upload-zone { grid-template-columns: 44px minmax(0, 1fr); }
  .choose-file { display: none; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .primary-command { width: 100%; }
  .queue-row { grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; padding: 9px 0; }
  .queue-main { padding: 0; }
  .queue-state { grid-column: 1; }
  .queue-retry, .queue-indicator { grid-column: 2; grid-row: 1 / span 2; }
  .source-review { grid-template-columns: 1fr; gap: 16px; }
  .media-preview { min-height: 180px; }
  .stage-ladder { grid-template-columns: repeat(5, minmax(54px, 1fr)); overflow-x: auto; padding-bottom: 4px; }
  .stage-node { min-width: 54px; }
  .breakdown-panel { grid-template-columns: 1fr; }
  .audience-profile { grid-template-columns: 1fr; }
  .audience-group-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .audience-dimensions { grid-template-columns: 1fr; }
  .audience-dimensions > div { border-top: 1px solid var(--line); border-left: 0; }
  .audience-dimensions > div:first-child { border-top: 0; }
  .content-structure-grid { grid-template-columns: 1fr; }
  .breakdown-block, .breakdown-block:nth-child(even) { grid-column: 1; padding: 19px 0; border-right: 0; }
  .result-header { display: grid; }
  .result-actions { justify-content: flex-start; }
  .rewrite-heading { display: grid; }
  .rewrite-structure { justify-items: start; max-width: none; }
  .structure-flow { justify-content: flex-start; }
  .rewrite-line { grid-template-columns: 70px minmax(0, 1fr); gap: 10px; }
  .rewrite-os { grid-column: 2; }
}

@media (max-width: 390px) {
  .analysis-pane { padding-right: 12px; padding-left: 12px; }
  .archive-pane { padding-right: 12px; padding-left: 12px; }
  .page-heading p:not(.eyebrow) { max-width: 230px; }
  .intake-title-row { gap: 18px; }
  .segmented-control { width: 100%; }
  .boundary-grid { grid-template-columns: 1fr; }
  .result-actions .secondary-command span { display: none; }
  .result-actions .secondary-command { width: 44px; padding: 0; }
}

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

@keyframes spin { to { transform: rotate(360deg); } }
