/* ============================================
   Location Library — Design System
   Dual theme: light (blueprint) + dark (field guide)
   Geist/Inter · Compact
   ============================================ */

/* Georgia is a system font — no external import needed */

/* ---- Light Theme (default) ---- */
:root {
  --color-canvas: #ffffff;
  --color-surface: #ffffff;
  --color-surface-alt: #f2f2f2;
  --color-border: #e5e5e5;
  --color-border-hover: #0a0a0a;
  --color-text-primary: #0a0a0a;
  --color-text-heading: #000000;
  --color-text-muted: #737373;
  --color-text-secondary: #525252;
  --color-text-faint: #a1a1aa;
  --color-accent: #d97706;
  --color-accent-light: #f59e0b;
  --color-accent-bg: rgba(217, 119, 6, 0.08);
  --color-cta-bg: #000000;
  --color-cta-text: #ffffff;
  --color-cta-hover: #0a0a0a;
  --color-callout-red: #c22b10;
  --color-callout-red-bg: #fdf2f0;
  --color-success-green: #10c22b;
  --color-tag-bg: #f2f2f2;
  --color-tag-border: #e5e5e5;
  --color-tag-active-bg: #000000;
  --color-tag-active-text: #ffffff;
  --color-overlay: rgba(10, 10, 10, 0.4);
  --color-lightbox: rgba(0, 0, 0, 0.85);
  --color-card-shadow: oklab(0.145 -0.00000143796 0.00000340492 / 0.1) 0px 0px 0px 1px;
  --color-fab-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  --color-fab-primary-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  --color-marker-stroke: #ffffff;

  /* Typography */
  --font-geist: 'Georgia', serif;
  --font-geist-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --text-caption: 12px;
  --leading-caption: 1.5;
  --text-body: 14px;
  --leading-body: 1.43;
  --text-heading: 18px;
  --leading-heading: 1.33;
  --tracking-heading: -0.45px;
  --text-display: 48px;
  --leading-display: 1;
  --tracking-display: -2.4px;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;

  /* Spacing */
  --spacing-4: 4px;
  --spacing-6: 6px;
  --spacing-8: 8px;
  --spacing-10: 10px;
  --spacing-12: 12px;
  --spacing-16: 16px;
  --spacing-20: 20px;
  --spacing-24: 24px;
  --spacing-32: 32px;

  /* Border radius */
  --radius-pill: 9999px;
  --radius-badge: 26px;
  --radius-cards: 14px;
  --radius-input: 10px;
  --radius-buttons: 10px;
  --radius-base: 8px;

  /* Layout */
  --drawer-width: 280px;
  --library-width: 420px;
  --panel-width: 360px;

  /* Animation */
  --duration-fast: 0.15s;
  --duration-base: 0.225s;
  --duration-slow: 0.375s;
  --ease-default: ease;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Z-index */
  --z-map: 0;
  --z-drawer: 10;
  --z-panel: 20;
  --z-toolbar: 30;
  --z-modal: 100;
}

/* ---- Dark Theme ---- */
[data-theme="dark"] {
  --color-canvas: #080808;
  --color-surface: #111111;
  --color-surface-alt: #1c1c1c;
  --color-border: #222222;
  --color-border-hover: #333333;
  --color-text-primary: #e4e4e7;
  --color-text-heading: #ffffff;
  --color-text-muted: #71717a;
  --color-text-secondary: #a1a1aa;
  --color-text-faint: #3f3f46;
  --color-accent: #d97706;
  --color-accent-light: #f59e0b;
  --color-accent-bg: rgba(217, 119, 6, 0.1);
  --color-cta-bg: #ffffff;
  --color-cta-text: #000000;
  --color-cta-hover: #e4e4e7;
  --color-callout-red: #ef4444;
  --color-callout-red-bg: rgba(239, 68, 68, 0.1);
  --color-success-green: #22c55e;
  --color-tag-bg: #1c1c1c;
  --color-tag-border: #2a2a2a;
  --color-tag-active-bg: #ffffff;
  --color-tag-active-text: #000000;
  --color-overlay: rgba(0, 0, 0, 0.6);
  --color-lightbox: rgba(0, 0, 0, 0.92);
  --color-card-shadow: none;
  --color-fab-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --color-fab-primary-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  --color-marker-stroke: #333333;
}

[data-theme="dark"] .drawer.open,
[data-theme="dark"] .list-view.open {
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-geist);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-text-primary);
  background: var(--color-canvas);
  -webkit-font-smoothing: antialiased;
}

