:root {
  /* —— Surfaces —— */
  --bg: #0a0f14;
  --bg-elev: #121a24;
  --bg-soft: #1a2430;
  --bg-muted: #222d3b;
  --surface-overlay: rgba(10, 15, 20, 0.72);

  /* —— Text —— */
  --text: #f0f4f8;
  --text-soft: #b4c0d0;
  --text-muted: #7a8fa6;
  --text-disabled: #556678;

  /* —— Brand & accents —— */
  --accent: #6eb6ff;
  --accent-hover: #8fc7ff;
  --accent-soft: rgba(110, 182, 255, 0.14);
  --accent-muted: rgba(110, 182, 255, 0.08);
  --accent-border: rgba(110, 182, 255, 0.38);

  /* —— Borders —— */
  --border: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* —— Island type colours —— */
  --sea: #4a9de8;
  --lake: #5fd4a8;
  --river: #e8b85a;
  --unknown: #b08bd1;
  --mist: rgba(180, 192, 208, 0.08);
  --peat: #14110d;
  --gold: #e8c44a;
  --for-sale: #c4a062;
  --for-sale-soft: rgba(196, 160, 98, 0.18);
  --for-sale-ring: rgba(196, 160, 98, 0.42);
  --unnamed: #fb923c;
  --unnamed-soft: rgba(251, 146, 60, 0.16);
  --unnamed-ring: rgba(251, 146, 60, 0.45);

  /* —— Elevation —— */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.28);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.48);

  /* —— Radius —— */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* —— Motion —— */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --transition-fast: 0.14s var(--ease-standard);
  --transition-med: 0.22s var(--ease-standard);

  /* —— Surfaces (layered cards) —— */
  --surface-card: #131b26;
  --surface-hover: #1a2432;
  --surface-inset: #0d1218;
  --radius-card: 16px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.14), 0 12px 28px rgba(0, 0, 0, 0.28);

  /* —— Typography —— */
  --font-display: "DM Serif Display", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.625rem;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.04em;
  --tracking-wider: 0.08em;

  /* —— Spacing (8px grid) —— */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* —— Controls —— */
  --control-h: 40px;
  --control-h-lg: 44px;
  --focus-ring: 0 0 0 3px var(--accent-soft);
  --focus-outline: 2px solid var(--accent);

  /* —— Layout —— */
  --sidebar-w: 380px;
  --glass: color-mix(in srgb, var(--bg-elev) 86%, transparent);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --mobile-nav-h: 0px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior: none;
  background: var(--bg);
  background-image: radial-gradient(
      120% 80% at 50% -20%,
      rgba(110, 182, 255, 0.07),
      transparent 55%
    ),
    linear-gradient(
      180deg,
      var(--bg) 0%,
      color-mix(in srgb, var(--bg) 96%, var(--peat)) 100%
    );
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  display: flex;
  flex-direction: column;
}

/* ===== Top bar ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  background: color-mix(in srgb, var(--bg-elev) 94%, transparent);
  backdrop-filter: blur(16px) saturate(1.15);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
  flex-wrap: wrap;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-link {
  border: none;
  background: transparent;
  color: inherit;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  touch-action: manipulation;
}

.brand-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.brand-mark {
  font-size: 28px;
  color: var(--accent);
  line-height: 1;
}

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

.tagline {
  margin: var(--space-1) 0 0;
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
  color: var(--text-muted);
  max-width: 28rem;
}

.topbar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.filter-tier--essential {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1 1 auto;
}

.filter-tier--more {
  flex: 0 0 auto;
  min-width: 140px;
}

.filter-tier__summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.filter-tier__summary::-webkit-details-marker {
  display: none;
}

.filter-tier__body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.filter-reset-btn {
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.filter-reset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (min-width: 901px) {
  .filter-tier--more .filter-tier__body {
    position: absolute;
    right: 20px;
    top: 100%;
    z-index: 1100;
    width: min(420px, 90vw);
    margin-top: 4px;
    box-shadow: var(--shadow);
  }

  .filter-tier--more {
    position: relative;
  }

  .topbar-actions {
    position: relative;
  }
}

.topbar-controls input,
.topbar-controls select {
  background: var(--surface-card);
  color: var(--text);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-3);
  min-height: var(--control-h);
  font-size: var(--text-sm);
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
  min-width: 160px;
}

.topbar-controls input:focus,
.topbar-controls select:focus {
  border-color: var(--accent-border);
  box-shadow: var(--focus-ring);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-card);
  color: var(--text-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0 var(--space-3);
  min-height: var(--control-h);
  font-size: var(--text-sm);
  cursor: pointer;
  user-select: none;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.toggle input {
  accent-color: var(--accent);
}

.toggle:has(input:checked) {
  background: var(--accent-soft);
  border-color: rgba(94, 176, 255, 0.45);
  color: var(--accent);
  font-weight: 600;
}

.toggle--pending {
  opacity: 0.55;
  cursor: wait;
}

.toggle--pending input:disabled {
  cursor: wait;
}

.topbar-controls select#area-min-filter,
.topbar-controls select#subtype-filter,
.topbar-controls select#confidence-filter {
  min-width: 128px;
}

/* ===== Cluster styling overrides ===== */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(78, 163, 255, 0.25);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(78, 163, 255, 0.85);
  color: white;
  font-weight: 600;
}

/* Highlighted island polygon overlay */
.island-polygon {
  stroke: #4ea3ff;
  stroke-width: 2;
  fill: rgba(78, 163, 255, 0.18);
}

.poly-loading {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Layout ===== */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 0;
}

.sidebar {
  position: relative;
  background: var(--bg);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.map-wrap {
  position: relative;
  min-height: 0;
}

/* Vignette removed — inset shadow read as a spurious dark line above the legend. */

.map-island-peek {
  position: absolute;
  left: 50%;
  bottom: calc(16px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(92%, 420px);
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.map-island-peek[hidden] {
  display: none;
}

.map-island-peek__name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-island-peek__cta {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.dot--explore {
  background: #f4d35e;
  border: 1px solid #c9a820;
}

#map {
  width: 100%;
  height: 100%;
  /* Match typical OSM water so sub-pixel tile gaps are not pitch-black lines. */
  background: #aadaff;
}

.leaflet-container {
  background: #aadaff;
}

.leaflet-tile {
  outline: 1px solid transparent;
}

#map.map--crowd-pick {
  cursor: crosshair;
}

/* ----- Crowd island suggestion modal ----- */
.crowd-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, var(--safe-top)) max(16px, var(--safe-right))
    max(16px, var(--safe-bottom)) max(16px, var(--safe-left));
}

.crowd-modal[hidden] {
  display: none;
}

/* Pick step: bottom sheet only — map stays clickable (pointer-events pass through) */
.crowd-modal--picking {
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.crowd-modal--picking .crowd-modal__backdrop {
  display: none;
}

.crowd-modal--picking .crowd-modal__panel {
  pointer-events: auto;
  width: min(100%, 480px);
  margin: 0 16px max(16px, var(--safe-bottom));
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
}

.crowd-modal--picking + #map,
.map-wrap:has(.crowd-modal--picking) #map {
  cursor: crosshair;
}

.crowd-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 12, 0.72);
  backdrop-filter: blur(4px);
}

.crowd-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: min(90vh, 640px);
  overflow-y: auto;
  padding: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.crowd-modal__title {
  margin: 0 0 12px;
  font-size: 18px;
}

.crowd-modal__lead,
.crowd-modal__fine {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.45;
}

.crowd-modal__fine {
  font-size: 12px;
  color: var(--text-muted);
}

.crowd-modal__fine a {
  color: var(--accent);
}

.crowd-step > .crowd-modal__btn {
  margin-top: 4px;
}

