/* wall.css — the Mox Polaroid Wall.
 *
 * Rules that keep this at 60fps on a phone:
 *   - the only properties that change every frame are `transform` on .layer
 *     and on .card. Nothing else is touched in the loop.
 *   - no animated box-shadow, filter, opacity-per-frame or width/height.
 *   - .card is the promoted layer; its children are rasterised once.
 *
 * Palette is lifted from the guildhall house style (roll-call-page.html):
 * warm near-black ink, oxblood used once, paper that is never pure grey.
 * The wall itself is white, per the brief — the Polaroids have to be the only
 * objects in the room.
 */

@font-face {
  font-family: 'Permanent Marker';
  src: url('../fonts/permanent-marker-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #211d18;
  --ink2: #6a6257;
  --ink3: #9a9285;
  --rule: #e2dcd0;
  --fill: #f7f4ee;
  --stamp: #7a2e22;

  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --marker: 'Permanent Marker', 'Marker Felt', 'Bradley Hand', Noteworthy,
            'Segoe Print', cursive;
  /* the fine-point pen under the name */
  --pen: 'Caveat', Noteworthy, 'Bradley Hand', 'Segoe Print', cursive;

  --pw: 176px;              /* Polaroid width at scale 1 */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body { position: fixed; inset: 0; }

/* ============================================================== the wall == */

.wall {
  position: fixed;
  inset: 0;
  touch-action: none;                 /* we own every gesture */
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  contain: strict;
}
.wall.panning { cursor: grabbing; }

.layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

/* ---------------------------------------------------------------- a card -- */
/* (x, y) written into the transform is the PIN, not the corner: the box is
   shifted left by half its width and rotates about its own top-centre. */
.card {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--pw);
  margin-left: calc(var(--pw) / -2);
  transform-origin: 50% 0;
  will-change: transform;
  transition: opacity .55s ease;
  --s: 1;
}

.cord {
  width: 1px;
  height: 70px;
  margin: 0 auto;
  background: linear-gradient(to bottom,
    rgba(33, 29, 24, .10) 0%,
    rgba(33, 29, 24, .42) 35%,
    rgba(33, 29, 24, .5) 100%);
}

/* the hanger sits on the pin, above the cord */
.hang {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fff 0 12%, rgba(255,255,255,.45) 22%, rgba(0,0,0,0) 46%),
    radial-gradient(circle at 50% 50%, #b9412f 0 58%, #8e2d20 100%);
  box-shadow: 0 1px 2px rgba(33, 29, 24, .34);
}
/* 1 = a small metal clip */
.card[data-hang="1"] .hang {
  top: -4px;
  width: 15px;
  height: 9px;
  margin-left: -7.5px;
  border-radius: 2px;
  background: linear-gradient(#f2efe9 0%, #cdc7bb 42%, #a9a296 60%, #e6e2da 100%);
  box-shadow: 0 1px 2px rgba(33, 29, 24, .3), inset 0 0 0 .5px rgba(33, 29, 24, .22);
}
.card[data-hang="1"] .hang::after {
  content: '';
  position: absolute;
  left: 3px;
  right: 3px;
  top: 3.5px;
  height: 1px;
  background: rgba(33, 29, 24, .3);
}
/* 2 = a torn strip of tape over the thread */
.card[data-hang="2"] .hang {
  top: -6px;
  width: 30px;
  height: 13px;
  margin-left: -15px;
  border-radius: 1px;
  transform: rotate(-7deg);
  background: linear-gradient(105deg,
    rgba(226, 214, 186, .80), rgba(238, 229, 205, .72) 45%, rgba(220, 207, 178, .8));
  box-shadow: 0 1px 2px rgba(33, 29, 24, .16);
  clip-path: polygon(0 12%, 7% 0, 100% 6%, 96% 92%, 88% 100%, 4% 94%);
}

/* ------------------------------------------------------------- the print -- */
.pola {
  position: relative;
  width: var(--pw);
  transform: scale(var(--s));
  transform-origin: 50% 0;
  background: #fffefb;
  padding: 9px 9px 0;
  border-radius: 2px;
  box-shadow:
    0 0 0 .5px rgba(33, 29, 24, .13),
    0 8px 16px -10px rgba(33, 29, 24, .46),
    0 2px 3px -2px rgba(33, 29, 24, .3);
}

.shot {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #efeae1 center / cover no-repeat;
  border-radius: 1px;
  box-shadow: inset 0 0 0 .5px rgba(33, 29, 24, .16);
}
/* the gloss every real Polaroid has */
.shot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1px;
  background: linear-gradient(196deg,
    rgba(255, 255, 255, .34) 0%,
    rgba(255, 255, 255, 0) 34%,
    rgba(255, 255, 255, 0) 72%,
    rgba(33, 29, 24, .05) 100%);
  pointer-events: none;
}

/* the Sharpie: slight rotation, and the bleed a marker leaves on emulsion */
.nm {
  font-family: var(--marker);
  font-size: 21px;
  line-height: 1.04;
  color: var(--mkink, #1d1a16);
  margin: 9px 2px 0;
  transform: rotate(var(--tilt, -1deg));
  letter-spacing: .1px;
  text-shadow:
    0 0 .7px var(--mkink, #1d1a16),
    .4px .3px .9px rgba(29, 26, 22, .34),
    -.3px .2px 1.6px rgba(29, 26, 22, .16);
  -webkit-text-stroke: .18px var(--mkink, #1d1a16);
  overflow-wrap: break-word;
}

.five {
  font-family: var(--pen);
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.02;
  color: #2c2823;
  margin: 3px 2px 0;
  transform: rotate(calc(var(--tilt, -1deg) * -0.6));
}

.foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 3px 2px 8px;
  min-height: 20px;
}
.lnk {
  font-family: var(--pen);
  font-weight: 600;
  font-size: 13px;
  color: #3b5a8c;
  text-decoration: none;
  padding: 2px 0 0 6px;
}
.lnk:empty { display: none; }
.lnk:hover, .lnk:focus-visible { color: var(--stamp); }
/* a sample person's link is shown, never followed; the tap goes to the print */
.lnk.is-sample { pointer-events: none; color: #6f7f96; }

/* rank + reason, only in match mode */
.rank {
  position: absolute;
  top: -9px;
  left: -9px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--stamp);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.5);
  transition: opacity .3s ease, transform .3s cubic-bezier(.2, 1.5, .4, 1);
  pointer-events: none;
}
.rank:empty { display: none; }
.card.is-chosen .rank { opacity: 1; transform: scale(1); }

.why {
  position: absolute;
  left: -8px;
  right: -8px;
  bottom: -6px;
  transform: translateY(100%);
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.32;
  text-align: center;
  color: var(--stamp);
  opacity: 0;
  transition: opacity .4s ease .12s;
  pointer-events: none;
}
.why:empty { display: none; }
.card.is-chosen .why { opacity: 1; }

.card.is-faded { opacity: .17; pointer-events: none; }
.card.grabbed { cursor: grabbing; }
.card.grabbed .pola {
  box-shadow:
    0 0 0 .5px rgba(33, 29, 24, .14),
    0 20px 34px -16px rgba(33, 29, 24, .5),
    0 3px 5px -3px rgba(33, 29, 24, .3);
}

/* ================================================================ chrome == */

.brand {
  position: fixed;
  top: 0;
  left: 0;
  padding: 16px 18px 22px 18px;
  pointer-events: none;
  z-index: 60;
}
/* the wall runs under the title, so fade it out rather than boxing it in */
.brand::before {
  content: '';
  position: absolute;
  inset: -10px -46px -10px -20px;
  background: radial-gradient(120% 100% at 14% 38%,
    rgba(255, 255, 255, .97) 0%,
    rgba(255, 255, 255, .88) 42%,
    rgba(255, 255, 255, 0) 100%);
  z-index: -1;
}
.brand .eyebrow {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--ink3);
  margin: 0 0 3px;
}
.brand h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  line-height: 1;
  margin: 0;
  color: var(--ink);
}
.brand .demo {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--stamp);
  border: .5px solid color-mix(in srgb, var(--stamp) 34%, transparent);
  border-radius: 2px;
  padding: 2px 5px;
}

