/* =====================================================================
   The survey (index.html). One layout system for every card.

   Anatomy of a card, top to bottom, the same everywhere:
     context line   optional: chapter note, follow-up reason, or priority block tag
     title          the question (one size), or a screen title (opening and closing)
     tools          optional: The record, Add a note (they open over the page on
                    single-column cards, so they never move the answers or Next)
     answers        tiles, the phone tray, the agree scale, or fields
     nav            Back on the left, Skip or Next on the right

   Spacing comes from one scale (--s-*); sizes from a few tokens. Shorter screens
   change the tokens, not the components. Wide cards put the question on the left
   and the answers on the right, centred on each other.
   ===================================================================== */

#screen {
  /* spacing scale */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  /* the card */
  --card-top: 2.25rem;          /* header to the first line */
  --card-bottom: 1.25rem;       /* last line to the footer */
  --gap-title: var(--s-4);      /* title to answers */
  --gap-nav: var(--s-6);        /* answers to Back / Next */
  --gap-group: var(--s-5);      /* between question groups on one card */
  /* type */
  --t-title: clamp(1.75rem, 3vw + 1rem, 2.5rem);
  --t-screen: clamp(2.5rem, 7vw + 0.6rem, 4.4rem);
  --t-lede: 1.05rem;
  --t-context: 1.05rem;        /* the line above a question: chapter notes, the priority it belongs to */
  --gap-context: 1.25rem;       /* context line to title */
  --t-legend: 1.08rem;
  /* answers */
  --tile-h: 52px;
  --tile-pad: 0.8rem;
  --tile-font: 1.0625rem;
  --tile-gap: 0.5rem;
  --tile-radius: 28px;
}
@media (min-width: 64rem) and (max-height: 820px) {
  #screen { --card-top: 1.5rem; --gap-nav: 1.75rem; --tile-h: 48px; --tile-pad: 0.65rem; --tile-gap: 0.4rem; }
}
@media (max-width: 34rem) {
  #screen {
    --card-top: 1.75rem;
    --card-bottom: 0.5rem;
    --gap-title: var(--s-4);
    --gap-nav: var(--s-4);
    --gap-group: var(--s-4);
    --t-title: 1.5rem;
    --t-screen: 1.95rem;
    --t-lede: 0.95rem;
    --t-context: 0.95rem;
    --gap-context: 0.6rem;
    --t-legend: 0.98rem;
    --tile-h: 44px;
    --tile-pad: 0.5rem;
    --tile-font: 0.95rem;
    --tile-gap: 0.35rem;
    --tile-radius: 24px;
  }
}
@media (max-width: 34rem) and (max-height: 780px) {
  #screen { --card-top: 1.2rem; --t-title: 1.375rem; --gap-nav: var(--s-4); --t-screen: 1.7rem; --t-lede: 0.85rem; --t-legend: 0.88rem; --tile-h: 44px; --tile-pad: 0.5rem; --tile-font: 0.86rem; --tile-gap: 0.3rem; --gap-group: 0.7rem; }
  #screen .q-title { line-height: 1.18; }
  .chapter-lede { display: none; }
  .likert { padding-block: 0.6rem; }
}
@media (max-width: 34rem) and (max-height: 710px) {
  #screen { --card-top: 0.9rem; }
  #screen .rank-list { row-gap: 3px; }
}

/* ---------- Page frame: header, one card, footer, never more than the window ---------- */
html:has(#screen), html:has(#screen) body { overscroll-behavior: none; }
.shell { display: flex; flex-direction: column; flex: 1 0 auto; width: 100%; }
#screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding: var(--card-top) var(--gutter) var(--card-bottom);
  view-transition-name: screen;
}
.step { display: flex; flex-direction: column; container-type: inline-size; }

/* Moving between cards: the card fades out, then the next one fades in where the page
   starts (js/app.js, render; .page-enter is in ending.css). The swap and the jump back
   to the top happen while nothing shows, so nothing slides or jumps. */
#screen.page-leave, .float-dock.page-leave { opacity: 0; transition: opacity 0.24s ease; pointer-events: none; }
/* Leaving for another page of the site, the card fades with the site's cross-fade */
::view-transition-group(screen) { animation-duration: 0.26s; }
::view-transition-old(screen), ::view-transition-new(screen) { animation-duration: 0.2s; animation-timing-function: ease-out; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(screen), ::view-transition-old(screen), ::view-transition-new(screen) { animation: none; }
}

/* ---------- Header: the progress row under the name ---------- */
.steps {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding: 0.45rem var(--gutter) 0.7rem;
}
@media (min-width: 64rem) { .steps { max-width: calc(78.5rem + 2 * var(--gutter)); } }
.steps-now { display: flex; align-items: baseline; gap: 0.75rem; margin: 0 0 0.45rem; font-size: 0.88rem; }
.steps-now > b { font-weight: 500; font-style: italic; font-size: 1.2rem; letter-spacing: -0.01em; color: var(--accent); }
.steps-count { display: inline-flex; gap: 0.25em; font-size: 0.95rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.steps-count .n { font-weight: 500; color: var(--ink); }
.steps-count .sep { color: rgb(35 31 32 / 0.3); }
.steps-now .save-status { margin-inline-start: auto; }

/* Progress: one hairline, one colour, one mark. Done is red, chapters are separated by
   small gaps, a red dot marks where you are and the red eases forward. */
@property --fill { syntax: '<percentage>'; inherits: true; initial-value: 0%; }
.steps-bar { list-style: none; margin: 0; padding: 5px 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; align-items: center; }
.steps-bar li { position: relative; display: grid; }
.steps-bar a, .steps-bar > li > span { display: block; position: relative; height: 2px; border-radius: 2px; background: rgb(35 31 32 / 0.13); }
.steps-bar a::after { content: ''; position: absolute; inset: -12px 0; }
.steps-bar .done { background: var(--accent); }
.steps-bar .done.ahead { background: rgb(163 11 63 / 0.3); }
@media (hover: hover) { .steps-bar .done:hover { background: var(--accent-ink); } }
.steps-bar .now { background: linear-gradient(to right, var(--accent) var(--fill), rgb(35 31 32 / 0.13) var(--fill)); transition: --fill 0.7s var(--ease); }
.steps-bar .now::after {
  content: '';
  position: absolute;
  top: 50%;
  left: var(--fill);
  width: 9px;
  height: 9px;
  translate: -50% -50%;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 4px 1px rgb(163 11 63 / 0.35);
}
.steps-bar .optional { background: repeating-linear-gradient(90deg, rgb(35 31 32 / 0.25) 0 3px, transparent 3px 7px); }

/* Phones: the bar and "1 / 7" only; "Saved" sits in the header's empty left slot */
@media (max-width: 34rem) {
  .steps { padding-block: 0.35rem 0.2rem; }
  .steps-now { height: 1.27rem; margin: 0; font-size: 0.8rem; line-height: 1.27rem; }
  .steps-now > b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .steps-count { font-size: 0.8rem; }
  .steps-now .save-long { display: none; }
  .steps-now .save-status {
    position: absolute;
    left: max(var(--gutter), env(safe-area-inset-left, 0px));
    top: calc(var(--head-pad) + var(--logo) * 0.55);
    translate: 0 -50%;
    max-width: 6.5rem;
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.25;
    text-align: start;
  }
  .steps-bar { padding-block: 4px 3px; }
}

/* ---------- The card's parts ---------- */
.q-title, .screen-head h1 {
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.q-title { font-size: var(--t-title); }
.screen-head { margin: 0 0 var(--gap-title); }
.screen-head h1 { font-size: var(--t-screen); line-height: 1.02; letter-spacing: -0.02em; }
.step > .q-title + .lede, .screen-head .lede { margin: var(--s-2) 0 0; font-size: var(--t-lede); color: var(--muted); }
.step > .q-title + .lede { margin-block-end: var(--gap-title); }

/* The context line above a title: one quiet style for all three kinds */
.chapter-lede, .fu-reason, .block-tag { margin: 0 0 var(--gap-context); font-size: var(--t-context); color: var(--muted); }
.fu-reason::before { content: ''; display: inline-block; width: 1.2rem; height: 1px; margin-inline-end: 0.55rem; background: var(--accent); vertical-align: middle; }
.block-tag { display: flex; align-items: center; gap: 0.65rem; font-weight: 500; color: var(--ink); }
.block-tag .rank-slot { width: 1.8rem; height: 1.8rem; font-size: 0.9rem; flex: none; }
.block-tag .of { margin-inline-start: auto; color: var(--muted); font-weight: 400; white-space: nowrap; }
.note { margin: 0 0 var(--s-4); padding: 0.9rem 1rem; border-radius: 18px; background: rgb(255 255 255 / 0.6); }
.note p { margin: 0; }
.fu { margin-block-start: var(--gap-group); }

/* Tools: The record and Add a note, on one line under the title */
.q-post { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-5); margin-block-start: var(--s-2); }
.q-post:empty { display: none; }
.record summary, .add-note summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  font-size: 1rem;
}
.record summary::-webkit-details-marker, .add-note summary::-webkit-details-marker { display: none; }
.record summary { font-weight: 500; color: var(--muted); }
@media (hover: hover) { .record summary:hover { color: var(--ink); } }
.record summary::before {
  content: '';
  width: 0.45em;
  height: 0.45em;
  border-inline-end: 1.5px solid currentColor;
  border-block-end: 1.5px solid currentColor;
  rotate: -45deg;
  transition: rotate 0.15s;
}
.record[open] summary::before { rotate: 45deg; }
/* "Add a note": bold and red, so people see they can say more */
.add-note summary { font-weight: 600; color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.2em; }
@media (hover: hover) { .add-note summary:hover { color: var(--accent); } }
.add-note[open] summary { text-decoration: none; }
.note-done { min-height: 36px; margin-inline-start: auto; padding: 0 0.25rem; font: inherit; font-size: 0.92rem; font-weight: 500; color: var(--ink); background: none; border: 0; cursor: pointer; }
@media (hover: hover) { .note-done:hover { color: var(--accent-ink); } }

