/* ═══════════════════════════════════════════════════════════════════════════
   Neretva – design system
   warm editorial "paper field guide": paper ground, ink type, clay accent.
   Tailwind handles layout; this file owns tokens, components and the map.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Self-hosted, so opening a page makes no request to Google (GDPR) and the
   first paint does not wait on a third-party connection. Latin + Latin Extended
   cover English, German, Croatian, Italian and the rest of the app's names. */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/fraunces-latin.069cb90e11a3.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/fraunces-latin-ext.a04d353989ad.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/inter-latin.260c81a4759b.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/inter-latin-ext.1ad231aac0a8.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper:      #F4EFE6;
  --paper-2:    #EFE8DB;
  --paper-3:    #E5DCCB;
  --card:       #FBF8F2;
  --ink:        #17140F;
  --muted:      #6E6555;
  --rule:       #DED6C6;
  --rule-soft:  #E9E1D2;
  --clay:       #B4462A;
  --clay-2:     #8F3520;
  --clay-soft:  #F3DED5;
  --sage:       #62705A;
  --danger:     #A33227;

  --shadow-sm: 0 1px 2px rgba(23, 20, 15, .06);
  --shadow-md: 0 20px 44px -32px rgba(23, 20, 15, .55);
  --shadow-lg: 0 30px 70px -40px rgba(23, 20, 15, .65);

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--clay); color: var(--paper); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #C9BFA9; }

.font-display { font-family: var(--font-display); font-optical-sizing: auto; }

