/* ============================================================================
 * WAYPOINTS — cartographic art direction
 * OS Explorer meets a 1930s Bartholomew touring map: aged paper, engraved
 * labels, inked category tones. Clean enough to scan fast.
 * ========================================================================== */

:root {
  /* Base */
  --paper:        #F4ECD8;
  --paper-deep:   #E9DEC4;
  --ink:          #3A3226;
  --ink-soft:     #6B5F4D;
  --line:         #B9824F;   /* contour / hairline accent */
  --water:        #6E8CA0;
  --cream:        #FBF6E9;

  /* Category colours — inked, paper-native */
  --c-personal:   #B23A6E;   /* madder rose */
  --c-heritage:   #B07A2B;   /* ochre / burnt sienna */
  --c-modern:     #2E7D8A;   /* teal */
  --c-nature:     #5A7D4F;   /* moss */

  --serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --mono:  ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;

  --shadow-soft: 0 2px 10px rgba(58, 50, 38, 0.18);
  --shadow-lift: 0 6px 26px rgba(58, 50, 38, 0.28);
  --radius: 4px;

  --panel-w: 380px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: var(--serif);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

#map {
  position: fixed; inset: 0;
  background: var(--paper);
  z-index: 1;
}

/* Tame Leaflet's default white-blue chrome into paper tones ---------------- */
.leaflet-container { font-family: var(--serif); background: var(--paper); }

/* Soften the Esri raster basemap (stays fully opaque — no see-through).
   Tunable: saturate = colour intensity (mutes green/blue), brightness =
   lightness (lightens water + gray land), sepia = warmth toward the paper tone.
   Raster tiles can't be recoloured per-feature, so this is a global wash. */
.leaflet-tile-pane { filter: saturate(0.86) brightness(1.02) sepia(0.03); }
.leaflet-bar a,
.leaflet-bar a:hover {
  background: var(--cream); color: var(--ink);
  border-bottom-color: rgba(58,50,38,0.15);
}
.leaflet-bar { border: 1px solid rgba(58,50,38,0.25); box-shadow: var(--shadow-soft); }
.leaflet-control-attribution {
  background: rgba(251,246,233,0.78) !important;
  color: var(--ink-soft); font-size: 10px;
}
.leaflet-control-attribution a { color: var(--line); }

/* Engraved scale bar */
.leaflet-control-scale-line {
  background: rgba(251,246,233,0.78);
  border: 1px solid var(--ink-soft); border-top: none;
  color: var(--ink); font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.04em; padding: 1px 6px;
}

/* ----------------------------- Overlays ---------------------------------- */
/* Paper grain — a faint fibrous texture over the whole surface */
.paper-grain {
  position: fixed; inset: 0; z-index: 400;
  pointer-events: none; opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* Soft edge vignette */
.map-vignette {
  position: fixed; inset: 0; z-index: 401; pointer-events: none;
  box-shadow: inset 0 0 160px 30px rgba(58, 50, 38, 0.22);
}

/* ----------------------------- Masthead ---------------------------------- */
/* Top-left group: title/tagline + flag strip on one row */
.top-left {
  position: fixed; top: 14px; left: 16px; z-index: 600;
  display: flex; align-items: center; gap: 14px;
  max-width: calc(100vw - 32px);
}
.masthead { pointer-events: none; flex: 0 0 auto; position: relative; }
/* soft light-gray scrim behind the title/tagline so they stay legible over the map */
.masthead::before {
  content: ''; position: absolute; left: -20px; top: -16px;
  width: 400px; height: 152px; z-index: 0; pointer-events: none;
  background: radial-gradient(250px 114px at 140px 60px,
    rgba(245,245,245,0.80) 0%, rgba(245,245,245,0.56) 48%, rgba(245,245,245,0) 82%);
}
.masthead h1, .masthead__sub { position: relative; z-index: 1; }
.masthead h1 {
  margin: 0; font-weight: 500; font-size: 30px; line-height: 1; letter-spacing: 0.02em;
  color: var(--ink);
  text-shadow: 0 1px 0 var(--cream), 0 0 14px rgba(244,236,216,0.9);
}
.masthead__sub {
  margin: 3px 0 0; font-size: 11px; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--ink-soft);
  text-shadow: 0 1px 0 var(--cream);
}

