/* Tagesmaß – reizarm: gedämpfte Farben, keine Animationen, große Flächen. */
@font-face { font-family: 'Manrope'; src: url('../fonts/manrope.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('../fonts/instrument.woff2') format('woff2'); font-weight: 400; font-display: swap; }
:root {
  --bg: #14171B; --bg2: #1C2026; --bg3: #242930; --line: rgba(236, 231, 221, .13); --line2: rgba(236, 231, 221, .26);
  --ink: #ECE7DD; --ink2: #C2BCB0; --ink3: #A29D93; --acc: #E3BE7B; --onacc: #1E1A12;
  --calm: #A3CBA8; --care: #E6AE77; --rest: #E19D90; --calm-bg: rgba(163, 203, 168, .12); --care-bg: rgba(230, 174, 119, .13); --rest-bg: rgba(225, 157, 144, .14);
  --bar: #8FA9C4; --r: 18px; --fs: 18px;
  --serif: 'Instrument Serif', Georgia, serif; --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
html.light {
  --bg: #F3EFE7; --bg2: #FCFAF5; --bg3: #ECE6DA; --line: rgba(34, 37, 42, .14); --line2: rgba(34, 37, 42, .3);
  --ink: #22252A; --ink2: #464A51; --ink3: #5A5E65; --acc: #7A5300; --onacc: #FFFFFF;
  --calm: #2E6A3C; --care: #8A4A00; --rest: #9C3A2C; --calm-bg: rgba(46, 106, 60, .1); --care-bg: rgba(138, 74, 0, .1); --rest-bg: rgba(156, 58, 44, .1);
  --bar: #4D6F93; color-scheme: light;
}
html.fs-l { --fs: 20px; } html.fs-xl { --fs: 22px; }
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { font: 400 var(--fs)/1.5 var(--sans); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--acc); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; border-radius: 10px; }
h1:focus { outline: none; }
.screen { max-width: 560px; margin: 0 auto; padding: calc(var(--sat) + 6px) 18px 36px; }
.screen.has-tabs { padding-bottom: calc(104px + var(--sab)); }
h1 { font: 400 2em/1.1 var(--serif); margin: .15em 0 .4em; letter-spacing: -.005em; }
h2 { font: 700 1.02em/1.3 var(--sans); margin: 0 0 .55em; }
h3 { font: 700 1em/1.3 var(--sans); margin: 0 0 .35em; }
p { margin: 0 0 .7em; }
.lead { font-size: 1.08em; color: var(--ink2); }
.mut { color: var(--ink2); }
.fine { font-size: max(16px, .9em); color: var(--ink3); }
.big { font: 400 2.6em/1 var(--serif); }
.ic { width: 1.3em; height: 1.3em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Kopf */
.top { display: flex; align-items: center; gap: 10px; min-height: 56px; }
.brand { font: 400 1.45em var(--serif); flex: 1; display: flex; align-items: center; gap: 8px; }
.brand svg { width: 28px; height: 28px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px 0 6px; border: 0; background: none; color: var(--ink2); cursor: pointer; border-radius: 12px; font-weight: 600; }
.crashbtn { min-height: 48px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line2); background: var(--rest-bg); color: var(--rest); font-weight: 700; cursor: pointer; }
.crashbtn.on { background: var(--rest); color: var(--bg); }

/* Knöpfe */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; width: 100%; padding: 10px 20px; border-radius: 16px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; font-weight: 700; text-decoration: none; color: var(--ink); text-align: center; }
.btn.pri { background: var(--acc); color: var(--onacc); border-color: transparent; }
.btn.quiet { background: transparent; }
.btn.warn { color: var(--rest); }
.btn.inl { display: inline-flex; width: auto; min-height: 48px; padding: 6px 18px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.stack { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 140px; }
.linkbtn { background: none; border: 0; padding: 8px 0; min-height: 44px; color: var(--acc); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600; }

/* Karten */
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin: 0 0 14px; }
.card.calm { background: var(--calm-bg); } .card.care { background: var(--care-bg); } .card.rest { background: var(--rest-bg); }
.card > :last-child { margin-bottom: 0; }
.note { border-left: 4px solid var(--acc); padding: 12px 14px; background: var(--bg2); border-radius: 0 14px 14px 0; margin: 14px 0; }

/* Energie-Auswahl */
.energy { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 8px 0 4px; }
.energy { gap: 6px; }
.energy button { min-height: 76px; border-radius: 16px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 2px; }
.energy b { font: 400 1.7em/1 var(--serif); }
.energy span { font-size: max(16px, .72em); color: var(--ink2); line-height: 1.15; text-align: center; }
.energy button[aria-pressed="true"] { background: var(--acc); color: var(--onacc); border-color: transparent; }
.energy button[aria-pressed="true"] span { color: var(--onacc); }
.scale { display: flex; justify-content: space-between; font-size: max(16px, .9em); color: var(--ink3); }

/* Auswahl-Leisten */
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.seg button { flex: 1 1 0; min-width: 84px; min-height: 52px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; font-weight: 650; }
.seg button[aria-pressed="true"] { background: var(--acc); color: var(--onacc); border-color: transparent; }
.seg.cost button { min-width: 52px; flex: 1 1 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.chips button { min-height: 48px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--bg3); border-color: var(--acc); color: var(--ink); font-weight: 700; }
.chips button[aria-pressed="true"]::before { content: '✓ '; color: var(--acc); }
label.f { display: block; font-weight: 700; margin: 14px 0 6px; }
input.in, textarea.in, select.in { width: 100%; min-height: 54px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line2); background: var(--bg); color: var(--ink); }
textarea.in { min-height: 110px; resize: vertical; line-height: 1.45; }
.numrow { display: flex; gap: 10px; align-items: center; }
.numrow input { max-width: 140px; }

