/* ============================================================
 * TIDE v0.1 — 29Court design system · COMPONENTS (CSS)   DRAFT
 * Needs tokens.css first. Plain CSS, @layer, no build step.
 *
 * Original 29Court code, except the parts marked [MIT-PORT],
 * whose behaviour/geometry is ported from Bencho free blocks
 * (slide-confirm, toast-stack, time-scrubber, one-time-code,
 * checklist, dynamic-island, slosh):
 *   MIT License — Copyright (c) 2026 Lorenzo Cabra
 *   Permission is hereby granted, free of charge, to any person
 *   obtaining a copy of this software ... (full text in
 *   THIRD-PARTY.md, which ships with this file).
 * Pro-licensed patterns (swipe deck, inline confirm, feedback bar,
 * pay button, access request, activity stack, AI chat input,
 * copy field, thinking, skeleton morph, shimmer) are clean-room
 * rebuilds from behaviour specs — no Bencho Pro code.
 * ============================================================ */

@layer c29.reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { margin: 0; }
  /* Axis lock (Rev 1, 2026-10-17): the page never scrolls sideways.
     Gesture components may paint past the viewport mid-flight; that
     travel must never become page scroll. clip (not hidden), so
     position:sticky keeps working; hidden is the legacy fallback. */
  html, body { overflow-x: hidden; overflow-x: clip; }
  button, input, textarea, select { font: inherit; color: inherit; }
  img, svg { display: block; max-width: 100%; }
  dialog { padding: 0; border: 0; color: inherit; }
  [hidden] { display: none !important; }
}

/* Derived tokens are re-declared on every component root so a knob
   set on the component (or any ancestor) recomputes them there. */
@layer c29.tokens {
  :root, .tc, [data-tune] {
    --d1: calc(160ms / var(--speed)); --d2: calc(220ms / var(--speed));
    --d3: calc(320ms / var(--speed)); --d4: calc(420ms / var(--speed)); --d5: calc(480ms / var(--speed));
    --ease-give: cubic-bezier(.24, calc(1 + .5 * var(--bounce)), .38, 1);
    --s1:calc(4px * var(--density)); --s2:calc(8px * var(--density)); --s3:calc(12px * var(--density));
    --s4:calc(16px * var(--density)); --s5:calc(20px * var(--density)); --s6:calc(24px * var(--density));
    --s8:calc(32px * var(--density)); --s12:calc(48px * var(--density));
    --accent-soft: color-mix(in srgb, var(--accent) 14%, var(--surface));
  }
}

@layer c29.base {
  html { background: var(--bg); color: var(--ink); font-family: var(--font-ui);
    font-size: var(--fs-body); line-height: var(--lh-body); -webkit-font-smoothing: antialiased; }
  body { background: var(--bg); position: relative; min-height: 100dvh; }
  h1, h2, h3 { font-family: var(--font-display); letter-spacing: var(--track-head); line-height: 1.15; margin: 0; text-wrap: balance; font-weight: 750; }
  p { margin: 0; text-wrap: pretty; }
  a { color: var(--accent-text); }
  :focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
  ::selection { background: color-mix(in srgb, var(--accent) 26%, transparent); }
  .tnum { font-variant-numeric: tabular-nums; }
  @view-transition { navigation: auto; }
}

@layer c29.components {

/* ---------- page frame ---------- */
.t-page { max-width: 560px; margin: 0 auto; padding: calc(var(--s4) + var(--safe-t)) var(--s4) calc(var(--s12) + var(--safe-b)); }
.t-sky { position: fixed; inset: 0; background: var(--glow); pointer-events: none; z-index: 0; }
.t-page > * { position: relative; z-index: 1; }
.t-cap { font-size: var(--fs-cap); letter-spacing: var(--track-cap); text-transform: uppercase; font-weight: 650; color: var(--ink-mute); }
.t-muted { color: var(--ink-mute); }
.t-small { font-size: var(--fs-sm); }
.t-stack { display: grid; gap: var(--s3); grid-template-columns: minmax(0, 1fr); }
.t-row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.t-spacer { flex: 1; }
.t-sim { display: inline-flex; align-items: center; gap: 4px; font: 650 11px/1 var(--font-ui); letter-spacing: .08em;
  text-transform: uppercase; color: var(--warn-text); background: var(--warn-bg); padding: 4px 7px; border-radius: 99px; white-space: nowrap; }

/* ---------- card / pane ---------- */
.t-card { background: var(--surface); border-radius: var(--corner); box-shadow: var(--hair); padding: var(--s5); }
.t-pane { background: var(--pane); backdrop-filter: blur(var(--pane-blur)) saturate(1.2); -webkit-backdrop-filter: blur(var(--pane-blur)) saturate(1.2);
  border-radius: var(--corner); box-shadow: 0 0 0 1px var(--pane-edge), var(--lift); background-image: var(--sheen); }

/* ---------- buttons ---------- */
.t-btn { --b-bg: var(--surface); --b-ink: var(--ink); --b-edge: var(--edge);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); min-width: var(--tap);
  padding: 0 calc(var(--s4) + 2px); border: 0; border-radius: var(--r-pill); background: var(--b-bg); color: var(--b-ink);
  box-shadow: 0 0 0 1px var(--b-edge); font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
  transition: transform var(--d1) var(--ease), background var(--d2) var(--ease), box-shadow var(--d2) var(--ease);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; white-space: nowrap; }
.t-btn:hover { background: color-mix(in srgb, var(--b-bg) 92%, var(--ink)); }
.t-btn:active { transform: scale(.97); }
.t-btn[disabled] { opacity: .45; pointer-events: none; }
.t-btn.is-accent { --b-bg: var(--accent); --b-ink: var(--on-accent); --b-edge: transparent; }
.t-btn.is-money { --b-bg: var(--money); --b-ink: var(--on-money); --b-edge: transparent; }
.t-btn.is-ghost { --b-bg: transparent; --b-edge: transparent; }
.t-btn.is-quiet { --b-bg: var(--wash); --b-edge: transparent; }
.t-btn.is-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.t-btn.is-icon { padding: 0; width: var(--tap); }
.t-btn svg { width: 18px; height: 18px; flex: none; }
.t-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 99px; border: 0;
  background: var(--wash); color: var(--ink-soft); font-size: 14px; font-weight: 550; cursor: pointer; transition: background var(--d2) var(--ease), color var(--d2) var(--ease), transform var(--d1) var(--ease); }
.t-chip[aria-pressed="true"], .t-chip.is-on { background: var(--accent); color: var(--on-accent); }
.t-chip:active { transform: scale(.96); }
.t-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- inputs ---------- */
.t-field { display: grid; gap: 6px; }
.t-field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.t-input { width: 100%; min-height: 48px; padding: 0 16px; border-radius: var(--r-md); border: 0; background: var(--raised);
  box-shadow: 0 0 0 1px var(--edge); font-size: 17px; color: var(--ink); transition: box-shadow var(--d2) var(--ease); }
.t-input:focus { outline: none; box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent); }
.t-input.is-bad { box-shadow: 0 0 0 1.5px var(--bad); animation: t-shake var(--d4) var(--ease); }
/* Rev 5 (2026-10-18): plain .t-input placeholders had no themed colour and
   fell back to UA grey at 3.10:1 on the dark raised surface. --ink-mute is
   theme-aware: 5.64:1 on light raised, 4.68:1 on dark raised. opacity:1
   stops engines that dim ::placeholder by default from undoing it. */
.t-input::placeholder { color: var(--ink-mute); opacity: 1; }
@keyframes t-shake { 20%{translate:-6px} 45%{translate:5px} 70%{translate:-3px} 100%{translate:0} }
.t-unfold { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--d4) var(--ease); }
.t-unfold > * { overflow: hidden; }
.t-unfold.is-open { grid-template-rows: 1fr; }

/* ---------- segmented / switch ---------- */
.t-seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 99px; background: var(--wash); position: relative; isolation: isolate; }
.t-seg button { min-height: 38px; padding: 0 14px; border: 0; background: none; border-radius: 99px; font-size: 14px; font-weight: 600; color: var(--ink-mute); cursor: pointer; transition: color var(--d2) var(--ease); white-space: nowrap; }
.t-seg button[aria-pressed="true"] { color: var(--ink); }
.t-seg .t-seg-thumb { position: absolute; z-index: -1; top: 3px; bottom: 3px; border-radius: 99px; background: var(--raised); box-shadow: var(--lift);
  transition: left var(--d3) var(--ease-give), width var(--d3) var(--ease-give); }
.t-switch { appearance: none; width: 50px; height: 30px; border-radius: 99px; background: var(--wash-2); position: relative; cursor: pointer; flex: none; margin: 7px 0;
  transition: background var(--d2) var(--ease); }
.t-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: translate var(--d3) var(--ease-give); }
.t-switch:checked { background: var(--accent); }
.t-switch:checked::after { translate: 20px 0; }

/* ---------- theme toggle ---------- */
.t-theme { position: relative; overflow: hidden; }
.t-theme .sun, .t-theme .moon { position: absolute; transition: transform var(--d4) var(--ease-give), opacity var(--d2) var(--ease); }
[data-theme="dark"] .t-theme .sun { transform: translateY(26px) rotate(60deg); opacity: 0; }
:root:not([data-theme="dark"]) .t-theme .moon { transform: translateY(-26px) rotate(-40deg); opacity: 0; }

/* ======================================================
   SWIPE DECK  <c29-deck>   (clean-room, spec: swipe-deck)
   ====================================================== */
c29-deck { display: block; position: relative; --deck-h: 360px; --fan: 1; outline: none; }
c29-deck .deck-stage { position: relative; height: var(--deck-h); touch-action: none; user-select: none; -webkit-user-select: none; }
c29-deck .deck-card { position: absolute; inset: 0; border-radius: var(--corner); background: var(--sheen), var(--raised); box-shadow: var(--lift);
  padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); overflow: hidden; will-change: transform;
  transition: transform var(--d5) var(--ease-give), opacity var(--d3) var(--ease), box-shadow var(--d3) var(--ease); cursor: grab; }
