/* Schichtklick: Die Bildsprache kommt vom gedruckten Dienstplan selbst – Raster, Kürzel, Textmarker am Wochenende.
   Ein Akzent (aus marke.toml, --akzent), Farben nach Aufgabe benannt. Handy zuerst. Keine fremden Server. */

@font-face { font-family: "Plex"; font-weight: 400; font-display: swap; src: url("/static/schrift/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex"; font-weight: 500; font-display: swap; src: url("/static/schrift/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex"; font-weight: 600; font-display: swap; src: url("/static/schrift/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex"; font-weight: 700; font-display: swap; src: url("/static/schrift/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap; src: url("/static/schrift/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 600; font-display: swap; src: url("/static/schrift/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }

:root {
  --akzent: #1f6b57;
  --akzent-dunkel: color-mix(in srgb, var(--akzent) 78%, black);
  --akzent-hell: color-mix(in srgb, var(--akzent) 10%, white);
  --text: #1d2629;
  --text-leise: #56636a;
  --linie: #d3dbd8;
  --raster: #e4e9e7;
  --flaeche: #ffffff;
  --grund: #f4f6f5;
  --marker: #f3e37c;          /* Textmarker wie auf dem gedruckten Plan (Wochenende) */
  --warn: #fff3c4;
  --warn-linie: #c9a227;
  --fehler: #a12b2b;
  --we: #f7f2d0;
  --r: 10px;
  --r-klein: 6px;
  --schrift: "Plex", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-family: var(--schrift);
  color: var(--text);
  background: var(--grund);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-color-scheme: dark) {
  :root {
    --akzent-hell: color-mix(in srgb, var(--akzent) 25%, #182020);
    --text: #e6ecea; --text-leise: #a5b1ad; --linie: #354240; --raster: #26302f; --flaeche: #1b2221; --grund: #131817;
    --marker: #5d5523; --warn: #3b3416; --warn-linie: #a08325; --fehler: #f09c9c; --we: #2a2a1c;
  }
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; font-size: 16px; background: var(--grund); }
a { color: var(--akzent); text-underline-offset: .15em; }
@media (prefers-color-scheme: dark) { a { color: color-mix(in srgb, var(--akzent) 45%, white); } }
h1 { font-size: clamp(1.6rem, 5vw, 2rem); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 1rem; font-weight: 700; }
h2 { font-size: 1.1rem; line-height: 1.3; margin: 0 0 .75rem; font-weight: 600; }
code { font-family: var(--mono); font-size: .9em; background: var(--raster); padding: 0 .3em; border-radius: 3px; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }
.klein { color: var(--text-leise); font-size: .875rem; }
.mitte { text-align: center; }

/* Kopf und Fuß */
.kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem;
  padding: .8rem 1rem; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.logo { font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--text); letter-spacing: -.01em; }
.kopf nav { display: flex; flex-wrap: wrap; gap: .25rem 1.2rem; }
.kopf nav a { text-decoration: none; color: var(--text-leise); padding: .25rem 0; }
.kopf nav a:hover, .kopf nav a[aria-current="page"] { color: var(--akzent); }
.kopf .anmelden { font-weight: 500; text-decoration: none; }
main { max-width: 760px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.fuss { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.2rem; padding: 1.2rem 1rem;
  color: var(--text-leise); font-size: .85rem; }
.fuss a { color: var(--text-leise); }

/* Bausteine */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); padding: 1rem 1.1rem;
  margin: 0 0 1rem; }
.meldung, .fehler { background: var(--flaeche); border: 1px solid var(--linie); border-left: 4px solid var(--akzent);
  padding: .65rem .85rem; border-radius: var(--r-klein); }
.fehler { border-left-color: var(--fehler); color: var(--fehler); }

label { display: block; margin: 0 0 .9rem; font-weight: 600; font-size: .95rem; }
label .klein { font-weight: 400; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; padding: .7rem; font: inherit; font-size: 16px;
  font-weight: 400; color: var(--text); background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: var(--r-klein); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent); outline-offset: 0; border-color: var(--akzent); }
textarea { font-family: var(--mono); font-size: 16px; line-height: 1.5; }
input[type="file"] { padding: .45rem; }
.haken-feld { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .92rem; }
.haken-feld input { width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; flex: none; accent-color: var(--akzent); }

button, .knopf { display: inline-block; padding: .7rem 1.15rem; font: inherit; font-weight: 600; line-height: 1.3;
  text-decoration: none; text-align: center; color: #fff; background: var(--akzent); border: 1px solid var(--akzent);
  border-radius: var(--r-klein); cursor: pointer; transition: transform .1s ease, background-color .15s ease; }
button:hover, .knopf:hover { background: var(--akzent-dunkel); border-color: var(--akzent-dunkel); }
button:active, .knopf:active { transform: scale(.97); }
button:disabled { opacity: .6; cursor: wait; }
button.zweit, .knopf.zweit { color: var(--akzent); background: transparent; }
button.zweit:hover, .knopf.zweit:hover { background: var(--akzent-hell); }
@media (prefers-color-scheme: dark) { button.zweit, .knopf.zweit { color: var(--text); border-color: var(--linie); } }
button.link { padding: 0; border: 0; background: none; color: var(--akzent); font-weight: 400; text-decoration: underline; }
button.link:active { transform: none; }
button.gefahr { background: var(--fehler); border-color: var(--fehler); }
.knoepfe { display: flex; flex-wrap: wrap; gap: .6rem; }
.knoepfe.unten { margin-top: 1rem; }
.reihe { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.reihe .weit { flex: 1 1 14rem; margin: 0; }
.zeile { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.zeile h2 { margin: 0; }
details summary { cursor: pointer; color: var(--akzent); margin: 1rem 0 .75rem; }
.code { font-family: var(--mono); font-weight: 600; letter-spacing: .06em; font-size: 1.1rem; }
.breit { display: block; width: 100%; padding: .85rem 1rem; }
.knopf.gross { display: block; padding: .9rem 1rem; margin: 0 0 1rem; font-size: 1.05rem; }

.haken { list-style: none; padding: 0; margin: 0; }
.haken li { padding: .35rem 0 .35rem 1.8rem; position: relative; }
.haken li::before { content: ""; position: absolute; left: 0; top: .6rem; width: 1rem; height: 1rem; border-radius: 50%;
  border: 2px solid var(--linie); }
.haken li.ok::before { background: var(--akzent); border-color: var(--akzent); }
.haken li.ok a { color: var(--text-leise); }

.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; padding: .6rem 0;
  border-top: 1px solid var(--linie); }
.aktionen { display: flex; gap: 1rem; align-items: center; }
.aktionen form { margin: 0; }
.dienste li { padding: 0; }
.dienste a { display: flex; gap: 1rem; width: 100%; padding: .65rem 0; color: inherit; text-decoration: none; }
.dienste .wann { min-width: 5.5rem; color: var(--text-leise); }
.dienste strong { font-family: var(--mono); }
.kuerzel li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: .6rem; }
.kuerzel strong { font-family: var(--mono); }

/* Prüfliste: je Tag eine Zeile, zum Ändern aufklappen */
.zusammenfassung { font-weight: 600; margin: 0 0 .4rem; }
.tage { border: 1px solid var(--linie); border-radius: var(--r); overflow: hidden; background: var(--flaeche); }
.tagzeile { border-top: 1px solid var(--raster); }
.tagzeile:first-child { border-top: 0; }
.tagzeile summary { display: grid; grid-template-columns: 4.3rem minmax(0, 1fr) auto 1rem; gap: .6rem; align-items: center;
  min-height: 3rem; margin: 0; padding: .5rem .8rem; cursor: pointer; list-style: none; color: var(--text); }
.tagzeile summary::-webkit-details-marker { display: none; }
.tagzeile summary::after { content: "›"; color: var(--text-leise); font-size: 1.2rem; transition: transform .15s; }
.tagzeile[open] summary::after { transform: rotate(90deg); }
.tagzeile .tag { font-variant-numeric: tabular-nums; color: var(--text-leise); }
.tagzeile .kz { font-family: var(--mono); font-weight: 600; color: var(--akzent); overflow-wrap: anywhere; }
@media (prefers-color-scheme: dark) { .tagzeile .kz { color: var(--text); } }
.tagzeile .zeit { text-align: right; font-variant-numeric: tabular-nums; }
.tagzeile.we { background: var(--we); }
.tagzeile.unsicher, .tagzeile.unbekannt { background: var(--warn); box-shadow: inset 4px 0 0 var(--warn-linie); }
.tagzeile:target summary { outline: 2px solid var(--akzent); outline-offset: -2px; }
.stern { color: var(--akzent); font-weight: 700; }
.tag-hinweis { margin: 0; padding: .1rem .8rem 0; }
.felder { display: grid; gap: .1rem; padding: .2rem .8rem .6rem; }
.felder label { margin-bottom: .5rem; }
@media (min-width: 720px) { .felder { grid-template-columns: 1fr 1fr 1.4fr; gap: .8rem; } }
.leiste { position: sticky; bottom: 0; padding: .75rem 0 calc(.75rem + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--grund) 30%); margin-top: .5rem; }
body.mit-tabs .leiste { bottom: calc(3.6rem + env(safe-area-inset-bottom)); }

/* Foto wählen */
.fotowahl { display: block; position: relative; margin: 0 0 1rem; padding: 1.5rem 1rem; text-align: center; cursor: pointer;
  background: var(--flaeche); border: 2px dashed var(--akzent); border-radius: var(--r); font-weight: 400; }
.fotowahl input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.fotowahl:focus-within { outline: 3px solid var(--akzent); outline-offset: 2px; }
.fotowahl-text { display: flex; flex-direction: column; gap: .3rem; }
.fotowahl-text strong { color: var(--akzent); font-size: 1.05rem; }
.fotowahl.zweit { border-color: var(--linie); }
.fotowahl.zweit .fotowahl-text strong { color: var(--text); }
.fotowahl.gewaehlt { border-style: solid; padding: 1rem; }
.vorschauen { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.vorschauen:not(:empty) { margin-top: .8rem; }
.vorschauen img { width: 5.5rem; height: 7rem; object-fit: cover; border-radius: var(--r-klein); border: 1px solid var(--linie); }
details.name summary { color: var(--text); margin: .2rem 0 .8rem; }

/* Warten beim Lesen */
.warten { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 1rem; background: rgba(20, 28, 27, .45); }
.warten[hidden] { display: none; }
.warten-box { display: flex; flex-direction: column; align-items: center; gap: .5rem; max-width: 20rem; padding: 1.5rem;
  text-align: center; background: var(--flaeche); border-radius: var(--r); }
.kreis { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 3px solid var(--linie); border-top-color: var(--akzent);
  animation: drehen 1s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }

/* Menü: am Handy unten wie in einer App, am PC oben */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--flaeche); border-top: 1px solid var(--linie); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 3.6rem;
  padding: .45rem 0 .4rem; font-size: .72rem; color: var(--text-leise); text-decoration: none; }
.tabs svg { width: 1.45rem; height: 1.45rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.tabs a[aria-current="page"] { color: var(--akzent); font-weight: 600; }
body.mit-tabs main { padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
body.mit-tabs .fuss { padding-bottom: calc(4.6rem + env(safe-area-inset-bottom)); }
.kopf nav.oben { display: none; }
@media (min-width: 720px) {
  .tabs { display: none; }
  .kopf nav.oben { display: flex; }
  body.mit-tabs main { padding-bottom: 3rem; }
  body.mit-tabs .fuss { padding-bottom: 1.2rem; }
  body.mit-tabs .leiste { bottom: 0; }
}

/* Rechtstexte */
.text { max-width: 40rem; }
.text h2 { margin-top: 1.8rem; }
.text p, .text address { max-width: 65ch; }
.text address { font-style: normal; line-height: 1.7; margin-bottom: 1rem; }
.einleitung { font-size: 1.05rem; }
.platzhalter { background: var(--warn); padding: 0 .2em; border-radius: 3px; }
.rechtshinweis { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--linie); color: var(--text-leise); font-size: .875rem; }

/* ---------- Startseite ---------- */
.startseite main { max-width: 1120px; padding-top: 0; }
.startseite .kopf { padding-inline: max(1rem, calc((100% - 1088px) / 2)); }
.kopf { padding-inline: max(1rem, calc((100% - 728px) / 2)); }
.held { display: grid; gap: 2rem; padding: 2.2rem 0 2.5rem; align-items: center; }
.held h1 { font-size: clamp(2.3rem, 7.4vw, 3.7rem); line-height: 1.03; letter-spacing: -.03em; margin-bottom: 1.1rem; }
.held h1 span { display: block; }
.held p { font-size: 1.12rem; max-width: 34ch; color: var(--text-leise); margin: 0 0 1.5rem; }
@media (min-width: 900px) {
  .held { grid-template-columns: 5fr 6fr; gap: 3rem; padding: 4.5rem 0 4rem; }
}

/* Der Plan-Streifen: eine Woche aus dem gedruckten Plan; nach dem Laden fallen die Uhrzeiten unter die Kürzel */
.plan { margin: 0; }
.plan-raster { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: var(--r); overflow: hidden; }
.plan-tag { display: grid; grid-template-rows: auto auto auto; border-left: 1px solid var(--raster); text-align: center; }
.plan-tag:first-child { border-left: 0; }
.plan-kopf { padding: .45rem .1rem; font-size: .75rem; color: var(--text-leise); border-bottom: 1px solid var(--raster);
  font-variant-numeric: tabular-nums; }
.plan-kopf b { display: block; color: var(--text); font-weight: 600; font-size: .9rem; }
.plan-kz { padding: .7rem .1rem; font-family: var(--mono); font-weight: 600; font-size: clamp(.9rem, 3.6vw, 1.15rem);
  border-bottom: 1px solid var(--raster); }
.plan-kz sup { color: var(--akzent); font-size: .8em; line-height: 0; }
.plan-zeit { padding: .55rem .1rem .7rem; min-height: 4.4rem; font-family: var(--mono); font-size: clamp(.66rem, 2.6vw, .8rem);
  line-height: 1.35; color: var(--akzent); }
.plan-zeit span { display: block; }
.plan-tag.we { background: color-mix(in srgb, var(--marker) 55%, var(--flaeche)); }
.plan-tag.frei .plan-zeit { color: var(--text-leise); }
.plan figcaption { margin-top: .7rem; font-size: .85rem; color: var(--text-leise); }
@media (min-width: 900px) { .plan { transform: translateX(1.5rem); } }
@media (prefers-reduced-motion: no-preference) {
  .plan-zeit > * { opacity: 0; transform: translateY(-.9rem); animation: fallen .45s cubic-bezier(.2, .7, .2, 1) forwards; }
  .plan-tag:nth-child(1) .plan-zeit > * { animation-delay: .5s; }
  .plan-tag:nth-child(2) .plan-zeit > * { animation-delay: .62s; }
  .plan-tag:nth-child(3) .plan-zeit > * { animation-delay: .74s; }
  .plan-tag:nth-child(4) .plan-zeit > * { animation-delay: .86s; }
  .plan-tag:nth-child(5) .plan-zeit > * { animation-delay: .98s; }
  .plan-tag:nth-child(6) .plan-zeit > * { animation-delay: 1.1s; }
  .plan-tag:nth-child(7) .plan-zeit > * { animation-delay: 1.22s; }
}
@keyframes fallen { to { opacity: 1; transform: none; } }

.abschnitt { padding: 2.5rem 0; border-top: 1px solid var(--linie); display: grid; gap: 1.2rem; }
.abschnitt h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); letter-spacing: -.015em; line-height: 1.15; margin: 0; max-width: 16ch; }
@media (min-width: 900px) { .abschnitt { grid-template-columns: 4fr 7fr; gap: 3rem; padding: 3.5rem 0; } }

.ablauf { list-style: none; margin: 0; padding: 0; counter-reset: schritt; }
.ablauf li { counter-increment: schritt; display: grid; grid-template-columns: 2.6rem 1fr; gap: .2rem .9rem;
  padding: 1rem 0; border-top: 1px solid var(--raster); }
.ablauf li:first-child { border-top: 0; padding-top: 0; }
.ablauf li::before { content: counter(schritt); grid-row: span 2; font-size: 1.9rem; font-weight: 700; line-height: 1;
  color: var(--akzent); }
.ablauf strong { font-size: 1.05rem; }
.ablauf span { color: var(--text-leise); }

.versprechen { margin: 0; display: grid; gap: 0; }
.versprechen div { padding: .9rem 0; border-top: 1px solid var(--raster); }
.versprechen div:first-child { border-top: 0; padding-top: 0; }
.versprechen dt { font-weight: 600; }
.versprechen dd { margin: .2rem 0 0; color: var(--text-leise); max-width: 60ch; }

.fragen details { border-top: 1px solid var(--raster); }
.fragen details:first-child { border-top: 0; }
.fragen summary { display: flex; justify-content: space-between; gap: 1rem; margin: 0; padding: .9rem 0; color: var(--text);
  font-weight: 600; list-style: none; }
.fragen summary::-webkit-details-marker { display: none; }
.fragen summary::after { content: "+"; color: var(--akzent); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.fragen details[open] summary::after { content: "−"; }
.fragen details p { margin: 0 0 1rem; color: var(--text-leise); max-width: 62ch; }

.schluss { padding: 2.5rem 0 1rem; border-top: 1px solid var(--linie); }
.schluss p { font-size: 1.15rem; font-weight: 600; margin: 0 0 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; }
  .kreis { animation: drehen 3s linear infinite !important; }
}

/* Dunkler Modus: Akzent als Schriftfarbe aufhellen, damit er lesbar bleibt */
@media (prefers-color-scheme: dark) {
  :root { --akzent-text: color-mix(in srgb, var(--akzent) 45%, white); }
  .plan-zeit, .plan-kz sup, .ablauf li::before, .stern, .fragen summary::after, .fotowahl-text strong,
  .tabs a[aria-current="page"], .kopf nav a[aria-current="page"], details summary { color: var(--akzent-text); }
  .fotowahl { border-color: var(--akzent-text); }
}
