/* UI scale 1.2 applied to all px sizes. OTiS — charcoal #333 with a gold #f0bc5a accent and hairline outlines. */

:root {
  /* Dark charcoal page, warm gold accent, thin outlines instead of shadows
     (inspired by Wolfram|Alpha's home page). */
  --bg: #333333;
  --bg-elev: #333333;          /* boxes sit on the page, separated by a line */
  --bg-input: #2a2a2a;
  --fill: rgba(255, 255, 255, 0.06);
  --fill-2: rgba(255, 255, 255, 0.11);
  --label: #ececec;
  --label-2: #b4b4b4;
  --label-3: #a3a3a3;          /* 5.0:1 on #333333 (WCAG AA) */
  --line: #5e5e5e;             /* the thin box outline */
  --line-strong: #7a7a7a;
  --sep: #474747;              /* rows inside a box */
  --glass: #333333;
  --glass-border: #5e5e5e;
  --nav: #333333;
  --shadow: none;

  --accent: #f0bc5a;
  --on-accent: #2b2b2b;
  --blue: #f0bc5a;             /* OTiS network path = brand gold */
  --purple: #a898f2;           /* start marker, velocity */
  --green: #52c08a;            /* convex optimization */
  --orange: #ee7f5c;           /* E-guidance */
  --red: #e65b55;              /* goal */
  --pink: #d78fbd;             /* control vectors */
  --indigo: #a898f2;
  --teal: #55b6cc;             /* pursuit */
  --yellow: #f6d27f;
  --navy: #f0bc5a;

  --canvas-bg: #2e2e2e;
  --grid: rgba(255, 255, 255, 0.05);
  --grid-strong: #5e5e5e;

  --radius-xl: 0;
  --radius-l: 0;
  --radius-m: 0;
  --font: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.25, .1, .25, 1);
  --spring: cubic-bezier(.34, 1.36, .64, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: 15.6px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.muted { color: var(--label-2); font-weight: 400; }
small { display: block; color: var(--label-2); font-size: 14.4px; margin-top: 1px; }
code, kbd { font-family: var(--mono); font-size: 14.4px; background: var(--fill); padding: 1px 7.2px; border-radius: 0; }

/* ---------- navigation bar (translucent material) ---------- */
.navbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--nav);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 0.5px solid var(--sep);
}
.nav-inner {
  max-width: 1728px; margin: 0 auto; height: 62.4px; padding: 0 28.8px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 19.2px;
}
.brand { display: flex; align-items: center; gap: 9.6px; font-weight: 600; font-size: 20.4px; letter-spacing: -0.02em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text span { font-family: var(--serif); font-size: 24px; letter-spacing: 0.02em; }
.brand-text small { margin: 0; font-size: 13.2px; font-weight: 500; color: var(--label-2); letter-spacing: 0.01em; }
.brand-mark { width: 26.4px; height: 26.4px; color: var(--accent); }
.status { justify-self: end; display: flex; align-items: center; gap: 9.6px; font-size: 15.6px; color: var(--label-2); }
.status .dot { width: 9.6px; height: 9.6px; border-radius: 0; background: var(--label-3); transition: background .3s; }
.status.live .dot { background: var(--green); box-shadow: 0 0 0 0 var(--green); animation: pulse 1.6s infinite; }
.status.ready .dot { background: var(--blue); }
.status.warn .dot { background: var(--orange); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,199,89,.5);} 70% { box-shadow: 0 0 0 8.4px rgba(52,199,89,0);} 100% { box-shadow: 0 0 0 0 rgba(52,199,89,0);} }

