:root {
  --canvas: #f4f7fa;
  --paper: #ffffff;
  --ink: #10243c;
  --ink-soft: #30445d;
  --muted: #66768a;
  --muted-2: #8996a7;
  --rule: #d9e2ea;
  --rule-strong: #c7d4df;
  --teal: #0b8e95;
  --teal-dark: #08747a;
  --teal-soft: #eaf7f7;
  --amber: #b76a08;
  --amber-soft: #fff6e7;
  --red: #c5403a;
  --red-soft: #fff0ee;
  --green: #287c5b;
  --green-soft: #eaf7f1;
  --blue-soft: #edf4fb;
  --display: "Avenir Next", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --body: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --data: "DIN Alternate", "SFMono-Regular", "Roboto Mono", monospace;
  color: var(--ink);
  font-family: var(--body);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); min-width: 1024px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
small { display: block; }

:focus-visible {
  outline: 3px solid rgba(11, 142, 149, 0.34);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.desktop-notice { display: none; }
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 176px;
  display: flex;
  flex-direction: column;
  background: #f9fbfd;
  border-right: 1px solid var(--rule);
}

.brand {
  height: 82px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--rule);
}

.brand > span:last-child { min-width: 0; }
.brand strong { display: block; font: 700 18px/1.1 var(--display); letter-spacing: 0.04em; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 10px; letter-spacing: 0.04em; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; display: flex; align-items: flex-end; gap: 3px; padding: 5px; border: 1px solid var(--rule-strong); border-radius: 8px; background: var(--paper); }
.brand-mark i { display: block; width: 4px; border-radius: 3px 3px 1px 1px; background: var(--teal); }
.brand-mark i:nth-child(1) { height: 9px; }
.brand-mark i:nth-child(2) { height: 18px; background: var(--ink); }
.brand-mark i:nth-child(3) { height: 13px; }

.nav-list { padding: 18px 10px; display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border: 1px solid transparent; border-radius: 8px; color: var(--ink-soft); }
.nav-item span { display: grid; place-items: center; width: 26px; height: 26px; color: var(--muted); border: 1px solid var(--rule-strong); border-radius: 7px; font-size: 12px; font-weight: 700; background: var(--paper); }
.nav-item b { font-size: 14px; font-weight: 560; }
.nav-item:hover { background: var(--paper); border-color: var(--rule); }
.nav-item.active { color: var(--teal-dark); background: var(--teal-soft); }
.nav-item.active span { color: white; background: var(--teal); border-color: var(--teal); }

.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 18px; border-top: 1px solid var(--rule); }
.sidebar-foot strong { display: block; font-size: 11px; font-weight: 600; }
.sidebar-foot small { margin-top: 3px; color: var(--muted); font: 10px var(--data); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }

