/* ---------- Design tokens ----------
   The floating overlays (nav, toasts, panels, Leaflet controls) all need to know
   where the nav sits. These drive every offset so they can't drift apart. */
:root {
  --brand: #0077be;
  --brand-2: #0099cc;
  --ink: #0f172a;
  --muted: #5a6b80;

  --nav-top: 16px;
  --nav-height: 56px;
  --nav-bottom: calc(var(--nav-top) + var(--nav-height));

  /* Marker categories - kept close to the previous hues so existing users
     still recognise them at a glance. */
  --cat-waypoints: #0077be;
  --cat-boat-ramp: #dc2626;
  --cat-camping: #15803d;
  --cat-diving: #ea580c;
  --cat-photos: #7c3aed;

  /* Sponsored business listings - deep enough to read as a label on white,
     and nowhere near any category hue. */
  --sponsor-gold: #c8901b;

  --line: rgba(0, 119, 190, 0.15);
  --surface-tint: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);

  --tap-target: 44px;
  --shadow-raised: 0 10px 30px rgba(15, 23, 42, 0.15);
  --shadow-panel: 0 16px 44px rgba(15, 23, 42, 0.18);

  --z-map-control: 800;
  --z-scrim: 1000;
  --z-panel: 1100;
  --z-nav: 1200;
  --z-toast: 1300;
  --z-status: 1400;
}

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

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  color: var(--ink);
  background: #fff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Map ---------- */
#map {
  height: 100vh;  /* fallback */
  height: 100dvh; /* avoids the mobile address-bar jump */
  width: 100%;
}

/* ---------- Leaflet controls ---------- */
.leaflet-top.leaflet-left {
  top: 12px;
  left: 12px;
}

.leaflet-touch .leaflet-bar,
.leaflet-bar {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-raised);
}

.leaflet-touch .leaflet-bar a,
.leaflet-bar a {
  display: grid;
  place-items: center;
  width: var(--tap-target);
  height: var(--tap-target);
  line-height: 1;
  border: none;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  color: var(--ink);
  font-size: 20px;
  font-weight: 400;
  transition: background 0.15s ease, color 0.15s ease;
}

.leaflet-bar a:last-child {
  border-bottom: none;
}

.leaflet-bar a:hover {
  background: rgba(0, 119, 190, 0.08);
  color: var(--brand);
}

.leaflet-bar a:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: -2px;
}

/* The locate control is its own bar, so give it breathing room under zoom. */
.sc-locate {
  margin-top: 10px !important;
}

/* On phones, move the zoom + locate stack to the bottom-left. Under the nav it
   sat at exactly the height popups open at, so the control column covered the
   left edge of every popup near the top of the screen - and bottom-left is the
   easier reach one-handed anyway. */
@media (max-width: 560px) {
  .leaflet-top.leaflet-left {
    top: auto;
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }
}

/* ========== Panels (explore + trip planner) ==========
   One base, two modifiers. Visibility is CSS-only - transitioning `visibility`
   alongside opacity/transform means no display toggling and no setTimeout. */
.panel {
  position: fixed;
  z-index: var(--z-panel);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-panel);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}

/* `hidden` is the closed state; the UA display:none rule is overridden so the
   panel can animate out rather than vanishing. */
.panel[hidden] {
  display: flex;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  /* Hold visibility until the fade-out finishes */
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s 0.18s;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  flex-shrink: 0;
}

.panel-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--brand);
}

.panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-target);
  height: var(--tap-target);
  flex-shrink: 0;
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.panel-close:hover {
  background: rgba(0, 119, 190, 0.08);
  border-color: var(--brand);
  color: var(--brand);
}

.panel-close:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

.panel-body {
  overflow-y: auto;
  /* Nothing in a panel should ever scroll sideways. */
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 0 20px 20px;
  -webkit-overflow-scrolling: touch;
}

/* ---------- Pinned panel actions ----------
   The button that undoes a panel is the one you should never have to scroll to
   find, so it rides at the top of the scrolling body rather than at the end of
   it - the same place the trip planner already puts Share/GPX/Clear.

   Pulled back out to the body's 20px inset, because rows passing underneath
   would otherwise show through the button's rounded corners.

   It carries the panel's own translucent white rather than a flat #fff: over a
   dark stretch of bay the 3% difference reads as a seam across the panel, which
   is far more visible than anything showing through. The blur is what pays for
   that 3% - the rows sliding behind are smeared rather than ghosting past. */
.panel-sticky-actions {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 -20px 12px;
  padding: 0 20px 10px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
}

/* Grab handle - only meaningful in the mobile sheet */
.panel-grip { display: none; }

/* ---------- Desktop: right-hand card ---------- */
@media (min-width: 769px) {
  .panel {
    top: calc(var(--nav-bottom) + 12px);
    right: 16px;
    width: 340px;
    max-height: calc(100dvh - var(--nav-bottom) - 32px);
    border: 1px solid rgba(0, 119, 190, 0.12);
    border-radius: 18px;
  }

  .panel[hidden] {
    transform: translateX(12px);
  }
}

