/* The question flow (templates/flow.html, js/lib/flow.js): sign-up's last step and the
   optional questions after it, one at a time. Without a script the same markup is a plain
   form, every question stacked; `.flow-page.is-live` is the one-at-a-time version.

   Motion: one ease (quick start, long soft landing) for things arriving, one spring for
   things that are chosen, never anything bouncy on text. Everything respects
   prefers-reduced-motion. Glyphs (web/img/answer-glyphs.svg) are line art in the ink
   colour; a chosen option tints its glyph's body and plays the glyph's little move. */

.flow-page {
  --flow-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --flow-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --flow-radius: 1.125rem;
  --flow-line: color-mix(in oklab, var(--ink) 16%, transparent);
  --flow-line-hover: color-mix(in oklab, var(--ink) 40%, transparent);
  --flow-chosen: color-mix(in oklab, var(--ink) 6%, var(--surface));
  margin: 0 auto;
  width: 100%;
  max-width: 36rem;
  padding: 1rem 1rem 0;
}

/* A focused page: just the flow (layout.html with `page.focus`). */
.is-focus .main { padding-bottom: 0; }
.is-focus .topbar { border-bottom-color: transparent; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; position: relative; }

.flow { display: flex; min-height: calc(100dvh - 4.5rem); flex-direction: column; }

/* ─── Head: back, the track, finish later ───────────────────────────────── */

.flow-head { margin-bottom: 1.75rem; }
.flow-page:not(.is-live) .flow-head { display: none; }
.flow-head-row { display: flex; min-height: 2.25rem; align-items: center; justify-content: space-between; margin: 0 -0.625rem 0.375rem; }
.flow-back, .flow-exit {
  display: inline-flex; height: 2.25rem; align-items: center; gap: 0.375rem; padding: 0 0.625rem; border-radius: 9999px;
  font-size: 0.875rem; font-weight: 500; color: var(--muted); white-space: nowrap;
  transition: opacity 240ms ease, color 160ms ease, background-color 160ms ease, transform 160ms ease;
}
.flow-back:hover, .flow-exit:hover { background: var(--surface-2); color: var(--ink); }
.flow-back:active, .flow-exit:active { transform: scale(0.96); }
.flow-back .icon { transition: transform 260ms var(--flow-spring); }
.flow-back:hover .icon { transform: translateX(-2px); }
.flow-back.is-away, .flow-exit.is-away { opacity: 0; pointer-events: none; }
.flow-exit { margin-left: auto; }

.flow-track { min-width: 0; }
.ft-bars { display: flex; height: 0.375rem; gap: 0.25rem; }
.ft-part {
  position: relative; min-width: 0.75rem; flex: var(--grow, var(--total)) 1 0; overflow: hidden; border-radius: 9999px;
  background: var(--surface-3); transition: flex-grow 800ms var(--flow-ease);
}
.ft-fill {
  position: absolute; inset: 0; border-radius: inherit; background: var(--ink); transform-origin: left center;
  transform: scaleX(calc(var(--passed, 0) / var(--total, 1)));
  transition: transform 560ms var(--flow-ease) 520ms;
}
.ft-part.is-done .ft-fill { transform: none; }
.ft-done { display: none; }
.ft-label { margin-top: 0.625rem; overflow: hidden; font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }

/* ─── The stage and its steps ───────────────────────────────────────────── */

.flow-stage { position: relative; }
/* Not painted until the script has it ready (.is-ready, the same turn the first step's entry
   starts), so a page comes in once instead of showing and then animating. Without a script
   (flow.html's <noscript> style), or if it never arrives, it simply shows. */
.flow-stage { opacity: 0; animation: flow-reveal 1ms 2.5s forwards; }
.flow-stage.is-ready { opacity: 1; animation: none; }
@keyframes flow-reveal { to { opacity: 1; } }
.flow-page.is-live .flow-stage { min-height: 22rem; }
.flow-step[hidden] { display: none; }
.flow-step.is-leaving { position: absolute; inset-inline: 0; pointer-events: none; }
fieldset.flow-step { min-width: 0; margin: 0; border: 0; padding: 0; }

.flow-kicker { display: inline-flex; align-items: center; gap: 0.4rem; margin-bottom: 0.875rem; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.01em; color: var(--muted); }
.flow-kicker-done { color: var(--ink); }
.flow-kicker-done svg { width: 1.125rem; height: 1.125rem; padding: 0.1875rem; border-radius: 9999px; background: var(--ink); color: var(--surface); }
.flow-page.is-live .flow-kicker-done svg path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: flow-draw 520ms var(--flow-ease) 520ms forwards; }

