/*
 * Ocala Studio & Gallery Tour — the passport's look.
 *
 * Taken from the tour's own rack card, so the thing on the wall and the thing
 * on the phone are obviously the same event:
 *
 *   red, black and white, and nothing else doing the talking;
 *   a heavy uppercase grotesk for STUDIO & GALLERY TOUR, with OCALA stacked
 *     letter by letter beside it;
 *   a round geometric sans for everything anyone actually reads;
 *   a hand-lettered marker for the asides — "scan to see", "follow us";
 *   halftone dots fading off the red, a black wave that cuts it off, the map
 *     pin, the flag.
 *
 * Fonts are the one network cost this app now pays before first paint, and
 * `display=swap` keeps it honest: the system face renders immediately and the
 * brand face replaces it when it lands, so a scan in a doorway is never
 * waiting on a typeface.
 */

/* `hidden` always wins. Without this, anything given its own display (flex,
   grid) ignores the attribute and shows up empty, which is how the directions
   banner once sat on the map as a black bar. */
[hidden] { display: none !important; }

:root {
  color-scheme: light dark;

  --red: #d6262c;
  --red-deep: #a81c21;
  --red-wash: #fbe9ea;
  --black: #111111;
  --white: #ffffff;

  --paper: #ffffff;
  --wash: #f5f4f2;
  --card: #ffffff;
  --ink: #111111;
  --ink-soft: #585858;
  --line: #e5e5e5;
  --good: #1f7a4d;

  /* Older names, kept so every screen speaks the brand without a rename. */
  --stamp: var(--red);
  --brass: var(--red);

  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 10px 30px rgba(0, 0, 0, .08);

  --display: "Archivo", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --sans: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "Caveat Brush", "Marker Felt", "Comic Sans MS", cursive;
  /* The serif is gone; the name survives for any rule still asking for it. */
  --serif: var(--sans);

  --radius: 16px;
  --tab-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --red: #ef3e44;
    --red-deep: #d6262c;
    --red-wash: #2a1415;
    --paper: #0d0d0d;
    --wash: #141414;
    --card: #181818;
    --ink: #f5f5f5;
    --ink-soft: #a8a8a8;
    --line: #2a2a2a;
    --good: #4cc38a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}

.wrap { max-width: 560px; margin: 0 auto; padding-inline: 18px; }

h1, h2, h3 { margin: 0; font-family: var(--sans); font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
h1 { font-family: var(--display); font-weight: 900; font-size: 30px; text-transform: uppercase; letter-spacing: -.01em; line-height: 1; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }
a { color: inherit; }

.muted { color: var(--ink-soft); }
.small { font-size: 13.5px; }
.tiny { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.hand { font-family: var(--hand); font-weight: 400; letter-spacing: .02em; }

/* ============================================================ the brand === */

/* OCALA stacked letter by letter beside STUDIO & GALLERY TOUR. */
.lockup {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.lockup .ocala {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: var(--display);
  font-weight: 800;
  font-size: .3em;
  line-height: 1;
  color: var(--black);
  padding: .08em 0 .12em;
  text-align: center;
}
.lockup .words {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: .95;
  letter-spacing: -.01em;
}
.lockup .words span { display: block; }

/* The red field with dots fading off its corner and a black wave under it. */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--red);
  color: var(--white);
  padding: 22px 18px 58px;
  margin-bottom: 18px;
}
.hero .inner { max-width: 560px; margin: 0 auto; position: relative; z-index: 1; }
.hero .lockup { font-size: 40px; }
.hero .tagline { font-weight: 600; font-size: 15px; line-height: 1.3; margin-top: 12px; max-width: 18em; }

.halftone {
  position: absolute;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--black) 1.3px, transparent 1.7px);
  background-size: 7px 7px;
  -webkit-mask-image: radial-gradient(ellipse at 0% 100%, #000 10%, transparent 68%);
  mask-image: radial-gradient(ellipse at 0% 100%, #000 10%, transparent 68%);
}
.hero .halftone { left: 0; bottom: 0; width: 70%; height: 90%; opacity: .75; }

.wave {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  width: 100%;
  height: 46px;
  display: block;
}
.wave .black { fill: var(--black); }
.wave .ground { fill: var(--paper); }

/* A shorter band for the secondary screens. */
.band {
  background: var(--red);
  color: var(--white);
  position: relative;
  overflow: hidden;
  padding: 18px 18px 40px;
  margin-bottom: 14px;
}
.band .inner { max-width: 560px; margin: 0 auto; position: relative; z-index: 1; }
.band .halftone { right: 0; top: 0; width: 55%; height: 100%; opacity: .55;
  -webkit-mask-image: radial-gradient(ellipse at 100% 0%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse at 100% 0%, #000 10%, transparent 70%); }
.band .wave { height: 30px; }
.band h1 { font-size: 34px; }
.band .tiny { color: rgba(255, 255, 255, .85); }

.masthead { padding: 20px 0 14px; }
.masthead .tiny { color: var(--red); }

/* ================================================================= cards == */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card + .card { margin-top: 12px; }
.card-body { padding: 18px; }

/* ============================================================== progress == */

.progress { padding: 20px 16px 14px; text-align: center; }
.progress .count { font-family: var(--display); font-weight: 900; font-size: 46px; line-height: 1; }
.progress .count small { font-size: 20px; color: var(--ink-soft); }

.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 14px 0 4px; }
.bar > i { display: block; height: 100%; background: var(--red); border-radius: 99px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }

.dial { position: relative; width: 172px; height: 172px; margin: 6px auto 4px; }
.dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial .track { fill: none; stroke: var(--line); stroke-width: 9; }
.dial .fill { fill: none; stroke: var(--red); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.2, .9, .25, 1); }
.dial .inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dial .num { font-family: var(--display); font-weight: 900; font-size: 58px; line-height: .9; }
.dial .of { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-top: 6px; }

.card.paper { position: relative; }
.card.paper::before {
  content: ''; position: absolute; right: 0; top: 0; width: 45%; height: 60%;
  background-image: radial-gradient(circle, var(--red) 1.1px, transparent 1.5px);
  background-size: 7px 7px; opacity: .22; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse at 100% 0%, #000 5%, transparent 70%);
  mask-image: radial-gradient(ellipse at 100% 0%, #000 5%, transparent 70%);
}

/* ================================================================= stamps == */

.stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; padding: 4px 16px 18px; position: relative; align-items: stretch; }

/* Square when the name is short; taller when a full name needs more lines.
   Every name is shown whole — the grid row grows rather than cutting it off. */
.stamp-slot {
  position: relative;
  overflow: hidden;
  min-height: 96px;
  border-radius: 14px;
  border: 1.5px dashed var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; padding: 6px;
  text-align: center; font-size: 10.5px; font-weight: 500; line-height: 1.2;
  color: var(--ink-soft); background: var(--card);
  cursor: pointer; text-decoration: none;
}
.stamp-slot.got { border: 1.5px solid var(--red); background: var(--red-wash); color: var(--ink); }
.stamp-slot .mark {
  font-family: var(--display); font-weight: 900; font-size: 17px;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2.5px solid currentColor; color: var(--ink-soft);
}
.stamp-slot:not(.got) .mark { border-style: dashed; opacity: .4; }
.stamp-slot.got .mark { color: var(--red); transform: rotate(-9deg); }

/* A custom stamp replaces the ring and letters with the organiser's art. */
.stamp-slot .mark.art { border: none; width: 46px; height: 46px; border-radius: 0; }
.stamp-slot .mark.art img { width: 100%; height: 100%; object-fit: contain; display: block; }
.stamp-slot:not(.got) .mark.art { filter: grayscale(1); opacity: .28; }

/* Closed this tour: still on the card, not required, clearly not collectable. */
.stamp-slot.closed { border-style: dotted; opacity: .55; cursor: default; }
.stamp-slot.closed::after {
  content: 'Closed'; position: absolute; top: 5px; right: 5px;
  font-size: 8.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--white); background: var(--ink-soft); padding: 1px 5px; border-radius: 99px;
}

.stamp-slot.got .mark { animation: thud .5s cubic-bezier(.2, 1.6, .4, 1) backwards; animation-delay: var(--in, 0ms); }
@keyframes thud {
  0% { transform: rotate(-30deg) scale(2.1); opacity: 0; }
  55% { opacity: 1; }
  100% { transform: rotate(-9deg) scale(1); opacity: 1; }
}
.stamp-slot.got::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--red) 30%, transparent), transparent 62%);
  opacity: 0; animation: bloom .7s ease-out backwards; animation-delay: var(--in, 0ms);
}
@keyframes bloom { 0% { opacity: .9; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.4); } }

