:root {
  --zh-blue:       #272727;
  --zh-blue-dark:  #1a1a1a;
  --zh-blue-light: #eeeeee;
  --lu-blue:       #005AA0;
  --lu-blue-light: #e0eef8;
  --accent:        #272727;
  --success-bg:    #e8f5e9;
  --success-border:#a5d6a7;
  --error-bg:      #ffebee;
  --error-border:  #ef9a9a;
  --warn-bg:       #fff8e1;
  --warn-border:   #ffe082;
  --text:          #1a1a1a;
  --text-muted:    #666;
  --border:        #dde1e7;
  --bg:            #f5f7fa;
  --white:         #ffffff;
  --radius:        8px;
  --shadow:        0 2px 10px rgba(0,0,0,0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.app-header {
  background: #272727;
  color: white;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  flex-shrink: 0;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.header-logo:hover .logo-title { opacity: 0.8; }

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-title   { font-weight: 600; font-size: 14px; }
.logo-subtitle { font-size: 11px; opacity: 0.7; }

/* Step progress in header */
.steps-nav {
  display: flex;
  align-items: center;
}

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.step-num.active { background: white; color: #272727; }
.step-num.done   { background: rgba(255,255,255,0.45); color: white; }

.step-label {
  font-size: 10px;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.3px;
}

.step-connector {
  width: 36px;
  height: 1px;
  background: rgba(255,255,255,0.25);
  margin: 0 6px 14px;
}

/* ── Main ── */
main { flex: 1; display: flex; flex-direction: column; }

.step-section         { display: none; flex: 1; flex-direction: column; }
.step-section.active  { display: flex; }

/* ── Step 1: Adresssuche ── */
.step-container {
  max-width: 580px;
  margin: 0 auto;
  padding: 52px 24px 48px;
  width: 100%;
}

.step-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--zh-blue);
  margin-bottom: 8px;
}

.step-description {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 32px;
}

.search-wrapper { position: relative; }

.search-box {
  display: flex;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  transition: border-color 0.15s;
}
.search-box:focus-within { border-color: var(--zh-blue); }

.search-box input {
  flex: 1;
  padding: 13px 16px;
  font-size: 16px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
}

.search-box button {
  padding: 13px 16px;
  background: var(--zh-blue);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.15s;
}
.search-box button:hover { background: var(--zh-blue-dark); }

.suggestions-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
}
.suggestions-list.hidden { display: none; }

.suggestions-list li {
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.suggestions-list li:last-child { border-bottom: none; }
.suggestions-list li:hover { background: var(--zh-blue-light); }

.suggestion-main  { font-size: 14px; font-weight: 500; }
.suggestion-sub   { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.status-message {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  min-height: 18px;
}

/* ── Step 2: Karte ── */
#step-2 { flex-direction: column; }

.map-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.location-label {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.area-display {
  font-size: 11px;
  font-weight: 500;
  color: var(--zh-blue);
  white-space: nowrap;
}

.map-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  background: var(--zh-blue-light);
  font-size: 12px;
  color: var(--zh-blue);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.warning-banner {
  padding: 9px 16px;
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-border);
  color: #7d5700;
  font-size: 13px;
  flex-shrink: 0;
}
.warning-banner.hidden { display: none; }

#map {
  flex: 1;
  min-height: 400px;
}

/* ── Step 3: Bestellung ── */
.perimeter-summary {
  background: var(--zh-blue-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--zh-blue);
  margin-bottom: 28px;
  line-height: 1.6;
}

.email-field { margin-bottom: 32px; }

.email-field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.email-field input {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
  outline: none;
}
.email-field input:focus { border-color: var(--zh-blue); }

.field-hint {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

.dataset-section { margin-bottom: 32px; }

.dataset-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.source-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
}
.source-badge.zh { background: var(--zh-blue); color: white; }
.source-badge.lu { background: var(--lu-blue); color: white; }
.source-badge.ch { background: #c8102e;        color: white; }

.dataset-source-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.dataset-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-icon-wrap {
  color: var(--zh-blue);
  opacity: 0.35;
  margin-bottom: 16px;
}

.ds-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #444;
  margin-top: 1px;
}

.loading-msg {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.dataset-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.dataset-item:hover:not(.unavailable)  { border-color: var(--accent); }
.dataset-item.selected                 { border-color: var(--zh-blue); background: var(--zh-blue-light); }
.dataset-item.unavailable              { opacity: 0.5; cursor: not-allowed; }

.dataset-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--zh-blue);
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}
.dataset-item.unavailable input { cursor: not-allowed; }

.dataset-item-body { flex: 1; min-width: 0; }
.dataset-item-name { font-weight: 600; font-size: 14px; }
.dataset-item-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.avail-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e8f5e9;
  color: #1b5e20;
}
.avail-badge.direct { background: var(--zh-blue-light); color: var(--zh-blue); }
.avail-badge.warn   { background: #fff3e0; color: #e65100; }
.avail-badge.na     { background: #fce4ec; color: #b71c1c; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--zh-blue);
  color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--zh-blue-dark); }
