/* Belt Road. Dark page; the accent is whatever belt is being worn. */

:root {
  --bg: #121317;
  --surface: #1c1e24;
  --surface-2: #24272f;
  --line: #2c3038;
  --text: #f2f2f2;
  --muted: #9aa0aa;
  --faint: #6f7580;
  --danger: #ff6b6b;
  --radius: 18px;
  --dock-h: 78px;

  /* Overwritten from the current belt by app.js */
  --belt: #d4a017;
  --belt-hero: #d4a017;
  --belt-ink: #111;
  --accent: #d4a017;
  --accent-ink: #111;
  --accent-text: #e0b23a;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}

button, .stop__link, .kid, .row, .choice, .pillopt, .sw { -webkit-user-select: none; user-select: none; }

button { font: inherit; color: inherit; }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

[hidden] { display: none !important; }

.view {
  max-width: 640px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 16px calc(var(--dock-h) + env(safe-area-inset-bottom) + 24px);
  outline: none;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.muted { color: var(--muted); }

.hint {
  margin: 18px 4px;
  color: var(--muted);
  font-size: 15px;
}

.fatal { padding: 40px 20px; color: var(--danger); }

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

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-bottom: 8px;
}

.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.iconbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.iconbtn--sm { width: 32px; height: 32px; margin-left: auto; background: transparent; }
.iconbtn--sm svg { fill: currentColor; stroke: none; }

.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
}

.pagetitle { margin: 4px 0 16px; font-size: 30px; font-weight: 800; }

/* ---------- kid switcher ---------- */

.hscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }

.kids { display: flex; gap: 8px; margin: 0 -16px 14px; padding: 2px 16px; }

.kid {
  flex: none;
  min-height: 36px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.kid--on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.kid--add { color: var(--muted); font-weight: 600; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 22px 20px 18px;
  border-radius: 24px;
  background: linear-gradient(140deg, var(--belt-hero), color-mix(in srgb, var(--belt-hero) 82%, #000));
  color: var(--belt-ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  overflow: hidden;
}

.hero__eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .78;
}

.hero__name {
  margin: 2px 0 0;
  font-size: 40px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}

.hero__name--belt { font-size: 34px; }

.hero__since { margin: 4px 0 0; font-size: 14px; font-weight: 500; opacity: .82; }

.hero--page { margin-bottom: 18px; }

/* The belt itself. A stripe colour, when set, runs down the middle. */
.beltbar {
  position: relative;
  display: block;
  height: 18px;
  overflow: visible;
  border-radius: 4px;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18), inset 0 5px 0 rgba(255, 255, 255, .14);
}

.beltbar[data-stripe] {
  background: linear-gradient(to bottom, var(--c) 0 34%, var(--s) 34% 66%, var(--c) 66% 100%);
}

/* On the card the belt is the card's own colour, so it needs edges, a knot
   and two tails to read as a tied belt rather than a slider. */
.beltbar--hero, .beltbar--cele {
  position: relative;
  height: 20px;
  margin: 22px 0 34px;
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .32), inset 0 6px 0 rgba(255, 255, 255, .16), 0 3px 8px rgba(0, 0, 0, .28);
}

.beltbar--hero::before, .beltbar--cele::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  width: 50px;
  height: 36px;
  margin-left: -25px;
  background: inherit;
  filter: brightness(.7);
  clip-path: polygon(30% 0, 70% 0, 96% 88%, 72% 100%, 50% 30%, 28% 100%, 4% 88%);
}

.beltbar--hero::after, .beltbar--cele::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -7px;
  width: 38px;
  height: 34px;
  margin-left: -19px;
  border-radius: 7px;
  background: inherit;
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .36), inset 0 7px 0 rgba(255, 255, 255, .16), 0 3px 8px rgba(0, 0, 0, .3);
}
.beltbar--chip { flex: none; width: 44px; height: 12px; border-radius: 3px; }
.beltbar--cele { width: min(320px, 80vw); margin: 30px auto 30px; animation: tie .7s .15s cubic-bezier(.2, .9, .25, 1.2) both; transform-origin: center; }

