/* ============================================================
   Lumorph — design system
   Dark-first, gold on ink. Every animation runs on transform
   and opacity only, so it stays on the compositor at 60fps.
   ============================================================ */

:root {
  color-scheme: dark;
  --ink: #F7EFF3;
  --muted: #A998A4;
  --faint: #8A7C87;
  --bg: #100812;
  --bg-2: #1A0F1E;
  --surface: rgba(255, 255, 255, 0.062);
  --surface-2: rgba(255, 255, 255, 0.10);
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.20);
  --gold: #F0A170;
  --gold-2: #C97B4E;
  --gold-3: #8A4F2E;
  --gold-soft: rgba(240, 161, 112, 0.16);
  --gold-rgb: 240, 161, 112;
  --accent2-rgb: 180, 90, 140;
  --bg-rgb: 16, 8, 18;
  --danger: #E8796E;
  --good: #8FCBA4;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 34px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 0.8, 0.2);
  --spring: cubic-bezier(0.34, 1.4, 0.5, 1);

  --t-fast: 180ms;
  --t-mid: 320ms;
  --t-slow: 560ms;

  --pad: 22px;
  --tabbar: 74px;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* theme-aware pieces */
  --accent-solid: linear-gradient(180deg, #FFD9BE, var(--gold) 55%, var(--gold-2));
  --on-accent: #2A1206;
  --bar-grad: linear-gradient(90deg, var(--gold-3), var(--gold), #FFD9BE);
  --thumb-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  --heat-1: rgba(240, 161, 112, 0.22);
  --heat-2: rgba(240, 161, 112, 0.45);
  --heat-3: rgba(240, 161, 112, 0.72);
  --heat-4: var(--gold);
  --heat-frozen: rgba(122, 132, 160, 0.20);
  --grain-opacity: 0.05;
  --aurora-opacity: 1;
}

[data-theme="light"] {
  color-scheme: light;
  --ink: #14181C;
  --muted: #5E666E;
  --faint: #676F77;
  --bg: #F4F2ED;
  --bg-2: #FFFFFF;
  --surface: rgba(20, 24, 28, 0.035);
  --surface-2: rgba(20, 24, 28, 0.06);
  --line: rgba(20, 24, 28, 0.10);
  --line-strong: rgba(20, 24, 28, 0.20);
  --gold: #2F6B57;
  --gold-2: #1F4F40;
  --gold-3: #123027;
  --gold-soft: rgba(47, 107, 87, 0.13);
  --gold-rgb: 47, 107, 87;
  --accent2-rgb: 120, 150, 200;
  --bg-rgb: 244, 242, 237;
  --danger: #B3402F;
  --good: #2F7A4F;

  --serif: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;

  --accent-solid: linear-gradient(180deg, #4A8C74, #2F6B57 55%, #1F4F40);
  --on-accent: #FFFFFF;
  --bar-grad: linear-gradient(90deg, #7FB39F, #2F6B57);
  --thumb-bg: linear-gradient(180deg, #FFFFFF, #EFEDE6);
  --heat-1: rgba(47, 107, 87, 0.14);
  --heat-2: rgba(47, 107, 87, 0.30);
  --heat-3: rgba(47, 107, 87, 0.52);
  --heat-4: #2F6B57;
  --heat-frozen: rgba(110, 120, 150, 0.14);
  --grain-opacity: 0.02;
  --aurora-opacity: 0.45;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* the page must grow and scroll with its content */
html { overflow-x: hidden; }

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; }
::selection { background: var(--gold-soft); }

/* ---------- shell ---------- */
.app {
  position: relative;
  width: 100%;
  max-width: 460px;
  min-height: 100dvh;
  background: var(--bg);
  isolation: isolate;
}

@media (min-width: 520px) {
  body { background: radial-gradient(120% 80% at 50% 0%, #101014 0%, #050506 70%); }
  .app {
    min-height: 100dvh;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 40px 120px rgba(0, 0, 0, 0.6);
  }
}

/* slow drifting aurora — one transform animation, no repaint */
.aurora {
  position: fixed;
  inset: -30% -30% auto -30%;
  height: 70vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(50% 50% at 30% 20%, rgba(var(--gold-rgb), 0.22), transparent 70%),
    radial-gradient(45% 45% at 75% 10%, rgba(var(--accent2-rgb), 0.16), transparent 72%),
    radial-gradient(40% 40% at 50% 45%, rgba(var(--gold-rgb), 0.10), transparent 70%);
  filter: blur(18px);
  opacity: var(--aurora-opacity);
  will-change: transform;
  animation: drift 26s var(--ease) infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(-2%, 0, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

/* fine film grain, static, sits above the gradient only */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
}

/* ---------- typography ---------- */
.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.02;
  margin: 0;
}
.display.xl { font-size: 46px; }
.display.lg { font-size: 36px; }
.display.md { font-size: 27px; }
.display.sm { font-size: 21px; }
.display em { font-style: italic; }

.eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.lede { color: var(--muted); font-size: 14.5px; margin: 8px 0 0; max-width: 34ch; }
.small { font-size: 12.5px; color: var(--muted); }
.tiny { font-size: 11px; color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- view scaffolding ---------- */
#view {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  padding: 0 var(--pad) calc(var(--tabbar) + 34px);
  will-change: transform, opacity;
}
#view.no-tabs { padding-bottom: 40px; }
#view.enter { animation: viewIn var(--t-mid) var(--ease) both; }
#view.leave { animation: viewOut 160ms var(--ease-in) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes viewOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translate3d(0, -6px, 0); }
}

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.grow { flex: 1; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; } .mt-28 { margin-top: 28px; } .mt-36 { margin-top: 36px; }

/* staggered entrance */
.rise {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
  transition-delay: calc(var(--i, 0) * 55ms);
  will-change: transform, opacity;
}
.rise.in { opacity: 1; transform: none; }

/* ---------- top bar ---------- */
#topbar {
  position: relative;
  z-index: 3;
  padding: 0 var(--pad);
}
.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(24px + env(safe-area-inset-top)) 0 12px;
  min-height: 54px;
}
.icon-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: transform var(--t-fast) var(--spring), background var(--t-fast) var(--ease);
}
.icon-btn:active { transform: scale(0.9); background: var(--surface-2); }
.icon-btn.ghost { background: none; border-color: transparent; }
.brandmark {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 9px;
}
.orb-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFF4D8, var(--gold) 45%, var(--gold-2) 80%);
  box-shadow: 0 0 12px rgba(var(--gold-rgb), 0.55);
}

/* ---------- cards ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  overflow: hidden;
}
[data-theme="light"] .card {
  background: linear-gradient(180deg, #FFFFFF, #FBFAF6);
  box-shadow: 0 1px 2px rgba(23,22,26,0.04), 0 10px 30px rgba(23,22,26,0.05);
}
.card.tight { padding: 14px; }
.card.flat { background: var(--surface); }
.card.gold {
  background:
    radial-gradient(120% 120% at 12% 0%, rgba(var(--gold-rgb), 0.16), transparent 58%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border-color: rgba(var(--gold-rgb), 0.22);
}
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }

/* ---------- buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 54px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: transform 140ms var(--spring), background var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
  will-change: transform;
}
.btn:active { transform: scale(0.975); }
.btn.primary {
  background: var(--accent-solid);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--on-accent);
  box-shadow: 0 10px 30px -12px rgba(var(--gold-rgb), 0.55);
}
.btn.primary:active { box-shadow: 0 4px 16px -10px rgba(var(--gold-rgb), 0.5); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.small { height: 40px; font-size: 13.5px; width: auto; padding: 0 16px; }
.btn.danger { color: var(--danger); border-color: rgba(228, 121, 110, 0.3); }
.btn[disabled] { opacity: 0.38; pointer-events: none; }
.btn .spin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.25); border-top-color: var(--on-accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- chips / pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px; font-weight: 500; color: var(--ink);
  white-space: nowrap;
}
.pill.gold { border-color: rgba(var(--gold-rgb), 0.3); background: var(--gold-soft); color: var(--gold); }
.pill.plain { background: none; }
.pill.badge-pill { background: var(--gold-soft); border-color: rgba(var(--gold-rgb), 0.28); color: var(--gold); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.pill.tap { transition: transform 140ms var(--spring), background var(--t-fast) var(--ease); }
.pill.tap:active { transform: scale(0.94); }

/* ---------- tabs (segmented) ---------- */
.segmented {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.segmented .thumb {
  position: absolute;
  top: 4px; left: 4px; bottom: 4px;
  border-radius: 999px;
  background: var(--thumb-bg);
  border: 1px solid var(--line-strong);
  transition: transform var(--t-mid) var(--spring), width var(--t-mid) var(--spring);
  will-change: transform, width;
}
.segmented button {
  position: relative; z-index: 1;
  height: 38px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  transition: color var(--t-fast) var(--ease);
}
.segmented button[aria-selected="true"] { color: var(--ink); }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed;
  z-index: 20;
  bottom: 0;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  width: 100%;
  max-width: 460px;
  padding: 10px calc(var(--pad) - 6px) calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, rgba(var(--bg-rgb), 0) 0%, rgba(var(--bg-rgb), 0.86) 42%, var(--bg) 100%);
}
[data-theme="light"] .tabbar {
  background: linear-gradient(180deg, rgba(246,243,236,0) 0%, rgba(246,243,236,0.9) 42%, var(--bg) 100%);
}
.tabbar .inner {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 60px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(20, 20, 26, 0.82);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 18px 40px -20px rgba(0,0,0,0.9);
}
[data-theme="light"] .tabbar .inner { background: rgba(255,255,255,0.85); }
.tabbar .glow {
  position: absolute;
  left: 0;
  top: 6px; bottom: 6px;
  width: 0;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid rgba(var(--gold-rgb), 0.22);
  transition: transform var(--t-mid) var(--spring), width var(--t-mid) var(--spring);
  will-change: transform, width;
}
.tabbar button {
  position: relative;
  z-index: 1;
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color var(--t-fast) var(--ease), transform 140ms var(--spring);
}
.tabbar button svg { width: 20px; height: 20px; }
.tabbar button.active { color: var(--gold); }
.tabbar button:active { transform: scale(0.92); }
.tabbar .scan-fab {
  flex: 0 0 auto;
  width: 72px;
  height: 46px;
  margin: 0 3px;
  border-radius: 999px;
  background: var(--accent-solid);
  color: var(--on-accent);
  flex-direction: row;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 24px -12px rgba(var(--gold-rgb), 0.7);
}
.tabbar .scan-fab svg { width: 17px; height: 17px; }

