/* Crêpes-Zähler · Stil "Achromatic ledger" (taste-skill), angepasst für draußen: Sonne, Kälte, Handschuhe */
@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #f4f3f1;      /* Stein: eine Stufe neben Weiß */
  --surface: #ffffff;
  --raised: #e9e8e5;
  --border: #e2e1de;
  --rule: #ecebe8;
  --control: #c9c8c4;
  --text: #0a0a0a;
  --muted: #5f5f5f;
  --accent: #141414;
  --hue: #1d5fbf;          /* die eine Datenfarbe */
  --positive: #2e7d32;
  --negative: #c4242a;
  --warning: #92400e;
  --pill-warning-bg: #fff4d6; --pill-warning-ink: #7a3410;
  --pill-positive-bg: #dcfae5; --pill-positive-ink: #04250e;
  --pill-neutral-bg: #e9e8e5; --pill-neutral-ink: #3d3d3d;
  --pill-negative-bg: #ffedea; --pill-negative-ink: #831c1e;
  --radius-card: 8px;
  --radius-control: 6px;
  --gap: 12px;
  --pad: 20px;
  --font: "Geist", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.num, td.n, .tabular { font-variant-numeric: tabular-nums; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--hue); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.bar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 var(--pad);
  min-height: 60px;
  background: var(--ground);
  border-bottom: 1px solid var(--border);
}
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; font-size: 16px; white-space: nowrap; }
.mark svg { width: 30px; height: 30px; flex: none; }
.bar nav { display: flex; gap: 4px; margin-left: auto; }
.bar nav a {
  text-decoration: none; color: var(--muted);
  padding: 10px 12px; border-radius: var(--radius-control); font-weight: 500;
}
.bar nav a[aria-current="page"] { color: var(--text); background: var(--raised); }
.bar nav a:hover { color: var(--text); }

.page { max-width: 1180px; margin: 0 auto; padding: 24px var(--pad) 64px; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
h1 { font-size: 24px; line-height: 1.2; font-weight: 500; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 16px; line-height: 1.3; font-weight: 500; margin: 0; }
.sub { color: var(--muted); font-size: 14px; margin: 4px 0 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--pad); }
.card + .card, .grid + .card, .card + .grid { margin-top: var(--gap); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid { display: grid; gap: var(--gap); }
.grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 820px) { .grid.two { grid-template-columns: 1fr; } }

/* ---------- Buttons & Felder ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 0; border-radius: var(--radius-control);
  background: var(--accent); color: #fff; font-weight: 500; font-size: 16px;
  text-decoration: none; cursor: pointer;
  transition: transform .08s ease, background-color .15s ease;
}
.btn:hover { background: #2b2b2b; }
.btn:active { transform: scale(.97); }
.btn.secondary { background: var(--raised); color: var(--text); }
.btn.secondary:hover { background: #dedcd8; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--control); }
.btn.big { min-height: 60px; font-size: 18px; padding: 0 24px; }
.btn[disabled] { opacity: .45; cursor: default; }

.seg { display: inline-flex; background: var(--raised); border-radius: var(--radius-control); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; min-height: 38px; border-radius: 4px; color: var(--muted); font-weight: 500; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); }

input[type=text], input[type=password], input[type=number], input[inputmode], select {
  min-height: 48px; padding: 0 14px;
  border: 1px solid var(--control); border-radius: var(--radius-control);
  background: var(--surface); font-size: 17px; width: 100%;
}
input:focus { border-color: var(--text); outline: none; box-shadow: 0 0 0 2px var(--text) inset; }
label.field { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }

.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.pill.ok { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill.neutral { background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }
.pill.bad { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; cursor: pointer; }
.toggle input { appearance: none; -webkit-appearance: none; width: 56px; height: 32px; border-radius: 999px; background: var(--control); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(24px); }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--accent); color: #fff; padding: 14px 20px; border-radius: var(--radius-card);
  font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px);
  box-shadow: 0 6px 24px rgba(0,0,0,.18); z-index: 20; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--negative); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
