/* PUFU Portal: ein Design-System fuer alle Seiten.
   Tokens oben, dann Grundgeruest, dann genau ein Satz Komponenten. Seiten-CSS (css/pages/*.css)
   ordnet nur an und nutzt diese Tokens; es definiert keine eigenen Knoepfe, Felder oder Karten. */

@font-face { font-family: "Familjen Grotesk"; src: url(/static/fonts/familjen-grotesk-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Familjen Grotesk"; src: url(/static/fonts/familjen-grotesk-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Familjen Grotesk"; src: url(/static/fonts/familjen-grotesk-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Familjen Grotesk"; src: url(/static/fonts/familjen-grotesk-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "DM Serif Display"; src: url(/static/fonts/dm-serif-display-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }

/* ═══ Tokens (Werte aus dem Claude-Design-Entwurf 23.10.2026) ═══════ */
:root {
  /* Farben */
  --bg: #F4F1EA;          /* Seitengrund (cream) */
  --surface: #FBF9F5;     /* Karten, Dialoge, Kopfleiste */
  --surface-2: #EFE9DF;   /* Seitenleiste, Segment-Spur, Hover */
  --surface-3: #E2DACB;   /* Spur, Platzhalter, Knopf-Flaeche */
  --ink: #2E2C29;
  --ink-2: #2A2623;       /* Text auf Pfirsich */
  --text-2: #5A544B;
  --text-3: #736B5F;
  --text-4: #8E8474;      /* Gruppenkoepfe der Navigation */
  --line: #E2DACB;
  --line-2: #D3C8B7;
  --accent: #FBC49D;      /* die eine Akzentfarbe: Hauptaktion, Auswahl */
  --accent-hover: #F6B482;
  --accent-soft: #FDE8D7;
  --accent-wash: #FCEEE3; /* grosse warme Flaechen (Stempeluhr, Heute im Laden) */
  --accent-ink: #2A2623;
  --accent-deep: #A9763F; /* caramel: Kicker, Symbole, aktive Auswahl */
  --ok: #6F8F4E;          /* matcha */
  --ok-soft: #DCE6CF;
  --warn: #A9763F;
  --bad: #A8432F;
  --bad-soft: #F8E9E4;
  --warn-soft: #FAF0E3;
  --focus: #D98A52;

  /* Abstaende 4/8/12/16/20/24/32/48 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s45: 20px; --s5: 24px; --s6: 32px; --s7: 48px;
  /* Radien */
  --r-xs: 9px; --r-sm: 10px; --r-md: 12px; --r-lg: 14px; --r-card: 20px; --r-sheet: 22px; --r-pill: 999px;
  /* Kontrollhoehen: Leisten und Knoepfe 42, Formularfelder 44 */
  --ctl: 42px; --field: 44px;
  /* Schrift */
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "Familjen Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-ui: 14px; --fs-body: 15px; --fs-md: 16px; --fs-lg: 20px; --fs-xl: 28px; --fs-2xl: clamp(34px, 4vw, 52px);
  /* Tiefe */
  --shadow-pop: 0 16px 40px -12px rgba(46, 44, 41, .28), 0 2px 6px rgba(46, 44, 41, .08);
  --shadow-dlg: 0 24px 64px -16px rgba(46, 44, 41, .45);
  --shadow-raise: 0 1px 3px rgba(46, 44, 41, .12);
  /* Bewegung */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  /* Grundgeruest */
  --side-w: 264px; --rail-w: 92px; --top-h: 58px; --tab-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

/* ═══ Basis ════════════════════════════════════════════════════════ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-2) transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs-body)/1.5 var(--sans); caret-color: var(--accent-deep); -webkit-tap-highlight-color: transparent; }
::selection { background: var(--accent-soft); color: var(--ink); }
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent-deep); }
h1, h2, h3, h4 { margin: 0; font-weight: 400; text-wrap: balance; }
h1 { font: 400 var(--fs-2xl)/1.15 var(--serif); letter-spacing: -0.01em; }
h2 { font: 400 var(--fs-xl)/1.2 var(--serif); }
h3 { font: 600 var(--fs-md)/1.3 var(--sans); }
p { margin: 0 0 var(--s3); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ic { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: -0.125em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: var(--fs-sm); }
.nowrap { white-space: nowrap; }
.il { display: inline-flex; align-items: center; gap: var(--s2); }
.il > .ic { vertical-align: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.row-flex { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.pos { color: var(--ok); }
.neg { color: var(--bad); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }

/* Abschnittstitel: klein, Grossbuchstaben, Symbol auf einer Linie */
.sec-title { display: flex; align-items: center; gap: var(--s2); margin: var(--s6) 0 var(--s3); font: 600 var(--fs-xs)/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.sec-title .ic { font-size: 14px; vertical-align: 0; }
.sec-title .act { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 600; }
.sec-title:first-child { margin-top: 0; }

/* ═══ Grundgeruest (Entwurf): Handy < 768 oben + unten, Leiste 768 bis 1199 (92px), ab 1200 Seitenleiste 264px ═══ */
.app { min-height: 100vh; display: flex; background: var(--bg); }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side { display: none; }
.top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: var(--s3); height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) var(--s4) 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .logo img { display: block; height: 28px; width: auto; }
.top-title { flex: 1; min-width: 0; font: 400 20px/1.2 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .me { border: 0; background: transparent; padding: 0; cursor: pointer; display: flex; }
.top .me .av { width: 34px; height: 34px; font-size: 12px; font-weight: 700; }
.main { flex: 1; width: 100%; max-width: 1640px; margin: 0 auto; padding: 20px var(--s4) calc(104px + var(--safe-b)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -12px rgba(46, 44, 41, .18); }
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; border: 0; background: transparent; color: var(--text-3); font: 500 11px/1 var(--sans); text-decoration: none; cursor: pointer; padding: 0; }
.tabbar .pill { position: relative; display: flex; align-items: center; justify-content: center; width: 52px; height: 28px; border-radius: var(--r-pill); transition: background-color 150ms ease; }
.tabbar .pill .ic { font-size: 20px; }
.tabbar .pill .dot { position: absolute; top: 2px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tabbar .lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar .on { color: var(--ink); font-weight: 700; }
.tabbar .on .pill { background: var(--accent-soft); }

.side .brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 28px; padding: 0; border: 0; background: transparent; text-decoration: none; cursor: pointer; }
.side .brand img { display: block; height: 34px; width: auto; flex: none; }
.side .brand .bt { display: none; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.side .brand .bt b { font: 400 20px/1.1 var(--serif); color: var(--ink); }
.side .brand .bt span { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 18px; }
.nav-g { display: flex; flex-direction: column; gap: 2px; }
.nav-h { display: none; font: 600 11px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--text-4); padding: 0 12px 6px; }
.nav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 100%; height: 58px; border-radius: var(--r-md); color: var(--text-2); font: 500 11px/1.1 var(--sans); text-decoration: none; transition: background-color 150ms ease; }
.nav a .ic { font-size: 21px; color: var(--text-3); }
.nav a .lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.nav a:hover { box-shadow: inset 0 0 0 1px rgba(46, 44, 41, .12); }
.nav a.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav a.on .ic { color: var(--accent-ink); }
.nav .badge { position: absolute; top: 6px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); font-size: 0; }
.nav a.on .badge { background: var(--accent-ink); }
.nav .badge:empty { display: none; }
.side-foot { margin-top: auto; padding-top: 20px; display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
.side-foot .me { display: flex; align-items: center; justify-content: center; gap: var(--s3); width: 100%; padding: 0; border: 0; border-radius: var(--r-md); background: transparent; cursor: pointer; text-align: left; text-decoration: none; color: var(--ink); }
.side-foot .me .av { width: 40px; height: 40px; font-size: 13px; font-weight: 700; }
.side-foot .me.on .av { box-shadow: 0 0 0 3px var(--accent); }
.side-foot .me .who, .side-foot .me .chev { display: none; }

@media (min-width: 768px) {
  .top, .tabbar { display: none; }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; width: var(--rail-w); flex: none; padding: 18px 8px 16px; background: var(--surface-2); color: var(--text-2); border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .main { padding: 32px 32px 56px; }
}
@media (min-width: 1200px) {
  .side { width: var(--side-w); padding: 24px 16px 18px; }
  .side .brand { justify-content: flex-start; }
  .side .brand img { height: 40px; }
  .side .brand .bt { display: flex; }
  .nav-h { display: block; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; height: 40px; padding: 0 12px; border-radius: var(--r-sm); font-size: 14px; }
  .nav a .ic { font-size: 18px; }
  .nav a .lbl { flex: 1; padding: 0; }
  .nav .badge { position: static; width: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; font: 700 12px/1 var(--sans); color: var(--accent-ink); }
  .nav a.on .badge { background: var(--accent-ink); color: var(--accent); }
  .side-foot { align-items: stretch; }
  .side-foot .me { justify-content: flex-start; padding: 10px; }
  .side-foot .me.on { background: var(--surface); }
  .side-foot .me:hover { box-shadow: inset 0 0 0 1px rgba(46, 44, 41, .12); }
  .side-foot .me .av { width: 36px; height: 36px; }
  .side-foot .me.on .av { box-shadow: none; }
  .side-foot .me .who { display: block; flex: 1; min-width: 0; line-height: 1.25; }
  .side-foot .me .who b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-foot .me .who span { display: block; font-size: 12px; color: var(--text-3); }
  .side-foot .me .chev { display: block; font-size: 16px; color: var(--text-4); }
  .main { padding: 44px 56px 64px; }
}
/* Menue-Blatt "Alle Bereiche" (Handy) */
.dlg.menu { background: var(--bg); }
.dlg.menu .dlg-h h2 { font-size: 24px; }
.dlg.menu .x { width: 40px; height: 40px; background: var(--surface-3); }
.dlg.menu .dlg-f { justify-content: center; }
.menu-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.menu-tiles a, .menu-tiles button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2); height: 88px; border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); font: 600 13px/1.1 var(--sans); text-decoration: none; cursor: pointer; position: relative; }
.menu-tiles .ic { font-size: 24px; color: var(--accent-deep); }
.menu-tiles .on { background: var(--accent); color: var(--accent-ink); }
.menu-tiles .on .ic { color: var(--accent-ink); }
.menu-tiles .badge { position: absolute; top: 10px; right: 14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font: 700 11px/18px var(--sans); text-align: center; }
.menu-tiles .badge:empty { display: none; }

/* Seitenkopf (Entwurf): Kicker, grosser Serif-Titel, rechts Aktionen */
.kicker { font: 600 12px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-deep); margin-bottom: 10px; }
.ph { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: 28px; }
.ph .tt { flex: 1 1 260px; min-width: 0; }
.ph h1 { font: 400 var(--fs-2xl)/1 var(--serif); letter-spacing: -.015em; }
.ph .sub { color: var(--text-3); margin-top: var(--s2); font-size: var(--fs-ui); }
.ph .acts { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
@media (max-width: 767px) { .ph { margin-bottom: var(--s45); } }

/* Werkzeugleiste: alles 42px hoch */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-bottom: var(--s45); }
.bar > * { flex: none; }
.bar .spacer { flex: 1 1 0; min-width: 0; }
.bar .select { min-width: 170px; }
.bar .select select, .bar .input { height: var(--ctl); border-radius: var(--r-md); background: var(--surface); font-size: var(--fs-ui); }
.bar .label { font-weight: 600; font-size: var(--fs-md); min-width: 140px; text-align: center; font-variant-numeric: tabular-nums; }
.bar .group { display: inline-flex; align-items: center; gap: var(--s1); }
@media (max-width: 767px) {
  .bar .select { flex: 1 1 140px; min-width: 0; }
  .bar .spacer { display: none; }
  .bar .group.fill { flex: 1 1 100%; justify-content: space-between; }
  .bar .group.fill .label { flex: 1; }
}
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-bottom: var(--s4); }

