:root {
  color-scheme: light;
  --bg: #eef2f1;
  --surface: #ffffff;
  --surface-2: #f7f9f8;
  --surface-3: #e8eeee;
  --ink: #18201f;
  --ink-soft: #3d4745;
  --muted: #697674;
  --line: #d7dfdc;
  --line-strong: #aebfba;
  --teal: #087568;
  --teal-2: #0f9a88;
  --teal-soft: #dff4ef;
  --blue: #285c9d;
  --blue-soft: #e2ecf8;
  --amber: #a86411;
  --amber-soft: #fff0cc;
  --red: #b3261e;
  --red-soft: #ffe2dd;
  --violet: #5d54b7;
  --violet-soft: #ebe9ff;
  --shadow: 0 18px 55px rgba(23, 35, 32, 0.13);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0) 30%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

button:hover {
  border-color: var(--teal);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

svg {
  display: block;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

.react-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.topbar {
  min-height: 70px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: relative;
  z-index: 6;
}

.brand {
  min-width: 255px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--ink), var(--teal));
  color: #fff;
  font-weight: 850;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 18px;
  line-height: 1.1;
}

.brand p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.btn,
.file-btn,
.lang-switch {
  min-height: 36px;
}

.btn,
.file-btn {
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.btn svg,
.file-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.btn.danger,
.btn.live-active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn.subtle {
  background: var(--surface-2);
}

.file-btn {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.file-btn input {
  display: none;
}

.lang-switch {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(34px, 1fr));
  gap: 3px;
}

.lang-switch button {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.lang-switch button.active {
  background: var(--ink);
  color: #fff;
}

.workspace {
  min-height: 0;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(370px, 0.82fr) minmax(600px, 1.18fr);
  gap: 14px;
  overflow: hidden;
}

.left-rail,
.right-rail {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 2px;
}

.left-rail {
  display: grid;
  grid-template-rows: minmax(305px, auto) minmax(260px, 1fr);
  gap: 12px;
  overflow-y: auto;
}

.right-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.video-console {
  padding: 12px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-head h2,
.section-title h2 {
  font-size: 16px;
  line-height: 1.2;
}

.panel-head p,
.section-title p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.status-pill {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.status-pill.hot {
  background: var(--red-soft);
  border-color: #f2b9b1;
  color: var(--red);
}

.status-pill.ok {
  background: var(--teal-soft);
  border-color: #acd8cf;
  color: var(--teal);
}

.stage {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #101615;
  aspect-ratio: 16 / 10;
  max-height: min(235px, 24vh);
  flex: 0 0 auto;
}

.stage video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #101615;
}

.live-badge {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  min-height: 32px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(6, 12, 11, 0.76);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  backdrop-filter: blur(10px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loop-badge {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--radius);
  background: rgba(8, 117, 104, 0.88);
  color: #fff;
  font-size: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.loop-badge span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loop-badge button {
  min-height: 28px;
  padding: 0 9px;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.transport-strip {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: stretch;
}

.timeline-bars {
  min-height: 44px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  display: flex;
  align-items: end;
  gap: 3px;
  overflow: hidden;
}

.timeline-bar {
  flex: 1 1 0;
  min-width: 8px;
  border-radius: 3px 3px 0 0;
  background: var(--line-strong);
  cursor: pointer;
}

.timeline-bar.warning {
  background: var(--amber);
}

.timeline-bar.hot {
  background: var(--red);
}

.timeline-bar.active {
  box-shadow: 0 0 0 2px #101615 inset;
}

.review-timeline-layers {
  display: grid;
  gap: 5px;
}

.timeline-layer {
  min-height: 22px;
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 7px;
  align-items: center;
}

.timeline-layer > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.timeline-dot {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  min-height: 10px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}

.timeline-layer.context .timeline-dot {
  background: var(--amber);
}

.timeline-layer.audio .timeline-dot {
  background: var(--blue);
}

.timeline-layer.micro .timeline-dot {
  background: var(--red);
}

.timeline-layer.baseline .timeline-dot {
  background: var(--violet);
}

.timeline-layer.ai .timeline-dot {
  background: var(--teal);
}

.now-card {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.now-card strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}

.now-card p {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.35;
  max-height: 58px;
  overflow-y: auto;
}

.live-controls {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.live-controls textarea {
  width: 100%;
  min-height: 50px;
  max-height: 80px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 9px 10px;
  color: var(--ink);
}

.baseline-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.baseline-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.library-panel {
  min-height: 340px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.library-search-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.library-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 9px 10px;
  color: var(--ink);
}

.library-search-row span {
  min-width: 74px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-align: center;
  white-space: nowrap;
}

.video-list {
  margin-top: 10px;
  min-height: 230px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 1px 4px 8px 1px;
  scrollbar-gutter: stable;
}

.video-row {
  position: relative;
  width: 100%;
  min-height: 86px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.video-row.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.video-select {
  width: 100%;
  min-width: 0;
  min-height: 84px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  padding: 10px 44px 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.video-row-top {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.video-title,
.video-subtitle {
  min-width: 0;
  overflow: hidden;
}

.video-title {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.22;
  white-space: normal;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.video-subtitle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-pill {
  min-height: 22px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 820;
  line-height: 1.15;
  white-space: nowrap;
}

.analysis-pill.ok {
  background: var(--teal-soft);
  color: var(--teal);
}

.video-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  white-space: normal;
  max-height: 42px;
  overflow: hidden;
}

.video-meta-line em {
  max-width: 100%;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-soft);
  font-style: normal;
  font-size: 10px;
  line-height: 1.3;
}

.library-filters {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.library-filters button {
  min-width: 0;
  min-height: 30px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-filters button.active {
  background: var(--ink);
  color: #fff;
}

.video-delete {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 28px;
  height: 28px;
  min-height: 0;
  border: 1px solid #efc1ba;
  border-radius: 6px;
  color: var(--red);
  background: #fff8f6;
  display: grid;
  place-items: center;
  opacity: 0.72;
}

.video-row:hover .video-delete,
.video-delete:focus-visible {
  opacity: 1;
}

.video-delete svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.metric-dock {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.dock-head h2 {
  font-size: 15px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  min-width: 0;
  min-height: 62px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.metric strong {
  display: block;
  margin-top: 7px;
  font-size: 17px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.tabbar {
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 5px;
}

.tabbar button {
  min-width: 0;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabbar button.active {
  color: #fff;
  background: var(--ink);
}

.mode-switch {
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.mode-switch button {
  min-width: 0;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 820;
}

.mode-switch button.active {
  background: var(--ink);
  color: #fff;
}

.signal-panel {
  padding: 12px;
  min-height: 450px;
}

.list-stack {
  display: grid;
  gap: 10px;
}

.empty-state {
  min-height: 120px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1.45;
}

.event-card,
.context-card,
.ai-card,
.judgment-card,
.calibration-card,
.background-card,
.reasoning-card,
.context-flow-row,
.clue-card,
.micro-card,
.audio-card,
.aggregate-card,
.hotspot-card,
.transcript-card,
.log-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.event-card.active,
.context-card.active,
.context-flow-row.active,
.ai-card.active,
.micro-card.active,
.audio-card.active,
.aggregate-card.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(8, 117, 104, 0.12);
}

.event-card.hot,
.context-card.hot,
.judgment-card.hot,
.clue-card.hot,
.micro-card.hot,
.audio-card.hot,
.aggregate-card.hot,
.hotspot-card.hot {
  border-color: #efb2ab;
  background: linear-gradient(180deg, #fff, var(--red-soft));
}

.event-card.warning,
.context-card.warning,
.ai-card.warning,
.judgment-card.warning,
.calibration-card.warning,
.clue-card.warning,
.micro-card.warning,
.audio-card.warning,
.aggregate-card.warning {
  border-color: #eccb82;
  background: linear-gradient(180deg, #fff, var(--amber-soft));
}

.event-card {
  padding: 8px;
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  align-items: stretch;
}

.event-shot {
  width: 100%;
  min-height: 74px;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  object-fit: cover;
  background: #111;
}

.card-body {
  min-width: 0;
  padding: 2px 0;
}

.row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.row-head strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.action-row {
  margin-top: 10px;
  align-items: center;
}

.card-body p,
.context-card p,
.ai-card p,
.judgment-card p,
.calibration-card p,
.background-card p,
.reasoning-card p,
.context-flow-row p,
.clue-card p,
.micro-card p,
.audio-card p,
.aggregate-card p,
.hotspot-card p,
.transcript-card p,
.log-row p {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.46;
}

.context-card,
.ai-card,
.judgment-card,
.calibration-card,
.background-card,
.reasoning-card,
.context-flow-row,
.clue-card,
.aggregate-card,
.hotspot-card,
.transcript-card,
.log-row {
  padding: 11px;
}

.chips {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips span {
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-soft);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reasoning-stack {
  display: grid;
  gap: 10px;
}

.case-review-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(300px, 0.68fr);
  gap: 12px;
  align-items: start;
}

.case-main,
.evidence-drawer,
.case-section {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.case-section-title {
  padding: 2px 0;
}

.case-section-title.top {
  padding: 4px 2px 0;
}

.case-section-title h2,
.drawer-head h2 {
  font-size: 16px;
  line-height: 1.2;
}

.case-section-title p,
.drawer-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.case-readiness {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 12px;
}

.case-readiness.ready {
  border-color: #acd8cf;
  background: linear-gradient(180deg, #fff, var(--teal-soft));
}

.case-readiness.partial {
  border-color: #eccb82;
  background: linear-gradient(180deg, #fff, var(--amber-soft));
}

.readiness-score {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.readiness-score strong {
  margin-top: 6px;
  font-size: 32px;
  line-height: 1;
}

.readiness-score p {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 12px;
}

.readiness-body {
  min-width: 0;
}

.readiness-checks {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.readiness-checks span {
  padding: 5px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 760;
}

.readiness-checks span.ok {
  background: var(--teal-soft);
  color: var(--teal);
}

.readiness-checks span.missing {
  background: var(--red-soft);
  color: var(--red);
}

.case-card,
.drawer-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.case-card.primary-review,
.case-card.hypothesis {
  background: linear-gradient(180deg, #fff, #f7fbfa);
}

.case-card.warning,
.drawer-card.warning {
  border-color: #eccb82;
  background: var(--amber-soft);
}

.case-card.hot,
.case-card.hypothesis.hot {
  border-color: #efb2ab;
  background: linear-gradient(180deg, #fff, var(--red-soft));
}

.case-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.case-card-head h2,
.case-card-head h3 {
  margin-top: 3px;
  font-size: 16px;
  line-height: 1.25;
}

.case-card p,
.drawer-card p {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.48;
}

.case-fields {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.case-field {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.case-field.muted {
  opacity: 0.72;
}

.case-field strong {
  display: block;
  font-size: 12px;
  line-height: 1.25;
}

.case-field p {
  margin-top: 5px;
}

.case-evidence-list {
  margin: 8px 0 0;
  padding-left: 16px;
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.42;
}

.evidence-jump {
  width: 100%;
  min-height: 30px;
  padding: 5px 7px;
  border-radius: 6px;
  background: #fff;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px;
  text-align: left;
}

.evidence-jump span {
  color: var(--teal);
  font-size: 11px;
  font-weight: 820;
}

.evidence-jump b {
  min-width: 0;
  color: var(--ink-soft);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.drawer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.drawer-card h3 {
  font-size: 14px;
}

.drawer-signal {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.drawer-signal:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.drawer-signal .micro-shots {
  margin-bottom: 7px;
}

.drawer-audio {
  width: 100%;
  min-height: 0;
  margin-top: 8px;
  padding: 8px;
  border-radius: 6px;
  background: var(--surface-2);
  display: grid;
  gap: 7px;
  text-align: left;
}

.drawer-audio span {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.35;
}

.reasoning-grid {
  display: grid;
  gap: 10px;
}

.reasoning-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-title {
  margin-top: 4px;
}

.judgment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.judgment-head h3 {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.2;
}

.score-tile {
  width: 72px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  display: grid;
  place-items: center;
  align-content: center;
}

.score-tile span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.score-tile strong {
  font-size: 22px;
  line-height: 1;
}

.claim-text,
.method-note {
  margin-top: 10px;
}

.method-note {
  padding: 8px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.58);
}

.calibration-card {
  padding: 11px;
}

.calibration-card.hot {
  border-color: #efb2ab;
  background: linear-gradient(180deg, #fff, var(--red-soft));
}

.calibration-columns {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.calibration-columns > div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
}

.calibration-columns strong {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
}

.contributor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px solid rgba(30, 41, 59, 0.07);
  font-size: 12px;
}

.contributor-row:first-of-type {
  border-top: 0;
}

.contributor-row span {
  min-width: 0;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contributor-row b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.evidence-block {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.evidence-block > strong,
.reasoning-card > strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}

.evidence-list {
  margin-top: 8px;
  display: grid;
  gap: 7px;
}

.evidence-row {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.evidence-row span {
  display: block;
  color: var(--teal);
  font-size: 11px;
  font-weight: 820;
}

.evidence-row p {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.reasoning-card ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.context-flow-row {
  width: 100%;
  text-align: left;
  display: block;
}

.context-flow-row.active {
  background: var(--teal-soft);
}

.background-card {
  background: linear-gradient(180deg, #fff, var(--blue-soft));
}

.editor-card {
  display: grid;
  gap: 9px;
}

.background-facts-input {
  width: 100%;
  min-height: 150px;
  max-height: 260px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.evidence-matrix {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.evidence-matrix > div,
.subtle-card {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.evidence-matrix strong {
  display: block;
  font-size: 12px;
  line-height: 1.25;
}

.evidence-matrix ul {
  margin: 7px 0 0;
  padding-left: 16px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.42;
}

.evidence-matrix li {
  overflow-wrap: anywhere;
}

.ai-card {
  background: linear-gradient(180deg, #fff, #f7fbfa);
}

.ai-card h2,
.ai-card h3 {
  margin: 0 0 6px;
}

.raw-ai-output {
  max-height: 420px;
  margin-top: 10px;
  padding: 11px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0f1716;
  color: #edf7f4;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.45;
}

.time-chip {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 12px;
}

.micro-card {
  padding: 9px;
  display: grid;
  grid-template-columns: minmax(185px, 250px) 1fr;
  gap: 11px;
}

.micro-shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-content: start;
}

.micro-shot {
  min-width: 0;
}

.asset-thumb {
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  display: block;
}

.asset-thumb:focus-visible,
.asset-thumb:hover {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.asset-thumb::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(16, 22, 21, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.asset-thumb::before {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 6px;
  height: 6px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  z-index: 1;
}

.micro-shot img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #111;
  display: block;
}

.micro-shot figcaption {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.micro-empty {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 11px;
}

.audio-card {
  padding: 9px;
  display: grid;
  grid-template-columns: minmax(190px, 285px) 1fr;
  gap: 11px;
}

.audio-wave-btn {
  background: transparent;
}

.audio-wave {
  width: 100%;
  height: auto;
}

.audio-wave rect {
  fill: #f4f7f6;
  stroke: #d7dfdc;
}

.audio-wave .center-line {
  stroke: #bfcbc7;
  stroke-width: 1;
}

.audio-wave .wave-line {
  stroke-width: 1.2;
}

.audio-wave text {
  fill: var(--ink-soft);
  font-size: 10px;
}

.audio-wave.large text {
  font-size: 15px;
}

.aggregate-groups {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.signal-group,
.cross-modal {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.signal-group.high,
.cross-modal.high {
  border-color: #f0b0a9;
  background: var(--red-soft);
}

.signal-group.watch,
.signal-group.medium,
.signal-group.low,
.cross-modal.watch,
.cross-modal.medium,
.cross-modal.low {
  border-color: #e7c47f;
  background: var(--amber-soft);
}

.cross-modal-list {
  margin-top: 8px;
  display: grid;
  gap: 7px;
}

.hotspot-card {
  width: 100%;
  text-align: left;
}

.transcript-card time,
.log-row time {
  color: var(--muted);
  font-size: 11px;
}

.log-row {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 10px;
}

.log-row.error {
  border-color: #efb2ab;
  background: var(--red-soft);
}

.log-row.done {
  border-color: #acd8cf;
  background: var(--teal-soft);
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.viewer.active {
  display: block;
}

.viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 16, 15, 0.72);
}

.viewer-dialog {
  position: absolute;
  inset: 42px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #fff;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.viewer-head {
  min-height: 54px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.viewer-body {
  min-height: 0;
  padding: 12px;
  overflow: auto;
  display: grid;
  place-items: center;
  background: var(--surface-2);
}

.viewer-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
  background: #111;
}

.viewer-body .audio-large-wrap {
  width: min(1180px, 100%);
}

@media (max-width: 1120px) {
  body {
    overflow: auto;
  }

  .react-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .topbar,
  .workspace {
    display: block;
  }

  .topbar {
    position: sticky;
    top: 0;
  }

  .top-actions {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .workspace {
    overflow: visible;
  }

  .left-rail,
  .right-rail {
    overflow: visible;
    margin-bottom: 12px;
  }

  .left-rail {
    display: grid;
    grid-template-rows: auto auto;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tabbar {
    grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  }

	  .aggregate-groups {
	    grid-template-columns: repeat(2, minmax(0, 1fr));
	  }

	  .calibration-columns {
	    grid-template-columns: 1fr;
	  }

  .case-review-grid {
    grid-template-columns: 1fr;
  }
	}

@media (max-width: 720px) {
  .transport-strip,
  .baseline-row,
  .card-row,
  .event-card,
  .micro-card,
  .audio-card,
	  .aggregate-groups,
	  .calibration-columns,
  .evidence-matrix,
  .case-readiness,
  .case-fields,
  .reasoning-grid.two,
  .log-row {
    grid-template-columns: 1fr;
  }

  .card-row {
    display: grid;
  }

  .viewer-dialog {
    inset: 12px;
  }

  .stage {
    max-height: none;
  }
}
