/* KSM-Dispo – Design wie KSM-Master und KSM CheckIn: Anthrazit, Signalgelb, Barlow / Barlow Condensed */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(../fonts/barlow-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(../fonts/barlow-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(../fonts/barlow-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url(../fonts/barlow-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(../fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(../fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url(../fonts/barlow-condensed-latin-800-normal.woff2) format("woff2"); }

:root {
  --bg: #F3F4F2; --surface: #FFFFFF; --surface-2: #E9EBE7; --line: #D6D9D3;
  --fg: #1E272C; --muted: #5E686D; --head: #1E272C; --head-fg: #FFFFFF; --head-muted: #A9B2B6; --head-line: #3B474D;
  --yellow: #F2B705; --yellow-ink: #1E272C; --yellow-soft: #FCEFC4;
  --ok: #2E7D4F; --ok-soft: #DDEFE3; --warn: #B8402B; --warn-soft: #F6E0DB; --info: #2F5D7C; --info-soft: #DEE8EF;
  --f-display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --f-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141A1D; --surface: #1C2428; --surface-2: #232D32; --line: #33403F;
    --fg: #E8ECEA; --muted: #9AA6AA; --head: #0E1315; --head-muted: #8C989C; --head-line: #2C373C;
    --yellow-soft: #3A3010; --ok: #6CC28F; --ok-soft: #173226; --warn: #EE8A75; --warn-soft: #3A1E18; --info: #8DB8D6; --info-soft: #1B2B36;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141A1D; --surface: #1C2428; --surface-2: #232D32; --line: #33403F;
  --fg: #E8ECEA; --muted: #9AA6AA; --head: #0E1315; --head-muted: #8C989C; --head-line: #2C373C;
  --yellow-soft: #3A3010; --ok: #6CC28F; --ok-soft: #173226; --warn: #EE8A75; --warn-soft: #3A1E18; --info: #8DB8D6; --info-soft: #1B2B36;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--f-body); padding-top: env(safe-area-inset-top, 0px); }
h1, h2, h3 { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .03em; margin: 0; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--info); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Logo */
.logo { display: inline-flex; flex-direction: column; line-height: 1; user-select: none; }
.logo .k { font: 800 12px var(--f-display); letter-spacing: .18em; color: var(--head-muted); }
.logo .n { font: 800 28px var(--f-display); letter-spacing: .02em; color: var(--head-fg); text-transform: uppercase; margin-top: 1px; }
.logo .b { height: 5px; background: var(--yellow); margin-top: 4px; }
.logo.on-light .k { color: var(--muted); }
.logo.on-light .n { color: var(--fg); }

/* Kopf */
.top { background: var(--head); color: var(--head-fg); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
.top-in { max-width: 1240px; margin: 0 auto; padding: 12px 16px 0; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.top-sub { font: 600 12px var(--f-body); color: var(--head-muted); letter-spacing: .06em; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who { text-decoration: none; font-size: 13px; color: var(--head-muted); background: none; border: 1px solid var(--head-line); border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.who b { color: var(--head-fg); font-weight: 600; }
.iconbtn { background: transparent; border: 1px solid var(--head-line); color: var(--head-fg); border-radius: 6px; padding: 6px 10px; cursor: pointer; font-size: 13px; min-height: 34px; }
.iconbtn:hover, .who:hover { border-color: var(--head-muted); }
nav.tabs { max-width: 1240px; margin: 10px auto 0; padding: 0 16px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
@media (min-width: 1100px) { nav.tabs { flex-wrap: wrap; overflow: visible; } }
nav.tabs a { color: var(--head-muted); font: 700 15px var(--f-display); letter-spacing: .06em; text-transform: uppercase; padding: 10px 9px 12px; border-bottom: 4px solid transparent; white-space: nowrap; display: flex; align-items: center; gap: 6px; text-decoration: none; }
nav.tabs a[aria-current="page"] { color: var(--head-fg); border-color: var(--yellow); }
nav.tabs a:hover { color: var(--head-fg); }
.cnt { font: 700 11px var(--f-body); background: var(--warn); color: #fff; border-radius: 999px; padding: 1px 7px; letter-spacing: 0; }

main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 64px; display: flex; flex-direction: column; gap: 16px; }
.vhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.vhead h1 { font-size: 30px; line-height: 1; }
.vhead p { margin: 6px 0 0; color: var(--muted); font-size: 14px; max-width: 70ch; }
.vhead .row { justify-content: flex-end; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { font-size: 18px; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.g2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.g2e { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .g2, .g2e { grid-template-columns: 1fr; } }

.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; text-decoration: none; color: inherit; display: block; }
a.kpi:hover { border-color: var(--muted); }
.kpi .l { font: 700 12px var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kpi .v { font: 800 38px/1 var(--f-display); font-variant-numeric: tabular-nums; margin-top: 6px; }
.kpi .s { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kpi.alert { border-color: var(--warn); box-shadow: inset 4px 0 0 var(--warn); }

.btn { border: 1.5px solid var(--line); background: var(--surface); border-radius: 6px; padding: 9px 14px; cursor: pointer; font: 700 14px var(--f-display); letter-spacing: .08em; text-transform: uppercase; min-height: 42px; text-decoration: none; color: var(--fg); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--yellow); border-color: var(--yellow); color: var(--yellow-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.sm { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.btn.danger { color: var(--warn); border-color: var(--warn); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--info); text-decoration: underline; cursor: pointer; font-size: 14px; }

.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tools input[type=search], .tools select, .tools input[type=date] { border: 1.5px solid var(--line); background: var(--surface); border-radius: 6px; padding: 9px 12px; font-size: 16px; min-height: 42px; }
.tools input[type=search] { flex: 1; min-width: 200px; }
.tools label.chk { font-size: 14px; display: flex; gap: 6px; align-items: center; }

.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.tw.flat { border: 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font: 700 12px var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1.5px solid var(--line); white-space: nowrap; background: var(--surface); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td, tbody tr.click:focus-within td { background: var(--surface-2); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.id { font: 600 12.5px var(--f-mono); color: var(--muted); white-space: nowrap; }
.mono { font: 600 13.5px var(--f-mono); letter-spacing: .03em; white-space: nowrap; }
.sub { font-size: 12.5px; color: var(--muted); }
.raw { color: var(--warn); font-size: 12.5px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 4px; font: 700 11.5px var(--f-body); padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.y { background: var(--yellow); color: var(--yellow-ink); }
a.badge { text-decoration: none; }
a.badge:hover { filter: brightness(.95); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; border: 1px dashed var(--line); border-radius: 4px; padding: 2px 7px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.chip button { background: none; border: 0; color: var(--warn); cursor: pointer; padding: 0 2px; font-size: 14px; line-height: 1; }

/* Prüfliste */
.match { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.match:last-child { border-bottom: 0; }
.match .raw-name { font-weight: 600; overflow-wrap: anywhere; }
.score { font: 700 12px var(--f-mono); padding: 1px 6px; border-radius: 4px; background: var(--yellow-soft); }
@media (max-width: 640px) { .match { grid-template-columns: 1fr; } }

/* Import */
.drop { border: 2px dashed var(--line); border-radius: var(--r); padding: 28px 16px; text-align: center; background: var(--surface); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.drop.over { border-color: var(--yellow); background: var(--yellow-soft); }
.drop b { font: 700 18px var(--f-display); text-transform: uppercase; letter-spacing: .06em; }
.maptable select { min-width: 160px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 6px; padding: 7px 10px; font-size: 15px; }
.req { color: var(--warn); font-weight: 700; }
.steps { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.steps li { flex: 1; font: 700 12px var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-top: 4px solid var(--line); padding-top: 6px; }
.steps li.on { color: var(--fg); border-color: var(--yellow); }
.steps li.done { color: var(--ok); border-color: var(--ok); }

/* Programme */
/* Rechte-Matrix */
.perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 20px; }
.perms fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.perms legend { font: 700 13px var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.chk { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.chk input { width: 18px; height: 18px; flex: none; accent-color: var(--yellow); }

/* Dialog */
.ov { position: fixed; inset: 0; background: rgba(14, 19, 21, .55); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: calc(24px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
.dlg { background: var(--surface); border-radius: 10px; width: 100%; max-width: 680px; padding: 20px; display: flex; flex-direction: column; gap: 14px; border-top: 5px solid var(--yellow); }
.dlg.wide { max-width: 920px; }
.dlg h2 { font-size: 22px; overflow-wrap: anywhere; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form .full { grid-column: 1 / -1; }
.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f label, .f .lbl { font: 700 12px var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.f input, .f select, .f textarea { border: 1.5px solid var(--line); background: var(--surface); border-radius: 6px; padding: 9px 11px; font-size: 16px; width: 100%; }
.f textarea { min-height: 80px; resize: vertical; }
.f label.chk { font: 500 15px var(--f-body, inherit); letter-spacing: 0; text-transform: none; color: var(--fg); flex-direction: row; align-items: center; }
.f label.chk input { width: 18px; padding: 0; }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }
.secret { font: 600 14px var(--f-mono); background: var(--surface-2); border-radius: 6px; padding: 10px 12px; overflow-wrap: anywhere; user-select: all; }
.note { font-size: 14px; padding: 10px 12px; border-radius: 6px; background: var(--surface-2); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.ok { background: var(--ok-soft); color: var(--ok); }
.note.y { background: var(--yellow-soft); }
.qr { width: 200px; height: 200px; image-rendering: pixelated; background: #fff; padding: 8px; border-radius: 6px; }

/* Anmeldung */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; background: var(--head); }
.login .card { background: var(--surface); color: var(--fg); border-radius: 10px; width: 100%; max-width: 400px; padding: 24px; display: flex; flex-direction: column; gap: 14px; border-top: 6px solid var(--yellow); }
.code { letter-spacing: .4em; font-family: var(--f-mono); font-size: 22px !important; text-align: center; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--head); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 60; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); border-left: 4px solid var(--yellow); max-width: calc(100vw - 32px); }
.toast.err { border-left-color: var(--warn); }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; font-size: 14px; }
.loading { color: var(--muted); padding: 20px; text-align: center; }
footer.foot { max-width: 1240px; margin: 0 auto; padding: 0 16px 24px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.grow { flex: 1; min-width: 0; border: 1.5px solid var(--line); background: var(--surface); border-radius: 6px; padding: 7px 10px; font-size: 16px; }
details > summary { cursor: pointer; padding: 4px 0; }
details > summary.lbl { font: 700 12px var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
code { font-family: var(--f-mono); font-size: .9em; }
fieldset.perms { border: 0; padding: 0; margin: 0; }
fieldset.perms legend { font: 700 12px var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
label.btn { position: relative; align-self: flex-start; }
.logo:hover { text-decoration: none; }
a.logo { text-decoration: none; }

/* Filterleiste und sortierbare Spalten (v1.1) */
.filterbar { display: flex; flex-direction: column; gap: 10px; }
.fltpanel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.fltgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.fltgrid .f select, .fltgrid .f input { font-size: 15px; padding: 8px 10px; }
.chip.on { border-style: solid; border-color: var(--yellow); background: var(--yellow-soft); color: var(--fg); }
#fltToggle[aria-expanded="true"] { border-color: var(--yellow); }
th[aria-sort] { padding: 0; }
.sortbtn { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 12px; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
th.n .sortbtn { justify-content: flex-end; }
.sortbtn:hover, .sortbtn.on { color: var(--fg); }
.sortbtn:focus-visible { outline: 3px solid var(--yellow); outline-offset: -3px; }
.sortbtn .arr { font-size: 10px; opacity: .45; }
.sortbtn.on .arr { opacity: 1; color: var(--fg); }
.sortrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.sortrow select { border: 1.5px solid var(--line); background: var(--surface); border-radius: 6px; padding: 6px 8px; font-size: 14px; }
.selbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 12px; background: var(--yellow-soft); border-radius: 6px; font-size: 14px; }
.match .pick { width: 20px; height: 20px; accent-color: var(--yellow); }
.match.sel { background: var(--yellow-soft); }
/* Programmrechte (zentrale Anmeldung) */
.apps-box { display: flex; flex-direction: column; gap: 12px; }
.app-card { border: 1.5px solid var(--line); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.app-card.on { border-color: var(--yellow); }
.app-card > .row { justify-content: space-between; }
.cat-multi { max-height: 220px; overflow: auto; border: 1.5px solid var(--line); border-radius: 6px; padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.cat-levels td { padding: 4px 8px; }
.cat-levels select { min-width: 180px; }
.f .cat-find { margin-bottom: 4px; }
.prog-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }


/* =====================================================================
   KSM-Dispo: Planung, Kalender, Karte, Tour, Kundenseite
   ===================================================================== */
main.wide { max-width: none; padding-left: 16px; padding-right: 16px; }
.top-in.wide, nav.tabs.wide { max-width: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; background: var(--sv, var(--muted)); }
.muted { color: var(--muted); }
.tnum { font-variant-numeric: tabular-nums; }
.gap6 { gap: 6px; }

/* Datumsleiste */
.daynav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.daynav input[type=date] { border: 1.5px solid var(--line); background: var(--surface); border-radius: 6px; padding: 7px 10px; font-size: 15px; min-height: 42px; }
.daynav .dname { font: 700 20px var(--f-display); letter-spacing: .04em; text-transform: uppercase; min-width: 9ch; }

/* Hinweise */
.warns { display: flex; flex-direction: column; gap: 6px; }
.warn-item { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 8px 12px; border-radius: 6px; background: var(--yellow-soft); border-left: 4px solid var(--yellow); }
.warn-item.bad { background: var(--warn-soft); border-left-color: var(--warn); }
.warn-item b { font-family: var(--f-display); letter-spacing: .06em; text-transform: uppercase; font-size: 12px; white-space: nowrap; padding-top: 2px; }

/* Planungs-Raster */
.planbox { display: grid; gap: 14px; grid-template-columns: 300px minmax(0, 1fr); grid-template-areas: "list cal" "map map"; align-items: start; }
@media (min-width: 1560px) { .planbox { grid-template-columns: 300px minmax(0, 1fr) minmax(380px, 30vw); grid-template-areas: "list cal map"; } .planbox .mapwrap { position: sticky; top: 120px; } }
@media (max-width: 900px) { .planbox { grid-template-columns: 1fr; grid-template-areas: "cal" "list" "map"; } }
.planbox .olist { grid-area: list; }
.planbox .calwrap { grid-area: cal; }
.planbox .mapwrap { grid-area: map; }
.olist { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 170px); position: sticky; top: 120px; }
@media (max-width: 900px) { .olist { position: static; max-height: none; } }
.olist .tools input[type=search] { min-width: 0; }
.olist .scroll { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; min-height: 120px; }
.ocard { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 6px; padding: 8px 10px; cursor: grab; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.ocard:hover { border-color: var(--muted); }
.ocard.sel { border-color: var(--yellow); box-shadow: 0 0 0 2px var(--yellow); }
.ocard.prio { border-left-color: var(--warn); }
.ocard .o1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ocard .o1 b { font: 700 15px var(--f-display); letter-spacing: .03em; }
.ocard .o2 { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ocard .chips { margin-top: 3px; }
.ocard.dragging { opacity: .45; }

/* Kalender */
.calwrap { min-width: 0; }
.cal { --px: 1.5px; display: grid; grid-template-columns: 52px repeat(var(--n), minmax(150px, 1fr)); overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); position: relative; }
.cal .ch { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1.5px solid var(--line); padding: 8px 10px; min-height: 64px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); }
.cal .ch .nm { display: flex; gap: 6px; align-items: center; font: 700 15px var(--f-display); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ch .sm { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal .ch.off { background: var(--surface-2); }
.cal .corner { position: sticky; left: 0; top: 0; z-index: 5; background: var(--surface); border-bottom: 1.5px solid var(--line); }
.cal .axis { position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid var(--line); }
.cal .axis span { position: absolute; right: 6px; font: 600 11.5px var(--f-mono); color: var(--muted); transform: translateY(-50%); }
.cal .col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% calc(60 * var(--px)); }
.cal .col.off { background-color: var(--surface-2); }
.cal .col .offtime { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--line) 55%, transparent) 6px 8px); pointer-events: none; }
.cal .col.drop { background-color: var(--yellow-soft); }
.cal .now { position: absolute; left: 0; right: 0; height: 2px; background: var(--warn); z-index: 2; pointer-events: none; }
.cal .ghost { position: absolute; left: 4px; right: 4px; border: 2px dashed var(--yellow); border-radius: 6px; background: color-mix(in srgb, var(--yellow) 18%, transparent); pointer-events: none; z-index: 3; font: 700 12px var(--f-mono); padding: 2px 6px; }
.appt { position: absolute; left: 4px; right: 4px; border-radius: 6px; background: var(--surface); border: 1.5px solid var(--sv); border-left-width: 5px; padding: 3px 6px; font-size: 12.5px; line-height: 1.3; overflow: hidden; cursor: pointer; z-index: 1; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.appt:hover { z-index: 3; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.appt .t { font: 700 12px var(--f-mono); display: flex; justify-content: space-between; gap: 4px; }
.appt .o { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt .k { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt.bad { box-shadow: 0 0 0 2px var(--warn); }
.appt.st-unterwegs { background: color-mix(in srgb, var(--sv) 10%, var(--surface)); }
.appt.st-vor_ort { background: color-mix(in srgb, var(--sv) 22%, var(--surface)); }
.appt.st-erledigt { opacity: .6; border-style: dashed; }
.appt.dragging { opacity: .4; }
.drive { position: absolute; left: 14px; right: 14px; border-left: 3px dotted var(--sv); font: 600 11px var(--f-mono); color: var(--muted); padding-left: 6px; display: flex; align-items: center; pointer-events: none; overflow: hidden; white-space: nowrap; }
.sticon { font-size: 11px; font-weight: 700; padding: 0 5px; border-radius: 3px; background: var(--surface-2); color: var(--muted); font-family: var(--f-body); }
.sticon.unterwegs { background: var(--info-soft); color: var(--info); }
.sticon.vor_ort { background: var(--yellow); color: var(--yellow-ink); }
.sticon.erledigt { background: var(--ok-soft); color: var(--ok); }

/* Karte */
.mapwrap { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.map { height: 460px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); overflow: hidden; position: relative; }
.map.tall { height: calc(100vh - 220px); min-height: 420px; }
.map svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.map .maphint { position: absolute; left: 8px; top: 8px; right: 52px; width: fit-content; font-size: 11.5px; background: color-mix(in srgb, var(--surface) 88%, transparent); padding: 3px 8px; border-radius: 4px; color: var(--muted); }
.map .zoom { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; }
.map .zoom button { width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); font: 700 18px var(--f-body); cursor: pointer; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.legend label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.gm-info { color: #1E272C; font: 13px var(--f-body); max-width: 240px; }

/* Vorschläge */
.sugg { display: flex; flex-direction: column; gap: 8px; }
.sg { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; background: var(--surface); text-align: left; font: inherit; color: inherit; width: 100%; }
.sg:hover, .sg:focus-visible { border-color: var(--yellow); }
.sg.best { border-color: var(--ok); box-shadow: inset 4px 0 0 var(--ok); }
.sg.no { opacity: .7; }
.sg .rk { font: 800 22px var(--f-display); color: var(--muted); width: 26px; text-align: center; }
.sg .nm { font: 700 16px var(--f-display); letter-spacing: .04em; text-transform: uppercase; display: flex; gap: 6px; align-items: center; }
.sg .ex { text-align: right; font: 800 22px var(--f-display); font-variant-numeric: tabular-nums; }
.sg .ex small { display: block; font: 600 11.5px var(--f-body); color: var(--muted); }
.sg .info { grid-column: 2 / 4; font-size: 13px; color: var(--muted); }

/* Woche */
.wk td.d { text-align: center; cursor: pointer; }
.wk td.d:hover { background: var(--surface-2); }
.wk .n { font: 800 20px var(--f-display); }
.wk .s { font-size: 11.5px; color: var(--muted); }
.wk td.off { background: var(--surface-2); color: var(--muted); }
.wk th.today, .wk td.today { box-shadow: inset 0 -3px 0 var(--yellow); }

/* Live */
.live { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
@media (max-width: 1000px) { .live { grid-template-columns: 1fr; } }
.lcard { border: 1px solid var(--line); border-left: 5px solid var(--sv); border-radius: 8px; padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; font-size: 14px; cursor: pointer; }
.lcard:hover { border-color: var(--muted); border-left-color: var(--sv); }
.lcard .h { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.lcard .h b { font: 700 16px var(--f-display); letter-spacing: .04em; text-transform: uppercase; }
.age.ok { color: var(--ok); } .age.old { color: var(--warn); }

/* Sachverständige */
.svgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.svcard { border-top: 5px solid var(--sv); }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days label { border: 1.5px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 13px; cursor: pointer; display: flex; gap: 4px; align-items: center; }
.days label:has(input:checked) { border-color: var(--yellow); background: var(--yellow-soft); }
.days input { accent-color: var(--yellow); }
.steps-ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }

/* Tour (Handy der Sachverständigen) */
.tour { max-width: 640px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.ortung { display: flex; flex-direction: column; gap: 8px; border-left: 5px solid var(--muted); }
.ortung.on { border-left-color: var(--ok); }
.ortung.pause { border-left-color: var(--yellow); }
.ortung .st { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2s infinite; flex: none; }
.ortung:not(.on) .pulse { background: var(--muted); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.stop { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.stop.next { border-left-color: var(--yellow); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.stop.st-erledigt { opacity: .65; border-left-color: var(--ok); }
.stop.st-vor_ort { border-left-color: var(--info); }
.stop .sh { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stop .time { font: 800 28px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.stop .addr { font-size: 17px; font-weight: 600; text-decoration: none; color: var(--fg); display: block; }
.stop .addr span { color: var(--info); font-size: 14px; font-weight: 600; display: block; margin-top: 2px; }
.stop .acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.stop .acts .btn { min-height: 52px; font-size: 16px; }
.stop .meta { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.legline { font: 600 13px var(--f-mono); color: var(--muted); padding: 2px 0 2px 18px; border-left: 3px dotted var(--line); margin-left: 12px; }

/* Kundenseite */
body.kunde { background: var(--head); }
.kunde-main { min-height: 100vh; min-height: 100dvh; display: grid; place-items: start center; padding: 24px 14px; }
.kunde-card { background: var(--surface); border-radius: 12px; border-top: 6px solid var(--yellow); width: 100%; max-width: 520px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.kunde-card h1 { font-size: 26px; line-height: 1.1; }
.kunde-eta { background: var(--surface-2); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.kunde-eta .lbl { font: 700 12px var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kunde-eta b { font: 800 40px/1.05 var(--f-display); font-variant-numeric: tabular-nums; }
.kunde-karte img { width: 100%; border-radius: 8px; display: block; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); }
.secret { display: block; margin: 4px 0 8px; }
.ortung .row .btn { flex: 1; }
.note.y { background: var(--yellow-soft); }
.clk { cursor: pointer; }
/* Programme */

dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.refs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ref { border: 1px solid var(--line); border-left: 4px solid var(--yellow); border-radius: 6px; padding: 10px 12px; }
.ref b { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .06em; }

.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.log li:last-child { border-bottom: 0; }
.log time { font: 600 12.5px var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.log .d { color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 560px) { .log li { grid-template-columns: 1fr; gap: 2px; } }

.fs { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fs legend { font: 700 12px var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 6px; display: flex; gap: 6px; align-items: center; }
.cal .axis span:first-child { transform: none; }
.cal .axis span:last-child { transform: translateY(-100%); }
.olist .tools { flex-wrap: wrap; }
.olist .tools input[type=search] { flex: 1 1 100%; }
.olist .tools select { flex: 1 1 100%; min-height: 38px; padding: 6px 10px; }
.navtour { width: 100%; min-height: 52px; font-size: 16px; }
.cal .ch .maplink { color: var(--info); text-decoration: none; font-weight: 600; }
.cal .ch .maplink:hover { text-decoration: underline; }

/* 1.1: Mittagspause, Vorlauf (Anfahrt/Heimfahrt), Wochenplan aus dem Master */
.cal .col .pausetime { position: absolute; left: 0; right: 0; background: color-mix(in srgb, var(--yellow) 22%, transparent); border-top: 1px dashed color-mix(in srgb, var(--yellow-ink, #5a4500) 40%, transparent); border-bottom: 1px dashed color-mix(in srgb, var(--yellow-ink, #5a4500) 40%, transparent); font: 700 10px var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.cal .col .vorlauf { position: absolute; left: 0; width: 4px; background: color-mix(in srgb, var(--sv, var(--info)) 45%, transparent); pointer-events: none; }
.wmini { border-collapse: collapse; font-size: 13px; }
.wmini th { text-align: left; padding: 1px 8px 1px 0; font-weight: 700; }
.wmini td { padding: 1px 8px 1px 0; white-space: nowrap; }
.dayinfo { margin: -4px 0 10px; }
.fzcheck a { font-weight: 700; }
