/* Terminplaner Kehrbezirk
   Papier wie ein Kehrbuch, Tinte wie die Arbeitskleidung, Messing wie die Knöpfe.
   Die Farben f0–f5 kennzeichnen die Zeitfenster; ein Termin trägt die Farbe seines Fensters. */

:root {
  --papier: #E9EDEF;
  --flaeche: #FFFFFF;
  --tinte: #1C2730;
  --grau: #56636E;
  --linie: #CDD5DA;
  --linie-hell: #E1E6E9;
  --messing: #85600E;
  --messing-hell: #F3E8C9;
  --gruen: #22665A;
  --gruen-hell: #DCEDE7;
  --rot: #A3342A;
  --rot-hell: #F7DFDB;
  --pause: #DCE2E5;
  --f0: #3B6787; --f1: #85600E; --f2: #2B7765; --f3: #844868; --f4: #616B26; --f5: #96502F;
  /* Farbkennzeichnung der Termine (farben.py) */
  --m-rot: #C5372C; --m-orange: #D9621B; --m-gelb: #D9A400; --m-gruen: #2E8B4E; --m-tuerkis: #0F8C8C; --m-blau: #2470C2; --m-lila: #7E4BB8; --m-rosa: #C93E7C; --m-braun: #8A5A3B; --m-grau: #5F6B75;
  --schrift: "Bahnschrift", "DIN Alternate", "DIN Next LT Pro", "Roboto Condensed", "Segoe UI", system-ui, sans-serif;
  --schrift-eng: "Bahnschrift SemiCondensed", "Bahnschrift", "DIN Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --radius: 5px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --papier: #141A1F; --flaeche: #1D252C; --tinte: #E6EBEE; --grau: #9AA7B0; --linie: #34404A; --linie-hell: #27313A;
    --messing: #D8AA45; --messing-hell: #3A2F14; --gruen: #6CC0A9; --gruen-hell: #173229; --rot: #E57E70; --rot-hell: #3D1E1A;
    --pause: #10151A;
    --f0: #6F9CC0; --f1: #D2A23F; --f2: #5DB59C; --f3: #C484A5; --f4: #A9B45C; --f5: #D48A63;
    --m-rot: #F0786C; --m-orange: #F79A5B; --m-gelb: #F2C744; --m-gruen: #6CCB8B; --m-tuerkis: #55C6C6; --m-blau: #6FAEF0; --m-lila: #B594E6; --m-rosa: #F08DB6; --m-braun: #C99B7C; --m-grau: #A3AEB7;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--papier); color: var(--tinte);
  font-family: var(--schrift); font-size: 16px; line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration-color: var(--messing); text-underline-offset: 2px; }
a:hover { color: var(--messing); }
:focus-visible { outline: 3px solid var(--messing); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--schrift-eng); line-height: 1.15; margin: 0; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }
h2 { font-size: 21px; font-weight: 600; margin: 34px 0 10px; }
h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
p { margin: 0 0 10px; }
small, .klein { font-size: 14px; color: var(--grau); }

/* Kopf */
.kopf {
  display: flex; align-items: baseline; gap: 6px 26px; flex-wrap: wrap;
  padding: 14px 24px 0; background: var(--flaeche); border-bottom: 1px solid var(--linie);
}
.marke { font-family: var(--schrift-eng); font-weight: 700; font-size: 20px; text-decoration: none; padding-bottom: 12px; }
.marke span { font-weight: 400; color: var(--grau); margin-left: 8px; font-size: 16px; }
.nav { display: flex; gap: 2px 18px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; text-decoration: none; color: var(--grau); padding: 4px 0 12px; border-bottom: 3px solid transparent; }
.nav a:hover { color: var(--tinte); }
.nav a[aria-current] { color: var(--tinte); border-bottom-color: var(--messing); font-weight: 600; }

/* Seite */
.seite { max-width: 1180px; margin: 0 auto; padding: 26px 24px 80px; }
.seite.breit { max-width: none; }
.unterzeile, .einleitung { color: var(--grau); max-width: 75ch; }
.einleitung { margin-bottom: 18px; }
.zurueck { margin-bottom: 6px; font-size: 15px; }
.zurueck a::before { content: "‹ "; }
.leer { color: var(--grau); padding: 18px 0; }
.randnotiz { color: var(--grau); font-size: 14px; margin-top: 8px; }
.rechtsbuendig { display: flex; justify-content: flex-end; margin-top: -6px; }
.zweispaltig { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px 28px; align-items: start; }
.zweispaltig.eng { gap: 10px 20px; }
.schlicht { padding-left: 18px; }
.schlicht li { margin-bottom: 6px; }