c29-deck .deck-card.is-held { transition: none; cursor: grabbing; box-shadow: var(--lift-hi); }
c29-deck .deck-card.is-gone { pointer-events: none; }
c29-deck .deck-card:not(.is-top) { pointer-events: none; }
c29-deck .deck-card:not(.is-top) > :not(.deck-tint) { opacity: .0; transition: opacity var(--d3) var(--ease); }
c29-deck .deck-card.is-top > * { opacity: 1; }
c29-deck .deck-tint { position: absolute; inset: 0; pointer-events: none; opacity: 0; border-radius: inherit; }
c29-deck .deck-tint[data-verb="approve"] { background: var(--accent); }
c29-deck .deck-tint[data-verb="dismiss"] { background: var(--ink); }
c29-deck .deck-tint[data-verb="snooze"] { background: var(--sun-300); }
c29-deck .deck-tint[data-verb="comment"] { background: var(--29d-coral-600); }
/* The ONE indicator: a full-stage layer clipped (per move, in JS) to
   exactly the strip the dragged card has vacated on the trailing edge —
   it never overlays card content. Muted tint while the swipe is a
   suggestion; .is-armed flips it to the solid action colour and the
   content to that colour's on-colour. --rv-fg rides the same transition
   via .deck-reveal-in's colour transition. */
c29-deck .deck-reveal { position: absolute; inset: 0; z-index: 60; pointer-events: none; opacity: 0; clip-path: inset(0 100% 0 0); transition: opacity var(--d3) var(--ease), background-color var(--d2) var(--ease); }
c29-deck .deck-reveal.is-on { opacity: 1; }
c29-deck .deck-reveal[data-verb="approve"] { background: color-mix(in srgb, var(--accent) 20%, transparent); --rv-fg: var(--ink); }
c29-deck .deck-reveal[data-verb="approve"].is-armed { background: var(--accent); --rv-fg: var(--on-accent); }
c29-deck .deck-reveal[data-verb="dismiss"] { background: color-mix(in srgb, var(--ink) 14%, transparent); --rv-fg: var(--ink); }
c29-deck .deck-reveal[data-verb="dismiss"].is-armed { background: var(--ink); --rv-fg: var(--bg); }
c29-deck .deck-reveal[data-verb="snooze"] { background: color-mix(in srgb, var(--sun-300) 40%, transparent); --rv-fg: var(--ink); }
c29-deck .deck-reveal[data-verb="snooze"].is-armed { background: var(--sun-300); --rv-fg: #3b2a12; }
/* Dark-theme correction (deck-pass, measured): on the dark theme's
   --sun-300 (#C08442) the #3b2a12 word sits at 4.34:1 — under AA.
   Night beach deepens the word to the same brown family at 5.8:1;
   light keeps #3b2a12 (8.85:1). */
[data-theme="dark"] c29-deck .deck-reveal[data-verb="snooze"].is-armed { --rv-fg: #1d1406; }
c29-deck .deck-reveal[data-verb="comment"] { background: color-mix(in srgb, var(--29d-coral-600) 16%, transparent); --rv-fg: var(--ink); }
c29-deck .deck-reveal[data-verb="comment"].is-armed { background: var(--29d-coral-600); --rv-fg: var(--29d-on-coral); }
c29-deck .deck-reveal-in { position: absolute; display: flex; align-items: center; gap: 6px; color: var(--rv-fg); transition: color var(--d2) var(--ease); }
c29-deck .deck-reveal[data-dir="right"] .deck-reveal-in { left: 16px; top: 50%; translate: 0 -50%; flex-direction: column; text-align: center; }
c29-deck .deck-reveal[data-dir="left"] .deck-reveal-in { right: 16px; top: 50%; translate: 0 -50%; flex-direction: column; text-align: center; }
c29-deck .deck-reveal[data-dir="down"] .deck-reveal-in { top: 14px; left: 50%; translate: -50% 0; }
c29-deck .deck-reveal[data-dir="up"] .deck-reveal-in { bottom: 14px; left: 50%; translate: -50% 0; }
c29-deck .deck-reveal-ic { display: grid; place-items: center; transition: transform var(--d2) var(--ease); }
c29-deck .deck-reveal-ic .t-icon { width: 26px; height: 26px; }
c29-deck .deck-reveal.is-armed .deck-reveal-ic { transform: scale(1.18); }
c29-deck .deck-reveal-word { font: 800 15px/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
c29-deck .deck-reveal-sub { font-size: 11px; font-weight: 650; letter-spacing: .04em; opacity: .75; white-space: nowrap; }
c29-deck .deck-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: var(--s6);
  border-radius: var(--corner); box-shadow: inset 0 0 0 1.5px var(--edge); border: 0; color: var(--ink-mute); opacity: 0; transition: opacity var(--d4) var(--ease) var(--d2); }
c29-deck[data-empty] .deck-empty { opacity: 1; }
c29-deck .deck-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); margin-top: calc(var(--s4) + 28px); }
c29-deck .deck-bar button { min-height: 56px; border: 0; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--hair); cursor: pointer;
  display: grid; place-items: center; gap: 2px; padding: 6px 2px; font-size: 12px; font-weight: 600; color: var(--ink-soft);
  transition: transform var(--d1) var(--ease), background var(--d2) var(--ease); }
c29-deck .deck-bar button:active { transform: scale(.95); }
c29-deck .deck-bar button[data-verb="approve"] { background: var(--accent); color: var(--on-accent); box-shadow: none; }
c29-deck .deck-bar .t-icon { width: 20px; height: 20px; }
c29-deck .deck-hint { margin-top: var(--s2); text-align: center; font-size: 12px; color: var(--ink-mute); }
c29-deck .deck-count { position: absolute; top: -12px; right: 12px; z-index: 50; }

/* item anatomy (used in deck + inbox) */
.t-item-kind { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-mute); }
.t-item-kind i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.t-item-kind i.money { background: var(--money); } .t-item-kind i.warn { background: var(--sun-500); }
.t-item-title { font: 750 var(--fs-xl)/1.2 var(--font-display); letter-spacing: var(--track-head); }
.t-item-body { color: var(--ink-soft); font-size: 15px; }
.t-item-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--ink-mute); }
.t-amount { font: 750 var(--fs-2xl)/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.t-tag { white-space: nowrap; display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 99px; background: var(--wash); font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.t-tag.is-accent { background: var(--accent-soft); color: var(--accent-text); }
.t-tag.is-money { background: color-mix(in srgb, var(--money) 14%, var(--surface)); color: var(--money-text); }

/* ======================================================
   SLIDE TO CONFIRM  <c29-slide>   [MIT-PORT slide-confirm]
   The handle follows the finger 1:1; only the end of the
   track commits; on commit the handle unfurls leftward and
   fills the track (right edge pinned), arrow becomes check.
   ====================================================== */
c29-slide { --h: 60px; --pad: 4px; display: block; }
c29-slide .sl-track { position: relative; height: var(--h); border-radius: min(var(--corner), calc(var(--h) / 2)); background: var(--wash);
  box-shadow: inset 0 0 0 1px var(--edge-soft); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  transition: scale var(--d3) var(--ease); }
c29-slide .sl-wash { position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--sl-c, var(--accent)) 22%, transparent), transparent); opacity: 0; }
c29-slide .sl-label { position: absolute; inset: 0; display: grid; place-items: center; padding-left: calc(var(--h) + 4px); padding-right: 16px;
  font-weight: 650; font-size: 15px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
c29-slide .sl-label span { background: linear-gradient(90deg, var(--ink-soft) 0 40%, var(--ink-mute) 50%, var(--ink-soft) 60%) 0 0/250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: t-sweep var(--shimmer-period) linear infinite; }
c29-slide .sl-grip { position: absolute; top: var(--pad); left: var(--pad); height: calc(var(--h) - 2 * var(--pad)); width: calc(var(--h) - 2 * var(--pad));
  border-radius: max(0px, calc(min(var(--corner), calc(var(--h) / 2)) - var(--pad))); background: var(--sl-c, var(--accent)); color: var(--on-accent);
  display: flex; align-items: center; justify-content: flex-end; padding-right: calc((var(--h) - 2 * var(--pad) - 22px) / 2);
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--sl-c, var(--accent)) 60%, transparent); cursor: grab; border: 0; }
c29-slide .sl-grip:focus-visible { box-shadow: var(--focus); }
c29-slide .sl-grip svg { width: 22px; height: 22px; transition: opacity var(--d2) var(--ease), transform var(--d3) var(--ease-give); }
c29-slide .sl-grip .ok { position: absolute; right: calc((var(--h) - 2 * var(--pad) - 22px) / 2); opacity: 0; transform: scale(.4); }
c29-slide .sl-grip .ok path { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset var(--d4) var(--ease) var(--d2); }
c29-slide .sl-done { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; color: var(--on-accent); font-weight: 700; font-size: 15px; opacity: 0; pointer-events: none;
  transition: opacity var(--d3) var(--ease) var(--d3); }
