/* Wegwarte · Grundlagen: Schrift, Farben, Formulare, Knöpfe – gilt für öffentliche Karte und internen Bereich */

@font-face { font-family: 'Atkinson Next'; font-weight: 400; font-style: normal; font-display: swap;
  src: url(/assets/fonts/atkinson-hyperlegible-next-latin-400-normal.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: 'Atkinson Next'; font-weight: 400; font-style: normal; font-display: swap;
  src: url(/assets/fonts/atkinson-hyperlegible-next-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Atkinson Next'; font-weight: 400; font-style: italic; font-display: swap;
  src: url(/assets/fonts/atkinson-hyperlegible-next-latin-400-italic.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }
@font-face { font-family: 'Atkinson Next'; font-weight: 600; font-style: normal; font-display: swap;
  src: url(/assets/fonts/atkinson-hyperlegible-next-latin-600-normal.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: 'Atkinson Next'; font-weight: 600; font-style: normal; font-display: swap;
  src: url(/assets/fonts/atkinson-hyperlegible-next-latin-ext-600-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Atkinson Next'; font-weight: 700; font-style: normal; font-display: swap;
  src: url(/assets/fonts/atkinson-hyperlegible-next-latin-700-normal.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: 'Atkinson Next'; font-weight: 700; font-style: normal; font-display: swap;
  src: url(/assets/fonts/atkinson-hyperlegible-next-latin-ext-700-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Atkinson Mono'; font-weight: 400; font-style: normal; font-display: swap;
  src: url(/assets/fonts/atkinson-hyperlegible-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Atkinson Mono'; font-weight: 700; font-style: normal; font-display: swap;
  src: url(/assets/fonts/atkinson-hyperlegible-mono-latin-700-normal.woff2) format('woff2'); }

:root {
  color-scheme: light;
  --papier: #F7F5EF;
  --flaeche: #FFFFFF;
  --flaeche-2: #F1EEE6;
  --flaeche-3: #E7E3D8;
  --linie: #D8D3C6;
  --linie-stark: #B9B3A4;
  --rand-feld: #8A8474;        /* Formularränder: mindestens 3:1 gegen Feld und Papier */
  --tinte: #17202B;
  --tinte-2: #465162;
  --tinte-3: #5F6B7C;
  --akzent: #2F4FBF;          /* Wegwarten-Blau */
  --akzent-stark: #233D9C;
  --akzent-hell: #E7ECFB;
  --akzent-mittel: #C9D3F5;
  --auf-akzent: #FFFFFF;
  --fokus: #D9480F;
  --fehler: #B42318;
  --fehler-hell: #FDECEA;
  --erfolg: #186A3B;
  --erfolg-hell: #E6F4EA;
  --warnung: #8A5A00;
  --warnung-hell: #FFF4D6;
  --muster: #2B2F36;
  --auf-muster: #FFFFFF;
  /* Status (geprüft mit dem Palettenprüfer, immer mit Symbol und Text) */
  --st-offen: #2361C4;
  --st-in-arbeit: #E0A20F;
  --st-erledigt: #1B6E45;
  --st-nicht: #B5577A;
  --reihe-a: #2F4FBF;          /* Diagramme: zwei Reihen, geprüft hell und dunkel */
  --reihe-b: #B8792A;
  --schatten: 0 1px 2px rgb(23 32 43 / .08), 0 4px 16px rgb(23 32 43 / .08);
  --schatten-stark: 0 2px 4px rgb(23 32 43 / .10), 0 12px 32px rgb(23 32 43 / .16);
  --radius: 10px;
  --radius-klein: 6px;
  --schrift: 'Atkinson Next', 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Atkinson Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --papier: #12161C; --flaeche: #1A2028; --flaeche-2: #212833; --flaeche-3: #2A3240; --linie: #343D4B; --linie-stark: #4A5566; --rand-feld: #6F7A8C;
    --tinte: #EEF1F5; --tinte-2: #C3CAD5; --tinte-3: #A1AAB8;
    --akzent: #8EA6F5; --akzent-stark: #B0C1FA; --akzent-hell: #1F2A4A; --akzent-mittel: #34477E; --auf-akzent: #0E1530;
    --fokus: #FF9D5C; --fehler: #FF8A80; --fehler-hell: #3A1C1C; --erfolg: #7DD3A0; --erfolg-hell: #15301F;
    --warnung: #F2C46D; --warnung-hell: #33280F; --muster: #343D4B; --auf-muster: #EEF1F5;
    --st-offen: #5B8CE8; --st-in-arbeit: #C08A10; --st-erledigt: #2C9A66; --st-nicht: #C9779C;
    --reihe-a: #6F8CEB; --reihe-b: #B87A3A;
    --schatten: 0 1px 2px rgb(0 0 0 / .4), 0 4px 16px rgb(0 0 0 / .35);
    --schatten-stark: 0 2px 4px rgb(0 0 0 / .5), 0 12px 32px rgb(0 0 0 / .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --papier: #12161C; --flaeche: #1A2028; --flaeche-2: #212833; --flaeche-3: #2A3240; --linie: #343D4B; --linie-stark: #4A5566; --rand-feld: #6F7A8C;
  --tinte: #EEF1F5; --tinte-2: #C3CAD5; --tinte-3: #A1AAB8;
  --akzent: #8EA6F5; --akzent-stark: #B0C1FA; --akzent-hell: #1F2A4A; --akzent-mittel: #34477E; --auf-akzent: #0E1530;
  --fokus: #FF9D5C; --fehler: #FF8A80; --fehler-hell: #3A1C1C; --erfolg: #7DD3A0; --erfolg-hell: #15301F;
  --warnung: #F2C46D; --warnung-hell: #33280F; --muster: #343D4B; --auf-muster: #EEF1F5;
  --st-offen: #5B8CE8; --st-in-arbeit: #C08A10; --st-erledigt: #2C9A66; --st-nicht: #C9779C;
  --reihe-a: #6F8CEB; --reihe-b: #B87A3A;
  --schatten: 0 1px 2px rgb(0 0 0 / .4), 0 4px 16px rgb(0 0 0 / .35);
  --schatten-stark: 0 2px 4px rgb(0 0 0 / .5), 0 12px 32px rgb(0 0 0 / .5);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--papier); color: var(--tinte); font-family: var(--schrift);
  font-size: 1.0625rem; line-height: 1.55; font-feature-settings: 'kern' 1; overflow-wrap: break-word; hyphens: manual;
}
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; text-wrap: balance; hyphens: manual; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p, ul, ol, dl { margin: 0 0 1em; }
p, li, dd { text-wrap: pretty; }
a { color: var(--akzent); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--akzent-stark); text-decoration-thickness: .14em; }
code, kbd, samp, .mono { font-family: var(--mono); font-size: .92em; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 .35em; border: 1px solid var(--linie-stark); border-bottom-width: 2px;
  border-radius: 4px; background: var(--flaeche); text-align: center; line-height: 1.45; }
img, svg, canvas { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--linie); margin: 1.5rem 0; }
small, .klein { font-size: .875rem; }
.leise { color: var(--tinte-3); }
.zahl { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; border-radius: 3px; }
h1[tabindex="-1"]:focus, main[tabindex="-1"]:focus { outline: none; }
.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; }
.springen { position: absolute; left: .5rem; top: -100px; z-index: 1000; background: var(--akzent); color: var(--auf-akzent);
  padding: .6rem 1rem; border-radius: var(--radius-klein); font-weight: 700; }
.springen:focus { top: .5rem; }

/* Musterhinweis: steht auf jeder Seite, auch im Druck */
.musterhinweis { background: var(--muster); color: var(--auf-muster); font-size: .875rem; line-height: 1.35;
  padding: .45rem 1rem; display: flex; gap: .4rem 1rem; flex-wrap: wrap; align-items: center; justify-content: center; text-align: center; }
.musterhinweis strong { font-weight: 700; }
.musterhinweis a { color: inherit; }

/* Knöpfe */
button { font: inherit; color: inherit; }
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .55rem 1rem;
  border: 1.5px solid var(--linie-stark); border-radius: var(--radius-klein); background: var(--flaeche); color: var(--tinte);
  font-weight: 600; line-height: 1.2; cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s; hyphens: manual; }
.knopf:hover { background: var(--flaeche-2); border-color: var(--tinte-3); color: var(--tinte); }
.knopf.primaer { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); }
.knopf.primaer:hover { background: var(--akzent-stark); border-color: var(--akzent-stark); color: var(--auf-akzent); }
.knopf.gefahr { color: var(--fehler); border-color: currentColor; }
.knopf.gefahr:hover { background: var(--fehler-hell); }
.knopf.still { border-color: transparent; background: transparent; }
.knopf.still:hover { background: var(--flaeche-2); }
.knopf.klein { min-height: 36px; padding: .35rem .7rem; font-size: .9375rem; }
.knopf[disabled], .knopf[aria-disabled="true"], .knopf.primaer[disabled], .knopf.primaer[aria-disabled="true"] {
  background: var(--flaeche-2); border-color: var(--linie); color: var(--tinte-3); cursor: not-allowed; }
.knopf svg { width: 1.15em; height: 1.15em; flex: none; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Formulare */
label, .label { display: block; font-weight: 600; margin-bottom: .3rem; }
.hilfe { display: block; color: var(--tinte-3); font-size: .9rem; font-weight: 400; margin-top: .2rem; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], input[type=url],
select, textarea {
  font: inherit; color: var(--tinte); background: var(--flaeche); border: 1.5px solid var(--rand-feld); border-radius: var(--radius-klein);
  padding: .55rem .7rem; width: 100%; min-height: 44px; }
textarea { min-height: 7rem; resize: vertical; line-height: 1.45; }
::placeholder { color: var(--tinte-3); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--tinte-3); }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--fehler); box-shadow: 0 0 0 1px var(--fehler); }
.feld { margin-bottom: 1rem; }
.feldfehler { color: var(--fehler); font-weight: 600; font-size: .9375rem; margin-top: .3rem; }
.auswahl { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; cursor: pointer; }
.auswahl input { width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; flex: none; accent-color: var(--akzent); }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: .4rem; }

