/* ============================================================
   FACAI3 — "The Room"
   One continuous room you move through, not a set of tabs.
   Film is the ground; type and a single hairline are the chrome.
   Palette sampled from the project's own limewash-studio stills.
   Accent is injected from js/config.js as --accent (white-label).
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;

  /* limewash daylight */
  --bg:        #efe9df;
  --bg-deep:   #e5ddd1;
  --raise:     #fbf8f3;
  --raise-2:   #f2ece2;
  --ink:       #221f1b;
  --muted:     #6d6459;
  --faint:     #9c9081;
  --line:      rgba(34, 31, 27, 0.10);
  --line-soft: rgba(34, 31, 27, 0.055);

  --accent:      #c9b8a5;                                       /* overwritten by config */
  --accent-ink:  #17130f;
  /* legible against limewash without abandoning the creator's hue */
  --accent-cast: color-mix(in oklab, var(--accent) 52%, #46301c);
  --accent-soft: color-mix(in oklab, var(--accent) 22%, transparent);
  --on-film:     #f6f0e6;

  --shadow-1: 0 1px 2px rgba(46, 36, 26, 0.05), 0 8px 24px rgba(46, 36, 26, 0.06);
  --shadow-2: 0 2px 6px rgba(46, 36, 26, 0.07), 0 28px 70px rgba(46, 36, 26, 0.13);

  --r-xs: 8px;
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 36px;

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --ui: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --page: 1180px;
  --gut: clamp(20px, 5vw, 56px);

  --ease: cubic-bezier(0.22, 0.68, 0.16, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 180ms;
  --t: 340ms;
  --t-slow: 620ms;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #100e0c;
  --bg-deep:   #0a0908;
  --raise:     #1a1714;
  --raise-2:   #23201c;
  --ink:       #f2eade;
  --muted:     #a99c8c;
  --faint:     #7c7264;
  --line:      rgba(242, 234, 222, 0.11);
  --line-soft: rgba(242, 234, 222, 0.055);
  --accent-cast: var(--accent);
  --accent-soft: color-mix(in oklab, var(--accent) 16%, transparent);
  --shadow-1: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.28);
  --shadow-2: 0 2px 8px rgba(0,0,0,0.36), 0 30px 80px rgba(0,0,0,0.5);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1, "cv11" 1;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }
a { color: var(--accent-cast); text-underline-offset: 3px; text-decoration-thickness: 1px; }

:focus-visible {
  outline: 2px solid var(--accent-cast);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; top: -100px; left: 16px; z-index: 200;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: var(--r-xs);
}
.skip:focus { top: 16px; }

/* ---------- type ---------- */
.display {
  font-family: var(--display);
  font-weight: 400;
  font-variation-settings: "SOFT" 28, "WONK" 1, "opsz" 40;
  line-height: 1.02;
  letter-spacing: -0.021em;
  text-wrap: balance;
}
h1.display { font-size: clamp(2.6rem, 7.4vw, 5.1rem); }
h2.display { font-size: clamp(1.9rem, 4.2vw, 3rem); }
h3.display { font-size: clamp(1.35rem, 2.6vw, 1.85rem); line-height: 1.12; }

