/* FEDER — Grundsystem „Korrekturfahne“
   Welt: Lektorat. Kühles Fahnenpapier, violett-schwarze Satztinte, Kopierstift-Violett als Marke.
   Rot und Grün sind reserviert: Rot = KI-typische Stelle, Grün = Ersatzvorschlag. Nie als Deko. */
@font-face { font-family: 'Instrument Serif'; src: url('../fonts/instrument-serif.woff2') format('woff2'); font-weight: 400; font-style: normal; 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: 'Instrument Serif'; src: url('../fonts/instrument-serif-ext.woff2') format('woff2'); font-weight: 400; font-style: normal; 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: 'Instrument Serif'; src: url('../fonts/instrument-serif-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; 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: 'Instrument Serif'; src: url('../fonts/instrument-serif-italic-ext.woff2') format('woff2'); font-weight: 400; font-style: italic; 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: 'Manrope'; src: url('../fonts/manrope.woff2') format('woff2'); font-weight: 200 800; 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: 'Manrope'; src: url('../fonts/manrope-ext.woff2') format('woff2'); font-weight: 200 800; 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: 'Sometype Mono'; src: url('../fonts/sometype-mono.woff2') format('woff2'); font-weight: 400 700; 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: 'Sometype Mono'; src: url('../fonts/sometype-mono-ext.woff2') format('woff2'); font-weight: 400 700; 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; }
/* metrisch angeglichene Fallbacks gegen Layoutsprung */
@font-face { font-family: 'Manrope Fallback'; src: local('Arial'); size-adjust: 103%; ascent-override: 100%; descent-override: 28%; }
@font-face { font-family: 'Instrument Fallback'; src: local('Times New Roman'); size-adjust: 92%; ascent-override: 98%; descent-override: 26%; }

:root {
  color-scheme: light;
  --fahne: #f3f4f7;        /* Seitengrund: kühles Fahnenpapier */
  --bogen: #ffffff;        /* Karten, Editor */
  --bogen-2: #eceef3;      /* eingelassene Flächen */
  --satz: #16152b;         /* Satztinte (Haupttext) */
  --satz-2: #34334d;
  --graphit: #5b5a70;      /* gedämpfter Text, AA auf --fahne und --bogen */
  --linie: rgba(22, 21, 43, .11);
  --linie-stark: rgba(22, 21, 43, .24);
  --kopierstift: #5232d0;  /* Marke, Aktion, Fokus */
  --kopierstift-tief: #3d22a8;
  --kopierstift-hauch: #eeeafd;
  --knopf-text: #ffffff;
  /* reserviert */
  --rot: #b8231a;          /* Text/Kontur KI-typische Stelle */
  --rot-flaeche: #fde4e0;
  --rot-linie: #e0493e;
  --gruen: #0c7149;        /* Text/Kontur Vorschlag */
  --gruen-flaeche: #d7f2e4;
  --gruen-linie: #1f9d68;
  --warn: #8a5a00;
  --warn-flaeche: #fbf0d6;
  --schatten: 0 1px 2px rgba(22, 21, 43, .06), 0 8px 24px -12px rgba(22, 21, 43, .18);
  --schatten-hoch: 0 2px 6px rgba(22, 21, 43, .08), 0 24px 48px -20px rgba(22, 21, 43, .35);

  --ff-display: 'Instrument Serif', 'Instrument Fallback', Georgia, serif;
  --ff-body: 'Manrope', 'Manrope Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ff-mono: 'Sometype Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --r-s: 6px; --r: 10px; --r-l: 16px;
  --maxw: 1160px;
  --ease: cubic-bezier(.2, .8, .25, 1);
  --ease-feder: cubic-bezier(.65, 0, .35, 1);   /* Federstrich: ruhig an, ruhig aus */
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fahne: #100f1d; --bogen: #191829; --bogen-2: #13121f;
  --satz: #ecebf6; --satz-2: #cfcde2; --graphit: #a4a3bb;
  --linie: rgba(236, 235, 246, .10); --linie-stark: rgba(236, 235, 246, .24);
  --kopierstift: #a892ff; --kopierstift-tief: #c4b6ff; --kopierstift-hauch: rgba(168, 146, 255, .14); --knopf-text: #120f24;
  --rot: #ff9d93; --rot-flaeche: rgba(224, 73, 62, .22); --rot-linie: #ff7b70;
  --gruen: #84e3b5; --gruen-flaeche: rgba(31, 157, 104, .22); --gruen-linie: #4fd39a;
  --warn: #f0c060; --warn-flaeche: rgba(240, 192, 96, .14);
  --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --schatten-hoch: 0 2px 6px rgba(0, 0, 0, .35), 0 24px 48px -20px rgba(0, 0, 0, .8);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; background: var(--fahne); color: var(--satz);
  font: 400 16px/1.6 var(--ff-body); overflow-wrap: break-word; -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--kopierstift); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--kopierstift-tief); }
