/* Web-Fenster GoldGarten.Tracker · Werte aus app/lib/design/tokens.dart */

@font-face {
  font-family: "Poppins";
  src: url("schriften/Poppins-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("schriften/Poppins-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("schriften/Archivo-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --screen-bg: #f1f2f2;
  --surface: #ffffff;
  --surface-sunken: #f7f8f8;
  --track: #e6e7e9;
  --border: #e3e4e6;
  --border-dashed: #c9cbcf;
  --text: #2d2b3f;
  --text-muted: #5c5b69;
  --text-faint: #7c7b88;
  --accent: #0e7c78;
  --accent-pressed: #0b6360;
  --accent-tint: #bfe8e2;
  --accent-wash: #e0f4f2;
  --warn-text: #8f3a18;
  --warn-fill: #c0562c;

  --r-card: 12px;
  --r-inner: 10px;
  --r-legend: 6px;
  --r-pill: 999px;
  --r-sheet: 20px;

  --shadow-card: 0 2px 12px rgba(45, 43, 63, 0.078);
  --shadow-tile: 0 1px 2px rgba(45, 43, 63, 0.07);
  --shadow-focus: 0 0 16px 1px rgba(14, 124, 120, 0.18), 0 2px 12px rgba(45, 43, 63, 0.078);
  --shadow-sheet: 0 -6px 24px rgba(45, 43, 63, 0.22);

  --gap: 15px;
  --tap: 44px;
  --pad-side: 22px;

  --poppins: "Poppins", "Segoe UI", system-ui, sans-serif;
  --archivo: "Archivo", "Segoe UI", system-ui, sans-serif;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--screen-bg);
  color: var(--text);
  font-family: var(--archivo);
  font-size: 14px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
}

[hidden] { display: none !important; }

img { max-width: 100%; }

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.sprung {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--surface);
  padding: 10px 14px;
  border-radius: var(--r-inner);
  z-index: 50;
}
.sprung:focus { top: 12px; }

/* ----------------------------------------------------------- Testdatum */
.testdatum {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--warn-fill);
  color: #fff;
  font-family: var(--poppins);
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  padding: 10px 16px;
  letter-spacing: 0.01em;
}

/* --------------------------------------------------------------- Rahmen */
.rahmen {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}
.rahmen.ohne-leiste { grid-template-columns: minmax(0, 1fr); }

.seitenleiste {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px 16px 22px;
  border-right: 1px solid var(--border);
  background: var(--surface-sunken);
}

.marke {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}
.marke img { width: 36px; height: 36px; }

.navigation {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-punkt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 0 12px;
  border: 0;
  background: transparent;
  border-radius: var(--r-inner);
  font-family: var(--poppins);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
}
.nav-punkt:hover { background: var(--track); color: var(--text); }
.nav-punkt[aria-current="page"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-tile);
}
.nav-punkt[aria-current="page"]::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--accent);
  margin-left: -4px;
}
.trennen { margin-top: auto; }

.inhalt {
  padding: 40px clamp(16px, 4vw, 48px) 60px;
  max-width: 980px;
  width: 100%;
}
.inhalt:focus { outline: none; }
.inhalt.gesperrt { pointer-events: none; }

/* ---------------------------------------------------------- Typografie */
.kicker {
  font-family: var(--archivo);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.077em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.titel {
  font-family: var(--poppins);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.1;
  color: var(--text);
}
.unterzeile {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 7px;
}
.kartentitel {
  font-family: var(--poppins);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.15;
}
.feldtitel {
  font-family: var(--poppins);
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.25;
  color: var(--text);
  overflow-wrap: anywhere;
}
.text { font-size: 13px; line-height: 1.4; color: var(--text-muted); }
.text-klein { font-size: 11.5px; line-height: 1.35; color: var(--text-muted); }
.fussnote { font-size: 11.5px; line-height: 1.55; color: var(--text-faint); }

.kopf { margin-bottom: 26px; }
.kopf .kicker { display: block; margin-bottom: 10px; }

.abschnitt { margin-top: 30px; }
.abschnitt > .kicker { display: block; margin-bottom: 10px; }
.abschnitt-klein { margin-top: 12px; }
.karte > p.kicker { margin-bottom: 4px; }

/* --------------------------------------------------------------- Karten */
.karte {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 16px;
}
.karte + .karte { margin-top: 12px; }
.karte.hervor {
  box-shadow: var(--shadow-focus);
  outline: 1.5px solid var(--accent-tint);
}
.karte.gestrichelt {
  background: transparent;
  box-shadow: none;
  border: 1.5px dashed var(--border-dashed);
}
.karte-kopf {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.karte-kopf .kicker { flex: 1; min-width: 0; }

.liste > li + li { margin-top: 12px; }

.schritt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.schritt-text { flex: 1 1 260px; min-width: 0; }
.schritt-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 6px;
}
.knopfreihe {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Rollen-Kennzeichen: Punkt in der Rollenfarbe und immer der Name daneben */
.rolle-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.rolle-chip::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rollenfarbe, var(--accent));
  flex: none;
}

