@font-face { font-family: 'Figtree'; font-weight: 400; font-display: swap; src: url('/fonts/figtree/figtree-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-weight: 500; font-display: swap; src: url('/fonts/figtree/figtree-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-weight: 600; font-display: swap; src: url('/fonts/figtree/figtree-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-weight: 700; font-display: swap; src: url('/fonts/figtree/figtree-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Bricolage'; font-weight: 600; font-display: swap; src: url('/fonts/bricolage/bricolage-grotesque-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Bricolage'; font-weight: 800; font-display: swap; src: url('/fonts/bricolage/bricolage-grotesque-latin-800-normal.woff2') format('woff2'); }

:root {
  --c: #c2560c;        /* Farbe der angemeldeten Person */
  --t: #fff0e4;        /* zarte Tönung */
  --d: #9a4209;        /* dunkle Variante für Text */
  --ink: #2a211b;
  --muted: #6b5647;
  --line: #efe4da;
  --field: #e4d9d0;
  --soft: #f6f1ec;
  --danger: #b42318;
  --danger-bg: #fdf0ee;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #fff; color: var(--ink);
  font-family: Figtree, system-ui, sans-serif; font-size: 16px; line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
::selection { background: var(--t); }
button, input, select { font: inherit; color: inherit; }
a { color: var(--d); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }

#app { max-width: 560px; margin: 0 auto; padding: 22px 20px 110px; min-height: 100vh; }
.display { font-family: Bricolage, Figtree, sans-serif; }
h1 { font-family: Bricolage, Figtree, sans-serif; font-weight: 800; font-size: 30px; line-height: 1.1; letter-spacing: -0.4px; margin: 0; }
h2 { font-family: Bricolage, Figtree, sans-serif; font-weight: 600; font-size: 19px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section { margin-top: 24px; }

/* Kopfzeile */
.avatar {
  width: 40px; height: 40px; border-radius: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
}
.avatar.big { width: 52px; height: 52px; border-radius: 26px; font-size: 19px; }
.avatar.ring { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ring, var(--c)); }
.iconbtn {
  width: 44px; height: 44px; border-radius: 22px; border: 1.5px solid var(--field); background: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; text-decoration: none;
}
.iconbtn svg { width: 18px; height: 18px; stroke: var(--muted); }
.briefing { font-size: 19px; line-height: 1.5; color: #3d3029; margin: 10px 0 0; }
.briefing strong { color: var(--ink); }

/* Zeitleiste mit Etappen */
.timeline { margin-top: 26px; }
.stage { display: flex; gap: 14px; }
.stage .rail { display: flex; flex-direction: column; align-items: center; width: 16px; flex-shrink: 0; }
.stage .dot { width: 12px; height: 12px; border-radius: 6px; border: 2px solid #d9cabd; background: #fff; margin-top: 6px; }
.stage.now .dot { width: 16px; height: 16px; border-radius: 8px; border: 0; background: var(--c); box-shadow: 0 0 0 4px var(--t); margin-top: 4px; }
.stage .line { width: 2px; flex-grow: 1; background: var(--line); margin-top: 6px; }
.stage:last-child .line { display: none; }
.stage .body { flex-grow: 1; display: flex; flex-direction: column; gap: 8px; padding-bottom: 26px; min-width: 0; }
.stage .hint { font-size: 13px; color: var(--muted); }
.stage.now .hint { color: var(--d); font-weight: 700; }

/* Einträge */
.item {
  display: flex; gap: 12px; align-items: center; min-height: 52px; padding: 8px 12px 8px 14px;
  border-radius: var(--radius); border: 1.5px solid var(--line); background: #fff;
}
.item.tint { border-color: transparent; background: var(--it, var(--t)); }
.item input[type=checkbox] { width: 22px; height: 22px; margin: 0; accent-color: var(--ic, var(--c)); flex-shrink: 0; }
.item .main { flex-grow: 1; min-width: 0; background: none; border: 0; padding: 4px 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; }
.item .title { font-size: 16px; overflow-wrap: anywhere; }
.item .meta { font-size: 13px; color: var(--muted); }
.item .meta.strong { font-weight: 600; color: var(--id, var(--d)); }
.item .time { font-weight: 700; color: var(--id, var(--d)); min-width: 46px; }
.item.done .title { text-decoration: line-through; color: #8c7565; }
.tag { font-size: 13px; font-weight: 600; color: var(--id, var(--d)); white-space: nowrap; }
.gtag { font-size: 11px; font-weight: 700; letter-spacing: .2px; color: var(--muted); border: 1px solid var(--field); border-radius: 8px; padding: 2px 6px; white-space: nowrap; background: #fff; }
.allday { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--t); font-weight: 600; font-size: 15px; }
.calbox { border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.calbox ol { margin: 0; padding-left: 20px; font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.ok { color: #0b5e58; font-weight: 600; font-size: 14px; }
.empty { font-size: 15px; color: var(--muted); padding: 6px 0; }

/* Formulare */
label.field, .field { display: flex; flex-direction: column; gap: 8px; }
.field > span, .label { font-size: 15px; font-weight: 600; }
input[type=text], input[type=time], input[type=date], select {
  font-size: 17px; padding: 13px 14px; border: 1.5px solid var(--field); border-radius: var(--radius); background: #fff; width: 100%;
}
input[type=time], input[type=date] { width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 22px;
  border: 1.5px solid var(--field); background: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.chip[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .pdot { width: 10px; height: 10px; border-radius: 5px; box-shadow: 0 0 0 2px #fff; }
.seg { display: grid; gap: 4px; background: var(--soft); border-radius: var(--radius); padding: 4px; }
.seg.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg button { min-height: 44px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(60, 40, 25, .15); }
.form { display: flex; flex-direction: column; gap: 22px; }
.btn {
  border: 0; border-radius: 16px; padding: 16px; font-size: 17px; font-weight: 700; cursor: pointer;
  background: var(--c); color: #fff; width: 100%;
}
.btn.secondary { background: #fff; color: var(--danger); border: 1.5px solid var(--field); }
.btn:disabled { opacity: .5; cursor: default; }
.error { color: var(--danger); font-size: 14px; font-weight: 600; }
.notice, .field > span.notice { font-size: 14px; font-weight: 400; color: var(--muted); }
.switch { width: 50px; height: 30px; border-radius: 15px; background: #d9cabd; position: relative; flex-shrink: 0; border: 0; cursor: pointer; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s ease-out; }
.switch[aria-checked=true] { background: var(--c); }
.switch[aria-checked=true]::after { transform: translateX(20px); }
.swatch { width: 36px; height: 36px; border-radius: 18px; border: 0; cursor: pointer; }
.swatch[aria-pressed=true] { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--sw); }
.listrow { display: flex; justify-content: space-between; align-items: center; min-height: 54px; border-top: 1px solid #f1ebe6; gap: 12px; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 40px; height: 40px; border-radius: 20px; border: 1.5px solid var(--field); background: #fff; font-size: 20px; cursor: pointer; }
.panel { border-radius: 18px; padding: 18px 16px; display: flex; flex-direction: column; gap: 18px; }

/* Familie & Woche */
.pcard { border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.daytitle { margin: 22px 0 8px; display: flex; gap: 8px; align-items: baseline; }
.daytitle .today { font-size: 13px; font-weight: 700; color: var(--d); }

/* Untere Leiste */
nav.bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom));
  width: calc(100% - 24px); max-width: 536px;
  display: flex; justify-content: space-between; align-items: center; background: #fff;
  border: 1px solid #efe7e1; border-radius: 22px; padding: 6px 8px; box-shadow: 0 4px 14px rgba(60, 40, 25, .08);
}
nav.bar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 12px; font-size: 12px; font-weight: 600; text-decoration: none; color: var(--muted); }
nav.bar a svg { width: 22px; height: 22px; stroke: currentColor; }
nav.bar a[aria-current=page] { color: var(--d); font-weight: 700; }
nav.bar a.plus { width: 48px; height: 48px; border-radius: 16px; background: var(--c); justify-content: center; padding: 0; color: #fff; }

/* Anmeldung */
.center { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.whobtn { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: 18px; font-weight: 600; text-align: left; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
