/*
Token source for production inheritance:
colors: --bg, --surface, --surface-2, --line, --text, --muted, --blue, --cyan, --amber, --red, --green
spacing: --s1..--s8
radii: --r1..--r4
shadows: --shadow, --glow-blue, --glow-cyan
motion: --fast, --base, --slow
*/
:root {
  color-scheme: dark;
  --bg: #071018;
  --bg-2: #0a1420;
  --surface: #0d1822;
  --surface-2: #102233;
  --surface-3: #132b3d;
  --line: rgba(143, 174, 204, 0.25);
  --line-strong: rgba(47, 123, 255, 0.52);
  --text: #f4f8fb;
  --muted: #92a7ba;
  --blue: #2f7bff;
  --blue-2: #1b5cd8;
  --cyan: #18d7c4;
  --amber: #ffb02e;
  --red: #ff5a66;
  --green: #55d87f;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s7: 32px;
  --s8: 40px;
  --r1: 4px;
  --r2: 6px;
  --r3: 8px;
  --r4: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  --glow-blue: 0 0 0 1px rgba(47, 123, 255, 0.36), 0 0 32px rgba(47, 123, 255, 0.18);
  --glow-cyan: 0 0 0 1px rgba(24, 215, 196, 0.34), 0 0 30px rgba(24, 215, 196, 0.12);
  --fast: 150ms;
  --base: 220ms;
  --slow: 320ms;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 22% 0%, rgba(47, 123, 255, 0.16), transparent 36%),
    linear-gradient(135deg, var(--bg), #05090f 70%);
  line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.app {
  width: 100%;
  min-height: 100vh;
  overflow-x: clip;
}
.mobile-only { display: none !important; }
.eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
}

.login-view {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 54px;
}
.login-view__scene {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(10, 24, 36, 0.74), rgba(7, 16, 24, 0.95)),
    repeating-linear-gradient(90deg, transparent 0 78px, rgba(47, 123, 255, 0.06) 79px 80px),
    repeating-linear-gradient(0deg, transparent 0 78px, rgba(24, 215, 196, 0.045) 79px 80px);
}
.login-view__content {
  position: relative;
  z-index: 1;
  width: min(1380px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  grid-template-areas:
    "brand auth"
    "visual auth"
    "metrics auth"
    "value auth";
  gap: var(--s4) 70px;
  align-items: start;
}
.brand-block { grid-area: brand; }
.roadshow-visual--hero { grid-area: visual; }
.login-metrics { grid-area: metrics; }
.value-strip { grid-area: value; }
.auth-panel { grid-area: auth; align-self: center; }
.brand-block {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: var(--s5);
  align-items: start;
}
.brand-block h1 {
  margin: 6px 0 12px;
  font-size: 44px;
  line-height: 1.14;
  letter-spacing: 0;
}
.brand-block__copy {
  max-width: 560px;
  margin: 0;
  color: #c1d0de;
  font-size: 17px;
}
.roadshow-visual {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(143, 174, 204, 0.24);
  border-radius: var(--r3);
  background: rgba(13, 24, 34, 0.72);
  box-shadow: var(--shadow);
}
.roadshow-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 16, 24, 0.08), rgba(24, 215, 196, 0.1), rgba(7, 16, 24, 0.18));
  pointer-events: none;
}
.roadshow-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.roadshow-visual--hero {
  width: min(660px, 100%);
  aspect-ratio: 16 / 5;
  margin-top: var(--s6);
  box-shadow: var(--shadow), var(--glow-cyan);
}
.roadshow-visual--hero img { object-position: center top; }
.roadshow-visual--pipeline {
  min-height: 160px;
  align-self: stretch;
}
.roadshow-visual--pipeline img { object-position: center center; }
.roadshow-visual--archive {
  aspect-ratio: 16 / 4.2;
  margin-bottom: var(--s5);
}
.roadshow-visual--archive img { object-position: center bottom; }
.value-strip {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s3);
  margin-top: var(--s4);
}
.value-strip article,
.impact-grid article,
.completion-state__value article {
  border: 1px solid rgba(143, 174, 204, 0.22);
  border-radius: var(--r2);
  background: rgba(13, 24, 34, 0.66);
  padding: var(--s3);
}
.value-strip span,
.impact-grid span,
.completion-state__value span {
  display: block;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}
