:root {
  /* Farben aus dem System-Design (apps.app.paulwoehrle.de/shared/system.css) */
  --green: var(--sys-accent);
  --green-dark: var(--sys-accent);
  --green-soft: var(--sys-accent-soft);
  --on-green: var(--sys-accent-text);
  --ink: var(--sys-text);
  --muted: var(--sys-muted);
  --faint: var(--sys-faint);
  --line: var(--sys-border-soft);
  --line-strong: var(--sys-border);
  --bg: var(--sys-bg);
  --card: var(--sys-surface);
  --panel: var(--sys-sidebar);
  --field: var(--sys-input);
  --hover: var(--sys-hover);
  --amber: var(--sys-warning);
  --red: var(--sys-danger);
  --ok: var(--sys-success);
  --blue: #2563eb;
  --radius: var(--sys-radius);
  --shadow: 0 -2px 16px rgba(0, 0, 0, .18);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.4 var(--sys-font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

input, button { font: inherit; color: inherit; }

/* ---- Login ---- */
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 22px;
  display: grid;
  gap: 12px;
}
.login-card p { margin: 0 0 6px; }

/* ---- Grundgerüst ---- */
.app { height: 100dvh; display: flex; flex-direction: column; }
.top {
  flex: none;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  z-index: 1000;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .2px; }
.brand-lg { font-size: 22px; color: var(--ink); }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.tabs { display: flex; gap: 2px; margin-left: auto; background: var(--field); border: 1px solid var(--line); padding: 3px; border-radius: 10px; }
.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
}
.tab.active { background: var(--sys-active); color: var(--ink); }
.count { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 10px; background: var(--green-soft); color: var(--ink); font-size: 12px; text-align: center; }
.tab.active .count { background: var(--green); color: var(--on-green); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--ink);
  padding: 7px 10px;
  border-radius: 9px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.icon-btn.square { background: var(--field); color: var(--ink); padding: 0; width: 46px; height: 46px; justify-content: center; flex: none; }

.view { display: none; flex: 1; min-height: 0; position: relative; }
.view.active { display: flex; flex-direction: column; }
#map { flex: 1; min-height: 0; }

/* ---- Panel ---- */
.panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 800;
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
  padding: 14px 16px calc(10px + var(--safe-b));
  display: grid;
  gap: 10px;
}
@media (min-width: 760px) {
  .panel { left: 16px; right: auto; bottom: 16px; width: 380px; border-radius: var(--radius); border-bottom: 1px solid var(--line); padding-bottom: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .22); }
}

.field-row { display: flex; gap: 8px; }
.field { position: relative; flex: 1; }
.field input, .leads-head input, .login-card input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--sys-radius-sm);
  padding: 0 14px;
  background: var(--field);
  color: var(--ink);
  outline: none;
  font-size: 16px; /* verhindert Zoom auf iOS */
}
input::placeholder { color: var(--faint); }
.field input:focus, .leads-head input:focus, .login-card input:focus, .filter-suche input:focus { border-color: var(--sys-accent-line); box-shadow: 0 0 0 3px var(--sys-accent-soft); }

