/* ───────── Hands — Sen works inside another app ─────────
   Calm (no JS / reduced motion): copy beside a still desktop in its end
   state — every field filled, Sen waiting for the OK. Pinned: three beats
   (ask → fill in → wait for OK). hands.js types the fields and moves the
   focus ring from the scene's progress; CSS stages the rest by data-phase.
   The desktop is sized in em off its column (container query), so it
   scales as one piece. The Expenses window is deliberately not the Sen look:
   it is someone else's app. */
.act--hands .act__stage { padding-top: 140px; padding-bottom: 140px; }
.hands { display: grid; gap: 56px; align-items: center; }
@media (min-width: 1024px) {
    .hands { grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); gap: 64px; }
}
.hands__copy h2 { font-size: clamp(36px, 3.7vw, 58px); letter-spacing: -.045em; line-height: 1; }
.hands__lede { margin: 18px 0 26px; max-width: 36ch; font-size: clamp(16px, 1.25vw, 18px); line-height: 1.5; color: var(--text-2); }
.hands__safe { list-style: none; display: grid; gap: 10px; margin: 26px 0 0; padding: 22px 0 0; border-top: 1px solid var(--border-subtle); }
.hands__safe li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--text-1); }
.hands__safe-ic { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--bg-elevated); border: 1px solid var(--border-subtle); color: var(--text-2); }
.hands__os { display: flex; align-items: center; gap: 8px; margin-top: 20px; font-size: 13px; color: var(--text-3); }

/* ── The desktop ── */
.desk-wrap { container-type: inline-size; }
.desk { --w: 54; --hgt: 34; position: relative; width: calc(var(--w) * 1em); height: calc(var(--hgt) * 1em); margin: 0 auto; font-size: calc(100cqw / var(--w)); line-height: 1.35; color: var(--text-1); border-radius: 1.2em; background: var(--bg-input); border: 1px solid var(--border-subtle); overflow: hidden; user-select: none; }
.desk p { margin: 0; }
.desk .ic { width: 1.15em; height: 1.15em; }