h1, h2, h3 { font-family: var(--ff-display); font-weight: 400; line-height: 1.05; letter-spacing: -.01em; margin: 0 0 .45em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h3 { font-size: 1.45rem; }
h1 em, h2 em { font-style: italic; color: var(--kopierstift); }
h4 { font: 700 1rem/1.3 var(--ff-body); margin: 0 0 .4em; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--ff-mono); font-size: .9em; }
.etikett { font: 500 12px/1.2 var(--ff-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--graphit); margin: 0 0 10px; }
:focus-visible { outline: 2px solid var(--kopierstift); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--kopierstift-hauch); color: var(--satz); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--kopierstift); color: var(--knopf-text); padding: 10px 14px; border-radius: 8px; z-index: 100; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 0 18px; border-radius: var(--r); border: 1px solid var(--linie-stark);
  background: var(--bogen); color: var(--satz); font: 600 15px/1 var(--ff-body); text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), background-color .2s, border-color .2s, color .2s; white-space: nowrap;
}
.btn:hover { border-color: var(--satz); color: var(--satz); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn--primaer { background: var(--kopierstift); border-color: var(--kopierstift); color: var(--knopf-text); }
.btn--primaer:hover { background: var(--kopierstift-tief); border-color: var(--kopierstift-tief); color: var(--knopf-text); }
.btn--leise { background: transparent; border-color: transparent; color: var(--graphit); }
.btn--leise:hover { background: var(--bogen-2); color: var(--satz); border-color: transparent; }
.btn--gefahr { color: var(--rot); border-color: var(--rot-linie); background: var(--bogen); }
.btn--gefahr:hover { background: var(--rot-flaeche); color: var(--rot); border-color: var(--rot-linie); }
.btn--klein { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* Formulare */
.feld { display: grid; gap: 6px; margin-bottom: 16px; }
.feld label, .feld .label { font-weight: 600; font-size: 14px; }
.feld .hilfe { font-size: 13px; color: var(--graphit); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--linie-stark);
  background: var(--bogen); color: var(--satz); font: 400 16px/1.4 var(--ff-body);
  transition: border-color .15s, box-shadow .15s;
}
textarea { line-height: 1.65; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--kopierstift); box-shadow: 0 0 0 3px var(--kopierstift-hauch); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; margin-bottom: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--kopierstift); }
.fehler { color: var(--rot); background: var(--rot-flaeche); border-radius: var(--r-s); padding: 10px 12px; font-size: 14px; margin: 12px 0 0; }
.ok { color: var(--gruen); background: var(--gruen-flaeche); border-radius: var(--r-s); padding: 10px 12px; font-size: 14px; margin: 12px 0 0; }
.hinweis { color: var(--graphit); font-size: 14px; }