/* ---------- score ring ---------- */
.ring { position: relative; display: grid; place-items: center; }
.ring svg { transform: rotate(-90deg); overflow: visible; }
.ring .track { stroke: var(--line); }
.ring .prog {
  stroke: url(#goldGrad);
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px rgba(var(--gold-rgb), 0.35));
}
[data-theme="light"] .ring .prog {
  stroke: url(#goldGradLight);
  filter: drop-shadow(0 0 6px rgba(140, 106, 42, 0.22));
}
.ring .mid {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.ring .val {
  font-family: var(--serif);
  font-size: 52px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.ring .cap { font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

/* ---------- bars ---------- */
.bar {
  position: relative;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.bar > i {
  position: absolute;
  inset: 0;
  width: 100%;
  border-radius: 99px;
  background: var(--bar-grad);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 900ms var(--ease);
  will-change: transform;
}
.bar.in > i { transform: scaleX(var(--w, 0)); }
.bar.thin { height: 4px; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.list > * + * { border-top: 1px solid var(--line); }
.item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 2px;
  transition: transform 140ms var(--ease), opacity var(--t-fast) var(--ease);
}
.item:active { transform: scale(0.995); opacity: 0.9; }
.item .ico {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--gold);
}
.item .txt { flex: 1; min-width: 0; }
.item .t { font-size: 14.5px; font-weight: 550; }
.item .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.item .chev { color: var(--faint); flex: 0 0 auto; }

/* ---------- quests ---------- */
.quest {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  transition: opacity var(--t-mid) var(--ease);
}
.quest + .quest { border-top: 1px solid var(--line); }
.quest .tick {
  position: relative;
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid; place-items: center;
  transition: transform 160ms var(--spring), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.quest .tick svg { width: 14px; height: 14px; opacity: 0; transform: scale(0.4); transition: opacity 160ms var(--ease), transform 220ms var(--spring); }
.quest .tick:active { transform: scale(0.88); }
.quest.done .tick { background: var(--accent-solid); border-color: transparent; }
.quest.done .tick svg { opacity: 1; transform: none; color: var(--on-accent); }
.quest.done .t { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.quest .xp {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid rgba(var(--gold-rgb), 0.18);
  padding: 3px 9px;
  border-radius: 99px;
}

/* ---------- week strip ---------- */
.week { display: flex; gap: 8px; }
.day {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 9px 0 8px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 160ms var(--spring), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.day .d { font-size: 9.5px; letter-spacing: 0.1em; color: var(--muted); }
.day .n { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.day .mark { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.day.done .mark { background: var(--gold); box-shadow: 0 0 8px rgba(var(--gold-rgb), 0.7); }
.day.today {
  background: var(--accent-solid);
  border-color: transparent;
  color: var(--on-accent);
}
.day.today .d, .day.today .n { color: var(--on-accent); }
.day.today .mark { background: currentColor; opacity: 0.55; box-shadow: none; }

/* ---------- heatmap ---------- */
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.heat i {
  aspect-ratio: 1;
  border-radius: 5px;
  background: var(--surface-2);
  transform: scale(0.5);
  opacity: 0;
  transition: transform 420ms var(--spring), opacity 300ms var(--ease), background var(--t-fast) var(--ease);
  transition-delay: calc(var(--i, 0) * 9ms);
}
.heat.in i { transform: none; opacity: 1; }
.heat i.l1 { background: var(--heat-1); }
.heat i.l2 { background: var(--heat-2); }
.heat i.l3 { background: var(--heat-3); }
.heat i.l4 { background: var(--heat-4); }
.heat i.frozen { background: var(--heat-frozen); }

/* ---------- sparkline ---------- */
.spark { width: 100%; height: 96px; display: block; overflow: visible; }
.spark path.line {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(var(--gold-rgb), 0.4));
}
.spark path.area { fill: url(#areaGrad); stroke: none; opacity: 0; transition: opacity 700ms var(--ease) 300ms; }
.spark.in path.area { opacity: 1; }
.spark circle { fill: var(--bg); stroke: var(--gold); stroke-width: 2; }

/* ---------- forms ---------- */
.field { display: block; margin-top: 18px; }
.field .lab { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.input {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 16px;
  outline: none;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.input:focus { border-color: rgba(var(--gold-rgb), 0.45); background: var(--surface-2); }
.input::placeholder { color: var(--faint); }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choices.one { grid-template-columns: 1fr; }
.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 14px;
  min-height: 96px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
  transition: transform 160ms var(--spring), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  will-change: transform;
}
.choice:active { transform: scale(0.97); }
.choice .glyph {
  width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--gold);
}
.choice .t { font-size: 14px; font-weight: 600; }
.choice .s { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.choice[aria-pressed="true"] {
  border-color: rgba(var(--gold-rgb), 0.5);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(var(--gold-rgb), 0.16), transparent 60%),
    var(--surface-2);
}
.choice[aria-pressed="true"] .glyph { background: var(--accent-solid); color: var(--on-accent); }
.choice .check {
  position: absolute; top: 12px; right: 12px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid; place-items: center;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform 200ms var(--spring);
}
.choice .check svg { width: 10px; height: 10px; opacity: 0; transform: scale(0.5); transition: all 180ms var(--spring); color: var(--on-accent); }
.choice[aria-pressed="true"] .check { background: var(--gold); border-color: transparent; transform: scale(1.06); color: var(--on-accent); }
.choice[aria-pressed="true"] .check svg { opacity: 1; transform: none; }

/* progress dots for onboarding */
.steps { display: flex; gap: 5px; margin-top: 4px; }
.steps i {
  flex: 1; height: 3px; border-radius: 99px;
  background: var(--line);
  overflow: hidden;
  position: relative;
}
.steps i::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--gold-3), var(--gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 480ms var(--ease);
}
.steps i.done::after { transform: scaleX(1); }
.steps i.now::after { transform: scaleX(1); }

/* ---------- camera ---------- */
.cam-wrap {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: #000;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
}
.cam-wrap video, .cam-wrap img.shot {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: block;
}
.cam-wrap img.shot { transform: none; }
.cam-oval {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.cam-oval svg { width: 72%; height: auto; overflow: visible; }
.cam-oval .guide {
  fill: none;
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 1.4;
  stroke-dasharray: 4 7;
  transition: stroke var(--t-mid) var(--ease), stroke-dasharray var(--t-mid) var(--ease);
}
.cam-oval.ok .guide { stroke: var(--gold); stroke-dasharray: none; filter: drop-shadow(0 0 10px rgba(var(--gold-rgb), 0.5)); }
.cam-hint {
  position: absolute;
  left: 0; right: 0; bottom: 16px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 8px rgba(0,0,0,0.8);
}
.cam-chips { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 14px; }
.qchip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 27px; padding: 0 11px;
  border-radius: 99px;
  font-size: 11px; font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform 180ms var(--spring);
}
.qchip .d { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.qchip.ok { color: var(--ink); border-color: rgba(var(--gold-rgb), 0.4); background: var(--gold-soft); }
.qchip.ok .d { background: var(--gold); box-shadow: 0 0 7px rgba(var(--gold-rgb), 0.8); }

/* ---------- camera ---------- */
.cam-panel {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 28px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
}
.cam-panel video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.cam-guide {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
}
.cam-guide svg { width: 100%; height: 100%; }
.cam-guide .guide-main {
  fill: none;
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 5 8;
  transition: stroke var(--t-mid) var(--ease), stroke-dasharray var(--t-mid) var(--ease);
}
.cam-guide .guide-soft {
  fill: none;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1.2;
}
.cam-guide .guide-arrow {
  fill: none;
  stroke: rgba(255, 255, 255, 0.42);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cam-guide .guide-tick {
  fill: none;
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.cam-guide.ok .guide-main {
  stroke: var(--gold);
  stroke-dasharray: none;
  filter: drop-shadow(0 0 10px rgba(var(--gold-rgb), 0.5));
}
.cam-step {
  position: absolute;
  top: 14px; left: 14px;
  display: inline-flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 12px;
  border-radius: 99px;
  background: rgba(10, 10, 14, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--ink);
}
.cam-step .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.cam-hint {
  position: absolute;
  left: 0; right: 0; bottom: 16px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
  padding: 0 20px;
}
.cam-flash {
  position: absolute; inset: 0;
  background: #FFF6DF;
  opacity: 0;
  pointer-events: none;
}
.cam-flash.on { animation: flash 420ms var(--ease); }
@keyframes flash {
  0% { opacity: 0; }
  12% { opacity: 0.85; }
  100% { opacity: 0; }
}
.cam-chips { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 14px; }

.shutter-row { display: flex; justify-content: center; margin-top: 18px; }
.shutter {
  position: relative;
  width: 78px; height: 78px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: none;
  transition: transform 160ms var(--spring), opacity var(--t-fast) var(--ease);
}
.shutter:active { transform: scale(0.92); }
.shutter:disabled { opacity: 0.35; }
.shutter .shutter-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
}
.shutter .shutter-dot {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--accent-solid);
  box-shadow: 0 0 26px rgba(var(--gold-rgb), 0.35);
}
.shutter:disabled .shutter-dot { box-shadow: none; }

/* ---------- landmark mesh ---------- */
.cam-mesh {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  transform: scaleX(-1);
  pointer-events: none;
  transition: opacity var(--t-mid) var(--ease);
}
.cam-toggle {
  position: absolute;
  top: 14px; right: 14px;
  height: 28px; padding: 0 13px;
  border-radius: 99px;
  background: rgba(10, 10, 14, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(246, 241, 231, 0.75);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.cam-toggle[aria-pressed="true"] {
  color: var(--gold);
  border-color: rgba(var(--gold-rgb), 0.45);
  background: rgba(var(--gold-rgb), 0.12);
}

/* ---------- age stepper ---------- */
.age-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 34px;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
}
.age-step {
  flex: 0 0 auto;
  width: 62px; height: 62px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--gold);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  transition: transform 160ms var(--spring), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.age-step:active { transform: scale(0.92); background: var(--gold-soft); }
.age-mid { flex: 1; text-align: center; }
.age-value {
  font-family: var(--serif);
  font-size: 76px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--faint);
  transition: color var(--t-mid) var(--ease);
}
.age-value.set { color: var(--ink); }
.age-unit {
  margin-top: 6px;
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}
.age-note {
  margin-top: 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  min-height: 18px;
}
.age-note.warn { color: var(--danger); }

/* ---------- long names ---------- */
.greet { overflow-wrap: anywhere; }
.greet.long { font-size: 0.82em; line-height: 1.06; }

/* ---------- ascend ---------- */
.bar-track {
  height: 8px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.bar-track i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: var(--bar-grad);
  transform-origin: left center;
  transition: transform 420ms var(--ease);
}
.adots {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 6px;
  margin-top: 14px;
}
.adot {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.adot.done { background: var(--gold); border-color: var(--gold); }
.adot.today { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.adot.missed { background: rgba(var(--gold-rgb), 0.10); border-color: rgba(var(--gold-rgb), 0.22); }

/* ---------- icon centring ----------
   Only containers that hold a single icon become grids. Pills are inline-flex
   and tab buttons are flex-column, and forcing them to grid stacked their
   contents — that is what put the rank badge's dot above its label. */
.icon-btn, .step-dot, .ico, .gift-btn {
  display: grid;
  place-items: center;
}
.icon-btn svg, .step-dot svg, .ico svg, .gift-btn svg {
  width: 100%;
  height: 100%;
  display: block;
  flex: 0 0 auto;
}
.tabbar button svg { width: 20px; height: 20px; display: block; flex: 0 0 auto; }
.tabbar .scan-fab svg { width: 17px; height: 17px; display: block; flex: 0 0 auto; }
.pill svg { width: 14px; height: 14px; display: block; flex: 0 0 auto; }
.btn svg { display: block; flex: 0 0 auto; }
.step-row { cursor: pointer; }
.step-row:active { opacity: .75; }
.gift-btn { margin-right: 2px; }

/* ---------- diagnostics ---------- */
.diag {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-top: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- routine ---------- */
.step-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  flex: 0 0 auto;
  color: var(--bg);
  margin-top: 2px;
}
.step-dot.on { background: var(--gold); border-color: var(--gold); }
.step-t { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.xp-chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  background: var(--gold-soft);
  border-radius: 99px;
  padding: 4px 9px;
  flex: 0 0 auto;
}
.focus-row { padding: 12px 0; border-top: 1px solid var(--line); }
.focus-row:first-of-type { border-top: none; padding-top: 8px; }

/* ---------- photo strip ---------- */
.strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 6px;
  margin: 0 calc(var(--pad) * -1);
  padding-left: var(--pad);
  padding-right: var(--pad);
  scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.shot {
  flex: 0 0 auto;
  width: 84px;
  scroll-snap-align: start;
  display: grid;
  gap: 6px;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  transition: transform 160ms var(--spring);
}
.shot:active { transform: scale(0.95); }
.shot img {
  width: 84px;
  height: 108px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.shot .when { font-size: 10.5px; letter-spacing: 0.04em; }
.shot .val {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--gold);
  line-height: 1;
}

/* ---------- camera warm-up ---------- */
.warmup {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 260ms var(--ease), visibility 260ms;
}
.warmup.show { opacity: 1; visibility: visible; }
.warm-inner { text-align: center; padding: 0 28px; }
.warm-ring {
  width: 96px; height: 96px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  background: radial-gradient(circle at 50% 30%, var(--gold-soft), transparent 70%);
  box-shadow: 0 0 40px -10px var(--gold-soft);
}
.warm-num {
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.warm-label {
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 6px;
}
.warm-sub {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 260px;
  margin: 0 auto;
  line-height: 1.5;
}
.warm-bar {
  width: 132px; height: 3px;
  margin: 18px auto 0;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.warm-bar i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: var(--bar-grad);
  transform: scaleX(0);
  transform-origin: left center;
}

/* ---------- calibration ---------- */
.tiny-input {
  height: 42px;
  padding: 0 12px;
  text-align: center;
  font-size: 15px;
  -moz-appearance: textfield;
}
.tiny-input::-webkit-outer-spin-button,
.tiny-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- consent bar ---------- */
.consent-bar {
  position: fixed;
  left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 436px);
  z-index: 120;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.9);
  animation: consentIn 320ms var(--ease) both;
}
.consent-bar p { font-size: 12.5px; line-height: 1.45; color: var(--muted); margin: 0; }
.consent-bar .row { flex: 0 0 auto; }
@keyframes consentIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- ai card ---------- */
.ai-card {
  margin-top: 16px;
  padding: 20px 20px 22px;
  border-radius: 22px;
  border: 1px solid rgba(var(--gold-rgb), 0.22);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(var(--accent2-rgb), 0.16), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
}
.ai-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 3px 9px;
}
.ai-badge.live {
  color: #CBB8FF;
  border-color: rgba(180, 160, 255, 0.35);
  background: rgba(140, 120, 220, 0.14);
}
.ai-rows { display: grid; gap: 10px; }
.ai-row { display: flex; align-items: baseline; justify-content: space-between; }
.ai-row .k { font-size: 13px; color: var(--muted); }
.ai-row .v { font-family: var(--serif); font-size: 22px; color: var(--ink); }
.ai-skel { display: grid; gap: 10px; }
.ai-skel i {
  display: block;
  height: 12px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.14), rgba(255,255,255,0.06));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.ai-skel i:nth-child(2) { width: 72%; }
.ai-skel i:nth-child(3) { width: 48%; }
@keyframes shimmer {
  from { background-position: 140% 0; }
  to { background-position: -40% 0; }
}

/* ---------- tier ---------- */
.tier-line {
  display: flex; align-items: baseline; gap: 10px;
  margin-top: 10px; flex-wrap: wrap;
}
.tier-name {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--gold);
}
.tier-code {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 3px 9px;
}
.tier-chip {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid rgba(var(--gold-rgb), 0.28);
  border-radius: 99px;
  padding: 2px 8px;
}

/* ---------- metric detail ---------- */
.metric.tap { cursor: pointer; }
.metric.tap:active { opacity: 0.75; }
.metric-canvas {
  width: 100%;
  border-radius: 18px;
  display: block;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.metric-read {
  display: flex; align-items: baseline; gap: 10px;
  margin-top: 14px;
}
.metric-read .big { font-family: var(--serif); font-size: 34px; color: var(--gold); }

/* ---------- recap ---------- */
.recap-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0;
}
.recap-row + .recap-row { border-top: 1px solid var(--line); }
.recap-row .k { font-size: 13.5px; color: var(--muted); }
.recap-row .v { font-family: var(--serif); font-size: 20px; }

/* ---------- processing ---------- */
.proc { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 76dvh; gap: 26px; text-align: center; }
.proc .orb { position: relative; width: 148px; height: 148px; }
.proc .core {
  position: absolute; inset: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #FFFBEF, var(--gold) 42%, var(--gold-2) 78%, #7A5C28);
  box-shadow: 0 0 60px rgba(var(--gold-rgb), 0.35), inset 0 -8px 20px rgba(0,0,0,0.25);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}
.proc .halo { position: absolute; inset: 0; animation: spin 3.4s linear infinite; }
.proc .halo circle { fill: none; stroke: rgba(var(--gold-rgb), 0.55); stroke-width: 1.4; stroke-dasharray: 40 220; stroke-linecap: round; }
.proc .halo.slow { animation-duration: 5.2s; animation-direction: reverse; }
.proc .halo.slow circle { stroke: rgba(var(--gold-rgb), 0.3); }
.proc-list { width: 100%; max-width: 320px; }
.proc-step {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-top: 8px;
  opacity: 0.45;
  transition: opacity var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease), transform var(--t-mid) var(--spring);
}
.proc-step.active { opacity: 1; border-color: rgba(var(--gold-rgb), 0.35); transform: scale(1.01); }
.proc-step.done { opacity: 1; }
.proc-step .b { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; }
.proc-step .b svg { width: 11px; height: 11px; opacity: 0; }
.proc-step.done .b { background: var(--gold); border-color: transparent; color: var(--on-accent); }
.proc-step.done .b svg { opacity: 1; }
.proc-step .lbl { font-size: 14px; font-weight: 550; }
.proc-step .spin-sm {
  margin-left: auto; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(var(--gold-rgb), 0.2); border-top-color: var(--gold);
  animation: spin 0.8s linear infinite; opacity: 0;
}
.proc-step.active .spin-sm { opacity: 1; }

/* ---------- pillar rows ---------- */
.pillar { padding: 14px 0; }
.pillar + .pillar { border-top: 1px solid var(--line); }
.pillar .top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.pillar .name { font-size: 14.5px; font-weight: 600; }
.pillar .score { font-family: var(--serif); font-size: 19px; color: var(--gold); }
.pillar .blurb { font-size: 11.5px; color: var(--muted); margin-top: 7px; }

/* metric rows inside a pillar */
.metric { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.metric .mt { flex: 1; min-width: 0; }
.metric .mn { font-size: 13px; }
.metric .mv { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.metric .ms { font-family: var(--serif); font-size: 15px; width: 34px; text-align: right; color: var(--ink); }
.metric .mb { flex: 0 0 64px; }

/* ---------- toast ---------- */
#toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(var(--tabbar) + 22px);
  transform: translate3d(-50%, 20px, 0);
  opacity: 0;
  pointer-events: none;
  max-width: 88vw;
  padding: 12px 18px;
  border-radius: 99px;
  background: rgba(28, 28, 34, 0.94);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(14px);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform var(--t-mid) var(--spring), opacity var(--t-fast) var(--ease);
  will-change: transform, opacity;
}
[data-theme="light"] #toast { background: rgba(255,255,255,0.96); color: var(--ink); }
#toast.show { transform: translate3d(-50%, 0, 0); opacity: 1; }

/* ---------- sheet ---------- */
.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: end;
  justify-items: center;
  pointer-events: none;
}
.sheet-wrap .scrim {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity var(--t-mid) var(--ease);
}
.sheet {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 86dvh;
  overflow: auto;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-bottom: 0;
  padding: 10px var(--pad) calc(26px + env(safe-area-inset-bottom));
  transform: translate3d(0, 100%, 0);
  transition: transform var(--t-mid) var(--ease);
  will-change: transform;
}
.sheet .grab { width: 38px; height: 4px; border-radius: 99px; background: var(--line-strong); margin: 6px auto 16px; }
.sheet-wrap.open { pointer-events: auto; }
.sheet-wrap.open .scrim { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }

/* ---------- misc ---------- */
.divider { height: 1px; background: var(--line); margin: 22px 0; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px;
  border-radius: 99px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--gold-soft); color: var(--gold);
  border: 1px solid rgba(var(--gold-rgb), 0.25);
}
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.scroll-x { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; margin: 0 calc(var(--pad) * -1); padding-left: var(--pad); padding-right: var(--pad); }
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x > * { scroll-snap-align: start; flex: 0 0 auto; }
.hide { display: none !important; }

/* onboarding stage */
.onb { min-height: 100dvh; display: flex; flex-direction: column; padding-top: 6px; }
.onb .body { flex: 1; padding-top: 18px; }
.onb .foot { padding: 18px 0 26px; }

/* ---------- form feedback ---------- */
.hint {
  display: block;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: 0.01em;
}
.field-error {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--danger);
  opacity: 0;
  transform: translate3d(0, -4px, 0);
  transition: opacity 200ms var(--ease), transform 240ms var(--ease);
}
.field-error.on { opacity: 1; transform: none; }
.field-error::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  margin-right: 8px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 2px;
}

@keyframes shake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  18% { transform: translate3d(-7px, 0, 0); }
  36% { transform: translate3d(6px, 0, 0); }
  54% { transform: translate3d(-4px, 0, 0); }
  72% { transform: translate3d(3px, 0, 0); }
  88% { transform: translate3d(-1px, 0, 0); }
}
.btn.shake { animation: shake 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97); }

/* ---------- one-time entrance ---------- */
.onb.instant .rise {
  opacity: 1;
  transform: none;
  transition: none;
  transition-delay: 0s;
}
.onb.step-in { animation: stepIn 260ms var(--ease) both; }
@keyframes stepIn {
  from { opacity: 0; transform: translate3d(0, 7px, 0); }
  to { opacity: 1; transform: none; }
}

/* ---------- range input ---------- */
.ruler {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 32px;
  margin: 22px 0 0;
  background: transparent;
  cursor: pointer;
}
.ruler::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.ruler::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  margin-top: -11px;
  border-radius: 50%;
  background: var(--accent-solid);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.7);
  transition: transform 140ms var(--spring);
}
.ruler:active::-webkit-slider-thumb { transform: scale(1.08); }
.ruler::-moz-range-track {
  height: 5px;
  border-radius: 99px;
  background: var(--surface-2);
}
.ruler::-moz-range-thumb {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: var(--gold);
}

