/* JAH Warenwirtschaft. Der Look folgt dem Shop jah-gmbh.de: Markenblau #00428E mit
   weißer Schrift darauf, kühle Grautöne, kleine Rundungen, Text und Überschriften in
   Work Sans, Nummern und Etiketten in IBM Plex Mono. Hell oder dunkel richtet sich nach
   dem Gerät. Die Schriften liegen in fonts/, damit keine Anfrage an fremde Server geht. */
@font-face { font-family: "Work Sans"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/work-sans-latin-wght-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

:root {
  --grund: #F3F5F9;
  --flaeche: #FFFFFF;
  --flaeche-2: #EEF3F9;
  --linie: #D5DDE8;
  --linie-stark: #AEBBCC;
  --tinte: #101B2B;
  --tinte-leise: #5A6B80;
  --blau: #00428E;
  --blau-hell: #E5EDF7;
  --blau-tief: #00428E;
  --auf-blau: #FFFFFF;
  --kopf: #00428E;
  --auf-kopf: #FFFFFF;
  --warn: #8A5200;
  --warn-grund: #FBF0D9;
  --fehler: #B3261E;
  --fehler-grund: #FBE9E7;
  --schatten: 0 1px 2px rgba(16, 27, 43, .06), 0 8px 24px rgba(16, 27, 43, .08);
  --schleier: rgba(16, 27, 43, .45);
  --schrift: "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --schrift-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 4px;
  --leiste: 232px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0A0F17;
    --flaeche: #121A26;
    --flaeche-2: #182233;
    --linie: #243147;
    --linie-stark: #3A4C66;
    --tinte: #E7EDF5;
    --tinte-leise: #9EACBF;
    --blau: #2D6CC0;
    --blau-hell: #14233A;
    --blau-tief: #8DB6EE;
    --auf-blau: #FFFFFF;
    --kopf: #0B2C57;
    --auf-kopf: #FFFFFF;
    --warn: #E9B44C;
    --warn-grund: #2B2310;
    --fehler: #FF8A80;
    --fehler-grund: #2E1513;
    --schatten: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .45);
    --schleier: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body { min-height: 100%; margin: 0; background: var(--grund); color: var(--tinte); font: 400 16px/1.5 var(--schrift); }
[hidden] { display: none !important; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1 { font: 600 28px/1.2 var(--schrift); letter-spacing: -.01em; text-wrap: balance; }
h2 { font: 600 19px/1.25 var(--schrift); text-wrap: balance; }
h3 { font: 600 16px/1.3 var(--schrift); }
a { color: var(--blau-tief); text-underline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
button { margin: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blau-tief); outline-offset: 2px; }
svg.symbol { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.leise { color: var(--tinte-leise); }
.klein { font-size: 14px; line-height: 1.45; }
.etikett { font: 500 11px/1.3 var(--schrift-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--tinte-leise); }
.mono { font-family: var(--schrift-mono); }
.stapel { display: flex; flex-direction: column; gap: 16px; }
.stapel.eng { gap: 8px; }
.stapel.weit { gap: 28px; }
.reihe { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.reihe.auseinander { justify-content: space-between; }
.laden { padding: 48px 16px; text-align: center; color: var(--tinte-leise); }

/* Wortmarke: das blaue Feld mit JAH in Weiß, daneben der Name des Programms */
.wortmarke { display: flex; align-items: center; gap: 10px; color: var(--tinte); text-decoration: none; }
.wortmarke b { display: grid; place-items: center; min-width: 52px; height: 32px; padding: 0 8px; border-radius: var(--r); background: var(--kopf); color: var(--auf-kopf); font: 700 17px/1 var(--schrift); letter-spacing: .06em; }
.wortmarke span { font: 600 15px/1.1 var(--schrift); color: var(--tinte); }

/* Knöpfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 8px 18px; border: 1px solid var(--blau); border-radius: var(--r); background: var(--blau); color: var(--auf-blau); font: 600 15px/1.25 var(--schrift); text-align: center; text-decoration: none; }
.knopf:hover { filter: brightness(1.12); }
.knopf:disabled { opacity: .55; cursor: progress; filter: none; }
.knopf.leise { background: transparent; color: var(--tinte); border-color: var(--linie-stark); }
.knopf.leise:hover { background: var(--flaeche-2); filter: none; }
.knopf.gefahr { background: transparent; color: var(--fehler); border-color: var(--fehler); }
.knopf.gefahr:hover { background: var(--fehler-grund); filter: none; }
.knopf.klein { min-height: 36px; padding: 5px 12px; font-size: 14px; }
.knopf.breit { display: flex; width: 100%; }
.textknopf { padding: 4px 0; border: 0; background: none; color: var(--blau-tief); font: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* Formulare */
form { display: flex; flex-direction: column; gap: 16px; }
.feld { display: flex; flex-direction: column; gap: 6px; }
.feld > label, .feld > .beschriftung { font-weight: 500; font-size: 15px; }
.feld .hilfe { font-size: 14px; line-height: 1.4; color: var(--tinte-leise); }
.eingabe { width: 100%; min-height: 46px; padding: 9px 12px; border: 1px solid var(--linie-stark); border-radius: var(--r); background: var(--flaeche); color: var(--tinte); font: 400 16px/1.4 var(--schrift); }
.eingabe:focus-visible { outline: 2px solid var(--blau-tief); outline-offset: 0; border-color: var(--blau-tief); }
select.eingabe { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 19px) 20px, calc(100% - 14px) 20px; background-size: 5px 5px; background-repeat: no-repeat; }
.eingabe.code { max-width: 220px; font: 500 24px/1.2 var(--schrift-mono); letter-spacing: .3em; text-align: center; }
.mit-knopf { display: flex; gap: 8px; }
.mit-knopf .eingabe { flex: 1; min-width: 0; }
.auswahl { display: flex; flex-direction: column; gap: 8px; }
.auswahl label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--linie); border-radius: var(--r); background: var(--flaeche); cursor: pointer; }
.auswahl label:has(input:checked) { border-color: var(--blau-tief); background: var(--blau-hell); }
.auswahl input { margin: 4px 0 0; accent-color: var(--blau-tief); }
.auswahl small { display: block; font-size: 14px; color: var(--tinte-leise); }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset:disabled { opacity: .6; }
legend { padding: 0; margin-bottom: 6px; }

/* Meldungen */
.meldung { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--linie); border-left-width: 3px; border-radius: var(--r); background: var(--flaeche-2); font-size: 15px; line-height: 1.45; }
.meldung.fehler { border-color: var(--fehler); background: var(--fehler-grund); color: var(--fehler); }
.meldung.warnung { border-color: var(--warn); background: var(--warn-grund); }
.meldung.gut { border-color: var(--blau-tief); background: var(--blau-hell); }
.meldung > div { flex: 1; min-width: 0; }

