/* ==========================================================================
   Aussehen aller Seiten der Anwendung.
   Gleiche Farben und Schriften wie die Webseite zum Angebot. Schriften lokal
   (SIL OFL 1.1, siehe fonts/LICENSE-Schriften.txt) – keine fremden Server.
   ========================================================================== */
@font-face { font-family: 'Archivo'; font-weight: 700; font-display: swap; src: url('fonts/archivo-700.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 800; font-display: swap; src: url('fonts/archivo-800.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-display: swap; src: url('fonts/jetbrains-mono-500.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --navy: #0b1f4d; --navy-tief: #071638;
  --orange: #f45b00; --orange-tief: #c24700;
  --cyan: #0090b4; --cyan-dunkel: #007f9f;
  --gelb: #f5a800; --gelb-flaeche: #fff6e2; --gelb-rand: #f0dcae; --gelb-text: #7a5600;
  --rot-flaeche: #fdecec; --rot-rand: #f3c2c2; --rot-text: #9b1c1c;
  --gruen-flaeche: #e8f6ef; --gruen-rand: #b9e2cb; --gruen-text: #1c6b45;
  --papier: #eff3f8; --papier-tief: #e3eaf3; --weiss: #fff;
  --linie: #ccd8e7; --linie-fein: #dfe7f1;
  --text: #0b1f4d; --text-weich: #4c5f7d;
  --font-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-text: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --haken: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.8 8.3l2.7 2.7 5.7-5.8' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --ausruf: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 3.6v5.3' stroke='%230b1f4d' stroke-width='2.3' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='12.1' r='1.35' fill='%230b1f4d'/%3E%3C/svg%3E");
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--papier); color: var(--text); font-family: var(--font-text); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; line-height: 1.12; margin: 0 0 .5em; color: var(--navy); text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 3.6vw, 2.35rem); }
h2 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 .9em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

.huelle { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: 20px; }
.huelle--schmal { max-width: 780px; }
/* Eine Spalte, die nie breiter wird als der Bildschirm – sonst schiebt ein langer Link die ganze Seite zur Seite. */
main.huelle { padding-block: 28px 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }

/* Kopf und Fuß */
.kopf { background: var(--weiss); border-bottom: 1px solid var(--linie-fein); }
.kopf-innen { display: flex; align-items: center; gap: 18px; min-height: 68px; flex-wrap: wrap; padding-block: 10px; }
.kopf-logo { height: 40px; width: auto; }
.kopf-titel { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .13em; text-transform: uppercase; color: var(--text-weich); border-left: 1px solid var(--linie); padding-left: 18px; }
.admin-hinweis { margin: 0; padding: 9px 20px; text-align: center; background: var(--gelb-flaeche); border-bottom: 1px solid var(--gelb-rand); color: var(--gelb-text); font-size: .85rem; }
.fuss { border-top: 1px solid var(--linie); background: var(--weiss); color: var(--text-weich); font-size: .84rem; }
.fuss-innen { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 18px; }

/* Karten und Kästen */
.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: 14px; padding: clamp(20px, 3vw, 30px); }
.karte > h2:first-child, .karte > h3:first-child { margin-top: 0; }
.marke { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 12px; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--orange-tief); }
.marke::before { content: ''; width: 20px; height: 3px; border-radius: 2px; background: var(--orange); }
.lead { font-size: 1.05rem; color: var(--text-weich); }
.weich { color: var(--text-weich); }
.klein { font-size: .88rem; }
.fehler, .erfolg, .info { border-radius: 12px; padding: 14px 18px; border: 1px solid; }
.fehler { background: var(--rot-flaeche); border-color: var(--rot-rand); color: var(--rot-text); }
.fehler ul { margin: 6px 0 0; padding-left: 1.2em; }
.erfolg { background: var(--gruen-flaeche); border-color: var(--gruen-rand); color: var(--gruen-text); }
.info { background: var(--gelb-flaeche); border-color: var(--gelb-rand); color: var(--gelb-text); }
.kurzfakten { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 14px 0 0; padding: 0; font-family: var(--font-mono); font-size: .74rem; color: var(--text-weich); }
.kurzfakten li::before { content: '•'; color: var(--cyan); margin-right: 7px; }