/* Meldungen und Hinweise */
.meldung { border-left: 5px solid var(--gruen); background: var(--gruen-hell); padding: 10px 14px; margin: 0 0 20px; border-radius: 0 var(--radius) var(--radius) 0; }
.meldung p { margin: 0; }
.meldung ul { margin: 6px 0 0; padding-left: 18px; }
.meldung.warnung { border-color: var(--messing); background: var(--messing-hell); }
.meldung.fehler { border-color: var(--rot); background: var(--rot-hell); }
.hinweis { font-size: 14px; padding-left: 10px; border-left: 3px solid var(--linie); margin: 2px 0; }
.hinweis.pruefen { border-color: var(--rot); }
.intern { background: var(--messing-hell); padding: 8px 12px; border-radius: var(--radius); }

.status { display: inline-block; font-size: 13px; padding: 1px 8px; border-radius: 10px; background: var(--linie-hell); white-space: nowrap; }
.status.s-pruefen { background: var(--rot-hell); color: var(--rot); }
.status.s-offen { background: var(--gruen-hell); color: var(--gruen); }
.status.s-geplant { background: var(--flaeche); border: 1px dashed var(--grau); }
.status.s-angekuendigt, .status.s-bestaetigt { background: var(--messing-hell); color: var(--messing); }
.status.s-erledigt { text-decoration: line-through; }
.platzhalter { color: var(--messing); font-weight: 700; margin-left: 1px; }
.termin-link { display: block; font-size: 14px; margin-top: 3px; }

