/* ROX OS — Design-System v4 (Leitfaden §2b, §3, §6; Seitenbauplan §8).
   Tokens exakt §2b. 24-px-Raster, Inhaltsbreite 760 px, Leiste 280 px. Kein Verlauf, kein Schatten, kein Glas.
   Instrument Sans (tabular-nums) fuer alles; JetBrains Mono nur fuer Hash und Job-ID. Kontrast >= 7:1. */
:root {
  --grund: #000000; --leiste: #141414; --linie: #2A2A2A; --schrift: #FFFFFF; --zweit: #A3A39E;
  --siegel: #7AA2FF; --sieg: #4CC38A; --verlust: #F58B75;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 24px; --inhalt: 760px; --leiste-b: 280px;
}
* { box-sizing: border-box; }
html { background: var(--grund); color-scheme: dark; }
body { margin: 0; background: var(--grund); color: var(--schrift); font-family: var(--sans); font-size: 16px; line-height: 26px; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--siegel); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 32px; line-height: 40px; font-weight: 500; margin: 0 0 var(--r); }
h2 { font-size: 24px; line-height: 32px; font-weight: 500; margin: 48px 0 16px; }
h3 { font-size: 16px; line-height: 26px; font-weight: 500; margin: 24px 0 8px; }
p { margin: 0 0 var(--r); max-width: 65ch; }
ul, ol { margin: 0 0 var(--r); padding-left: 20px; max-width: 65ch; }
.sprecher, .zweit, .satz, .hinweis { color: var(--zweit); font-size: 14px; line-height: 22px; }
.mono { font-family: var(--mono); font-size: 14px; word-break: break-all; }
.fehler { color: var(--verlust); }
.sieg, .won, .hit { color: var(--sieg); }
.verlust, .lost, .miss { color: var(--verlust); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border-radius: 0; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--siegel); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Knopf: primaer Siegelblau (eine Handlung je Bildschirm), sekundaer Linie */
.knopf, .knopf-2 { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 20px; font-weight: 500; border-radius: 0; text-decoration: none; text-align: center; max-width: 100%; }
.knopf { background: var(--siegel); color: var(--grund); border: 1px solid var(--siegel); }
.knopf:hover { text-decoration: none; }
.knopf-2 { background: transparent; color: var(--schrift); border: 1px solid var(--schrift); }
.knopf-2:hover { text-decoration: none; border-color: var(--siegel); color: var(--siegel); }
.knopf-3 { background: transparent; border: 0; color: var(--zweit); padding: 0; font-size: 14px; }
.klein { height: 32px; padding: 0 12px; font-size: 14px; }

/* Felder */
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea { width: 100%; min-width: 0; height: 48px; padding: 0 12px; background: var(--leiste); border: 1px solid var(--linie); color: var(--schrift); border-radius: 0; }
textarea { height: auto; min-height: 96px; padding: 12px; }
input[type=file] { color: var(--zweit); font-size: 14px; }
.feld { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; }
.feld .satz { margin: 0; }
.zeile { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 0 0 var(--r); }
.zeile > input, .zeile > select { flex: 1 1 240px; }
.spalte { display: flex; flex-direction: column; gap: 12px; max-width: 520px; }

