/* Depot – dunkles Design wie Familienkalender und Rezeptplaner: dunkle Flächen, Lime als Akzent, Grün/Rot für Kursbewegungen */

@font-face {
  font-family: 'Figtree';
  src: url('../fonts/figtree.woff2') format('woff2');
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('../fonts/bricolage.woff2') format('woff2');
  font-weight: 600 800;
  font-display: swap;
}

:root {
  --grund: #0E1014;
  --flaeche: #1B1E26;
  --flaeche-2: #232731;
  --feld: #262A34;
  --feld-tief: #13161C;
  --nav: #1F232C;
  --text: #F2F4F7;
  --text-2: #9AA3B2;
  --text-3: #C9D0DB;
  --linie: #2A2F3A;
  --rahmen: #2F3440;
  --akzent: #C6F432;
  --auf-hell: #0E1014;
  --plus: #34D3B4;
  --plus-flaeche: #13302C;
  --minus: #FF8A8A;
  --minus-flaeche: #3A1C1E;
  --minus-voll: #FF6B6B;
  --minus-rand: #3A2226;
  --gold: #FFD25C;
  --gold-flaeche: #362E14;
  --schatten: 0 10px 30px rgba(0, 0, 0, 0.5);
  --display: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
  --radius: 24px;
  --tabs-h: 68px;
  --unten: env(safe-area-inset-bottom, 0px);
  --oben: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--grund); }