c29-slide[data-state="done"] .sl-grip .go { opacity: 0; transform: translateX(8px); }
c29-slide[data-state="done"] .sl-grip .ok { opacity: 1; transform: none; }
c29-slide[data-state="done"] .sl-grip .ok path { stroke-dashoffset: 0; }
c29-slide[data-state="done"] .sl-done { opacity: 1; }
c29-slide[data-state="done"] .sl-label { opacity: 0; }
c29-slide[tone="money"] { --sl-c: var(--money); }
c29-slide[tone="money"] .sl-done, c29-slide[tone="money"] .sl-grip { color: var(--on-money); }
@keyframes t-sweep { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* ======================================================
   TOASTS  <c29-toasts>   [MIT-PORT toast-stack: every place is its depth]
   ====================================================== */
c29-toasts { position: fixed; z-index: 90; left: 50%; bottom: calc(16px + var(--safe-b)); width: min(420px, calc(100vw - 24px)); translate: -50% 0;
  height: 0; pointer-events: none; }
c29-toasts .toast { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: auto; display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 8px 8px 8px 16px; border-radius: min(var(--corner), 22px); overflow: hidden;
  background: var(--pane-strong); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 0 0 1px var(--pane-edge), var(--lift-hi); transform-origin: 50% 100%;
  transition: transform var(--d5) var(--ease-give), opacity var(--d3) var(--ease); }
c29-toasts .toast .tx { flex: 1; min-width: 0; font-size: 15px; font-weight: 550; line-height: 1.3; }
c29-toasts .toast .tx small { display: block; font-weight: 450; color: var(--ink-mute); font-size: 13px; }
c29-toasts .toast .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent); color: var(--on-accent); }
c29-toasts .toast .dot svg { width: 15px; height: 15px; }
c29-toasts .toast[data-tone="neutral"] .dot { background: var(--ink); color: var(--bg); }
c29-toasts .toast[data-tone="sun"] .dot { background: var(--sun-300); color: #3b2a12; }
c29-toasts .toast[data-tone="bad"] .dot { background: var(--bad); color: var(--on-bad); }
c29-toasts .toast .drain { position: absolute; left: 0; bottom: 0; height: 2.5px; width: 100%; background: var(--accent); transform-origin: 0 50%; opacity: .7; }
c29-toasts .toast .t-btn { min-height: 40px; }
c29-toasts:hover .toast, c29-toasts:focus-within .toast { transition-duration: var(--d4); }

/* ======================================================
   BOTTOM SHEET  <c29-sheet> wraps native <dialog>
   ====================================================== */
dialog.t-sheet { position: fixed; inset: auto 0 0 0; margin: 0 auto; width: min(560px, 100%); max-width: 100%; max-height: min(88dvh, 760px);
  border-radius: calc(var(--corner) + 6px) calc(var(--corner) + 6px) 0 0; background: var(--raised); box-shadow: var(--lift-hi);
  padding: 0 var(--s5) calc(var(--s6) + var(--safe-b)); overflow: auto; overscroll-behavior: contain;
  transform: translateY(100%); transition: transform var(--d5) var(--ease-sheet), display var(--d5) allow-discrete, overlay var(--d5) allow-discrete; }
dialog.t-sheet[open] { transform: translateY(0); }
@starting-style { dialog.t-sheet[open] { transform: translateY(100%); } }
dialog.t-sheet::backdrop { background: color-mix(in srgb, #0b1622 34%, transparent); backdrop-filter: blur(2px); opacity: 0;
  transition: opacity var(--d4) var(--ease), display var(--d4) allow-discrete, overlay var(--d4) allow-discrete; }
dialog.t-sheet[open]::backdrop { opacity: 1; }
@starting-style { dialog.t-sheet[open]::backdrop { opacity: 0; } }
dialog.t-sheet.is-held { transition: none; }
.t-sheet .grab { display: block; margin: 0 auto; width: 100%; height: 28px; border: 0; background: var(--raised); cursor: grab; touch-action: none; position: sticky; top: 0; z-index: 2; }
/* The grab strip is a pointer affordance, not a focus destination.
   showModal's initial focus lands on it (first focusable element in the
   sheet) and the global :focus-visible ring painted a sea-green outline
   around the full-width strip — the "green border" defect (Rev 1,
   2026-10-17). Sheet focus lives on the dialog itself (tide.js sheet()).
   The grab also paints the sheet's own background so content scrolling
   beneath the sticky strip no longer ghosts through it. */
.t-sheet .grab:focus-visible { box-shadow: none; border-radius: 0; }
.t-sheet .grab::before { content: ""; display: block; margin: 10px auto 0; width: 40px; height: 5px; border-radius: 99px; background: var(--grab-pill); }
.t-sheet h2 { font-size: var(--fs-xl); margin-bottom: var(--s2); }
.t-sheet .sheet-body { display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1fr); }

/* ======================================================
   SNOOZE  <c29-snooze>   presets + [MIT-PORT time-scrubber] ruler
   ====================================================== */
c29-snooze { display: grid; gap: var(--s4); }
c29-snooze .sz-presets { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
c29-snooze .sz-presets button { min-height: 64px; border: 0; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--hair); text-align: left;
  padding: 10px 14px; cursor: pointer; display: grid; gap: 2px; transition: background var(--d2) var(--ease), box-shadow var(--d2) var(--ease), transform var(--d1) var(--ease); }
c29-snooze .sz-presets button b { font-size: 15px; font-weight: 650; }
c29-snooze .sz-presets button span { font-size: 13px; color: var(--ink-mute); }
c29-snooze .sz-presets button[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
/* Rev 5 (2026-10-18): the selected preset sits on the --accent-soft tint,
   where the sublabel's --ink-mute fell to 3.99:1 in dark. On the tint the
   sublabel steps up one ink level: --ink-soft measures 6.71:1 on the dark
   tint and stays clear on the light tint too. Unselected presets keep
   --ink-mute on --surface, which passes in both themes. */
c29-snooze .sz-presets button[aria-pressed="true"] span { color: var(--ink-soft); }
c29-snooze .sz-presets button:active { transform: scale(.97); }
c29-snooze .sz-read { text-align: center; }
c29-snooze .sz-time { font: 750 var(--fs-3xl)/1.1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
c29-snooze .sz-day { font-size: 14px; color: var(--ink-mute); }
c29-snooze .sz-ruler { position: relative; height: 64px; border-radius: var(--r-md); background: var(--sunken); overflow: hidden; touch-action: none; cursor: ew-resize;
  -webkit-mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
c29-snooze .sz-ruler:focus-visible { box-shadow: var(--focus); }
c29-snooze .sz-ticks { position: absolute; inset: 0; }
c29-snooze .sz-ticks i { position: absolute; bottom: 14px; width: 2px; border-radius: 2px; background: var(--ink); translate: -1px 0; }
c29-snooze .sz-ticks em { position: absolute; bottom: 0; font: 600 10px/1 var(--font-ui); font-style: normal; color: var(--ink-mute); translate: -50% 0; white-space: nowrap; }
c29-snooze .sz-mark { position: absolute; left: 50%; top: 6px; bottom: 10px; width: 3px; translate: -1.5px 0; border-radius: 3px; background: var(--accent); }

/* ======================================================
   COMPOSER  <c29-composer>   (clean-room, spec: ai-chat-input)
   pill → box on one springy curve; radius never changes
   ====================================================== */
c29-composer { display: block; --c-h: 52px; --c-open: 120px; }
c29-composer .cp-box { position: relative; min-height: var(--c-h); height: var(--c-h); border-radius: 26px; background: var(--raised);
  box-shadow: 0 0 0 1px var(--edge), var(--lift); transition: height var(--d4) var(--ease-give), box-shadow var(--d3) var(--ease); overflow: hidden;
  display: flex; flex-direction: column; }
c29-composer.is-open textarea { padding-bottom: 48px; }
c29-composer.is-open .cp-box { height: var(--c-open); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--accent) 60%, transparent), var(--lift-hi); }
c29-composer textarea { flex: 1; width: 100%; resize: none; border: 0; background: none; outline: none; padding: 14px 56px 12px 20px; font-size: 16px; line-height: 1.45; color: var(--ink); min-height: 0; }
c29-composer:not(.is-open) textarea { white-space: nowrap; overflow: hidden; }
c29-composer textarea::placeholder { color: var(--ink-mute); }
c29-composer .cp-tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 6px; padding: 0 12px 10px; opacity: 0; transform: translateY(6px);
  transition: opacity var(--d2) var(--ease), transform var(--d3) var(--ease); pointer-events: none; overflow-x: auto; scrollbar-width: none; margin-right: 54px; }
c29-composer.is-open .cp-tools { opacity: 1; transform: none; pointer-events: auto; transition-delay: var(--d1); }
c29-composer .cp-tools .t-chip { min-height: 32px; padding: 0 12px; font-size: 13px; flex: none; }
c29-composer .cp-send { position: absolute; right: 6px; bottom: 6px; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: transparent; color: var(--ink-mute); transition: background var(--d3) var(--ease), color var(--d3) var(--ease), transform var(--d1) var(--ease); }
c29-composer .cp-send svg { position: absolute; width: 20px; height: 20px; transition: opacity var(--d2) var(--ease), transform var(--d3) var(--ease-give); }
c29-composer .cp-send .send { opacity: 0; transform: translateY(8px) scale(.6); }
c29-composer.has-text .cp-send { background: var(--ink); color: var(--bg); }
c29-composer.has-text .cp-send .mic { opacity: 0; transform: scale(.6); }
c29-composer.has-text .cp-send .send { opacity: 1; transform: none; }
c29-composer.is-sent .cp-send { transform: translateY(-4px) scale(.92); }
c29-composer .cp-ctx { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13px; color: var(--ink-mute); min-height: 20px; }
c29-composer .cp-ctx:empty { display: none; }

/* ======================================================
   FEEDBACK BAR  <c29-feedback>   (clean-room, spec: feedback-bar)
   one bar changing shape; width eases to measured content
   ====================================================== */
c29-feedback { display: inline-block; max-width: 100%; }
c29-feedback .fb { display: inline-flex; align-items: center; overflow: hidden; border-radius: 26px; background: var(--surface); box-shadow: var(--hair);
  min-height: 52px; transition: width var(--d4) var(--ease), height var(--d4) var(--ease); max-width: 100%; }
c29-feedback .fb-in { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 16px; flex-wrap: wrap; animation: t-in var(--d3) var(--ease) both; }
c29-feedback .fb-in > span { font-size: 15px; font-weight: 550; margin-right: 4px; }
c29-feedback .fb-thumb { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--ink-soft);
  transition: background var(--d2) var(--ease), transform var(--d3) var(--ease-give); }