/* Marken (kleine Zustands-Schilder) */
.marke { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; border: 1px solid var(--linie-stark); border-radius: var(--r); font: 500 10.5px/1.2 var(--schrift-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--tinte-leise); white-space: nowrap; }
.marke.blau { border-color: var(--blau-tief); background: var(--blau-hell); color: var(--blau-tief); }
.marke.warn { border-color: var(--warn); background: var(--warn-grund); color: var(--warn); }
.marke.rot { border-color: var(--fehler); background: var(--fehler-grund); color: var(--fehler); }

/* Karten */
.karte { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 20px; border: 1px solid var(--linie); border-radius: var(--r); background: var(--flaeche); }
.karte > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.angaben { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 15px; }
.angaben dt { color: var(--tinte-leise); }
.angaben dd { min-width: 0; overflow-wrap: anywhere; }

/* Seiten vor der Anmeldung: eine Karte in der Mitte */
.vorraum { display: flex; flex-direction: column; align-items: center; gap: 24px; min-height: 100vh; min-height: 100dvh; padding: max(32px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom)); }
.vorraum .karte { width: 100%; max-width: 440px; padding: 28px 24px; gap: 20px; box-shadow: var(--schatten); }
.vorraum .wortmarke { margin-top: 4vh; }
.vorraum footer { font-size: 13px; color: var(--tinte-leise); }
.schritte { display: flex; gap: 6px; }
.schritte i { flex: 1; height: 3px; background: var(--linie); }
.schritte i.erledigt, .schritte i.aktiv { background: var(--blau); }
.qr { align-self: center; max-width: 100%; border: 1px solid var(--linie); background: #fff; line-height: 0; }
.qr svg { display: block; max-width: 100%; height: auto; }
.schluessel { padding: 10px 12px; border: 1px dashed var(--linie-stark); border-radius: var(--r); background: var(--flaeche-2); font: 500 15px/1.5 var(--schrift-mono); letter-spacing: .06em; overflow-wrap: anywhere; user-select: all; }
.schluessel.gross { font-size: 20px; text-align: center; letter-spacing: .1em; }
ol.zahlen { display: flex; flex-direction: column; gap: 14px; counter-reset: schritt; }
ol.zahlen > li { position: relative; display: flex; flex-direction: column; gap: 10px; padding-left: 38px; counter-increment: schritt; }
ol.zahlen > li::before { content: counter(schritt); position: absolute; left: 0; top: -1px; display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--blau-tief); border-radius: 50%; font: 500 12px/1 var(--schrift-mono); color: var(--blau-tief); }