.crowd-coords-label {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.crowd-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-soft);
}

.crowd-field span {
  font-weight: 600;
  color: var(--text);
}

.crowd-optional {
  font-weight: 400;
  font-style: italic;
  color: var(--text-muted);
}

.crowd-field input,
.crowd-field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.crowd-field textarea {
  resize: vertical;
  min-height: 72px;
}

.crowd-field input:focus,
.crowd-field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.crowd-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.crowd-modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.crowd-modal__btn--primary {
  background: linear-gradient(180deg, #5a9fff 0%, var(--accent) 100%);
  border-color: rgba(78, 163, 255, 0.45);
  color: #fff;
}

.crowd-modal__btn--ghost {
  background: transparent;
}

.crowd-modal__btn:hover {
  filter: brightness(1.06);
}

.crowd-modal__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.crowd-modal__btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.crowd-form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
  color: #ffb4b4;
  background: rgba(180, 48, 48, 0.2);
  border: 1px solid rgba(255, 120, 120, 0.35);
  border-radius: 10px;
}

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

.contribute-hub {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.contribute-hub__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 14px 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.contribute-hub__card:hover {
  border-color: var(--accent);
  background: var(--bg-soft);
}

.contribute-hub__card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.contribute-hub__badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.contribute-hub__badge--community {
  background: rgba(245, 197, 66, 0.2);
  color: #e8c44a;
  border: 1px solid rgba(245, 197, 66, 0.35);
}

.contribute-hub__badge--atlas {
  background: rgba(78, 163, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(78, 163, 255, 0.35);
}

.contribute-hub__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.contribute-hub__desc {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.crowd-context-banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.crowd-context-banner--community {
  background: rgba(245, 197, 66, 0.1);
  border-color: rgba(245, 197, 66, 0.35);
  color: #e8d48a;
}

.crowd-context-banner--atlas {
  background: rgba(78, 163, 255, 0.1);
  border-color: rgba(78, 163, 255, 0.35);
  color: #a8d4ff;
}

.crowd-config-hint {
  margin: 0 0 12px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
  background: var(--bg-soft);
  border-radius: 8px;
  border: 1px dashed var(--border);
}

.crowd-config-hint[hidden] {
  display: none;
}

.crowd-field--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.crowd-field--checkbox input {
  width: auto;
  margin: 0;
}

.crowd-field--checkbox span {
  font-weight: 500;
  color: var(--text-soft);
}

.topbar-link--contribute {
  border-color: color-mix(in srgb, var(--gold) 50%, var(--border-subtle));
  color: color-mix(in srgb, var(--gold) 90%, white);
}

.topbar-link--contribute:hover {
  background: color-mix(in srgb, var(--gold) 14%, var(--surface-hover));
  border-color: color-mix(in srgb, var(--gold) 60%, var(--border-strong));
}

/* ----- Saved islands (email gate) ----- */
.favorites-modal {
  position: fixed;
  inset: 0;
  z-index: 3100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, var(--safe-top)) max(16px, var(--safe-right))
    max(16px, var(--safe-bottom)) max(16px, var(--safe-left));
}

.favorites-modal[hidden] {
  display: none;
}

.favorites-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 12, 0.72);
  backdrop-filter: blur(4px);
}

.favorites-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 380px);
  padding: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.favorites-modal__title {
  margin: 0 0 10px;
  font-size: 18px;
}

.favorites-modal__lead {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-soft);
}

.favorites-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
}

.favorites-field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

.favorites-field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.favorites-access-error {
  margin: 0 0 12px;
  padding: 8px 10px;
  font-size: 13px;
  color: #ffb4b4;
  background: rgba(180, 48, 48, 0.2);
  border: 1px solid rgba(255, 120, 120, 0.35);
  border-radius: 8px;
}

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

.favorites-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.favorites-modal__btn {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.favorites-modal__btn--primary {
  background: linear-gradient(180deg, #ff7aa8 0%, #ff5c8a 100%);
  border-color: rgba(255, 92, 138, 0.45);
  color: #fff;
}

.favorites-modal__btn--ghost {
  background: transparent;
}

/* Saved islands on the main map */
.leaflet-div-icon.map-heart-marker {
  background: transparent;
  border: none;
}

.map-heart-marker__heart {
  display: block;
  font-size: 24px;
  line-height: 1;
  color: #ff5c8a;
  text-shadow:
    0 0 4px rgba(0, 0, 0, 0.9),
    0 1px 3px rgba(0, 0, 0, 0.75);
}

.leaflet-tooltip.map-heart-tooltip {
  font-weight: 600;
}

.legend-heart {
  font-style: normal;
  color: #ff5c8a;
  font-size: 14px;
  line-height: 1;
  vertical-align: middle;
}

/* ----- Browse quick filters + Scotland quick filters + active filter chips ----- */
.browse-quick {
  padding: 10px 12px 6px;
  border-bottom: 1px solid var(--border);
}

.browse-quick__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.browse-quick__chip {
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  min-height: 34px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--text-soft);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.browse-quick__chip:hover,
.browse-quick__chip:focus-visible {
  border-color: var(--accent-border);
  background: var(--accent-muted);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.browse-quick__chip.is-active {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.browse-quick__chip--explore {
  border-color: rgba(196, 160, 98, 0.45);
  background: rgba(196, 160, 98, 0.1);
}

.browse-quick__chip--explore.is-active {
  border-color: #c4a062;
  background: rgba(196, 160, 98, 0.22);
  color: #f5e6c8;
}

.crawl-links {
  margin: 0 12px 12px;
  padding: 12px 0 4px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.crawl-links__heading {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.crawl-links__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.crawl-links__sub {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
}

.crawl-links__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.crawl-links__list a {
  display: block;
  padding: 2px 0;
  color: var(--accent);
  text-decoration: none;
  line-height: 1.35;
}

.crawl-links__list a:hover,
.crawl-links__list a:focus-visible {
  text-decoration: underline;
}

.scotland-quick {
  padding: 12px 12px 4px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(61, 143, 212, 0.08) 0%, transparent 100%);
}

.scotland-quick__label {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sea);
}

.scotland-quick__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.scotland-quick__chip {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(61, 143, 212, 0.35);
  background: rgba(61, 143, 212, 0.12);
  color: #b8daf5;
  cursor: pointer;
}

.scotland-quick__chip:hover,
.scotland-quick__chip:focus-visible {
  border-color: var(--sea);
  color: var(--text);
  outline: none;
}

.scotland-quick__chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.active-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}

.active-filter-chips[hidden] {
  display: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-soft);
  border: 1px solid rgba(94, 176, 255, 0.35);
  color: var(--accent);
}

.filter-chip__clear {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

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

/* ----- Explore topic chips ----- */
.discover-panel {
  padding: 10px 12px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}

.discover-panel[hidden] {
  display: none;
}

.discover-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.discover-chip {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-soft);
  cursor: pointer;
}

.discover-chip:hover,
.discover-chip:focus-visible {
  border-color: var(--accent);
  color: var(--text);
  outline: none;
}

.discover-chip.is-active {
  background: var(--accent-soft);
  border-color: rgba(78, 163, 255, 0.45);
  color: var(--accent);
}

.discover-panel__hint {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.discover-panel__hint[hidden] {
  display: none;
}

/* ----- Featured / notable islands strip ----- */
.featured-strip {
  padding: 10px 12px 4px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}

.featured-strip[hidden] {
  display: none;
}

.featured-strip__title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.featured-strip__scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, #000 92%, transparent);
}

.featured-card {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--surface-card);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  scroll-snap-align: start;
  overflow: hidden;
  font-family: inherit;
  box-shadow: var(--shadow-card);
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med),
    border-color var(--transition-fast);
}