/* Kopf (öffentliche Seiten) — Auto-Hide beim Runterscrollen */
.kopf {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px); background: color-mix(in srgb, var(--fahne) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent;
  transition: transform .3s var(--ease), border-color .2s;
}
.kopf.gescrollt { border-bottom-color: var(--linie); }
.kopf.weg { transform: translateY(-100%); }
.kopf nav { display: flex; align-items: center; gap: 6px; }
.kopf .nav { color: var(--satz-2); text-decoration: none; font-weight: 600; font-size: 15px; padding: 10px 12px; border-radius: 8px; }
.kopf .nav:hover { background: var(--bogen-2); color: var(--satz); }
.marke { display: inline-flex; align-items: center; gap: 10px; color: var(--satz); text-decoration: none; font: 400 26px/1 var(--ff-display); letter-spacing: .01em; }
.marke:hover { color: var(--satz); }
.marke svg { width: 30px; height: 30px; }

/* Fuß */
.fuss { border-top: 1px solid var(--linie); margin-top: 64px; padding: 36px clamp(16px, 4vw, 40px) 48px; color: var(--graphit); font-size: 14px; }
.fuss-innen { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.fuss-innen > div { max-width: 520px; }
.fuss nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.fuss nav a { color: var(--satz-2); text-decoration: none; padding: 6px 0; }
.fuss nav a:hover { color: var(--kopierstift); }
.fuss .disclaimer { margin: 10px 0 0; }

/* Auth-Seiten */
.auth { min-height: calc(100svh - 220px); display: grid; place-items: center; padding: 40px 16px; }
.panel { background: var(--bogen); border: 1px solid var(--linie); border-radius: var(--r-l); box-shadow: var(--schatten); }
.auth-karte { width: min(440px, 100%); padding: clamp(24px, 5vw, 36px); }
.auth-karte h1 { font-size: clamp(2.2rem, 6vw, 2.8rem); }

/* Rechtstexte */
.recht { max-width: 760px; margin: 0 auto; padding: 48px clamp(16px, 4vw, 24px) 24px; }
.recht h1 { font-size: clamp(2.4rem, 6vw, 3.4rem); }
.recht h2 { font-size: 1.7rem; margin-top: 1.6em; }
.recht p, .recht li { color: var(--satz-2); }

/* Markierungen (überall gleich: Editor, Demo, Mappe) */
.mk {
  position: relative; display: inline; padding: 1px 2px; margin: 0 -1px; border: 0; border-radius: 4px; font: inherit; color: inherit; cursor: pointer;
  background: var(--rot-flaeche); box-shadow: inset 0 -2px 0 var(--rot-linie); transition: background-color .15s, box-shadow .15s;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; text-align: inherit;
}
.mk:hover, .mk[aria-expanded="true"] { box-shadow: inset 0 -2px 0 var(--rot-linie), 0 0 0 2px var(--rot-linie); }
.mk--leise { background: transparent; box-shadow: inset 0 -2px 0 var(--rot-linie); }
.vs {
  display: inline-flex; align-items: center; min-height: 40px; padding: 6px 12px; border-radius: 8px; cursor: pointer; text-align: left;
  border: 1px solid var(--gruen-linie); background: var(--gruen-flaeche); color: var(--satz); font: 500 15px/1.35 var(--ff-body);
  transition: transform .12s var(--ease), box-shadow .15s;
}
.vs:hover { box-shadow: 0 0 0 2px var(--gruen-linie); }
.vs:active { transform: scale(.97); }
.neu { background: var(--gruen-flaeche); border-radius: 4px; transition: background-color 1.6s ease 1.2s; }
.neu.verblasst { background: transparent; }

/* Toast */
.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 52; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast { background: var(--satz); color: var(--fahne); padding: 12px 16px; border-radius: var(--r); box-shadow: var(--schatten-hoch); font-size: 15px; pointer-events: auto; animation: toast-rein .25s var(--ease); }
.toast--fehler { background: var(--rot); color: #fff; }
@keyframes toast-rein { from { opacity: 0; transform: translateY(8px); } }

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