:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1d2420;
  --muted: #66706a;
  --border: #e4e2db;
  --accent: #2f6b4f;
  --accent-soft: #e3efe8;

  --m-ground: #eef1ea;

  /* Notices that need attention but aren't errors (e.g. no route from the
     visitor's location): soft amber. */
  --note-bg: #fdf6e8;
  --note-border: #f1dfb6;
  --note-icon-bg: #f8e7c2;
  --note-icon: #a8661a;
  --note-title: #5c3d10;
  --note-text: #6f5a3a;

  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .04), 0 8px 24px rgba(20, 30, 25, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614;
    --surface: #1a201d;
    --text: #e9ece8;
    --muted: #9aa49e;
    --border: #2a322e;
    --accent: #7cc5a0;
    --accent-soft: #20342a;

    --m-ground: #18201c;

    --note-bg: #2a2418;
    --note-border: #4a3d24;
    --note-icon-bg: #3d321d;
    --note-icon: #e3b366;
    --note-title: #f2dcaf;
    --note-text: #cbb894;

    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Site header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 16px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.brand-mark { width: 28px; height: 28px; flex-shrink: 0; }
.brand-mark rect, .brand-mark circle { fill: var(--accent); }
.brand-mark path { fill: var(--surface); }

/* EN / BS language switch */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.lang-switch button {
  min-width: 40px;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
}
.lang-switch[hidden] { display: none; }
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--surface); }
.lang-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* A faint illustrated map behind the top of the page, in the same style as
   the Driving/Walking pictures. The streets (::before) are fainter than the
   cemetery and walking route drawn over them (::after). It sits inside the
   search box's form and is positioned from it, so it moves with the search
   box (e.g. when a grave card opens and the heading shrinks) and the route
   always runs just below it. It's always drawn at full size, and is fainter
   behind the heading and search box, fading out at the top, the bottom and
   the sides of very wide screens. 285px is how far the search box sits below
   the top of the map (assets/hero-map.svg) in the design. */