c29-feedback .fb-thumb:hover { background: var(--wash); }
c29-feedback .fb-thumb.is-on { background: var(--accent); color: var(--on-accent); animation: t-pop var(--d4) var(--ease-give); }
c29-feedback .fb-thumb.is-shake { background: var(--ink); color: var(--bg); animation: t-shake var(--d4) var(--ease); }
c29-feedback .fb-reasons { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 6px; width: 100%; }
@keyframes t-in { from { opacity: 0; filter: blur(4px); transform: translateY(4px); } }
@keyframes t-pop { 40% { transform: scale(1.18); } }

/* ======================================================
   DECISION INBOX  <c29-inbox>   (clean-room, specs: activity-stack + access-request)
   stacked by depth; press opens into the list; rows approve/dismiss
   ====================================================== */
c29-inbox { display: block; --peek: 10px; }
c29-inbox .ib-pile { position: relative; display: block; width: 100%; border: 0; padding: 0; background: none; text-align: left; cursor: pointer; color: inherit;
  height: calc(92px + 2 * var(--peek)); transition: height var(--d4) var(--ease); }
c29-inbox .ib-card { position: absolute; left: 0; right: 0; bottom: 0; height: 92px; border-radius: var(--corner); background: var(--raised); box-shadow: var(--lift);
  padding: 14px 16px; display: flex; gap: 12px; align-items: center; transform-origin: 50% 0;
  transition: transform var(--d5) var(--ease-give), opacity var(--d4) var(--ease); }
c29-inbox .ib-card .ib-av { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
c29-inbox .ib-card .ib-av.money { background: color-mix(in srgb, var(--money) 14%, var(--surface)); color: var(--money); }
c29-inbox .ib-card .ib-t { min-width: 0; flex: 1; }
c29-inbox .ib-card .ib-t b { display: block; font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
c29-inbox .ib-card .ib-t span { display: block; font-size: 13px; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
c29-inbox .ib-badge { position: absolute; z-index: 9; top: -6px; right: 10px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 99px; background: var(--money); color: var(--on-money);
  font: 700 13px/26px var(--font-ui); text-align: center; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 3px var(--bg); transition: transform var(--d3) var(--ease-give); }
c29-inbox .ib-badge.bump { transform: scale(1.25); }
c29-inbox.is-open .ib-pile { height: 64px; }
c29-inbox .ib-card.ib-fold { height: 64px; background: var(--accent-soft); box-shadow: var(--hair); }
c29-inbox .ib-list { display: grid; gap: 8px; margin-top: var(--s3); }
c29-inbox .ib-row { display: grid; grid-template-columns: 40px 1fr; gap: 6px 12px; align-items: center; padding: 12px 12px 12px 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--hair);
  transition: opacity var(--d3) var(--ease), transform var(--d4) var(--ease), grid-template-rows var(--d4) var(--ease); }
c29-inbox .ib-row .ib-av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
c29-inbox .ib-row .ib-av.money { background: color-mix(in srgb, var(--money) 14%, var(--surface)); color: var(--money); }
c29-inbox .ib-row .ib-t b { display: block; font-size: 15px; font-weight: 650; }
c29-inbox .ib-row .ib-t span { display: block; font-size: 13px; color: var(--ink-mute); }
c29-inbox .ib-row .ib-acts { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
c29-inbox .ib-row.is-out { opacity: 0; transform: translateX(40px) scale(.98); }
c29-inbox .ib-row.is-out-l { opacity: 0; transform: translateX(-40px) scale(.98); }
c29-inbox .ib-empty { text-align: center; padding: var(--s6); color: var(--ink-mute); border-radius: var(--corner); box-shadow: inset 0 0 0 1.5px var(--edge); }

/* ======================================================
   BUY  <c29-buy>   (clean-room, spec: pay-button) — one shape the whole way
   ====================================================== */
c29-buy { display: block; }
c29-buy .by { position: relative; display: flex; align-items: center; justify-content: center; margin: 0 auto; width: 100%; height: 56px; border: 0; border-radius: 28px;
  background: var(--money); color: var(--on-money); font-weight: 700; font-size: 16px; cursor: pointer; overflow: hidden;
  transition: width var(--d4) var(--ease-sheet), background var(--d3) var(--ease), transform var(--d1) var(--ease); }
c29-buy .by:active { transform: scale(.98); }
c29-buy .by-l { display: flex; align-items: center; gap: 8px; white-space: nowrap; transition: opacity var(--d2) var(--ease), filter var(--d2) var(--ease); }
c29-buy .by-l svg { width: 16px; height: 16px; }
c29-buy .by-price { font-variant-numeric: tabular-nums; padding-left: 8px; margin-left: 2px; border-left: 1px solid color-mix(in srgb, currentColor 35%, transparent); }
c29-buy .by-track { position: absolute; left: 22px; right: 22px; top: 50%; height: 3px; translate: 0 -50%; border-radius: 3px; background: color-mix(in srgb, currentColor 25%, transparent); opacity: 0; overflow: hidden; }
c29-buy .by-track::after { content: ""; position: absolute; inset: 0; width: 40%; border-radius: 3px; background: currentColor; translate: -100% 0; }
c29-buy .by-ok { position: absolute; display: flex; align-items: center; gap: 8px; opacity: 0; white-space: nowrap; }
c29-buy .by-ok path { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset var(--d4) var(--ease) var(--d3); }
c29-buy[data-state="processing"] .by { width: 128px; }
c29-buy[data-state="processing"] .by-l { opacity: 0; filter: blur(3px); }
c29-buy[data-state="processing"] .by-track { opacity: 1; transition: opacity var(--d2) var(--ease) var(--d3); }
c29-buy[data-state="processing"] .by-track::after { animation: t-run calc(1100ms / var(--speed)) var(--ease) infinite; }
c29-buy[data-state="success"] .by { background: var(--ok); color: var(--on-ok); }
c29-buy[data-state="success"] .by-l { opacity: 0; }
c29-buy[data-state="success"] .by-ok { opacity: 1; transition: opacity var(--d3) var(--ease) var(--d3); }
c29-buy[data-state="success"] .by-ok path { stroke-dashoffset: 0; }
c29-buy .by-meta { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--ink-mute); flex-wrap: wrap; text-align: center; }
c29-buy .by-receipt { margin-top: 10px; }
@keyframes t-run { to { translate: 260% 0; } }

/* ======================================================
   UPGRADE / RESET / LAPSED  <c29-upgrade>
   ====================================================== */
c29-upgrade { display: grid; position: relative; border-radius: var(--corner); overflow: hidden; box-shadow: var(--hair); background: var(--surface); }
c29-upgrade .up-preview, c29-upgrade .up-gate { grid-area: 1 / 1; }
c29-upgrade .up-preview { padding: var(--s5); filter: blur(5px) saturate(.8); opacity: .55; pointer-events: none; user-select: none; }
c29-upgrade[data-unlocked] .up-preview { filter: none; opacity: 1; pointer-events: auto; transition: filter var(--d5) var(--ease), opacity var(--d5) var(--ease); }
c29-upgrade .up-gate { display: grid; place-items: center; padding: var(--s4); transition: opacity var(--d3) var(--ease); }
c29-upgrade[data-unlocked] .up-gate { opacity: 0; pointer-events: none; }
c29-upgrade .up-card { max-width: 320px; width: 100%; text-align: center; display: grid; gap: 10px; justify-items: center; padding: var(--s5); }
c29-upgrade .up-card .t-pane { padding: 0; }
c29-upgrade .up-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--sun-100); color: #8a5a17; }
[data-theme="dark"] c29-upgrade .up-ic { background: #3a2a14; color: var(--sun-300); }
c29-upgrade h3 { font-size: var(--fs-lg); }
c29-upgrade p { font-size: 14px; color: var(--ink-soft); }

/* ======================================================
   ACCOUNT  <c29-account>
   ====================================================== */
c29-account { display: inline-block; position: relative; flex: none; }
c29-account > .t-btn { padding: 0 14px; }
c29-account .ac-av { width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; padding: 3px; background: conic-gradient(from 200deg, var(--sea-300), var(--sun-300), var(--sea-300)); }
c29-account .ac-av span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--raised); font-weight: 750; font-size: 15px; color: var(--ink); }
c29-account [popover] { position: fixed; inset: auto; margin: 0; border: 0; padding: 8px; min-width: 240px; border-radius: 18px; background: var(--pane-strong);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 0 0 1px var(--pane-edge), var(--lift-hi); color: var(--ink);
  opacity: 0; transform: translateY(-6px) scale(.97); transform-origin: 100% 0;
  transition: opacity var(--d2) var(--ease), transform var(--d3) var(--ease-give), display var(--d3) allow-discrete, overlay var(--d3) allow-discrete; }
c29-account [popover]:popover-open { opacity: 1; transform: none; }
@starting-style { c29-account [popover]:popover-open { opacity: 0; transform: translateY(-6px) scale(.97); } }
c29-account .ac-who { padding: 10px 12px 12px; border-bottom: 1px solid var(--edge-soft); margin-bottom: 6px; }
c29-account .ac-who b { display: block; font-size: 15px; } c29-account .ac-who span { font-size: 13px; color: var(--ink-mute); }
c29-account .ac-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: none; cursor: pointer; font-size: 15px; text-align: left; color: var(--ink); }
c29-account .ac-item:hover { background: var(--wash); }
.c29-if-member, .c29-if-anon { display: contents; }
html[data-session="anon"] .c29-if-member, html:not([data-session="anon"]) .c29-if-anon { display: none; }

/* ======================================================
   ONE-TIME CODE  <c29-otp>   [MIT-PORT one-time-code: one real input under six drawn cells]
   ====================================================== */
c29-otp { display: block; position: relative; max-width: 360px; }
c29-otp input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 17px; letter-spacing: 2em; caret-color: transparent; border: 0; z-index: 2; }
c29-otp .otp-cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
c29-otp .otp-cells i { height: 58px; border-radius: 14px; background: var(--raised); box-shadow: 0 0 0 1px var(--edge); display: grid; place-items: center; font: 700 24px/1 var(--font-display); font-style: normal;
  font-variant-numeric: tabular-nums; transition: box-shadow var(--d2) var(--ease), transform var(--d3) var(--ease-give), border-radius var(--d4) var(--ease), background var(--d3) var(--ease); }
