/* Zuschnitt-App: Grundlagen, Rahmen, Bausteine. Seitenbezogenes steht in seiten.css. */
@font-face { font-family: "Archivo"; src: url(/fonts/archivo-latin.woff2) format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo"; src: url(/fonts/archivo-latin-ext.woff2) format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/plexmono-400-latin.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/plexmono-500-latin.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --papier: #f2eee4; --papier-2: #e8e2d4; --flaeche: #f8f5ee;
  --tinte: #16150f; --tinte-2: #3c3a33; --grau: #6b675c; --linie: #d6cfbf; --linie-2: #bdb5a3;
  --matte: #24493a; --matte-2: #1c3a2e; --signal: #e5481f; --signal-text: #b5350e; --gelb: #f1d36b;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); --ease-io: cubic-bezier(0.77, 0, 0.175, 1); --ease-schub: cubic-bezier(0.32, 0.72, 0, 1);
  --rand: clamp(16px, 3.4vw, 40px);
  --unten: calc(64px + env(safe-area-inset-bottom)); /* Höhe der Leiste unten auf dem Handy */
  --mono: "Plex Mono", ui-monospace, "SF Mono", monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--papier); color: var(--tinte); font: 400 16px/1.5 "Archivo", system-ui, sans-serif; font-stretch: 100%; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 800; font-stretch: 72%; line-height: 1; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; overflow-wrap: break-word; }