.suggest {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 52px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--sys-dialog);
  border: 1px solid var(--line-strong);
  border-radius: var(--sys-radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  max-height: 260px;
  overflow: auto;
  z-index: 5;
}
.suggest li { padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.suggest li:hover, .suggest li.sel { background: var(--hover); }

.radius-row { display: flex; align-items: center; gap: 12px; }
.radius-row label { font-weight: 600; color: var(--muted); font-size: 14px; }
.radius-row input { flex: 1; accent-color: var(--green); height: 30px; }
.radius-row output { min-width: 56px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.hint { margin: 0; font-size: 13px; color: var(--muted); }
.hint b { color: var(--ink); }
.hint.warn { color: var(--amber); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}
.btn-sm { height: 46px; padding: 0 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--green); color: var(--on-green); }
.btn-primary:hover, .btn-primary:active { background: var(--sys-accent-hover); }
.btn-primary:disabled { background: var(--sys-active); color: var(--faint); cursor: default; }
.btn-ghost { background: var(--field); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--hover); border-color: var(--sys-border-strong); }
.btn-link { background: none; color: var(--muted); height: 38px; font-weight: 500; }
.btn-link:hover { color: var(--ink); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.run-head { display: flex; align-items: baseline; gap: 10px; }
.step { font-size: 12px; font-weight: 700; color: var(--green-dark); background: var(--green-soft); padding: 2px 8px; border-radius: 999px; flex: none; }
.phase { font-weight: 700; }
.bar { height: 8px; background: var(--field); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar div { height: 100%; width: 0; background: var(--green); transition: width .4s ease; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { background: var(--card); border: 1px solid var(--line); border-radius: var(--sys-radius-sm); padding: 8px 10px; display: grid; }
.stats b { font-size: 20px; font-variant-numeric: tabular-nums; }
.stats span { font-size: 11.5px; color: var(--muted); }

.done-title { font-size: 18px; font-weight: 700; }
.done-title.ok { color: var(--ok); }
.done-title.warn { color: var(--amber); }
.done-title.bad { color: var(--red); }

.legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; border-top: 1px solid var(--line); padding-top: 8px; flex-wrap: wrap; }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.swatch-offen {
  border: 1.5px solid #dc2626;
  background: repeating-linear-gradient(45deg, rgba(220, 38, 38, .38) 0 2px, rgba(254, 226, 226, .35) 2px 5px);
}
.swatch-fertig { border: 1.5px solid #15803d; background: rgba(34, 197, 94, .45); }
.legend-text { margin-left: auto; }

/* ---- Karte ---- */
.leaflet-container { font: inherit; background: #e5e7eb; }
.leaflet-popup-content { margin: 12px 14px; font-size: 14px; }
.pop b { display: block; margin-bottom: 2px; }
.pop .pop-actions { display: flex; gap: 12px; margin-top: 8px; }
.pop a { color: var(--sys-accent); font-weight: 600; }
.pop .del { color: var(--red); background: none; border: 0; padding: 0; font-weight: 600; cursor: pointer; }
.center-pin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
@keyframes pulse { 0%, 100% { opacity: .9; } 50% { opacity: .35; } }
.running-ring { animation: pulse 1.4s ease-in-out infinite; }

/* ---- Leads ---- */
#view-leads { overflow-y: auto; overflow-x: hidden; background: var(--bg); }
.leads-sticky { position: sticky; top: 0; z-index: 2; background: var(--bg); max-width: 100%; }
.leads-head { display: flex; gap: 8px; padding: 12px 16px 8px; max-width: 820px; margin: 0 auto; }
.leads-head input { flex: 1; }
.leads-info { margin: 0 auto; padding: 0 16px 8px; font-size: 13px; color: var(--muted); max-width: 820px; }
.lead-list {
  display: grid;
  /* feste Spaltenbreite: sonst zieht ein langer Name die Karte über den Rand */
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 0 16px calc(24px + var(--safe-b));
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
}
.lead {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}
.lead-top { display: flex; align-items: flex-start; gap: 8px; }
.lead-name { font-weight: 600; flex: 1; }
.lead:hover { border-color: var(--line-strong); }
.km { flex: none; font-size: 12px; font-weight: 600; color: var(--ink); background: var(--green-soft); padding: 2px 8px; border-radius: 999px; }
.lead-sub { font-size: 13px; color: var(--muted); }
.lead-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip.call { background: var(--green); color: var(--on-green); border-color: transparent; font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

.err { color: var(--red); margin: 0; font-size: 14px; }
.muted { color: var(--muted); }

@media (max-width: 420px) {
  .hide-xs { display: none; }
  .tab { padding: 6px 8px; }
  .top { gap: 6px; padding: 0 10px; }
}
@media (max-width: 360px) {
  .brand-text { display: none; }
}
.leaflet-top.leaflet-left .leaflet-control-attribution { margin: 0; border-radius: 0 0 6px 0; font-size: 11px; }

/* ---- Selbsttest ---- */
.check { font-size: 13px; display: grid; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--sys-radius-sm); padding: 10px 12px; }
.check div { display: flex; gap: 8px; }
.check b { flex: none; width: 104px; font-weight: 600; }
.check .ok { color: var(--ok); }
.check .bad { color: var(--red); }

/* ---- Leads: Sortieren und Filtern ---- */
.leads-tools { display: flex; gap: 6px; padding: 0 16px 8px; align-items: center; }
.leads-tools select {
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--field);
  color: var(--ink);
  padding: 0 22px 0 8px;
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
}
.fchip {
  height: 38px;
  flex: none;
  font-size: 13.5px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--field);
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
}
.fchip:hover { color: var(--ink); }
.fchip.on { background: var(--green-soft); border-color: var(--sys-accent-line); color: var(--ink); }
.lead { cursor: pointer; }
.lead-actions a { cursor: pointer; }

/* ---- Detailansicht ---- */
.sheet { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.sheet-card {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 88dvh;
  background: var(--sys-dialog);
  color: var(--ink);
  border: 1px solid var(--sys-border-strong);
  border-radius: 14px 14px 0 0;
  box-shadow: var(--sys-shadow);
  display: flex;
  flex-direction: column;
  animation: rise .18s ease-out;
}
@keyframes rise { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (min-width: 760px) {
  .sheet { align-items: center; }
  .sheet-card { border-radius: 14px; max-height: 84dvh; }
}
.sheet-head { display: flex; gap: 12px; align-items: flex-start; padding: 16px 16px 10px; border-bottom: 1px solid var(--line); }
.sheet-title { flex: 1; min-width: 0; }
.sheet-name { font-size: 18px; font-weight: 700; }
.sheet-close { flex: none; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: var(--field); color: var(--muted); font-size: 16px; cursor: pointer; }
.sheet-close:hover { background: var(--hover); color: var(--ink); }
.sheet-body { overflow: auto; padding: 14px 16px calc(20px + var(--safe-b)); display: grid; gap: 14px; }
.sheet-body h4 { margin: 0 0 7px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); }
.kv { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: 4px 10px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.rows { display: grid; gap: 6px; }
.row-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--sys-radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  text-decoration: none;
  color: inherit;
}
.row-link:hover { background: var(--hover); }
.row-link .rl-main { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.row-link .rl-sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.row-link .rl-go { color: var(--muted); font-weight: 600; flex: none; }
.impressum {
  white-space: pre-wrap;
  font-size: 12.5px;
  line-height: 1.5;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--sys-radius-sm);
  padding: 10px 12px;
  max-height: 260px;
  overflow: auto;
  color: var(--muted);
}
details summary { cursor: pointer; font-weight: 600; color: var(--muted); }

/* ---- Suchlauf ---- */
.run-top { display: flex; align-items: flex-start; gap: 10px; }
.run-head-text { flex: 1; min-width: 0; }
.run-title { font-weight: 700; font-size: 17px; }
.run-pct { font-size: 26px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.steps li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.steps li .ico {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.steps li .txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps li .num { flex: none; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.steps li.laeuft { color: var(--ink); font-weight: 600; }
.steps li.laeuft .ico { border-color: var(--green); color: var(--ink); animation: pulse 1.4s ease-in-out infinite; }
.steps li.fertig .ico { background: var(--green); border-color: var(--green); color: var(--on-green); }
.steps li.fertig { color: var(--muted); }
.leads-tools { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.leads-tools::-webkit-scrollbar { display: none; }
.leads-tools select { flex: none; max-width: 190px; }
.gebiet-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--green-soft);
  border-radius: 6px;
  padding: 1px 7px;
}
.pop .lnk { color: var(--sys-accent); background: none; border: 0; padding: 0; font-weight: 600; cursor: pointer; }

/* ---- Umkreis oder PLZ ---- */
.modus { display: flex; gap: 4px; background: var(--field); border: 1px solid var(--line); padding: 3px; border-radius: 10px; }
.modus-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.modus-btn.active { background: var(--sys-active); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 92px; overflow-y: auto; }
.chip-plz {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-soft);
  color: var(--ink);
  border: 1px solid var(--sys-accent-line);
  border-radius: 999px;
  padding: 4px 6px 4px 11px;
  font-size: 13px;
  font-weight: 600;
}
.chip-plz button { border: 0; background: none; color: inherit; font-size: 15px; line-height: 1; cursor: pointer; opacity: .65; padding: 0 3px; }
.chips-leer { font-size: 13px; color: var(--muted); }
.plz-label {
  background: none;
  border: 0;
  box-shadow: none;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  padding: 0;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
}
.plz-label::before { display: none; }

.plz-tools { display: flex; gap: 6px; margin-bottom: 8px; }
.btn-mini { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; font-weight: 500; }

/* ---- PLZ-Filter ---- */
.filter-suche { padding: 10px 16px 0; }
.filter-suche input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--sys-radius-sm);
  padding: 0 14px;
  background: var(--field);
  color: var(--ink);
  font-size: 16px;
  outline: none;
}
.baum { padding-top: 10px; gap: 0; }
.knoten {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
}
.knoten.tief1 { padding-left: 22px; }
.knoten.tief2 { padding-left: 44px; }
.knoten .pfeil { width: 18px; flex: none; color: var(--muted); font-size: 12px; text-align: center; }
.knoten .haken {
  width: 22px;
  height: 22px;
  flex: none;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--on-green);
  background: var(--field);
}
.knoten.an .haken { background: var(--green); border-color: var(--green); }
.knoten.halb .haken { background: var(--green-soft); border-color: var(--green); color: var(--ink); }
.knoten .name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knoten.tief2 .name { font-weight: 500; }
.knoten .zahl { flex: none; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.filter-fuss {
  display: flex;
  gap: 8px;
  padding: 10px 16px calc(12px + var(--safe-b));
  border-top: 1px solid var(--line);
}
.filter-fuss .btn { flex: 1; }
.fchip.an { background: var(--green-soft); border-color: var(--sys-accent-line); color: var(--ink); }

/* ---- Spaltenwahl ---- */
.spalte { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.spalte .nr { width: 22px; flex: none; font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; }
.spalte .name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spalte .pfeilbtn, .spalte .wegbtn, .spalte .dazubtn {
  flex: none;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 15px;
  cursor: pointer;
}
.spalte .dazubtn { background: var(--green-soft); color: var(--ink); font-weight: 700; }
.spalte .wegbtn { color: var(--red); }
.spalte.aus .name { color: var(--muted); font-weight: 500; }
.trenner { padding: 14px 4px 7px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); }

/* ---- Entfernungsfilter ---- */
.km-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.km-chips .fchip { height: 36px; padding: 0 12px; }
#kmSheet .radius-row { margin-top: 10px; }
#kmSheet .sheet-body > div + div { border-top: 1px solid var(--line); padding-top: 14px; }

/* PLZ mit Anzahl der Leads */
.plz-pille {
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 3px 2px 8px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 5px rgba(15, 23, 42, .35);
  font: 700 11.5px system-ui;
  color: #334155;
  white-space: nowrap;
}
.plz-pille .z { background: #14532d; color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 12px; }
.plz-pille.offen { opacity: .85; }
.plz-pille.offen .z { background: #64748b; }

/* Firefox-Scrollbalken (automatisch aus ::-webkit-scrollbar abgeleitet) */
@supports not selector(::-webkit-scrollbar) {
  .leads-tools { scrollbar-width: none; }
}

/* ---- System-Design: Kartenbedienelemente, Darstellung ---- */
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--sys-dialog); color: var(--ink); box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.leaflet-popup-content-wrapper { border: 1px solid var(--line-strong); border-radius: var(--sys-radius-sm); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-bar { border: 1px solid var(--line-strong) !important; box-shadow: 0 2px 8px rgba(0, 0, 0, .2) !important; border-radius: 9px; overflow: hidden; }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--panel); color: var(--ink); border-bottom-color: var(--line); }
.leaflet-bar a:hover { background: var(--hover); }
.icon-btn.theme-btn { padding: 7px; }
.tab { white-space: nowrap; }
.top .brand { min-width: 0; }
.top .brand-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .tabs, .top .icon-btn { flex: none; }
.leads-tools { max-width: 820px; margin: 0 auto; }
.leads-sticky { border-bottom: 1px solid var(--line); margin-bottom: 10px; }

/* ---- Kachel 960×540 (wenig Höhe): Panel kompakter, damit mehr Karte sichtbar bleibt ---- */
@media (min-width: 760px) and (max-height: 600px) {
  .panel { left: 10px; bottom: 10px; width: 360px; padding: 10px 12px; gap: 7px; }
  .field input { height: 40px; }
  .icon-btn.square { width: 40px; height: 40px; }
  .suggest { bottom: 46px; max-height: 200px; }
  .panel .btn { height: 40px; }
  .panel .btn-link { height: 30px; }
  .panel .legend { padding-top: 6px; }
  /* Lauf-/Ergebnisanzeige darf nicht über den Kartenrand hinauswachsen */
  #p-run, #p-done { max-height: calc(100vh - 150px); overflow: auto; scrollbar-width: thin; }
  .stats b { font-size: 17px; }
}