/* Open, each is a small card over the page, under its line. It never moves the answers or Next. */
.q-post > details[open] > :not(summary) {
  position: absolute;
  z-index: 30;
  inset-inline: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 0 0 1px rgb(35 31 32 / 0.08), 0 22px 44px -20px rgb(20 40 60 / 0.55);
}
.record p { max-height: min(22rem, 50dvh); overflow-y: auto; overscroll-behavior: contain; font-size: 0.95rem; font-style: italic; line-height: 1.5; color: var(--ink); }
.record p::before { content: ''; display: block; width: 1.5rem; height: 2px; margin-block-end: 0.7rem; border-radius: 2px; background: var(--accent); }
.add-note[open] > .field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--s-2) var(--s-4); }
.add-note .field > textarea { grid-column: 1 / -1; min-block-size: 4.5lh; }
@media (prefers-reduced-motion: no-preference) {
  .q-post > details[open] > :not(summary) { animation: pop-in 0.22s var(--ease); }
  @keyframes pop-in { from { opacity: 0; translate: 0 -4px; } }
}
@media (max-width: 34rem) {
  .record p { font-size: 0.88rem; line-height: 1.45; }
}

/* ---------- Answers ---------- */
.q { margin: 0; padding: 0; border: 0; min-width: 0; }
.q > legend { padding: 0; margin-block-end: var(--s-4); font-size: var(--t-legend); font-weight: 500; }
.q-hint { margin: 0 0 var(--s-2); font-size: 0.95rem; color: var(--muted); }
@media (max-width: 34rem) { .q-hint { font-size: 0.9rem; } }
.limit-note { margin: var(--s-2) 0 0; font-size: 0.92rem; color: var(--alert); }
.limit-note:empty { display: none; }
@media (max-width: 34rem) { .q-hint-one { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }

/* The glass tile: every answer, priority and permission */
:root { --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.5 10.5 8.5 14.5 15.5 6' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.opts, .perm-list { display: grid; gap: var(--tile-gap); }
.opt, .rank-btn, .qrank-btn {
  position: relative;
  min-height: var(--tile-h);
  font: inherit;
  font-size: var(--tile-font);
  line-height: 1.35;
  color: var(--ink);
  text-align: start;
  border: 0;
  border-radius: var(--tile-radius);
  cursor: pointer;
  background: linear-gradient(135deg, rgb(255 255 255 / 0.72), rgb(255 255 255 / 0.46) 60%, rgb(255 255 255 / 0.58));
  -webkit-backdrop-filter: blur(20px) saturate(1.15) brightness(1.06);
  backdrop-filter: blur(20px) saturate(1.15) brightness(1.06);
  box-shadow: inset 1.5px 1.5px 0 rgb(255 255 255 / 0.85), inset -1px -1px 0 rgb(255 255 255 / 0.35), 0 0 0 1px rgb(35 31 32 / 0.06), 0 10px 26px -18px rgb(20 40 60 / 0.5);
  transition: translate 0.35s var(--ease), box-shadow 0.35s, background 0.35s;
}
.opt::before, .rank-btn::before, .qrank-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 90% at 12% 0%, rgb(255 255 255 / 0.55), transparent 55%);
  pointer-events: none;
}
.opt > *, .rank-btn > *, .qrank-btn > * { position: relative; }
@media (hover: hover) { .opt:hover, .rank-btn:hover, .qrank-btn:hover {
  background: linear-gradient(135deg, rgb(255 255 255 / 0.85), rgb(255 255 255 / 0.6) 60%, rgb(255 255 255 / 0.7));
  box-shadow: inset 1.5px 1.5px 0 #fff, inset -1px -1px 0 rgb(255 255 255 / 0.45), 0 0 0 1px rgb(35 31 32 / 0.1), 0 12px 28px -18px rgb(20 40 60 / 0.5);
} }
.opt:has(input:checked), .rank-btn[aria-pressed='true'], .qrank-btn[aria-pressed='true'] {
  background: linear-gradient(135deg, #fff, rgb(246 249 251 / 0.95));
  translate: 0 -2px;
  box-shadow: inset 1.5px 1.5px 0 #fff, 0 0 0 1px rgb(35 31 32 / 0.1), 0 18px 34px -18px rgb(20 40 60 / 0.5);
}
@media (prefers-reduced-motion: reduce) { .opt:has(input:checked), .rank-btn[aria-pressed='true'], .qrank-btn[aria-pressed='true'] { translate: none; } }

/* An answer: its text, then a circle that fills red with a tick */
.opt { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: var(--tile-pad) 0.9rem var(--tile-pad) 1.35rem; }
.opt > span { min-width: 0; text-box: trim-both cap alphabetic; }
.opt small { display: block; margin-block-start: 0.2rem; font-size: 0.88rem; color: var(--muted); }
.opt input[type='radio'], .opt input[type='checkbox'] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.opt::after {
  content: '';
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.45) var(--tick) center / 0 no-repeat;
  box-shadow: inset 0 0 0 1px rgb(35 31 32 / 0.12);
  transition: background-color 0.2s, box-shadow 0.2s, background-size 0.2s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.opt:has(input:checked)::after { background-color: var(--accent); background-size: 15px; box-shadow: none; }
.opt:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (max-width: 34rem) {
  .opt { gap: 0.6rem; padding-inline: 1rem 0.7rem; }
  .opt::after { width: 22px; height: 22px; }
}

/* Phones: each answer list is one frosted tray; a white capsule glides to the choice
   (js/glide.js) and a small red dot marks it. Multi-answer lists get a capsule per choice. */
.opts.glide > .glide-cap { display: none; }
@media (max-width: 34rem) {
  .opts.glide {
    position: relative;
    gap: 0;
    padding: 5px;
    border-radius: 26px;
    background: linear-gradient(180deg, rgb(255 255 255 / 0.5), rgb(255 255 255 / 0.36));
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9), 0 0 0 1px rgb(35 31 32 / 0.1);
  }
  .opts.glide > .opt {
    z-index: 1;
    min-height: calc(var(--tile-h) + 4px);
    padding: var(--tile-pad) 1rem var(--tile-pad) 1.1rem;
    border-radius: 21px;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    translate: none;
    color: var(--muted);
    /* the shadow eases in with the white (it used to land first, a grey smudge under a
       still-clear row) */
    transition: color 0.25s, background-color 0.25s, box-shadow 0.25s;
  }
  @media (hover: hover) { .opts.glide > .opt:hover { background: rgb(255 255 255 / 0.3); color: var(--ink); } }
  .opts.glide > .opt:has(input:checked) { color: var(--ink); font-weight: 500; }
  .opts.glide:not(.glide-one) > .opt:has(input:checked) { background: #fff; box-shadow: 0 0 0 1px rgb(35 31 32 / 0.06), 0 8px 20px -14px rgb(20 30 40 / 0.45); }
  /* hairlines between answers, stepping aside around the choice */
  .opts.glide > .opt::before { display: none; }
  .opts.glide > .opt + .opt::before {
    display: block;
    inset: 0 1.25rem auto;
    height: 1px;
    border-radius: 0;
    background: rgb(35 31 32 / 0.09);
    transition: opacity 0.25s;
  }
  .opts.glide > .opt:has(input:checked)::before, .opts.glide > .opt:has(input:checked) + .opt::before { opacity: 0; }
  .opts.glide.opts-2 > .opt::before, .about-grid .opts.glide > .opt::before { display: none; }
  .opts.glide > .opt::after { width: 9px; height: 9px; background: var(--accent); box-shadow: none; scale: 0; transition: scale 0.3s var(--ease); }
  .opts.glide > .opt:has(input:checked)::after { scale: 1; }
  .opts.glide > .glide-cap {
    display: block;
    position: absolute;
    z-index: 0;
    top: 5px; left: 5px; width: 0; height: 0;
    border-radius: 21px;
    background: #fff;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9), 0 0 0 1px rgb(35 31 32 / 0.06), 0 10px 24px -14px rgb(20 30 40 / 0.45);
    opacity: 0;
    pointer-events: none;
    transition: top 0.45s var(--ease), left 0.45s var(--ease), width 0.45s var(--ease), height 0.45s var(--ease), opacity 0.2s;
  }
  .opts.glide.opts-many > .opt { min-height: 38px; padding-block: 0.35rem; }
  .opts.glide.opts-2 > .opt, .about-grid .opts.glide > .opt { min-height: 42px; padding-block: 0.4rem; }
  .opts-2 { grid-template-columns: 1fr 1fr; }
}

/* Agree or disagree (the town statements, js/app.js likertHtml). Each statement is a row:
   the statement, a frosted pill in four parts (Strongly disagree to Strongly agree) and "Not
   sure" on its own. The choice fills navy, like the other pressed controls in the survey.
   Wide: statement left, answers right, rows split by hairlines. Phones: stacked. */
.likert-list { display: grid; margin-block-start: var(--gap-title); }
.likert { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'q q' 'scale unsure'; align-items: center; gap: 0.6rem 0.5rem; padding-block: 1rem; border-top: 1px solid rgb(27 43 58 / 0.1); }
.likert:last-child { border-bottom: 1px solid rgb(27 43 58 / 0.1); }
.likert-q { grid-area: q; margin: 0; font-size: var(--t-legend); font-weight: 500; line-height: 1.35; color: var(--ink); text-wrap: pretty; }
.likert-scale {
  grid-area: scale;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.62), rgb(255 255 255 / 0.4));
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgb(27 43 58 / 0.1);
}
.lk {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 0.3rem 0.45rem;
  border-radius: 999px;
  font-size: 0.95rem;
  line-height: 1.2;
  text-align: center;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.lk input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.lk > span { position: relative; pointer-events: none; text-wrap: balance; }
.likert-scale > .lk + .lk::before { content: ''; position: absolute; left: 0; top: 27%; bottom: 27%; width: 1px; background: rgb(27 43 58 / 0.12); }
.likert-scale > .lk:has(input:checked)::before, .likert-scale > .lk:has(input:checked) + .lk::before { opacity: 0; }
@media (hover: hover) { .lk:hover { background: rgb(255 255 255 / 0.55); } }
.lk:has(input:checked) { background: var(--ink); color: #fff; font-weight: 500; box-shadow: 0 8px 18px -10px rgb(20 40 60 / 0.7); }
.lk:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
/* "Not sure": a smaller pill of its own */
.lk-unsure {
  grid-area: unsure;
  min-height: 40px;
  padding-inline: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  background: rgb(255 255 255 / 0.45);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.8), 0 0 0 1px rgb(27 43 58 / 0.12);
}
@container (min-width: 46rem) {
  .likert { grid-template-columns: minmax(0, 1fr) minmax(0, 27rem) auto; grid-template-areas: 'q scale unsure'; column-gap: 1.25rem; padding-block: 0.85rem; }
}
@media (max-width: 34rem) {
  .likert { gap: 0.5rem 0.4rem; padding-block: 0.75rem; }
  .likert-scale { padding: 3px; }
  .lk { min-height: 46px; padding: 0.25rem 0.3rem; font-size: 0.82rem; }
  .lk-unsure { min-height: 46px; padding-inline: 0.7rem; font-size: 0.82rem; }
}
/* the narrowest phones: "Not sure" under the row, so the four keep their width */
@media (max-width: 22.5rem) {
  .likert { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'q' 'scale' 'unsure'; }
  .lk-unsure { justify-self: end; min-height: 38px; }
}

/* Severity (potholes): three small tiles */
.sev .opts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sev .opt { flex-direction: column-reverse; justify-content: center; gap: 0.3rem; padding: 0.5rem 0.25rem; border-radius: 18px; text-align: center; font-size: 0.92rem; }
.sev .opt::after { width: 20px; height: 20px; }

/* ---------- Question cards: one column on phones; question left, answers right when wide ---------- */
.q-right { margin: var(--gap-title) 0 0; }
/* A question with facts first (the For everyone questions): the facts in reading size, then
   the question itself as the title. Every question's title is the same size, long or short. */
.q-lead { margin: 0 0 var(--s-4); font-size: 1.15rem; line-height: 1.5; color: var(--ink); text-wrap: pretty; }
@media (max-width: 34rem) { .q-lead { margin-block-end: var(--s-3); font-size: 0.95rem; line-height: 1.45; } }
@container (min-width: 46rem) {
  .qgrid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    gap: 3.5rem;
    align-items: center;   /* the question and the answers share a centre line */
  }
  .qgrid .q-title { font-size: clamp(1.6rem, 2.6cqi + 0.35rem, 2.3rem); }
  .q-right { margin: 0; }
  .q-post { margin-block-start: var(--s-3); }
  .step .two-col { gap: 1.5rem 1rem; }
  .step .about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; align-items: start; }
  .step .perm-list { grid-template-columns: 1fr 1fr; }
  .step .opts-2 { grid-template-columns: 1fr 1fr; column-gap: 1.25rem; }
}
.about-grid { display: grid; gap: var(--gap-group); }
.about-grid .q + .q, .about-grid > div > .q + .q { margin-block-start: 0; }
@media (max-width: 34rem) { .about-grid .opts { grid-template-columns: 1fr 1fr; } }