/* ---------- segmented control ---------- */
.segmented {
  position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--fill); border-radius: 0; padding: 2.4px; isolation: isolate;
}
.segmented button {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer;
  padding: 6px 21.6px; font-size: 15.6px; font-weight: 500; border-radius: 0; color: var(--label);
  transition: color .2s var(--ease); white-space: nowrap;
}
.segmented .seg-thumb {
  position: absolute; z-index: 0; top: 2.4px; bottom: 2.4px; left: 2.4px; border-radius: 0;
  background: var(--bg-elev); box-shadow: 0 3.6px 9.6px rgba(0,0,0,.12), 0 3.6px 1px rgba(0,0,0,.04);
  transition: transform .35s var(--spring), width .35s var(--spring);
}
.segmented.small { display: grid; width: 100%; }
.segmented.small button { padding: 6px 4.8px; font-size: 14.4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.layout > * { min-width: 0; }

/* ---------- views ---------- */
main { max-width: 1728px; margin: 0 auto; padding: 0 28.8px 76.8px; }
.view { display: none; animation: fade .45s var(--ease); }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(7.2px); } to { opacity: 1; transform: none; } }

.hero { text-align: center; padding: 52.8px 0 33.6px; }
.hero h1 { font-size: clamp(38.4px, 4.2vw, 62.4px); line-height: 1.07; font-weight: 650; letter-spacing: -0.025em; margin: 0 0 14.4px; font-family: var(--serif); }
.hero p { max-width: 864px; margin: 0 auto; font-size: 22.8px; line-height: 1.45; color: var(--label-2); letter-spacing: -0.015em; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 468px; gap: 24px; align-items: start; }
@media (max-width: 1296px) { .layout { grid-template-columns: 1fr; } }

.card { background: var(--bg-elev); border-radius: 0; box-shadow: var(--shadow); }
.glass {
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(28.8px);
  -webkit-backdrop-filter: saturate(180%) blur(28.8px);
  border: 0.5px solid var(--glass-border);
  box-shadow: 0 4.8px 21.6px rgba(0,0,0,.08);
}