.hero-bg {
  position: absolute;
  top: -285px;
  left: 50%;
  z-index: -1;
  width: 100vw;
  height: 640px;
  margin-left: -50vw;
  pointer-events: none;
  -webkit-mask-image:
    radial-gradient(ellipse 380px 220px at 50% 220px, rgba(0, 0, 0, .2), #000),
    linear-gradient(transparent, #000 60px, #000 35%, transparent),
    linear-gradient(90deg, transparent calc(50% - 700px), #000 calc(50% - 560px), #000 calc(50% + 560px), transparent calc(50% + 700px));
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(ellipse 380px 220px at 50% 220px, rgba(0, 0, 0, .2), #000),
    linear-gradient(transparent, #000 60px, #000 35%, transparent),
    linear-gradient(90deg, transparent calc(50% - 700px), #000 calc(50% - 560px), #000 calc(50% + 560px), transparent calc(50% + 700px));
  mask-composite: intersect;
}
/* 100vw includes the scroll bar, so the map is a little wider than the page;
   don't let that add a sideways scroll. */
body { overflow-x: clip; }
.hero-bg::before, .hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url(assets/hero-map.svg) center top / 1400px auto no-repeat;
  opacity: .3;
}
.hero-bg::after {
  background-image: url(assets/hero-cemetery.svg);
  opacity: .62;
}
@media (prefers-color-scheme: dark) {
  .hero-bg::before { opacity: .07; }
  .hero-bg::after { opacity: .16; }
}
/* On phones the middle of the map would show only streets; shift it so the
   end of the route and the pin show beside the search box. */
@media (max-width: 600px) {
  .hero-bg::before, .hero-bg::after { background-position: calc(50% - 190px) top; }
}

.wrap {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

/* ---------- Hero / search ---------- */

.hero {
  padding: 9vh 0 28px;
  text-align: center;
  transition: padding .35s ease;
}
body.has-detail .hero { padding-top: 24px; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font: 600 clamp(32px, 6vw, 48px)/1.1 Literata, Georgia, serif;
  letter-spacing: -.01em;
}

.lede {
  max-width: 480px;
  margin: 12px auto 28px;
  color: var(--muted);
}

/* A "Primjer" tag on sample records (from data.js). */
.sample-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: 2px;
}
.card-badge { display: none; margin: 0 0 8px; }
body.sample-data .card-badge { display: inline-block; }

.search {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}
.search input {
  width: 100%;
  padding: 18px 20px 18px 54px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 18px;
  box-shadow: var(--shadow);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow), 0 0 0 4px var(--accent-soft);
}
.search-icon {
  position: absolute;
  top: 50%;
  left: 20px;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---------- Results ---------- */

/* While searching, the page gets extra height *below the footer* so the search
   box can scroll to the top of the screen. --search-offset (set in app.js) is
   how far the search box is from the top of the page. Keeping the space at the
   very bottom means the cemetery-records card and footer stay right under the
   results, even when the search box is emptied. */
body.searching { min-height: calc(100vh + var(--search-offset, 0px)); }
body.searching .wrap { flex: none; }
body { overflow-anchor: none; }

.count, .empty {
  color: var(--muted);
  font-size: 14px;
}
.empty { text-align: center; padding: 24px 0; }

/* Placeholder rows while the records are still loading. */
.skeleton li { padding: 13px 16px; }
.skeleton span {
  display: block;
  width: 45%;
  height: 12px;
  border-radius: 6px;
  background: var(--border);
  animation: pulse 1s ease-in-out infinite alternate;
}
.skeleton span + span { width: 65%; height: 9px; margin-top: 8px; }
@keyframes pulse { to { opacity: .4; } }

/* One card with a divider between rows: name and place on the left,
   years on the right. */
.result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.result-list li + li { border-top: 1px solid var(--border); }
.result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  color: inherit;
  text-decoration: none;
  transition: background .15s;
}
/* Hover: a soft green row with a green bar on the left, and the arrow on
   the right darkens and nudges along. */
.result:hover, .result:focus-visible {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
  outline: none;
}
.result::after {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  margin: 0 2px 0 -2px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  color: var(--border);
  transform: rotate(45deg);
  transition: color .15s, transform .15s;
}
.result:hover::after, .result:focus-visible::after {
  color: var(--accent);
  transform: translateX(3px) rotate(45deg);
}
.r-main { flex: 1; min-width: 0; }
.r-name { display: block; font-weight: 600; line-height: 1.35; }
.result mark {
  padding: 0 1px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: inherit;
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--accent) 45%, transparent);
}
.r-place {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.r-dates {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Detail ---------- */

.detail { animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.back {
  margin-bottom: 12px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.back:hover { color: var(--text); }

.card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.person { padding: 28px 24px 24px; }
.person h2 {
  margin: 0;
  font: 600 clamp(28px, 5vw, 34px)/1.15 Literata, Georgia, serif;
  letter-spacing: -.01em;
}

/* Born / Passed away, side by side */
.life {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin: 16px 0 0;
}
.life dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.life dd { margin: 2px 0 0; font-size: 16px; }

/* Cemetery and place, set apart by a divider */
.where {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.where[hidden] { display: none; }
.where-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 50%;
  background: var(--accent-soft);
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
}
.where-cemetery { display: block; font-weight: 600; line-height: 1.3; }
.where-place { display: block; color: var(--muted); font-size: 15px; }

/* Satellite map (Mapbox via Leaflet): an inset card with a pin on the grave. */
.map-card {
  position: relative;
  isolation: isolate; /* keeps the map's own layers below the page's floating ones */
  margin: 0 24px;
  height: 340px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--m-ground);
  box-shadow: var(--shadow);
}
#grave-map { position: absolute; inset: 0; background: var(--m-ground); }
/* While a new spot's photos load: a soft shimmer over the map. */
.map-card::after {
  content: "";
  position: absolute;
  z-index: 500;
  inset: 0;
  background: var(--m-ground) linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%) 0 0 / 250% 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.map-card.loading::after { opacity: 1; transition: none; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.grave-pin svg { display: block; width: 30px; height: 42px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
.map-card .leaflet-control-attribution { font-size: 10px; }
.map-card .leaflet-bar a { color: #1d2420; }
/* Under the map while a walking route is shown (or being found). */
.walk-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 12px 24px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  font-size: 14px;
}
.walk-info[hidden] { display: none; }
.walk-info p { flex: 1 1 200px; margin: 0; }
.walk-info.busy p { color: var(--muted); }
.walk-info .walk-note { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.walk-info .walk-note[hidden] { display: none; }
.gate-label { padding: 2px 6px; border: 0; border-radius: 6px; background: #fff; color: #1d2420; font: 600 11px/1.3 Inter, system-ui, sans-serif; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.gate-label::before { display: none; }
/* The map inside the route card (a walking route through its graves). */
.route-map-slot:empty { display: none; }
.route-map-slot { margin: 0 0 14px; }
.route-map-slot .map-card { margin: 0; }
.route-map-slot .walk-info { margin: 12px 0 0; }
.stop-pin span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #ea4335;
  color: #fff;
  font: 700 13px/1 Inter, system-ui, sans-serif;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.walk-info a, .walk-hide { color: var(--accent); font: inherit; font-weight: 600; }
.walk-info a[hidden], .walk-hide[hidden] { display: none; }
.walk-hide { padding: 0; border: 0; background: none; cursor: pointer; }

/* Phones: "use two fingers" over the map after a one-finger drag. */
.map-hint {
  position: absolute;
  z-index: 950;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font: 600 16px/1.35 Inter, system-ui, sans-serif;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility 0s .3s;
  pointer-events: none;
}
.map-hint.show { opacity: 1; visibility: visible; transition: opacity .2s; }
.map-hint svg { width: 44px; height: 44px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* On the map, while a walk starts from a typed address: location is off. */
.map-flag {
  position: absolute;
  z-index: 1000;
  top: 10px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 120px);
  padding: 6px 12px 6px 9px;
  border-radius: 999px;
  background: var(--note-bg);
  color: var(--note-title);
  font: 600 13px/1.3 Inter, system-ui, sans-serif;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
  transform: translateX(-50%);
  pointer-events: none;
}
.map-flag[hidden] { display: none; }
.map-flag svg { flex-shrink: 0; width: 16px; height: 16px; fill: none; stroke: var(--note-icon); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* In full screen, below the back button. */
body.map-full .map-flag { top: calc(56px + env(safe-area-inset-top)); max-width: calc(100% - 32px); }
/* Full-screen map (setMapFull in app.js): the button on the map, and the
   one back to the page while it's full screen. */
.map-full-btn {
  position: absolute;
  z-index: 1000;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid rgba(0, 0, 0, .2);
  border-radius: 4px;
  background: #fff;
  background-clip: padding-box;
  color: #1d2420;
  cursor: pointer;
}
.map-full-btn:hover { background-color: #f4f4f4; }
.map-full-btn[hidden] { display: none; }
.map-full-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.map-exit {
  position: absolute;
  z-index: 1000;
  top: calc(12px + env(safe-area-inset-top));
  left: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px 8px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 600 14px/1 Inter, system-ui, sans-serif;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
  cursor: pointer;
}
.map-exit[hidden] { display: none; }
.map-exit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
body.map-full { overflow: hidden; }
body.map-full .map-box {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
body.map-full .map-card,
body.map-full .route-map-slot .map-card {
  flex: 1;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.map-full .walk-info,
body.map-full .route-map-slot .walk-info {
  margin: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-radius: 0;
}
/* Leaflet's zoom buttons move down, clear of the back button. */
body.map-full .leaflet-top { top: calc(48px + env(safe-area-inset-top)); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 24px 20px;
}
#panel-map { padding-bottom: 24px; }
.btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--surface);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.btn[hidden] { display: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-secondary { background: transparent; color: var(--accent); }
.btn-secondary[aria-pressed="true"] { background: var(--accent-soft); }


/* ---------- Directions popup ---------- */

.sheet {
  width: min(440px, calc(100% - 32px));
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 48px rgba(20, 30, 25, .2);
}
.sheet[open] { animation: rise .2s ease; }
.sheet::backdrop {
  background: rgba(20, 30, 25, .4);
  backdrop-filter: blur(2px);
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.sheet-head h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.sheet-sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.sheet-head form { margin: -4px -4px 0 0; }
.sheet-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sheet-close:hover { background: var(--border); color: var(--text); }
/* In the Driving/Walking popup when there's no route from the visitor. */
.sheet-msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--note-border);
  border-radius: 12px;
  background: var(--note-bg);
  color: var(--note-text);
  font-size: 13px;
  line-height: 1.45;
}
.sheet-msg[hidden] { display: none; }
.sheet-msg strong { display: block; margin-bottom: 1px; color: var(--note-title); font-size: 14px; font-weight: 600; }
.sheet-msg-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 50%;
  background: var(--note-icon-bg);
  fill: none;
  stroke: var(--note-icon);
  stroke-width: 2;
  stroke-linejoin: round;
}
/* "Location is needed" popup */
.sheet-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Two tiles side by side: a small map preview on top, icon and label below. */
.sheet-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.opt {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.opt:hover, .opt:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  outline: none;
}
.opt-art {
  height: 96px;
  border-bottom: 1px solid var(--border);
  background-size: cover;
  /* The pin sits on the right of each picture; keep it in view. */
  background-position: right center;
}
/* Without location (.by-address): the two options are a choice, marked
   with a tick on the chosen one, and an address field follows. */
.by-address .opt { position: relative; cursor: pointer; }
.by-address .opt:hover, .by-address .opt:focus-visible { transform: none; }
.by-address .opt[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.by-address .opt::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px; /* the pictures' pins are on the right */
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, .25);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.by-address .opt[aria-checked="true"]::after {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.sheet-address { margin: 18px 0 0; }
.sheet-address[hidden] { display: none; }
.sheet-address label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.sheet-address input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px or more: phones don't zoom in on it */
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.sheet-address input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.addr-error { margin: 8px 0 0; color: #b3261e; font-size: 14px; }
.addr-error[hidden] { display: none; }
.addr-start { display: flex; justify-content: center; width: 100%; margin-top: 16px; padding: 12px 18px; font-weight: 600; }
.addr-start.busy { opacity: .7; pointer-events: none; }
.opt-art-driving { background-image: url("assets/map-demo.svg"); }
.opt-art-walking { background-image: url("assets/walking-demo.svg"); }
.opt-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 600;
}
.opt-label svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* On phones the popup becomes a sheet that slides up from the bottom. */
@media (max-width: 520px) {
  .sheet {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 20px 20px 0 0;
  }
  .sheet[open] { animation: slide-up .25s ease; }
  .opt-art { height: 84px; }
}
@keyframes slide-up { from { transform: translateY(100%); } }

/* ---------- "Did you find it?" prompt ---------- */

.feedback {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 20;
  width: min(420px, calc(100% - 32px));
  padding: 18px 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(20, 30, 25, .18);
  transform: translateX(-50%);
  animation: fb-in .3s ease;
}
.feedback[hidden] { display: none; }
.feedback:focus, .fb-thanks:focus { outline: none; }
@keyframes fb-in { from { opacity: 0; transform: translate(-50%, 16px); } }

.fb-title { margin: 0 32px 0 0; font-weight: 600; line-height: 1.35; }
.fb-sub { margin: 4px 0 14px; color: var(--muted); font-size: 14px; }
.fb-actions { display: flex; gap: 8px; }
.fb-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
@media (max-width: 400px) {
  .fb-btn { gap: 6px; padding: 10px 8px; font-size: 14px; }
}
.fb-btn:hover, .fb-btn:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}
.fb-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.fb-thanks { margin: 0 32px 0 0; font-weight: 500; }
.fb-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.fb-close:hover { background: var(--bg); color: var(--text); }
.fb-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Route ---------- */

.route {
  margin-top: 24px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.route[hidden] { display: none; }
.route-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.route-head h2 { margin: 0; font: 600 20px/1.2 Literata, Georgia, serif; }
.route-count { color: var(--muted); font-size: 14px; }
.route-clear {
  margin-left: auto;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.route-clear:hover { color: var(--text); }

.route-hint { margin: -6px 0 6px; color: var(--muted); font-size: 13px; }
.route-list { margin: 0 0 16px; padding: 0; list-style: none; }
.route-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.route-list li + li { border-top: 1px solid var(--border); }
.route-num {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--surface);
  font-size: 13px;
  font-weight: 600;
}
.route-name { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.route-name:hover .route-person { color: var(--accent); }
.route-person { display: block; font-weight: 600; line-height: 1.3; }
.route-place {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.route-ctrl { flex-shrink: 0; display: flex; gap: 2px; }
.route-ctrl button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.route-ctrl button:hover:not(:disabled) { background: var(--bg); color: var(--text); }
.route-ctrl svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.route-note { margin: -4px 0 14px; color: var(--muted); font-size: 13px; }

@media (max-width: 520px) {
  .route { padding: 18px 16px; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
  .route-start { width: 100%; justify-content: center; }
}

/* Floating "Your route" button */
.route-fab {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 10px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--surface);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(20, 30, 25, .25);
  cursor: pointer;
  animation: fab-in .25s ease;
}
.route-fab[hidden] { display: none; }
@keyframes fab-in { from { opacity: 0; transform: translateY(12px); } }
.route-fab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.route-fab-count {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Add a burial record ---------- */

.submit {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.submit-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 50%;
  background: var(--accent-soft);
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.submit-text { flex: 1; min-width: 0; }
.submit h2 { margin: 0; font-size: 17px; }
.submit p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.submit-btn { flex-shrink: 0; }

@media (max-width: 520px) {
  .submit { flex-wrap: wrap; padding: 20px; }
  .submit-text { flex-basis: calc(100% - 60px); }
  .submit-btn { width: 100%; justify-content: center; }
}

/* ---------- Text pages (privacy) ---------- */

.page { max-width: 680px; padding-top: 24px; }
.page h1 { margin: 8px 0 12px; text-align: left; }
.page .lede { max-width: none; margin: 0 0 8px; }
.page h2 { margin: 32px 0 8px; font: 600 21px/1.25 Literata, Georgia, serif; }
.page p, .page li { color: var(--text); }
.page ul { padding-left: 20px; }
.page li + li { margin-top: 6px; }
.page a:not(.back) { color: var(--accent); }
.page .back { display: inline-block; color: var(--muted); text-decoration: none; }
.page .back:hover { color: var(--text); }
.page .updated { margin-top: 32px; color: var(--muted); font-size: 14px; }

/* ---------- Footer ---------- */

/* A thin divider and the small logo mark the end of the page. */
.footer {
  width: calc(100% - 32px); /* lines up with the cards above */
  max-width: 728px;
  margin: 0 auto;
  padding: 24px 0 32px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.footer-mark {
  display: block;
  width: 24px;
  height: 24px;
  margin: 0 auto 12px;
}
.footer-mark rect, .footer-mark circle { fill: var(--accent); }
.footer-mark path { fill: var(--surface); }
.footer p { margin: 0 auto; }
.footer p + p { margin-top: 10px; }
.footer .about { max-width: 520px; line-height: 1.6; }
.footer a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 520px) {
  .hero { padding-top: 5vh; }
  .r-place { white-space: normal; }
  .person { padding: 20px; }
  .actions { padding: 0 20px 16px; }
  #panel-map { padding-bottom: 20px; }
  .map-card { margin: 0 20px; height: 300px; }
  .walk-info { margin: 10px 20px 0; }
}

/* Test-location dropdown (local preview, or ?test-location only). */
.test-location {
  position: fixed;
  z-index: 30;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border: 1px dashed #c47f00;
  border-radius: 10px;
  background: #fff7e6;
  color: #6b4500;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.test-location select { font: inherit; font-weight: 500; }