/* the dock: bottom centre, thumb-reachable */
.dock {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  max-width: calc(100vw - 20px);
  z-index: 70;
  transition: transform .34s cubic-bezier(.3, .9, .3, 1), opacity .24s ease;
}
body.sheet-open .dock,
body.map-open .dock { transform: translateX(-50%) translateY(150%); opacity: 0; pointer-events: none; }

.btn {
  font: inherit;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  padding: 12px 17px;
  border-radius: 999px;
  border: .5px solid var(--rule);
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(1.6) blur(9px);
  backdrop-filter: saturate(1.6) blur(9px);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 6px 18px -10px rgba(33, 29, 24, .5), 0 1px 2px rgba(33, 29, 24, .07);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--ink3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:disabled { opacity: .35; cursor: default; }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--rule); }
.btn.sm { font-size: 12px; padding: 9px 13px; }
:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; }

/* ---------------------------------------------------------------- sheets -- */
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  max-height: 68vh;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, .95);
  -webkit-backdrop-filter: saturate(1.7) blur(16px);
  backdrop-filter: saturate(1.7) blur(16px);
  border-top: .5px solid var(--rule);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -18px 44px -28px rgba(33, 29, 24, .5);
  padding: 8px 16px calc(14px + env(safe-area-inset-bottom));
  transform: translateY(101%);
  transition: transform .4s cubic-bezier(.25, .9, .25, 1), max-height .4s ease;
  will-change: transform;
  pointer-events: none;                /* a closed panel must never eat a tap */
}
.sheet[data-open="1"] { transform: translateY(0); pointer-events: auto; }