/* ================================================================ buttons == */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; width: 100%;
  border-radius: 12px; border: 2px solid var(--ink);
  background: var(--ink); color: var(--paper);
  font: 700 15px/1 var(--sans); letter-spacing: .01em;
  cursor: pointer; text-decoration: none;
  transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn.red, .btn.stamp-btn { background: var(--red); border-color: var(--red); color: var(--white); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn + .btn { margin-top: 8px; }

/* ============================================================ stop cards == */

.stop {
  display: flex; gap: 12px; align-items: stretch; width: 100%;
  text-align: left; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0; overflow: hidden; cursor: pointer;
  font-family: inherit; color: inherit; min-height: 92px;
  box-shadow: var(--shadow); text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
.stop:active { transform: scale(.985); }
.stop + .stop { margin-top: 10px; }
.stop .thumb { width: 92px; flex: none; background: var(--line) center/cover no-repeat; position: relative; }
.stop .meta { padding: 12px 12px 12px 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.stop .name { font-weight: 700; font-size: 16px; line-height: 1.25; }
.stop .line { font-size: 13px; color: var(--ink-soft); }
.stop.closed .thumb { filter: grayscale(1); opacity: .6; }
.stop.closed .name { color: var(--ink-soft); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip {
  font-size: 11.5px; font-weight: 500; padding: 3px 9px; border-radius: 99px;
  border: 1px solid var(--line); color: var(--ink-soft); white-space: nowrap;
}
.chip.got { border-color: color-mix(in srgb, var(--good) 45%, transparent); color: var(--good); }
.chip.near { border-color: var(--ink); color: var(--ink); }
.chip.closed { border-color: var(--red); color: var(--red); font-weight: 600; }

.pocket-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* ================================================================ sheets == */

dialog.sheet {
  border: none; padding: 0; margin: auto auto 0;
  width: min(560px, 100%); max-height: 90dvh;
  border-radius: 22px 22px 0 0; background: var(--card); color: var(--ink);
  box-shadow: 0 -10px 50px rgba(0, 0, 0, .3);
}
dialog.sheet::backdrop { background: rgba(0, 0, 0, .55); }
.sheet-inner { padding: 0 0 calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; max-height: 90dvh; }
.sheet-hero { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: var(--line); }
.sheet-pad { padding: 16px 18px 0; }
/* A tall, full-width strip so the handle is easy to catch with a thumb. */
.grip { height: 22px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.grip::before { content: ""; width: 44px; height: 5px; border-radius: 99px; background: var(--line); }
.grip:active { cursor: grabbing; }
dialog.sheet { will-change: transform; }

.gallery-strip { display: flex; gap: 8px; overflow-x: auto; padding: 12px 18px 4px; scroll-snap-type: x mandatory; }
.gallery-strip img { height: 130px; border-radius: 12px; scroll-snap-align: start; flex: none; object-fit: cover; background: var(--line); }

/* =================================================== the overlay after a scan */

.scan-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .55);
  animation: fade .3s ease both;
}
.scan-sheet {
  position: relative;
  width: min(560px, 100%);
  max-height: 94dvh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 60px rgba(0, 0, 0, .35);
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
  animation: slide-up .5s cubic-bezier(.2, .9, .25, 1) both;
}
@keyframes slide-up { from { transform: translateY(100%); } to { transform: none; } }

.scan-sheet .band { margin: 0; border-radius: 24px 24px 0 0; padding: 22px 20px 44px; }
.scan-sheet .band h2 { font-family: var(--display); font-weight: 900; font-size: 30px; text-transform: uppercase; line-height: 1; }
.scan-sheet .band .pin-mark { position: absolute; right: 22px; top: 18px; width: 34px; height: 44px; z-index: 1; }
.scan-sheet .band .inner { padding-right: 46px; }
.scan-sheet .directions { padding: 4px 20px 0; }
.scan-sheet .directions p { font-size: 15px; color: var(--ink); }
.scan-sheet .claim { padding: 6px 20px 0; }
.scan-sheet .close-x {
  position: absolute; right: 12px; top: 12px; z-index: 3;
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: rgba(0, 0, 0, .25); color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}

/* The hand-drawn aside pointing at the form, straight off the rack card. */
.aside {
  display: flex; align-items: flex-end; gap: 6px;
  font-family: var(--hand); font-size: 22px; line-height: 1; color: var(--ink);
  margin: 10px 0 4px 6px; text-transform: uppercase;
}
.aside svg { width: 34px; height: 34px; flex: none; }

.meter { height: 10px; border-radius: 99px; background: var(--red-wash); overflow: hidden; margin: 12px 0 6px; }
.meter > i { display: block; height: 100%; background: var(--red); border-radius: 99px; transition: width .8s cubic-bezier(.2, .8, .2, 1); }

/* Consent: large enough to hit with a thumb, never ticked for anyone. */
.check {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 2px; margin: 4px 0 8px; cursor: pointer; font-size: 13.5px; line-height: 1.4;
}
.check input { appearance: none; -webkit-appearance: none; flex: none; margin: 0;
  width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--ink-soft);
  display: grid; place-items: center; cursor: pointer; background: var(--card);
  transition: background .15s ease, border-color .15s ease; }
.check input:checked { background: var(--red); border-color: var(--red); }
.check input:checked::after {
  content: ''; width: 6px; height: 11px; margin-top: -2px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.check input:focus-visible { outline: 3px solid color-mix(in srgb, var(--red) 40%, transparent); outline-offset: 2px; }

/* =================================================================== map == */

#map { height: calc(100dvh - var(--tab-h) - env(safe-area-inset-bottom)); width: 100%; }
.leaflet-container { font: inherit; background: var(--paper); }
/* Street tiles in greys, so the tour's red is the only colour on the map. */
.leaflet-tile-pane { filter: grayscale(1) contrast(.92) brightness(1.04); }
@media (prefers-color-scheme: dark) {
  .leaflet-tile-pane { filter: grayscale(1) invert(1) contrast(.85) brightness(.9); }
}
.pin {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 13px/1 var(--sans); color: #fff; background: var(--black);
  border: 2.5px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.pin.got { background: var(--red); }
.pin.closed { background: #9a9a9a; }

/* ================================================================== tabs == */

.tabs {
  position: fixed; inset: auto 0 0 0;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  z-index: 40;
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; text-decoration: none; color: var(--ink-soft);
  font-size: 11px; font-weight: 600; letter-spacing: .02em; position: relative;
}
.tabs a[aria-current="page"] { color: var(--red); }
.tabs a[aria-current="page"]::before {
  content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px;
  background: var(--red); border-radius: 0 0 3px 3px;
}
.tabs svg { width: 22px; height: 22px; }

/* ================================================================= seal === */

.seal-wrap { display: grid; place-items: center; padding: 34px 0 8px; }
.seal {
  width: 176px; height: 176px; border-radius: 50%;
  border: 6px double var(--red); color: var(--red);
  display: grid; place-items: center; text-align: center;
  transform: rotate(-9deg) scale(.4); opacity: 0;
  animation: land .55s cubic-bezier(.2, 1.5, .4, 1) .1s forwards;
  padding: 12px; background: var(--card);
}
.seal .word { font-size: 11px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; }
.seal .who { font-family: var(--display); font-weight: 900; font-size: 18px; line-height: 1.05; margin: 6px 0; text-transform: uppercase; }
.seal.art { border: none; width: 190px; height: 190px; padding: 0; background: none; }
.seal.art img { width: 100%; height: 100%; object-fit: contain; }
@keyframes land {
  0% { transform: rotate(-24deg) scale(1.7); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: rotate(-9deg) scale(1); opacity: 1; }
}

.notice {
  border-radius: 12px; padding: 12px 14px; font-size: 13.5px;
  border: 1px solid var(--line); background: var(--wash); margin-bottom: 12px;
}
.notice.bad { background: var(--red-wash); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.notice.closed-note { background: var(--red-wash); border-color: color-mix(in srgb, var(--red) 35%, transparent); font-weight: 500; }

/* ================================================================= forms == */

label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel], input[type=number], input[type=date], textarea, select {
  width: 100%; min-height: 48px; padding: 11px 13px;
  font: inherit; font-size: 16px; /* anything smaller and iOS zooms the page on focus */
  color: var(--ink); background: var(--wash);
  border: 1.5px solid var(--line); border-radius: 11px;
  transition: border-color .15s ease, background .15s ease;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); background: var(--card); }

/* A password with a Show button inside its right-hand edge. */
.with-peek { position: relative; }
.with-peek input { padding-right: 68px; }
.peek {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  min-height: 34px; padding: 0 10px; border: 0; border-radius: 8px;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--muted);
  background: transparent; cursor: pointer;
}
.peek:hover { color: var(--ink); background: var(--wash); }
.linklike {
  border: 0; background: none; padding: 0; font: inherit; font-size: inherit;
  color: var(--muted); text-decoration: underline; cursor: pointer;
}
.linklike:hover { color: var(--ink); }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }

table.stats { width: 100%; border-collapse: collapse; font-size: 14px; }
table.stats th, table.stats td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); }
table.stats td.num, table.stats th.num { text-align: right; font-variant-numeric: tabular-nums; }