.value-strip strong,
.impact-grid strong,
.completion-state__value strong {
  display: block;
  margin-top: 6px;
  color: #dce9f3;
  font-size: 13px;
  line-height: 1.45;
}
.brand-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  color: var(--blue);
  filter: drop-shadow(0 0 22px rgba(47, 123, 255, 0.45));
}
.brand-mark svg {
  width: 100%;
  height: 100%;
  fill: rgba(47, 123, 255, 0.1);
  stroke: currentColor;
  stroke-width: 2.2;
}
.brand-mark--small { width: 38px; height: 38px; }
.login-metrics {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: var(--s4);
  max-width: 650px;
}
.login-metrics article,
.metric,
.panel,
.list-row,
.review-drawer,
.bottom-sheet {
  border: 1px solid var(--line);
  background: rgba(13, 24, 34, 0.78);
  box-shadow: var(--shadow);
  border-radius: var(--r3);
}
.login-metrics article { padding: var(--s5); }
.login-metrics span { display: block; color: var(--muted); }
.login-metrics strong { display: block; margin-top: var(--s2); font-size: 30px; color: var(--cyan); }
.auth-panel {
  padding: var(--s7);
  border: 1px solid rgba(143, 174, 204, 0.32);
  border-radius: var(--r3);
  background: rgba(13, 24, 34, 0.86);
  box-shadow: var(--shadow), var(--glow-blue);
}
.tabs, .role-switch, .segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: var(--s2);
  padding: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  background: rgba(255, 255, 255, 0.03);
}
.tabs { margin-bottom: var(--s5); }
.tabs__item, .role-switch__item, .segmented button {
  min-height: 44px;
  border: 0;
  border-radius: var(--r2);
  color: var(--muted);
  background: transparent;
}
.tabs__item.is-active, .role-switch__item.is-active, .segmented button.is-active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(47, 123, 255, 0.35), rgba(24, 215, 196, 0.12));
  box-shadow: inset 0 0 0 1px rgba(47, 123, 255, 0.6);
}
.role-switch { margin-bottom: var(--s5); }
.field { display: block; margin-bottom: var(--s5); }
.field span { display: block; margin-bottom: var(--s2); color: #c6d5e1; }
.field input, .field textarea, .field select {
  width: 100%;
  min-height: 48px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: rgba(5, 12, 18, 0.72);
  padding: 0 var(--s4);
}
.field textarea { min-height: 120px; padding-top: var(--s3); resize: vertical; }
.button, .icon-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  transition: transform var(--fast), border-color var(--fast), background var(--fast);
}
.button:hover, .icon-button:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.button--primary {
  border-color: rgba(47, 123, 255, 0.76);
  background: linear-gradient(135deg, var(--blue), #0d67ff);
  box-shadow: 0 12px 30px rgba(47, 123, 255, 0.28);
}
.button--cyan { border-color: rgba(24, 215, 196, 0.6); background: rgba(24, 215, 196, 0.16); color: var(--cyan); }
.button--amber { border-color: rgba(255, 176, 46, 0.65); background: rgba(255, 176, 46, 0.14); color: var(--amber); }
.button--danger { border-color: rgba(255, 90, 102, 0.66); background: rgba(255, 90, 102, 0.14); color: var(--red); }
.button--block { width: 100%; font-weight: 800; }
.button[disabled] { cursor: not-allowed; opacity: 0.52; transform: none; }
.state-line { margin: 0 0 var(--s4); font-size: 13px; }
.state-line--error { color: var(--red); }
.state-line--success { color: var(--green); }

.lattice--large {
  position: absolute;
  left: 34%;
  top: 21%;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(24, 215, 196, 0.18);
  transform: rotate(45deg);
  box-shadow: inset 0 0 52px rgba(24, 215, 196, 0.08), 0 0 60px rgba(47, 123, 255, 0.16);
}
.lattice span {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #dffcff, var(--blue) 45%, #152d44 76%);
}
.lattice span:nth-child(1) { left: 14%; top: 18%; }
.lattice span:nth-child(2) { left: 62%; top: 11%; background: radial-gradient(circle, #fff, var(--cyan)); }
.lattice span:nth-child(3) { left: 30%; top: 48%; }
.lattice span:nth-child(4) { left: 72%; top: 52%; background: radial-gradient(circle, #fff, #b79645); }
.lattice span:nth-child(5) { left: 12%; top: 78%; background: radial-gradient(circle, #fff, var(--cyan)); }
.lattice span:nth-child(6) { left: 58%; top: 82%; }
.model-card {
  position: absolute;
  width: 250px;
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: rgba(13, 24, 34, 0.5);
  color: var(--muted);
}
.model-card--chart { left: 52%; top: 18%; }
.model-card--bars { left: 52%; top: 37%; }
.model-card i { display: inline-block; background: var(--blue); }
.model-card--chart i { width: 35px; height: 2px; margin: 28px 3px 0; transform: rotate(-18deg); }
.model-card--bars i { display: block; width: var(--w); height: 9px; margin-top: 10px; border-radius: 999px; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px 1fr;
  grid-template-rows: 72px 1fr;
  background:
    linear-gradient(rgba(7, 16, 24, 0.95), rgba(7, 16, 24, 0.97)),
    repeating-linear-gradient(90deg, transparent 0 68px, rgba(47, 123, 255, 0.04) 69px 70px);
}
.sidebar {
  grid-row: 1 / -1;
  border-right: 1px solid var(--line);
  background: rgba(8, 19, 30, 0.92);
  display: flex;
  flex-direction: column;
}
.sidebar__brand {
  min-height: 72px;
  padding: var(--s4);
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: var(--s3);
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.sidebar__brand strong { display: block; font-size: 15px; }
.sidebar__brand span { color: var(--muted); font-size: 12px; }
.side-nav { padding: var(--s4) var(--s3); display: grid; gap: var(--s2); }
.nav-item {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: var(--r2);
  color: #c1cfdb;
  background: transparent;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: var(--s3);
  align-items: center;
  padding: 0 var(--s3);
  text-align: left;
}
.nav-item.is-active {
  color: var(--text);
  border-color: rgba(47, 123, 255, 0.44);
  background: linear-gradient(90deg, rgba(47, 123, 255, 0.26), transparent);
}
.sidebar__collapse {
  min-height: 44px;
  margin: auto var(--s4) var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}
.topbar {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: 0 var(--s5);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 24, 0.82);
  backdrop-filter: blur(14px);
}
.topbar h2 { margin: 0; font-size: 24px; }
.topbar__status {
  display: flex;
  align-items: center;
  gap: var(--s5);
  color: #c7d5e2;
  font-size: 13px;
}
.topbar__status span { white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; }
.dot--ok { background: var(--green); box-shadow: 0 0 12px rgba(85, 216, 127, 0.8); }
.dot--blue { background: var(--blue); box-shadow: 0 0 12px rgba(47, 123, 255, 0.8); }
.dot--warn { background: var(--amber); }
.user-chip {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}
.workspace {
  grid-column: 2;
  min-width: 0;
  padding: var(--s5);
  overflow: auto;
}
.page { display: none; }
.page.is-active { display: block; }
.section-grid { display: grid; gap: var(--s4); }
.section-grid--three { grid-template-columns: 1.2fr 1fr 0.9fr; }
.section-grid--two { grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr); }
.section-grid--teacher { grid-template-columns: minmax(0, 1.35fr) 360px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4); margin-bottom: var(--s4); }
.metric { padding: var(--s4); min-height: 120px; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: var(--s2); font-size: 32px; line-height: 1; }
.metric small { color: var(--muted); }
.panel { padding: var(--s4); min-width: 0; }
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s4);
}
.panel__head h3 { margin: 0; font-size: 18px; }
.panel__head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--s3);
  margin-bottom: var(--s4);
}
.timeline__step {
  min-height: 72px;
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: rgba(255, 255, 255, 0.03);
}
.timeline__step strong { display: block; }
.timeline__step span { color: var(--muted); font-size: 12px; }
.timeline__step.is-active { border-color: var(--blue); box-shadow: var(--glow-blue); }
.timeline__step.is-complete { border-color: rgba(24, 215, 196, 0.45); }

.roadshow-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.88fr);
  gap: var(--s4);
  align-items: stretch;
  margin-bottom: var(--s4);
  border: 1px solid rgba(24, 215, 196, 0.24);
  border-radius: var(--r3);
  padding: var(--s4);
  background:
    radial-gradient(circle at 18% 0%, rgba(24, 215, 196, 0.13), transparent 34%),
    rgba(13, 24, 34, 0.72);
  box-shadow: var(--shadow);
}
.roadshow-hero h3 {
  max-width: 760px;
  margin: var(--s2) 0;
  font-size: 24px;
  line-height: 1.3;
}
.roadshow-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 0;
  color: #bfd0de;
}
.roadshow-hero--teacher {
  grid-template-columns: minmax(0, 1fr) 480px;
}
.impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s3);
}