/* ---- Map ---- */
#map {
  position: absolute;
  inset: 0;
  z-index: var(--z-map);
}

/* ---- Theme Toggle ---- */
.theme-toggle {
  position: fixed;
  top: var(--spacing-10);
  right: 52px;
  z-index: calc(var(--z-drawer) - 1);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-input);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: background var(--duration-base), border-color var(--duration-base);
}

.theme-toggle:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-border-hover);
}

/* ---- Map Style Toggle (satellite) ---- */
.map-style-toggle {
  position: fixed;
  top: var(--spacing-10);
  right: 88px;
  z-index: calc(var(--z-drawer) - 1);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-input);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: background var(--duration-base), border-color var(--duration-base);
}

.map-style-toggle:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-border-hover);
}

.map-style-toggle.active {
  background: var(--color-cta-bg);
  color: var(--color-cta-text);
  border-color: var(--color-cta-bg);
}

/* ---- Modal overlay ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-overlay);
  backdrop-filter: blur(6px);
  opacity: 1;
  transition: opacity var(--duration-slow) var(--ease-default), visibility var(--duration-slow) var(--ease-default);
}

.modal[hidden] {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-content {
  background: var(--color-surface);
  border-radius: var(--radius-cards);
  border: 1px solid var(--color-border);
  box-shadow: var(--color-card-shadow);
  padding: var(--spacing-24);
  width: 90%;
  max-width: 380px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(1) translateY(0);
  transition: transform var(--duration-slow) var(--ease-out);
}

.modal[hidden] .modal-content {
  transform: scale(0.95) translateY(12px);
}

.modal-wide { max-width: 520px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-20);
}

.modal-content h2 {
  font-size: var(--text-heading);
  font-weight: var(--font-weight-semibold);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  color: var(--color-text-heading);
}

.modal-subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-body);
  margin-top: var(--spacing-4);
  margin-bottom: var(--spacing-24);
}

/* ---- Drawer Toggle (Hamburger) ---- */
.drawer-toggle {
  position: fixed;
  top: var(--spacing-10);
  left: var(--spacing-10);
  z-index: calc(var(--z-panel) + 1);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-input);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: background var(--duration-base), border-color var(--duration-base);
}

.drawer-toggle:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-border-hover);
}

.drawer-toggle:active { transform: scale(0.92); }

/* ---- Filter Toggle (map, next to hamburger) ---- */
.filter-toggle {
  position: fixed;
  top: var(--spacing-10);
  left: 58px;
  z-index: calc(var(--z-panel) + 1);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-input);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: background var(--duration-base), border-color var(--duration-base);
}

.filter-toggle:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-border-hover);
}

.filter-toggle:active { transform: scale(0.92); }
.filter-toggle[hidden] { display: none; }

/* ---- Map Search Bar ---- */
.map-search {
  position: fixed;
  top: var(--spacing-10);
  left: 106px;
  z-index: calc(var(--z-panel) + 1);
  width: 240px;
}

.map-search input {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  background: var(--color-surface);
  font-family: var(--font-geist);
  font-size: var(--text-body);
  color: var(--color-text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: border-color var(--duration-base), background var(--duration-base);
}

.map-search input:focus {
  outline: none;
  border-color: var(--color-border-hover);
  background: var(--color-canvas);
}

.map-search input::placeholder {
  color: var(--color-text-faint);
}

.map-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}

.map-search-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background var(--duration-fast);
}

.map-search-result:last-child {
  border-bottom: none;
}

.map-search-result:hover {
  background: var(--color-surface-alt);
}

.map-search-result-name {
  font-family: var(--font-geist);
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--color-text-primary);
}

.map-search-result-loc {
  font-family: var(--font-geist-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ---- Drawer Backdrop ---- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-panel) - 1);
  background: var(--color-overlay);
  transition: opacity var(--duration-slow);
}

.drawer-backdrop[hidden] { display: none; }

/* ---- Drawer ---- */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--drawer-width);
  z-index: var(--z-panel);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--duration-slow) var(--ease-out), box-shadow var(--duration-slow) var(--ease-out);
}

.drawer.open {
  transform: translateX(0);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.06);
}

/* ---- Drawer Header ---- */
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-16);
  padding-top: 52px;
  border-bottom: 1px solid var(--color-border);
}

.drawer-title {
  font-size: var(--text-heading);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-heading);
  letter-spacing: var(--tracking-heading);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-16);
}