/* Knöpfe und Formulare */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; color: var(--flaeche); background: var(--tinte);
  border: 1px solid var(--tinte); border-radius: var(--radius); padding: 8px 16px; min-height: 40px;
  text-decoration: none; cursor: pointer;
}
.knopf:hover { background: var(--messing); border-color: var(--messing); color: #fff; }
.knopf.leise { background: transparent; color: var(--tinte); border-color: var(--linie); }
.knopf.leise:hover { border-color: var(--messing); color: var(--messing); background: transparent; }
.knopf.gefahr { background: transparent; color: var(--rot); border-color: var(--rot); }
.knopf.gefahr:hover { background: var(--rot); color: #fff; }
.knopf.klein { min-height: 30px; padding: 3px 10px; font-size: 14px; font-weight: 500; }
.knopfreihe { display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap; }

input, select, textarea {
  font: inherit; color: var(--tinte); background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: var(--radius); padding: 6px 9px; min-height: 38px; max-width: 100%;
}
input[type="checkbox"] { min-height: 0; width: 18px; height: 18px; accent-color: var(--messing); vertical-align: -3px; }
textarea { width: 100%; }
textarea.code { font-size: 14px; }
.mini { width: 70px; }
.feld { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; min-width: 0; }
.feld > span { font-size: 14px; color: var(--grau); }
.feld.kurz input, .feld.kurz select, input.kurz { width: 130px; }
.feld.falsch input, .feld.falsch select, .einstellung.falsch input, .einstellung.falsch select { border-color: var(--rot); }
.feld.falsch small, .einstellung.falsch small { color: var(--rot); }
.feldreihe { display: flex; flex-wrap: wrap; gap: 0 14px; align-items: flex-end; }
.haken { display: flex; gap: 8px; align-items: baseline; margin: 6px 0; cursor: pointer; }
.haken-gruppe { border: 0; padding: 0; margin: 0 0 12px; }
.haken-gruppe legend { font-size: 14px; color: var(--grau); padding: 0; margin-bottom: 2px; }
.haken-gruppe.waagrecht { display: flex; flex-wrap: wrap; gap: 0 18px; }
.haken-gruppe.waagrecht legend { width: 100%; }
.inline { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.inline-form { display: inline; }
.inline-zeile { display: flex; flex-wrap: wrap; gap: 0 14px; align-items: flex-end; margin-top: 14px; }
.inline-zeile > .knopf, .inline-zeile > .haken { margin-bottom: 12px; }

.block-form { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.block-form h2:first-child, .block-form h3:first-child { margin-top: 0; }
.block-form h2 { font-size: 18px; margin: 24px 0 10px; }
.block-form.breit { max-width: none; }
.block-form .feld input:not([type]), .block-form .feld input[type="text"] { width: 100%; }
.einstellungen fieldset { border: 0; padding: 0 0 6px; margin: 0; }
.einstellungen > fieldset > legend { float: left; width: 100%; font-family: var(--schrift-eng); font-size: 18px; font-weight: 600; padding: 16px 0 8px; margin-top: 8px; border-top: 1px solid var(--linie); }
.einstellungen > fieldset:first-child > legend { border-top: 0; margin-top: 0; padding-top: 0; }
.einstellungen > fieldset > legend + * { clear: both; }
.einstellung { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: 4px 20px; align-items: start; padding: 6px 0; }
.einstellung .feld, .einstellung .haken, .einstellung .haken-gruppe { margin: 0; }
.einstellung small { padding-top: 22px; }
.einstellung .haken + small { padding-top: 6px; }
.speicherleiste { position: sticky; bottom: 0; background: var(--flaeche); padding: 12px 0 4px; border-top: 1px solid var(--linie); }

/* Planen-Formular */
.planen-form { margin: 20px 0 16px; padding: 18px 20px 14px; background: var(--flaeche); border: 1px solid var(--linie); border-left: 5px solid var(--messing); border-radius: var(--radius); }
.planen-form h2 { margin: 0 0 12px; }

/* Unbekannte Angaben */
.unbekannt { margin: 22px 0; padding: 14px 18px; border: 1px solid var(--rot); border-radius: var(--radius); background: var(--flaeche); }
.unbekannt h2 { margin-top: 0; font-size: 18px; }
.zuordnen { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--linie-hell); }
.unbekannt-text { font-weight: 600; min-width: 180px; }
.unbekannt-text small { font-weight: 400; }

/* Tabellen */
.tabelle-rahmen { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); }
.tabelle-rahmen.schmal { max-width: 640px; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabelle th, .tabelle td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--linie-hell); }
.tabelle thead th { font-weight: 600; font-size: 14px; color: var(--grau); background: var(--flaeche); border-bottom: 1px solid var(--linie); white-space: nowrap; }
.tabelle tbody tr:last-child td, .tabelle tbody tr:last-child th { border-bottom: 0; }
.tabelle .zahl { text-align: right; }
.tabelle .auffaellig { color: var(--rot); font-weight: 700; }
.tabelle tr.inaktiv { color: var(--grau); }
.tabelle tr.neuer-tag td { border-top: 2px solid var(--linie); }
.tabelle tbody th { font-weight: 600; white-space: nowrap; }
.positionen tr.zeile-pruefen td:first-child { box-shadow: inset 4px 0 0 var(--rot); }
.positionen tr.zeile-geplant { color: var(--grau); }
.positionen tr:target td { background: var(--messing-hell); }
.matrix td, .matrix thead th:not(:first-child) { text-align: center; }
.block-form .tabelle-rahmen + .knopf, .block-form .tabelle-rahmen + .haken { margin-top: 12px; }
.kontakte td { min-width: 180px; }
.kuerzel-form, .zeitfenster-form { display: grid; grid-template-columns: 150px minmax(140px, 1fr) minmax(160px, 1.4fr) auto auto; gap: 8px; align-items: center; }
.zeitfenster-form { grid-template-columns: 16px minmax(120px, 1fr) 140px 140px auto auto auto; }
.farbpunkt { display: inline-block; width: 12px; height: 12px; border-radius: 6px; background: var(--fc); margin-right: 8px; vertical-align: -1px; }

/* Reiter */
.reiter { display: flex; gap: 4px; margin: 26px 0 10px; border-bottom: 1px solid var(--linie); overflow-x: auto; }
.reiter a { text-decoration: none; padding: 7px 14px; color: var(--grau); border-bottom: 3px solid transparent; white-space: nowrap; }
.reiter a span { font-size: 13px; background: var(--linie-hell); border-radius: 9px; padding: 0 7px; margin-left: 4px; }
.reiter a[aria-current] { color: var(--tinte); border-bottom-color: var(--messing); font-weight: 600; }

/* Übersicht */
.aufgaben { list-style: none; padding: 0; margin: 18px 0 0; border-top: 1px solid var(--linie); }
.aufgaben li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--linie); }
.tage { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tag { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); text-decoration: none; }
.tag:hover { border-color: var(--messing); color: inherit; }
.tag span { display: flex; justify-content: space-between; color: var(--grau); font-size: 15px; }
.tag b { color: var(--tinte); }