/* ═══ Knoepfe (Entwurf: 42px, Radius 10, primaer Pfirsich ohne Rahmen) ═══ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); height: var(--ctl); padding: 0 18px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 var(--fs-ui)/1 var(--sans); white-space: nowrap; cursor: pointer; text-decoration: none; transition: background-color 150ms ease, border-color 150ms ease, transform 160ms var(--ease-out); user-select: none; -webkit-user-select: none; }
.btn .ic { font-size: 16px; vertical-align: 0; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.soft { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.danger { color: var(--bad); }
.btn.dashed { border-style: dashed; background: transparent; }
.btn.icon { width: 38px; height: 38px; padding: 0; flex: none; border-color: transparent; background: transparent; }
.btn.icon .ic { font-size: 18px; }
.btn.sm { height: 34px; padding: 0 var(--s3); font-size: var(--fs-sm); border-radius: var(--r-xs); }
.btn.sm.icon { width: 34px; height: 34px; padding: 0; }
.btn.sm.icon .ic { font-size: 16px; }
.btn.lg { height: 56px; padding: 0 var(--s5); font-size: var(--fs-md); border-radius: var(--r-lg); }
.btn.block { width: 100%; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { background: var(--surface-2); }
  .btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
  .btn.ghost:hover:not(:disabled), .btn.icon:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
  .btn.danger:hover:not(:disabled) { background: var(--bad-soft); }
}
/* alter Name, gleiche Optik wie .btn.icon */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 38px; height: 38px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--ink); cursor: pointer; font-size: 18px; padding: 0; transition: background-color 150ms ease, transform 160ms var(--ease-out); }
.icon-btn:active { transform: scale(0.97); }
.icon-btn.sm { width: 34px; height: 34px; font-size: 16px; border-radius: var(--r-xs); }
.icon-btn.plain { color: var(--text-2); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--surface-2); color: var(--ink); } }