.drawer-section { margin-bottom: var(--spacing-20); }

.drawer-section h3 {
  font-size: var(--text-caption);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-8);
}

.drawer-footer {
  padding: var(--spacing-12) var(--spacing-16);
  border-top: 1px solid var(--color-border);
}

/* ---- Floating Add Button (FAB) ---- */
.fab-add {
  position: fixed;
  bottom: var(--spacing-24);
  right: var(--spacing-24);
  z-index: var(--z-toolbar);
}

.fab-add[hidden] { display: none; }

.fab-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--color-cta-bg);
  color: var(--color-cta-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--color-fab-primary-shadow);
  transition: transform var(--duration-base), background var(--duration-base);
}

.fab-btn:hover { transform: scale(1.08); }
.fab-btn:active { transform: scale(0.95); }

.fab-btn.open {
  transform: rotate(45deg);
}

.fab-btn.open:hover {
  transform: rotate(45deg) scale(1.08);
}

.fab-menu {
  position: absolute;
  bottom: 60px;
  right: 0;
  width: 240px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  opacity: 1;
  transform: scale(1) translateY(0);
  transform-origin: bottom right;
  transition: opacity var(--duration-base) var(--ease-default), transform var(--duration-base) var(--ease-out), visibility var(--duration-base) var(--ease-default);
}

.fab-menu[hidden] {
  display: block !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.9) translateY(8px);
}

.fab-menu-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-geist);
  transition: background var(--duration-fast);
}

.fab-menu-item:last-child { border-bottom: none; }

.fab-menu:not([hidden]) .fab-menu-item {
  animation: fab-item-enter var(--duration-base) var(--ease-out) backwards;
}
.fab-menu:not([hidden]) .fab-menu-item:nth-child(1) { animation-delay: 30ms; }
.fab-menu:not([hidden]) .fab-menu-item:nth-child(2) { animation-delay: 60ms; }
.fab-menu:not([hidden]) .fab-menu-item:nth-child(3) { animation-delay: 90ms; }
.fab-menu:not([hidden]) .fab-menu-item:nth-child(4) { animation-delay: 120ms; }
.fab-menu:not([hidden]) .fab-menu-item:nth-child(5) { animation-delay: 150ms; }
.fab-menu:not([hidden]) .fab-menu-item:nth-child(6) { animation-delay: 180ms; }
.fab-menu:not([hidden]) .fab-menu-item:nth-child(7) { animation-delay: 210ms; }
.fab-menu:not([hidden]) .fab-menu-item:nth-child(8) { animation-delay: 240ms; }

.fab-menu-item:hover { background: var(--color-surface-alt); }
.fab-menu-item:active { background: var(--color-border); }

.fab-menu-item strong {
  font-size: var(--text-body);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-heading);
}

.fab-menu-item span {
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  line-height: 1.4;
}

.fab-finish {
  position: fixed;
  bottom: var(--spacing-24);
  right: 84px;
  width: auto;
  padding: 0 var(--spacing-20);
  border-radius: var(--radius-pill);
  font-family: var(--font-geist);
  font-size: var(--text-body);
  font-weight: var(--font-weight-medium);
}

/* ---- Neighborhood Filters ---- */
.neighborhood-filters {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
  margin-bottom: var(--spacing-16);
}

.neighborhood-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-4);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-geist-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--duration-base);
  white-space: nowrap;
}

.neighborhood-pill:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text-primary);
}

.neighborhood-pill.active {
  background: var(--color-cta-bg);
  border-color: var(--color-cta-bg);
  color: var(--color-cta-text);
}

.neighborhood-pill .pill-count {
  font-size: 10px;
  opacity: 0.6;
}

.neighborhood-city {
  display: flex;
  align-items: center;
  gap: var(--spacing-4);
  width: 100%;
  padding: 6px 8px;
  border: none;
  border-radius: var(--radius-base);
  background: transparent;
  color: var(--color-text-primary);
  font-family: var(--font-geist);
  font-size: var(--text-body);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-base);
  text-align: left;
}

.neighborhood-city:hover {
  background: var(--color-surface-alt);
}

.neighborhood-city.active {
  color: var(--color-text-heading);
}

.neighborhood-city .pill-count {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.5;
  font-family: var(--font-geist-mono);
}

.neighborhood-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.neighborhood-row .neighborhood-city,
.neighborhood-row .neighborhood-pill {
  flex: 1;
  min-width: 0;
}

