/* Tourenplaner — internal agrar tool, 2026. No framework. */

:root {
  --page: #f4f1ea;
  --card: #ffffff;
  --ink: #1c1917;
  --muted: #57534e;
  --faint: #78716c;
  --line: #e4dfd4;
  --line-strong: #d4cfc3;
  --accent: #1f4d3a;
  --accent-hover: #17382b;
  --accent-soft: #e6efe9;
  --accent-ink: #1f4d3a;
  --churn: #9a6b12;
  --churn-bg: #f8f0de;
  --overdue: #8c3a3a;
  --overdue-bg: #f4e8e6;
  --ok: #1f4d3a;
  --ok-soft: #e6efe9;
  --danger-soft: #f4e8e6;
  --radius: 11px;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.05), 0 1px 3px rgba(28, 25, 23, 0.04);
  --tap: 44px;
  --max: 1120px;
  --header-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }


body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font-family: system-ui, "Segoe UI", Inter, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.page-login {
  justify-content: center;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0 0 0.6rem;
}
h1 { font-size: 1.55rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 0.75rem; }

small, .hint, .muted { color: var(--muted); font-size: 0.9rem; }
.count { font-weight: 500; color: var(--faint); }
.warn { color: var(--overdue); }
.ok { color: var(--ok); font-weight: 600; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.1rem;
}

/* ----- Header / nav ----- */

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--header-h);
  flex-wrap: wrap;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.brand {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  font-size: 1.05rem;
}
.brand:hover { text-decoration: none; color: var(--accent); }

.nav-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.25rem 0.7rem;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}
.nav-links a:hover {
  color: var(--ink);
  background: var(--page);
  text-decoration: none;
}
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 650;
}

.nav-links .inline { margin: 0 0 0 0.25rem; }

/* ----- Main / footer ----- */

.site-main {
  flex: 1;
  padding: 1.4rem 0 2.5rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 0.85rem 0 1.1rem;
  color: var(--faint);
  font-size: 0.82rem;
}
.site-footer .container { padding-top: 0; }

body.page-login .site-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
}
body.page-login .site-header { position: static; }

/* ----- Cards ----- */

article,
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem 1rem 0.95rem;
  margin-bottom: 0.85rem;
}

/* ----- Forms ----- */

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

input, select, textarea, button {
  font: inherit;
  color: var(--ink);
}

input[type="text"],
input[type="search"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="file"],
select,
textarea {
  display: block;
  width: 100%;
  min-height: var(--tap);
  margin-top: 0.3rem;
  padding: 0.45rem 0.7rem;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  box-shadow: none;
}
textarea { min-height: 5.5rem; resize: vertical; }

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
  margin: 0;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--tap);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0.2rem 0;
}
.check-line input { flex-shrink: 0; }

.check-hit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap);
  min-height: var(--tap);
  margin: 0;
}

/* ----- Buttons ----- */

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0.5rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}
button:hover,
.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  text-decoration: none;
  color: #fff;
}

button.outline,
.btn-outline,
a.outline {
  background: #fff;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
button.outline:hover,
.btn-outline:hover,
a.outline:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

button.secondary,
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--line-strong);
}
button.secondary:hover,
.btn-secondary:hover {
  background: var(--page);
  color: var(--ink);
  border-color: var(--muted);
}

