/* Stil angelehnt an die Lernapp „Revierwissen“: Loden-Grund, Signalfarbe, große ruhige Karten.
   --accent wird aus Verwaltung → Aussehen gesetzt. Schriften liegen lokal (keine Google-Verbindung). */
@font-face { font-family: "Zilla Slab"; font-weight: 600; font-display: swap; src: url(fonts/zilla-slab-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Zilla Slab"; font-weight: 700; font-display: swap; src: url(fonts/zilla-slab-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url(fonts/source-sans-3-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url(fonts/source-sans-3-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Code Pro"; font-weight: 500; font-display: swap; src: url(fonts/source-code-pro-latin-500-normal.woff2) format("woff2"); }

:root {
  --bg: #EEF0E8; --surface: #FAFBF6; --fg: #1B2318; --muted: #5C6656; --line: #D3D9C8;
  --accent: #C24A12; --accent-fg: #FFFFFF;
  --good: #3B7A36; --good-soft: #E1EEDC; --bad: #B4362F; --bad-soft: #F6E3E0; --shadow: rgba(27,35,24,.45);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--surface));
  --font-display: "Zilla Slab", Rockwell, Georgia, serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Source Code Pro", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #11160F; --surface: #1A2117; --fg: #E6EADD; --muted: #9AA591; --line: #2E3829;
  --accent-fg: #FFFFFF; --good: #7DBB72; --good-soft: #1E3019; --bad: #EE7A6F; --bad-soft: #3A1E1A; --shadow: rgba(0,0,0,.7);
  color-scheme: dark;
} }

[hidden], .hidden { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--fg); font: 17px/1.5 var(--font-body); margin: 0; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); }
button { touch-action: manipulation; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0; line-height: 1.1; text-wrap: balance; }
p { margin: 0; }
.muted { color: var(--muted); }
.error { color: var(--bad); font-size: 15px; min-height: 1.2em; }
.pre { white-space: pre-wrap; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; }

/* Eine Spalte; unten Platz für die Tab-Leiste */
.wrap {
  max-width: 640px; margin: 0 auto; display: grid; gap: 14px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 18px calc(96px + env(safe-area-inset-bottom, 0px));
}
.wrap.wide { max-width: 900px; }
.stack { display: grid; gap: 14px; min-width: 0; }

