/* Section 2 · the Misclo app on the tour's paper (owner, 30 Oct 2026: "an accurate design" from the app's front end).
   Visual source, read only: the app build's tokens, base, components, Today and Focus styles (.fx-earned) and its icons and
   token geometry. Values are copied, then scaled by --u:
   --s is the paper's size (set by js/stage.js), --k the fit factor (lowered per step if a screen would not fit).
   Content is the sample week (data/week-v2.4.json); nothing from the personal build's records is used.
   Section 2 v2 (7 Nov 2026): the companion choice sets data-companion on .paper; Theo's cobalt set and Lumi's coral set fill
   the same accent slots, so every component follows. New demo components live in css/demo.css. */

.paper {
  --s: 1; --k: 1; --u: calc(var(--s) * var(--k) * 1px);
  --ink: #1D2128; --ink2: #3A3F48; --sl: #5A606B; --ln: #DCD8D0; --ln2: #CAC5BB; --pl: #ECEAE4; --st: #F6F5F0; --iv: #FBFAF7;
  /* the companion's accent: --acc text and rings on light (AA), --accv graphic only, --accs soft fill, --accd text and rings on dark.
     Lumi's coral set is the default (owner decision 13); Theo's cobalt set below. */
  --acc: #A8363F; --accv: #ED7073; --accs: #FBE5E3; --accd: #FF9A97; --g1: #2C3139; --g2: #1D2128; --g3: #14171B; --od2: #C6CBD3;
  --sc: inset 0 1px 0 #ffffffd0, 0 1px 1px #1d21280d, 0 18px 40px -22px #1d212840;
  --dark: radial-gradient(130% 90% at 88% 0%, #3a404a 0%, transparent 55%), linear-gradient(180deg, #2C3139, #1D2128 60%, #14171B);
  background: var(--st); color: var(--ink); border-radius: 4px; overflow: hidden; container-type: size;
  box-shadow: inset 0 1px 0 #fff, 0 2px 4px #0003, 0 34px 70px -26px #000000d0;
  display: grid; grid-template-areas: "top" "app" "foot"; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  transform-origin: 50% 50%; font: 500 calc(14 * var(--u))/1.42 var(--font-body);
}
.paper[data-companion="theo"] { --acc: #1C48B9; --accv: #3E6BEF; --accs: #E2E8FA; --accd: #8EA6FF; }
.js .paper { position: absolute; left: var(--px); top: var(--py); width: var(--pw); height: var(--ph); }
.p-step, .app, .earned { --u: calc(var(--s) * var(--k) * 1px); }
.a-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ the guide's bar (on the paper, above the app) */
.p-top { grid-area: top; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px 10px 7px 12px; min-height: 52px; }
.p-say { flex: 1 1 auto; min-width: 0; display: grid; }
.say { grid-area: 1 / 1; display: flex; gap: 10px; align-items: center; min-width: 0; opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
.say.is-on { opacity: 1; visibility: inherit; transition: opacity .3s .1s, visibility 0s; }
.say > div { min-width: 0; }
.say h2 { margin: 0; font: 650 max(14.5px, calc(16 * var(--s) * 1px))/1.18 var(--font-display); letter-spacing: -.015em; outline-offset: 3px; }
.say p { margin: 2px 0 0; font-size: max(12px, calc(13 * var(--s) * 1px)); line-height: 1.3; color: #4c515a; }
.say em { font-style: normal; font-weight: 750; color: var(--ink); }
.face { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; position: relative; }
.face::before, .face::after { content: ''; position: absolute; top: 40%; width: 5px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 5px #9fb4ff; }
.face::before { left: 33%; } .face::after { right: 33%; }
.face--theo { background: #4a4f57; box-shadow: 0 0 0 2px var(--cobalt); }
.face--lumi { background: #a88f7d; box-shadow: 0 0 0 2px var(--coral); }
.face--lumi::before, .face--lumi::after { box-shadow: 0 0 5px #ffd2b0; }
.p-ex { margin: 0; flex: 0 0 auto; font: 800 12px/1 var(--font-body); letter-spacing: .04em; text-transform: uppercase; border: 1px dashed var(--line-strong); border-radius: 5px; padding: 4px 6px; color: var(--slate); }
.p-temp { flex: 0 0 auto; min-height: 32px; padding: 0 8px; border-radius: 999px; border: 1px dashed var(--line-strong); background: none; font: 700 12px/1 var(--font-body); color: var(--slate); cursor: pointer; position: relative; }
.p-skip { flex: 0 0 auto; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: none; font: 750 12.5px/1 var(--font-body); color: var(--graphite); cursor: pointer; position: relative; white-space: nowrap; }
.p-temp::after, .p-skip::after { content: ''; position: absolute; inset: -6px -2px; }
.stage[data-fmt="phone"] .p-temp, .stage[data-fmt="phone"] .p-ex { display: none; }
/* phone: the guide keeps its line; the longer note is read out, not shown (the paper has no room to spare) */
.stage[data-fmt="phone"] .p-top { padding: 7px 8px 6px 10px; min-height: 0; }
.stage[data-fmt="phone"] .say h2 { font-size: max(14px, calc(15 * var(--s) * 1px)); }
.stage[data-fmt="phone"] .say p { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.stage[data-fmt="phone"] .face { width: 26px; height: 26px; }
.stage[data-fmt="laptop"] .p-top { padding: 10px 16px 9px 18px; gap: 10px; min-height: 58px; }
.stage[data-fmt="laptop"] .face { width: 34px; height: 34px; }

/* ------------------------------------------------------------------ the app window (the app build's shell) */
.app { grid-area: app; position: relative; min-height: 0; min-width: 0; margin: 0 8px; border-radius: 16px; overflow: hidden; background: var(--pl);
  box-shadow: inset 0 0 0 1px #00000010, 0 1px 0 #ffffffb0;
  display: grid; grid-template-areas: "atop" "view" "nav"; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); }
.stage[data-fmt="laptop"] .app { margin: 0 14px; border-radius: 18px; grid-template-areas: "nav atop" "nav view"; grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: clamp(148px, 15.5cqw, 220px) minmax(0, 1fr); }

/* tab bar on phone (.mobile-nav) · sidebar on laptop (.sidebar, .side-link) — the six parts double as the tour's progress */
.p-tabs { grid-area: nav; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; padding: 4px 4px 5px; background: #FBFAF7f2; border-top: 1px solid var(--ln); }
.p-tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 46px; padding: 2px 0; min-width: 0;
  border: 0; background: none; border-radius: 14px; cursor: pointer; font: 700 12px/1.1 var(--font-body); letter-spacing: -.02em; color: var(--sl); position: relative; }
.p-tabs button span { white-space: nowrap; }
.p-tabs button .i { width: 21px; height: 21px; }
.p-tabs button[aria-current] { color: var(--ink); background: var(--accs); }
.p-tabs button[aria-current] .i { color: var(--acc); stroke-width: 2.1; }
.p-tabs button:focus-visible { outline: 3px solid var(--acc); outline-offset: -3px; }
.a-brand, .a-foot { display: none; }
.stage[data-fmt="laptop"] .p-tabs { display: flex; flex-direction: column; gap: 3px; padding: calc(16 * var(--u)) 10px 12px 12px; background: none; border: 0; min-height: 0; }
.stage[data-fmt="laptop"] .a-brand { display: flex; align-items: center; gap: 9px; margin: 0 0 calc(18 * var(--u)) 4px; font: 700 calc(21 * var(--u))/1 var(--font-display); letter-spacing: -.045em; color: var(--ink); }
.stage[data-fmt="laptop"] .a-brand svg { width: calc(30 * var(--u)); height: calc(30 * var(--u)); }
.stage[data-fmt="laptop"] .p-tabs button { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: 14px; font-size: max(13px, calc(14 * var(--u))); letter-spacing: 0; }
.stage[data-fmt="laptop"] .p-tabs button .i { width: 19px; height: 19px; }
.stage[data-fmt="laptop"] .p-tabs button:hover { color: var(--ink); background: #E3E0D9; }
.stage[data-fmt="laptop"] .p-tabs button[aria-current] { background: var(--iv); box-shadow: var(--sc); font-weight: 800; }
.stage[data-fmt="laptop"] .p-tabs button[aria-current]::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accv); }
.stage[data-fmt="laptop"] .a-foot { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }

/* standing chip (.standing-chip): the earned rank token; no meter (site rule: no XP meter outside the earned moment) */
.a-stand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.a-stand b { display: block; font: 600 calc(15 * var(--u))/1.1 var(--font-display); letter-spacing: -.02em; white-space: nowrap; }
.a-stand small, .a-prof small { display: block; font-size: 12px; font-weight: 650; color: var(--sl); }
.a-foot .a-stand { padding: 4px 4px 4px 2px; }
.a-prof { display: flex; align-items: center; gap: 9px; padding: 0 4px; }
.a-prof b { display: block; font: 700 13px/1.2 var(--font-body); white-space: nowrap; }
.a-avatar { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: #E3E0D9; font: 700 14px/1 var(--font-body); color: var(--ink2); }

/* page top (.page-top): day + date, standing chip, avatar */
.a-top { grid-area: atop; min-width: 0; display: flex; align-items: center; gap: 8px; padding: calc(7 * var(--u)) 10px calc(3 * var(--u)) 14px; }
.a-day { margin: 0 auto 0 0; min-width: 0; display: flex; flex-direction: column; }
.a-day b { font: 600 calc(16 * var(--u))/1.15 var(--font-display); letter-spacing: -.02em; white-space: nowrap; }
.a-day small { font-size: max(12px, calc(12.5 * var(--u))); font-weight: 650; color: var(--sl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-stand--top { background: var(--iv); border-radius: 14px; padding: 2px 12px 2px 5px; box-shadow: var(--sc); min-height: 36px; }
.stage[data-fmt="laptop"] .a-top { padding: calc(14 * var(--u)) calc(22 * var(--u)) calc(4 * var(--u)) 8px; }
.stage[data-fmt="laptop"] .a-day { flex-direction: row; align-items: baseline; gap: 10px; }
.stage[data-fmt="laptop"] .a-day b { font-size: calc(17 * var(--u)); }
.stage[data-fmt="laptop"] .a-day small { font-size: max(12px, calc(14 * var(--u))); }
.stage[data-fmt="laptop"] .a-stand--top { display: none; }

/* sculpted hex tokens (.token): earned brass is only ever the rank */
.tok { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; }
.tok svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 5px 7px #1d212833); }
.tok b { position: relative; font: 650 1em/1 var(--font-display); color: #4A3210; }
.tok-xs { width: 28px; height: 30px; font-size: 14px; }
.tok-md { width: calc(54 * var(--u)); height: calc(58 * var(--u)); font-size: calc(26 * var(--u)); }
.tok-lg { width: calc(96 * var(--u)); height: calc(104 * var(--u)); font-size: calc(46 * var(--u)); }
.e-tok b { color: var(--ink); }

/* ------------------------------------------------------------------ the screens: stacked in one cell, the current one slides in (css/demo.css) */
.p-view { grid-area: view; position: relative; overflow: hidden; min-height: 0; min-width: 0; }
.p-track { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); height: 100%; }
.p-step { grid-area: 1 / 1; position: relative; height: 100%; min-width: 0; overflow: hidden; padding: calc(3 * var(--u)) 12px calc(10 * var(--u)); }
.stage[data-fmt="laptop"] .p-step { padding: calc(8 * var(--u)) calc(22 * var(--u)) calc(16 * var(--u)) 8px; }
.scr { display: flex; flex-direction: column; gap: calc(9 * var(--u)); min-width: 0; }
.scr > *, .a-lead > *, .a-cols > * { min-width: 0; }
.a-lead { display: flex; flex-direction: column; gap: calc(9 * var(--u)); min-width: 0; }
.a-cols { display: flex; flex-direction: column; gap: calc(9 * var(--u)); }

.stage[data-fmt="phone"] .a-lap { display: none !important; }
.stage[data-fmt="laptop"] .a-ph { display: none !important; }

/* laptop: two columns, as the app lays its pages out at 1024 and up */
.stage[data-fmt="laptop"] .scr { gap: calc(12 * var(--u)); }
.stage[data-fmt="laptop"] .a-cols {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: calc(12 * var(--u)) calc(20 * var(--u)); align-items: start; }
.stage[data-fmt="laptop"] .a-lead { gap: calc(12 * var(--u)); }

/* type (.eyebrow / .page-h1: Space 550, tight tracking, a full stop) */
.a-head { display: grid; gap: calc(3 * var(--u)); }
.a-kick { margin: 0; font: 650 max(12px, calc(13 * var(--u)))/1.3 var(--font-body); color: var(--sl); }
.a-h1 { margin: 0; font: 550 calc(27 * var(--u))/1.02 var(--font-display); letter-spacing: -.045em; text-wrap: balance; }
.stage[data-fmt="laptop"] .a-h1 { font-size: calc(38 * var(--u)); }

.a-sec { margin: 0; font: 800 max(12px, calc(12 * var(--u)))/1.25 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
.a-sec span { letter-spacing: .04em; }

/* segmented control (.training-tabs) — shown as it is; the tour moves between parts, not between these */
.a-seg { margin: 0; display: flex; gap: 3px; background: #E3E0D9; border-radius: 999px; padding: 3px; width: max-content; max-width: 100%; flex: 0 0 auto; overflow: hidden; }
.a-seg span { display: inline-flex; align-items: center; padding: 0 calc(12 * var(--u)); min-height: calc(30 * var(--u)); border-radius: 999px; font: 700 max(12px, calc(12.5 * var(--u)))/1 var(--font-body); color: var(--sl); white-space: nowrap; }
.a-seg .on { color: var(--ink); background: var(--iv); box-shadow: var(--sc); }

/* week rail (.td-week / .td-day) */
.a-rail { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; background: var(--iv); border-radius: calc(18 * var(--u)); box-shadow: var(--sc); padding: 5px; }
.a-rail .d { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: calc(50 * var(--u)); padding: 3px 0; border-radius: 12px; font: 700 12px/1.15 var(--font-body); color: var(--sl); }
.a-rail .d i { font-style: normal; }
.a-rail .d b { font: 550 calc(18 * var(--u))/1.1 var(--font-display); color: var(--ink); letter-spacing: -.03em; }
.a-rail .d .i { width: 13px; height: 13px; stroke-width: 2.2; color: var(--ink2); }
.a-rail .d .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ink2); margin: 4px 0; }
.a-rail .is-today { background: linear-gradient(180deg, var(--g1), var(--g2)); color: #D9DDE3; box-shadow: inset 0 1px 0 #ffffff26, 0 12px 22px -14px #1d2128; }
.a-rail .is-today b, .a-rail .is-today .i { color: #fff; }
.a-rail .is-past b, .a-rail .is-past .i { color: var(--sl); }

/* the day's session card content (.td-hero parts: time, where, title, specs) */
.a-hero-top { margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0; }
.a-time { display: inline-flex; align-items: center; min-height: calc(26 * var(--u)); padding: 0 calc(9 * var(--u)); border-radius: 999px; background: var(--g2); color: #fff;
  font: 600 max(12.5px, calc(14 * var(--u)))/1 var(--font-display); font-variant-numeric: tabular-nums; }
.a-time--light { background: var(--iv); color: var(--ink); }
.a-hero-t { margin: 0; font: 550 calc(28 * var(--u))/1.02 var(--font-display); letter-spacing: -.05em; }
.stage[data-fmt="laptop"] .a-hero-t { font-size: calc(40 * var(--u)); }
.a-specs { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font: 650 max(12px, calc(13 * var(--u)))/1.3 var(--font-body); color: var(--ink2); }
.a-specs span { display: inline-flex; align-items: center; gap: 5px; }
.a-specs .i { width: 15px; height: 15px; color: var(--sl); }

/* the one action language (.btn-start · .btn-record) */
.a-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: max(44px, calc(50 * var(--u))); padding: 5px 5px 5px calc(18 * var(--u));
  border: 0; border-radius: 999px; background: linear-gradient(180deg, var(--g1), var(--g2) 60%, #14171B); color: #fff; text-align: left; cursor: pointer;
  font: 780 max(13px, calc(15 * var(--u)))/1.2 var(--font-body); letter-spacing: -.005em;
  box-shadow: inset 0 1px 0 #ffffff2e, 0 1px 1px #0000001f, 0 14px 26px -14px #1d2128b0; transition: transform .18s cubic-bezier(.2,.8,.2,1); }
.a-btn:active { transform: translateY(1px) scale(.995); }
.a-btn:focus-visible, .a-out:focus-visible, .a-back:focus-visible, .a-rows button:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.a-chip { display: grid; place-items: center; width: max(34px, calc(38 * var(--u))); height: max(34px, calc(38 * var(--u))); border-radius: 50%; flex-shrink: 0;
  background: var(--accv); color: #fff; box-shadow: inset 0 1px 0 #ffffff55, 0 0 0 4px color-mix(in srgb, var(--accv) 22%, transparent); }
.a-chip .i { width: 18px; height: 18px; stroke-width: 2.1; }
.a-btn--light { background: linear-gradient(180deg, #fff, var(--st)); color: var(--ink); box-shadow: inset 0 -1px 0 #0000001a, 0 16px 30px -16px #000; }
.a-btn--light .a-chip { background: var(--g2); color: var(--accd); box-shadow: none; }
.a-btn[aria-pressed="true"] { background: var(--iv); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ln2); }
.a-btn[aria-pressed="true"] .a-chip { background: var(--g2); color: #fff; box-shadow: none; }
.a-out { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--iv);
  box-shadow: inset 0 0 0 1.5px var(--sl); color: var(--ink); font: 700 max(12.5px, calc(13.5 * var(--u)))/1.1 var(--font-body); cursor: pointer; white-space: nowrap; flex: 0 0 auto; }
.a-out .i { width: 16px; height: 16px; }
.a-out::after { content: ''; position: absolute; inset: -4px -2px; }
.a-back::after { content: ''; position: absolute; inset: -5px -2px; } /* 34 px pill, 44 px target */
.a-back { position: relative; display: inline-flex; align-items: center; gap: 2px; min-height: 34px; padding: 0 12px 0 6px; border: 0; border-radius: 999px; background: var(--iv); box-shadow: var(--sc);
  font: 750 13px/1 var(--font-body); color: var(--ink); cursor: pointer; flex: 0 0 auto; }
.a-back .i { width: 18px; height: 18px; }
.a-back-row { margin: 0; display: flex; align-items: center; gap: 10px; min-width: 0; font: 700 max(12px, calc(13 * var(--u)))/1.2 var(--font-body); color: var(--sl); }
.a-back-row > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the day in time order (.td-row / .td-node): rows on plaster, a 2 px rail behind the nodes */
.a-rows { list-style: none; margin: 0; padding: 0; display: grid; position: relative; --tw: calc(42 * var(--u)); --nw: calc(40 * var(--u)); }
.a-rows::before { content: ''; position: absolute; left: calc(var(--tw) + 10px + var(--nw) / 2 - 1px); top: 10px; bottom: 10px; width: 2px; background: var(--ln); }
.a-rows button, .a-row { position: relative; display: grid; grid-template-columns: var(--tw) var(--nw) minmax(0, 1fr) auto; column-gap: 10px; align-items: center; width: 100%;
  min-height: max(44px, calc(52 * var(--u))); padding: 2px 0; border: 0; background: none; text-align: left; color: inherit; font: inherit; border-radius: 14px; }
.a-rows button { cursor: pointer; }
.a-rows button:hover .a-node { box-shadow: 0 0 0 2px var(--accv), var(--sc); }
.a-t { font: 550 max(12.5px, calc(14 * var(--u)))/1.1 var(--font-display); color: var(--ink2); font-variant-numeric: tabular-nums; }
.a-node { position: relative; z-index: 1; width: var(--nw, calc(40 * var(--u))); height: var(--nw, calc(40 * var(--u))); display: grid; place-items: center; background: var(--iv); border-radius: calc(12 * var(--u)); box-shadow: var(--sc); color: var(--ink2); }
.a-node .i { width: 18px; height: 18px; }
.a-txt { display: flex; flex-direction: column; min-width: 0; }
.a-txt b { font: 700 max(13px, calc(15 * var(--u)))/1.25 var(--font-body); overflow-wrap: break-word; }
.a-txt small { font: 650 max(12px, calc(12.5 * var(--u)))/1.3 var(--font-body); color: var(--sl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-rows--plain::before { display: none; }
.a-rows--plain .a-row { grid-template-columns: var(--tw) var(--nw) minmax(0, 1fr); }
.a-rows--plain .a-row:not(:has(.a-t)) { grid-template-columns: var(--nw) minmax(0, 1fr) auto; }
.a-rows--plain li + li { border-top: 1px solid #0000000d; }

/* cards (.x-card) */
.a-card { list-style: none; margin: 0; background: var(--iv); border-radius: calc(20 * var(--u)); box-shadow: var(--sc); padding: calc(13 * var(--u)) calc(15 * var(--u)); display: flex; flex-direction: column; gap: calc(6 * var(--u)); min-width: 0; }
.a-cue { margin: 0; display: flex; gap: 8px; align-items: flex-start; font: 650 max(12px, calc(13 * var(--u)))/1.35 var(--font-body); color: var(--ink2); }
.a-cue .i { width: 16px; height: 16px; color: var(--sl); margin-top: 1px; }

/* the dark session card (Train → Sessions, .session-card) */
.a-session { background: var(--dark); color: #fff; border-radius: calc(24 * var(--u)); padding: calc(15 * var(--u)) calc(16 * var(--u)); display: flex; flex-direction: column; gap: calc(7 * var(--u));
  box-shadow: inset 0 1px 0 #ffffff1c, 0 20px 44px -24px #000000a0; }
.stage[data-fmt="laptop"] .a-session { border-radius: calc(28 * var(--u)); padding: calc(20 * var(--u)); }
.a-where { display: inline-flex; align-items: center; gap: 5px; font: 700 max(12px, calc(13 * var(--u)))/1 var(--font-body); color: var(--od2); }
.a-where .i { width: 15px; height: 15px; }
.a-session .a-specs, .a-session .a-specs .i { color: var(--od2); }
.a-session .a-btn { margin-top: calc(4 * var(--u)); }

/* Eat: the meal-prep card (.meal-card.is-next) */
.a-upnext { margin: 0; display: flex; align-items: center; gap: 7px; font: 700 max(12px, calc(13 * var(--u)))/1.2 var(--font-body); color: var(--acc); }
.a-upnext i { width: 7px; height: 7px; border-radius: 50%; background: var(--accv); }
.a-meal { background: var(--iv); border-radius: calc(22 * var(--u)); box-shadow: 0 0 0 1.5px var(--ink), var(--sc); padding: calc(13 * var(--u)); display: flex; flex-direction: column; gap: calc(9 * var(--u)); }
.a-meal-row { display: flex; gap: 12px; align-items: center; min-width: 0; }
.a-meal-vis { flex: 0 0 auto; width: calc(64 * var(--u)); height: calc(64 * var(--u)); border-radius: calc(16 * var(--u)); display: grid; place-items: center; background: linear-gradient(160deg, var(--pl), var(--st)); color: var(--sl); }
.a-meal-vis .i { width: calc(30 * var(--u)); height: calc(30 * var(--u)); stroke-width: 1.4; }
.a-meal-t { font: 550 calc(21 * var(--u))/1.08 var(--font-display) !important; letter-spacing: -.035em; }
.a-meal .a-txt small { white-space: normal; }
.stage[data-fmt="laptop"] .a-meal-vis { width: calc(96 * var(--u)); height: calc(96 * var(--u)); }
.stage[data-fmt="laptop"] .a-meal-t { font-size: calc(26 * var(--u)) !important; }

/* Progress: facts strip (.facts), standing, the skill track (.home-step hexes, light) */
.a-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--iv); border-radius: calc(18 * var(--u)); box-shadow: var(--sc); padding: calc(9 * var(--u)) 4px; }
.a-facts > div { padding: 2px calc(10 * var(--u)); min-width: 0; }
.a-facts > div + div { border-left: 1px solid var(--ln); }
.a-facts b { display: block; font: 600 calc(22 * var(--u))/1.15 var(--font-display); letter-spacing: -.04em; white-space: nowrap; }
.a-facts b small { font-size: max(12px, .6em); color: var(--sl); letter-spacing: 0; }
.a-facts span { display: block; font: 650 max(12px, calc(12 * var(--u)))/1.3 var(--font-body); color: var(--sl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-standcard { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: calc(8 * var(--u)) 12px; }
.a-standcard .a-txt { gap: 2px; }
.a-standcard .a-out { grid-column: 1 / -1; justify-self: start; }
.a-st { font: 600 calc(20 * var(--u))/1.1 var(--font-display) !important; letter-spacing: -.03em; }
.a-standcard small { white-space: normal; }
.a-skill-h { display: flex; gap: 10px; align-items: center; min-width: 0; }
.a-track { list-style: none; margin: calc(2 * var(--u)) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.a-track li { display: grid; justify-items: center; gap: 4px; text-align: center; font: 650 12px/1.2 var(--font-body); color: var(--sl); }
.hx { width: calc(30 * var(--u)); height: calc(33 * var(--u)); display: grid; place-items: center; position: relative; clip-path: polygon(50% 0, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%); background: var(--ln2); }
.hx::before { content: ''; position: absolute; inset: 2px; clip-path: inherit; background: var(--pl); }
.hx span { position: relative; font: 600 max(12px, calc(13 * var(--u)))/1 var(--font-display); color: var(--sl); }
.a-track .is-next { color: var(--ink); }
.a-track .is-next .hx { background: var(--ink2); }
.a-track .is-next .hx::before { background: var(--iv); }
.a-track .is-next .hx span { color: var(--ink); }

/* ------------------------------------------------------------------ the earned moment (.fx-earned: rank shift, static rays, 0.7 s token settle, Before / Award / After) */
.earned { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 14px; background: #14171BFA; color: #fff; overflow: hidden; opacity: 0; transition: opacity .25s; }
.earned.is-in { opacity: 1; }
.earned[hidden] { display: none; }
.e-rays { position: absolute; inset: -20%; pointer-events: none; background: repeating-conic-gradient(from 0deg at 50% 40%, #ffffff10 0deg 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle at 50% 40%, #000 0 22%, transparent 62%); mask: radial-gradient(circle at 50% 40%, #000 0 22%, transparent 62%); }
.e-in { position: relative; display: grid; justify-items: center; gap: calc(8 * var(--u)); text-align: center; width: 100%; max-width: 400px; }
.earned.is-in .e-tok { animation: eSettle .7s cubic-bezier(.2,.8,.2,1) both; }
@keyframes eSettle { from { transform: translateY(-18px) scale(1.12); opacity: 0; } to { transform: none; opacity: 1; } }
.e-kick { margin: calc(4 * var(--u)) 0 0; font: 800 max(12px, calc(12 * var(--u)))/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--accd); }
.e-h { margin: 0; font: 550 calc(34 * var(--u))/1 var(--font-display); letter-spacing: -.04em; color: #fff; outline-offset: 6px; border-radius: 6px; }
.e-h:focus-visible { outline-color: var(--accd); }
.e-ledger { margin: calc(2 * var(--u)) 0 0; width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.e-ledger div { padding: calc(8 * var(--u)) 4px; border-radius: 14px; background: #22262D; min-width: 0; }
.e-ledger dt { font: 650 12px/1.2 var(--font-body); color: var(--od2); }
.e-ledger dd { margin: 3px 0 0; font: 600 calc(19 * var(--u))/1.1 var(--font-display); letter-spacing: -.02em; color: #fff; white-space: nowrap; }
.e-rows { margin: 0; font: 650 max(12px, calc(13.5 * var(--u)))/1.3 var(--font-body); color: #E3E6EB; }
.e-rank { margin: 0; display: flex; align-items: center; gap: 8px; font: 650 max(12px, calc(12.5 * var(--u)))/1.3 var(--font-body); color: var(--od2); text-align: left; }
.e-go { width: auto; min-width: 190px; margin-top: calc(4 * var(--u)); }
.e-label { margin: 0; font: 650 12px/1.2 var(--font-body); color: #ffffff8a; }

/* ------------------------------------------------------------------ Back / Next on the paper */
.p-foot { grid-area: foot; display: flex; align-items: center; gap: 10px; padding: 7px 10px calc(7px + var(--safe-b, 0px)); }
.p-back { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%; border: 1.5px solid var(--line-strong); background: none; font: 600 22px/1 var(--font-body); color: var(--graphite); cursor: pointer; position: relative; }
.p-back::after, .p-next::after { content: ''; position: absolute; inset: -2px; }
.p-next { position: relative; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--graphite); color: var(--ivory); font: 750 14.5px/1 var(--font-body); cursor: pointer; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.p-next.is-last { background: #111318; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accv) 40%, transparent), 0 10px 24px -10px var(--accv); }
.stage[data-fmt="laptop"] .p-foot { padding: 9px 16px 10px; }

/* the smallest phones (paper under 630 px tall, e.g. 360 × 640): drop secondary lines rather than shrink the type further */
@container (max-height: 630px) {
  .stage[data-fmt="phone"] .scr-prog .a-kick, .stage[data-fmt="phone"] .a-standcard small { display: none; }
}

/* reduced motion and no-JS */
html[data-motion="reduced"] .p-track, html[data-motion="reduced"] .say, html[data-motion="reduced"] .earned { transition: none !important; }
html[data-motion="reduced"] .e-tok { animation: none !important; }
.no-js .app { display: block; background: none; box-shadow: none; margin: 0; }
.no-js .p-top, .no-js .p-say { display: block; }
.no-js .say { opacity: 1; visibility: visible; margin: 12px 0; }
.no-js .a-sprite + .paper .say { position: static; }
.no-js .paper { container-type: normal; height: auto; overflow: visible; }
.no-js .a-btn, .no-js .a-out, .no-js .a-back, .no-js #pReceipt { display: none; }

/* the sample label: on the paper's top bar on laptop, in the app's top bar on phone (on phone it takes the avatar's place; the rank
   keeps its token, named "Rank E" for screen readers) */
.a-sample { display: none; }
.stage[data-fmt="phone"] .a-sample { display: block; flex: 0 0 auto; max-width: 8.4em; margin: 0; font: 700 12px/1.2 var(--font-body); color: var(--ink2);
  border: 1px dashed var(--ln2); border-radius: 6px; padding: 2px 6px; text-align: center; }
.stage[data-fmt="phone"] .a-stand--top > b { display: none; }
.stage[data-fmt="phone"] .a-stand--top { padding: 2px 5px; }
.stage[data-fmt="phone"] .a-day small { white-space: normal; }
/* a screen that cannot fit even at the smallest type (browser zoom) scrolls instead of clipping; it can take focus, and shows it */
.p-step.is-over { overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y pinch-zoom; }
.p-step.is-over:focus-visible { outline: 3px solid var(--acc); outline-offset: -3px; }
.p-step.is-over .a-txt small, .p-step.is-over .a-facts span, .p-step.is-over .a-back-row > span, .p-step.is-over .a-wk small, .p-step.is-over .a-wk b { white-space: normal; overflow: visible; }
/* while the earned moment is open, everything outside it is inert and dimmed */
.paper.is-modal .p-top, .paper.is-modal .p-foot { opacity: .35; transition: opacity .25s; }
/* the earned moment on a short paper (a phone on its side, 200 % zoom): drop the big token, keep the sample label, and let the rest
   scroll inside the dialog so Continue is always reachable */
.e-in { max-height: 100%; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y pinch-zoom; }
.e-label { color: #E3E6EB; }
@container (max-height: 470px) {
  .e-tok { display: none; }
  .e-h { font-size: max(20px, calc(26 * var(--u))); }
  .earned { padding: 8px 14px; }
}
/* "The beta" keeps its look but gets a 44 px target */
.p-skip::after { content: ''; position: absolute; inset: -6px -4px; }

/* ------------------------------------------------------------------ Train · the week rail's done mark (the app's Train · Week, 14-train.css) */
.a-rail--train .is-done .i { color: var(--acc); stroke-width: 2.6; }

/* ------------------------------------------------------------------ Train · the session player (the app's Session Focus, 11-focus.css: dark arena) */
.ps-focus { flex: 1 1 auto; background: var(--g3); color: #E6E8EC; border-radius: calc(22 * var(--u)); padding: calc(6 * var(--u)) calc(12 * var(--u)) calc(14 * var(--u)); gap: calc(8 * var(--u)); }
.stage[data-fmt="laptop"] .ps-focus { padding: calc(8 * var(--u)) calc(20 * var(--u)) calc(18 * var(--u)); }
.fx-top { display: flex; align-items: center; gap: 6px; min-height: 44px; width: 100%; }
.fx-x { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: #E6E8EC; cursor: pointer; }
.fx-x:hover { background: #ffffff14; }
.fx-x .i { width: 22px; height: 22px; stroke-width: 2.2; }
.fx-ttl { flex: 1 1 0; min-width: 0; margin: 0; font: 750 max(13px, calc(14 * var(--u)))/1.15 var(--font-body); }
.fx-el { font: 600 max(14px, calc(16 * var(--u)))/1 var(--font-display); font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; padding: 0 4px; }
/* on the app's dark surfaces (the session card, the player, the earned moment) the ring is the companion's light accent */
.a-session :focus-visible, .earned :focus-visible, .ps-focus :focus-visible { outline-color: var(--accd); }
.fx-x:focus-visible, .fx-chip:focus-visible, .fx-skip:focus-visible { outline: 3px solid var(--accd); outline-offset: 2px; }
/* the working set: kicker, name, the plate (reps, load) */
.fx-work { display: flex; flex-direction: column; gap: calc(10 * var(--u)); }
.fx-head { display: grid; gap: 4px; }
.fx-kick { margin: 0; font: 800 max(12px, calc(12 * var(--u)))/1.2 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: #A9AFB9; }
.fx-name { margin: 0; font: 550 calc(28 * var(--u))/1.04 var(--font-display); letter-spacing: -.045em; color: #fff; text-wrap: balance; }
.stage[data-fmt="laptop"] .fx-name { font-size: calc(38 * var(--u)); }
.fx-plate { border-radius: calc(20 * var(--u)); padding: calc(12 * var(--u)) calc(15 * var(--u)); background: linear-gradient(180deg, #2A2F37, #22262D); box-shadow: 0 18px 34px -22px #000, inset 0 1px 0 #ffffff12; }
.fx-phead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.fx-phead > span:first-child { font: 800 12px/1.2 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: #A9AFB9; }
.fx-set { font: 600 13px/1 var(--font-body); color: #C6CBD3; white-space: nowrap; }
.fx-set b { font: 600 calc(24 * var(--u))/1 var(--font-display); color: #fff; margin-left: 4px; font-variant-numeric: tabular-nums; }
.fx-set small { font: 500 max(13px, calc(16 * var(--u)))/1 var(--font-display); color: #A9AFB9; }
.fx-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: calc(8 * var(--u)); }
.fx-nums > div { border-top: 1px solid #ffffff1f; padding-top: calc(7 * var(--u)); min-width: 0; }
.fx-nums b { display: block; font: 600 calc(30 * var(--u))/1.08 var(--font-display); letter-spacing: -.03em; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fx-nums small { display: block; margin-top: 3px; font: 650 12px/1.2 var(--font-body); color: #C6CBD3; }
/* the console: quick reps chips (10 px apart, so the 3 px ring keeps the dark arena on both sides) and the one action */
.fx-con { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fx-chips { display: flex; gap: 10px; flex: 0 0 auto; }
.fx-chip { min-width: 46px; min-height: 48px; padding: 0 10px; border: 0; border-radius: 14px; background: #FBFAF7; color: var(--ink); box-shadow: inset 0 0 0 1.5px #D6D1C7;
  font: 600 16px/1 var(--font-display); font-variant-numeric: tabular-nums; cursor: pointer; }
.fx-chip[aria-pressed="true"] { background: var(--g2); color: #fff; box-shadow: inset 0 0 0 1.5px #59616D, 0 0 0 3px color-mix(in srgb, var(--accv) 30%, transparent); }
/* rest between sets: receipt, ring, next */
.fx-rec { margin: 0; display: inline-flex; align-items: center; gap: 6px; font: 700 13px/1.2 var(--font-body); color: #E6E8EC; }
.fx-rec .i { width: 16px; height: 16px; color: var(--accd); stroke-width: 2.6; }
.fx-ring { width: calc(150 * var(--u)); height: calc(150 * var(--u)); border-radius: 50%; display: grid; place-content: center; justify-items: center;
  background: radial-gradient(closest-side, #1D2128 82%, transparent 83%), conic-gradient(var(--accv) calc(var(--left, 1) * 360deg), #3D434D 0); }
.fx-ring b { font: 600 calc(36 * var(--u))/1 var(--font-display); color: #fff; font-variant-numeric: tabular-nums; }
.fx-ring small { font: 650 12px/1.2 var(--font-body); color: #C6CBD3; margin-top: 4px; }
.fx-nextline { margin: 0; font: 650 max(12px, calc(13 * var(--u)))/1.35 var(--font-body); color: #C6CBD3; }
.fx-skip { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid #ffffff59; background: none; color: #fff; font: 700 14px/1 var(--font-body); cursor: pointer; }
/* no JavaScript: the player reads as a static sample */
.no-js .ps-focus { margin-top: 12px; }
.no-js .fx-x, .no-js .fx-con { display: none; }

/* ------------------------------------------------------------------ the app's tab bar on phone (01-base.css .mobile-nav: 5 tabs, 54 px, 12 px labels, 22 px icons) */
.stage[data-fmt="phone"] .p-tabs button { min-height: 54px; gap: 3px; font-size: 12px; }
.stage[data-fmt="phone"] .p-tabs button .i { width: 22px; height: 22px; }
.stage[data-fmt="phone"] .a-divider { display: none; }
.stage[data-fmt="laptop"] .a-divider { display: block; height: 1px; margin: 6px 12px; background: var(--ln); }
.stage[data-fmt="phone"] .a-top { gap: 6px; }
.stage[data-fmt="phone"] .a-top .a-avatar { width: 30px; height: 30px; font-size: 13px; }
/* at 200 % zoom the laptop sidebar is taller than the paper: it scrolls itself; the app box clips (never scrolls), so focusing a tab
   can't push the screen or the earned dialog out of view */
.app { overflow: clip; }
.stage[data-fmt="laptop"] .p-tabs { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }

/* the week's sessions and their state (Sessions, laptop) */
.a-wk { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.a-wk li { display: grid; grid-template-columns: 36px minmax(0, auto) minmax(0, 1fr); align-items: baseline; column-gap: 8px; padding: calc(4 * var(--u)) 0; }
.a-wk li + li { border-top: 1px solid #0000000d; }
.a-wk span { font: 700 12px/1.2 var(--font-body); color: var(--sl); }
.a-wk b { font: 700 max(12px, calc(13.5 * var(--u)))/1.25 var(--font-body); white-space: nowrap; }
.a-wk small { font: 650 12px/1.25 var(--font-body); color: var(--sl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-wk li.is-done b { color: var(--ink2); }
.a-wk li.is-now span, .a-wk li.is-now b { color: var(--acc); }

/* ------------------------------------------------------------------ the guide's role ("Lumi · your AI companion · sample") */
.say .say-who { margin: 0 0 1px; font: 800 12px/1.25 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--acc); } /* outranks .say p's size */
/* laptop: the role sits on the heading's line, so the guide bar keeps its height */
.stage[data-fmt="laptop"] .say > div { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
.stage[data-fmt="laptop"] .say > div > p:not(.say-who) { flex-basis: 100%; }
.stage[data-fmt="laptop"] .say .say-who { margin: 0; }
.say-face { flex: 0 0 auto; display: grid; justify-items: center; gap: 2px; }
.stage[data-fmt="phone"] .say-face .face { width: 22px; height: 22px; }
.stage[data-fmt="phone"] .say-face .face::before, .stage[data-fmt="phone"] .say-face .face::after { width: 4px; height: 6px; }

/* ------------------------------------------------------------------ the compact landscape paper (a laptop-format paper under 500 px tall: phones
   held sideways, very short windows, 200 % zoom). The paper fills the screen (js/stage.js) and the sidebar becomes the app's icon
   rail; the screens' own compact layouts are in css/demo.css. */
@container (max-height: 500px) {
  .stage[data-fmt="laptop"] .app { margin: 0 6px; grid-template-columns: 52px minmax(0, 1fr); border-radius: 14px; }
  .stage[data-fmt="laptop"] .p-tabs { padding: 4px; gap: 2px; align-items: center; overflow-y: auto; }
  .stage[data-fmt="laptop"] .p-tabs .a-brand, .stage[data-fmt="laptop"] .a-foot { display: none; }
  .stage[data-fmt="laptop"] .p-tabs button { width: 44px; min-height: 44px; padding: 0; justify-content: center; flex: 0 0 auto; }
  .stage[data-fmt="laptop"] .p-tabs button > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .stage[data-fmt="laptop"] .p-tabs button[aria-current]::before { left: -4px; }
  /* Today, Train, Eat, Progress and More (Wallet and Enhance, coming soon), as on phone */
  .stage[data-fmt="laptop"] .p-tabs .a-lap { display: none !important; }
  .stage[data-fmt="laptop"] .p-tabs .a-ph { display: flex !important; }
  .stage[data-fmt="laptop"] .a-divider { display: none; }
  .stage[data-fmt="laptop"] .p-step { padding: 4px 10px 6px 4px; }
  .stage[data-fmt="laptop"] .a-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 14px; align-items: start; }
  .stage[data-fmt="laptop"] .scr > .a-seg { display: none; } /* decorative segments: the screen's own title carries the place */
  .stage[data-fmt="laptop"] .face { display: block; }
}
.stage[data-short="1"] .tb-note { display: none; } /* the temporary tabletop note would sit on the paper's footer */