.featured-card:hover,
.featured-card:focus-visible {
  border-color: var(--accent-border);
  outline: none;
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.featured-card__img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  object-position: center 35%;
  display: block;
  background: var(--bg);
}

.featured-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 112px;
  font-size: 28px;
  color: var(--text-muted);
  background: var(--bg);
}

.featured-card__body {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.featured-card__name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.featured-card__blurb {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Island list ===== */
.sidebar-section-header {
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 2;
}

.sidebar-section-header h2 {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
}

.count {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.count--filtered {
  background: var(--accent-soft);
  border-color: rgba(94, 176, 255, 0.45);
  color: var(--accent);
  font-weight: 600;
}

.island-list__items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.island-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  margin-bottom: var(--space-3);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid transparent;
  background: var(--surface-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med),
    background-color var(--transition-fast),
    border-color var(--transition-fast);
}

.island-card:has(.dot--sea) {
  border-left-color: var(--sea);
}

.island-card:has(.dot--lake) {
  border-left-color: var(--lake);
}

.island-card:has(.dot--river) {
  border-left-color: var(--river);
}

.island-card:has(.dot--unknown) {
  border-left-color: var(--unknown);
}

.island-card__main {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2) var(--space-3) var(--space-4);
  margin: 0;
  border: none;
  border-radius: 0;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--transition-fast);
  background: transparent;
  color: inherit;
  font: inherit;
}

.island-card__main:focus-visible {
  outline: none;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.island-card:hover {
  background: var(--surface-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.island-card.is-active {
  background: color-mix(in srgb, var(--accent-muted) 65%, var(--surface-card));
  border-color: var(--accent-border);
  box-shadow: var(--shadow-card-hover), inset 3px 0 0 var(--accent);
  transform: translateY(-1px);
}

.island-card__fav {
  flex: 0 0 40px;
  width: 40px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s ease, transform 0.12s ease;
}

.island-card__fav:hover,
.island-card__fav:focus-visible {
  color: #ff5c8a;
  transform: scale(1.08);
}

.island-card__fav.is-favorite {
  color: #ff5c8a;
}

.island-card__fav:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.island-card__thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--mist);
  border: 1px solid var(--border-subtle);
}

.island-card__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  line-height: 1;
  padding: 4px;
  background: linear-gradient(135deg, var(--bg-soft), var(--mist));
  border: 1px solid var(--border);
}

.island-card__thumb--sea {
  color: var(--sea);
  background: linear-gradient(135deg, rgba(78, 163, 255, 0.12), var(--bg-soft));
}

.island-card__thumb--lake {
  color: var(--lake);
  background: linear-gradient(135deg, rgba(108, 211, 163, 0.12), var(--bg-soft));
}

.island-card__thumb--river {
  color: var(--river);
  background: linear-gradient(135deg, rgba(245, 176, 74, 0.12), var(--bg-soft));
}

.island-card__thumb--unknown {
  color: #b08bd1;
  background: linear-gradient(135deg, rgba(176, 139, 209, 0.12), var(--bg-soft));
}

.hero-img--lightbox {
  cursor: zoom-in;
}

.hero-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 180px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: linear-gradient(135deg, var(--bg-soft), var(--mist));
}

.hero-placeholder__icon {
  font-size: 42px;
  line-height: 1;
  opacity: 0.85;
}

.hero-placeholder__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-placeholder--sea {
  color: var(--sea);
  border-color: rgba(78, 163, 255, 0.35);
}

.hero-placeholder--lake {
  color: var(--lake);
  border-color: rgba(108, 211, 163, 0.35);
}

.hero-placeholder--river {
  color: var(--river);
  border-color: rgba(245, 176, 74, 0.35);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 18, 0.88);
}

.lightbox__panel {
  position: relative;
  z-index: 1;
  max-width: min(960px, 100%);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100dvh - 96px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.lightbox__caption {
  margin: 0;
  font-size: 13px;
  color: #d8e2ef;
  text-align: center;
}

.lightbox__close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

body.lightbox-open {
  overflow: hidden;
}

#island-list:focus-visible {
  outline: none;
}

.featured-card,
.browse-quick__chip,
.discover-chip {
  touch-action: manipulation;
}

.island-card__text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.island-card__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  min-width: 0;
}

.island-card__meta {
  font-size: 12px;
  color: var(--text-soft);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.island-card__meta span::before {
  content: "•";
  margin-right: 6px;
  color: var(--text-muted);
}

.island-card__meta span:first-child::before {
  content: "";
  margin: 0;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sea);
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.dot--sea {
  background: var(--sea);
}

.dot--lake {
  background: var(--lake);
}

.dot--river {
  background: var(--river);
}

.dot--unknown {
  background: var(--unknown);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.35) 0px,
    rgba(255, 255, 255, 0.35) 2px,
    transparent 2px,
    transparent 4px
  );
}

.dot--crowd {
  background: #f5c542;
  box-shadow: 0 0 0 1px rgba(61, 46, 10, 0.65), 0 0 6px rgba(245, 197, 66, 0.45);
}

.dot--unnamed {
  background: var(--unnamed);
  box-shadow: 0 0 0 1px rgba(120, 53, 15, 0.5), 0 0 6px var(--unnamed-soft);
}

.marker-vis--unnamed {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.island-card--unnamed {
  border-left-color: var(--unnamed);
}

.island-card__unnamed-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: #431407;
  background: var(--unnamed-soft);
  border: 1px solid var(--unnamed-ring);
}

.unnamed-banner {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--unnamed-ring);
  background: var(--unnamed-soft);
  color: var(--text);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.unnamed-banner strong {
  display: block;
  margin-bottom: var(--space-1);
  color: #fdba74;
}

.unnamed-banner__link {
  border: none;
  padding: 0;
  background: none;
  color: var(--unnamed);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.layer-badge--unnamed {
  color: #431407;
  background: var(--unnamed-soft);
  border-color: var(--unnamed-ring);
}

/* ===== Details panel ===== */
.island-details {
  padding: 16px;
  position: relative;
  z-index: 5;
  background: var(--bg-elev);
  isolation: isolate;
}

.island-details[hidden] {
  display: none !important;
}

#island-list-section[hidden] {
  display: none !important;
}

body[data-island-detail="open"] #island-list-section,
body[data-island-detail="suspended"] #island-list-section {
  display: none !important;
}

body[data-island-detail="open"] .sidebar {
  overflow: hidden;
}

body[data-island-detail="open"] .island-details:not([hidden]) {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

.profile-body {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  contain: layout style;
}

.profile-body > * {
  max-width: 100%;
}

.profile-body .section,
.profile-body .ferry-section,
.profile-body .detail-map-section,
.profile-body .property-listings-section {
  min-width: 0;
}

.details-title-row,
.details-title-block {
  min-width: 0;
}

.details-title {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.details-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.details-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.back-button {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-soft);
  border-radius: var(--radius-full);
  padding: 0 var(--space-4);
  min-height: var(--control-h);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.back-button:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.details-hero {
  width: 100%;
  margin-bottom: var(--space-4);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
  gap: 6px;
}

.details-hero__media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}

.details-hero:has(.hero-img) .details-hero__media::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(12, 18, 25, 0.45), transparent);
  pointer-events: none;
}

.details-hero:has(.hero-img)::after {
  content: none;
}

.details-hero__media .hero-img {
  display: block;
  width: 100%;
  border-radius: 0;
}

.details-hero .hero-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.details-hero.hero-failed .hero-img,
.details-hero.hero-failed .hero-attrib,
.details-hero.hero-failed .thumb-strip {
  display: none;
}

.details-hero.hero-failed::after {
  content: "No photo yet — help us add one via Contribute";
  display: grid;
  place-items: center;
  min-height: 140px;
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: linear-gradient(135deg, var(--bg-soft), var(--mist));
}

