/* ─────────────────────────────────────────────────────────────────────────────
   Sprengningsplanlegger — stylesheet
   ───────────────────────────────────────────────────────────────────────────── */

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

:root {
  /* Background */
  --bg:         #05070b;
  --surface-1:  #0b0f18;
  --surface-2:  #111827;
  --surface-3:  #1a2235;

  /* Borders */
  --border:        rgba(148, 163, 184, 0.10);
  --border-bright: rgba(148, 163, 184, 0.18);

  /* Text */
  --text:       #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim:   #475569;

  /* Accent — orange for an explosive feel */
  --accent:      #f97316;
  --accent-dk:   #ea580c;
  --accent-glow: rgba(249, 115, 22, 0.12);

  /* Status */
  --danger:  #ef4444;
  --success: #22c55e;

  /* Layout */
  --sidebar-width: 278px;
  --header-height: 58px;
  --radius:    0.5rem;
  --radius-lg: 0.75rem;
  --gap:       1.5rem;

  /* Typography */
  --font: 'Source Sans 3', system-ui, -apple-system, sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Grid overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

/* ── App shell ───────────────────────────────────────────────────────────────── */

.app-shell {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────────────────────────── */

.site-header {
  height: var(--header-height);
  background: linear-gradient(135deg, #080c14 0%, #0d1523 100%);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 20;
}

.header-inner {
  height: 100%;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.header-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  color: var(--accent);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: var(--radius);
}

.site-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-subtitle {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 1px;
  white-space: nowrap;
}

/* ── Navigation tabs ─────────────────────────────────────────────────────────── */

.main-nav {
  display: flex;
  gap: 0.2rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-btn {
  padding: 0.38rem 0.85rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.nav-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-btn.active {
  background: var(--surface-3);
  color: var(--accent);
  border-color: rgba(249, 115, 22, 0.25);
}

/* ── Main layout ─────────────────────────────────────────────────────────────── */

.main-layout {
  flex: 1;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  overflow: hidden;
  min-height: 0;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */

.sidebar {
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 0.5rem;
}

.sidebar-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.area-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.4rem;
}

.area-list::-webkit-scrollbar { width: 3px; }
.area-list::-webkit-scrollbar-track { background: transparent; }
.area-list::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }

/* ── Area item ───────────────────────────────────────────────────────────────── */

.area-item {
  border-radius: var(--radius);
  margin-bottom: 0.2rem;
  border: 1px solid transparent;
  transition: border-color 0.15s;
}

.area-item.expanded {
  border-color: var(--border);
  background: rgba(17, 24, 39, 0.6);
}

.area-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  border-radius: var(--radius);
  user-select: none;
}

.area-header:hover { background: rgba(255,255,255,0.03); }

.area-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.area-name-text {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.area-post-count {
  font-size: 0.7rem;
  color: var(--text-dim);
  background: rgba(255,255,255,0.05);
  padding: 0.08rem 0.35rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.area-actions {
  display: flex;
  gap: 0.15rem;
  opacity: 0;
  transition: opacity 0.12s;
  flex-shrink: 0;
}

.area-header:hover .area-actions,
.area-item.expanded .area-actions { opacity: 1; }

.area-chevron {
  color: var(--text-dim);
  font-size: 0.75rem;
  transition: transform 0.18s;
  flex-shrink: 0;
}

.area-item.expanded .area-chevron { transform: rotate(90deg); }

/* ── Post list under area ─────────────────────────────────────────────────────── */

.area-posts {
  padding: 0 0.4rem 0.4rem;
  display: none;
}

.area-item.expanded .area-posts { display: block; }

.post-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: background 0.1s;
}

.post-item:hover { background: rgba(255,255,255,0.03); }

.post-item.focused {
  background: var(--accent-glow);
  border: 1px solid rgba(249, 115, 22, 0.2);
}

/* Cross-highlight: sidebar row lit up when its map pin is hovered, and vice-versa */
.post-item.post-hovered {
  background: rgba(148, 163, 184, 0.1);
  outline: 1px solid rgba(148, 163, 184, 0.25);
  outline-offset: -1px;
}

.post-item.post-hovered .post-actions { opacity: 1; }

.post-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: 2px;
}

.post-name-text {
  flex: 1;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-actions {
  display: flex;
  gap: 0.15rem;
  opacity: 0;
  transition: opacity 0.12s;
}

.post-item:hover .post-actions { opacity: 1; }

.no-coords-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(71, 85, 105, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-left: 3px;
  vertical-align: middle;
  cursor: help;
  flex-shrink: 0;
}

.add-post-btn {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px dashed rgba(148, 163, 184, 0.15);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.75rem;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.add-post-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* Wrapper that holds both "Legg til post" and "Ny gruppe" side by side */
.area-posts-actions {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.2rem;
}

.area-posts-actions .add-post-btn {
  flex: 1;
  margin-top: 0;
}

/* "Ny gruppe" button — indigo tint to visually separate it */
.add-group-btn {
  flex: 1;
  padding: 0.35rem 0.5rem;
  border: 1px dashed rgba(99, 102, 241, 0.22);
  background: transparent;
  color: rgba(129, 140, 248, 0.65);
  cursor: pointer;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.75rem;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.add-group-btn:hover {
  border-color: rgba(99, 102, 241, 0.55);
  color: #818cf8;
  background: rgba(99, 102, 241, 0.07);
}

/* ── Group item (sub-section inside an expanded area) ───────────────────────── */

.group-item {
  border-radius: calc(var(--radius) - 2px);
  margin-bottom: 0.12rem;
  border: 1px solid transparent;
  transition: border-color 0.15s;
}

.group-item.expanded {
  border-color: var(--border);
  background: rgba(8, 12, 20, 0.55);
}

.group-header {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.3rem 0.45rem;
  cursor: pointer;
  border-radius: calc(var(--radius) - 2px);
  user-select: none;
}

.group-header:hover { background: rgba(255,255,255,0.03); }

.group-name-text {
  flex: 1;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-post-count {
  font-size: 0.63rem;
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  padding: 0.05rem 0.28rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.group-actions {
  display: flex;
  gap: 0.15rem;
  opacity: 0;
  transition: opacity 0.12s;
  flex-shrink: 0;
}

.group-header:hover .group-actions,
.group-item.expanded .group-actions { opacity: 1; }

.group-chevron {
  color: var(--text-dim);
  font-size: 0.7rem;
  transition: transform 0.18s;
  flex-shrink: 0;
}

.group-item.expanded .group-chevron { transform: rotate(90deg); }

.group-posts {
  padding: 0 0.3rem 0.3rem 0.85rem;
}

.group-posts.hidden { display: none; }

/* ── Group centroid markers on the main map ─────────────────────────────────── */

.group-map-label-wrap {
  background: none !important;
  border:     none !important;
  box-shadow: none !important;
}

.group-map-label {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  padding: 0.22rem 0.55rem;
  border-radius: 0.375rem;
  font-size: 0.74rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.02em;
  color: var(--area-color, #94a3b8);
  background: rgba(5, 7, 11, 0.84);
  border: 1.5px solid var(--area-color, #94a3b8);
  backdrop-filter: blur(4px);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.group-map-label:hover { background: rgba(5, 7, 11, 0.96); }

.group-map-count {
  background: var(--area-color, #94a3b8);
  color: rgba(0,0,0,0.8);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.04rem 0.28rem;
  border-radius: 0.25rem;
}

/* ── Salve map marker ────────────────────────────────────────────────────────── */

.salve-map-marker {
  width:  54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  line-height: 1;
  /* White halo → red glow → dark shadow — all follow the emoji's own silhouette */
  filter:
    drop-shadow(0 0 3px #fff)
    drop-shadow(0 0 3px #fff)
    drop-shadow(0 0 6px rgba(220, 38, 38, 0.95))
    drop-shadow(0 0 10px rgba(220, 38, 38, 0.7))
    drop-shadow(0 3px 8px rgba(0, 0, 0, 0.85));
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.salve-map-marker:hover {
  transform: scale(1.18);
  filter:
    drop-shadow(0 0 4px #fff)
    drop-shadow(0 0 4px #fff)
    drop-shadow(0 0 10px rgba(220, 38, 38, 1))
    drop-shadow(0 0 16px rgba(220, 38, 38, 0.8))
    drop-shadow(0 4px 10px rgba(0, 0, 0, 0.9));
}

/* ── Salvelokasjon section in modals ─────────────────────────────────────────── */

.salve-section {
  margin-top: 1.2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.salve-section-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

/* ── Day planner — group sub-section ────────────────────────────────────────── */

.day-group-section { margin-top: 0.5rem; }

.day-group-heading {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.63rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 0.25rem 0;
  border-top: 1px solid var(--border);
  margin-bottom: 0.15rem;
}

/* Border visibility toggle inside expanded area */
.area-border-vis-btn {
  width: 100%;
  padding: 0.3rem 0.5rem;
  border: 1px solid rgba(124, 58, 237, 0.25);
  background: rgba(124, 58, 237, 0.06);
  color: #a78bfa;
  cursor: pointer;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.75rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.3rem;
  transition: all 0.15s;
}

.area-border-vis-btn:hover {
  background: rgba(124, 58, 237, 0.14);
  border-color: rgba(124, 58, 237, 0.5);
  color: #c4b5fd;
}

/* ── Icon buttons ─────────────────────────────────────────────────────────────── */

.btn-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  transition: all 0.1s;
  flex-shrink: 0;
}

.btn-icon:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text-muted);
}

.btn-icon.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

/* ── Content area ────────────────────────────────────────────────────────────── */

.content-area {
  position: relative;
  overflow: hidden;
}

.tab-panel {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}

.tab-panel.active { display: flex; }

/* ── Map ─────────────────────────────────────────────────────────────────────── */

#map {
  flex: 1;
  z-index: 1;
}

.map-overlay-controls {
  position: absolute;
  bottom: 1.5rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  gap: 0.4rem;
}

.map-ctrl-btn {
  padding: 0.45rem 0.8rem;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s;
  backdrop-filter: blur(6px);
}

.map-ctrl-btn:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  color: var(--accent);
}

/* Satellite toggle — highlighted when satellite is active */
.map-ctrl-toggle.layer-satellite-active {
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}

.map-ctrl-toggle.layer-satellite-active:hover {
  border-color: #22c55e;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

/* POI toggle — highlighted when POIs are hidden */
.map-ctrl-toggle.poi-hidden-active {
  border-color: rgba(251, 191, 36, 0.4);
  color: #fbbf24;
}

.map-ctrl-toggle.poi-hidden-active:hover {
  border-color: #fbbf24;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
}

/* "Vis alle poster" toggle — highlighted when active */
#btnShowAllPins.active {
  border-color: rgba(168, 85, 247, 0.5);
  color: #a855f7;
  background: rgba(168, 85, 247, 0.08);
}

#btnShowAllPins.active:hover {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.14);
}

/* ── Global border view — area centroid labels ──────────────────────────────── */

/* Leaflet wraps divIcon in a div with className; clear Leaflet's default styles */
.area-map-label-wrap {
  background: none !important;
  border:     none !important;
  box-shadow: none !important;
}

.area-map-label {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  padding: 0.3rem 0.7rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.02em;
  color: var(--area-color, #94a3b8);
  background: rgba(5, 7, 11, 0.72);
  border: 1.5px solid var(--area-color, #94a3b8);
  backdrop-filter: blur(4px);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: background 0.15s, opacity 0.2s;
}

.area-map-label:hover {
  background: rgba(5, 7, 11, 0.92);
}

/* ── Week planner ────────────────────────────────────────────────────────────── */

#panelUkeplan {
  padding: 1rem;
  gap: 0.75rem;
  overflow: hidden;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.week-label {
  flex: 1;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.week-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  min-height: 0;
  overflow-y: auto;
}

.day-col {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 200px;
  transition: border-color 0.15s;
}

.day-col.today { border-color: rgba(249, 115, 22, 0.28); }

.day-header {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  flex-shrink: 0;
}

.day-name {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
}

.day-date {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 1px;
}

.day-col.today .day-date { color: var(--accent); }

/* Week-view session list inside each day column */
.day-sessions-list {
  flex: 1;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  overflow-y: auto;
}

.day-session-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.38rem 0.5rem;
  cursor: pointer;
  transition: all 0.12s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.day-session-card:hover {
  border-color: var(--border-bright);
  background: var(--surface-3);
}

.dsc-time {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.dsc-info {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
  overflow: hidden;
}

.dsc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dsc-area {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dsc-count {
  font-size: 0.67rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ── Drag-and-drop states ── */
.day-session-card[draggable] { cursor: grab; }
.day-session-card[draggable]:active { cursor: grabbing; }

/* Source card dims while being dragged */
.day-session-card.dragging {
  opacity: 0.25;
  pointer-events: none;
}

/* Target column lights up on hover */
.day-col.drag-over {
  border-color: rgba(249, 115, 22, 0.55);
  background: rgba(249, 115, 22, 0.04);
}

.day-col.drag-over .day-sessions-list {
  outline: 2px dashed rgba(249, 115, 22, 0.3);
  outline-offset: -4px;
  border-radius: 0.3rem;
}

/* Drop-in animation for the newly placed card */
/* ── Map pin fade-in ─────────────────────────────────────────────────────────── */
@keyframes markerFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.marker-fade-in {
  animation: markerFadeIn 0.25s ease-out forwards;
}

/* Cross-highlight: pin glows when its sidebar row is hovered, and vice-versa */
.leaflet-marker-icon.marker-hovered {
  filter: brightness(1.45) drop-shadow(0 0 5px rgba(255, 255, 255, 0.55));
  transition: filter 0.12s ease;
}

@keyframes session-drop-in {
  0%   { opacity: 0; transform: translateY(-12px) scale(0.92); }
  65%  { opacity: 1; transform: translateY(3px)   scale(1.02); }
  100% { opacity: 1; transform: translateY(0)     scale(1);    }
}

.day-session-card.just-dropped {
  animation: session-drop-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.day-plan-btn {
  margin: 0.4rem;
  padding: 0.32rem;
  border: 1px dashed rgba(148, 163, 184, 0.12);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 0.375rem;
  font-size: 0.72rem;
  width: calc(100% - 0.8rem);
  text-align: center;
  font-family: inherit;
  transition: all 0.15s;
  flex-shrink: 0;
}

.day-plan-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* ── Day detail modal ────────────────────────────────────────────────────────── */

.modal-day-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

/* Left scrollable panel — session list + form */
.day-left-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

/* ── Planned sessions list (top of left panel) ── */
.day-session-list {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.day-sess-list-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}

.day-sess-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.45rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
  background: var(--surface-1);
  cursor: pointer;
  transition: all 0.12s;
}

.day-sess-item:hover,
.day-sess-item.editing {
  border-color: var(--border-bright);
  background: var(--surface-2);
}

.day-sess-item.editing {
  border-color: rgba(249, 115, 22, 0.4);
}

.dsi-time {
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  flex-shrink: 0;
}

.dsi-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dsi-area {
  font-size: 0.72rem;
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dsi-count {
  font-size: 0.67rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ── New / edit session form ── */
.day-session-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.session-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 0.7rem;
}

.session-form-header span {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.session-time-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.session-time-wrap input[type="time"] {
  background: var(--surface-1);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  padding: 0.18rem 0.4rem;
  cursor: pointer;
}

.session-time-wrap input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.5);
  cursor: pointer;
}

/* Posts list inside the session form */
.day-posts-list {
  padding: 0.7rem 1rem;
  overflow-y: auto;
  flex: 1;
}

.day-posts-list::-webkit-scrollbar { width: 3px; }
.day-posts-list::-webkit-scrollbar-track { background: transparent; }
.day-posts-list::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }

.day-area-section {
  margin-bottom: 1.1rem;
}

.day-area-section:last-child { margin-bottom: 0; }

.day-area-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.45rem;
}

.day-area-toggle {
  cursor: pointer;
  user-select: none;
}

.day-area-toggle:hover { color: var(--text-secondary); }

.day-area-chevron {
  margin-left: auto;
  font-size: 0.6rem;
  transition: transform 0.15s;
}

.day-post-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.05);
}

.day-post-row:last-child { border-bottom: none; }

.day-post-checkbox {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.day-post-label {
  flex: 1;
  font-size: 0.83rem;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-person-input {
  width: 130px;
  padding: 0.28rem 0.5rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  color: var(--text);
  font-size: 0.78rem;
  font-family: inherit;
  transition: border-color 0.15s, opacity 0.15s;
  outline: none;
  flex-shrink: 0;
}

.day-person-input:focus { border-color: var(--accent); }
.day-person-input:disabled { opacity: 0.3; pointer-events: none; }

/* Day map panel */
.day-map-panel {
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
}

.day-map-label {
  padding: 0.55rem 0.85rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#dayMap {
  flex: 1;
  min-height: 420px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */

.btn {
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--accent-dk);
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.28);
  transform: translateY(-1px);
}

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

.btn-ghost:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.btn-danger {
  background: transparent;
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: #f87171;
  color: #fca5a5;
}

.btn-sm {
  padding: 0.28rem 0.58rem;
  font-size: 0.76rem;
}

/* "Sett grense" button in area modal — purple tint */
.btn-border-draw {
  background: transparent;
  color: #a78bfa;
  border-color: rgba(124, 58, 237, 0.45);
}

.btn-border-draw:hover {
  background: rgba(124, 58, 237, 0.1);
  color: #c4b5fd;
  border-color: #7c3aed;
}

/* Leaflet area border polygon — rendered by drawing.js */
.area-border-polygon {
  pointer-events: none;
}

/* World dim-mask with area cut out — sits below pins/markers */
.area-mask-polygon {
  pointer-events: none;
}

/* ── Map right-click context menu ────────────────────────────────────────────── */

.map-ctx-menu {
  display: none;   /* hidden by default; JS sets display:block to show */
  position: fixed;
  z-index: 3500;
  min-width: 192px;
  background: var(--surface-2);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 0.3rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.35);
  backdrop-filter: blur(14px);
  animation: ctxFadeIn 0.1s ease;
}

@keyframes ctxFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.ctx-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.48rem 0.75rem;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.83rem;
  cursor: pointer;
  border-radius: calc(var(--radius) - 2px);
  text-align: left;
  transition: background 0.1s;
  white-space: nowrap;
}

.ctx-item i {
  width: 1rem;
  text-align: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ctx-item:hover {
  background: rgba(255,255,255,0.06);
}

.ctx-item:hover i {
  color: var(--accent);
}

.ctx-item:disabled {
  opacity: 0.38;
  cursor: default;
}

.ctx-item:disabled:hover {
  background: transparent;
}

.ctx-item:disabled:hover i {
  color: var(--text-muted);
}

.ctx-hint {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-style: italic;
}

.ctx-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0.4rem;
}

/* ── Modals ───────────────────────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.hidden { display: none; }

.modal {
  background: var(--surface-2);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 430px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

.modal-wide {
  max-width: 820px;
  max-height: 90vh;
}

.modal-header {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}

.modal-close:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text);
}

.modal-body {
  padding: 1.1rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-shrink: 0;
}

/* ── Forms ────────────────────────────────────────────────────────────────────── */

.form-group { margin-bottom: 0.95rem; }
.form-group:last-child { margin-bottom: 0; }

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.38rem;
}

.label-hint {
  color: var(--text-dim);
  font-weight: 400;
}

.form-input {
  width: 100%;
  padding: 0.52rem 0.72rem;
  background: var(--surface-1);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.form-input::placeholder { color: var(--text-dim); }

textarea.form-input {
  resize: vertical;
  min-height: 56px;
  line-height: 1.5;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.38rem;
  line-height: 1.4;
}

/* ── Color picker ────────────────────────────────────────────────────────────── */

.color-picker {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
  flex-shrink: 0;
}

.color-swatch:hover { transform: scale(1.15); }

.color-swatch.selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25);
}

/* ── Coordinates row ─────────────────────────────────────────────────────────── */

.coords-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.coords-badge {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.52rem 0.72rem;
  background: var(--surface-1);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.78rem;
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  min-width: 0;
}

.coords-badge svg { flex-shrink: 0; }

#coordsText {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

/* ── Pick mode banner ────────────────────────────────────────────────────────── */

.pick-banner {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 1.1rem;
  border-radius: 2rem;
  font-size: 0.83rem;
  font-weight: 500;
  z-index: 2000;
  display: none;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 8px 28px rgba(249, 115, 22, 0.42);
  white-space: nowrap;
}

.pick-banner.visible { display: flex; }

/* Direction banner variant */
.direction-banner {
  background: #1d4ed8;
  box-shadow: 0 8px 28px rgba(29, 78, 216, 0.42);
}

/* Relocate-pin banner variant */
.relocate-banner {
  background: #059669;
  box-shadow: 0 8px 28px rgba(5, 150, 105, 0.42);
}

/* Border-drawing banner variant */
.drawing-banner {
  background: #7c3aed;
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.42);
}

/* Salve pick-mode banner variant */
.salve-pick-banner {
  background: #dc2626;
  box-shadow: 0 8px 28px rgba(220, 38, 38, 0.42);
}

.direction-deg-live {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 4.5rem;
  display: inline-block;
  text-align: center;
  background: rgba(0,0,0,0.2);
  border-radius: 0.75rem;
  padding: 0 0.5rem;
}

.direction-banner-sep {
  opacity: 0.55;
}

.pick-cancel {
  padding: 0.2rem 0.6rem;
  background: rgba(0,0,0,0.25);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 1rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: inherit;
  transition: background 0.12s;
}

.pick-cancel:hover { background: rgba(0,0,0,0.4); }

/* ── Toasts ──────────────────────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  pointer-events: none;
}

.toast {
  padding: 0.55rem 1.1rem;
  border-radius: 2rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
  animation: toastIn 0.25s ease;
}

.toast.success { background: #1b6b38; border: 1px solid #22c55e44; }
.toast.error   { background: #6b1b1b; border: 1px solid #ef444444; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Empty state ─────────────────────────────────────────────────────────────── */

.empty-state {
  padding: 1.75rem 0.75rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.6;
}

.empty-icon {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  color: var(--text-dim);
}

/* ── Scrollbar global ────────────────────────────────────────────────────────── */

*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }

/* ── Leaflet overrides ───────────────────────────────────────────────────────── */

.leaflet-container { background: #141e2e !important; font-family: var(--font) !important; }

.leaflet-popup-content-wrapper {
  background: var(--surface-2) !important;
  border: 1px solid var(--border-bright) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5) !important;
  color: var(--text) !important;
  padding: 0 !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  padding: 0.65rem 0.8rem !important;
}

.leaflet-popup-tip-container { margin-top: -1px; }
.leaflet-popup-tip { background: var(--surface-2) !important; }
.leaflet-popup-close-button { color: var(--text-muted) !important; top: 6px !important; right: 8px !important; }
.leaflet-popup-close-button:hover { color: var(--text) !important; }

.leaflet-control-zoom a {
  background: var(--surface-2) !important;
  color: var(--text-muted) !important;
  border-color: var(--border-bright) !important;
}

.leaflet-control-zoom a:hover { color: var(--text) !important; }
.leaflet-bar { border: 1px solid var(--border-bright) !important; }
.leaflet-attribution-flag { display: none !important; }

/* Scale bar */
.leaflet-control-scale-line {
  background: rgba(11, 15, 24, 0.82) !important;
  border: 1px solid var(--border-bright) !important;
  border-top: 2px solid var(--text-muted) !important;
  color: var(--text-muted) !important;
  font-family: var(--font) !important;
  font-size: 0.7rem !important;
  font-weight: 500 !important;
  padding: 1px 5px !important;
  backdrop-filter: blur(4px);
  border-radius: 0 0 3px 3px !important;
}

/* Popup content */
.popup-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.18rem;
}

.popup-area {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.38rem;
}

.popup-person {
  font-size: 0.75rem;
  color: var(--accent);
  font-style: italic;
  margin-top: 0.18rem;
}

.popup-dir-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}

.popup-dir-info {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 1 0 100%;
  margin-bottom: 0.2rem;
}

.popup-action-btn {
  padding: 0.28rem 0.6rem;
  font-size: 0.73rem;
  font-family: var(--font);
  font-weight: 500;
  border-radius: 0.375rem;
  border: 1px solid var(--border-bright);
  background: var(--surface-3);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.12s;
  white-space: nowrap;
}

.popup-action-btn:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text);
  border-color: var(--accent);
}

.popup-action-btn.popup-action-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.popup-action-btn.popup-action-relocate:hover {
  border-color: #059669;
  color: #34d399;
  background: rgba(5, 150, 105, 0.1);
}

.popup-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: var(--accent);
  text-decoration: none;
  margin-top: 0.4rem;
  transition: opacity 0.12s;
}

.popup-link:hover { opacity: 0.8; text-decoration: underline; }

/* ─────────────────────────────────────────────────────────────────────────────
   Hamburger button
   ───────────────────────────────────────────────────────────────────────────── */

.nav-menu {
  display: none;           /* desktop: hidden */
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: var(--radius);
  flex-shrink: 0;
  transition: background 0.15s;
}

.nav-menu:hover { background: rgba(255,255,255,0.07); }

.hamburger {
  stroke: white;
  display: block;
  transition: rotate 0.6s cubic-bezier(.4,0,.2,1);
}

.nav-menu[aria-expanded="true"] .hamburger {
  rotate: 0.125turn;
}

.nav-menu .line {
  transition: stroke-dasharray 0.6s cubic-bezier(.4,0,.2,1),
              stroke-dashoffset 0.6s cubic-bezier(.4,0,.2,1);
  stroke-dasharray: 60 31 60 300;
}

.nav-menu[aria-expanded="true"] .line {
  stroke-dasharray: 60 105 60 300;
  stroke-dashoffset: -90;
}

/* ── Mobile sidebar + overlay ─────────────────────────────────────────────── */

.sidebar-mobile-nav {
  display: none;   /* desktop: hidden */
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: rgba(0, 0, 0, 0.55);
  z-index: 199;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.visible { display: block; }

/* ── Responsive breakpoint ────────────────────────────────────────────────── */

@media (max-width: 768px) {
  :root { --header-height: 54px; }

  /* Show hamburger, hide desktop nav tabs */
  .nav-menu  { display: flex; }
  .main-nav  { display: none; }

  /* Site title — shorter on tiny screens */
  .site-subtitle { display: none; }

  /* Header layout tweak */
  .header-inner { padding: 0 1rem; }

  /* Layout becomes a single column; sidebar floats as overlay */
  .main-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-width) - 4px);
    top: var(--header-height);
    height: calc(100dvh - var(--header-height));
    z-index: 200;
    transition: left 0.32s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    width: min(var(--sidebar-width), 88vw);
  }

  .sidebar.open {
    left: 0;
  }

  /* Mobile nav tabs inside sidebar */
  .sidebar-mobile-nav {
    display: flex;
    gap: 0.3rem;
    padding: 0.6rem 0.75rem 0;
    flex-shrink: 0;
  }

  .sidebar-mobile-nav .nav-btn {
    flex: 1;
    justify-content: center;
    font-size: 0.78rem;
    padding: 0.38rem 0.5rem;
  }

  /* Content takes full width */
  .content-area {
    width: 100%;
  }

  /* Week planner — horizontal scroll on mobile */
  .week-grid {
    grid-template-columns: repeat(7, minmax(130px, 1fr));
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  /* Day detail modal — stack vertically on mobile */
  .modal-day-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(300px, 45vh);
  }

  .day-map-panel { border-top: 1px solid var(--border); border-right: none; }
  #dayMap { min-height: 300px; }

  /* Modals fill more of the screen */
  .modal        { max-width: 100%; margin: 0 0.5rem; }
  .modal-wide   { max-width: 100%; max-height: 95dvh; }
  .modal-backdrop { padding: 0.5rem; align-items: flex-end; }

  /* Pick/direction banners — full width on mobile */
  .pick-banner {
    width: calc(100% - 2rem);
    border-radius: var(--radius);
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    font-size: 0.8rem;
    padding: 0.6rem 0.9rem;
  }

  /* Map overlay controls closer to edge */
  .map-overlay-controls { bottom: 1rem; right: 0.6rem; }

  /* Sidebar header — tighter */
  .sidebar-header { padding: 0.6rem 0.75rem; }
}