.ml-pipeline {
  display: grid;
  gap: var(--s3);
}
.ml-step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: var(--s3);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: var(--s3);
  background: rgba(255, 255, 255, 0.03);
}
.ml-step.is-running {
  border-color: rgba(47, 123, 255, 0.6);
  box-shadow: var(--glow-blue);
}
.ml-step__index {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--bg);
  background: var(--cyan);
  font-weight: 800;
}
.ml-step__head {
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
}
.ml-step__head span {
  color: var(--cyan);
  font-size: 12px;
}
.ml-step p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.ml-step b {
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}
.process-map {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--s3);
  align-items: center;
}
.process-node {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: var(--s3);
  background: rgba(255, 255, 255, 0.03);
}
.process-node span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.process-node strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
}
.process-arrow {
  color: var(--cyan);
  font-size: 22px;
  font-weight: 900;
}
.process-note {
  grid-column: 1 / -1;
  border: 1px solid rgba(24, 215, 196, 0.35);
  border-radius: var(--r2);
  padding: var(--s3);
  color: var(--cyan);
  background: rgba(24, 215, 196, 0.08);
}
.evaluation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s3);
}
.evaluation-grid article {
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: var(--s4);
  background: rgba(255, 255, 255, 0.03);
}
.evaluation-grid span,
.evaluation-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.evaluation-grid strong {
  display: block;
  margin: 6px 0;
  color: var(--cyan);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}