.details-hero .hero-img {
  object-position: center 35%;
}

.details-hero .hero-attrib {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  padding: 0 2px;
}

.details-hero .hero-attrib a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.thumb-strip {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  -webkit-overflow-scrolling: touch;
}

.thumb-strip::-webkit-scrollbar {
  height: 5px;
}

.thumb-strip::-webkit-scrollbar-track {
  background: transparent;
}

.thumb-strip::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.thumb-strip .thumb {
  flex: 0 0 56px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-soft);
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease;
}

.thumb-strip .thumb:hover {
  border-color: var(--accent);
}

.thumb-strip .thumb.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.thumb-strip .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.details-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 4px;
}

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

.details-action-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.details-action-btn:hover,
.details-action-btn:focus-visible {
  color: var(--accent);
  border-color: rgba(78, 163, 255, 0.45);
}

.details-title-row .details-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.details-fav {
  flex: 0 0 auto;
  margin: 2px 0 0;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.details-fav:hover,
.details-fav:focus-visible {
  color: #ff5c8a;
  border-color: rgba(255, 92, 138, 0.45);
}

.details-fav.is-favorite {
  color: #ff5c8a;
  border-color: rgba(255, 92, 138, 0.55);
  background: rgba(255, 92, 138, 0.08);
}

.details-fav:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.details-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

.details-subtitle {
  color: var(--text-soft);
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.alt-names {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 2px 0 10px;
  font-size: 12px;
  color: var(--text-soft);
}

.alt-name__lang {
  color: var(--text-muted);
  letter-spacing: 0.4px;
}

.alt-name__val {
  color: var(--text-soft);
  font-style: italic;
}

/* Suggest a correction (GitHub issue; source required) */
.correction-report {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.correction-report h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.correction-report__lead {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-soft);
}

.correction-report__note {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--river);
}

.correction-report__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

.correction-report__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #0a1320;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.correction-report__btn--primary {
  background: linear-gradient(180deg, #5a9fff 0%, var(--accent) 100%);
  color: #fff;
}

.correction-report__btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}

.correction-report__btn:hover {
  filter: brightness(1.06);
}

.details-title-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.layer-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.layer-badge--atlas {
  background: rgba(78, 163, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(78, 163, 255, 0.35);
}

.trip-priority-block {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(61, 143, 212, 0.35);
  background: linear-gradient(135deg, rgba(61, 143, 212, 0.1), transparent);
}

.trip-priority-block:empty {
  display: none;
}

.trip-priority-block .ferry-section h3 {
  margin-top: 0;
}

.correction-report__fine {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}

.sources-section .sources-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sources-section .src {
  padding: 8px 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}

.sources-section .src-line {
  color: var(--text);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: baseline;
}

.sources-section .src-line a {
  color: var(--accent);
}

.sources-section .src-lic {
  background: rgba(108, 211, 163, 0.12);
  color: #6cd3a3;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sources-section .src-ref {
  color: var(--text-muted);
}

.sources-section .src-attrib {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 4px;
  line-height: 1.4;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 16px 0;
}

@media (min-width: 420px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat--wide {
    grid-column: 1 / -1;
  }
}

.stat {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  min-width: 0;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.stat--wide {
  grid-column: 1 / -1;
}

.stat--multiline .stat__value {
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stat__label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  font-weight: 700;
}

.stat__value {
  font-weight: 600;
  font-size: 14px;
  margin-top: 4px;
  line-height: 1.35;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stat__value .stat__muted,
.stat__value span[style*="text-muted"] {
  color: var(--text-muted) !important;
  font-size: 12px !important;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.tag {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid rgba(78, 163, 255, 0.3);
}

.subtype-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.subtype-chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--lake);
  background: rgba(108, 211, 163, 0.15);
  border: 1px solid rgba(108, 211, 163, 0.45);
}

.section {
  margin: 14px 0;
}

.section h3 {
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 6px;
}

.section p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.detail-map-section .detail-map {
  height: 280px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.detail-map-section .detail-map__switcher {
  display: flex;
  gap: 6px;
  margin: 0 0 8px;
  flex-wrap: wrap;
}

.detail-map__basemap {
  appearance: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.detail-map__basemap:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(78, 163, 255, 0.4);
}

.detail-map__basemap.is-active {
  background: rgba(78, 163, 255, 0.18);
  border-color: rgba(78, 163, 255, 0.55);
  color: var(--accent);
  font-weight: 600;
}

.detail-map__basemap.is-disabled,
.detail-map__basemap:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.detail-map-section .detail-map__hint {
  margin: 6px 2px 0;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.detail-map-section .detail-map__hint code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 10.5px;
}

/* 3D terrain viewer (Three.js, showcase islands) */
.island-3d-section {
  min-width: 0;
}

.island-3d-view {
  position: relative;
  height: 280px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  overflow: hidden;
}

.island-3d-view canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.island-3d-view__status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  pointer-events: none;
  z-index: 1;
}

.island-3d-view--ready .island-3d-view__status {
  display: none;
}

.island-3d-view--error .island-3d-view__status {
  color: var(--text-muted);
}

.island-3d__hint {
  margin: 6px 2px 0;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Showcase landing grid */
.showcase-3d-page {
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.showcase-3d-page__back {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--accent);
  text-decoration: none;
}

.showcase-3d-page__back:hover {
  text-decoration: underline;
}

.showcase-3d-page h1 {
  font-size: 28px;
  margin: 8px 0 10px;
}

.showcase-3d-page__lead {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
  max-width: 62ch;
}

.showcase-3d-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.showcase-3d-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 12px 10px;
  min-width: 0;
}

.showcase-3d-card h2 {
  margin: 0 0 4px;
  font-size: 17px;
  color: var(--accent);
}

.showcase-3d-card__meta {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.showcase-3d-card .island-3d-view {
  height: 220px;
}

.showcase-3d-card__link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}

.showcase-3d-card__link:hover {
  text-decoration: underline;
}

/* OS Maps API key configuration form (lives next to the basemap pills). */
.detail-map__switcher-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  flex-wrap: wrap;
}

.detail-map__keycfg {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1 1 100%;
}

.os-key__toggle {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  font: inherit;
  font-size: 11.5px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
  white-space: nowrap;
}

.os-key__toggle:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.07);
}

.os-key__toggle .os-key__icon {
  opacity: 0.7;
  font-size: 12.5px;
}

.os-key__form {
  margin-top: 8px;
  padding: 10px 12px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  line-height: 1.5;
}