button.small {
  min-height: 36px;
  padding: 0.25rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.inline { display: inline; margin: 0; }
.inline button { width: auto; }

.btn-done {
  width: 100%;
  min-height: 56px;
  font-size: 1.12rem;
  letter-spacing: 0.01em;
}

.tap-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin: 0.75rem 0;
}
.tap-pair > a,
.tap-pair > .btn,
.tap-pair > .btn-outline {
  min-height: var(--tap);
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ----- Tables (desktop) ----- */

.table-wrap { overflow: visible; margin: 0 0 1rem; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
th, td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 650;
  background: #faf8f3;
}
tr:last-child td { border-bottom: none; }
td.name-cell, th.name-col { min-width: 12rem; }
td.name-cell { overflow-wrap: anywhere; word-break: break-word; }

tr.overdue td { background: var(--overdue-bg); }
tr.churn td { background: var(--churn-bg); }
tr.overdue.churn td { background: #f3ebe0; }

.card-list { display: none; }
.mobile-only { display: none; }

/* ----- KPI / dashboard ----- */

.lead-kpi {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin: 0 0 1.15rem;
  color: var(--muted);
}
.lead-kpi .kpi-value {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.kpi-card { margin-bottom: 0; }
.kpi-card h2 { margin-bottom: 0.15rem; color: var(--muted); font-weight: 600; font-size: 0.92rem; }
.kpi-card .kpi-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0.15rem 0 0.7rem;
}
.kpi-card.tone-overdue .kpi-value { color: var(--overdue); }
.kpi-card.tone-churn .kpi-value { color: var(--churn); }
.kpi-card.tone-ok .kpi-value { color: var(--accent); }

.kpi-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.kpi-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.kpi-list li:last-child { border-bottom: none; }

.scan-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.75rem;
  align-items: baseline;
}
.scan-row .place { color: var(--muted); font-size: 0.85rem; grid-column: 1; }
.scan-row .drop {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--churn);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.more-link {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.empty-note {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.dq-list { list-style: none; margin: 0; padding: 0; }
.dq-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.dq-list li:last-child { border-bottom: none; }
.dq-list span { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.dq-list strong { font-variant-numeric: tabular-nums; font-size: 1.7rem; letter-spacing: -0.03em; line-height: 1.1; }

/* ----- Page chrome ----- */

.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}
.page-head h1 { margin-bottom: 0.25rem; }
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.crumb { margin: 0 0 0.35rem; font-size: 0.88rem; }
.crumb a { color: var(--muted); }

.phone-hit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 0.95rem;
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
  background: #fff;
}
.phone-hit:hover { background: var(--accent-soft); text-decoration: none; }

/* ----- Filters / search rows ----- */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem 0.85rem;
}

.row-search {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem 0.85rem;
  align-items: end;
  margin-bottom: 0.4rem;
}
.row-search button { width: 100%; }

.filters button { width: auto; }

.filter-drawer {
  margin: 0;
}

.filter-drawer summary {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  cursor: pointer;
  font-weight: 650;
  color: var(--accent-ink);
  user-select: none;
}

.filter-drawer[open] summary {
  margin-bottom: 0.25rem;
}

/* ----- Entity cards (mobile lists) ----- */

.entity-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.75rem 0.85rem;
}
.entity-card.overdue { background: var(--overdue-bg); }
.entity-card.churn { background: var(--churn-bg); }
.entity-card.overdue.churn { background: #f3ebe0; }

.entity-card-top {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
}
.entity-card .name {
  font-weight: 650;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.entity-card .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.2rem 0 0.45rem;
}
.entity-card .reason {
  font-size: 0.88rem;
  color: var(--ink);
  margin: 0.15rem 0 0.45rem;
  overflow-wrap: anywhere;
}
.entity-card .row-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.prio {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
  white-space: nowrap;
}

.chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--page);
  color: var(--muted);
  border: 1px solid var(--line);
}
.chip-warn { background: var(--overdue-bg); color: var(--overdue); border-color: #e0c8c6; }
.chip-churn { background: var(--churn-bg); color: var(--churn); border-color: #e6d7b0; }
.chip-missing { background: #f3efe6; color: #6b5344; border-color: #e4d8c4; }

.alias { color: var(--faint); font-weight: 400; }

/* ----- Sticky plan action ----- */

.sticky-actions {
  margin-top: 0.75rem;
}
.sticky-actions .btn,
.sticky-actions button { width: 100%; }

/* ----- Tagesplan stop cards ----- */

.stop-card { margin-bottom: 0.65rem; padding: 0.75rem 0.85rem; }
.stop-card h3 { margin-bottom: 0.2rem; overflow-wrap: anywhere; }
.stop-card .addr { color: var(--muted); margin-bottom: 0.2rem; }

.stop-card.done {
  opacity: 1;
  background: #eef3ef;
  border-color: #c5d2c8;
  box-shadow: none;
  border-left: 4px solid var(--accent);
}
.stop-card.done h3 { color: var(--muted); }
.done-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ok);
  font-weight: 700;
  margin: 0.4rem 0 0;
}
.done-badge::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 0 0 2px #eef3ef, inset 0 0 0 3.5px var(--accent);
}

.note-field { margin: 0.15rem 0 0.55rem; }