.neighborhood-goto {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  border-radius: var(--radius-base);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base), color var(--duration-base), background var(--duration-base);
}

.neighborhood-row.hovered .neighborhood-goto {
  opacity: 1;
  pointer-events: auto;
}

.neighborhood-goto:hover {
  color: var(--color-text-primary);
  background: var(--color-surface-alt);
}

.neighborhood-children {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-4);
  padding: 4px 0 8px 12px;
}

.neighborhood-child {
  font-size: 10px;
}

/* ---- POI Detail Panel ---- */
.panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--panel-width);
  z-index: var(--z-panel);
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  opacity: 1;
  transform: translateX(0);
  transition: opacity var(--duration-slow) var(--ease-default), transform var(--duration-slow) var(--ease-out), visibility var(--duration-slow) var(--ease-default);
}

.panel[hidden] {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(16px);
}

.panel-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: var(--spacing-8) var(--spacing-16);
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 1;
}

.panel-body {
  flex: 1;
  padding: var(--spacing-20);
}

/* ---- Color Swatches ---- */
.color-swatches {
  display: flex;
  gap: var(--spacing-8);
  flex-wrap: wrap;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  cursor: pointer;
  padding: 0;
  transition: transform var(--duration-fast), border-color var(--duration-base);
}

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

.color-swatch.active {
  border-color: var(--color-text-heading);
  box-shadow: 0 0 0 2px var(--color-canvas), 0 0 0 4px var(--color-text-heading);
}

/* ---- Type Grid (icon selector) ---- */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 72px);
  gap: var(--spacing-8);
}

.type-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--spacing-6) var(--spacing-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-base);
  cursor: pointer;
  background: var(--color-surface);
  transition: border-color var(--duration-fast), background var(--duration-fast);
  user-select: none;
}

.type-grid-item:hover:not(.disabled) {
  border-color: var(--color-border-hover);
  background: var(--color-surface-alt);
}

.type-grid-item.active {
  border-color: var(--color-text-heading);
  background: var(--color-surface-alt);
}

.type-grid-item.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.type-grid-icon {
  font-size: 20px;
  line-height: 1;
}

.type-grid-label {
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.2;
  text-align: center;
}

.type-grid-item.active .type-grid-label {
  color: var(--color-text-heading);
}

/* ---- List View (Library) — slides in as overlay ---- */
.list-view {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--library-width);
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  z-index: var(--z-panel);
  border-right: 1px solid var(--color-border);
  transform: translateX(-100%);
  transition: transform var(--duration-slow) var(--ease-out), box-shadow var(--duration-slow) var(--ease-out);
}

.list-view[hidden] { display: none; }

.list-view.open {
  transform: translateX(0);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.06);
}

.list-header {
  border-bottom: 1px solid var(--color-border);
  padding: 52px var(--spacing-16) var(--spacing-16);
}

.list-back {
  flex-shrink: 0;
  font-size: 18px;
}

.list-filter-btn {
  flex-shrink: 0;
}

.list-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-8);
  margin-bottom: var(--spacing-8);
}

.list-type-toggle {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  flex-shrink: 0;
}

.type-btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  font-family: var(--font-geist-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--duration-base);
}

.type-btn:not(:last-child) {
  border-right: 1px solid var(--color-border);
}

.type-btn:hover {
  color: var(--color-text-primary);
}

.type-btn.active {
  background: var(--color-cta-bg);
  color: var(--color-cta-text);
}

.list-search {
  margin-bottom: var(--spacing-8);
}

.list-search input {
  width: 100%;
  padding: 7px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  background: var(--color-surface-alt);
  font-family: var(--font-geist);
  font-size: var(--text-body);
  color: var(--color-text-primary);
  transition: border-color var(--duration-base);
}

.list-search input:focus {
  outline: none;
  border-color: var(--color-border-hover);
}

.list-search input::placeholder {
  color: var(--color-text-faint);
}


/* Archived list row muted style */
.list-row.archived {
  opacity: 0.5;
}

.list-row.archived .list-row-name::after {
  content: 'ARCHIVED';
  font-family: var(--font-geist-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-left: 8px;
  vertical-align: middle;
}

.list-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-6);
}

.list-filter-bar:empty { display: none; }

.list-bulk-bar {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-8);
  padding: var(--spacing-10) 0 0;
  border-top: 1px solid var(--color-border);
  margin-top: var(--spacing-8);
}

.list-bulk-bar[hidden] { display: none; }