.skeleton { background: var(--line); border-radius: 8px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ================================================================ motion === */

.rise { animation: rise .5s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: var(--in, 0ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ================================================================ finale === */

.finale {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center; padding: 24px;
  background: color-mix(in srgb, var(--black) 70%, transparent);
  backdrop-filter: blur(6px);
  animation: fade .5s ease both; overflow-y: auto;
}
.finale canvas { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.finale .sheet-card {
  position: relative; z-index: 2; width: min(420px, 100%); text-align: center; overflow: hidden;
  background: var(--card); border-radius: 22px;
  padding: 0 0 calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .4);
  animation: rise .6s cubic-bezier(.2, .9, .25, 1) .15s backwards;
}
.finale .sheet-card .band { margin: 0 0 6px; padding: 22px 20px 50px; }
.finale .sheet-card > :not(.band) { margin-left: 22px; margin-right: 22px; }
.finale .crest {
  width: 120px; height: 120px; margin: -64px auto 12px; border-radius: 50%;
  border: 5px double var(--red); color: var(--red); background: var(--card);
  display: grid; place-items: center; position: relative; z-index: 2;
  animation: land .6s cubic-bezier(.2, 1.5, .4, 1) .3s backwards;
}
.finale .crest div div:first-child { font-family: var(--display); font-weight: 900; }
.code {
  font-family: var(--display); font-weight: 900; font-size: 34px; letter-spacing: .14em;
  color: var(--red); padding: 12px 0 4px;
  border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  margin: 14px 22px 14px;
}

.seg { display: flex; gap: 4px; padding: 4px; margin: 0 0 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.seg button { flex: 1; min-height: 40px; border: none; border-radius: 9px; cursor: pointer; background: transparent; color: var(--ink-soft); font: 600 13px var(--sans); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ============================================================ code boxes === */
/*
 * Six boxes over one invisible input. The phone raises its own number
 * keyboard, and — because the field carries autocomplete="one-time-code" —
 * offers the code straight from the notification.
 */

.code-entry { margin-top: 6px; position: relative; }

/*
 * The real input sits exactly on top of the boxes, invisible. It has to be
 * full size rather than parked off-screen: an off-screen field does not
 * reliably receive iOS's one-time-code autofill.
 */
.code-field {
  position: absolute; inset: 0; width: 100%; opacity: 0;
  border: none; background: none; font-size: 16px; letter-spacing: 1em;
  z-index: 2; cursor: pointer;
}
.code-display { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin: 4px 0 6px; cursor: text; }
.code-box {
  aspect-ratio: 3 / 4; border-radius: 11px;
  border: 2px solid var(--line); background: var(--wash);
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 900; font-size: 28px;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.code-box.filled { border-color: var(--red); background: var(--red-wash); animation: popin .18s ease-out; }
.code-box.next { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent); }
@keyframes popin { from { transform: scale(.82); } to { transform: scale(1); } }
.code-display.wrong { animation: shake .42s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}
.code-display.wrong .code-box { border-color: var(--red); }

@media (prefers-reduced-motion: reduce) {
  .seal { animation: none; opacity: 1; transform: rotate(-9deg); }
  .rise, .finale, .finale .sheet-card, .finale .crest, .scan-overlay, .scan-sheet,
  .stamp-slot.got .mark, .stamp-slot.got::before, .code-box, .code-display.wrong {
    animation: none !important;
  }
  .dial .fill, .bar > i, .meter > i { transition: none; }
}

/* ============================================================ profile ==== */

/* The round button in the corner of every header. */
.me {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--white); color: var(--black);
  border: 2.5px solid var(--black);
  font: 800 15px/1 var(--display); letter-spacing: .02em;
  text-decoration: none; box-shadow: 0 3px 12px rgba(0, 0, 0, .25);
  transition: transform .12s ease;
}
.me:active { transform: scale(.94); }
.me svg { width: 22px; height: 22px; }
.me.floating { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 1000; }

/* Until the profile has a name: a pulsing ring, a red dot, and a tag below.
   The ring is white edged in black so it reads on the red hero and the map. */
.me.nudge { background: var(--white); animation: me-bob 2.4s ease-in-out infinite; }
.me.nudge::before {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 3px solid var(--white); box-shadow: 0 0 0 1.5px var(--black);
  animation: me-ring 1.6s ease-out infinite; pointer-events: none;
}
.me.nudge::after {
  content: ""; position: absolute; top: -3px; right: -3px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--red); border: 2.5px solid var(--white);
}
/* Two short lines, so it stays clear of a headline beside the button. */
.me-note {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: 64px; padding: 5px 4px; border-radius: 10px; text-align: center;
  background: var(--black); color: var(--white);
  font: 700 10.5px/1.15 var(--sans); letter-spacing: .02em;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
}
.me-note::before {
  content: ""; position: absolute; bottom: 100%; left: 50%; margin-left: -5px;
  border: 5px solid transparent; border-bottom-color: var(--black);
}
@keyframes me-ring {
  0% { transform: scale(1); opacity: .95; }
  100% { transform: scale(1.55); opacity: 0; }
}
@keyframes me-bob {
  0%, 70%, 100% { transform: scale(1); }
  80% { transform: scale(1.1); }
  90% { transform: scale(.97); }
}
@media (prefers-reduced-motion: reduce) {
  .me.nudge, .me.nudge::before { animation: none; }
}

/* Chips you can press. The pressed state carries a tick, not only a colour. */
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick button {
  min-height: 40px; padding: 0 14px; border-radius: 99px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  font: 500 14px var(--sans); cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .08s ease;
}
.pick button:active { transform: scale(.96); }
.pick button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pick button[aria-pressed="true"]::before { content: '✓ '; font-weight: 700; }

/* A switch. Its label says the state in words, so it never relies on colour. */
.switch {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  width: 56px; height: 32px; border-radius: 99px; flex: none;
  background: #9a9a9a; position: relative;
  transition: background .22s ease;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
  transition: transform .28s cubic-bezier(.3, 1.4, .5, 1);
}
.switch input:checked + .track { background: var(--good); }
.switch input:checked + .track::after { transform: translateX(24px); }
.switch input:focus-visible + .track { outline: 3px solid color-mix(in srgb, var(--ink) 35%, transparent); outline-offset: 2px; }
.switch .state { font: 700 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; min-width: 52px; }

.saved {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--good);
  opacity: 0; transition: opacity .2s ease;
}
.saved.on { opacity: 1; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-row > div { background: var(--wash); border-radius: 12px; padding: 12px; text-align: center; }
.stat-row .v { font: 900 30px/1 var(--display); }
.stat-row .l { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-top: 6px; }

/* ================================================================ map ==== */

.map-bar {
  position: fixed; left: 12px; right: 68px; top: calc(12px + env(safe-area-inset-top));
  z-index: 1000; display: flex; gap: 8px; align-items: center;
}
.map-bar .seg { margin: 0; box-shadow: 0 4px 16px rgba(0, 0, 0, .2); flex: 1; max-width: 300px; }
.map-legend {
  position: fixed; left: 12px; z-index: 1000;
  top: calc(66px + env(safe-area-inset-top));
  background: var(--card); border-radius: 12px; padding: 8px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18); font-size: 12px;
}
.map-legend .ramp { width: 150px; height: 8px; border-radius: 99px; margin: 6px 0 3px;
  background: linear-gradient(90deg, #fbe9ea, #f08a8d, #d6262c, #7a1418); }
.map-legend .ends { display: flex; justify-content: space-between; color: var(--ink-soft); }

.next-card {
  position: fixed; left: 12px; right: 12px; z-index: 1000;
  bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom));
  background: var(--card); border-radius: 18px; padding: 18px 14px 12px;
  touch-action: none;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .28);
  max-width: 540px; margin: 0 auto;
}
/* A handle, so the card reads as something that can be swiped away. */
.next-card::before {
  content: ""; position: absolute; top: 7px; left: 50%; margin-left: -20px;
  width: 40px; height: 4px; border-radius: 99px; background: var(--line);
}
.next-pill {
  position: fixed; z-index: 1000; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom));
  padding: 10px 16px; border-radius: 99px; border: none; cursor: pointer;
  background: var(--black); color: var(--white); font: 700 13px var(--sans);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3); animation: fade .2s ease both;
}
.next-pill::before { content: "▲ "; font-size: 10px; }
.next-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; width: 100%;
  background: none; border: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.next-row + .next-row { border-top: 1px solid var(--line); }