/* once there are results the question has been asked: give the wall back the
   room so you can actually watch the prints gather */
.sheet[data-state="results"] { max-height: 47vh; }
.sheet[data-state="results"] .seeds { display: none; }
.sheet[data-state="results"] textarea#q { min-height: 0; height: 44px; overflow: hidden; }
.sheet .grab {
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: var(--rule);
  margin: 2px auto 10px;
  flex: none;
}
.sheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex: none;
  margin-bottom: 9px;
}
.sheet-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.15;
  margin: 0;
}
.sheet-head .x {
  font: inherit;
  font-size: 12px;
  background: none;
  border: 0;
  color: var(--ink2);
  cursor: pointer;
  padding: 4px 2px;
  flex: none;
}
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

textarea#q {
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  width: 100%;
  min-height: 74px;
  max-height: 148px;
  resize: none;
  padding: 11px 12px;
  border: .5px solid var(--rule);
  border-radius: 9px;
  background: var(--fill);
  color: var(--ink);
}
textarea#q::placeholder { color: var(--ink3); }
textarea#q:focus { outline: none; border-color: var(--ink2); background: #fff; }

.row { display: flex; align-items: center; gap: 9px; margin-top: 9px; flex-wrap: wrap; }
.row .spacer { flex: 1 1 auto; }
.hint { font-size: 11.5px; color: var(--ink3); line-height: 1.45; }

/* try-these chips */
.seeds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.seed {
  font: inherit;
  font-size: 11.5px;
  padding: 6px 10px;
  border-radius: 999px;
  border: .5px solid var(--rule);
  background: #fff;
  color: var(--ink2);
  cursor: pointer;
}
.seed:hover { border-color: var(--ink2); color: var(--ink); }

/* results */
.results { list-style: none; margin: 12px 0 0; padding: 0; }
.results li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-top: .5px solid var(--rule);
  cursor: pointer;
}
.results li:last-child { border-bottom: .5px solid var(--rule); }
.results .n {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink3);
  padding-top: 3px;
}
.results .who, .results .sum, .results .rsn { display: block; }
.results .who { font-family: var(--marker); font-size: 17px; line-height: 1.15; }
.results .sum { font-size: 11.5px; color: var(--ink2); margin-top: 1px; }
.results .rsn {
  font-size: 11px;
  color: var(--stamp);
  margin-top: 3px;
  line-height: 1.35;
}
.results .bar {
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: var(--rule);
  margin-top: 8px;
  overflow: hidden;
}
.results .bar i { display: block; height: 100%; background: var(--stamp); }

.empty { font-size: 12.5px; color: var(--ink2); margin-top: 12px; line-height: 1.5; }
.empty b { font-weight: 600; color: var(--ink); }