.bulk-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.select-all-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-8);
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
}

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-6);
}

.selection-count {
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  font-family: var(--font-geist-mono);
  white-space: nowrap;
}

/* ---- Custom checkboxes ---- */
input[type="checkbox"].list-row-checkbox,
#list-select-all {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--color-border-hover);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}

input[type="checkbox"].list-row-checkbox:hover,
#list-select-all:hover {
  border-color: var(--color-text-muted);
}

input[type="checkbox"].list-row-checkbox:checked,
#list-select-all:checked {
  background: #2563eb;
  border-color: #2563eb;
}

input[type="checkbox"].list-row-checkbox:checked::before,
#list-select-all:checked::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%) rotate(45deg);
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
}

/* ---- Export Modal ---- */
.export-format-bar {
  display: flex;
  gap: var(--spacing-16);
  margin-bottom: var(--spacing-12);
}

.export-format-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-6);
  font-family: var(--font-geist-mono);
  font-size: var(--text-caption);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  cursor: pointer;
}

.export-format-option input {
  accent-color: var(--color-cta-bg);
}

.export-output {
  width: 100%;
  min-height: 280px;
  max-height: 400px;
  padding: var(--spacing-12);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  background: var(--color-canvas);
  font-family: var(--font-geist-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-text-primary);
  resize: vertical;
  white-space: pre;
  overflow-x: auto;
}

.export-output:focus {
  outline: none;
  border-color: var(--color-border-hover);
}

.export-copy-btn {
  margin-top: var(--spacing-12);
  width: 100%;
}

.list-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-4) 0 var(--spacing-16);
}

/* ---- List Rows ---- */
.list-row {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-12);
  padding: var(--spacing-20);
  margin: var(--spacing-8) var(--spacing-16);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-cards);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color var(--duration-base), background var(--duration-base), box-shadow var(--duration-base);
}

.list-row {
  animation: list-row-enter var(--duration-base) var(--ease-out) backwards;
  animation-delay: calc(var(--row-index, 0) * 30ms);
}

.list-row:first-child {
  margin-top: var(--spacing-12);
}

.list-row:hover {
  border-color: var(--color-border-hover);
  background: var(--color-surface-alt);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.list-row:active { transform: scale(0.985); }

.list-row.selected {
  background: var(--color-accent-bg);
  border-color: var(--color-accent);
}

.list-row-checkbox {
  align-self: center;
  flex-shrink: 0;
}

.list-row-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-input);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.list-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-row-thumb .type-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
}

.list-row-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.list-row-name {
  font-weight: 700;
  font-size: var(--text-body);
  color: var(--color-text-heading);
  line-height: 1.2;
}

.list-row-location {
  font-size: 11px;
  color: var(--color-text-muted);
  font-family: var(--font-geist-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.list-row-type {
  font-size: 10px;
  color: var(--color-text-faint);
  margin-top: 1px;
}

.list-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 2px;
}

.list-row-tags .tag {
  font-size: 10px;
  font-family: var(--font-geist-mono);
  padding: 2px 7px;
  border-radius: 3px;
  cursor: default;
}

.list-row-desc {
  font-size: var(--text-caption);
  line-height: 1.5;
  color: var(--color-text-muted);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-row-notes {
  font-size: var(--text-caption);
  line-height: 1.55;
  color: var(--color-accent);
  border-left: 2px solid var(--color-accent);
  padding-left: var(--spacing-8);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-row-meta {
  flex-shrink: 0;
  text-align: right;
  align-self: flex-end;
}

.list-row-date {
  font-size: 11px;
  color: var(--color-text-faint);
  font-family: var(--font-geist-mono);
  white-space: nowrap;
}

.list-row-type-badge {
  font-family: var(--font-geist-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-4);
  display: inline-block;
}

.list-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--color-text-faint);
  font-size: var(--text-body);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-6);
  padding: 8px 16px;
  border-radius: var(--radius-buttons);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-family: var(--font-geist);
  font-size: var(--text-body);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-base);
  text-decoration: none;
}

.btn:hover {
  background: var(--color-surface-alt);
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--color-cta-bg);
  border-color: var(--color-cta-bg);
  color: var(--color-cta-text);
}

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

.btn-small {
  padding: 4px 10px;
  font-size: var(--text-caption);
  border-radius: var(--radius-pill);
}


.btn-icon {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: var(--spacing-4);
  line-height: 1;
  border-radius: var(--radius-input);
  transition: color var(--duration-fast), background var(--duration-fast);
}