.btn-primary:disabled { opacity: 0.38; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); }

.btn-large {
  width: 100%;
  justify-content: center;
  padding: 14px 24px;
  font-size: 16px;
  margin-top: 8px;
}

/* ── Bestellungsresultate ── */
#order-status { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }

.order-card {
  border-radius: var(--radius);
  padding: 16px 18px;
  border: 1px solid;
}
.order-card.success { background: var(--success-bg); border-color: var(--success-border); }
.order-card.direct  { background: var(--zh-blue-light); border-color: var(--border); }
.order-card.error   { background: var(--error-bg); border-color: var(--error-border); }

.order-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.order-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.order-id {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  background: rgba(0,0,0,0.07);
  padding: 1px 6px;
  border-radius: 3px;
}

.download-links {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}
.download-link:hover { text-decoration: underline; }

/* ── Karten-Controls ── */
.map-ctrl {
  background: white;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  overflow: hidden;
}

/* ── Darstellung-Panel ── */
.darst-ctrl    { min-width: 175px; }
.darst-header  {
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #888;
  background: #f7f7f7;
  border-bottom: 1px solid var(--border);
}
.darst-body    { padding: 7px 8px; display: flex; flex-direction: column; gap: 0; }
.darst-row     { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.darst-sep     { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Standalone Zoom-Buttons (topleft, unter Draw-Toolbar) ── */
.zoom-ctrl {
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 5px rgba(0,0,0,0.2);
}
.zoom-ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
  background: white;
  border: none;
  border-bottom: 1px solid #ddd;
  color: #333;
  cursor: pointer;
  transition: background 0.1s;
  padding: 0;
}
.zoom-ctrl-btn:last-child { border-bottom: none; }
.zoom-ctrl-btn:hover { background: #f0f0f0; }

/* Basemap thumbnail buttons (like geo.admin.ch) */
.bm-btns { display: flex; gap: 4px; padding: 5px 4px 4px; justify-content: center; }
.bm-btn  {
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border-radius: 6px;
  width: 54px;
  border: none;
  background: white;
  cursor: pointer;
  transition: background 0.1s, box-shadow 0.1s;
}
.bm-thumb { display: block; }
.bm-thumb svg { width: 44px; height: 34px; display: block; border-radius: 3px; }
.bm-label { font-size: 10px; color: #666; text-align: center; display: block; line-height: 1.2; }
.bm-btn:hover .bm-label { color: #272727; }
.bm-btn.active { box-shadow: inset 0 0 0 2px #272727; background: rgba(0,0,0,0.04); }
.bm-btn.active .bm-label { color: #272727; font-weight: 700; }

/* Parcel/Liegenschaften toggle */
.parz-btn { width: 100%; justify-content: center; border: 1px solid var(--border); border-radius: 5px; }

.mc-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: white;
  color: #444;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
  white-space: nowrap;
}
.mc-btn:hover  { background: #f0f0f0; }
.mc-btn.active { background: var(--zh-blue); color: white; }


/* ── Leaflet Draw — Perimeter-Panel (240px, horizontal: Draw | Edit | Delete) ── */
.leaflet-draw.leaflet-control {
  width: 240px;
  background: white;
  border-radius: 6px !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18) !important;
  overflow: hidden;
}

/* Flex-Row mit allen drei Toolbar-Buttons nebeneinander */
.perimeter-toolbar-row {
  display: flex;
  border-top: 1px solid var(--border);
}
/* display:contents macht die .leaflet-bar-Divs unsichtbar als Layout-Box
   → ihre Kind-Elemente (a) werden direkte Flex-Kinder */
.perimeter-toolbar-row .leaflet-bar {
  display: contents;
}
/* Jeder Button bekommt exakt ein Drittel der Breite */
.perimeter-toolbar-row .leaflet-draw-toolbar a {
  flex: 1 !important;
  height: 36px !important;
  line-height: 36px !important;
  width: auto !important;
  border-radius: 0 !important;
  border: none !important;
  border-right: 1px solid var(--border) !important;
  background-color: white !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.perimeter-toolbar-row .leaflet-draw-toolbar a:last-child {
  border-right: none !important;
}
.perimeter-toolbar-row .leaflet-draw-toolbar a:hover:not(.leaflet-disabled) {
  background-color: #f0f0f0 !important;
}
.perimeter-toolbar-row .leaflet-draw-toolbar a.leaflet-disabled {
  opacity: 0.38 !important;
  cursor: not-allowed !important;
}

/* Save/Cancel-Aktionsleiste von Leaflet.draw ausblenden (wir zeigen eigenen Save-Button) */
.leaflet-draw-actions { display: none !important; }

/* Eigener Save-Button — erscheint nur wenn Edit-Modus aktiv */
.perimeter-save-bar {
  border-top: 1px solid var(--border);
  padding: 6px 8px;
  background: #fafafa;
}
.perimeter-save-bar.hidden { display: none; }
.perimeter-save-btn {
  width: 100%;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  background: #272727;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.2px;
}
.perimeter-save-btn:hover { background: #1a1a1a; }

/* ── Live-Bemaßungs-Tooltip beim Zeichnen ── */
.dim-tip {
  background: rgba(232, 80, 0, 0.88) !important;
  border: none !important;
  border-radius: 5px !important;
  color: white !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 4px 9px !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25) !important;
  pointer-events: none !important;
}
.dim-tip::before { display: none !important; }
.dim-tip-hint {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.85;
  display: block;
}

/* Leaflet.draw built-in tooltip verstecken (wir zeigen eigenen dim-tip) */
.leaflet-draw-tooltip { display: none !important; }

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Kanton Luzern — Dataset-Sektion ── */
#section-lu .dataset-section-title { color: var(--lu-blue); }
#section-lu .avail-badge.direct    { background: var(--lu-blue-light); color: var(--lu-blue); }
#section-lu .dataset-item:hover:not(.unavailable):not(.av-portal-row) { border-color: var(--lu-blue); }
#section-lu .dataset-item.selected { border-color: var(--lu-blue); background: var(--lu-blue-light); }
#section-lu .dataset-item input[type="checkbox"] { accent-color: var(--lu-blue); }

/* ── AV-Portalzeile (Luzern) ── */
.av-portal-row {
  cursor: default;
  opacity: 0.75;
  background: var(--bg);
}
.av-portal-row:hover { border-color: var(--border) !important; background: var(--bg) !important; }

.portal-link-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--lu-blue);
  border: 1px solid var(--lu-blue);
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.portal-link-btn:hover { background: var(--lu-blue); color: white; }

/* ── Kanton nicht verfügbar ── */
.canton-other-note {
  padding: 14px 16px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── App-Footer / Disclaimer ── */
.app-footer {
  border-top: 1px solid var(--border);
  padding: 14px 24px;
  text-align: center;
  font-size: 11px;
  color: #999;
  background: var(--white);
  flex-shrink: 0;
}
.app-footer a { color: #aaa; text-decoration: underline; }
.app-footer a:hover { color: var(--text-muted); }

/* ── Step 1: Hero-Layout (zentriert) ── */
.step-1-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 64px;
}

.hero-logo-wrap {
  margin-bottom: 16px;
  opacity: 0.85;
}

.hero-app-name {
  font-size: 36px;
  font-weight: 800;
  color: #272727;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.hero-tagline {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 0;
}

.hero-divider {
  width: 48px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  margin: 28px 0 24px;
}

.step-subtitle {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

/* Search-Wrapper bleibt im Step-1 linksbündig (volle Breite) */
.step-1-centered .search-wrapper  { text-align: left; width: 100%; }
.step-1-centered .status-message  { text-align: left; width: 100%; }
.step-1-centered .step-description {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ZH badge stays readable as a neutral dark label */
.source-badge.zh   { background: #444;    color: white; }
.source-badge.oereb { background: #5D4037; color: white; }

/* ── ÖREB-Zeile ── */
.oereb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}
.oereb-row-info    { flex: 1; min-width: 0; }
.oereb-row-egrid   { font-size: 13px; font-weight: 500; color: var(--text); }
.oereb-row-egrid code {
  font-family: 'Courier New', monospace;
  font-size: 11.5px;
  background: #f0f0f0;
  padding: 1px 5px;
  border-radius: 3px;
  color: #444;
}
.oereb-row-addr    { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.oereb-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #5D4037;
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}
.oereb-pdf-btn:hover { background: #4E342E; }

.oereb-row-unsupported { background: var(--bg); }
.oereb-unsupported-note {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  text-align: right;
  max-width: 180px;
  line-height: 1.4;
}

/* ── Planrahmen-Panel ── */
.plan-ctrl { width: 240px; overflow: visible !important; }
.plan-ctrl .darst-header { border-radius: 6px 6px 0 0; }
.plan-ctrl .darst-body   { padding: 6px 0 8px; gap: 0; }

/* Hover-Sektion: Trigger-Zeile + aufklappbarer Inhalt */
.plan-section { position: relative; }

.plan-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  cursor: default;
  transition: background 0.12s;
  user-select: none;
}
.plan-section:hover .plan-trigger { background: #f4f4f4; }

.plan-trigger-lbl {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  min-width: 56px;
  flex-shrink: 0;
}
.plan-trigger-val {
  flex: 1;
  font-size: 11px;
  color: #272727;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-trigger-chv {
  color: #aaa;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.plan-section:hover .plan-trigger-chv { transform: rotate(180deg); color: #555; }

/* Aufklappbarer Inhalt via grid-Trick (keine feste Höhe nötig) */
.plan-section-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s ease;
  overflow: hidden;
  background: #fafafa;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
}
.plan-section:hover .plan-section-body {
  grid-template-rows: 1fr;
  border-color: var(--border);
}
.plan-section-inner { min-height: 0; padding: 0 12px; }
.plan-section:hover .plan-section-inner { padding: 10px 12px 12px; }

.plan-sublabel {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #bbb;
  margin-bottom: 6px;
}

.plan-sep { height: 1px; background: var(--border); }

/* Buttons innerhalb der Sektionen */
.plan-btn-grp { display: flex; flex-wrap: wrap; gap: 3px; }
.plan-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: white;
  color: #444;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  white-space: nowrap;
  line-height: 1.3;
}
.plan-btn:hover  { background: #f0f0f0; border-color: #aaa; }
.plan-btn.active { background: #272727; color: white; border-color: #272727; }

/* Eigenes-Mass / Eigener-Massstab Eingabefelder */
.plan-custom-row {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #f0f0f0;
  border-radius: 5px;
  padding: 5px 7px;
  margin-top: 6px;
  font-size: 11px;
  color: #666;
}
.plan-input {
  width: 56px;
  padding: 3px 5px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: right;
  outline: none;
  background: white;
}
.plan-input:focus { border-color: #272727; }
.plan-input-w { width: 78px; }
.plan-unit { color: #888; font-size: 11px; }

/* Info-Zusammenfassung */
.plan-info {
  margin: 6px 12px 4px;
  background: #f7f7f7;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 7px 9px;
  font-size: 11px;
  color: #666;
  line-height: 1.7;
}
.plan-info-head  { display: block; color: #999; font-size: 10px; }
.plan-info-dims  { display: block; color: #444; }
.plan-info strong { color: #272727; }

/* Aktions-Buttons */
.plan-actions { display: flex; flex-direction: column; gap: 4px; padding: 4px 10px 0; }
.plan-action-btn {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: white;
  color: #272727;
  cursor: pointer;
  text-align: center;
  transition: background 0.1s;
}
.plan-action-btn:hover:not(:disabled) { background: #f0f0f0; }
.plan-action-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.plan-adopt-btn           { background: #272727; color: white; border-color: #272727; }
.plan-adopt-btn:hover:not(:disabled) { background: #1a1a1a; }
.plan-adopt-btn:disabled  { background: #272727; opacity: 0.35; }

/* Planrahmen drag handle */
.plan-drag-icon { cursor: move; background: transparent !important; border: none !important; }

/* Planrahmen tooltip/label auf der Karte */
.plan-label-tip {
  background: rgba(0,90,160,0.88) !important;
  border: none !important;
  border-radius: 4px !important;
  color: white !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  padding: 4px 8px !important;
  pointer-events: none !important;
  text-align: center !important;
  line-height: 1.5 !important;
  white-space: nowrap !important;
}
.plan-label-tip::before { display: none !important; }

/* ── Liegenschafts-Tooltip (rotes Parzel-Label) ── */
.parcel-tip {
  background: rgba(180, 0, 0, 0.88) !important;
  border: none !important;
  border-radius: 4px !important;
  color: white !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 4px 8px !important;
  pointer-events: none !important;
  text-align: center !important;
  line-height: 1.55 !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25) !important;
}
.parcel-tip::before { display: none !important; }
.parcel-gem {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.85;
}

/* ── Perimeter-Tooltip (oben rechts am orangen Rechteck) ── */
.perimeter-tip {
  background: rgba(232, 80, 0, 0.9) !important;
  border: none !important;
  border-radius: 4px !important;
  color: white !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  padding: 4px 8px !important;
  pointer-events: none !important;
  line-height: 1.55 !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2) !important;
}
.perimeter-tip::before { display: none !important; }

/* ── Massstabsbalken ── */
.leaflet-control-scale-line {
  border: 2px solid #555 !important;
  border-top: none !important;
  background: rgba(255,255,255,0.82) !important;
  font-size: 10px !important;
  color: #333 !important;
  padding: 1px 4px !important;
  font-weight: 500 !important;
}
.leaflet-control-scale { margin-bottom: 8px !important; margin-right: 8px !important; }

/* ── Leaflet Draw — custom icons ── */
/* Rectangle draw → pencil icon (suggests drawing/creating) */
.leaflet-draw-toolbar a.leaflet-draw-draw-rectangle {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M3 17l1-4L14 3l3 3-10 10z' fill='%23555'/%3E%3Cpath d='M14 3l3 3' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3Cline x1='3' y1='17' x2='6.5' y2='17' stroke='%23666' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-size: 17px 17px !important;
  background-position: center center !important;
}

/* Delete/Remove → Mülleimer-Icon (custom SVG, verhindert Sprite-Wiederholung) */
.leaflet-draw-toolbar a.leaflet-draw-edit-remove {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4,7 4,16 16,16 16,7'/%3E%3Cline x1='2' y1='7' x2='18' y2='7'/%3E%3Crect x='7' y='3' width='6' height='4' rx='1'/%3E%3Cline x1='8.5' y1='10' x2='8.5' y2='13.5'/%3E%3Cline x1='11.5' y1='10' x2='11.5' y2='13.5'/%3E%3C/svg%3E") !important;
  background-size: 17px 17px !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

/* Edit layers → vertex/node icon (suggests editing existing shape handles) */
.leaflet-draw-toolbar a.leaflet-draw-edit-edit {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 15L4 7l8-3 5 5-4 7z' fill='none' stroke='%23555' stroke-width='1.3' stroke-linejoin='round'/%3E%3Crect x='3' y='14' width='3' height='3' rx='.5' fill='%23555'/%3E%3Crect x='2.5' y='6' width='3' height='3' rx='.5' fill='%23555'/%3E%3Crect x='11' y='3' width='3' height='3' rx='.5' fill='%23555'/%3E%3Crect x='15.5' y='7.5' width='3' height='3' rx='.5' fill='%23555'/%3E%3Crect x='12' y='13.5' width='3' height='3' rx='.5' fill='%23555'/%3E%3C/svg%3E") !important;
  background-size: 17px 17px !important;
  background-position: center center !important;
}
