/* CED-Tracker: ruhig, hell und dunkel nach Systemeinstellung, Handy zuerst */

@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #f4f2ee;
  --card: #fffdf9;
  --sunk: #ebe7e0;
  --line: #dcd5ca;
  --fg: #24211d;
  --dim: #686157;
  --faint: #938b7f;
  --accent: #2f6f62;
  --accent-fg: #ffffff;
  --accent-soft: #dfece8;
  --good: #3c8a5a;
  --good-soft: #dcefe2;
  --mid: #b8860b;
  --mid-soft: #f6ebcc;
  --bad: #b5472e;
  --bad-soft: #f6ddd5;
  --shadow: 0 1px 2px rgba(40, 32, 20, .06), 0 4px 16px rgba(40, 32, 20, .06);

  --f-display: "Newsreader", Georgia, "Times New Roman", serif;
  --f-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --r: 12px;
  --tap: 46px;
  --nav-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141715;
    --card: #1d211f;
    --sunk: #252a27;
    --line: #333a36;
    --fg: #ebe7df;
    --dim: #a59e93;
    --faint: #7d776e;
    --accent: #7cc2b0;
    --accent-fg: #0f1513;
    --accent-soft: #22342f;
    --good: #6fc08d;
    --good-soft: #1f3327;
    --mid: #e0b44a;
    --mid-soft: #3a3120;
    --bad: #e88a70;
    --bad-soft: #3b2420;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 var(--f-body);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 24px);
}
a { color: var(--accent); }
img, svg, canvas { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font: 600 1.85rem/1.15 var(--f-display); }
h2 { font: 600 1.3rem/1.2 var(--f-display); }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* Kopf und Navigation */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.top-inner { max-width: 880px; margin: 0 auto; display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.logo { font: 600 1.35rem var(--f-display); color: var(--fg); text-decoration: none; letter-spacing: -.01em; }
.logo span { color: var(--accent); }
.top nav { display: none; gap: 4px; margin-left: auto; }
.top nav a { color: var(--dim); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.top nav a[aria-current="page"] { color: var(--fg); background: var(--sunk); }
.top .more-link { margin-left: auto; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.tabbar ul { list-style: none; margin: 0 auto; padding: 0; max-width: 560px; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--nav-h); align-items: center; }
.tabbar a, .tabbar button.tab {
  display: grid; justify-items: center; gap: 2px; text-decoration: none; color: var(--dim);
  font: 600 .7rem var(--f-body); background: none; border: 0; padding: 6px 0; min-height: var(--tap); cursor: pointer; width: 100%;
}
.tabbar svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar .plus { justify-self: center; width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; border: 0; cursor: pointer; box-shadow: var(--shadow); margin-top: -18px; }
.tabbar .plus svg { width: 28px; height: 28px; stroke-width: 2.2; }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 40; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--card);
  border-radius: 18px 18px 0 0; padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: grid; gap: 10px; max-width: 560px; margin: 0 auto;
}
.sheet h2 { font-size: 1.1rem; }
.sheet a { display: flex; gap: 14px; align-items: center; min-height: 56px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r); color: var(--fg); text-decoration: none; font-weight: 600; }
.sheet a small { display: block; color: var(--dim); font-weight: 400; font-size: .85rem; }
.sheet a .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; font-family: var(--f-mono); font-weight: 500; }

@media (min-width: 760px) {
  .top nav { display: flex; }
  .top .more-link { display: none; }
  .tabbar { display: none; }
  body { padding-bottom: 48px; }
  .fab { position: fixed; right: max(24px, env(safe-area-inset-right, 0px)); bottom: 24px; z-index: 30; }
}
@media (max-width: 759px) { .btn.fab { display: none; } }