/* Das Programm nach der Anmeldung */
.rahmen { min-height: 100vh; min-height: 100dvh; }
.kopf { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); border-bottom: 0; background: var(--kopf); color: var(--auf-kopf); }
.kopf .wortmarke span { color: var(--auf-kopf); }
.kopf .wortmarke b { border: 1.5px solid rgba(255, 255, 255, .75); }
.navigation { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; padding: 0 max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left)); border-top: 1px solid var(--linie); background: var(--flaeche); }
.navigation a:not(.wortmarke) { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 8px; color: var(--tinte-leise); font: 500 11.5px/1.2 var(--schrift); text-decoration: none; }
.navigation a:not(.wortmarke) span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navigation a[aria-current] { color: var(--blau-tief); box-shadow: inset 0 2px 0 var(--blau); }
.navigation .unten { display: none; }
.inhalt { display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 980px; padding: 24px max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.seitenkopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.seitenkopf > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.zurueck { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; text-decoration: none; }
.fuss { font-size: 13px; color: var(--tinte-leise); }

@media (min-width: 900px) {
  .rahmen { padding-left: var(--leiste); }
  .kopf { display: none; }
  .navigation { top: 0; right: auto; width: var(--leiste); flex-direction: column; gap: 2px; padding: 24px 12px 16px; border-top: 0; border-right: 1px solid var(--linie); overflow-y: auto; }
  .navigation .wortmarke { flex-direction: column; align-items: flex-start; gap: 8px; padding: 0 10px 22px; }
  .navigation a:not(.wortmarke) { flex: none; flex-direction: row; gap: 12px; padding: 11px 10px; border-radius: var(--r); font-size: 15px; }
  .navigation a:not(.wortmarke):not([aria-current]):hover { background: var(--flaeche-2); color: var(--tinte); }
  .navigation a[aria-current] { background: var(--blau-hell); box-shadow: inset 3px 0 0 var(--blau); }
  .navigation .unten { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--linie); }
  .navigation .unten strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
  .inhalt { gap: 24px; padding: 40px 40px 64px; }
  h1 { font-size: 34px; }
  /* Am PC steht "Abmelden" schon in der Leiste. */
  .nur-handy { display: none; }
  .zwei-spalten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
}
@media (max-width: 899px) {
  .navigation .wortmarke { display: none; }
  /* Unten ist nur für fünf Bereiche Platz. Die anderen stehen als Kacheln auf der Startseite. */
  .navigation a.nur-pc { display: none; }
  .zwei-spalten { display: flex; flex-direction: column; gap: 20px; }
}

/* Kacheln auf der Startseite */
/* Geplante Läufe auf der Startseite der Verwaltung */
.laeufe { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--linie); }
.laeufe > li { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--linie); }
.laeufe p { margin: 0; font-size: 14px; }

.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.kachel { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--linie); border-radius: var(--r); background: var(--flaeche); color: var(--tinte); text-decoration: none; }
.kachel:hover { border-color: var(--blau-tief); }
.kachel svg { color: var(--blau-tief); }
.kachel p { font-size: 15px; color: var(--tinte-leise); }
.kachel.bald { border-style: dashed; background: transparent; }
.kachel.bald svg { color: var(--tinte-leise); }