.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--faint);
}
.lede { font-size: clamp(1rem, 1.5vw, 1.14rem); color: var(--muted); max-width: 54ch; text-wrap: pretty; }
.tiny { font-size: 12.5px; color: var(--faint); line-height: 1.5; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---------- shell ---------- */
.wrap { width: min(100% - var(--gut) * 2, var(--page)); margin-inline: auto; }

.ribbon {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 9px 18px; font-size: 12.5px; line-height: 1.45; text-align: center;
  background: var(--ink); color: var(--bg); flex-wrap: wrap;
}
.ribbon button {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 99px; background: color-mix(in oklab, var(--bg) 22%, transparent);
  flex: none;
}

.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 8px;
  padding: 13px var(--gut);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.topbar.is-stuck { border-bottom-color: var(--line-soft); }

.brand { display: flex; align-items: center; gap: 11px; margin-right: auto; }
.mono {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
}
.brand-name {
  font-family: var(--display); font-size: 19px; font-weight: 500;
  font-variation-settings: "SOFT" 20, "WONK" 1, "opsz" 20;
  letter-spacing: -0.01em; line-height: 1;
}
.brand-sub { font-size: 11px; color: var(--faint); letter-spacing: 0.03em; }

.nav { display: flex; gap: 2px; }
.nav button {
  padding: 8px 14px; border-radius: 99px; font-size: 14px; color: var(--muted);
  position: relative; transition: color var(--t-fast) var(--ease);
}
.nav button:hover { color: var(--ink); }
.nav button[aria-current="page"] { color: var(--ink); font-weight: 500; }
.nav button[aria-current="page"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 1.5px; background: var(--accent-cast); border-radius: 2px;
}

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  color: var(--muted); transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--raise-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- view transitions ---------- */
.view { animation: rise var(--t-slow) var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- 1. THE ROOM (hero) ---------- */
.room {
  position: relative; isolation: isolate;
  min-height: min(84dvh, 720px);
  display: flex; align-items: flex-end;
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-top: 10px;
  background: var(--bg-deep);
  box-shadow: var(--shadow-2);
}
.room-film { position: absolute; inset: 0; z-index: -2; }
.room-film img, .room-film video {
  width: 100%; height: 100%; object-fit: cover;
  animation: drift 34s var(--ease) infinite alternate;
}
@keyframes drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to   { transform: scale(1.12) translate3d(-1.6%, -1.2%, 0); }
}
.room::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, rgba(12, 10, 8, 0.88) 0%, rgba(12, 10, 8, 0.55) 34%, rgba(12, 10, 8, 0.08) 66%, rgba(12,10,8,0.22) 100%);
}
.room-body { padding: clamp(28px, 5vw, 60px); color: var(--on-film); width: 100%; }
.room-body .eyebrow { color: color-mix(in oklab, var(--on-film) 66%, transparent); }
.room-body h1 { color: var(--on-film); margin: 14px 0 0; max-width: 15ch; }
.room-why {
  margin-top: 16px; font-size: 15.5px; line-height: 1.55;
  color: color-mix(in oklab, var(--on-film) 82%, transparent); max-width: 46ch;
}
.room-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px;
}
.chip-film {
  font-size: 12px; letter-spacing: 0.02em; padding: 6px 12px; border-radius: 99px;
  background: rgba(246, 240, 230, 0.14); color: var(--on-film);
  border: 1px solid rgba(246, 240, 230, 0.18);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.room-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 26px; border-radius: 99px; font-size: 15px; font-weight: 500;
  letter-spacing: -0.005em; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.btn:active { transform: scale(0.975); }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-1); }
.btn-primary:hover { box-shadow: var(--shadow-2); }

.btn-ink { background: var(--ink); color: var(--bg); }
.btn-ink:hover { background: color-mix(in oklab, var(--ink) 88%, var(--accent)); }

.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--raise-2); border-color: transparent; }