.num-badge {
  width: 26px; height: 26px;
  padding: 0;
  justify-content: center;
  flex: 0 0 auto;
}

/* segmented controls that carry no sliding thumb */
.segmented.no-thumb button[aria-selected="true"] {
  background: var(--surface-2);
  border-radius: 999px;
}

/* ---------- light theme wash ---------- */
[data-theme="light"] .aurora {
  background:
    radial-gradient(50% 50% at 28% 18%, rgba(176, 138, 70, 0.20), transparent 70%),
    radial-gradient(45% 45% at 76% 12%, rgba(146, 138, 196, 0.10), transparent 72%),
    radial-gradient(42% 42% at 50% 46%, rgba(214, 188, 130, 0.16), transparent 70%);
  filter: blur(24px);
}
[data-theme="light"] .card.gold {
  background:
    radial-gradient(120% 120% at 12% 0%, rgba(169, 131, 56, 0.13), transparent 58%),
    linear-gradient(180deg, #FFFFFF, #FDFBF5);
  border-color: rgba(140, 106, 42, 0.22);
}
[data-theme="light"] .tabbar .inner { box-shadow: 0 18px 40px -24px rgba(26, 24, 21, 0.45); }

/* ---------- responsive ---------- */
.grow { min-width: 0; }
.display.xl { font-size: clamp(34px, 10.5vw, 46px); }
.display.lg { font-size: clamp(27px, 8.6vw, 36px); }
.display.md { font-size: clamp(22px, 6.4vw, 27px); }
.lede { font-size: clamp(13.5px, 3.7vw, 14.5px); }

.app { overflow-x: clip; }

@media (max-width: 359px) {
  :root { --pad: 16px; }
  .choices { gap: 8px; }
  .choice { padding: 13px 11px; min-height: 88px; }
  .week { gap: 5px; }
  .day { padding: 7px 0 6px; border-radius: 13px; }
  .ring .val { font-size: 40px !important; }
  .tabbar .scan-fab { width: 68px; font-size: 12px; }
  .btn { height: 50px; font-size: 14.5px; }
}

@media (max-height: 640px) {
  .onb .body { padding-top: 10px; }
  .onb .foot { padding: 12px 0 18px; }
  .proc { min-height: 60dvh; gap: 18px; }
}

/* ---------- splash ---------- */
#splash {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  background: var(--bg);
  opacity: 1;
  transition: opacity 520ms var(--ease), visibility 520ms;
  /* if the script never runs, the splash still gets out of the way */
  animation: splashAuto 1ms linear 2600ms forwards;
}
@keyframes splashAuto { to { opacity: 0; visibility: hidden; } }
#splash.gone { opacity: 0; visibility: hidden; pointer-events: none; }

