/* ---------- Tokens ---------- */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --text: #17202b;
  --muted: #5f6b7a;
  --faint: #8a95a3;
  --border: #e1e5ea;
  --border-strong: #cdd3db;
  --accent: #1d4ed8;
  --accent-soft: #e8eefc;
  --hover: #f1f4f8;
  --shadow: 0 8px 28px rgba(16, 24, 40, 0.14);
  --radius: 8px;

  --eb-top: #1d4ed8;
  --eb-kunden: #0d9488;
  --eb-opportunity: #9333ea;
  --eb-lead: #e08a00;
  --eb-sonstige: #9aa4b2;

  --tile-filter: saturate(0.55) brightness(1.03);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1318; --surface: #171c23; --surface-2: #1c222a; --text: #e7ebf0; --muted: #9ba6b4; --faint: #6f7a88;
    --border: #2a323d; --border-strong: #38424f; --accent: #7aa2ff; --accent-soft: #1f2a44; --hover: #202833;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
    --eb-top: #5b8cff; --eb-kunden: #2cc4b3; --eb-opportunity: #b57bff; --eb-lead: #f2a93b; --eb-sonstige: #6b7684;
    --tile-filter: invert(1) hue-rotate(180deg) saturate(0.4) brightness(0.85) contrast(0.9);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1318; --surface: #171c23; --surface-2: #1c222a; --text: #e7ebf0; --muted: #9ba6b4; --faint: #6f7a88;
  --border: #2a323d; --border-strong: #38424f; --accent: #7aa2ff; --accent-soft: #1f2a44; --hover: #202833;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  --eb-top: #5b8cff; --eb-kunden: #2cc4b3; --eb-opportunity: #b57bff; --eb-lead: #f2a93b; --eb-sonstige: #6b7684;
  --tile-filter: invert(1) hue-rotate(180deg) saturate(0.4) brightness(0.85) contrast(0.9);
  color-scheme: dark;
}

/* ---------- Grundlayout ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  display: grid; grid-template-rows: 52px 1fr;
  background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
button, input, select { font: inherit; color: inherit; }

.topbar {
  display: flex; align-items: center; gap: 24px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; white-space: nowrap; }
.logo {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 15px;
}
.tabs { display: flex; gap: 4px; height: 100%; }
.tab {
  display: flex; align-items: center; padding: 0 12px; color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent; font-weight: 550;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.topbar-meta { margin-left: auto; color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.layout { display: grid; grid-template-columns: 380px 1fr; min-height: 0; position: relative; }

/* ---------- Seitenleiste ---------- */
.panel {
  display: flex; flex-direction: column; min-height: 0; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
}
.block { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.block-title {
  margin: 0 0 8px; font-size: 11px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
details.block > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; margin: 0; }
details.block > summary::-webkit-details-marker { display: none; }
details.block > summary::before { content: "▸"; font-size: 10px; transition: transform 0.15s; }
details.block[open] > summary::before { transform: rotate(90deg); }
details.block[open] > summary { margin-bottom: 10px; }

.input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--surface); outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-sm { width: auto; padding: 4px 8px; font-size: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--surface); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn[aria-pressed="true"], .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-quiet { border-color: transparent; color: var(--accent); background: none; padding-left: 0; padding-right: 0; }
.btn-quiet:hover { background: none; text-decoration: underline; }
.btn-sm { padding: 4px 9px; font-size: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 11px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); cursor: pointer; font-size: 13px;
}
.chip:hover { background: var(--hover); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

.umkreis { display: grid; gap: 8px; }
.umkreis-row { display: grid; grid-template-columns: 1fr 96px; gap: 8px; }
.umkreis-info {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 6px; background: var(--accent-soft); font-size: 13px;
}
.umkreis-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ort-suche { position: relative; }
.vorschlaege {
  position: absolute; z-index: 1200; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px 0; list-style: none;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px; box-shadow: var(--shadow);
}
.vorschlaege li { padding: 7px 10px; cursor: pointer; font-size: 13px; }
.vorschlaege li:hover, .vorschlaege li.aktiv { background: var(--hover); }
.vorschlaege .leer { color: var(--muted); cursor: default; }

.filter-grid { display: grid; gap: 10px; }
.fieldset { border: 0; margin: 0; padding: 0; }
.fieldset legend, .field { font-size: 12px; color: var(--muted); }
.field { display: grid; gap: 4px; }
.checklist { display: grid; gap: 2px; margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; color: var(--text); font-size: 13px; }
.check .n { margin-left: auto; color: var(--faint); font-variant-numeric: tabular-nums; font-size: 12px; }
.count-badge { padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; letter-spacing: 0; }

.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }

.results-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.result-count { font-size: 13px; color: var(--muted); }
.result-count strong { color: var(--text); }
.results-actions { display: flex; gap: 6px; }

.liste { list-style: none; margin: 0; padding: 0; }
.liste li {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center;
  padding: 9px 16px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.liste li:hover { background: var(--hover); }
.liste li.aktiv { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.liste .name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.liste .name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste .ort { grid-column: 1; padding-left: 18px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste .rechts { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.liste .rechts b { display: block; color: var(--text); font-weight: 600; }
.rang {
  display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); font-size: 11px; font-weight: 600;
}
.ohne-pos { color: var(--faint); font-style: italic; }
.mehr { margin: 10px 16px 16px; }
.liste li.trenner {
  display: block; cursor: default; padding: 8px 16px; background: var(--surface-2);
  color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase;
}
.liste li.trenner:hover { background: var(--surface-2); }
.naehe-knopf { display: inline-flex; gap: 4px; }
.leer-hinweis { padding: 24px 16px; color: var(--muted); text-align: center; }

.ebenen { display: grid; gap: 2px; }
.ebene { display: flex; align-items: center; gap: 9px; padding: 6px 0; cursor: pointer; font-size: 13.5px; }
.ebene input { margin: 0; }
.ebene .n { margin-left: auto; color: var(--faint); font-variant-numeric: tabular-nums; font-size: 12px; }
.ebene.aus { color: var(--muted); }
.top-stufen { display: flex; align-items: center; gap: 4px; margin: 0 0 8px 22px; }
.top-stufen .label { color: var(--muted); font-size: 12px; margin-right: 2px; }
.top-stufen .chip { padding: 2px 9px; font-size: 12px; white-space: nowrap; }
.ebenen-hinweis { margin: 6px 0 0; color: var(--faint); font-size: 12px; }

/* ---------- Karte ---------- */
.map-wrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--bg); }
#map.punkt-modus { cursor: crosshair; }
.leaflet-tile-pane { filter: var(--tile-filter); }
.map-hint {
  position: absolute; z-index: 800; top: 12px; left: 50%; transform: translateX(-50%);
  padding: 8px 14px; border-radius: 999px; background: var(--text); color: var(--surface); font-size: 13px; box-shadow: var(--shadow);
}
.legende {
  position: absolute; z-index: 800; left: 12px; bottom: 24px; padding: 8px 12px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); font-size: 12px; display: grid; gap: 3px;
}
.legende div { display: flex; align-items: center; gap: 7px; }
.leaflet-tooltip { font: 12px/1.3 inherit; }

