/* ── Design-Tokens: Light (Standard) ────────────────── */
:root {
  --accent: #ea580c;
  --accent-hover: #c2410c;
  --accent-soft: rgba(234, 88, 12, 0.1);
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-hover: #f3f4f2;
  --border: #e3e4e1;
  --text: #1c1e1b;
  --text-muted: #62655f;
  --success: #16a34a;
  --warning: #b45309;
  --danger: #dc2626;
  --info: #2563eb;
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(28, 30, 27, 0.06), 0 4px 16px rgba(28, 30, 27, 0.06);
  --shadow-lg: 0 8px 28px rgba(28, 30, 27, 0.14);
  --overlay-bg: rgba(255, 255, 255, 0.94);
  color-scheme: light;
}

/* ── Design-Tokens: Dark (per Toggle, [data-theme="dark"]) ── */
:root[data-theme='dark'] {
  --accent: #f97316;
  --accent-hover: #fb923c;
  --accent-soft: rgba(249, 115, 22, 0.14);
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-hover: #242838;
  --border: #2a2d3e;
  --text: #e2e8f0;
  --text-muted: #8892a4;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --info: #3b82f6;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.55);
  --overlay-bg: rgba(15, 17, 23, 0.92);
  color-scheme: dark;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.2s ease, color 0.2s ease;
}

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

/* ── Inline-Icons (SVG, currentColor) ────────────────── */
.icon-inline {
  display: inline-flex;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

.icon-inline svg {
  width: 100%;
  height: 100%;
}

a:hover {
  text-decoration: underline;
}

/* ── Navigation ─────────────────────────────────────── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 56px;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-logo:hover {
  text-decoration: none;
  color: var(--text);
}

.nav-logo-mark {
  display: inline-flex;
  color: var(--accent);
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav-logo-mark svg { width: 100%; height: 100%; }

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  overflow-x: auto;
  flex: 1;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.nav-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-icon svg { width: 100%; height: 100%; }

.nav-links a:hover,
.nav-links a.active {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-links a.active {
  color: var(--accent);
}

/* Kopfnavigation auf schmalen Schirmen: umbrechen statt seitlich scrollen (Robert, 23.09.2026).
   Zeile 1 traegt Logo und Theme-Schalter, Zeile 2 die vier Menuepunkte. Die Menuepunkte brauchen
   490 Pixel; einzeilig bleiben dafuer erst ab rund 800 Pixel Schirmbreite genug uebrig. */
@media (max-width: 800px) {
  .nav-inner {
    flex-wrap: wrap;
    height: auto;
    gap: 0.35rem 0.5rem;
    padding: 0.4rem 0.75rem 0.45rem;
  }

  .nav-logo { font-size: 0.98rem; margin-right: auto; }

  .nav-links {
    order: 3;
    width: 100%;
    flex: 0 0 100%;
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 0.15rem 0.2rem;
  }

  .nav-links a {
    padding: 0.25rem 0.4rem;
    font-size: 0.8rem;
  }

  .theme-toggle { margin-left: 0; width: 32px; height: 32px; }
}

/* Unter 580 Pixeln reicht die zweite Zeile nicht mehr fuer Symbole und Beschriftung:
   ohne Symbole sind es 320 statt 417 Pixel und damit eine Zeile statt zwei. */
@media (max-width: 580px) {
  .nav-links .nav-icon { display: none; }
}

/* ── Theme-Toggle ────────────────────────────────────── */
.theme-toggle {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  margin-left: 0.5rem;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-icon {
  width: 17px;
  height: 17px;
  display: none;
}

.theme-icon svg { width: 100%; height: 100%; }

.theme-icon-sun { display: inline-flex; }
.theme-icon-moon { display: none; }

.theme-toggle.is-dark .theme-icon-sun { display: none; }
.theme-toggle.is-dark .theme-icon-moon { display: inline-flex; }

/* ── Layout ──────────────────────────────────────────── */
main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  width: 100%;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── Karten ──────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: var(--font);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-outline:hover,
.btn-outline.active {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--accent);
}

.btn-outline.active {
  color: var(--accent);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

/* ── Formulare ───────────────────────────────────────── */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Filter-Bar ──────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

/* ── Badges / Tags ───────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-danger  { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-warning { background: rgba(234,179,8,0.15); color: var(--warning); }
.badge-info    { background: rgba(59,130,246,0.15); color: var(--info); }
.badge-success { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-muted   { background: rgba(136,146,164,0.15); color: var(--text-muted); }
.badge-accent  { background: rgba(249,115,22,0.15); color: var(--accent); }

/* ── Karte (Leaflet-Container) ───────────────────────── */
#map {
  width: 100%;
  height: 480px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

@media (max-width: 600px) {
  #map { height: 320px; }
}

/* ── Liste ───────────────────────────────────────────── */
.list-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.5rem;
  transition: border-color 0.15s;
}

.list-item:hover {
  border-color: var(--accent);
}

.list-item-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.list-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Statuskarten (KPIs) ─────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  text-align: center;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── Hinweis-Boxen ───────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert-info    { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.3); color: #93c5fd; }
.alert-success { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.3); color: #86efac; }
.alert-warning { background: rgba(234,179,8,0.1); border-color: rgba(234,179,8,0.3); color: #fde047; }
.alert-danger  { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #fca5a5; }

/* ── Tabs ────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.6rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: var(--font);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Footer ──────────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

footer a { color: var(--text-muted); }
footer a:hover { color: var(--text); }

/* ── Site-Footer (mehrspaltig, auf allen Seiten) ─────── */
footer.site-footer {
  padding: 2.5rem 1rem 1.5rem;
  text-align: left;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.6rem;
  font-size: 1rem;
}

.footer-about p { line-height: 1.6; max-width: 40ch; }

.footer-col h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col ul a { font-size: 0.85rem; }

.site-footer .footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
}

@media (max-width: 820px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ── Spinner ─────────────────────────────────────────── */
.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 2rem auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Detailseiten-Komponenten (Ämter & Gemeinden) ────── */
/* Gemeinsame Bausteine für /amt/:slug und /gemeinde/:slug,
   damit Design-Änderungen nur an einer Stelle gepflegt werden müssen. */
.info-block h3 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.info-block p,
.info-block a { font-size: 0.95rem; color: var(--text); line-height: 1.5; }

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  word-break: break-all;
  margin-bottom: 0.15rem;
}

.contact-link:hover { text-decoration: underline; }

.oez-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.oez-table td { padding: 0.3rem 0; vertical-align: top; }
.oez-table td:first-child { color: var(--text-muted); width: 42%; }
.oez-table tr.closed td { color: var(--text-muted); opacity: 0.6; }

.directions-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  margin-top: 0.5rem;
}

.directions-btn:hover { background: var(--accent-hover); text-decoration: none; }

.tag-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
}