/* ------------------------- Flag strip (region filter) -------------------- */
.region-control {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 601;
  display: flex; gap: 0; flex-wrap: nowrap; align-items: stretch;
  background: var(--cream); border: 1px solid rgba(58,50,38,0.30);
  border-radius: var(--radius);
  box-shadow: 0 0 10px 2px rgba(245,245,245,0.85), var(--shadow-soft);
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
  max-width: calc(100vw - 32px);
}
.region-control::-webkit-scrollbar { display: none; }
.rc-active, .rc-ghosts { display: flex; }
/* inactive/other-country flags collapse into a sliding accordion */
.rc-ghosts { max-width: 0; overflow: hidden; transition: max-width 0.32s ease; }
.region-control.ghosts-open .rc-ghosts { max-width: 320px; }
.rc-toggle {
  appearance: none; border: none; background: transparent; cursor: pointer;
  padding: 0 8px; display: flex; align-items: center; flex: 0 0 auto;
  border-left: 1px solid rgba(58,50,38,0.14); color: var(--ink-soft);
}
.rc-toggle:hover { color: var(--ink); }
.rc-arrow { font-size: 17px; line-height: 1; display: inline-block; transition: transform 0.25s; }
.region-control.ghosts-open .rc-arrow { transform: rotate(90deg); }
.region-control button {
  appearance: none; border: none; background: transparent;
  padding: 6px 8px; cursor: pointer; line-height: 0; flex: 0 0 auto;
  border-right: 1px solid rgba(58,50,38,0.14);
  transition: background 0.15s;
}
.rc-ghosts button:last-child, .rc-active button:last-child { border-right: none; }
/* uniform container: every flag in an equal 24×16 box, original aspect (no stretch) */
.region-control button img {
  width: 24px; height: 16px; object-fit: contain; display: block; border-radius: 2px;
  opacity: 0.55; transition: opacity 0.15s, filter 0.15s;
}
.region-control button:hover img { opacity: 0.9; }
.region-control button.is-active { background: var(--paper-deep); }
.region-control button.is-active img { opacity: 1; }
/* ghosted (non-target countries that have pins): dim, still clickable */
.region-control button.is-ghost img { filter: grayscale(1); opacity: 0.3; }
.region-control button.is-ghost:hover img { opacity: 0.55; }
.region-control button.is-ghost.is-active img { filter: grayscale(0.3); opacity: 0.85; }
.region-control .rc-mono {
  display: inline-block; font: 600 9px/16px var(--serif); letter-spacing: 0.04em;
  color: var(--ink-soft); height: 16px; min-width: 22px; text-align: center;
  border: 1px solid rgba(58,50,38,0.25); border-radius: 2px; opacity: 0.4;
}
.region-control button.is-active .rc-mono { opacity: 1; }

/* ------------------------------ Legend ----------------------------------- */
/* Bottom-left row: legend (KEY) with the Add button to its right */
.lower-left {
  position: fixed; left: 16px; bottom: 22px; z-index: 600;
  display: flex; flex-direction: row; align-items: flex-end; gap: 12px;
}

.legend {
  width: 172px; flex: 0 0 auto; background: var(--cream);
  max-height: calc(100vh - 200px); overflow-y: auto;
  border: 1px solid rgba(58,50,38,0.30); border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 9px 11px 11px;
  outline: 1px solid rgba(58,50,38,0.18); outline-offset: 3px;
}
.legend__title {
  font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ink); margin: 0 0 7px; text-align: center;
  border-bottom: 1px solid rgba(58,50,38,0.20); padding-bottom: 6px;
}
/* group = items column + a heading rotated CCW down the right edge */
.legend__group { display: flex; align-items: stretch; gap: 6px; }
.legend__group + .legend__group { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(58,50,38,0.12); }
.legend__items { flex: 1 1 auto; min-width: 0; }
.legend__heading {
  writing-mode: vertical-rl; transform: rotate(180deg);
  flex: 0 0 auto; align-self: stretch; text-align: center;
  font-size: 8.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-soft);
  padding: 1px 1px; border-left: 1px solid rgba(58,50,38,0.16);
}
.legend__item {
  display: flex; align-items: center; gap: 7px; width: 100%;
  appearance: none; border: none; background: transparent;
  font-family: var(--serif); font-size: 11px; color: var(--ink);
  padding: 1.5px 2px; cursor: pointer; text-align: left;
  border-radius: 3px; transition: background 0.12s, opacity 0.12s;
}
.legend__item:hover { background: var(--paper-deep); }
.legend__item.is-off { opacity: 0.38; }
.legend__swatch {
  width: 11px; height: 11px; border-radius: 50%;
  border: 1.5px solid var(--cream); box-shadow: 0 0 0 1px rgba(58,50,38,0.35);
  flex: 0 0 auto;
}
.legend__glyph {
  width: 15px; text-align: center; flex: 0 0 auto;
  color: var(--ink-soft);
}
.legend__glyph svg { width: 13px; height: 13px; fill: currentColor; vertical-align: middle; }