.os-key__intro {
  margin: 0 0 8px;
  color: var(--muted, #98a2b3);
}

.os-key__intro a {
  color: var(--accent);
}

.os-key__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.os-key__field .os-key__label {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #98a2b3);
}

.os-key__field input {
  width: 100%;
  padding: 7px 9px;
  font: inherit;
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.os-key__field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.os-key__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.os-key__actions button {
  padding: 5px 11px;
  font-size: 11.5px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
}

.os-key__actions button:hover {
  border-color: var(--accent);
}

.os-key__save {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #0a0f1a !important;
  font-weight: 600;
}

.os-key__test {
  background: rgba(108, 211, 163, 0.15) !important;
  border-color: rgba(108, 211, 163, 0.45) !important;
  color: #6cd3a3 !important;
}

.os-key__clear {
  margin-left: auto; /* push destructive action to the right */
  color: #f5b04a !important;
  border-color: rgba(245, 176, 74, 0.4) !important;
}

.os-key__detail {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted, #98a2b3);
}

.os-key__detail code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 10.5px;
}

.os-key__status {
  margin: 8px 0 0;
  font-size: 11.5px;
  min-height: 1em;
  color: var(--muted, #98a2b3);
}

.os-key__status.is-ok {
  color: #6cd3a3;
}

.os-key__status.is-warn {
  color: #f5b04a;
}

.os-key__status.is-err {
  color: #ef6f6c;
}

.os-key__note {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--muted, #98a2b3);
}

.os-key__note code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 10.5px;
}

.external-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.external-links a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  text-align: center;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.external-links a:hover,
.external-links a:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ===== Map legend ===== */
.legend-wrap {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 500;
  max-width: min(96vw, 520px);
}

.legend-wrap__toggle {
  list-style: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(8px);
  color: var(--text-soft);
}

.legend-wrap__toggle::-webkit-details-marker {
  display: none;
}

.legend-wrap__toggle::after {
  content: " ▾";
  font-size: 10px;
  opacity: 0.7;
}

.legend-wrap[open] .legend-wrap__toggle::after {
  content: " ▴";
}

.legend {
  position: static;
  margin-top: 8px;
  background: rgba(15, 22, 32, 0.85);
  backdrop-filter: blur(6px);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 12px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== Leaflet popup tweaks ===== */
.leaflet-popup-content-wrapper {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.leaflet-popup-content {
  margin: 10px 12px;
  font-size: 13px;
}

.leaflet-popup-content b {
  color: var(--text);
}

.leaflet-popup-tip {
  background: var(--bg-elev);
  border: 1px solid var(--border);
}

.leaflet-popup.crowd-popup-wrap .leaflet-popup-content-wrapper {
  border-color: rgba(245, 197, 66, 0.45);
  box-shadow: 0 0 0 1px rgba(245, 197, 66, 0.2);
}

.crowd-popup {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.crowd-popup__title {
  font-size: 15px;
  color: var(--text);
}

.crowd-popup__badge {
  display: inline-block;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(245, 197, 66, 0.2);
  color: #f5c542;
}

.crowd-popup__note {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.4;
}

.crowd-popup__src {
  margin: 0;
}

.crowd-popup__src a {
  color: var(--accent);
  font-weight: 600;
}

.crowd-popup__credit {
  margin: 4px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-soft);
}

.crowd-popup__credit ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.crowd-popup__id {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.crowd-popup__id code {
  font-size: 11px;
}

.crowd-popup__action--edit-details {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, #5a9fff 0%, var(--accent) 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}

.crowd-popup__action--edit-details:hover {
  filter: brightness(1.06);
}

.crowd-popup__action,
.crowd-popup__action--suggest-name {
  display: inline-block;
  margin-top: 8px;
  margin-right: 8px;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
}

.crowd-popup__action--github {
  font-size: 12px;
  color: var(--text-muted);
}

.crowd-popup__action--suggest-name {
  font-weight: 600;
  color: var(--accent);
}

.leaflet-control-attribution {
  background: rgba(15, 22, 32, 0.7) !important;
  color: var(--text-muted) !important;
}

.leaflet-control-attribution a {
  color: var(--text-soft) !important;
}

.popup-link {
  display: inline-block;
  margin-top: 4px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

/* ===== Responsive ===== */
.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  flex: 1 1 280px;
  justify-content: flex-end;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-h-lg);
  padding: 0 var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.topbar-link:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
  filter: none;
}

.topbar-link:focus-visible {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: var(--focus-ring);
}

.topbar-link--btn {
  cursor: pointer;
  font: inherit;
  touch-action: manipulation;
}

.topbar-link--btn:hover {
  background: var(--surface-hover);
}

.topbar-filters-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-h-lg);
  padding: 0 var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.topbar-filters-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.topbar-filters-toggle:focus-visible {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: var(--focus-ring);
}

.mobile-nav {
  display: none;
}

@media (max-width: 900px) {
  :root {
    --mobile-nav-h: calc(58px + var(--safe-bottom));
  }

  body {
    min-height: 100dvh;
    padding-bottom: var(--mobile-nav-h);
  }

  body.filters-open {
    overflow: hidden;
  }

  body.filters-open .layout {
    pointer-events: none;
  }

  body.filters-open .topbar {
    pointer-events: auto;
  }

  .topbar {
    position: sticky;
    top: 0;
    padding: calc(8px + var(--safe-top)) calc(12px + var(--safe-right)) 8px
      calc(12px + var(--safe-left));
    gap: 10px;
    background: var(--glass);
    backdrop-filter: blur(12px);
  }

  .brand h1 {
    font-size: 16px;
  }

  .tagline {
    display: none;
  }

  .topbar-filters-toggle {
    display: inline-flex;
  }

  .topbar-controls {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-soft);
  }

  body.filters-open .topbar-controls {
    display: flex;
  }

  .topbar-controls input,
  .topbar-controls select,
  .topbar-controls .toggle {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  .layout {
    display: block;
    position: relative;
    min-height: calc(100dvh - var(--mobile-nav-h) - 64px);
  }

  .map-wrap,
  .sidebar {
    position: absolute;
    inset: 0;
    min-height: 0;
  }

  .map-wrap {
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }

  .sidebar {
    z-index: 2;
    border-right: none;
    transform: translateX(100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  body[data-mobile-view="map"] .map-wrap,
  body[data-mobile-view="trip"] .map-wrap {
    opacity: 1;
    pointer-events: auto;
  }

  body[data-mobile-view="islands"] .sidebar {
    transform: translateX(0);
    pointer-events: auto;
  }

  body[data-mobile-view="map"] .sidebar,
  body[data-mobile-view="trip"] .sidebar,
  body[data-mobile-view="ask"] .sidebar {
    pointer-events: none;
  }

  body[data-mobile-view="islands"][data-island-detail="open"] .island-list,
  body[data-island-detail="open"] #island-list-section {
    display: none !important;
  }

  body[data-mobile-view="islands"][data-island-detail="open"] .island-details,
  body[data-island-detail="open"] .island-details {
    position: absolute;
    inset: 0;
    z-index: 30;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
    padding: calc(12px + var(--safe-top)) calc(12px + var(--safe-right))
      calc(16px + var(--safe-bottom)) calc(12px + var(--safe-left));
  }

  body[data-mobile-view="islands"][data-island-detail="open"] .details-toolbar {
    position: sticky;
    top: 0;
    z-index: 3;
    margin: calc(-1 * (12px + var(--safe-top))) calc(-1 * (12px + var(--safe-right))) 12px
      calc(-1 * (12px + var(--safe-left)));
    padding: calc(8px + var(--safe-top)) calc(12px + var(--safe-right)) 8px
      calc(12px + var(--safe-left));
    background: color-mix(in srgb, var(--bg-elev) 94%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }

  body[data-mobile-view="islands"][data-island-detail="open"] .back-button {
    position: static;
    margin: 0;
    min-height: 44px;
    background: transparent;
    backdrop-filter: none;
  }

  body[data-mobile-view="islands"][data-island-detail="open"] .stat-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body[data-mobile-view="islands"][data-island-detail="open"] .stat--wide {
    grid-column: 1;
  }

  body[data-mobile-view="islands"][data-island-detail="open"] .details-title {
    font-size: 24px;
    line-height: 1.2;
  }

  body[data-mobile-view="islands"][data-island-detail="open"] .details-subtitle {
    font-size: 15px;
    line-height: 1.45;
  }

  .legend-wrap {
    bottom: calc(12px + var(--mobile-nav-h) + 8px);
    left: calc(12px + var(--safe-left));
    right: auto;
    max-width: calc(100% - 24px);
  }

  .legend-wrap:not([open]) .legend {
    display: none;
  }

  .legend {
    font-size: 11px;
  }

  .map-island-peek {
    bottom: calc(12px + var(--mobile-nav-h) + 8px);
  }

  body[data-mobile-view="islands"][data-island-detail="open"] .details-hero {
    margin-left: calc(-1 * (12px + var(--safe-left)));
    margin-right: calc(-1 * (12px + var(--safe-right)));
    width: calc(100% + 24px + var(--safe-left) + var(--safe-right));
  }

  body[data-mobile-view="islands"][data-island-detail="open"] .details-hero .hero-img {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .chat-launcher {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-1);
    padding: var(--space-2) calc(var(--space-2) + var(--safe-right))
      calc(var(--space-2) + var(--safe-bottom)) calc(var(--space-2) + var(--safe-left));
    background: color-mix(in srgb, var(--bg-elev) 96%, transparent);
    border-top: 1px solid var(--border-subtle);
    backdrop-filter: blur(16px) saturate(1.1);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.28);
  }

  .mobile-nav__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    min-height: 52px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    transition:
      background-color var(--transition-fast),
      color var(--transition-fast);
  }

  .mobile-nav__btn.is-active {
    background: var(--accent-muted);
    color: var(--accent);
    position: relative;
  }

  .mobile-nav__btn.is-active::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    border-radius: 999px;
    background: var(--accent);
  }

  .mobile-nav__icon {
    font-size: 18px;
    line-height: 1;
  }

  .back-button {
    min-height: 44px;
    font-size: 15px;
  }

  .island-card {
    min-height: 88px;
  }
}

/* ---------- Chatbot ---------- */

.chat-launcher {
  position: fixed;
  right: var(--space-5);
  bottom: calc(var(--space-5) + var(--mobile-nav-h));
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-h-lg);
  padding: 0 var(--space-5);
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-border);
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent) 18%, var(--bg-elev)),
    var(--surface-card)
  );
  color: var(--text);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-med),
    border-color var(--transition-fast);
}

