/* Dogs Welcome. Layout: one-screen phone app. Header (search + type chips), a view area (map / list / saved / about),
   bottom tab bar, and a place sheet that slides up over everything. */
:root {
  /* Colour scheme (Settings): each scheme sets only these, for light and dark */
  --head-l: #0f6670;  --head-d: #123a3f;   /* header and tab bar */
  --field-l: #0d5f66; --field-d: #67cfc4;  /* links, icons, secondary actions */
  --bg-l: #e4ecea;    --s2-l: #d9e4e2;     --line-l: #cbd8d6;
  --sun: #ffc72c;          /* main actions and what's selected */
  --sun-ink: #13302f;      /* text and icons on --sun */

  --field: var(--field-l);
  --field-ink: #ffffff;
  --tag: #e8a317;          /* amber: limits, saved, required marks */
  --bg: var(--bg-l);
  --surface: #ffffff;
  --surface-2: var(--s2-l);
  --head: var(--head-l);
  --head-ink: #ffffff;
  --head-edge: transparent; /* a thin edge under the header and above the tab bar (white scheme only) */
  --ink: #14262a;
  --ink-2: #4e6266;
  --line: var(--line-l);
  --focus: #1c7cd6;
  --shadow: 0 6px 24px rgba(13, 50, 55, .14);
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", Roboto, system-ui, sans-serif;
  --r: 14px;
  color-scheme: light;
}
/* Dark: when the phone is in dark mode (unless Settings says Light), or when Settings says Dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    --field: var(--field-d); --field-ink: #062023; --tag: #f0b75a;
    --bg: #0e1a1c; --surface: #16262a; --surface-2: #1e3236; --ink: #e8f1f1; --ink-2: #a9bcbe; --line: #2a4044;
    --head: var(--head-d); --head-ink: #e8f1f1; --focus: #7cc1ff; --shadow: 0 6px 24px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-mode="dark"] {
  --field: var(--field-d); --field-ink: #062023; --tag: #f0b75a;
  --bg: #0e1a1c; --surface: #16262a; --surface-2: #1e3236; --ink: #e8f1f1; --ink-2: #a9bcbe; --line: #2a4044;
  --head: var(--head-d); --head-ink: #e8f1f1; --focus: #7cc1ff; --shadow: 0 6px 24px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* Colour schemes */