/* ------------------------------ Markers ---------------------------------- */
.wp-marker { display: block; }
.wp-marker__disc {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.wp-marker__disc svg { fill: var(--cream); }

/* Signature: filled survey-marker disc, cream ring, glyph, drop shadow */
.wp-marker--signature .wp-marker__disc {
  width: 30px; height: 30px;
  border: 2px solid var(--cream);
  box-shadow: var(--shadow-soft), 0 0 0 1px rgba(58,50,38,0.30);
}
.wp-marker--signature .wp-marker__disc svg { width: 16px; height: 16px; }

/* Standard: smaller, muted, hollow — recedes into the paper, brightens on hover */
.wp-marker--standard .wp-marker__disc {
  width: 18px; height: 18px; opacity: 0.62;
  border: 2px solid var(--cream);
  background: transparent !important;
  box-shadow: 0 0 0 1px rgba(58,50,38,0.30);
}
.wp-marker--standard .wp-marker__disc svg { display: none; }
.wp-marker--standard .wp-marker__disc::after {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.wp-marker:hover .wp-marker__disc { transform: scale(1.18); opacity: 1; }
.wp-marker--done .wp-marker__disc { filter: grayscale(0.6); }

/* Marker clusters — paper-toned bubbles */
.wp-cluster {
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); font-family: var(--serif); font-weight: 500;
  box-shadow: var(--shadow-soft);
}
.wp-cluster div { font-size: 13px; }

/* Compass rose — sits under the zoom control, clear of scale + attribution */
.compass {
  position: fixed; right: 14px; top: 96px; z-index: 600;
  width: 62px; height: 62px; opacity: 0.85; pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(58,50,38,0.3));
}
.compass svg { width: 100%; height: 100%; }

/* ------------------------------ Panel ------------------------------------ */
.panel {
  position: fixed; top: 0; right: 0; height: 100%; width: var(--panel-w);
  max-width: 92vw; z-index: 1000;
  background: var(--cream); color: var(--ink);
  border-left: 1px solid rgba(58,50,38,0.30);
  box-shadow: var(--shadow-lift);
  transform: translateX(105%); transition: transform 0.32s cubic-bezier(.22,.61,.36,1);
  overflow-y: auto; overscroll-behavior: contain;
}
.panel.is-open { transform: translateX(0); }
.panel__handle { display: none; }
.panel__close {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  appearance: none; border: none; background: rgba(244,236,216,0.7);
  color: var(--ink); font-size: 24px; line-height: 1;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  transition: background 0.15s;
}
.panel__close:hover { background: var(--paper-deep); }
.panel__backdrop {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(58,50,38,0.28); opacity: 0;
  transition: opacity 0.3s; pointer-events: none;
}
.panel__backdrop.is-open { opacity: 1; pointer-events: auto; }

/* Panel content */
.panel__body { padding: 0 0 28px; }
.p-thumb { width: 100%; height: 200px; object-fit: cover; display: block;
  background: var(--paper-deep); border-bottom: 1px solid rgba(58,50,38,0.2); }
.p-thumb-strip { display: flex; gap: 0; }
.p-thumb-strip .p-thumb { height: 130px; }
.p-pad { padding: 16px 20px 0; }
.p-breadcrumb {
  font-size: 10px; letter-spacing: 0.20em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 6px;
}
.p-name { font-size: 23px; font-weight: 500; line-height: 1.2; margin: 0 0 10px; }
.p-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.p-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; letter-spacing: 0.04em; padding: 3px 9px;
  border-radius: 999px; border: 1px solid currentColor;
  background: transparent;
}
.p-chip svg { width: 12px; height: 12px; fill: currentColor; }
.p-chip--cat { color: var(--cream); border-color: transparent; }
.p-status {
  display: inline-block; font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-soft);
  border: 1px solid rgba(58,50,38,0.25); border-radius: 3px;
  padding: 2px 7px; margin-left: 4px;
}
.p-blurb { font-size: 15px; line-height: 1.5; color: var(--ink); margin: 0 0 16px; }
.p-row {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 13px; padding: 9px 0; border-top: 1px solid rgba(58,50,38,0.14);
}
.p-row__label {
  flex: 0 0 78px; font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-soft);
}
.p-coords { font-family: var(--mono); font-size: 13px; cursor: pointer;
  border-bottom: 1px dashed var(--ink-soft); }
