/* ===== Dienstplan – DRK-Style, modern, Light & Dark ===== */
:root {
  --rot: #e30613;            /* DRK-Rot */
  --rot-dunkel: #b80410;
  --rot-weich: #fdecee;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f1f3f5;
  --line: #e6e8ec;
  --text: #15181d;
  --muted: #697280;
  --gruen: #1f9d57;
  --gelb: #fff3d4;
  --gelb-text: #8a5a00;
  --blau-bg: #e7eefc;
  --blau-text: #2b4a9b;
  --violett-bg: #f1e8fc;
  --violett-text: #6b2fb3;
  --unbekannt: #aab2bd;
  --line-stark: #c4cad3;
  /* Farbkonzept Dienste: gelb = Tag, violett = Nacht (weich für Kürzel, voll für den Kalender) */
  --tag-bg: #fff1cc;
  --tag-text: #7a4f00;
  --tag-voll: #f5b625;
  --tag-voll-text: #1a1400;
  --nacht-bg: #efe6fd;
  --nacht-text: #5b2a9e;
  --nacht-voll: #7c3aed;
  --nacht-voll-text: #ffffff;
  --schatten: 0 1px 2px rgba(20,25,35,.06), 0 1px 3px rgba(20,25,35,.04);
  --r: 14px;
  --r-s: 10px;
}
html[data-theme="dark"] {
  --rot: #ff2b38;
  --rot-dunkel: #ff4a55;
  --rot-weich: #2a1416;
  --bg: #0e1013;
  --surface: #181b20;
  --surface-2: #21252c;
  --line: #2b2f37;
  --text: #e9ebee;
  --muted: #98a1ad;
  --gruen: #35c074;
  --gelb: #3a3016;
  --gelb-text: #f0c35e;
  --blau-bg: #1b2740;
  --blau-text: #9cb6ff;
  --violett-bg: #2a2140;
  --violett-text: #c4a6ff;
  --unbekannt: #5b646f;
  --line-stark: #4a505b;
  --tag-bg: #3a3016;
  --tag-text: #fbbf24;
  --tag-voll: #fbbf24;
  --tag-voll-text: #0e1013;
  --nacht-bg: #2a2140;
  --nacht-text: #c4b5fd;
  --nacht-voll: #a78bfa;
  --nacht-voll-text: #0e1013;
  --schatten: 0 1px 2px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: pan-x pan-y; } /* kein Zoom per Zwei-Finger-Geste */