.btn-icon:hover {
  color: var(--color-text-primary);
  background: var(--color-surface-alt);
}

.btn-icon:active { transform: scale(0.88); }

.btn-danger {
  color: var(--color-callout-red);
  border-color: var(--color-callout-red);
  background: var(--color-surface);
}

.btn-danger:hover {
  background: var(--color-callout-red-bg);
}

/* ---- Forms ---- */
.form-group { margin-bottom: var(--spacing-12); }

.form-group label {
  display: block;
  font-size: var(--text-caption);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-4);
  letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  color: var(--color-text-primary);
  font-family: var(--font-geist);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

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

/* Color inputs now use swatch buttons instead */

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-border-hover);
  box-shadow: 0 0 0 2px var(--color-accent-bg);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-faint);
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23737373' d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.form-actions {
  display: flex;
  gap: var(--spacing-8);
  justify-content: flex-end;
  margin-top: var(--spacing-20);
  padding-top: var(--spacing-16);
  border-top: 1px solid var(--color-border);
}

.error-text {
  color: var(--color-callout-red);
  font-size: var(--text-caption);
  margin-top: var(--spacing-6);
}

.error-text[hidden] { display: none; }

/* ---- Tags ---- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-6);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--color-tag-bg);
  border: 1px solid var(--color-tag-border);
  border-radius: var(--radius-badge);
  font-size: var(--text-caption);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--duration-base), border-color var(--duration-base), color var(--duration-base);
}

.tag:hover {
  border-color: var(--color-border-hover);
}

.tag.active {
  background: var(--color-tag-active-bg);
  border-color: var(--color-tag-active-bg);
  color: var(--color-tag-active-text);
}

/* ---- Filter Tags (text-only toggles, Barcelona style) ---- */
.filter-tag {
  display: inline-block;
  padding: 2px 4px;
  background: transparent;
  border: none;
  font-family: var(--font-geist-mono);
  font-size: 11px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--duration-base);
}

.filter-tag:hover {
  color: var(--color-text-primary);
}

.filter-tag:active { opacity: 0.6; }

.filter-tag.active {
  color: var(--color-accent-light);
}

/* ---- Route List ---- */
.route-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-6);
}

.route-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-8);
  padding: 8px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  font-size: var(--text-body);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: border-color var(--duration-base);
}

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

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

/* ---- POI Panel Content — Barcelona card layout ---- */
.poi-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-12);
}

.poi-neighborhood {
  font-family: var(--font-geist-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.poi-type-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-4);
  font-family: var(--font-geist-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.poi-type-badge--area {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.poi-color-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.poi-card-name {
  font-size: var(--text-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text-heading);
  letter-spacing: var(--tracking-heading);
  margin-bottom: var(--spacing-12);
}

.poi-footer {
  border-top: 1px solid var(--color-border);
  padding-top: var(--spacing-12);
  margin-top: var(--spacing-16);
  margin-bottom: var(--spacing-12);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.poi-maps-link {
  font-family: var(--font-geist-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent-light);
  border: 1px solid var(--color-accent-light);
  padding: 3px 10px;
  border-radius: 4px;
  text-decoration: none;
  transition: all var(--duration-base);
}

.poi-maps-link:hover {
  background: var(--color-accent-light);
  color: var(--color-cta-text);
}

.poi-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: var(--spacing-6);
  margin-bottom: var(--spacing-16);
}

.poi-images img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius-input);
  cursor: pointer;
  border: 1px solid var(--color-border);
  transition: border-color var(--duration-fast);
}

.poi-images img:hover { border-color: var(--color-border-hover); }

.poi-description {
  font-size: 13px;
  line-height: 1.65;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-16);
}

.poi-description h1,
.poi-description h2,
.poi-description h3 {
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-heading);
  color: var(--color-text-heading);
  margin-top: var(--spacing-12);
  margin-bottom: var(--spacing-6);
}

.poi-description a { color: var(--color-text-primary); text-decoration: underline; }

.poi-description ul,
.poi-description ol { padding-left: var(--spacing-20); }

.poi-description p { margin-bottom: var(--spacing-8); }

/* Personal Notes — accent color with left border (matches Barcelona tip style) */
.poi-personal-notes {
  font-size: 12px;
  line-height: 1.55;
  color: var(--color-accent);
  border-left: 2px solid var(--color-accent);
  padding-left: var(--spacing-10);
  margin-bottom: var(--spacing-16);
}