/* Karte, Tabelle */
.karte { background: var(--leiste); border: 1px solid var(--linie); padding: var(--r); margin: 0 0 var(--r); }
table.t { width: 100%; border-collapse: collapse; margin: 0 0 var(--r); font-size: 15px; line-height: 22px; }
table.t th { text-align: left; font-weight: 400; color: var(--zweit); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--linie); }
table.t td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--linie); vertical-align: top; }
table.t td.n, table.t th.n { text-align: right; white-space: nowrap; }
table.t .einheit { color: var(--zweit); font-size: 14px; }
table.t tr.wahlbar { cursor: pointer; }
table.t tr.aktiv td { color: var(--siegel); }
table.t tr.aus td { color: var(--zweit); }
.tabelle-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.detail { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 15px; line-height: 22px; }
table.detail td { padding: 4px 0; vertical-align: top; }
table.detail td.l { color: var(--zweit); width: 40%; padding-right: 12px; }
table.detail td.v { text-align: right; white-space: nowrap; }
table.detail td.v.lang { text-align: left; white-space: normal; }
table.detail td.v.mono { font-family: var(--mono); font-size: 13px; text-align: left; white-space: normal; }
table.detail td.n { color: var(--zweit); font-size: 14px; padding-left: 12px; }
table.detail td.ok { color: var(--sieg); } table.detail td.abw { color: var(--verlust); }
ul.plain { list-style: none; padding: 0; margin: 0 0 var(--r); max-width: none; }
p, li, .karte, .tz .w, td { overflow-wrap: anywhere; }
ul.plain li { padding: 8px 0; border-top: 1px solid var(--linie); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
ul.plain li:last-child { border-bottom: 1px solid var(--linie); }

/* Transkriptzeile, ROX-Wahl-Zeile, Statuszeile */
.transkript { margin: 0 0 32px; }
.transkript .tz { display: flex; gap: 16px; padding: 8px 0; border-top: 1px solid var(--linie); font-size: 15px; line-height: 22px; }
.transkript .tz:last-child { border-bottom: 1px solid var(--linie); }
.transkript .tz .l { color: var(--zweit); flex: 0 0 140px; }
.transkript .tz .w { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.transkript .tz.rox .l { color: var(--siegel); }
.transkript .tz button { background: transparent; border: 0; color: var(--zweit); font-size: 14px; padding: 0; }
.frage { font-size: 24px; line-height: 32px; font-weight: 500; margin: 0 0 16px; }
.status { display: flex; gap: 16px; align-items: center; margin: var(--r) 0; font-size: 16px; line-height: 26px; }
.handlung { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: var(--r) 0 0; }

/* Wahlkarten, Reiter */
.wahlen { display: flex; flex-direction: column; gap: 8px; margin: 0 0 var(--r); }
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin: 0 0 var(--r); }
.wahl { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 16px; background: var(--leiste); border: 1px solid var(--linie); color: var(--schrift); }
.wahl.aktiv { border-color: var(--siegel); }
.wahl .titel { font-size: 16px; line-height: 24px; font-weight: 500; }
.wahl .satz { margin: 0; }
.reiter { display: flex; margin: 0 0 16px; border-bottom: 1px solid var(--linie); flex-wrap: wrap; }
.reiter button { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--zweit); padding: 8px 12px; }
.reiter button.aktiv { color: var(--schrift); border-bottom-color: var(--siegel); }
.erkannt { font-family: var(--mono); font-size: 14px; line-height: 22px; margin: 0 0 var(--r); }

/* Marken: Regime, Urteil */
.marke { display: inline-block; padding: 0 8px; border: 1px solid var(--linie); font-size: 14px; line-height: 22px; white-space: nowrap; }
.marke.under { border-color: var(--sieg); color: var(--sieg); }
.marke.at { border-color: var(--siegel); color: var(--siegel); }
.marke.beyond { border-color: var(--verlust); color: var(--verlust); }
.urteil { font-size: 16px; line-height: 26px; }
.urteil.sieg, .urteil.won, .urteil.hit { color: var(--sieg); }
.urteil.verlust, .urteil.lost, .urteil.miss { color: var(--verlust); }

/* Tafelzeile: Verb, Zahl, Satz, + proof */
table.tafel { width: 100%; border-collapse: collapse; margin: 0 0 var(--r); }
table.tafel > tbody > tr.zeile > td { padding: var(--r) 0; border-top: 1px solid var(--linie); vertical-align: top; }
table.tafel > tbody > tr.zeile:last-child > td { border-bottom: 1px solid var(--linie); }
td.tag { width: 150px; font-weight: 500; }
td.tag .untertitel { display: block; color: var(--zweit); font-size: 14px; line-height: 22px; font-weight: 400; max-width: 22ch; }
td.wert { text-align: right; width: 210px; font-size: 24px; line-height: 32px; font-weight: 500; white-space: nowrap; padding-right: var(--r) !important; }
td.wert.lang { font-size: 16px; line-height: 26px; white-space: normal; text-align: left; width: 300px; padding-left: 16px !important; }
td.wert.sieg { color: var(--sieg); } td.wert.verlust { color: var(--verlust); }
td.inhalt .urteil { margin-bottom: 8px; }
details.beweis { margin-top: 4px; }
details.beweis > summary { cursor: pointer; color: var(--zweit); font-size: 14px; line-height: 22px; list-style: none; }
details.beweis > summary::-webkit-details-marker { display: none; }
details.beweis > summary::before { content: "+ "; }
details.beweis[open] > summary::before { content: "– "; }
.kopf { margin-bottom: var(--r); }
.kopf .titel { font-size: 24px; line-height: 32px; font-weight: 500; }
.kopf .jobkey { font-family: var(--mono); font-size: 14px; line-height: 22px; color: var(--zweit); word-break: break-all; }
.downloads { display: flex; gap: 24px; flex-wrap: wrap; margin: 0 0 var(--r); font-size: 15px; }