c29-otp .otp-cells i.is-cur { box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 5px color-mix(in srgb, var(--accent) 15%, transparent); }
c29-otp .otp-cells i.is-cur::after { content: ""; width: 2px; height: 24px; background: var(--accent); animation: t-blink 1s steps(1) infinite; }
c29-otp .otp-cells i.pop { transform: scale(1.08); }
c29-otp[data-state="ok"] .otp-cells { gap: 0; transition: gap var(--d4) var(--ease); }
c29-otp[data-state="ok"] .otp-cells i { border-radius: 0; background: var(--accent-soft); box-shadow: none; color: var(--accent-text); }
c29-otp[data-state="ok"] .otp-cells i:first-child { border-radius: 14px 0 0 14px; } c29-otp[data-state="ok"] .otp-cells i:last-child { border-radius: 0 14px 14px 0; }
c29-otp[data-state="bad"] .otp-cells { animation: t-shake var(--d4) var(--ease); }
c29-otp[data-state="bad"] .otp-cells i { box-shadow: 0 0 0 1.5px var(--bad); }
@keyframes t-blink { 50% { opacity: 0; } }

/* ======================================================
   COPY FIELD  <c29-copy>   (clean-room, spec: copy-field)
   ====================================================== */
c29-copy { min-width: 0; display: flex; align-items: center; gap: 4px; min-height: 52px; padding: 4px 4px 4px 16px; border-radius: var(--r-md); background: var(--sunken); box-shadow: inset 0 0 0 1px var(--edge-soft); max-width: 100%; }
c29-copy code { flex: 1; min-width: 0; font: 500 14px/1.3 var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative;
  background: linear-gradient(90deg, var(--ink) 0 40%, var(--accent) 50%, var(--ink) 60%) 100% 0/250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
c29-copy.is-copied code { animation: t-sweep calc(700ms / var(--speed)) var(--ease) 1 both; }
c29-copy button { position: relative; width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--raised); box-shadow: var(--hair); cursor: pointer; display: grid; place-items: center; flex: none; color: var(--ink-soft); }
c29-copy button svg { position: absolute; width: 18px; height: 18px; transition: opacity var(--d2) var(--ease), transform var(--d2) var(--ease); }
c29-copy button .pg-b { transform: translate(2px, -2px); }
c29-copy button .ok { opacity: 0; color: var(--accent); }
c29-copy button .ok path { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset var(--d3) var(--ease) var(--d2); }
c29-copy.is-copied .pg-b { transform: none; opacity: 0; } c29-copy.is-copied .pg-f { opacity: 0; transition-delay: var(--d1); }
c29-copy.is-copied .ok { opacity: 1; transition-delay: var(--d1); } c29-copy.is-copied .ok path { stroke-dashoffset: 0; }

/* ======================================================
   CONNECT  <c29-connect>
   ====================================================== */
c29-connect { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--hair); position: relative; overflow: hidden; }
c29-connect .cn-logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--sunken); font-weight: 800; font-size: 16px; color: var(--ink-soft); }
c29-connect .cn-t b { display: block; font-size: 15px; font-weight: 650; }
c29-connect .cn-t span { display: block; font-size: 13px; color: var(--ink-mute); min-height: 18px; }
c29-connect .cn-bar { position: absolute; left: 0; bottom: 0; height: 2.5px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; transition: transform var(--d5) var(--ease); }
c29-connect[data-state="syncing"] .cn-bar { transform: scaleX(.7); transition-duration: calc(1400ms / var(--speed)); }
c29-connect[data-state="on"] .cn-bar { transform: scaleX(1); opacity: 0; transition: transform var(--d3) var(--ease), opacity var(--d4) var(--ease) var(--d3); }
c29-connect[data-state="on"] .cn-logo { background: var(--accent-soft); color: var(--accent); }

/* ---------- recover / reset prompt ---------- */
c29-recover { display: block; }

/* ======================================================
   SKELETON / SHIMMER (clean-room, specs: skeleton-morph, shimmer-text)
   ====================================================== */
.t-skel { position: relative; overflow: hidden; border-radius: 10px; background: var(--sunken); min-height: 14px; }
.t-skel::after { content: ""; position: absolute; inset: 0; translate: -100% 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--sun-100) 55%, transparent), transparent); animation: t-wave calc(var(--shimmer-period) / var(--speed)) var(--ease) infinite; }
[data-theme="dark"] .t-skel::after { background: linear-gradient(90deg, transparent, rgba(220,240,255,.06), transparent); }
@keyframes t-wave { 60%, 100% { translate: 100% 0; } }
.t-shimmer { background: linear-gradient(90deg, var(--ink-mute) 0 35%, var(--ink) 50%, var(--ink-mute) 65%) 0 0/250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: t-sweep calc(var(--shimmer-period) / var(--speed)) linear infinite; }
.t-morph > * { animation: t-rise var(--d5) var(--ease) both; }
.t-morph > *:nth-child(2) { animation-delay: calc(80ms / var(--speed)); } .t-morph > *:nth-child(3) { animation-delay: calc(160ms / var(--speed)); }
.t-morph > *:nth-child(4) { animation-delay: calc(240ms / var(--speed)); }
@keyframes t-rise { from { opacity: 0; transform: translateY(8px); filter: blur(5px); } }

/* ======================================================
   TRACE / TIMELINE  <c29-trace>   (clean-room, spec: thinking) + [MIT-PORT step-player dots]
   ====================================================== */
c29-trace { display: block; }
c29-trace .tr-head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; font-size: 15px; font-weight: 650; color: var(--ink); }
c29-trace .tr-head svg { transition: transform var(--d3) var(--ease); }
c29-trace[data-folded] .tr-head svg.chev { transform: rotate(-90deg); }
c29-trace .tr-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--d5) var(--ease); }
c29-trace[data-folded] .tr-body { grid-template-rows: 0fr; }
c29-trace .tr-body > ol { overflow: hidden; margin: 0; padding: 0; list-style: none; }
c29-trace li { position: relative; padding: 0 0 18px 34px; animation: t-rise var(--d4) var(--ease) both; }
c29-trace li::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: -2px; width: 2px; border-radius: 2px; background: var(--edge); }
c29-trace li:last-child::before { display: none; }
c29-trace li .dot { position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--raised); box-shadow: inset 0 0 0 2px var(--accent); }
c29-trace li[data-s="done"] .dot { background: var(--accent); box-shadow: none; }
c29-trace li[data-s="done"] .dot::after { content: ""; position: absolute; left: 5px; top: 3px; width: 4px; height: 7px; border: solid var(--on-accent); border-width: 0 2px 2px 0; rotate: 45deg; }
c29-trace li[data-s="run"] .dot { animation: t-breathe 1.6s var(--ease) infinite; }
c29-trace li[data-s="wait"] .dot { box-shadow: inset 0 0 0 2px var(--sun-500); background: var(--sun-100); }
c29-trace li b { display: block; font-size: 15px; font-weight: 600; }
c29-trace li span { display: block; font-size: 13px; color: var(--ink-mute); }
c29-trace li .tr-acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
c29-trace li .tr-note { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; color: var(--ink-soft); animation: t-rise var(--d4) var(--ease) both; }
@keyframes t-breathe { 50% { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent); } }

/* ---------- checklist  [MIT-PORT checklist: box fills, tick draws, words strike] ---------- */
.t-check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-size: 15px; }
.t-check input { appearance: none; width: 24px; height: 24px; border-radius: 8px; box-shadow: inset 0 0 0 1.5px var(--edge); margin: 0; flex: none; display: grid; place-items: center; cursor: pointer;
  transition: background var(--d2) var(--ease), box-shadow var(--d2) var(--ease); }
.t-check input::after { content: ""; width: 6px; height: 11px; border: solid var(--on-accent); border-width: 0 2.2px 2.2px 0; rotate: 45deg; translate: 0 -1px; scale: 0; transition: scale var(--d3) var(--ease-give); }
.t-check input:checked { background: var(--accent); box-shadow: none; }
.t-check input:checked::after { scale: 1; }
.t-check span { background: linear-gradient(currentColor, currentColor) 0 55%/0% 1.5px no-repeat; transition: background-size var(--d4) var(--ease), color var(--d3) var(--ease); }
.t-check input:checked + span { background-size: 100% 1.5px; color: var(--ink-mute); }

/* ---------- tune panel ---------- */
.t-tune { display: grid; gap: var(--s4); }
.t-tune .tn-row { display: grid; grid-template-columns: 76px 1fr 46px; align-items: center; gap: 10px; font-size: 14px; }
.t-tune .tn-row output { font-variant-numeric: tabular-nums; color: var(--ink-mute); text-align: right; font-size: 13px; }
.t-tune input[type=range] { width: 100%; accent-color: var(--accent); height: 44px; margin: 0; }
.t-tune .tn-sw { display: flex; gap: 8px; flex-wrap: wrap; }
.t-tune .tn-sw button { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.t-tune .tn-sw button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }

} /* end components */

@layer c29.utilities {
  .vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- reduced motion: ONE GLOBAL GATE (Rev 4 item 5) ----------
   Keep states, lose the travel; springs collapse to fades. The
   effective mode is resolved ONCE by tide.js — a stored user
   override (sh29core_motion) wins over the OS in either direction;
   no stored override follows the OS — and published as
   <html data-motion="reduced"|"full">. The media-query block below
   therefore stands down the moment the user has explicitly chosen
   "full", and the [data-motion="reduced"] block applies the same
   collapse when the user chose reduced against a full-motion OS.
   The duration scale itself is zeroed at the token layer
   (tokens.css), and every JS-driven animation consults
   Tide.reduced() — the gate is a system feature, not a per-surface
   negotiation. */
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="full"]) *, html:not([data-motion="full"]) *::before, html:not([data-motion="full"]) *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important;
    transition-property: opacity, background-color, color, box-shadow !important; transition-duration: 160ms !important; }
  html:not([data-motion="full"]) .t-shimmer, html:not([data-motion="full"]) c29-slide .sl-label span { animation: none !important; color: var(--ink-soft) !important; background: none !important; }
  @view-transition { navigation: none; }
}
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important;
  transition-property: opacity, background-color, color, box-shadow !important; transition-duration: 160ms !important; }