.next-row .n { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font: 800 13px var(--sans); color: #fff; background: var(--red); }
.next-row.second .n { background: var(--black); }
.next-row .t { min-width: 0; flex: 1; }
.next-row .t b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-row .d { font-size: 12.5px; color: var(--ink-soft); }
.count-badge {
  position: absolute; top: -8px; right: -10px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 99px; background: var(--white); color: var(--black);
  font: 800 11px/20px var(--sans); text-align: center; border: 1.5px solid var(--black);
}

/* ============================================================== scanner === */

/* The gallery name, with the stamp that opens the scanner in its corner. */
.name-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stamp-icon {
  position: relative; flex: none; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--red); color: #fff; border: 2.5px solid var(--card);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--red) 45%, transparent);
  transform: rotate(-10deg); transition: transform .15s ease;
}
.stamp-icon:hover { transform: rotate(-4deg) scale(1.05); }
.stamp-icon:active { transform: rotate(-10deg) scale(.9); }
/* One slow ring now and then, so it reads as something to press. */
.stamp-icon::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid var(--red); opacity: 0; animation: stamp-ring 2.8s ease-out infinite 1s;
}
@keyframes stamp-ring { 0% { transform: scale(1); opacity: .7; } 60%, 100% { transform: scale(1.45); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .stamp-icon::after { animation: none; } }

.scanner {
  position: fixed; inset: 0; z-index: 2000; background: #000; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  animation: fade .2s ease both;
}
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-top, .scan-bottom { position: relative; z-index: 2; padding: calc(18px + env(safe-area-inset-top)) 20px 18px; }
.scan-top { background: linear-gradient(180deg, rgba(0, 0, 0, .7), transparent); text-align: center; }
.scan-top .tiny { color: #ff6b70; }
.scan-hint { font-weight: 700; font-size: 18px; margin-top: 4px; }
.scan-bottom { padding-bottom: calc(22px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, rgba(0, 0, 0, .8), transparent); }
.scan-status { text-align: center; font-size: 14px; margin: 0 0 14px; min-height: 20px; }
.scan-actions { display: flex; gap: 10px; max-width: 420px; margin: 0 auto; }
.scan-actions .btn { background: #fff; color: #111; border-color: #fff; }
.scan-torch {
  min-height: 50px; padding: 0 18px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, .5);
  background: transparent; color: #fff; font: 700 15px var(--sans); cursor: pointer;
}
.scan-torch[aria-pressed="true"] { background: #fff; color: #111; }

/* The frame: red corners, and a line sweeping so it visibly looks. */
.scan-frame {
  position: absolute; z-index: 1; left: 50%; top: 50%;
  width: min(68vw, 300px); aspect-ratio: 1; transform: translate(-50%, -54%);
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); border-radius: 18px;
}
.scan-frame .c { position: absolute; width: 38px; height: 38px; border: 5px solid var(--red); }
.scan-frame .tl { left: -3px; top: -3px; border-right: 0; border-bottom: 0; border-radius: 18px 0 0 0; }
.scan-frame .tr { right: -3px; top: -3px; border-left: 0; border-bottom: 0; border-radius: 0 18px 0 0; }
.scan-frame .bl { left: -3px; bottom: -3px; border-right: 0; border-top: 0; border-radius: 0 0 0 18px; }
.scan-frame .br { right: -3px; bottom: -3px; border-left: 0; border-top: 0; border-radius: 0 0 18px 0; }
.scan-frame .sweep {
  position: absolute; left: 8%; right: 8%; height: 3px; top: 10%; border-radius: 3px;
  background: var(--red); box-shadow: 0 0 14px var(--red);
  animation: sweep 1.8s ease-in-out infinite alternate;
}
@keyframes sweep { to { top: 88%; } }
.scanner.found .scan-frame .c { border-color: #4cc38a; }
.scanner.found .scan-frame .sweep { display: none; }
@media (prefers-reduced-motion: reduce) { .scan-frame .sweep { animation: none; top: 50%; } }

/* ================================================================ credit === */

/* The studio that made the site. Quiet on purpose: set small, in the page's
   muted ink, with the KIAH wordmark as it appears on kiah.design (Syne 800,
   wide tracking). */
.credit { display: flex; justify-content: center; padding: 34px 16px 26px; }
.credit a {
  display: inline-flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--ink-soft); text-decoration: none; opacity: .85;
  transition: opacity .2s ease, color .2s ease;
}
.credit a::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .35; margin-bottom: 8px; }
.credit .by { font: 500 10px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; }
.credit .kiah {
  font: 800 15px/1 Syne, var(--display); letter-spacing: .34em; margin-right: -.34em;
  color: var(--ink); transition: color .2s ease;
}
.credit .site { font: 500 11px/1 var(--sans); letter-spacing: .04em; }
.credit a:hover, .credit a:focus-visible { opacity: 1; outline: none; }
.credit a:hover .kiah, .credit a:focus-visible .kiah { color: var(--red); }
.credit a:focus-visible .site { text-decoration: underline; text-underline-offset: 3px; }

/* ======================================================= gallery details === */

.info-card { margin-top: 6px; }
.info-row { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom: none; }
.info-row .k { flex: none; width: 96px; color: var(--ink-soft); }
.info-row .v { min-width: 0; word-break: break-word; }

/* Whole words only: no hyphens, and a word is never split unless it cannot fit the square at all. */
.stamp-slot .slot-name { hyphens: manual; -webkit-hyphens: manual; word-break: normal; overflow-wrap: break-word; padding: 0 2px; }

/* ======================================================= directions ======= */

/* While directions are running the map belongs to them. */
.navigating .map-bar, .navigating .map-legend, .navigating .next-card,
.navigating .next-pill, .navigating .me.floating { display: none !important; }

.next-row { border-radius: 12px; padding: 8px; margin: 0 -8px; width: calc(100% + 16px); }
.next-row + .next-row { border-top: none; margin-top: 2px; }
.next-row .n { background: var(--black); }
.next-row.selected { background: var(--red-wash); }
.next-row.selected .n { background: var(--red); }
.next-actions { display: flex; gap: 8px; margin-top: 10px; }
.next-actions .btn { margin: 0; min-height: 44px; }
.next-actions .btn.red { flex: 2; }
.next-actions .btn.ghost { flex: 1; }

.nav-banner {
  position: fixed; z-index: 1001; left: 12px; right: 12px;
  top: calc(12px + env(safe-area-inset-top));
  max-width: 540px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 18px;
  background: var(--black); color: var(--white);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  animation: fade .2s ease both;
}
.nav-icon { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--red); color: #fff; }
.nav-icon svg { width: 30px; height: 30px; }
.nav-text { min-width: 0; display: grid; gap: 2px; }
.nav-text b { font: 900 26px/1 var(--display); letter-spacing: .01em; }
.nav-text span { font: 600 15px/1.25 var(--sans); }

.nav-panel {
  position: fixed; z-index: 1001; left: 12px; right: 12px;
  bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom));
  max-width: 540px; margin: 0 auto; max-height: 62dvh; overflow-y: auto;
  padding: 14px; border-radius: 18px; background: var(--card);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .28);
}
.nav-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.nav-dest { display: block; font-size: 16px; line-height: 1.2; }
.nav-eta { margin-top: 3px; font: 700 14px var(--sans); color: var(--red); }
.nav-end {
  flex: none; border: none; border-radius: 99px; padding: 9px 16px; cursor: pointer;
  background: var(--ink); color: var(--paper); font: 700 13px var(--sans);
}
.nav-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }
.nav-row .seg { margin: 0; flex: 1 1 150px; }
.nav-chip {
  min-height: 40px; padding: 0 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 13px var(--sans);
}
.nav-chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.nav-steps { list-style: none; margin: 12px 0 0; padding: 0; max-height: 30dvh; overflow-y: auto; border-top: 1px solid var(--line); }
.nav-steps li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.nav-steps li .nav-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--wash); color: var(--ink); }
.nav-steps li .nav-icon svg { width: 20px; height: 20px; }
.nav-steps li span { flex: 1; min-width: 0; }
.nav-steps li em { font-style: normal; font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.nav-steps li.done { opacity: .45; }
.nav-steps li.now .nav-icon { background: var(--red); color: #fff; }
.nav-msg { margin: 12px 0 0; font-size: 14px; }
.nav-elsewhere { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.nav-elsewhere .btn { flex: 1; margin: 0; min-height: 42px; font-size: 13px; }
.nav-panel > .btn.red { margin-top: 12px; }
.nav-recenter {
  position: fixed; z-index: 1001; right: 12px; bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom) + 190px);
  padding: 10px 14px; border-radius: 99px; border: none; cursor: pointer;
  background: var(--card); color: var(--ink); font: 700 13px var(--sans); box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.next-row .t b { white-space: normal; overflow: visible; text-overflow: clip; }

/* Center on my location. Top right, under the profile button and its note. */
.locate-me {
  position: fixed; z-index: 1000; right: 12px; top: calc(116px + env(safe-area-inset-top));
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  display: grid; place-items: center;
  background: var(--card); color: #2f6fd0; box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}
.locate-me svg { width: 24px; height: 24px; }
.locate-me:active { transform: scale(.94); }
.locate-me.finding svg { animation: locate-spin 1s linear infinite; }
.locate-me.denied { color: var(--red); }
@keyframes locate-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .locate-me.finding svg { animation: none; } }
.navigating .locate-me { display: none; }

/* The closest-stops card, opened out to every stop. */
.next-card.expanded { max-height: calc(100dvh - var(--tab-h) - 150px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.next-list {
  overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain;
  margin: 6px -8px 0; padding: 0 8px; min-height: 0; flex: 1 1 auto;
}
.next-row.closed .n { background: #9a9a9a; }
.next-row .d .flag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px;
  font-style: normal; font-size: 11px; font-weight: 700;
  background: var(--wash); color: var(--ink-soft);
}
.next-row .d .flag.got { background: var(--red-wash); color: var(--red); }
.next-toggle {
  display: block; width: 100%; margin-top: 8px; padding: 10px 0 2px; border: none; background: none; cursor: pointer;
  font: 700 13px var(--sans); color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
}
.next-toggle:hover { color: var(--red); }

/* ====================================================== notifications ==== */

/* The bell sits left of the profile button, the same size and shape. */
.bell {
  position: absolute; top: 14px; right: 66px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; padding: 0;
  background: var(--white); color: var(--black); border: 2.5px solid var(--black);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .25);
}
.bell svg { width: 21px; height: 21px; }
.bell:active { transform: scale(.94); }
.bell.floating { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 64px; z-index: 1000; }
.bell .count {
  position: absolute; top: -6px; right: -6px; min-width: 21px; height: 21px; padding: 0 5px;
  border-radius: 99px; background: var(--red); color: #fff; border: 2px solid var(--white);
  font: 800 11px/17px var(--sans); text-align: center;
  animation: count-pop .35s cubic-bezier(.2, 1.6, .4, 1) both;
}
@keyframes count-pop { from { transform: scale(0); } }
/* Room for the bell beside the map's view switch. */
.map-bar { right: 116px; }
.navigating .bell.floating { display: none; }

.news { list-style: none; margin: 0; padding: 0; }
.news li { position: relative; padding: 12px 0 12px 16px; border-bottom: 1px solid var(--line); }
.news li.unread::before {
  content: ""; position: absolute; left: 0; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--red);
}
.news .when { font-size: 11.5px; color: var(--ink-soft); }
.news b { display: block; font-size: 15.5px; margin-top: 2px; }
.news p { margin: 4px 0 0; font-size: 14px; }
.news .go { display: inline-block; margin-top: 6px; font-weight: 700; color: var(--red); }

/* The pop-up asking to install / turn on notifications. */
.push-banner {
  position: fixed; z-index: 1002; left: 12px; right: 12px;
  bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto;
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 16px 16px 14px; border-radius: 18px;
  background: var(--card); color: var(--ink); border: 2.5px solid var(--black);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .3);
  animation: banner-up .35s cubic-bezier(.2, .9, .3, 1.15) both;
}
.push-banner.leaving { animation: banner-down .22s ease forwards; }
@keyframes banner-up { from { transform: translateY(120%); opacity: 0; } }
@keyframes banner-down { to { transform: translateY(120%); opacity: 0; } }
.push-banner .x {
  position: absolute; top: 6px; right: 8px; width: 34px; height: 34px; border: none; background: none;
  font-size: 24px; line-height: 1; color: var(--ink-soft); cursor: pointer;
}
.push-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--red); color: #fff; }
.push-icon svg { width: 22px; height: 22px; }
.push-body { min-width: 0; flex: 1; padding-right: 18px; }
.push-body b { font-size: 15.5px; }
.push-body .btn { margin: 0; min-height: 42px; }
.steps { margin: 6px 0 0; padding-left: 20px; }
.steps li { margin: 3px 0; }
.nudge-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.nudge-actions .btn { flex: 1 1 150px; }
@media (prefers-reduced-motion: reduce) { .push-banner, .push-banner.leaving, .bell .count { animation: none; } }
/* Keep headlines clear of the bell and profile buttons in the top corner. */
#top .band h1, #top .band .tiny { padding-right: 104px; }
@media (max-width: 370px) { .hero .lockup { margin-top: 26px; font-size: 36px !important; } }

