/* Design 05 "Brutalist": zwei Farben, 4px-Linien, eine Signalfarbe.
   Darkmode = Invertierung von --bg/--fg; --sig bleibt. */
:root {
  --bg: #ffffff;
  --fg: #000000;
  --sig: #ff4d00;
  --on-sig: #000000;
  --line: 4px solid var(--fg);
  --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --black: 'Arial Black', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #000000; --fg: #ffffff; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #000000; --fg: #ffffff; color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font-family: var(--sans); -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 3px; }
a:hover, .link:hover { background: var(--fg); color: var(--bg); }
.mono { font-family: var(--mono); font-size: 13px; }
mark { background: var(--sig); color: var(--on-sig); padding: 0 0.08em; }
/* inline-block: sonst ragt der Hintergrund bei line-height < 1 in die Zeile darüber */
.headline mark { display: inline-block; line-height: 0.9; }
.page { min-height: 100vh; overflow-x: hidden; }

/* Kopfzeile */
.bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); border-bottom: var(--line); }
.cell { padding: 12px 16px; border-right: var(--line); border-bottom: var(--line); margin-bottom: -4px; }
.brand { font-weight: 900; font-size: 18px; }
.status { background: var(--sig); color: var(--on-sig); font-weight: 700; }
.status.ok { background: var(--fg); color: var(--bg); }
.toggle { background: var(--bg); color: var(--fg); border-top: 0; border-left: 0; text-align: left; cursor: pointer; font-weight: 700; }
.toggle:hover { background: var(--fg); color: var(--bg); }

/* Hero */
.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); border-bottom: var(--line); }
.grade-wrap { border-right: var(--line); display: flex; align-items: flex-end; justify-content: center; overflow: hidden; padding: 0 16px; min-height: 200px; }
.grade { font-family: var(--black); font-weight: 900; font-size: clamp(220px, 42vw, 620px); line-height: 0.74; letter-spacing: -0.08em; margin-bottom: -0.02em; }
.grade.pending { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.hero-side { display: flex; flex-direction: column; }
.row { padding: 16px 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.hero-side .row { padding: 20px; border-bottom: var(--line); font-size: 14px; }
.headline { margin: 0; padding: 20px; font-family: var(--black); font-weight: 900; font-size: clamp(40px, 6vw, 92px); line-height: 0.9; letter-spacing: -0.03em; text-transform: uppercase; flex: 1; text-wrap: balance; overflow-wrap: anywhere; }
.scale { display: grid; grid-template-columns: repeat(6, 1fr); border-top: var(--line); }
.scale div { padding: 12px 0; text-align: center; font-weight: 900; font-size: 22px; border-right: var(--line); }
.scale div:last-child { border-right: 0; }
.scale div.on { background: var(--fg); color: var(--bg); }

.section-head { border-bottom: var(--line); font-size: 14px; }

/* Tells */
.tell { display: grid; grid-template-columns: minmax(64px, 140px) minmax(0, 1fr); border-bottom: var(--line); }
.tell .num { padding: 20px; border-right: var(--line); font-weight: 900; font-size: clamp(32px, 4vw, 48px); line-height: 0.9; }
.tell .body { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px 24px; padding: 20px; align-items: baseline; }
.tell .title { font-weight: 900; font-size: clamp(22px, 2.6vw, 32px); text-transform: uppercase; line-height: 1; overflow-wrap: anywhere; }
.tell .text { font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.badge { font-family: var(--mono); font-size: 14px; font-weight: 700; justify-self: start; border: 3px solid var(--fg); padding: 2px 8px; white-space: nowrap; }

/* Kritischer Tell: Signalfläche mit Fix-Panel */
.tell.crit { background: var(--sig); color: var(--on-sig); }
.tell.crit .num { border-right-color: #000; font-size: clamp(40px, 6vw, 72px); }
.tell.crit .main { display: flex; flex-direction: column; }
.tell.crit .head { padding: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: baseline; border-bottom: 4px solid #000; }
.tell.crit .title { font-family: var(--black); font-size: clamp(28px, 4vw, 52px); line-height: 0.95; }
.tell.crit .badge { background: #000; color: var(--sig); border-color: #000; }
.tell.crit .split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.tell.crit .detail { padding: 20px; font-size: 18px; line-height: 1.35; border-right: 4px solid #000; text-wrap: pretty; overflow-wrap: anywhere; }
.tell.crit .fix { padding: 20px; font-size: 18px; line-height: 1.35; background: #000; color: #fff; display: flex; flex-direction: column; gap: 10px; overflow-wrap: anywhere; }
.fix .label { font-family: var(--mono); font-size: 13px; color: var(--sig); }

.oks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.ok { padding: 16px 20px; border-right: var(--line); border-bottom: var(--line); margin-right: -4px; display: flex; justify-content: space-between; gap: 12px; font-weight: 700; text-transform: uppercase; }
.ok .mono { font-weight: 700; }

.progress { padding: 20px; border-bottom: var(--line); display: grid; gap: 6px; font-size: 14px; }
.progress .done::after { content: " ✓"; }

/* Karten */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.card { padding: 20px; border-right: var(--line); border-bottom: var(--line); margin-right: -4px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card .k { font-family: var(--mono); font-size: 13px; }
.card .v { font-weight: 900; font-size: 28px; line-height: 1.05; overflow-wrap: anywhere; }
.card .v.small { font-size: 18px; font-family: var(--mono); font-weight: 700; }
.card .s { font-size: 15px; text-transform: uppercase; overflow-wrap: anywhere; }
.card .k .hl { background: var(--sig); color: var(--on-sig); padding: 0 4px; }

.raw { border-bottom: var(--line); }
.raw summary { cursor: pointer; list-style: none; font-size: 14px; }
.raw summary::-webkit-details-marker { display: none; }
.raw[open] summary { border-bottom: var(--line); }
.raw pre { margin: 0; padding: 20px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; }

.foot { font-size: 13px; }
.link { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { .grade.pending { animation: none; } }