/* ---------- Mobile: bottom sheet ---------- */
@media (max-width: 768px) {
  .panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 78dvh;
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .panel[hidden] {
    transform: translateY(16px);
  }

  .panel-grip {
    display: block;
    width: 40px;
    height: 4px;
    margin: 10px auto 2px;
    border-radius: 2px;
    background: rgba(15, 23, 42, 0.18);
    flex-shrink: 0;
  }

  .panel-header {
    padding-top: 8px;
  }
}

/* ---------- Scrim ---------- */
.panel-scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-scrim);
  background: rgba(15, 23, 42, 0.35);
  opacity: 1;
  transition: opacity 0.18s ease, visibility 0s;
}

.panel-scrim[hidden] {
  display: block;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0s 0.18s;
}

/* On desktop the panel is a side card, so the scrim only needs to catch
   outside clicks - it shouldn't dim the map. */
@media (min-width: 769px) {
  .panel-scrim {
    background: transparent;
    /* The side panel isn't modal on desktop - keep the map interactive so you
       can filter and inspect markers at the same time. */
    pointer-events: none;
  }
}

/* ---------- Panel scrollbars ---------- */
.panel-body::-webkit-scrollbar {
  width: 10px;
}
.panel-body::-webkit-scrollbar-thumb {
  background: rgba(0, 119, 190, 0.3);
  border-radius: 10px;
}
.panel-body::-webkit-scrollbar-track {
  background: rgba(0, 119, 190, 0.05);
  border-radius: 10px;
}

/* ---------- Search ---------- */
.panel-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.panel-search-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.panel-search-input {
  width: 100%;
  min-height: var(--tap-target);
  padding: 10px 40px 10px 38px;
  border: 2px solid rgba(0, 119, 190, 0.18);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
}

.panel-search-input::-webkit-search-cancel-button { display: none; }

.panel-search-input:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(0, 153, 204, 0.15);
}

.panel-search-clear {
  position: absolute;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.panel-search-clear:hover { background: rgba(15, 23, 42, 0.06); color: var(--ink); }
.panel-search-clear[hidden] { display: none; }

/* ---------- Search results ---------- */
.search-results {
  list-style: none;
  margin: 0 0 12px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  max-height: 260px;
  overflow-y: auto;
}

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

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--tap-target);
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.search-result:hover { background: rgba(0, 119, 190, 0.08); }

.search-result:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: -2px;
}

.search-result-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-empty,
.search-more {
  padding: 10px 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ========== Panel tabs (Filters / Nearby list) ========== */
.panel-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(0, 119, 190, 0.07);
}

.panel-tab {
  min-height: 36px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.panel-tab[aria-selected="true"] {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.panel-tab:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

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

/* ---------- Result total ---------- */
.filter-total {
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- Standalone filter block (distance) ---------- */
.filter-block {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-tint);
}

.filter-block-title {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--brand);
}

/* ---------- Chips ---------- */
.filter-group-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 38px;
  padding: 0 14px;
  border: 1.5px solid rgba(0, 119, 190, 0.25);
  border-radius: 19px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip:hover { border-color: var(--brand-2); background: rgba(0, 119, 190, 0.06); }

.chip[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  border-color: transparent;
  color: #fff;
}

.chip:focus-visible,
.seg:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

/* ---------- Segmented control ---------- */
.segmented {
  display: flex;
  border: 1.5px solid rgba(0, 119, 190, 0.25);
  border-radius: 10px;
  overflow: hidden;
}

.seg {
  flex: 1;
  min-height: 38px;
  padding: 0 10px;
  border: none;
  border-right: 1px solid rgba(0, 119, 190, 0.18);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.seg:last-child { border-right: none; }
.seg:hover { background: rgba(0, 119, 190, 0.06); }

.seg[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
}

/* ========== Category filter rows ==========
   Every section used to be an accordion: a <button> wrapping a <label> wrapping
   a checkbox (invalid, and unreliable for screen readers), with a caret over an
   empty body on five of the six. A row is now just a row; only sections that
   really have sub-filters get a disclosure button. */
.accordion {
  display: grid;
  gap: 8px;
}

.filter-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-tint);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-section:hover {
  border-color: rgba(0, 119, 190, 0.3);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  min-height: var(--tap-target);
}

.category-toggle {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--brand);
}

.filter-row-label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 6px 0;
  cursor: pointer;
  user-select: none;
}

.filter-row-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.category-count {
  min-width: 26px;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(0, 119, 190, 0.1);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.filter-row-note {
  margin: -4px 14px 10px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
}

/* ---------- Disclosure ---------- */
.accordion-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--brand-2);
  cursor: pointer;
}

.accordion-toggle:hover { background: rgba(0, 119, 190, 0.1); }

.accordion-toggle:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: -2px;
}

.accordion-caret {
  transition: transform 0.25s ease;
}

.filter-section.open .accordion-caret {
  transform: rotate(180deg);
}

.section-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 14px;
  transition: max-height 0.25s ease, opacity 0.25s ease, padding 0.25s ease;
}

.filter-section.open .section-body {
  max-height: 600px;
  opacity: 1;
  padding: 0 14px 14px;
}