.marke-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 9px;
  border-radius: var(--r-legend);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--accent-wash);
  color: var(--accent-pressed);
}
.marke-chip.neutral { background: var(--track); color: var(--text-muted); }
.marke-chip .zeichen { font-size: 12px; line-height: 1; }

.dauer { font-size: 12.5px; color: var(--text-faint); }

/* --------------------------------------------------------------- Knöpfe */
.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 18px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-family: var(--poppins);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.knopf-primaer { background: var(--accent); color: #fff; }
.knopf-primaer:hover { background: var(--accent-pressed); }
.knopf-rand { background: var(--surface); border-color: var(--border); color: var(--text); }
.knopf-rand:hover { border-color: var(--border-dashed); background: var(--surface-sunken); }
.knopf-leise { background: transparent; color: var(--accent-pressed); padding: 0 12px; }
.knopf-leise:hover { background: var(--accent-wash); }
.knopf-gross { min-height: 52px; font-size: 16px; padding: 0 26px; }
.knopf:disabled, .knopf[aria-disabled="true"] {
  background: var(--track);
  color: var(--text-faint);
  border-color: transparent;
  cursor: not-allowed;
}

/* ---------------------------------------------------------- Formulare */
.formular {
  display: grid;
  gap: 12px;
}
.formular-zeile {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}
.feld {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 180px;
  min-width: 0;
}
.feld.schmal { flex: 0 1 160px; }
.feld > span { font-size: 12px; color: var(--text-muted); }
.eingabe {
  min-height: var(--tap);
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-inner);
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
}
textarea.eingabe { min-height: 72px; resize: vertical; }
.eingabe:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
select.eingabe { padding-right: 32px; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }

.auswahl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.auswahl label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
}
.auswahl input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.auswahl label:has(input:checked) {
  border-color: var(--text);
  box-shadow: inset 0 0 0 1px var(--text);
  font-weight: 600;
}
.auswahl label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.auswahl label:has(input:checked)::after {
  content: "✓";
  font-size: 12px;
}

.farbe-punkt {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--rollenfarbe);
  flex: none;
}

.haken {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  padding: 6px 12px;
  border-radius: var(--r-inner);
  cursor: pointer;
}
.haken:hover { background: var(--surface-sunken); }
.haken input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }

/* ----------------------------------------------------------- Koppeln */
.koppeln {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
}
.qr-flaeche {
  background: var(--surface);
  border-radius: var(--r-sheet);
  box-shadow: var(--shadow-card);
  padding: 22px;
  line-height: 0;
}
.qr-flaeche canvas {
  display: block;
  width: min(360px, 78vw);
  height: auto;
  aspect-ratio: 1;
  image-rendering: pixelated;
}
.schritte-anleitung { margin-top: 18px; display: grid; gap: 10px; }
.schritte-anleitung li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 15px;
  color: var(--text);
}
.schritte-anleitung .nr {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent-pressed);
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.zustand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--text-muted);
}
.zustand::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-dashed);
}
.zustand.aktiv::before { background: var(--accent); }