.chat-launcher:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.chat-launcher:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), var(--shadow);
}
.chat-launcher__icon {
  font-size: 16px;
  line-height: 1;
}
.chat-launcher.is-hidden {
  display: none;
}

.chat-panel {
  position: fixed;
  right: var(--space-5);
  bottom: calc(var(--space-5) + var(--mobile-nav-h));
  width: min(420px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 80px));
  display: none;
  flex-direction: column;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 1100;
}
.chat-panel.is-open {
  display: flex;
}

.chat-panel__header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  position: relative;
  background: linear-gradient(180deg, rgba(78, 163, 255, 0.12), transparent);
}
.chat-panel__header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.chat-panel__sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
.chat-panel__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.chat-panel__close:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.chat-panel__ai-btn {
  position: absolute;
  top: 10px;
  right: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  height: 26px;
}
.chat-panel__ai-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.chat-panel__ai-btn.is-on {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.chat-panel__ai-btn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
}
.chat-panel__ai-btn.is-on .chat-panel__ai-btn-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.chat-settings {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px 14px;
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
}
.chat-settings[hidden] {
  display: none;
}
.chat-settings__row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-settings__row label {
  flex: 0 0 70px;
  color: var(--text-soft);
  font-weight: 500;
}
.chat-settings__row select,
.chat-settings__row input {
  flex: 1;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
}

.chat-settings__keyrow {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
}
.chat-settings__keyrow label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--text);
}
.chat-settings__keyrow strong {
  color: var(--text);
  font-weight: 700;
}
.chat-settings__keyrow a {
  color: var(--accent);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}