/* Kunden */
.suche { display: flex; gap: 10px; margin: 16px 0 6px; max-width: 640px; }
.suche input { flex: 1; }
.angaben { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; margin: 0; }
.angaben dt { color: var(--grau); font-size: 15px; }
.angaben dd { margin: 0; }
.kurzcode { font-family: var(--schrift-eng); font-size: 20px; letter-spacing: 0.12em; }

/* Kalender-Kopf */
.kalender-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.datumwahl { display: flex; gap: 6px; align-items: center; }
.datumwahl .knopf { min-width: 40px; padding: 6px 12px; }
.woche { display: flex; gap: 4px; margin: 16px 0 12px; overflow-x: auto; }
.woche a { flex: 1; min-width: 74px; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 4px; text-decoration: none; border-radius: var(--radius); border: 1px solid transparent; color: var(--grau); }
.woche a b { color: var(--tinte); min-height: 1.4em; }
.woche a.heute span { color: var(--messing); font-weight: 600; }
.woche a.wochenende { opacity: 0.6; }
.woche a[aria-current] { background: var(--flaeche); border-color: var(--linie); color: var(--tinte); }
.woche .woche-sprung { flex: 0 0 34px; min-width: 34px; justify-content: center; font-size: 20px; }

.legende { color: var(--grau); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.legende span { padding: 0 8px; border-radius: 3px; border: 1px solid var(--grau); }
.leg-geplant { border-style: dashed !important; }
.leg-angekuendigt { background: var(--linie-hell); }
.leg-erledigt { text-decoration: line-through; opacity: 0.7; }
.leg-neu { border: 2px solid var(--messing) !important; }
.leg-alt { opacity: 0.55; }

/* Zeitleiste: das zentrale Bild. Linker Rand jeder Spalte = Ankunftsfenster als Klammern. */
.zeitleiste {
  display: grid; grid-template-columns: 40px repeat(var(--spalten), minmax(230px, 1fr));
  overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  position: relative;
}
.zl-ecke, .zl-kopf { position: sticky; top: 0; z-index: 3; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.zl-kopf { padding: 10px 12px; border-left: 1px solid var(--linie); display: flex; gap: 2px 10px; flex-wrap: wrap; align-items: baseline; }
.zl-kopf strong { font-family: var(--schrift-eng); font-size: 17px; }
.zl-kopf span { color: var(--grau); font-size: 14px; }
.zl-kopf .zl-hinweis { color: var(--messing); }
.zl-achse { grid-row: 2; position: relative; height: var(--hoehe); }
.zl-achse span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 13px; color: var(--grau); }
.zl-spalte {
  grid-row: 2; position: relative; height: var(--hoehe); border-left: 1px solid var(--linie);
  background-color: var(--pause);
  background-image: repeating-linear-gradient(to bottom, var(--linie) 0 1px, transparent 1px calc(60 * var(--px)));
}
.zl-flaeche { position: absolute; left: 0; right: 0; }
.zl-flaeche.block { background: var(--flaeche); background-image: repeating-linear-gradient(to bottom, var(--linie-hell) 0 1px, transparent 1px calc(60 * var(--px))); }
.zl-flaeche.sperre {
  left: var(--rand); z-index: 1;
  background: repeating-linear-gradient(-45deg, var(--linie) 0 6px, transparent 6px 12px);
  border-top: 2px solid var(--grau); border-bottom: 2px solid var(--grau);
}
.zl-flaeche.sperre span { position: absolute; top: 4px; left: 8px; font-size: 13px; background: var(--flaeche); padding: 0 6px; border-radius: 3px; }
.band {
  position: absolute; z-index: 2; width: 9px; left: calc(4px + var(--lane) * 13px);
  background: var(--fc); border-radius: 5px; opacity: 0.9;
}
.band span {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  writing-mode: vertical-rl; transform: translateX(-50%) rotate(180deg);
  font-size: 11px; line-height: 1; color: #fff; white-space: nowrap; font-weight: 600;
}
.f0 { --fc: var(--f0); } .f1 { --fc: var(--f1); } .f2 { --fc: var(--f2); }
.f3 { --fc: var(--f3); } .f4 { --fc: var(--f4); } .f5 { --fc: var(--f5); } .fx { --fc: var(--grau); }

.eintrag {
  position: absolute; z-index: 2;
  left: calc(var(--rand) + (100% - var(--rand) - 6px) * var(--lane) / var(--lanes));
  width: calc((100% - var(--rand) - 6px) / var(--lanes) - 3px);
  display: block; overflow: hidden;
  padding: 3px 8px 2px 9px; font-size: 13px; line-height: 16px; text-decoration: none; color: var(--tinte);
  background: color-mix(in srgb, var(--fc) 16%, var(--flaeche));
  border-left: 5px solid var(--fc); border-radius: 0 4px 4px 0;
}
.eintrag:hover { color: var(--tinte); box-shadow: 0 0 0 2px var(--fc); z-index: 4; }
.e-kopf, .e-text, .e-neben { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.e-zeit { font-weight: 600; }
.e-titel { font-weight: 600; margin-left: 4px; }
.e-text, .e-neben { color: var(--grau); }
.eintrag.status-geplant { background: var(--flaeche); outline: 1px dashed var(--fc); outline-offset: -1px; }
.eintrag.status-erledigt { opacity: 0.6; }
.eintrag.status-erledigt .e-titel, .eintrag.status-erledigt .e-zeit { text-decoration: line-through; }
.eintrag.uhrzeit .e-zeit::after { content: " fest"; font-weight: 400; color: var(--grau); }
.vorschau .eintrag:not(.neu) { opacity: 0.55; }
.vorschau .eintrag.neu { outline: 2px solid var(--fc); outline-offset: -2px; background: color-mix(in srgb, var(--fc) 20%, var(--flaeche)); }

.ziehbar { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.eintrag.zieht { cursor: grabbing; z-index: 10; box-shadow: 0 6px 16px rgba(20, 30, 40, 0.28); opacity: 0.95; }
.eintrag.zieht .e-zeit { color: var(--messing); }
.zl-spalte.ziel { box-shadow: inset 0 0 0 2px var(--messing); }
.zieh-meldung { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--tinte); color: var(--flaeche); padding: 10px 16px; border-radius: var(--radius); z-index: 20; }

.bilanz { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin: 18px 0; padding: 14px 18px; background: var(--flaeche); border: 1px solid var(--linie); border-left: 5px solid var(--messing); border-radius: var(--radius); }
.bilanz p { margin: 0; font-size: 17px; }

@media (max-width: 720px) {
  .kopf { padding: 12px 14px 0; }
  .seite { padding: 18px 14px 60px; }
  h1 { font-size: 25px; }
  .einstellung { grid-template-columns: 1fr; }
  .einstellung small { padding-top: 0; }
  .kuerzel-form, .zeitfenster-form { grid-template-columns: 1fr 1fr; }
  .angaben { grid-template-columns: 1fr; gap: 2px; }
  .angaben dd { margin-bottom: 8px; }
  .zeitleiste { grid-template-columns: 34px repeat(var(--spalten), minmax(250px, 1fr)); }
  .e-zeit { display: block; }
  .e-titel { margin-left: 0; }
  .aufgaben li { flex-direction: column; align-items: flex-start; gap: 6px; }
}
@media (prefers-reduced-motion: no-preference) {
  .eintrag { transition: box-shadow 120ms; }
}

/* Postkarten */
.abstand { margin-top: 14px; }
.knopf[disabled] { opacity: 0.45; cursor: not-allowed; }
.schritte { padding-left: 22px; margin: 18px 0 0; }
.schritte li { margin-bottom: 20px; padding-left: 6px; }
.schritte li::marker { font-family: var(--schrift-eng); font-weight: 700; font-size: 20px; color: var(--messing); }
.schritte h2 { margin: 0 0 6px; font-size: 19px; }
.hilfe { margin-top: 26px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px 16px; }
.hilfe summary { cursor: pointer; font-weight: 600; }
.platzhalter-liste { margin: 0; font-size: 14px; }
.platzhalter-liste dt { font-weight: 600; margin-top: 8px; word-break: break-word; }
.platzhalter-liste dd { margin: 0; color: var(--grau); }
.empfaenger-zeile { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--linie-hell); }

/* Neu/bestehend im Vorschlag, private Termine */
.e-marke { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.02em; padding: 0 5px; margin-right: 4px;
  border-radius: 3px; line-height: 15px; vertical-align: 1px; color: #fff; background: var(--fc); }
.vorschau .eintrag.bestehend { opacity: 1; background: var(--pause); border-left-color: var(--grau); outline: none; color: var(--grau); }
.vorschau .eintrag.bestehend .e-marke { background: var(--grau); }
.vorschau .eintrag.bestehend .e-titel { font-weight: 500; }
.vorschau .eintrag.neu { box-shadow: 0 1px 4px rgba(20, 30, 40, 0.18); }
.eintrag.privat { --fc: var(--privat); background: color-mix(in srgb, var(--privat) 14%, var(--flaeche)); border-left-color: var(--privat); }
.eintrag.privat.blockiert { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--privat) 22%, var(--flaeche)) 0 6px, color-mix(in srgb, var(--privat) 10%, var(--flaeche)) 6px 12px); }
.eintrag.privat:not(.blockiert) { border-left-style: dotted; }
.vorschau .eintrag.privat { opacity: 1; }
.zl-flaeche.privat-sperre { left: var(--rand); z-index: 1; background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--privat) 25%, transparent) 0 6px, transparent 6px 12px); }
.ganztags { font-size: 13px; padding: 1px 8px; border-radius: 10px; text-decoration: none; color: var(--tinte);
  background: color-mix(in srgb, var(--privat, #8C8C8C) 22%, var(--flaeche)); }
.leg-privat { border-color: var(--grau) !important; background: color-mix(in srgb, #8C8C8C 18%, transparent); }
.leg-neu { background: var(--f0); color: #fff; border-color: var(--f0) !important; font-weight: 700; }
.leg-alt { opacity: 1 !important; background: var(--pause); color: var(--grau); }
.etikett { display: inline-block; font-size: 12px; font-weight: 700; padding: 0 7px; border-radius: 3px; white-space: nowrap; }
.etikett.neu { background: var(--f0); color: #fff; }
.etikett.bestehend { background: var(--pause); color: var(--grau); }
.etikett.privat { background: color-mix(in srgb, #8C8C8C 25%, transparent); }
.vorschlag-tabelle tr.bestehend td { color: var(--grau); }
.ohne-umbruch { white-space: nowrap; }
.breit-feld { flex: 1; min-width: 240px; }
.breit-feld input { width: 100%; }
.abo-zeile { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--linie-hell); }
.abo-zeile code { font-size: 12.5px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 3px; padding: 2px 6px; word-break: break-all; }
.farbwahl { display: inline-flex; align-items: center; gap: 8px; }
.farbwahl input[type="color"] { width: 54px; padding: 2px; }
.feld.kurz input[type="date"], .inline-zeile input[type="date"] { width: 160px; }
.empfaenger-zeile + form, .empfaenger-zeile ~ form:first-of-type { margin-top: 12px; }

/* Achtung vor Ort */
.achtung { border-left: 5px solid var(--rot); background: var(--rot-hell); padding: 10px 14px; margin: 6px 0 18px; border-radius: 0 var(--radius) var(--radius) 0; }
.achtung ul { margin: 4px 0 0; padding-left: 18px; }

/* Tätigkeiten wählen, Ankündigung */
.auswahl { border-top: 1px solid var(--linie-hell); margin-bottom: 12px; }
.auswahl-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; padding: 6px 0; border-bottom: 1px solid var(--linie-hell); }
.auswahl-zeile > .haken { flex: 1 1 340px; margin: 0; }
.auswahl-zeile .klein { margin-left: 4px; }
.auswahl-zuschlaege { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 2px 20px; padding-left: 26px; }
.auswahl-zuschlaege .haken { margin: 2px 0; align-items: center; }
.ankuendigung .haken { align-items: center; flex-wrap: wrap; }
.ankuendigung select, .ankuendigung input[type="time"] { min-height: 32px; padding: 3px 6px; }
.kunde-vorschau { align-self: center; padding: 6px 0 14px; font-weight: 600; }
.kunde-vorschau.fehlt { color: var(--rot); }
details.block-form > summary { cursor: pointer; }

/* Versand */
.mail { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 18px; }
pre.mail, .mail pre { white-space: pre-wrap; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; line-height: 1.5; margin: 8px 0 0; }

/* Anmeldung, Zugänge */
.wer { margin-left: auto; display: flex; align-items: center; gap: 10px; padding-bottom: 10px; font-size: 15px; }
.wer form { margin: 0; }
.seite.schmal { max-width: 520px; }
.zaehler { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--rot); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.rechte-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 18px; }
.rechte-raster legend { grid-column: 1 / -1; }
.zugang h3 { margin-bottom: 10px; }

/* Anfragen */
.eintrag.status-angefragt { background: var(--flaeche); outline: 2px dotted var(--rot); outline-offset: -2px; }
.e-marke.angefragt { background: var(--rot); }
.anfrage-kopf { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.anfrage .knopfreihe { align-items: flex-start; }
.ablehnen > summary { list-style: none; }
.ablehnen > summary::-webkit-details-marker { display: none; }
.ablehnen[open] { flex-basis: 100%; }

/* Tagesablauf und Kartendienst */
.fehlertext { color: var(--rot); font-weight: 600; }
.zl-spalte .eintrag .e-zeit { font-variant-numeric: tabular-nums; }
.geo-status { display: inline-block; font-size: 0.85em; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--linie); }
.geo-status.ok, .geo-status.manuell { background: var(--gruen-hell); border-color: var(--gruen); color: var(--gruen); }
.geo-status.ungenau, .geo-status.offen { background: var(--messing-hell); border-color: var(--messing); color: var(--messing); }
.geo-status.pruefen, .geo-status.nicht_gefunden, .geo-status.fehler { background: var(--rot-hell); border-color: var(--rot); color: var(--rot); }
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 18px; }
.kennzahlen div { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px 12px; }
.kennzahlen b { display: block; font-size: 1.5em; }
.kennzahlen span { color: var(--grau); font-size: 0.9em; }
.namensnennung { color: var(--grau); font-size: 0.8em; margin-top: 24px; }
.koord-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.koord-form input[type=text] { min-width: 14em; flex: 1 1 14em; }
.erledigt-zeile td { color: var(--grau); }
.zeile-form { display: flex; gap: 8px; align-items: flex-end; margin: 0 0 12px; }
.empfaenger-wahl { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: flex-end; margin: 4px 0 8px; }
.empfaenger-wahl .klein { flex-basis: 100%; margin: 0; }
details > summary { cursor: pointer; font-weight: 600; }

/* Kleine Tagesansicht „woher, wohin“ */
.tv-reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.tv { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 8px 10px; font-size: 0.9em; }
.tv h4 { margin: 0 0 6px; font-size: 0.95em; }
.tv h4 span { font-weight: 400; color: var(--grau); }
.tv-bisher { border-style: dashed; }
.tv ol { list-style: none; margin: 0; padding: 0; }
.tv li { display: grid; grid-template-columns: 3.6em 1fr auto; gap: 2px 6px; padding: 3px 4px; border-top: 1px solid var(--linie-hell); }
.tv li:first-child { border-top: 0; }
.tv .tv-f { font-variant-numeric: tabular-nums; color: var(--grau); }
.tv .tv-m { font-variant-numeric: tabular-nums; color: var(--grau); white-space: nowrap; }
.tv .tv-p { grid-column: 1 / -1; color: var(--rot); font-size: 0.92em; }
.tv li.tv-buero .tv-t { color: var(--grau); font-style: italic; }
.tv li.tv-neu { background: var(--messing-hell); border-radius: 3px; }
.tv li.tv-neu b { color: var(--messing); font-weight: 600; }
.tv li.tv-weg .tv-t { text-decoration: line-through; color: var(--grau); }
.tv li.tv-weg b { text-decoration: none; display: inline-block; color: var(--grau); font-weight: 600; }
.tv-fuss { margin: 6px 0 0; color: var(--grau); }
#vorschau.laedt, .vorschau.laedt { opacity: 0.55; transition: opacity 0.2s; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.ank-wahl:has(input[value=kunde]:checked) + .empfaenger-wahl { display: none; }

/* Mein Tag (Handy) */
.heute-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.heute-titel { flex: 1; min-width: 0; text-align: center; }
.heute-titel h1 { margin: 0; font-size: 1.35em; }
.heute-titel .unterzeile { margin: 2px 0 0; }
.heute-leiste { display: flex; gap: 8px; justify-content: center; align-items: center; margin: 0 0 12px; flex-wrap: wrap; }
.heute-person select { min-width: 12em; }
.heute-weg { text-align: center; color: var(--grau); font-style: italic; margin: 6px 0; }
.heute-fahrt { text-align: center; color: var(--grau); font-size: 0.9em; margin: 4px 0; }
.heute-fahrt::before, .heute-fahrt::after { content: "·"; margin: 0 6px; }
.heute-karte { background: var(--flaeche); border: 1px solid var(--linie); border-left: 6px solid var(--f0); border-radius: var(--radius); padding: 12px 14px; margin: 6px 0; }
.heute-karte.rot { border-left-color: var(--rot); }
.heute-karte.erledigt { opacity: 0.6; }
.heute-karte.erledigt h2 a { text-decoration: line-through; }
.hk-kopf { display: flex; justify-content: space-between; align-items: baseline; }
.hk-fenster { font-size: 1.25em; font-weight: 700; font-variant-numeric: tabular-nums; }
.hk-status { font-size: 0.85em; color: var(--grau); }
.heute-karte h2 { margin: 4px 0 0; font-size: 1.2em; }
.heute-karte h2 a { color: var(--tinte); }
.hk-ort { margin: 0 0 6px; color: var(--grau); }
.hk-taet { list-style: none; margin: 4px 0; padding: 0; }
.hk-taet li { display: flex; justify-content: space-between; border-top: 1px solid var(--linie-hell); padding: 3px 0; }
.hk-taet li span { color: var(--grau); font-variant-numeric: tabular-nums; }
.hk-achtung { background: var(--rot-hell); border-left: 4px solid var(--rot); padding: 6px 10px; margin: 6px 0; border-radius: 0 var(--radius) var(--radius) 0; }
.hk-achtung p { margin: 2px 0; color: var(--rot); font-weight: 600; }
.hk-hinweis { margin: 4px 0; font-size: 0.95em; }
.hk-tel { list-style: none; margin: 6px 0; padding: 0; }
.hk-tel li { margin: 3px 0; }
.hk-tel a { font-weight: 600; font-variant-numeric: tabular-nums; }
.hk-tel span { color: var(--grau); font-size: 0.9em; }
.hk-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.hk-knoepfe form { margin: 0; }
.erledigt-knopf { background: var(--gruen); border-color: var(--gruen); color: #fff; }
@media (max-width: 600px) {
  .seite.heute { padding-left: 10px; padding-right: 10px; }
  .hk-knoepfe .knopf { flex: 1 1 auto; text-align: center; }
}
.unterwegs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.unterwegs form { margin: 0; }
@media (max-width: 600px) { .unterwegs .knopf { flex: 1 1 auto; text-align: center; } }

/* Testbetrieb */
.testbetrieb-hinweis { background: var(--messing-hell); border-bottom: 1px solid var(--messing); color: var(--tinte); padding: 6px 16px; font-size: 0.9em; text-align: center; }
.schmal-mitte { max-width: 520px; margin: 40px auto; text-align: center; }

/* Farbkennzeichnung der Termine: geht vor der Farbe des Zeitfensters */
.m-rot { --mc: var(--m-rot); } .m-orange { --mc: var(--m-orange); } .m-gelb { --mc: var(--m-gelb); } .m-gruen { --mc: var(--m-gruen); } .m-tuerkis { --mc: var(--m-tuerkis); } .m-blau { --mc: var(--m-blau); } .m-lila { --mc: var(--m-lila); } .m-rosa { --mc: var(--m-rosa); } .m-braun { --mc: var(--m-braun); } .m-grau { --mc: var(--m-grau); }
.eintrag.markiert { --fc: var(--mc); background: color-mix(in srgb, var(--mc) 30%, var(--flaeche)); }
.eintrag.markiert.status-geplant { background: color-mix(in srgb, var(--mc) 18%, var(--flaeche)); }
.punkt { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 50%; background: var(--mc, var(--grau)); margin-right: 0.35em; vertical-align: -0.05em; flex: none; }
.punkt.ohne { background: transparent; border: 2px solid var(--grau); }
.farbmarke { display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 9px 1px 7px; border-radius: 12px; font-size: 0.9em; background: color-mix(in srgb, var(--mc) 18%, var(--flaeche)); border: 1px solid var(--mc); }
.farbwahl-termin { border: 0; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.farbwahl-termin legend { padding: 0; margin-bottom: 4px; font-weight: 600; }
.farbe-wahl { display: inline-flex; align-items: center; padding: 4px 10px 4px 8px; border: 1px solid var(--linie); border-radius: 16px; cursor: pointer; background: var(--flaeche); font-size: 0.92em; }
.farbe-wahl input { position: absolute; opacity: 0; width: 0; height: 0; }
.farbe-wahl:has(input:checked) { border-color: var(--tinte); box-shadow: inset 0 0 0 1px var(--tinte); font-weight: 600; }
.farbe-wahl:has(input:focus-visible) { outline: 2px solid var(--messing); outline-offset: 1px; }
.heute-karte.markiert { border-left-color: var(--mc); }
.hk-farbe { margin: 4px 0; font-weight: 600; }
.leg-farbe { display: inline-flex; align-items: center; margin-left: 8px; white-space: nowrap; }
.leg-mobil { margin-left: 12px; white-space: nowrap; }
.legende .leg-farbe .punkt { border: 0; padding: 0; margin: 0 0.35em 0 0; }
