/* Mappe — Basis: Schriften, Tokens, Grundelemente, Registerreiter (Signature). Siehe DESIGN.md. */

@font-face { font-family: 'Young Serif'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/assets/fonts/young-serif-latin.woff2) format('woff2');
  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: 'Young Serif'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/assets/fonts/young-serif-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Rethink Sans'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/assets/fonts/rethink-sans-latin.woff2) format('woff2');
  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: 'Rethink Sans'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/assets/fonts/rethink-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fragment Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/assets/fonts/fragment-mono-latin.woff2) format('woff2');
  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: 'Fragment Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/assets/fonts/fragment-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* metrisch angeglichene Ausweichschrift — der Font-Tausch erzeugt keinen Sprung (CLS/LCP) */
@font-face { font-family: 'Young Serif Fallback'; src: local('Georgia'), local('Times New Roman'); size-adjust: 112%; ascent-override: 88%; descent-override: 24%; }
@font-face { font-family: 'Rethink Sans Fallback'; src: local('Arial'), local('Helvetica'); size-adjust: 100%; ascent-override: 98%; descent-override: 26%; }

:root {
  --kopie: #f2f3f0; --blatt: #ffffff; --manila: #e8cf8c; --manila-kante: #c9a54a; --manila-ink: #3d3210;
  --graphit: #1e2125; --graphit-2: #555b62; --linie: #d6d8d2; --linie-2: #e6e7e2;
  --deckel: #1d5a43; --deckel-ink: #ffffff; --deckel-hell: #dcebe3; --deckel-druck: #154633;
  --rotstift: #b42318; --rotstift-hell: #fdecea; --textmarker: #fff1a8; --warn: #8a5a00; --warn-hell: #fdf3dc;
  --schatten: 0 1px 2px rgba(30, 33, 37, .06), 0 6px 18px rgba(30, 33, 37, .06);
  --schatten-hoch: 0 2px 4px rgba(30, 33, 37, .08), 0 14px 32px rgba(30, 33, 37, .12);
  --f-display: 'Young Serif', 'Young Serif Fallback', Georgia, serif;
  --f-text: 'Rethink Sans', 'Rethink Sans Fallback', Arial, system-ui, sans-serif;
  --f-mono: 'Fragment Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --r: 6px; --r-gross: 10px;
  --ease: cubic-bezier(.2, .9, .25, 1);
  --breite: 1180px;
  color-scheme: light;
}
[data-theme="dark"] {
  --kopie: #15171a; --blatt: #1f2226; --manila: #3a3222; --manila-kante: #8a7340; --manila-ink: #f1dc9e;
  --graphit: #e9eae6; --graphit-2: #a9aeb4; --linie: #33373c; --linie-2: #2a2e33;
  --deckel: #6fcf9f; --deckel-ink: #0e1a14; --deckel-hell: #1d3a2d; --deckel-druck: #8fe0b6;
  --rotstift: #ff8a7a; --rotstift-hell: #3a1b18; --textmarker: #5a4f14; --warn: #f3c25a; --warn-hell: #3a2f12;
  --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  --schatten-hoch: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 32px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --kopie: #15171a; --blatt: #1f2226; --manila: #3a3222; --manila-kante: #8a7340; --manila-ink: #f1dc9e;
    --graphit: #e9eae6; --graphit-2: #a9aeb4; --linie: #33373c; --linie-2: #2a2e33;
    --deckel: #6fcf9f; --deckel-ink: #0e1a14; --deckel-hell: #1d3a2d; --deckel-druck: #8fe0b6;
    --rotstift: #ff8a7a; --rotstift-hell: #3a1b18; --textmarker: #5a4f14; --warn: #f3c25a; --warn-hell: #3a2f12;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    --schatten-hoch: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 32px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--kopie); color: var(--graphit); font: 400 1rem/1.6 var(--f-text);
  overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.18; overflow-wrap: break-word; }