/* ----- Login ----- */

.login-card {
  width: 100%;
  max-width: 24rem;
  margin: 0 auto;
  padding: 1.5rem 1.4rem 1.45rem;
}
.login-card h1 { margin-bottom: 0.85rem; }
.login-card button { width: 100%; margin-top: 0.35rem; }
.login-card .hint { margin-top: 0.85rem; text-align: center; }

/* ----- Detail bits ----- */

.kv {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 0.4rem 1rem;
  margin: 0;
}
.kv dt { font-weight: 600; color: var(--muted); font-size: 0.88rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.trend-nums {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}
.trend-nums span { display: block; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.trend-nums strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }

.trend-bar {
  height: 8px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
  margin: 0.35rem 0 0.55rem;
}
.trend-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}
.trend-fill.down { background: var(--churn); }

.visit-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem 0.75rem;
  align-items: end;
  margin-bottom: 0.85rem;
}

.warnings { max-height: 16rem; overflow: auto; }

.banner-warn {
  background: var(--overdue-bg);
  color: var(--overdue);
  border: 1px solid #e0c8c6;
  border-radius: 9px;
  padding: 0.55rem 0.75rem;
  margin: 0 0 1rem;
  font-weight: 600;
}

.match-list, .plain-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.match-list li, .plain-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.anchor-box p { margin: 0; }

/* ----- Responsive ----- */

@media (min-width: 720px) {
  details.filter-drawer,
  details.filter-drawer[open] {
    display: contents;
  }
  details.filter-drawer > summary {
    display: none;
  }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .row-search { grid-template-columns: 1fr 12.5rem auto; }
  .row-search button { width: auto; min-width: 7.5rem; }
  .visit-form { grid-template-columns: 11rem 1fr auto; }
  .sticky-actions .btn,
  .sticky-actions button { width: auto; }
  .scan-row { grid-template-columns: 1fr 10rem auto; }
  .scan-row .place { grid-column: 2; grid-row: 1; text-align: right; }
  .scan-row .drop { grid-column: 3; grid-row: 1; }
  table .btn-outline {
    min-height: 36px;
    padding: 0.2rem 0.65rem;
    font-size: 0.88rem;
  }
  table .tap-pair { margin: 0.15rem 0 0; gap: 0.35rem; }
}

@media (min-width: 960px) {
  .kpi-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .kpi-grid .kpi-wide { grid-column: span 2; }
}