/* Black tape on the end of the belt, one per three classes. */
.tape {
  position: absolute;
  top: -1px;
  bottom: -1px;
  right: calc(10px + var(--i) * 9px);
  width: 5px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12);
}

.tape { background: var(--t, #111); }
/* Black tape on a black belt needs an edge to be seen. */
.beltbar[data-dark] .tape { box-shadow: 0 0 0 1px rgba(255, 255, 255, .45); }

.beltbar--opt .tape, .beltbar--chip .tape { display: none; }

/* Dan bars on the left end of a black belt. */
.rankbar {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: calc(10px + var(--i) * 10px);
  width: 6px;
  border-radius: 1px;
  background: var(--b);
}

.beltbar--chip .rankbar { top: 1px; bottom: 1px; left: calc(3px + var(--i) * 5px); width: 3px; }
.beltbar--opt .rankbar { top: 1px; bottom: 1px; left: calc(6px + var(--i) * 8px); width: 4px; }

.tapes {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -14px 0 14px;
}

.tapes__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.tapes__text strong { font-size: 15px; }
.tapes__text small { font-size: 13px; opacity: .8; }

.tapes__btn {
  flex: none;
  min-width: 44px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: rgba(17, 17, 17, .9);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.tapes__btn:disabled { opacity: .35; cursor: default; }
.tapes__btn--add { padding: 0 14px; }

/* ---------- next test tile ---------- */

.next {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 16px;
  background: rgba(17, 17, 17, .9);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.next__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.next__label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.next__title { font-size: 17px; font-weight: 700; }
.next__when { color: var(--muted); font-size: 14px; }
.next__hint { margin-top: 2px; color: var(--accent-text); font-size: 13px; font-weight: 600; }

.next__count { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.next__big { color: var(--accent-text); font-size: 30px; line-height: 1; font-weight: 800; }
.next__big:not(:only-child) { margin-bottom: 2px; }
.next__big--word { font-size: 22px; }
.next__small { color: var(--muted); font-size: 12px; }

.next--empty .next__plus {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 22px;
  font-weight: 700;
}

/* ---------- belt road ---------- */

.sechead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 26px 4px 10px;
}

.sechead__title {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.link {
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.link--add { display: block; margin-top: 4px; }

.road { position: relative; margin: 0; padding: 0; list-style: none; }

.stop { position: relative; }

/* The road: a segment from each circle down to the next, ending at "Journey
   started". Dashed up to the belt still to come. */
.stop::before {
  content: "";
  position: absolute;
  top: 23px;
  left: 23px;
  width: 3px;
  height: 100%;
  background: var(--line);
}

.stop:last-child::before { display: none; }
.stop--next::before { background: repeating-linear-gradient(to bottom, var(--line) 0 5px, transparent 5px 11px); }

.stop__link {
  display: flex;
  gap: 14px;
  width: 100%;
  padding: 10px 4px 14px;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

/* Road circles look like the belt: the colour, its centre stripe across the
   middle, and Dan bars standing on it. */
.node {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 26px;
  height: 26px;
  margin: 0 4px 0 7px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 4px var(--bg), inset 0 0 0 1px rgba(255, 255, 255, .25);
  overflow: hidden;
}

.node[data-stripe] {
  background: linear-gradient(to bottom, var(--c) 0 33%, var(--s) 33% 67%, var(--c) 67% 100%);
}

.node[data-dark] { box-shadow: 0 0 0 4px var(--bg), inset 0 0 0 1.5px rgba(255, 255, 255, .4); }

.node__bar { display: block; width: 2px; height: 52%; border-radius: 1px; background: var(--b); }

.stop--current .node { width: 30px; height: 30px; margin: -2px 2px 0 5px; box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px color-mix(in srgb, var(--c) 35%, transparent); }
.stop--current .node[data-dark] { box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px rgba(255, 255, 255, .25), inset 0 0 0 1.5px rgba(255, 255, 255, .4); }

/* The belt still to come: the same look, faded, inside a dashed ring. */
.node--next { overflow: visible; opacity: .7; }
.node--next::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px dashed rgba(255, 255, 255, .55);
  border-radius: 50%;
}

/* Where the road begins. */
.node--origin { background: var(--surface-2); color: var(--muted); box-shadow: 0 0 0 4px var(--bg), inset 0 0 0 1.5px var(--line); }
.node--origin svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stop__sub--ask { color: var(--accent-text); font-weight: 600; }

.node--sm { width: 18px; height: 18px; margin: 0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }

.stop__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.stop__title { font-size: 16px; font-weight: 700; }
.stop__sub { color: var(--muted); font-size: 14px; }

/* Four across at most, shrinking on narrow phones rather than overflowing. */
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 64px)); gap: 6px; margin-top: 10px; }
.thumbs .thumb { width: 100%; height: auto; aspect-ratio: 1; }

.thumb {
  position: relative;
  display: block;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: var(--surface-2) center / cover no-repeat;
  overflow: hidden;
}

.thumb--none::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 45%, rgba(255, 255, 255, .06) 45% 55%, transparent 55%);
}

.thumb--more {
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.thumb__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  margin: -9px 0 0 -6px;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent rgba(255, 255, 255, .92);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5));
}