/* -------------------------------------------------------- the map screen -- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(255, 255, 255, .97);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.overlay[data-open="1"] { opacity: 1; pointer-events: auto; }
.overlay[data-open="0"] { visibility: hidden; }

.map-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px 6px;
}
.map-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  margin: 0 0 3px;
}
.map-head .hint { max-width: 46ch; }

#mapCanvas {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: block;
  touch-action: none;
  cursor: grab;
}

.legend {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: .5px solid var(--rule);
}
.legend button {
  font: inherit;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
  border: .5px solid var(--rule);
  background: #fff;
  color: var(--ink2);
  cursor: pointer;
}
.legend button:hover { border-color: var(--ink2); color: var(--ink); }
.legend .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.legend .ct { font-family: var(--mono); font-size: 9.5px; color: var(--ink3); }

/* what the reader heard in your words */
.heard {
  margin: 12px 0 0;
  font-family: var(--pen);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.2;
  color: var(--stamp);
}
.heard .k { color: var(--ink2); font-weight: 500; }
.empty p { margin: 0 0 10px; }

/* ---------------------------------------------------------- add yourself -- */
#pinForm { display: flex; flex-direction: column; gap: 10px; padding-bottom: 4px; }
.pin-top { display: grid; grid-template-columns: 116px 1fr; gap: 12px; align-items: start; }
.snap {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 3px;
  background: #fffefb;
  box-shadow: 0 0 0 .5px rgba(33, 29, 24, .16), 0 6px 14px -9px rgba(33, 29, 24, .5);
  padding: 7px 7px 20px;
  cursor: pointer;
  display: block;
}
.snap-empty, .snap img {
  display: flex;
  width: 100%;
  height: 100%;
  border-radius: 1px;
  object-fit: cover;
}
.snap-empty {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  background: repeating-linear-gradient(135deg, #f3efe7 0 7px, #efe9df 7px 14px);
  font-family: var(--pen);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.05;
  color: var(--ink);
  padding: 6px;
}
.snap-empty small { font-size: 13px; color: var(--ink2); font-weight: 500; }
.snap-empty[hidden], .snap img[hidden] { display: none; }
.pin-fields { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: var(--ink2);
}
.field em { font-style: normal; color: var(--ink3); }
.links-field input + input { margin-top: 6px; }
.inspect .place2 { font-size: 11.5px; color: var(--ink3); margin: -5px 0 9px; }
.inspect .place2[hidden] { display: none; }
.inspect .links { display: contents; }
.field input, .field textarea {
  font: inherit;
  font-size: 16px;               /* 16px stops iOS zooming into the field */
  line-height: 1.35;
  width: 100%;
  padding: 9px 10px;
  border: .5px solid var(--rule);
  border-radius: 8px;
  background: var(--fill);
  color: var(--ink);
  resize: none;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink2); background: #fff; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink3); }
.count { font-family: var(--mono); font-size: 10px; color: var(--ink3); margin-left: 4px; }
.count.over { color: var(--stamp); font-weight: 600; }
#pinForm .err { margin: 0; font-size: 12.5px; color: var(--stamp); }
#pinForm .err[hidden] { display: none; }

/* ------------------------------------------------------------------ toast -- */
.toast {
  position: fixed;
  left: 50%;
  top: max(14px, env(safe-area-inset-top));
  transform: translate(-50%, -180%);
  z-index: 120;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 10px 26px -14px rgba(33, 29, 24, .7);
  transition: transform .34s cubic-bezier(.25, .9, .25, 1);
  pointer-events: none;
  white-space: nowrap;
}
.toast[data-open="1"] { transform: translate(-50%, 0); }

/* ------------------------------------------------------------- filterbar -- */
.filterbar {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%) translateY(-160%);
  z-index: 75;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px 8px 13px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  box-shadow: 0 8px 22px -12px rgba(33, 29, 24, .6);
  transition: transform .34s cubic-bezier(.25, .9, .25, 1);
  max-width: calc(100vw - 28px);
  pointer-events: none;
}
.filterbar[data-open="1"] { transform: translateX(-50%) translateY(0); pointer-events: auto; }
.filterbar .lab {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 0 1 auto;
}
.filterbar .ct {
  font-family: var(--mono);
  font-size: 10px;
  opacity: .6;
  white-space: nowrap;
  flex: none;
}
.filterbar button {
  font: inherit;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, .17);
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