.reasoning-panel {
  display: grid;
  gap: var(--s3);
}
.reasoning-panel div {
  border-left: 3px solid var(--cyan);
  padding: var(--s2) var(--s3);
  background: rgba(24, 215, 196, 0.06);
}
.reasoning-panel p {
  margin: 4px 0 0;
  color: var(--muted);
}

.periodic {
  display: grid;
  grid-template-columns: repeat(10, minmax(34px, 1fr));
  gap: 6px;
}
.element {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  color: #d7e4ef;
  background: rgba(255, 255, 255, 0.03);
}
.element.is-selected {
  color: var(--bg);
  background: var(--cyan);
  border-color: var(--cyan);
}
.element.is-common { box-shadow: inset 0 -2px 0 var(--blue); }
.element.is-rare { box-shadow: inset 0 -2px 0 #8a61ff; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s4); color: var(--muted); font-size: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; }
.selected-list { display: grid; gap: var(--s3); }
.ratio-row {
  display: grid;
  grid-template-columns: 64px minmax(130px, 1fr) 70px;
  gap: var(--s3);
  align-items: center;
}
.ratio-row strong { color: var(--cyan); font-size: 18px; }
.ratio-row input { accent-color: var(--cyan); }
.ratio-row input[type="range"] {
  width: 100%;
  min-height: 44px;
}
.ratio-row output {
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  font-variant-numeric: tabular-nums;
}
.validation {
  margin-top: var(--s4);
  padding: var(--s3);
  border: 1px solid rgba(24, 215, 196, 0.36);
  border-radius: var(--r2);
  background: rgba(24, 215, 196, 0.08);
  color: var(--cyan);
}
.prediction-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
.prediction-card {
  min-height: 116px;
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: rgba(255, 255, 255, 0.03);
}
.prediction-card span { color: var(--muted); }
.prediction-card strong { display: block; margin-top: 8px; font-size: 30px; font-variant-numeric: tabular-nums; }
.model-result-source {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: var(--s3);
  padding: var(--s3);
  border: 1px solid rgba(24, 215, 196, 0.28);
  border-radius: var(--r2);
  background: rgba(24, 215, 196, 0.07);
}
.model-result-source span, .model-result-source small { color: var(--muted); }
.model-result-source strong { color: var(--cyan); }
.model-error { min-height: 72px; margin-bottom: var(--s3); padding: var(--s3); }
.risk-low { color: var(--green); }
.risk-mid { color: var(--amber); }
.risk-high { color: var(--red); }
.progress-ring {
  --value: 92%;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: conic-gradient(var(--blue) var(--value), rgba(255, 255, 255, 0.09) 0);
  margin-top: var(--s2);
}
.model-progress { display: grid; gap: var(--s2); margin-top: var(--s4); }
.model-progress__item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: var(--s2);
  color: var(--muted);
  font-size: 13px;
}
.model-progress__item.is-active { color: var(--cyan); }
.chart-bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(128px, 0.8fr) minmax(90px, 1fr) 70px; gap: var(--s3); align-items: center; }
.bar-row > span { overflow-wrap: anywhere; }
.bar-row i {
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  width: calc(var(--v) * 1%);
}
.bar-row.is-negative i { background: linear-gradient(90deg, var(--red), #b83544); justify-self: end; }
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.data-table th { color: var(--muted); font-weight: 600; }
.data-table tr:hover td { background: rgba(47, 123, 255, 0.06); }
.data-table tr.is-selected-row td { background: rgba(24, 215, 196, 0.08); }
.status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}
.status--ok { color: var(--cyan); background: rgba(24, 215, 196, 0.12); }
.status--warn { color: var(--amber); background: rgba(255, 176, 46, 0.14); }
.status--risk { color: var(--red); background: rgba(255, 90, 102, 0.13); }
.list { display: grid; gap: var(--s3); }
.mobile-review-list { display: none; }
.list-row {
  padding: var(--s4);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s3);
  align-items: center;
}
.list-row strong { display: block; }
.list-row span { color: var(--muted); }
.empty-state, .error-state, .loading-state {
  min-height: 170px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--r3);
  color: var(--muted);
}
.loading-state i {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(47, 123, 255, 0.18);
  border-top-color: var(--blue);
  animation: spin 900ms linear infinite;
}
.error-state { color: var(--red); border-color: rgba(255, 90, 102, 0.42); }