.faq-item summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.2rem; color: var(--accent); flex-shrink: 0; margin-left: 1rem; }
.faq-item[open] summary::after { content: '−'; }
.faq-answer { padding: 0 1.25rem 1rem; color: var(--text-muted); line-height: 1.7; font-size: 0.93rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.back-link:hover { color: var(--accent); text-decoration: none; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 1.3rem; }
  .kpi-value { font-size: 1.4rem; }
}

/* ── Seitengerüst und gemeinsame Bausteine aller Unterseiten ──
   Früher als eigener <style>-Block in jedem Modul (lk-, g-, amt-, sp-, ld-, ov-, nf-),
   seit Phase 1 nur noch hier. */
main.page { max-width: 1100px; margin: 0 auto; padding: 2rem 1rem 4rem; }
main.home { max-width: none; margin: 0; padding: 0; }
main.page-center { max-width: 700px; padding-top: 4rem; text-align: center; }
.muted { color: var(--text-muted); margin-bottom: 2rem; }
.nf-emoji { font-size: 3rem; margin-bottom: 1rem; }
main.page-center h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 0.6rem; }
main.page-center .section-label { margin: 1.5rem 0 0.6rem; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.06em; }

.breadcrumb { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb-sep { margin: 0 0.4rem; }

.hero { margin-bottom: 1.5rem; }
.hero h1 { font-size: 1.9rem; font-weight: 800; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; line-height: 1.25; }
.hero h1.h1-icon .icon-inline { color: var(--accent); width: 0.85em; height: 0.85em; }
.hero p { color: var(--text-muted); margin-top: 0.4rem; max-width: 70ch; }
.stand-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }

.badges, .badge-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.badge-soft { display: inline-flex; align-items: center; gap: 0.35rem; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.78rem; color: var(--text-muted); }
.badges .badge-soft { background: var(--surface); padding: 0.2rem 0.75rem; font-size: 0.82rem; }
.badge-accent { color: var(--accent); border-color: var(--accent); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 1.5rem 0 2rem; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }

.map-box { height: 280px; width: 100%; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.map-box-tall { height: 340px; }
.map-dot { background: var(--accent); width: 14px; height: 14px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
.map-price { background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 5px; border-radius: 10px; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); white-space: nowrap; }
.map-emoji { background: var(--accent); width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }

.info-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; display: flex; flex-direction: column; gap: 1.2rem; }

