:root {
  --bg: #f5f5f7; --card: #fff; --ink: #1d1d1f; --mute: #6e6e73;
  --line: rgba(0,0,0,.09); --edge: rgba(0,0,0,.14); --acc: #0071e3;
  --head: rgba(255,255,255,.76); --fill: rgba(120,120,128,.12); --fill2: rgba(120,120,128,.2);
  --danger: #d70015; --ok: #1f9d55;
  --r: 22px; --shadow: 0 1px 3px rgba(0,0,0,.05), 0 8px 28px rgba(0,0,0,.06);
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000; --card: #1c1c1e; --ink: #f5f5f7; --mute: #a1a1a6;
    --line: rgba(255,255,255,.12); --edge: rgba(255,255,255,.2); --acc: #2997ff;
    --head: rgba(22,22,23,.72); --danger: #ff453a; --ok: #30d158; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000; --card: #1c1c1e; --ink: #f5f5f7; --mute: #a1a1a6;
  --line: rgba(255,255,255,.12); --edge: rgba(255,255,255,.2); --acc: #2997ff;
  --head: rgba(22,22,23,.72); --danger: #ff453a; --ok: #30d158; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; letter-spacing: -.011em; -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.hidden { display: none !important; }
.brand { font-weight: 300; letter-spacing: -.035em; font-size: 24px; color: var(--ink); text-decoration: none; white-space: nowrap; line-height: 1; }
.brand b { font-weight: 800; }
.nav { position: sticky; top: 0; z-index: 20; background: var(--head); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 24px; height: 60px; padding-top: env(safe-area-inset-top); }
.nav .sp { flex: 1; }
.btn { border: 0; background: var(--acc); color: #fff; height: 36px; padding: 0 18px; border-radius: 980px; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-family: inherit; }
.btn:hover { filter: brightness(1.1); }
.icon-btn { background: none; border: 0; padding: 8px; color: var(--mute); border-radius: 50%; display: inline-flex; cursor: pointer; }
.icon-btn:hover { color: var(--ink); background: var(--fill); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.seg { display: inline-flex; background: var(--fill); border-radius: 980px; padding: 3px; gap: 2px; max-width: 100%; }
.seg button { border: 0; background: transparent; color: var(--mute); height: 32px; padding: 0 16px; border-radius: 980px; font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
main { max-width: 860px; margin: 0 auto; padding: 24px 16px calc(48px + env(safe-area-inset-bottom)); }
h2.lbl { margin: 28px 6px 8px; font-size: 13px; font-weight: 600; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; }

/* Anmeldung */
.login { max-width: 360px; margin: 14vh auto 0; padding: 32px 24px; text-align: center; }
.login .brand { font-size: 34px; }
.login p { color: var(--mute); margin: 12px 0 20px; }
.login input { width: 100%; height: 44px; border-radius: 980px; border: 1px solid var(--edge); background: var(--bg); color: var(--ink); padding: 0 18px; font-size: 16px; font-family: inherit; margin-bottom: 12px; }
.login .btn { width: 100%; height: 44px; font-size: 15px; }
.fehler { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* Aktuell */
.hero { padding: 36px 24px 28px; text-align: center; }
.hero .k { color: var(--mute); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.hero .w { font-size: clamp(56px, 16vw, 104px); font-weight: 700; letter-spacing: -.045em; line-height: 1.02; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.hero .w small { font-size: .32em; font-weight: 500; color: var(--mute); letter-spacing: -.02em; margin-left: 6px; }
.hero .d { color: var(--mute); font-size: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.chip { background: var(--fill); border-radius: 980px; padding: 6px 14px; font-size: 13px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.chip.runter { color: var(--ok); } .chip.rauf { color: var(--danger); }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.stat { padding: 16px 18px; }
.stat .k { color: var(--mute); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--mute); font-size: 12px; margin-top: 2px; }

/* Diagramm */
.chart { padding: 16px 12px 12px; }
.chart .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 0 8px 8px; }
.chart .ti { font-size: 13px; color: var(--mute); }
.chart svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart text { font-family: var(--sans); fill: var(--mute); font-size: 11px; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); border-radius: 12px; padding: 6px 10px; font-size: 12px; font-weight: 500; white-space: nowrap; transform: translate(-50%, -120%); font-variant-numeric: tabular-nums; z-index: 5; }
.cw { position: relative; }
.legende { display: flex; gap: 16px; flex-wrap: wrap; padding: 6px 10px 0; color: var(--mute); font-size: 12px; }
.legende i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--acc); vertical-align: middle; margin-right: 6px; }
.legende i.m { border-top: 2px dashed var(--mute); } .legende i.t { border-top: 2px dotted var(--ink); }

/* Liste */
.liste { overflow-y: auto; max-height: 460px; }
.zeile { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); }
.zeile:first-child { border-top: 0; }
.zeile .kg { font-size: 22px; font-weight: 700; letter-spacing: -.03em; min-width: 104px; font-variant-numeric: tabular-nums; }
.zeile .kg small { font-size: 13px; font-weight: 500; color: var(--mute); margin-left: 3px; }
.zeile .dt { flex: 1; color: var(--mute); }
.zeile .df { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--mute); }
.zeile .df.runter { color: var(--ok); } .zeile .df.rauf { color: var(--danger); }
.einst { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; }
.einst label { font-weight: 500; }
.einst select { height: 36px; border-radius: 980px; border: 0; background: var(--fill); color: var(--ink); padding: 0 14px; font-size: 13px; font-weight: 500; font-family: inherit; }
.einst .stand { flex: 1 1 100%; color: var(--mute); font-size: 12px; }
.anl { margin-top: 28px; padding: 0; }
.anl summary { cursor: pointer; padding: 16px 20px; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.anl summary::-webkit-details-marker { display: none; }
.anl summary::after { content: '+'; font-size: 22px; font-weight: 400; color: var(--mute); line-height: 1; }
.anl[open] summary::after { content: '–'; }
.anl-text { padding: 0 20px 6px; color: var(--mute); line-height: 1.5; }
.anl-text p { margin: 0 0 12px; } .anl-text b { color: var(--ink); font-weight: 600; }
.hinweis { color: var(--mute); font-size: 12px; text-align: center; margin: 18px 0 0; }
.leer { padding: 28px; text-align: center; color: var(--mute); }
@media (max-width: 520px) { .nav { padding-left: 14px; padding-right: 10px; } .brand { font-size: 22px; } main { padding-left: 12px; padding-right: 12px; } .seg button { padding: 0 12px; } }