:root[data-theme="green"]  { --head-l: #0f5c3d; --head-d: #12392a; --field-l: #0f5c3d; --field-d: #5fcf96; --bg-l: #e7eee9; --s2-l: #dbe5de; --line-l: #ccd9cf; --sun: #f2b33d; --sun-ink: #1d2a12; }
:root[data-theme="ocean"]  { --head-l: #1d4e89; --head-d: #16304f; --field-l: #1f5fa8; --field-d: #8cc2ff; --bg-l: #e6edf5; --s2-l: #d9e3ef; --line-l: #c9d6e6; --sun: #ffb000; --sun-ink: #1d1a0d; }
:root[data-theme="heather"]{ --head-l: #5b3f7a; --head-d: #34264a; --field-l: #6a4a92; --field-d: #c9a8f0; --bg-l: #efeaf4; --s2-l: #e4dcee; --line-l: #d6cbe3; --sun: #f6c445; --sun-ink: #2a1d10; }
:root[data-theme="sunset"] { --head-l: #9a3412; --head-d: #4a1f10; --field-l: #9a3412; --field-d: #ffb08a; --bg-l: #f6ece4; --s2-l: #efdfd2; --line-l: #e4d0c0; --sun: #ffd166; --sun-ink: #3a1a08; }
:root[data-theme="slate"]  { --head-l: #2f3b45; --head-d: #1d252c; --field-l: #2f5d7c; --field-d: #9cc7e6; --bg-l: #eceff2; --s2-l: #e0e5ea; --line-l: #d0d7de; --sun: #f2c14e; --sun-ink: #1b1d20; }
/* White: white header and tab bar with teal and yellow; in dark mode it uses a plain dark header */
:root[data-theme="white"]  { --head-l: #ffffff; --head-d: #1a2224; --field-l: #0d5f66; --field-d: #67cfc4; --bg-l: #eef2f2; --s2-l: #e3e9e9; --line-l: #d3dcdc; --sun: #ffc72c; --sun-ink: #13302f;
                             --head-ink: #14262a; --head-edge: var(--line); }
@media (prefers-color-scheme: dark) { :root[data-theme="white"]:not([data-mode="light"]) { --head-ink: #e8f1f1; --head-edge: transparent; } }
:root[data-theme="white"][data-mode="dark"] { --head-ink: #e8f1f1; --head-edge: transparent; }
/* High contrast: black, white and yellow, the same in light and dark */
:root[data-theme="contrast"] {
  --head: #000000; --head-ink: #ffffff; --sun: #ffe600; --sun-ink: #000000; --field: #0040a8; --field-ink: #ffffff;
  --tag: #8a5a00; --bg: #ffffff; --surface: #ffffff; --surface-2: #eeeeee; --ink: #000000; --ink-2: #1f1f1f; --line: #000000;
  --focus: #c800c8; --shadow: 0 0 0 2px #000; color-scheme: light;
}

/* Text size (Settings) */
:root[data-text="large"] { font-size: 112.5%; }
:root[data-text="larger"] { font-size: 125%; }

* { box-sizing: border-box; }
/* Locked like an app: the page itself never scrolls, pans or zooms; only the list and panels inside it scroll. */
html, body { height: 100%; margin: 0; overflow: hidden; overflow: clip; overscroll-behavior: none; }
:root { --sab: env(safe-area-inset-bottom, 0px); }
.no-bottom-inset { --sab: 0px; }
html { position: fixed; inset: 0; background: var(--head); }   /* any sliver below the app (rounding, edge-to-edge phones) matches the tab bar */
body {
  position: fixed; inset: 0;
  touch-action: pan-x pan-y;          /* no pinch-zoom or double-tap zoom of the page (the map still zooms) */
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.45 var(--font-body);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--field); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

input, textarea, select, [contenteditable], .sheet p, .sheet dd, .lede, .policy { user-select: text; -webkit-user-select: text; }
.leaflet-container { touch-action: none; }
.app {
  position: fixed; inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  overflow: clip;        /* clip, not just hide: the browser can't shift the whole app when it scrolls a field into view */
}

/* ---------- Header ---------- */
.topbar {
  background: var(--head);
  color: var(--head-ink);
  box-shadow: inset 0 -1px 0 var(--head-edge);
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  padding-bottom: 10px;
  display: grid;
  gap: 10px;
  z-index: 500;
}
.brand, .search { margin-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 32px; height: 32px; flex: none; border-radius: 9px; background: var(--sun); color: var(--sun-ink); display: grid; place-items: center; }
.brand-mark svg { width: 24px; height: 24px; fill: currentColor; stroke: none; }
.brand h1 { margin: 0; font: 800 1.42rem/1 var(--font-display); letter-spacing: -.02em; white-space: nowrap; }
.brand-text { display: grid; gap: 3px; min-width: 0; }
.brand-tag { font-size: .8rem; line-height: 1.1; color: color-mix(in srgb, var(--head-ink) 82%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 0 14px; min-height: 44px;
  border: 1.5px solid var(--head-edge);
}
.search svg { width: 20px; height: 20px; color: var(--ink-2); flex: none; }
.search input {
  border: 0; background: transparent; outline: none; flex: 1; min-width: 0; padding: 10px 0;
}
.search:focus-within { border-color: var(--sun); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }   /* our own X below instead */
.search-clear { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-right: -8px; padding: 0; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--ink); cursor: pointer; }
.search-clear[hidden] { display: none; }
.search .search-clear svg { width: 16px; height: 16px; color: var(--ink); fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }

.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  scroll-padding-inline: 16px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid color-mix(in srgb, var(--head-ink) 40%, transparent);
  background: transparent; color: var(--head-ink);
  border-radius: 999px; padding: 6px 12px; font-size: .9rem; cursor: pointer; white-space: nowrap;
}
.chip i { display: grid; place-items: center; width: 20px; height: 20px; margin-left: -4px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 1.5px #fff; }
.chip i .glyph { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chip i .glyph .f, .chip i .glyph .f * { fill: #fff; stroke: none; }
.chip[aria-pressed="true"] { background: var(--sun); color: var(--sun-ink); border-color: var(--sun); font-weight: 700; }
.chip b { font-weight: 400; opacity: .75; font-variant-numeric: tabular-nums; }

/* ---------- Views ---------- */
.views { position: relative; min-height: 0; overflow: hidden; overflow: clip; }
.view { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.view-map { overflow: hidden; }
.map { position: absolute; inset: 0; background: var(--surface-2); z-index: 0; }  /* keeps Leaflet's own layers and controls below the place sheet */
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]):not([data-theme="contrast"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.6); }
}
:root[data-mode="dark"]:not([data-theme="contrast"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.6); }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { font-size: 11px; background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--ink-2); }
.leaflet-control-attribution a { color: var(--ink-2); }
.leaflet-bar a { background: var(--surface); color: var(--ink); border-color: var(--line); }

.map-status {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 450;
  background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 6px 14px;
  font-size: .85rem; box-shadow: var(--shadow); white-space: nowrap; max-width: calc(100% - 32px);
  overflow: hidden; text-overflow: ellipsis;
}
.map-status:empty { display: none; }
.fab {
  position: absolute; z-index: 450;
  right: max(14px, env(safe-area-inset-right, 0px)); bottom: 74px;
  width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: var(--surface); color: var(--field); box-shadow: var(--shadow); cursor: pointer;
  display: grid; place-items: center;
}
.fab svg { width: 24px; height: 24px; }
.fab.busy svg { animation: spin 1s linear infinite; }
.area-list {
  position: absolute; z-index: 450; left: 50%; transform: translateX(-50%); bottom: 42px;   /* just above the map credit, which must stay readable */
  border: 0; border-radius: 999px; padding: 6px 14px; font-size: .9rem; line-height: 1.3; cursor: pointer;
  background: var(--sun); color: var(--sun-ink); font-weight: 700; box-shadow: var(--shadow);
  white-space: nowrap;
}
.area-list:empty { display: none; }
.routing .area-list, .routing .map-status { display: none; }
.leaflet-control-layers { border: 0 !important; box-shadow: var(--shadow) !important; background: var(--surface); color: var(--ink); border-radius: 10px !important; }
.leaflet-control-layers-expanded { padding: 8px 12px; font-size: .92rem; }
.leaflet-control-layers label { padding: 4px 0; }
.route {
  position: absolute; z-index: 460; left: 10px; right: 10px; bottom: 30px; max-width: 420px; margin: 0 auto;
  background: var(--surface); color: var(--ink); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 14px 10px;
}
.route-head { display: flex; align-items: flex-start; gap: 8px; }
.route-head p { margin: 2px 0 0; flex: 1; min-width: 0; font-size: .95rem; overflow-wrap: anywhere; }
.route-x { border: 0; background: transparent; color: var(--ink-2); width: 36px; height: 36px; margin: -6px -6px 0 0; display: grid; place-items: center; cursor: pointer; }
.route-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.route-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.route-modes button {
  border: 1.5px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: 7px 0; font: inherit; font-size: .9rem; cursor: pointer;
}
.route-modes button[aria-pressed="true"] { background: var(--field); border-color: var(--field); color: var(--field-ink); font-weight: 700; }
.route-info { margin: 10px 0 0; font-size: 1rem; min-height: 1.4em; }
.route-info strong { font-size: 1.15rem; }
.route-approx { margin: 6px 0 0; font-size: .82rem; color: var(--ink-2); }
.route-go {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; padding: 12px; border-radius: 12px;
  background: var(--sun); color: var(--sun-ink); font-weight: 700; text-decoration: none;
}
.route-go svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.move-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.move-actions .btn { width: 100%; margin: 0; }
.btn.ghost { background: transparent; color: var(--field); border: 1.5px solid var(--field); }
.move-pin { width: 34px; height: 46px; }
.move-pin svg { width: 34px; height: 46px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.install { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; padding: 12px 14px; border-radius: var(--r);
  background: var(--surface); border: 1.5px solid var(--sun); }
.install[hidden] { display: none; }
.install img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.install-text { flex: 1; min-width: 0; }
.install-text p { margin: 0; }
.install-text .small { margin-top: 2px; }
.install .btn { margin: 0; flex: none; }
.install .btn[hidden] { display: none; }
.owner { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 8px; }
.owner-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 6px; }
.owner-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.owner-btns .btn { margin: 0; padding: 8px 14px; font-size: .9rem; }
.btn.ghost.danger { color: #c92a2a; border-color: #c92a2a; }
.route-note { margin: 8px 0 0; font-size: .74rem; color: var(--ink-2); }
.route-note a { color: var(--ink-2); }

/* ---------- Lists ---------- */
.list-head {
  position: sticky; top: 0; z-index: 2; background: var(--bg);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--line);
}
.list-count { margin: 0; color: var(--ink-2); font-size: .92rem; }
.list-count strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.policy-filter { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-2); }
.policy-filter select {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 8px; min-height: 36px;
}
.cards {
  list-style: none; margin: 0;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px));
  display: grid; gap: 10px;
}
@media (min-width: 760px) { .cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }
.card {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; cursor: pointer; text-align: left; width: 100%;
}
.card:hover { border-color: color-mix(in srgb, var(--field) 50%, var(--line)); }
.card .dot {
  width: 40px; height: 40px; border-radius: 12px; background: var(--dot);
  display: grid; place-items: center;
}
.card .dot svg { width: 24px; height: 24px; }
.card-body { min-width: 0; }
.card h3 { margin: 0 0 2px; font: 700 1.02rem/1.25 var(--font-body); overflow-wrap: anywhere; }
.card h3.unnamed { font-weight: 400; font-style: italic; }
.card .meta { margin: 0; color: var(--ink-2); font-size: .88rem; overflow-wrap: anywhere; }
.card .dist { color: var(--ink-2); font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 2px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 9px 2px 7px;
  font-size: .78rem; font-weight: 700; margin-top: 6px;
  background: color-mix(in srgb, var(--field) 13%, transparent); color: var(--field);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.p-outside, .badge.p-leashed, .badge.p-seasonal { background: color-mix(in srgb, var(--tag) 22%, transparent); color: color-mix(in srgb, var(--tag) 55%, var(--ink)); }

.more {
  display: block; margin: 0 auto 28px; border: 1.5px solid var(--field); color: var(--field);
  background: transparent; border-radius: 999px; padding: 10px 22px; font-weight: 700; cursor: pointer;
}
.empty { text-align: center; color: var(--ink-2); padding: 48px 32px; max-width: 26rem; margin: 0 auto; }
.empty svg { width: 40px; height: 40px; color: var(--tag); }
.empty p { margin: 6px 0; }

/* ---------- About ---------- */
.prose {
  max-width: 40rem; margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px));
}
.prose h2 { font: 800 1.6rem/1.15 var(--font-display); margin: 0 0 10px; text-wrap: balance; }
.prose h3 { font: 600 1.15rem/1.2 var(--font-display); margin: 26px 0 6px; }
.prose p { margin: 0 0 10px; }
.prose code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.data-meta { color: var(--ink-2); font-size: .9rem; }
.credit { color: var(--ink-2); font-size: .85rem; margin-top: 28px !important; }
.btn {
  border: 0; border-radius: 999px; padding: 10px 20px; background: var(--sun); color: var(--sun-ink);
  font-weight: 700; cursor: pointer;
}

/* ---------- Tabs ---------- */
.tabs {
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--head); color: var(--head-ink);
  padding-bottom: var(--sab);
  padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
  z-index: 500;
  box-shadow: inset 0 1px 0 var(--head-edge), 0 40px 0 0 var(--head);   /* paint the tab bar's colour on down to the phone's own buttons: no thin line between */
}
.tabs a {
  display: grid; justify-items: center; gap: 2px; padding: 8px 0 9px; text-decoration: none;
  color: color-mix(in srgb, var(--head-ink) 82%, transparent); font-size: .78rem;
}
.tabs svg { width: 24px; height: 24px; padding: 2px 14px; box-sizing: content-box; border-radius: 999px; }
.tabs a[aria-current="page"] { color: var(--head-ink); font-weight: 700; }
.tabs a[aria-current="page"] svg { stroke-width: 2.4; background: var(--sun); color: var(--sun-ink); }

/* ---------- Place sheet ---------- */
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5, 15, 10, .45); z-index: 900; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 901;
  max-height: calc(100% - 40px - env(safe-area-inset-top, 0px));
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 20px 20px 0 0; box-shadow: var(--shadow);
  padding-bottom: calc(20px + var(--sab));
  animation: rise .22s ease-out;
}
@media (min-width: 760px) {
  .sheet { left: auto; top: 0; right: 0; bottom: 0; width: 440px; max-height: none; border-radius: 0; animation: slide .22s ease-out; }
  /* Wide screens: the place page sits beside the map, so the map stays usable (no dimming layer over it) */
  .sheet-backdrop { display: none; }
  .grabber { visibility: hidden; height: 0; }
}
.sheet-in {
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
}
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; }
.sheet-top { display: flex; align-items: flex-start; gap: 12px; padding-top: 14px; }
.sheet-top .dot { width: 48px; height: 48px; border-radius: 14px; background: var(--dot); flex: none; display: grid; place-items: center; }
.sheet-top .dot svg { width: 28px; height: 28px; }
.sheet-title { flex: 1; min-width: 0; }
.sheet-title h2 { margin: 0; font: 800 1.45rem/1.12 var(--font-display); overflow-wrap: anywhere; text-wrap: balance; }
.sheet-title p { margin: 4px 0 0; color: var(--ink-2); }
.close {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--surface-2); color: var(--ink); display: grid; place-items: center;
}
.close svg { width: 20px; height: 20px; }