.result-list { display: flex; flex-direction: column; gap: 0.75rem; max-height: 480px; overflow-y: auto; padding-right: 0.25rem; }
.result-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; }
.result-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.4rem; }
.result-card-emoji { font-size: 1.2rem; }
.result-card-name { font-weight: 700; flex: 1; min-width: 0; }
.result-card-row { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }
.result-card-row a { color: var(--accent); }
.result-card-link { display: inline-block; margin-top: 0.6rem; font-size: 0.82rem; font-weight: 600; color: var(--accent); }
.result-card-link:hover { text-decoration: underline; }
.pill { font-size: 0.78rem; color: var(--text-muted); background: var(--bg); border-radius: 999px; padding: 0.15rem 0.55rem; flex-shrink: 0; }
.pill-right { margin-left: auto; }
.status-badge { font-size: 0.72rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 999px; }
.status-badge.is-open { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.status-badge.is-closed { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.price-row { display: flex; gap: 0.75rem; margin-top: 0.6rem; }
.price { display: flex; flex-direction: column; background: var(--bg); border-radius: var(--radius); padding: 0.4rem 0.6rem; flex: 1; text-align: center; }
.price-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.price-value { font-weight: 700; font-size: 0.95rem; }
.price-value.is-cheapest { color: var(--success); }
.source-note { font-size: 0.8rem; color: var(--text-muted); margin: -1rem 0 2rem; }
#results-list .source-note { margin: 0.75rem 1rem 0; }

.box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem; }
.box > h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem; }
.box > p { color: var(--text-muted); margin-bottom: 1rem; }
.box > p:last-child { margin-bottom: 0; }
.prose { color: var(--text-muted); line-height: 1.7; }
.btn-accent { display: inline-block; background: var(--accent); color: #fff; padding: 0.6rem 1.2rem; border-radius: var(--radius); font-weight: 600; font-size: 0.9rem; }
.btn-accent:hover { background: var(--accent-hover); text-decoration: none; }

.section { margin-bottom: 2rem; }
.section-label { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--text-muted); }
.section.faq h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; }
.tags-wrap { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.chip-links, .chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip-links-center { justify-content: center; }
.chip-row { margin: 1.25rem 0; }
.chip-link, .chip-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 0.4rem 0.85rem; font-size: 0.85rem; color: var(--text); text-decoration: none;
  font-family: var(--font); cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.box .chip-link { background: var(--bg); }
.chip-link-lg { padding: 0.45rem 0.9rem; font-size: 0.88rem; }
.chip-link:hover, .chip-btn:hover { border-color: var(--accent); background: var(--surface-hover); text-decoration: none; color: var(--text); }
.chip-btn.active { border-color: var(--accent); background: var(--accent-soft); }

.toggle-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.toggle-row button { background: transparent; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.4rem 0.9rem; font-size: 0.85rem; color: var(--text-muted); cursor: pointer; font-family: var(--font); }
.toggle-row button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; color: var(--text); display: flex; flex-direction: column; gap: 0.2rem; transition: border-color 0.15s; }
.tile:hover { border-color: var(--accent); text-decoration: none; }
.tile-title { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; font-size: 1.05rem; }
.tile-title .icon-inline { color: var(--accent); }
.tile-meta { font-size: 0.82rem; color: var(--text-muted); }

.legal h2 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal li { font-size: 0.92rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 0.5rem; }
.legal ul { padding-left: 1.25rem; }

.footer-services { list-style: none; display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 0.8rem; }
.footer-services a { font-size: 0.85rem; }

/* Datentabellen (z. B. /gemeinden) */
.table-wrap { overflow-x: auto; margin: 1.5rem 0 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table th, .data-table td { padding: 0.65rem 0.9rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 700; }
.data-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table tbody tr:hover { background: var(--surface-hover); }
.data-table tfoot td { font-weight: 700; border-bottom: none; }
.data-table td a { font-weight: 600; }
main.page > .table-wrap + .source-note { margin: 0 0 2rem; }

/* Abgrenzung "Privates Informationsangebot" auf Gemeinde- und Ämterseiten: bewusst schlicht, nicht amtlich */
.notice { font-size: 0.85rem; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: var(--radius); padding: 0.7rem 0.9rem; margin: 0 0 1.5rem; line-height: 1.55; }
.notice strong { color: var(--text); }

/* Behördenseiten (Phase 2b): Antwortbox, Checklisten, Lücken, abgeleitete Angaben, Quellen */
.antwortbox { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.75rem; margin: 0 0 2rem; }
.antwortbox-zeile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.85rem 1rem; }
.antwortbox dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 700; margin-bottom: 0.3rem; }
.antwortbox dd { margin: 0; font-size: 0.92rem; line-height: 1.5; overflow-wrap: anywhere; }
.antwortbox dd a { display: inline-block; margin-top: 0.2rem; font-weight: 600; }
.checkliste, .hinweise, .quellen, .von-gemeinde { padding-left: 1.2rem; margin: 0 0 0.5rem; line-height: 1.6; font-size: 0.93rem; }
.checkliste li, .hinweise li, .von-gemeinde li { margin-bottom: 0.35rem; }
.quellen li { margin-bottom: 0.35rem; font-size: 0.85rem; overflow-wrap: anywhere; }
.von-gemeinde li:target { background: var(--accent-soft); border-radius: var(--radius); }
.luecke { color: var(--text-muted); font-style: italic; }
.abgeleitet { display: inline-block; font-size: 0.72rem; font-weight: 700; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 0.45rem; margin-left: 0.3rem; vertical-align: middle; }
.abgeleitet-grund { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }
.hinweis-redaktion { font-size: 0.88rem; border-left: 3px solid var(--accent); padding-left: 0.6rem; }
.info-panel.stelle p { font-size: 0.92rem; line-height: 1.55; overflow-wrap: anywhere; }
.info-panel.stelle .icon-inline, .info-panel.stelle svg { width: 1em; height: 1em; vertical-align: -0.15em; color: var(--accent); }
.portal p { margin-bottom: 0.4rem; overflow-wrap: anywhere; }
.variante h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.data-table tr:target td { background: var(--accent-soft); }