/* Segment-Umschalter (Entwurf: Spur #EFE9DF, Radius 12, Knoepfe 34px, aktiv hell mit Schatten) */
.seg { display: inline-flex; align-items: center; gap: 2px; height: var(--ctl); padding: 4px; border-radius: var(--r-md); background: var(--surface-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; vertical-align: middle; }
.seg::-webkit-scrollbar { display: none; }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--text-2); font: 600 var(--fs-ui)/1 var(--sans); white-space: nowrap; cursor: pointer; transition: background-color 150ms ease, color 150ms ease; }
.seg button .ic { font-size: 15px; vertical-align: 0; }
.seg button .cnt { font-size: var(--fs-xs); color: var(--accent-deep); font-weight: 700; font-variant-numeric: tabular-nums; }
.seg button .cnt:empty { display: none; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-raise); }
.seg.block { display: flex; width: 100%; }
.seg.block button { flex: 1; justify-content: center; }

/* Umschalt-Chip (Entwurf: Mehrfachauswahl mit Lucide square / square-check) */
.tgl { position: relative; display: inline-flex; align-items: center; gap: var(--s2); min-height: 40px; padding: 0 var(--s3); border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: 500 var(--fs-ui)/1.2 var(--sans); cursor: pointer; user-select: none; transition: background-color 150ms ease, border-color 150ms ease; }
.tgl input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.tgl .ic { font-size: 17px; color: #A39886; }
.tgl .ic.y { display: none; }
.tgl:has(input:checked) { border-color: var(--accent-deep); background: var(--accent-soft); }
.tgl:has(input:checked) .ic.n { display: none; }
.tgl:has(input:checked) .ic.y { display: inline-block; color: var(--accent-deep); }
.tgl:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.tgls { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ═══ Felder (Entwurf: Beschriftung 14/600, Feld 44px, Radius 12, weiss) ═══ */
.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; }
.f > .lbl { font: 600 var(--fs-ui)/1.3 var(--sans); color: var(--ink); }
.f > .hint { font-size: var(--fs-sm); color: var(--text-3); line-height: 1.4; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.form > .full, .form > .msg, .form > .sec-title, .form > .drop, .form > .sw, .form > .cbs, .form > .preview { grid-column: 1 / -1; }
.form > .sec-title { margin: var(--s2) 0 0; }
.form.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form.one { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 520px) { .form { grid-template-columns: minmax(0, 1fr); } .form.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form.three > .full { grid-column: 1 / -1; } }
.input, .select select {
  display: block; width: 100%; height: var(--field); margin: 0; padding: 0 var(--s3); border: 1px solid var(--line-2); border-radius: var(--r-md); background: #fff; color: var(--ink);
  font: 400 var(--fs-body)/1.2 var(--sans); transition: border-color 150ms ease, box-shadow 150ms ease; }
textarea.input { height: auto; min-height: 96px; padding: 10px var(--s3); line-height: 1.45; resize: vertical; }
.input::placeholder { color: var(--text-3); }
/* keine nativen Windows-Zusaetze in Feldern (Passwort-Auge, Loeschen-Kreuz) */
input::-ms-reveal, input::-ms-clear { display: none; }
.input:focus, .select select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.input:disabled, .select select:disabled { background: var(--surface-2); color: var(--text-3); }
.input[type=date], .input[type=time], .input[type=month] { padding-right: var(--s2); min-width: 0; }
.input[type=date]::-webkit-calendar-picker-indicator, .input[type=time]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
.input.invalid { border-color: var(--bad); }
/* Eingabe mit Einheit rechts (z. B. Euro) */
.affix { position: relative; display: block; }
.affix .input { padding-right: 40px; }
.affix .sfx { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 38px; display: flex; align-items: center; justify-content: center; color: var(--text-2); font-weight: 600; pointer-events: none; border-left: 1px solid var(--line); }
/* eigenes Select: natives Element ohne Pfeil, Lucide-Pfeil daneben */
.select { position: relative; display: block; min-width: 0; }
.select select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.select select::-ms-expand { display: none; }
.select .chev { position: absolute; right: 12px; top: 50%; margin-top: -8px; font-size: 16px; color: var(--text-2); pointer-events: none; }

/* eigene Checkbox */
.cb { display: inline-flex; align-items: flex-start; gap: var(--s3); min-height: 24px; cursor: pointer; font-size: var(--fs-body); line-height: 1.35; position: relative; user-select: none; }
.cb input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.cb .box { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line-2); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: transparent; font-size: 15px; transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out); }
.cb .box .ic { stroke-width: 3; vertical-align: 0; }
.cb:active .box { transform: scale(0.92); }
.cb input:checked + .box { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.cb input:focus-visible + .box { outline: 2px solid var(--focus); outline-offset: 2px; }
.cb input:disabled + .box { background: var(--surface-2); }
.cb .txt { padding-top: 1px; min-width: 0; }
.cb .txt small { display: block; color: var(--text-3); font-size: var(--fs-xs); }
.cbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s3) var(--s4); }
/* Schalter */
.sw { display: flex; align-items: center; gap: var(--s3); min-height: var(--ctl); cursor: pointer; position: relative; user-select: none; }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.sw .txt { flex: 1; min-width: 0; line-height: 1.35; }
.sw .txt small { display: block; color: var(--text-3); font-size: var(--fs-xs); }
.sw .track { flex: none; width: 44px; height: 26px; border-radius: var(--r-pill); background: var(--surface-3); position: relative; transition: background-color 180ms ease; }
.sw .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(46, 44, 41, .28); transition: transform 200ms var(--ease-out); }
.sw input:checked ~ .track { background: var(--accent-deep); }
.sw input:checked ~ .track::after { transform: translateX(18px); }
.sw input:focus-visible ~ .track { outline: 2px solid var(--focus); outline-offset: 2px; }
.sw.boxed { padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }

/* Datei-Ablageflaeche */
.drop { position: relative; display: flex; align-items: center; gap: var(--s4); padding: var(--s4); border: 1.5px dashed var(--line-2); border-radius: var(--r-md); background: #fff; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease; }
.drop input[type=file] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.drop.over { border-color: var(--accent-deep); background: var(--accent-soft); }
.drop.has { border-style: solid; border-color: var(--line); cursor: default; }
.drop .pv { flex: none; width: 96px; height: 96px; border-radius: var(--r-sm); background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 28px; overflow: hidden; }
.drop .pv img { width: 100%; height: 100%; object-fit: contain; }
.drop .tx { flex: 1; min-width: 0; font-size: var(--fs-ui); color: var(--text-2); }
.drop .tx b { display: block; color: var(--ink); font-size: var(--fs-body); margin-bottom: 2px; }
.drop .tx .fn { display: block; margin-top: var(--s1); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop .acts { display: flex; gap: var(--s2); margin-top: var(--s3); flex-wrap: wrap; }
.drop.big { flex-direction: column; justify-content: center; text-align: center; padding: var(--s6) var(--s4); }
.drop.big .pv { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-deep); font-size: 24px; }
@media (max-width: 420px) { .drop .pv { width: 72px; height: 72px; } }

/* Meldungen inline */
.msg { display: flex; align-items: flex-start; gap: 10px; padding: 10px var(--s3); border-radius: var(--r-sm); font-size: var(--fs-ui); line-height: 1.45; background: var(--surface-2); color: var(--ink); }
.msg .ic { font-size: 16px; margin-top: 2px; }
.msg.err { background: var(--bad-soft); color: #7E3222; }
.msg.ok { background: var(--ok-soft); color: #3F5A2B; }
.msg.warn { background: var(--warn-soft); color: #6F4D25; }
.msg:empty { display: none; }
.msg .act { margin-left: auto; }

/* ═══ Flaechen (Entwurf: Karte #FBF9F5, Rahmen #E2DACB, Radius 20, Innenabstand 22/24) ═══ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px 24px; }
.card.warm { background: var(--accent-wash); border-color: #F3D6BF; }
.card.tight { padding: var(--s4); }
.card.flush { padding: 0; overflow: hidden; }
.card + .card { margin-top: var(--s45); }
.card-h { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.card-h h3 { flex: 1; min-width: 0; }
.card-h .sec-title { margin: 0; flex: 1; }
.grid-2 { display: grid; gap: var(--s45); }
@media (min-width: 1180px) { .grid-2 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; } }
@media (max-width: 767px) { .card { padding: 18px var(--s4); } }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); min-height: 56px; }
.list > li:first-child { border-top: 0; }
.list .main-col { flex: 1; min-width: 0; }
.list .t { font-weight: 600; line-height: 1.3; }
.list .s { color: var(--text-2); font-size: var(--fs-ui); line-height: 1.4; margin-top: 2px; }
.list .right { margin-left: auto; text-align: right; flex: none; }
.list > li.click { cursor: pointer; transition: background-color 120ms ease; }
@media (hover: hover) and (pointer: fine) { .list > li.click:hover { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); } }
.list > li.click:active { background: var(--surface-2); }
.list.plain > li { padding-left: 0; padding-right: 0; }
.kind-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: 17px; }
.kind-ic.acc { background: var(--accent-soft); color: var(--accent-deep); }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.stats > div { padding: var(--s3) var(--s4); box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); }
.stats .k { font: 600 var(--fs-xs)/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.stats .v { font: 600 var(--fs-lg)/1.3 var(--sans); font-variant-numeric: tabular-nums; margin-top: 4px; }
.stats .v small { font-size: var(--fs-ui); font-weight: 500; color: var(--text-2); }

.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: var(--s2) var(--s5); font-size: var(--fs-body); margin: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dt { font-size: var(--fs-sm); } .kv dd { margin-bottom: var(--s3); } }

/* Status: 7px-Punkt plus Wort */
.st { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-ui); line-height: 1.2; color: var(--text-2); white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.st-ok::before { background: var(--ok); }
.st-wait::before { background: var(--warn); }
.st-bad::before { background: var(--bad); }
.st-new::before { background: var(--accent-hover); }
.st-off::before { background: var(--line-2); }

/* Kennzeichen (z. B. Empfehlung) */
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-pill); background: var(--accent-soft); color: #7A4B22; font: 600 var(--fs-xs)/1 var(--sans); white-space: nowrap; vertical-align: middle; }
.tag .ic { font-size: 12px; vertical-align: 0; }
.tag.neutral { background: var(--surface-2); color: var(--text-2); }

/* Avatar: Initialen exakt mittig */
.av { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--av, var(--surface-3)); color: #4A3F33; font: 600 12px/1 var(--sans); letter-spacing: .02em; text-transform: uppercase; user-select: none; text-indent: .02em; }
.av.sm { width: 26px; height: 26px; font-size: 10.5px; }
.av.lg { width: 56px; height: 56px; font-size: 19px; }
.av.xl { width: 72px; height: 72px; font-size: 24px; }
.avs { display: inline-flex; vertical-align: middle; }
.avs .av { box-shadow: 0 0 0 2px var(--surface); }
.avs .av + .av { margin-left: -6px; }

/* Tabellen: Zahlen rechts (Kopf und Wert), feste Spalten */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-ui); }
.tbl.fixed { table-layout: fixed; }
.tbl th { text-align: left; font: 600 var(--fs-xs)/1.2 var(--sans); letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); padding: 10px var(--s3); border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl td { padding: 10px var(--s3); border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th.num, .tbl td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl th.act, .tbl td.act { text-align: right; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .tbl tr.click:hover td { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); } }
.tbl tr.dim td { color: var(--text-3); }
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--line-2); border-bottom: 0; background: var(--surface-2); }
.tbl .cell-t { font-weight: 600; display: block; }
.tbl .cell-s { display: block; color: var(--text-3); font-size: var(--fs-sm); font-weight: 400; }