/* Siegelkarte */
.siegelkarte { padding: var(--r); background: var(--leiste); border: 1px solid var(--linie); margin: 0 0 var(--r); }
.hash { font-family: var(--mono); font-size: 15px; line-height: 24px; word-break: break-all; margin: 0 0 8px; color: var(--siegel); }
.hash span { opacity: 0; animation: setzt 400ms forwards; }
@keyframes setzt { to { opacity: 1; } }
.sicherheit { border: 1px solid var(--verlust); padding: 16px; margin: 0 0 var(--r); }
input.ja { width: 120px; flex: none; font-family: var(--mono); text-transform: uppercase; }

/* Ring: dreht nur bei Zustaenden */
.ring { width: 56px; height: 56px; flex: none; border-radius: 50%; display: block; }
.ring.busy { animation: dreh 8s linear infinite, atmen 4s ease-in-out infinite; }
@keyframes dreh { to { rotate: 360deg; } }
@keyframes atmen { 0%, 100% { scale: 0.96; } 50% { scale: 1.04; } }
.leerbild { display: flex; justify-content: center; padding: 48px 0 0; }
.leerbild .ring { width: 160px; height: 160px; }

/* Kante (SVG): zeichnet sich einmal beim Laden (600 ms) */
.kante { width: 100%; max-width: var(--inhalt); display: block; margin: 0 0 var(--r); }
.kante svg { width: 100%; height: auto; display: block; }
.kante .achse { stroke: var(--linie); stroke-width: 1; }
.kante .raster { stroke: var(--linie); stroke-width: 1; stroke-dasharray: 2 4; }
.kante .beschriftung { fill: var(--zweit); font-family: var(--sans); font-size: 12px; }
.kante .mono { fill: var(--zweit); font-family: var(--mono); font-size: 11px; }
.kante .kurve { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.kante .kurve.default { stroke: var(--zweit); }
.kante .kurve.rox { stroke: var(--siegel); }
.kante .kurve.zeichnet { stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: zeichnen 600ms ease-out forwards; }
@keyframes zeichnen { to { stroke-dashoffset: 0; } }
.kante .punkt.default { fill: var(--zweit); } .kante .punkt.rox { fill: var(--siegel); }
.kante .se { stroke-width: 1; } .kante .se.default { stroke: var(--zweit); } .kante .se.rox { stroke: var(--siegel); }
.kante .muenze { stroke: var(--verlust); stroke-width: 1; stroke-dasharray: 4 4; }
.kante .edge { stroke: var(--schrift); stroke-width: 1; }
.kante .edge-text { fill: var(--schrift); font-family: var(--sans); font-size: 12px; font-weight: 500; }
.kante .job { fill: var(--siegel); }
.kante .leer { fill: var(--zweit); font-family: var(--sans); font-size: 14px; }

/* Hintergrund-Motiv: statisch, <= 8 % Deckung, fest positioniert; nie hinter Tabellen */
.motiv { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: url("/static/motif.svg") no-repeat center / cover; opacity: .08; }
.motiv ~ * { position: relative; z-index: 1; }

/* App-Layout: Leiste 280 px, Mitte 760 px */
.app { display: grid; grid-template-columns: var(--leiste-b) minmax(0, 1fr); min-height: 100vh; }
aside.leiste { background: var(--leiste); border-right: 1px solid var(--linie); display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0; }
aside .marke { padding: var(--r) var(--r) 16px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
aside .neu { margin: 0 var(--r) var(--r); height: 44px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--linie); background: transparent; color: var(--schrift); font-weight: 500; }
aside nav { flex: 1; overflow-y: auto; padding: 0 0 var(--r); }
aside .abschnitt > summary { padding: 8px var(--r); color: var(--zweit); font-size: 14px; cursor: pointer; list-style: none; }
aside .abschnitt > summary::-webkit-details-marker { display: none; }
aside .abschnitt > summary::before { content: "▾ "; }
aside .abschnitt:not([open]) > summary::before { content: "▸ "; }
aside .eintrag, aside a.eintrag { display: block; width: 100%; text-align: left; padding: 8px var(--r); background: transparent; border: 0; color: var(--schrift); text-decoration: none; font-size: 15px; line-height: 22px; }
aside .eintrag.aktiv { background: var(--grund); }
aside .eintrag .meta { color: var(--zweit); font-size: 14px; display: block; }
aside .tag { padding: 12px var(--r) 4px; color: var(--zweit); font-size: 14px; }
aside .projekt-block .eintrag { padding-left: 40px; }
aside .konto { border-top: 1px solid var(--linie); }
aside .konto > summary { padding: 16px var(--r); cursor: pointer; list-style: none; line-height: 22px; }
aside .konto > summary::-webkit-details-marker { display: none; }
aside .konto > summary .org { color: var(--zweit); font-size: 14px; display: block; }
aside .konto a, aside .konto button.menu { display: block; padding: 8px var(--r); color: var(--schrift); text-decoration: none; background: transparent; border: 0; width: 100%; text-align: left; font-size: 15px; }
aside .konto a:last-child { padding-bottom: 16px; }
aside .schliessen { display: none; background: transparent; border: 1px solid var(--linie); color: var(--schrift); height: 32px; padding: 0 12px; }
main { padding: 0 0 96px; min-width: 0; }
.kontext { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: baseline; padding: var(--r) var(--r) 0; max-width: calc(var(--inhalt) + 2 * var(--r)); color: var(--zweit); font-size: 14px; line-height: 22px; }
.kontext .menue { display: none; }
.mitte { max-width: calc(var(--inhalt) + 2 * var(--r)); padding: 48px var(--r) 0; }

/* Seiten ohne Leiste (Login, Learn, Proof, Pricing, Website) */
.seite { max-width: calc(var(--inhalt) + 2 * var(--r)); margin: 0 auto; padding: var(--r) var(--r) 96px; }
.seite.breit { max-width: 1160px; }
.site .schritt img { max-width: 100%; }
.site .raster-3 > * { min-width: 0; }
.kopfzeile { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: var(--r) 0; }
.kopfzeile .marke { font-weight: 500; font-size: 16px; color: var(--schrift); }
.kopfzeile nav { display: flex; gap: 20px; flex-wrap: wrap; font-size: 15px; }
.kopfzeile nav a { color: var(--zweit); }
.kopfzeile nav a.aktiv, .kopfzeile nav a:hover { color: var(--schrift); text-decoration: none; }
.fuss { border-top: 1px solid var(--linie); margin-top: 72px; padding: var(--r) 0; color: var(--zweit); font-size: 14px; line-height: 22px; display: flex; gap: 16px 24px; flex-wrap: wrap; }
.fuss a { color: var(--zweit); }
.beweisleiste { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--zweit); font-size: 14px; line-height: 22px; padding: 16px 0; border-top: 1px solid var(--linie); border-bottom: 1px solid var(--linie); margin: var(--r) 0; }
.beweisleiste a { color: var(--zweit); }
.zahl { font-size: 32px; line-height: 40px; font-weight: 500; }
.zahl-gross { font-size: 48px; line-height: 56px; font-weight: 500; letter-spacing: -0.01em; }
.raster-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--r); margin: 0 0 var(--r); }
.hero { padding: 48px 0 0; }
.hero h1 { font-size: 40px; line-height: 48px; max-width: 24ch; }
.regler { display: flex; gap: 12px; align-items: center; margin: 0 0 16px; font-size: 15px; }
.regler input[type=range] { flex: 1; accent-color: var(--siegel); }
.regler output { min-width: 4ch; text-align: right; }