/* Hinweise und Meldungen */
.kasten { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem 1.1rem; }
.meldung { border-radius: var(--radius-klein); padding: .7rem .9rem; border-left: 4px solid; margin: 0 0 1rem; }
.meldung.fehler { background: var(--fehler-hell); border-color: var(--fehler); }
.meldung.erfolg { background: var(--erfolg-hell); border-color: var(--erfolg); }
.meldung.warnung { background: var(--warnung-hell); border-color: var(--warnung); }
.meldung.info { background: var(--akzent-hell); border-color: var(--akzent); }
.meldung > :last-child { margin-bottom: 0; }

/* Status-Abzeichen: Farbe + Symbol + Text */
.status { max-width: 100%; display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .9rem; line-height: 1.2; padding: .2rem .55rem .2rem .3rem;
  border-radius: 999px; background: var(--flaeche-2); border: 1px solid var(--linie); white-space: nowrap; }
.status i { width: 1.15rem; height: 1.15rem; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; flex: none; font-style: normal; }
.status i svg { width: .8rem; height: .8rem; }
.status.offen i { background: var(--st-offen); }
.status.in_arbeit i { background: var(--st-in-arbeit); color: #1A1300; box-shadow: 0 0 0 1px #6B4A00; }   /* Rand für 3:1 gegen die helle Pille */
.status.erledigt i { background: var(--st-erledigt); }
.status.nicht_umsetzbar i { background: var(--st-nicht); }
.status.intern i { background: var(--tinte-3); color: var(--flaeche); }

.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
  background: var(--akzent-hell); color: var(--akzent-stark); border: 1px solid var(--akzent-mittel); white-space: nowrap; }