a { color: inherit; text-underline-offset: 3px; }
img { max-width: 100%; }
code { font: 400 0.9em var(--mono); background: var(--papier-2); padding: 1px 5px; border-radius: 3px; overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
.zahl { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.tc { font: 500 12px/1.3 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
.unsichtbar { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.springen { position: absolute; left: 12px; top: -60px; z-index: 90; padding: 10px 14px; background: var(--tinte); color: var(--papier); border-radius: 6px; }
.springen:focus { top: 12px; }
.laden { padding: 48px var(--rand); color: var(--grau); }
.hinweis { font-size: 14px; line-height: 1.45; color: var(--grau); }
.hinweis a { color: var(--tinte); font-weight: 600; }
.hinweis.warnung { color: var(--signal-text); font-weight: 600; }
.unter { margin-top: 12px; max-width: 580px; color: var(--tinte-2); font-size: 17px; }
.legende { font-weight: 700; font-size: 15px; }

/* Marke */
.marke { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-stretch: 80%; font-size: 22px; letter-spacing: -0.02em; }
.marke-zeichen { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; }
.marke-zeichen rect { fill: var(--signal); stroke: none; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 6px; background: var(--signal); color: #fff; font: 700 16px/1 "Archivo", sans-serif; font-stretch: 90%;
  text-decoration: none; cursor: pointer; white-space: nowrap; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}
.knopf:active:not(:disabled) { transform: scale(0.97); }
.knopf .ic { width: 18px; height: 18px; stroke-width: 2.2; margin-left: -2px; }
@media (hover: hover) and (pointer: fine) { .knopf:hover { background: #cf3c15; } }
.knopf-klein { min-height: 44px; padding: 0 14px; font-size: 15px; }
.knopf-rand { background: transparent; color: var(--tinte); box-shadow: inset 0 0 0 1.5px var(--tinte); }
@media (hover: hover) and (pointer: fine) { .knopf-rand:hover { background: var(--tinte); color: var(--papier); } }
.knopf-gefahr { background: var(--signal-text); }
.knopf-dunkel { background: var(--tinte); color: var(--papier); }
@media (hover: hover) and (pointer: fine) { .knopf-dunkel:hover { background: #34312a; } }
@media (hover: hover) and (pointer: fine) { .knopf-gefahr:hover { background: #8f2909; } }
.knopf-text { background: transparent; color: var(--tinte); padding: 0 10px; text-decoration: underline; text-decoration-color: var(--linie-2); }
@media (hover: hover) and (pointer: fine) { .knopf-text:hover { background: var(--papier-2); text-decoration-color: currentColor; } }
.knopf-text.gefahr { color: var(--signal-text); }
.knopf.breit { width: 100%; }
.knopf:disabled, .knopf[aria-disabled="true"] { cursor: default; opacity: 0.45; }
.knopf.laedt { opacity: 0.7; cursor: progress; }
.knopf.laedt::after { content: ""; width: 14px; height: 14px; margin-left: 2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: drehen 600ms linear infinite; }
@keyframes drehen { to { transform: rotate(1turn); } }
.knopf-symbol { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer; transition: background-color 160ms ease, transform 160ms var(--ease-out); }
.knopf-symbol:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .knopf-symbol:hover { background: var(--papier-2); } }
.knopf-mini { min-width: 44px; height: 44px; padding: 0 8px; border: 1px solid var(--linie-2); border-radius: 6px; background: var(--flaeche); font-size: 14px; cursor: pointer; transition: transform 120ms var(--ease-out), background-color 120ms ease; }
.knopf-mini:active:not(:disabled) { transform: scale(0.94); background: var(--papier-2); }
.knopf-mini:disabled { opacity: 0.35; cursor: default; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.zurueck { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -8px 0 4px -6px; padding: 0 8px 0 2px; border-radius: 6px; color: var(--grau); text-decoration: none; font-weight: 600; font-size: 15px; }
.zurueck .ic { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .zurueck:hover { color: var(--tinte); } }

/* ---------- Rahmen: Handy zuerst ---------- */
.schale { min-height: 100dvh; display: grid; grid-template: "oben" auto "balken" auto "inhalt" 1fr / minmax(0, 1fr); padding-bottom: var(--unten); }
.balken-ort { grid-area: balken; min-width: 0; }
.bestaetigen { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin: 12px var(--rand) 0; padding: 8px 8px 8px 14px; border-radius: 8px; background: #f6ecc4; font-size: 14.5px; }
.bestaetigen p { flex: 1 1 260px; }
.bestaetigen .knopf-text { min-height: 40px; font-size: 14.5px; }
.bestaetigen .knopf-text:disabled { text-decoration: none; color: var(--grau); cursor: default; opacity: 1; }
.oben { grid-area: oben; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: max(8px, env(safe-area-inset-top)) var(--rand) 8px; background: var(--papier); border-bottom: 1px solid var(--linie); }
.inhalt { grid-area: inhalt; width: 100%; max-width: 1280px; padding: clamp(20px, 4vw, 44px) var(--rand) 72px; }
.leiste { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding-bottom: env(safe-area-inset-bottom); background: var(--papier); border-top: 1px solid var(--linie); }
.leiste > .marke, .leiste-fuss { display: none; }
.navi { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.navi a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 64px; color: var(--grau); text-decoration: none; font-size: 11.5px; font-weight: 600; -webkit-tap-highlight-color: transparent; transition: color 140ms ease; }
.navi a .ic { width: 23px; height: 23px; }
.navi a[aria-current] { color: var(--tinte); }
.navi a[aria-current]::before { content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 3px; border-radius: 0 0 2px 2px; background: var(--signal); }
.nur-breit { display: none; }

@media (min-width: 900px) {
  .schale { grid-template: "leiste oben" auto "leiste balken" auto "leiste inhalt" 1fr / 236px minmax(0, 1fr); padding-bottom: 0; }
  .bestaetigen { max-width: calc(1280px - 2 * var(--rand)); margin-top: 0; margin-bottom: 20px; }
  .leiste { grid-area: leiste; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 22px 14px 20px; border-top: 0; border-right: 1px solid var(--linie); }
  .leiste > .marke { display: inline-flex; align-self: flex-start; margin: 0 0 30px 10px; }
  .navi { display: flex; flex-direction: column; gap: 2px; }
  .navi a { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 6px; font-size: 16px; font-weight: 600; color: var(--tinte-2); }
  .navi a .ic { width: 21px; height: 21px; }
  .navi a[aria-current] { background: var(--tinte); color: var(--papier); }
  .navi a[aria-current]::before { top: 50%; left: auto; right: 12px; width: 6px; height: 6px; border-radius: 1px; transform: translateY(-50%); }
  @media (hover: hover) { .navi a:not([aria-current]):hover { background: var(--papier-2); color: var(--tinte); } }
  .leiste-fuss { display: grid; gap: 4px; margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--linie); font-size: 14px; color: var(--grau); }
  .leiste-fuss b { color: var(--tinte); }
  .leiste-fuss a { color: var(--signal-text); font-weight: 600; text-decoration: none; }
  .leiste-fuss a:hover { text-decoration: underline; }
  .oben { position: static; justify-content: flex-end; min-height: 72px; padding-top: 16px; border-bottom: 0; background: transparent; }
  .inhalt { padding-top: 8px; }
  .nur-handy { display: none !important; }
  .nur-breit { display: inline; }
}

/* Verbrauch oben rechts: wie ein Lineal mit zehn Teilen */
.zaehler { display: grid; grid-template-columns: auto auto; grid-template-areas: "text plan" "spur spur"; align-items: baseline; gap: 6px 14px; min-width: 168px; min-height: 44px; align-content: center; text-decoration: none; border-radius: 6px; }
.zaehler-text { grid-area: text; display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--grau); white-space: nowrap; }
.zaehler-text b { color: var(--tinte); font-size: 13px; }
.zaehler-plan { grid-area: plan; justify-self: end; font-weight: 700; font-size: 13px; font-stretch: 90%; }
.zaehler-spur { grid-area: spur; position: relative; height: 5px; overflow: hidden; border-radius: 1px; background: var(--linie); }
.zaehler-spur i { position: absolute; inset: 0; background: var(--tinte); transform-origin: left; transition: transform 500ms var(--ease-out); }
.zaehler-spur::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1.5px), var(--papier) calc(10% - 1.5px) 10%); }
.zaehler.knapp .zaehler-spur i { background: var(--signal); }
@media (hover: hover) and (pointer: fine) { .zaehler:hover .zaehler-plan { text-decoration: underline; } }
@media (min-width: 900px) { .zaehler { min-width: 300px; } .zaehler-text, .zaehler-text b, .zaehler-plan { font-size: 14px; } }

/* Kopf einer Seite */
.kopfzeile { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: clamp(24px, 4vw, 40px); }
.kopfzeile > div:first-child { min-width: 0; flex: 1 1 340px; }
.kopfzeile h1 { font-size: clamp(42px, 6.2vw, 68px); overflow-wrap: break-word; }
.kopfzeile .anzahl { margin-left: 4px; font-size: 18px; color: var(--grau); vertical-align: top; letter-spacing: 0; }
.kopf-rechts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.limit { font-size: 14px; color: var(--grau); }

/* ---------- Formulare ---------- */
.feld { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.feld > label, .feld-kopf label { font-weight: 600; font-size: 15px; }
.feld-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.feld-kopf a { font-size: 14px; color: var(--grau); }
.feld-eingabe { width: 100%; min-height: 50px; padding: 0 14px; border: 1.5px solid var(--tinte); border-radius: 6px; background: #fff; font-size: 16px; transition: border-color 140ms ease, box-shadow 140ms ease; }
.feld-eingabe:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px rgba(229, 72, 31, 0.18); }
.feld-eingabe:disabled { background: var(--papier-2); border-color: var(--linie-2); color: var(--grau); }
.feld-eingabe[aria-invalid="true"] { border-color: var(--signal-text); }
.feld-eingabe.kurz { width: 5.5em; min-height: 44px; text-align: center; padding: 0 6px; }
select.feld-eingabe { appearance: none; padding-right: 40px; background: linear-gradient(45deg, transparent 50%, var(--tinte) 50%) calc(100% - 20px) 50% / 5px 5px no-repeat, linear-gradient(135deg, var(--tinte) 50%, transparent 50%) calc(100% - 15px) 50% / 5px 5px no-repeat #fff; }
.form-fehler { padding: 12px 14px; border-radius: 6px; background: #f7dfd5; color: #7a2409; font-weight: 600; font-size: 15px; }
.satz-feld { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.haken-feld { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--linie); border-radius: 8px; background: var(--flaeche); cursor: pointer; font-size: 15px; }
.haken-feld input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--tinte); }
.haken-feld:has(input:checked) { border-color: var(--tinte); }

/* Chips (mehrere wählbar) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--linie-2); border-radius: 6px; font-weight: 600; font-size: 14.5px; cursor: pointer; user-select: none; transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms var(--ease-out); }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip:active { transform: scale(0.97); }
.chip:has(input:checked) { background: var(--tinte); border-color: var(--tinte); color: var(--papier); }
.chip:has(input:focus-visible), .wahl-karte:has(input:focus-visible), .segment label:has(input:focus-visible), .farbe-feld:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .chip:not(:has(:checked)):hover { border-color: var(--tinte); } }

/* Segment (genau eins) */
.segment { display: inline-flex; flex-wrap: wrap; max-width: 100%; padding: 4px; border-radius: 8px; background: var(--papier-2); gap: 2px; }
.segment label { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 6px; font-weight: 600; font-size: 15px; color: var(--grau); cursor: pointer; transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease; }
.segment input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segment label:has(input:checked) { background: #fff; color: var(--tinte); box-shadow: 0 1px 0 rgba(22, 21, 15, 0.08), 0 0 0 1px rgba(22, 21, 15, 0.06); }

/* Wahlkarten (genau eins, mit Erklärung) */
.wahl { display: grid; gap: 8px; }
.wahl-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wahl-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.wahl-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1100px) { .wahl-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.wahl-karte { position: relative; display: grid; align-content: start; gap: 2px; min-height: 64px; padding: 12px 14px; border: 1.5px solid var(--linie); border-radius: 8px; background: var(--flaeche); cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease, transform 150ms var(--ease-out); }
.wahl-karte:active { transform: scale(0.98); }
.wahl-karte input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.wahl-karte b { font-weight: 750; font-stretch: 85%; font-size: 17px; line-height: 1.15; }
.wahl-karte span { font-size: 13px; color: var(--grau); line-height: 1.35; }
.wahl-karte:has(input:checked) { border-color: var(--tinte); background: #fff; box-shadow: inset 0 0 0 1px var(--tinte); }
.wahl-karte:has(input:checked)::after { content: ""; position: absolute; top: 11px; right: 11px; width: 8px; height: 8px; border-radius: 1px; background: var(--signal); }
@media (hover: hover) and (pointer: fine) { .wahl-karte:not(:has(:checked)):hover { border-color: var(--linie-2); } }

/* Schalter */
.schalter { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-size: 15px; font-weight: 500; }
.schalter input { position: relative; flex: none; width: 44px; height: 26px; margin: 0; border-radius: 13px; background: #c6bea9; appearance: none; cursor: pointer; transition: background-color 180ms ease; }
.schalter input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(22, 21, 15, 0.25); transition: transform 220ms var(--ease-out); }
.schalter input:checked { background: var(--tinte); }
.schalter input:checked::after { transform: translateX(18px); }

/* Schieberegler */
.regler { display: flex; align-items: center; gap: 16px; max-width: 460px; transition: opacity 150ms ease; }
.regler[data-aus] { opacity: 0.4; }
.regler input { flex: 1; min-width: 0; height: 44px; margin: 0; background: transparent; appearance: none; cursor: pointer; --p: 21%; }
.regler input:disabled { cursor: default; }
.regler input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(var(--tinte), var(--tinte)) 0 0 / var(--p) 100% no-repeat, var(--linie-2); }
.regler input::-moz-range-track { height: 4px; border-radius: 2px; background: var(--linie-2); }
.regler input::-moz-range-progress { height: 4px; background: var(--tinte); }
.regler input::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -10px; border: 2px solid var(--tinte); border-radius: 50%; background: var(--papier); appearance: none; transition: transform 150ms var(--ease-out); }
.regler input::-moz-range-thumb { width: 20px; height: 20px; border: 2px solid var(--tinte); border-radius: 50%; background: var(--papier); }
.regler input:active::-webkit-slider-thumb { transform: scale(1.12); }
.regler output { min-width: 3.4ch; font-size: 22px; text-align: right; }

/* Hinweis-Kasten */
.hinweis-box { padding: 14px 16px; border-radius: 8px; background: var(--papier-2); color: var(--tinte-2); font-size: 15px; margin-bottom: 20px; }
.hinweis-box a { color: var(--tinte); font-weight: 700; }
.hinweis-box.fehler { background: #f7dfd5; color: #7a2409; }
.hinweis-box h2 { font-size: 26px; margin-bottom: 8px; color: var(--tinte); }
.hinweis-box > * + * { margin-top: 8px; }
.hinweis-box .knopf { margin-top: 14px; }

/* Fortschritt */
.balken { position: relative; height: 6px; overflow: hidden; border-radius: 3px; background: var(--linie); }
.balken i { position: absolute; inset: 0; background: var(--signal); transform-origin: left; transform: scaleX(0); transition: transform 700ms var(--ease-out); }
.balken.gross { height: 10px; border-radius: 2px; }
.balken.gross i { background: var(--tinte); }
.balken.gross.knapp i { background: var(--signal); }
.balken.gross::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), var(--papier) calc(10% - 2px) 10%); }
.status { display: grid; gap: 8px; }
.status-text { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; min-width: 0; }
.status-text > span:not(.punkt) { min-width: 0; }
.status-text b { margin-left: auto; font-size: 13px; }
.status-text .ic { width: 17px; height: 17px; stroke-width: 2.4; color: var(--matte); }
.punkt { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gelb); }
[data-status="laeuft"] .punkt { background: var(--signal); animation: blinken 1s steps(2, jump-none) infinite; }
[data-status="wartet"] .punkt { background: #a59d8a; }
[data-status="wartet"] .status-text { color: var(--grau); font-weight: 500; }
[data-status="fehler"] .status-text { color: var(--signal-text); font-weight: 600; }
[data-status="fehler"] .punkt { background: var(--signal-text); border-radius: 1px; }
@keyframes blinken { 50% { opacity: 0.25; } }

/* Leerzustand */
.leer { display: grid; justify-items: start; gap: 14px; max-width: 560px; padding: 24px 0; }
.leer h1, .leer h2 { font-size: clamp(34px, 5vw, 48px); }
.leer p { color: var(--tinte-2); }
.leer-gross { justify-items: center; text-align: center; margin: 0 auto; padding: clamp(28px, 6vw, 64px) 0; }
.leer-gross .knoepfe { justify-content: center; margin-top: 6px; }

/* Dialog und Schublade */
dialog { color: var(--tinte); }
dialog::backdrop { background: rgba(22, 21, 15, 0.5); transition: opacity 200ms ease, display 200ms allow-discrete, overlay 200ms allow-discrete; opacity: 0; }
dialog[open]::backdrop { opacity: 1; }
@starting-style { dialog[open]::backdrop { opacity: 0; } }
.dialog { width: min(440px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: 12px; background: var(--papier); box-shadow: 0 24px 60px -20px rgba(22, 21, 15, 0.5); opacity: 0; transform: scale(0.96); transition: opacity 180ms ease, transform 220ms var(--ease-out), display 220ms allow-discrete, overlay 220ms allow-discrete; }
.dialog[open] { opacity: 1; transform: none; }
@starting-style { .dialog[open] { opacity: 0; transform: scale(0.96); } }
.dialog h2 { font-size: 30px; margin-bottom: 10px; }
.dialog p { color: var(--tinte-2); }
.dialog-knoepfe { display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.schublade { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 100%; max-height: 92dvh; margin: 0; padding: 0; border: 0; border-radius: 14px 14px 0 0; background: var(--papier); display: flex; flex-direction: column; box-shadow: 0 -20px 60px -24px rgba(22, 21, 15, 0.5); transform: translateY(100%); transition: transform 320ms var(--ease-schub), display 320ms allow-discrete, overlay 320ms allow-discrete; }
.schublade:not([open]) { display: none; }
.schublade[open] { transform: none; }
@starting-style { .schublade[open] { transform: translateY(100%); } }
.schublade-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 12px 12px var(--rand); border-bottom: 1px solid var(--linie); }
.schublade-kopf h2 { font-size: 28px; }
.schublade-inhalt { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 20px var(--rand) 28px; }
.schublade-fuss { display: flex; justify-content: flex-end; flex-wrap: wrap-reverse; gap: 8px; padding: 12px var(--rand) max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--linie); background: var(--papier); }
@media (min-width: 760px) {
  .schublade { inset: 0 0 0 auto; width: min(540px, 100vw); height: 100dvh; max-height: 100dvh; border-radius: 0; transform: translateX(100%); box-shadow: -20px 0 60px -24px rgba(22, 21, 15, 0.5); }
  @starting-style { .schublade[open] { transform: translateX(100%); } }
}

/* Meldungen */
.toasts { position: fixed; z-index: 80; left: 50%; bottom: calc(var(--unten) + 12px); display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); transform: translateX(-50%); pointer-events: none; }
/* Mittig über dem Inhalt, damit Meldungen nie den Knopf unten rechts verdecken */
@media (min-width: 900px) { .toasts { bottom: 96px; left: calc(50% + 118px); } }
.toast { padding: 14px 16px; border-radius: 8px; background: var(--tinte); color: var(--papier); font-size: 15px; box-shadow: 0 10px 30px -12px rgba(22, 21, 15, 0.6); pointer-events: auto; cursor: pointer; transition: opacity 200ms ease, transform 260ms var(--ease-out); }
@starting-style { .toast { opacity: 0; transform: translateY(12px); } }
.toast.geht { opacity: 0; transform: translateY(6px); }
.toast[data-art="fehler"] { background: var(--signal-text); color: #fff; }
.toast[data-art="gut"]::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 1px; background: var(--gelb); vertical-align: 1px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  /* Bewegung raus, Überblendungen bleiben: Fortschritt springt, Schubladen erscheinen ohne Fahrt */
  .schublade, .dialog, .toast { transition-property: opacity, display, overlay !important; }
  .knopf, .chip, .wahl-karte, .knopf-mini, .knopf-symbol { transform: none !important; }
  .balken i, .zaehler-spur i, .spur-kopf, .schalter input::after { transition: none !important; }
}
html:has(dialog[open]) { overflow: hidden; }
.feld > .segment { justify-self: start; }
fieldset.feld > legend { padding: 0; margin-bottom: 8px; }
/* Handy: Kopf oben und Leisten unten kleben, Fokus soll nicht darunter verschwinden */
@media (max-width: 899px) { html { scroll-padding: 72px 0 calc(var(--unten) + 84px); } }