button, a, label, select, input, summary, .pname { touch-action: manipulation; } /* kein Zoom per Doppeltipp */
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; color: var(--text); background: var(--bg); line-height: 1.45; -webkit-font-smoothing: antialiased; }
.verborgen { display: none !important; }
.leise { color: var(--muted); }
.leer { color: var(--muted); font-style: italic; }
code { background: var(--surface-2); padding: .05rem .35rem; border-radius: 6px; font-size: .85em; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* Kopf */
header { background: linear-gradient(135deg, var(--rot), var(--rot-dunkel)); color: #fff; padding: calc(env(safe-area-inset-top) + .8rem) 1.1rem .8rem; }
.kopfzeile { display: flex; align-items: center; gap: .6rem; }
.kreuz { width: 26px; height: 26px; background: #fff; border-radius: 7px; position: relative; flex: 0 0 auto; }
.kreuz::before, .kreuz::after { content: ""; position: absolute; background: var(--rot); border-radius: 2px; }
.kreuz::before { left: 50%; top: 20%; width: 26%; height: 60%; transform: translateX(-50%); }
.kreuz::after { top: 50%; left: 20%; height: 26%; width: 60%; transform: translateY(-50%); }
.datenstand { display: inline-flex; align-items: center; gap: .35rem; margin-top: .55rem; padding: .22rem .65rem; border-radius: 999px; background: rgba(255,255,255,.18); color: #fff; font-size: .8rem; text-decoration: none; white-space: nowrap; max-width: 100%; overflow: hidden; }
.datenstand span { overflow: hidden; text-overflow: ellipsis; }
.datenstand .ic { width: 15px; height: 15px; flex: 0 0 auto; }
.datenstand.warn { background: #fff3d4; color: #7a4f00; }
.datenstand.alt { background: #fff; color: var(--rot-dunkel); font-weight: 600; }
.datenstand[hidden] { display: none; }
header h1 { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; flex: 1; }
.themebtn { background: rgba(255,255,255,.16); border: 0; color: #fff; width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; cursor: pointer; }
.themebtn:hover { background: rgba(255,255,255,.26); filter: none; }

/* Navigation */
nav { display: flex; gap: .1rem; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; padding: 0 .4rem; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
nav a { flex: 0 0 auto; padding: .8rem .75rem .7rem; font-size: .9rem; color: var(--muted); text-decoration: none; border-bottom: 2.5px solid transparent; white-space: nowrap; font-weight: 500; transition: color .15s; }
nav a:hover { color: var(--text); }
nav a.aktiv { color: var(--rot); border-bottom-color: var(--rot); font-weight: 600; }

main { max-width: 900px; margin: 0 auto; padding: 1.1rem; }
section { margin-bottom: 1.25rem; }

/* Flächen & Buttons */
.karte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--schatten); }
.daten { padding: 1.1rem; }
.daten-kopf { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.daten-kopf h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.offline { font-size: .72rem; color: var(--muted); }
button { background: var(--rot); color: #fff; border: 0; border-radius: var(--r-s); padding: .6rem .95rem; font-size: .9rem; cursor: pointer; font-weight: 600; transition: filter .15s, background .15s; }
button:hover { filter: brightness(1.05); }
button:active { transform: translateY(.5px); }
button.link { background: none; color: var(--muted); text-decoration: underline; padding: .3rem 0; font-weight: 500; }
button.link:hover { color: var(--text); filter: none; }
button.gefahr { background: none; color: var(--rot); text-decoration: underline; padding: 0; font-size: .78rem; font-weight: 500; }
.reihe { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
ol.anleitung { font-size: .85rem; color: var(--muted); margin: .6rem 0 0; padding-left: 1.2rem; }
ol.anleitung li { margin: .25rem 0; }
ol.anleitung code { background: var(--surface-2); border-radius: 5px; padding: .05rem .3rem; font-size: .82em; }
.howto { margin-top: .7rem; padding: .8rem 1rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); }
.howlead { margin: 0 0 .2rem; font-size: .85rem; color: var(--text); font-weight: 600; }

#drop { display: block; border: 1.5px dashed var(--line); border-radius: var(--r-s); padding: 1.1rem; text-align: center; cursor: pointer; margin-top: .8rem; transition: .15s; background: var(--surface-2); }
#drop:hover, #drop.over { border-color: var(--rot); background: var(--rot-weich); }
#drop b { display: block; font-weight: 600; }
#drop small { color: var(--muted); }
.dateiliste { font-size: .76rem; color: var(--muted); margin-top: .7rem; display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; }

.auswahl { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.auswahl label { font-size: .85rem; color: var(--muted); }
select { font-size: .95rem; padding: .45rem .6rem; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface); color: var(--text); max-width: 240px; }

.zeit { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; }
.partner { margin: 0 0 .45rem; }
.partner b { color: var(--gruen); }
details summary { cursor: pointer; color: var(--muted); font-size: .86rem; }
details summary:hover { color: var(--text); }
.wache { margin-top: .5rem; display: grid; grid-template-columns: 1fr; gap: .4rem .9rem; }
@media (min-width: 620px) { .wache { grid-template-columns: 1fr 1fr; } }
.fz { font-size: .85rem; border-left: 3px solid var(--line); padding: .1rem .5rem; }
.qbadge.vermutet { border-style: dashed; color: var(--muted); }
.qbadge.leer { border-color: transparent; background: var(--surface-2); color: var(--muted); }
.modal-grund { font-size: .82rem; font-weight: 400; color: var(--muted); margin-top: .35rem; }
.qbadge { font-size: .68rem; color: var(--text); border: 1px solid var(--line-stark); border-radius: 6px; padding: 0 .35rem; font-weight: 700; margin-left: .25rem; letter-spacing: .01em; white-space: nowrap; }
.pname { cursor: pointer; }
.fuss { font-size: .78rem; color: var(--muted); margin-top: 1.5rem; }

/* Woche */
.wochekopf { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .8rem; }
.wochekopf b { font-size: 1.05rem; }
.navbtn { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-s); padding: .4rem .75rem; font-weight: 600; }
.wabstand-reihe { margin-bottom: .8rem; justify-content: center; }
.navbtn.aus { opacity: .35; }
.kalexport { justify-content: center; margin-bottom: 1rem; flex-direction: column; align-items: center; gap: .35rem; }
.kalexport a.link { font-size: .85rem; color: var(--muted); }
.wabstand { font-size: .82rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: .15rem .65rem; }
.wabstand.jetzt { color: #fff; background: var(--rot); }
.wliste { touch-action: pan-y; }
.wliste.wisch-links { animation: wischLinks .22s ease-out; }
.wliste.wisch-rechts { animation: wischRechts .22s ease-out; }
@keyframes wischLinks { from { transform: translateX(28px); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes wischRechts { from { transform: translateX(-28px); opacity: .3; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wliste.wisch-links, .wliste.wisch-rechts { animation: none; } }

/* Tausch */
.teilen { background: var(--surface); color: var(--rot); border: 1px solid var(--rot); border-radius: var(--r-s); padding: .4rem .75rem; font-size: .82rem; font-weight: 600; }
.teilen:hover { background: var(--rot-weich); filter: none; }

/* Qualifikationen */

/* Dialog */
.modal-bg { position: fixed; inset: 0; background: rgba(10,12,16,.55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 1rem; }
.modal { background: var(--surface); color: var(--text); border-radius: 18px; padding: 1.1rem 1.15rem; max-width: 360px; width: 100%; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.modal-name { font-weight: 700; font-size: 1.05rem; margin-bottom: .2rem; }
.modal-btns { display: flex; flex-direction: column; gap: .5rem; margin: .85rem 0; }
.qbtn { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-stark); border-radius: var(--r-s); padding: .65rem; font-size: .95rem; font-weight: 700; }
.qbtn.aktiv { background: var(--text); color: var(--surface); border-color: var(--text); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 1rem); transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: .85rem; border-radius: 12px; padding: .6rem .95rem; box-shadow: 0 6px 24px rgba(0,0,0,.3); max-width: 90%; z-index: 60; }

/* Icons (Heroicons, inline) */
.ic { width: 1.1em; height: 1.1em; vertical-align: -0.2em; flex: 0 0 auto; }
button .ic { pointer-events: none; }
.teilen, button#icsBtn { display: inline-flex; align-items: center; gap: .4rem; }
.themebtn { display: inline-flex; align-items: center; justify-content: center; }
.themebtn .ic { width: 19px; height: 19px; vertical-align: middle; }
.navbtn { display: inline-flex; align-items: center; justify-content: center; }
.navbtn .ic { width: 20px; height: 20px; }


/* Versionsanzeige (wird beim Release gesetzt) */
.appversion { text-align: center; color: var(--muted); font-size: .75rem; padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom)); }

/* Hinweis: Zeitraum ohne Abteilungsplan */
.hinweis { background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: var(--r-s); padding: .55rem .8rem; font-size: .88rem; color: var(--muted); margin: 0 0 .9rem; }

/* Vorschau-Umgebung (…/vorschau/): deutlich markiert */
.vorschau-tag { display: none; }
body.vorschau .vorschau-tag { display: inline; color: #b45309; font-weight: 700; }
body.vorschau header::after { content: 'VORSCHAU – Testversion, nicht die Live-App'; display: block; text-align: center; font-size: .72rem; font-weight: 700; letter-spacing: .04em; background: #f59e0b; color: #111; padding: .2rem .4rem; margin: .6rem -1.1rem -.8rem; }

/* ---------- Wache ---------- */
.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .25rem; margin-bottom: .7rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .75rem; font-size: .82rem; font-weight: 600; }
.chip span { color: var(--muted); font-weight: 500; margin-left: .15rem; }
.chip.an { background: var(--rot); border-color: var(--rot); color: #fff; }
.chip.an span { color: rgba(255,255,255,.85); }
.bst { font-size: .74rem; font-weight: 600; border-radius: 999px; padding: .08rem .55rem; }
.bst.warn { background: var(--gelb); color: var(--gelb-text); }
.bst.fehlt { background: var(--rot); color: #fff; }
.wabw { padding: .6rem .8rem; margin-top: .9rem; font-size: .88rem; }
.wabw summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.wabwzeile { margin-top: .4rem; line-height: 1.6; }

/* ---------- Wachenauswahl ---------- */
.wachenwahl { margin-bottom: .5rem; }
.wachenwahl .chip.an { background: var(--text); border-color: var(--text); color: var(--surface); }
.wort { font-size: .72rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: .02rem .4rem; margin-left: .4rem; white-space: nowrap; }

/* ---------- Person ---------- */
.ksuche { margin-bottom: .8rem; }
.ksuche input { display: block; width: 100%; box-sizing: border-box; font: inherit; font-size: 1rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); padding: .6rem .75rem; min-height: 44px; }
.ktreffer { display: flex; flex-direction: column; margin-top: .3rem; }
.ktreffer:empty { display: none; }
.ktreffer-btn { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 0; text-align: left; padding: .6rem .75rem; min-height: 44px; font-weight: 600; margin-top: -1px; }
.ktreffer-btn:first-child { border-radius: var(--r-s) var(--r-s) 0 0; }
.ktreffer-btn:last-child { border-radius: 0 0 var(--r-s) var(--r-s); }
.ktreffer-btn:only-child { border-radius: var(--r-s); }
.ksuche #kIch { margin-top: .4rem; }
.qdienste { margin-left: auto; font-size: .82rem; white-space: nowrap; }
.modal-dienste { display: block; margin: .6rem auto 0; font-size: .9rem; }

/* ---------- Tausch anfragen ---------- */
button.anfragen { margin-left: auto; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); padding: .25rem .6rem; font-size: .8rem; display: inline-flex; align-items: center; gap: .3rem; }
button.anfragen .ic { width: 15px; height: 15px; }
.amodal { text-align: left; max-width: 34rem; width: calc(100% - 1.5rem); max-height: 92vh; overflow: auto; }
.amodal label { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: .5rem; }
.amodal input, .amodal select, .amodal textarea { display: block; width: 100%; box-sizing: border-box; margin-top: .2rem; font: inherit; font-weight: 400; font-size: .92rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .55rem; }
.amodal textarea { resize: vertical; line-height: 1.45; }
a.knopf { background: var(--rot); color: #fff; border-radius: var(--r-s); padding: .6rem .95rem; font-size: .9rem; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
a.knopf .ic { width: 18px; height: 18px; }

/* ---------- Wache fahrzeugbasiert ---------- */
.segment { display: flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; margin-bottom: .5rem; overflow-x: auto; }
.segment button { flex: 1 0 auto; background: none; color: var(--muted); border-radius: 999px; padding: .3rem .6rem; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.planansicht { margin-bottom: .8rem; }
.segment button.an { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.fzk { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .45rem .7rem .35rem; margin-bottom: .5rem; box-shadow: var(--schatten); }
.fzk.meins { border-color: var(--rot); box-shadow: 0 0 0 1px var(--rot) inset; }
.fzkopf { font-size: .8rem; color: var(--muted); display: flex; gap: .4rem; align-items: baseline; padding: .15rem 0 .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fzkopf .mkal-leg { margin-left: auto; }
.fzkopf b { color: var(--text); font-size: .85rem; }
.fzfunk { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.sch { display: grid; grid-template-columns: minmax(3.1rem, max-content) minmax(3.9rem, max-content) minmax(0, 1fr) auto; gap: .5rem; align-items: center; min-height: 36px; border-top: 1px dashed var(--line); font-size: .88rem; }
.sch > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sch > .wcode, .sch > .zeit, .sch > .tztag { overflow: visible; text-overflow: clip; }
.sch .wcode { justify-self: start; max-width: 100%; border-radius: 6px; padding: .05rem .4rem; font-size: .8rem; font-weight: 700; }
.sch .zeit { font-size: .82rem; }
.sch .bst { justify-self: end; font-size: .7rem; }
.sch.vortag .wcode, .sch.vortag .zeit, .sch.vortag .schleute { opacity: .55; }
.sch.ich .wcode { box-shadow: 0 0 0 2px var(--rot); }
/* ---------- Sync ---------- */
.formular label { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: .45rem; }
.formular input { display: block; width: 100%; box-sizing: border-box; margin-top: .2rem; font: inherit; font-weight: 400; font-size: .92rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .55rem; }
.formular .reihe { margin-top: .6rem; }
.aufklapper { margin-top: .6rem; font-size: .88rem; }
.aufklapper summary { cursor: pointer; color: var(--muted); font-weight: 600; }

/* Chip-Leisten seitlich scrollbar (Wischen wechselt dort nicht den Tag) */
.chips, .segment, nav { touch-action: pan-x; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.chips .chip, .segment button { touch-action: pan-x; }

/* ---------- Dienstzeilen (Woche, Monat, Person): eine Zeile je Dienst ---------- */
.dtab { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; overflow: clip; box-shadow: var(--schatten); margin-bottom: 1rem; }
.dz { display: grid; grid-template-columns: minmax(3.1rem, max-content) minmax(3.1rem, max-content) minmax(4.3rem, max-content) minmax(3.8rem, max-content) minmax(0, 1fr); gap: .4rem; align-items: center; min-height: 44px; padding: 0 .65rem; border-top: 1px solid var(--line); font-size: .84rem; font-variant-numeric: tabular-nums; }
.dz > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dz-kopf { min-height: 0; padding-top: .4rem; padding-bottom: .4rem; border-top: 0; background: var(--surface-2); color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
@media (min-width: 620px) { .dz { grid-template-columns: minmax(4rem, max-content) minmax(4.5rem, max-content) minmax(5.5rem, max-content) minmax(4.5rem, max-content) minmax(0, 1fr); gap: .8rem; padding: 0 1rem; } }
/* Monatszeile: über die ganze Breite, klebt beim Scrollen unter der Navigation */
.dz-monat { position: sticky; top: var(--nav-h, 0px); z-index: 2; background: var(--surface-2); border-top: 1px solid var(--line); padding: .4rem .65rem; font-size: .84rem; font-weight: 700; color: var(--text); }
@media (min-width: 620px) { .dz-monat { padding: .4rem 1rem; } }
.dz.heute { background: var(--rot-weich); box-shadow: inset 4px 0 0 var(--rot); }
/* Kleine Zeile über heute bzw. einem Feiertag: „Heute“, „1. Weihnachtstag“, „Heute · 2. Weihnachtstag“ */
.dz-marke { border-top: 1px solid var(--line); padding: .3rem .65rem 0; line-height: 1.35; font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--rot); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dz-marke.heute { background: var(--rot-weich); box-shadow: inset 4px 0 0 var(--rot); }
.dz-marke + .dz { border-top: 0; }
@media (min-width: 620px) { .dz-marke { padding: .3rem 1rem 0; } }
.dz-marke + .dz { min-height: 38px; }
.dz.abw { opacity: .6; }
button.dz-tag { background: none; color: var(--text); padding: 0; min-height: 44px; border-radius: 0; font-size: inherit; font-weight: 700; text-align: left; }
button.dz-tag:hover { filter: none; text-decoration: underline; }
.dz.heute .dz-tag, .dz-tag.ft { color: var(--rot); }
.dz-code { justify-self: start; max-width: 100%; border-radius: 6px; padding: .08rem .4rem; font-size: .82rem; font-weight: 700; }
.s-tag .dz-code, .wcode.s-tag { background: var(--tag-bg); color: var(--tag-text); }
.s-nacht .dz-code, .wcode.s-nacht { background: var(--nacht-bg); color: var(--nacht-text); }
.s-frei .dz-code, .wcode.s-frei { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.dz.s-frei .dz-tag { color: var(--muted); }
/* Datum wird nie gekürzt: Spalte wächst notfalls mit (minmax … max-content), kein „…“ */
.dz > .dz-tag, .dz > .dz-code, .dz > .dz-zeit, .dz > .dz-fz, .sch.tz > .tztag { overflow: visible; text-overflow: clip; }
.dz-fz { color: var(--muted); font-size: .8rem; letter-spacing: -.01em; }
.dz-mit .pname:hover { text-decoration: underline; }

/* Monatskalender (Woche, Monat) */
.mkal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .7rem .75rem .8rem; box-shadow: var(--schatten); margin-bottom: 1rem; }
.mkal-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.mkal-leg { display: flex; align-items: center; gap: .3rem; font-size: .76rem; color: var(--muted); }
.mkal-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: .5rem; }
.mkal-leg i.s-tag { background: var(--tag-voll); }
.mkal-leg i.s-nacht { background: var(--nacht-voll); }
.mkal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mk-wt { text-align: center; font-size: .68rem; font-weight: 700; color: var(--muted); }
button.mk { height: 34px; padding: 0; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
button.mk:hover { filter: brightness(.97); }
button.mk.s-tag { background: var(--tag-voll); color: var(--tag-voll-text); }
button.mk.s-nacht { background: var(--nacht-voll); color: var(--nacht-voll-text); }
button.mk.s-aus { background: none; color: var(--unbekannt); }
button.mk.mk-woche { box-shadow: 0 0 0 2px var(--text) inset; }
button.mk.mk-heute { outline: 2px solid var(--rot); outline-offset: 1px; }

/* ---------- Variante B in der ganzen App: eine Zeile je Eintrag ---------- */
.schleute .pname.ich { font-weight: 700; }
.wabwzeile { margin-top: .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filterzeile { display: flex; gap: .5rem; align-items: center; flex-wrap: nowrap; margin-bottom: .9rem; font-size: .85rem; }
.filterzeile label { white-space: nowrap; }
.filterzahl { margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* Tauschen */
.tauschwahl label { display: flex; flex-direction: column; gap: .3rem; width: 100%; font-weight: 600; font-size: .8rem; }
.tauschwahl select { max-width: none; width: 100%; min-height: 44px; }
.tauschmit { margin: 0 0 .7rem; font-size: .88rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tauschmit b { color: var(--text); }
.kkopf { display: flex; align-items: center; gap: .35rem; padding: .15rem 0 .35rem; white-space: nowrap; min-width: 0; }
.kkopf .kname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.kzahl { margin-left: auto; font-size: .78rem; }
.sch.tz { grid-template-columns: minmax(3.2rem, max-content) 3.1rem minmax(0, 1fr) auto; min-height: 44px; }
.tztag { font-weight: 700; }
/* Monatszeile in den Tauschkarten: über die ganze Kartenbreite, vor dem ersten Gegentag und bei jedem Monatswechsel */
.tz-monat { margin: 0 -.7rem; padding: .3rem .7rem; background: var(--surface-2); border-top: 1px solid var(--line); font-size: .8rem; font-weight: 700; color: var(--text); }
.tz-monat + .sch { border-top: 0; }
.tztag.folge { color: var(--muted); }
.sch.tz button.anfragen { margin: 0; }
.kand.unpassend { box-shadow: none; }
.kein { font-size: .84rem; color: var(--muted); padding: .1rem 0 .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kaktion { margin: .35rem 0 .2rem; }
.nknoepfe { gap: .5rem; margin-top: .5rem; flex-wrap: wrap; }
.nknoepfe .knopf, .nknoepfe button { flex: 1 1 auto; text-align: center; justify-content: center; }
.teilen.klein { padding: .3rem .6rem; font-size: .78rem; }

/* Quali */
.suchfeld { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 .75rem; margin-bottom: .7rem; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); color: var(--muted); }
.suchfeld input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: .95rem; outline: none; }
.qz { display: grid; grid-template-columns: minmax(0, 1fr) 3.6rem 3.9rem 3.9rem; gap: .45rem; align-items: center; min-height: 44px; padding: 0 .7rem; border-top: 1px solid var(--line); font-size: .88rem; }
.qz > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.qz.dz-kopf { min-height: 0; }
.qz .qbadge { margin-left: 0; }
.qz button.qdienste { margin-left: 0; justify-self: start; color: var(--muted); text-decoration: none; padding: 0; text-align: left; font-variant-numeric: tabular-nums; }


/* Datenimport */
.marke { font-size: .75rem; font-weight: 700; color: var(--gruen); }
.izeile { display: flex; gap: .5rem; justify-content: space-between; font-size: .9rem; white-space: nowrap; }
.izeile > span:first-child { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dateitab { margin: .8rem 0 .4rem; box-shadow: none; }
.iz { display: grid; grid-template-columns: 1.2rem minmax(0, 1fr) auto; gap: .5rem; align-items: center; min-height: 38px; padding: 0 .7rem; border-top: 1px solid var(--line); font-size: .85rem; }
.iz > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.iz.dz-kopf { min-height: 0; }
.dateiliste > span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Login und gemeinsamer Dienstplan (Supabase) ---------- */
body.nurlogin nav { display: none !important; }
.karte.login { max-width: 26rem; margin: 2rem auto; padding: 1.1rem 1.2rem; }
.karte.login h2 { margin-top: 0; }
/* Login mit Face ID / Fingerabdruck (Passkey) – groß oben, Passwort darunter */
.breitknopf { display: flex; width: 100%; align-items: center; justify-content: center; gap: .55rem; padding: .85rem 1rem; font-size: 1rem; margin: .3rem 0 .2rem; }
.breitknopf .ic { width: 24px; height: 24px; }
.oder { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .8rem; margin: .8rem 0 .5rem; }
.oder::before, .oder::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
button.zweitrangig { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.karte.konto button .ic { width: 18px; height: 18px; vertical-align: -4px; }
#kontoBtn.an { background: rgba(255,255,255,.22); }
.rollentab { margin: .6rem 0 .2rem; box-shadow: none; }
.iz.rz { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) auto; padding: .3rem .7rem; }
@media (max-width: 520px) { .iz.rz { grid-template-columns: minmax(0, 1fr) auto; } .iz.rz .rmail { grid-column: 1 / -1; } }
.iz.rz select { font: inherit; font-size: .82rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .25rem .3rem; min-width: 0; max-width: 100%; }
.rmail { color: var(--muted); }
button[disabled] { opacity: .5; cursor: default; }
.themebtn[hidden], nav a[hidden] { display: none !important; }
/* Nutzer:innen: eigene Person fest – als Text statt Auswahl */

/* Spalten einer Tabelle/Karte gemeinsam so breit wie der breiteste Eintrag (Datum, Kürzel, Zeit werden nie gekürzt
   und bleiben untereinander bündig). Ohne subgrid gelten die Spaltenbreiten der einzelnen Zeilen oben. */
@supports (grid-template-columns: subgrid) {
  .dtab { display: grid; grid-template-columns: minmax(2.5rem, max-content) minmax(3.1rem, max-content) minmax(3.5rem, max-content) minmax(3.6rem, max-content) minmax(0, 1fr); column-gap: .4rem; }
  .dtab > * { grid-column: 1 / -1; }
  .dtab > .dz { grid-template-columns: subgrid; }
  @media (min-width: 620px) { .dtab { grid-template-columns: minmax(4rem, max-content) minmax(4.5rem, max-content) minmax(5.5rem, max-content) minmax(4.5rem, max-content) minmax(0, 1fr); column-gap: .8rem; } }
  .fzk.raster { display: grid; grid-template-columns: minmax(2.6rem, max-content) minmax(3.1rem, max-content) minmax(0, 1fr) auto; column-gap: .5rem; }
  .fzk.raster > * { grid-column: 1 / -1; }
  .fzk.raster > .sch { grid-template-columns: subgrid; }
}

/* ---------- Kollegen-Info (Tippen auf einen Namen) ---------- */
.modal-info { margin: .75rem 0 .2rem; }
.kinfo { border-radius: var(--r-s); padding: .75rem .8rem; background: var(--surface-2); border: 1px solid var(--line); }
.kinfo.s-tag { background: var(--tag-bg); border-color: var(--tag-voll); }
.kinfo.s-tag .kinfo-dienst b { color: var(--tag-text); }
.kinfo.s-nacht { background: var(--nacht-bg); border-color: var(--nacht-voll); }
.kinfo.s-nacht .kinfo-dienst b { color: var(--nacht-text); }
.kinfo-wann { font-size: 1.35rem; font-weight: 800; line-height: 1.15; }
.kinfo-datum { font-size: .9rem; margin-top: .1rem; }
.kinfo-dienst { margin-top: .45rem; font-size: 1rem; white-space: nowrap; }
.kinfo-lang { font-size: .82rem; color: var(--muted); margin-top: .1rem; }
.kinfo-mit { margin-top: .45rem; font-size: .95rem; }
.kinfo-mit .pname { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.kinfo-leer { color: var(--muted); margin: .4rem 0; }
.kinfo-mail { display: inline-flex; align-items: center; gap: .35rem; margin-top: .8rem; font-size: .9rem; color: var(--rot); text-decoration: none; word-break: break-all; }
.kinfo-mail .ic { width: 16px; height: 16px; flex: none; }
.kinfo-hinweis { font-size: .72rem; color: var(--muted); margin-top: .1rem; }

/* Umdisponieren (nur Admin) */
.ud-ist { display: flex; flex-wrap: wrap; gap: .35rem .5rem; align-items: center; font-size: .86rem; padding: .1rem 0 .4rem; }
.udv { display: grid; grid-template-columns: .7rem minmax(0, 1fr) auto; gap: .55rem; align-items: start; border-top: 1px dashed var(--line); padding: .45rem 0; font-size: .87rem; }
.udv .ampel { width: .7rem; height: .7rem; border-radius: 50%; margin-top: .3rem; }
.udv .ampel.gruen { background: var(--gruen); }
.udv .ampel.gelb { background: var(--tag-voll); }
.udv-art { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.udv-schritt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.udv-pfeil { font-weight: 600; white-space: nowrap; }
.udv-hinweis { font-size: .78rem; color: var(--gelb-text); margin-top: .1rem; }
.udv-kopieren { padding: .2rem; }
.udv-kopieren .ic { width: 18px; height: 18px; }
.udweitere summary { font-size: .82rem; color: var(--muted); padding: .35rem 0; cursor: pointer; }
.chip.udrot:not(.an) { border-color: var(--rot); color: var(--rot); }
.udk .kein { white-space: normal; }
.kand[hidden], #tKeiner[hidden] { display: none; }

/* Am PC per QR-Code anmelden */
.qrlogin .anleitung { margin: .2rem 0 .8rem; padding-left: 1.2rem; font-size: .9rem; }
.qrbild { width: 232px; height: 232px; margin: .4rem auto .3rem; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: var(--r-s); border: 1px solid var(--line); }
.qrbild svg { width: 100%; height: 100%; display: block; border-radius: var(--r-s); }
.qrcode { text-align: center; font: 600 1.35rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; margin: .3rem 0 .4rem; }
.pcform { gap: .5rem; flex-wrap: nowrap; }
.pcform input { flex: 1; min-width: 0; min-height: 44px; font: 600 1.05rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; }
.pcbestaetigen p { margin: .2rem 0 .5rem; }

/* Dienstplan: Suche nach Kolleg:innen und Anzeige, wessen Plan gezeigt wird */
.plansuche .suchfeld { margin-bottom: .4rem; }
.plansuche .ktreffer:empty { display: none; }
.planperson { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: .1rem 0 .8rem; padding: .55rem .75rem; border: 1px solid var(--line); border-left: 4px solid var(--rot); border-radius: var(--r-s); background: var(--surface); }
.planperson .planname { font-weight: 700; }
.planperson .planinfo { font-size: .8rem; margin-top: .1rem; }
.planperson .link { white-space: nowrap; }
.plansuche .suchfeld input { border: 0; padding: 0; min-height: 0; background: none; }