.chip.neutral { background: var(--flaeche-2); color: var(--tinte-2); border-color: var(--linie); }
.vorgang-nr { font-family: var(--mono); font-weight: 700; letter-spacing: .01em; white-space: nowrap; }

/* Tabellen */
/* Scrollschatten zeigen, dass die Tabelle seitlich weitergeht (verschwinden am jeweiligen Ende) */
.tabelle-huelle { position: relative; overflow-x: auto; border: 1px solid var(--linie); border-radius: var(--radius);
  background: linear-gradient(to right, var(--flaeche) 40%, transparent) left / 48px 100% no-repeat local,
    linear-gradient(to left, var(--flaeche) 40%, transparent) right / 48px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgb(23 32 43 / .22), transparent) left / 16px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgb(23 32 43 / .22), transparent) right / 16px 100% no-repeat scroll,
    var(--flaeche); }
table { border-collapse: collapse; width: 100%; font-size: .9375rem; hyphens: manual; }
caption { text-align: left; font-weight: 700; padding: .7rem .9rem; caption-side: top; }
th, td { text-align: left; padding: .55rem .8rem; border-bottom: 1px solid var(--linie); vertical-align: baseline; }
thead th { background: var(--flaeche-2); font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
tbody tr:hover { background: var(--flaeche-2); }
td.zahl, th.zahl { text-align: right; }
th button.sortieren { all: unset; cursor: pointer; display: inline-flex; gap: .3rem; align-items: center; }
th button.sortieren svg { width: 1rem; height: 1rem; }
th button.sortieren:focus-visible { outline: 3px solid var(--fokus); }

.lade { display: inline-block; width: 1.1em; height: 1.1em; border: 2px solid var(--linie-stark); border-top-color: var(--akzent);
  border-radius: 50%; animation: drehen .8s linear infinite; vertical-align: -.15em; }
@keyframes drehen { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* geschwärzte Stellen */
.geschwaerzt { background: var(--tinte); color: var(--tinte); border-radius: 2px; }

@media (forced-colors: active) {
  .status i, .knopf.primaer { forced-color-adjust: none; }
  .knopf { border: 2px solid ButtonText; }
}

/* gemeinsam für Karte und internen Bereich */
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--akzent); margin-bottom: .35rem; }
.h-klein { font-size: 1rem; margin-bottom: .6rem; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: .25rem .9rem; font-size: .9375rem; margin: .5rem 0 1rem; }
.meta dt { color: var(--tinte-3); }
.meta dd { margin: 0; font-weight: 600; }
.zurueck { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: .75rem; font-weight: 600; text-decoration: none; }
.zurueck .sym { width: 1.1rem; height: 1.1rem; }
.hinweis-foto { border-radius: var(--radius); display: block; width: 100%; height: auto; margin: .5rem 0 1rem; border: 1px solid var(--linie); }
.linkfeld { display: flex; gap: .4rem; }
.linkfeld input { font-family: var(--mono); font-size: .85rem; }
.abschnitt { margin-top: 1.25rem; }

/* eigene Dateiauswahl: das Eingabefeld bleibt fokussierbar, der Knopf zeigt den Fokus */
.dateiwahl { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; position: relative; }
.dateiwahl input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.dateiwahl label { margin: 0; font-weight: 600; }
.dateiwahl input:focus-visible + label { outline: 3px solid var(--fokus); outline-offset: 2px; }