@media (prefers-reduced-motion: reduce) {
  .ring.busy { animation: none; }
  .hash span { animation: none; opacity: 1; }
  .kante .kurve.zeichnet { animation: none; stroke-dashoffset: 0; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  aside.leiste { position: fixed; inset: 0; z-index: 3; width: 100%; height: 100%; border-right: 0; transform: translateX(-100%); transition: none; }
  aside.leiste.offen { transform: none; }
  aside .schliessen { display: block; }
  .kontext .menue { display: inline-block; background: transparent; border: 1px solid var(--schrift); color: var(--schrift); height: 32px; padding: 0 12px; }
  .kontext { padding: 16px 16px 0; }
  .mitte { padding: 32px 16px 0; }
  .seite { padding: 16px 16px 72px; }
  h1 { font-size: 28px; line-height: 36px; }
  .hero h1 { font-size: 30px; line-height: 38px; }
  .zahl-gross { font-size: 36px; line-height: 44px; }
  table.tafel, table.tafel tbody, table.tafel tr, table.tafel td { display: block; width: 100%; }
  table.tafel > tbody > tr.zeile > td { padding: 12px 0 0; border-top: 0; }
  table.tafel > tbody > tr.zeile { border-top: 1px solid var(--linie); padding: 12px 0 var(--r); display: block; }
  table.tafel > tbody > tr.zeile:last-child { border-bottom: 1px solid var(--linie); }
  table.tafel > tbody > tr.zeile:last-child > td { border-bottom: 0; }
  td.tag, td.wert { width: auto; }
  td.wert { text-align: left; padding-right: 0 !important; white-space: normal; }
  table.detail td.n { display: block; padding-left: 0; }
  table.detail td.v { text-align: left; white-space: normal; }
  .transkript .tz .l { flex: 0 0 96px; }
}