/* ---------- Back, Skip, Next ---------- */
.step-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-block-start: var(--gap-nav); }
.step-nav .nav-spacer { flex: 1; }
.form-error { flex-basis: 100%; margin: 0; color: var(--alert); font-weight: 500; }
.form-error:empty { display: none; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0.2rem 0.4rem 0.2rem 0;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
}
.btn-back .disc { width: 44px; height: 44px; border: 1px solid var(--line); }
@media (hover: hover) { .btn-back:hover .disc { border-color: var(--ink); translate: -3px 0; } }
.btn-skip {
  min-height: 48px;
  padding: 0.4rem 0.9rem;
  font: inherit;
  font-size: 1rem;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
@media (hover: hover) { .btn-skip:hover { color: var(--ink); background: var(--wash); } }
@media (max-width: 34rem) { .btn-back .disc { width: 40px; height: 40px; } }
@media (max-width: 34rem) and (max-height: 780px) { .btn-back .disc { width: 36px; height: 36px; } }

/* ---------- Fields ---------- */
.field { display: grid; gap: 0.4rem; }
.field + .field, .two-col + .field, .field + .two-col { margin-block-start: var(--s-3); }
.field label, .label { margin: 0; padding-inline-start: 0.35rem; font-weight: 500; }
.hint { margin: 0; font-size: 0.9rem; color: var(--muted); }
.counter { margin: 0; padding-inline-end: 0.6rem; font-size: 0.8rem; color: var(--muted); text-align: end; font-variant-numeric: tabular-nums; }
.error-msg { display: none; margin: 0; padding-inline-start: 0.35rem; font-size: 0.92rem; color: var(--alert); }
input:user-invalid ~ .error-msg { display: block; }
.two-col { display: grid; gap: var(--s-3); }
.two-col > .field + .field { margin-block-start: 0; }
@media (min-width: 34rem) { .two-col { grid-template-columns: 1fr 1fr; } }
@media (max-width: 34rem) and (max-height: 780px) { .field + .field, .two-col + .field, .field + .two-col { margin-block-start: var(--s-2); } .two-col { gap: var(--s-2); } }
/* An email already given: shown as a filled field, its label inside, "Change it" at the right */
#email-wrap:has(> .email-known) { position: relative; }
#email-wrap > .label { position: absolute; z-index: 1; top: 0.62rem; left: 1.1rem; padding: 0; font-size: 0.75rem; font-weight: 500; line-height: 1.2; color: var(--muted); pointer-events: none; }
.email-known { display: flex; align-items: center; gap: 0.75rem; min-height: var(--field-h); padding: 1.35rem 0.5rem 0.3rem 1.1rem; border-radius: 16px; background: rgb(255 255 255 / 0.5); box-shadow: 0 0 0 1px rgb(27 43 58 / 0.1); }
.email-known span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-known .btn-quiet { flex: none; min-height: 36px; padding-inline: 0.5rem; font-size: 0.875rem; }
@media (max-width: 34rem) { .email-known { border-radius: 14px; } }
.worst-grid { display: grid; gap: var(--s-4); }
.photo-field input[type='file'] { font: inherit; font-size: 0.92rem; max-width: 100%; }
.photo-field input[type='file']::file-selector-button { font: inherit; font-size: 0.9rem; margin-inline-end: 0.8rem; padding: 0.5rem 1rem; border: 0; border-radius: 999px; background: #fff; color: var(--ink); cursor: pointer; box-shadow: 0 0 0 1px rgb(35 31 32 / 0.12); }
.photo-preview { display: flex; align-items: center; gap: 0.75rem; margin-block-start: 0.5rem; }
.photo-preview img { width: 96px; height: 72px; object-fit: cover; border-radius: 12px; }

/* ---------- Priorities: the opening card ---------- */
.pri { display: grid; grid-template-areas: 'intro' 'list' 'foot'; }
.pri-intro { grid-area: intro; margin: 0 0 var(--gap-title); }
.pri-intro h1 { font-size: var(--t-screen); line-height: 1.02; text-box: trim-both cap alphabetic; }
.pri-intro .lede { margin-block-start: var(--s-4); font-size: var(--t-lede); line-height: 1.5; color: var(--ink); }
.pri-intro .meta { font-size: 0.92rem; }
/* two columns, filled down: --rows is half the number of priorities, rounded up (js/app.js) */
.rank-list { grid-area: list; position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(var(--rows, 8), auto); gap: var(--tile-gap) 0.6rem; }
.rank-list li { position: relative; }
.rank-btn { width: 100%; min-height: calc(var(--tile-h) + 2px); display: grid; grid-template-columns: 2.3rem 1fr; align-items: center; gap: 1rem; padding: 0.45rem 0.9rem 0.45rem 0.6rem; font-size: 0.98rem; line-height: 1.3; }
.rank-btn > span:last-child { text-box: trim-both cap alphabetic; }
.rank-slot {
  width: 2.3rem;
  height: 2.3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgb(35 31 32 / 0.12);
  background: rgb(255 255 255 / 0.45);
  font-size: 1.05rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.num { display: block; line-height: 1; text-box: trim-both cap alphabetic; }
@supports not (text-box: trim-both cap alphabetic) { .num { translate: 0 0.08em; } }
.rank-btn[aria-pressed='true'] .rank-slot, .block-tag .rank-slot { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .rank-btn[aria-pressed='true'] .rank-slot { animation: slot-pop 0.22s cubic-bezier(0.3, 1.6, 0.5, 1); }
  @keyframes slot-pop { from { scale: 0.7; } }
}
/* picks can be dragged into a new order */
.rank-list li:has(.rank-btn[aria-pressed='true']) { touch-action: none; cursor: grab; }
.rank-list li.is-dragging { z-index: 5; cursor: grabbing; }
.rank-list li.is-dragging .rank-btn { scale: 1.04; box-shadow: inset 0 0 0 1px #fff, 0 0 0 1px rgb(35 31 32 / 0.12), 0 22px 40px -16px rgb(20 40 60 / 0.55); transition: scale 0.15s ease, box-shadow 0.15s ease; }
.rank-list.is-sorting { user-select: none; -webkit-user-select: none; }
.rank-list.is-sorting li:not(.is-dragging) .rank-btn { transition: none; }
.pri-foot { grid-area: foot; }

/* A ranked answer ("What should come first on Stewart’s streets?"): tapped in order, each
   shows its place in the circle where other answers show a tick (js/app.js, act.qrank) */
.qrank { display: grid; gap: var(--tile-gap); list-style: none; margin: 0; padding: 0; }
.qrank-btn { width: 100%; min-height: var(--tile-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: var(--tile-pad) 0.9rem var(--tile-pad) 1.35rem; }
.qrank-btn > span:first-child { min-width: 0; text-box: trim-both cap alphabetic; }
.qrank-btn .rank-slot { flex: none; width: 26px; height: 26px; font-size: 0.85rem; }
.qrank-btn[aria-pressed='true'] .rank-slot { background: var(--ink); border-color: var(--ink); color: #fff; }
.qrank-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) { .qrank-btn[aria-pressed='true'] .rank-slot { animation: slot-pop 0.22s cubic-bezier(0.3, 1.6, 0.5, 1); } }
@media (max-width: 34rem) {
  .qrank-btn { gap: 0.6rem; padding-inline: 1rem 0.7rem; }
  .qrank-btn .rank-slot { width: 24px; height: 24px; font-size: 0.8rem; }
}
.rank-summary { margin: 0.9rem 0 0; min-height: calc(2 * 1.425em); line-height: 1.425; font-size: 0.95rem; color: var(--ink); }
/* Past three picks: the survey is getting longer (js/app.js, LONGER) */
.rank-length { margin: 0.35rem 0 0; line-height: 1.425; font-size: 0.95rem; font-weight: 500; color: var(--ink); }
.rank-length:empty { display: none; }
.pri-foot .step-nav { margin-block-start: var(--s-3); justify-content: flex-end; }
@media (min-width: 64rem) {
  .pri { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr); grid-template-areas: 'intro list' '. foot'; column-gap: 3rem; align-items: start; }
  .pri-intro { align-self: center; margin: 0; }
  .pri-intro h1 { font-size: clamp(2.2rem, 2.4vw + 1rem, 3.2rem); }
  .pri-intro .lede { margin-block-start: 1.4rem; }
  .rank-list { column-gap: 1.5rem; }
  .rank-summary { min-height: 1.425em; }
  .pri-foot .step-nav { margin-block-start: 2.5rem; }
}
@media (max-width: 34rem) {
  .pri-intro { margin-block-end: 0.55rem; }
  .pri-intro h1 + .lede { margin-block-start: 0.9rem; }
  .pri-intro .lede { font-size: 0.9rem; line-height: 1.4; }
  .pri-intro .meta { display: none; }
  .rank-list { column-gap: 0.75rem; row-gap: 4px; }
  .rank-btn { min-height: 44px; grid-template-columns: 1.5rem 1fr; gap: 0.55rem; padding: 0.3rem 0.5rem 0.3rem 0.45rem; font-size: 0.8rem; line-height: 1.25; }
  .rank-slot { width: 1.5rem; height: 1.5rem; font-size: 0.8rem; }
  .rank-summary { margin-block-start: var(--s-3); line-height: 1.35; text-align: center; font-size: 0.85rem; font-weight: 500; text-wrap: balance; }
  .rank-length { line-height: 1.35; text-align: center; font-size: 1rem; text-wrap: balance; }
  .pri-foot .step-nav { justify-content: center; margin-block-start: var(--s-2); }
}

/* ---------- Send card ---------- */
.perm-list .opt small { font-size: 0.8rem; }
#perm-email:empty, #perm-phone:empty { display: none; }
.perm-email { margin-block-start: var(--s-4); }
.perm-email label { color: var(--ink); font-weight: 500; font-size: 0.95rem; }
.perm-email > label.is-error:not(.visually-hidden) { color: var(--alert); } /* red, over the grey of a label inside its field */
@media (prefers-reduced-motion: no-preference) {
  .perm-email { animation: perm-in 0.4s var(--ease); }
  @keyframes perm-in { from { opacity: 0; translate: 0 -6px; } }
}
@media (max-width: 34rem) {
  .wide-only { display: none; }
  .perm-list { gap: 0.35rem; }
  .perm-list .opt { min-height: 42px; padding-block: 0.35rem; }
  .perm-list .opt small { display: none; }
  [data-screen='send'] legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .perm-email { margin-block-start: var(--s-2); }
  #perm-phone .perm-email { margin-block-start: 0.4rem; }
  .perm-email input { min-height: 44px; }
  .perm-email label.is-error { font-size: 0.82rem; margin-block-end: 0.25rem; }
  [data-screen='send'] .fine { margin-block-start: var(--s-2); font-size: 0.74rem; line-height: 1.4; }
}

/* ---------- Potholes ---------- */
.street-map { position: relative; height: 15rem; overflow: hidden; border-radius: 22px; background: var(--wash); box-shadow: 0 0 0 1px rgb(35 31 32 / 0.08); }
.street-map .map { position: absolute; inset: 0; }
.street-map .tap-start { position: absolute; inset: auto 1rem 1.9rem; z-index: 500; font-size: 1.1rem; }
.below-map { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-block-start: 0.75rem; }
.pothole-lists h2 { font-weight: 300; font-size: 1.7rem; margin-block: 2rem 0.75rem; }
.pothole-lists .empty { margin: 0; color: var(--muted); }
.pothole-list { list-style: none; margin: 0; padding: 0; border-block-start: 1px solid rgb(35 31 32 / 0.2); }
.pothole-list .card { padding: 1rem 0; border-block-end: 1px solid var(--line); }
.card-head { display: flex; align-items: center; gap: 0.85rem; }
.card-head .where { flex: 1; min-width: 0; }
.card-head .where strong { display: block; font-weight: 500; }
.card-head .where span { font-size: 0.88rem; color: var(--muted); }
.card-body { margin-block-start: 1rem; display: grid; gap: 1.25rem; }
.pin-num { flex: none; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; background: var(--ink); color: var(--surface); border-radius: 50% 50% 50% 0; rotate: -45deg; font-weight: 500; font-size: 0.95rem; }
.pin-num > span { rotate: 45deg; }
.pin-icon { background: none; border: 0; }
.pin-icon .pin-num { width: 30px; height: 30px; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.picker { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--ink); }
.picker[open] { display: grid; grid-template-rows: auto 1fr auto; }
.picker::backdrop { background: rgb(0 0 0 / 0.4); }
.picker-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem var(--gutter); border-block-end: 1px solid var(--line); }
.picker-bar h2 { font-weight: 300; font-size: 1.5rem; }
.picker-map-wrap { position: relative; min-height: 0; }
.picker-map { position: absolute; inset: 0; }
.picker-target { position: absolute; left: 50%; top: 50%; z-index: 500; width: 52px; height: 52px; translate: -50% -50%; pointer-events: none; border: 2px solid var(--accent); border-radius: 50%; box-shadow: 0 0 0 3px rgb(255 255 255 / 0.9); }
.picker-target::before, .picker-target::after { content: ''; position: absolute; left: 50%; top: 50%; translate: -50% -50%; background: var(--accent); }
.picker-target::before { width: 2px; height: 80px; }
.picker-target::after { width: 80px; height: 2px; }
.picker-foot { display: grid; gap: 0.6rem; width: 100%; max-width: calc(var(--measure) + 2 * var(--gutter)); margin-inline: auto; padding: 0.75rem var(--gutter) max(0.75rem, env(safe-area-inset-bottom)); border-block-start: 1px solid var(--line); }
.picker-where { margin: 0; min-height: 1.5em; font-weight: 500; }
.leaflet-container { font: inherit; background: var(--wash); }

/* ---------- Thank you ---------- */
.thanks-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin: 0 0 2rem; border-block: 1px solid rgb(35 31 32 / 0.2); }
.thanks-facts div { padding: 1rem 1rem 1rem 0; }
.thanks-facts div + div { border-inline-start: 1px solid var(--line); padding-inline-start: 1rem; }
.thanks-facts dt { font-size: 0.85rem; color: var(--muted); }
.thanks-facts dd { margin: 0.25rem 0 0; font-size: 1.6rem; line-height: 1.1; }
.panel { margin-block-start: 3rem; padding-block-start: 1.25rem; border-block-start: 1px solid rgb(35 31 32 / 0.2); }
.panel h2 { font-weight: 300; font-size: 1.9rem; }
.dates { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 1rem; }
.dates li { display: grid; grid-template-columns: 4.25rem 1fr; gap: 1rem; align-items: center; }
.date-tile { display: grid; place-items: center; padding: 0.35rem 0; border: 1px solid var(--ink); border-radius: 14px; line-height: 1; text-align: center; }
.date-tile b { font-weight: 300; font-size: 2.1rem; }
.date-tile small { font-size: 0.72rem; letter-spacing: 0.08em; }
.link-line .btn-quiet { min-height: 0; padding: 0; }
@media (max-width: 34rem) {
  .thanks-facts dd { font-size: 1.1rem; }
  .thanks-facts div { padding-block: 0.75rem; }
}

/* =====================================================================
   Palette and type pass, as on the letter page. Navy does the work the
   near-black and greys did. Red keeps the name, and the pothole pins on the
   map, where they have to stand out from the streets. Answer ticks, ranked
   picks, the progress bar, step name and small rules are navy. Text links
   hover in glacier teal. Buttons are navy and still turn red on hover.
   ===================================================================== */
.survey-page {
  --ink: #1b2b3a;        /* fjord navy */
  --muted: #384a5c;      /* navy grey for small text over the photo */
  --graphite: #516478;
  --teal-ink: #1a6573;   /* glacier teal, dark enough for text */
  accent-color: var(--ink);
}

/* Header: "Your town, your call" as a small letterspaced label, the tagline in navy */
.survey-page .masthead .survey-name {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.survey-page .brand-tag { color: var(--ink); }
/* Test mode (romanforstewart.ca/test-mode): the same spot reads TEST MODE in red, on phones too */
.survey-page .masthead .survey-name.is-test { color: var(--accent-ink); }
@media (max-width: 34rem) { .survey-page .masthead .survey-name.is-test { display: block; font-size: 0.72rem; letter-spacing: 0.1em; } }

/* Progress in navy: the step name, the done segments and the moving mark */
.survey-page .steps-now > b { color: var(--ink); }
.survey-page .steps-count .sep { color: rgb(27 43 58 / 0.3); }
.survey-page .steps-bar a,
.survey-page .steps-bar > li > span { background: rgb(27 43 58 / 0.13); }
.survey-page .steps-bar .done { background: var(--ink); }
.survey-page .steps-bar .done.ahead { background: rgb(27 43 58 / 0.3); }
@media (hover: hover) { .survey-page .steps-bar .done:hover { background: var(--teal-ink); } }
.survey-page .steps-bar .now { background: linear-gradient(to right, var(--ink) var(--fill), rgb(27 43 58 / 0.13) var(--fill)); }
.survey-page .steps-bar .now::after { background: var(--ink); box-shadow: 0 1px 4px 1px rgb(27 43 58 / 0.3); }
.survey-page .steps-bar .optional { background: repeating-linear-gradient(90deg, rgb(27 43 58 / 0.25) 0 3px, transparent 3px 7px); }

/* The valley behind the survey, painted exactly like the letter page's once its fog
   has lifted: the same photo (HDR on HDR screens), anchored at the top so the glacier
   sits in the same place, the same white wash (lighter at the top so the glacier and
   sky show), the same blue at the foot, and Safari's toolbar fade from base.css. */
body.survey-page::before {
  background:
    linear-gradient(to bottom, rgb(163 194 217 / 0) calc(100% - 52px), rgb(163 194 217 / 0.35) calc(100% - 28px), var(--edge-bottom) 100%),
    linear-gradient(to top, rgb(40 150 220 / 0.32) 0%, rgb(40 150 220 / 0.12) 28%, transparent 55%),
    radial-gradient(70rem 45rem at 100% 100%, rgb(163 11 63 / 0.06), transparent 70%),
    radial-gradient(60rem 40rem at 0% 0%, rgb(160 205 215 / 0.06), transparent 70%),
    linear-gradient(to bottom, rgb(251 252 252 / 0.56) 0%, rgb(251 252 252 / 0.56) 12%, rgb(251 252 252 / 0.8) 26%, rgb(251 252 252 / 0.78) 58%, rgb(251 252 252 / 0.3) 100%),
    var(--backdrop-photo) center top / max(100%, calc(100vh * 1.3159)) auto no-repeat,
    var(--bg);
  /* The tints and the white veil are sized to 100vh and hang from the top, like the photo
     and the header's copy of them: on iPhone they then stay still while Safari's toolbar
     grows and shrinks (sized to the window, they stretched, and the lower half of the
     valley lightened and darkened with every scroll). Only the blue at the foot follows
     the window's bottom edge. */
  background-size: 100% 100%, 100% 100vh, 100% 100vh, 100% 100vh, 100% 100vh, max(100%, calc(100vh * 1.3159)) auto;
  background-position: 0 0, 0 0, 0 0, 0 0, 0 0, center top;
  background-repeat: no-repeat;
}

/* The footer sits on the blue at the foot of the photo: full navy keeps it readable */
.survey-page .site-footer,
.survey-page .site-footer a:not(:hover) { color: var(--ink); }

/* Your picks and ticks in navy (white numbers on navy read at about 14:1) */
.survey-page .rank-btn[aria-pressed='true'] .rank-slot,
.survey-page .block-tag .rank-slot { background: var(--ink); border-color: var(--ink); color: #fff; }
.survey-page .opt:has(input:checked)::after { background-color: var(--ink); }
@media (max-width: 34rem) { .survey-page .opts.glide > .opt::after { background: var(--ink); } } /* phones' small dot */

/* Small rules beside text */
.survey-page .fu-reason::before,
.survey-page .record p::before { background: var(--ink); }

/* Text links hover in teal (buttons and the name keep their own hovers) */
.survey-page a:not(.btn-go):not(.brand):hover,
.survey-page .note-done:hover { color: var(--teal-ink); }

/* The opening question reads in even lines: "next council" and "fix first?"
   stay together (non-breaking spaces in js/app.js), the heading is balanced and a
   touch smaller on computers so it breaks evenly without narrowing the answers,
   and the two short paragraphs
   are balanced so no word or two is left alone on a line. */
.pri-intro h1 { text-wrap: balance; }
.pri-intro .lede,
.pri-intro .meta { text-wrap: balance; }
@media (min-width: 64rem) {
  .pri-intro h1 { font-size: clamp(2.1rem, 2vw + 0.9rem, 2.7rem); }
  /* each sentence on its own lines, so they break at the commas */
  .pri-intro .lede > span { display: block; text-wrap: balance; }
}

/* The survey header paints the page's own valley layers behind it (the same layers,
   sizes and anchoring as the page background), so questions scrolling up pass under
   it instead of through the progress line; a short fade below it softens the edge,
   as on the letter page. */
.survey-page .masthead {
  --sv-layers:
    linear-gradient(to top, rgb(40 150 220 / 0.32) 0%, rgb(40 150 220 / 0.12) 28%, transparent 55%),
    radial-gradient(70rem 45rem at 100% 100%, rgb(163 11 63 / 0.06), transparent 70%),
    radial-gradient(60rem 40rem at 0% 0%, rgb(160 205 215 / 0.06), transparent 70%),
    linear-gradient(to bottom, rgb(251 252 252 / 0.56) 0%, rgb(251 252 252 / 0.56) 12%, rgb(251 252 252 / 0.8) 26%, rgb(251 252 252 / 0.78) 58%, rgb(251 252 252 / 0.3) 100%),
    var(--backdrop-photo);
  --sv-sizes: 100% 100vh, 100% 100vh, 100% 100vh, 100% 100vh, max(100%, calc(100vh * 1.3159)) auto;
  background: var(--sv-layers), var(--top-tint);
  background-size: var(--sv-sizes), auto;
  background-position: 0 0, 0 0, 0 0, 0 0, center top, 0 0;
  background-repeat: no-repeat;
}
/* Above the header, behind the phone's status bar and Dynamic Island, the same valley
   carries on to the very top of the screen: the header's own layers, mirrored, so the
   two meet without a seam (no flat pale bar). */
.survey-page .masthead { box-shadow: none; }
.survey-page .masthead::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 160px;
  pointer-events: none;
  background: var(--sv-layers), var(--bg);
  background-size: var(--sv-sizes), auto;
  background-position: 0 0, 0 0, 0 0, 0 0, center top, 0 0;
  background-repeat: no-repeat;
  transform: scaleY(-1);
}
.survey-page .masthead::after {
  content: '';
  position: absolute;
  inset: 100% 0 auto 0;
  height: 28px;
  pointer-events: none;
  --off: calc(-1 * var(--mh, 100px));
  background: var(--sv-layers), var(--bg);
  background-size: var(--sv-sizes), auto;
  background-position: 0 var(--off), 0 var(--off), 0 var(--off), 0 var(--off), center var(--off), 0 0;
  background-repeat: no-repeat;
  -webkit-mask-image: linear-gradient(#000, transparent);
  mask-image: linear-gradient(#000, transparent);
}

/* Footer: the authorization line at a readable size on phones, and the two links
   with a tap area of at least 44px (an invisible pad, so the layout does not move) */
@media (max-width: 34rem) {
  .survey-page .site-footer { font-size: 0.82rem; }
}
.survey-page .site-footer a { position: relative; }
.survey-page .site-footer a::after { content: ''; position: absolute; inset: -16px -6px; }

/* ---------- Address: suggestions as you type ---------- */
.field[hidden] { display: none; }
/* the write-in under "Something else" */
.other-field { margin-top: 0.75rem; }
.combo { position: relative; }
.addr-list {
  position: absolute;
  inset-inline: 0.4rem;
  top: calc(100% + 6px);
  z-index: 30;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border-radius: 22px;
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 0 0 1px rgb(35 31 32 / 0.08), 0 18px 40px -18px rgb(20 40 60 / 0.45);
}
.addr-list li {
  padding: 0.7rem 1rem;
  border-radius: 16px;
  cursor: pointer;
  line-height: 1.25;
}
.addr-list li[aria-selected='true'], .addr-list li:hover { background: rgb(27 43 58 / 0.08); }
.addr-hint:empty { display: none; }
.addr-hint .btn-quiet { font-size: 0.9rem; }
/* What an address gets them: a small "What you get" tip beside the label (it opens on
   hover, focus or a tap), so the card never grows */
.addr-label { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 0.75rem; }
/* The address label inside the box like the others, the "What you get" tip at its right */
.addr-field { position: relative; }
.addr-field > .addr-label { position: absolute; z-index: 2; top: 0; left: 1.1rem; right: 0.45rem; height: var(--field-h); flex-wrap: nowrap; align-items: center; pointer-events: none; }
.addr-field > .addr-label > label { align-self: flex-start; margin-top: 0.62rem; padding: 0; font-size: 0.75rem; font-weight: 500; line-height: 1.2; color: var(--muted); white-space: nowrap; }
.addr-field > .addr-label > label .hint { font-size: inherit; font-weight: 400; }
.addr-field > .addr-label .perk-tip-wrap { pointer-events: auto; }
.addr-field .combo > input { min-height: var(--field-h); padding: 1.5rem 9.25rem 0.4rem 1.1rem; }
.addr-field .combo > input:placeholder-shown { text-overflow: ellipsis; }
/* Address and town side by side; the hint under both. On phones the tip shows its two
   icons only, so the address keeps room. */
.addr-group { display: grid; gap: var(--s-3); }
.addr-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--s-3); }
.addr-group > .addr-hint { margin-top: calc(var(--s-3) * -0.25); }
.addr-row > .field + .field { margin-block-start: 0; }
.addr-group .region-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.two-col + .addr-group, .addr-group + .field, .addr-group + .two-col { margin-block-start: var(--s-3); }
.addr-group[hidden] { display: none; }
@media (max-width: 34rem) {
  .addr-group, .addr-row { gap: var(--s-2); }
  .addr-row { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
  .addr-field .perk-tip { gap: 0; padding: 0 0.3rem; }
  .addr-field .perk-word { display: none; }
  .addr-field .combo > input { padding-right: 3.75rem; }
}
@media (max-width: 34rem) and (max-height: 780px) { .two-col + .addr-group, .addr-group + .field, .addr-group + .two-col { margin-block-start: var(--s-2); } }
.addr-field:has(input:focus) > .addr-label > label { color: var(--ink); }
.perk-tip-wrap { position: relative; }
.perk-tip { display: inline-flex; align-items: center; gap: 0.3rem; min-height: 32px; padding: 0 0.75rem 0 0.35rem; border: 0; border-radius: 999px; background: rgb(255 255 255 / 0.6); box-shadow: 0 0 0 1px rgb(27 43 58 / 0.1); font: inherit; font-size: 0.84rem; font-weight: 500; color: var(--ink); cursor: pointer; }
.perk-tip .perk-i { width: 1.5rem; height: 1.5rem; }
.perk-tip .perk-i + .perk-i { margin-inline-start: -0.55rem; }
.perk-tip .perk-i svg { width: 0.85rem; height: 0.85rem; }
@media (hover: hover) { .perk-tip:hover { background: #fff; } }
.perk-i { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgb(27 43 58 / 0.12); }
.perk-i svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.perk-pop {
  position: absolute;
  z-index: 40;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(19rem, 80vw);
  padding: 0.8rem 1rem;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.45;
  box-shadow: 0 16px 36px -14px rgb(10 20 30 / 0.55);
  opacity: 0;
  visibility: hidden;
  translate: 0 4px;
  transition: opacity 0.18s ease, translate 0.18s ease, visibility 0s linear 0.18s;
  pointer-events: none;
}
.perk-pop::after { content: ''; position: absolute; right: 1.6rem; top: 100%; border: 7px solid transparent; border-top-color: var(--ink); }
.perk-tip-wrap.is-open .perk-pop, .perk-tip:focus-visible + .perk-pop { opacity: 1; visibility: visible; translate: 0 0; transition-delay: 0s; }
@media (hover: hover) { .perk-tip:hover + .perk-pop { opacity: 1; visibility: visible; translate: 0 0; transition-delay: 0s; } }
/* Name and address card: first and last name side by side on phones too; email and phone
   side by side from tablets up, stacked on phones so the email has room */
.two-col.name-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 34rem) { .two-col.contact-row { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Last page: your street, today and repaved ---------- */
.ba-sec { margin: 0 0 2.5rem; }
.ba-kicker { margin: 0 0 0.35rem; font-size: 0.85rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ba-sec h2 { margin: 0 0 1rem; font-weight: 300; font-size: clamp(1.7rem, 2.4vw + 1rem, 2.4rem); line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
.ba { --pos: 50%; margin: 0; max-width: 40rem; }
.ba-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 24px;
  background: #c9d6df;
  box-shadow: 0 0 0 1px rgb(35 31 32 / 0.08), 0 24px 50px -30px rgb(20 40 60 / 0.55);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: ew-resize;
}
.ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.ba-top { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.ba-handle { position: absolute; z-index: 1; top: 0; bottom: 0; left: var(--pos); width: 0; pointer-events: none; }
.ba-handle::before { content: ''; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgb(20 40 60 / 0.18), 0 0 14px rgb(20 40 60 / 0.35); }
.ba-knob {
  position: absolute;
  top: 50%;
  left: 0;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 0 0 3px #fff, 0 8px 20px -6px rgb(20 40 60 / 0.6);
  transition: scale 0.2s var(--ease);
}
.ba-knob svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ba.is-dragging .ba-knob { scale: 1.08; }
.ba-tag {
  position: absolute;
  top: 12px;
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  background: rgb(255 255 255 / 0.88);
  box-shadow: 0 0 0 1px rgb(35 31 32 / 0.08);
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.2s;
}
.ba-tag small { font-size: 0.72rem; font-weight: 400; color: var(--muted); }
/* a small picture keeps "Illustration" and drops the filming date, so the two labels never meet */
.ba-frame { container-type: inline-size; }
@container (max-width: 22rem) { .ba-tag-before small { display: none; } }
.ba-tag-before { left: 12px; }
.ba-tag-after { right: 12px; }
.ba-tag-after small { color: var(--accent); letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.66rem; font-weight: 500; }
/* a label fades once its side is mostly covered */
.ba.is-left .ba-tag-before, .ba.is-right .ba-tag-after { opacity: 0; }
.ba-range {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.ba-frame:has(.ba-range:focus-visible) { outline: 3px solid var(--teal-ink, #1a6573); outline-offset: 3px; }
.ba-note { margin: 0.8rem 0 0; max-width: 40rem; font-size: 0.85rem; line-height: 1.45; color: var(--muted); }
.ba-facts { margin: 1rem 0 0; max-width: 40em; font-size: 1.05rem; line-height: 1.45; }
.ba-q { margin-block-start: 1.75rem; max-width: 40rem; }
.ba-q .opts { grid-template-columns: 1fr; }
@media (min-width: 40rem) { .ba-q .opts { grid-template-columns: 1fr 1fr; } }
.ba-reply { margin: 1rem 0 0; max-width: 40em; font-size: 1.15rem; line-height: 1.4; font-weight: 500; color: var(--ink); }
.ba-reply:empty { display: none; }

/* The District's property tax on their address, year by year */
.tax-table { width: 100%; max-width: 32rem; margin: 0.25rem 0 0; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tax-table th, .tax-table td { padding: 0.55rem 0; border-block-end: 1px solid var(--line); text-align: end; font-weight: 400; }
.tax-table th:first-child { text-align: start; }
.tax-table thead th { padding-block-start: 0; font-size: 0.82rem; font-weight: 500; color: var(--muted); }
.tax-table tbody td:last-child { font-weight: 500; }
@media (max-width: 34rem) {
  .ba-frame { border-radius: 18px; }
  .ba-tag { top: 8px; padding: 0.3rem 0.6rem; font-size: 0.78rem; }
  .ba-tag-before { left: 8px; }
  .ba-tag-after { right: 8px; }
  .ba-knob { width: 40px; height: 40px; }
  .ba-knob svg { width: 19px; height: 19px; }
  .ba-reply { font-size: 1.05rem; }
}

/* =====================================================================
   The end of the survey: parts shared by the tax, street and summary cards
   (the rest is in css/ending.css).
   ===================================================================== */
/* what the camera found near their house, and the way to the map */
.tally { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.1rem; }
.tally li { display: flex; align-items: baseline; gap: 0.35rem; font-size: 0.9rem; color: var(--ink); }
.tally li::before { content: ''; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: #1b2b3a; }
.tally .t3::before { background: #ff3b44; }
.tally .t1::before { background: none; box-shadow: inset 0 0 0 1.5px #1b2b3a; }
.tally b { font-size: 1.3rem; font-weight: 500; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.hh-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-inline-start: auto;
  padding: 0.5rem 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}
.hh-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: translate 0.25s var(--ease); }
@media (hover: hover) { .hh-link:hover { color: var(--accent-ink); } .hh-link:hover svg { translate: 3px 0; } }
.hh-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.hh-fine { margin: 0; max-width: 34rem; font-size: 0.84rem; line-height: 1.45; color: var(--muted); }

/* Street fine: a mosaic of the worst streets instead of their own */
.worst-mosaic { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; border-radius: 24px; overflow: hidden; box-shadow: 0 24px 50px -30px rgb(20 40 60 / 0.55); }
.worst-mosaic img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }

/* Their tax now and with the Community Share, as two big figures */
.cs-numbers { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.25rem 1.1rem; }
.cs-n b { display: block; font-weight: 300; font-size: clamp(2.5rem, 2.4vw + 1.5rem, 3.6rem); line-height: 0.95; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--ink); }
.cs-n span { display: block; margin-top: 0.45rem; font-size: 0.8rem; color: var(--muted); }
.cs-n.is-cs b { font-weight: 400; color: var(--accent); }
.cs-n.is-cs span { color: var(--accent-ink); font-weight: 500; }
.cs-arrow { padding-bottom: 1.75rem; }
.cs-arrow svg { display: block; width: 26px; height: 26px; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
/* The questions on the tax and street cards: one frosted tray each, a white capsule on the choice
   (js/glide.js), on every screen size */
.hq > legend { margin-block-end: 0.9rem; font-size: 1.1rem; }
.hq .opts { grid-template-columns: 1fr; }
@media (min-width: 34.01rem) {
  .hq .opts.glide {
    position: relative;
    gap: 0;
    padding: 5px;
    border-radius: 26px;
    background: linear-gradient(180deg, rgb(255 255 255 / 0.5), rgb(255 255 255 / 0.36));
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9), 0 0 0 1px rgb(35 31 32 / 0.1);
  }
  .hq .opts.glide > .opt {
    z-index: 1;
    min-height: 50px;
    padding: 0.65rem 1rem 0.65rem 1.3rem;
    border-radius: 21px;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    translate: none;
    color: var(--muted);
    transition: color 0.25s, background-color 0.25s, box-shadow 0.25s;
  }
  @media (hover: hover) { .hq .opts.glide > .opt:hover { background: rgb(255 255 255 / 0.3); color: var(--ink); } }
  .hq .opts.glide > .opt:has(input:checked) { color: var(--ink); font-weight: 500; }
  .hq .opts.glide > .opt::before { display: none; }
  .hq .opts.glide > .opt + .opt::before { display: block; inset: 0 1.3rem auto; height: 1px; border-radius: 0; background: rgb(35 31 32 / 0.09); transition: opacity 0.25s; }
  .hq .opts.glide > .opt:has(input:checked)::before, .hq .opts.glide > .opt:has(input:checked) + .opt::before { opacity: 0; }
  .hq .opts.glide > .opt::after { width: 22px; height: 22px; }
  .hq .opts.glide > .glide-cap {
    display: block;
    position: absolute;
    z-index: 0;
    top: 5px; left: 5px; width: 0; height: 0;
    border-radius: 21px;
    background: #fff;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9), 0 0 0 1px rgb(35 31 32 / 0.06), 0 10px 24px -14px rgb(20 30 40 / 0.45);
    opacity: 0;
    pointer-events: none;
    transition: top 0.45s var(--ease), left 0.45s var(--ease), width 0.45s var(--ease), height 0.45s var(--ease), opacity 0.2s;
  }
}
.hq + .saved:not(:empty) { margin-top: 0.9rem; }
.ba-reply { margin: 0.4rem 0 0; max-width: 34rem; font-size: 1.05rem; line-height: 1.4; font-weight: 400; color: var(--ink); }
.ba-reply:empty { display: none; }

/* "Saved. Thank you." the moment an answer is picked */
.saved { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; margin: 0; font-size: 0.92rem; font-weight: 500; color: var(--ink); }
.saved:not(:empty) { margin-top: 0.8rem; }
.saved-tick { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent) var(--tick) center / 12px no-repeat; }
.saved-off { font-weight: 400; color: var(--muted); }
/* About you, right after sending: "Your answers are sent" above the title */
.saved.sent-note:not(:empty) { margin: 0 0 0.9rem; font-size: 1rem; }
.saved.is-new { animation: saved-in 0.35s var(--ease); }
.saved.is-new .saved-tick { animation: saved-pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes saved-in { from { opacity: 0; translate: 0 -4px; } }
@keyframes saved-pop { from { scale: 0; } }
@media (prefers-reduced-motion: reduce) { .saved.is-new, .saved.is-new .saved-tick { animation: none; } }

/* A small round icon beside a line (the reserves lock) */
.flow-i { grid-row: span 2; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: rgb(255 255 255 / 0.75); box-shadow: 0 0 0 1px rgb(27 43 58 / 0.12); }
.flow-i svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.flow-lock { display: flex; align-items: center; gap: 0.75rem; margin: 1.4rem 0 0; font-size: 0.92rem; color: var(--muted); }
.flow-lock .flow-i { width: 2.3rem; height: 2.3rem; }
.flow-lock .flow-i svg { width: 1.05rem; height: 1.05rem; }

/* Yes / No / Not sure: one frosted pill in three parts */
.seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.62), rgb(255 255 255 / 0.42));
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgb(35 31 32 / 0.1);
}
.seg > .opt {
  display: grid;
  place-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.3rem 0.4rem;
  border-radius: 999px;
  font-size: 0.92rem;
  text-align: center;
  color: var(--muted);
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  translate: none;
  transition: background-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.seg > .opt::before, .seg > .opt::after { display: none; }
.seg > .opt + .opt { background: linear-gradient(rgb(35 31 32 / 0.1), rgb(35 31 32 / 0.1)) left center / 1px 46% no-repeat; }
@media (hover: hover) { .seg > .opt:hover { color: var(--ink); background: rgb(255 255 255 / 0.4); box-shadow: none; } }
.seg > .opt:has(input:checked) { background: #fff; color: var(--ink); font-weight: 500; box-shadow: 0 0 0 1px rgb(35 31 32 / 0.06), 0 8px 18px -10px rgb(20 40 60 / 0.5); }
.seg > .opt:has(input:checked) + .opt { background-size: 0 0; }

/* ---------- The streets, and the way into the map and the drive ---------- */
.streets-sec { margin: 5.5rem 0 3.5rem; }
.streets-sec h2 { margin: 0; font-size: clamp(1.85rem, 1.5vw + 1.25rem, 2.55rem); }
.streets-sec .worst-grid { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 0.6rem; }
.streets-sec .worst-grid figure { margin: 0; }
.streets-sec .worst-grid img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; background: var(--line); }
.streets-sec .worst-grid figcaption { margin-top: 0.45rem; font-size: 0.82rem; line-height: 1.3; color: var(--muted); }
.streets-sec .worst-grid figcaption b { display: block; font-weight: 500; color: var(--ink); }
@media (max-width: 39.99rem) { .streets-sec .worst-grid li:nth-child(9) { display: none; } }
@media (min-width: 40rem) { .streets-sec .worst-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem 0.75rem; } }
@media (min-width: 60rem) {
  .streets-sec .worst-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .streets-sec .worst-grid li:nth-child(9) { display: none; }
}

.launch { display: grid; gap: 1rem; margin-top: 2rem; }
@media (min-width: 44rem) { .launch { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.launch-tile {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 26px;
  overflow: hidden;
  font: inherit;
  text-align: start;
  color: var(--ink);
  cursor: pointer;
  background: #dfe8ee;
  box-shadow: 0 0 0 1px rgb(35 31 32 / 0.08), 0 24px 50px -30px rgb(20 40 60 / 0.55);
}
.lt-img { display: block; aspect-ratio: 16 / 10; }
.lt-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: scale 0.7s var(--ease); }
.launch-tile:not(.is-drive) .lt-img img { object-position: 50% 25%; }
.lt-cap {
  position: absolute;
  inset: auto 12px 12px;
  display: block;
  padding: 0.95rem 4.2rem 1rem 1.15rem;
  border-radius: 18px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.85), 0 0 0 1px rgb(35 31 32 / 0.08);
}
.lt-cap > b { display: block; font-size: 1.2rem; font-weight: 500; letter-spacing: -0.01em; }
.lt-cap > span:not(.lt-go) { display: block; margin-top: 0.25rem; font-size: 0.86rem; line-height: 1.35; color: var(--muted); }
.lt-go { position: absolute; top: 50%; right: 0.9rem; translate: 0 -50%; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--ink); color: #fff; transition: background-color 0.25s; }
.lt-go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: translate 0.25s var(--ease); }
@media (hover: hover) {
  .launch-tile:hover .lt-img img { scale: 1.03; }
  .launch-tile:hover .lt-go { background: var(--accent); }
  .launch-tile:hover .lt-go svg { translate: 2px 0; }
}
.launch-tile:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
@media (max-width: 34rem) {
  .launch-tile { border-radius: 20px; }
  .lt-img { aspect-ratio: 3 / 2; }
  .lt-cap { position: relative; inset: auto; padding: 0.85rem 3.8rem 0.95rem 1rem; border-radius: 0; background: rgb(255 255 255 / 0.8); box-shadow: 0 -1px 0 rgb(35 31 32 / 0.06); }
  .lt-cap > b { font-size: 1.05rem; }
  .lt-go { width: 2.3rem; height: 2.3rem; right: 0.7rem; }
}

/* =====================================================================
   Phones: one column at reading size. Answers and priorities are one to a row at 17px
   (16px on short screens) instead of two narrow columns at 13 to 15px. The priorities
   keep their usual order and show their numbers, so nothing moves under a finger, and
   the button at the foot of the window is a down arrow at first (there is more below)
   and "Continue with 3" once the page moves (js/app.js, setDock). Every answer shows its
   ring (or a box, where you can pick several) so it reads as something to tap. The
   street card keeps its own sizes: it fits its screens to the window.
   ===================================================================== */
@media (max-width: 34rem) {
  #screen:not([data-kind='street']) { --tile-font: 1.0625rem; --tile-h: 52px; --tile-pad: 0.6rem; --t-lede: 1rem; --t-legend: 1rem; }
  .pri .rank-list { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; row-gap: 6px; }
  .pri .rank-btn { min-height: 54px; grid-template-columns: 2rem 1fr; gap: 0.85rem; padding: 0.55rem 1rem 0.55rem 0.75rem; font-size: 1.0625rem; line-height: 1.3; }
  .pri .rank-btn .rank-slot { width: 2rem; height: 2rem; font-size: 0.95rem; }
  .pri .rank-list li:has(.rank-btn[aria-pressed='true']) { touch-action: manipulation; cursor: pointer; }
  .pri .rank-summary { font-size: 1rem; }
  body.has-dock .pri-foot .btn-go { display: none; }
  .opts-2, .about-grid .opts { grid-template-columns: 1fr; }
  .opts.glide > .opt, .opts.glide.opts-2 > .opt, .about-grid .opts.glide > .opt { min-height: var(--tile-h); padding-block: 0.5rem; }
  .opts.glide.opts-many > .opt { min-height: calc(var(--tile-h) - 6px); padding-block: 0.4rem; }
  .opts.glide.opts-2 > .opt + .opt::before, .about-grid .opts.glide > .opt + .opt::before { display: block; }
  .survey-page .opts.glide > .opt::after {
    scale: 1;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: transparent;
    box-shadow: inset 0 0 0 1.5px rgb(27 43 58 / 0.4);
    transition: background-color 0.2s, box-shadow 0.2s;
  }
  .survey-page .opts.glide > .opt:has(input:checked)::after { background: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink), inset 0 0 0 5px #fff; }
  .survey-page .opts.glide > .opt:has(input[type='checkbox'])::after { border-radius: 6px; }
  .survey-page .opts.glide > .opt:has(input[type='checkbox']:checked)::after { background: var(--ink) var(--tick) center / 14px no-repeat; box-shadow: none; }
}
@media (max-width: 34rem) and (max-height: 780px) {
  #screen:not([data-kind='street']) { --tile-font: 1rem; --tile-h: 48px; --tile-pad: 0.5rem; --t-lede: 0.95rem; --t-legend: 0.95rem; }
  .pri .rank-btn { min-height: 50px; font-size: 1rem; }
}
/* Phones: the picks so far stay in view at the foot of the window, above the arrow or
   Continue: one frosted strip of numbered short names, in order (a tap on one takes it
   off). Many picks wrap to a second line; the band behind grows with it (--picks-h). */
.dock-picks { display: none; }
@media (max-width: 34rem) {
  body.dock-picks-on .dock-picks {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: calc(var(--dock-btn) + env(safe-area-inset-bottom, 0px) + 62px);
    z-index: 31;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 18px;
    background: rgb(255 255 255 / 0.8);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 0 0 1px rgb(27 43 58 / 0.08), 0 8px 20px -14px rgb(20 40 60 / 0.5);
  }
  .pick-chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 30px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.875rem;
    color: var(--ink);
    white-space: nowrap;
    cursor: pointer;
  }
  .pick-chip .num { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 0.75rem; font-weight: 500; }
  body.has-dock.dock-picks-on { --band: calc(104px + var(--picks-h, 38px) + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 34rem) and (max-height: 720px) {
  body.has-dock.dock-picks-on { --band: calc(92px + var(--picks-h, 38px) + env(safe-area-inset-bottom, 0px)); }
}
/* Phones: "You can pick up to seven…" and "Pick at least one…" show just above the picks
   at the foot of the window (js/app.js, priNotice), where the eye is. */
.dock-note { display: none; }
@media (max-width: 34rem) {
  .float-dock .dock-note:not([hidden]) {
    display: block;
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: calc(var(--dock-btn) + env(safe-area-inset-bottom, 0px) + 72px + var(--picks-h, 0px));
    z-index: 32;
    max-width: 24rem;
    margin: 0 auto;
    padding: 0.6rem 0.9rem;
    border-radius: 14px;
    background: rgb(255 255 255 / 0.96);
    box-shadow: 0 0 0 1.5px rgb(179 38 30 / 0.45), 0 12px 28px -14px rgb(20 40 60 / 0.5);
    color: var(--alert);
    font-size: 0.9375rem;
    line-height: 1.35;
    text-align: center;
    text-wrap: balance;
  }
  @media (prefers-reduced-motion: no-preference) {
    .float-dock .dock-note:not([hidden]) { animation: dock-note-in 0.3s var(--ease); }
    @keyframes dock-note-in { from { opacity: 0; translate: 0 8px; } }
  }
}
/* the heads-up past three picks: navy, no tick */
@media (max-width: 34rem) {
  .float-dock .dock-note.is-info:not([hidden]) { color: var(--ink); box-shadow: 0 0 0 1px rgb(27 43 58 / 0.12), 0 12px 28px -14px rgb(20 40 60 / 0.5); }
}
/* the full list is good news: navy, with a tick */
@media (max-width: 34rem) {
  .float-dock .dock-note.is-good:not([hidden]) { color: var(--ink); box-shadow: 0 0 0 1px rgb(27 43 58 / 0.12), 0 12px 28px -14px rgb(20 40 60 / 0.5); }
  .float-dock .dock-note.is-good::before { content: ''; display: inline-block; width: 20px; height: 20px; margin-inline-end: 0.45rem; vertical-align: -0.3em; border-radius: 50%; background: var(--ink) var(--tick) center / 13px no-repeat; }
}
/* Phones: reading text at 16px at least. The line above a question (chapter notes such as
   "Two quick questions on each priority you picked", the priority it belongs to), the facts
   before a question, the hints, the priorities intro, the statements and the About you
   labels. Fine print (sources, counters, the footer, labels inside fields) stays small; the
   agree scale's four labels go to 14px, the most its pill has room for. The street card
   keeps its own sizes. */
@media (max-width: 34rem) {
  #screen:not([data-kind='street']) { --t-context: 1rem; --t-lede: 1rem; --t-legend: 1rem; }
  #screen:not([data-kind='street']) .q-hint,
  #screen:not([data-kind='street']) .pri-intro .lede { font-size: 1rem; }
  #screen:not([data-kind='street']) .q-lead { font-size: 1.0625rem; }
  #screen:not([data-kind='street']) .lk { font-size: 0.875rem; }
}

/* ---------- Send: one thing, their email (js/app.js cards.send) ----------
   "Send and keep me posted" is the main button; "Just send my answers" sits beside it,
   quiet. Quoting and texts come on the next card. */
.send-card .send-email { margin-block-start: 1.5rem; max-width: 30rem; }
.send-card .send-email > label.is-error { color: var(--alert); }
.send-promise { margin: 0.75rem 0 0; max-width: 32rem; font-size: 0.95rem; line-height: 1.45; color: var(--muted); }
.send-card .step-nav .send-plain { white-space: nowrap; }
@media (max-width: 34rem) {
  .send-card .step-nav { flex-wrap: wrap; row-gap: 0.25rem; }
  .send-card .step-nav .send-plain { order: 5; margin-inline-start: auto; }
}

/* ---------- Finish later (js/app.js showFinishLater) ----------
   Once, partway through: a small card at the foot of the window offering a link by email. */
.later {
  position: fixed;
  z-index: 60;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(24rem, calc(100% - 32px));
  box-sizing: border-box;
  padding: 1.1rem 1.1rem 1rem;
  border-radius: 22px;
  background: linear-gradient(180deg, #f8fafb, #eef3f6);
  box-shadow: 0 24px 60px -24px rgb(10 20 30 / 0.55), 0 0 0 1px rgb(27 43 58 / 0.08);
  color: var(--ink);
  opacity: 0;
  translate: 0 12px;
  transition: opacity 0.3s ease, translate 0.35s var(--ease);
}
.later.is-in { opacity: 1; translate: 0 0; }
.later-x { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: rgb(27 43 58 / 0.07); color: var(--ink); cursor: pointer; }
.later-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media (hover: hover) { .later-x:hover { background: rgb(27 43 58 / 0.13); } }
.later-h { margin: 0; padding-right: 2.75rem; font-size: 1.15rem; font-weight: 500; line-height: 1.25; }
.later-p { margin: 0.3rem 0 0; padding-right: 1rem; font-size: 0.92rem; line-height: 1.4; color: var(--muted); }
.later-form { display: flex; gap: 0.5rem; margin-top: 0.85rem; }
.later-form input { flex: 1; min-width: 0; min-height: 44px; padding: 0 0.95rem; border: 1px solid rgb(27 43 58 / 0.22); border-radius: 999px; background: #fff; font: inherit; font-size: 1rem; color: var(--ink); }
.later-form input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.later-form .btn-small { flex: none; }
.later-msg { margin: 0.55rem 0 0; font-size: 0.9rem; line-height: 1.4; color: var(--muted); }
.later-msg:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .later { transition: none; } }