/* -------------------------------------------------------------- Fokus */
.fokus {
  min-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
}
.fokus-leiste {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.fokus-mitte {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 40px 0;
}
.fokus-titel {
  font-family: var(--poppins);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.15;
  max-width: 22ch;
  overflow-wrap: anywhere;
}
.fokus-satz {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 44ch;
}
.fokus-zeit {
  font-family: var(--poppins);
  font-weight: 600;
  font-size: clamp(48px, 9vw, 84px);
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--text);
  margin: 18px 0 8px;
}
.fokus-zustand { font-size: 13px; color: var(--text-faint); }
.fokus-knoepfe { justify-content: center; margin-top: 8px; }

.bestaetigt-titel {
  font-family: var(--poppins);
  font-weight: 700;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.1;
  color: var(--accent-pressed);
}

/* --------------------------------------------------------------- Woche */
.woche-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.balken-liste { display: grid; gap: 14px; }
.balken-zeile {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 16px;
}
.balken-spur {
  height: 12px;
  border-radius: var(--r-pill);
  background: var(--track);
  overflow: hidden;
}
.balken-spur > span {
  display: block;
  height: 100%;
  width: calc(var(--anteil, 0) * 100%);
  min-width: 4px;
  border-radius: var(--r-pill);
  background: var(--rollenfarbe, var(--accent));
}
.balken-wert { text-align: right; font-size: 13px; color: var(--text); white-space: nowrap; }
.balken-wert small { display: block; font-size: 11.5px; color: var(--text-faint); }

.raster-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.raster-2 > .karte + .karte { margin-top: 0; }
.zahl {
  font-family: var(--poppins);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
  margin-top: 4px;
}

/* ------------------------------------------------------- Meldung, Weg */
.meldung {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 40;
  max-width: min(560px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 18px;
  background: var(--text);
  color: #fff;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sheet);
  font-size: 14px;
}
.meldung.fehler { background: var(--warn-text); }
.meldung .knopf { background: rgba(255, 255, 255, 0.16); color: #fff; min-height: 36px; padding: 0 12px; }
.meldung .knopf:hover { background: rgba(255, 255, 255, 0.26); }

.weg {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(241, 242, 242, 0.82);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.weg-karte {
  background: var(--surface);
  border-radius: var(--r-sheet);
  box-shadow: var(--shadow-sheet);
  padding: 28px;
  max-width: 420px;
  text-align: center;
  display: grid;
  gap: 12px;
  justify-items: center;
}
.weg-titel { font-family: var(--poppins); font-weight: 600; font-size: 21px; line-height: 1.2; }
.weg-text { font-size: 13px; color: var(--text-muted); }

.leer-hinweis { font-size: 13px; color: var(--text-faint); padding: 6px 0; }

.bestaetigen-zeile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.noscript { padding: 40px; }

.probe { position: absolute; left: -9999px; top: 0; }

/* -------------------------------------------------------------- Schmal */
@media (max-width: 880px) {
  .rahmen { grid-template-columns: minmax(0, 1fr); }
  .seitenleiste {
    position: sticky;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    z-index: 20;
  }
  .testdatum:not([hidden]) ~ .rahmen .seitenleiste { top: 41px; }
  .marke { padding: 0; }
  .marke .kicker { display: none; }
  .marke img { width: 32px; height: 32px; }
  .navigation {
    flex-direction: row;
    order: 3;
    flex: 1 0 100%;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 2px;
    margin: 0 -4px;
  }
  .navigation::-webkit-scrollbar { display: none; }
  .nav-punkt { white-space: nowrap; padding: 0 12px; flex: none; }
  .nav-punkt[aria-current="page"]::before { display: none; }
  .nav-punkt[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--accent), var(--shadow-tile); }
  .trennen { margin-left: auto; margin-top: 0; }
  .inhalt { padding: 26px 16px 90px; }
  .koppeln { grid-template-columns: minmax(0, 1fr); }
  .qr-flaeche { justify-self: center; order: -1; }
  .raster-2 { grid-template-columns: minmax(0, 1fr); }
  .balken-zeile { grid-template-columns: minmax(0, 1fr) auto; }
  .balken-zeile .balken-spur { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 480px) {
  .titel { font-size: 25px; }
  .knopfreihe .knopf { flex: 1 1 auto; }
  .karte { padding: 14px; }
}

@media (prefers-reduced-motion: no-preference) {
  .knopf, .nav-punkt, .karte { transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.18s ease; }
}