.lede { margin: 12px 0 0; font-size: 1rem; line-height: 1.45; color: var(--ink); text-wrap: pretty; }

.policy {
  margin-top: 14px; border-radius: var(--r); padding: 12px 14px;
  background: color-mix(in srgb, var(--field) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--field) 25%, transparent);
}
.policy.p-outside, .policy.p-leashed, .policy.p-seasonal { background: color-mix(in srgb, var(--tag) 14%, var(--surface)); border-color: color-mix(in srgb, var(--tag) 40%, transparent); }
.policy strong { display: block; font: 700 1.05rem/1.2 var(--font-display); }
.policy p { margin: 3px 0 0; font-size: .92rem; color: var(--ink-2); }
.policy p.extra { color: var(--ink); }

.gallery { display: flex; gap: 10px; overflow-x: auto; margin: 14px -2px 0; padding: 0 2px 4px; scroll-snap-type: x mandatory; }
.gallery figure { margin: 0; flex: 0 0 82%; scroll-snap-align: start; min-width: 0; }
.gallery.one figure { flex-basis: 100%; }
.gallery a { display: block; position: relative; border-radius: var(--r); overflow: hidden; background: var(--surface-2); aspect-ratio: 16 / 10; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery a.video::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%;
  background: rgba(0,0,0,.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 28px no-repeat;
}
.gallery figcaption { font-size: .74rem; color: var(--ink-2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-top .dot.logo { background: #fff; border: 1px solid var(--line); overflow: hidden; }
.sheet-top .dot.logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }

.actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 14px; }
.act {
  display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  font-size: .8rem; cursor: pointer; text-align: center;
}
.act svg { width: 22px; height: 22px; color: var(--field); }
.act[aria-pressed="true"] svg { fill: var(--tag); color: var(--tag); }
.gmaps {
  display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 16px; border-radius: var(--r);
  background: var(--field); color: var(--field-ink); text-decoration: none;
}
.gmaps svg { width: 26px; height: 26px; flex: none; }
.gmaps strong { display: block; font-size: 1.02rem; }
.gmaps span { font-size: .86rem; opacity: .9; }

.facts { margin: 16px 0 0; display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.fact { display: grid; grid-template-columns: 24px 1fr; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.fact:first-child { border-top: 0; }
.fact svg { width: 20px; height: 20px; color: var(--ink-2); margin-top: 2px; }
.fact dt { font-size: .82rem; font-weight: 700; color: var(--ink-2); }
.fact dd { margin: 1px 0 0; overflow-wrap: anywhere; }
.fact dd a { font-weight: 700; }
.hours { margin: 2px 0 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.fact .copy {
  margin-left: 8px; border: 1px solid var(--line); background: transparent; border-radius: 8px;
  padding: 1px 8px; font-size: .8rem; cursor: pointer; color: var(--ink-2);
}
.fix { display: block; margin-top: 16px; font-size: .9rem; color: var(--ink-2); }
.fix a { color: var(--ink-2); }

/* ---------- Loading + toast ---------- */
.loading {
  position: absolute; inset: 0; z-index: 1000; background: var(--bg);
  display: grid; place-content: center; justify-items: center; text-align: center; gap: 4px; padding: 32px;
}
.loading-paw { width: 72px; height: 72px; fill: var(--field); stroke: none; animation: bob 1.1s ease-in-out infinite; }
.loading p { margin: 8px 0 0; font: 600 1.1rem/1.3 var(--font-display); max-width: 22rem; }
.loading .loading-sub { font: 400 .9rem/1.4 var(--font-body); color: var(--ink-2); margin-top: 2px; }
.loading.error .loading-paw { animation: none; fill: var(--ink-2); }
.toast {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(80px + var(--sab));
  z-index: 1100; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-size: .92rem; box-shadow: var(--shadow); max-width: calc(100% - 32px);
}

@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Suggest a place ---------- */
.suggest { display: grid; gap: 14px; }
.suggest h2, .suggest > p { margin-bottom: 0; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field legend { font-weight: 700; font-size: .95rem; padding: 0; }
.field b { color: var(--tag); }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px;
  padding: 10px 12px; min-height: 46px; font-size: 1rem;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--field); box-shadow: 0 0 0 3px color-mix(in srgb, var(--field) 25%, transparent); }
.field [aria-invalid="true"] { border-color: #d6336c; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 380px) { .row2 { grid-template-columns: 1fr; } }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label {
  display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 8px 14px; cursor: pointer;
}
.choices label:has(input:checked) { border-color: var(--field); background: color-mix(in srgb, var(--field) 12%, var(--surface)); font-weight: 700; }
.field .choices input { accent-color: var(--field); margin: 0; width: 18px; height: 18px; min-height: 0; padding: 0; border: 0; box-shadow: none; }
.app[data-view="suggest"] .search, .app[data-view="suggest"] .chips,
.app[data-view="about"] .search, .app[data-view="about"] .chips { display: none; }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--field); }
.form-error { color: #c2255c; font-weight: 700; margin: 0; }
.photo-pick { display: grid; place-items: center; gap: 8px; min-height: 120px; border: 2px dashed var(--line); border-radius: var(--r); padding: 12px; cursor: pointer; color: var(--field); font-weight: 700; text-align: center; overflow: hidden; }
.photo-pick:focus-within { border-color: var(--field); }
.photo-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-pick img { max-width: 100%; max-height: 260px; border-radius: 10px; object-fit: contain; }
.link-btn { justify-self: start; border: 0; background: none; color: var(--field); text-decoration: underline; font: inherit; padding: 0; cursor: pointer; }
.photo-field .check { align-items: flex-start; font-weight: 400; font-size: .92rem; }
.field .check input { width: 20px; height: 20px; min-height: 0; padding: 0; border: 0; box-shadow: none; flex: none; margin: 2px 0 0; accent-color: var(--field); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.small { font-size: .85rem; color: var(--ink-2); margin: 0 !important; }
.suggest .btn { justify-self: start; padding: 12px 26px; font-size: 1rem; }
.sent { text-align: center; padding-top: 48px; }
.sent-paw { width: 56px; height: 56px; fill: var(--field); stroke: none; }

/* ---------- Suggest an edit / report a place ---------- */
.fb-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.fb-btns .btn { margin: 0; padding: 9px 14px; font-size: .92rem; display: inline-flex; align-items: center; gap: 6px; }
.fb-btns svg { width: 18px; height: 18px; }
.fb-panel { margin-top: 16px; border: 1.5px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--surface); }
.fb-form { display: grid; gap: 12px; }
.fb-form h3 { margin: 0; font: 800 1.15rem/1.2 var(--font-display); }
.fb-form .small { margin: 0; }
.fb-reasons { flex-direction: column; align-items: stretch; }
.fb-reasons label { border-radius: 12px; }
.fb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-actions .btn { margin: 0; }
.fb-thanks { display: flex; gap: 12px; align-items: center; }
.fb-thanks .sent-paw { width: 40px; height: 40px; flex: none; }
.fb-thanks p { margin: 0; }

/* ---------- Owner: review suggestions ---------- */
.app[data-view="review"] .search, .app[data-view="review"] .chips { display: none; }
.review-tabs { display: flex; gap: 8px; }
.review-tabs .chip { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.review-tabs .chip[aria-pressed="true"] { background: var(--sun); color: var(--sun-ink); border-color: var(--sun); }
.rv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rv-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.rv-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rv-kind { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); }
.rv-card[data-kind="report"] .rv-kind { background: #ffe3e3; color: #a51d2d; }
.rv-card[data-kind="edit"] .rv-kind { background: #e7f0ff; color: #1c4f9c; }
.rv-card[data-kind="new"] .rv-kind { background: #e3f6ea; color: #1b6b3f; }
.rv-card h3 { margin: 8px 0 6px; font: 700 1.1rem/1.25 var(--font-body); overflow-wrap: anywhere; }
.rv-table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 6px 0 10px; }
.rv-table th { text-align: left; color: var(--ink-2); font-weight: 700; padding: 5px 8px 5px 0; vertical-align: top; width: 28%; }
.rv-table td { padding: 5px 6px; vertical-align: top; overflow-wrap: anywhere; }
.rv-table .was { color: var(--ink-2); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-2) 50%, transparent); }
.rv-table .now { font-weight: 700; background: color-mix(in srgb, var(--field) 10%, transparent); border-radius: 6px; }
.rv-table tr.sub td { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 700; background: none; text-decoration: none; }
.rv-actions { display: flex; gap: 8px; }
.rv-actions .btn { margin: 0; flex: 1; }
.rv-done { margin: 0 0 4px; font-weight: 700; }
.rv-done.approved { color: #1b6b3f; }
.rv-done.rejected { color: #a51d2d; }
@media (prefers-color-scheme: dark) {
  .rv-card[data-kind="report"] .rv-kind { background: #4a1d22; color: #ffb3b8; }
  .rv-card[data-kind="edit"] .rv-kind { background: #1c2f4d; color: #b4d0ff; }
  .rv-card[data-kind="new"] .rv-kind { background: #183a27; color: #a6e3bd; }
  .rv-done.approved { color: #7fd6a3; }
  .rv-done.rejected { color: #ff9aa2; }
}

/* Category pictures: the same drawing on map markers, list cards and place pages */
.dot svg.glyph { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.dot svg.glyph .f, .dot svg.glyph .f * { fill: #fff; stroke: none; }
/* Map markers: category icons when zoomed in */
.mk-wrap { background: none; border: 0; }
.mk { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.mk svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mk svg .f, .mk svg .f * { fill: #fff; stroke: none; }

/* Easter egg (Labrador Sea) */
.egg-pin { display: flex; align-items: flex-end; justify-content: center; background: none; border: 0; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); cursor: pointer; }
.egg-pin svg { display: block; animation: egg-wobble 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes egg-wobble { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-9deg); } 90% { transform: rotate(9deg); } 95% { transform: rotate(-5deg); } }
@media (prefers-reduced-motion: reduce) { .egg-pin svg { animation: none; } }
.egg-modal { position: fixed; inset: 0; z-index: 2000; background: rgba(15, 20, 25, .6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.egg-card { position: relative; background: #fff; color: #1d2b25; border-radius: 16px; max-width: 360px; width: 100%; max-height: 92vh; overflow: auto; padding: 0 0 18px; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.egg-card img { display: block; width: 100%; height: auto; max-height: 52vh; object-fit: cover; border-radius: 16px 16px 0 0; }
.egg-card h2 { margin: 14px 18px 6px; font-size: 1.25rem; }
.egg-card p { margin: 6px 18px; line-height: 1.45; }
.egg-card .egg-link { display: inline-block; margin: 10px 0 4px; }
.egg-card .egg-yt { background: #e03131; color: #fff; }
.egg-card .egg-credit { margin: 4px 12px 0; font-size: .72rem; color: #6c7a75; text-align: right; }
.egg-card .egg-credit a { color: inherit; }
.egg-close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); font-size: 24px; line-height: 1; cursor: pointer; }

/* Easter egg progress: toast, collection, celebration */
.egg-bar { height: 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin: 6px 0; }
.egg-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffd43b, #f08c00); transition: width .6s ease; }
.egg-toast { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 2100; width: min(360px, calc(100% - 24px));
  display: flex; gap: 10px; align-items: center; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 16px; box-shadow: var(--shadow); text-align: left; }
.egg-toast[hidden] { display: none; }
.egg-toast.show { animation: egg-toast-in .4s ease-out; }
@keyframes egg-toast-in { from { transform: translate(-50%, -30px); opacity: 0; } }
.egg-toast-paw { flex: none; width: 34px; height: 34px; fill: #ffd43b; }
.egg-toast-text { flex: 1; min-width: 0; display: grid; gap: 1px; font-size: .9rem; }
.egg-toast-text strong { font-size: 1rem; }
.egg-toast .egg-bar { background: rgba(255,255,255,.25); border-color: transparent; }
.egg-collection { margin: 0 0 10px; }
.egg-collection .egg-progress-text { margin: 0; font-size: 1.05rem; }
.egg-grid { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.egg-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; width: 100%; min-height: 96px; padding: 8px 4px 6px;
  background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); border-radius: 12px; font: inherit; font-size: .72rem; line-height: 1.2; text-align: center; }
.egg-tile span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
button.egg-tile { cursor: pointer; }
button.egg-tile:hover, button.egg-tile:focus-visible { border-color: var(--field); box-shadow: 0 0 0 2px var(--field); outline: none; }
.egg-tile.locked { background: var(--surface-2); color: var(--ink-2); border-style: dashed; }
.egg-tile.locked > svg:first-child { filter: grayscale(1); opacity: .45; }
.egg-tile .egg-lock { position: absolute; top: 24px; left: 50%; width: 22px; height: 22px; margin-left: -11px; filter: drop-shadow(0 0 2px rgba(255,255,255,.9)); }
.egg-modal.with-toast { padding-top: calc(128px + env(safe-area-inset-top, 0px)); }
.egg-modal.with-toast .egg-card { max-height: calc(100vh - 150px - env(safe-area-inset-top, 0px)); max-height: calc(100dvh - 150px - env(safe-area-inset-top, 0px)); }
.egg-card .egg-show { display: inline-block; margin: 6px 0 4px; }

.celebrate { position: fixed; inset: 0; z-index: 2200; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(circle at 50% 35%, rgba(255, 212, 59, .35), rgba(15, 20, 25, .88) 70%); }
.cele-card { position: relative; z-index: 1; width: 100%; max-width: 380px; max-height: 94vh; overflow: auto; text-align: center; background: #fff; color: #1d2b25; border-radius: 22px; padding: 14px 20px 22px; box-shadow: 0 12px 40px rgba(0,0,0,.4); }
.cele-dog { width: 150px; height: auto; display: block; margin: 0 auto -4px; }
.cele-tail { transform-box: fill-box; transform-origin: 0% 100%; animation: cele-wag .35s ease-in-out infinite alternate; }
@keyframes cele-wag { from { transform: rotate(-16deg); } to { transform: rotate(22deg); } }
.cele-card h2 { margin: 6px 0 4px; font: 800 2.2rem/1.1 var(--font-display); color: #c2410c; letter-spacing: .02em; animation: cele-pop .7s ease-out; }
@keyframes cele-pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
.cele-big { margin: 6px 0; font: 700 1.25rem/1.25 var(--font-display); }
.cele-sub { margin: 4px 0 14px; font-size: 1.05rem; }
.cele-bit { position: absolute; top: -16px; width: 10px; height: 16px; border-radius: 2px; opacity: .9; animation: cele-fall linear infinite; }
@keyframes cele-fall { from { transform: translate3d(0, 0, 0) rotate(0); } to { transform: translate3d(var(--drift), 112vh, 0) rotate(720deg); } }
.cele-paw { position: absolute; bottom: -60px; width: 44px; height: 44px; fill: #ffd43b; opacity: 0; animation: cele-paw 4.2s ease-in infinite; }
@keyframes cele-paw { 0% { transform: translateY(0) rotate(var(--tilt)); opacity: 0; } 15% { opacity: .85; } 85% { opacity: .85; } 100% { transform: translateY(-110vh) rotate(var(--tilt)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .cele-bits, .cele-paws { display: none; }
  .egg-toast.show, .cele-card h2, .cele-tail { animation: none; }
}

/* Been here with your dog? */
.fb-btns .visit-btn { flex-basis: 100%; justify-content: center; }

/* ---------- Amenity filters ---------- */
.chip-filter svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.fp-back { position: absolute; inset: 0; background: rgba(5, 15, 10, .45); z-index: 950; }
.fpanel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 951; display: flex; flex-direction: column;
  max-height: calc(100% - 40px - env(safe-area-inset-top, 0px));
  background: var(--bg); border-radius: 20px 20px 0 0; box-shadow: var(--shadow);
  padding: 4px max(16px, env(safe-area-inset-left, 0px)) calc(12px + var(--sab)) max(16px, env(safe-area-inset-right, 0px));
  animation: rise .22s ease-out;
}
.fpanel[hidden], .fp-back[hidden] { display: none; }
@media (min-width: 760px) {
  .fpanel { left: auto; top: 0; right: 0; bottom: 0; width: 400px; max-height: none; border-radius: 0; animation: slide .22s ease-out; }
}
.fp-head { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; }
.fp-head h2 { margin: 0; font: 800 1.35rem/1.2 var(--font-display); }
.fp-scope { margin: 4px 0 0; color: var(--ink-2); font-size: .9rem; }
.fp-scope:empty { display: none; }
.fp-body { overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; padding-bottom: 6px; }
.fgroup { border: 0; margin: 14px 0 0; padding: 0; }
.fgroup legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.fopts { display: flex; flex-wrap: wrap; gap: 8px; }
.fopt {
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 7px 12px; font: inherit; font-size: .92rem; cursor: pointer;
}
.fopt b { font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fopt[aria-pressed="true"] { background: var(--sun); border-color: var(--sun); color: var(--sun-ink); font-weight: 700; }
.fopt[aria-pressed="true"] b { color: inherit; opacity: .8; }
.fp-none { color: var(--ink-2); }
.fp-note { margin: 8px 0 0; font-size: .8rem; color: var(--ink-2); }
.fp-foot { display: flex; gap: 10px; padding-top: 10px; }
.fp-foot .btn { margin: 0; flex: 1; }
.fp-foot .btn:disabled { opacity: .45; cursor: default; }

/* Amenities on a place page */
.amen { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.amen li {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px;
  background: var(--surface-2); font-size: .88rem;
}
.amen svg { width: 15px; height: 15px; fill: none; stroke: var(--field); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.fb-am-g { margin: 10px 0 4px; font-size: .88rem; font-weight: 700; color: var(--ink-2); }
.fb-am { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; }
.fb-am label { display: flex; gap: 6px; align-items: center; font-size: .92rem; }
.field .fb-am input { accent-color: var(--field); margin: 0; width: 18px; height: 18px; min-height: 0; padding: 0; border: 0; box-shadow: none; flex: none; }

/* ---------- Settings ---------- */
.set-open { margin-left: auto; width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--head-ink); }
.set-open svg { width: 24px; height: 24px; }
.app[data-view="settings"] .search, .app[data-view="settings"] .chips { display: none; }
.app[data-view="settings"] .set-open { background: color-mix(in srgb, var(--head-ink) 18%, transparent); }
.settings .set-group { border: 0; padding: 0; margin: 22px 0 0; min-width: 0; }
.settings legend { font: 600 1.15rem/1.2 var(--font-display); padding: 0; margin-bottom: 10px; }
.themes { display: grid; gap: 8px; }
.theme-opt {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); padding: 10px 12px; position: relative;
}
.theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.theme-opt:has(input:checked) { border-color: var(--field); box-shadow: 0 0 0 2px var(--field); }
.theme-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.theme-opt:has(input:checked)::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12.5 4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.swatch { width: 64px; height: 44px; border-radius: 10px; overflow: hidden; display: grid; grid-template-rows: 16px 1fr; background: var(--sw-bg); border: 1px solid rgba(0,0,0,.15); position: relative; }
.swatch i { background: var(--sw-head); border-bottom: 1px solid rgba(0,0,0,.12); }
.swatch b { position: absolute; left: 8px; bottom: 7px; width: 26px; height: 11px; border-radius: 6px; background: var(--sw-sun); }
.swatch u { position: absolute; right: 7px; bottom: 7px; width: 14px; height: 11px; border-radius: 3px; background: #fff; }
.theme-text { display: grid; padding-right: 30px; }
.theme-text strong { font-size: 1rem; }
.theme-text span { font-size: .86rem; color: var(--ink-2); }
.set-cb { align-items: flex-start; font-weight: 700; }
.set-cb input { margin-top: 2px; flex: none; }
.settings .small { margin-top: 8px !important; }
.choices .t-l { font-size: 1.1rem; }
.choices .t-xl { font-size: 1.22rem; }
.choices input { accent-color: var(--field); }
#set-reset { margin-top: 26px; }

/* ---------- First-run tour (js/tour.js): five steps, a bouncing arrow points at each button ---------- */
.tour { position: fixed; inset: 0; z-index: 1500; font-family: var(--font-body); }
.tour[hidden] { display: none; }
.tour-shade { position: absolute; inset: 0; }
.tour.dim .tour-shade { background: rgba(6, 22, 24, .62); }
.tour-spot {
  position: absolute; display: none; padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer;
  box-shadow: 0 0 0 3px var(--sun), 0 0 0 9999px rgba(6, 22, 24, .62);
  transition: left .32s cubic-bezier(.3,.8,.3,1), top .32s cubic-bezier(.3,.8,.3,1), width .32s cubic-bezier(.3,.8,.3,1), height .32s cubic-bezier(.3,.8,.3,1);
}
.tour-spot::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; box-shadow: 0 0 0 3px var(--sun); animation: tour-ping 1.6s ease-out infinite; }
.tour-spot.big::after { animation: none; }
.tour-spot.big { box-shadow: 0 0 0 3px var(--sun), 0 0 0 9999px rgba(6, 22, 24, .38); }
@keyframes tour-ping { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.35); } }

.tour-arrow { position: absolute; display: none; width: 40px; height: 46px; pointer-events: none; animation: tour-bob-down .9s ease-in-out infinite; }
.tour-arrow.up { animation-name: tour-bob-up; }
.tour-arrow svg { width: 40px; height: 56px; margin-top: -5px; fill: none; stroke: var(--sun); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45)); }
.tour-arrow.up svg { transform: rotate(180deg); }
@keyframes tour-bob-down { 0%, 100% { transform: translateY(-6px); } 50% { transform: translateY(2px); } }
@keyframes tour-bob-up { 0%, 100% { transform: translateY(6px); } 50% { transform: translateY(-2px); } }

.tour-card {
  position: absolute; box-sizing: border-box; background: var(--surface); color: var(--ink); border-radius: 20px; padding: 18px 18px 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .35); transition: left .32s cubic-bezier(.3,.8,.3,1), top .32s cubic-bezier(.3,.8,.3,1), opacity .15s;
}
.tour.moving .tour-card { opacity: 0; }
.tour-card.nudge { animation: tour-nudge .35s; }
@keyframes tour-nudge { 20% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } 80% { transform: rotate(-1deg); } }
.tour-card h2 { font: 800 1.3rem/1.15 var(--font-display); margin: 10px 0 6px; padding-right: 70px; }
.tour-card p { margin: 0 0 14px; line-height: 1.45; color: var(--ink-2); }
.tour-card p strong { color: var(--ink); }
.tour-skip { position: absolute; top: 12px; right: 12px; border: 0; background: var(--surface-2); color: var(--ink); font: inherit; font-size: .85rem;
  padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.tour-ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--sun); color: var(--sun-ink); }
.tour-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tour-card.center { text-align: center; }
.tour-card.center h2 { padding: 0; font-size: 1.55rem; }
.tour-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tour-card.center .tour-foot { justify-content: center; }
.tour-paws { display: flex; gap: 4px; margin: 0 0 4px; padding: 0; list-style: none; flex: 0 0 100%; }
.tour-paws li { width: 9px; height: 9px; border-radius: 50%; background: var(--line); transition: background .2s, transform .2s; }
.tour-paws li.past { background: var(--field); }
.tour-paws li.now { background: var(--sun); transform: scale(1.35); box-shadow: 0 0 0 1.5px var(--sun-ink); }
.tour-count { font-size: .85rem; color: var(--ink-2); white-space: nowrap; margin-right: auto; }
.tour-count:empty, .tour-paws:empty { display: none; }
.tour-foot .btn { margin: 0; padding: 10px 18px; }
.tour-card.center .tour-next { padding: 12px 28px; font-size: 1.05rem; }
.tour-back[hidden], .tour-skip[hidden] { display: none; }
.tour.leaving { opacity: 0; transition: opacity .2s; }

.tour-finger { position: absolute; width: 44px; height: 44px; margin: -6px 0 0 -14px; pointer-events: none; z-index: 2;
  transition: left .45s cubic-bezier(.4,.1,.3,1), top .45s cubic-bezier(.4,.1,.3,1); }
.tour-finger svg { width: 100%; height: 100%; fill: #fff; stroke: #13302f; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45)); transition: transform .12s; }
.tour-finger::before { content: ""; position: absolute; left: 19px; top: 5px; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  background: var(--sun); opacity: 0; transform: scale(.3); }
.tour-finger.tap svg { transform: scale(.86) translateY(2px); }
.tour-finger.tap::before { animation: tour-tap .45s ease-out; }
@keyframes tour-tap { 0% { opacity: .9; transform: scale(.3); } 100% { opacity: 0; transform: scale(2.2); } }
/* Smaller boxes (John, 18 Nov): icon beside the title, tighter spacing, smaller buttons */
.tour-card { padding: 11px 13px 10px; border-radius: 16px; }
.tour-head { float: left; margin: 0 8px 0 0; }
.tour-ico { width: 28px; height: 28px; border-radius: 9px; }
.tour-ico svg { width: 17px; height: 17px; }
.tour-card h2 { font-size: 1.05rem; line-height: 28px; margin: 0 0 4px; padding: 0; }
.tour-card p { clear: left; font-size: .92rem; line-height: 1.35; margin: 0 0 9px; }
.tour-skip { position: static; background: none; padding: 6px 2px; font-size: .85rem; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.tour-paws { flex: 1; justify-content: center; margin: 0; gap: 3px; }
.tour-paws li { width: 7px; height: 7px; }
.tour-count { display: none; }
.tour-foot { flex-wrap: nowrap; gap: 6px; }
.tour-foot .btn { padding: 6px 13px; font-size: .88rem; }
.tour-arrow, .tour-arrow svg { width: 32px; }
.tour-arrow { height: 38px; }
.tour-arrow svg { height: 46px; }

@media (prefers-reduced-motion: reduce) {
  .tour-arrow, .tour-spot::after, .tour-card.nudge { animation: none; }
  .tour-spot, .tour-card { transition: none; }
}