/* ---------- Detailfenster ---------- */
.drawer {
  position: absolute; z-index: 1000; top: 12px; right: 12px; bottom: 12px; width: min(420px, calc(100% - 24px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.drawer-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--border); position: relative; }
.drawer-head h2 { margin: 0 32px 6px 0; font-size: 17px; line-height: 1.3; }
.drawer-close {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border: 0; border-radius: 6px;
  background: none; color: var(--muted); font-size: 20px; cursor: pointer;
}
.drawer-close:hover { background: var(--hover); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border);
}
.drawer-body { overflow-y: auto; padding: 4px 16px 16px; }
.adresse { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.section { padding-top: 14px; }
.section h3 { margin: 0 0 8px; font-size: 11px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.kpi { padding: 10px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.kpi .label { font-size: 11px; color: var(--muted); }
.kpi .value { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 0; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.note { padding: 8px 10px; border-radius: 6px; background: #fff6e0; color: #6b4d00; font-size: 13px; }
:root[data-theme="dark"] .note { background: #3a2f12; color: #f3d38a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .note { background: #3a2f12; color: #f3d38a; } }
.naehe { display: grid; gap: 4px; font-size: 13px; }
.naehe-row { display: flex; align-items: center; gap: 8px; }
.naehe-row .n { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.timeline li:first-child { border-top: 0; }
.timeline .wann { color: var(--muted); font-size: 12px; }
.timeline .notiz { overflow-wrap: anywhere; }
.drawer .lade { padding: 24px 16px; color: var(--muted); }

/* Umgebungsliste */
.eyebrow { font-size: 11px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
.zurueck { border: 0; background: none; padding: 0; margin: 0 32px 6px 0; color: var(--accent); cursor: pointer; font-size: 13px; text-align: left; }
.zurueck:hover { text-decoration: underline; }
.umg-steuerung { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.umg-summe { font-size: 13px; color: var(--muted); }
.umg-summe strong { color: var(--text); }
.umg-ebenen { margin-top: 10px; font-size: 13px; }
.umg-ebenen summary { cursor: pointer; color: var(--accent); }
.umg-ebenen > div { display: grid; gap: 2px; margin-top: 6px; }
.umg-ebene { display: flex; align-items: center; gap: 8px; padding: 2px 0; cursor: pointer; }
.umg-ebene.aus { color: var(--muted); }
.umg-ebene .n { margin-left: auto; color: var(--faint); font-variant-numeric: tabular-nums; font-size: 12px; }
.umg-body { padding: 0; }
.umg-liste { list-style: none; margin: 0; padding: 0; }
.umg-liste li {
  display: grid; grid-template-columns: 58px 1fr auto; gap: 10px; align-items: center;
  padding: 9px 16px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.umg-liste li:hover { background: var(--hover); }
.umg-liste li.aktiv { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.umg-km { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.umg-main { display: grid; min-width: 0; }
.umg-name { display: flex; align-items: center; gap: 7px; font-weight: 600; min-width: 0; }
.umg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.umg-ort { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.umg-rechts { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.umg-trenner {
  padding: 8px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase;
}
.umg-actions { padding: 12px 16px 16px; margin: 0; }

/* ---------- Login ---------- */
body.login-seite { display: grid; place-items: center; grid-template-rows: 1fr; min-height: 100%; padding: 16px; }
.login-karte {
  width: min(380px, 100%); padding: 28px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
}
.login-brand { margin-bottom: 20px; }
.login-karte h1 { margin: 0 0 16px; font-size: 20px; }
.login-karte form { display: grid; gap: 14px; }
.login-karte .field { font-size: 13px; }
.login-knopf { width: 100%; padding: 9px 12px; font-weight: 600; }
.login-knopf:disabled { opacity: 0.7; cursor: wait; }
.login-fehler { margin: 0; padding: 8px 10px; border-radius: 6px; background: #fdecec; color: #9b1c1c; font-size: 13px; }
.login-hinweis { margin: 16px 0 0; color: var(--faint); font-size: 12px; text-align: center; }
.benutzer { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ---------- Seiten ohne Karte (z. B. Benutzer) ---------- */
body.seite { grid-template-rows: 52px auto; grid-template-columns: minmax(0, 1fr); }
.seiten-inhalt { width: min(980px, 100%); margin: 0 auto; padding: 24px 16px 48px; }
.seiten-kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.seiten-kopf h1 { margin: 0; font-size: 22px; }
.seiten-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.karte-box { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle th {
  text-align: left; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.tabelle td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle .rechts { text-align: right; }
.zelle-name { font-weight: 600; }
.zelle-sub { color: var(--muted); font-size: 12px; }
.du { margin-left: 4px; padding: 0 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; }
.status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-ok { background: #e6f6ec; color: #17663a; }
.status-warn { background: #fff3dc; color: #8a5a00; }
.status-aus { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
:root[data-theme="dark"] .status-ok { background: #173523; color: #7fd8a0; }
:root[data-theme="dark"] .status-warn { background: #3a2f12; color: #f3d38a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .status-ok { background: #173523; color: #7fd8a0; }
  :root:not([data-theme="light"]) .status-warn { background: #3a2f12; color: #f3d38a; }
}

.dialog {
  width: min(460px, calc(100% - 32px)); padding: 22px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  max-height: calc(100dvh - 32px); overflow-y: auto;
}
.dialog::backdrop { background: rgba(15, 20, 30, 0.45); }
.dialog h2 { margin: 0 0 14px; font-size: 18px; }
.dialog form { display: grid; gap: 12px; }
.dialog .field { font-size: 13px; }
.hilfe { color: var(--faint); font-size: 12px; margin: 0; }
.check-zeile { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; padding: 2px 0; }
.dialog .fieldset { display: grid; gap: 4px; }
.dialog .fieldset legend { margin-bottom: 4px; }
.dialog-aktionen { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.dialog-aktionen .links, .dialog-aktionen .rechts { display: flex; gap: 6px; flex-wrap: wrap; }
.dialog-aktionen .rechts { margin-left: auto; }
.btn-gefahr { color: #b42318; border-color: #f1b8b2; }
.btn-gefahr:hover { background: #fdecec; }
.pw-feld { display: flex; gap: 6px; }
.pw-feld .input { flex: 1; min-width: 0; }
.pw-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 6px;
  padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
}
.pw-box code { font-size: 17px; letter-spacing: 0.04em; overflow-wrap: anywhere; }

/* Routenplanung */
.route-start, .route-summe { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.route-summe strong, .route-start strong { color: var(--text); }
.link-knopf { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.link-knopf:hover { text-decoration: underline; }
.field-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.vorschlaege-inline { list-style: none; margin: 6px 0 0; padding: 0; border-radius: 6px; overflow: hidden; }
.vorschlaege-inline li { padding: 8px 10px; border: 1px solid var(--border); border-top: 0; cursor: pointer; font-size: 13px; }
.vorschlaege-inline li:first-child { border-top: 1px solid var(--border); border-radius: 6px 6px 0 0; }
.vorschlaege-inline li:last-child { border-radius: 0 0 6px 6px; }
.vorschlaege-inline li:hover { background: var(--hover); }
.vorschlaege-inline .leer { color: var(--muted); cursor: default; }
.stopp { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 4px; font-size: 12px; color: var(--text); cursor: pointer; }
.umg-liste li .umg-rechts { display: grid; justify-items: end; }

.alternativen { display: grid; gap: 6px; margin-top: 10px; }
.alt {
  display: grid; gap: 1px; text-align: left; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); cursor: pointer; font-size: 13px;
}
.alt span { color: var(--muted); font-size: 12px; }
.alt .alt-kopf { color: var(--text); font-size: 13px; }
.alt:hover { background: var(--hover); }
.alt.aktiv { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }

/* Touren */
.btn-xs { padding: 2px 7px; font-size: 11px; border-radius: 5px; }
.tour-knopf { margin-top: 4px; }
.tour-knopf.in-tour { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.tour-titel { font-size: 16px; font-weight: 650; margin: 2px 32px 8px 0; width: calc(100% - 32px); }
.tour-felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.tour-felder .field { font-size: 12px; }
.tour-liste li { grid-template-columns: 28px 1fr auto; }
.tour-nr {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
}
.tour-aktionen { display: flex; gap: 3px; }
.link-zeile { border: 0; background: none; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.link-zeile:hover { text-decoration: underline; }
.hinweis-ok { margin: 8px 0 0; padding: 8px 10px; border-radius: 6px; background: #e6f6ec; color: #17663a; font-size: 13px; }
.tour-gespeichert { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tour-gespeichert li { border: 1px solid var(--border); border-radius: 6px; }
.tour-gespeichert li.aktiv { border-color: var(--accent); background: var(--accent-soft); }
.tour-gespeichert .link-zeile { display: grid; width: 100%; padding: 8px 10px; }
.tour-gespeichert .link-zeile span { color: var(--muted); font-size: 12px; }
.tour-marker {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff;
  background: #1d4ed8; color: #fff; font: 700 12px/1 -apple-system, sans-serif; box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
#tour-anzahl { margin-left: 2px; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: 50vh 1fr; }
  .map-wrap { grid-row: 1; }
  .panel { grid-row: 2; border-right: 0; border-top: 1px solid var(--border); }
  .drawer { position: fixed; top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 75vh; }
  .topbar-meta, #benutzer-name { display: none; }
  .topbar { gap: 12px; padding: 0 10px; }
  .brand span:last-child { display: none; }
  .legende { bottom: 12px; }
  .tabelle th:nth-child(4), .tabelle td:nth-child(4) { display: none; }
}