html[data-motion="reduced"] .t-shimmer, html[data-motion="reduced"] c29-slide .sl-label span { animation: none !important; color: var(--ink-soft) !important; background: none !important; }

/* ============================================================
 * REV 2 — mined from the AccountabilityPals First-Name pages
 * (PALS-INVENTORY-2026-10-17.md). Patterns generalized, costumes
 * left behind; every value a token.
 * ============================================================ */

/* ---------- c29-sweep + c29-sweep-entry: the dated update board ----------
   Rev 4 overhaul (2026-10-18; the Principal's steering: "the sweep is
   shit and needs a full overhaul"). A timeline board: date medallions
   ride a rail, facts read as a spec sheet, and today is the one coral
   day. The date state machine is unchanged — past fades + Done, today
   is coral + Today, an all-past board declares itself stale — only
   the presentation was rebuilt, a full tier up.
   Every value below is a real token. The Rev 2 block named tokens
   that never existed (--hairline, --shadow-pop, --r-lg, a rise/fadein
   keyframe pair), so its borders, shadows and radii silently never
   rendered; that, not taste, is why the trio read flat. */
c29-sweep { display: block; }
c29-sweep .sw-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
c29-sweep .sw-head h3 { font: 700 19px/1.2 var(--font-display); letter-spacing: -.01em; }
c29-sweep .sw-range { flex: none; margin-top: 1px; }
c29-sweep .sw-checked { display: flex; align-items: center; gap: 6px; margin-top: var(--s1); font-size: 12.5px; color: var(--ink-mute); }
c29-sweep .sw-checked .t-icon { width: 14px; height: 14px; flex: none; }
c29-sweep .sw-entries { position: relative; margin-top: var(--s4); display: grid; gap: var(--s4); }
c29-sweep .sw-entries::before { content: ""; position: absolute; top: 12px; bottom: 12px; left: 26px; width: 2px; border-radius: 2px;
  background: color-mix(in srgb, var(--ink-1) 9%, transparent); }
c29-sweep-entry { position: relative; display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: var(--s3); }
c29-sweep-entry .se-medal { position: relative; z-index: 1; width: 54px; height: 54px; border-radius: 17px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--sunken); color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--edge-soft); }
c29-sweep-entry .se-medal b { font: 800 19px/1 var(--font-display); letter-spacing: -.01em; }
c29-sweep-entry .se-medal span { margin-top: 3px; font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
c29-sweep-entry .se-medal .t-icon { width: 22px; height: 22px; }
c29-sweep-entry .se-main { min-width: 0; padding-top: 3px; }
c29-sweep-entry .se-top { display: flex; align-items: baseline; gap: var(--s2); }
c29-sweep-entry .se-title { font-weight: 700; font-size: 15.5px; line-height: 1.3; }
c29-sweep-entry .se-tag { margin-left: auto; flex: none; }
c29-sweep-entry .se-when { margin-top: 1px; font-size: 13px; font-weight: 650; color: var(--ink-soft); }
c29-sweep-entry .se-body { margin-top: 3px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
c29-sweep-entry .se-kvs { margin-top: var(--s2); }
c29-sweep-entry .se-kv { display: flex; gap: var(--s3); padding: 6px 0; border-top: 1px solid var(--edge-soft); font-size: 13.5px; line-height: 1.45; }
c29-sweep-entry .se-kv:last-child { border-bottom: 1px solid var(--edge-soft); }
c29-sweep-entry .se-kv b { flex: none; min-width: 48px; padding-top: 2px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-mute); }
c29-sweep-entry .se-src { margin-top: var(--s2); font-size: 13px; font-weight: 650; }
c29-sweep-entry .se-src a { text-decoration: none; }
c29-sweep-entry[data-state="past"] { opacity: .6; }
c29-sweep-entry[data-state="past"] .se-medal { background: transparent; }
c29-sweep-entry[data-state="today"] .se-medal { background: linear-gradient(155deg, var(--29d-coral-500), var(--money));
  color: var(--on-money); box-shadow: var(--lift); }
c29-sweep-entry[data-state="today"] .se-main { margin: calc(-1 * var(--s2)) calc(-1 * var(--s3)); padding: calc(var(--s2) + 3px) var(--s3) var(--s2);
  border-radius: var(--r-md); background: color-mix(in srgb, var(--money) 6%, transparent);
  box-shadow: inset 3px 0 0 var(--money); }
c29-sweep .sw-cadence { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--edge-soft);
  font-size: 13px; color: var(--ink-soft); }
c29-sweep[data-state="stale"] .sw-cadence { display: inline-block; padding: 7px 13px; border-top: 0; border-radius: var(--r-pill);
  background: var(--warn-bg); color: var(--warn-text); font-weight: 650; }
c29-sweep .sw-note { margin-top: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-md);
  background: var(--sunken); font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
c29-sweep .sw-note:empty { display: none; }

/* ---------- c29-gift: the present / drawer ----------
   One component, two modes (inline box | announce bar -> sheet
   drawer), one seen-store, presence owned by the host page through
   html[data-gift-open]; the bar stands down while the mini player
   docks. Rev 4 (2026-10-18: "the gift doesn't open or confetti or
   anything") gives the open its moment: ONE master progress value
   (--gp, 0..1) driven by a rAF clock in tide.js flies the lid, swells
   the box and fades the ribbon; at p=.42 a tasteful confetti burst
   fires (canvas, token colors, ~1.2s, sound off, one buzz) and the
   reveal rises in behind it. Reduced motion — or a gift restored as
   already opened — skips the sequence entirely: instant reveal, no
   confetti, at most the static settle of the end state. */
/* Box internals are scoped to .gift-box, never to the element: the
   drawer path MOVES the box into Tide.sheet's <dialog>, out from
   under <c29-gift> — element-scoped rules silently stopped applying
   there (the Rev 2 drawer box rendered naked). The box mirrors the
   component's state + costume on itself for the same reason. */
c29-gift { display: block; }
.gift-box { position: relative; text-align: center; padding: var(--s2) 0; }
.gift-box .gift-kicker { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--money-text); }
.gift-box .gift-title { margin-top: var(--s2); font: 700 19px/1.25 var(--font-display); letter-spacing: -.01em; }
.gift-box .gift-stage { position: relative; width: 120px; height: 106px; margin: var(--s4) auto var(--s1); }
.gift-box .gift-shadow { position: absolute; left: 50%; bottom: 0; width: 78px; height: 12px; transform: translateX(-50%);
  border-radius: 50%; background: color-mix(in srgb, var(--ink-1) 16%, transparent); filter: blur(5px); }
.gift-box .gift-present { --gp: 0; position: absolute; left: 50%; top: 8px; width: 88px; height: 88px; margin-left: -44px;
  display: grid; place-items: center; border: 0; border-radius: 20px; cursor: pointer; color: var(--money-text);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 26%, var(--surface)), color-mix(in srgb, var(--accent) 12%, var(--surface)));
  box-shadow: inset 0 0 0 1px var(--edge-soft);
  transform: scale(calc(1 + var(--gp) * .07)); }
.gift-box .gift-present::before { content: ""; position: absolute; left: -5px; right: -5px; top: -7px; height: 25px; border-radius: 9px;
  background: linear-gradient(160deg, var(--29d-coral-500), var(--money)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink-1) 8%, transparent);
  transform-origin: 10% 90%;
  transform: rotate(calc(var(--gp) * -26deg)) translate(calc(var(--gp) * -16px), calc(var(--gp) * -24px));
  opacity: calc(1 - var(--gp) * .92);
  transition: transform var(--d2) var(--ease), opacity var(--d2) var(--ease); }
.gift-box .gift-present::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 15px; margin-left: -7.5px;
  border-radius: 2px; background: linear-gradient(180deg, var(--29d-coral-500), var(--money));
  opacity: calc(1 - var(--gp) * .5); transition: opacity var(--d2) var(--ease); }
.gift-box[data-state="opening"] .gift-present::before, .gift-box[data-state="opening"] .gift-present::after { transition: none; }
.gift-box .gift-present .t-icon { position: relative; z-index: 1; width: 34px; height: 34px; margin-top: 10px; }
.gift-box .gift-present:active { transform: scale(calc(.94 + var(--gp) * .07)); }
/* the waiting life is a breathing shadow, never a moving tap target:
   the present sits still (agents and thumbs alike get a stable hit
   area — Bot Manners rule 76) while its ground shadow breathes. */
.gift-box[data-state="waiting"] .gift-shadow, .gift-box[data-state="panel"] .gift-shadow { animation: gift-bob 3.4s ease-in-out infinite; }
@keyframes gift-bob { 0%, 100% { transform: translateX(-50%) scaleX(1); opacity: 1; } 50% { transform: translateX(-50%) scaleX(.84); opacity: .55; } }
.gift-box .gift-confetti { position: absolute; z-index: 6; pointer-events: none; }
.gift-box .gift-hint { min-height: 20px; margin-top: var(--s2); font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.gift-box .gift-reveal { margin-top: var(--s3); text-align: left; }
.gift-box .gift-reveal[hidden] { display: none; }
.gift-box .gift-reveal .t-stack > * { animation: t-rise var(--d3) var(--ease) both; }
.gift-box .gift-actions { display: flex; gap: var(--s2); justify-content: center; margin-top: var(--s4); }
c29-gift.gift-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--s3) + var(--safe-b)); z-index: 75;
  width: min(calc(100% - 2 * var(--s4)), 560px); min-height: 60px;
  display: flex; align-items: center; gap: var(--s3); text-align: left;
  padding: var(--s2) var(--s4) var(--s2) var(--s3); border-radius: var(--corner);
  background: var(--surface); border: 1px solid var(--edge-soft); box-shadow: var(--lift);
  animation: t-rise var(--d2) var(--ease); }