/* Stellen-Steckbrief */
/* Flex statt Raster: Der letzte Eintrag füllt seine Zeile, sonst blieben graue Löcher. */
.steckbrief { display: flex; flex-wrap: wrap; gap: 1px; margin-top: 16px; background: var(--linie-fein); border: 1px solid var(--linie-fein); border-radius: 12px; overflow: hidden; }
.steckbrief div { flex: 1 1 200px; background: var(--weiss); padding: 11px 14px; }
.steckbrief b { display: block; font-family: var(--font-mono); font-weight: 500; font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-weich); margin-bottom: 2px; }

/* Formulare */
form { display: grid; gap: 20px; }
.abschnitt { border: 1px solid var(--linie); border-radius: 14px; background: var(--weiss); padding: clamp(18px, 3vw, 28px); margin: 0; min-width: 0; display: grid; gap: 18px; }
.abschnitt > legend { padding: 0 8px; margin-left: -8px; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--navy); }
.abschnitt > legend span { font-family: var(--font-mono); font-weight: 500; font-size: .72rem; letter-spacing: .1em; color: var(--orange-tief); margin-right: 8px; }
.abschnitt-hilfe { margin: -8px 0 0; color: var(--text-weich); font-size: .92rem; }
.feld { display: grid; gap: 6px; }
.feld-label { font-weight: 600; font-size: .95rem; }
.feld-hilfe { font-size: .85rem; color: var(--text-weich); }
.zwei-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .zwei-spalten { grid-template-columns: 1fr; } }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=url], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--weiss); border: 1px solid var(--linie); border-radius: 10px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 144, 180, .18); }
.zeichen { font-family: var(--font-mono); font-size: .7rem; color: var(--text-weich); text-align: right; }
.unsichtbar { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Auswahl als Pillen – Eingabe unsichtbar, aber per Tastatur erreichbar */
.wahl-reihe { display: flex; flex-wrap: wrap; gap: 8px; }
.wahl { position: relative; display: inline-flex; }
.wahl input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.wahl span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--linie); background: var(--weiss); font-size: .9rem; line-height: 1.3; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.wahl input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.wahl input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }
.wahl input:disabled + span { opacity: .45; cursor: not-allowed; }
.wahl-liste { display: grid; gap: 8px; }
.wahl-liste .wahl span { border-radius: 10px; width: 100%; padding: 11px 14px; }
.wahl-liste .wahl { display: flex; }

/* Vierer-Skala */
.aussage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 10px 20px; align-items: center; padding: 12px 0; border-top: 1px solid var(--linie-fein); }
.aussage:first-of-type { border-top: 0; }
.aussage p { margin: 0; }
.skala { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--papier); padding: 4px; border-radius: 12px; }
.skala-wahl { position: relative; display: flex; }
.skala-wahl input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.skala-wahl span { flex: 1; display: grid; place-items: center; text-align: center; min-height: 40px; padding: 6px 4px; border-radius: 9px; font-size: .78rem; line-height: 1.2; color: var(--text-weich); cursor: pointer; }
.skala-wahl input:checked + span { background: var(--navy); color: #fff; font-weight: 600; }
.skala-wahl input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 1px; }
@media (max-width: 720px) { .aussage { grid-template-columns: 1fr; } }

/* Zeilen für eigene Anforderungen und Arbeitszeiten */
.zeile { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 10px 20px; align-items: center; }
@media (max-width: 720px) { .zeile { grid-template-columns: 1fr; } }
.vorschlaege { display: flex; flex-wrap: wrap; gap: 6px; }
.vorschlag { border: 1px dashed var(--linie); background: var(--weiss); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .82rem; color: var(--text-weich); cursor: pointer; }
.vorschlag:hover { border-color: var(--orange); color: var(--navy); }

/* Knöpfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; font-size: .98rem; line-height: 1.2; text-decoration: none; cursor: pointer; border: 2px solid transparent; border-radius: 999px; padding: 12px 24px; }
.knopf--orange { background: var(--orange); color: var(--navy); }
.knopf--orange:hover { box-shadow: 0 8px 22px rgba(244, 91, 0, .32); }
.knopf--rand { background: var(--weiss); color: var(--navy); border-color: var(--linie); }
.knopf--rand:hover { border-color: var(--navy); }
.knopf--gefahr { background: var(--weiss); color: var(--rot-text); border-color: var(--rot-rand); }
.knopf--gefahr:hover { border-color: var(--rot-text); }
.knopf--klein { padding: 8px 16px; font-size: .88rem; }
.knopf-reihe { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Link, QR, Baustein */
.linkzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--papier); border: 1px solid var(--linie); border-radius: 10px; padding: 10px 12px; }
.linkzeile code { flex: 1 1 260px; min-width: 0; font-family: var(--font-mono); font-size: .8rem; word-break: break-all; }
.kopieren { border: 0; border-radius: 999px; background: var(--navy); color: #fff; font: inherit; font-size: .78rem; font-weight: 700; padding: 7px 14px; cursor: pointer; }
.kopieren[data-fertig='ja'] { background: var(--cyan-dunkel); }
.material { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 700px) { .material { grid-template-columns: minmax(0, 1fr); } }
.qr-box { background: #fff; border: 1px solid var(--linie); border-radius: 12px; padding: 12px; text-align: center; }
.qr-box svg { width: 100%; height: auto; display: block; }
.qr-box a { font-size: .82rem; }
.baustein { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--navy-tief); color: #dbe5f4; border-radius: 10px; padding: 14px 16px; font-family: var(--font-mono); font-size: .8rem; line-height: 1.7; }

/* Status der Stelle */
.status { border-radius: 12px; padding: 14px 18px; border: 1px solid; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.status--entwurf { background: var(--gelb-flaeche); border-color: var(--gelb-rand); color: var(--gelb-text); }
.status--aktiv { background: var(--gruen-flaeche); border-color: var(--gruen-rand); color: var(--gruen-text); }
.status--geschlossen { background: var(--papier-tief); border-color: var(--linie); color: var(--text-weich); }

/* Rangliste */
.kandidat { background: var(--weiss); border: 1px solid var(--linie); border-radius: 14px; overflow: hidden; min-width: 0; }
.kandidat-kopf { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 16px 20px; }
.kandidat-kopf b { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.kandidat-kopf span { display: block; font-size: .86rem; color: var(--text-weich); margin-top: 2px; }
.kandidat-wert { text-align: right; font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; line-height: 1; font-variant-numeric: tabular-nums; }
.kandidat-wert small { display: block; margin-top: 4px; font-family: var(--font-mono); font-weight: 500; font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-weich); }
.kandidat-teil { padding: 0 20px 16px; }
.kandidat-fuss { border-top: 1px solid var(--linie-fein); background: var(--papier); padding: 12px 20px; display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; }
.hinweise { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.hinweis-chip { background: var(--gelb-flaeche); border: 1px solid var(--gelb-rand); color: var(--gelb-text); border-radius: 8px; padding: 3px 10px; font-size: .84rem; }
.hinweis-chip--nein { background: #fdf0e6; border-color: #f2c9a7; color: #8a3d00; }
.kontakt { display: grid; gap: 2px; font-size: .92rem; }

/* Aufklappen */
.aufklapp { border-top: 1px solid var(--linie-fein); }
.aufklapp > summary { cursor: pointer; list-style: none; padding: 12px 20px; font-weight: 600; font-size: .92rem; display: flex; justify-content: space-between; }
.aufklapp > summary::-webkit-details-marker { display: none; }
.aufklapp > summary::after { content: '+'; font-weight: 700; color: var(--orange-tief); }
.aufklapp[open] > summary::after { content: '–'; }
.aufklapp-inhalt { padding: 0 20px 16px; }
.karte .aufklapp > summary, .karte .aufklapp-inhalt { padding-inline: 0; }

/* Abgleich-Tabelle – wie auf der Webseite */
.tabelle-huelle { overflow-x: auto; }
.abgleich-tabelle { width: 100%; border-collapse: collapse; font-size: .9rem; }
.abgleich-tabelle th { text-align: left; font-family: var(--font-mono); font-weight: 500; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: #5f7090; padding: 8px 10px; border-bottom: 1px solid var(--linie); background: var(--papier); }
.abgleich-tabelle td { padding: 9px 10px; border-bottom: 1px solid var(--linie-fein); vertical-align: top; }
.abgleich-tabelle tr:last-child td { border-bottom: 0; }
.aspekt { font-weight: 600; }
.gewicht { display: inline-block; white-space: nowrap; border-radius: 999px; padding: 2px 9px; font-family: var(--font-mono); font-size: .66rem; }
.gewicht--4 { background: var(--navy); color: #fff; }
.gewicht--3 { background: #37507f; color: #fff; }
.gewicht--2, .gewicht--1 { background: var(--papier-tief); color: var(--text-weich); }
.urteil { display: flex; gap: 8px; align-items: flex-start; color: var(--text-weich); }
.urteil::before { content: ''; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--cyan-dunkel) var(--haken) center / 12px no-repeat; }
.urteil--ab { color: var(--navy); }
.urteil--ab::before { background: var(--gelb) var(--ausruf) center / 12px no-repeat; }
/* Handy: engere Zellen und Silbentrennung, damit alle drei Spalten ohne Wischen passen */
@media (max-width: 520px) {
  .abgleich-tabelle th, .abgleich-tabelle td { padding-inline: 6px; }
  .abgleich-tabelle td { -webkit-hyphens: auto; hyphens: auto; }
}
/* Sehr schmale Handys (320 px): etwas weniger Rand, sonst fehlen der Tabelle 20 px */
@media (max-width: 380px) {
  .huelle { padding-inline: 14px; }
  .karte { padding: 16px; }
  .kandidat-kopf, .kandidat-teil, .kandidat-fuss, .aufklapp > summary, .aufklapp-inhalt { padding-inline: 14px; }
  .abgleich-tabelle { font-size: .86rem; }
}

/* Situationen */
.situation { border-left: 3px solid var(--cyan); padding-left: 14px; margin: 0 0 14px; }
.situation p { margin: 0 0 4px; }
.situation blockquote { margin: 0; color: var(--text); white-space: pre-wrap; }

/* Verwaltung */
.tabelle { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabelle th { text-align: left; font-family: var(--font-mono); font-weight: 500; font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-weich); border-bottom: 1px solid var(--linie); padding: 8px 10px; }
.tabelle td { border-bottom: 1px solid var(--linie-fein); padding: 10px; vertical-align: top; }
.pille { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600; }
.pille--entwurf { background: var(--gelb-flaeche); color: var(--gelb-text); }
.pille--aktiv { background: var(--gruen-flaeche); color: var(--gruen-text); }
.pille--geschlossen { background: var(--papier-tief); color: var(--text-weich); }
.leer { text-align: center; color: var(--text-weich); padding: 26px; }

/* Rechtstext */
.rechtstext h2 { margin-top: 1.6em; font-size: 1.2rem; }
.rechtstext h2:first-of-type { margin-top: .4em; }
.rechtstext p, .rechtstext li { color: var(--text-weich); }
.rechtstext .stand { font-family: var(--font-mono); font-size: .76rem; }

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

/* Link zur Verwaltung in der Kopfzeile, nur für angemeldete Administratoren */
.kopf-verwaltung { margin-left: auto; font-size: .88rem; font-weight: 600; text-decoration: none; }