/* Leerzustand: klein und ruhig */
.empty { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); color: var(--text-2); font-size: var(--fs-ui); }
.empty .ic { font-size: 18px; color: var(--text-3); }
.empty.center { justify-content: center; text-align: center; padding: var(--s6) var(--s4); }
.empty.bare { padding: var(--s2) 0; }
.loading { padding: var(--s5) 0; }
.skel { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite; margin-bottom: var(--s3); }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Menue (Popover am Ausloeser) */
.pop { position: fixed; z-index: 120; min-width: 220px; max-width: calc(100vw - 24px); padding: 6px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-pop); opacity: 0; transform: scale(0.97); transition: opacity 140ms ease, transform 180ms var(--ease-out); }
.pop.in { opacity: 1; transform: none; }
.pop button { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: var(--ctl); padding: 0 var(--s3); border: 0; border-radius: var(--r-sm); background: none; color: var(--ink); font: 500 var(--fs-ui)/1.2 var(--sans); text-align: left; cursor: pointer; }
.pop button .ic { font-size: 16px; color: var(--text-2); vertical-align: 0; }
.pop button:hover, .pop button:focus-visible { background: var(--surface-2); outline: none; }
.pop button.danger, .pop button.danger .ic { color: var(--bad); }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* ═══ Dialoge (Entwurf: max 560, Radius 20, am Handy Blatt mit Radius 22 oben, Fuss auf cream) ═══ */
.ov { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(42, 38, 35, .48); opacity: 0; transition: opacity 200ms ease; }
.ov.in { opacity: 1; }
.dlg { position: relative; display: flex; flex-direction: column; width: 100%; max-height: 92vh; max-height: 92dvh; background: var(--surface); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: var(--shadow-dlg); padding-bottom: var(--safe-b); transform: translateY(100%); transition: transform 340ms var(--ease-drawer); overflow: hidden; }
.ov.in .dlg { transform: none; }
.dlg::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-2); z-index: 1; }
.dlg-h { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); padding: 22px 24px 0; }
.dlg-h h2 { flex: 1; min-width: 0; font: 400 28px/1.15 var(--serif); overflow-wrap: anywhere; }
.dlg-h .dlg-sub { font: 400 14px/1.4 var(--sans); color: var(--text-3); margin-top: 2px; }
.dlg-h .x { flex: none; margin: -2px -8px 0 0; }
.dlg-pre:empty { display: none; }
.dlg-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 18px 24px; }
.dlg-b > .msg + *, .dlg-b > * + .msg { margin-top: var(--s4); }
.dlg-f { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--s2); padding: 14px 24px; background: var(--bg); border-top: 1px solid var(--line); }
.dlg-f .left { margin-right: auto; }
.dlg-f[hidden] { display: none; }
.dlg .guard:empty { display: none; }
.dlg .guard { padding: 0 24px 12px; }
.dlg .guard .row-flex { justify-content: flex-end; margin-top: var(--s2); }
@media (max-width: 767px) {
  .dlg-h { padding: 24px 16px 0; }
  .dlg-h h2 { font-size: 24px; }
  .dlg-b { padding: 16px; }
  .dlg-f { padding: 12px 16px; }
  .dlg-f .btn { flex: 1 1 0; min-width: 0; }
  .dlg-f .btn.left { flex: 0 0 auto; }
  .dlg .guard { padding: 0 16px 12px; }
}
@media (min-width: 768px) {
  .ov { align-items: center; padding: 24px; }
  .dlg { max-width: 560px; border-radius: var(--r-card); padding-bottom: 0; transform: translateY(8px) scale(0.98); opacity: 0; transition: transform 220ms var(--ease-out), opacity 180ms ease; }
  .ov.in .dlg { opacity: 1; }
  .dlg::before { display: none; }
  .dlg.sm { max-width: 440px; }
  .dlg.lg, .dlg.wide { max-width: 880px; }
  .dlg.xl { max-width: 1080px; }
}
/* Schrittanzeige als eigene Leiste unter dem Kopf */
.steps { display: flex; align-items: center; gap: var(--s2); margin: 0 var(--s5); padding: var(--s2) 0 var(--s4); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.steps .st-i { display: inline-flex; align-items: center; gap: var(--s2); flex: none; font: 500 var(--fs-sm)/1 var(--sans); color: var(--text-3); white-space: nowrap; }
.steps .st-i .n { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-2); font: 600 12px/1 var(--sans); color: var(--text-2); background: #fff; }
.steps .st-i .n .ic { font-size: 13px; stroke-width: 3; vertical-align: 0; }
.steps .st-i.on { color: var(--ink); font-weight: 600; }
.steps .st-i.on .n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps .st-i.done .n { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.steps .sep { flex: 1 1 16px; min-width: 12px; height: 1.5px; background: var(--line-2); }
.steps .st-i.done + .sep { background: var(--accent-deep); }
@media (max-width: 639px) {
  .steps { margin: 0 var(--s4); }
  .steps .st-i:not(.on) .t { display: none; }
}

/* ═══ Datenschutz-Hinweis (erster Login, Mein Konto) ═══ */
.pv-intro { margin: 0 0 var(--s45); font-size: var(--fs-md); line-height: 1.5; color: var(--text-2); }
.pv-secs { display: flex; flex-direction: column; gap: var(--s4); }
.pv-sec { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--s3); align-items: start; padding: var(--s4); border-radius: var(--r-lg); background: var(--bg); }
.pv-ic { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent-deep); font-size: 18px; }
.pv-sec h3 { margin: 2px 0 6px; font: 600 var(--fs-md)/1.3 var(--sans); }
.pv-sec ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-body); line-height: 1.45; color: var(--ink); }
.pv-sec li::marker { color: var(--accent-deep); }
.pv-ack { display: flex; align-items: center; gap: var(--s2); margin: var(--s45) 0 0; font-size: var(--fs-ui); color: var(--ok); }
.dlg.pv .dlg-f .btn.primary { min-width: 160px; }

/* ═══ Anmeldung ════════════════════════════════════════════════════ */
.screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--s5) var(--s4); }
.auth { width: 100%; max-width: 400px; }
.auth .logo { display: block; margin: 0 auto var(--s5); width: 112px; }
.auth h1 { text-align: center; margin-bottom: var(--s2); }
.auth .sub { text-align: center; color: var(--text-2); margin-bottom: var(--s5); }
.auth .card { display: flex; flex-direction: column; gap: var(--s4); }

/* ═══ Druckansicht ═════════════════════════════════════════════════ */
.print-page { background: #fff; color: #000; padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-md); }
.print-page h1 { font-size: 26px; }
.print-page .tbl th, .print-page .tbl td { padding: 5px 8px; font-size: 13px; }
.sig { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 48px; font-size: 13px; color: #444; }
.sig div { border-top: 1px solid #555; padding-top: 6px; }
.print-break { break-after: page; page-break-after: always; margin-bottom: 30px; }
@media print {
  body { background: #fff; }
  .side, .top, .tabbar, .no-print, #modals { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; max-width: none; }
  .print-page { border: 0; padding: 0; }
  .print-break:last-child { break-after: auto; }
}