html[data-player="mini"] c29-gift.gift-bar { display: none; } /* stand-down: one floating bar at a time */
c29-gift[hidden], c29-gift.gift-bar[hidden] { display: none; } /* author display rules must never beat [hidden] */
c29-gift.gift-bar .t-icon { width: 26px; height: 26px; color: var(--accent-text); flex: none; }
c29-gift .gb-open { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: var(--s3); text-align: left; border: 0; background: none; cursor: pointer; }
c29-gift .gb-x { flex: none; width: 40px; height: 44px; display: grid; place-items: center; border: 0; background: none; border-radius: 99px; color: var(--ink-soft); cursor: pointer; }
c29-gift .gb-x .t-icon { width: 19px; height: 19px; color: var(--ink-soft); }
c29-gift .gift-bar-tx { flex: 1; min-width: 0; }
c29-gift .gift-bar-tx b { display: block; font-size: 14.5px; font-weight: 700; }
c29-gift .gift-bar-tx span { display: block; font-size: 12.5px; color: var(--ink-mute); }
c29-gift[theme="gameboy"] { --gift-a: #9BBC0F; --gift-b: #0F380F; }
.gift-box[data-costume="gameboy"] { --gift-a: #9BBC0F; --gift-b: #0F380F; }
.gift-box[data-costume="gameboy"] .gift-present { background: var(--gift-a); border: 3px solid var(--gift-b); border-radius: 6px; color: var(--gift-b); box-shadow: none; }
.gift-box[data-costume="gameboy"] .gift-present::before { background: var(--gift-b); box-shadow: none; border-radius: 4px; }
.gift-box[data-costume="gameboy"] .gift-present::after { background: var(--gift-b); }
c29-gift[theme="gameboy"].gift-bar { background: var(--gift-a); border: 3px solid var(--gift-b); border-radius: 6px; box-shadow: none; }

/* ---------- c29-player: the listen player ----------
   Rev 4 visual overhaul (2026-10-18: "looks like ass and not as
   nice as Therese's") to the wc player standard of the pals' pages:
   a real stage card with artwork, a 22px title, bordered skip
   circles, a 58px coral play, and a seek you can SEE — a filled
   track painted from the component's own progress (--p, 0..1) over
   the range input, so the keyboard contract is the native one.
   Behavior is untouched Rev 2 law: Stop is split from Dismiss, the
   html[data-player] attribute + --player-slot-h own presence, the
   component formats chapters, persist="local" never autoplays,
   auto-advance stays OFF. (The Rev 2 CSS below this line also named
   dead tokens and a classless .t-range — the seek rendered as a
   naked browser input. Gone.) */
c29-player { display: block; }
c29-player .pl-stage { position: relative; overflow: hidden; padding: var(--s5);
  background: var(--raised); border-radius: calc(var(--corner) - 4px); box-shadow: var(--hair); }
c29-player .pl-stage::before { content: ""; position: absolute; inset: 0; background: var(--sheen); pointer-events: none; }
c29-player .pl-stage > * { position: relative; }
c29-player .pl-top { display: flex; align-items: center; gap: var(--s3); }
c29-player .pl-art, c29-player .pm-art { flex: none; position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 30% 20%, var(--sea-200), var(--sea-600) 78%); }
c29-player .pl-art::after, c29-player .pm-art::after { content: ""; position: absolute; inset: 0; background: var(--sheen); }
c29-player .pl-art[data-art="1"], c29-player .pm-art[data-art="1"] { background: radial-gradient(120% 120% at 30% 20%, var(--sun-300), var(--29d-coral-500) 80%); }
c29-player .pl-art[data-art="2"], c29-player .pm-art[data-art="2"] { background: radial-gradient(120% 120% at 70% 15%, var(--sea-300), var(--sea-700) 80%); }
c29-player .pl-art[data-art="3"], c29-player .pm-art[data-art="3"] { background: radial-gradient(120% 120% at 25% 25%, var(--sun-100), var(--sun-500) 82%); }
c29-player .pl-art { width: 52px; height: 52px; border-radius: 14px; box-shadow: var(--hair); }
c29-player .pl-id { flex: 1; min-width: 0; }
c29-player .pl-id .t-kicker { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent-text); }
c29-player .pl-show { margin-top: 1px; font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
c29-player .pl-title { margin-top: var(--s4); font: 750 22px/1.22 var(--font-display); letter-spacing: -.01em; }
c29-player .pl-note { margin-top: 3px; font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); }
c29-player .pl-note:empty { display: none; }
c29-player .pl-seek { margin-top: var(--s4); }
c29-player input[type="range"].pl-range { --p: 0; -webkit-appearance: none; appearance: none; display: block;
  width: 100%; height: 28px; margin: 0; padding: 0; background: transparent; cursor: pointer; }
c29-player .pl-range::-webkit-slider-runnable-track { height: 8px; border-radius: 99px;
  background: linear-gradient(90deg, var(--money) calc(var(--p) * 100%), var(--sunken) calc(var(--p) * 100%)); }
c29-player .pl-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin-top: -6px;
  border-radius: 50%; background: var(--raised); border: 1px solid var(--edge); box-shadow: var(--lift); }
c29-player .pl-range::-moz-range-track { height: 8px; border-radius: 99px; background: var(--sunken); }
c29-player .pl-range::-moz-range-progress { height: 8px; border-radius: 99px; background: var(--money); }
c29-player .pl-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%;
  background: var(--raised); border: 1px solid var(--edge); box-shadow: var(--lift); }
c29-player .pl-times { display: flex; justify-content: space-between; margin-top: 1px; }
c29-player .pl-t { font-size: 12px; font-weight: 600; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
c29-player .pl-t[data-now] { color: var(--ink-soft); }
c29-player .pl-ctl { display: flex; align-items: center; justify-content: center; gap: var(--s4); margin-top: var(--s3); }
c29-player .pl-skip { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--edge); background: transparent; color: var(--money-text);
  transition: transform var(--d1) var(--ease-give), background var(--d1) var(--ease); }
c29-player .pl-skip .t-icon { width: 23px; height: 23px; }
c29-player .pl-skip:active { background: var(--wash); transform: scale(.94); }
c29-player .pl-play { flex: none; width: 58px; height: 58px; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  color: var(--on-money); background: linear-gradient(155deg, var(--29d-coral-500), var(--money)); box-shadow: var(--lift);
  transition: transform var(--d1) var(--ease-give); }
c29-player .pl-play .t-icon { width: 25px; height: 25px; }
c29-player .pl-play:active { transform: scale(.93); }
c29-player .pl-err { margin-top: var(--s3); font-size: 13px; font-weight: 600; color: var(--bad-text); text-align: center; }
c29-player .pl-err[hidden] { display: none; }
c29-player .pl-listlab { margin-top: var(--s5); font-size: 12px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-mute); }
c29-player [data-list], c29-player [data-chaplist] { border-bottom: 1px solid var(--edge-soft); }
c29-player .pl-ep { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 52px;
  padding: var(--s3) 2px; border: 0; border-top: 1px solid var(--edge-soft); background: none; text-align: left; cursor: pointer; }
c29-player .pl-ep .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--accent); opacity: .35; }
c29-player .pl-ep.is-on .dot { background: var(--accent); opacity: 1; }
c29-player .pl-ep .tx { flex: 1; min-width: 0; display: grid; }
c29-player .pl-ep .tx b { font-size: 15px; font-weight: 650; line-height: 1.3; }
c29-player .pl-ep.is-on .tx b { color: var(--accent-text); }
c29-player .pl-ep .tx small { font-size: 13px; color: var(--ink-mute); }
c29-player .pl-ep .pl-dur { flex: none; padding-left: var(--s2); font-size: 12.5px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
c29-player .pl-chaplab { margin-top: var(--s4); font-size: 13px; color: var(--ink-soft); }
c29-player .pl-chap { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 44px;
  padding: var(--s2) 2px; border: 0; border-top: 1px solid var(--edge-soft); background: none; text-align: left; font-size: 14.5px; cursor: pointer; }
c29-player .pl-chap .ct { flex: none; padding: 3px 9px; border-radius: 99px; background: var(--accent-soft);
  color: var(--accent-text); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
c29-player .pl-chap.is-on .ct { background: var(--accent); color: var(--on-accent); }
c29-player .pl-chap.is-on .cl { font-weight: 700; }
c29-player .pl-mini { --p: 0; position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--s2) + var(--safe-b)); z-index: 80;
  width: min(calc(100% - 2 * var(--s3)), 560px); height: calc(var(--player-slot-h) - 8px);
  display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s3) 0 var(--s2); overflow: hidden;
  border-radius: 99px; background: var(--raised); border: 1px solid var(--edge-soft); box-shadow: var(--lift);
  animation: t-rise var(--d2) var(--ease); }
c29-player .pl-mini::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 4px; height: 3px; border-radius: 99px;
  background: linear-gradient(90deg, var(--money) calc(var(--p) * 100%), var(--wash-2) calc(var(--p) * 100%)); }
c29-player .pm-art { width: 34px; height: 34px; border-radius: 10px; }
c29-player .pl-mini[hidden] { display: none; }
c29-player .pm-play { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  color: var(--on-money); background: linear-gradient(155deg, var(--29d-coral-500), var(--money)); }
c29-player .pm-play .t-icon { width: 19px; height: 19px; }
c29-player .pm-words { flex: 1; min-width: 0; display: grid; text-align: left; padding: 2px 0; border: 0; background: none; cursor: pointer; }
c29-player .pm-words b { font-size: 14px; font-weight: 650; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
c29-player .pm-words small { font-size: 12px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
c29-player .pm-btn { flex: none; width: 40px; height: 44px; display: grid; place-items: center; border: 0; background: none; border-radius: 99px; color: var(--ink-soft); cursor: pointer; }
c29-player .pm-btn .t-icon { width: 19px; height: 19px; }
c29-player .pl-resume { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--s3) + var(--safe-b)); z-index: 79;
  display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s4); border-radius: 99px;
  background: var(--surface); border: 1px solid var(--edge-soft); box-shadow: var(--lift);
  font-weight: 650; font-size: 13.5px; animation: t-rise var(--d2) var(--ease); }