h1, h2 { font-family: var(--f-display); font-weight: 400; letter-spacing: -.005em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--deckel); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--deckel); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--textmarker); color: var(--graphit); }
code, .mono { font-family: var(--f-mono); font-size: .92em; }
.lead { font-size: 1.08rem; color: var(--graphit-2); max-width: 62ch; }
.klein { font-size: .875rem; }
.leise { color: var(--graphit-2); }
.eyebrow { display: inline-block; font: 400 .75rem/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--graphit-2); margin-bottom: .5rem; }
.wrap { width: min(100% - 2rem, var(--breite)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--blatt); padding: .5rem 1rem; z-index: 100; border-radius: var(--r); }
.skip:focus { left: .5rem; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Knöpfe ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .55rem 1.1rem;
  border: 1.5px solid transparent; border-radius: var(--r); font-weight: 650; font-size: .98rem; line-height: 1.2; text-decoration: none;
  cursor: pointer; transition: transform .12s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease; text-align: center; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn--primaer { background: var(--deckel); color: var(--deckel-ink); }
.btn--primaer:hover { background: var(--deckel-druck); }
.btn--rahmen { background: var(--blatt); border-color: var(--linie); color: var(--graphit); }
.btn--rahmen:hover { border-color: var(--graphit-2); }
.btn--leise { background: transparent; color: var(--deckel); padding-inline: .6rem; }
.btn--leise:hover { background: var(--deckel-hell); }
.btn--gefahr { background: var(--blatt); border-color: var(--rotstift); color: var(--rotstift); }
.btn--gefahr:hover { background: var(--rotstift-hell); }
.btn--klein { min-height: 36px; padding: .35rem .8rem; font-size: .9rem; }
.btn--block { width: 100%; }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.btn.laedt { position: relative; color: transparent !important; pointer-events: none; }
.btn.laedt::after { content: ""; position: absolute; width: 1.1em; height: 1.1em; border-radius: 50%; border: 2px solid currentColor; border-color: var(--deckel-ink) transparent var(--deckel-ink) transparent; animation: dreh .8s linear infinite; }
.btn--rahmen.laedt::after, .btn--leise.laedt::after { border-color: var(--graphit) transparent var(--graphit) transparent; }
@keyframes dreh { to { transform: rotate(360deg); } }

/* ---------- Formulare ---------- */
.field { display: grid; gap: .35rem; margin-bottom: 1rem; min-width: 0; }
.field > label, .label { font-weight: 650; font-size: .93rem; }
.hilfe { font-size: .85rem; color: var(--graphit-2); margin: 0; }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: .6rem .75rem; background: var(--blatt); border: 1.5px solid var(--linie);
  border-radius: var(--r); transition: border-color .15s ease, box-shadow .15s ease; }
.textarea { min-height: 7rem; resize: vertical; line-height: 1.55; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--graphit-2); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--deckel); box-shadow: 0 0 0 3px var(--deckel-hell); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--rotstift); }
.check { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr); gap: .6rem; align-items: start; margin-bottom: .8rem; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; accent-color: var(--deckel); cursor: pointer; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-inline-size: 0; }
legend { font-weight: 650; padding: 0; margin-bottom: .5rem; }
.form-fehler { display: flex; gap: .5rem; align-items: flex-start; padding: .7rem .9rem; border-radius: var(--r); background: var(--rotstift-hell); color: var(--rotstift); font-weight: 600; }
.form-fehler::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 2px solid currentColor; font-size: .8rem; line-height: 1; }
.form-ok { padding: .7rem .9rem; border-radius: var(--r); background: var(--deckel-hell); color: var(--graphit); }
.pw-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }

/* ---------- Blätter (Karten) ---------- */
.blatt { background: var(--blatt); border: 1px solid var(--linie-2); border-radius: var(--r); box-shadow: var(--schatten); padding: clamp(1rem, .6rem + 1.5vw, 1.6rem); min-width: 0; }
.blatt > :last-child { margin-bottom: 0; }