.poi-personal-notes-label {
  font-family: var(--font-geist-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent-light);
  margin-bottom: var(--spacing-4);
  display: block;
}

.poi-video-embed {
  position: relative;
  padding-bottom: 56.25%;
  margin-bottom: var(--spacing-16);
  border-radius: var(--radius-input);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.poi-video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.poi-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-4);
  margin-bottom: var(--spacing-16);
}

.poi-tags .tag {
  font-size: 10px;
  font-family: var(--font-geist-mono);
  padding: 2px 7px;
  background: var(--color-surface-alt);
  border: none;
  border-radius: 3px;
  color: var(--color-text-muted);
  cursor: default;
}

.poi-links {
  list-style: none;
  margin-bottom: var(--spacing-16);
}

.poi-links li { margin-bottom: var(--spacing-4); }

.poi-links a {
  color: var(--color-text-primary);
  font-size: var(--text-body);
  text-decoration: underline;
}

.poi-links a:hover { color: var(--color-text-muted); }

.poi-actions {
  display: flex;
  gap: var(--spacing-8);
  margin-top: var(--spacing-16);
  padding-top: var(--spacing-16);
  border-top: 1px solid var(--color-border);
}

.poi-coords {
  font-family: var(--font-geist-mono);
  font-size: 11px;
  color: var(--color-text-faint);
}

/* ---- Map Markers ---- */
.map-marker {
  width: 24px;
  height: 24px;
  background: var(--color-cta-bg);
  border: 2px solid var(--color-marker-stroke);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform var(--duration-base);
}

.map-marker:hover { transform: scale(1.25); }

/* ---- Empty / Loading states ---- */
.empty-state {
  color: var(--color-text-muted);
  font-size: var(--text-caption);
}

/* ---- CSV Import ---- */
.csv-modal-desc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-12);
  margin-bottom: var(--spacing-12);
  font-size: var(--text-body);
  color: var(--color-text-muted);
}

.csv-drop-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-input);
  padding: var(--spacing-24) var(--spacing-16);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--duration-base), background var(--duration-base);
  margin-bottom: var(--spacing-12);
}

.csv-drop-zone:hover,
.csv-drop-zone.drag-over {
  border-color: var(--color-border-hover);
  background: var(--color-surface-alt);
}

.csv-drop-icon {
  font-size: 24px;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-6);
  line-height: 1;
}

.csv-drop-text {
  font-size: var(--text-body);
  color: var(--color-text-muted);
}

.csv-browse-link {
  background: none;
  border: none;
  font-family: var(--font-geist);
  font-size: var(--text-body);
  color: var(--color-text-primary);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.csv-browse-link:hover { color: var(--color-text-muted); }

.csv-parse-result {
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-4);
}

.csv-parse-result.ready {
  color: var(--color-success-green);
  font-weight: var(--font-weight-medium);
}

/* ---- Backup Modal ---- */