/* Map credits: an ⓘ in the corner instead of a bar across the bottom. */
.map-credits-button {
  flex: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 1px solid var(--line); background: var(--card);
  color: var(--ink-soft); font: 700 15px/1 Georgia, 'Times New Roman', serif;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}
.map-credits-button:hover { color: var(--ink); }
.map-credits {
  position: fixed; z-index: 1001; left: 12px; right: 12px; max-width: 330px;
  top: calc(66px + env(safe-area-inset-top));
  padding: 10px 12px; border-radius: 12px;
  background: var(--card); color: var(--ink-soft); box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  font-size: 11.5px; line-height: 1.45;
}
.map-credits p { margin: 0; }
.map-credits p + p { margin-top: 3px; }
.map-credits a { color: var(--ink); }
.navigating .map-credits-button, .navigating .map-credits { display: none; }

/* ================================================================= join === */
/* The gallery sign-up page: the list of pages waiting for an owner, and the
   pin a new gallery drops on its own door. */

.search-box {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; margin: 10px 0 4px;
  background: var(--wash); border: 1.5px solid var(--line); border-radius: 11px;
}
.search-box svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search-box input { border: 0; background: none; padding-left: 0; }
.search-box input:focus { background: none; }

.pick-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 14px 4px; text-align: left; cursor: pointer;
  font: inherit; color: inherit; background: none; border: 0;
  border-bottom: 1px solid var(--line);
}
.pick-row:hover { background: var(--wash); }
.pick-row .meta { display: grid; gap: 2px; min-width: 0; }
.pick-row .go { flex: none; font-weight: 700; color: var(--red); }

.pin-map {
  height: 260px; margin: 12px 0 0;
  border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden;
}

/* Two fields side by side, or two choices — first and last name, new or
   returning. One column on the narrowest phones, where side by side is worse
   than nothing. */
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two-up > .btn { margin: 0; }
.two-up > label.field { margin-bottom: 12px; }
@media (max-width: 380px) { .two-up { grid-template-columns: 1fr; } }

/* The passport code, on the screen that hands it over. Spaced out because
   people read it aloud to each other. */
.passport-code {
  display: inline-block; padding: 12px 18px; border-radius: 12px;
  font: 800 24px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .12em; white-space: nowrap;
  background: var(--wash); border: 1.5px dashed var(--line);
}