/* ---------- Registerreiter (Signature) ---------- */
.reiter-leiste { display: flex; gap: .3rem; align-items: flex-end; padding-left: .75rem; overflow-x: auto; scrollbar-width: none; position: relative; z-index: 1; }
.reiter-leiste::-webkit-scrollbar { display: none; }
.reiter { position: relative; flex: none; display: inline-flex; align-items: center; gap: .45rem; min-height: 42px; padding: .5rem 1rem .55rem;
  background: var(--manila); color: var(--manila-ink); border: 1px solid var(--manila-kante); border-bottom: 0; border-radius: 9px 9px 0 0;
  font: 650 .92rem/1.2 var(--f-text); cursor: pointer; text-decoration: none; transform: translateY(4px);
  transition: transform .2s var(--ease), background-color .2s ease; }
.reiter:hover { transform: translateY(1px); }
.reiter[aria-selected="true"], .reiter[aria-current="page"] { background: var(--blatt); color: var(--graphit); border-color: var(--linie); transform: translateY(1px); z-index: 2; }
.reiter[aria-selected="true"]::after, .reiter[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; background: var(--blatt); }
.reiter .mono { font-size: .72rem; opacity: .75; }
.reiter { white-space: nowrap; }
.reiter .ico { width: 18px; height: 18px; flex: none; }
.reiter-blatt { background: var(--blatt); border: 1px solid var(--linie); border-radius: 0 var(--r) var(--r) var(--r); box-shadow: var(--schatten); padding: clamp(1rem, .6rem + 1.5vw, 1.6rem); min-width: 0; position: relative; }

/* ---------- Statusmarken (Form + Wort) ---------- */
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .18rem .6rem; border-radius: 99px; font-size: .8rem; font-weight: 650; border: 1px solid var(--linie); background: var(--blatt); white-space: nowrap; }
.chip-form { width: .55rem; height: .55rem; border-radius: 50%; background: var(--graphit-2); }
.chip--ok .chip-form { background: var(--deckel); }
.chip--laeuft .chip-form { background: var(--manila-kante); animation: puls 1.2s ease-in-out infinite; }
.chip--fehler { color: var(--rotstift); border-color: var(--rotstift); }
.chip--fehler .chip-form { background: var(--rotstift); border-radius: 1px; transform: rotate(45deg); }
@keyframes puls { 50% { opacity: .35; } }

/* ---------- Sprachumschalter + Thema ---------- */
.sprache { display: inline-flex; border: 1px solid var(--linie); border-radius: 99px; overflow: hidden; background: var(--blatt); }
.sprache button { min-width: 40px; min-height: 36px; padding: 0 .55rem; border: 0; background: transparent; font: 400 .78rem var(--f-mono); letter-spacing: .05em; cursor: pointer; color: var(--graphit-2); }
.sprache button[aria-pressed="true"] { background: var(--graphit); color: var(--blatt); }
.thema-knopf { min-width: 40px; min-height: 36px; border: 1px solid var(--linie); border-radius: 99px; background: var(--blatt); cursor: pointer; display: inline-grid; place-items: center; }
.thema-knopf svg { width: 18px; height: 18px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: .5rem; width: min(100% - 2rem, 440px); pointer-events: none; }
.toast { background: var(--graphit); color: var(--blatt); padding: .75rem 1rem; border-radius: var(--r); box-shadow: var(--schatten-hoch); font-weight: 550; pointer-events: auto; animation: einlegen .32s var(--ease); }
.toast--fehler { background: var(--rotstift); color: #fff; }
[data-theme="dark"] .toast--fehler { color: #1b0805; }

/* ---------- Eintritt „Blatt wird eingelegt“ ---------- */
@keyframes einlegen { from { opacity: 0; transform: translateY(10px) rotate(-.6deg); } }
.einlegen { animation: einlegen .32s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }

/* ---------- Rechtstexte / einfache Seiten ---------- */
.recht { max-width: 72ch; padding-block: 2.5rem 4rem; }
.recht h2 { margin-top: 2rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
