/* Design im Stil der ZHAW-Website: Weiss, viel Weissraum, grosse klare Schrift, feine schwarze Linien.
   Blau (ZHAW #0064A6) nur für Buttons, Links und aktive Zustände. Keine Rundungen, keine Schatten. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --soft: #f4f6f8;
  --line: #dfe3e8;
  --rule: #1a1a1a;
  --text: #1a1a1a;
  --muted: #646e78;
  --accent: #0064a6;
  --accent-ink: #ffffff;
  --accent-soft: #e8f1f8;
  --green: #1e7d3c;
  --yellow: #b26a00;
  --red: #c4262e;
  --grey: #9aa3ad;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 40px; }
h2 { font-size: 24px; }
h3 { font-size: 17px; }
p { margin: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.nt { text-transform: none; }
[hidden] { display: none !important; }

/* Kopf */
.masthead { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.masthead-inner { max-width: 1180px; margin: 0 auto; padding: 16px 32px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 18px; text-decoration: none; color: inherit; min-width: 0; }
.logo-slot img { height: 52px; width: auto; display: block; }
.brand-mark { width: 44px; height: 44px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; padding-left: 18px; border-left: 1px solid var(--line); }
.brand-text strong { font-size: 21px; letter-spacing: -0.01em; }
.brand-text span { font-size: 13px; color: var(--muted); }
.nav { display: flex; gap: 28px; align-items: center; }
.nav a { color: var(--text); text-decoration: none; font-weight: 500; font-size: 16px; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--accent); }
.nav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-logout { color: var(--muted) !important; font-size: 14px !important; }

.page { max-width: 1180px; margin: 0 auto; padding: 48px 32px 72px; min-height: 60vh; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.page-head p { margin-top: 12px; color: var(--muted); max-width: 680px; font-size: 18px; line-height: 1.5; }
.section { margin-top: 56px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--rule); margin-bottom: 20px; }
.section-head p { color: var(--muted); font-size: 14px; }
.footer { max-width: 1180px; margin: 0 auto; padding: 24px 32px 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }

/* Flächen: bewusst ohne Rahmen; Gliederung über Linien und Abstand */
.panel { padding: 0; }
.panel + .panel { margin-top: 56px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--rule); margin-bottom: 20px; }
.panel-head h2 { display: flex; align-items: baseline; gap: 12px; }
.tag { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.tag.navy { color: var(--muted); }

/* Bedienelemente */
.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; color: var(--accent); background: #fff; border: 1.5px solid var(--accent); padding: 10px 18px; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--accent-soft); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #00518a; }
.btn-big { font-size: 16px; padding: 13px 24px; }
.btn-small { padding: 6px 12px; font-size: 14px; border-width: 1px; }
.btn-ghost { border-color: transparent; color: var(--muted); background: transparent; }
.btn-ghost:hover:not(:disabled) { color: var(--red); background: transparent; }
.btn-on-dark { color: #fff; border-color: #fff; background: transparent; }
.btn-on-dark:hover:not(:disabled) { background: rgba(255, 255, 255, .15); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .4; cursor: default; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
input[type="text"], input[type="number"], input[type="date"], input[type="password"], select {
  font: inherit; font-size: 15px; font-weight: 400; color: var(--text); background: #fff; border: 1px solid #b9c0c8; padding: 9px 11px; min-width: 0;
}
input:focus, select:focus, .btn:focus-visible, .dropzone:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
details summary { cursor: pointer; color: var(--accent); font-size: 15px; font-weight: 600; }

.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 40px 16px; border: 1.5px dashed #9aa3ad; background: var(--soft); color: var(--muted); cursor: pointer; }
.dropzone svg { color: var(--accent); }
.dropzone strong { color: var(--text); font-size: 19px; }
.dropzone.over, .dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.big { min-height: 340px; }

.notice { padding: 14px 18px; background: var(--soft); font-size: 15px; border-left: 3px solid var(--accent); }
.notice.warn { border-left-color: var(--yellow); }
.notice.error { border-left-color: var(--red); }
.notice strong { display: block; margin-bottom: 2px; }

/* Schritte (Test) */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 40px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--line); }
.step { display: flex; gap: 14px; align-items: center; padding: 18px 4px 16px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.step .num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; border: 1.5px solid #b9c0c8; color: var(--muted); flex: none; }
.step strong { display: block; color: var(--text); font-size: 16px; }
.step span.sub { font-size: 13.5px; }
.step.done .num { background: var(--green); border-color: var(--green); color: #fff; }
.step.active { border-bottom-color: var(--accent); }
.step.active .num { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.active strong { color: var(--accent); }
a.step:hover strong { color: var(--accent); }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; border-top: 1px solid var(--rule); }
.kpi { padding: 16px 20px 18px 0; border-bottom: 1px solid var(--line); }
.kpi + .kpi { padding-left: 20px; border-left: 1px solid var(--line); }
.kpi .label { font-size: 13.5px; color: var(--muted); }
.kpi .value { font-size: 30px; font-weight: 700; margin-top: 4px; display: flex; align-items: center; gap: 8px; letter-spacing: -0.01em; }
.kpi .note { font-size: 13px; color: var(--muted); }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
td { padding: 13px 12px 13px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.group td { padding-top: 26px; padding-bottom: 8px; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--rule); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--soft); }
td input { width: 100%; }

/* Ampel: Punkt + Wort, ohne Flächen */
.ampel { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.ampel::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: currentColor; flex: none; }
.ampel.gruen { color: var(--green); }
.ampel.gelb { color: var(--yellow); }
.ampel.rot { color: var(--red); }
.ampel.grau { color: var(--grey); }
.legend { display: flex; gap: 6px 20px; flex-wrap: wrap; align-items: center; font-size: 13.5px; color: var(--muted); }
.legend .ampel + span { margin-left: -12px; }
.chip { display: inline-block; font-size: 13px; font-weight: 600; color: var(--muted); }
.chip.bezug-direkt { color: var(--accent); }

/* Demo */
.demo-grid { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 56px; align-items: start; }
.player { position: sticky; top: 110px; }
.player-frame { position: relative; background: #000; }
.player-frame video { width: 100%; aspect-ratio: 9 / 16; display: block; object-fit: contain; }
.player-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.player .meta { margin-top: 12px; font-size: 13px; color: var(--muted); display: grid; gap: 2px; }
.stufe { margin-bottom: 32px; }
.stufe-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.stufe-head h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stufe-head span { color: var(--muted); font-size: 13.5px; }
.stufe-note { font-size: 13.5px; color: var(--red); margin-top: 8px; }
.feature { display: grid; grid-template-columns: minmax(0, 1fr) 130px 130px 140px; gap: 2px 20px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.feature-head { padding: 0 0 8px; border-bottom: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.feature-head span:nth-child(2), .feature-head span:nth-child(3) { text-align: right; }
.feature-head span:last-child { justify-self: end; }
.feature .value2 { font-weight: 500; color: var(--muted); }
.feature .value2.differs { color: var(--yellow); font-weight: 700; }
.feature .value2.differs::after { content: " ≠"; }
.agree { font-size: 15px; margin: 0 0 18px; }
.feature .name { font-size: 16px; }
.feature .value { font-size: 17px; font-weight: 700; text-align: right; }
.feature .value.missing { color: var(--muted); font-weight: 400; font-size: 15px; font-style: italic; }
.feature .ampel { justify-self: end; }
.feature .beleg { grid-column: 1 / -1; font-size: 13.5px; color: var(--muted); max-width: 640px; }
.feature .warn { display: none; }
.claim { font-size: 15px; color: var(--muted); margin-bottom: 18px; max-width: 680px; }
.claim strong { color: var(--text); }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 46px; align-items: center; gap: 12px; font-size: 14.5px; }
.bar-track { height: 8px; background: var(--soft); }
.bar-fill { height: 100%; }
.bar-value { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-box { position: relative; height: 260px; }
.chart-box canvas { cursor: pointer; }
.face-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); gap: 48px; margin-top: 32px; }
.face-grid h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-bottom: 8px; border-bottom: 1px solid var(--rule); margin-bottom: 14px !important; }
.peaks { list-style: none; margin: 0; padding: 0; }
.peaks button { width: 100%; display: flex; justify-content: space-between; gap: 8px; font: inherit; font-size: 14.5px; color: inherit; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 0; cursor: pointer; }
.peaks button:hover { color: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; vertical-align: baseline; }
.mapping td { font-size: 14px; padding: 8px 12px 8px 0; }
.status-ja { color: var(--green); font-weight: 700; }
.status-teilweise { color: var(--yellow); font-weight: 700; }
.status-nein { color: var(--red); font-weight: 700; }
.progress-line { height: 4px; background: var(--soft); margin-top: 8px; }
.progress-line > div { height: 100%; background: var(--accent); }

/* Codieren */
.code-grid { display: grid; grid-template-columns: minmax(230px, 320px) minmax(0, 1fr); gap: 56px; align-items: start; }
.code-q { padding: 20px 0; border-bottom: 1px solid var(--line); }
.code-q h4 { font-size: 17px; }
.code-q p { font-size: 14.5px; color: var(--muted); margin: 4px 0 12px; max-width: 680px; }
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.options label { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #b9c0c8; padding: 8px 13px; cursor: pointer; font-size: 15px; background: #fff; }
.options label:hover { border-color: var(--accent); }
.options label:has(input:checked) { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 600; }
.options label:has(input:checked) .anker { color: rgba(255, 255, 255, .85); }
.options input { accent-color: var(--accent); margin: 0; }
.options .anker { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.options label.nb { color: var(--muted); border-style: dashed; }
.reel-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.reel-list li button { width: 100%; display: flex; justify-content: space-between; gap: 8px; font: inherit; color: inherit; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: 11px 4px; cursor: pointer; }
.reel-list li button:hover { color: var(--accent); }
.reel-list li button.active { color: var(--accent); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); padding-left: 12px; }
.reel-list .check { color: var(--green); font-weight: 700; }
.matrix td, .matrix th { font-size: 13.5px; padding: 7px 10px 7px 0; }
.matrix td.diff { background: #fdf3e1; }
pre.prompt { white-space: pre-wrap; background: var(--soft); padding: 18px; font-size: 13.5px; line-height: 1.6; max-height: 560px; overflow: auto; margin: 0; }

/* Login */
.login-body { min-height: 100vh; display: grid; place-items: center; background: var(--soft); padding: 16px; }
.login-card { width: 100%; max-width: 420px; background: #fff; border-top: 4px solid var(--accent); }
.login-inner { padding: 40px; display: flex; flex-direction: column; gap: 14px; }
.login-inner .logo-slot img { height: 64px; }
.login-inner h1 { font-size: 30px; margin-top: 10px; }
.login-inner form { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.login-error { color: var(--red); font-size: 14px; font-weight: 600; }

/* Warteschlange und Meldungen */
.queue { position: sticky; top: 0; z-index: 30; background: var(--accent); color: #fff; }
.queue-inner { max-width: 1180px; margin: 0 auto; padding: 10px 32px; display: flex; align-items: center; gap: 14px; font-size: 15px; }
.queue-bar { flex: 1; height: 4px; background: rgba(255, 255, 255, .3); min-width: 80px; }
.queue-bar > div { height: 100%; background: #fff; width: 0; transition: width .3s; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; flex: none; }
.spinner.dark { border-color: var(--line); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 12px 20px; font-size: 15px; z-index: 50; max-width: calc(100vw - 32px); }
.loading { display: flex; gap: 12px; align-items: center; color: var(--muted); padding: 24px 0; }

@media (max-width: 900px) {
  h1 { font-size: 30px; }
  .page { padding: 32px 16px 56px; }
  .masthead-inner, .footer, .queue-inner { padding-left: 16px; padding-right: 16px; }
  .logo-slot img { height: 40px; }
  .brand-text span { display: none; }
  .nav { gap: 18px; }
  .demo-grid, .code-grid, .face-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .player { position: static; max-width: 320px; }
  .steps { grid-template-columns: 1fr; }
  .feature { grid-template-columns: minmax(0, 1fr) auto auto; }
  .feature .ampel { grid-column: 1 / -1; justify-self: start; }
  .feature-head span:last-child { display: none; }
  .kpi + .kpi { padding-left: 0; border-left: 0; }
}

/* Demo-Tabelle: klar getrennte Spalten, Modelle leicht getönt */
.dt-toolbar { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 4px 0 14px; }
.dt-toolbar .agree { margin: 0; }
.dt-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--accent); font-weight: 600; cursor: pointer; }
.dt-switch input { accent-color: var(--accent); margin: 0; }
.demo-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 15.5px; }
.demo-table col.c-val { width: 132px; }
.demo-table col.c-amp { width: 132px; }
.demo-table th { font-size: 13px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; }
.demo-table th.dt-m1, .demo-table th.dt-m2 { text-align: center; color: var(--text); }
.demo-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.demo-table .dt-m1 { background: #eef4f9; }
.demo-table .dt-m2 { background: #f3f3f5; }
.demo-table td.dt-val { text-align: center; font-weight: 700; }
.demo-table td.dt-m2 { font-weight: 600; }
.demo-table td.dt-amp { padding-left: 16px; }
.demo-table .dt-name { padding-left: 0; }
.demo-table tr.dt-group td { padding: 26px 0 8px; border-bottom: 1px solid var(--rule); background: none; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.demo-table tr.dt-group td span { text-transform: none; letter-spacing: 0; font-weight: 400; }
.demo-table tr.dt-differs td.dt-m2 { background: #fdf0d6; color: var(--yellow); }
.demo-table .dt-ne { margin-left: 6px; font-weight: 700; }
.demo-table .nb { color: var(--muted); font-weight: 400; font-style: italic; }
.demo-table .dt-belege { display: none; margin-top: 6px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.demo-table.show-belege .dt-belege { display: grid; gap: 4px; }
.demo-table .dt-belege b { color: var(--text); font-weight: 600; }
@media (max-width: 900px) {
  .demo-table { font-size: 14.5px; }
  .demo-table col.c-val { width: 78px; }
  .demo-table col.c-amp { width: 30px; }
  .demo-table td, .demo-table th { padding: 10px 6px; }
  .demo-table td.dt-amp .ampel { font-size: 0; gap: 0; }
  .demo-table th:last-child { font-size: 0; }
  .demo-table th { white-space: normal; }
  .demo-table .dt-full { display: none; }
}

/* Vereinfachte Ansichten */
.nav a.nav-quiet { color: var(--muted); font-size: 14.5px; }
.nav a.nav-quiet.active { color: var(--accent); }
.rules-line { font-size: 14px; color: var(--muted); margin: -16px 0 20px; }
.answer { font-size: 17px; padding: 16px 20px; background: var(--accent-soft); border-left: 3px solid var(--accent); }
details > summary { font-size: 15px; }

.reel-list .draft { color: var(--yellow); font-weight: 700; }