/* Rahmen */
.meter { height: 16px; border-radius: 999px; background: var(--bg3); overflow: hidden; margin: 10px 0 8px; position: relative; border: 1px solid var(--line); }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--bar); opacity: .45; }
.meter b { position: absolute; inset: 0 auto 0 0; background: var(--bar); }
.meter.over b, .meter.over i { background: var(--rest); }
.kv { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--ink2); }
.kv b { color: var(--ink); }
.dims { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.dims div { background: var(--bg3); border-radius: 12px; padding: 8px 4px; text-align: center; font-size: max(16px, .85em); color: var(--ink2); }
.dims b { display: block; font-size: 1.25em; color: var(--ink); }

/* Ampel */
.amp { display: flex; align-items: center; gap: 12px; }
.dot { width: 22px; height: 22px; border-radius: 50%; flex: none; border: 2px solid currentColor; }
.l0 { color: var(--calm); } .l1 { color: var(--care); } .l2 { color: var(--rest); }
.l0 .dot, .dot.l0 { background: var(--calm); } .l1 .dot { background: var(--care); } .l2 .dot { background: var(--rest); }
.amp h2 { margin: 0; font-size: 1.2em; }
.rules { list-style: none; padding: 0; margin: 12px 0 0; }
.rules li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.rules li .m { width: 1.4em; flex: none; font-weight: 800; }
.rules li.hit .m { color: var(--care); }
.rules li:not(.hit) { color: var(--ink3); }

/* Listen */
.list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; padding: 0; list-style: none; }
.item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; text-align: left; text-decoration: none; color: var(--ink); }
.item .tx { flex: 1; min-width: 0; }
.item .tx small { display: block; color: var(--ink2); font-size: max(16px, .88em); margin-top: 2px; }
.item .chev { color: var(--ink3); }
.item.lock .tx::after { content: 'Plus'; font-size: max(16px, .75em); font-weight: 700; color: var(--acc); border: 1px solid var(--acc); border-radius: 999px; padding: 1px 8px; margin-left: 8px; }
.pl { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg2); }
.pl .tick { width: 52px; height: 52px; border-radius: 14px; border: 2px solid var(--line2); background: transparent; cursor: pointer; flex: none; font-size: 1.3em; font-weight: 800; color: var(--calm); }
.pl .tick[aria-pressed="true"] { background: var(--calm-bg); border-color: var(--calm); }
.pl .tx { flex: 1; min-width: 0; padding: 4px 0; }
.pl .tx small { display: block; color: var(--ink2); font-size: max(16px, .88em); }
.pl.done .tx > span { text-decoration: line-through; text-decoration-color: var(--ink3); color: var(--ink2); }
.pl .ed { min-width: 52px; min-height: 52px; border-radius: 14px; border: 0; background: transparent; color: var(--ink2); cursor: pointer; }
.cost { font-weight: 800; color: var(--acc); white-space: nowrap; }
.grp { margin: 18px 0 6px; font-weight: 700; color: var(--ink2); font-size: max(16px, .92em); }