.flow-title {
  display: block; float: none; width: 100%; padding: 0; outline: none;
  font-family: var(--font-serif); font-size: clamp(1.75rem, 1.3rem + 2vw, 2.375rem); line-height: 1.14; font-weight: 600;
  letter-spacing: -0.025em; color: var(--ink); text-wrap: balance;
}
/* Each word rises in its own mask; the padding keeps descenders inside it. */
.fw { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.fw > span { display: inline-block; }

.flow-about { margin-top: 0.75rem; max-width: 32rem; font-size: 1.0625rem; line-height: 1.55; color: var(--ink-2); }
.flow-meta { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; font-size: 0.8125rem; color: var(--muted); }
.flow-meta span + span::before { content: '·'; margin-right: 0.5rem; }
.fq-body { margin-top: 1.75rem; }
.fq-note { margin-top: 0.625rem; font-size: 0.8125rem; line-height: 1.5; color: var(--muted); }
.fq-error {
  margin-top: 1rem; border-radius: 0.75rem; padding: 0.625rem 0.875rem; font-size: 0.875rem; font-weight: 500;
  background: color-mix(in oklab, var(--danger) 10%, transparent); color: var(--danger);
}
.flow-link { font-size: 0.875rem; font-weight: 500; color: var(--ink-2); text-decoration: underline; text-underline-offset: 0.2em; }

/* Without a script: the questions stacked, each a plain field set. */
.flow-page:not(.is-live) .flow-section > .fq + .fq { margin-top: 2.5rem; border-top: 1px solid var(--line); padding-top: 2rem; }
.flow-page:not(.is-live) .flow-title { font-size: 1.5rem; }
.flow-page:not(.is-live) .flow-checkpoint .flow-title { font-size: 2rem; }
.flow-actions { margin: 2.5rem 0 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ─── Options ───────────────────────────────────────────────────────────── */

.fo-set { display: grid; gap: 0.625rem; }
.fo {
  position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; min-height: 6.25rem; padding: 1rem 0.75rem; border: 1.5px solid var(--flow-line); border-radius: var(--flow-radius);
  background: var(--surface); color: var(--ink); text-align: center; cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 200ms ease, transform 180ms var(--flow-ease), box-shadow 240ms ease;
}
.fo:hover { border-color: var(--flow-line-hover); }
.fo:active { transform: scale(0.975); }
/* The radio stays in the label, invisible: keyboard focus and the form both use it. */
.fo-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.fo:has(.fo-input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
/* The fill grows from where it was pressed (--x, --y from the script; the middle by keyboard). */
.fo::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--flow-chosen);
  clip-path: circle(0% at var(--x, 50%) var(--y, 50%)); transition: clip-path 560ms var(--flow-ease);
}
.fo:has(.fo-input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 0.5px var(--ink); }
.fo:has(.fo-input:checked)::before { clip-path: circle(150% at var(--x, 50%) var(--y, 50%)); }
.fo-text { font-size: 0.9375rem; font-weight: 500; line-height: 1.3; text-wrap: balance; }
.fo-check {
  position: absolute; top: 0.5rem; right: 0.5rem; display: grid; width: 1.375rem; height: 1.375rem; place-items: center;
  border-radius: 9999px; background: var(--ink); color: var(--surface); transform: scale(0);
  /* Going away: quick and straight (a spring would overshoot past nothing and flip it). */
  transition: transform 180ms cubic-bezier(0.55, 0, 0.75, 0.2);
}
.fo-check svg path, .flow-box svg path, .fg-mark svg path, .ft-done svg path {
  fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
}
.fo-check svg path, .flow-box svg path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 300ms ease-out 120ms; }
.fo:has(.fo-input:checked) .fo-check { transform: scale(1); transition: transform 380ms var(--flow-spring); }
.fo:has(.fo-input:checked) .fo-check svg path { stroke-dashoffset: 0; }
.fo-none { min-height: 3rem; border-style: dashed; color: var(--muted); }
.fo-none .fo-text { font-size: 0.875rem; }