/* ─── Type helpers ───────────────────────────────────────────────────────── */
.eyebrow {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .19em;
  text-transform: uppercase;
}
.u-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.tnum { font-variant-numeric: tabular-nums; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  padding: .625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 9999px;
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

.btn-ink   { background: var(--ink); color: var(--paper); }
.btn-ink:hover:not(:disabled) { background: var(--clay); }

.btn-clay  { background: var(--clay); color: #FFF8F4; }
.btn-clay:hover:not(:disabled) { background: var(--clay-2); }

.btn-line  { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-line:hover:not(:disabled) { background: var(--ink); color: var(--paper); }

.btn-quiet { background: var(--card); color: var(--ink); border-color: var(--rule); }
.btn-quiet:hover:not(:disabled) { border-color: var(--ink); }

.btn-danger { background: transparent; color: var(--danger); border-color: #DFC4BC; }
.btn-danger:hover:not(:disabled) { background: #F6E4DF; border-color: var(--danger); }

.btn-sm { min-height: 2.1rem; padding: .3rem .8rem; font-size: .78rem; }
.btn-xs { min-height: 1.85rem; padding: .2rem .65rem; font-size: .72rem; }

/* ─── Surfaces ───────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
}

.panel {
  background: rgba(251, 248, 242, .93);
  backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid var(--rule);
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
}

/* A search dropdown is absolutely positioned inside its panel, so without
   this the next panel in the column paints over the suggestions. */
.panel:has(#city-results:not(.hidden)),
.panel:has(#landmark-results:not(.hidden)) {
  position: relative;
  z-index: 30;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--rule-soft);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .15rem .55rem;
  border: 1px solid var(--rule);
  border-radius: 9999px;
  background: var(--paper);
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
}
.chip-clay { background: var(--clay-soft); border-color: #E7C4B6; color: var(--clay-2); }

.divider { height: 1px; background: var(--rule); }

/* A small set of mutually exclusive options (map themes, leaderboard sorting). */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: .2rem;
  padding: .2rem;
  border: 1px solid var(--rule);
  border-radius: 9999px;
  background: var(--paper);
}
.segmented button {
  padding: .38rem .5rem;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-label {
  display: block;
  margin-bottom: .35rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink);
}
.form-input,
input[type="text"].form-input,
input[type="email"].form-input,
input[type="password"].form-input,
input[type="date"].form-input,
input[type="search"].form-input,
textarea.form-input,
select.form-input {
  display: block;
  width: 100%;
  min-height: 2.6rem;
  padding: .55rem .8rem;
  background: #FFFDF9;
  border: 1px solid var(--rule);
  border-radius: .7rem;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: .875rem;
  line-height: 1.45;
  transition: border-color .15s ease, box-shadow .15s ease;
  outline: none;
}
.form-input::placeholder { color: #A79C88; }
.form-input:focus {
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(180, 70, 42, .13);
}
.form-input:disabled { background: var(--paper-2); color: var(--muted); }
textarea.form-input { min-height: 4.5rem; resize: vertical; }
input[type="date"].form-input { padding-right: .5rem; }
/* Search fields with an icon absolutely positioned inside them. */
input[type="search"].form-input.has-icon {
  padding-left: 2.45rem;
  padding-right: 2.3rem;
}

.form-error { margin-top: .3rem; font-size: .75rem; color: var(--danger); }
.form-hint  { margin-top: .3rem; font-size: .75rem; color: var(--muted); }

/* ─── Navigation ─────────────────────────────────────────────────────────── */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .8rem;
  border-radius: 9999px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color .16s ease, background .16s ease;
  white-space: nowrap;
}
.nav-link:hover { color: var(--ink); background: rgba(23, 20, 15, .05); }
.nav-link-active { color: var(--paper); background: var(--ink); }
.nav-link-active:hover { color: var(--paper); background: var(--ink); }

.tab-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  padding: .45rem 0 .55rem;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
}
.tab-link svg { width: 1.25rem; height: 1.25rem; }
.tab-link-active { color: var(--clay); }

/* ─── Toasts ─────────────────────────────────────────────────────────────── */
.toast {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .7rem .9rem;
  border-radius: .8rem;
  border: 1px solid var(--rule);
  background: var(--card);
  box-shadow: var(--shadow-md);
  font-size: .82rem;
  color: var(--ink);
}
.toast-success { border-color: #BFD3BB; background: #F1F6EE; }
.toast-error   { border-color: #E4C3BA; background: #FBEDE9; }
.toast-info    { border-color: var(--rule); background: var(--card); }

/* ─── Empty states ───────────────────────────────────────────────────────── */
.empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.6;
}

/* ─── Auth pages ─────────────────────────────────────────────────────────── */
.auth-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1rem 4rem;
  background:
    radial-gradient(ellipse 70% 55% at 15% 0%, rgba(180, 70, 42, .07), transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(98, 112, 90, .08), transparent 60%),
    var(--paper);
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-lg);
  padding: 2rem;
}
@media (max-width: 480px) {
  .auth-card { padding: 1.4rem; border-radius: 1rem; }
}

/* ─── Map layout ─────────────────────────────────────────────────────────── */
#map-container {
  position: fixed;
  inset: 4rem 0 0 0;
  z-index: 0;
}
@media (max-width: 1023px) {
  #map-container { inset: 4.0625rem 0 3.6rem 0; }
  /* Keep the required credit clear of the sheet handle at the bottom. The
     attribution moves to the top-left on phones, so it stays visible. */
  #map .maplibregl-ctrl-top-left { margin: .55rem 0 0 .55rem; }
}

#map { position: absolute; inset: 0; width: 100%; height: 100%; background: var(--paper); overflow: hidden; }

/* Desktop: two floating columns. The wrapper is transparent to layout so the
   two children can be positioned independently at the screen edges. */
@media (min-width: 1024px) {
  #map-panels { display: contents; }
  #panel-left,
  #panel-right {
    position: absolute;
    top: .9rem;
    width: 21.5rem;
    max-height: calc(100dvh - 6rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    z-index: 20;
  }
  #panel-left { left: .9rem; }
  #panel-right { right: .9rem; width: 19.5rem; }
  #panel-left > *, #panel-right > * { margin-bottom: .75rem; }
}

/* Mobile/tablet: one bottom sheet that slides up over the map. */
@media (max-width: 1023px) {
  #map-panels {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 3.55rem;
    z-index: 40;
    max-height: 78dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 .75rem calc(1rem + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 1px solid var(--rule);
    border-radius: 1.35rem 1.35rem 0 0;
    box-shadow: 0 -20px 50px -30px rgba(23, 20, 15, .7);
    transform: translateY(calc(100% - 3.15rem));
    transition: transform .3s cubic-bezier(.32, .72, 0, 1);
    will-change: transform;
  }
  #map-panels.sheet-open { transform: translateY(0); }
  #panel-left > *, #panel-right > * { margin-bottom: .6rem; }
}

@media (max-width: 1023px) {
  #sheet-handle {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: calc(100% + 1.5rem);
    height: 3.15rem;
    margin: 0 -.75rem;
    padding: 0 .75rem;
    background: var(--paper);
    border: 0;
    border-radius: 1.35rem 1.35rem 0 0;
    cursor: pointer;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  #sheet-handle::before {
    content: "";
    position: absolute;
    top: .45rem;
    left: 50%;
    width: 2.4rem;
    height: .22rem;
    margin-left: -1.2rem;
    border-radius: 9999px;
    background: #CFC4AE;
  }
}

/* MapLibre chrome, restyled to the paper world */
.maplibregl-ctrl-group {
  background: var(--card);
  border: 1px solid var(--rule) !important;
  border-radius: .75rem !important;
  box-shadow: var(--shadow-sm) !important;
  overflow: hidden;
}
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--rule-soft); }
.maplibregl-ctrl-group button { width: 2.1rem; height: 2.1rem; }
.maplibregl-ctrl-group button:hover { background: var(--paper-2); }