body {
  margin: 0; background: var(--grund); color: var(--text);
  font-family: 'Figtree', system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.35;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
body.sheet-offen { overflow: hidden; }
a { color: var(--akzent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
svg { flex-shrink: 0; }
.zahl { font-variant-numeric: tabular-nums; }
.leise { color: var(--text-2); font-weight: 500; }
.klein { font-size: 13px; margin: 0; }
.leer { padding: 32px 16px; text-align: center; color: var(--text-2); }
.einzeilig { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plus { color: var(--plus); }
.minus { color: var(--minus); }
.unsichtbar { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

.ansicht { padding-bottom: calc(var(--tabs-h) + var(--unten) + 48px); min-height: 100vh; max-width: 720px; margin: 0 auto; }

/* ---------- Kopf ---------- */
.kopf { padding: calc(var(--oben) + 22px) 16px 8px; display: flex; flex-direction: column; gap: 14px; }
.kopf-zeile { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.kopf-titel { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ueber { font-size: 13px; font-weight: 700; color: var(--text-2); letter-spacing: 0.08em; text-transform: uppercase; }
.kopf h1 { font-family: var(--display); font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; overflow-wrap: anywhere; }
.kopf h1.summe { font-size: 46px; font-variant-numeric: tabular-nums; }
.kopf-knoepfe { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* Tages- und Gesamtveränderung im Kopf */
.bewegungen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bewegung { background: var(--flaeche); border-radius: 18px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bewegung-label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.bewegung-wert { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bewegung-pct { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Knöpfe ---------- */
.icon-knopf {
  width: 44px; height: 44px; border-radius: 22px; border: none; background: none;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text); text-decoration: none; flex-shrink: 0;
}
.icon-knopf.rund { background: var(--flaeche); }
.icon-knopf.rund svg { width: 20px; height: 20px; }
.icon-knopf:disabled { opacity: 0.5; }
.knopf {
  min-height: 44px; padding: 0 18px; border-radius: 16px; border: none;
  background: var(--text); color: var(--auf-hell); font-weight: 800; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.knopf.akzent { background: var(--akzent); color: var(--auf-hell); }
.knopf.breit { width: 100%; min-height: 52px; border-radius: 18px; font-size: 16px; }
.knopf.leise { background: var(--flaeche-2); color: var(--text); border: 1px solid var(--rahmen); font-weight: 700; }
.knopf.gefahr { background: transparent; color: var(--minus); border: 1px solid var(--minus-rand); font-weight: 700; }
.knopf.klein-knopf { min-height: 38px; font-size: 14px; padding: 0 14px; border-radius: 14px; }
.knopf:disabled { opacity: 0.55; }
.knopf-stapel { display: flex; flex-direction: column; gap: 10px; }
.knopf-reihe { display: flex; gap: 8px; flex-wrap: wrap; }
.knopf-reihe .knopf { flex: 1; }

.fab {
  position: fixed; right: max(18px, calc(50vw - 342px)); bottom: calc(var(--tabs-h) + var(--unten) + 32px);
  width: 62px; height: 62px; border-radius: 22px; background: var(--akzent); color: var(--auf-hell); border: none;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--schatten); z-index: 5;
}
.fab svg { width: 28px; height: 28px; stroke-width: 2.6; }

/* ---------- Umschalter ---------- */
.segmente { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; background: var(--feld-tief); border-radius: 22px; padding: 4px; }
.segmente button { min-height: 40px; border-radius: 18px; border: none; background: transparent; font-size: 14px; font-weight: 700; color: var(--text-2); padding: 0 8px; }
.segmente button.an { background: var(--text); font-weight: 800; color: var(--auf-hell); }

/* ---------- Depotliste ---------- */
.liste { padding: 6px 12px; display: flex; flex-direction: column; gap: 8px; }
.wert {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text);
  background: var(--flaeche); border-radius: 20px; padding: 12px 14px; min-height: 68px;
}
.wert-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wert-name { font-size: 16px; font-weight: 800; }
.wert-meta { font-size: 13px; color: var(--text-2); display: flex; gap: 6px; align-items: center; min-width: 0; }
.wert-zahlen { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.wert-kurs { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.wert-meta .einzeilig { font-variant-numeric: tabular-nums; }
.wert-aktuell { font-weight: 700; }
.wert-aktuell:not(.plus):not(.minus) { color: var(--text); }
.pille {
  font-size: 13px; font-weight: 800; border-radius: 10px; padding: 3px 8px; font-variant-numeric: tabular-nums; white-space: nowrap;
  background: var(--feld); color: var(--text-3);
}
.pille.plus { background: var(--plus-flaeche); color: var(--plus); }
.pille.minus { background: var(--minus-flaeche); color: var(--minus); }
.pille.gelb { background: var(--gold-flaeche); color: var(--gold); }
.wert.suchend .wert-meta { color: var(--gold); }
.wert.problem .wert-meta { color: var(--minus); }
.stand { padding: 10px 16px 0; font-size: 12px; color: var(--text-2); text-align: center; }
.stand.neben-fab { text-align: left; padding-right: 96px; min-height: 62px; }
.dreher { width: 14px; height: 14px; border-radius: 7px; border: 2px solid currentColor; border-right-color: transparent; animation: drehen 0.9s linear infinite; display: inline-block; flex-shrink: 0; }
@keyframes drehen { to { transform: rotate(360deg); } }

/* ---------- Tab-Leiste (schwebend) ---------- */
.tabs {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--unten) + 16px); z-index: 20;
  max-width: 560px; margin: 0 auto; height: var(--tabs-h); padding: 6px; border-radius: 34px;
  background: var(--nav); box-shadow: var(--schatten);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
}
.tabs a { position: relative; border-radius: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--text-2); font-size: 12px; font-weight: 700; }
.tabs a svg { width: 20px; height: 20px; }
.tabs a.aktiv { background: var(--text); color: var(--auf-hell); font-weight: 800; }
.tabs .neu-punkt { position: absolute; top: 9px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 5px; background: var(--akzent); box-shadow: 0 0 0 2px var(--nav); }
.tabs a.aktiv .neu-punkt { box-shadow: 0 0 0 2px var(--text); }

/* ---------- Seiten (Detail, Mehr) ---------- */
.seite { padding: 0 12px 32px; display: flex; flex-direction: column; gap: 12px; }
.leiste { padding: calc(var(--oben) + 12px) 0 4px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.leiste-titel { font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); text-align: center; }
.leiste-platz { width: 44px; flex-shrink: 0; }
.farb-kopf { background: var(--flaeche); margin: 0 -12px; padding: 0 16px 22px; border-radius: 0 0 32px 32px; display: flex; flex-direction: column; gap: 14px; }
.detail-name { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 800; color: var(--text-3); border: 1px solid var(--rahmen); border-radius: 10px; padding: 3px 9px; }
.chip.hell { color: var(--auf-hell); background: var(--text); border-color: var(--text); }
.detail-kurs { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.detail-kurs strong { font-family: var(--display); font-size: 40px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.kacheln { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kachel { background: var(--flaeche); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.farb-kopf .kachel { background: var(--feld); }
.kachel-label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.kachel-wert { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kachel-zusatz { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

.karte { background: var(--flaeche); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; border: none; margin: 0; min-width: 0; }
.abschnitt { font-size: 12px; font-weight: 800; color: var(--text-2); letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 6px 0; margin: 0; }
.karte .abschnitt { padding: 0; }
.zeile { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--linie); }
.zeile:last-child { border-bottom: none; }
.zeile-label { font-size: 15px; font-weight: 600; flex-shrink: 0; }
.zeile-wert { font-size: 15px; font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.zeile-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 15px; }
.zeile-text strong { font-weight: 800; }
.zeile-text .leise { font-size: 13px; overflow-wrap: anywhere; }
.link-zeile { text-decoration: none; color: var(--text); min-height: 64px; }
.pfeil { color: #6B7280; display: inline-flex; }
.pfeil svg { width: 18px; height: 18px; }
.schalter { width: 22px; height: 22px; accent-color: var(--akzent); flex-shrink: 0; }
.notiz { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; color: var(--text-3); }
.hinweis-box { margin: 0; display: flex; gap: 8px; align-items: flex-start; background: var(--feld); border-radius: 16px; padding: 10px 12px; font-size: 14px; color: var(--text-3); }
.hinweis-box.gelb { background: var(--gold-flaeche); color: var(--gold); }
.hinweis-box.rot { background: var(--minus-flaeche); color: var(--minus); }
.status-punkt { width: 10px; height: 10px; border-radius: 5px; flex-shrink: 0; }
.status-punkt.gruen { background: var(--plus); box-shadow: 0 0 0 4px var(--plus-flaeche); }
.status-punkt.gelb { background: var(--gold); box-shadow: 0 0 0 4px var(--gold-flaeche); }
.status-punkt.rot { background: var(--minus-voll); box-shadow: 0 0 0 4px var(--minus-flaeche); }
.kandidaten { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.kandidat { display: flex; align-items: center; gap: 10px; background: var(--feld); border-radius: 14px; padding: 8px 10px; font-size: 14px; }
.kandidat .zeile-text { font-size: 14px; }
.kandidat button { flex-shrink: 0; }
.adresse { display: block; background: var(--feld-tief); border-radius: 12px; padding: 10px 12px; font-size: 13px; overflow-wrap: anywhere; color: var(--text-3); font-family: ui-monospace, Menlo, monospace; }

/* ---------- Briefing ---------- */
.zusammenfassung { margin: 0; font-size: 17px; font-weight: 600; color: var(--text-3); line-height: 1.4; padding: 0 4px; }
.meldung { background: var(--flaeche); border-radius: 22px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.meldung.wichtig { box-shadow: inset 4px 0 0 var(--akzent); }
.meldung-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.meldung h3 { font-size: 17px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.meldung p { margin: 0; font-size: 15px; color: var(--text-3); line-height: 1.4; }
.quellen { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; font-weight: 700; }
.quellen a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.archiv-zeile { text-decoration: none; color: var(--text); }
.suche { position: relative; }
.suche .eingabe { padding-left: 38px; }
.suche svg { position: absolute; left: 12px; top: 12px; color: var(--text-2); }

/* ---------- Termine ---------- */
.monat-titel { font-size: 13px; font-weight: 800; color: var(--text-2); letter-spacing: 0.08em; text-transform: uppercase; padding: 10px 6px 2px; }
.termin { display: flex; gap: 12px; align-items: center; background: var(--flaeche); border-radius: 20px; padding: 10px 14px 10px 10px; text-decoration: none; color: var(--text); }
.termin-datum { width: 52px; height: 56px; border-radius: 14px; background: var(--feld); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.termin-datum strong { font-family: var(--display); font-size: 22px; font-weight: 800; line-height: 1; }
.termin-datum span { font-size: 11px; font-weight: 800; color: var(--text-2); text-transform: uppercase; }
.termin-datum.bald { background: var(--akzent); color: var(--auf-hell); }
.termin-datum.bald span { color: var(--auf-hell); }

/* ---------- Formulare ---------- */
.formular { display: flex; flex-direction: column; gap: 14px; }
.feld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.feld-label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.eingabe {
  width: 100%; min-height: 46px; border-radius: 14px; border: 1px solid var(--rahmen); background: var(--feld-tief);
  padding: 8px 12px; font-size: 16px; color: var(--text);
}
.eingabe::placeholder { color: #6B7280; }
textarea.eingabe { resize: vertical; }
.zwei-spalten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fehler { color: var(--minus); margin: 0; font-weight: 700; }
.feld-hilfe { font-size: 12px; color: var(--text-2); margin: 0; }

/* ---------- Anmeldung ---------- */
.login { max-width: 400px; margin: 0 auto; padding: calc(var(--oben) + 48px) 20px 32px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login form { display: flex; flex-direction: column; gap: 14px; text-align: left; margin-top: 8px; }
.login-logo { border-radius: 18px; align-self: center; }
.login h1 { font-family: var(--display); font-size: 36px; font-weight: 800; letter-spacing: -0.03em; }
.login p { margin: 0; color: var(--text-2); }

/* ---------- Sheet, Toast, Update ---------- */
.sheet-hintergrund { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--flaeche); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  border-radius: 28px 28px 0 0; padding: 8px 16px calc(20px + var(--unten)); animation: hoch 0.18s ease-out;
}
@keyframes hoch { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-kopf { display: flex; justify-content: space-between; align-items: center; padding: 4px 0 8px; position: sticky; top: -8px; background: var(--flaeche); z-index: 1; }
.sheet-kopf h2 { font-family: var(--display); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.toast {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabs-h) + var(--unten) + 28px); z-index: 60; max-width: 520px; margin: 0 auto;
  background: var(--text); color: var(--auf-hell); border-radius: 18px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-weight: 700; box-shadow: var(--schatten);
}
.toast button { border: none; background: var(--auf-hell); color: var(--akzent); border-radius: 12px; padding: 0 12px; font-weight: 800; min-height: 36px; }
.update-hinweis {
  position: fixed; left: 12px; right: 12px; top: calc(var(--oben) + 8px); z-index: 70; max-width: 520px; margin: 0 auto;
  background: var(--nav); border: 1px solid var(--rahmen); border-radius: 18px; padding: 8px 8px 8px 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 700; box-shadow: var(--schatten);
}
.update-hinweis button { border: none; background: var(--akzent); color: var(--auf-hell); border-radius: 14px; min-height: 40px; padding: 0 14px; font-weight: 800; }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } .dreher { animation-duration: 3s; } }
@media (max-width: 380px) {
  .kopf h1.summe { font-size: 38px; }
  .detail-kurs strong { font-size: 34px; }
}

/* ---------- Kursverlauf ---------- */
.verlauf { gap: 10px; }
.verlauf-kopf { display: flex; justify-content: space-between; align-items: flex-start; min-height: 44px; }
.verlauf-kopf > div { display: flex; flex-direction: column; gap: 2px; }
.verlauf-label { font-size: 12px; font-weight: 800; color: var(--text-2); letter-spacing: 0.08em; text-transform: uppercase; }
.verlauf-wert { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.verlauf-pct { font-size: 15px; margin-left: 4px; }
.verlauf-flaeche { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; margin: 0 -4px; }
.verlauf-flaeche svg { display: block; overflow: visible; transition: opacity 0.2s; }
.verlauf-flaeche svg.blass { opacity: 0.45; }
.verlauf-leer { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-2); font-size: 14px; text-align: center; padding: 0 16px; }
.verlauf-hinweis { margin: -4px 0 0; }
.verlauf .segmente button { min-height: 36px; font-size: 13px; }
.kurve { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke: var(--text-3); }
.kurve.plus, .punkt.plus { stroke: var(--plus); }
.kurve.minus, .punkt.minus { stroke: var(--minus); }
.stopp { stop-color: var(--text-3); }
.stopp.plus { stop-color: var(--plus); }
.stopp.minus { stop-color: var(--minus); }
.gitter { stroke: var(--linie); stroke-width: 1; }
.achse { fill: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.achse.kauf { fill: var(--text-3); font-weight: 700; }
.kauflinie { stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 4 4; }
.fadenkreuz { stroke: var(--text-2); stroke-width: 1; }
.punkt { fill: var(--text-3); stroke: var(--flaeche); stroke-width: 2; }
.punkt.plus { fill: var(--plus); stroke: var(--flaeche); }
.punkt.minus { fill: var(--minus); stroke: var(--flaeche); }
