/* Misclo homepage v2 · section 2, the demo on the paper (redesign-v2/STORYBOARD.md §2). Builds on css/app.css:
   sizes scale with --u (the paper's size × the fit factor), colours come from the paper's accent slots (--acc text and rings on
   light, --accv graphic, --accs soft fill, --accd on dark), which data-companion on #paper fills with Theo's cobalt set or
   Lumi's coral set. State attributes (data-beat on #paper; data-acc, data-dock, data-mini, data-propin, data-sat, data-by,
   data-kept on .d-today) are set by js/demo.js. Hidden states are scoped to .js, so without JavaScript everything reads. */

/* ------------------------------------------------------------------ focus: the companion's ring on the paper (3:1 or more in both themes) */
.paper :focus-visible { outline-color: var(--acc); }
.paper .ps-focus :focus-visible, .paper .a-session :focus-visible, .paper .d-next :focus-visible { outline-color: var(--accd); }

/* ------------------------------------------------------------------ the screens: the current one slides in, the last one fades */
.js .p-step:not(.is-on) { visibility: hidden; opacity: 0; transition: opacity .18s linear, visibility 0s linear .18s; }
.js .p-step.is-on { z-index: 1; animation: dScrIn .42s var(--ease-out) both; }
.paper { --dx: 1; }
.paper[data-dir="back"] { --dx: -1; }
@keyframes dScrIn { from { opacity: 0; transform: translateX(calc(var(--dx) * 22px)); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ the paper's top bar: the companion's line and the switch */
.say-who .d-who-l { white-space: nowrap; }
.paper .say h2:focus-visible { outline-offset: 2px; border-radius: 4px; }
.stage[data-fmt="laptop"] .say > div { row-gap: 5px; }
/* a narrower laptop paper (about 1366 px windows): the role, the line and the sentence stack, one line each, so the bar keeps one height from beat to beat */
@container (max-width: 1260px) {
  .stage[data-fmt="laptop"] .say > div { display: grid; row-gap: 1px; align-content: center; }
  .stage[data-fmt="laptop"] .say > div > * { min-width: 0; }
  .stage[data-fmt="laptop"] .say h2, .stage[data-fmt="laptop"] .say p { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.d-cswitch { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: #E3E0D9; }
.d-cs-lbl { padding: 0 4px 0 8px; font: 750 12px/1 var(--font-body); color: var(--sl); }
.d-cswitch button { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 11px 0 4px; border: 0; border-radius: 999px;
  background: none; font: 750 13px/1 var(--font-body); color: var(--ink2); cursor: pointer; }
.d-cswitch button::after { content: ''; position: absolute; inset: -6px -1px; }
.d-cswitch button:hover { color: var(--ink); }
.d-cswitch button[aria-pressed="true"] { background: var(--iv); color: var(--ink); box-shadow: var(--sc); }
.stage .d-cswitch .face { width: 24px; height: 24px; }
.stage .d-cswitch .face::before, .stage .d-cswitch .face::after { width: 4px; height: 6px; }
.d-cswitch button:focus-visible { outline: 3px solid var(--acc); outline-offset: 1px; }
.js .paper[data-beat="C"] .d-cswitch { display: none; } /* the choice screen is the switch */
/* phone: the switch carries the companion's face; the inactive one shows its face only (its name stays for screen readers) */
.stage[data-fmt="phone"] .say-face, .stage[data-fmt="phone"] .d-cs-lbl, .stage[data-fmt="phone"] .say-who .d-who-l { display: none; }
.stage[data-fmt="phone"] .d-cswitch button { min-height: 32px; padding: 0 9px 0 3px; gap: 5px; font-size: 12.5px; }
.stage[data-fmt="phone"] .d-cswitch button[aria-pressed="false"] { min-width: 44px; justify-content: center; padding: 0 3px; }
.stage[data-fmt="phone"] .d-cswitch button[aria-pressed="false"] .d-cs-n { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.stage[data-fmt="phone"] .d-cswitch .face { width: 22px; height: 22px; }
.stage[data-fmt="phone"] .p-skip { padding: 0 10px; }

/* ------------------------------------------------------------------ the footer: Back · Play / Pause · four chapter chips · Next */
.p-foot .p-back:focus-visible, .p-foot .p-next:focus-visible, .p-top button:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.d-play { position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 15px 0 12px;
  border-radius: 999px; border: 1.5px solid var(--line-strong); background: none; color: var(--graphite); font: 750 13.5px/1 var(--font-body); cursor: pointer; white-space: nowrap; }
.d-play .i { width: 15px; height: 15px; fill: currentColor; stroke-width: 2.6; }
.d-play.is-playing .i { fill: none; }
.d-play:hover { background: #0000000a; }
.d-play.is-playing { background: var(--graphite); border-color: var(--graphite); color: var(--ivory); }
.d-play:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.d-chaps { flex: 1 1 auto; min-width: 0; display: flex; gap: 4px; }
.d-chaps button { flex: 1 1 0; min-width: 44px; display: flex; flex-direction: column; justify-content: center; gap: 5px; min-height: 44px; padding: 2px 4px;
  border: 0; border-radius: 10px; background: none; color: var(--sl); font: 750 12px/1 var(--font-body); letter-spacing: -.01em; text-align: left; cursor: pointer; }
.d-chaps button > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-chaps i { display: block; height: 4px; border-radius: 99px; background: #00000021; overflow: hidden; }
.d-chaps b { display: block; height: 100%; width: calc(var(--f, 0) * 100%); border-radius: inherit; background: var(--acc); }
.d-chaps button[aria-current] { color: var(--ink); }
.d-chaps button:hover { background: #0000000a; color: var(--ink); }
.d-chaps button:focus-visible { outline: 3px solid var(--acc); outline-offset: 1px; }
.d-where { margin: 0 auto 0 2px; min-width: 0; font: 700 12.5px/1.2 var(--font-body); color: var(--sl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage[data-fmt="laptop"] .d-chaps { flex: 0 1 460px; }
.stage[data-fmt="laptop"] .d-chaps button { padding-inline: 8px; font-size: 13px; }
.p-foot .p-back { width: 44px; height: 44px; }
.p-foot .p-next { min-height: 44px; }
.stage[data-fmt="phone"] .p-foot { gap: 4px; padding-inline: 6px; }
.stage[data-fmt="phone"] .d-play { width: 44px; padding: 0; }
.stage[data-fmt="phone"] .d-play span, .stage[data-fmt="phone"] .d-where { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.stage[data-fmt="phone"] .d-chaps { gap: 0; }
.stage[data-fmt="phone"] .d-chaps button { padding-inline: 3px; }
.stage[data-fmt="phone"] .p-next { padding: 0 13px; gap: 0; }
.stage[data-fmt="phone"] .p-next > span { display: none; } /* "Next" alone, so the four chapters keep 44 px each at 375 px */

/* the app's sidebar: More holds Wallet and Enhance, marked "Soon" */
.d-soon { display: inline-flex; align-items: center; flex: 0 0 auto; margin: 0; padding: 3px 7px; border: 1px dashed var(--line-strong); border-radius: 6px;
  font: 800 12px/1.1 var(--font-body); font-style: normal; letter-spacing: .01em; color: var(--sl); white-space: nowrap; }
.d-soon--nav { margin-left: auto; padding: 1px 5px; }
@container (min-height: 500.5px) { .stage[data-fmt="laptop"] .app { grid-template-columns: clamp(176px, 16.5cqw, 220px) minmax(0, 1fr); } }
.stage[data-fmt="laptop"] .p-tabs button.a-lap { gap: 8px; padding-inline: 10px; }
.a-sec .d-soon, .a-kick .d-soon { margin-left: 6px; text-transform: none; letter-spacing: 0; vertical-align: 1px; }

/* ------------------------------------------------------------------ 0 · the companion choice */
.d-choose { height: 100%; justify-content: center; gap: calc(14 * var(--u)); width: 100%; max-width: calc(780 * var(--u)); margin: 0 auto; }
.d-pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: calc(14 * var(--u)); }
.d-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "port port" "tx go"; align-items: center; gap: calc(12 * var(--u)) 10px;
  padding: calc(12 * var(--u)) calc(12 * var(--u)) calc(14 * var(--u)); border: 0; border-radius: calc(26 * var(--u)); background: var(--iv); box-shadow: var(--sc);
  color: var(--ink); text-align: left; cursor: pointer; transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.d-card:hover { transform: translateY(-2px); box-shadow: var(--sculpt-raised); }
.d-card--theo { --cc: #1C48B9; --cv: #3E6BEF; --cs: #E2E8FA; }
.d-card--lumi { --cc: #A8363F; --cv: #ED7073; --cs: #FBE5E3; }
.d-card:focus-visible { outline: 3px solid var(--cc); outline-offset: 3px; }
.d-card.is-chosen { box-shadow: 0 0 0 2.5px var(--cv), var(--sc); }
.d-port { grid-area: port; display: grid; place-items: center; height: calc(164 * var(--u)); border-radius: calc(18 * var(--u));
  background: radial-gradient(70% 80% at 50% 38%, #fff 0%, var(--cs) 58%, color-mix(in srgb, var(--cs) 70%, var(--cv)) 130%); }
.stage .d-port .face { width: calc(104 * var(--u)); height: calc(104 * var(--u)); box-shadow: 0 0 0 calc(4 * var(--u)) var(--cv), 0 18px 34px -14px color-mix(in srgb, var(--cv) 70%, #000); }
.stage .d-port .face::before, .stage .d-port .face::after, .stage .d-mface .face::before, .stage .d-mface .face::after, .stage .d-media .face::before, .stage .d-media .face::after { width: 13%; height: 19%; }
.d-card-tx { grid-area: tx; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.d-card-t { font: 600 calc(23 * var(--u))/1.08 var(--font-display); letter-spacing: -.035em; }
.d-card-l { font: 650 max(12.5px, calc(14 * var(--u)))/1.35 var(--font-body); color: var(--ink2); }
.d-card-go { grid-area: go; display: grid; place-items: center; width: max(36px, calc(42 * var(--u))); height: max(36px, calc(42 * var(--u))); border-radius: 50%; background: var(--cs); color: var(--cc); }
.d-card-go .i { width: 20px; height: 20px; stroke-width: 2.1; }
.stage[data-fmt="phone"] .d-pick { grid-template-columns: minmax(0, 1fr); gap: calc(10 * var(--u)); }
.stage[data-fmt="phone"] .d-card { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "port tx go"; padding: calc(10 * var(--u)); }
.stage[data-fmt="phone"] .d-port { width: calc(84 * var(--u)); height: calc(84 * var(--u)); }
.stage[data-fmt="phone"] .d-port .face { width: calc(58 * var(--u)); height: calc(58 * var(--u)); box-shadow: 0 0 0 3px var(--cv); }
.stage[data-fmt="phone"] .d-card-t { font-size: calc(20 * var(--u)); }

/* ------------------------------------------------------------------ T1–T4 · Today */
.d-today { height: 100%; }
.d-day { display: flex; flex-direction: column; gap: calc(10 * var(--u)); min-width: 0; }
.stage[data-fmt="laptop"] .d-today, .stage[data-fmt="laptop"] .d-cols { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); gap: calc(12 * var(--u)) calc(22 * var(--u)); align-items: start; }
.stage[data-fmt="laptop"] .d-today { grid-template-rows: minmax(0, 1fr); }
.d-cols { display: flex; flex-direction: column; gap: calc(9 * var(--u)); min-width: 0; }
.d-rows { --tw: calc(54 * var(--u)); }
.d-rows .a-row { grid-template-columns: var(--tw) var(--nw) minmax(0, 1fr) auto; }
.d-rows .a-t { white-space: nowrap; }
.stage[data-fmt="phone"] .d-rows { --tw: calc(50 * var(--u)); --nw: calc(36 * var(--u)); }
.stage[data-fmt="phone"] .d-rows .a-row { column-gap: 8px; }
.stage[data-fmt="phone"] .d-rows .a-t { font-size: 12.5px; }
.stage[data-fmt="phone"] .d-tag { padding: 4px 7px; }
/* before / after your OK, and who confirmed */
.js .d-today:not([data-acc="1"]) .d-a, .js .d-today[data-acc="1"] .d-b { display: none; }
.js .d-today:not([data-by="you"]) .d-by-you, .js .d-today[data-by="you"] .d-by-sample { display: none; }
.js .d-today:not([data-sat="1"]) .d-sat { display: none; }
.js .d-today[data-sat="1"] .d-sat { animation: dGrow .5s var(--ease-out) both; }
.d-okline { margin: 0; display: flex; align-items: center; gap: 6px; font: 750 max(12.5px, calc(13 * var(--u)))/1.3 var(--font-body); color: var(--acc); }
.d-okline .i { width: 16px; height: 16px; stroke-width: 2.4; }
.d-tag { margin: 0; padding: 4px 8px; border-radius: 999px; background: var(--accs); color: var(--acc); font: 800 12px/1 var(--font-body); font-style: normal; white-space: nowrap; }
.d-chg .a-row, .d-sat .a-row { border-radius: 14px; }
.d-sat .a-txt small { white-space: normal; }

/* the companion's corner: laptop, the right column; phone, a sheet that rises over the day */
.d-dock { display: flex; flex-direction: column; gap: calc(10 * var(--u)); min-width: 0; min-height: 0; }
.stage[data-fmt="laptop"] .d-dock { align-self: stretch; }
.js .d-next, .js .d-mini, .js .d-prop, .js .d-chat, .js .d-say { display: none; }
.js .stage[data-fmt="laptop"] .d-today:is([data-dock="idle"], [data-dock="done"]) .d-next { display: block; animation: dIn .4s var(--ease-out) both; }
.js .d-today[data-mini="1"]:not([data-dock="idle"]) .d-mini { display: flex; animation: dPop .46s cubic-bezier(.2, .9, .3, 1.25) both; }
.js .d-today[data-dock="prop"][data-propin="1"] .d-prop { display: flex; animation: dRise .42s var(--ease-out) both; }
.js .d-today[data-dock="done"] .d-prop { display: flex; }
.js .d-today[data-dock="chat"] .d-chat { display: flex; animation: dRise .42s var(--ease-out) both; }
.js .d-today[data-dock="prop"] .d-say--prop, .js .d-today[data-dock="done"] .d-say--done, .js .d-today[data-dock="chat"] .d-say--chat { display: block; }
.js .stage[data-fmt="phone"] .d-dock { display: none; position: absolute; z-index: 3; left: 6px; right: 6px; bottom: 6px; max-height: calc(100% - 12px);
  padding: calc(10 * var(--u)); border-radius: calc(22 * var(--u)); background: var(--st); box-shadow: 0 0 0 1px #0000000f, 0 22px 50px -14px #1d2128a6; }
.js .stage[data-fmt="phone"] .d-today:is([data-dock="prop"], [data-dock="chat"]) .d-dock { display: flex; animation: dSheet .4s var(--ease-out) both; }
.js .stage[data-fmt="phone"] .d-today:is([data-dock="prop"], [data-dock="chat"])::after { content: ''; position: absolute; inset: 0; z-index: 2; background: #ECEAE4b8; animation: dFade .3s linear both; }
.js .stage[data-fmt="phone"] .d-today[data-dock="chat"] .d-mini { display: none; }

/* up next (laptop): the session the day is built around */
.d-next { position: relative; background: var(--dark); color: #fff; border-radius: calc(24 * var(--u)); padding: calc(15 * var(--u)) calc(18 * var(--u)); box-shadow: inset 0 1px 0 #ffffff1c, 0 20px 44px -24px #000000a0; }
.d-next p { margin: 0; }
.d-next-k { display: flex; align-items: center; gap: 7px; font: 800 12px/1.2 var(--font-body); letter-spacing: .07em; text-transform: uppercase; color: var(--od2); }
.d-next-k i { width: 7px; height: 7px; border-radius: 50%; background: var(--accv); }
.d-next-t { margin-top: calc(6 * var(--u)) !important; font: 550 calc(32 * var(--u))/1.04 var(--font-display); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.d-next-s { margin-top: calc(4 * var(--u)) !important; font: 650 max(12.5px, calc(14 * var(--u)))/1.35 var(--font-body); color: var(--od2); }

/* the miniature: the companion's face (placeholder until the B2 busts) and its speech bubble */
.d-mini { align-items: flex-start; gap: calc(10 * var(--u)); }
.d-mface { flex: 0 0 auto; display: grid; place-items: center; width: max(40px, calc(50 * var(--u))); height: max(40px, calc(50 * var(--u))); border-radius: 50%; background: var(--iv); box-shadow: var(--sc); }
.stage .d-mface .face { width: 78%; height: 78%; }
.d-bubble { position: relative; flex: 1 1 auto; min-width: 0; padding: calc(10 * var(--u)) calc(14 * var(--u)); border-radius: calc(18 * var(--u)); border-top-left-radius: 6px; background: var(--iv); box-shadow: var(--sc); }
.d-bubble p { margin: 0; }
.d-bname { font: 800 12px/1.2 var(--font-body); letter-spacing: .05em; text-transform: uppercase; color: var(--acc); }
.d-bname span { letter-spacing: .03em; }
.d-say { margin-top: 3px !important; font: 650 max(13px, calc(15 * var(--u)))/1.38 var(--font-body); color: var(--ink); }

/* the proposed change: Planned → Proposed, what it keeps, Needs your OK, Accept / Keep plan */
.d-prop { position: relative; flex-direction: column; gap: calc(9 * var(--u)); padding: calc(13 * var(--u)) calc(14 * var(--u)); border-radius: calc(20 * var(--u)); background: var(--iv);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accv) 55%, transparent), var(--sc); }
.d-prop p { margin: 0; }
.d-prop-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.d-prop-top b { font: 650 max(14px, calc(16 * var(--u)))/1.2 var(--font-display); letter-spacing: -.015em; }
.d-status > span { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font: 800 12px/1 var(--font-body); white-space: nowrap; }
.d-st-ask { background: var(--accs); color: var(--acc); }
.d-st-kept { background: #E3E0D9; color: var(--ink2); }
.d-st-ok { background: var(--g2); color: #fff; }
.d-swap { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 8px; }
.d-swap > .i { align-self: center; width: 18px; height: 18px; color: var(--sl); }
.d-was, .d-now { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; padding: calc(8 * var(--u)) calc(11 * var(--u)); border-radius: calc(14 * var(--u));
  font: 700 max(13px, calc(14.5 * var(--u)))/1.25 var(--font-body); }
.d-was small, .d-now small { font: 800 12px/1.2 var(--font-body); letter-spacing: .05em; text-transform: uppercase; }
.d-was { background: #0000000b; color: var(--ink2); }
.d-was small { color: var(--sl); }
.d-now { background: var(--accs); color: var(--ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accv) 60%, transparent); }
.d-now small { color: var(--acc); }
.d-keeps { display: flex; align-items: center; gap: 6px; font: 700 max(12.5px, calc(13.5 * var(--u)))/1.3 var(--font-body); color: var(--ink2); }
.d-keeps .i { width: 16px; height: 16px; color: var(--acc); stroke-width: 2.4; }
.d-acts { display: flex; align-items: center; gap: 8px; }
.d-accept { position: relative; flex: 1 1 auto; width: auto; min-width: 0; }
.d-keep { min-height: max(44px, calc(50 * var(--u))); padding: 0 calc(16 * var(--u)); }
.d-kept { font: 700 max(12.5px, calc(13.5 * var(--u)))/1.35 var(--font-body); color: var(--ink2); }
.d-receipt { display: flex; align-items: center; gap: 6px; font: 750 max(12.5px, calc(13 * var(--u)))/1.3 var(--font-body); color: var(--ink2); }
.js .d-receipt, .js .d-kept, .js .d-st-kept, .js .d-st-ok { display: none; }
.js .d-today[data-kept="1"] .d-kept { display: block; }
.js .d-today[data-kept="1"] .d-st-kept { display: inline-flex; }
.js .d-today[data-kept="1"] .d-st-ask { display: none; }
.js .d-today[data-dock="done"] :is(.d-swap, .d-keeps, .d-acts, .d-kept, .d-st-ask, .d-st-kept) { display: none; }
.js .d-today[data-dock="done"] .d-receipt { display: flex; }
.js .d-today[data-dock="done"] .d-st-ok { display: inline-flex; }

/* the scripted conversation */
.d-chat { flex: 1 1 auto; flex-direction: column; gap: calc(8 * var(--u)); min-height: 0; padding: calc(11 * var(--u)) calc(12 * var(--u)); border-radius: calc(20 * var(--u)); background: var(--iv); box-shadow: var(--sc); }
.d-chat-lbl { margin: 0; align-self: flex-start; max-width: 100%; padding: 3px 7px; border: 1px dashed var(--line-strong); border-radius: 6px; font: 750 12px/1.3 var(--font-body); color: var(--sl); }
.d-log { flex: 1 1 0; min-height: calc(64 * var(--u)); overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 7px; padding: 2px 3px; border-radius: 10px; scrollbar-width: thin; }
.d-log:focus-visible { outline: 3px solid var(--acc); outline-offset: 1px; }
.d-log > :first-child { margin-top: auto; } /* the conversation sits on the chips, as in a chat */

.stage[data-fmt="phone"] .d-log { flex: 0 1 auto; }
.d-msg { margin: 0; max-width: 90%; font: 650 max(13px, calc(14 * var(--u)))/1.38 var(--font-body); }
.d-msg p { margin: 0; }
.d-msg--me { align-self: flex-end; padding: calc(7 * var(--u)) calc(12 * var(--u)); border-radius: 16px 16px 4px 16px; background: var(--g2); color: #fff; }
.d-msg--me small { display: block; margin-bottom: 1px; font: 800 12px/1.2 var(--font-body); letter-spacing: .03em; color: var(--od2); }
.d-msg--ai { align-self: flex-start; display: flex; align-items: flex-end; gap: 7px; }
.stage .d-msg--ai > .face { width: 22px; height: 22px; }
.stage .d-msg--ai > .face::before, .stage .d-msg--ai > .face::after { width: 3.5px; height: 5px; }
.d-msg--ai p { padding: calc(7 * var(--u)) calc(12 * var(--u)); border-radius: 16px 16px 16px 4px; background: var(--accs); color: var(--ink); }
.d-msg--me.is-new { animation: dRise .3s var(--ease-out) both; }
.d-msg--ai.is-new p { animation: dReveal .34s .5s var(--ease-out) both; } /* a short beat, as if typed */
.d-msg--ai.is-new { position: relative; }
.d-msg--ai.is-new::after { content: ''; position: absolute; left: 31px; bottom: 9px; width: 30px; height: 8px; pointer-events: none;
  background: radial-gradient(circle, var(--sl) 2.6px, transparent 3px) 0 50% / 10px 8px repeat-x; animation: dDots .5s linear both; }
@keyframes dDots { 0%, 88% { opacity: 1; } 100% { opacity: 0; } }
.d-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.d-chip { position: relative; min-height: 36px; padding: 0 13px; border: 0; border-radius: 999px; background: var(--st); box-shadow: inset 0 0 0 1.5px var(--line-strong);
  color: var(--ink); font: 700 max(12.5px, calc(13 * var(--u)))/1.15 var(--font-body); cursor: pointer; }
.d-chip::after { content: ''; position: absolute; inset: -4px -2px; }
.d-chip:hover { box-shadow: inset 0 0 0 1.5px var(--acc); color: var(--acc); }
.d-chip:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.stage[data-fmt="phone"] .d-chip:nth-child(n+4) { display: none; }
.d-ask { display: flex; align-items: center; gap: 6px; margin: 0; }
.d-ask input { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 15px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--ink);
  font: 600 16px/1 var(--font-body); -webkit-user-select: text; user-select: text; }
.d-ask input::placeholder { color: var(--sl); opacity: 1; }
.d-ask input:focus-visible { outline: 3px solid var(--acc); outline-offset: 1px; }
.d-send { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--g2); color: #fff; cursor: pointer; }
.d-send .i { width: 19px; height: 19px; stroke-width: 2; }
.d-send:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }

.paper .a-btn, .paper .fx-chip { position: relative; } /* sample taps are drawn inside the control they land on */
/* the sample tap: a ring where the finger lands and a label, so nobody thinks they pressed it */
.d-tapmark { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.d-tapmark i { position: absolute; left: var(--x, 50%); top: var(--y, 50%); width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; background: color-mix(in srgb, var(--accv) 42%, transparent);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px color-mix(in srgb, var(--accv) 60%, transparent); animation: dTap .7s var(--ease-out) both; }
.d-tapmark b { position: absolute; left: var(--x, 50%); bottom: calc(100% + 6px); transform: translateX(-50%); padding: 4px 8px; border-radius: 6px; background: var(--g2); color: #fff;
  font: 800 12px/1 var(--font-body); letter-spacing: .02em; white-space: nowrap; animation: dIn .25s var(--ease-out) both; }

.d-tapmark.d-tapmark--end b { left: auto; right: 0; transform: none; }
.d-tapmark.d-tapmark--start b { left: 0; transform: none; }
.d-tapmark.d-tapmark--below b { bottom: auto; top: calc(100% + 6px); }

/* the pulse: the AI's one soft heartbeat of light, in the companion's colour (rise about 0.6 s, decay about 0.9 s) */
.d-chg.is-pulse .a-node, .d-next.is-pulse, .d-mface.is-pulse { animation: dPulse 1.5s cubic-bezier(.3, 0, .2, 1) 1 both; }
.d-chg.is-pulse .a-row { animation: dFlash 1.5s cubic-bezier(.3, 0, .2, 1) 1 both; }

/* ------------------------------------------------------------------ Train, Eat, More: hub screens and their panes (one pane at a time) */
.x-hub, .x-more { gap: calc(8 * var(--u)); }
.stage[data-fmt="laptop"] .x-hub, .stage[data-fmt="laptop"] .x-more { gap: calc(10 * var(--u)); }
.x-seg { margin: 0; display: flex; gap: 3px; width: max-content; max-width: 100%; flex: 0 0 auto; padding: 3px; border-radius: 999px; background: #E3E0D9; }
.x-seg button { position: relative; display: inline-flex; align-items: center; min-height: max(32px, calc(34 * var(--u))); padding: 0 calc(14 * var(--u)); border: 0; border-radius: 999px; background: none;
  font: 700 max(12.5px, calc(13 * var(--u)))/1 var(--font-body); color: var(--sl); white-space: nowrap; cursor: pointer; }
.x-seg button::after { content: ''; position: absolute; inset: -6px -1px; }
.x-seg button:hover { color: var(--ink); }
.x-seg button[aria-current] { background: var(--iv); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink2), var(--sc); }
.stage[data-fmt="phone"] .x-seg button { padding: 0 calc(11 * var(--u)); }
.js .x-hub:not(.has-seg) > .x-seg { display: none; }
.x-panes { min-width: 0; }
.x-pane { display: flex; flex-direction: column; gap: calc(9 * var(--u)); min-width: 0; }
.stage[data-fmt="laptop"] .x-pane { gap: calc(12 * var(--u)); }
.js .x-pane:not(.is-on) { display: none; }
.js .x-pane.is-on { animation: dIn .3s var(--ease-out) both; }
.x-pane h3.a-h1, .x-more h3.a-h1, .d-end h3.a-h1, .fx-name { justify-self: start; width: fit-content; max-width: 100%; }
.x-pane h3.a-h1:focus-visible, .x-more h3.a-h1:focus-visible, .d-end h3.a-h1:focus-visible, .fx-name:focus-visible { outline-offset: 2px; border-radius: 6px; }
.x-link { position: relative; align-self: flex-start; min-height: 30px; padding: 0 2px; border: 0; background: none; color: var(--acc); font: 750 max(12.5px, calc(13 * var(--u)))/1.2 var(--font-body);
  text-decoration: underline; text-underline-offset: 3px; text-align: left; cursor: pointer; }
.x-link::after { content: ''; position: absolute; inset: -7px -3px; }
.x-note { margin: 0; font: 650 max(12.5px, calc(13.5 * var(--u)))/1.35 var(--font-body); color: var(--od2); }
.x-sd { margin: 0; font: 650 max(13px, calc(14 * var(--u)))/1.4 var(--font-body); color: var(--ink2); }
.x-pill { display: inline-flex; align-items: center; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--accs); color: var(--acc); font: 800 12px/1.3 var(--font-body); letter-spacing: .01em; text-transform: none; vertical-align: 1px; }
.x-pill--lock { background: #E3E0D9; color: var(--ink2); }
.x-ph { display: grid; place-items: center; align-content: center; gap: 6px; border: 1px dashed var(--ln2); background: linear-gradient(160deg, var(--pl), var(--st)); color: var(--sl); font: 650 12px/1.3 var(--font-body); text-align: center; }
.x-ph .i { width: 22px; height: 22px; stroke-width: 1.5; }

/* Sessions: the week (a button per day) and the day's card */
.x-rail button.d { position: relative; border: 0; font: inherit; color: var(--sl); cursor: pointer; }
.x-rail button.d:not(.is-today) { background: none; }
.x-rail button.d::after { content: ''; position: absolute; inset: -2px; }
.x-rail button.d:hover:not(.is-today) { background: #0000000a; }
.x-rail .d[aria-pressed="true"]:not(.is-today) { box-shadow: inset 0 0 0 2px var(--acc); }
.x-rail .d.is-today[aria-pressed="true"] { box-shadow: inset 0 1px 0 #ffffff26, 0 0 0 2px var(--acc); }
.x-rail .d.is-today:not([aria-pressed="true"]) { box-shadow: inset 0 1px 0 #ffffff26, 0 0 0 2px var(--ln2); }
.x-rail button.d:focus-visible { outline-offset: 1px; }
.x-rail .d.is-ping { animation: dPing 1.5s cubic-bezier(.3, 0, .2, 1) 1 both; }
.x-daycard { min-width: 0; }
.x-daycard .a-hero-t { overflow-wrap: anywhere; }

/* the session player (the app's focus arena): demonstration slot, reps, Log set, rest, next set */
.x-player { gap: calc(8 * var(--u)); }
.x-player .fx-top { min-height: 40px; }
.x-player .fx-ttl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-player .x-st { display: none; flex-direction: column; gap: calc(10 * var(--u)); min-width: 0; }
.x-player[data-st="work"] .x-st--work, .x-player[data-st="rest"] .x-st--rest, .x-player[data-st="done"] .x-st--done { display: flex; }
.x-player .fx-rec { margin: 0; }
.x-player .fx-nextline { margin: 0; }
.x-player .fx-con { gap: 10px; }
.x-log { flex: 1 1 auto; width: auto; min-width: 0; }
.x-log[aria-disabled="true"] { opacity: .6; }
.x-st--rest, .x-st--done { align-items: center; text-align: center; }
.x-racts { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.x-player .fx-skip { min-height: 44px; }
.x-player .fx-ring { width: calc(132 * var(--u)); height: calc(132 * var(--u)); }
.x-med-t { max-width: 22ch; }
.x-player .d-media .face { box-shadow: 0 0 0 calc(3 * var(--u)) var(--accv); }
.stage[data-fmt="phone"] .x-player .d-media { display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 0; padding: calc(8 * var(--u)) 12px; text-align: left; }
.stage[data-fmt="phone"] .x-player .d-media .face { width: 32px; height: 32px; }
.stage[data-fmt="phone"] .x-player .fx-ring { width: calc(104 * var(--u)); height: calc(104 * var(--u)); }
.stage[data-fmt="phone"] .x-player .fx-ring b { font-size: calc(28 * var(--u)); }
.stage[data-fmt="phone"] .x-player .fx-name { font-size: calc(24 * var(--u)); }
.stage[data-fmt="phone"] .x-player .fx-nums b { font-size: calc(25 * var(--u)); }
.stage[data-fmt="phone"] .x-player .fx-plate { padding-block: calc(9 * var(--u)); }
.stage[data-fmt="phone"] .x-player .x-st--rest { gap: calc(6 * var(--u)); }

/* Academy: the discipline grid, the Journey glimpse, a discipline's list; Eat: the meal types */
.x-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(8 * var(--u)); }
.stage[data-fmt="laptop"] .x-tiles--meal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.x-tile { width: 100%; display: flex; align-items: center; gap: 10px; min-height: max(44px, calc(54 * var(--u))); padding: calc(7 * var(--u)) calc(12 * var(--u)); border: 0; border-radius: calc(16 * var(--u));
  background: var(--iv); box-shadow: var(--sc); color: var(--ink); text-align: left; cursor: pointer; transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.x-tile:hover { box-shadow: inset 0 0 0 1.5px var(--acc), var(--sc); }
.x-tile .i { width: 22px; height: 22px; color: var(--acc); }
.x-tile-t { display: block; min-width: 0; }
.x-tile-t b { display: block; overflow-wrap: anywhere; font: 700 max(13px, calc(14 * var(--u)))/1.2 var(--font-body); }
.x-tile-t small { display: block; font: 650 12px/1.25 var(--font-body); color: var(--sl); }
.stage[data-fmt="phone"] .x-tile { gap: 8px; padding-inline: 10px; }
.stage[data-fmt="phone"] .x-tiles:not(.x-tiles--meal) .x-tile-t small, .stage[data-fmt="phone"] .x-kick-opt, .stage[data-fmt="phone"] .x-more .a-kick { display: none; }
.stage[data-fmt="phone"] .x-tiles--meal .x-tile { min-height: max(52px, calc(60 * var(--u))); }
.js .x-pane.is-on .x-tile { animation: dRise .4s calc(var(--i, 0) * 55ms) var(--ease-out) both; }
.x-glimpse { gap: calc(8 * var(--u)); }
.x-glimpse .a-track { margin: 0; }
.x-glimpse .hx span { display: grid; place-items: center; }
.x-glimpse .hx .i { width: 15px; height: 15px; stroke-width: 2; }
.x-glimpse.is-ping { animation: dPing 1.5s cubic-bezier(.3, 0, .2, 1) 1 both; }
.x-list { list-style: none; margin: 0; padding: 0; display: grid; gap: calc(8 * var(--u)); }
.x-item { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: max(52px, calc(60 * var(--u))); padding: calc(6 * var(--u)) calc(12 * var(--u)) calc(6 * var(--u)) calc(8 * var(--u));
  border: 0; border-radius: calc(16 * var(--u)); background: var(--iv); box-shadow: var(--sc); color: var(--ink); text-align: left; cursor: pointer; }
.x-item:hover { box-shadow: inset 0 0 0 1.5px var(--acc), var(--sc); }
.x-thumb { width: calc(44 * var(--u)); height: calc(44 * var(--u)); min-width: 40px; min-height: 40px; border-radius: 12px; }
.x-go { display: grid; place-items: center; color: var(--sl); }
.x-go .i { width: 18px; height: 18px; stroke-width: 2.2; }
.x-item .a-txt small, .a-rows .x-go ~ small { white-space: normal; }
.stage[data-fmt="laptop"] .x-list { grid-template-columns: minmax(0, 1fr); max-width: calc(560 * var(--u)); }
.x-mrows { --tw: calc(48 * var(--u)); }
.x-mrows button { padding-right: 6px; }
.x-mrows .a-txt small { white-space: normal; }
.x-mrows .a-t { white-space: nowrap; }
.x-nut { align-self: flex-start; margin-top: calc(4 * var(--u)); }
.x-mealcard { min-width: 0; }

/* the exercise and recipe cards: placeholder media, then a card with tabs */
.x-excols { align-items: start; }
.x-media { min-height: calc(150 * var(--u)); padding: 10px; border-radius: calc(18 * var(--u)); }
.stage[data-fmt="laptop"] .x-media { min-height: calc(190 * var(--u)); }
.x-media .face { width: calc(56 * var(--u)); height: calc(56 * var(--u)); }
.stage .x-media .face::before, .stage .x-media .face::after { width: 13%; height: 19%; }
.x-media--rc .i { width: 34px; height: 34px; }
.stage[data-fmt="phone"] .x-media { display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 0; padding: calc(7 * var(--u)) 12px; text-align: left; }
.stage[data-fmt="phone"] .x-media .face { width: 30px; height: 30px; }
.stage[data-fmt="phone"] .x-media--rc .i { width: 26px; height: 26px; }
.stage[data-fmt="phone"] .x-excols .a-lead { gap: calc(6 * var(--u)); }
.x-card { gap: calc(10 * var(--u)); }
.x-tabs { display: grid; gap: calc(10 * var(--u)); min-width: 0; }
.x-tablist { display: flex; gap: 3px; width: max-content; max-width: 100%; padding: 3px; border-radius: 999px; background: #E3E0D9; }
.x-tablist button { position: relative; min-height: max(32px, calc(32 * var(--u))); padding: 0 calc(13 * var(--u)); border: 0; border-radius: 999px; background: none;
  font: 700 max(12.5px, calc(13 * var(--u)))/1 var(--font-body); color: var(--sl); white-space: nowrap; cursor: pointer; }
.x-tablist button::after { content: ''; position: absolute; inset: -6px -1px; }
.x-tablist button:hover { color: var(--ink); }
.x-tablist button[aria-selected="true"] { background: var(--iv); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink2), var(--sc); }
.x-tablist button:focus-visible { outline: 3px solid var(--acc); outline-offset: 1px; }
.x-tpanels { display: grid; min-width: 0; }
.x-tpanel { grid-area: 1 / 1; visibility: hidden; min-width: 0; }
.x-tpanel.is-on { visibility: visible; animation: dIn .25s var(--ease-out) both; }
.x-cues { list-style: none; margin: 0; padding: 0; display: grid; gap: calc(9 * var(--u)); }
.x-cues li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; font: 650 max(13px, calc(14 * var(--u)))/1.35 var(--font-body); color: var(--ink); }
.x-cues--s li { font-size: max(13px, calc(13.5 * var(--u))); }
.x-n { display: grid; place-items: center; width: max(22px, calc(24 * var(--u))); height: max(22px, calc(24 * var(--u))); border-radius: 8px; background: var(--g2); color: #fff; font: 600 12.5px/1 var(--font-display); }
.x-avoid { list-style: none; margin: 0; padding: 0; display: grid; gap: calc(9 * var(--u)); }
.x-avoid li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; font: 650 max(13px, calc(14 * var(--u)))/1.35 var(--font-body); color: var(--ink); }
.x-avoid .i { width: 20px; height: 20px; color: var(--acc); stroke-width: 1.9; }
.x-muscles { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: calc(10 * var(--u)) 14px; align-items: center; }
.x-mapwrap { border-radius: 10px; }
.x-mapwrap.is-ping { animation: dPing 1.5s cubic-bezier(.3, 0, .2, 1) 1 both; }
.x-mm { display: grid; justify-items: center; gap: 2px; }
.mm { width: calc(176 * var(--u)); height: auto; aspect-ratio: 212 / 150; }
.mm-b { fill: #DDD9D0; }
.mm-m { fill: #E9E6DF; stroke: #C9C4BA; stroke-width: .8; }
.mm-m[data-l="1"] { fill: var(--accv); stroke: var(--acc); stroke-width: 1.8; }
.mm-m[data-l="2"] { fill: var(--accs); stroke: var(--acc); stroke-width: 1.3; stroke-dasharray: 2.6 1.6; }
.x-mmcap { display: flex; justify-content: space-around; width: 100%; font: 650 12px/1.2 var(--font-body); color: var(--sl); }
.x-legend { margin: 0; font: 650 max(13px, calc(13.5 * var(--u)))/1.55 var(--font-body); color: var(--ink2); }
.x-legend b { color: var(--ink); }
.x-key { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.x-key--1 { background: var(--accv); box-shadow: inset 0 0 0 1.5px var(--acc); }
.x-key--2 { background: var(--accs); box-shadow: inset 0 0 0 1.5px var(--acc); }
.stage[data-fmt="laptop"] .mm { width: calc(210 * var(--u)); }
.stage[data-fmt="phone"] .mm { width: calc(138 * var(--u)); }
.x-ing { list-style: none; margin: 0; padding: 0; display: grid; }
.x-ing li { display: grid; grid-template-columns: minmax(66px, auto) minmax(0, 1fr); gap: 10px; padding: calc(6 * var(--u)) 0; border-top: 1px solid #0000000d; font: 650 max(13px, calc(14 * var(--u)))/1.3 var(--font-body); color: var(--ink2); }
.x-ing li:first-child { border-top: 0; }
.x-ing b { font-weight: 800; color: var(--ink); }
.x-ing--rev li { grid-template-columns: minmax(0, 1fr) auto; }
.x-ing--rev span { color: var(--ink); font-weight: 700; }
.x-ing--rev b { color: var(--ink2); font-weight: 700; }
.x-est { margin: 0 0 calc(6 * var(--u)); font: 650 max(12.5px, calc(13 * var(--u)))/1.3 var(--font-body); color: var(--ink2); }
.x-est .x-pill { margin-left: 0; margin-right: 4px; }
.x-macros { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.x-macros > div { min-width: 0; padding: calc(8 * var(--u)) 4px; border-radius: 12px; background: var(--st); box-shadow: inset 0 0 0 1px var(--ln); text-align: center; }
.x-macros dt { font: 650 12px/1.2 var(--font-body); color: var(--sl); }
.x-macros dd { margin: 2px 0 0; font: 600 max(17px, calc(22 * var(--u)))/1.05 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.x-macros dd small { display: block; font: 650 12px/1.2 var(--font-body); letter-spacing: 0; color: var(--sl); }
.x-total { gap: calc(8 * var(--u)); }
.x-macros + .x-sd { margin-top: calc(8 * var(--u)); }
.x-card--dim { box-shadow: inset 0 0 0 1.5px var(--ln2); background: transparent; }

/* Journey: the milestone path (a button per stage) and the stage's card */
.x-path { list-style: none; margin: 0; padding: calc(4 * var(--u)) 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: relative; }
.x-path::before { content: ''; position: absolute; left: 12.5%; right: 12.5%; top: calc(4 * var(--u) + max(22px, 23 * var(--u))); height: 2px; background: var(--ln2); }
.x-path li { position: relative; min-width: 0; }
.x-stage { position: relative; width: 100%; display: grid; justify-items: center; gap: 5px; padding: 2px 0 4px; border: 0; background: none; color: var(--sl); font: 700 max(12px, calc(12.5 * var(--u)))/1.2 var(--font-body); cursor: pointer; }
.x-stage::after { content: ''; position: absolute; inset: -3px -2px; }
.x-stage .hx { width: max(38px, calc(42 * var(--u))); height: max(42px, calc(46 * var(--u))); }
.x-stage .hx span { display: grid; place-items: center; }
.x-stage .hx .i { width: 16px; height: 16px; stroke-width: 2; }
.x-stage.is-now .hx { background: var(--ink2); }
.x-stage.is-now .hx::before { background: var(--iv); }
.x-stage.is-now .hx span { color: var(--ink); }
.x-stage[aria-pressed="true"] { color: var(--ink); }
.x-stage[aria-pressed="true"] .hx { background: var(--acc); }
.x-stage[aria-pressed="true"] b { text-decoration: underline; text-decoration-color: var(--acc); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.x-stage:hover .hx { background: var(--acc); }
.x-stagecard { gap: calc(8 * var(--u)); }
.x-locked { display: flex; gap: 8px; align-items: flex-start; }
.x-locked .i { width: 18px; height: 18px; color: var(--sl); margin-top: 1px; }
.stage[data-fmt="laptop"] .x-path { max-width: calc(520 * var(--u)); }

/* Consultation: the companion asks, chips answer */
.x-thread { display: flex; flex-direction: column; gap: calc(8 * var(--u)); min-width: 0; }
.x-thread .d-msg { max-width: 92%; }
.x-opts { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 29px; }
.x-opt { position: relative; min-height: 38px; padding: 0 15px; border: 0; border-radius: 999px; background: var(--st); box-shadow: inset 0 0 0 1.5px var(--line-strong);
  color: var(--ink); font: 700 max(12.5px, calc(13 * var(--u)))/1.15 var(--font-body); cursor: pointer; }
.x-opt::after { content: ''; position: absolute; inset: -4px -2px; }
.x-opt:hover { box-shadow: inset 0 0 0 1.5px var(--acc); color: var(--acc); }
.x-opt:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.x-notes { margin-top: calc(2 * var(--u)); gap: calc(7 * var(--u)); }
.x-notes .x-redo { align-self: flex-start; min-height: 36px; }

/* guided meal prep */
.x-pd { margin: 0; font: 650 max(13px, calc(15 * var(--u)))/1.4 var(--font-body); color: var(--ink2); }
.x-pacts { margin: 0; display: flex; gap: 8px; align-items: center; }
.x-pacts .a-out[disabled] { opacity: .55; cursor: default; }
.x-pnext { flex: 1 1 auto; width: auto; min-width: 0; }
.x-plink { margin: 0; }
.x-timer { align-items: center; justify-content: center; gap: calc(10 * var(--u)); text-align: center; }
.x-pring { 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, var(--iv) 82%, transparent 83%), conic-gradient(var(--acc) calc(var(--left, 1) * 360deg), #0000001c 0); }
.x-pring b { font: 600 calc(34 * var(--u))/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink); }
.x-pring small { margin-top: 4px; font: 650 12px/1.2 var(--font-body); color: var(--sl); max-width: 10ch; }
.x-timer[data-timer="0"] .x-pring, .x-timer[data-timer="0"] .x-ptoggle { display: none; }
.x-timer[data-timer="1"] .x-notimer { display: none; }
.x-notimer { margin: 0; font: 650 max(13px, calc(14 * var(--u)))/1.4 var(--font-body); color: var(--sl); }
.stage[data-fmt="phone"] .x-timer { flex-direction: row; justify-content: space-between; gap: 12px; text-align: left; }
.stage[data-fmt="phone"] .x-pring { width: calc(98 * var(--u)); height: calc(98 * var(--u)); }
.stage[data-fmt="phone"] .x-pring b { font-size: calc(26 * var(--u)); }
.stage[data-fmt="phone"] .x-pring small { display: none; }

/* More: Wallet and Enhance, coming soon (Explore's Wallet and Enhance tabs mark the card they stand for) */
.x-soon { gap: calc(8 * var(--u)); }
.x-more[data-focus="wallet"] .x-soon--wallet, .x-more[data-focus="enhance"] .x-soon--enhance { box-shadow: inset 0 0 0 2px var(--acc), var(--sc); }
.stage[data-fmt="laptop"] .x-more > .d-cols { align-items: start; }

/* the sample's kept-plan line (Explore · Today) */
.d-keptline { margin: 0; }
.js .d-today:not([data-kept="1"]) .d-keptline, .js .d-today[data-acc="1"] .d-keptline, .js .d-today[data-dock="prop"] .d-keptline { display: none; }

/* Explore: the run is paused; Play says "Resume tour" */
.paper[data-mode="explore"] .d-play { background: var(--accs); border-color: var(--acc); color: var(--acc); }
.paper[data-mode="explore"] .d-chaps button[aria-current] { color: var(--sl); }

/* the session player's body, the demonstration slot and the step dots (shared with meal prep) */
.d-player { display: flex; flex-direction: column; }
.d-player-b { display: flex; flex-direction: column; gap: calc(10 * var(--u)); min-width: 0; }
.stage[data-fmt="laptop"] .d-player-b { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: calc(18 * var(--u)); align-items: start; }
.d-media { display: grid; place-items: center; align-content: center; gap: 10px; min-height: calc(150 * var(--u)); padding: 12px; border: 1px dashed #ffffff47; border-radius: calc(18 * var(--u));
  background: #ffffff0a; color: #C6CBD3; font: 650 12px/1.3 var(--font-body); text-align: center; }
.stage[data-fmt="laptop"] .d-media { min-height: calc(280 * var(--u)); }
.stage .d-media .face { width: calc(64 * var(--u)); height: calc(64 * var(--u)); }
.stage .d-media .face::before, .stage .d-media .face::after { width: 13%; height: 19%; }
.d-dots { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.d-dots li { width: 28px; height: 6px; border-radius: 99px; background: #00000021; }
.d-dots .is-done { background: var(--ink2); }
.d-dots .is-now { background: var(--acc); }

/* the end of the run: explore any tab */
.d-end { height: 100%; justify-content: center; gap: calc(14 * var(--u)); width: 100%; max-width: calc(820 * var(--u)); margin: 0 auto; }
.d-go { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(150 * var(--u)), 1fr)); gap: 8px; }
.d-go button { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: calc(10 * var(--u)) calc(14 * var(--u)); border: 0; border-radius: calc(18 * var(--u));
  background: var(--iv); box-shadow: var(--sc); color: var(--ink); text-align: left; cursor: pointer; }
.d-go button:hover { box-shadow: inset 0 0 0 1.5px var(--acc), var(--sc); }
.d-go button:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.d-go .i { width: 20px; height: 20px; color: var(--acc); }
.d-go b { display: block; font: 700 max(13.5px, calc(15 * var(--u)))/1.2 var(--font-body); }
.d-go small { display: block; font: 650 12px/1.3 var(--font-body); color: var(--sl); }
.stage[data-fmt="phone"] .d-go { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.stage[data-fmt="phone"] .d-go button { min-height: 52px; padding: 8px 10px; gap: 8px; }

/* ------------------------------------------------------------------ small papers (phones under 630 px of paper, short laptop windows) */
/* Progress's decorative segments give way on phones up to 375 × 667 (a 631 px paper) */
@container (max-height: 640px) { .stage[data-fmt="phone"] .scr-prog > .a-seg { display: none; } }
@container (max-height: 630px) {
  .stage[data-fmt="phone"] .d-today .a-kick, .stage[data-fmt="phone"] .d-choose .a-kick { display: none; }
  .stage[data-fmt="phone"] .d-port { width: calc(72 * var(--u)); height: calc(72 * var(--u)); }
  .stage[data-fmt="phone"] .d-port .face { width: calc(50 * var(--u)); height: calc(50 * var(--u)); }
}

/* ------------------------------------------------------------------ the compact landscape paper (a laptop-format paper under 500 px tall: a phone
   held sideways at 844 × 390, a short window, 200 % zoom). The chrome gives the screen its height back (one-line guide, no app top
   bar, the sample label in the paper's bar), and each screen takes a side-by-side layout, so no step needs an inner scroll. */
@container (max-height: 500px) {
  /* the guide: the role and the line on two short rows; the sentence is read out, not shown */
  .stage[data-fmt="laptop"] .p-top { min-height: 0; padding: 4px 10px 3px 12px; gap: 8px; }
  .stage[data-fmt="laptop"] .say { gap: 8px; }
  .stage[data-fmt="laptop"] .say > div { display: grid; row-gap: 0; }
  .stage[data-fmt="laptop"] .say p:not(.say-who) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .stage[data-fmt="laptop"] .say h2, .stage[data-fmt="laptop"] .say .say-who { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stage[data-fmt="laptop"] .say h2 { font-size: 14.5px; line-height: 1.25; }
  .stage[data-fmt="laptop"] .say-face .face { width: 26px; height: 26px; }
  .paper .say h2:focus-visible { outline-offset: 0; }
  .stage[data-fmt="laptop"] .d-cs-lbl, .stage[data-fmt="laptop"] .d-where, .stage[data-fmt="laptop"] .p-temp { display: none; }
  .stage[data-fmt="laptop"] .p-ex { padding: 3px 6px; }
  /* the app's top bar (day, rank) gives way; the sample label stays in the paper's bar */
  .stage[data-fmt="laptop"] .a-top { display: none; }
  .stage[data-fmt="laptop"] .app { grid-template-areas: "nav view" "nav view"; }
  .stage[data-fmt="laptop"] .p-foot { padding-block: 3px; }
  .stage[data-fmt="laptop"] .d-chaps button { min-height: 44px; }

  /* every screen: a tighter rhythm and smaller titles */
  .stage[data-fmt="laptop"] .p-step { padding-top: calc(6 * var(--u)); padding-bottom: calc(6 * var(--u)); }
  .stage[data-fmt="laptop"] .scr, .stage[data-fmt="laptop"] .x-pane, .stage[data-fmt="laptop"] .a-lead, .stage[data-fmt="laptop"] .x-hub { gap: calc(7 * var(--u)); }
  .stage[data-fmt="laptop"] .a-h1, .stage[data-fmt="laptop"] .fx-name { font-size: calc(24 * var(--u)); }
  .stage[data-fmt="laptop"] .a-head { gap: 1px; }
  .stage[data-fmt="laptop"] .x-seg button { min-height: 30px; }
  .stage[data-fmt="laptop"] .x-seg button::after { inset: -7px -1px; }
  /* rows that are read, not pressed, sit closer (pressable rows keep 44 px) */
  .stage[data-fmt="laptop"] .a-row { min-height: 34px; }
  .stage[data-fmt="laptop"] .a-rows { --nw: calc(30 * var(--u)); }

  /* the choice */
  .stage[data-fmt="laptop"] .d-choose .a-kick { display: none; }
  .stage[data-fmt="laptop"] .d-port { height: calc(96 * var(--u)); }
  .stage[data-fmt="laptop"] .d-port .face { width: calc(70 * var(--u)); height: calc(70 * var(--u)); }
  .stage[data-fmt="laptop"] .d-card { padding: calc(10 * var(--u)); gap: calc(8 * var(--u)) 10px; }

  /* Today: the day beside the companion; in the chat the miniature steps aside, three questions on one row */
  .stage[data-fmt="laptop"] .d-today .a-kick { display: none; }
  .stage[data-fmt="laptop"] .d-day { gap: calc(6 * var(--u)); }
  .stage[data-fmt="laptop"] .d-rows .a-row { min-height: 32px; }
  .stage[data-fmt="laptop"] .d-next-t { font-size: calc(24 * var(--u)); }
  .stage[data-fmt="laptop"] .d-next { padding: calc(11 * var(--u)) calc(14 * var(--u)); }
  .stage[data-fmt="laptop"] .d-dock { gap: calc(7 * var(--u)); }
  .stage[data-fmt="laptop"] .d-prop { gap: calc(6 * var(--u)); padding: calc(10 * var(--u)) calc(12 * var(--u)); }
  .stage[data-fmt="laptop"] .d-mface { width: 40px; height: 40px; }
  .stage[data-fmt="laptop"] .d-bubble { padding: calc(7 * var(--u)) calc(11 * var(--u)); }
  .js .stage[data-fmt="laptop"] .d-today[data-dock="chat"] .d-mini { display: none; }
  .stage[data-fmt="laptop"] .d-chat { gap: calc(6 * var(--u)); padding: calc(8 * var(--u)) calc(10 * var(--u)); }
  .stage[data-fmt="laptop"] .d-chips { flex-wrap: nowrap; }
  .stage[data-fmt="laptop"] .d-chip { flex: 0 0 auto; }
  .stage[data-fmt="laptop"] .d-chip:nth-child(n+3) { display: none; } /* two questions on the row; the text box takes the rest */
  .stage[data-fmt="laptop"] .d-log { min-height: 48px; }

  /* Sessions: the week rail and the day's card side by side; the five rows go (the rail holds the week) */
  .stage[data-fmt="laptop"] .x-wk { display: none; }
  .stage[data-fmt="laptop"] .a-rail .d { min-height: 46px; }
  .stage[data-fmt="laptop"] .a-session { padding: calc(13 * var(--u)) calc(15 * var(--u)); gap: calc(5 * var(--u)); }
  .stage[data-fmt="laptop"] .a-hero-t { font-size: calc(28 * var(--u)); }

  /* the session player: the demonstration slot beside the set; rest puts the ring beside its actions */
  .stage[data-fmt="laptop"] .x-player { padding: calc(2 * var(--u)) calc(14 * var(--u)) calc(10 * var(--u)); gap: calc(4 * var(--u)); }
  .stage[data-fmt="laptop"] .x-player .fx-top { min-height: 44px; }
  .stage[data-fmt="laptop"] .d-player-b { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: calc(14 * var(--u)); align-items: stretch; }
  .stage[data-fmt="laptop"] .d-media { min-height: 0; }
  .stage[data-fmt="laptop"] .x-player .fx-work { gap: calc(7 * var(--u)); }
  .stage[data-fmt="laptop"] .x-player .fx-plate { padding: calc(8 * var(--u)) calc(12 * var(--u)); }
  .stage[data-fmt="laptop"] .x-player .fx-nums { margin-top: calc(4 * var(--u)); }
  .stage[data-fmt="laptop"] .x-player .fx-nums b { font-size: calc(24 * var(--u)); }
  .stage[data-fmt="laptop"] .x-player .fx-chip { min-height: 44px; }
  .stage[data-fmt="laptop"] .x-player .x-st--rest, .stage[data-fmt="laptop"] .x-player .x-st--done { display: none; }
  .stage[data-fmt="laptop"] .x-player[data-st="rest"] .x-st--rest { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ring rec" "ring next" "ring acts"; gap: 4px 16px; align-items: center; justify-items: start; text-align: left; }
  .stage[data-fmt="laptop"] .x-player[data-st="done"] .x-st--done { display: flex; align-items: flex-start; text-align: left; }
  .stage[data-fmt="laptop"] .x-player .fx-ring { grid-area: ring; width: calc(104 * var(--u)); height: calc(104 * var(--u)); }
  .stage[data-fmt="laptop"] .x-player .fx-ring b { font-size: calc(28 * var(--u)); }
  .stage[data-fmt="laptop"] .x-player .x-st--rest .fx-rec { grid-area: rec; }
  .stage[data-fmt="laptop"] .x-player .x-st--rest .fx-nextline { grid-area: next; }
  .stage[data-fmt="laptop"] .x-player .x-racts { grid-area: acts; justify-content: flex-start; }

  /* cards: a smaller media slot; the muscle map and the lists keep their size */
  .stage[data-fmt="laptop"] .x-media { min-height: calc(96 * var(--u)); }
  .stage[data-fmt="laptop"] .mm { width: calc(170 * var(--u)); }
  .stage[data-fmt="laptop"] .x-tabs, .stage[data-fmt="laptop"] .x-card { gap: calc(7 * var(--u)); }
  .stage[data-fmt="laptop"] .x-card { padding-block: calc(9 * var(--u)); }
  .stage[data-fmt="laptop"] .x-cues, .stage[data-fmt="laptop"] .x-avoid { gap: calc(6 * var(--u)); }
  .stage[data-fmt="laptop"] .x-ing li { padding-block: calc(4 * var(--u)); }
  .stage[data-fmt="laptop"] .x-cues--s { gap: 3px; }
  .stage[data-fmt="laptop"] .x-cues--s li { line-height: 1.25; }
  .stage[data-fmt="laptop"] .x-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
  .stage[data-fmt="laptop"] .x-item { min-height: 52px; }
  .stage[data-fmt="laptop"] .x-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stage[data-fmt="laptop"] .x-tile { min-height: 48px; }
  .stage[data-fmt="laptop"] .x-tiles--meal { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* the consultation: the questions on the left, the notes card on the right */
  .stage[data-fmt="laptop"] .x-thread { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); column-gap: calc(16 * var(--u)); row-gap: calc(6 * var(--u)); align-content: start; }
  .stage[data-fmt="laptop"] .x-thread > * { grid-column: 1; }
  .stage[data-fmt="laptop"] .x-thread > .d-msg--me { justify-self: end; }
  .stage[data-fmt="laptop"] .x-thread > .d-msg--ai { justify-self: start; }
  .stage[data-fmt="laptop"] .x-thread > .x-notes { grid-column: 2; grid-row: 1 / span 6; align-self: start; margin: 0; }

  /* groceries and the week's numbers: two columns of rows */
  .stage[data-fmt="laptop"] .x-ing--rev { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
  .stage[data-fmt="laptop"] .x-ing--rev li:nth-child(2) { border-top: 0; }
  .stage[data-fmt="laptop"] .x-card--dim .a-cue { margin-top: 2px; }

  /* meal prep: the step beside its timer */
  .stage[data-fmt="laptop"] .x-pring { width: calc(112 * var(--u)); height: calc(112 * var(--u)); }
  .stage[data-fmt="laptop"] .x-pring b { font-size: calc(26 * var(--u)); }
  .stage[data-fmt="laptop"] .x-pd { font-size: max(13px, calc(14 * var(--u))); }

  /* More and Progress */
  .stage[data-fmt="laptop"] .x-more .a-kick { display: none; }
  .stage[data-fmt="laptop"] .scr-prog .a-kick { display: none; }
  .stage[data-fmt="laptop"] .a-facts { padding-block: calc(6 * var(--u)); }

  /* the end screen: six tabs in three columns */
  .stage[data-fmt="laptop"] .d-go { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stage[data-fmt="laptop"] .d-go button { min-height: 48px; }
}
/* a narrower compact paper (a short window under about 1300 px): the switch shows the two faces (their names stay for screen readers) */
@container (max-height: 500px) and (max-width: 800px) {
  .stage[data-fmt="laptop"] .d-cswitch button { min-width: 44px; justify-content: center; padding: 0 4px; }
  .stage[data-fmt="laptop"] .d-cs-n { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .stage[data-fmt="laptop"] .d-chg .a-lap { display: none; }
}

/* ------------------------------------------------------------------ motion */
@keyframes dIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dPop { 0% { opacity: 0; transform: translateY(8px) scale(.9); } 100% { opacity: 1; transform: none; } }
@keyframes dRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes dSheet { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes dGrow { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes dReveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes dTap { 0% { opacity: 0; transform: scale(.4); } 35% { opacity: 1; transform: scale(1); } 100% { opacity: .85; transform: scale(1.12); } }
@keyframes dPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accv) 0%, transparent), var(--sc); }
  40% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accv) 50%, transparent), 0 0 26px 6px color-mix(in srgb, var(--accv) 38%, transparent); }
  100% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--accv) 0%, transparent), var(--sc); }
}
@keyframes dPing {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accv) 0%, transparent); }
  40% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accv) 55%, transparent); }
  100% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--accv) 0%, transparent); }
}
@keyframes dFlash { 0% { background: transparent; } 40% { background: color-mix(in srgb, var(--accv) 16%, transparent); } 100% { background: transparent; } }
/* reduced motion (system or Pause motion): nothing moves; states change in place */
html[data-motion="reduced"] .paper *, html[data-motion="reduced"] .paper *::before, html[data-motion="reduced"] .paper *::after { animation: none !important; transition: none !important; }
html[data-motion="reduced"] .d-msg--ai.is-new::after { display: none; }

/* ------------------------------------------------------------------ without JavaScript: every screen reads in order, controls that need JS hide */
.no-js .p-step { visibility: visible; opacity: 1; height: auto; overflow: visible; }
.no-js .d-today, .no-js .d-choose, .no-js .d-end, .no-js .d-player { height: auto; }
.no-js .x-pane { display: flex; }
.no-js .x-pane:has(> [data-render]:empty) { display: none; }
.no-js .x-seg, .no-js .x-st--rest, .no-js .x-st--done, .no-js .d-keptline { display: none; }
.no-js .x-st--work { display: flex; }
.no-js .x-tablist { display: none; }
.no-js .x-tpanels { display: block; }
.no-js .x-tpanel { visibility: visible; margin-top: 8px; }
.no-js .x-tpanel::before { content: attr(data-label); display: block; margin-bottom: 4px; font: 800 12px/1.2 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
.no-js .x-pane h3.a-h1 { margin: 0; }
.no-js :is(.d-a, .d-sat, .d-okline, .d-acts, .d-receipt, .d-kept, .d-st-kept, .d-st-ok, .d-say--done, .d-say--chat, .d-by-you, .d-chips, .d-ask, .d-cswitch, .d-play, .d-chaps, .d-where, .d-card-go, .d-go) { display: none; }
.no-js .d-card { cursor: default; }
.no-js .x-notimer, .no-js .a-ph { display: none; } /* the static meal-prep step has its timer; phone-only short labels give way to the full ones */
