@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Mono:wght@400;500&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --bg:           #f5f2ec;
  --surface:      #faf8f3;
  --surface-2:    #f0ede5;
  --surface-3:    #e8e4da;
  --border:       #ddd8cc;
  --border-2:     #ccc7b8;
  --ink:          #1e2419;
  --ink-2:        #4a5444;
  --ink-3:        #7a8872;
  --field:        #2d6b44;
  --field-bright: #3a8a58;
  --field-dim:    #1e4d30;
  --field-pale:   #e8f2ec;
  --amber:        #c47c2a;
  --amber-pale:   #fdf3e3;
  --danger:       #c0392b;
  --white:        #fffefb;
  --radius:       8px;
  --radius-lg:    14px;
  --nav-h:        40px;
  --shadow-sm: 0 1px 3px rgba(30,36,25,0.08), 0 1px 2px rgba(30,36,25,0.04);
  --shadow:    0 4px 12px rgba(30,36,25,0.1),  0 2px 4px rgba(30,36,25,0.06);
  --shadow-lg: 0 12px 32px rgba(30,36,25,0.12), 0 4px 8px rgba(30,36,25,0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 12px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ───────────────────────────────────────── */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: var(--nav-h);
  background: rgba(250,248,243,0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

.app-nav-logo {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 21px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.app-nav-logo img { width: 26px; height: 26px; display: block; flex-shrink: 0; }

.app-nav-links { display: flex; align-items: center; gap: 4px; }
.app-nav-links a {
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 13px;
  border-radius: 7px;
  transition: color 0.15s, background 0.15s;
}
.app-nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.app-nav-links .nav-cta { background: var(--field); color: white; font-weight: 600; box-shadow: var(--shadow-sm); }
.app-nav-links .nav-cta:hover { background: var(--field-bright); color: white; }

.nav-pro-btn {
  min-height: 28px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 600;
  background: var(--amber-pale);
  border-color: var(--amber);
  color: var(--amber);
  box-shadow: none;
}
.nav-pro-btn:hover { background: #fde8c8; border-color: var(--amber); color: var(--amber); }

.premium-tab.premium-unlocked { opacity: 1; cursor: pointer; }
.premium-tab.premium-unlocked .pro-badge { background: var(--field); }

/* ── APP SHELL ─────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - var(--nav-h));
}

/* ── CONTROL PANEL ─────────────────────────────── */
.control-panel {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
.control-panel::-webkit-scrollbar { width: 4px; }
.control-panel::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

/* ── PANEL SECTIONS ────────────────────────────── */
.panel-section {
  padding: 6px 11px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.panel-section--tight { padding: 4px 11px; }

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── MISSION TABS ──────────────────────────────── */
.mission-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.mission-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: none;
}
.mission-tab:hover { border-color: var(--field); color: var(--field); background: var(--field-pale); }
.mission-tab.active { background: var(--field); border-color: var(--field); color: white; box-shadow: var(--shadow-sm); }

.premium-tab { opacity: 0.55; cursor: default; }
.premium-tab:hover { opacity: 0.7; border-color: var(--border-2); color: var(--ink-2); background: var(--white); }

.pro-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--amber);
  color: white;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.4;
}

.mode-hint {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.45;
}

/* ── FORM & INPUTS ─────────────────────────────── */
label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.label-with-tip {
  display: flex;
  align-items: center;
  gap: 4px;
}

input, select {
  width: 100%;
  min-height: 28px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 3px 8px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  box-shadow: var(--shadow-sm);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--field-bright);
  box-shadow: 0 0 0 3px rgba(58,138,88,0.12);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a8872' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  background-color: var(--white);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: end;
}

.hint-text {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.45;
}

/* ── TOOLTIP ANCHORS & BUBBLES ─────────────────── */
.tooltip-anchor {
  display: inline-flex;
  align-items: center;
  color: var(--ink-3);
  cursor: help;
  flex-shrink: 0;
}
.tooltip-anchor:hover { color: var(--field); }

.tooltip-bubble {
  display: none;
  background: var(--white);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 9px 11px;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-2);
  line-height: 1.5;
  box-shadow: var(--shadow);
}
.tooltip-anchor:hover ~ .tooltip-bubble { display: block; }

/* ── DIRECTION ROW ─────────────────────────────── */
.dir-row {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}

.dir-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}

.dir-preset {
  min-height: 30px;
  padding: 0;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  border: 1px solid var(--border-2);
  border-radius: 5px;
  background: var(--white);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: none;
}
.dir-preset:hover { border-color: var(--field-bright); color: var(--field); background: var(--field-pale); }

.dir-row input {
  min-height: 30px;
  text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  padding: 4px 6px;
}

/* ── COMPUTED ROW (mapping mode) ───────────────── */
.computed-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.computed-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
}
.computed-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 2px;
}