/* ---------- stage ---------- */
.stage { position: relative; overflow: hidden; aspect-ratio: 1 / 0.82; width: 100%; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#sim-canvas { cursor: crosshair; }
#sim-canvas.grab { cursor: grab; }
#sim-canvas.grabbing { cursor: grabbing; }
.legend { position: absolute; top: 19.2px; left: 19.2px; border-radius: 0; padding: 9.6px 14.4px; display: flex; flex-direction: column; gap: 4.8px; font-size: 14.4px; font-weight: 500; }
.legend span { display: flex; align-items: center; gap: 9.6px; }
.legend i { width: 21.6px; height: 3.6px; border-radius: 0; display: inline-block; }
.hint { position: absolute; top: 19.2px; right: 19.2px; border-radius: 0; padding: 8.4px 14.4px; font-size: 14.4px; color: var(--label-2); max-width: 408px; transition: opacity .4s; }
.hint b { font-weight: 600; }
.c-start { color: var(--purple); } .c-goal { color: var(--red); } .c-vel { color: var(--indigo); }
.badge { position: absolute; top: 19.2px; left: 19.2px; border-radius: 0; padding: 8.4px 14.4px; font-size: 15.6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.transport {
  position: absolute; left: 50%; bottom: 19.2px; transform: translateX(-50%);
  width: min(672px, calc(100% - 38.4px)); border-radius: 0; padding: 9.6px 16.8px 9.6px 9.6px;
  display: flex; align-items: center; gap: 14.4px;
}
.transport .mono { min-width: 103.2px; text-align: right; color: var(--label-2); font-size: 14.4px; }
.icon-btn { width: 40.8px; height: 40.8px; border-radius: 0; border: 0; background: var(--accent); color: white; display: grid; place-items: center; cursor: pointer; flex: none; transition: transform .2s var(--spring), filter .2s; }
.icon-btn svg { width: 19.2px; height: 19.2px; fill: currentColor; }
.icon-btn:hover { filter: brightness(1.08); }
.icon-btn:active { transform: scale(.92); }

/* ---------- range slider (iOS style) ---------- */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 33.6px; background: transparent; cursor: pointer; flex: 1; --p: 100%; }
input[type=range]::-webkit-slider-runnable-track { height: 4.8px; border-radius: 0; background: linear-gradient(to right, var(--accent) var(--p), var(--fill-2) var(--p)); }
input[type=range]::-moz-range-track { height: 4.8px; border-radius: 0; background: var(--fill-2); }
input[type=range]::-moz-range-progress { height: 4.8px; border-radius: 0; background: var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26.4px; height: 26.4px; margin-top: -10.8px; border-radius: 0; background: #fff; box-shadow: 0 0.5px 4.8px rgba(0,0,0,.12), 0 7.2px 15.6px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); transition: transform .15s var(--spring); }
input[type=range]::-moz-range-thumb { width: 26.4px; height: 26.4px; border: 0; border-radius: 0; background: #fff; box-shadow: 0 0.5px 4.8px rgba(0,0,0,.12), 0 7.2px 15.6px rgba(0,0,0,.12); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.1); }

/* ---------- inspector: grouped inset lists ---------- */
.inspector { display: flex; flex-direction: column; gap: 26.4px; }
.group-title { font-size: 15.6px; font-weight: 600; color: var(--label); padding: 0 19.2px 8.4px; display: flex; justify-content: space-between; align-items: baseline; }
.group-title .muted { font-size: 14.4px; }
.list { background: var(--bg-elev); border-radius: 0; box-shadow: var(--shadow); overflow: hidden; }
.list.pad { padding: 14.4px 16.8px; }
.row { display: flex; align-items: center; gap: 14.4px; padding: 13.2px 19.2px; min-height: 52.8px; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 19.2px; right: 0; height: 0.5px; background: var(--sep); }
.row.col { flex-direction: column; align-items: stretch; gap: 7.2px; }
.row.slider-row { padding-top: 0; min-height: 40.8px; }
.row.slider-row::before { display: none; }
.row.buttons { gap: 9.6px; }
.row.buttons .btn { flex: 1; }
.grow { flex: 1; min-width: 0; font-weight: 450; }
label.row { cursor: pointer; }
.swatch { width: 14.4px; height: 14.4px; border-radius: 0; flex: none; }
.swatch.neural { background: var(--blue); } .swatch.convex { background: var(--green); } .swatch.eguid { background: var(--orange); } .swatch.thrust { background: var(--pink); }

/* iOS switch */
.switch { -webkit-appearance: none; appearance: none; width: 61.2px; height: 37.2px; border-radius: 0; background: var(--fill-2); position: relative; cursor: pointer; flex: none; transition: background .25s var(--ease); margin: 0; }
.switch::after { content: ""; position: absolute; top: 2.4px; left: 2.4px; width: 32.4px; height: 32.4px; border-radius: 0; background: #fff; box-shadow: 0 3.6px 9.6px rgba(0,0,0,.15), 0 3.6px 1px rgba(0,0,0,.06); transition: transform .3s var(--spring); }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(24px); }

/* buttons */
.btn { border: 0; border-radius: 0; background: var(--fill); padding: 9.6px 19.2px; font-size: 16.8px; font-weight: 500; cursor: pointer; transition: transform .15s var(--spring), background .2s, opacity .2s; }
.btn:hover { background: var(--fill-2); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .4; pointer-events: none; }

/* comparison table */
.compare .row { padding: 12px 19.2px; }
.cmp-head { font-size: 13.2px; text-transform: uppercase; letter-spacing: .04em; color: var(--label-2); font-weight: 600; }
.cmp-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr)); gap: 4.8px 9.6px; width: 100%; align-items: baseline; }
.cmp-grid .num { text-align: right; font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.cmp-name { display: flex; align-items: center; gap: 8.4px; font-weight: 500; font-size: 15.6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.delta { font-size: 13.2px; font-family: var(--mono); text-align: right; }
.delta.good { color: var(--green); } .delta.bad { color: var(--red); } .delta.neutral { color: var(--label-2); }

/* KPIs */
.kpis { display: grid; grid-template-columns: 1fr 1fr; border-top: 0.5px solid var(--sep); }
.kpi { padding: 14.4px 19.2px; display: flex; flex-direction: column; gap: 2.4px; }
.kpi:nth-child(odd) { border-right: 0.5px solid var(--sep); }
.kpi:nth-child(n+3) { border-top: 0.5px solid var(--sep); }
.kpi-val { font-size: 26.4px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-lab { font-size: 14.4px; color: var(--label-2); }
.progress { height: 7.2px; border-radius: 0; background: var(--fill); overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--accent); border-radius: 0; transition: width .3s var(--ease); }
.mini-legend { display: flex; gap: 19.2px; font-size: 14.4px; color: var(--label-2); margin-top: 7.2px; }
.mini-legend .ln { display: inline-block; width: 16.8px; height: 3.6px; border-radius: 0; margin-right: 7.2px; vertical-align: middle; }
.ln.neural { background: var(--blue); } .ln.convex { background: var(--green); }
#thrust-canvas, #loss-canvas { width: 100%; display: block; }

/* ---------- benchmark ---------- */
.empty { padding: 57.6px; text-align: center; color: var(--label-2); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 19.2px; margin-bottom: 24px; }
@media (max-width: 1152px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { background: var(--bg-elev); border-radius: 0; box-shadow: var(--shadow); padding: 26.4px 26.4px 24px; }
.tile .t-lab { font-size: 15.6px; font-weight: 600; color: var(--label-2); }
.tile .t-val { font-size: 48px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; margin: 9.6px 0 4.8px; font-variant-numeric: tabular-nums; }
.tile .t-sub { font-size: 15.6px; color: var(--label-2); }
.tile.blue .t-val { color: var(--blue); } .tile.green .t-val { color: var(--green); } .tile.orange .t-val { color: var(--orange); } .tile.indigo .t-val { color: var(--indigo); }
.table-card { padding: 26.4px 28.8px; margin-bottom: 24px; }
.table-card h2 { margin: 0 0 16.8px; font-size: 25.2px; font-weight: 600; letter-spacing: -0.02em; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 16.8px; }
th { text-align: right; font-size: 14.4px; font-weight: 600; color: var(--label-2); padding: 9.6px 12px; border-bottom: 0.5px solid var(--sep); white-space: nowrap; }
td { text-align: right; padding: 13.2px 12px; border-bottom: 0.5px solid var(--sep); font-family: var(--mono); font-size: 15.6px; font-variant-numeric: tabular-nums; letter-spacing: 0; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; font-family: var(--font); font-size: 16.8px; letter-spacing: -0.01em; }
td:first-child { font-weight: 500; }
tr:last-child td { border-bottom: 0; }
td.good { color: var(--green); } td.bad { color: var(--red); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 1152px) { .two { grid-template-columns: 1fr; } }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; gap: 14.4px; padding: 12px 0; border-bottom: 0.5px solid var(--sep); align-items: flex-start; }
.checks li:last-child { border-bottom: 0; }
.checks .ok { width: 26.4px; height: 26.4px; border-radius: 0; background: var(--green); color: #fff; display: grid; place-items: center; flex: none; font-size: 15.6px; font-weight: 700; }
.checks .c-t { font-weight: 500; }
.checks .c-v { font-family: var(--mono); font-size: 14.4px; color: var(--label-2); }
.bars { display: flex; flex-direction: column; gap: 16.8px; }
.bar-row .bar-lab { display: flex; justify-content: space-between; font-size: 15.6px; margin-bottom: 6px; }
.bar-row .bar-lab .mono { color: var(--label-2); font-size: 14.4px; }
.bar-track { height: 12px; background: var(--fill); border-radius: 0; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 0; transition: width .8s var(--ease); }
.footnote { color: var(--label-2); font-size: 15.6px; max-width: 1080px; margin: 9.6px auto 0; text-align: center; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 33.6px; transform: translate(-50%, 24px); opacity: 0; border-radius: 0; padding: 12px 21.6px; font-size: 16.8px; font-weight: 500; pointer-events: none; transition: all .35s var(--spring); z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 768px) {
  .nav-inner { grid-template-columns: auto 1fr; padding: 0 19.2px; }
  .status { display: none; }
  main { padding: 0 19.2px 57.6px; }
  .hint { display: none; }
}


.vehicle-bar { display: flex; flex-direction: column; align-items: center; gap: 14.4px; margin: 0 0 26.4px; }
.vehicle-blurb { max-width: 864px; margin: 0; font-size: 18px; line-height: 1.45; color: var(--label-2); text-align: center; }
.swatch.pursuit { background: var(--teal); }

/* ---------- parameters panel ---------- */
.layout.three { grid-template-columns: 360px minmax(0, 1fr) 432px; }
@media (max-width: 1584px) {
  .layout.three { grid-template-columns: minmax(0, 1fr) 432px; }
  .layout.three .params-panel { grid-column: 1 / -1; order: 3; display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); align-items: start; }
}
@media (max-width: 1296px) { .layout.three { grid-template-columns: 1fr; } }
.params-panel { gap: 21.6px; }
.title-actions { display: flex; gap: 2.4px; }
.linkbtn { border: 0; background: none; color: var(--accent); font-size: 15px; font-weight: 600; padding: 2.4px 7.2px; border-radius: 0; cursor: pointer; }
.linkbtn:hover { background: var(--fill); }
.param-sub { font-size: 13.2px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--label-2); padding: 14.4px 19.2px 7.2px; }
.param-sub:first-child { padding-top: 12px; }
.param-list + .param-sub { border-top: 0.5px solid var(--sep); }
.field { display: grid; grid-template-columns: minmax(0, 1fr) 110.4px 52.8px; align-items: center; gap: 9.6px; padding: 7.2px 14.4px 7.2px 19.2px; min-height: 48px; }
.field-lab { font-size: 16.8px; font-weight: 450; line-height: 1.2; cursor: help; text-decoration: underline dotted transparent; text-underline-offset: 3.6px; }
.field-lab:hover { text-decoration-color: var(--label-3); }
.field .unit, .field-pair .unit { font-size: 14.4px; color: var(--label-2); white-space: nowrap; }
.num-in {
  width: 100%; min-width: 0; border: 0.5px solid transparent; border-radius: 0; background: var(--fill);
  padding: 6px 9.6px; text-align: right; font-family: var(--mono); font-size: 15.6px; font-variant-numeric: tabular-nums;
  letter-spacing: 0; outline: none; transition: background .15s, box-shadow .15s, border-color .15s;
}
.num-in:hover { background: var(--fill-2); }
.num-in:focus { background: var(--bg); border-color: var(--accent); box-shadow: 0 0 0 3.6px rgba(85, 85, 85, .18); }
.num-in.invalid { border-color: var(--red); box-shadow: 0 0 0 3.6px rgba(139, 58, 42, .18); }
.num-in.edited { font-weight: 600; }
.num-in:disabled { opacity: .55; cursor: not-allowed; }
.field-note { grid-column: 1 / -1; font-size: 13.8px; color: var(--red); margin-top: -2.4px; }
.field-pair { display: grid; grid-template-columns: 74.4px 1fr 1fr 40.8px; gap: 9.6px; align-items: center; padding: 8.4px 14.4px 8.4px 19.2px; position: relative; }
.field-pair + .field-pair::before { content: ""; position: absolute; top: 0; left: 19.2px; right: 0; height: 0.5px; background: var(--sep); }
.pair-lab { font-size: 16.8px; font-weight: 450; }
.mini { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mini > span { font-size: 13.2px; color: var(--label-3); font-family: var(--mono); width: 16.8px; text-align: right; flex: none; }
.drow { display: flex; justify-content: space-between; gap: 14.4px; padding: 9.6px 19.2px; font-size: 16.2px; position: relative; }
.drow + .drow::before { content: ""; position: absolute; top: 0; left: 19.2px; right: 0; height: 0.5px; background: var(--sep); }
.drow .mono { color: var(--label); }
.drow .dlab { color: var(--label-2); }
.notes { padding: 9.6px 19.2px 14.4px; display: flex; flex-direction: column; gap: 7.2px; border-top: 0.5px solid var(--sep); }
.note { font-size: 15px; line-height: 1.35; padding: 8.4px 12px; border-radius: 0; background: rgba(181, 106, 60, .12); color: var(--label); }
.note.ok { background: rgba(61, 92, 74, .12); }
.note.info { background: var(--fill); color: var(--label-2); }
.neural-body { padding: 14.4px 19.2px; display: flex; flex-direction: column; gap: 9.6px; font-size: 16.2px; }
.neural-body .state { display: flex; align-items: center; gap: 9.6px; font-weight: 600; }
.neural-body .state i { width: 9.6px; height: 9.6px; border-radius: 0; background: var(--label-3); flex: none; }
.neural-body .state.on i { background: var(--green); }
.neural-body .state.live i { background: var(--green); animation: pulse 1.6s infinite; }
.neural-body .state.off i { background: var(--orange); }
.neural-body p { margin: 0; color: var(--label-2); font-size: 15px; }
.neural-body .btn { align-self: flex-start; }
.plant-summary { padding: 12px 19.2px 14.4px; display: flex; flex-wrap: wrap; gap: 7.2px; }
.chip { font-size: 14.4px; font-family: var(--mono); background: var(--fill); border-radius: 0; padding: 3.6px 9.6px; letter-spacing: 0; white-space: nowrap; }
.chip b { font-family: var(--font); font-weight: 600; margin-right: 4.8px; letter-spacing: -0.01em; }


/* ---------- outlined, shadowless theme ---------- */
.navbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 1px solid var(--sep); }
.brand-mark, .brand-text span { color: var(--accent); }
.card, .list, .tile, .glass { background: var(--bg-elev); box-shadow: none; border: 1px solid var(--line); backdrop-filter: none; -webkit-backdrop-filter: none; }
.glass { background: rgba(51, 51, 51, 0.94); }
.stage.card { background: var(--canvas-bg); }
.hero h1 { color: var(--label); font-weight: 500; }
.hero p { font-family: var(--serif); font-style: italic; font-weight: 300; color: var(--label-2); }
.group-title { color: var(--accent); font-weight: 600; }
.group-title .muted { color: var(--label-3); }

/* segmented: dark pill track, active segment outlined in gold */
.segmented { background: transparent; border: 1px solid var(--line); padding: 2.4px; }
.segmented .seg-thumb { background: rgba(240, 188, 90, 0.12); box-shadow: none; border: 1px solid var(--accent); }
.segmented button { color: var(--label-2); }
.segmented button.active { color: var(--accent); }

/* buttons */
.btn { background: transparent; border: 1px solid var(--line); color: var(--label); }
.btn:hover { background: var(--fill); border-color: var(--line-strong); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.icon-btn { color: var(--on-accent); }
.linkbtn { color: var(--accent); }

/* switch: outlined track, gold when on */
.switch { background: transparent; border: 1px solid var(--line-strong); }
.switch::after { background: var(--label-2); box-shadow: none; top: 3.6px; left: 3.6px; width: 27.6px; height: 27.6px; }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { background: var(--on-accent); }

/* sliders */
input[type=range]::-webkit-slider-thumb { background: var(--accent); box-shadow: none; border: 1px solid var(--on-accent); width: 16.8px; height: 21.6px; margin-top: -8.4px; }
input[type=range]::-moz-range-thumb { background: var(--accent); box-shadow: none; border: 1px solid var(--on-accent); width: 16.8px; height: 21.6px; }

/* inputs: dark field, thin line, gold focus ring like a search box */
.num-in { background: var(--bg-input); border: 1px solid var(--line); color: var(--label); }
.num-in:hover { background: var(--bg-input); border-color: var(--line-strong); }
.num-in:focus { background: var(--bg-input); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.num-in.invalid { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.num-in.edited { color: var(--accent); }

/* notes, chips, progress */
.note { background: transparent; border: 1px solid rgba(238, 127, 92, 0.55); color: var(--label); }
.note.ok { border-color: rgba(82, 192, 138, 0.55); }
.note.info { background: transparent; border: 1px solid var(--line); color: var(--label-2); }
.chip { background: transparent; border: 1px solid var(--line); }
.progress { background: var(--bg-input); border: 1px solid var(--sep); }
.bar-track { background: var(--bg-input); }
.checks .ok { color: var(--on-accent); }
kbd, code { background: transparent; border: 1px solid var(--line); }
.status.ready .dot { background: var(--accent); }
.kpis, .kpi, .kpi:nth-child(odd), .kpi:nth-child(n+3), .notes, .param-list + .param-sub { border-color: var(--sep); }
.toast { color: var(--label); }


/* ---------- training log ---------- */
.log-card { margin-top: 24px; }
.log-head { display: flex; align-items: center; justify-content: space-between; gap: 19.2px; flex-wrap: wrap; margin-bottom: 14.4px; }
.log-head h2 { margin: 0; }
.log-head h2 .muted { font-size: 15.6px; font-weight: 400; letter-spacing: 0; margin-left: 9.6px; color: var(--label-3); }
.log-tools { display: flex; align-items: center; gap: 9.6px; }
.log-tools .segmented button { padding: 4.8px 14.4px; font-size: 15px; }
.small-lab { font-size: 15px; color: var(--label-3); }
.log-wrap { max-height: 432px; overflow-y: auto; border: 1px solid var(--sep); }
#log-table th { position: sticky; top: 0; background: var(--bg); z-index: 1; }
#log-table td { padding: 8.4px 12px; }
#log-table tr.latest td { color: var(--accent); }
#log-table tr.fresh td { animation: logflash 1.2s var(--ease); }
@keyframes logflash { from { background: rgba(240, 188, 90, 0.16); } to { background: transparent; } }
#log-table td.empty { text-align: left; color: var(--label-3); font-family: var(--font); }
.log-foot { display: block; margin-top: 12px; font-size: 14.4px; }


/* ---------- vehicle bar under the logo ---------- */
.nav-sub { padding: 18px 0 0; display: flex; align-items: center; }
.nav-sub.hidden { display: none; }
.nav-sub .segmented button { padding: 6px 22px; font-size: 15.6px; }
.hero { padding-top: 28px; }

/* larger status marker, top right */
.status { font-size: 19px; gap: 12px; color: var(--label); font-weight: 500; }
.status .dot { width: 13px; height: 13px; }
/* simulator intro: white, upright */
#sim-hero { color: #ffffff; font-style: normal; font-weight: 400; }

/* vehicle bar = parameters column width; training badge matches it */
:root { --side-w: 360px; --bar-h: 44px; }
.nav-sub { padding: 34px 0 0; }
.nav-sub .segmented { width: var(--side-w); height: var(--bar-h); box-sizing: border-box; }
.nav-sub .segmented button { padding: 0 8px; }
.view > .hero:first-child { padding-top: 22px; padding-bottom: 22px; }
#train-badge { width: var(--side-w); height: var(--bar-h); box-sizing: border-box; display: flex; align-items: center; justify-content: center; padding: 0 12px; white-space: nowrap; }
#sim-hero { font-size: 25.2px; max-width: 1000px; }
@media (max-width: 640px) { :root { --side-w: 100%; } }

/* intro sentence spans exactly the simulation column */
#view-simulator > .hero { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) 432px; gap: 24px; text-align: center; }
#view-simulator > .hero #sim-hero { grid-column: 2; max-width: none; margin: 0; }
@media (max-width: 1584px) {
  #view-simulator > .hero { grid-template-columns: minmax(0, 1fr) 432px; }
  #view-simulator > .hero #sim-hero { grid-column: 1; }
}
@media (max-width: 1296px) { #view-simulator > .hero { grid-template-columns: 1fr; } }

/* badge: right edge flush with the vehicle bar (stage inset is 19.2px) */
#train-badge { width: calc(var(--side-w) - 20.2px); padding: 0 6px; font-size: 15px; }

/* vehicle bar sits in the title row, left column; no whitespace above the row */
.view > .hero:first-child { padding-top: 16px; padding-bottom: 20px; }
.view > .hero .nav-sub { padding: 0; grid-column: 1; grid-row: 1; align-self: center; justify-self: start; }
#view-simulator > .hero #sim-hero { grid-row: 1; }
#view-training > .hero { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) var(--side-w); gap: 24px; align-items: center; }
#view-training > .hero h1 { grid-column: 2; grid-row: 1; margin: 0; }
@media (max-width: 1584px) {
  #view-simulator > .hero { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  #view-simulator > .hero #sim-hero { grid-column: 2; }
}
@media (max-width: 1296px) {
  #view-simulator > .hero, #view-training > .hero { grid-template-columns: 1fr; }
  #view-simulator > .hero #sim-hero, #view-training > .hero h1 { grid-column: 1; grid-row: 2; }
}

/* equal space above and below the intro; Training title gets the same visible top gap
   (24px offsets the h1's tighter line-height vs. the intro's 1.45) */
#view-simulator > .hero { padding-top: 49.6px; padding-bottom: 20px; }
#view-training > .hero { padding-top: 53.6px; }
#view-about > .hero { padding-top: 53.6px; }


/* ---------- benchmark: problem definition + delta legend ---------- */
.defs { margin: 0; display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--sep); }
.defs > div { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--sep); }
.defs > div:last-child { border-bottom: 0; }
.defs dt { color: var(--accent); font-weight: 600; font-size: 15px; }
.defs dd { margin: 0; color: var(--label); font-size: 15.6px; line-height: 1.45; }
@media (max-width: 768px) { .defs > div { grid-template-columns: 1fr; gap: 4px; } }
.delta-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; font-size: 14px; color: var(--label-2); align-items: center; }
.delta-legend i { display: inline-block; width: 12px; height: 12px; margin-right: 7px; vertical-align: -1px; }
.delta-legend .good-sw { background: var(--green); }
.delta-legend .bad-sw { background: var(--red); }
.delta-legend .muted { color: var(--label-3); }


/* ---------- about ---------- */
#view-about .about { max-width: 1240px; margin: 0 auto; overflow-wrap: anywhere; }
#view-about .about p { margin: 0 0 12px; font-size: 17.5px; line-height: 1.55; color: var(--label); }
#view-about .about p:last-child { margin-bottom: 0; }
#view-about .about-lead { padding: 28px 32px; margin-bottom: 28px; }
#view-about .about-lead p { font-size: 20px; }
#view-about h2 { margin: 0 0 14px; font-size: 21px; font-weight: 600; color: var(--accent); }
#view-about h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
#view-about .steps { list-style: none; margin: 0 0 28px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
#view-about .steps li { border: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
#view-about .steps .n { width: 34px; height: 34px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 700; }
#view-about .steps p { font-size: 16.5px; }
#view-about .about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
#view-about .about-card { padding: 22px 26px; min-width: 0; }
#view-about .about-technical { margin-top: 28px; border: 1px solid var(--line); min-width: 0; }
#view-about summary { padding: 18px 24px; cursor: pointer; color: var(--accent); font-size: 20px; font-weight: 600; }
#view-about summary:hover { background: var(--fill); }
#view-about summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#view-about .about-technical-body { padding: 8px 24px 24px; min-width: 0; }
#view-about .about-technical-body h2:not(:first-child) { margin-top: 26px; }
#view-about .about .eq { display: flex; flex-wrap: wrap; gap: 8px 16px; max-width: 100%; padding: 14px 0; border-top: 1px solid var(--sep); border-bottom: 1px solid var(--sep); font-family: var(--serif); font-size: 21px; line-height: 1.8; overflow-wrap: anywhere; }
#view-about .eq > span { max-width: 100%; }
#view-about .eq sub, #view-about .eq sup { font-size: .7em; }
@media (max-width: 900px) { #view-about .steps { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
  #view-about .about-grid { grid-template-columns: 1fr; }
  #view-about .about-lead, #view-about .about-card { padding: 20px; }
  #view-about .about-lead p { font-size: 18px; }
  #view-about summary { padding: 16px 20px; }
  #view-about .about-technical-body { padding: 4px 20px 20px; }
}

/* ---------- planner error note ---------- */
.note.err { border-color: rgba(230, 91, 85, 0.75); color: var(--label); }
.note.err b { color: var(--red); }

/* ---------- phones: no horizontal page scroll ---------- */
html, body { overflow-x: clip; }
@media (max-width: 640px) {
  .nav-inner { display: flex; flex-wrap: wrap; justify-content: space-between; height: auto; padding: 8px 16px; row-gap: 8px; }
  .brand-text small { display: none; }
  #tabs { order: 3; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  #tabs button { padding: 6px 4px; }
  main { padding: 0 16px 48px; }
  .log-tools { flex-wrap: wrap; row-gap: 8px; }
  .log-head h2 .muted { display: block; margin: 4px 0 0; }
  .hero h1 { font-size: 34px; }
  .transport { left: 8px; right: 8px; }
}