/* Tiles: two or three across, more on wide screens. */
.fo-set-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fo-set-tiles[data-n='3'] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fo-set-tiles[data-n='5'] > .fo:nth-child(5) { grid-column: span 2; }
.fo-set-tiles[data-n='8'] .fo { min-height: 5.75rem; }
.fo-set-tiles:not(:has(.glyph)) .fo { min-height: 4.25rem; }
.fo-glyph { display: grid; place-items: center; color: var(--ink); }
.fo-glyph .glyph { width: 2.75rem; height: 2.75rem; }
.fo-set-tiles[data-n='8'] .fo-glyph .glyph { width: 2.375rem; height: 2.375rem; }

/* A list: one option a row. */
.fo-set-list { gap: 0.5rem; }
.fo-set-list .fo, .fg-options .fo, .fo-set-ladder .fo, .flow-page:not(.is-live) .fo-set-slider .fo, .flow-page:not(.is-live) .fo-set-day_night .fo {
  flex-direction: row; justify-content: flex-start; gap: 0.875rem; min-height: 3.375rem; padding: 0.75rem 3rem 0.75rem 1.125rem; text-align: left;
}
.fo-set-list .fo-check, .fg-options .fo-check, .fo-set-ladder .fo-check { top: 50%; right: 1rem; margin-top: -0.6875rem; }
.fo-set-list .fo-glyph .glyph { width: 2rem; height: 2rem; }

