/* Act 3, "Vivi at work": the page turns into a dark devices stage (js/work.js).
   It enters from paper into near-black and leaves back to paper through two-stop oklch gradients. */
.work {
  --stage: light-dark(oklch(0.16 0.006 55), oklch(0.14 0.006 55)); /* basalt, dark in both themes; a step deeper than dark paper */
  --stage-floor: oklch(0.21 0.007 55);
  --stage-ink: oklch(0.95 0.01 85);
  --stage-ink-2: oklch(0.79 0.01 80);
  --stage-ink-3: oklch(0.66 0.01 230);
  --fade: 24dvh;
  position: relative; padding-block: var(--fade);
  color: var(--stage-ink);
  background: linear-gradient(in oklch to bottom, var(--paper), var(--stage) var(--fade), var(--stage) calc(100% - var(--fade)), var(--paper));
}
.work-fallback { max-width: 40rem; margin: 0 auto; padding: 4rem 1.25rem; }
.work-fallback p { color: var(--stage-ink-2); margin-top: 0.8rem; }
.work-track { position: relative; height: 640dvh; }
.work-stage {
  position: sticky; top: 0; height: 100dvh; overflow: clip;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: clamp(12px, 2.4dvh, 28px);
  padding: calc(var(--bar-h) + clamp(0.5rem, 2dvh, 1.5rem)) var(--inset) clamp(12px, 2.4dvh, 24px);
  /* a soft floor under the devices so their contact shadows read on the dark. It fades out INSIDE the stage (centre
     80 %, gone by ~96 %), and the stage's last 12 px fade out too, so when the pinned stage scrolls away nothing it
     paints (the floor, the devices' contact shadows) ends on the clip edge as a hard line (founder: "added edges again") */
  background: radial-gradient(60% 22% at 50% 80%, var(--stage-floor), transparent 72%);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 12px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 12px), transparent);
}

