/* Bauphysik — layout: navy top bar with pill tabs · left sidebar for context · wide stage for the work.
   Same family as LabGorilla / Phoenix. No uppercase transforms: they would turn λ, µ, θ_si into other symbols. */
:root {
  --bg: #f1efe8; --surface: #fbfaf7; --surface2: #efece3; --surface3: #e3e0d4;
  --ink: #1b2330; --ink2: #465163; --ink3: #7a8493; --line: #d6d2c5; --line2: #e6e3d9;
  --accent: #1d4f91; --accent-ink: #ffffff; --accent-soft: #e0e9f5; --accent2: #0f7a86;
  --p: #1d4f91; --ps: #c2410c; --cond: rgba(194, 65, 12, .16);
  --ok: #2c7a58; --ok-soft: #dcefe5; --warn: #a96b0a; --warn-soft: #f6e8cd; --bad: #b3261e; --bad-soft: #f6dcd9;
  --lane-thermal: #b4541a; --lane-moisture: #17708c; --lane-energy: #8a6d13; --lane-comfort: #69489a; --lane-eco: #3b7d4f; --lane-exam: #566170;
  --shadow: 0 1px 0 rgba(27, 35, 48, .04), 0 4px 14px -8px rgba(27, 35, 48, .22);
  --r: 7px; --r2: 12px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, "SF Mono", Menlo, monospace;
  --hdr: 58px; --bar: #1b2330; --sb-w: 290px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #10141b; --surface: #171d26; --surface2: #1f2631; --surface3: #29313e;
  --ink: #e6e9ef; --ink2: #aab3c1; --ink3: #7b8696; --line: #2c3543; --line2: #232b37;
  --accent: #6aa5f5; --accent-ink: #0b1220; --accent-soft: #1b2a41; --accent2: #4cc0cf;
  --p: #6aa5f5; --ps: #ff8a50; --cond: rgba(255, 138, 80, .18);
  --ok: #55c08f; --ok-soft: #14291f; --warn: #e5a93f; --warn-soft: #2b2212; --bad: #ff7a70; --bad-soft: #301816;
  --lane-thermal: #e8854a; --lane-moisture: #4cb3d1; --lane-energy: #d6b34a; --lane-comfort: #a98be0; --lane-eco: #6cc084; --lane-exam: #94a0b0;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 6px 18px -10px rgba(0, 0, 0, .6);
  --bar: #0b0f15; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #10141b; --surface: #171d26; --surface2: #1f2631; --surface3: #29313e;
    --ink: #e6e9ef; --ink2: #aab3c1; --ink3: #7b8696; --line: #2c3543; --line2: #232b37;
    --accent: #6aa5f5; --accent-ink: #0b1220; --accent-soft: #1b2a41; --accent2: #4cc0cf;
    --p: #6aa5f5; --ps: #ff8a50; --cond: rgba(255, 138, 80, .18);
    --ok: #55c08f; --ok-soft: #14291f; --warn: #e5a93f; --warn-soft: #2b2212; --bad: #ff7a70; --bad-soft: #301816;
    --lane-thermal: #e8854a; --lane-moisture: #4cb3d1; --lane-energy: #d6b34a; --lane-comfort: #a98be0; --lane-eco: #6cc084; --lane-exam: #94a0b0;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 6px 18px -10px rgba(0, 0, 0, .6);
    --bar: #0b0f15; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
h1 { font-size: 26px; letter-spacing: -.02em; } h2 { font-size: 19px; } h3 { font-size: 15.5px; } h4 { font-size: 14px; }
p { margin: 0 0 .7em; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: .92em; background: var(--surface2); padding: 0 .25em; border-radius: 3px; }
kbd { font-family: var(--mono); font-size: 11.5px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--ink2); }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink2); } .faint { color: var(--ink3); }
.label { font-size: 12px; font-weight: 650; letter-spacing: .02em; color: var(--ink3); }
.hide { display: none !important; } [hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ============ header ============ */
.hdr { position: sticky; top: 0; z-index: 40; height: var(--hdr); display: flex; align-items: center; gap: 18px; padding: 0 22px; background: var(--bar); color: #e7eaf0; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 18px; letter-spacing: -.02em; text-decoration: none; color: #fff; white-space: nowrap; }
.brand svg { width: 24px; height: 24px; }
.brand small { font-weight: 500; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.5); margin-left: 2px; }
.tabs { display: flex; gap: 4px; margin-left: 10px; align-items: center; }
.tab { display: flex; align-items: center; gap: 7px; padding: 7px 13px; border: 0; border-radius: 8px; background: none; cursor: pointer; font-weight: 600; font-size: 14px; color: rgba(255,255,255,.7); white-space: nowrap; }
.tab:hover { color: #fff; background: rgba(255,255,255,.08); }
.tab[aria-selected="true"] { color: #fff; background: rgba(255,255,255,.15); box-shadow: inset 0 -2px 0 var(--ps); }
.tab svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab .badge { font-size: 11px; background: var(--ps); color: #fff; border-radius: 9px; padding: 0 6px; font-weight: 700; }
.hdr .sp { flex: 1; }
.searchbtn { display: flex; align-items: center; gap: 8px; min-width: 250px; padding: 6px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07); color: rgba(255,255,255,.6); cursor: pointer; font-size: 13.5px; }
.searchbtn:hover { background: rgba(255,255,255,.13); color: #fff; }
.searchbtn kbd { margin-left: auto; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: rgba(255,255,255,.7); }
.searchbtn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 12.5px; color: var(--ink2); cursor: default; white-space: nowrap; }
button.chip { cursor: pointer; } button.chip:hover { border-color: var(--ink3); color: var(--ink); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink3); }
.chip.ok .dot { background: var(--ok); } .chip.warn .dot { background: var(--warn); } .chip.bad .dot { background: var(--bad); }
.hdr .chip { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: rgba(255,255,255,.85); padding: 5px 12px; }
.hdr button.chip:hover { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.4); }
.hdr .chip.ok .dot { background: #5fd49a; } .hdr .chip.warn .dot { background: #f0b34a; } .hdr .chip.bad .dot { background: #ff8a80; }
.iconbtn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid transparent; border-radius: var(--r); background: none; cursor: pointer; color: var(--ink2); }
.iconbtn:hover { background: var(--surface2); color: var(--ink); }
.iconbtn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hdr .iconbtn { color: rgba(255,255,255,.75); } .hdr .iconbtn:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ============ layout: sidebar + stage ============ */
.appbody { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: calc(100vh - var(--hdr)); }
.appbody.nosb { grid-template-columns: minmax(0, 1fr); }
.appbody.wide { --sb-w: 380px; }
.sidebar { position: sticky; top: var(--hdr); align-self: start; height: calc(100vh - var(--hdr)); overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px 28px; display: flex; flex-direction: column; gap: 4px; }
.sidebar .sb-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 10px; }
.sidebar .sb-head h2 { font-size: 15.5px; }
.sidebar .sb-toggle { display: none; }
.sidebar .sb-body { display: flex; flex-direction: column; gap: 4px; }
.sidebar .sb-sep { height: 1px; background: var(--line); margin: 10px 4px; }
.sidebar .sb-label { padding: 8px 8px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--ink3); }
.sidebar .card { box-shadow: none; }
.nav { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 9px; background: none; cursor: pointer; position: relative; color: var(--ink); }
.nav:hover { background: var(--surface2); }
.nav[aria-current="true"] { background: var(--accent-soft); }
.nav[aria-current="true"]::before { content: ""; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav .ic { display: grid; place-items: center; color: var(--ink3); font-size: 12px; font-family: var(--mono); font-weight: 700; }
.nav .ic svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav[aria-current="true"] .ic { color: var(--accent); }
.nav .tx { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.nav .tx b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .tx small { color: var(--ink3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .meta { font-size: 12px; color: var(--ink3); font-family: var(--mono); }
.nav .pill { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); }
.nav .pill.warm { background: var(--ps); color: #fff; }
.stage { padding: 26px 38px 110px; min-width: 0; }
.stage.narrow { max-width: 940px; margin: 0 auto; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 5px 0 0; color: var(--ink2); max-width: 80ch; font-size: 15px; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(360px, 1fr); gap: 18px; align-items: start; }
.split.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* ============ primitives ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow); }
.card.pad { padding: 18px 22px; } .card.flat { box-shadow: none; }
.grid { display: grid; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--ink3); background: var(--surface2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: none; border-color: transparent; color: var(--ink2); } .btn.ghost:hover { background: var(--surface2); color: var(--ink); }
.btn.sm { padding: 4px 10px; font-size: 13px; } .btn.lg { padding: 10px 20px; font-size: 15px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.good { background: var(--ok); border-color: var(--ok); color: #fff; } .btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg button { padding: 6px 13px; border: 0; background: none; cursor: pointer; font-weight: 550; color: var(--ink2); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; } .seg button:hover { background: var(--surface2); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 12px; color: var(--ink3); font-weight: 600; }
input[type="text"], input[type="number"], input[type="date"], input[type="search"], select, textarea, input.num { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 9px; min-width: 0; width: 100%; }
input.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.unit { font-size: 12px; color: var(--ink3); margin-left: 4px; font-family: var(--mono); }
.inwrap { position: relative; display: flex; align-items: center; } .inwrap .unit { position: absolute; right: 9px; pointer-events: none; margin: 0; } .inwrap input { padding-right: 46px; }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r); background: var(--surface); padding: 10px 14px; font-size: 14px; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); } .callout.bad { border-left-color: var(--bad); background: var(--bad-soft); } .callout.ok { border-left-color: var(--ok); background: var(--ok-soft); }
.callout > :last-child { margin-bottom: 0; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 5px; font-size: 11.5px; font-weight: 650; background: var(--surface2); color: var(--ink2); border: 1px solid var(--line2); }
.tag.hot { background: var(--warn-soft); color: var(--warn); border-color: transparent; } .tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; } .tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.lanedot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
.empty { padding: 40px; text-align: center; color: var(--ink3); }
.bar { height: 6px; border-radius: 3px; background: var(--surface3); overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.ring { display: block; } .ring .trk { stroke: var(--surface3); } .ring text { font-family: var(--mono); font-weight: 700; fill: var(--ink2); }
.weight { display: inline-flex; gap: 3px; vertical-align: middle; } .weight i { width: 8px; height: 8px; border-radius: 50%; background: var(--surface3); } .weight i.on { background: var(--warn); }
.checklist { display: flex; flex-direction: column; gap: 7px; margin: 8px 0 0; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; cursor: pointer; line-height: 1.45; }
.checklist input { margin-top: 4px; accent-color: var(--accent); width: 15px; height: 15px; }
.checklist label.done { color: var(--ink3); } .checklist label.done span { text-decoration: line-through; text-decoration-color: var(--line); }
details.acc { border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); }
details.acc > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: "+"; color: var(--ink3); font-size: 18px; font-weight: 400; } details.acc[open] > summary::after { content: "–"; }
details.acc > div { padding: 4px 14px 14px; }
details.qa { border-bottom: 1px solid var(--line2); } details.qa:last-child { border-bottom: 0; }
details.qa > summary { cursor: pointer; padding: 9px 2px; font-weight: 550; list-style: none; display: flex; gap: 10px; align-items: baseline; }
details.qa > summary::-webkit-details-marker { display: none; } details.qa > summary::before { content: "›"; color: var(--ink3); font-size: 16px; transition: transform .15s; } details.qa[open] > summary::before { transform: rotate(90deg); }
details.qa > div { padding: 2px 4px 12px 20px; color: var(--ink2); font-size: 14px; }