/* Counts: a little scene of figures over the numbers. */
.fq-count-scene { position: relative; display: flex; height: 6rem; align-items: flex-end; justify-content: center; gap: 0.25rem; margin-bottom: 1.25rem; border-bottom: 1.5px solid var(--line); color: var(--ink); }
.fq-count-slot { display: none; }
.fq-count-slot.is-on { display: block; }
.fq-count-slot .glyph { width: 4.25rem; height: 4.25rem; --glyph-fill: color-mix(in oklab, currentColor 14%, transparent); }
.fq-count-more { display: none; align-self: center; font-family: var(--font-serif); font-size: 1.75rem; font-weight: 600; }
.fq-count-scene.is-plus .fq-count-more { display: block; }
.fq-count-more::before { content: '+'; }
.fq-count-scene.is-empty::after, .fq-count-scene[data-none='1']::after {
  content: ''; position: absolute; bottom: 1.25rem; width: 2.5rem; height: 2.5rem; border: 1.5px dashed var(--line-strong); border-radius: 9999px;
}
.fo-set-count { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 0.5rem; }
.fo-set-count .fo { min-height: 4rem; padding: 0.75rem 0.25rem; }
.fo-set-count .fo-text { font-family: var(--font-serif); font-size: 1.375rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.fo-set-count .fo-check { display: none; }
.fo-figures { display: flex; gap: 0.125rem; }
.fo-figures .glyph { width: 1.5rem; height: 1.5rem; }
.flow-page.is-live .fo-figures { display: none; }

/* The ladder: the highest level on top; the chosen one and those under it fill, bottom up. */
.fo-set-ladder { gap: 0.375rem; }
.fo-set-ladder .fo { min-height: 3rem; padding-block: 0.625rem; }
.fo-rung {
  flex: none; width: calc(0.625rem + var(--level) * 0.3125rem); height: 0.5rem; border-radius: 9999px; background: var(--surface-3);
  transition: background-color 280ms ease calc(var(--level) * 45ms), transform 420ms var(--flow-spring) calc(var(--level) * 45ms);
}
.fo.is-under .fo-rung { background: var(--ink); transform: scaleY(1.25); }
.fo-set-ladder .fo-text { font-size: 0.9375rem; }

/* Bars: five equal groups, rising. */
.fo-set-bars { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; gap: 0.5rem; }
.fo-set-bars .fo { min-height: 0; justify-content: flex-end; gap: 0.625rem; border: 0; padding: 0.5rem 0.125rem; background: none; }
.fo-set-bars .fo::before { display: none; }
.fo-set-bars .fo-check { top: auto; bottom: calc(100% - 1.5rem); left: 50%; right: auto; margin-left: -0.6875rem; }
.fo-bar {
  width: 100%; height: calc(2.75rem + var(--level) * 1.625rem); border-radius: 0.875rem 0.875rem 0.5rem 0.5rem; background: var(--surface-3);
  transform-origin: bottom; transition: background-color 240ms ease, transform 460ms var(--flow-spring);
}
.fo-set-bars .fo:hover .fo-bar { background: color-mix(in oklab, var(--ink) 22%, var(--surface-3)); }
.fo-set-bars .fo:has(.fo-input:checked) { box-shadow: none; }
.fo-set-bars .fo:has(.fo-input:checked) .fo-bar { background: var(--ink); transform: scaleY(1.06); }
.fo-set-bars .fo-text { font-size: 0.75rem; line-height: 1.25; color: var(--muted); }
.fo-set-bars .fo:has(.fo-input:checked) .fo-text { color: var(--ink); font-weight: 600; }

/* Several choices: chips. */
.fo-set-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.fo-chip { flex-direction: row; gap: 0.5rem; min-height: 2.75rem; padding: 0.5rem 1rem 0.5rem 0.625rem; border-radius: 9999px; }
.fo-chip .fo-check { position: static; width: 1.25rem; height: 1.25rem; transform: none; background: transparent; border: 1.5px solid var(--line-strong); color: transparent; transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease; }
.fo-chip:has(.fo-input:checked) .fo-check { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.fo-chip .fo-text { font-size: 0.9375rem; }

/* Groups, then the branch. */
.fo-groups { display: grid; gap: 0.5rem; }
.fg-label { margin: 1rem 0 0.5rem; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.fg-options { display: grid; gap: 0.375rem; }
.fo-groups.is-live .fg-options, .fq-grouped.is-live .fg-options { overflow: hidden; padding: 0.375rem 0 0.25rem 0.875rem; }
.fg-pick {
  display: flex; width: 100%; align-items: center; gap: 0.25rem; min-height: 3.375rem; padding: 0.75rem 1rem 0.75rem 1.125rem;
  border: 1.5px solid var(--flow-line); border-radius: var(--flow-radius); background: var(--surface); text-align: left; font-size: 0.9375rem; font-weight: 500;
  transition: border-color 200ms ease, background-color 240ms ease, transform 180ms var(--flow-ease);
}
.fg-pick:hover { border-color: var(--flow-line-hover); }
.fg-pick:active { transform: scale(0.985); }
.fg.is-chosen > .fg-pick { border-color: var(--ink); background: var(--flow-chosen); }
.fg-branch { color: var(--muted); font-weight: 400; }
.fg-branch:not(:empty)::before { content: '·'; margin: 0 0.4rem; }
.fg-mark { margin-left: auto; display: grid; width: 1.375rem; height: 1.375rem; place-items: center; border-radius: 9999px; transition: transform 320ms var(--flow-ease), background-color 200ms ease; }
.fg[data-size='1'] .fg-mark { transform: scale(0); background: var(--ink); color: var(--surface); transition-duration: 180ms; transition-timing-function: cubic-bezier(0.55, 0, 0.75, 0.2); }
.fg[data-size='1'].is-chosen .fg-mark { transform: scale(1); transition-duration: 380ms; transition-timing-function: var(--flow-spring); }
.fg[data-size='1'] .fg-mark path { stroke-width: 2.6; }
.fg:not([data-size='1']).is-open .fg-mark { transform: rotate(180deg); }

/* ─── Along a track ─────────────────────────────────────────────────────── */

.fs { --thumb: 2.25rem; padding-top: 0.25rem; }
.fs-value { min-height: 2.25rem; margin-bottom: 1.25rem; text-align: center; font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); }
.fs.is-empty .fs-value { font-family: var(--font-sans); font-size: 0.9375rem; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.fs-track { position: relative; height: 3rem; }
.fs-range { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; touch-action: pan-y; }
.fs-stops {
  position: absolute; top: 50%; inset-inline: calc(var(--thumb) / 2); display: flex; height: 0.375rem; align-items: center; justify-content: space-between;
  border-radius: 9999px; background: var(--surface-3); transform: translateY(-50%);
}
.fs-stops::before {
  content: ''; position: absolute; inset-block: 0; left: 0; width: calc(var(--p, 0) * 100%); border-radius: inherit; background: var(--ink);
  transition: width 280ms var(--flow-ease);
}
.fs.is-empty .fs-stops::before { width: 0; }
.fs-stop { position: relative; width: 0.625rem; height: 0.625rem; border: 2px solid var(--line-strong); border-radius: 9999px; background: var(--surface); transition: border-color 200ms ease, background-color 200ms ease, transform 300ms var(--flow-spring); }
.fs-stop:first-child { margin-left: -0.3125rem; }
.fs-stop:last-child { margin-right: -0.3125rem; }
.fs-stop.is-on { border-color: var(--ink); background: var(--ink); }
.fs-thumb {
  position: absolute; top: 50%; left: calc(var(--thumb) / 2 + var(--p, 0) * (100% - var(--thumb))); z-index: 1;
  display: grid; width: var(--thumb); height: var(--thumb); place-items: center; border: 2px solid var(--ink); border-radius: 9999px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); transform: translate(-50%, -50%);
  transition: left 240ms var(--flow-ease), transform 260ms var(--flow-spring), opacity 200ms ease;
}
.fs.is-empty .fs-thumb { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
.fs-range:active ~ .fs-thumb { transform: translate(-50%, -50%) scale(1.12); }
.fs-range:focus-visible ~ .fs-thumb { outline: 2px solid var(--focus); outline-offset: 3px; }
.fs-ends { display: flex; justify-content: space-between; gap: 1.5rem; margin-top: 0.75rem; font-size: 0.8125rem; line-height: 1.35; color: var(--muted); }
.fs-ends span:last-child { text-align: right; }
.flow-page.is-live .fo-set-slider, .flow-page.is-live .fo-set-day_night { display: none; }

/* Morning to evening: a sky along the track, the sun or the moon on the thumb. */
.fs-daynight { --sky-a: #f2c14e; --sky-b: #ec8f5e; --sky-c: #6c72c4; --sky-d: #2c2f6b; }
.fs-daynight .fs-stops { height: 0.625rem; background: linear-gradient(90deg, var(--sky-a), var(--sky-b) 38%, var(--sky-c) 66%, var(--sky-d)); }
.fs-daynight .fs-stops::before { display: none; }
.fs-daynight .fs-stop { border-color: rgb(255 255 255 / 0.65); background: transparent; }
.fs-daynight .fs-stop.is-on { border-color: #fff; background: #fff; }
.fs-daynight .fs-thumb { --thumb: 2.75rem; width: 2.75rem; height: 2.75rem; }
.fs-daynight .fs-thumb .glyph { position: absolute; width: 1.625rem; height: 1.625rem; transition: opacity 260ms ease, transform 420ms var(--flow-ease); }
.fs-daynight .g-sun { --glyph-fill: color-mix(in oklab, var(--sky-a) 55%, transparent); }
.fs-daynight .g-moon { --glyph-fill: color-mix(in oklab, var(--sky-c) 40%, transparent); opacity: 0; transform: rotate(-60deg) scale(0.6); }
.fs-daynight[data-side='night'] .g-sun { opacity: 0; transform: rotate(60deg) scale(0.6); }
.fs-daynight[data-side='night'] .g-moon { opacity: 1; transform: none; }
.fq-day-night { display: none; }

/* ─── The compass ───────────────────────────────────────────────────────── */

.flow-compass { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.flow-compass .compass-pad { width: min(19rem, 72vw); border-radius: 0.75rem; }
.flow-compass .compass-dot { transition: cx 140ms ease-out, cy 140ms ease-out; }
.flow-compass .compass-pad.is-dragging .compass-dot { transition: none; }
.flow-compass .compass-reading { min-height: 1.5rem; font-size: 0.9375rem; font-weight: 500; color: var(--ink); text-align: center; }
.flow-compass .compass-controls { width: 100%; }
.flow-compass .flow-consent-check, .flow-compass .fq-note { align-self: stretch; }

/* ─── Sign-up: the birth date ───────────────────────────────────────────── */

.fb { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.fy { margin-bottom: 1.75rem; }
.fy-label { margin-bottom: 0.5rem; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.fy-window { position: relative; --item: 4.75rem; border-radius: 1.25rem; background: var(--surface-2); outline: none; touch-action: pan-x; }
.fy-window:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
.fy-strip {
  display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-inline: calc(50% - var(--item) / 2); cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24%, #000 76%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 24%, #000 76%, transparent);
}
.fy-strip::-webkit-scrollbar { display: none; }
.fy-strip.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.fy-item {
  display: grid; flex: none; width: var(--item); height: 5.25rem; place-items: center; scroll-snap-align: center; user-select: none;
  font-family: var(--font-serif); font-size: 1.375rem; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--muted);
  transform: scale(calc(1.4 - var(--d, 3) * 0.22)); opacity: calc(1 - var(--d, 3) * 0.3); transition: color 200ms ease;
}
.fy-item.is-on { color: var(--ink); font-weight: 600; }
.fy-lens { position: absolute; top: 0.5rem; bottom: 0.5rem; left: 50%; width: calc(var(--item) + 0.75rem); border: 1.5px solid var(--ink); border-radius: 0.875rem; pointer-events: none; transform: translateX(-50%); transition: border-color 240ms ease; }
.fy.is-empty .fy-lens { border-style: dashed; border-color: var(--line-strong); }
.fy-hint { margin-top: 0.5rem; font-size: 0.8125rem; color: var(--muted); text-align: center; transition: opacity 240ms ease; }
.fy:not(.is-empty) .fy-hint { opacity: 0; }
.fm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
.fm-month {
  display: grid; place-items: center; text-align: center; min-height: 2.875rem; border: 1.5px solid var(--flow-line); border-radius: 0.875rem; background: var(--surface); font-size: 0.9375rem; font-weight: 500;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 180ms var(--flow-ease);
}
.fm-month:hover { border-color: var(--flow-line-hover); }
.fm-month:active { transform: scale(0.95); }
.fm-month[aria-pressed='true'] { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.fm-month.is-picked { animation: flow-pick 420ms var(--flow-spring); }

/* ─── Sign-up: the country ──────────────────────────────────────────────── */

.fc-search {
  display: flex; height: 3.5rem; align-items: center; gap: 0.625rem; padding: 0 1rem; border: 1.5px solid var(--flow-line); border-radius: 1rem;
  background: var(--surface); color: var(--muted); transition: border-color 200ms ease, box-shadow 200ms ease;
}
.fc-search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in oklab, var(--focus) 16%, transparent); color: var(--ink); }
.fc-input { min-width: 0; flex: 1; border: 0; background: none; font-size: 1.0625rem; color: var(--ink); outline: none; }
.fc-input::-webkit-search-cancel-button { display: none; }
.fc-list { margin-top: 0.75rem; display: grid; gap: 0.375rem; }
.fc-row {
  position: relative; display: flex; min-height: 3.375rem; align-items: center; gap: 0.75rem; padding: 0.75rem 3rem 0.75rem 1.125rem;
  border: 1.5px solid var(--flow-line); border-radius: var(--flow-radius); background: var(--surface); cursor: pointer;
  transition: border-color 200ms ease, background-color 200ms ease;
}
.fc-row:hover, .fc-row.is-active { border-color: var(--flow-line-hover); }
.fc-row[aria-selected='true'] { border-color: var(--ink); background: var(--flow-chosen); }
.fc-row .fo-check { top: 50%; right: 1rem; margin-top: -0.6875rem; }
.fc-row[aria-selected='true'] .fo-check { transform: scale(1); transition: transform 380ms var(--flow-spring); }
.fc-row[aria-selected='true'] .fo-check svg path { stroke-dashoffset: 0; }
.fc-name { font-weight: 500; }
.fc-note { font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.fc-empty { padding: 0.75rem 0.25rem; font-size: 0.875rem; color: var(--muted); }

/* ─── Show on my profile ────────────────────────────────────────────────── */

.fq-show { position: relative; display: inline-flex; align-items: flex-start; gap: 0.75rem; margin-top: 1.5rem; cursor: pointer; font-size: 0.9375rem; color: var(--ink-2); transition: opacity 240ms ease; }
.fq-show.is-idle { opacity: 0.45; }
.fq-show-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fq-switch { position: relative; flex: none; width: 2.5rem; height: 1.5rem; border-radius: 9999px; background: var(--surface-3); transition: background-color 220ms ease; }
.fq-switch::after {
  content: ''; position: absolute; top: 0.1875rem; left: 0.1875rem; width: 1.125rem; height: 1.125rem; border-radius: 9999px;
  background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / 0.25); transition: transform 340ms var(--flow-spring);
}
.fq-show:has(.fq-show-input:checked) .fq-switch { background: var(--ink); }
.fq-show:has(.fq-show-input:checked) .fq-switch::after { transform: translateX(1rem); }
.fq-show:has(.fq-show-input:focus-visible) .fq-switch { outline: 2px solid var(--focus); outline-offset: 2px; }
.fq-show-text { padding-top: 0.125rem; }
.fq-show-note { display: block; margin-top: 0.125rem; font-size: 0.8125rem; color: var(--muted); }

/* ─── A section's "go on, or stop here?" ────────────────────────────────── */

.flow-checkpoint { padding-top: 0.5rem; }
.flow-choices { display: grid; gap: 0.75rem; margin-top: 2rem; }
.flow-choice {
  display: inline-flex; height: 3.5rem; align-items: center; justify-content: center; padding: 0 1.75rem; border: 1.5px solid var(--flow-line);
  border-radius: 9999px; background: var(--surface); color: var(--ink); font-size: 1.0625rem; font-weight: 600; text-decoration: none;
  transition: background-color 200ms ease, border-color 200ms ease, transform 180ms var(--flow-ease), box-shadow 240ms ease;
}
.flow-choice:hover { border-color: var(--flow-line-hover); }
.flow-choice:active { transform: scale(0.97); }
.flow-go { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.flow-go:hover { border-color: var(--ink); box-shadow: var(--shadow-lg); }
/* Consent: saying no is exactly as easy and as visible as saying yes. */
.flow-checkpoint[data-needs-consent] .flow-go { background: var(--surface); color: var(--ink); }
.flow-checkpoint[data-needs-consent]:has([data-flow-consent]:checked) .flow-go { background: var(--ink); color: var(--surface); }
.flow-choice.is-busy { pointer-events: none; color: transparent; position: relative; }
.flow-choice.is-busy::after, .flow-next.is-busy::after {
  content: ''; position: absolute; width: 1.25rem; height: 1.25rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 9999px;
  color: var(--surface); animation: bt-spin 700ms linear infinite;
}
.flow-agreed { display: flex; align-items: center; gap: 0.5rem; margin-top: 1.5rem; font-size: 0.9375rem; color: var(--ink-2); }
.flow-agreed svg { width: 1.125rem; height: 1.125rem; padding: 0.1875rem; border-radius: 9999px; background: var(--ink); color: var(--surface); }
.flow-promise { margin-top: 1.5rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); }
.flow-promise summary { display: flex; align-items: center; gap: 0.5rem; padding: 0.875rem 1rem; cursor: pointer; list-style: none; font-size: 0.9375rem; font-weight: 500; }
.flow-promise summary::-webkit-details-marker { display: none; }
.flow-chevron { margin-left: auto; color: var(--muted); transition: transform 260ms var(--flow-ease); }
.flow-promise[open] .flow-chevron { transform: rotate(180deg); }
.flow-promise-body { padding: 0 1rem 1rem; font-size: 0.875rem; line-height: 1.55; color: var(--ink-2); }
/* Where the browser can, the fold glides open instead of jumping. */
.flow-promise { interpolate-size: allow-keywords; }
.flow-promise::details-content { block-size: 0; overflow-y: clip; transition: block-size 420ms var(--flow-ease), content-visibility 420ms allow-discrete; }
.flow-promise[open]::details-content { block-size: auto; }
.flow-consent { margin-top: 1.5rem; border-radius: 1rem; background: var(--surface-2); padding: 1rem 1.125rem; }
.flow-consent-check { position: relative; display: flex; align-items: flex-start; gap: 0.75rem; cursor: pointer; font-size: 0.9375rem; line-height: 1.5; color: var(--ink); }
.flow-consent-check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.flow-box {
  display: grid; flex: none; width: 1.375rem; height: 1.375rem; margin-top: 0.0625rem; place-items: center; border: 1.5px solid var(--ink-2);
  border-radius: 0.4375rem; background: var(--surface); color: var(--surface); transition: background-color 200ms ease, border-color 200ms ease, transform 300ms var(--flow-spring);
}
.flow-consent-check:has(input:checked) .flow-box { border-color: var(--ink); background: var(--ink); transform: scale(1.06); }
.flow-consent-check:has(input:checked) .flow-box svg path { stroke-dashoffset: 0; }
.flow-consent-check:has(input:focus-visible) .flow-box { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ─── The thanks ────────────────────────────────────────────────────────── */

.flow-done { padding-top: 2.5rem; text-align: center; }
.flow-done .flow-title, .flow-done .flow-about { margin-inline: auto; }
.flow-done .flow-meta { justify-content: center; }
.flow-done .flow-choices { justify-content: center; }
.flow-done-mark { display: inline-block; margin-bottom: 1.5rem; }
.flow-count { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ─── The button under a question ───────────────────────────────────────── */

.flow-bar {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 1rem; margin-top: auto; padding: 1.5rem 0 calc(1rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--page) 72%, transparent); transition: opacity 260ms ease, transform 420ms var(--flow-ease);
}
.flow-bar.is-away { opacity: 0; transform: translateY(0.75rem); pointer-events: none; }
.flow-next {
  position: relative; display: inline-flex; flex: 1; height: 3.5rem; align-items: center; justify-content: center; gap: 0.5rem; overflow: hidden;
  padding: 0 1.75rem; border: 1.5px solid var(--flow-line); border-radius: 9999px; background: var(--surface); color: var(--ink); font-size: 1.0625rem; font-weight: 600;
  transition: background-color 280ms ease, color 280ms ease, border-color 280ms ease, transform 180ms var(--flow-ease), box-shadow 280ms ease;
}
.flow-next:hover { border-color: var(--flow-line-hover); }
.flow-next:active { transform: scale(0.98); }
.flow-next.is-ready { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.flow-next.is-ready:hover { box-shadow: var(--shadow-lg); }
.flow-next-label { display: inline-block; }
.flow-next-arrow { transition: transform 320ms var(--flow-spring); }
.flow-next:hover .flow-next-arrow { transform: translateX(3px); }
.flow-next.is-busy > * { opacity: 0; }
.flow-hint { display: none; font-size: 0.8125rem; color: var(--muted); }
.flow-hint kbd { display: inline-block; margin: 0 0.125rem; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 0.375rem; padding: 0 0.375rem; font-family: var(--font-sans); font-size: 0.75rem; color: var(--ink-2); }

/* The answer, flying to the track. */
.flow-token { position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; will-change: transform; }
.flow-token-pill {
  display: inline-flex; height: 2.25rem; align-items: center; gap: 0.375rem; padding: 0 0.875rem; border-radius: 9999px; background: var(--ink);
  color: var(--surface); box-shadow: var(--shadow-lg); font-size: 0.875rem; font-weight: 600; white-space: nowrap; will-change: transform, opacity;
}
.flow-token-pill .glyph { width: 1.25rem; height: 1.25rem; stroke-width: 2; }

/* ─── Glyphs ────────────────────────────────────────────────────────────── */

.glyph { width: 2.5rem; height: 2.5rem; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.glyph .g-fill { fill: var(--glyph-fill, none); transition: fill 320ms ease; }
.glyph .g-solid { fill: currentColor; stroke: none; }
.glyph .g-faint { opacity: 0.38; }
.glyph .g-wag, .glyph .g-pop, .glyph .g-spin, .glyph .g-bob { transform-box: view-box; }
.fo:has(.fo-input:checked) .glyph, .fq-count-slot .glyph { --glyph-fill: color-mix(in oklab, currentColor 16%, transparent); }
.is-picked .glyph .g-wag { animation: g-wag 760ms var(--flow-ease); }
.is-picked .glyph .g-bob { animation: g-bob 560ms var(--flow-spring); }
.is-picked .glyph .g-pop { animation: g-pop 600ms var(--flow-spring); }
.is-picked .glyph .g-spin { animation: g-spin 900ms var(--flow-ease); }
.is-picked .fo-glyph { animation: flow-pick 460ms var(--flow-spring); }

@keyframes g-wag { 0%, 100% { transform: rotate(0deg); } 22% { transform: rotate(-12deg); } 52% { transform: rotate(10deg); } 78% { transform: rotate(-4deg); } }
@keyframes g-bob { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-1.5px); } }
@keyframes g-pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes g-spin { from { transform: rotate(0deg); } to { transform: rotate(45deg); } }
@keyframes flow-pick { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes flow-draw { to { stroke-dashoffset: 0; } }

/* ─── Wider screens ─────────────────────────────────────────────────────── */

@media (min-width: 40rem) {
  .flow-page { padding-top: 2rem; }
  .flow { min-height: calc(100dvh - 7rem); }
  .flow-page.is-live .flow-stage { min-height: 26rem; }
  .fo-set-tiles[data-n='5'], .fo-set-tiles[data-n='6'] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .fo-set-tiles[data-n='5'] > .fo, .fo-set-tiles[data-n='6'] > .fo { grid-column: span 2; }
  .fo-set-tiles[data-n='5'] > .fo:nth-child(4) { grid-column: 2 / span 2; }
  .fo-set-tiles[data-n='5'] > .fo:nth-child(5) { grid-column: span 2; }
  .fo-set-tiles[data-n='8'] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fm-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .flow-choices { grid-template-columns: auto auto; justify-content: start; }
  .flow-done .flow-choices { justify-content: center; }
  .flow-bar { position: static; margin-top: 2.25rem; padding: 0 0 2.5rem; background: none; }
  .flow-next { flex: none; min-width: 11rem; }
  .flow-hint { display: inline; }
}

@media (hover: none) {
  .flow-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .flow-page *, .flow-page *::before, .flow-page *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
}