/* Listen: auf dem Handy Karten, auf dem PC Zeilen */
.liste { display: flex; flex-direction: column; border: 1px solid var(--linie); border-radius: var(--r); background: var(--flaeche); }
.liste > li + li { border-top: 1px solid var(--linie); }
.liste .zeile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--tinte); text-decoration: none; }
.liste .zeile > .symbol { flex: none; }
.liste .mitte { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.liste a.zeile:hover { background: var(--flaeche-2); }
.liste .haupt { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.liste .haupt strong { font-weight: 600; overflow-wrap: anywhere; }
.liste .haupt span { font-size: 14px; color: var(--tinte-leise); overflow-wrap: anywhere; }
.liste .neben { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.liste .zeit { font: 400 13px/1.4 var(--schrift-mono); color: var(--tinte-leise); white-space: nowrap; }
.liste .inaktiv .haupt strong { color: var(--tinte-leise); text-decoration: line-through; }
.liste .leer { padding: 28px 16px; text-align: center; color: var(--tinte-leise); }
.filter { display: flex; flex-wrap: wrap; gap: 6px; }
.filter a { padding: 7px 12px; border: 1px solid var(--linie-stark); border-radius: var(--r); color: var(--tinte); font: 500 12px/1.2 var(--schrift-mono); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }
.filter a[aria-current] { border-color: var(--blau-tief); background: var(--blau-hell); color: var(--blau-tief); }

/* Suche über einer Liste */
.suche { flex-direction: row; gap: 0; }
.suche .mit-knopf { flex: 1; max-width: 560px; }
.suche .knopf { min-width: 48px; padding: 8px 12px; }
.liste.flach { border: 0; border-radius: 0; background: none; border-top: 1px solid var(--linie); }
.liste.flach > li { border-bottom: 1px solid var(--linie); }
.liste.flach > li + li { border-top: 0; }
.liste.flach .zeile { padding: 12px 4px; }

/* Tabellen: am PC Zeilen und Spalten, auf dem Handy je Zeile ein Block */
.tabelle-rahmen { margin: 0 -4px; overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabelle th { padding: 8px 10px; border-bottom: 1px solid var(--linie-stark); font: 500 11px/1.3 var(--schrift-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--tinte-leise); text-align: left; white-space: nowrap; }
.tabelle td { padding: 9px 10px; border-bottom: 1px solid var(--linie); vertical-align: top; overflow-wrap: anywhere; }
.tabelle tbody tr:last-child td { border-bottom: 0; }
.tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabelle td.mono { font-size: 14px; white-space: nowrap; }
@media (max-width: 699px) {
  .tabelle-rahmen { margin: 0; overflow: visible; }
  .tabelle thead { display: none; }
  .tabelle, .tabelle tbody, .tabelle tr, .tabelle td { display: block; width: 100%; }
  .tabelle tr { padding: 10px 0; border-bottom: 1px solid var(--linie); }
  .tabelle tbody tr:last-child { border-bottom: 0; }
  .tabelle td { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; border: 0; text-align: right; }
  .tabelle td::before { content: attr(data-titel); flex: none; color: var(--tinte-leise); font-size: 14px; text-align: left; }
  .tabelle td.zahl { white-space: normal; }
  .tabelle td[data-leer] { display: none; }
  .tabelle td:first-child { font-weight: 600; }
}

.anschrift { font-style: normal; line-height: 1.5; }
.adressen { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 20px; }
.personen { display: flex; flex-direction: column; gap: 10px; }
.personen li { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.fehlertext { color: var(--fehler); font-size: 14px; }

/* Fenster über der Seite */
dialog { width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--linie-stark); border-radius: var(--r); background: var(--flaeche); color: var(--tinte); box-shadow: var(--schatten); }
dialog::backdrop { background: var(--schleier); }
dialog > .stapel { padding: 24px; }
dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.schliessen { display: grid; place-items: center; width: 36px; height: 36px; margin: -6px -8px 0 0; border: 0; border-radius: var(--r); background: none; color: var(--tinte-leise); }
.schliessen:hover { background: var(--flaeche-2); color: var(--tinte); }
progress { width: 100%; height: 8px; accent-color: var(--blau-tief); }

.rueckmeldung { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 20; display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px); padding: 10px 16px; transform: translateX(-50%); border-radius: var(--r); background: var(--tinte); color: var(--grund); font-size: 15px; box-shadow: var(--schatten); }
.rueckmeldung.fehler { background: var(--fehler); }
@media (min-width: 900px) { .rueckmeldung { bottom: 32px; left: calc(50% + var(--leiste) / 2); } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