/* ── BUTTONS ───────────────────────────────────── */
button {
  min-height: 28px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
button:hover { border-color: var(--field); color: var(--field); background: var(--field-pale); }

button.primary {
  background: var(--field);
  border-color: var(--field);
  color: white;
  font-weight: 700;
  box-shadow: var(--shadow);
}
button.primary:hover { background: var(--field-bright); border-color: var(--field-bright); box-shadow: var(--shadow-lg); }

.clear-button { border-color: var(--border); color: var(--danger); background: var(--white); box-shadow: none; }
.clear-button:hover { background: #fdf0ef; border-color: var(--danger); box-shadow: none; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 12px;
}

.optimize-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  font-size: 11px;
  padding: 0 10px;
  box-shadow: none;
}
.optimize-btn:disabled { opacity: 0.5; cursor: default; }

/* ── TOGGLE ROW ────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
  padding: 5px 9px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s;
}
.toggle-row:has(input:checked) {
  background: var(--field-pale);
  border-color: var(--field);
  color: var(--field-dim);
}
.toggle-row input[type="checkbox"] {
  width: 14px;
  min-height: 14px;
  flex-shrink: 0;
  accent-color: var(--field-bright);
  cursor: pointer;
}

/* ── COLLAPSIBLE ───────────────────────────────── */
.collapsible-toggle {
  background: none;
  border: none;
  box-shadow: none;
  min-height: auto;
  padding: 0;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
}
.collapsible-toggle:hover { color: var(--field); background: none; border-color: transparent; }

.toggle-chevron { transition: transform 0.2s; flex-shrink: 0; }

.action-count-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--field);
  color: white;
  border-radius: 10px;
  padding: 1px 6px;
  line-height: 1.4;
}

/* ── ACTION LIST ───────────────────────────────── */
.action-list { display: flex; flex-direction: column; gap: 4px; }

.add-action-row select {
  font-size: 12px;
  min-height: 30px;
}

/* ── BADGE OPTIONAL ────────────────────────────── */
.badge-optional {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface-3);
  color: var(--ink-3);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

/* ── FLIGHT SUMMARY BAR ────────────────────────── */
.flight-summary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
}
.flight-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.fs-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: var(--ink-2);
}
.fs-item svg { color: var(--ink-3); flex-shrink: 0; }

/* ── MESSAGE / NOTES ───────────────────────────── */
.notes {
  padding: 9px 11px;
  border-left: 3px solid var(--amber);
  background: var(--amber-pale);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.5;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.notes.error { border-color: var(--danger); background: #fdf0ef; color: var(--danger); }

/* ── WP TOOLBAR ────────────────────────────────── */
.wp-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.wp-select-all-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  flex-direction: row;
  letter-spacing: 0;
  min-height: auto;
}
.wp-deselect-btn { min-height: 24px; padding: 0 7px; font-size: 11px; box-shadow: none; border-radius: 4px; }
.wp-sel-count { font-size: 11px; color: var(--ink-3); font-family: 'DM Mono', monospace; }
.wp-bulk-btn { margin-left: auto; min-height: 26px; padding: 0 10px; font-size: 11px; font-weight: 600; }

/* ── PANEL HEADING BAR ─────────────────────────── */
.panel-heading-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  user-select: none;
  list-style: none;
}
.panel-heading-bar::-webkit-details-marker { display: none; }

/* ── DOWNLOAD PANEL ────────────────────────────── */
.download-panel {
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.download-links { display: grid; gap: 5px; padding: 8px 16px; }
.download-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--field);
  background: var(--field-pale);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  font-family: 'DM Mono', monospace;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.download-links a::before { content: '↓'; font-size: 13px; font-weight: 700; }
.download-links a:hover { background: #d4ecdc; border-color: var(--field); }

/* ── WAYPOINT DETAILS PANEL ────────────────────── */
.waypoint-details-panel { border-top: 1px solid var(--border); }
.waypoint-details-panel > summary { list-style: none; cursor: pointer; }
.waypoint-details-panel > summary::-webkit-details-marker { display: none; }

.waypoint-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 0;
  color: var(--ink-3);
  font-size: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
.waypoint-item {
  display: grid;
  grid-template-columns: 20px 36px 1fr;
  gap: 6px;
  align-items: center;
  padding: 5px 16px;
  border-bottom: 1px solid rgba(221,216,204,0.5);
  transition: background 0.1s;
}
.waypoint-item:last-child { border-bottom: 0; }
.waypoint-item:hover { background: var(--surface-2); }
.waypoint-index { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--field); font-weight: 600; }
.waypoint-meta { display: grid; gap: 1px; }
.waypoint-meta strong { color: var(--ink); font-weight: 600; }

/* ── DRONE COMPAT ──────────────────────────────── */
.drone-compat {
  padding: 5px 11px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--ink-3);
  line-height: 1.4;
  margin-top: auto;
  background: var(--surface-2);
}