.btn-film {
  border: 1px solid rgba(246, 240, 230, 0.3); color: var(--on-film);
  background: rgba(246, 240, 230, 0.08);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn-film:hover { background: rgba(246, 240, 230, 0.18); }

.btn-sm { padding: 9px 17px; font-size: 13.5px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ---------- 2. RIGHT NOW composer ---------- */
.now {
  margin-top: clamp(48px, 8vw, 96px);
  display: grid; gap: clamp(24px, 4vw, 48px);
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
}
@media (max-width: 860px) { .now { grid-template-columns: 1fr; } }

.now-dials { display: grid; gap: 26px; }
.dial-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.dial-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dial {
  padding: 10px 16px; border-radius: 99px; font-size: 14px; color: var(--muted);
  border: 1px solid var(--line);
  transition: all var(--t-fast) var(--ease);
}
.dial:hover { border-color: var(--faint); color: var(--ink); }
.dial[aria-pressed="true"] {
  background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 500;
}

.now-out {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--raise); box-shadow: var(--shadow-1);
  overflow: hidden;
}
.now-out-head {
  padding: 22px 24px 18px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.now-list { list-style: none; }
.now-item {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center;
  padding: 12px 24px; border-bottom: 1px solid var(--line-soft);
  animation: rise var(--t) var(--ease-out) both;
}
.now-item:last-child { border-bottom: 0; }
.now-thumb {
  width: 56px; height: 56px; border-radius: var(--r-xs); object-fit: cover;
  background: var(--raise-2); filter: saturate(0.92);
}
.now-name { display: block; font-size: 15px; font-weight: 500; letter-spacing: -0.006em; }
.now-sub { display: block; font-size: 12.5px; color: var(--faint); margin-top: 3px; }
.now-secs { font-size: 13px; color: var(--muted); }
.now-foot { padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* ---------- 3. LIBRARY — contact sheet ---------- */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  margin: clamp(48px, 8vw, 96px) 0 24px; flex-wrap: wrap;
}
.section-head p { margin-top: 8px; }

.rail {
  display: flex; gap: 7px; overflow-x: auto; padding-bottom: 10px;
  scrollbar-width: none; -ms-overflow-style: none;
  scroll-snap-type: x proximity;
}
.rail::-webkit-scrollbar { display: none; }
.rail .dial { flex: none; scroll-snap-align: start; }

.sheet-grid {
  display: grid; gap: 14px; margin-top: 20px;
  grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
}
.card {
  position: relative; text-align: left; border-radius: var(--r-md); overflow: hidden;
  background: var(--raise-2); isolation: isolate;
  animation: rise var(--t) var(--ease-out) both;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.card-film { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-deep); }
.card-film img, .card-film video {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--t-slow) var(--ease), opacity var(--t) var(--ease);
}
.card:hover .card-film img { transform: scale(1.05); }
.card-film video { position: absolute; inset: 0; opacity: 0; }
.card.is-playing .card-film video { opacity: 1; }
.card-film::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(12,10,8,0.86) 0%, rgba(12,10,8,0.3) 40%, transparent 68%);
}
.card-body {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 16px 16px 15px; color: var(--on-film);
}
.card-title {
  font-family: var(--display); font-weight: 500; font-size: 17px; line-height: 1.15;
  font-variation-settings: "SOFT" 24, "WONK" 1, "opsz" 18;
  letter-spacing: -0.012em;
}
.card-meta {
  font-size: 11.5px; margin-top: 6px; letter-spacing: 0.02em;
  color: color-mix(in oklab, var(--on-film) 72%, transparent);
  display: flex; align-items: center; gap: 7px;
}
.dot { width: 2.5px; height: 2.5px; border-radius: 50%; background: currentColor; opacity: 0.6; flex: none; }