.filter-group {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

/* ========== Nearby list ========== */
.list-origin {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

.link-btn {
  border: none;
  background: none;
  padding: 0;
  color: var(--brand);
  font: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.location-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.loc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--tap-target);
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(0, 119, 190, 0.04);
  font: inherit;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.loc-row:hover {
  background: rgba(0, 119, 190, 0.09);
  border-color: rgba(0, 119, 190, 0.2);
}

.loc-row:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 1px;
}

.loc-text {
  flex: 1;
  min-width: 0;
  display: grid;
}

.loc-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 600;
}

.loc-meta {
  font-size: 0.74rem;
  color: var(--muted);
}

.loc-flag {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.25);
  color: #854d0e;
  font-size: 0.68rem;
  font-weight: 700;
}

.loc-chevron {
  flex-shrink: 0;
  color: var(--muted);
}

.loc-empty {
  padding: 24px 8px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted);
}

.loc-more {
  width: 100%;
  min-height: 40px;
  margin-top: 4px;
  border: 1.5px dashed rgba(0, 119, 190, 0.3);
  border-radius: 10px;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
}

.loc-more:hover { background: rgba(0, 119, 190, 0.06); }

/* ---------- Reset filters ----------
   Lives at the top of the filters view now, inside .panel-sticky-actions, which
   owns the spacing - hence no margin of its own. */
.clear-filters {
  width: 100%;
  min-height: var(--tap-target);
  margin: 0;
  padding: 10px 16px;
  border-radius: 10px;
  border: 2px solid rgba(0, 119, 190, 0.18);
  background: #fff;
  color: var(--brand);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.clear-filters:hover {
  background: rgba(0, 119, 190, 0.1);
  border-color: var(--brand-2);
}

.clear-filters:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

/* The build stamp used to float over the map in monospace, which read as debug
   output left in by accident. */
.panel-footnote {
  margin: 16px 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
}

/* A second footnote holds the Terms and Privacy links. There is no global `a`
   rule in this file, so without this they would come up browser-blue against
   the muted line around them. */
.panel-footnote + .panel-footnote { margin-top: 4px; }
.panel-footnote a { color: inherit; text-decoration: underline; }

/* ---------- Home button ---------- */
.home-button {
  position: fixed;
  bottom: 50px;
  right: 20px;
  z-index: var(--z-map-control);
  display: inline-block;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.home-button img {
  display: block;
  width: 60px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.home-button:hover {
  transform: scale(1.1);
}

.home-button:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 4px;
}

@media (max-width: 768px) {
  .home-button { bottom: 28px; right: 12px; }
  .home-button img { width: 46px; }
}

/* ========== Toasts ========== */
.toast-container {
  position: fixed;
  top: calc(var(--nav-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.toast {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  padding: 12px 20px;
  border-radius: 24px;
  box-shadow: 0 4px 12px rgba(0, 119, 190, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-20px) scale(0.9);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  max-width: min(90vw, 420px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.hide {
  opacity: 0;
  transform: translateY(-20px) scale(0.9);
}

/* Toast type variants. `type` is applied as a class by ToastNotification.processQueue;
   without these every toast rendered as the same blue pill. */
.toast.success {
  background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.3);
}

.toast.warning {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.3);
}

.toast.error {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.3);
}

/* ========== Loading / error state ========== */
.app-status {
  position: fixed;
  inset: 0;
  z-index: var(--z-status);
  display: grid;
  place-items: center;
  background: rgba(248, 250, 252, 0.75);
  backdrop-filter: blur(2px);
}

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

.app-status-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 36px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-panel);
  text-align: center;
  max-width: min(90vw, 360px);
}

.app-status-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0, 119, 190, 0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

.app-status-text {
  margin: 0;
  font-weight: 500;
  color: var(--ink);
}

.app-status-retry {
  min-height: var(--tap-target);
  padding: 0 22px;
  border: none;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.app-status-retry:hover { background: #005a8f; }
.app-status-retry[hidden] { display: none; }

/* ========== Confirmation dialog ========== */
.dialog-host {
  position: fixed;
  inset: 0;
  z-index: var(--z-status);
  display: grid;
  place-items: center;
}

.dialog-host[hidden] { display: none; }

.dialog-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.dialog {
  position: relative;
  width: min(92vw, 400px);
  padding: 24px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-panel);
}

.dialog-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.dialog-message {
  margin: 0 0 20px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dialog-btn {
  min-height: var(--tap-target);
  padding: 0 18px;
  border: 1.5px solid rgba(15, 23, 42, 0.15);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.dialog-btn:hover { background: rgba(15, 23, 42, 0.05); }

.dialog-btn:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

.dialog-confirm {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
}

.dialog-confirm.danger {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
}

.dialog-confirm:hover { filter: brightness(1.05); }

@media (prefers-reduced-motion: reduce) {
  .panel,
  .panel-scrim,
  .toast,
  .section-body,
  .accordion-caret,
  .loc-row,
  .home-button {
    transition-duration: 0.01ms;
  }
  .app-status-spinner { animation-duration: 2s; }
}