/* Grundgerüst */
main { max-width: 880px; margin: 0 auto; padding: 20px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 20px; }
main.narrow { max-width: 620px; }
.page-head { display: grid; gap: 4px; }
.eyebrow { font: 500 .72rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.lead { color: var(--dim); }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 12px; min-width: 0; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head a { font-size: .9rem; font-weight: 600; text-decoration: none; }
.muted { color: var(--dim); }
.small { font-size: .875rem; }

.notice { border-radius: var(--r); padding: 14px 16px; background: var(--accent-soft); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.notice.warn { background: var(--mid-soft); }
.notice.bad { background: var(--bad-soft); }
.flash { border-radius: var(--r); padding: 12px 16px; background: var(--good-soft); font-weight: 600; }
.errors { border-radius: var(--r); padding: 12px 16px; background: var(--bad-soft); }
.errors ul { margin: 0; padding-left: 18px; }

/* Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg);
  font: 600 .95rem var(--f-body); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn.ghost { background: transparent; color: var(--accent); }
.btn.quiet { background: var(--sunk); border-color: var(--sunk); color: var(--fg); }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .875rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Formulare */
form.stack, .stack { display: grid; gap: 16px; }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 14px; min-width: 0; }
legend { font: 600 1.15rem var(--f-display); padding: 0; margin-bottom: 6px; }
label, .label { font-weight: 600; font-size: .95rem; }
.field { display: grid; gap: 6px; min-width: 0; }
.hint { color: var(--dim); font-size: .85rem; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], select, textarea {
  width: 100%; min-height: var(--tap); font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
textarea { min-height: 88px; resize: vertical; }
input[type=number] { font-family: var(--f-mono); }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* Regler 0 bis 10 */
.scale { display: grid; gap: 8px; }
.scale-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.scale-value { font: 500 1.25rem var(--f-mono); min-width: 2.5ch; text-align: right; color: var(--accent); }
.scale-value.empty { color: var(--faint); font-size: .9rem; }
.scale-ends { display: flex; justify-content: space-between; font-size: .78rem; color: var(--dim); }
input[type=range] { width: 100%; height: 36px; accent-color: var(--accent); margin: 0; }

/* Auswahl als Pillen */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-weight: 600; font-size: .9rem; cursor: pointer; }
.choice input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--fg); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.choices.cards { display: grid; gap: 8px; }
.choices.cards .choice span { border-radius: 10px; width: 100%; justify-content: flex-start; min-height: 48px; font-weight: 400; }
.choices.cards .choice b { font-family: var(--f-mono); font-weight: 500; min-width: 1.5ch; }

/* Bristol-Auswahl */
.bristol { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.bristol .choice span { flex-direction: column; justify-content: center; min-height: 64px; padding: 6px 2px; border-radius: 10px; width: 100%; font-family: var(--f-mono); font-size: 1.05rem; }
.bristol .choice span small { font: 400 .62rem var(--f-body); color: var(--dim); text-align: center; line-height: 1.15; }
@media (max-width: 420px) { .bristol .choice span small { display: none; } }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--tap); }
.switch input { width: 46px; height: 28px; accent-color: var(--accent); }