@media (max-width: 719px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block; }

  .table-wrap table {
    border: none;
    background: transparent;
    box-shadow: none;
    display: block;
  }
  .table-wrap thead { display: none; }
  .table-wrap tbody { display: block; }
  .table-wrap tr {
    display: block;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.85rem 1rem;
    margin-bottom: 0.7rem;
  }
  .table-wrap tr.overdue { background: var(--overdue-bg); }
  .table-wrap tr.churn { background: var(--churn-bg); }
  .table-wrap tr.overdue.churn { background: #f3ebe0; }
  .table-wrap td {
    display: block;
    border: none;
    padding: 0.12rem 0;
  }
  .table-wrap td.name-cell a { font-weight: 650; }
  .table-wrap tr.has-check {
    display: grid;
    grid-template-columns: var(--tap) 1fr;
    align-items: start;
  }
  .table-wrap td.col-check {
    grid-column: 1;
    grid-row: 1 / -1;
    padding: 0;
  }
  .table-wrap tr.has-check td:not(.col-check) {
    grid-column: 2;
  }
  table .btn-outline {
    min-height: 44px;
    width: auto;
    display: inline-flex;
    align-items: center;
    padding: 0 0.9rem;
  }
  .site-header .container { flex-wrap: nowrap; }
  nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links { flex-wrap: nowrap; }
  .card-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-bottom: 0.5rem;
  }
  .nav-links a { min-height: var(--tap); }
  .nav-links button.small { min-height: var(--tap); }
  .sticky-actions {
    position: sticky;
    bottom: calc(48px + env(safe-area-inset-bottom, 0px));
    z-index: 15;
    background: var(--page);
    padding: 0.7rem 0 calc(0.7rem + env(safe-area-inset-bottom));
    margin: 0.5rem -1.1rem 0;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 16px rgba(28, 25, 23, 0.04);
  }
  .kv { grid-template-columns: 1fr; gap: 0.1rem; }
  .kv dt { margin-top: 0.45rem; }
  h1 { font-size: 1.35rem; }
  .site-main { padding-bottom: calc(4.5rem + 48px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 419px) {
  .site-header .container { padding-left: 0.85rem; padding-right: 0.85rem; }
  .container { padding-left: 0.85rem; padding-right: 0.85rem; }
}

.nav-drawer { margin-left: auto; }
.nav-drawer > summary { list-style: none; }
.nav-drawer > summary::-webkit-details-marker { display: none; }
.nav-toggle {
  display: none;
  min-height: var(--tap);
  padding: 0 0.85rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
}
@media (max-width: 719px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav-drawer { position: relative; }
  .nav-drawer nav {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(28, 25, 23, 0.1);
    min-width: 12.5rem;
    padding: 0.4rem;
    z-index: 30;
  }
  .nav-drawer[open] nav { display: block; }
  .nav-drawer .nav-links {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
  }
  .nav-drawer .nav-links a,
  .nav-drawer .nav-links button {
    width: 100%;
    justify-content: flex-start;
  }
  .site-header .container { flex-wrap: nowrap; }
  .table-wrap { padding-bottom: 5.5rem; }
}
@media (min-width: 720px) {
  .nav-drawer { display: contents; }
  .nav-toggle { display: none; }
}

/* ----- Hero Google Maps route ----- */

.hero-route { margin: 0.35rem 0 1rem; }
.btn-hero {
  width: 100%;
  min-height: 56px;
  font-size: 1.12rem;
  letter-spacing: 0.01em;
}
@media (min-width: 720px) {
  .btn-hero { width: auto; min-width: 18rem; }
}

/* ----- Mobile bottom bar (48px) ----- */

.bottom-bar { display: none; }

@media (max-width: 719px) {
  .bottom-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    height: calc(48px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 14px rgba(28, 25, 23, 0.05);
  }
  .bottom-bar a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    color: var(--muted);
    font-weight: 650;
    font-size: 0.92rem;
    text-decoration: none;
  }
  .bottom-bar a:hover { text-decoration: none; color: var(--ink); }
  .bottom-bar a.active {
    color: var(--accent);
    background: var(--accent-soft);
  }
  body.page-login .bottom-bar { display: none; }
  .nav-primary { display: none; }
}

/* ----- Full-height map page ----- */

html:has(body.page-map),
body.page-map {
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
}
body.page-map {
  display: flex;
  flex-direction: column;
}
body.page-map .site-main {
  flex: 1;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
body.page-map .site-main > .container {
  max-width: none;
  width: 100%;
  padding: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body.page-map .site-footer { display: none; }

.map-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
}
#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #e8efe9;
}

.map-caption {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.55rem 0.8rem 0.6rem;
  max-width: min(16.5rem, calc(100% - 4.5rem));
}
.map-caption h1 { font-size: 1.05rem; margin: 0 0 0.1rem; }
.map-caption .hint { margin: 0; font-size: 0.82rem; }

.leaflet-div-icon.plz-marker {
  background: transparent;
  border: none;
}
.plz-bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--s, 28px);
  height: var(--s, 28px);
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(28, 25, 23, 0.28);
}

.leaflet-container a { color: var(--accent); }

@media (max-width: 719px) {
  body.page-map .site-main {
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  }
  body.page-map .leaflet-control-attribution {
    margin-bottom: 2px;
  }
}


.map-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 600;
  width: min(20rem, calc(100% - 20px));
  max-height: calc(100% - 20px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.12);
  padding: 0.7rem 0.85rem 0.8rem;
}
.map-panel h2 { font-size: 1.05rem; margin: 0 1.6rem 0.15rem 0; }
.map-panel .hint { margin: 0 0 0.45rem; }
.map-panel .plain-list { margin-bottom: 0.35rem; }
.map-panel-close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  min-height: 36px;
  min-width: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
}
.map-panel-close:hover {
  background: var(--page);
  color: var(--ink);
  border: none;
}
@media (max-width: 719px) {
  .map-panel {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-height: 42%;
  }
}

table .btn-outline { white-space: nowrap; min-width: 4.2rem; }
th:first-child, td:first-child { white-space: nowrap; }