.badge {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 99px;
  background: rgba(12,10,8,0.5); color: var(--on-film);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.badge-lock { background: var(--accent); color: var(--accent-ink); }
.badge-done { background: rgba(246,240,230,0.9); color: #17130f; }
.card.is-excluded { opacity: 0.42; filter: grayscale(0.7); }

/* wide routine cards */
.rt-grid { display: grid; gap: 16px; margin-top: 20px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.rt-card .card-film { aspect-ratio: 16 / 10; }
.rt-card .card-title { font-size: 21px; }

/* ---------- sheets / dialogs ---------- */
dialog {
  border: 0; padding: 0; color: var(--ink); background: transparent;
  max-width: 100vw; max-height: 100dvh; width: 100%; height: 100%;
}
dialog::backdrop { background: rgba(10, 8, 6, 0.62); backdrop-filter: blur(6px); }
.sheet {
  position: fixed; inset: auto 0 0 0; margin-inline: auto;
  width: min(100%, 720px); max-height: 92dvh; overflow-y: auto;
  background: var(--raise); border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-2);
  animation: sheetUp 420ms var(--ease-out) both;
  overscroll-behavior: contain;
}
@media (min-width: 760px) {
  .sheet { inset: 0; margin: auto; border-radius: var(--r-xl); max-height: 88dvh; }
  @keyframes sheetUp { from { opacity: 0; transform: translateY(24px) scale(0.985); } to { opacity: 1; transform: none; } }
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }

.sheet-film { position: relative; aspect-ratio: 16 / 9; background: var(--bg-deep); overflow: hidden; }
.sheet-film video, .sheet-film img { width: 100%; height: 100%; object-fit: cover; }
.sheet-close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(12,10,8,0.55); color: var(--on-film);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.sheet-close svg { width: 15px; height: 15px; }
.sheet-body { padding: clamp(22px, 4vw, 34px); }
.sheet-body h2 { margin-bottom: 10px; }

.pill-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 22px; }
.pill {
  font-size: 12px; padding: 5px 11px; border-radius: 99px;
  background: var(--raise-2); color: var(--muted); border: 1px solid var(--line-soft);
}

.cues { list-style: none; margin: 20px 0; border-top: 1px solid var(--line-soft); }
.cue {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 14px; align-items: baseline;
  padding: 13px 2px; border-bottom: 1px solid var(--line-soft);
}
.cue-n { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.cue-t { font-size: 15px; line-height: 1.5; }
.cue-s { font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }

.note {
  border-left: 2px solid var(--accent-cast); padding: 4px 0 4px 16px;
  font-size: 14px; color: var(--muted); line-height: 1.55; margin: 20px 0;
}
.sheet-actions {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding-top: 6px;
}
.sheet-actions .grow { margin-left: auto; }

/* ---------- 4. THE PLAYER ---------- */
.player {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: #0a0908; color: var(--on-film);
  flex-direction: column;
}
.player.is-open { display: flex; animation: fadeIn var(--t) var(--ease-out) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.player-film { position: absolute; inset: 0; z-index: 0; }
.player-film video, .player-film img { width: 100%; height: 100%; object-fit: cover; opacity: 0.62; }
.player-film::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% 42%, rgba(10,9,8,0.18) 0%, rgba(10,9,8,0.86) 72%, rgba(10,9,8,0.96) 100%);
}

/* the hairline — progress lives at the very top edge, not in a chunky ring */
.player-line {
  position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 5;
  background: rgba(246,240,230,0.14);
}
.player-line i {
  display: block; height: 100%; width: 0%; background: var(--accent);
  transition: width 1s linear;
}
.player-head {
  position: relative; z-index: 4;
  display: flex; align-items: center; gap: 14px;
  padding: 22px clamp(18px, 5vw, 40px);
}
.player-head .eyebrow { color: rgba(246,240,230,0.55); }
.player-title { font-size: 13.5px; color: rgba(246,240,230,0.8); margin-right: auto; }
.player-x {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(246,240,230,0.1); color: var(--on-film);
}
.player-x svg { width: 15px; height: 15px; }

.player-stage {
  position: relative; z-index: 4; flex: 1;
  display: grid; place-items: center; padding: 20px clamp(18px, 5vw, 40px); text-align: center;
}
.player-inner { max-width: min(88vw, 560px); }
.player-count {
  font-family: var(--display); font-size: clamp(3.4rem, 12vw, 6.6rem);
  font-variation-settings: "SOFT" 40, "WONK" 0, "opsz" 96;
  font-weight: 300; line-height: 1; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: rgba(246,240,230,0.32);
}
.player-cue {
  font-family: var(--display); font-weight: 400;
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 40;
  font-size: clamp(1.45rem, 3.4vw, 2.15rem); line-height: 1.2; letter-spacing: -0.018em;
  margin-top: 26px; text-wrap: balance;
}
.player-cue.swap { animation: cueSwap 520ms var(--ease-out) both; }
@keyframes cueSwap {
  from { opacity: 0; filter: blur(6px); transform: translateY(10px); }
  to   { opacity: 1; filter: blur(0); transform: none; }
}
.player-next { margin-top: 20px; font-size: 13px; color: rgba(246,240,230,0.45); }

.player-foot {
  position: relative; z-index: 4;
  padding: 20px clamp(18px, 5vw, 40px) calc(28px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.pbtn {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(246,240,230,0.22); color: var(--on-film);
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.pbtn:hover { background: rgba(246,240,230,0.12); }
.pbtn:active { transform: scale(0.94); }
.pbtn svg { width: 19px; height: 19px; }
.pbtn-main {
  width: 76px; height: 76px; background: var(--accent); color: var(--accent-ink); border-color: transparent;
}
.pbtn-main svg { width: 25px; height: 25px; }

.player-steps { display: flex; gap: 4px; justify-content: center; padding: 0 clamp(18px,5vw,40px) 10px; position: relative; z-index: 4; }
.pstep { height: 2px; flex: 1; max-width: 44px; background: rgba(246,240,230,0.16); border-radius: 2px; transition: background var(--t) var(--ease); }
.pstep.done { background: rgba(246,240,230,0.5); }
.pstep.now { background: var(--accent); }

/* finish */
.finish { text-align: center; max-width: 30ch; }
.finish h2 { color: var(--on-film); margin-bottom: 14px; }
.finish p { color: rgba(246,240,230,0.7); font-size: 15px; }
.finish-stats { display: flex; gap: 28px; justify-content: center; margin: 30px 0; }
.fstat b {
  display: block; font-family: var(--display); font-size: 2.1rem; font-weight: 400;
  font-variation-settings: "SOFT" 30, "opsz" 36; line-height: 1;
}
.fstat span { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(246,240,230,0.5); }

/* ---------- 5. PROGRESS ---------- */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 22px; }
.stat {
  padding: 22px; border-radius: var(--r-md); background: var(--raise); border: 1px solid var(--line-soft);
}
.stat b {
  display: block; font-family: var(--display); font-weight: 400; font-size: 2.5rem; line-height: 1;
  font-variation-settings: "SOFT" 34, "WONK" 0, "opsz" 40; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat span { display: block; margin-top: 8px; font-size: 12px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); }

.strip { display: flex; gap: 5px; margin-top: 22px; }
.strip i {
  flex: 1; height: 42px; border-radius: 6px; background: var(--raise-2);
  transition: background var(--t) var(--ease);
}
.strip i.on { background: var(--accent-cast); }

.map { display: grid; gap: 9px; margin-top: 22px; }
.map-row { display: grid; grid-template-columns: 96px 1fr 38px; gap: 14px; align-items: center; font-size: 13.5px; }
.map-bar { height: 7px; border-radius: 99px; background: var(--raise-2); overflow: hidden; }
.map-bar i { display: block; height: 100%; background: var(--accent-cast); border-radius: 99px; transition: width var(--t-slow) var(--ease-out); }
.map-n { text-align: right; color: var(--faint); font-variant-numeric: tabular-nums; font-size: 12.5px; }

/* ---------- export ---------- */
.export-pre {
  margin-top: 18px; padding: 20px; border-radius: var(--r-md);
  background: var(--raise-2); border: 1px solid var(--line-soft);
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; line-height: 1.65;
  white-space: pre-wrap; max-height: 320px; overflow-y: auto; color: var(--muted);
}

/* ---------- paywall ---------- */
.pay-list { list-style: none; margin: 20px 0; }
.pay-list li { display: flex; gap: 12px; padding: 9px 0; font-size: 15px; align-items: baseline; }
.pay-list svg { width: 14px; height: 14px; flex: none; color: var(--accent-cast); transform: translateY(2px); }
.plans { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin: 22px 0; }
@media (max-width: 480px) { .plans { grid-template-columns: 1fr; } }
.plan {
  padding: 20px; border-radius: var(--r-md); border: 1px solid var(--line); text-align: left;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.plan[aria-pressed="true"] { border-color: var(--ink); background: var(--raise-2); }
.plan b { display: block; font-family: var(--display); font-size: 1.7rem; font-weight: 400; font-variation-settings: "SOFT" 30, "opsz" 30; }
.plan span { display: block; font-size: 12.5px; color: var(--faint); margin-top: 5px; }

/* ---------- footer ---------- */
.foot {
  margin-top: clamp(64px, 10vw, 120px); padding: 40px 0 60px;
  border-top: 1px solid var(--line-soft); color: var(--faint); font-size: 12.5px; line-height: 1.65;
}
.foot p + p { margin-top: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); z-index: 300;
  padding: 12px 22px; border-radius: 99px; font-size: 14px;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2);
  opacity: 0; pointer-events: none; transition: all var(--t) var(--ease-out);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 620px) {
  .nav button { padding: 8px 10px; font-size: 13px; }
  .brand-sub { display: none; }
  .room { min-height: 78dvh; border-radius: var(--r-lg); }
}