/* Computer-use indicator — ComputerUseIndicator's floating card */
.desk__pill { position: absolute; z-index: 4; left: 50%; top: 1.4em; translate: -50% 0; display: flex; align-items: center; gap: .8em; height: 3.1em; padding: 0 .45em 0 .7em; border-radius: 1em; background: var(--bg-elevated); border: 1px solid var(--border-default); box-shadow: var(--float-shadow); font-size: 1.05em; white-space: nowrap; }
.desk__state { display: inline-flex; align-items: center; gap: .45em; height: 1.9em; padding: 0 .7em; border-radius: var(--r-pill); background: var(--bg-active); font-size: .82em; }
.desk__state b { font-weight: 600; }
.desk__state .led { width: .55em; height: .55em; }
.desk__s0 { display: none; }
.desk__state .led { background: var(--text-3); }
.desk__who { font-weight: 500; }
.desk__hint { color: var(--text-3); font-variant-numeric: tabular-nums; }
.desk__stop { display: inline-flex; align-items: center; gap: .4em; height: 2.1em; padding: 0 .85em; border-radius: var(--r-pill); background: var(--danger); color: #fff; font-size: .85em; font-weight: 500; }
.desk__stop .ic { width: 1em; height: 1em; }

/* Receipts — paper slips the job starts from */
.desk__rcpt { position: absolute; left: 2em; top: 6.6em; width: 11.5em; display: grid; gap: .7em; }
.desk__rcpt-h { display: flex; align-items: center; gap: .45em; font-size: .9em; color: var(--text-2); }
.slip { display: grid; grid-template-columns: 1fr auto; column-gap: .6em; row-gap: .1em; padding: .7em .8em; border-radius: .35em; background: #EEEDE8; color: #2A2925; box-shadow: 0 .5em 1em -.5em rgba(0, 0, 0, .6); font-size: .9em; rotate: -1.5deg; transition: translate 300ms var(--e-out), box-shadow 300ms var(--e-out); }
.slip:nth-of-type(2) { rotate: 1.2deg; }
.slip:nth-of-type(3) { rotate: -.6deg; }
.slip__d { grid-row: 1; font-size: .8em; color: #77746B; }
.slip__w { grid-row: 2; grid-column: 1 / -1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slip b { grid-row: 1; grid-column: 2; font-weight: 600; font-variant-numeric: tabular-nums; }
.slip.is-on { translate: .5em 0; box-shadow: 0 0 0 2px var(--xw-focus, #2F6FEB), 0 .6em 1.2em -.5em rgba(0, 0, 0, .7); }

/* Expenses — another app, light and plain */
.xw { --xw-bg: #F6F6F8; --xw-ink: #1C1C1E; --xw-mute: #6B6B72; --xw-line: #DCDCE1; --xw-field: #FFFFFF; --xw-focus: #2F6FEB; position: absolute; z-index: 1; left: 15.5em; top: 6.2em; width: 36.5em; border-radius: .8em; background: var(--xw-bg); color: var(--xw-ink); box-shadow: 0 1.4em 2.6em -1em rgba(0, 0, 0, .7); overflow: visible; }
.xw__bar { display: flex; align-items: center; gap: .45em; height: 2.5em; padding: 0 .9em; border-radius: .8em .8em 0 0; background: #E8E8EC; border-bottom: 1px solid var(--xw-line); font-size: .9em; }
.xw__bar i { width: .8em; height: .8em; border-radius: 50%; background: #C9C9CF; }
.xw__bar span { flex: 1; margin-right: 2.4em; text-align: center; font-weight: 600; color: var(--xw-mute); }
.xw__body { padding: 1.3em 1.5em 1.4em; }
.xw__h { font-size: 1.35em; font-weight: 600; letter-spacing: -.02em; }
.xw__s { margin-top: .15em !important; font-size: .9em; color: var(--xw-mute); }
.xw__grid { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) 6.5em; gap: .5em .6em; margin-top: 1.1em; }
.xw__col { font-size: .78em; font-weight: 600; color: var(--xw-mute); }
.xw__col--n, .xw__in--n { text-align: right; }
.xw__in { position: relative; display: block; height: 2.5em; padding: 0 .7em; border-radius: .4em; background: var(--xw-field); border: 1px solid var(--xw-line); line-height: 2.4em; font-size: .95em; white-space: nowrap; overflow: visible; font-variant-numeric: tabular-nums; }
.xw__v { display: inline-block; max-width: calc(100% - 3px); vertical-align: top; overflow: hidden; }
.xw__foot { display: flex; align-items: center; gap: .6em; margin-top: 1.2em; padding-top: 1em; border-top: 1px solid var(--xw-line); }
.xw__total { flex: 1; font-size: .95em; color: var(--xw-mute); }
.xw__total b { margin-left: .3em; color: var(--xw-ink); font-variant-numeric: tabular-nums; }
.xw__btn { position: relative; display: inline-flex; align-items: center; height: 2.4em; padding: 0 1.1em; border-radius: .45em; border: 1px solid var(--xw-line); background: var(--xw-field); font-size: .92em; font-weight: 500; }
.xw__btn--go { background: var(--xw-ink); border-color: var(--xw-ink); color: #fff; }
/* Focus ring: Sen finds each field by its name, not by pixels */
.xw__in.is-focus, .xw__btn--go { outline: 2px solid transparent; outline-offset: 2px; transition: outline-color 200ms var(--e-out); }
.xw__in.is-focus, .act--hands:not([data-phase="0"]):not([data-phase="1"]) .xw__btn--go { outline-color: var(--xw-focus); }
.xw__in::after, .xw__btn--go::after { content: attr(data-name); position: absolute; left: -2px; bottom: calc(100% + 4px); padding: .2em .5em; border-radius: .3em; background: var(--xw-focus); color: #fff; font: 600 .72em/1.3 var(--sans); white-space: nowrap; opacity: 0; transition: opacity 200ms var(--e-out); pointer-events: none; }
.xw__in--n::after { left: auto; right: -2px; }
.xw__in.is-focus::after, .act--hands:not([data-phase="0"]):not([data-phase="1"]) .xw__btn--go::after { opacity: 1; }
.xw__caret { display: inline-block; width: 1px; height: 1.1em; margin-left: 1px; background: var(--xw-ink); vertical-align: -.2em; }

/* The ask, and Sen's question back */
.desk__ask { position: absolute; z-index: 2; left: 2em; bottom: 2em; width: 12.5em; }
.desk__you { display: block; padding: .75em .95em; border-radius: 1em 1em .3em 1em; background: var(--bubble); border: 1px solid var(--border-subtle); font-size: .95em; line-height: 1.4; }
.desk__ask { display: none; }
.desk__ok { position: absolute; z-index: 3; left: 2em; bottom: 1.6em; width: 23em; display: grid; grid-template-columns: auto 1fr; gap: .8em; padding: 1em 1.1em 1em; border-radius: 1em; background: var(--bg-elevated); border: 1px solid var(--border-default); box-shadow: var(--float-shadow); }
.desk__mark { width: 1.9em !important; height: 1.9em !important; }
.desk__ok-t { display: grid; gap: .15em; }
.desk__ok-t b { font-size: 1.05em; }
.desk__ok-t span { font-size: .9em; color: var(--text-2); }
.desk__ok-a { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: .5em; }
.desk__ok-a .btn { height: 2.5em; padding: 0 1.1em; font-size: .9em; }

/* ── Phones: a narrower desktop without the receipts ── */
@media (max-width: 767px) {
    .desk { --w: 38; --hgt: 33; }
    .desk__rcpt { display: none; }
    .desk__pill { top: 1em; gap: .6em; font-size: .95em; }
    .desk__hint { display: none; }
    .xw { left: 1.5em; top: 5.4em; width: 35em; }
    .desk__ask { left: 1.5em; bottom: 1.4em; width: 21em; }
    .desk__ok { left: 1.5em; bottom: 1.4em; width: 22em; }
}

/* ── Pinned ── */
html.js:not(.reduce-motion) .act--hands { height: calc(100svh + 300vh); }
html.js:not(.reduce-motion) .act--hands .act__stage { padding-top: 0; padding-bottom: 0; }
html.js:not(.reduce-motion) .hands { height: 100%; padding: 72px 0 96px; }
html.js:not(.reduce-motion) .act--hands .desk { font-size: min(calc(100cqw / var(--w)), calc((100svh - 190px) / var(--hgt))); }

/* Steps follow the beat (hands.js sets data-s) */
html.js:not(.reduce-motion) .hands__steps li { transition: color 300ms var(--e-out); }

/* Indicator: appears as Sen starts, turns to Waiting on the last beat */
html.js:not(.reduce-motion) .desk__pill { --a: clamp(0, calc((var(--p, 0) - .04) * 14), 1); opacity: var(--a); translate: -50% calc((1 - var(--a)) * -1.2em); }
html.js:not(.reduce-motion) .act--hands:is([data-phase="0"], [data-phase="1"]) .desk__s0 { display: inline; }
html.js:not(.reduce-motion) .act--hands:is([data-phase="0"], [data-phase="1"]) .desk__s1 { display: none; }
html.js:not(.reduce-motion) .act--hands:is([data-phase="0"], [data-phase="1"]) .desk__state .led { background: var(--text-1); animation: breathe 1.6s ease-in-out infinite; }

/* Your ask holds until Sen's question replaces it on the last beat */
html.js:not(.reduce-motion) .desk__ask { display: block; transition: opacity 300ms var(--e-out), translate 300ms var(--e-out); }
html.js:not(.reduce-motion) .act--hands[data-phase="2"] .desk__ask { opacity: 0; translate: 0 -1em; }
html.js:not(.reduce-motion) .desk__ok { --o: 0; opacity: var(--o); translate: 0 calc((1 - var(--o)) * 1.5em); scale: calc(.97 + var(--o) * .03); }
html.js:not(.reduce-motion) .act--hands[data-phase="2"] .desk__ok { --o: clamp(0, calc((var(--pf, 0) - .08) * 6), 1); }

@media (max-width: 1023px) {
    .act--hands .act__stage { padding-top: 96px; padding-bottom: 96px; }
    .hands__copy h2 { font-size: 42px; }
    html.js:not(.reduce-motion) .hands { grid-template-rows: auto minmax(0, 1fr); gap: 24px; padding: 64px 0 96px; align-items: start; }
    html.js:not(.reduce-motion) .hands__lede { margin-bottom: 0; }
    html.js:not(.reduce-motion) .hands__steps, html.js:not(.reduce-motion) .hands__os { display: none; }
    html.js:not(.reduce-motion) .hands__safe { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; padding-top: 14px; }
    html.js:not(.reduce-motion) .hands__safe li { font-size: 13px; gap: 8px; }
    html.js:not(.reduce-motion) .hands__safe-ic { width: 22px; height: 22px; }
    html.js:not(.reduce-motion) .act--hands .desk { font-size: min(calc(100cqw / var(--w)), calc((100svh - 400px) / var(--hgt))); }
}
@media (max-width: 767px) {
    .hands__copy h2 { font-size: 34px; }
    html.js:not(.reduce-motion) .hands { padding-top: 56px; gap: 18px; }
    html.js:not(.reduce-motion) .hands__lede { margin-top: 12px; font-size: 15px; }
    html.js:not(.reduce-motion) .act--hands .desk { font-size: min(calc(100cqw / var(--w)), calc((100svh - 430px) / var(--hgt))); }
}