/* ============ md / math / tables ============ */
.md p { margin: 0 0 .6em; } .md ul, .md ol { margin: 0 0 .6em; padding-left: 1.3em; } .md li { margin: .15em 0; }
.md .mathblock, .mathblock { overflow-x: auto; overflow-y: hidden; padding: 4px 0; text-align: center; }
.md > :last-child { margin-bottom: 0; }
.tblwrap { overflow-x: auto; margin: 0 0 .7em; }
.mdtable { border-collapse: collapse; font-size: 13.5px; } .mdtable th, .mdtable td { border: 1px solid var(--line); padding: 4px 9px; text-align: left; vertical-align: top; } .mdtable th { background: var(--surface2); }
.katex { font-size: 1.04em; } .texfb { white-space: pre-wrap; }
table.data { border-collapse: collapse; width: 100%; font-size: 13px; }
table.data th { text-align: right; font-weight: 600; color: var(--ink3); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data td { padding: 5px 8px; border-bottom: 1px solid var(--line2); text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.data td:first-child { font-family: var(--font); }
table.data tr.air td { color: var(--ink3); } table.data tr.bad td { background: var(--bad-soft); color: var(--bad); font-weight: 600; } table.data tr.sum td { font-weight: 700; border-top: 1px solid var(--ink3); }
table.data input.num { padding: 3px 6px; width: 92px; }
.tblscroll { overflow-x: auto; }
#toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 100; max-width: 90vw; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ============ Übersicht ============ */
.hello h1 { font-size: 28px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); }
.kpi .v { font-family: var(--mono); font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .v small { font-size: 12px; color: var(--ink3); font-weight: 500; margin-left: 3px; }
.kpi.ok { border-color: var(--ok); background: var(--ok-soft); } .kpi.bad { border-color: var(--bad); background: var(--bad-soft); } .kpi.warn { border-color: var(--warn); background: var(--warn-soft); }
.plan { display: flex; flex-direction: column; }
.task { display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line2); }
.task:last-child { border-bottom: 0; }
.task .chk { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; font-weight: 800; }
.task.done .chk { background: var(--ok); border-color: var(--ok); color: #fff; }
.task.todo .chk { border-color: var(--accent); }
.task h4 { font-size: 15px; } .task .sub { color: var(--ink3); font-size: 13px; }
.task.done h4 { color: var(--ink3); text-decoration: line-through; text-decoration-color: var(--line); }
.task .bar { margin-top: 7px; max-width: 320px; height: 5px; }
.mtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.mtile { display: grid; grid-template-columns: 6px 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 10px 12px 10px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; overflow: hidden; }
.mtile:hover { border-color: var(--ink3); box-shadow: var(--shadow); }
.mtile .stripe { align-self: stretch; }
.mtile b { display: block; font-size: 14px; line-height: 1.25; } .mtile small { color: var(--ink3); font-size: 12px; }
.heat { display: grid; grid-template-rows: repeat(7, 13px); grid-auto-flow: column; grid-auto-columns: 13px; gap: 3px; }
.heat i { border-radius: 2px; background: var(--surface3); }
.heat i[data-l="1"] { background: color-mix(in srgb, var(--accent) 30%, var(--surface3)); } .heat i[data-l="2"] { background: color-mix(in srgb, var(--accent) 55%, var(--surface3)); } .heat i[data-l="3"] { background: color-mix(in srgb, var(--accent) 80%, var(--surface3)); } .heat i[data-l="4"] { background: var(--accent); }
.mrow { display: grid; grid-template-columns: 22px 200px 1fr 54px 220px; gap: 12px; align-items: center; padding: 9px 6px; border-bottom: 1px solid var(--line2); cursor: pointer; }
.mrow:hover { background: var(--surface2); }
.setup { border: 1px solid var(--warn); background: var(--warn-soft); border-radius: var(--r2); padding: 14px 18px; }

/* ============ Lernen (module page) ============ */
.mhead { display: flex; gap: 22px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.mhead .kick { font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.rel { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: 13px; color: var(--ink3); }
.rel button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 2px 10px; cursor: pointer; font-size: 12.5px; color: var(--ink2); }
.rel button:hover { border-color: var(--accent); color: var(--accent); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.step { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r2); padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; position: relative; }
.step:hover { border-color: var(--ink3); box-shadow: var(--shadow); }
.step .n { font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: var(--ink3); }
.step b { font-size: 15px; } .step small { color: var(--ink2); font-size: 12.5px; } .step .bar { margin-top: 8px; height: 4px; }
.step.next { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; } .step.next .n { color: var(--accent); }
.step.done .n::after { content: " ✓"; color: var(--ok); }
.step .go { position: absolute; right: 12px; top: 10px; color: var(--ink3); }

/* ============ labs ============ */
.layers { display: flex; flex-direction: column; gap: 6px; }
.layer { display: grid; grid-template-columns: 12px 1fr 90px 22px; gap: 6px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.layer .inwrap input { padding-right: 30px; padding-left: 4px; }
.layer .sw { width: 10px; height: 28px; border-radius: 2px; } .layer select { padding: 3px 6px; font-size: 13px; }
.layer .mini { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .layer .meta { font-size: 11px; color: var(--ink3); font-family: var(--mono); }
.layer .ctl { display: flex; flex-direction: column; } .layer .ctl button { border: 0; background: none; cursor: pointer; color: var(--ink3); padding: 0; line-height: 1; height: 14px; font-size: 10px; } .layer .ctl button:hover { color: var(--ink); }
.layer.drag { opacity: .5; }
.gauge { position: relative; height: 56px; margin: 4px 0 6px; }
.gauge .gtrack { position: absolute; left: 0; right: 0; top: 34px; height: 10px; border-radius: 5px; background: var(--surface3); }
.gauge .gmark { position: absolute; top: 28px; width: 3px; height: 22px; transform: translateX(-50%); border-radius: 2px; }
.gauge .gthumb { position: absolute; top: 29px; width: 20px; height: 20px; transform: translateX(-50%); border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.gauge .gthumb b { position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%); font-size: 15px; white-space: nowrap; font-family: var(--mono); }
.chart { width: 100%; height: auto; display: block; user-select: none; }
.chart text { font-family: var(--font); fill: var(--ink2); font-size: 13px; }
.chart .ax { stroke: var(--ink3); stroke-width: 1; } .chart .grid line { stroke: var(--line2); stroke-width: 1; }
.chart .gridlbl { font-size: 12px; fill: var(--ink3); font-family: var(--mono); }
.chart .pline { stroke: var(--p); stroke-width: 2.4; fill: none; } .chart .psline { stroke: var(--ps); stroke-width: 2.4; fill: none; stroke-linejoin: round; }
.chart .rope { stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 6 4; fill: none; } .chart .condzone { fill: var(--cond); }
.chart .tline { stroke: var(--accent); stroke-width: 2.6; fill: none; stroke-linejoin: round; } .chart .cross { stroke: var(--ink3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .tip rect { fill: var(--ink); } .chart .tip text { fill: var(--bg); font-size: 13px; font-family: var(--mono); }
.legend-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink2); }
.legend-row i { display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.goal { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border: 1px dashed var(--line); border-radius: var(--r2); background: var(--surface); } .goal.done { border: 1px solid var(--ok); background: var(--ok-soft); }
.steps7 { counter-reset: s; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.steps7 li { counter-increment: s; display: grid; grid-template-columns: 22px 1fr; gap: 8px; }
.steps7 li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; background: var(--surface3); color: var(--ink2); font-weight: 700; font-size: 12px; display: grid; place-items: center; }

/* ============ Üben ============ */
.deck { max-width: 820px; margin: 0 auto; }
.fcard { min-height: 300px; padding: 30px 36px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.fcard .q { font-size: 20px; font-weight: 600; line-height: 1.4; } .fcard .a { border-top: 1px solid var(--line); padding-top: 16px; font-size: 15.5px; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; } .grades .btn { flex-direction: column; gap: 0; padding: 9px 6px; } .grades .btn small { font-weight: 500; opacity: .75; font-size: 11.5px; }
.hints { display: flex; gap: 14px; justify-content: center; margin-top: 12px; font-size: 12.5px; color: var(--ink3); flex-wrap: wrap; }
.opt { display: flex; gap: 11px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); cursor: pointer; }
.opt:hover { border-color: var(--ink3); } .opt input { margin-top: 4px; accent-color: var(--accent); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); } .opt.wrong { border-color: var(--bad); background: var(--bad-soft); } .opt.missed { border-style: dashed; border-color: var(--ok); } .opt .why { font-size: 13px; color: var(--ink2); margin-top: 3px; }
.ans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; } .ans { display: flex; flex-direction: column; gap: 4px; }
.ans input.good { border-color: var(--ok); background: var(--ok-soft); } .ans input.badv { border-color: var(--bad); background: var(--bad-soft); } .ans .sol { font-size: 12.5px; font-family: var(--mono); color: var(--ink2); }
.progress { height: 4px; background: var(--surface3); border-radius: 2px; overflow: hidden; margin-bottom: 14px; } .progress > i { display: block; height: 100%; background: var(--accent); }
.timer { font-family: var(--mono); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; } .timer.low { color: var(--bad); }
.qnav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 2px 6px 6px; }
.qnav button { aspect-ratio: 1.2; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; font-weight: 700; font-family: var(--mono); position: relative; color: var(--ink2); }
.qnav button:hover { border-color: var(--accent); }
.qnav button.ans { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.qnav button.okc { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.qnav button.badc { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.qnav button.flag::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--ps); }

/* ============ Formeln ============ */
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 14px; }
.fcard2 { padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; } .fcard2 .formula { overflow-x: auto; overflow-y: hidden; padding: 8px 0 4px; font-size: 1.12em; }
.sym-row > * { min-width: 0; overflow-wrap: anywhere; }
.sym-row { display: grid; grid-template-columns: 90px 150px 1fr 130px; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line2); align-items: baseline; }

/* ============ search dialog ============ */
dialog.search { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); padding: 0; width: min(760px, 94vw); max-height: 78vh; margin-top: 9vh; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
dialog.search::backdrop { background: rgba(10, 14, 20, .5); }
dialog.search input { border: 0; border-bottom: 1px solid var(--line); border-radius: 14px 14px 0 0; padding: 16px 20px; font-size: 17px; background: var(--surface); }
dialog.search input:focus { box-shadow: none; }
.sres { overflow-y: auto; max-height: calc(78vh - 62px); padding: 8px 10px 14px; }
.sres .grp { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 700; color: var(--ink3); }
.sres .it { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.sres .it:hover, .sres .it.sel { background: var(--accent-soft); }
.sres .it small { display: block; color: var(--ink3); }

/* ============ responsive ============ */
@media (max-width: 1500px) { .searchbtn { min-width: 0; } .searchbtn .stxt, .searchbtn kbd { display: none; } .hide-lg { display: none !important; } .brand small { display: none; } }
@media (max-width: 1500px) { .appbody.wide { --sb-w: 350px; } .appbody.wide .split:not(.even) { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1280px) { :root { --sb-w: 260px; } .appbody.wide { --sb-w: 330px; } .stage { padding: 22px 26px 100px; } .tab { padding: 7px 10px; } .tab svg { display: none; } }
@media (max-width: 1100px) { .split, .split.even { grid-template-columns: minmax(0, 1fr); } .cols3 { grid-template-columns: 1fr; } }
@media (max-width: 960px) { .hide-md { display: none !important; } .hdr { padding: 0 14px; gap: 10px; } }
@media (max-width: 900px) {
  .appbody { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .sidebar .sb-head { padding: 0; } .sidebar .sb-toggle { display: inline-flex; }
  .sidebar .sb-body { display: none; padding-top: 8px; } .sidebar.open .sb-body { display: flex; }
  .nav[aria-current="true"]::before { display: none; }
  .stage { padding: 18px 14px 90px; }
}
@media (max-width: 760px) {
  .brand small { display: none; }
  .tabs { position: fixed; bottom: 0; left: 0; right: 0; height: 60px; background: var(--bar); border-top: 1px solid rgba(255,255,255,.12); margin: 0; padding: 0 4px; justify-content: space-around; gap: 2px; z-index: 50; }
  .tab { flex-direction: column; gap: 1px; padding: 6px 2px; font-size: 11px; flex: 1; justify-content: center; border-radius: 8px; } .tab svg { display: block; }
  .tab[aria-selected="true"] { box-shadow: none; }
  .fcard { padding: 20px; } .fcard .q { font-size: 17px; }
  .mrow { grid-template-columns: 22px 1fr 54px; } .mrow > :nth-child(3), .mrow > :nth-child(5) { display: none; }
  .sym-row { grid-template-columns: 70px 1fr; } .sym-row > :nth-child(2), .sym-row > :nth-child(4) { display: none; }
  .fgrid { grid-template-columns: 1fr; } .mhead { flex-direction: column; align-items: flex-start; }
  .hide-sm { display: none !important; }
}
@media print { .hdr, .tabs, .sidebar, #toast { display: none !important; } .appbody { display: block; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