.p-coords.copied { color: var(--c-nature); border-color: var(--c-nature); }
.p-link { color: var(--water); text-decoration: none; border-bottom: 1px solid currentColor; }
.p-link:hover { color: var(--ink); }
.p-flag {
  margin: 14px 20px 0; font-size: 11px; line-height: 1.45;
  color: var(--ink-soft); background: rgba(178,58,110,0.08);
  border-left: 2px solid var(--c-personal); padding: 8px 10px; border-radius: 0 3px 3px 0;
}

/* Food & drink regional sidebar */
.p-food {
  margin: 16px 20px 0; padding: 12px 14px;
  background: var(--paper); border: 1px solid rgba(58,50,38,0.18); border-radius: var(--radius);
}
.p-food__title { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 8px; }
.p-food__list { font-size: 13px; line-height: 1.6; margin: 0; color: var(--ink); }

/* Nested pins: "Part of" link + "Inside (N)" list */
.p-partof { font-size: 13px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid rgba(58,50,38,0.14); }
.p-inside { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(58,50,38,0.14); }
.p-inside__title { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 8px; }
.p-inside__item { display: flex; align-items: center; gap: 9px; padding: 5px 4px; border-radius: 4px;
  color: var(--ink); text-decoration: none; font-size: 14px; }
.p-inside__item:hover { background: var(--paper-deep); }
.p-inside__item img { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; flex: 0 0 auto; background: var(--paper-deep); }
.p-inside__dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; margin: 0 11px; box-shadow: 0 0 0 1px rgba(58,50,38,0.3); }

/* Flag-as-duplicate (remove) — lower-right of the panel */
.p-dup {
  display: block; margin: 18px 20px 8px auto;
  appearance: none; background: transparent; border: 1px solid rgba(178,58,110,0.45);
  color: var(--c-personal); font-family: var(--serif); font-size: 11px; letter-spacing: 0.06em;
  padding: 6px 12px; border-radius: 5px; cursor: pointer; transition: background 0.15s;
}
.p-dup:hover { background: rgba(178,58,110,0.10); }

/* --------------------- Add-waypoint button (corner brackets) ------------- */
.add-waypoint {
  width: 132px; height: 132px; position: relative;
  background: rgba(255, 255, 255, 0.6); border: none; cursor: pointer;
  color: var(--ink-soft); transition: color 0.15s, background 0.15s;
  border-radius: 6px;
}
.add-waypoint:hover { color: var(--line); background: rgba(251, 246, 233, 0.35); }
.add-waypoint.is-over { color: var(--line); background: rgba(185, 130, 79, 0.14); }

/* Quick-drop toast (auto-submit feedback, shown without the modal) */
.aw-toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%) translateY(-8px);
  z-index: 1200; background: var(--ink); color: var(--cream);
  font-family: var(--serif); font-size: 13px; letter-spacing: 0.02em;
  padding: 9px 16px; border-radius: 6px; box-shadow: var(--shadow-lift);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; max-width: 80vw;
}
.aw-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.aw-toast.is-error { background: var(--c-personal); }
.add-waypoint .aw-frame { position: absolute; inset: 0; width: 100%; height: 100%;
  filter: drop-shadow(0 1px 1px rgba(58,50,38,0.25)); }
.add-waypoint .aw-corners { fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: round; }
.add-waypoint .aw-plus   { fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: round; }
.add-waypoint .aw-lbl {
  position: absolute; left: 0; right: 0; text-align: center;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink);
  text-shadow: 0 1px 0 var(--cream);
}
.add-waypoint .aw-lbl--top    { top: 6%;  bottom: 60%; }   /* above the plus */
.add-waypoint .aw-lbl--bottom { top: 60%; bottom: 6%;  }   /* below the plus */