.thumb__dur {
  position: absolute;
  left: 6px;
  bottom: 4px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
}

/* ---------- dock ---------- */

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid #1d2026;
  /* Opaque and on its own layer: a blurred fixed bar smears while scrolling on iOS. */
  transform: translateZ(0);
}

.cta {
  display: block;
  width: 100%;
  max-width: 608px;
  min-height: 54px;
  margin: 0 auto;
  border: 0;
  border-radius: 27px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- belt page ---------- */

.testcard {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 16px;
  background: rgba(17, 17, 17, .9);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.testcard__label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.testcard__when { font-size: 16px; font-weight: 700; }
.testcard__quote { margin-top: 6px; font-size: 15px; font-style: italic; }
.testcard__notes { margin-top: 4px; color: var(--muted); font-size: 14px; white-space: pre-line; }
.testcard__edit { margin-top: 6px; color: var(--accent-text); font-size: 14px; font-weight: 600; }

.btn--onbelt {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: rgba(17, 17, 17, .88);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.capsule { margin: 0 0 18px; }
.capsule .sechead__title { margin: 0 4px 10px; }

.capsule__tile {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.thumb--wide { width: 112px; height: 84px; }
.capsule__q { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 13px; }

.capsule__cta {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.capsule__ctatitle { color: var(--accent-text); font-weight: 700; }
.capsule__ctasub { color: var(--muted); font-size: 14px; }

.moment {
  margin: 0 0 12px;
  padding: 12px 14px 14px;
  border-radius: var(--radius);
  background: var(--surface);
}

.moment__head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 32px; }
.moment__date { font-size: 14px; font-weight: 700; }
.moment__cap { margin: 4px 0 8px; white-space: pre-line; overflow-wrap: anywhere; }

.tag {
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.tag--star { color: var(--accent-text); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 6px; }

.grid__cell { display: block; padding: 0; border: 0; background: none; cursor: pointer; aspect-ratio: 1; }
.grid__cell .thumb { width: 100%; height: 100%; border-radius: 8px; }

/* ---------- settings ---------- */

.card {
  margin: 0 0 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
}

.card p { margin: 0 0 10px; font-size: 15px; }

.card__title { margin: 0 0 10px; font-size: 17px; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.row--tight { min-height: 44px; }
.row__main { flex: 1; font-weight: 600; }
.row__sub { color: var(--muted); font-size: 14px; }
.row__chev { color: var(--faint); font-size: 20px; }

.prog { margin-top: 14px; }
.prog__title { margin: 0 0 2px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.build { margin: 20px 0; color: var(--faint); font-size: 13px; text-align: center; }

/* ---------- setup ---------- */

.setup { padding-top: 18px; }
.setup__title { margin: 4px 0 4px; font-size: 32px; font-weight: 800; }
.setup .muted { margin: 0 0 22px; }

/* ---------- forms ---------- */

.field { display: block; margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }

.field__label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.field__label small { font-weight: 400; color: var(--faint); }

.field__hint { margin: 0 0 10px; color: var(--faint); font-size: 13px; }
.field__hint--under { margin: -8px 0 18px; }

/* Belts of one program, drawn as belts. Real radio buttons underneath. */
.beltopts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.beltopt { position: relative; cursor: pointer; }

.beltopt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }

.beltopt__box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
}

.beltopt input:checked + .beltopt__box { border-color: var(--text); background: var(--surface-2); }
.beltopt input:focus-visible + .beltopt__box { outline: 2px solid var(--accent-text); outline-offset: 2px; }

.beltbar--opt { height: 14px; }
.beltopt__name { font-size: 14px; font-weight: 600; }

.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.field-row .field--narrow { flex: 0 0 120px; }

input[type=text], input[type=date], input[type=time], input[type=month], select, textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  /* 16px stops iOS zooming into the field. */
  font: inherit;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}

input[type=date], input[type=time], input[type=month] { min-width: 0; }
input::-webkit-date-and-time-value { text-align: left; }

select {
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

textarea { resize: vertical; }

input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }

.formerr { margin: 0 0 12px; color: var(--danger); font-size: 14px; }

.note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 14px;
}

.lands { min-height: 1.4em; margin: -6px 0 14px; color: var(--accent-text); font-size: 14px; font-weight: 600; }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0 0 12px;
  font-weight: 600;
}

.check small { color: var(--faint); font-weight: 400; }

.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }

/* Program pills and colour swatches are real radio buttons, visually replaced. */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }

.pillopt, .sw { position: relative; cursor: pointer; }

.pillopt input, .sw input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pillopt span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  font-size: 15px;
  font-weight: 600;
}

.pillopt input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.pillopt input:focus-visible + span, .sw input:focus-visible + .sw__dot { outline: 2px solid var(--accent-text); outline-offset: 2px; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 10px 6px; }

.sw { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.sw__dot {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}

.sw__dot[data-none] { background: transparent; border: 1.5px dashed var(--faint); }

.sw input:checked + .sw__dot { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text); }

.sw__name { color: var(--muted); font-size: 12px; }
.sw input:checked ~ .sw__name { color: var(--text); font-weight: 600; }

.newbelt { margin: -4px 0 16px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.newbelt .field__label { margin-top: 2px; }
.newbelt .pills { margin-bottom: 14px; }
.newbelt .swatches { margin-bottom: 14px; }
.newbelt .field { margin-bottom: 0; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.btn:disabled { opacity: .45; cursor: default; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--danger { background: var(--danger); color: #111; }
.btn--quiet { background: var(--surface-2); color: var(--text); font-weight: 600; }
.btn--block { display: flex; width: 100%; }
.btn--big { min-height: 56px; font-size: 17px; margin-bottom: 14px; }

.btnrow { display: flex; gap: 10px; justify-content: flex-end; }
.btnrow .btn { flex: 1; }
.btnrow--left { justify-content: flex-start; }

.choices { display: flex; flex-direction: column; gap: 10px; }

.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 12px 16px;
  border: 0;
  border-radius: 16px;
  background: var(--surface-2);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.choice strong { display: block; font-size: 16px; }
.choice small { display: block; color: var(--muted); font-size: 13px; }

.choice__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 18px;
}

.questions { margin: 0 0 20px; padding-left: 22px; font-size: 18px; font-weight: 600; }
.questions li { margin-bottom: 8px; }

.previews { display: flex; gap: 8px; margin: 0 -16px 14px; padding: 2px 16px; }

.pv {
  position: relative;
  flex: none;
  width: 84px;
  height: 84px;
  border-radius: 12px;
  background: var(--surface-2) center / cover no-repeat;
}

.pv__x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font-size: 18px;
  line-height: 26px;
  cursor: pointer;
}

.progress { position: relative; height: 28px; margin: 0 0 14px; border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.progress__bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); transition: width .2s; }
.progress__text { position: relative; display: block; line-height: 28px; text-align: center; font-size: 13px; font-weight: 700; mix-blend-mode: difference; color: #fff; }

/* ---------- sheet ---------- */

.sheet { position: fixed; inset: 0; z-index: 50; }

.sheet__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); animation: fade .18s ease; }

.sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--kb, 0px);
  max-width: 640px;
  max-height: calc(100% - var(--kb, 0px) - 24px);
  margin: 0 auto;
  padding: 6px 16px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  outline: none;
  animation: rise .24s cubic-bezier(.2, .9, .25, 1);
}

.sheet__grab { width: 40px; height: 5px; margin: 4px auto 12px; border-radius: 3px; background: var(--line); cursor: pointer; }

.sheet__title { margin: 0 0 14px; font-size: 21px; font-weight: 800; }

/* ---------- confirm ---------- */

.confirm { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; }
.confirm__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); }
.confirm__box { position: relative; width: 100%; max-width: 360px; padding: 20px; border-radius: 20px; background: var(--surface); }
.confirm__title { margin: 0 0 6px; font-size: 19px; }
.confirm__msg { margin: 0 0 18px; color: var(--muted); font-size: 15px; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 16px + var(--kb, 0px));
  z-index: 80;
  max-width: calc(100% - 32px);
  padding: 11px 18px;
  border-radius: 99px;
  background: #f2f2f2;
  color: #111;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity .2s, transform .2s;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- viewer ---------- */

.viewer { position: fixed; inset: 0; z-index: 60; background: #000; }

.vw { position: absolute; inset: 0; display: flex; flex-direction: column; }

.vw__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 10px 6px;
}

.vw__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.vw__btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

.vw__count { color: #bbb; font-size: 14px; }

.vw__stage { position: relative; flex: 1; display: grid; place-items: center; min-height: 0; }
.vw__stage img, .vw__stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.vw__err { padding: 24px; color: #bbb; text-align: center; }

.vw__foot { padding: 10px 18px calc(14px + env(safe-area-inset-bottom)); }
.vw__cap { margin: 0 0 2px; color: #fff; white-space: pre-line; }
.vw__date { margin: 0; color: #999; font-size: 13px; }

.vw__nav {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 64px;
  margin-top: -32px;
  border: 0;
  background: rgba(0, 0, 0, .35);
  color: #fff;
  font-size: 34px;
  cursor: pointer;
}

.vw__nav:disabled { opacity: 0; pointer-events: none; }
.vw__nav--prev { left: 0; border-radius: 0 12px 12px 0; }
.vw__nav--next { right: 0; border-radius: 12px 0 0 12px; }

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, .2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ---------- belt up ---------- */

.celebrate { position: fixed; inset: 0; z-index: 65; }

.cele {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(120% 80% at 50% 30%, color-mix(in srgb, var(--belt) 55%, #121317), #0b0c0f 70%);
  color: #fff;
  text-align: center;
  overflow: hidden;
  animation: fade .3s ease;
}

.cele__inner { position: relative; width: 100%; max-width: 380px; }

.cele__eyebrow {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: 0;
  animation: up .5s .05s ease forwards;
}

.cele__title {
  margin: 6px 0 0;
  font-size: 38px;
  line-height: 1.1;
  font-weight: 800;
  opacity: 0;
  animation: up .55s .25s ease forwards;
}

.cele__date { margin: 6px 0 28px; color: rgba(255, 255, 255, .7); opacity: 0; animation: up .5s .55s ease forwards; }

.cele__actions { display: flex; flex-direction: column; gap: 10px; opacity: 0; animation: up .5s .8s ease forwards; }

.btn--cele { background: var(--accent); color: var(--accent-ink); }
.btn--cele-ghost { background: rgba(255, 255, 255, .1); color: #fff; }
.btn--cele-link { background: none; color: rgba(255, 255, 255, .75); }

.cele__burst { position: absolute; left: 50%; top: 42%; width: 0; height: 0; }

.bit {
  position: absolute;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  background: var(--c);
  opacity: 0;
  animation: burst 1.6s var(--d) cubic-bezier(.15, .7, .3, 1) forwards;
}

/* Up and out, then a fall under gravity. */
@keyframes burst {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  40% { opacity: 1; transform: translate(calc(var(--x) * .6), var(--y)) rotate(calc(var(--r) * .4)); }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 340px)) rotate(var(--r)); }
}

@keyframes tie { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .bit { display: none; }
}
