:root {
  color-scheme: light;
  --ground: #EEF2F0;
  --surface: #FFFFFF;
  --surface-2: #F6F8F7;
  --ink: #15232A;
  --ink-2: #3B4B52;
  --muted: #66767C;
  --line: #D6DEDB;
  --line-soft: #E4EAE7;
  --accent: #0B5D6B;
  --accent-ink: #FFFFFF;
  --accent-soft: #DCEDEF;
  --done: #2D8A57;
  --done-soft: #DDF1E4;
  --shown: #C98314;
  --shown-soft: #FBEBCF;
  --open: #9AA8AC;
  --q: #6A4BC4;
  --q-soft: #ECE6FA;
  --danger: #B8342B;
  --lane-a: #F3F6F5;
  --lane-b: #EAF0EE;
  --shadow: 0 1px 2px rgba(21,35,42,.06), 0 8px 24px -12px rgba(21,35,42,.18);
  --radius: 14px;
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0E161A; --surface: #152127; --surface-2: #1A2830; --ink: #E5ECEA; --ink-2: #C3CFCC;
    --muted: #8C9C9F; --line: #2A3A41; --line-soft: #223138; --accent: #4DB2C1; --accent-ink: #062A31;
    --accent-soft: #143840; --done: #4CC181; --done-soft: #173828; --shown: #E8A93E; --shown-soft: #3A2C12;
    --open: #5F7075; --q: #A58CF0; --q-soft: #2A2345; --danger: #F07167; --lane-a: #121D22; --lane-b: #16232A;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0E161A; --surface: #152127; --surface-2: #1A2830; --ink: #E5ECEA; --ink-2: #C3CFCC;
  --muted: #8C9C9F; --line: #2A3A41; --line-soft: #223138; --accent: #4DB2C1; --accent-ink: #062A31;
  --accent-soft: #143840; --done: #4CC181; --done-soft: #173828; --shown: #E8A93E; --shown-soft: #3A2C12;
  --open: #5F7075; --q: #A58CF0; --q-soft: #2A2345; --danger: #F07167; --lane-a: #121D22; --lane-b: #16232A;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.tiny { font-size: 12px; letter-spacing: .02em; color: var(--muted); }
.eyebrow { font: 500 12px/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0; }
.error { color: var(--danger); min-height: 1.4em; margin: 0; font-size: 14px; }
kbd { font: 500 11px var(--f-mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; background: var(--surface); color: var(--ink-2); }

/* Buttons */
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; justify-content: center; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.q-btn { background: var(--q); border-color: var(--q); color: #fff; }
.btn.wide { width: 100%; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 16px; line-height: 1; display: inline-grid; place-items: center; }
.icon-btn:hover { border-color: var(--accent); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--q); color: #fff; font: 600 12px var(--f-mono); }
.count.soft { background: var(--line-soft); color: var(--ink-2); }
.count.q { background: var(--q-soft); color: var(--q); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 500px at 10% -10%, var(--accent-soft), transparent 60%), var(--ground); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.login-card h1 { font: 700 30px/1.1 var(--f-display); margin: 0; letter-spacing: -.01em; }
.login-card p { margin: 0; }
.login-card input { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); font-size: 16px; }

.brand-mark { display: inline-flex; gap: 2px; }
.brand-mark span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; font: 750 15px var(--f-display); background: var(--accent); color: var(--accent-ink); }
.brand-mark span + span { background: var(--ink); color: var(--surface); }

/* Topbar */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; padding: 12px 24px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-title { font: 650 16px/1.2 var(--f-display); white-space: nowrap; }
.brand-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32ch; }
.env-badge { font: 600 11px var(--f-mono); background: var(--shown); color: #1d1300; padding: 3px 8px; border-radius: 6px; letter-spacing: .08em; }
.progress { display: grid; gap: 4px; max-width: 420px; width: 100%; justify-self: center; }
.progress-track { position: relative; height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.progress-fill, .progress-shown { position: absolute; inset: 0 auto 0 0; border-radius: 99px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.progress-fill { background: var(--done); z-index: 2; }
.progress-shown { background: var(--shown); opacity: .55; }
.progress-label { font-size: 12px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.progress-label strong { color: var(--ink); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.session-box { display: flex; align-items: center; gap: 6px; }
.session-box select { border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: var(--surface); max-width: 220px; }
.popover { position: fixed; z-index: 40; top: 70px; right: 24px; width: min(340px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 10px; box-shadow: var(--shadow); }
.popover label { font-weight: 600; }
.popover input { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: var(--surface-2); }
.popover p { margin: 0; }
.row { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

/* Map */
.map-wrap { padding: 20px 24px 8px; }
.map-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.map { position: relative; padding-top: 6px; display: grid; grid-template-columns: 148px repeat(var(--cols, 13), minmax(78px, 1fr)); grid-template-rows: repeat(5, 58px); min-width: 1120px; }
.lane-label { grid-column: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 14px; border-right: 1px solid var(--line); z-index: 1; }
.lane-label b { font: 600 13px/1.2 var(--f-body); }
.lane-label span { font: 400 11px/1.2 var(--f-mono); color: var(--muted); }
.lane-bg { grid-column: 1 / -1; z-index: 0; }
.lane-bg.odd { background: var(--lane-a); }
.lane-bg.even { background: var(--lane-b); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.map-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; overflow: visible; }
.map-lines path { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.map-lines .seg-todo { stroke: var(--open); stroke-dasharray: 4 6; opacity: .7; }
.map-lines .seg-done { stroke: var(--done); }
.map-lines .seg-shown { stroke: var(--shown); }

.node { z-index: 3; align-self: stretch; justify-self: center; margin: 10px 3px 6px; width: calc(100% - 6px); max-width: 118px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px 6px; text-align: center; transition: transform .18s, box-shadow .18s, border-color .18s, background .18s; }
.node:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.node .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--f-mono); background: var(--surface-2); border: 1.5px solid var(--open); color: var(--ink-2); flex: none; }
.node .t { font: 600 11.5px/1.2 var(--f-body); color: var(--ink-2); text-wrap: balance; }
.node .v { font: 500 9.5px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.node.frame { background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 6px, var(--surface-2) 6px, var(--surface-2) 12px); }
.node.frame .n { font-size: 13px; }
.node.s-gezeigt { border-color: var(--shown); background: var(--shown-soft); }
.node.s-gezeigt .n { border-color: var(--shown); background: var(--shown); color: #1d1300; }
.node.s-besprochen { border-color: var(--done); background: var(--done-soft); }
.node.s-besprochen .n { border-color: var(--done); background: var(--done); color: #fff; font-size: 13px; }
.node.current { border-color: var(--accent); border-width: 2px; box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); transform: translateY(-2px); }
.node.current .t { color: var(--ink); }
.node { position: relative; }
.node.current::after { content: "JETZT"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font: 600 9px/1.4 var(--f-mono); letter-spacing: .12em; color: var(--accent-ink); background: var(--accent); padding: 1px 6px; border-radius: 5px; }
.node .qdot { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 99px; background: var(--q); color: #fff; font: 600 10px var(--f-mono); display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--surface); }

.legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 10px 4px 0; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 1.5px solid var(--open); }
.dot.s-gezeigt { background: var(--shown); border-color: var(--shown); }
.dot.s-besprochen { background: var(--done); border-color: var(--done); }
.legend .kbd-hint { margin-left: auto; }

/* Stage */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; padding: 16px 24px 110px; align-items: start; }
.content { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 36px; box-shadow: var(--shadow); min-width: 0; }
.content.enter { animation: rise .35s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { transform: translateY(8px); opacity: .6; } to { transform: none; opacity: 1; } }
.head { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; }
.bignum { font: 750 64px/0.9 var(--f-display); color: var(--accent); letter-spacing: -.03em; font-variant-numeric: tabular-nums; min-width: 1.1em; }
.bignum.frame { font-size: 40px; padding-top: 6px; }
.head h1 { font: 700 34px/1.12 var(--f-display); margin: 6px 0 10px; letter-spacing: -.015em; text-wrap: balance; }
.goal { font-size: 18px; line-height: 1.5; color: var(--ink-2); max-width: 64ch; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.chip { font: 500 12px var(--f-mono); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); }
.chip.variant { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.chip.ref { border-style: dashed; }
.blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 28px; }
.block h3 { font: 600 12px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.flow { list-style: none; margin: 0; padding: 0; counter-reset: f; display: grid; gap: 2px; }
.flow li { counter-increment: f; display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.flow li::before { content: counter(f); width: 24px; height: 24px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font: 600 12px var(--f-mono); display: grid; place-items: center; }
.flow li:last-child { border-bottom: 0; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rules li { padding: 10px 12px 10px 14px; background: var(--surface-2); border-radius: 10px; border-left: 3px solid var(--accent); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.compare > div { border-radius: 12px; padding: 16px 18px; border: 1px solid var(--line); }
.compare .ist { background: var(--surface-2); }
.compare .soll { background: var(--done-soft); border-color: color-mix(in srgb, var(--done) 35%, transparent); }
.compare h3 { font: 700 18px var(--f-display); margin: 0 0 8px; }
.compare ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.presenter { display: none; margin-top: 24px; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
body.presenter-on .presenter { display: grid; }
.talk { background: var(--shown-soft); border: 1px dashed var(--shown); border-radius: 12px; padding: 14px 16px; }
.talk h3, .demo h3 { font: 600 12px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; margin: 0 0 6px; color: var(--ink-2); }
.talk p { margin: 0; }
.demo { background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; padding: 14px 16px; }
.demo dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; }
.demo dt { color: var(--muted); font-size: 13px; }
.demo dd { margin: 0; font: 500 13px var(--f-mono); }
.overview { margin-top: 28px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ov { text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: center; }
.ov:hover { border-color: var(--accent); }
.ov .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 600 11px var(--f-mono); border: 1.5px solid var(--open); }
.ov.s-besprochen .n { background: var(--done); border-color: var(--done); color: #fff; }
.ov.s-gezeigt .n { background: var(--shown); border-color: var(--shown); color: #1d1300; }
.ov small { color: var(--muted); display: block; }

.stand { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.stand-col { border-radius: 12px; padding: 12px 16px; border: 1px solid var(--line); }
.stand-col h3 { font: 600 12px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; margin: 0 0 6px; }
.stand-col ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.stand-col.ok { background: var(--done-soft); border-color: color-mix(in srgb, var(--done) 35%, transparent); }
.stand-col.ok h3 { color: var(--done); }
.stand-col.todo { background: var(--shown-soft); border-color: color-mix(in srgb, var(--shown) 45%, transparent); }
.stand-col.todo h3 { color: var(--shown); }
@media (max-width: 640px) { .stand { grid-template-columns: 1fr; } }

/* Bench */
.bench { position: sticky; top: 84px; display: grid; gap: 14px; }
.bench-status, .panel, .tabs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.bench-status { padding: 16px; display: grid; gap: 10px; box-shadow: var(--shadow); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--line-soft); }
.seg button { border: 0; background: transparent; padding: 8px 6px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button[aria-checked="true"][data-status="offen"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg button[aria-checked="true"][data-status="gezeigt"] { background: var(--shown); color: #1d1300; }
.seg button[aria-checked="true"][data-status="besprochen"] { background: var(--done); color: #fff; }
.seg.small { grid-template-columns: repeat(3, auto); justify-content: start; }
.seg.small button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.check-btn { padding: 12px; font-size: 15px; }
.check-btn .check-ic { width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.2); display: grid; place-items: center; }
.check-btn.is-done { background: var(--done); border-color: var(--done); color: #fff; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; margin-bottom: -8px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: 0; }
.tabs button { border: 0; background: transparent; padding: 9px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); display: inline-flex; gap: 6px; justify-content: center; align-items: center; }
.tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--ink); }
.panel { border-top-left-radius: 0; border-top-right-radius: 0; padding: 14px; display: grid; gap: 12px; max-height: calc(100vh - 380px); min-height: 220px; overflow: auto; box-shadow: var(--shadow); }
.entry { display: grid; gap: 8px; }
.entry textarea { resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); min-height: 72px; line-height: 1.45; }
.entry textarea:focus { background: var(--surface); }
.entry select, .drawer select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--surface); }
.entry .row { justify-content: space-between; }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.item { border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); display: grid; gap: 6px; }
.item p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.item .meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.item .meta .sp { flex: 1; }
.link-btn { border: 0; background: none; padding: 2px 4px; color: var(--muted); cursor: pointer; font-size: 12px; border-radius: 5px; }
.link-btn:hover { color: var(--ink); background: var(--line-soft); }
.link-btn.danger:hover { color: var(--danger); }
.item.question { border-left: 3px solid var(--q); background: var(--q-soft); }
.item.question.resolved { border-left-color: var(--done); background: var(--surface-2); }
.item.question.resolved p.qt { text-decoration: line-through; color: var(--muted); }
.owner { font: 600 11px var(--f-mono); padding: 2px 7px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.qcheck { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.qcheck input { accent-color: var(--done); width: 16px; height: 16px; }
.answer { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--surface); width: 100%; font-size: 13px; }
.empty { color: var(--muted); font-size: 13px; text-align: center; padding: 14px 8px; border: 1px dashed var(--line); border-radius: 10px; }
.edit-area { width: 100%; border: 1px solid var(--accent); border-radius: 8px; padding: 8px; background: var(--surface); resize: vertical; }

/* Step nav */
.stepnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.nav-btn { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 14px; cursor: pointer; text-align: left; justify-self: start; max-width: 100%; min-width: 0; }
.nav-btn.next { justify-self: end; text-align: right; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.nav-btn:disabled { opacity: .35; cursor: default; }
.nav-btn small { display: block; font-size: 11px; opacity: .75; }
.nav-btn b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30ch; }
.nav-btn .arrow { font-size: 20px; }
.nav-pos { display: flex; gap: 5px; }
.nav-pos i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); cursor: pointer; transition: transform .2s; }
.nav-pos i.s-gezeigt { background: var(--shown); }
.nav-pos i.s-besprochen { background: var(--done); }
.nav-pos i.cur { transform: scale(1.5); box-shadow: 0 0 0 2px var(--accent); }

/* Drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(10,20,24,.35); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 51; border-left: 1px solid var(--line); padding: calc(20px + env(safe-area-inset-top, 0px)) 22px 22px; display: grid; grid-template-rows: auto auto 1fr; gap: 14px; box-shadow: var(--shadow); animation: slide .25s cubic-bezier(.2,.8,.2,1); }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.drawer h2 { font: 700 26px/1.1 var(--f-display); margin: 4px 0 0; }
.drawer-list { overflow: auto; display: grid; gap: 18px; align-content: start; }
.drawer-group h4 { margin: 0 0 8px; font: 600 13px var(--f-body); display: flex; gap: 8px; align-items: center; }
.drawer-group h4 button { border: 0; background: none; cursor: pointer; color: var(--accent); font: inherit; padding: 0; text-align: left; }

.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 9px 16px; border-radius: 10px; font-weight: 600; z-index: 60; box-shadow: var(--shadow); }

@media (max-width: 1100px) {
  .stage { grid-template-columns: 1fr; }
  .bench { position: static; }
  .panel { max-height: none; }
  .topbar { grid-template-columns: 1fr auto; }
  .progress { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .legend .kbd-hint { display: none; }
}
@media (max-width: 640px) {
  .topbar, .map-wrap, .stage, .stepnav { padding-left: 16px; padding-right: 16px; }
  .topbar { grid-template-columns: 1fr; gap: 10px; position: static; }
  .map { grid-template-columns: 112px repeat(var(--cols, 13), minmax(78px, 1fr)); }
  .lane-label span { display: none; }
  .toolbar { justify-content: flex-start; }
  .content { padding: 22px 18px; }
  .head { grid-template-columns: 1fr; gap: 4px; }
  .bignum { font-size: 44px; }
  .head h1 { font-size: 26px; }
  .compare { grid-template-columns: 1fr; }
  .nav-pos { display: none; }
  .stepnav { grid-template-columns: 1fr 1fr; }
  .nav-btn b { max-width: 14ch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