.chat-settings__keyrow a:hover {
  text-decoration: underline;
}
.chat-settings__keyrow input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.chat-settings__row--toggle {
  justify-content: space-between;
}
.chat-settings__switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.chat-settings__switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.chat-settings__switch-track {
  width: 32px;
  height: 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  position: relative;
  transition: background 0.18s ease;
}
.chat-settings__switch-track::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-soft);
  transition: transform 0.18s ease, background 0.18s ease;
}
.chat-settings__switch input:checked + .chat-settings__switch-track {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.chat-settings__switch input:checked + .chat-settings__switch-track::after {
  transform: translateX(14px);
  background: var(--accent);
}
.chat-settings__switch-label {
  font-weight: 600;
  color: var(--text);
}
.chat-settings__note {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
}
.chat-settings__actions {
  display: flex;
  gap: 8px;
}
.chat-settings__actions button {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.chat-settings__actions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.chat-settings__danger:hover {
  border-color: #f5b04a !important;
  color: #f5b04a !important;
}
.chat-settings__status {
  margin: 0;
  font-size: 11px;
  min-height: 14px;
  color: var(--text-muted);
}
.chat-settings__status.is-ok {
  color: #6cd3a3;
}
.chat-settings__status.is-err {
  color: #f5b04a;
}

.chat-msg__badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.chat-msg__list {
  margin: 6px 0 4px;
  padding-left: 18px;
  list-style: disc;
}

.chat-msg__list li {
  margin: 2px 0;
}

.chat-msg--bot strong {
  font-weight: 600;
}

.chat-msg--bot em {
  font-style: italic;
}

.chat-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.chat-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  word-wrap: break-word;
}
.chat-msg--user {
  align-self: flex-end;
  background: var(--accent);
  color: #0a1320;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.chat-msg--bot {
  align-self: flex-start;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-msg--system {
  align-self: center;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  max-width: 100%;
  padding: 4px 8px;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chat-suggestions button {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-soft);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.chat-suggestions button:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.chat-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.chat-result {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  color: inherit;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.chat-result:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.chat-result__thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background-color: var(--bg-soft);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.chat-result__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
}
.chat-result__body strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-result__meta {
  display: block;
  color: var(--text-muted);
  font-size: 11.5px;
  margin-top: 2px;
}
.chat-result__source {
  display: inline-block;
  margin-top: 4px;
  color: var(--accent);
  text-decoration: none;
  font-size: 11px;
}
.chat-result__source:hover {
  text-decoration: underline;
}

.chat-result__causeway {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.chat-result__ferries {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.chat-ferry-snippet {
  font-size: 11px;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
  line-height: 1.35;
}

.chat-result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chat-result__map-btn,
.chat-result__detail-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
}

.chat-result__map-btn:hover,
.chat-result__detail-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chat-panel__form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.chat-panel__form input {
  flex: 1;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
}
.chat-panel__form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.chat-panel__form button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #0a1320;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.chat-panel__form button:hover {
  background: #7ec4ff;
}

@media (max-width: 900px) {
  .chat-panel {
    right: 0;
    left: 0;
    bottom: var(--mobile-nav-h);
    width: auto;
    height: calc(100dvh - var(--mobile-nav-h) - 56px);
    border-radius: 16px 16px 0 0;
  }

  body[data-mobile-view="ask"] .chat-panel {
    display: flex;
  }

  body[data-mobile-view="ask"] .map-wrap {
    opacity: 0;
    pointer-events: none;
  }

  .chat-panel__form input,
  .chat-panel__form button {
    min-height: 44px;
  }
}


/* ===== P0b enrichment detail blocks ===== */
.stat-meta {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.enrichment-attribution {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
}

.population-detail {
  margin-top: 8px;
  font-size: 13px;
}

.population-detail summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

.population-detail__grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 8px 0 0;
}

.population-detail__grid dt {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.population-detail__grid dd {
  margin: 0;
  font-weight: 600;
}

.hills-on {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.hills-on__title {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.hills-on__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hills-on__list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.hill-name {
  font-weight: 600;
}

.hill-class {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.hill-class-munro {
  color: #f4d35e;
  border-color: rgba(244, 211, 94, 0.45);
  background: rgba(244, 211, 94, 0.12);
}

.hill-class-corbett,
.hill-class-graham,
.hill-class-donald {
  color: var(--lake);
  border-color: rgba(108, 211, 163, 0.45);
  background: rgba(108, 211, 163, 0.1);
}

.hill-class-marilyn,
.hill-class-hump,
.hill-class-hewitt {
  color: var(--accent);
  border-color: rgba(78, 163, 255, 0.35);
  background: rgba(78, 163, 255, 0.1);
}

.hill-ele {
  color: var(--text-muted);
  font-size: 12px;
}

.hills-on__more {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.lighthouses__nav-warning {
  font-size: 12px;
  color: var(--river);
  background: rgba(255, 180, 120, 0.08);
  border: 1px solid rgba(255, 180, 120, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0 0 10px;
}

.lighthouses__subtitle,
.reserves-wildlife__subtitle {
  margin: 10px 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.lighthouse,
.reserve {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.lighthouse:last-child,
.reserve:last-child {
  border-bottom: none;
}

.lighthouse__name,
.reserve__name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.lighthouse-meta,
.reserve__meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-soft);
}

.lighthouse__links {
  margin: 4px 0 0;
  font-size: 12px;
}

.wildlife-colonies__note {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.wildlife-colonies__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.colony-species {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.colony-species-scheduled {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--river);
  margin-left: 4px;
}

.colony-species-season {
  color: var(--text-muted);
  font-size: 11px;
}

/* ===== Ferry "How to get there" block ===== */
.ferry-section {
  /* Use the same .section class spacing; this is just extra scoping. */
}
.ferry-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ferry-section h3::before {
  content: "⛴";
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
}
.ferry-subtitle {
  color: var(--text-soft);
  font-size: 13px;
  margin: -4px 0 12px;
}
.ferry-disclosure {
  color: var(--text-muted);
  font-size: 11px;
  margin: 14px 0 0;
  padding: 8px 10px;
  border-left: 2px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 6px 6px 0;
}
.ferry-loading {
  color: var(--text-muted);
  font-size: 13px;
  padding: 10px 0;
}
.ferry-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ferry-card-list--scrollable {
  max-height: 26rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
  scrollbar-gutter: stable;
}
.ferry-card-list__scroll-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
.ferry-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ferry-card__header {
  display: flex;
  gap: 12px;
  align-items: center;
}
.ferry-card__logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-elev);
}
.ferry-card__logo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  border: 1px solid var(--border);
}
.ferry-card__title {
  flex: 1;
  min-width: 0;
}
.ferry-card__op {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ferry-card__route {
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1px;
}
.ferry-card__route [aria-hidden="true"] {
  color: var(--accent);
  margin: 0 4px;
}
.ferry-card__meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ferry-card__meta li {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--text-soft);
}
.ferry-card__notes {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
}
.ferry-card__schedule {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  word-break: break-all;
}
.ferry-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ferry-card__book {
  background: var(--accent);
  color: #0a1320;
  font-weight: 600;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
}
.ferry-card__book:hover {
  background: #7ec4ff;
}
.ferry-card__affiliate {
  color: var(--text-soft);
  font-size: 12px;
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px dashed var(--border);
}
.ferry-card__affiliate:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.ferry-card__aff-tag {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 2px;
}
.ferry-card__aff-meta {
  font-size: 10px;
  color: var(--text-muted);
}
.ferry-card__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}
.ferry-card__foot a {
  color: var(--text-muted);
  text-decoration: none;
}
.ferry-card__foot a:hover {
  color: var(--accent);
}
.ferry-card__verified {
  white-space: nowrap;
}
/* ===== Sidebar list ⛴ icon for ferry-accessible islands ===== */
.island-card__ferry-icon {
  display: inline-block;
  margin-left: 6px;
  color: var(--accent);
  font-size: 12px;
  vertical-align: 0;
  opacity: 0.85;
}
.island-card--for-sale {
  border-left: 2px solid var(--for-sale-ring);
  background: linear-gradient(
    90deg,
    var(--for-sale-soft) 0%,
    transparent 48%
  );
}
.island-card__sale-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--for-sale);
  background: var(--for-sale-soft);
  border: 1px solid var(--for-sale-ring);
  border-radius: 4px;
  vertical-align: middle;
}
.island-card__listing-link {
  flex-shrink: 0;
  align-self: center;
  margin-right: 4px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  color: var(--for-sale);
  background: var(--for-sale-soft);
  border-radius: 6px;
  border: 1px solid var(--for-sale-ring);
  white-space: nowrap;
}
.island-card__listing-link:hover {
  background: color-mix(in srgb, var(--for-sale-soft) 60%, var(--for-sale) 40%);
  text-decoration: none;
}
.for-sale-count {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 600;
}
.map-sale-marker {
  background: transparent;
  border: none;
}
.map-sale-marker__ring {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 1.5px solid var(--for-sale-ring);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  opacity: 0.9;
}
.map-sale-marker__badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--for-sale);
  background: color-mix(in srgb, var(--bg-elev) 72%, var(--for-sale) 28%);
  border-radius: 50%;
  border: 1px solid var(--for-sale-ring);
}
.map-sale-tooltip-wrap {
  font-size: 12px;
  line-height: 1.35;
  padding: 6px 8px;
  border: 1px solid var(--border);
}
.map-sale-tooltip__hint {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}
.marker-vis--for-sale {
  filter: drop-shadow(0 0 2px rgba(196, 160, 98, 0.35));
}
.sale-popup-wrap .leaflet-popup-content-wrapper {
  border-color: var(--border);
}
.sale-popup__title {
  margin: 0 0 6px;
  font-size: 14px;
}
.sale-popup__lead {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.sale-popup__list {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}
.sale-popup__item {
  margin-bottom: 8px;
}
.sale-popup__link {
  display: block;
  font-weight: 600;
  color: var(--for-sale);
  margin-bottom: 2px;
  padding: 8px 0;
  min-height: 44px;
  line-height: 1.35;
}
.sale-popup__meta {
  font-size: 11px;
  color: var(--text-muted);
}
.sale-popup__atlas-btn {
  width: 100%;
  margin-top: 4px;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
}
.sale-popup__atlas-btn:hover {
  border-color: var(--accent);
}
.dot--for-sale {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  font-size: 9px;
  font-weight: 600;
  font-style: normal;
  color: var(--for-sale);
  background: color-mix(in srgb, var(--bg-elev) 72%, var(--for-sale) 28%);
  border-radius: 50%;
  border: 1px solid var(--for-sale-ring);
}
.property-listings-section {
  margin-top: 0.5rem;
}
.property-listings__lead,
.property-listings__disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0 0 0.75rem;
}
.property-listing-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.property-listing {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: var(--surface-elevated, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}
.property-listing__link {
  display: block;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 0.25rem;
}
.property-listing__link:hover {
  text-decoration: underline;
}
.property-listing__meta {
  font-size: 12px;
  color: var(--text-muted);
}
.property-listing__source {
  text-transform: capitalize;
}
.property-listing__low {
  color: var(--river, #c9a227);
  font-weight: 700;
}
.island-card__unconfirmed {
  display: inline-block;
  margin-left: 4px;
  min-width: 1.1em;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--river);
  border: 1px solid rgba(245, 176, 74, 0.45);
  border-radius: 4px;
  padding: 0 4px;
  line-height: 1.2;
  vertical-align: 0.1em;
}
.ferry-card__local-name {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 13px;
  font-style: italic;
}
.ferry-card__drive {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ferry-card__drive-pill {
  background: rgba(78, 163, 255, 0.10);
  color: var(--accent);
  border: 1px solid rgba(78, 163, 255, 0.25);
  border-radius: 999px;
  font-size: 11px;
  padding: 3px 8px;
}

/* ===== Tidal / causeway block ===== */
.causeway-card {
  background: rgba(245, 176, 74, 0.10);
  border: 1px solid rgba(245, 176, 74, 0.30);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  color: var(--text);
}
.causeway-card__header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.causeway-card__icon {
  font-size: 22px;
  color: var(--river);
  line-height: 1;
}
.causeway-card__type {
  font-weight: 700;
  font-size: 13px;
  color: var(--river);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.causeway-card__summary {
  font-size: 14px;
  color: var(--text);
  margin-top: 2px;
}
.causeway-card__window {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-soft);
}
.causeway-card__warning {
  margin: 6px 0 0;
  font-size: 12px;
  color: #ffd09b;
  background: rgba(245, 176, 74, 0.10);
  padding: 6px 8px;
  border-radius: 6px;
  border-left: 2px solid var(--river);
}
.causeway-card__source {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}
.causeway-card__source:hover {
  text-decoration: underline;
}

/* ===== Itinerary banner ===== */
.itinerary-banner {
  position: relative;
  z-index: 1101;
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text);
}
.itinerary-banner strong {
  color: var(--accent);
}
.itinerary-banner__stops a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent);
  cursor: pointer;
}
.itinerary-banner__stops a:hover {
  background: var(--accent-soft);
}
.itinerary-banner__unknown {
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.itinerary-banner__arrow {
  color: var(--accent);
  margin: 0 4px;
}
.itinerary-banner__meta {
  color: var(--text-muted);
  font-size: 12px;
}
.itinerary-banner__close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 2px 8px;
}
.itinerary-banner__close:hover {
  color: var(--text);
}

/* ===== Map marker hit targets (transparent div icons; no canvas black rings) ===== */
.leaflet-div-icon.map-marker-hit {
  background: transparent !important;
  border: none !important;
}

.map-marker-hit__target {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* ===== Trip planner (map overlay) ===== */
.marker-hit {
  cursor: pointer;
}

.ferry-freshness {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted, #8fa3b8);
}

/* In sidebar list column (not a map overlay). Was position:absolute and escaped onto the map. */
.trip-planner {
  flex-shrink: 0;
  margin: 0 12px 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  box-shadow: none;
}

.trip-planner__title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.trip-planner__form {
  display: grid;
  gap: 8px;
}

.trip-planner__field {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.trip-planner__field input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

.trip-planner__submit {
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.trip-planner__submit:hover {
  filter: brightness(1.05);
}

.trip-planner__status {
  margin: 8px 0 0;
  min-height: 1.2em;
  font-size: 11px;
  color: var(--text-muted);
}
.ferry-card__stale {
  color: var(--river);
  background: rgba(245, 176, 74, 0.10);
  border: 1px solid rgba(245, 176, 74, 0.30);
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 600;
}

/* ===== UX polish (loading, empty states, hierarchy) ===== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 10000;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #0a1320;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 8px;
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px) saturate(1.1);
}

.app-loading[hidden] {
  display: none;
}

.app-loading__inner {
  text-align: center;
  color: var(--text-soft);
  padding: var(--space-8) var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  min-width: min(90vw, 280px);
}

.app-loading__mark {
  display: block;
  font-size: 32px;
  margin-bottom: var(--space-3);
  color: var(--accent);
  animation: app-loading-pulse 1.4s var(--ease-standard) infinite;
}

.app-loading__text {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
}

@keyframes app-loading-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-loading__mark {
    animation: none;
  }
}

.sidebar-section-label {
  margin: 0;
  padding: 8px 16px 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.island-list#island-list-section {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

#island-list.island-list__items {
  flex: 1 1 auto;
  min-height: 10rem;
  overflow: hidden;
  isolation: isolate;
  contain: layout paint;
  padding: var(--space-2) var(--space-3) var(--space-4);
}

.list-virtual-inner {
  z-index: 1;
  will-change: transform;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 100%;
  min-width: min(100%, 280px);
}

.search-field input[type="search"] {
  width: 100%;
  min-height: 48px;
  padding: 0 2.5rem 0 2.25rem;
  border-radius: var(--radius-full);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
  font-size: var(--text-sm);
}

.search-field input[type="search"]:focus {
  border-color: var(--accent-border);
  box-shadow: var(--focus-ring), var(--shadow-sm);
}

.search-field__icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
}

.search-field__clear {
  position: absolute;
  right: 6px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-soft);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.search-field__clear[hidden] {
  display: none;
}

.search-field__clear:hover,
.search-field__clear:focus-visible {
  color: var(--text);
  background: var(--border);
}

.topbar-filters-toggle {
  gap: 8px;
}

.filters-toggle__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #0a1320;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.filters-toggle__badge[hidden] {
  display: none;
}

.list-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-soft);
}

.list-empty__title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.list-empty__hint {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}

.list-empty__btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--bg-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

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

.list-skeleton {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 6px 4px;
}

.list-skeleton__thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    var(--bg-soft) 0%,
    color-mix(in srgb, var(--border) 60%, var(--bg-soft)) 50%,
    var(--bg-soft) 100%
  );
  background-size: 200% 100%;
  animation: list-skeleton-shimmer 1.1s ease-in-out infinite;
}

.list-skeleton__lines {
  flex: 1;
  display: grid;
  gap: 8px;
}

.list-skeleton__lines i {
  display: block;
  height: 10px;
  border-radius: 4px;
  background: var(--bg-soft);
}

.list-skeleton__lines i:last-child {
  width: 55%;
}

@keyframes list-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .list-skeleton__thumb {
    animation: none;
  }
}

.map-hint {
  position: absolute;
  left: 50%;
  top: calc(12px + var(--safe-top));
  transform: translateX(-50%);
  z-index: 850;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: min(92%, 380px);
  padding: 10px 12px 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elev) 94%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-soft);
}

.map-hint[hidden] {
  display: none;
}

.map-hint__text {
  margin: 0;
  flex: 1;
}

.map-hint__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.map-hint__close:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.trip-planner--collapse {
  margin: 8px 12px 12px;
}

.trip-planner--collapse > summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  padding: 4px 0;
}

.trip-planner--collapse > summary::-webkit-details-marker {
  display: none;
}

.trip-planner--collapse > summary::after {
  content: " ▾";
  font-size: 11px;
  opacity: 0.7;
}

.trip-planner--collapse[open] > summary::after {
  content: " ▴";
}

.trip-planner__body {
  padding-top: 8px;
}

.crawl-links--seo {
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .map-hint {
    display: none;
  }

  .crawl-links--seo {
    max-height: 140px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: calc(var(--mobile-nav-h) + 8px);
  }
}

.stat {
  transition: border-color 0.12s ease;
}

.stat:focus-within {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.back-button {
  font-weight: 600;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-bottom) + var(--mobile-nav-h));
  transform: translateX(-50%);
  z-index: 10001;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elev) 94%, transparent);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.app-toast[hidden] {
  display: none;
}

.map-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#map:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sidebar-kbd-hint {
  display: none;
}

@media (min-width: 901px) {
  .legend-wrap {
    pointer-events: none;
  }

  .legend-wrap__toggle {
    display: none;
  }

  .legend-wrap .legend {
    display: flex !important;
    pointer-events: auto;
    margin-top: 0;
  }

  .sidebar-kbd-hint {
    display: block;
    margin: 0;
    padding: 8px 16px 12px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid var(--border);
  }

  .sidebar-kbd-hint kbd {
    display: inline-block;
    margin: 0 1px;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    font-family: inherit;
    font-size: 10px;

/* ===== Shared focus & motion (single source — no duplicate overrides) ===== */
:where(a, summary):focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

:where(button, [role="button"]):focus:not(:focus-visible) {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .island-card:hover,
  .island-card.is-active,
  .featured-card:hover,
  .chat-launcher:hover,
  .crowd-modal__btn--primary:hover,
  .favorites-modal__btn--primary:hover,
  .trip-planner__submit:hover {
    transform: none;
  }
}