.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s4); }
.review-drawer { padding: var(--s4); position: sticky; top: 0; align-self: start; }
.review-drawer__head { display: flex; justify-content: space-between; gap: var(--s3); align-items: start; }
.review-drawer__actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-top: var(--s4); }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); margin: var(--s4) 0; }
.detail-grid div { border: 1px solid var(--line); border-radius: var(--r2); padding: var(--s3); }
.detail-grid span { display: block; color: var(--muted); font-size: 12px; }
.detail-grid strong { font-size: 20px; }
.mobile-review-list__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
  font-size: 12px;
}
.toast {
  position: fixed;
  right: var(--s5);
  bottom: var(--s5);
  z-index: 20;
  max-width: 360px;
  padding: var(--s4);
  border: 1px solid rgba(24, 215, 196, 0.4);
  border-radius: var(--r3);
  background: rgba(13, 24, 34, 0.95);
  box-shadow: var(--shadow);
}
.completion-state {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 8, 13, 0.68);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--base);
}
.completion-state.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.completion-state__panel {
  width: min(900px, 100%);
  border: 1px solid rgba(24, 215, 196, 0.42);
  border-radius: var(--r3);
  padding: var(--s7);
  background:
    radial-gradient(circle at 82% 18%, rgba(24, 215, 196, 0.16), transparent 34%),
    rgba(13, 24, 34, 0.96);
  box-shadow: var(--shadow), var(--glow-cyan);
}
.completion-state__panel h2 {
  margin: 6px 0 10px;
  font-size: 36px;
}
.completion-state__panel p {
  margin: 0 0 var(--s5);
  color: #c3d2df;
}
.completion-state__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s3);
}
.completion-state__value {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s3);
  margin-top: var(--s3);
}
.completion-state__grid article {
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: var(--s4);
  background: rgba(255, 255, 255, 0.04);
}
.completion-state__grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.completion-state__grid strong {
  display: block;
  margin-top: 6px;
  color: var(--cyan);
  font-size: 26px;
}
.completion-state__grid article:nth-child(2) strong { font-size: 20px; white-space: nowrap; }
.completion-state__steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s5);
}
.completion-state__steps span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(24, 215, 196, 0.35);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--cyan);
  background: rgba(24, 215, 196, 0.08);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--s4);
}
.form-grid .field--wide { grid-column: 1 / -1; }
.ai-goal-layout { margin-bottom: var(--s4); }
.strategy-result h4 { margin: var(--s2) 0; font-size: 20px; }
.strategy-result p { color: #bfd0de; }
.strategy-result ol { margin: var(--s4) 0; padding-left: 22px; color: #c8d5df; }
.strategy-result li + li { margin-top: var(--s2); }
.empty-state--compact { min-height: 220px; padding: var(--s5); }
.empty-state--compact p { max-width: 420px; margin: var(--s2) 0 0; }
.record-actions,
.completion-state__actions,
.project-report__actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s4);
}
.evidence-progress {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--s4);
  margin-bottom: var(--s2);
}
.evidence-progress strong { color: var(--cyan); font-size: 34px; }
.evidence-progress span { color: var(--muted); }
.evidence-list .list-row { border-bottom: 1px solid var(--line); }
.archive-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s5);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--s4);
  margin-bottom: var(--s4);
}
.archive-summary h3 { margin: 4px 0; font-size: 24px; }
.archive-summary p:not(.eyebrow) { margin: 0; color: var(--muted); }
.archive-steps { margin: 0 0 var(--s5); }
.evidence-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: var(--s3);
  margin: var(--s3) 0;
  background: rgba(255, 255, 255, 0.03);
}
.evidence-summary span { color: var(--muted); font-size: 12px; }
.completion-state__panel { position: relative; max-height: calc(100vh - 48px); overflow: auto; }
.completion-state__close { position: absolute; top: 12px; right: 12px; z-index: 2; }
.project-report-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: auto;
  padding: 32px;
  background: rgba(3, 8, 13, 0.82);
  backdrop-filter: blur(12px);
}
.project-report {
  width: min(980px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(24, 215, 196, 0.38);
  border-radius: var(--r3);
  padding: var(--s7);
  background: var(--surface);
  box-shadow: var(--shadow), var(--glow-cyan);
}
.project-report__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s4);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--s5);
}
.project-report__head h2 { margin: 4px 0; font-size: 30px; }
.project-report__head p:not(.eyebrow) { margin: 0; color: var(--muted); }
.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s3);
}
.report-grid--summary { margin: var(--s5) 0; }
.report-grid section,
.report-grid p {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: var(--s4);
  background: rgba(255, 255, 255, 0.03);
}
.report-grid span,
.report-note span { display: block; color: var(--muted); font-size: 12px; }
.report-grid strong { display: block; margin-top: 6px; overflow-wrap: anywhere; }
.report-section { border-top: 1px solid var(--line); padding-top: var(--s4); margin-top: var(--s4); }
.report-section h3 { margin: 0 0 var(--s3); }
.report-note { margin: var(--s3) 0 0; color: #c7d5e2; }
.report-approval {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s4);
  border-left: 3px solid var(--cyan);
  padding: var(--s3) var(--s4);
  background: rgba(24, 215, 196, 0.07);
}
.report-approval strong { color: var(--cyan); }

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