/* Tageswahl */
.days { display: flex; gap: 8px; overflow-x: auto; margin: 4px -18px 14px; padding: 2px 18px 6px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.days button { flex: none; white-space: nowrap; min-height: 52px; min-width: 64px; padding: 6px 12px; border-radius: 14px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; font-weight: 650; }
.days button[aria-pressed="true"] { background: var(--acc); color: var(--onacc); border-color: transparent; }
.days button.lock { color: var(--ink3); }

/* Verlauf */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--ink3); font: 600 12px var(--sans); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: max(16px, .9em); color: var(--ink2); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg2); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + var(--sab)); display: flex; justify-content: center; z-index: 5; }
.tabs nav { display: flex; width: 100%; max-width: 560px; }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; color: var(--ink2); text-decoration: none; font-size: max(16px, .8em); font-weight: 650; border-radius: 14px; }
.tabs a[aria-current="page"] { color: var(--acc); background: var(--bg3); }

/* Hilfe */
.tel { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; border-radius: 16px; background: var(--bg2); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.tel b { font-size: 1.2em; color: var(--acc); min-width: 4.2em; }
.tel span small { display: block; color: var(--ink2); font-size: max(16px, .88em); }

/* Crash-Modus: noch dunkler, noch weniger */
html.crash, html.crash body { background: #0D0E10; }
html.crash { --bg: #0D0E10; --bg2: #16181B; --bg3: #1E2125; --ink: #D9D3C8; --ink2: #B3AEA4; --ink3: #9B968D; --acc: #CDB283; --onacc: #15130E; color-scheme: dark; }
.crash-s h1 { font-size: 2.2em; margin-top: .6em; }
.crash-s .timer { font: 400 2.4em/1.1 var(--serif); margin: 8px 0; }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--sab)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 700; z-index: 20; max-width: 90vw; text-align: center; }
.toast[hidden] { display: none; }
details { margin: 10px 0; } summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--acc); }
.src { font-size: max(16px, .9em); color: var(--ink3); margin-top: 12px; }
.src a { display: block; padding: 6px 0; min-height: 36px; }
.foot { margin-top: 28px; font-size: max(16px, .9em); color: var(--ink3); text-align: center; }
table.rt { width: 100%; border-collapse: collapse; font-size: max(16px, .95em); margin: 8px 0 14px; }
table.rt td, table.rt th { text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.rt td:last-child { text-align: right; font-weight: 700; }
.bell button { text-align: left; }

/* Druck: nur der Bericht */
@media print {
  html, body { background: #fff !important; color: #111 !important; font-size: 11pt; }
  body * { visibility: hidden; }
  .report, .report * { visibility: visible; }
  .report { position: absolute; left: 0; top: 0; width: 100%; background: #fff !important; color: #111 !important; border: 0 !important; padding: 0 !important; }
  .report .card { border: 1px solid #bbb; background: #fff !important; break-inside: avoid; }
  .report .chart text { fill: #333 !important; }
  .report .mut, .report .fine { color: #333 !important; }
  .noprint { display: none !important; }
  @page { margin: 16mm; }
}