.splash-inner {
  display: flex; flex-direction: column; align-items: center;
  transform: translate3d(0, 0, 0);
  animation: splashRise 900ms var(--ease) both;
}
@keyframes splashRise {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to { opacity: 1; transform: none; }
}
.splash-orb {
  position: relative;
  width: 92px; height: 92px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #FFF1E6, var(--gold) 42%, var(--gold-2) 78%, var(--gold-3));
  box-shadow: 0 0 90px rgba(var(--gold-rgb), 0.35);
  animation: orbPulse 3.2s var(--ease) infinite;
}
@keyframes orbPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.splash-word {
  font-family: var(--serif);
  font-size: 52px;
  letter-spacing: -0.02em;
  margin-top: 34px;
  color: var(--ink);
}
.splash-tag {
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}
.splash-bar {
  margin-top: 46px;
  width: 128px; height: 2px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.splash-bar i {
  display: block; height: 100%; width: 40%;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: splashSweep 1.25s var(--ease) infinite;
}
@keyframes splashSweep {
  from { transform: translateX(-120%); }
  to { transform: translateX(320%); }
}

/* ---------- settings ---------- */
.sect {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 30px 0 12px;
}
.group {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  overflow: hidden;
}
.grow-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 16px;
  text-align: left;
  transition: background var(--t-fast) var(--ease);
}
.grow-row + .grow-row { border-top: 1px solid var(--line); }
.grow-row:active { background: var(--surface-2); }
.grow-row .tile {
  flex: 0 0 42px;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--gold);
}
.grow-row .tile svg { width: 19px; height: 19px; }
.grow-row .tt { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.grow-row .ts { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.grow-row .rt { margin-left: auto; color: var(--faint); flex: 0 0 auto; display: grid; }
.grow-row.danger .tt { color: var(--danger); }
.grow-row.danger .tile { color: var(--danger); border-color: rgba(228, 121, 110, 0.25); }
.grow-row.static { pointer-events: none; }
.grow-row .ok-tick {
  margin-left: auto;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--good); color: #07110B;
  flex: 0 0 auto;
}
.grow-row .ok-tick svg { width: 12px; height: 12px; }

/* icon tiles segmented control */
.tiles {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}
.tiles button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 15px 6px 13px;
  border-radius: 15px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform 160ms var(--spring);
}
.tiles button svg { width: 21px; height: 21px; }
.tiles button:active { transform: scale(0.96); }
.tiles button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--thumb-bg);
  border-color: var(--line-strong);
  box-shadow: 0 6px 18px -12px rgba(0, 0, 0, 0.9);
}
.helper { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin-top: 12px; }

/* switch */
.switch {
  margin-left: auto;
  flex: 0 0 auto;
  width: 48px; height: 28px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  position: relative;
  transition: background var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease);
}
.switch span {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform var(--t-mid) var(--spring);
  will-change: transform;
}
.switch[aria-checked="true"] {
  background: var(--accent-solid);
  border-color: transparent;
}
.switch[aria-checked="true"] span { transform: translate3d(20px, 0, 0); background: var(--on-accent); }

/* legal / doc sheets */
.doc h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  margin: 24px 0 8px;
}
.doc h3:first-child { margin-top: 6px; }
.doc p { font-size: 13.5px; line-height: 1.6; color: var(--muted); margin: 0 0 10px; }
.doc p strong { color: var(--ink); font-weight: 600; }
.doc .note {
  border-left: 2px solid rgba(var(--gold-rgb), 0.5);
  padding: 2px 0 2px 14px;
  color: var(--ink);
  font-size: 13px;
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .rise { opacity: 1; transform: none; }
  .heat i { opacity: 1; transform: none; }
}

/* ============================================================
   Template pass — monochrome, high contrast, large type.
   Appended last so it wins over the original plum/copper tokens
   without rewriting every rule that consumes them.
   ============================================================ */