/* ------------------------------ Add modal -------------------------------- */
.aw-modal-backdrop {
  position: fixed; inset: 0; z-index: 1100; background: rgba(58,50,38,0.34);
}
.aw-modal {
  position: fixed; z-index: 1101; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 460px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
  background: var(--cream); color: var(--ink);
  border: 1px solid rgba(58,50,38,0.3); border-radius: 8px;
  box-shadow: var(--shadow-lift); padding: 24px 24px 22px;
  outline: 1px solid rgba(58,50,38,0.16); outline-offset: 4px;
}
.aw-close {
  position: absolute; top: 10px; right: 12px; appearance: none; border: none;
  background: transparent; font-size: 26px; line-height: 1; color: var(--ink-soft);
  cursor: pointer; width: 32px; height: 32px; border-radius: 50%;
}
.aw-close:hover { background: var(--paper-deep); color: var(--ink); }
.aw-h { margin: 0 0 4px; font-weight: 500; font-size: 22px; }
.aw-sub { margin: 0 0 16px; font-size: 13px; color: var(--ink-soft); line-height: 1.45; }
.aw-drop {
  border: 1.5px dashed rgba(58,50,38,0.4); border-radius: 6px;
  background: var(--paper); padding: 22px 16px; text-align: center; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.aw-drop:hover, .aw-drop.is-over { background: var(--paper-deep); border-color: var(--c-personal); }
.aw-drop-icon { display: block; font-size: 26px; color: var(--ink-soft); margin-bottom: 6px; }
.aw-drop-text { font-size: 13px; color: var(--ink-soft); }
.aw-drop img { max-height: 140px; max-width: 100%; border-radius: 4px; display: block; margin: 0 auto; }
.aw-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--ink-soft); font-size: 12px; }
.aw-or::before, .aw-or::after { content: ''; flex: 1; height: 1px; background: rgba(58,50,38,0.18); }
.aw-text, .aw-key {
  width: 100%; box-sizing: border-box; font-family: var(--serif); font-size: 14px;
  color: var(--ink); background: var(--paper); border: 1px solid rgba(58,50,38,0.3);
  border-radius: 5px; padding: 10px 12px; resize: vertical;
}
.aw-text:focus, .aw-key:focus { outline: none; border-color: var(--c-personal); }
.aw-key { margin-top: 10px; }
.aw-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.aw-btn {
  appearance: none; font-family: var(--serif); font-size: 13px; letter-spacing: 0.04em;
  padding: 9px 16px; border-radius: 5px; cursor: pointer; border: 1px solid transparent;
  transition: background 0.15s, opacity 0.15s;
}
.aw-btn--ghost { background: transparent; border-color: rgba(58,50,38,0.3); color: var(--ink); }
.aw-btn--ghost:hover { background: var(--paper-deep); }
.aw-btn--primary { background: var(--ink); color: var(--cream); }
.aw-btn--primary:hover { background: #2c261d; }
.aw-btn[disabled] { opacity: 0.5; cursor: default; }
.aw-status { margin: 10px 0 0; font-size: 12px; color: var(--ink-soft); min-height: 16px; }
.aw-status.is-error { color: var(--c-personal); }

/* preview card */
.aw-preview img { width: 100%; max-height: 200px; object-fit: cover; border-radius: 5px;
  border: 1px solid rgba(58,50,38,0.2); margin-bottom: 12px; background: var(--paper-deep); }
.aw-pv-name { font-size: 19px; font-weight: 500; margin: 0 0 4px; }
.aw-pv-crumb { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 10px; }
.aw-pv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.aw-pv-chip { font-size: 11px; padding: 3px 9px; border-radius: 999px; color: var(--cream); }
.aw-pv-chip--out { color: var(--ink); border: 1px solid rgba(58,50,38,0.3); }
.aw-pv-blurb { font-size: 14px; line-height: 1.5; margin: 0 0 10px; }
.aw-pv-coords { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }

/* Tablet & down: drop the title/tagline; the flag strip stands alone top-left */
@media (max-width: 1024px) {
  .masthead { display: none; }
}

/* ------------------------------ Mobile ----------------------------------- */
@media (max-width: 640px) {
  .add-waypoint { width: 96px; height: 96px; }
  .add-waypoint .aw-lbl { font-size: 9px; letter-spacing: 0.12em; }
  .legend { width: 150px; font-size: 12px; }
  .compass { width: 44px; height: 44px; bottom: auto; top: 64px; right: 12px; }

  /* Panel becomes a bottom sheet */
  .panel {
    top: auto; bottom: 0; right: 0; left: 0;
    width: 100%; max-width: 100%; height: 78vh;
    border-left: none; border-top: 1px solid rgba(58,50,38,0.3);
    border-radius: 16px 16px 0 0;
    transform: translateY(105%);
  }
  .panel.is-open { transform: translateY(0); }
  .panel__handle {
    display: block; width: 42px; height: 5px; border-radius: 3px;
    background: rgba(58,50,38,0.25); margin: 8px auto 2px;
  }
  .panel__close { top: 8px; right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .panel, .panel__backdrop, .wp-marker__disc { transition: none; }
}