.workspace { margin-left: 176px; min-height: 100vh; transition: margin-right 220ms ease; }
.task-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 22px 30px 20px; background: rgba(255,255,255,0.94); border-bottom: 1px solid var(--rule); }
.eyebrow { display: flex; gap: 8px; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.eyebrow a { color: var(--teal-dark); }
.title-row { display: flex; align-items: center; gap: 12px; }
.title-row h1 { font: 700 clamp(22px, 2vw, 28px)/1.18 var(--display); letter-spacing: -0.025em; }
.status { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); border-radius: 6px; padding: 5px 8px; font-size: 12px; font-weight: 600; }
.status.running { color: var(--teal-dark); background: var(--teal-soft); border-color: #b9dfdf; }
.status.running span { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.context-tags { display: flex; gap: 7px; margin-top: 10px; }
.context-tags span { padding: 5px 9px; color: var(--ink-soft); background: var(--blue-soft); border: 1px solid #d6e3ee; border-radius: 5px; font-size: 11px; }

.header-actions { display: flex; align-items: center; gap: 10px; padding-top: 17px; }
.concept-badge { padding: 8px 10px; color: var(--amber); background: var(--amber-soft); border: 1px solid #ebcc99; border-radius: 6px; font-size: 11px; font-weight: 650; }
.scenario-control { height: 34px; display: flex; align-items: center; border: 1px solid var(--rule-strong); border-radius: 6px; overflow: hidden; background: var(--paper); }
.scenario-control > span { padding: 0 9px; color: var(--muted); border-right: 1px solid var(--rule); font-size: 11px; }
.scenario-control select { height: 100%; min-width: 130px; border: 0; padding: 0 28px 0 9px; background: transparent; color: var(--ink); font-size: 12px; outline: none; }

.main-content { width: min(1480px, calc(100% - 48px)); margin: 0 auto; padding: 20px 0 42px; }
.ledger-section { margin-top: 14px; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.ledger-section[id] { scroll-margin-top: 18px; }
.ledger-section:first-of-type { margin-top: 0; }
.section-heading { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--rule); }
.section-heading > div:first-child { display: flex; align-items: baseline; gap: 10px; }
.section-heading h2 { font: 680 17px/1.25 var(--display); letter-spacing: -0.01em; }
.section-index { color: var(--teal-dark); font: 700 10px/1 var(--body); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.section-heading p, .heading-meta { color: var(--muted); font-size: 11px; }
.heading-meta { display: flex; align-items: center; gap: 16px; }
.compact-heading { min-height: 44px; }

.scenario-banner { min-height: 64px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin-bottom: 14px; padding: 12px 16px; background: var(--amber-soft); border: 1px solid #e9cc9e; border-left: 4px solid var(--amber); border-radius: 8px; }
.scenario-banner[hidden] { display: none; }
.banner-icon { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #dba75f; border-radius: 50%; color: var(--amber); font-weight: 800; }
.scenario-banner strong { font-size: 13px; }
.scenario-banner p { margin-top: 4px; color: var(--ink-soft); font-size: 11px; }
.scenario-banner.info { background: var(--blue-soft); border-color: #c7dced; border-left-color: #4e83ad; }
.scenario-banner.info .banner-icon { color: #386f99; border-color: #83aac8; }

.funnel { --funnel-border: #6f9fa8; list-style: none; min-height: 154px; display: flex; align-items: center; margin: 0; padding: 12px 18px 14px; overflow: hidden; }
.funnel li { --stage-height: 112px; position: relative; z-index: 1; flex: 1 1 0; height: var(--stage-height); min-width: 0; display: flex; flex-direction: column; justify-content: center; margin-left: -13px; padding: 14px 30px 14px 34px; isolation: isolate; }
.funnel li::before { content: ""; position: absolute; z-index: -1; inset: 0; background: #f4f8fa; clip-path: polygon(0 0, calc(100% - 17px) 0, 100% 50%, calc(100% - 17px) 100%, 0 100%, 17px 50%); filter: drop-shadow(0 -1px 0 var(--funnel-border)) drop-shadow(0 1px 0 var(--funnel-border)) drop-shadow(1px 0 0 var(--funnel-border)) drop-shadow(-1px 0 0 var(--funnel-border)); }
.funnel li:first-child { z-index: 6; margin-left: 0; padding-left: 28px; }
.funnel li:first-child::before { clip-path: polygon(0 0, calc(100% - 17px) 0, 100% 50%, calc(100% - 17px) 100%, 0 100%); box-shadow: inset 6px 0 0 var(--teal); }
.funnel li:nth-child(2) { z-index: 5; --stage-height: 118px; }
.funnel li:nth-child(3) { z-index: 4; --stage-height: 110px; }
.funnel li:nth-child(4) { z-index: 3; --stage-height: 102px; }
.funnel li:nth-child(5) { z-index: 2; --stage-height: 94px; }
.funnel li:nth-child(6) { z-index: 1; --stage-height: 86px; padding-right: 26px; }
.funnel li:first-child { --stage-height: 126px; }
.funnel li:not(:last-child)::after { content: "→"; position: absolute; right: 3px; top: 50%; z-index: 4; width: 28px; height: 28px; display: grid; place-items: center; color: var(--teal-dark); background: var(--paper); border: 1px solid var(--rule); border-radius: 50%; box-shadow: 0 2px 8px rgba(16,36,60,0.08); font: 700 15px/1 var(--body); transform: translate(50%, -50%); }
.funnel span, .funnel strong, .funnel small { position: relative; z-index: 2; }
.funnel span { color: var(--muted); font-size: 11px; font-weight: 600; }
.funnel strong { margin-top: 7px; font: 720 24px/1 var(--data); letter-spacing: -0.035em; }
.funnel small { margin-top: 8px; color: var(--muted); font: 600 10px var(--data); }
.funnel .attention::before { background: var(--red-soft); filter: drop-shadow(0 -1px 0 var(--red)) drop-shadow(0 1px 0 var(--red)) drop-shadow(1px 0 0 var(--red)) drop-shadow(-1px 0 0 var(--red)); }
.funnel .attention::after { color: var(--red); border-color: #efc1bd; }
.funnel .attention span, .funnel .attention strong, .funnel .attention small { color: var(--red); }

.diagnostic-list { display: grid; }
.diagnostic-row { width: 100%; display: grid; grid-template-columns: 38px minmax(180px, 1.15fr) 105px minmax(240px, 1.5fr) 118px 100px; align-items: center; gap: 12px; min-height: 74px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--rule); background: var(--paper); color: var(--ink); text-align: left; }
.diagnostic-row:last-child { border-bottom: 0; }
.diagnostic-row:hover { background: #fbfdfe; }
.diagnostic-row.active { position: relative; background: #f8fcfc; box-shadow: inset 3px 0 0 var(--teal); }
.diagnostic-row.active::after { content: ""; position: absolute; inset: -1px 0; pointer-events: none; border: 1px solid var(--teal); }
.severity { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-size: 10px; font-weight: 750; }
.severity.high { color: var(--red); background: var(--red-soft); border: 1px solid #efc1bd; }
.severity.medium { color: var(--amber); background: var(--amber-soft); border: 1px solid #ecd2a8; }
.severity.low { color: var(--muted); background: #eef2f6; border: 1px solid var(--rule); }
.diagnostic-name strong, .diagnostic-finding strong { display: block; font-size: 13px; font-weight: 620; }
.diagnostic-name small, .diagnostic-finding small { margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 400; }
.metric-change b { display: block; color: var(--red); font: 700 20px/1 var(--data); }
.metric-change small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.review-state { width: max-content; padding: 5px 8px; border-radius: 5px; font-size: 10px; white-space: nowrap; }
.review-state.pending { color: var(--amber); background: var(--amber-soft); border: 1px solid #ebcf9f; }
.review-state.observation { color: var(--muted); background: #f0f4f7; border: 1px solid var(--rule); }
.review-state.confirmed { color: var(--green); background: var(--green-soft); border: 1px solid #bbdecf; }
.review-state.rejected { color: var(--red); background: var(--red-soft); border: 1px solid #efc1bd; }
.row-action { justify-self: end; color: var(--teal-dark); font-size: 11px; font-weight: 650; }
.row-action i { margin-left: 7px; font-style: normal; }

.analysis-heading { border-bottom: 0; }
.causal-note { padding: 5px 8px; background: #f3f6f8; border: 1px solid var(--rule); border-radius: 5px; }
.tabs { display: flex; padding: 0 18px; border-bottom: 1px solid var(--rule); }
.tabs button { min-width: 104px; padding: 12px 16px 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 12px; }
.tabs button[aria-selected="true"] { color: var(--teal-dark); border-bottom-color: var(--teal); font-weight: 650; }
.analysis-panel { display: grid; grid-template-columns: minmax(300px, 0.75fr) minmax(460px, 1.25fr); min-height: 250px; }
.analysis-summary { padding: 22px; border-right: 1px solid var(--rule); }
.signal-label { display: inline-block; padding: 4px 7px; color: var(--teal-dark); background: var(--teal-soft); border-radius: 4px; font-size: 9px; font-weight: 700; letter-spacing: 0.08em; }
.analysis-summary h3 { margin-top: 12px; max-width: 440px; font: 680 21px/1.38 var(--display); letter-spacing: -0.02em; }
.analysis-summary > p { max-width: 500px; margin-top: 9px; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.analysis-summary dl { margin: 20px 0 0; display: grid; gap: 9px; }
.analysis-summary dl div { display: grid; grid-template-columns: 78px 1fr; padding-top: 9px; border-top: 1px solid var(--rule); }
.analysis-summary dt { color: var(--muted); font-size: 10px; }
.analysis-summary dd { margin: 0; font-size: 11px; font-weight: 560; }
.comparison { padding: 22px; }
.comparison-head { display: flex; justify-content: space-between; align-items: center; }
.comparison-head h3 { font-size: 13px; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 10px; }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; background: #c8d3dd; }
.legend .v7::before { background: var(--teal); }
.bar-group { margin-top: 20px; }
.bar-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 11px; }
.bar-title b { font: 700 11px var(--data); }
.negative { color: var(--red); }
.bar-row { display: grid; grid-template-columns: 28px 1fr 48px; align-items: center; gap: 10px; margin: 8px 0; color: var(--muted); font-size: 10px; }
.bar-row strong { color: var(--ink); font: 650 11px var(--data); text-align: right; }
.bar-track { height: 9px; overflow: hidden; background: #eef2f5; border-radius: 2px; }
.bar { display: block; width: var(--value); height: 100%; border-radius: 2px; transition: width 320ms ease; }
.v6-bar { background: #c7d2dc; }
.v7-bar { background: var(--teal); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { padding: 9px 14px; color: var(--muted); background: #f8fafc; border-bottom: 1px solid var(--rule); text-align: left; font-size: 10px; font-weight: 600; }
td { height: 58px; padding: 8px 14px; border-bottom: 1px solid var(--rule); color: var(--ink-soft); font-size: 11px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfdfd; }
th:nth-child(1), td:nth-child(1) { width: 15%; }
th:nth-child(2), td:nth-child(2) { width: 16%; }
th:nth-child(3), td:nth-child(3) { width: 25%; }
th:nth-child(4), td:nth-child(4) { width: 16%; }
th:nth-child(5), td:nth-child(5) { width: 15%; }
th:last-child, td:last-child { width: 100px; text-align: right; }
td small { margin-top: 4px; color: var(--muted); font-size: 9px; }
td strong { color: var(--ink); font-weight: 580; }
.mono { font-family: var(--data); font-variant-numeric: tabular-nums; }
.evidence-state, .human-state { position: relative; display: inline-flex; align-items: center; gap: 5px; font-size: 10px; }
.evidence-state::before, .human-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.evidence-state.complete { color: var(--green); }
.evidence-state.complete::before { background: var(--green); }
.evidence-state.incomplete { color: var(--amber); }
.evidence-state.incomplete::before { background: var(--amber); }
.human-state.pending { color: var(--amber); }
.human-state.pending::before { border: 2px solid var(--amber); }
.human-state.confirmed { color: var(--green); }
.human-state.confirmed::before { background: var(--green); }
.human-state.rejected { color: var(--red); }
.human-state.rejected::before { background: var(--red); }
.evidence-button, .text-button { border: 0; background: transparent; color: var(--teal-dark); font-size: 11px; font-weight: 650; }
.evidence-button:hover, .text-button:hover { text-decoration: underline; }

.record-list { list-style: none; }
.record-list li { display: grid; grid-template-columns: 54px 10px minmax(0, 1fr) auto; align-items: start; gap: 12px; min-height: 66px; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.record-list li:last-child { border-bottom: 0; }
.record-list time { padding-top: 2px; color: var(--muted); font-size: 10px; }
.record-list strong { display: block; font-size: 11px; font-weight: 620; }
.record-list p { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.record-dot { width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.record-dot.human { background: var(--green); box-shadow: 0 0 0 3px #e1f3eb; }
.record-dot.corrected { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.record-dot.release { background: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.record-tag { padding: 4px 7px; color: var(--muted); border: 1px solid var(--rule); border-radius: 4px; background: #f8fafb; font-size: 9px; white-space: nowrap; }
.portfolio-notice { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 24px 16px 4px; color: var(--muted); font-size: 10px; line-height: 1.6; text-align: center; }

.drawer-scrim { position: fixed; inset: 0; z-index: 38; border: 0; background: rgba(16,36,60,0.12); opacity: 0; transition: opacity 180ms ease; }
.drawer-scrim.visible { opacity: 1; }
.evidence-drawer { position: fixed; z-index: 40; inset: 0 0 0 auto; width: min(520px, 45vw); display: flex; flex-direction: column; overflow-y: auto; background: var(--paper); border-left: 1px solid var(--rule-strong); box-shadow: -20px 0 50px rgba(16,36,60,0.08); transform: translateX(102%); transition: transform 220ms ease; }
.evidence-drawer.open { transform: translateX(0); }
.drawer-header { position: sticky; top: 0; z-index: 2; min-height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: rgba(255,255,255,0.96); border-bottom: 1px solid var(--rule); }
.drawer-header h2, .modal header h2 { margin-top: 5px; font: 700 20px var(--display); }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 1px solid var(--rule); border-radius: 7px; background: var(--paper); color: var(--muted); font-size: 20px; line-height: 1; }
.icon-button:hover { color: var(--ink); border-color: var(--rule-strong); }
.drawer-context { display: grid; grid-template-columns: 1.2fr 1fr .65fr; margin: 16px 20px 0; border: 1px solid var(--rule); border-radius: 7px; }
.drawer-context div { padding: 10px; border-right: 1px solid var(--rule); }
.drawer-context div:last-child { border-right: 0; }
.drawer-context span { display: block; color: var(--muted); font-size: 9px; }
.drawer-context strong { display: block; margin-top: 5px; font-size: 10px; font-weight: 580; }

.audio-card { display: grid; grid-template-columns: 32px 36px 1fr 36px auto; align-items: center; gap: 8px; margin: 12px 20px 0; padding: 12px; background: #f7fafb; border: 1px solid var(--rule); border-radius: 7px; }
.play-button { width: 30px; height: 30px; border: 0; border-radius: 50%; color: white; background: var(--teal); font-size: 11px; }
.audio-card .mono { color: var(--muted); font-size: 9px; }
.waveform { height: 28px; display: flex; align-items: center; gap: 2px; overflow: hidden; }
.waveform i { flex: 1; min-width: 2px; height: var(--height); max-height: 22px; border-radius: 2px; background: #8dbfc1; }
.waveform.playing i:nth-child(-n+16) { background: var(--teal); }
.evidence-jump { padding: 5px 7px; border: 1px solid #b8dcdc; border-radius: 4px; color: var(--teal-dark); background: var(--teal-soft); font-size: 9px; }

.finding-card { margin: 12px 20px 0; padding: 16px; border: 1px solid #c7dede; border-left: 3px solid var(--teal); border-radius: 7px; background: #fbfefe; }
.finding-head { display: flex; align-items: center; justify-content: space-between; }
.ai-label { color: var(--teal-dark); font-size: 9px; font-weight: 750; letter-spacing: 0.08em; }
.finding-card h3 { margin-top: 10px; font: 680 18px var(--display); }
.finding-card > p { margin-top: 7px; color: var(--ink-soft); font-size: 11px; line-height: 1.7; }
.finding-card > small { margin-top: 10px; color: var(--muted); font-size: 9px; }
.finding-evidence { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin-top: 12px; padding: 9px; border: 1px solid var(--rule); border-radius: 5px; background: var(--paper); text-align: left; }
.finding-evidence span { color: var(--teal-dark); font-size: 9px; }
.finding-evidence strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 570; }
.finding-evidence i { color: var(--teal-dark); font-size: 9px; font-style: normal; }

.inline-state { display: flex; flex-direction: column; gap: 4px; margin: 12px 20px 0; padding: 12px; border: 1px solid #e9cc9e; border-left: 3px solid var(--amber); border-radius: 6px; background: var(--amber-soft); }
.inline-state[hidden] { display: none; }
.inline-state strong { font-size: 11px; }
.inline-state span { color: var(--ink-soft); font-size: 10px; }

.transcript-section { padding: 20px 20px 120px; }
.transcript-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.transcript-heading h3 { font-size: 13px; }
.transcript-heading span { color: var(--green); font: 9px var(--data); }
.transcript-rail { position: relative; list-style: none; margin: 0; padding: 7px 0 0; }
.transcript-rail::before { content: ""; position: absolute; top: 0; bottom: 0; left: 39px; width: 1px; background: var(--rule-strong); }
.transcript-rail li { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 8px 10px 0; border-radius: 5px; }
.transcript-rail li::before { content: ""; position: absolute; left: 36px; top: 16px; width: 7px; height: 7px; border: 2px solid var(--paper); border-radius: 50%; background: var(--muted-2); box-shadow: 0 0 0 1px var(--rule-strong); }
.transcript-rail time { color: var(--muted); font: 9px var(--data); }
.transcript-rail p { margin-top: 5px; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.transcript-rail small { margin-top: 5px; color: var(--red); font-size: 9px; }
.speaker { padding: 3px 6px; border-radius: 4px; font-size: 9px; font-weight: 650; }
.speaker.customer { color: #37678e; background: #eaf2f9; }
.speaker.bot { color: var(--teal-dark); background: var(--teal-soft); }
.transcript-rail li.evidence-line { background: var(--red-soft); }
.transcript-rail li.evidence-line::before { background: var(--red); box-shadow: 0 0 0 4px #f9d8d4; }
.transcript-rail li.evidence-line.highlight { animation: evidencePulse 900ms ease; }
.transcript-rail.low-confidence .evidence-line { background: var(--amber-soft); }
.transcript-rail.low-confidence .evidence-line::before { background: var(--amber); box-shadow: 0 0 0 4px #f9e7c7; }

.review-actions { position: sticky; bottom: 0; z-index: 3; margin-top: auto; padding: 12px 20px 16px; background: rgba(255,255,255,0.97); border-top: 1px solid var(--rule); box-shadow: 0 -10px 25px rgba(16,36,60,0.04); }
.review-status { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.review-status .status-dot { width: 8px; height: 8px; border: 2px solid var(--amber); border-radius: 50%; }
.review-status strong { display: block; font-size: 10px; }
.review-status small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.review-status.confirmed .status-dot { border-color: var(--green); background: var(--green); }
.action-row { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 8px; }
.button { min-height: 36px; padding: 0 12px; border-radius: 6px; font-size: 10px; font-weight: 650; }
.button.primary { color: white; background: var(--teal); border: 1px solid var(--teal); }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { color: var(--ink-soft); background: var(--paper); border: 1px solid var(--rule-strong); }
.button.secondary:hover { color: var(--teal-dark); border-color: var(--teal); }
.button.danger { color: white; background: var(--red); border: 1px solid var(--red); }
.button:disabled { color: var(--muted-2); background: #edf1f4; border-color: var(--rule); }

.modal { width: min(620px, calc(100vw - 48px)); max-height: 88vh; padding: 0; overflow: hidden; border: 1px solid var(--rule-strong); border-radius: 12px; color: var(--ink); background: var(--paper); box-shadow: 0 22px 70px rgba(16,36,60,0.2); }
.modal::backdrop { background: rgba(16,36,60,0.3); backdrop-filter: blur(2px); }
.modal header, .modal footer { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--rule); }
.modal footer { justify-content: flex-end; gap: 8px; border-top: 1px solid var(--rule); border-bottom: 0; }
.modal-body { display: grid; gap: 14px; padding: 18px; overflow-y: auto; }
.modal label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 10px; font-weight: 600; }
.modal input, .modal select, .modal textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--rule-strong); border-radius: 6px; color: var(--ink); background: var(--paper); font-size: 11px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.source-strip, .compliance-note { padding: 11px 12px; border: 1px solid var(--rule); border-radius: 6px; background: #f7fafb; }
.source-strip { display: flex; align-items: center; gap: 10px; font-size: 10px; }
.source-strip span { color: var(--muted); }
.source-strip strong { font-weight: 600; }
.compliance-note { border-left: 3px solid var(--teal); }
.compliance-note strong { font-size: 10px; }
.compliance-note p, .modal-intro { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.compact-modal { width: min(480px, calc(100vw - 48px)); }

.toast { position: fixed; z-index: 60; top: 24px; right: 24px; max-width: 420px; padding: 12px 16px; color: white; background: var(--ink); border-radius: 7px; box-shadow: 0 10px 30px rgba(16,36,60,0.2); font-size: 11px; pointer-events: none; }
.toast[hidden] { display: none; }

@keyframes evidencePulse {
  0%, 100% { box-shadow: none; }
  45% { box-shadow: 0 0 0 3px rgba(197,64,58,0.15); }
}

@media (min-width: 1440px) {
  body.drawer-open .workspace { margin-right: 500px; }
  body.drawer-open .drawer-scrim { display: none; }
  body.drawer-open .main-content { width: calc(100% - 32px); }
  body.drawer-open .diagnostic-row { grid-template-columns: 34px minmax(140px, 1fr) 82px minmax(170px, 1.25fr) 94px 82px; gap: 8px; padding-inline: 12px; }
  body.drawer-open .analysis-panel { grid-template-columns: 1fr; }
  body.drawer-open .analysis-summary { border-right: 0; border-bottom: 1px solid var(--rule); }
}

@media (max-width: 1499px) {
  .sidebar { width: 74px; }
  .brand { justify-content: center; padding: 0; }
  .brand > span:last-child, .nav-item b, .sidebar-foot span:last-child { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .sidebar-foot { justify-content: center; }
  .workspace { margin-left: 74px; }
  .diagnostic-row { grid-template-columns: 34px minmax(150px, 1fr) 90px minmax(190px, 1.25fr) 105px 90px; }
}

@media (max-width: 1199px) {
  .main-content { width: calc(100% - 28px); }
  .header-actions { flex-direction: column; align-items: stretch; padding-top: 0; }
  .concept-badge { text-align: center; }
  .diagnostic-row { grid-template-columns: 30px 1fr 80px 1.15fr 96px 80px; gap: 7px; padding-inline: 10px; }
  .funnel li { padding-inline: 12px; }
}

@media (max-width: 1023px) {
  body { min-width: 0; }
  .desktop-notice { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 30px; text-align: center; }
  .desktop-notice strong { font: 700 22px var(--display); }
  .desktop-notice span { max-width: 420px; color: var(--muted); font-size: 13px; line-height: 1.6; }
  .app-shell { display: none; }
}

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