/* ── MAP PANEL ─────────────────────────────────── */
.map-panel { position: relative; }
#map { position: absolute; inset: 0; }
.leaflet-container { font-family: 'DM Sans', sans-serif; }

/* ── MAP TOPBAR ────────────────────────────────── */
.map-topbar {
  position: absolute;
  top: 10px;
  left: 60px;
  right: 10px;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
  transition: right 0.2s;
}
.map-topbar > * { pointer-events: auto; }
.wp-editor-open .map-topbar { right: 278px; }

/* ── LOCATION SEARCH ───────────────────────────── */
.location-search {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 8px 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  background: rgba(250,248,243,0.97);
  box-shadow: var(--shadow-lg);
}
.location-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}
.location-search-row input { min-height: 30px; font-size: 13px; }
.location-search-row button {
  min-height: 30px;
  padding: 0 12px;
  background: var(--field);
  border-color: var(--field);
  color: white;
  font-size: 12px;
}
.location-results {
  display: grid;
  gap: 2px;
  max-height: 180px;
  overflow-y: auto;
}
.location-result {
  min-height: auto;
  padding: 6px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  box-shadow: none;
}
.location-result:hover { background: var(--surface-2); color: var(--ink); }
.location-result-message, .location-attribution { padding: 4px 8px; color: var(--ink-3); font-size: 11px; }
.location-attribution { border-top: 1px solid var(--border); }

/* ── MISSION NAME PILL ─────────────────────────── */
.mission-name-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  background: rgba(250,248,243,0.97);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 130px;
  overflow: hidden;
}
.mission-name-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mission-name-pill:hover { border-color: var(--field); color: var(--field); }

.mission-name-input {
  padding: 5px 8px;
  font-size: 12px;
  font-family: 'DM Mono', monospace;
  min-height: 30px;
  width: 140px;
  flex-shrink: 0;
  background: rgba(250,248,243,0.97);
  box-shadow: var(--shadow-sm);
}

/* ── WAYPOINT DOTS ON MAP ──────────────────────── */
.wp-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid white;
  background: var(--field);
  color: white;
  font-family: 'DM Mono', monospace;
  font-size: 7px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(30,36,25,0.4);
}
.wp-dot.wp-dot-part { background: var(--amber); box-shadow: 0 1px 6px rgba(196,124,42,0.5); }
.wp-dot.wp-dot-selected { background: #1a52cc; border-color: white; box-shadow: 0 0 0 2px #1a52cc; }

.waypoint-item.wp-selected { background: #eef2ff; }

.waypoint-tooltip {
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: rgba(250,248,243,0.98);
  color: var(--ink-2);
  box-shadow: var(--shadow-lg);
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  line-height: 1.6;
}
.waypoint-tooltip .tooltip-title { margin-bottom: 3px; color: var(--field); font-weight: 600; font-size: 12px; }

/* ── WP EDITOR (slide-in) ──────────────────────── */
.wp-editor {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 270px;
  background: var(--white);
  border-left: 1px solid var(--border-2);
  box-shadow: var(--shadow-lg);
  z-index: 800;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wp-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}
.wp-editor-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.wp-editor-close { min-height: 26px; padding: 0 8px; font-size: 13px; box-shadow: none; }
.wp-editor-body {
  padding: 11px 13px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wp-editor-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; }
.wp-editor-label { color: var(--ink-3); flex-shrink: 0; }
.wp-editor-value { color: var(--ink); font-family: 'DM Mono', monospace; font-size: 11px; text-align: right; }
.wp-editor-divider { height: 1px; background: var(--border); margin: 3px 0; }
.wp-editor-section {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.wp-editor-override-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--amber);
  color: white;
  padding: 1px 5px;
  border-radius: 3px;
}

/* ── BULK EDIT MODAL ───────────────────────────── */
.bulk-modal {
  position: absolute;
  inset: 0;
  background: rgba(30,36,25,0.45);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bulk-modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: min(340px, 92%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.bulk-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 15px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.bulk-modal-body {
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
}
.bulk-modal-footer {
  display: flex;
  gap: 8px;
  padding: 11px 15px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  justify-content: flex-end;
}

/* ── TERRAIN MODAL ─────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,36,25,0.5);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: min(400px, 94%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 17px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.modal-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.modal-close { min-height: 28px; padding: 0 8px; font-size: 14px; box-shadow: none; }
.modal-body {
  padding: 15px 17px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
}
.modal-footer { padding: 12px 17px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }

/* ── RESPONSIVE ────────────────────────────────── */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; grid-template-rows: auto 50vh; }
  .control-panel { border-right: 0; border-bottom: 1px solid var(--border); max-height: 50vh; }
  .map-panel { min-height: 50vh; }
  .map-topbar { right: 12px; }
}