/* Kopf jeder Seite */
.hd { display: grid; gap: 6px; }
.brandline { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--muted); }
.brandline img { width: 30px; height: 30px; object-fit: contain; }
.eyebrow { font: 500 11px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0; }
.hd h1 { font-size: clamp(30px, 8vw, 44px); line-height: 1.04; letter-spacing: -.015em; }
.lede { color: var(--muted); max-width: 60ch; }
.stats { display: grid; gap: 6px; margin-top: 4px; }
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--good); transition: width .4s ease; }
.stat { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stat b { color: var(--fg); font-weight: 600; }

/* Karten */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 18px;
  display: grid; gap: 12px; box-shadow: 0 18px 40px -30px var(--shadow); min-width: 0;
}
a.card { color: var(--fg); text-decoration: none; }
a.card:focus-visible, .btn:focus-visible, .chip:focus-visible, .tab:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.kick { font: 500 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 6px; }
.kick .icon { width: 14px; height: 14px; }
.card h2 { font-size: 26px; }
.card h3 { font-size: 20px; }
.card > p { color: var(--muted); }
.go { justify-self: start; margin-top: 2px; padding: 11px 16px; border-radius: 12px; background: var(--accent); color: var(--accent-fg); font-weight: 600; font-size: 16px; }
.big { font: 700 64px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.big small { font-size: 22px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.duo .card { gap: 4px; }
.duo .card .big { font-size: 40px; }

/* Pillen */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 13px; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tag.plain { background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 99px; padding: 7px 14px; font: 500 14px var(--font-body); cursor: pointer; white-space: nowrap; text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; }
.chip small { margin-left: 6px; opacity: .55; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); min-width: 0; }
.list li:last-child { border-bottom: 0; }
.list .main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.list .title { font-weight: 600; overflow-wrap: anywhere; }
.list .sub { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.list .amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list .amount.minus { color: var(--bad); }
.list .amount.plus { color: var(--good); }
.list a.main { color: var(--fg); text-decoration: none; }
.list .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.list .end { display: grid; justify-items: end; gap: 2px; flex: none; text-align: right; font-size: 14px; }
.list .end .sub { font-size: 13px; }
.list li.done .title { text-decoration: line-through; color: var(--muted); }
.list .empty { color: var(--muted); }
.sumrow { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 2px solid var(--fg); font-weight: 600; }

/* Knöpfe */
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions .wide { grid-column: 1 / -1; }
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 14px; padding: 11px 18px;
  font: 600 16px var(--font-body); cursor: pointer; text-align: center; text-decoration: none;
}
.btn.small { min-height: 40px; padding: 7px 12px; font-size: 14px; font-weight: 500; border-radius: 10px; }
.btn.icon-only { min-height: 40px; width: 40px; padding: 0; border-radius: 10px; }
.btn.ghost { background: transparent; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.bad { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; }
.note { font-size: 13px; color: var(--muted); }

/* Formulare */
.form { display: grid; gap: 12px; }
.fl { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); min-width: 0; }
.fl small { font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
input, select, textarea {
  width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  color: var(--fg); font: 17px var(--font-body); min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--good); flex: none; }
input[type=color] { padding: 4px; height: 50px; }
textarea { resize: vertical; min-height: 80px; line-height: 1.4; }
.list select { width: auto; padding: 6px 8px; font-size: 14px; border-radius: 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--bg); font-size: 15px; font-weight: 500; color: var(--fg); cursor: pointer; }
.check:has(input:checked) { border-color: var(--good); background: var(--good-soft); }
.check input { width: 18px; height: 18px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg a, .seg button { appearance: none; border: 0; background: none; color: var(--muted); font: 600 14px var(--font-body); padding: 9px 6px; border-radius: 9px; cursor: pointer; min-height: 40px; text-align: center; text-decoration: none; display: grid; place-items: center; }
.seg [aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* Tab-Leiste: am Handy unten über die ganze Breite, am PC als schwebende Leiste */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(var(--tabs, 4), 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
}
.tab { display: grid; justify-items: center; gap: 2px; padding: 6px 0; font: 600 12px var(--font-body); color: var(--muted); text-decoration: none; border-radius: 10px; }
.tab .icon { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
@media (min-width: 700px) {
  .wrap { padding-block: 32px calc(110px + env(safe-area-inset-bottom, 0px)); }
  .tabbar { left: 50%; right: auto; bottom: 16px; transform: translateX(-50%); width: calc(var(--tabs, 4) * 100px); border: 1px solid var(--line); border-radius: 18px; padding-bottom: 6px; box-shadow: 0 18px 40px -24px var(--shadow); }
}

/* Anmeldung */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 400px; }
.login .logo { width: 84px; height: 84px; object-fit: contain; }

/* Dateien */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; border-radius: 12px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; cursor: zoom-in; }
.gallery figcaption { font-size: 13px; padding: 6px 8px; display: flex; gap: 6px; align-items: center; }
.gallery figcaption span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery .btn.icon-only { min-height: 30px; width: 30px; }
.drop { border: 2px dashed var(--line); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.92); display: grid; place-items: center; padding: 12px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview { width: 96px; height: 96px; object-fit: contain; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); padding: 6px; }

.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 60; max-width: calc(100% - 32px); font-weight: 600; }
.toast.err { background: var(--bad); color: #fff; }

@media (max-width: 520px) {
  .grid3 { grid-template-columns: 1fr 1fr; }
  .duo .card .big { font-size: 32px; }
  .list .ico { display: none; }
  .list li { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .btn:active { transform: none; } }