@media (max-width: 760px) {
  body { background: var(--bg); }
  .mobile-only { display: inline-grid !important; }
  .login-view { padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); align-items: start; }
  .login-view__content { grid-template-columns: 1fr; gap: var(--s5); }
  .login-view__content {
    grid-template-areas:
      "brand"
      "visual"
      "metrics"
      "value"
      "auth";
  }
  .brand-block { grid-template-columns: 58px 1fr; gap: var(--s3); margin-top: 36px; }
  .brand-block h1 { font-size: 30px; line-height: 1.2; }
  .brand-block__copy { font-size: 14px; }
  .brand-mark { width: 58px; height: 58px; }
  .roadshow-visual--hero { aspect-ratio: 16 / 7; margin-top: var(--s4); }
  .value-strip { grid-template-columns: 1fr; gap: var(--s2); }
  .login-metrics { grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin-top: var(--s5); }
  .login-metrics article { padding: var(--s3); min-height: 76px; }
  .login-metrics strong { font-size: 22px; }
  .auth-panel { padding: var(--s5); }
  .lattice--large { left: 55%; top: 11%; width: 170px; height: 170px; opacity: 0.42; }
  .model-card { display: none; }

  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }
  .sidebar { display: none; }
  .topbar {
    grid-column: 1;
    min-height: 76px;
    padding: max(12px, env(safe-area-inset-top)) 16px 12px;
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .topbar h2 { font-size: 22px; }
  .topbar__status { gap: var(--s2); font-size: 12px; }
  .topbar__status span:not(.user-chip):first-child { display: none; }
  .user-chip { display: none; }
  .workspace { grid-column: 1; padding: var(--s4); overflow: visible; }
  .metrics-grid { grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
  .metric { min-height: 96px; padding: var(--s3); }
  .metric strong { font-size: 26px; }
  .roadshow-hero,
  .roadshow-hero--teacher { grid-template-columns: 1fr; }
  .roadshow-hero h3 { font-size: 20px; }
  .roadshow-visual--pipeline { min-height: 130px; }
  .impact-grid { grid-template-columns: 1fr; }
  .section-grid,
  .section-grid--three,
  .section-grid--two,
  .section-grid--teacher,
  .review-layout { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: repeat(5, minmax(96px, 1fr)); overflow-x: auto; padding-bottom: var(--s2); }
  .periodic { grid-template-columns: repeat(6, 1fr); }
  .element { min-height: 42px; }
  .ratio-row { grid-template-columns: 58px 1fr 62px; }
  .prediction-grid { grid-template-columns: 1fr 1fr; }
  .ml-step { grid-template-columns: 34px 1fr; }
  .ml-step b { grid-column: 2; }
  .process-map { grid-template-columns: 1fr; }
  .process-arrow { display: none; }
  .evaluation-grid { grid-template-columns: repeat(2, 1fr); }
  .prediction-card { min-height: 106px; padding: var(--s3); }
  .prediction-card strong { font-size: 24px; }
  .data-table { min-width: 680px; }
  .table-scroll { overflow-x: auto; }
  .review-table-wrap { display: none; }
  .mobile-review-list { display: grid; gap: var(--s3); }
  .mobile-review-list .list-row {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
  .mobile-review-list .list-row span {
    display: block;
    overflow-wrap: anywhere;
  }
  .review-drawer {
    position: fixed;
    top: auto;
    left: 12px;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    z-index: 12;
    max-height: 46vh;
    overflow: auto;
  }
  .review-drawer[hidden] { display: none; }
  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 14;
    min-height: calc(68px + env(safe-area-inset-bottom));
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    border-top: 1px solid var(--line);
    background: rgba(7, 16, 24, 0.96);
    backdrop-filter: blur(14px);
  }
  .bottom-nav .nav-item {
    min-height: 54px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2px;
    padding: 4px;
    font-size: 12px;
  }
  .bottom-nav .nav-item span:first-child { font-size: 20px; line-height: 1; }
  .toast { left: var(--s4); right: var(--s4); bottom: calc(84px + env(safe-area-inset-bottom)); }
  .completion-state__panel { padding: var(--s5); }
  .completion-state__panel h2 { font-size: 27px; }
  .completion-state__grid,
  .completion-state__value { grid-template-columns: 1fr; }
  .roadshow-visual--archive { aspect-ratio: 16 / 6; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field--wide { grid-column: auto; }
  .record-actions .button { flex: 1 1 150px; }
  .archive-summary { display: grid; }
  .project-report-overlay { padding: 12px; }
  .project-report { padding: var(--s5); }
  .project-report__head h2 { font-size: 24px; }
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-approval { grid-template-columns: 1fr; }
}

@media print {
  body { color: #111827; background: #fff; }
  body > :not(.project-report-overlay) { display: none !important; }
  .project-report-overlay { position: static; padding: 0; background: #fff; }
  .project-report { width: 100%; border: 0; color: #111827; background: #fff; box-shadow: none; }
  .project-report__actions, .project-report__head .icon-button { display: none; }
  .report-grid section, .report-grid p { border-color: #d1d5db; background: #fff; }
  .report-grid span, .report-note span, .project-report__head p:not(.eyebrow) { color: #4b5563; }
}

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