.backup-last-export {
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  margin: 0 0 var(--spacing-16);
}
.backup-last-export.stale { color: var(--color-amber, #f59e0b); }
.backup-last-export.very-stale { color: var(--color-danger, #ef4444); }

.backup-section {
  margin-bottom: var(--spacing-16);
}

.backup-section-title {
  font-size: var(--text-body);
  font-weight: var(--font-weight-medium);
  margin: 0 0 var(--spacing-8);
}

.backup-export-btns {
  display: flex;
  gap: var(--spacing-8);
}

.backup-import-progress {
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-8);
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 10);
  background: var(--color-lightbox);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: fade-in var(--duration-slow) var(--ease-default);
}

.lightbox img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  border-radius: var(--radius-input);
  animation: scale-in var(--duration-slow) var(--ease-out);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes list-row-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fab-item-enter {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---- POI Hover Popup ---- */
.poi-hover-popup-wrap {
  opacity: 0;
  animation: fade-in var(--duration-fast) var(--ease-default) forwards;
}

.poi-hover-popup-wrap .mapboxgl-popup-content {
  padding: 0;
  border-radius: var(--radius-base);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--color-border);
  overflow: hidden;
  font-family: var(--font-geist);
  background: var(--color-surface);
}

.poi-hover-popup-wrap .mapboxgl-popup-tip {
  border-top-color: var(--color-surface);
}

.poi-hover {
  width: 220px;
}

.poi-hover-img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-bottom: 1px solid var(--color-border);
}

.poi-hover-body {
  padding: 10px 12px;
  background: var(--color-surface);
}

.poi-hover-neighborhood {
  font-family: var(--font-geist-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.poi-hover-name {
  font-size: var(--text-body);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-heading);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poi-hover-desc {
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
  line-height: 1.45;
  margin-bottom: 8px;
}

.poi-hover-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.poi-hover-tag {
  display: inline-block;
  padding: 2px 7px;
  background: var(--color-surface-alt);
  border: none;
  border-radius: 3px;
  font-size: 10px;
  font-family: var(--font-geist-mono);
  color: var(--color-text-muted);
}

/* ---- Mapbox overrides ---- */
.mapboxgl-ctrl-group {
  border-radius: var(--radius-input) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid var(--color-border) !important;
  overflow: hidden;
}

.mapboxgl-ctrl-group button {
  background: var(--color-surface) !important;
  color: var(--color-text-primary) !important;
}

.mapboxgl-ctrl-group button:hover {
  background: var(--color-surface-alt) !important;
}

[data-theme="dark"] .mapboxgl-ctrl-group button .mapboxgl-ctrl-icon {
  filter: invert(1);
}

[data-theme="dark"] .mapboxgl-ctrl-attrib-inner a {
  color: var(--color-text-muted);
}

/* ============================================
   Mobile (<768px)
   ============================================ */
@media (max-width: 767px) {
  /* Touch targets: minimum 44px */
  .btn, .btn-icon, .drawer-toggle, .theme-toggle, .map-style-toggle,
  .fab-btn, .neighborhood-city, .neighborhood-pill, .filter-tag, .route-item {
    min-height: 44px;
    min-width: 44px;
  }

  .filter-tag {
    padding: 10px 8px;
  }

  .neighborhood-pill {
    padding: 10px 12px;
  }

  /* Detail panel — bottom sheet */
  .panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    max-height: 75vh;
    border-left: none;
    border-top: 1px solid var(--color-border);
    border-radius: 16px 16px 0 0;
  }

  .panel-header {
    padding: var(--spacing-12) var(--spacing-16);
  }

  .panel-body {
    padding: var(--spacing-16);
  }

  /* Modals */
  .modal-content {
    width: 95%;
    max-height: 85vh;
  }

  .modal-wide {
    max-width: 95%;
  }

  /* Library list */
  .list-view {
    width: 100%;
  }

  .list-header {
    padding: 60px var(--spacing-12) var(--spacing-12);
  }

  .list-controls {
    flex-wrap: wrap;
    gap: var(--spacing-8);
  }

  .list-type-toggle {
    flex: 1;
  }

  .type-btn {
    flex: 1;
    min-height: 44px;
  }

  .list-search input {
    min-height: 44px;
    font-size: 16px;
  }

  .map-search {
    left: 10px;
    top: 60px;
    right: 10px;
    width: auto;
  }

  .map-search input {
    min-height: 44px;
    font-size: 16px;
  }

  .list-row {
    margin: var(--spacing-6) var(--spacing-12);
    padding: var(--spacing-16);
  }

  .list-row-thumb {
    width: 40px;
    height: 40px;
  }

  .list-row-desc,
  .list-row-notes {
    display: none;
  }

  .list-row-date {
    font-size: 10px;
  }

  .list-bulk-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-12) var(--spacing-16) calc(var(--spacing-12) + env(safe-area-inset-bottom));
    margin-top: 0;
    z-index: 25;
    gap: var(--spacing-10);
  }

  /* Drawer full-height on mobile */
  .drawer {
    width: 85vw;
    max-width: 320px;
  }

  /* FAB */
  .fab-add {
    bottom: var(--spacing-16);
    right: var(--spacing-16);
  }

  .fab-menu {
    width: 220px;
  }

  .fab-menu-item {
    min-height: 44px;
    padding: 12px 14px;
  }

  /* Top controls */
  .drawer-toggle {
    width: 44px;
    height: 44px;
  }

  .filter-toggle {
    width: 44px;
    height: 44px;
    left: 62px;
  }

  .theme-toggle,
  .map-style-toggle {
    width: 36px;
    height: 36px;
  }

  .map-style-toggle {
    right: 96px;
  }

  /* Form inputs */
  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px; /* prevents iOS zoom */
    padding: 8px 12px;
  }

  /* Color swatches larger for touch */
  .color-swatch {
    width: 36px;
    height: 36px;
  }

  /* POI images grid — 2 columns on narrow screens */
  .poi-images {
    grid-template-columns: repeat(2, 1fr);
  }
}
