:root {
  --bg: #f4f6f1;
  --card: #ffffff;
  --ink: #16200f;
  --muted: #5c6655;
  --line: #d9dfd2;
  --green: #2f5d1e;
  --green-2: #4a8a2c;
  --green-soft: #e6efdf;
  --yellow: #f2c94c;
  --red: #b3261e;
  --red-soft: #fbe9e7;
  --blue-soft: #e3edf7;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11160e; --card: #1b2316; --ink: #eef3e9; --muted: #a3ae9a; --line: #2f3a28;
    --green: #7cc35a; --green-2: #8fd16c; --green-soft: #24331c; --red: #ff8a80; --red-soft: #3a1e1c; --blue-soft: #1d2a36;
  }
}
:root[data-theme="dark"] {
  --bg: #11160e; --card: #1b2316; --ink: #eef3e9; --muted: #a3ae9a; --line: #2f3a28;
  --green: #7cc35a; --green-2: #8fd16c; --green-soft: #24331c; --red: #ff8a80; --red-soft: #3a1e1c; --blue-soft: #1d2a36;
}
* { box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100%; overscroll-behavior-x: none; touch-action: pan-y; margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.hidden { display: none !important; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: #2f5d1e; color: #fff; }
.brand { font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net { font-size: 13px; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.18); white-space: nowrap; }
.net.off { background: #f2c94c; color: #222; font-weight: 600; }

.timerbar { position: sticky; top: 52px; z-index: 4; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 16px; background: #f2c94c; color: #222; font-weight: 600; }
.timerbar button { background: #222; color: #fff; border: 0; border-radius: 10px; padding: 10px 16px; font-size: 16px; font-weight: 700; }

main { max-width: 760px; margin: 0 auto; padding: 14px 16px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 20px 0 8px; }
h2:first-child { margin-top: 4px; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { display: flex; flex-direction: column; align-items: center; padding: 8px 0 10px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600; }
.tabs a span { font-size: 22px; line-height: 1.2; }
.tabs a.on { color: var(--green); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.pick { min-height: 58px; padding: 10px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); font-size: 17px; font-weight: 600; text-align: left; cursor: pointer; }
.pick small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.pick.on { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; min-width: 0; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { color: var(--muted); font-size: 14px; }
.big { font-size: 24px; font-weight: 700; }

label.f { display: block; margin: 10px 0 0; font-size: 14px; font-weight: 600; color: var(--muted); }
input, select, textarea { width: 100%; margin-top: 4px; padding: 12px; font: inherit; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 12px; }
input, select, textarea { min-width: 0; max-width: 100%; display: block; }
input[type=date], input[type=month] { -webkit-appearance: none; appearance: none; min-height: 50px; text-align: left; }
input::-webkit-date-and-time-value { text-align: left; }
.card, .modal .sheet { overflow-wrap: anywhere; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); }
input.huge { font-size: 32px; font-weight: 700; padding: 10px 14px; }
input[type=checkbox] { display: inline-block; width: 26px; height: 26px; margin: 0; accent-color: var(--green); flex: none; }
.check { display: flex; gap: 12px; align-items: center; padding: 12px; margin-top: 12px; border-radius: 12px; background: var(--blue-soft); font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px; border: 0; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; background: var(--green-soft); color: var(--green); }
.btn.primary { background: var(--green); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #10170c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #10170c; } }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.block { width: 100%; padding: 18px; font-size: 20px; margin-top: 16px; }
.btn.sm { padding: 8px 12px; font-size: 14px; }
.btn:disabled { opacity: .45; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quick { display: flex; gap: 6px; margin-top: 6px; }
.quick .btn { flex: 1; padding: 10px 0; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--green-soft); color: var(--green); white-space: nowrap; }
.chip.warn { background: #fdf3d3; color: #7a5a00; }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.grey { background: var(--line); color: var(--muted); }
.amount { font-weight: 700; white-space: nowrap; }
.preview { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--green-soft); font-weight: 600; }

.modal { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.modal .sheet { width: 100%; max-width: 620px; max-height: 92vh; overflow: auto; background: var(--bg); border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .modal { align-items: center; } .modal .sheet { border-radius: 18px; } }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 30; max-width: 520px; margin: 0 auto; padding: 14px 16px; border-radius: 12px; background: #16200f; color: #fff; font-weight: 600; text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.toast.err { background: #b3261e; }
.login { max-width: 360px; margin: 12vh auto 0; }
details.card > summary { font-weight: 700; cursor: pointer; list-style: none; }
details.card > summary::after { content: '▸'; float: right; color: var(--muted); }
details.card[open] > summary::after { content: '▾'; }
.inactive { opacity: .5; }

/* Schmale Handys: Felder untereinander statt nebeneinander */
@media (max-width: 420px) { .row { flex-direction: column; align-items: stretch; gap: 0; } }