/* Werte und Ampel */
.score { display: flex; align-items: center; gap: 18px; }
.score-ring { --v: 0; --c: var(--faint); width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: radial-gradient(closest-side, var(--card) 79%, transparent 80% 100%), conic-gradient(var(--c) calc(var(--v) * 1%), var(--sunk) 0); }
.score-ring b { font: 500 1.7rem var(--f-mono); }
.light-green { --c: var(--good); }
.light-yellow { --c: var(--mid); }
.light-red { --c: var(--bad); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font: 600 .78rem var(--f-body); background: var(--sunk); color: var(--fg); white-space: nowrap; }
.pill.green, .pill.remission { background: var(--good-soft); color: var(--good); }
.pill.yellow, .pill.mild { background: var(--mid-soft); color: var(--mid); }
.pill.red, .pill.moderate, .pill.severe { background: var(--bad-soft); color: var(--bad); }
.pill.flare { background: var(--bad-soft); color: var(--bad); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--faint); }
.dot.green { background: var(--good); } .dot.yellow { background: var(--mid); } .dot.red { background: var(--bad); }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 0; }
.kv div { background: var(--bg); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.kv dt { font-size: .78rem; color: var(--dim); }
.kv dd { margin: 0; font: 500 1.05rem var(--f-mono); }

.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .meta { color: var(--dim); font-size: .85rem; }
.empty { color: var(--dim); text-align: center; padding: 18px 0; }

.intake { display: flex; align-items: center; gap: 12px; }
.intake time { font: 500 .95rem var(--f-mono); color: var(--dim); min-width: 3.2rem; }
.intake.done { color: var(--dim); }
.intake.done .grow b { text-decoration: line-through; text-decoration-color: var(--faint); }
.check { width: var(--tap); height: var(--tap); border-radius: 50%; border: 2px solid var(--accent); background: transparent; color: var(--accent); display: grid; place-items: center; cursor: pointer; flex: none; }
.check.on { background: var(--accent); color: var(--accent-fg); }
.check svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.streak { font: 500 .85rem var(--f-mono); color: var(--dim); }
.streak b { color: var(--accent); font-size: 1.1rem; }

/* Kalender */
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .wd { text-align: center; font: 500 .72rem var(--f-mono); color: var(--dim); padding-bottom: 4px; text-transform: uppercase; }
.cal a, .cal span.pad { aspect-ratio: 1 / 1.05; border-radius: 10px; display: grid; grid-template-rows: auto 1fr; padding: 5px; text-decoration: none; color: var(--fg); background: var(--card); border: 1px solid var(--line); min-width: 0; }
.cal span.pad { background: transparent; border-color: transparent; }
.cal a.today { border-color: var(--accent); border-width: 2px; }
.cal a.future { opacity: .45; }
.cal a .d { font: 500 .8rem var(--f-mono); }
.cal a .marks { display: flex; flex-wrap: wrap; gap: 3px; align-content: flex-end; }
.cal a.light-green { background: var(--good-soft); }
.cal a.light-yellow { background: var(--mid-soft); }
.cal a.light-red { background: var(--bad-soft); }
.cal .m { width: 7px; height: 7px; border-radius: 2px; background: var(--fg); opacity: .55; }
.cal .m.flare { background: var(--bad); opacity: 1; border-radius: 50%; }
.cal .m.hbi { background: var(--accent); opacity: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--dim); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Trends */
.chart-box { position: relative; height: 300px; }
@media (min-width: 700px) { .chart-box { height: 360px; } }
.summary { display: grid; gap: 6px; }
.summary p { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.better { color: var(--good); font-weight: 600; }
.worse { color: var(--bad); font-weight: 600; }

/* Anmelden */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.auth .card { width: 100%; max-width: 400px; }

footer.foot { max-width: 880px; margin: 32px auto 0; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; color: var(--faint); font: 500 .75rem var(--f-mono); }
footer.foot a { color: var(--faint); }

.prose { display: grid; gap: 12px; max-width: 65ch; }
.prose h2 { margin-top: 12px; }
.prose ul { margin: 0; padding-left: 20px; }

.recovery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; font-family: var(--f-mono); }
.qr { background: #fff; padding: 12px; border-radius: 10px; width: 200px; }
.qr svg { display: block; width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* Skala 0 bis 10 als Tasten */
.scale11 { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.scale11 .choice span { width: 100%; justify-content: center; padding: 0; min-height: 44px; border-radius: 8px; font: 500 .95rem var(--f-mono); }
.scale11 .choice input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.stepper { display: grid; grid-template-columns: var(--tap) 1fr var(--tap); gap: 6px; align-items: center; max-width: 220px; }
.stepper button { min-height: var(--tap); border-radius: 10px; border: 1px solid var(--line); background: var(--sunk); color: var(--fg); font: 600 1.2rem var(--f-mono); cursor: pointer; }
.stepper input { text-align: center; }
details.more { border-top: 1px solid var(--line); padding-top: 12px; }
details.more > summary { cursor: pointer; font-weight: 600; min-height: var(--tap); display: flex; align-items: center; }
.sticky-save { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 8px); z-index: 5; }
@media (min-width: 760px) { .sticky-save { bottom: 16px; } }

/* Verlauf der Anamnese */
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.history > li { display: grid; gap: 4px; padding-left: 14px; border-left: 2px solid var(--line); }
.history-date { font: 500 .85rem var(--f-mono); color: var(--accent); }
.history ul { margin: 0; padding-left: 18px; display: grid; gap: 2px; }

/* Bei Bedarf und abweichende Dosis */
.as-needed { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.as-needed .label { font-size: .85rem; font-weight: 600; color: var(--dim); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.inline-form input[type="text"] { width: 9rem; }
.inline-form input, .inline-form select { min-width: 0; }
details.dose-alt > summary { cursor: pointer; font-size: .85rem; color: var(--accent); width: max-content; }

/* Zusammenhänge */
.corr-row { display: flex; gap: 12px; align-items: flex-start; }
.corr-row .rho { font: 500 1rem var(--f-mono); min-width: 3.4rem; color: var(--dim); }
.corr-row.hl .rho { color: var(--accent); }
.explain { margin: 0; padding-left: 18px; display: grid; gap: 6px; }

/* Laborwerte */
.lab-row { display: flex; gap: 12px; align-items: center; }
.lab-row a.grow { color: inherit; text-decoration: none; min-width: 0; }
.lab-value { font: 500 1rem var(--f-mono); text-align: right; white-space: nowrap; }
.lab-value small { color: var(--dim); font-size: .75rem; }
.lab-value.high, .lab-value.low { color: var(--bad); }
.lab-value .flag { display: block; font: 600 .7rem var(--f-body); letter-spacing: .04em; text-transform: uppercase; }
.lab-input { display: grid; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.lab-input:last-child { border-bottom: 0; padding-bottom: 0; }
.lab-input > input { max-width: 12rem; }
details.ref > summary { cursor: pointer; font-size: .85rem; color: var(--dim); }
details.ref[open] > summary { margin-bottom: 6px; }
.custom-lab { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.error { color: var(--bad); font-size: .9rem; margin: 0; }

/* Lebensmittel */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--accent-soft, var(--sunk)); font-size: .9rem; }
.chip button { border: 0; background: transparent; color: var(--dim); font-size: 1.1rem; line-height: 1; min-width: 32px; min-height: 32px; cursor: pointer; border-radius: 999px; }
.choice-btn { border: 1px solid var(--line); background: var(--card); color: var(--fg); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .88rem; min-height: 36px; cursor: pointer; }
.choice-btn.on { border-color: var(--accent); color: var(--accent); }
.food-picker { display: grid; gap: 8px; }
.list li.food-row { display: grid; gap: 8px; align-items: stretch; }
.food-top { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.suggest { font-size: .85rem; color: var(--bad); }

/* Empfehlungen und Vorsorge */
.list li.reco { display: grid; gap: 8px; align-items: stretch; }
.reco.done > p, .reco.done .food-top b { color: var(--dim); }
.draft { color: var(--bad); font-weight: 600; }
.meta.due { color: var(--bad); font-weight: 600; }

/* Arztbericht, am Bildschirm und gedruckt */
.report-sheet { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; display: grid; gap: 20px; }
.report-sheet section { display: grid; gap: 8px; break-inside: avoid; }
.report-sheet h2 { font-size: 1.1rem; margin: 0; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.report-head { display: grid; gap: 6px; }
.report-head h1 { margin: 0; font-size: 1.5rem; }
.report-list { margin: 0; padding-left: 20px; display: grid; gap: 3px; }
.report-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.report-table th, .report-table td { text-align: left; padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.report-table th { font-size: .78rem; color: var(--dim); font-weight: 600; }
.report-table tr.off td { color: var(--bad); font-weight: 600; }
.spark-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.spark-grid figure { margin: 0; display: grid; gap: 4px; }
.spark { width: 100%; height: 60px; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark .axis { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
@media (max-width: 520px) { .report-sheet { padding: 16px; } .report-table { font-size: .82rem; } }

@media print {
  :root { --bg: #fff; --card: #fff; --fg: #111; --dim: #555; --line: #ccc; --accent: #2f6f62; --bad: #a3331d; color-scheme: light; }
  body { background: #fff; color: #111; }
  header.top, .tabbar, .fab, .foot, .flash, .no-print, .sheet, .sheet-backdrop { display: none !important; }
  main { padding: 0 !important; max-width: none !important; }
  .report-sheet { border: 0; padding: 0; box-shadow: none; }
  a { color: inherit; text-decoration: none; }
  @page { size: A4; margin: 16mm 14mm; }
}

/* Ziele */
.goal-bar { height: 10px; border-radius: 999px; background: var(--sunk); overflow: hidden; }
.goal-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
