/* Kopfgeld – Handy-App. Farben und Schriften nur über die Tokens hier oben. */
:root {
  --bg: #F4F1EA;
  --card: #FBFAF6;
  --ink: #17160F;
  --muted: #6B675C;
  --line: #E2DDD0;
  --track: #E9E4D8;
  --accent: #FF5B2E;
  --accent-soft: #FFE3D9;
  --good: #2D7D4A;
  --good-soft: #DDEFE2;
  --warn: #9A6412;
  --warn-soft: #F6E8CC;
  --key: #FFFFFF;
  --key-press: #ECE7DB;
  --bar: #3F3B31;
  --num: ui-rounded, "SF Pro Rounded", "SF Pro Display", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text: system-ui, -apple-system, "SF Pro Text", "Segoe UI", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121110;
    --card: #1C1B18;
    --ink: #F2EFE7;
    --muted: #9A958A;
    --line: #2E2C27;
    --track: #2A2824;
    --accent: #FF7A52;
    --accent-soft: #3A2218;
    --good: #6CC48A;
    --good-soft: #1D3325;
    --warn: #E3B160;
    --warn-soft: #3A2E18;
    --key: #24221E;
    --key-press: #33302A;
    --bar: #CFC9BC;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--text); }
body { min-height: 100dvh; overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
[hidden] { display: none !important; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }

.phone { position: relative; width: 100%; max-width: 480px; margin: 0 auto; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; overflow: clip; }
.screen { flex: 1; overflow-y: auto; overflow-x: hidden; display: none; flex-direction: column; padding-top: env(safe-area-inset-top); }
.screen.active { display: flex; }

.top { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 20px 4px; }
.brand { font-family: var(--num); font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.brand i { font-style: normal; color: var(--accent); }
.hello { font-size: 13px; color: var(--muted); }

.seg { display: inline-flex; background: var(--track); border-radius: 999px; padding: 3px; }
.seg button { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.hero { padding: 10px 20px 0; }
.hero-row { display: flex; justify-content: space-between; align-items: center; }
.hero-label { font-size: 15px; color: var(--muted); }
.hero-num { font-family: var(--num); font-weight: 700; font-size: 64px; letter-spacing: -.035em; line-height: 1.05; margin: 2px 0 6px; font-variant-numeric: tabular-nums; }
.hero-num.over { color: var(--accent); }
.hero-num small { font-size: 36px; font-weight: 600; margin-left: 4px; }
.meter { height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ink); border-radius: 999px; transition: width .35s ease; }
.meter.over span { background: var(--accent); }
.hero-sub { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; }
.stock { display: flex; gap: 8px; margin: 14px 0 0; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 13px; background: var(--card); border: 1px solid var(--line); }
.pill b { font-family: var(--num); font-variant-numeric: tabular-nums; }
.pill.good { background: var(--good-soft); border-color: transparent; color: var(--good); }
.pill.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.sync { font-size: 11px; color: var(--muted); margin-top: 10px; }

.entry { margin-top: auto; padding: 10px 16px calc(10px + env(safe-area-inset-bottom) * .3); }
.amount { text-align: center; font-family: var(--num); font-weight: 600; font-size: 40px; letter-spacing: -.02em; min-height: 52px; font-variant-numeric: tabular-nums; }
.amount.empty { color: var(--muted); font-size: 17px; font-family: var(--text); font-weight: 400; padding-top: 14px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-size: 15px; font-weight: 600; transition: opacity .15s, transform .1s; }
.chip:active { transform: scale(.96); }
.chips.off .chip { opacity: .4; pointer-events: none; }
.chip.more { background: transparent; }
.chip .e { font-size: 18px; }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keys button { height: 54px; border-radius: 14px; background: var(--key); font-family: var(--num); font-size: 26px; font-weight: 500; box-shadow: 0 1px 0 var(--line); }
.keys button:active { background: var(--key-press); }

.h1 { font-family: var(--num); font-weight: 700; font-size: 28px; letter-spacing: -.02em; margin: 12px 20px 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; margin: 0 16px 12px; position: relative; }
.card h3 { margin: 0 0 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.card .big { font-family: var(--num); font-weight: 700; font-size: 34px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.card .big small { font-size: 17px; font-weight: 600; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); margin: 4px 0 0; line-height: 1.4; }
.rows { margin: 8px 0 0; font-size: 14px; }
.rows div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); gap: 12px; }
.rows div:last-child { border-bottom: 0; }
.rows span:last-child { font-family: var(--num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rows .sum { font-weight: 700; }
.rows .minus span:last-child { color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; margin-top: 8px; }
.status.good { background: var(--good-soft); color: var(--good); }
.status.warn { background: var(--warn-soft); color: var(--warn); }

.chart { width: 100%; height: auto; display: block; margin-top: 10px; touch-action: pan-y; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; font-family: var(--text); }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.proj { stroke-dasharray: 5 4; }
.chart .area { fill: var(--ink); opacity: .06; }
.chart .base { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 2 3; }
.chart .baselbl { fill: var(--accent); font-size: 10px; font-family: var(--text); }
.chart .dot { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.chart .cross { stroke: var(--muted); stroke-width: 1; }
.chart .sel { fill: var(--ink); stroke: var(--card); stroke-width: 2; }
.chart-wrap { position: relative; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12px; padding: 6px 8px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -100%); opacity: 0; transition: opacity .1s; }
.tip b { font-family: var(--num); }
details { margin-top: 8px; font-size: 13px; color: var(--muted); }
details summary { cursor: pointer; }

.bars { margin-top: 10px; display: grid; gap: 8px; }
.bars .b { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 13px; }
.bars .b .t { height: 8px; grid-column: 1 / -1; border-radius: 4px; background: var(--track); overflow: hidden; }
.bars .b .t span { display: block; height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; }
.bars .b em { font-style: normal; font-family: var(--num); font-variant-numeric: tabular-nums; }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; margin-left: 6px; }

.list { margin-top: 6px; }
.list .it { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list .it:last-child { border-bottom: 0; }
.list .it .e { font-size: 20px; width: 28px; text-align: center; }
.list .it .w { flex: 1; min-width: 0; }
.list .it .w small { display: block; color: var(--muted); font-size: 12px; }
.list .it .a { font-family: var(--num); font-variant-numeric: tabular-nums; }
.list .it .x { color: var(--muted); padding: 4px 8px; font-size: 18px; }

.slider { width: 100%; margin: 14px 0 4px; accent-color: var(--accent); }
.months { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 15px; background: var(--ink); color: var(--bg); }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: .5; }
.link { color: var(--muted); font-size: 13px; text-decoration: underline; padding: 8px 0; }
.spacer { height: 16px; flex: 0 0 auto; }

.tabs { display: flex; justify-content: space-around; border-top: 1px solid var(--line); background: var(--bg); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 6px 0; }
.tabs button svg { width: 24px; height: 24px; }
.tabs button[aria-current="page"] { color: var(--ink); }

.scrim { position: absolute; inset: 0; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--card); border-radius: 24px 24px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .25s cubic-bezier(.2,.8,.2,1), visibility 0s .25s; z-index: 11; max-height: 85%; overflow-y: auto; visibility: hidden; }
.sheet.on { transform: none; visibility: visible; transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.grab { width: 40px; height: 5px; border-radius: 999px; background: var(--line); margin: 0 auto 12px; }
.sheet h4 { margin: 0 0 12px; font-size: 17px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; border-radius: 16px; background: var(--bg); font-size: 13px; font-weight: 600; text-align: center; line-height: 1.2; }
.tile .e { font-size: 26px; }
.tile small { font-weight: 500; color: var(--muted); font-size: 11px; }
.field { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea { display: block; width: 100%; margin-top: 4px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 16px var(--text); -webkit-user-select: text; user-select: text; }
.field textarea { font-family: ui-monospace, monospace; font-size: 12px; min-height: 90px; resize: none; }

.toast { position: absolute; left: 16px; right: 16px; top: calc(env(safe-area-inset-top) + 12px); background: var(--ink); color: var(--bg); border-radius: 16px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; transform: translateY(-160%); transition: transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s .3s; z-index: 20; font-size: 14px; visibility: hidden; }
.toast.on { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.toast .e { font-size: 22px; }
.toast .w { flex: 1; line-height: 1.3; }
.toast .w small { display: block; opacity: .7; font-size: 12px; }
.toast button { color: var(--accent); font-weight: 700; font-size: 14px; }

.pair { padding: 40px 24px; display: flex; flex-direction: column; gap: 14px; }
.pair .brand { font-size: 32px; }
.pair p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 15px; }
.pair .err { color: var(--accent); font-size: 14px; }
.empty-note { font-size: 14px; color: var(--muted); padding: 10px 0; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }

.liquid[open] { width: 100%; }
.liquid summary { cursor: pointer; }
.liquid .field { margin-top: 8px; }
.liquid summary::after { content: "▾"; }
.liquid[open] summary::after { content: "▴"; }