c29-player .pl-resume[hidden] { display: none; }

/* ============================================================
 * REV 5 — the Bencho steals (WO-TIDE-601/602/603), ported from
 * the tide-lab prototypes P2/P3/P1 in real Tide tokens. Every
 * behavior collapses under the global motion gate: tide.js
 * snaps the springs, glues the fill, and never arms the rise.
 * ============================================================ */

/* ---------- c29-progress: the activity island [MIT-PORT dynamic-island] ----------
   One black pill that IS the activity. Width, height and corner
   are written by tide.js from ONE spring scalar; the faces are
   absolutely placed over the morphing box and crossfade against
   that scalar. The island is a dark surface in both themes (its
   own --pg-bg), so its text colors are pinned locally, exactly
   as the prototype pinned them. */
c29-progress { display: block; }
c29-progress .pg-stage { display: flex; justify-content: center; min-height: 216px; padding-top: var(--s1); }
c29-progress .pg-island { --pg-bg: var(--ink-1); position: relative; flex: none; overflow: hidden; cursor: pointer;
  background: var(--pg-bg); color: #FBF7EF; box-shadow: var(--lift-hi); -webkit-tap-highlight-color: transparent; }
[data-theme="dark"] c29-progress .pg-island { --pg-bg: #050D14; }
c29-progress .pg-face { position: absolute; inset: 0; padding: 0 var(--s4); }
c29-progress .pg-compact { display: flex; align-items: center; gap: var(--s2); }
c29-progress .pg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sea-300); flex: none; }
c29-progress[data-state="paused"] .pg-dot { background: var(--sun-300); }
c29-progress .pg-compact .pg-label { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
c29-progress .pg-compact .pg-pct { margin-left: auto; font-variant-numeric: tabular-nums; color: #8DCABD;
  font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; }
c29-progress .pg-full { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
c29-progress .pg-full h3 { margin: 0; font-family: var(--font-display); font-size: var(--fs-lg); letter-spacing: var(--track-head); }
c29-progress .pg-detail { margin: 0; font-size: var(--fs-sm); color: #C7D2D6; font-variant-numeric: tabular-nums; }
c29-progress .pg-note { margin: 0; font-size: var(--fs-sm); color: #C7D2D6; }
/* flex-crush guard (WO-TIDE-601 regression, caught by the lab rig):
   the full face is a morphing flex column — without flex:none the
   bar shrinks to 0px tall mid-morph. The bar NEVER shrinks. */
c29-progress .pg-bar { flex: none; height: 6px; min-height: 6px; border-radius: 3px; background: rgba(255,255,255,.16); overflow: hidden; margin-top: var(--s1); }
c29-progress .pg-bar i { display: block; height: 100%; width: 0%; background: var(--sea-300); border-radius: 3px; }
c29-progress .pg-actions { margin-top: auto; display: flex; gap: var(--s2); flex: none; }
c29-progress .pg-btn { appearance: none; border: 0; cursor: pointer; min-height: 38px; padding: 0 var(--s4);
  border-radius: var(--r-pill); background: rgba(255,255,255,.14); color: #fff; font: 650 var(--fs-sm) var(--font-ui); }
c29-progress .pg-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--pg-bg), 0 0 0 4px var(--sea-300); }

/* ---------- .t-range: the range family [MIT-PORT slosh] ----------
   A pill track, a drawn handle, and a fill with weight: tide.js
   rides the handle 1:1 under the finger and chases it with the
   fill on a softer second spring (the skew is the liquid leaning
   into the move, driven by the fill spring's own velocity).
   overflow:hidden keeps a surging fill inside the pill. With a
   nested native input the input is the control (invisible, full
   size, focusable) and the drawn pieces are its picture. */
.t-range { position: relative; display: block; height: 56px; border-radius: var(--r-pill); background: var(--sunken);
  box-shadow: inset 0 0 0 1px var(--edge-soft); overflow: hidden; touch-action: none; cursor: grab; }
.t-range:active { cursor: grabbing; }
.t-range:focus-visible { outline: none; box-shadow: var(--focus); }
.t-range:focus-within { box-shadow: var(--focus); }
.t-range .tr-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: var(--r-pill);
  transform-origin: left center; background: linear-gradient(180deg, var(--sea-300), var(--sea-500)); pointer-events: none; }
.t-range .tr-handle { position: absolute; top: 50%; width: 48px; height: 48px; border-radius: 50%;
  background: var(--raised); box-shadow: var(--lift); transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center; gap: 3px; pointer-events: none; }
.t-range .tr-handle i { width: 3px; height: 16px; border-radius: 2px; background: var(--ink-4); }
.t-range input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: grab; }
.t-range input[type="range"]:active { cursor: grabbing; }

/* ---------- type in motion: [data-rise] ----------
   Words are split by tide.js (never pre-hidden in markup); the
   rise itself is one WAAPI pass armed only under full motion. */
[data-rise] .t-rise-w { display: inline-block; }

/* ============================================================
 * REV 6 — the peel (WO-TIDE-604), CEREMONY CLASS. The ceremony
 * doctrine (the Principal's ruling on Desk card
 * tide-ceremony-doctrine, consumed by buzzsaw R116): ceremony
 * surfaces (gift, front door, pricing) may carry one flourish;
 * work surfaces (approvals, decks, sheets) stay calm. These
 * styles serve c29-peel and c29-gift[reveal=peel] ONLY — both
 * stamp data-surface="ceremony" on the peel root. Geometry and
 * shading are the tide-lab P4 prototype's, in canonical tokens;
 * tide.js drives the fold, and under the motion gate the corner
 * is a plain toggle (JS snaps; nothing here animates).
 * ============================================================ */

/* ---------- the peel: shared geometry [CLEAN-ROOM page-peel] ---------- */
.peel-card { position: relative; border-radius: var(--corner); overflow: hidden; box-shadow: var(--lift);
  touch-action: none; background: var(--sea-100); }
.peel-under { position: absolute; inset: 0; padding: var(--s4);
  background: linear-gradient(160deg, var(--sea-100), var(--sea-200)); }
.peel-face { position: absolute; inset: 0; padding: var(--s5); background: var(--raised); }
.peel-flap { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(225deg, var(--sand-300), var(--sand-50) 55%, var(--sand-200));
  filter: drop-shadow(-5px 5px 7px rgba(74, 56, 28, .28)); visibility: hidden; }
.peel-hint { position: absolute; top: 0; right: 0; width: 74px; height: 74px; pointer-events: none;
  transition: opacity var(--d2) var(--ease); }
.peel-hint i { position: absolute; top: 0; right: 0; width: 0; height: 0; border-style: solid;
  border-width: 0 34px 34px 0; border-color: transparent var(--sand-200) transparent transparent; }
.peel-hint span { position: absolute; top: 30px; right: 8px; font-size: var(--fs-cap); font-weight: 700;
  letter-spacing: var(--track-cap); text-transform: uppercase; color: var(--ink-soft); } /* ink-soft, not ink-mute: the label must clear 4.5 on the card's sea ground in dark too (render-pass, Rev 6) */
.peel-btn { position: absolute; top: 0; right: 0; width: 84px; height: 84px; z-index: 3;
  appearance: none; border: 0; background: transparent; cursor: pointer; }
.peel-btn:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 0 var(--corner) 0 var(--corner); }
/* face + under typography (hosts may override; the under's key
   lines belong in the corner triangle the fold uncovers, laid
   out as a right-aligned staircase clear of the fold at rest) */
.peel-face h3 { margin: 0 0 var(--s2); font-family: var(--font-display); font-size: var(--fs-xl); letter-spacing: var(--track-head); }
.peel-face p { margin: 0; color: var(--ink-soft); max-width: 26ch; }
.peel-face .peel-price { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-2xl); color: var(--money-text); margin-top: var(--s3); }
.peel-face .peel-price span { font-size: var(--fs-body); color: var(--ink-mute); }
.peel-under h3 { margin: 0 0 var(--s2); font-family: var(--font-display); font-size: var(--fs-lg); letter-spacing: var(--track-head); color: var(--ink-1); }
.peel-under p { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.65; }
.peel-under .peel-note { margin-left: auto; width: 72%; text-align: right; }
.peel-under .peel-note p { line-height: 1.45; } /* tighter staircase pitch: each descending line drops one pitch closer to the 45deg fold — 1.45 keeps equal-width lines clear of it at rest (Rev 6 render-pass: the 1.65 pitch grazed by 2.7px) */
.peel-under .peel-note .nl { display: block; }

/* ---------- c29-peel: the ceremony reveal ---------- */
c29-peel { display: block; }
c29-peel .peel-card { height: var(--peel-h, 244px); }

/* ---------- c29-gift[reveal=peel]: the ceremony opening ----------
   The payload layer is IN FLOW (it sizes the card) under an
   absolute wrapping face that carries the present; the fold
   uncovers the real payload, and the open settle sweeps the
   face fully off. Scoped to .gift-box like every gift internal
   (the drawer path moves the box out from under the element). */
.gift-box .gift-peel { margin-top: var(--s4); text-align: left; background: var(--sunken); }
.gift-box .gift-peel .peel-under { position: relative; inset: auto; padding: var(--s4); background: none; }
.gift-box .gift-peel .gift-reveal { margin-top: 0; }
.gift-box .gift-peel-face { display: flex; align-items: center; justify-content: center; padding: var(--s4); }
.gift-box .gift-peel-face .gift-stage { margin: 0; }