.maplibregl-popup-content {
  padding: .8rem .9rem;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: .85rem;
  box-shadow: var(--shadow-md);
  font-family: var(--font-sans);
}
.maplibregl-popup-tip { border-top-color: var(--card) !important; border-bottom-color: var(--card) !important; }
.maplibregl-popup-close-button {
  top: .25rem;
  right: .3rem;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border-radius: 9999px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.4;
}
.maplibregl-popup-close-button:hover { background: var(--paper-2); color: var(--ink); }

.maplibregl-ctrl-attrib {
  background: rgba(244, 239, 230, .88) !important;
  color: var(--muted) !important;
  border-radius: .5rem;
  font-size: .62rem;
}
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
.maplibregl-ctrl-scale {
  background: rgba(244, 239, 230, .8);
  border-color: var(--muted);
  color: var(--muted);
  font-size: .62rem;
}

/* Popup content primitives (Tailwind is not applied to runtime HTML on the map) */
.popup-title {
  margin: 0 0 .1rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}
.popup-sub {
  margin: 0 0 .55rem;
  font-size: .72rem;
  color: var(--muted);
}
.popup-block {
  margin-top: .4rem;
  padding: .45rem .55rem;
  border: 1px solid var(--rule-soft);
  border-radius: .5rem;
  background: var(--paper);
}
.popup-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  font-size: .72rem;
  color: var(--muted);
}
.popup-row + .popup-row { margin-top: .15rem; }
.popup-note {
  margin: .2rem 0 0;
  font-size: .72rem;
  font-style: italic;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.popup-user {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .74rem;
  font-weight: 600;
  color: var(--ink);
}
.popup-dot { width: .5rem; height: .5rem; border-radius: 9999px; flex: none; }
.popup-action {
  margin-top: .4rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--danger);
  font-size: .7rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.popup-kind {
  display: inline-block;
  margin-bottom: .35rem;
  padding: .05rem .4rem;
  border: 1px solid var(--rule);
  border-radius: 9999px;
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Map markers */
.marker-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: 2px solid #FFFDF9;
  box-shadow: 0 6px 16px rgba(23, 20, 15, .28);
  color: #FFFDF9;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease;
}
.marker-pin:hover { transform: scale(1.14); }
.marker-pin--shared {
  background: var(--ink);
  width: 2.15rem;
  height: 2.15rem;
}
.marker-count {
  position: absolute;
  top: -.3rem;
  right: -.35rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 .2rem;
  border-radius: 9999px;
  background: var(--ink);
  color: var(--paper);
  font-size: .58rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
}
.marker-sight {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: .45rem;
  border: 2px solid #FFFDF9;
  background: var(--card);
  box-shadow: 0 4px 12px rgba(23, 20, 15, .25);
  cursor: pointer;
  transition: transform .15s ease;
}
.marker-sight:hover { transform: scale(1.15); }
.marker-sight svg { width: .8rem; height: .8rem; }

.marker-preview { animation: preview-pulse 1.6s ease-in-out infinite alternate; }
@keyframes preview-pulse {
  from { transform: scale(1); }
  to   { transform: scale(1.16); }
}

/* ─── Animation ──────────────────────────────────────────────────────────── */
@keyframes slide-in {
  from { transform: translateY(-6px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes fade-up {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.animate-slide-in { animation: slide-in .3s cubic-bezier(.22, 1, .36, 1) both; }
.animate-fade-up  { animation: fade-up .38s ease both; }

.stagger > * { animation: fade-up .34s ease both; }
.stagger > *:nth-child(1) { animation-delay: .03s; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .09s; }
.stagger > *:nth-child(4) { animation-delay: .12s; }
.stagger > *:nth-child(5) { animation-delay: .15s; }
.stagger > *:nth-child(6) { animation-delay: .18s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Misc ───────────────────────────────────────────────────────────────── */
.color-swatch {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 9999px;
  border: 2px solid rgba(23, 20, 15, .12);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: var(--ink); transform: scale(1.15); }

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

:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------------------
   Vid � discovery additions
   --------------------------------------------------------------------------- */

/* Search dropdowns need to paint above the next panel. */
.panel:has(#place-results:not(.hidden)),
.panel:has(#saved-filter-results:not(.hidden)) {
  position: relative;
  z-index: 30;
}

/* --- Category chips ------------------------------------------------------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .4rem;
}
.category-chip {
  --cat: var(--clay);
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  min-height: 3.2rem;
  padding: .5rem .55rem;
  border: 1px solid var(--rule);
  border-radius: .7rem;
  background: var(--card);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.category-chip:hover { border-color: var(--cat); }
.category-chip[aria-pressed="true"] {
  border-color: var(--cat);
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--cat);
}
.category-chip .cat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  flex: none;
  margin-top: .05rem;
  border-radius: .42rem;
  background: var(--paper);
  color: var(--cat);
}
.category-chip .cat-icon svg { width: .9rem; height: .9rem; }
.category-chip .cat-copy { min-width: 0; flex: 1; }
.category-chip .cat-label {
  display: block;
  font-size: .72rem;
  font-weight: 650;
  line-height: 1.2;
}
.category-chip .cat-count {
  display: block;
  margin-top: .15rem;
  font-size: .61rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
}
.category-chip .cat-count.has-results { color: var(--cat); }

/* --- Radius chips --------------------------------------------------------- */
.radius-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .3rem;
}
.radius-chip {
  min-height: 2.1rem;
  padding: .3rem .2rem;
  border: 1px solid var(--rule);
  border-radius: .55rem;
  background: var(--card);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: .69rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.radius-chip:hover { border-color: var(--ink); color: var(--ink); }
.radius-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.radius-chip:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }

/* --- Search suggestions --------------------------------------------------- */
.search-result {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  width: 100%;
  padding: .55rem .7rem;
  border: 0;
  border-bottom: 1px solid var(--rule-soft);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover, .search-result:focus-visible { background: var(--paper); outline: none; }
.search-result .sr-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  margin-top: .1rem;
  border-radius: .4rem;
  background: var(--paper-2);
  color: var(--clay);
}
.search-result .sr-icon svg { width: .8rem; height: .8rem; }
.search-result .sr-name { display: block; font-size: .78rem; font-weight: 600; line-height: 1.25; }
.search-result .sr-sub { display: block; margin-top: .1rem; font-size: .66rem; color: var(--muted); }
.search-empty { padding: .9rem; font-size: .75rem; color: var(--muted); text-align: center; }

/* --- Results -------------------------------------------------------------- */
.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .75rem .85rem;
  border-bottom: 1px solid var(--rule-soft);
}
.result-list {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: .65rem;
}
.result-scroll {
  max-height: min(57dvh, 38rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.place-card {
  --cat: var(--clay);
  position: relative;
  display: grid;
  grid-template-columns: 3.6rem minmax(0, 1fr) auto;
  gap: .55rem;
  width: 100%;
  padding: .55rem;
  border: 1px solid var(--rule);
  border-radius: .8rem;
  background: var(--card);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.place-card:hover { border-color: color-mix(in srgb, var(--cat) 55%, var(--rule)); }
.place-card:has(.place-open:focus-visible) { outline: 2px solid var(--clay); outline-offset: 2px; }
/* A real button stretches over the card so the whole row is one control for
   pointer, keyboard and screen-reader users. */
.place-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}
.place-open:focus-visible { outline: none; }
.place-card.is-selected {
  border-color: var(--cat);
  box-shadow: 0 0 0 1px var(--cat), var(--shadow-md);
}
.place-card.is-top::before {
  content: "";
  position: absolute;
  inset: .35rem auto .35rem .2rem;
  width: 2px;
  border-radius: 9999px;
  background: var(--cat);
}
.place-thumb {
  position: relative;
  width: 3.6rem;
  height: 3.6rem;
  overflow: hidden;
  border-radius: .55rem;
  background: var(--paper-2);
}
.place-thumb img { width: 100%; height: 100%; object-fit: cover; }
.place-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--cat) 20%, var(--paper)) 0%, var(--paper-2) 70%);
  color: var(--cat);
}
.place-thumb-fallback svg { width: 1.25rem; height: 1.25rem; }
.place-main { min-width: 0; padding-top: .05rem; }
.place-kicker {
  display: flex;
  align-items: center;
  gap: .3rem;
  min-width: 0;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.place-kicker .pf-dot { width: .38rem; height: .38rem; flex: none; border-radius: 9999px; background: var(--cat); }
.place-kicker .pf-distance { margin-left: auto; color: var(--muted); letter-spacing: .04em; white-space: nowrap; }
.place-title {
  margin: .16rem 0 0;
  font-family: var(--font-display);
  font-size: .93rem;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.place-desc {
  display: -webkit-box;
  margin: .18rem 0 0;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: .68rem;
  line-height: 1.4;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.place-badges { display: flex; flex-wrap: wrap; gap: .2rem; margin-top: .3rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: .15rem;
  padding: .06rem .35rem;
  border: 1px solid var(--rule);
  border-radius: 9999px;
  background: var(--paper);
  color: var(--muted);
  font-size: .54rem;
  font-weight: 650;
  letter-spacing: .03em;
  white-space: nowrap;
}
.badge-wiki { border-color: #CFC2AE; color: #5C5140; }
.badge-notable { border-color: #D9C3B6; background: var(--clay-soft); color: var(--clay-2); }
.place-side { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: .3rem; pointer-events: none; }
.place-side > * { pointer-events: auto; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid transparent;
  border-radius: 9999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: var(--paper); color: var(--ink); border-color: var(--rule); }
.icon-btn.is-saved { color: var(--clay); border-color: #E7C4B6; background: var(--clay-soft); }
.icon-btn svg { width: .85rem; height: .85rem; }
.place-links { display: flex; gap: .1rem; }
.place-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  color: var(--muted);
}
.place-links a svg { width: .85rem; height: .85rem; }
.place-links a:hover { color: var(--clay); background: var(--paper); }

.result-toolbar {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .65rem 0;
}
.result-toolbar .form-input { min-height: 2.1rem; font-size: .74rem; }
.results-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  padding: .4rem .85rem .65rem;
  font-size: .64rem;
  color: var(--muted);
}
.results-stale {
  margin: 0 .85rem .5rem;
  padding: .35rem .5rem;
  border-left: 2px solid #C1783C;
  background: #FBF1E7;
  border-radius: 0 .35rem .35rem 0;
  font-size: .64rem;
  line-height: 1.45;
  color: #6E4A22;
}
.attribution-line {
  padding: .55rem .85rem .7rem;
  border-top: 1px solid var(--rule-soft);
  font-size: .57rem;
  line-height: 1.5;
  color: #938875;
}
.attribution-line a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* --- Skeleton / status ---------------------------------------------------- */
.skeleton-card { display: grid; grid-template-columns: 3.6rem 1fr; gap: .55rem; padding: .55rem; border: 1px solid var(--rule-soft); border-radius: .8rem; }
.skeleton { border-radius: .4rem; background: linear-gradient(90deg, var(--paper-2) 25%, #F7F2E9 37%, var(--paper-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.skeleton-block { height: .65rem; }
.skeleton-thumb { width: 3.6rem; height: 3.6rem; border-radius: .55rem; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* --- Modal ---------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(23, 20, 15, .45);
  backdrop-filter: blur(3px);
}
.modal-card {
  width: 100%;
  max-width: 34rem;
  max-height: min(88dvh, 46rem);
  overflow-y: auto;
  border: 1px solid var(--rule);
  border-radius: 1rem;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  animation: fade-up .22s ease both;
}
.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.1rem .8rem;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--card);
}
.modal-body { padding: 1rem 1.1rem 1.2rem; }
.modal-image { width: 100%; height: 14rem; object-fit: cover; border-radius: .7rem; background: var(--paper-2); }
.modal-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.modal-kicker { font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--clay); }
.modal-text { margin-top: .6rem; font-size: .82rem; line-height: 1.62; color: #3D372D; }
.modal-muted { font-size: .7rem; color: var(--muted); }
.modal-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.modal-facts { display: grid; gap: .35rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--rule-soft); }
.modal-fact { display: flex; gap: .5rem; font-size: .72rem; line-height: 1.4; }
.modal-fact dt { flex: none; width: 5.2rem; color: var(--muted); }
.modal-fact dd { min-width: 0; overflow-wrap: anywhere; }

/* --- Saved page ----------------------------------------------------------- */
.app-page { max-width: 82rem; margin: 0 auto; padding: 6.5rem 1rem 3rem; }
@media (min-width: 1024px) { .app-page { padding: 7.5rem 2rem 4rem; } }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.page-title { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; line-height: 1.04; letter-spacing: -.02em; }
.page-lede { max-width: 38rem; margin-top: .5rem; font-size: .95rem; line-height: 1.65; color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.mini-stat { padding: .7rem .8rem; border: 1px solid var(--rule); border-radius: .8rem; background: var(--card); }
.mini-stat .value { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; line-height: 1; }
.mini-stat .label { margin-top: .25rem; font-size: .58rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }

.saved-layout { display: grid; gap: 1rem; }
@media (min-width: 1024px) { .saved-layout { grid-template-columns: 16.5rem minmax(0, 1fr); align-items: start; } }
.saved-sidebar { display: none; }
@media (min-width: 1024px) { .saved-sidebar { display: block; position: sticky; top: 5.5rem; } }
.collection-nav { display: flex; flex-direction: column; gap: .15rem; }
.collection-nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .5rem .65rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.collection-nav button:hover { background: var(--paper-2); color: var(--ink); }
.collection-nav button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.collection-nav .count { font-size: .62rem; font-variant-numeric: tabular-nums; opacity: .7; }
.collection-add { display: flex; gap: .3rem; margin-top: .6rem; }
.collection-add .form-input { min-height: 2.1rem; font-size: .74rem; }

.saved-grid { display: grid; gap: .55rem; }
@media (min-width: 640px) { .saved-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .saved-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.saved-card {
  --cat: var(--clay);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: .9rem;
  background: var(--card);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.saved-card:hover { border-color: var(--rule); box-shadow: var(--shadow-md); }
.saved-card-image { position: relative; height: 8.5rem; background: var(--paper-2); }
.saved-card-image img { width: 100%; height: 100%; object-fit: cover; }
.saved-card-image .fallback { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: var(--cat); background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--cat) 18%, var(--paper)) 0%, var(--paper-2) 75%); }
.saved-card-image .fallback svg { width: 2rem; height: 2rem; }
.saved-card-image .visited-stamp {
  position: absolute;
  top: .45rem;
  right: .45rem;
  padding: .1rem .4rem;
  border-radius: 9999px;
  background: var(--sage);
  color: #FFFDF9;
  font-size: .54rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.saved-card-body { display: flex; flex: 1; flex-direction: column; padding: .65rem .75rem .7rem; }
.saved-card .kicker { display: flex; align-items: center; gap: .3rem; font-size: .56rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.saved-card .kicker .dot { width: .36rem; height: .36rem; border-radius: 9999px; background: var(--cat); }
.saved-card h3 { margin-top: .2rem; font-family: var(--font-display); font-size: 1rem; font-weight: 600; line-height: 1.18; overflow-wrap: anywhere; }
.saved-card .notes { margin-top: .3rem; font-size: .7rem; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.saved-card .meta { margin-top: auto; padding-top: .55rem; display: flex; align-items: center; justify-content: space-between; gap: .4rem; font-size: .62rem; color: var(--muted); }
.saved-card .actions { display: flex; gap: .1rem; }
.saved-card .actions .icon-btn { width: 1.55rem; height: 1.55rem; }
.saved-note-edit { margin-top: .5rem; display: none; }
.saved-card.editing .saved-note-edit { display: block; }

.collection-panel { padding: .8rem; border: 1px solid var(--rule); border-radius: .9rem; background: var(--card); }
.collection-panel h2 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }
.collection-panel p { margin-top: .3rem; font-size: .7rem; line-height: 1.45; color: var(--muted); }
.collection-share { display: flex; gap: .3rem; margin-top: .55rem; }
.collection-share input { min-height: 2rem; font-size: .68rem; }

/* --- Share page ----------------------------------------------------------- */
.share-hero {
  border-bottom: 1px solid var(--rule);
  background:
    radial-gradient(ellipse 65% 70% at 20% 0%, rgba(180, 70, 42, .08), transparent 65%),
    radial-gradient(ellipse 55% 55% at 90% 100%, rgba(98, 112, 90, .09), transparent 65%),
    var(--paper);
}
.share-list { border: 1px solid var(--rule); border-radius: 1rem; overflow: hidden; background: var(--card); }
.share-row { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; gap: .65rem; align-items: center; padding: .7rem .85rem; border-bottom: 1px solid var(--rule-soft); }
.share-row:last-child { border-bottom: 0; }
.share-row .num { display: flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; border-radius: .55rem; background: var(--paper); color: var(--clay); font-family: var(--font-display); font-size: .8rem; font-weight: 600; }
.share-row h2 { font-family: var(--font-display); font-size: .92rem; font-weight: 600; }
.share-row p { margin-top: .1rem; font-size: .67rem; color: var(--muted); }
.share-row a {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 1.5rem;
  padding: 0 .25rem;
  font-size: .65rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* --- Landing extras ------------------------------------------------------- */
.hero-art {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 1.2rem;
  background: #EEF0E4;
  box-shadow: 0 34px 70px -46px rgba(23, 20, 15, .55);
}
.hero-art svg { display: block; width: 100%; height: auto; }
.hero-note {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  max-width: 15rem;
  padding: .7rem .8rem;
  border: 1px solid var(--rule);
  border-radius: .7rem;
  background: rgba(251, 248, 242, .93);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
}
.hero-note p:first-child { font-size: .55rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--clay); }
.hero-note p:last-child { margin-top: .2rem; font-size: .72rem; line-height: 1.4; color: var(--ink); }
.feature-card { padding: 1.2rem; border: 1px solid var(--rule); border-radius: .9rem; background: var(--card); }
.category-showcase { display: flex; flex-wrap: wrap; gap: .4rem; }
.showcase-chip {
  --cat: var(--clay);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .7rem .35rem .5rem;
  border: 1px solid var(--rule);
  border-radius: 9999px;
  background: var(--card);
  font-size: .74rem;
  font-weight: 600;
}
.showcase-chip svg { width: .9rem; height: .9rem; color: var(--cat); }

/* --- Misc app bits -------------------------------------------------------- */
.hint-box { padding: .55rem .65rem; border: 1px solid var(--rule); border-radius: .6rem; background: var(--paper); font-size: .68rem; line-height: 1.45; color: var(--muted); }
.hint-box strong { color: var(--ink); font-weight: 600; }
.loading-strip { display: flex; align-items: center; gap: .45rem; padding: .5rem .85rem; font-size: .66rem; color: var(--muted); }
.spinner { width: .9rem; height: .9rem; border: 2px solid var(--clay); border-top-color: transparent; border-radius: 9999px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.plan-pill { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .55rem; border: 1px solid var(--rule); border-radius: 9999px; background: var(--paper); font-size: .6rem; font-weight: 650; letter-spacing: .04em; color: var(--muted); }
.plan-pill.pro { border-color: #E1C7B9; background: var(--clay-soft); color: var(--clay-2); }
.saved-count { font-size: .62rem; color: var(--muted); }
.mobile-only { display: block; }
@media (min-width: 1024px) { .mobile-only { display: none; } }
.lg-only { display: none; }
@media (min-width: 1024px) { .lg-only { display: block; } }

/* Map marker glyphs are drawn as MapLibre circle layers; these are the
   legend swatches. */
.legend-dot { width: .6rem; height: .6rem; flex: none; border-radius: 9999px; }
.legend-row { display: flex; align-items: center; gap: .4rem; font-size: .68rem; color: var(--muted); }