/* ---- copy: one short beat at a time, crossfading with a slight blur */
.work-copy { display: grid; max-width: 38rem; }
/* the old beat leaves fast (180 ms, accelerating), the new one follows (300 ms, decelerating) */
.work-beat { grid-area: 1 / 1; opacity: 0; filter: blur(6px); visibility: hidden; transition: opacity 0.18s var(--ease-exit), filter 0.18s var(--ease-exit), visibility 0s 0.18s; }
.work-beat[data-on] { opacity: 1; filter: none; visibility: visible; transition: opacity 0.3s var(--ease-enter) 0.1s, filter 0.3s var(--ease-enter) 0.1s, visibility 0s; }
.work-h { font: var(--display-wght) var(--step-3)/var(--head-lh) var(--font-display); letter-spacing: var(--head-track); text-wrap: balance; color: var(--stage-ink); }
/* the beats as Vivi's plan (.ds-plan, css/ds.css): the active step follows the scroll; placement only here */
.work-plan { grid-row: 2; margin-top: var(--ds-3); max-width: 30rem; }
.work-plan-i { inline-size: 1.05em; block-size: 1.05em; vertical-align: -0.15em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* short screens: the plan shows only the step it is on, so the devices keep their size */
@media (height < 760px) { .work-plan > li:not([data-status="active"]) { display: none; } .work-plan > li::before { content: none; } .work-plan { margin-top: var(--ds-2); } }

/* ---- the devices, side by side; whichever is working is lit, the other rests */
.work-devices {
  --dev-h: calc(100dvh - clamp(76px, 10dvh, 96px) - 13.5rem);
  display: flex; align-items: flex-end; justify-content: center; gap: clamp(28px, 4.5vw, 72px); min-height: 0;
}
.work-phone, .work-laptop { position: relative; transition: opacity 0.35s var(--ease-out), filter 0.35s var(--ease-out), scale 0.35s var(--ease-out); }
.work .vs-demo { margin: 0; }
.work-phone .vs-demo { width: clamp(220px, calc(var(--dev-h) * 0.47), 300px); }
.work-laptop .vs-demo--laptop { width: min(780px, calc(var(--dev-h) / 0.64), 62vw); }
/* desktop: the devices row is a size container, so the phone and laptop are sized from the height the stage really
   leaves them (after the bar, the copy and the fine print) and from its width, never from a guess about the copy */
@media (width >= 900px) {
  .work-devices {
    --work-gap: clamp(28px, 4.5vw, 72px);
    --pw: min(300px, calc((100cqh - 2.5rem) / 2.17));   /* 2.5rem: the "His phone" caption above it */
    container-type: size; gap: var(--work-gap);
    /* on tall screens the devices (capped at their real sizes) sit in the middle of the row, not on its floor */
    flex-wrap: wrap; align-content: center;
  }
  .work-phone .vs-demo { width: var(--pw); }
  .work-laptop .vs-demo--laptop { width: min(780px, calc((100cqh - 0.75rem) / 0.64), calc(100cqw - var(--pw) - var(--work-gap) - 1px)); }
  .work-bg { left: calc(100% + var(--work-gap)); }
  /* a short row makes the laptop narrower than 560 px, where its screen crops to a taller 4:3.6 view (css/screens.css):
     size it by that taller ratio so it still fits the row */
  @container (max-height: 372px) {
    .work-laptop .vs-demo--laptop { width: min(780px, calc((100cqh - 0.75rem) / 0.85), calc(100cqw - var(--pw) - var(--work-gap) - 1px)); }
  }
}
.work-stage[data-focus="laptop"] .work-phone, .work-stage[data-focus="phone"] .work-laptop[data-awake="true"] { opacity: 0.62; filter: saturate(0.7) brightness(0.8); }
.work-stage[data-focus="phone"] .work-laptop[data-awake="false"] { opacity: 0.9; }
.work .vs-demo::before { background: radial-gradient(closest-side, oklch(0 0 0 / 0.55), oklch(0 0 0 / 0.2) 55%, transparent); }

/* the laptop sleeps until Vivi needs it: a black screen with a faint glass sheen, then the recording fades in */
.work .vs-desktop { background: oklch(0.08 0.004 265); }
.work-lid-off { position: absolute; inset: 0; z-index: 6; pointer-events: none; background: linear-gradient(in oklch 125deg, oklch(1 0 0 / 0.05), transparent 38%), oklch(0.08 0.004 265); transition: opacity 0.4s var(--ease-out) 0.12s; }   /* follows the focus swap instead of running with it */
.work-laptop[data-awake="true"] .work-lid-off { opacity: 0; }
.work-still { display: none; }
.work .vs-desktop[data-still] .work-still { display: block; }
.work .vs-desktop[data-still] video { visibility: hidden; }
.work .vs-gn-note { width: calc(370 * var(--l)); }

/* ---- what is said: Vivi in his ear, then his reply */
.work-say { position: absolute; z-index: 3; left: calc(100% + 14px); top: 9%; width: min(320px, 30vw); display: grid; pointer-events: none; }
/* placement and entrance only; the bubble itself is the design system's .ds-bubble */
.work-bubble {
  grid-area: 1 / 1; align-self: start; display: flex; gap: var(--ds-2); align-items: flex-start; margin: 0;
  opacity: 0; filter: blur(6px); translate: 0 6px;
  transition: opacity 0.45s var(--ease-out), filter 0.45s var(--ease-out), translate 0.45s var(--ease-out);
}
.work-bubble[data-on] { opacity: 1; filter: none; translate: 0 0; }
.work-bubble[hidden] { display: none; }
.work-bubble--him { justify-self: end; max-width: 15rem; }
/* the earbud: a rendered cut-out (assets/earbud-hd/cutout) fills this slot; until then it stays a quiet empty tile */
.work-bud { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: oklch(1 0 0 / 0.06); overflow: hidden; }
.work-bud:has(picture) { background: none; border-radius: 0; }
.work-bud :is(picture, img) { display: block; width: 100%; height: 100%; object-fit: contain; }

/* ---- inside the phone: the Vivi app and the Hours time tracker (One UI dp = var(--u)) */
.work-vivi { background: var(--vs-bg); }
.work-thread { display: flex; flex-direction: column; gap: calc(12 * var(--u)); padding: calc(4 * var(--u)) calc(14 * var(--u)); }
.work-msg { display: flex; flex-direction: column; gap: calc(4 * var(--u)); max-width: 86%; }
.work-msg p { padding: calc(10 * var(--u)) calc(14 * var(--u)); border-radius: calc(20 * var(--u)); font-size: calc(15 * var(--u)); line-height: 1.35; }
.work-msg--you { align-self: flex-end; align-items: flex-end; }
.work-msg--you p { background: var(--vs-out); border-bottom-right-radius: calc(6 * var(--u)); }
.work-msg-src { font-size: calc(11.5 * var(--u)); color: var(--vs-ink-2); }
.work-msg--vivi { flex-direction: row; align-items: flex-end; gap: calc(8 * var(--u)); }
.work-msg--vivi p { background: var(--vs-card); border-bottom-left-radius: calc(6 * var(--u)); }
.work-agent { position: static; margin-top: calc(4 * var(--u)); box-shadow: none; }
.work-steps { border-radius: calc(20 * var(--u)); padding: calc(10 * var(--u)) calc(14 * var(--u)); font-size: calc(13.5 * var(--u)); }
.work-speaking .work-bud { width: calc(22 * var(--u)); height: calc(22 * var(--u)); border-radius: calc(6 * var(--u)); background: var(--vs-line); }
.work-speaking { margin: 0 !important; padding-left: calc(4 * var(--u)); color: var(--vs-ink-2); font-size: calc(13 * var(--u)); }
.work-device { display: flex; align-items: center; gap: calc(8 * var(--u)); font-size: calc(13.5 * var(--u)); color: var(--vs-ink-2); }
.work-device .vs-i { width: calc(16 * var(--u)); height: calc(16 * var(--u)); }

.work-hours { background: var(--vs-bg); }
.work-hours-brand { display: flex; flex-wrap: wrap; align-items: center; column-gap: calc(8 * var(--u)); }
.work-hours-brand small { flex-basis: 100%; }
.work-hours-logo { width: calc(22 * var(--u)); height: calc(22 * var(--u)); border-radius: calc(7 * var(--u)); background: conic-gradient(from 0deg, oklch(0.62 0.15 150) 0 72%, oklch(0.85 0.06 150) 0); }
.work-chip { margin-top: 0 !important; }
.work-clients { position: relative; padding: calc(4 * var(--u)) 0; }
.work-client { position: relative; display: flex; align-items: center; gap: calc(12 * var(--u)); padding: calc(12 * var(--u)) calc(16 * var(--u)); font-size: calc(15 * var(--u)); transition: background-color 0.2s; }
.work-client + .work-client { border-top: 1px solid var(--vs-line); }
.work-client > span:nth-child(2) { flex: 1; min-width: 0; font-weight: 500; }
.work-client small { display: block; font-weight: 400; font-size: calc(12.5 * var(--u)); color: var(--vs-ink-2); }
.work-client b { font-weight: 600; font-variant-numeric: tabular-nums; }
.work-client .vs-avatar { width: calc(32 * var(--u)); height: calc(32 * var(--u)); font-size: calc(14 * var(--u)); }
.work-client:nth-child(2) .vs-avatar { background: oklch(0.7 0.1 255); }
.work-client:nth-child(3) .vs-avatar { background: oklch(0.72 0.1 60); }
.work-client:nth-child(4) .vs-avatar { background: oklch(0.7 0.08 320); }
.work-client.is-pressed { background: color-mix(in oklch, var(--vs-ink) 7%, transparent); }
.work-hours-total { position: relative; display: grid; padding: calc(18 * var(--u)) calc(20 * var(--u)); margin-bottom: calc(10 * var(--u)); }
.work-hours-total span { font-size: calc(13.5 * var(--u)); color: var(--vs-ink-2); }
.work-hours-total b { font-size: calc(40 * var(--u)); font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.work-hours-total small { font-size: calc(12.5 * var(--u)); color: var(--vs-ink-2); }
.work-weeks { padding: calc(4 * var(--u)) 0; }
.work-weeks div { display: flex; justify-content: space-between; padding: calc(10 * var(--u)) calc(18 * var(--u)); font-size: calc(14 * var(--u)); }
.work-weeks div + div { border-top: 1px solid var(--vs-line); }
.work-weeks b { font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---- the run, live in the chat: what Vivi is doing now, the steps so far, where it works */
.work-vivi .work-thread { flex: 1; min-height: 0; overflow: hidden; }
.work-live { color: var(--vs-accent-text) !important; }
.work-run { display: flex; flex-direction: column; gap: calc(8 * var(--u)); padding: calc(2 * var(--u)) calc(2 * var(--u)) 0; }
.work-run .aui-as { align-items: flex-start; gap: calc(9 * var(--u)); padding: 0 !important; border: 0; border-radius: 0; background: none; font-size: calc(15 * var(--u)); }
.work-run .aui-as-label { white-space: normal; font-weight: 600; line-height: 1.3; }
.work-run .aui-as .aui-as-dot, .work-run .aui-as .aui-as-lead { margin-top: calc(5 * var(--u)); }
.work-run .aui-as .aui-mono { margin-left: auto; padding-left: calc(8 * var(--u)); }
.work-run .aui-tl { margin-left: calc(4 * var(--u)); padding-left: calc(12 * var(--u)); border-left: 1px solid var(--vs-line); font-size: calc(13.5 * var(--u)); }
.work-run .aui-tl-trigger { color: var(--vs-accent-text); }
.work-run[data-state="done"] .aui-tl-trigger { color: var(--vs-ink-2); }
.work-run .aui-tl-step:not(:nth-last-child(-n + 3 of .aui-tl-step)) { display: none; }
.work-run[data-state="working"] .aui-tl-step:last-child { font-weight: 600; color: var(--vs-ink); }
.work-run-note { display: flex; gap: calc(6 * var(--u)); align-items: flex-start; font-size: calc(12 * var(--u)); line-height: 1.35; color: var(--vs-ink-2); }
.work-run-note .vs-i { width: calc(14 * var(--u)); height: calc(14 * var(--u)); margin-top: calc(1 * var(--u)); }
.work-composer {
  position: relative; z-index: 11; flex: none; display: flex; align-items: center; gap: calc(10 * var(--u));
  margin: calc(8 * var(--u)) calc(12 * var(--u)) calc(30 * var(--u)); padding: calc(6 * var(--u)) calc(6 * var(--u)) calc(6 * var(--u)) calc(18 * var(--u));
  min-height: calc(48 * var(--u)); border-radius: 999px; background: var(--vs-card); color: var(--vs-ink-2); font-size: calc(14 * var(--u));
  box-shadow: 0 0 0 1px var(--vs-line);
}
.work-composer > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-composer > .vs-i { width: calc(20 * var(--u)); height: calc(20 * var(--u)); }
.work-composer .aui-as-stop { background: var(--vs-ink); color: var(--vs-bg); }
.work-composer .aui-as-stop:hover { background: color-mix(in oklch, var(--vs-ink) 85%, var(--vs-bg)); }
/* the live small view of Vivi's background screen; tap to enlarge */
.work-pip {
  position: absolute; z-index: 12; right: calc(14 * var(--u)); bottom: calc(92 * var(--u)); width: calc(112 * var(--u));
  padding: 0; text-align: left; font: inherit; border: calc(2.5 * var(--u)) solid var(--vs-accent); border-radius: calc(16 * var(--u)); overflow: hidden; background: var(--vs-card);
  box-shadow: var(--vs-shadow, 0 calc(6 * var(--u)) calc(20 * var(--u)) oklch(0 0 0 / 0.2)); transition: width 0.45s var(--ease-out), scale 150ms ease-out;
}
.work-pip:active { scale: 0.97; }
.work-pip.is-big { width: calc(250 * var(--u)); }
.work-pip-screen { display: flex; border-radius: 0; pointer-events: none; }
.work-pip:focus-visible { outline: 2px solid var(--vs-accent); outline-offset: 3px; }

/* ---- Hours, the time tracker on Vivi's background screen (One UI / Material 3 list app) */
/* the "Hours" app (Material 3 in green); like every app on the phone it follows the phone's theme */
.hr-app { --hr: light-dark(oklch(0.55 0.11 150), oklch(0.74 0.12 150)); --hr-bg: light-dark(oklch(0.972 0.006 160), oklch(0.165 0.008 160)); flex: 1; position: relative; display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--hr-bg); color: var(--vs-ink); }
.hr-bar { position: relative; z-index: 3; flex: none; background: var(--hr-bg); display: flex; align-items: center; gap: calc(14 * var(--u)); padding: calc(10 * var(--u)) calc(18 * var(--u)) calc(8 * var(--u)); }
.hr-bar > .vs-i { width: calc(22 * var(--u)); height: calc(22 * var(--u)); }
.hr-bar h3 { flex: 1; font-size: calc(26 * var(--u)); font-weight: 700; letter-spacing: -0.02em; }
.hr-bar .hr-h-sm { font-size: calc(20 * var(--u)); }
.hr-logo { width: calc(26 * var(--u)); height: calc(26 * var(--u)); border-radius: calc(8 * var(--u)); background: conic-gradient(from 0deg, var(--hr) 0 72%, oklch(0.86 0.06 150) 0); }
.hr-chips { flex: none; display: flex; gap: calc(8 * var(--u)); padding: calc(4 * var(--u)) calc(16 * var(--u)) calc(12 * var(--u)); }
.hr-chip { position: relative; display: inline-block; padding: calc(6 * var(--u)) calc(12 * var(--u)); border-radius: 999px; border: 1px solid color-mix(in oklch, var(--vs-ink) 15%, transparent); font-size: calc(13 * var(--u)); white-space: nowrap; }
.hr-chip.is-on { background: light-dark(oklch(0.9 0.05 150), oklch(0.32 0.06 150)); border-color: transparent; color: light-dark(oklch(0.3 0.08 150), oklch(0.9 0.06 150)); font-weight: 600; }
.hr-card { position: relative; margin: 0 calc(12 * var(--u)); background: var(--vs-card); border-radius: calc(24 * var(--u)); }
.hr-sum { padding: calc(16 * var(--u)) calc(18 * var(--u)); }
.hr-sum p { font-size: calc(16 * var(--u)); }
.hr-sum p b { font-size: calc(34 * var(--u)); font-weight: 700; letter-spacing: -0.03em; }
.hr-sum small, .hr-total small { display: block; font-size: calc(12.5 * var(--u)); color: var(--vs-ink-2); }
.hr-split { display: flex; gap: calc(2 * var(--u)); height: calc(8 * var(--u)); margin-top: calc(12 * var(--u)); border-radius: calc(4 * var(--u)); overflow: hidden; }
.hr-split i { flex: var(--w); background: oklch(0.7 0.11 var(--h)); }
.hr-sec { padding: calc(18 * var(--u)) calc(26 * var(--u)) calc(8 * var(--u)); font-size: calc(14 * var(--u)); font-weight: 600; color: var(--vs-ink-2); }
.hr-row { position: relative; display: flex; align-items: center; gap: calc(12 * var(--u)); padding: calc(12 * var(--u)) calc(16 * var(--u)); font-size: calc(15 * var(--u)); transition: background-color 0.2s; }
.hr-row + .hr-row { border-top: 1px solid var(--vs-line); }
.hr-row.is-pressed { background: color-mix(in oklch, var(--vs-ink) 7%, transparent); }
.hr-av { flex: none; display: grid; place-items: center; width: calc(34 * var(--u)); height: calc(34 * var(--u)); border-radius: 50%; background: oklch(0.7 0.11 var(--h)); color: #fff; font-size: calc(14 * var(--u)); font-weight: 600; }
.hr-name { flex: 1; min-width: 0; font-weight: 500; }
.hr-name small { display: block; font-size: calc(12.5 * var(--u)); font-weight: 400; color: var(--vs-ink-2); }
.hr-meter { display: block; width: calc(var(--w) * 1%); height: calc(4 * var(--u)); margin-top: calc(6 * var(--u)); border-radius: calc(2 * var(--u)); background: oklch(0.7 0.11 var(--h)); }
.hr-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.hr-fab { position: absolute; right: calc(16 * var(--u)); bottom: calc(86 * var(--u)); display: flex; align-items: center; gap: calc(8 * var(--u)); padding: calc(14 * var(--u)) calc(18 * var(--u)); border-radius: calc(18 * var(--u)); background: light-dark(oklch(0.88 0.06 150), oklch(0.38 0.07 150)); color: light-dark(oklch(0.27 0.07 150), oklch(0.93 0.05 150)); font-size: calc(14 * var(--u)); font-weight: 600; box-shadow: 0 calc(3 * var(--u)) calc(8 * var(--u)) light-dark(oklch(0 0 0 / 0.14), transparent); }
.hr-fab .vs-i { width: calc(18 * var(--u)); height: calc(18 * var(--u)); }
.hr-nav { position: relative; z-index: 2; margin-top: auto; flex: none; display: flex; justify-content: space-around; padding: calc(8 * var(--u)) 0 calc(24 * var(--u)); background: light-dark(oklch(0.955 0.01 160), oklch(0.215 0.01 160)); font-size: calc(11.5 * var(--u)); }
.hr-nav span { display: grid; justify-items: center; gap: calc(4 * var(--u)); color: var(--vs-ink-2); }
.hr-nav .vs-i { box-sizing: content-box; width: calc(22 * var(--u)); height: calc(22 * var(--u)); padding: calc(3 * var(--u)) calc(16 * var(--u)); border-radius: 999px; }
.hr-nav .is-on { color: var(--vs-ink); font-weight: 600; }
.hr-nav .is-on .vs-i { background: light-dark(oklch(0.88 0.06 150), oklch(0.36 0.06 150)); }
.hr-scroll { transition: translate 0.4s var(--ease-out); }
.hr-scroll.is-scrolled { translate: 0 calc(-128 * var(--u)); }
.hr-total { display: flex; flex-direction: column; align-items: flex-start; padding: calc(16 * var(--u)) calc(18 * var(--u)) calc(18 * var(--u)); }
.hr-total .hr-bars { align-self: stretch; }
.hr-big { position: relative; display: inline-block; margin-top: calc(10 * var(--u)); font-size: calc(18 * var(--u)); }
.hr-big b { font-size: calc(46 * var(--u)); font-weight: 700; letter-spacing: -0.03em; }
.hr-bars { display: flex; align-items: flex-end; gap: calc(8 * var(--u)); height: calc(60 * var(--u)); margin-top: calc(14 * var(--u)); }
.hr-bars i { flex: 1; height: calc(var(--v) * 100%); border-radius: calc(6 * var(--u)) calc(6 * var(--u)) calc(2 * var(--u)) calc(2 * var(--u)); background: oklch(0.72 0.11 150); }
@media (prefers-reduced-motion: reduce) { .hr-scroll, .work-pip { transition: none; } }
html[data-motion="off"] :is(.hr-scroll, .work-pip) { transition: none; }

/* ---- Vivi's background screen, beside his phone while Vivi works there (desktop); it folds back into the small view */
.work-bg {
  position: absolute; z-index: 2; left: calc(100% + clamp(28px, 4.5vw, 72px)); bottom: 0; width: 100%; margin: 0;
  /* it comes out of the phone's small view: from 0.97 and a short slide, never from a thumbnail-sized 0.3 (rule 1);
     out fast (200 ms), in at 320 ms after the phone has settled */
  transform-origin: left bottom; opacity: 0; scale: 0.97; translate: -1.5rem 0.5rem; pointer-events: none; visibility: hidden;
  transition: opacity 0.2s var(--ease-exit), scale 0.2s var(--ease-exit), translate 0.2s var(--ease-exit), visibility 0s 0.2s;
}
.work-stage[data-bg="on"] .work-bg { opacity: 1; scale: 1; translate: 0 0; pointer-events: auto; visibility: visible;
  transition: opacity 0.32s var(--ease-enter) 0.08s, scale 0.32s var(--ease-enter) 0.08s, translate 0.32s cubic-bezier(0.2, 0, 0, 1) 0.08s, visibility 0s; }
.work-bg-frame { padding: 2.9cqi; }
.work-bg-screen { box-shadow: 0 0 0 1px oklch(1 0 0 / 0.18); }
.work-cap { position: absolute; left: 50%; top: -1.9rem; translate: -50% 0; margin: 0; white-space: nowrap; text-align: center; font-size: 0.85rem; color: var(--stage-ink-3); opacity: 0; transition: opacity 0.4s var(--ease-out); }
.work-stage[data-bg="on"] .work-cap { opacity: 1; }
.work-stage[data-bg="on"] .work-laptop[data-awake] { opacity: 0.14; }

/* the approval sheet: the exact invoice, then a hold (gesture) or a spoken "confirm" (hands-free) */
.work-sheet { bottom: calc(22 * var(--u)); padding: calc(18 * var(--u)) calc(18 * var(--u)); }
.work-sheet .aui-ap-details { font-size: calc(13 * var(--u)); }
.work-sheet .aui-ap-desc { font-size: calc(12.5 * var(--u)); }
.work-sheet .aui-ap-actions, .work-lap-ask .aui-ap-actions { flex-wrap: nowrap; justify-content: space-between; gap: calc(16 * var(--u)); }
.work-sheet .work-send { flex: 0 1 auto; }
/* voice first, never voice only: the state line says both ways to answer, with the live listening indicator */
.work-lap-state { display: flex; align-items: center; gap: calc(8 * var(--u)); margin-top: calc(10 * var(--u)) !important; font-size: calc(12.5 * var(--u)); color: var(--aui-muted); }
.work-lap-state .aui-dm { width: calc(14 * var(--u)); height: calc(14 * var(--u)); color: var(--aui-live); }
/* the laptop's approval component sits in Vivi's overlay, a little wider while it asks */
.work .vs-gn-note:has(.work-lap-ask) { width: calc(440 * var(--l)); }
.work-lap-ask .aui-ap-details { font-size: calc(12.5 * var(--l)); }
.work-lap-ask .vs-btn { min-height: calc(34 * var(--l)); padding: 0 calc(16 * var(--l)); border-radius: 999px; font-size: calc(13.5 * var(--l)) !important; }
.work-hand { bottom: calc(22 * var(--u)); padding: calc(18 * var(--u)); }
.work-hand .aui-ap-actions { justify-content: flex-end; }
.work-sheet .work-approve { flex: 1 1 100%; width: 100%; height: calc(52 * var(--u)); font: 600 calc(15.5 * var(--u))/1 var(--vs-ui); }
.work-sheet .work-approve:focus-visible { outline: 2px solid var(--vs-accent); outline-offset: 2px; }
.work-hint { margin-top: calc(8 * var(--u)) !important; font-size: calc(12 * var(--u)); color: var(--vs-ink-2); min-height: 1.3em; }
.work-say-confirm { display: flex; align-items: center; justify-content: space-between; gap: calc(12 * var(--u)); margin-top: calc(10 * var(--u)); min-height: calc(48 * var(--u)); }
.work-say-label { font-size: calc(15 * var(--u)); font-weight: 600; transition: opacity 0.15s ease-out; }
.work-say-confirm:has(.ui-voice-pill[data-state="listening"]) .work-say-label { opacity: 0; }
.work-session { display: inline-flex; align-items: center; gap: calc(6 * var(--u)); padding: calc(5 * var(--u)) calc(10 * var(--u)); border-radius: 999px; background: color-mix(in oklch, var(--vs-accent) 12%, transparent); color: var(--vs-accent-text); font-size: calc(12 * var(--u)); font-weight: 600; }
.work-session .aui-dm, .work-say-label .aui-dm { width: calc(14 * var(--u)); height: calc(14 * var(--u)); color: var(--vs-accent); }
.work-say-label { display: inline-flex; align-items: center; gap: calc(8 * var(--u)); }
.work-perm-why { display: flex; gap: calc(6 * var(--u)); align-items: flex-start; margin-top: calc(8 * var(--u)) !important; font-size: calc(12.5 * var(--u)); line-height: 1.35; color: var(--vs-ink); }
.work-perm-why .vs-i { flex: none; width: calc(15 * var(--u)); height: calc(15 * var(--u)); color: var(--vs-accent-text); }
.work-pill-ring { display: inline-flex; border-radius: 999px; }
.work-say-confirm .ui-voice-pill:focus-visible { outline: 2px solid var(--vs-accent); outline-offset: 3px; }

/* ---- a note from us to the visitor (site type, not part of Vivi's app): his setting, with the shared permission toggle */
.work-notice {
  position: absolute; z-index: 4; top: calc(var(--bar-h) + clamp(0.5rem, 2dvh, 1.5rem)); right: var(--inset); width: min(380px, 30vw);
  /* its look is the design system's note (.ds-note .ds-dark, css/ds.css): the same note as in #ways, dark by tokens */
  /* ds motion: exits 160 ms accelerating; enters from 0.97 and 6 px, 280 ms decelerating, a stagger after the devices */
  opacity: 0; translate: 0 var(--ds-enter-y); scale: 0.97;
  transition: opacity var(--ds-t-exit) var(--ease-exit), translate var(--ds-t-exit) var(--ease-exit), scale var(--ds-t-exit) var(--ease-exit);
}
.work-notice[data-on] { opacity: 1; translate: 0 0; scale: 1;
  transition: opacity var(--ds-t-enter) var(--ease-enter) var(--ds-stagger), translate var(--ds-t-enter) var(--ease-enter) var(--ds-stagger), scale var(--ds-t-enter) var(--ease-enter) var(--ds-stagger); }
/* desktop: the notice takes the top band beside the copy, so it can never cover a device */
@media (min-width: 900px) {
  .work-stage { grid-template-columns: minmax(0, 1fr) auto; column-gap: clamp(24px, 4vw, 64px); }
  .work-copy { grid-column: 1; grid-row: 1; }
  .work-devices { grid-column: 1 / -1; grid-row: 2; }
  .work-notice { position: static; grid-column: 2; grid-row: 1; align-self: start; width: min(var(--ds-note-w), 34vw); }
  /* the in-ear line rides high at the approval so the laptop's own approval stays clear */
  .work-stage[data-beat="11"] .work-say { left: auto; right: calc(100% + 18px); top: 18%; width: min(300px, 24vw); }
}
/* at the approval both devices carry Vivi's question, so neither rests */
.work-stage[data-focus="both"] :is(.work-phone, .work-laptop) { opacity: 1; filter: none; }
.work-notice[hidden] { display: none; }

/* ---- the top bar sits over the dark stage while it is pinned */
[data-stage="dark"] .bar { --bar-tint: var(--stage-bar); color: oklch(0.95 0.01 85); }   /* the bar's fading tint (css/site.css .bar::before) */
:root { --stage-bar: light-dark(oklch(0.16 0.006 55), oklch(0.14 0.006 55)); }
[data-stage="dark"] .bar .linkish { color: oklch(0.7 0.01 230); &:hover { color: oklch(0.95 0.01 85); } }
[data-stage="dark"] .bar .theme-toggle { color: oklch(0.7 0.01 230); &:hover { color: oklch(0.95 0.01 85); background: oklch(1 0 0 / 0.08); } }
[data-stage="dark"] .bar :focus-visible { outline-color: oklch(0.8 0.065 225); }

/* ---- phones: one device at a time, the copy in its own band above */
@media (max-width: 899px) {
  .work-stage { padding-top: 76px; gap: 12px; }
  .work-devices { --dev-h: calc(100dvh - 76px - 15rem); display: grid; grid-template-columns: minmax(0, 1fr); place-items: end center; }
  .work-phone, .work-laptop { grid-area: 1 / 1; }
  .work-phone .vs-demo { width: clamp(190px, calc(var(--dev-h) * 0.47), 280px); }
  .work-laptop { width: 100%; align-self: center; }
  .work-laptop .vs-demo--laptop { width: 100%; }
  .work-stage[data-focus="laptop"] .work-phone, .work-stage[data-focus="phone"] .work-laptop { opacity: 0; filter: blur(6px); scale: 0.97; pointer-events: none; visibility: hidden; transition: opacity 0.2s var(--ease-exit), filter 0.2s var(--ease-exit), scale 0.2s var(--ease-exit), visibility 0s 0.2s; }
  .work-stage[data-focus="phone"] .work-laptop[data-awake="false"] { opacity: 0; }
  .work-say { left: 50%; top: auto; bottom: 16%; translate: -50% 0; width: min(330px, calc(100vw - 32px)); }
  .work-bubble--him { justify-self: center; }
  .work-bg, .work-cap { display: none; }
  /* phones: the plan shows only the step it is on */
  .work-plan { margin-top: var(--ds-2); }
  .work-plan > li:not([data-status="active"]) { display: none; }
  .work-plan > li::before { content: none; }
  /* phones: the notice sits below the phone in its own band; the beat line under the heading gives way to it */
  .work-notice { position: static; width: auto; }   /* .ds-note--compact-auto */
  .work-stage[data-notice] { grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 10px; }
  .work-stage[data-notice] .work-beat:not([data-on]) { display: none; }
  .work-stage[data-notice] .work-devices { --dev-h: calc(100dvh - 76px - 4.5rem - 176px - 84px); }
  .work-stage[data-notice] .work-phone .vs-demo { width: clamp(170px, calc(var(--dev-h) * 0.47), 280px); }
  .work-stage:is([data-beat="9"], [data-beat="10"], [data-beat="11"]) .work-say { top: auto; bottom: calc(100% - 44px); }
  .work-stage:is([data-beat="9"], [data-beat="10"]) .work-bubble .work-bud { width: 32px; height: 32px; }
  .work-stage[data-beat="11"] .work-bubble .work-bud { width: 32px; height: 32px; }
  /* phones at the approval: no room above the phone (heading, plan); the card itself says "asked in your ear",
     and the caption is still announced by the live region */
  .work-stage[data-beat="11"] .work-say { display: none; }
}

/* reduced motion and Pause motion: the same beats, final states, no movement */
@media (prefers-reduced-motion: reduce) {
  .work-beat, .work-bubble, .work-phone, .work-laptop, .work-lid-off, .work-bg, .work-notice { transition: none !important; filter: none !important; translate: none !important; scale: none !important; }
}
html[data-motion="off"] :is(.work-beat, .work-bubble, .work-phone, .work-laptop, .work-lid-off, .work-bg, .work-notice) { transition: none !important; filter: none !important; translate: none !important; scale: none !important; }

/* when the plan shows only its active step (short screens, phones), it has no line to the next one */
@media (height < 760px) { .work-plan.ds-plan > li::before { content: none; } }
@media (width < 900px) { .work-plan.ds-plan > li::before { content: none; } }

/* founder: the permission note looked crowded (four options wrapping to two lines in a 22rem note). On wide screens the
   note grows so each option sits on one line with room around it; narrower screens keep the wrapping note. */
@media (min-width: 1280px) {
  .work-notice { width: min(31rem, 36vw); }
  .work-notice .ds-seg { --seg-pad-x: 0.85rem; }
  .work-notice .ds-seg :is(button, [role="radio"], label) { white-space: nowrap; padding-inline: 0.85rem; }
}

/* the laptop's live view on the phone (beats 10-11): landscape, same frame as the Hours view */
.work-pip--lap { width: calc(150 * var(--u)); }
.work-pip--lap.is-big { width: calc(290 * var(--u)); }
.work-pip-lap { display: block; aspect-ratio: 16 / 10; }
.work-pip-lap img { display: block; width: 100%; height: 100%; object-fit: cover; }