:root {
  color-scheme: dark;
  --ink: #F4F4F5;
  --muted: #8E8E93;
  --faint: #6E6E73;
  --bg: #0A0A0B;
  --bg-2: #101012;
  --surface: #171719;
  --surface-2: #212124;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.22);
  --gold: #EDEDED;
  --gold-2: #C7C7CC;
  --gold-3: #8A8A8E;
  --gold-soft: rgba(255, 255, 255, 0.10);
  --gold-rgb: 237, 237, 237;
  --accent2-rgb: 150, 150, 155;
  --bg-rgb: 10, 10, 11;
  --danger: #FF6B6B;
  --good: #6FCF97;

  --r-sm: 14px;
  --r-md: 22px;
  --r-lg: 28px;
  --r-xl: 36px;

  --serif: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --accent-solid: #E8E8EA;
  --on-accent: #0A0A0B;
  --bar-grad: linear-gradient(90deg, #6E6E73, #EDEDED);
  --thumb-bg: #E8E8EA;
  --heat-1: rgba(255, 255, 255, 0.10);
}

[data-theme="light"] {
  color-scheme: light;
  --ink: #0A0A0B;
  --muted: #6E6E73;
  --faint: #86868B;
  --bg: #F5F5F7;
  --bg-2: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #EDEDF0;
  --line: rgba(0, 0, 0, 0.10);
  --line-strong: rgba(0, 0, 0, 0.22);
  --gold: #111113;
  --gold-2: #2C2C2E;
  --gold-3: #48484A;
  --gold-soft: rgba(0, 0, 0, 0.06);
  --gold-rgb: 17, 17, 19;
  --accent2-rgb: 90, 90, 95;
  --bg-rgb: 245, 245, 247;
  --danger: #C0392B;
  --good: #2F7A4F;
  --accent-solid: #111113;
  --on-accent: #FFFFFF;
  --bar-grad: linear-gradient(90deg, #48484A, #111113);
  --thumb-bg: #111113;
  --serif: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* headings: tight sans, no italics, no serif */
.display, h1.display, .display.lg, .display.md, .display.sm {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.02;
}
.display em { font-style: normal; font-weight: 500; }
.display.lg { font-size: clamp(30px, 9.2vw, 40px); }
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

/* cards: flat, quiet, no glow */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: none;
}

/* the CONTINUE bar */
.btn {
  font-family: var(--sans);
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.btn.primary {
  background: var(--accent-solid);
  color: var(--on-accent);
  border: none;
  font-weight: 500;
  box-shadow: none;
}
.foot .btn.primary, .onb .btn.primary {
  width: 100%;
  height: 58px;
  border-radius: 29px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.btn.primary:disabled { background: var(--surface-2); color: var(--faint); }
.btn.ghost { border: 1px solid var(--line-strong); background: transparent; }

/* continuous progress bar with a hatched fill */
.steps {
  display: block;
  position: relative;
  height: 9px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.steps i { display: none; }
.steps::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p, 0%);
  border-radius: 99px;
  background: repeating-linear-gradient(-45deg,
    var(--gold) 0 5px, rgba(var(--gold-rgb), 0.55) 5px 10px);
  transition: width var(--t-mid) var(--ease);
}

/* option cards */
.choices.one { display: flex; flex-direction: column; gap: 14px; }
.choice {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "t c" "s c";
  align-content: center;
  align-items: center;
  column-gap: 14px;
  width: 100%;
  min-height: 76px;
  padding: 14px 22px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.choice .t { grid-area: t; font-size: 19px; font-weight: 400; letter-spacing: -0.01em; text-align: left; }
.choice .s { grid-area: s; font-size: 13px; color: var(--muted); margin-top: 3px; text-align: left; }
.choice .check { grid-area: c; margin: 0; width: 26px; height: 26px; opacity: 0; display: grid; place-items: center; }
.choice[aria-pressed="true"] {
  background: #E8E8EA;
  border-color: #E8E8EA;
  color: #0A0A0B;
}
.choice[aria-pressed="true"] .s { color: rgba(10, 10, 11, 0.62); }
/* the reference puts a solid disc behind the tick */
.choice[aria-pressed="true"] .check {
  opacity: 1;
  background: #0A0A0B;
  border-radius: 50%;
  color: #FFFFFF;
}
.choice[aria-pressed="true"] .check svg { stroke: #FFFFFF; stroke-width: 2.6; width: 15px; height: 15px; }
[data-theme="light"] .choice[aria-pressed="true"] { background: #111113; border-color: #111113; color: #FFFFFF; }
[data-theme="light"] .choice[aria-pressed="true"] .s { color: rgba(255, 255, 255, 0.66); }
[data-theme="light"] .choice[aria-pressed="true"] .check { background: #FFFFFF; color: #0A0A0B; }
[data-theme="light"] .choice[aria-pressed="true"] .check svg { stroke: #0A0A0B; }

/* age wheel */
.age-wrap { position: relative; margin: 26px 0 10px; }
.age-wheel {
  height: 310px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  mask-image: linear-gradient(180deg, transparent, #000 26%, #000 74%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 26%, #000 74%, transparent);
}
.age-wheel::-webkit-scrollbar { display: none; }
.age-spacer { height: 124px; }
.age-cell {
  height: 62px;
  display: grid;
  place-items: center;
  scroll-snap-align: center;
  font-size: 26px;
  font-weight: 400;
  color: var(--faint);
  transition: font-size var(--t-fast) var(--ease), color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
  cursor: pointer;
}
.age-cell.d1 { opacity: 0.55; font-size: 24px; }
.age-cell.d2 { opacity: 0.32; font-size: 22px; }
.age-cell.d3 { opacity: 0.16; font-size: 20px; }
.age-cell.on { color: var(--ink); font-size: 42px; opacity: 1; }
.age-band {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 62px;
  margin-top: -31px;
  border-radius: var(--r-md);
  background: rgba(var(--gold-rgb), 0.05);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  pointer-events: none;
}
.age-note { text-align: center; font-size: 13px; color: var(--faint); margin-top: 14px; }

/* dream slider */
.dream { text-align: center; margin-top: 54px; }
.dream-label { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; }
.dream-quip { font-size: 14px; color: var(--muted); margin-top: 8px; }
.dream-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  margin-top: 42px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold) var(--fill, 50%), var(--surface-2) var(--fill, 50%));
  outline: none;
}
.dream-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--thumb-bg);
  border: 6px solid rgba(var(--gold-rgb), 0.28);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.dream-range::-moz-range-thumb {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--thumb-bg);
  border: 6px solid rgba(var(--gold-rgb), 0.28);
}

/* baseline capture cards */
.baseline-list { display: flex; flex-direction: column; gap: 18px; margin-top: 26px; }
.baseline {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 40px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}
.baseline:active { background: var(--surface-2); }
.baseline-cam {
  width: 62px; height: 62px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2);
  margin-bottom: 6px;
}
.baseline-t { font-size: 15px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.baseline-s { font-size: 14px; color: var(--muted); }

/* the tab bar and scanner follow the same language */
.tabbar .inner { background: rgba(var(--bg-rgb), 0.86); border-color: var(--line); }
.tabbar .scan-fab { background: var(--accent-solid); color: var(--on-accent); box-shadow: none; }

/* ---------- monochrome consistency ----------
   The template has no colour, so nothing may keep a warm tint: the gold card
   wash, the flash, the splash orb and the segmented thumb all had one. */
.card.gold,
[data-theme="light"] .card.gold {
  background: var(--surface);
  border-color: var(--line);
}
.cam-flash { background: #FFFFFF; }
.splash-orb {
  background: radial-gradient(circle at 34% 28%, #FFFFFF, #C7C7CC 42%, #8A8A8E 78%, #48484A);
}
[data-theme="light"] .splash-orb {
  background: radial-gradient(circle at 34% 28%, #FFFFFF, #D8D8DC 42%, #8A8A8E 78%, #3A3A3C);
}
/* the selected tab sits on the accent-coloured thumb: its label must contrast
   with that, not with the page — this was black text on a black pill */
.segmented button[aria-selected="true"] { color: var(--on-accent); }
.segmented .thumb { border-color: transparent; }
.pill.gold { background: var(--surface-2); border-color: var(--line); color: var(--ink); }

/* ============================================================
   Scanner — guided capture
   A dark surface in both themes, because it is a camera.
   ============================================================ */
.cam-screen {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  background: #0A0A0B;
  color: #F4F4F5;
}
.cam-head {
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  align-items: center;
  padding: 4px 0 14px;
}
.cam-ico {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #F4F4F5;
  background: transparent;
  border: none;
}
.cam-ico:active { background: rgba(255,255,255,0.08); }
.cam-title { text-align: center; }
.cam-title span { display: block; font-size: 19px; font-weight: 500; letter-spacing: -0.01em; }
.cam-title em {
  display: block; font-style: normal; margin-top: 3px;
  font-size: 10px; letter-spacing: 0.20em; text-transform: uppercase;
  color: #8E8E93;
}

.cam-frame {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 30px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255,255,255,0.10);
}
.cam-frame video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.cam-mesh { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* the drawn face, not a mesh */
.cam-guide { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.face-guide { width: 78%; height: 88%; }
.face-guide .fg-line path {
  fill: none;
  stroke: rgba(244,244,245,0.85);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke var(--t-fast) var(--ease);
}
.face-guide .fg-soft path {
  fill: none;
  stroke: rgba(244,244,245,0.28);
  stroke-width: 1;
}
.cam-guide.ok .fg-line path { stroke: rgba(255,255,255,0.98); }
.cam-guide.ok .fg-soft path { stroke: rgba(255,255,255,0.42); }

/* corner brackets */
.cam-corners { position: absolute; inset: 16px; pointer-events: none; }
.cam-corners i {
  position: absolute;
  width: 26px; height: 26px;
  border: 2px solid rgba(244,244,245,0.45);
}
.cam-corners i:nth-child(1) { top: 0; left: 0; border-right: none; border-bottom: none; border-radius: 10px 0 0 0; }
.cam-corners i:nth-child(2) { top: 0; right: 0; border-left: none; border-bottom: none; border-radius: 0 10px 0 0; }
.cam-corners i:nth-child(3) { bottom: 0; left: 0; border-right: none; border-top: none; border-radius: 0 0 0 10px; }
.cam-corners i:nth-child(4) { bottom: 0; right: 0; border-left: none; border-top: none; border-radius: 0 0 10px 0; }

.cam-status { text-align: center; padding: 16px 0 4px; }
.cam-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; color: #F4F4F5;
}
.cam-chip-ico { display: grid; width: 18px; height: 18px; color: #8E8E93; }
.cam-sub { font-size: 13px; color: #8E8E93; margin-top: 7px; }
.cam-chips { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.cam-screen .qchip { color: #6E6E73; }
.cam-screen .qchip .d { background: #3A3A3C; }
.cam-screen .qchip.ok { color: #F4F4F5; }
.cam-screen .qchip.ok .d { background: #F4F4F5; }
.cam-screen .btn.small.primary { margin: 12px auto 0; }

.cam-auto {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 4px 6px;
}
.cam-auto-ico { width: 18px; height: 18px; display: grid; color: #8E8E93; }
.cam-auto-lbl { font-size: 15px; color: #8E8E93; flex: 1; }
.switch {
  width: 52px; height: 30px; border-radius: 99px;
  background: rgba(255,255,255,0.16);
  border: none; padding: 3px;
  display: flex; align-items: center;
  transition: background var(--t-fast) var(--ease);
}
.switch i {
  width: 24px; height: 24px; border-radius: 50%;
  background: #F4F4F5;
  transition: transform var(--t-fast) var(--spring);
}
.switch[aria-checked="true"] { background: #F4F4F5; }
.switch[aria-checked="true"] i { transform: translateX(22px); background: #0A0A0B; }

.cam-shutter-row { display: grid; place-items: center; padding: 6px 0 4px; }
.cam-shutter {
  width: 78px; height: 78px;
  border-radius: 50%;
  border: 3px solid rgba(244,244,245,0.9);
  background: transparent;
  display: grid; place-items: center;
  transition: transform 140ms var(--spring), opacity var(--t-fast);
}
.cam-shutter:active { transform: scale(0.94); }
.cam-shutter:disabled { opacity: 0.38; }
.cam-shutter-in {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: #F4F4F5;
  color: #0A0A0B;
  display: grid; place-items: center;
}
.cam-note { text-align: center; font-size: 12px; color: #6E6E73; margin-top: 8px; }

/* the old hint was absolutely positioned inside the viewfinder */
.cam-screen .cam-hint,
.cam-status .cam-hint {
  position: static;
  inset: auto;
  transform: none;
  padding: 0;
  background: none;
  text-shadow: none;
  font-size: 15px;
  color: #F4F4F5;
}
.cam-status .cam-chip { max-width: 100%; }
.cam-status .cam-chip .cam-hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the baseline step ends with a quiet Skip, not a primary action */
.skip-btn {
  width: 100%;
  height: 52px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.skip-btn:active { color: var(--ink); }

/* the model download is a download, not a countdown */
.cam-load-note {
  font-size: 12px;
  color: #6E6E73;
  margin-top: 8px;
}
.cam-load-note.hide { display: none; }

/* the engine toggle has no sliding thumb, so the selected side carries the
   accent itself — without this the label was white on white */
.segmented.engine-seg {
  background: var(--surface-2);
  border: none;
  padding: 4px;
  margin-top: 4px;
}
.segmented.engine-seg button {
  height: 44px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.segmented.engine-seg button[aria-selected="true"] {
  background: var(--accent-solid);
  color: var(--on-accent);
}

/* the first screen: two clear ways in, one of them not committing to anything */
.welcome .welcome-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}
.welcome .btn { height: 52px; width: 100%; }

/* a button centres its text by default, which pushed the account row's label
   out of line with its icon */
button.item { text-align: left; }
button.item .txt { flex: 1; min-width: 0; }

/* date of birth: three snapping columns, like a native picker */
.dob-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1.5fr 0.9fr 1fr;
  gap: 6px;
  height: 156px;
  margin-top: 26px;
  border-radius: 22px;
  background: var(--surface-2);
  padding: 0 10px;
  overflow: hidden;
}
.dob-band {
  position: absolute;
  left: 8px; right: 8px; top: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  pointer-events: none;
}
.dob-col {
  position: relative;
  height: 156px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.dob-col::-webkit-scrollbar { display: none; }
.dob-spacer { height: 52px; }
.dob-cell {
  height: 52px;
  display: grid;
  place-items: center;
  scroll-snap-align: center;
  font-family: var(--serif);
  font-size: 19px;
  color: var(--muted);
  transition: color .18s ease, opacity .18s ease;
  white-space: nowrap;
}
.dob-cell.on { color: var(--ink); font-size: 22px; }
.dob-cell.d2 { opacity: .5; }
.dob-cell.d3 { opacity: .28; }
.dob-age {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

/* only the small caps labels: the spacing was doing the shouting, not the words */
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.055em;
  color: var(--muted);
  text-transform: uppercase;
}

/* height: one big number in cm, two side by side in feet and inches */
.h-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
}
.h-num {
  font-family: var(--serif);
  font-size: 68px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.h-unit {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}

/* ---------- full-screen sign in / create account ---------- */
.sheet.full {
  height: 100%;
  max-height: 100%;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: calc(env(safe-area-inset-top, 0px) + 22px) 26px calc(env(safe-area-inset-bottom, 0px) + 26px);
  box-sizing: border-box;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.auth-word { font-family: var(--serif); }
.auth-mid {
  margin-top: auto;
  margin-bottom: auto;
  padding: 40px 0;
}
.auth-h1 {
  font-size: 42px;
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin: 0;
}
.auth-h1 em { font-style: italic; }
.auth-sub {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 30ch;
}
.auth-actions {
  display: grid;
  gap: 12px;
  margin-top: 34px;
}
.auth-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 58px;
  padding: 0 22px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}
.auth-btn:active { background: var(--surface-2); }
.auth-btn.solid {
  background: var(--accent-solid);
  color: var(--on-accent);
  border-color: transparent;
  justify-content: center;
}
.auth-g { display: grid; place-items: center; width: 22px; height: 22px; flex: none; }
.auth-switch {
  margin-top: 26px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}
.auth-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.auth-legal-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--muted);
}
.auth-dot { opacity: .6; }
.auth-back {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--ink);
}

/* legal reading view inside the gate */
.legal-page { padding-bottom: 40px; }
.legal-body { margin-top: 22px; }
.legal-h {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 22px 0 8px;
  color: var(--ink);
}
.legal-p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 10px;
}

/* the reason sign-in failed, in words, where it cannot be missed */
.auth-error {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(179, 64, 47, 0.10);
  border: 1px solid rgba(179, 64, 47, 0.28);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

/* Google's own button, given the same room as ours */
.gis-slot {
  display: grid;
  place-items: center;
  min-height: 58px;
  border-radius: 18px;
  overflow: hidden;
}
.gis-slot iframe { width: 100% !important; max-width: 100%; }

/* Google's iframe must sit inside the card, not spill past it */
.gis-slot {
  width: 100%;
  box-sizing: border-box;
}
.gis-slot > div,
.gis-slot iframe {
  max-width: 100% !important;
}

/* ---------- fixes from the review ---------- */

/* 3. the selected segment was dark text on a dark thumb.
   The theme, language and selfie switches use aria-pressed; the engine toggle
   uses aria-selected. Both are covered. */
.segmented button[aria-selected="true"],
.segmented button[aria-pressed="true"] {
  color: var(--on-accent) !important;
  z-index: 2;
  position: relative;
}
.segmented button[aria-selected="false"],
.segmented button[aria-pressed="false"] { color: var(--muted); }
[data-theme="light"] .segmented button[aria-selected="false"],
[data-theme="light"] .segmented button[aria-pressed="false"] { color: #6E6E73; }

/* 5. settings icons were oversized and broke the row rhythm */
.item .ico,
.grow-row .ico {
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
}
.item .ico svg,
.grow-row .ico svg {
  width: 18px !important;
  height: 18px !important;
}

/* suggestion rows with an add button */
.sugg-row,
.fix-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}
.sugg-row .small,
.fix-row .small { flex: 1; min-width: 0; }
.sugg-add {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
}
.sugg-add:active { background: var(--surface-2); }

/* routine problem blocks */
.prob-block { padding: 12px 0; border-top: 1px solid var(--line); }
.prob-block:first-of-type { border-top: none; }
.prob-head { display: grid; gap: 2px; margin-bottom: 4px; }
.prob-head .step-t { font-weight: 600; }

/* the theme, language and selfie pickers are .tiles, not .segmented: the
   selected tile had ink-coloured text on a dark thumb */
.tiles button[aria-pressed="true"] {
  color: var(--on-accent) !important;
}
.tiles button[aria-pressed="true"] svg { stroke: currentColor; }
.tiles button[aria-pressed="false"] { color: var(--muted); }
[data-theme="light"] .tiles button[aria-pressed="false"] { color: #6E6E73; }

/* the add button sat low and ran into the card edge */
.sugg-row,
.fix-row {
  align-items: center;
  padding: 8px 0;
  min-width: 0;
}
.sugg-row .small,
.fix-row .small {
  line-height: 1.4;
  padding-right: 4px;
}
.sugg-add {
  margin-right: 2px;
  align-self: center;
  padding: 0;
  line-height: 0;
}
.sugg-add svg {
  width: 14px !important;
  height: 14px !important;
  display: block;
}

/* a suggestion that has already been added */
.sugg-add.added {
  background: var(--accent-solid);
  border-color: transparent;
  color: var(--on-accent);
}

/* ---------- one door in ----------
   Both buttons sit together at the foot of the screen, same width, same height,
   same shape. The legal links sit under them. */
.auth-page{ justify-content:flex-start; }
.auth-bottom{
  margin-top:auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
  padding-bottom:8px;
}
.auth-bottom .auth-btn,
.auth-bottom .gis-slot{
  width:100%;
  max-width:420px;
  height:56px;
  border-radius:16px;
  margin:0;
}
.auth-bottom .gis-slot{ display:flex; align-items:center; justify-content:center; }
.auth-bottom .auth-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-size:16px;
  font-weight:600;
  letter-spacing:-.01em;
  background:var(--bg-2);
  color:var(--ink);
  border:1px solid var(--line-strong);
}
.auth-bottom .auth-btn.solid{
  background:var(--accent-solid);
  color:var(--on-accent);
  border:none;
}
.auth-bottom .auth-legal{
  margin-top:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-size:12px;
}
.auth-mid{ padding-top:8vh; }

/* ---------- pine green, declared last so it paints ----------
   The monochrome template sets the accent to near-black further up the file.
   Everything below is the same green the app had before that template. */
[data-theme="light"]{
  --accent-solid: linear-gradient(180deg, #4A8C74, #2F6B57 55%, #1F4F40);
  --on-accent: #FFFFFF;
  --bar-grad: linear-gradient(90deg, #7FB39F, #2F6B57);
  --thumb-bg: linear-gradient(180deg, #FFFFFF, #EFEDE6);
  --gold: #2F6B57;
  --gold-2: #1F4F40;
  --gold-soft: rgba(47,107,87,.13);
  --heat-4: #2F6B57;
}
[data-theme="light"] .scan-fab,
[data-theme="light"] .tabbar .scan-fab{
  background: linear-gradient(180deg, #4A8C74, #2F6B57 60%, #1F4F40);
  color: #FFFFFF;
  box-shadow: 0 10px 22px -12px rgba(47,107,87,.55);
}
[data-theme="light"] .pill.gold,
[data-theme="light"] .pill.plain{
  background: rgba(47,107,87,.14);
  color: #2A5F4D;
}
[data-theme="light"] .bar i,
[data-theme="light"] .bar-track i{
  background: linear-gradient(90deg, #7FB39F, #2F6B57);
}
[data-theme="light"] .quest.done .tick,
[data-theme="light"] .tick.on{
  background: #2F6B57;
  border-color: #2F6B57;
}

/* ---------- auth buttons: one shape, both present immediately ----------
   Google's button arrives when its script finishes, which made the screen jump
   and left two buttons that did not match. Our button is drawn at once and
   Google's real one sits invisibly on top of it, so the tap still reaches
   Google while the shape never changes. */
.auth-google{
  position:relative;
  width:100%;
  max-width:420px;
  height:56px;
  flex:none;
}
.auth-google .auth-btn{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  margin:0;
}
.auth-google .gis-slot{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  overflow:hidden;
  opacity:0.01;          /* invisible, still clickable */
  display:flex;
  align-items:center;
  justify-content:center;
}
.auth-google .gis-slot > div{
  width:100% !important;
  height:100% !important;
  transform:scale(1.02);
}

/* ---------- legal pages ---------- */
.legal-page{ padding-top:calc(env(safe-area-inset-top,0px) + 10px); }
.legal-top{
  display:flex; align-items:center; gap:12px;
  padding-bottom:10px; border-bottom:1px solid var(--line);
}
.legal-close{
  width:40px; height:40px; border-radius:50%;
  display:grid; place-items:center;
  background:var(--surface-2); color:var(--ink); border:none;
  flex:none;
}
.legal-top-title{
  font-size:15px; font-weight:600; letter-spacing:-.01em; color:var(--muted);
}
.legal-scroll{
  flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch;
  padding:18px 0 24px;
}
.legal-bottom{
  flex:none; padding-top:12px; border-top:1px solid var(--line);
  display:flex; justify-content:center;
}
.legal-btn{
  width:100%; max-width:420px; height:52px; border-radius:16px;
  background:var(--accent-solid); color:var(--on-accent);
  border:none; font-size:16px; font-weight:600; letter-spacing:-.01em;
}

/* ==========================================================================
   Lumorph 3.0 — the mockup, in code.
   Inter throughout, white cards on a warm-grey page, one pine green used only
   where it means something. Declared last so it wins over every earlier layer.
   ========================================================================== */

:root{ --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
html, body, button, input, select, textarea{
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[data-theme="light"]{
  color-scheme: light;
  --bg: #FAFAF7;
  --bg-2: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F4F4F0;
  --ink: #12130F;
  --muted: #6E6E66;
  --faint: #8E8E85;
  --line: #E9E9E3;
  --line-strong: #D8D8CF;
  --accent-solid: #1E4A3C;
  --on-accent: #FFFFFF;
  --gold: #1E4A3C;
  --gold-2: #16382E;
  --gold-3: #0F2A22;
  --gold-soft: rgba(30, 74, 60, .10);
  --gold-rgb: 30, 74, 60;
  --bg-rgb: 250, 250, 247;
  --danger: #B3402F;
  --good: #2F7A4F;
  --bar-grad: linear-gradient(90deg, #2F6B57, #1E4A3C);
  --thumb-bg: #FFFFFF;
  --heat-1: rgba(30,74,60,.10);
  --heat-2: rgba(30,74,60,.26);
  --heat-3: rgba(30,74,60,.48);
  --heat-4: #1E4A3C;
  --r-sm: 10px; --r-md: 16px; --r-lg: 20px; --r-xl: 26px;
  --shadow-card: none;
}
[data-theme="dark"]{
  color-scheme: dark;
  --bg: #0C0F0D;
  --bg-2: #141816;
  --surface: #141816;
  --surface-2: #1C211E;
  --ink: #F2F3EF;
  --muted: #9AA096;
  --faint: #7C827A;
  --line: #232924;
  --line-strong: #333A35;
  --accent-solid: #2F6B57;
  --on-accent: #FFFFFF;
  --gold: #4E9C7C;
  --gold-2: #3E8A6E;
  --gold-3: #2F6B57;
  --gold-soft: rgba(78,156,124,.14);
  --gold-rgb: 78, 156, 124;
  --bg-rgb: 12, 15, 13;
  --danger: #E8796E;
  --good: #6FBF95;
  --bar-grad: linear-gradient(90deg, #4E9C7C, #2F6B57);
  --thumb-bg: #141816;
  --heat-1: rgba(78,156,124,.14);
  --heat-2: rgba(78,156,124,.30);
  --heat-3: rgba(78,156,124,.52);
  --heat-4: #4E9C7C;
  --shadow-card: none;
}

body{ background: var(--bg); color: var(--ink); }

/* ---- type ---- */
.display, .display.xl, .display.lg, .display.md, .display.sm{
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.display.xl{ font-size: 32px; }
.display.lg{ font-size: 26px; }
.display.md{ font-size: 20px; }
.display.sm{ font-size: 16px; }
.display em{ font-style: normal; color: inherit; }
.sect{
  font-size: 12px; font-weight: 500; letter-spacing: .01em;
  text-transform: none; color: var(--muted);
  margin: 26px 0 8px;
}
.eyebrow{ font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.lede{ font-size: 15px; line-height: 1.5; color: var(--muted); letter-spacing: -0.011em; }
.small{ font-size: 14px; line-height: 1.45; letter-spacing: -0.011em; }
.tiny{ font-size: 12px; line-height: 1.45; color: var(--muted); }

/* ---- cards: white, hairline, no shadow ---- */
.card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: none;
  padding: 16px;
  margin-left: 16px; margin-right: 16px;
}
.card.gold{ background: var(--surface); border: 1px solid var(--line); }

/* ---- rows ---- */
.item, .grow-row{
  min-height: 52px; padding: 12px 16px;
  background: transparent;
  position: relative;
}
.item + .item::before, .grow-row + .grow-row::before{
  content: ""; position: absolute; top: 0; left: 16px; right: 0;
  height: 1px; background: var(--line);
}
.item .t, .grow-row .tt{ font-size: 15px; font-weight: 500; letter-spacing: -0.015em; }
.item .s, .grow-row .ts{ font-size: 12.5px; color: var(--muted); }

/* ---- buttons ---- */
.btn{
  border-radius: 12px; height: 52px; font-size: 15px; font-weight: 600;
  letter-spacing: -0.015em; border: none;
  transition: transform .18s var(--ease), opacity .18s var(--ease);
}
.btn.primary{ background: var(--accent-solid); color: var(--on-accent); }
.btn.ghost{ background: transparent; border: 1px solid var(--line-strong); color: var(--ink); }
.btn:active{ transform: scale(.975); }

/* ---- pills ---- */
.pill{
  font-size: 12px; font-weight: 500; padding: 5px 11px; border-radius: 99px;
  background: var(--surface-2); color: var(--muted);
}
.pill.gold, .pill.plain{ background: var(--gold-soft); color: var(--accent-solid); }

/* ---- top bar ---- */
.topbar{
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  padding: 10px 16px;
}
.topbar .brandmark{ font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.topbar .display.md{ font-size: 26px; }

/* ---- tab bar with the raised scan button ---- */
.tabbar{
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: none;
}
.tabbar .inner > button{ font-size: 10px; font-weight: 500; color: var(--muted); gap: 3px; height: 46px; }
.tabbar .inner > button.active{ color: var(--accent-solid); }
.tabbar .inner > button svg{ width: 23px; height: 23px; }
.tabbar .scan-fab{
  background: var(--accent-solid); color: #fff;
  width: 48px; height: 48px; border-radius: 50%;
  box-shadow: 0 8px 20px -8px rgba(var(--gold-rgb), .55);
  transform: translateY(-10px);
  font-size: 9px;
}
.tabbar .scan-fab svg{ width: 22px; height: 22px; }

/* ---- inputs ---- */
.input{
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 12px; height: 50px; font-size: 15px; color: var(--ink);
  padding: 0 14px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.input:focus{ border-color: var(--accent-solid); box-shadow: 0 0 0 3px var(--gold-soft); outline: none; }

/* ---- quests ---- */
.quest{ min-height: 52px; padding: 12px 16px; }
.quest .t{ font-size: 15px; font-weight: 500; letter-spacing: -0.015em; }
.quest .tick{ width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.quest.done .tick{ background: var(--accent-solid); border-color: var(--accent-solid); }

/* ==========================================================================
   Motion — transform and opacity only, so it stays on the compositor.
   ========================================================================== */

/* a screen arriving */
@keyframes viewIn{
  from{ opacity: 0; transform: translate3d(0, 10px, 0); }
  to{ opacity: 1; transform: translate3d(0, 0, 0); }
}
.view, .page{ animation: viewIn .34s var(--ease) both; }

/* staggered children */
@keyframes riseIn{
  from{ opacity: 0; transform: translate3d(0, 14px, 0); }
  to{ opacity: 1; transform: translate3d(0, 0, 0); }
}
.rise{
  animation: riseIn .46s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}

/* cards lift a hair on press, nothing more */
.card, .item, .quest, .grow-row{
  transition: transform .16s var(--ease), background-color .16s var(--ease);
}
.item:active, .quest:active, .grow-row:active{ background: var(--surface-2); }

/* the scan button breathes, slowly, like it is waiting */
@keyframes breathe{
  0%, 100%{ transform: translateY(-10px) scale(1); }
  50%{ transform: translateY(-10px) scale(1.045); }
}
.tabbar .scan-fab{ animation: breathe 3.6s ease-in-out infinite; }

/* a bar filling */
.bar i, .bar-track i{
  transform-origin: left center;
  animation: barFill .7s var(--ease) both;
}
@keyframes barFill{ from{ transform: scaleX(0); } to{ transform: scaleX(1); } }

/* the ring drawing itself */
.ring svg circle:last-child, .ring-svg circle:last-child{
  animation: ringDraw 1.1s var(--ease) both;
}
@keyframes ringDraw{ from{ stroke-dashoffset: 528; } }

/* numbers settle rather than snap */
@keyframes numIn{
  from{ opacity: 0; transform: translate3d(0, 8px, 0) scale(.96); }
  to{ opacity: 1; transform: none; }
}
.ring b, .score-num, .bigscore .n{ animation: numIn .5s var(--ease) both; }

/* sheets rise from the bottom */
@keyframes sheetIn{
  from{ opacity: 0; transform: translate3d(0, 26px, 0); }
  to{ opacity: 1; transform: none; }
}
.sheet{ animation: sheetIn .34s var(--ease) both; }

/* respect the people who asked for less */
@media (prefers-reduced-motion: reduce){
  .view, .page, .rise, .sheet, .ring svg circle:last-child,
  .ring b, .score-num, .bigscore .n, .tabbar .scan-fab{
    animation: none !important;
  }
  .bar i, .bar-track i{ animation: none !important; transform: none !important; }
  *{ transition-duration: .01ms !important; }
}

/* the rings take the accent, not ink */
.ring svg circle:last-child,
.ring-svg svg circle:last-child,
.score-ring circle:last-child{ stroke: var(--accent-solid) !important; }
.ring b, .score-num{ color: var(--ink); }

/* the scan button is an icon, not a word in a circle */
.tabbar .scan-fab{ font-size: 0 !important; gap: 0 !important; overflow: hidden; }
.tabbar .scan-fab span{ width: 22px !important; height: 22px !important; }

/* ---------- fixes from the screenshots ---------- */

/* bars: the fill is driven by --w, so a keyframe on transform overwrote it and
   every bar read full. A transition lets --w animate instead. */
.bar > i{
  animation: none !important;
  transition: transform .65s var(--ease);
}
.bar-track i{ animation: none !important; }

/* segmented control and the three-way pickers: the text was inheriting a
   colour that matched the background */
.segmented button,
.tiles button{
  color: var(--ink) !important;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.segmented button[aria-selected="true"],
.tiles button[aria-pressed="true"]{
  color: var(--ink) !important;
  font-weight: 600;
}
.segmented .thumb,
.tiles button[aria-pressed="true"]{
  background: var(--surface) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.10), 0 0 0 1px var(--line);
}
.segmented{ background: var(--surface-2); }
.tiles{ background: var(--surface-2); }
[data-theme="dark"] .segmented,
[data-theme="dark"] .tiles{ background: var(--surface-2); }
[data-theme="dark"] .segmented .thumb,
[data-theme="dark"] .tiles button[aria-pressed="true"]{
  background: #2A322C !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.4), 0 0 0 1px var(--line-strong);
}

/* the scan button sits in every tab bar the same way */
.tabbar .scan-fab{
  transform: translateY(-10px) !important;
  margin: 0 !important;
  flex: 0 0 48px !important;
  width: 48px !important;
  height: 48px !important;
}
@keyframes breathe{
  0%, 100%{ transform: translateY(-10px) scale(1); }
  50%{ transform: translateY(-10px) scale(1.045); }
}

/* the scan photo, sitting under the score */
.scan-photo-card{ padding: 10px; }
.scan-photo-wrap{
  border-radius: 12px; overflow: hidden; background: var(--surface-2);
  aspect-ratio: 4 / 5; display: grid; place-items: center;
}
.scan-photo{ width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- one header band, everywhere ----------
   The bar was picking up a tinted background on some pages, so the header
   read as a panel floating above the page. It is now the page colour itself,
   with no seam and no border, on every route. */
.topbar,
[data-theme="light"] .topbar,
[data-theme="dark"] .topbar{
  background: var(--bg) !important;
  background-image: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  padding: 8px 16px 4px !important;
}
.topbar .eyebrow{
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 2px;
}
.topbar .display.md{
  font-size: 27px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.1;
}
/* the page body starts straight under it, no gap of its own */
.page > .topbar + *, .view > .topbar + *{ margin-top: 0; }

/* ==========================================================================
   Typefaces
   Clash Display for anything that is a title. Figtree for everything else.
   ========================================================================== */
:root{
  --font-display: "Clash Display", "Figtree", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ui: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
html, body, button, input, select, textarea{ font-family: var(--font-ui); }

/* titles */
.display, .display.xl, .display.lg, .display.md, .display.sm,
h1, h2, h3, .auth-h1, .auth-word, .wordmark, .legal-h,
.topbar .display.md, .card-h .display,
.sheet h2, .sheet h1{
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.display.xl, .auth-h1{ font-size: 34px; line-height: 1.06; }
.display.lg{ font-size: 27px; }
.display.md, .topbar .display.md{ font-size: 26px; }
.display.sm{ font-size: 17px; letter-spacing: -0.015em; }
.display em, .auth-h1 em{ font-style: normal; }

/* big numbers are titles too */
.bigscore .n, .score-num, .ring b, .score-big, .hero .txt .v{
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.03em;
}

/* everything else stays Figtree */
.eyebrow, .sect, .lede, .small, .tiny, .item .t, .item .s,
.grow-row .tt, .grow-row .ts, .quest .t, .quest .xp, .pill, .btn,
.input, .foot, .legal-p, .tabbar .inner > button{
  font-family: var(--font-ui);
}
.eyebrow, .sect{ font-weight: 500; letter-spacing: 0.08em; }

/* ---------- 1. splash: the real icon, sitting lower ---------- */
#splash .splash-inner{
  justify-content: center;
  padding-bottom: 12vh;      /* push the block down from centre */
}
.splash-icon{
  width: 96px; height: 96px; border-radius: 24px;
  display: block; margin: 0 auto;
  box-shadow: 0 18px 40px -18px rgba(20,72,58,.55);
}
.splash-word{ font-family: var(--font-display); font-weight: 500; }
#splash .splash-orb{ display: none; }

/* ---------- 3. the height slider was invisible on the new background ---------- */
.ruler::-webkit-slider-runnable-track{
  height: 6px;
  background: var(--line-strong);
  border: none;
}
.ruler::-webkit-slider-thumb{
  width: 28px; height: 28px;
  margin-top: -11px;
  background: var(--accent-solid);
  border: 3px solid var(--bg-2);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.ruler::-moz-range-track{ height: 6px; background: var(--line-strong); border: none; }
.ruler::-moz-range-thumb{
  width: 24px; height: 24px; background: var(--accent-solid);
  border: 3px solid var(--bg-2);
}

/* ---------- 4. selected chips: theme colour, never black ---------- */
[aria-pressed="true"], [aria-selected="true"], .chip.on, .pick.on, .tile.on{
  background: var(--gold-soft) !important;
  color: var(--accent-solid) !important;
  border-color: var(--accent-solid) !important;
}
[data-theme="dark"] [aria-pressed="true"],
[data-theme="dark"] [aria-selected="true"]{
  background: var(--gold-soft) !important;
  color: var(--ink) !important;
}
/* a tick sits inside the chip, never on top of the word */
.chip, .pick, .tile{
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 12px;
  font-size: 14px; line-height: 1.2;
}
.chip .tick, .pick .tick, .tile .tick{
  width: 18px; height: 18px; flex: none; margin: 0;
  display: grid; place-items: center;
}

/* ---------- 5. everything was too narrow ---------- */
.page, .view, .main, .screen-body{ padding-left: 14px; padding-right: 14px; }
.card{ margin-left: 12px; margin-right: 12px; }
.sect{ padding: 0 14px; }

/* ---------- 6. header aligned to the same edges as the content ---------- */
.topbar{
  padding: 10px 14px 6px !important;
  margin: 0 !important;
}
.topbar .eyebrow{ margin: 0 0 3px; }

/* ---------- 4. skin / focus tiles: theme colour, tick out of the way ---------- */
.choice{
  position: relative;
}
.choice[aria-pressed="true"],
[data-theme="dark"] .choice[aria-pressed="true"]{
  background: var(--gold-soft) !important;
  border: 1px solid var(--accent-solid) !important;
  color: var(--ink) !important;
}
.choice[aria-pressed="true"] .t,
.choice[aria-pressed="true"] .s{ color: var(--ink) !important; }
.choice[aria-pressed="true"] .s{ opacity: .75; }
/* the tick sits in the corner, and the title never runs under it */
.choice .check{
  position: absolute !important;
  top: 12px; right: 12px;
  width: 22px; height: 22px;
  margin: 0 !important;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-solid);
  color: #fff;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.choice[aria-pressed="true"] .check{ opacity: 1; transform: scale(1); }
.choice .check svg{ width: 13px; height: 13px; }
.choice .t{ padding-right: 30px; }

/* ---------- 6. the header bar reaches the screen edges ---------- */
.topbar{
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100%;
  box-sizing: border-box;
}

/* ---------- 3. the cm / inches switch needs a visible selected side ---------- */
.segmented.no-thumb button[aria-selected="true"]{
  background: var(--surface) !important;
  color: var(--ink) !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,.10), 0 0 0 1px var(--line);
  border-radius: 9px;
}

/* ==========================================================================
   Screen alignment — the last word.
   The page inset was being applied twice: once by --pad on the container and
   again by each card's own margin, so content sat ~38px from each edge. One
   inset only, and the bars paint the page colour so nothing reads as a panel.
   ========================================================================== */

:root, [data-theme="light"], [data-theme="dark"]{ --pad: 16px; }

/* one inset, from the container */
.card, .card.mt-16, .card.gold{
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.sect{ padding-left: 0 !important; padding-right: 0 !important; margin-left: 0; margin-right: 0; }
.helper{ padding-left: 0 !important; padding-right: 0 !important; }

/* the bars are the page, not a panel on top of it */
.topbar,
[data-theme="light"] .topbar,
[data-theme="dark"] .topbar{
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 10px 0 6px !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* the tab bar matches the page it sits on */
.tabbar,
[data-theme="light"] .tabbar,
[data-theme="dark"] .tabbar{
  background: var(--bg) !important;
  border-top: 1px solid var(--line) !important;
  box-shadow: none !important;
}
.tabbar .inner{
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* nothing hides behind the tab bar */
.page, .view, .main, .screen-body, .scroll, .scroll-area{
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
}

/* a value never runs into the words beside it */
.item, .grow-row{ gap: 12px; }
.item .lbl, .item .t, .grow-row .tt, .row .k{ min-width: 0; }
.item .val, .grow-row .rt, .row .v{
  flex: 0 0 auto;
  margin-left: 12px;
  white-space: nowrap;
  text-align: right;
}

/* ---------- remote update bar ---------- */
.update-bar{
  position: fixed; left: 12px; right: 12px;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 300;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px; font-weight: 500;
  box-shadow: 0 12px 30px -12px rgba(0,0,0,.45);
  animation: riseIn .4s var(--ease) both;
}
.update-btn{
  flex: none; border: none; border-radius: 9px;
  background: var(--bg); color: var(--ink);
  font-size: 13px; font-weight: 600; padding: 8px 14px;
}

/* upload mode: a quiet screen, not a dead camera */
.cam-panel.upload-mode video{ display: none !important; }
.cam-panel.upload-mode{ background: var(--bg-2); }
.cam-panel.upload-mode .cam-guide,
.cam-panel.upload-mode canvas{ opacity: 0; }