/* ----------------------------------------------------------- the inspect -- */
/* tapping a Polaroid: the back of the print */
.inspect {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(150%);
  z-index: 85;
  width: min(360px, calc(100vw - 24px));
  padding: 14px 15px 13px;
  border-radius: 12px;
  background: #fffefb;
  border: .5px solid var(--rule);
  box-shadow: 0 14px 34px -18px rgba(33, 29, 24, .55);
  transition: transform .36s cubic-bezier(.25, .9, .25, 1);
  pointer-events: none;
}
.inspect[data-open="1"] { transform: translateX(-50%) translateY(0); pointer-events: auto; }
.inspect .nm2 {
  font-family: var(--marker);
  font-size: 23px;
  line-height: 1.05;
  color: #1d1a16;
  margin: 0 0 3px;
  transform: rotate(-.8deg);
}
.inspect .sum2 { font-size: 12.5px; color: var(--ink2); margin: 0 0 9px; }
.inspect .tags { display: flex; flex-wrap: wrap; gap: 5px; }
.inspect .tag {
  font: inherit;
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 999px;
  border: .5px solid var(--rule);
  background: #fff;
  color: var(--ink2);
  cursor: pointer;
}
.inspect .tag:hover { border-color: var(--stamp); color: var(--stamp); }
.inspect .meet { margin-top: 10px; }
.inspect .meet[hidden] { display: none; }
.inspect .meet .lab { font-size: 11px; color: var(--ink2); margin: 0 0 5px; letter-spacing: .02em; }
.inspect .meet .tag { font-family: var(--marker); font-size: 14px; color: #1d1a16; }
.inspect .acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 11px; }
.inspect .act {
  font: inherit;
  font-size: 12.5px;
  background: none;
  border: 0;
  padding: 2px 0;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  cursor: pointer;
}
.inspect .act[hidden] { display: none; }
.inspect .act:hover { text-decoration-color: var(--stamp); color: var(--stamp); }
.inspect .act.is-sample { color: var(--ink3); cursor: default; }
.inspect .act.quiet { color: var(--ink3); }
.inspect .close {
  position: absolute;
  top: 8px;
  right: 9px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  color: var(--ink3);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

/* --------------------------------------------------------------- loading -- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink3);
  transition: opacity .4s ease;
}
.boot[hidden] { display: none; }
.boot.gone { opacity: 0; pointer-events: none; }
.boot .err {
  max-width: 44ch;
  text-align: center;
  line-height: 1.7;
  color: var(--stamp);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--sans);
  font-size: 13px;
}

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

/* ============================================================== desktop == */
@media (min-width: 880px) {
  :root { --pw: 190px; }

  .brand { padding: 20px 24px; }
  .brand h1 { font-size: 22px; }

  /* the matcher becomes a left rail; the wall keeps the rest of the room */
  .sheet {
    top: 0;
    right: auto;
    bottom: 0;
    width: 388px;
    max-height: none;
    border-radius: 0;
    border-top: 0;
    border-right: .5px solid var(--rule);
    padding: 88px 26px 26px;
    transform: translateX(-101%);
    box-shadow: 18px 0 44px -34px rgba(33, 29, 24, .5);
  }
  .sheet[data-open="1"] { transform: translateX(0); pointer-events: auto; }
  .sheet .grab { display: none; }
  .sheet-head h2 { font-size: 20px; }
  /* the rail has room; keep the full form even once results are in */
  .sheet[data-state="results"] { max-height: none; }
  .sheet[data-state="results"] .seeds { display: flex; }
  .sheet[data-state="results"] textarea#q { min-height: 74px; height: auto; overflow: auto; }

  .dock { left: auto; right: 24px; bottom: 24px; transform: none; }
  body.sheet-open .dock { transform: translateY(150%); }
  body.map-open .dock { transform: translateY(150%); }

  .filterbar { left: auto; right: 24px; top: 22px; transform: translateY(-160%); }
  .filterbar[data-open="1"] { transform: translateY(0); }

  .inspect { left: auto; right: 24px; bottom: 84px; transform: translateY(150%); }
  .inspect[data-open="1"] { transform: translateY(0); pointer-events: auto; }

  .map-head { padding: 20px 24px 8px; }
  .legend { padding: 10px 24px 18px; }
}

/* very short landscape phones: don't let the sheet eat the wall */
@media (max-height: 460px) {
  .sheet { max-height: 86vh; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet, .dock, .filterbar, .inspect, .overlay { transition-duration: .01ms; }
  .rank, .why { transition-duration: .01ms; }
}

@media (max-width: 400px) {
  .dock .btn { font-size: 12.5px; padding: 11px 13px; }
}
