/* Direction B. Every number below comes from direction.js through custom properties that app.js
   writes on :root at startup (applyDirection). The 850px and 1320px breakpoints mirror
   direction.phoneMaxWidth and the documentWidthCompact rule; media queries cannot read variables. */
@font-face{font-family:Geist;src:url('./vendor/fonts/Geist-Variable.woff2') format('woff2');font-weight:100 900;font-display:swap}
:root{color-scheme:light;font-family:Geist,'Helvetica Neue',Arial,sans-serif;color:var(--c-ink);background:var(--c-page);--header-bg:#fbf8f3;--shadow-soft:0 8px 24px rgba(34,29,38,.10);--shadow-panel:0 18px 48px rgba(34,29,38,.14)}
*,*::before,*::after{box-sizing:border-box}
html,body{height:100%}
body{margin:0;overflow:hidden;background:var(--c-page);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
h1,h2,h3,p,dl,dd{margin:0}
button,a{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
button{cursor:pointer;border:0;background:none;padding:0;text-align:inherit}
a{text-decoration:none}
:focus-visible{outline:3px solid var(--c-accent);outline-offset:2px}
[tabindex="-1"]:focus{outline:none}
[tabindex="-1"]:focus-visible{outline:3px solid var(--c-accent);outline-offset:4px;border-radius:4px}
/* The anchored labels (.cubie, .inbox-item, .room-label) position with the individual translate property, so this transform cannot knock them off their anchor. */
button:active{transform:scale(.98)}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.skip{position:absolute;left:16px;top:-100px;z-index:50;padding:12px 16px;border-radius:12px;background:var(--c-surface);box-shadow:var(--shadow-soft)}
.skip:focus{top:8px}

/* Header: light, one hairline, text controls, Book a call becomes a pill once a document lands. */
.topbar{position:relative;z-index:30;height:var(--header-h,56px);display:flex;align-items:center;gap:4px;padding:0 16px 0 20px;background:var(--header-bg);border-bottom:1px solid var(--c-hairline)}
.brand{display:flex;align-items:center;gap:10px;min-height:44px;min-width:44px;font-size:17px;font-weight:600;letter-spacing:-.01em;white-space:nowrap}
.brand img{width:30px;height:30px;display:block}
.brand-sub{font-weight:400;color:var(--c-muted)}
.demo-label{min-height:44px;min-width:44px;display:inline-flex;align-items:center;justify-content:center;padding:0 6px}
.demo-label span{display:inline-block;padding:3px 9px;border-radius:999px;border:1px solid var(--c-hairline);background:var(--c-surface);font-size:12px;line-height:16px;font-weight:500;color:var(--c-muted)}
.demo-label:hover span{color:var(--c-ink)}
.header-actions{margin-left:auto;display:flex;align-items:center;gap:2px}
.quiet{min-height:44px;min-width:44px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border-radius:12px;font-size:14px;font-weight:500;white-space:nowrap;color:var(--c-ink);transition:background-color .18s var(--ease-standard)}
.quiet:hover{background:var(--c-hairline)}
.icon{width:44px;padding:0;font-size:15px}
.book{min-height:44px;display:inline-flex;align-items:center;gap:4px;padding:0 12px;border-radius:999px;font-size:14px;font-weight:500;color:var(--c-ink);white-space:nowrap;transition:background-color .2s var(--ease-standard),color .2s var(--ease-standard)}
.book:hover{color:var(--c-accent)}
.book.prominent{margin-left:6px;padding:0 18px;background:var(--c-primary);color:var(--c-on-primary)}
.book.prominent:hover{background:color-mix(in srgb,var(--c-primary) 80%,var(--c-accent));color:var(--c-on-primary)}

/* Stage: full bleed under the header. The scene positions every label inside .world. */
/* Fallbacks mirror direction.js layout.headerHeight (56 desktop, 48 phone) and sceneShare (.66) so the stage and
   its loader have size before app.js writes the variables. */
.experience{position:relative;height:calc(100svh - var(--header-h,56px));overflow:hidden;background:var(--c-page)}
.world{position:absolute;inset:0;overflow:hidden;background:var(--c-page) var(--fallback,none) center/cover no-repeat}
.webgl-ready .world:not(.static-world){background-image:none}
.world canvas{position:absolute;inset:0;width:100%;height:100%;display:block;transition:opacity var(--t-street-fade) var(--ease-standard)}
/* First paint on the street: the sky gradient to 60 percent, then the page colour; the live canvas fades in
   once .street-ready lands. The overview still is only the no-WebGL fallback, never the street pre-paint. */
.experience[data-view=street] .world:not(.static-world){background-image:linear-gradient(var(--c-sky-top),var(--c-sky-bottom) 60%,var(--c-page) 60%)}
.experience[data-view=street] .world.static-world{background-image:var(--still-overview)}
.experience[data-view=street] .world:not(.street-ready) canvas,.experience[data-view=street] .world:not(.street-ready) #paper-tags{opacity:0}
#paper-tags{transition:opacity var(--t-street-fade) var(--ease-standard)}
.static-world canvas{display:none}
.labels{position:absolute;inset:0;pointer-events:none}
.labels>*{pointer-events:auto}
.world-status{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.static-world .world-status{width:auto;height:auto;clip:auto;right:16px;top:16px;z-index:3;padding:6px 10px;border-radius:999px;background:var(--c-surface);font-size:12px;color:var(--c-muted)}
/* Loader: painted by the HTML before any module arrives (app.js sets the direction variables later, so every
   colour has a first-paint fallback). app.js names each real milestone and hides it once the first scene is drawn. */
.world-loader{position:absolute;inset:0;z-index:4;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:24px;pointer-events:none;text-align:center}
.world-loader-text{display:inline-flex;align-items:center;gap:10px;min-height:44px;padding:10px 16px;border-radius:999px;background:var(--c-surface,#fffdf9);color:var(--c-ink,#221d26);font-size:14px;line-height:20px;font-weight:500;box-shadow:var(--shadow-soft)}
.world-loader-mark{flex:none;width:12px;height:12px;border-radius:3px;background:var(--c-primary,#221d26);animation:world-loader-turn 1.2s var(--ease-standard,ease) infinite}
@keyframes world-loader-turn{to{transform:rotate(90deg)}}
.world-loader-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;pointer-events:auto}
.world-loader-actions .quiet{background:var(--c-surface,#fffdf9)}
.world-loader-actions .world-loader-primary{background:var(--c-primary,#221d26);color:var(--c-on-primary,#fff)}
.world-loader.is-failed .world-loader-mark{animation:none;background:var(--c-muted,#6b6470)}
@media(scripting:none){.world-loader{display:none}}

/* Name tags: all three between runs, only the active one during beats (the scene sets visibility). */
.cubie{position:absolute;z-index:2;translate:-50% -100%;min-height:44px;min-width:44px;padding:0 4px;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none}
.webgl-ready .cubie{opacity:1;pointer-events:auto}
.cubie span{display:inline-flex;padding:5px 12px;border-radius:999px;background:var(--c-surface);color:var(--c-ink);font-size:13px;line-height:18px;font-weight:500;white-space:nowrap;box-shadow:0 2px 10px rgba(34,29,38,.12)}
.cubie:hover span{color:var(--c-accent)}
.cubie[aria-pressed=true] span{background:var(--c-primary);color:var(--c-on-primary)}
.static-world #crew{inset:auto;left:16px;top:16px;display:flex;gap:6px}
.static-world .cubie{position:static;translate:none;opacity:1;visibility:visible!important;pointer-events:auto}
/* R3: none while a landed document is shown (app.js sets data-tags); this beats the scene's inline visibility. */
.experience[data-tags=hidden] .world:not(.static-world) .cubie{visibility:hidden!important}

/* Scene-anchored chips start hidden; world.projectLabels() places them and makes them visible. */
.inbox-item,.room-label{position:absolute;z-index:3;translate:-50% -50%;visibility:hidden;min-height:44px;display:inline-flex;align-items:center;padding:0 16px;border-radius:999px;background:var(--c-surface);color:var(--c-ink);font-size:14px;line-height:20px;white-space:nowrap;box-shadow:0 4px 16px rgba(34,29,38,.14)}
/* R7: city chips are cityChip.height tall with cityChip.fontSize text; a pseudo-element keeps the 44px hit area. */
.inbox-item{min-height:0;height:var(--chip-h);padding:0 var(--chip-pad);font-size:var(--chip-font);line-height:18px}
.inbox-item::before{content:'';position:absolute;inset:calc((var(--chip-h) - 44px) / 2) 0}
.inbox-item strong{font-weight:600}
.inbox-item span{color:var(--c-muted)}
.inbox-item:hover,.room-label:hover{box-shadow:0 0 0 2px var(--c-accent),0 4px 16px rgba(34,29,38,.14)}
.static-world #inbox{inset:16px 16px auto 16px;display:flex;flex-wrap:wrap;gap:6px}
.static-world .inbox-item{position:relative;translate:none;visibility:visible!important}
/* The tag hangs 10px below its sheet's bottom-centre anchor; the phone street pill sits above the envelope. */
.paper-tag{position:absolute;z-index:2;transform:translate(-50%,10px);visibility:hidden;max-width:240px;padding:8px 12px;border-radius:12px;background:var(--c-surface);box-shadow:0 4px 16px rgba(34,29,38,.12);font-size:13px;line-height:18px;pointer-events:none}
/* R4: the pill's bottom edge sits envelope.phoneTagGap above its anchor, the envelope's top-most projected point. */
.paper-tag[data-paper=request]{transform:translate(-50%,calc(-100% - var(--envelope-gap)))}
.paper-tag span{display:block;color:var(--c-muted)}
.work-object{position:absolute;transform:translate(-50%,-50%);visibility:hidden}

/* The active chip sits just above the caption bar's top-left corner while beats run. */
.beat-chip{position:absolute;z-index:7;left:var(--caption-left);bottom:calc(var(--caption-bottom) + var(--caption-live-h,var(--caption-h)) + 10px);max-width:calc(100% - 2 * var(--caption-left));padding:7px 14px;border-radius:999px;background:var(--c-surface);color:var(--c-ink);font-size:13px;line-height:18px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:var(--shadow-soft);pointer-events:none}

/* Caption bar: one caption, at most two actions. One 76px row that never resizes during a beat (the copy
   is capped to fit); decision and result captions stack (data-layout=stack). Text wraps, never ellipsis. */
.caption{position:absolute;z-index:8;left:var(--caption-left);bottom:var(--caption-bottom);width:min(var(--caption-w),calc(100% - 2 * var(--caption-left)));min-height:var(--caption-h);display:flex;align-items:center;gap:16px;padding:12px 14px 12px 24px;border-radius:var(--caption-r);background:color-mix(in srgb,var(--c-surface) 94%,transparent);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);box-shadow:var(--shadow-soft)}
.experience[data-doc=shown] .caption{width:min(var(--caption-w),calc(100% - var(--doc-w) - 2 * var(--doc-inset) - var(--caption-left) - 16px))}
.caption-text{flex:1 1 220px;min-width:0}
.caption-eyebrow{display:none}
#caption-title{font-size:17px;line-height:22px;font-weight:600;letter-spacing:-.01em;overflow-wrap:anywhere;text-wrap:balance}
.caption-detail{margin-top:2px;font-size:14px;line-height:20px;color:var(--c-muted);overflow-wrap:anywhere}
.caption-actions{flex:none;display:flex;align-items:center;gap:4px;margin-left:auto}
@media(min-width:851px){
 .caption[data-layout=stack]{flex-direction:column;align-items:stretch;gap:12px;padding:16px 14px 14px 24px}
 .caption[data-layout=stack] .caption-text{flex:none}
 .caption[data-layout=stack] .caption-actions{margin-left:0}
}
.caption-actions:empty{display:none}
.caption-actions[data-decision]>*{animation:rise-in var(--t-caption) var(--ease-standard) var(--t-decision) both}
@keyframes rise-in{from{opacity:0;translate:0 6px}to{opacity:1;translate:none}}

.primary{min-height:var(--btn-h);display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 20px;border-radius:999px;background:var(--c-primary);color:var(--c-on-primary);font-size:15px;line-height:20px;font-weight:500;white-space:nowrap;transition:background-color .18s var(--ease-standard)}
.primary:hover{background:color-mix(in srgb,var(--c-primary) 80%,var(--c-accent))}
.text-button{min-height:44px;min-width:44px;display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:0 12px;border-radius:12px;font-size:15px;line-height:20px;font-weight:500;color:var(--c-accent);white-space:nowrap;transition:background-color .18s var(--ease-standard)}
.text-button:hover{background:color-mix(in srgb,var(--c-accent) 8%,transparent)}
.art-button{display:flex;justify-content:space-between;align-items:center;width:100%;min-height:44px;padding:8px 0;border-top:1px solid var(--c-hairline);font-size:14px;line-height:20px;color:var(--c-accent);text-align:left}
.art-button:hover{color:var(--c-ink)}

/* Document panel (desktop): appears only when a document exists, slides in from the right. */
.document{position:absolute;z-index:8;top:var(--doc-inset);right:var(--doc-inset);bottom:var(--doc-inset);width:var(--doc-w);display:flex;flex-direction:column;border-radius:var(--doc-r);background:var(--c-surface);box-shadow:var(--shadow-panel);overflow:hidden}
@media(max-width:1319px){.document{width:var(--doc-w-compact)}.experience[data-doc=shown] .caption{width:min(var(--caption-w),calc(100% - var(--doc-w-compact) - 2 * var(--doc-inset) - var(--caption-left) - 16px))}}
.doc-head{position:relative;flex:none;padding:28px 28px 16px}
.doc-kicker{padding-right:72px;font-size:12px;line-height:16px;font-weight:500;letter-spacing:.08em;text-transform:uppercase;color:var(--c-muted)}
.doc-head h2{margin-top:8px;font-size:22px;line-height:28px;font-weight:600;letter-spacing:-.01em}
.doc-tab{display:inline-block;margin-top:10px;padding:3px 10px;border-radius:999px;font-size:13px;line-height:18px;font-weight:500;color:var(--c-accent);background:color-mix(in srgb,var(--c-accent) 8%,transparent)}
.doc-tab[data-status=held],.doc-tab[data-status=blocked],.doc-tab[data-status=pending]{color:var(--c-held);background:var(--c-held-wash)}
.doc-tab[data-status=approved]{color:var(--stamp-color);background:var(--c-surface);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--stamp-color) 35%,transparent)}
.doc-close{position:absolute;top:16px;right:14px;font-size:14px}
.doc-body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 28px 24px;scrollbar-width:thin}
/* R6: the panel body softens over documentFade px above the footer, so a line cut there reads as "more below".
   Nothing is hidden: at the end of the scroll the body's bottom padding sits under the fade. */
.document .doc-body{-webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - var(--doc-fade)),transparent);mask-image:linear-gradient(to bottom,#000 calc(100% - var(--doc-fade)),transparent)}
.doc-subtitle{padding-bottom:12px;border-bottom:1px solid var(--c-hairline);font-size:14px;line-height:20px;color:var(--c-muted)}
.doc-rows{list-style:none;margin:0;padding:0}
.doc-row{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:12px 0;border-bottom:1px solid var(--c-hairline)}
.doc-row strong{display:block;font-size:15px;line-height:21px;font-weight:600}
.doc-row small{display:block;margin-top:2px;font-size:13px;line-height:18px;color:var(--c-muted)}
.doc-row b{font-size:15px;line-height:21px;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.doc-row[data-state=held] strong,.doc-row[data-state=held] b{color:var(--c-held)}
.doc-row[data-state=removed] strong,.doc-row[data-state=removed] b{color:var(--c-muted);font-weight:500;text-decoration:line-through}
.doc-summary{position:relative;padding:12px 0 4px}
.doc-totals div{display:flex;justify-content:space-between;gap:16px;padding:2px 0;font-size:14px;line-height:20px;color:var(--c-muted)}
.doc-totals div:first-child{padding-bottom:6px;font-size:20px;line-height:26px;font-weight:600;color:var(--c-ink)}
.doc-totals dd{font-variant-numeric:tabular-nums}
/* F15: the impression sits in its own space under the totals, right-aligned beneath the figures, so no
   amount is ever covered (desktop panel, 1200 compact panel, phone sheet at 390 and 320). The -8 degree
   turn adds about 10px above and below and 4px at the right: the 20px top margin clears the Held row,
   the 6px right margin keeps the turned corner inside the scroller (no sideways scroll on the phone). */
.stamp{width:var(--stamp-w);min-height:var(--stamp-h);display:grid;place-items:center;margin:20px 6px 8px auto;padding:6px 10px;border:4px double var(--stamp-color);border-radius:10px;color:var(--stamp-color);font-size:13px;line-height:16px;font-weight:700;letter-spacing:.04em;text-align:center;rotate:var(--stamp-angle);background:color-mix(in srgb,var(--c-surface) 70%,transparent);animation:stamp-in var(--t-stamp) var(--ease) both}
@keyframes stamp-in{from{scale:1.3;opacity:0}to{scale:1;opacity:1}}
.stamp[data-settled]{animation:none}
.doc-note{margin-top:12px;font-size:14px;line-height:20px;color:var(--c-muted)}
.desk-checked{margin-top:12px;font-size:15px;line-height:22px}
.desk-heading{margin-top:20px;font-size:15px;line-height:21px;font-weight:600}
.request-note{margin-top:16px;padding:14px 16px;border-radius:14px;background:var(--c-held-wash);color:var(--c-ink)}
.request-note p{font-size:14px;line-height:20px}
.request-note-head{margin-bottom:6px;color:var(--c-held)}
.request-note-foot{margin-top:6px;color:var(--c-muted)}
.doc-sources{margin-top:16px;border-top:1px solid var(--c-hairline)}
.doc-sources summary,.source summary{min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;font-size:14px;font-weight:500;list-style:none}
.doc-sources summary{color:var(--c-accent)}
.doc-sources summary::-webkit-details-marker,.source summary::-webkit-details-marker{display:none}
.doc-sources summary::after,.source summary::after{content:'+';color:var(--c-accent)}
.doc-sources[open] summary::after,.source[open] summary::after{content:'−'}
.doc-replay{margin-top:16px}
.doc-sources+.doc-replay{margin-top:0}
.doc-actions{flex:none;display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;gap:8px;padding:14px 20px 18px 28px;border-top:1px solid var(--c-hairline);background:var(--c-surface)}
.doc-peek{display:none}

/* Dialogs (How this works, the demo note, directory, mission review) and the phone sheet. */
dialog{width:min(720px,calc(100% - 40px));max-height:min(860px,90svh);padding:28px;border:0;border-radius:24px;background:var(--c-surface);color:var(--c-ink);box-shadow:0 30px 90px rgba(34,29,38,.28)}
dialog[open]{display:flex;flex-direction:column;overflow:hidden}
dialog::backdrop{background:rgba(34,29,38,.32);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
#dialog-body{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;padding-right:4px}
.dialog-close{flex:none;align-self:flex-start;margin-top:16px;background:var(--c-page)}
dialog h2{margin-bottom:12px;font-size:26px;line-height:32px;font-weight:600;letter-spacing:-.015em}
dialog p{margin:10px 0;font-size:15px;line-height:23px;color:var(--c-muted)}
dialog .quiet{margin:4px 4px 0 0;background:var(--c-page)}
.document-sheet .doc-head h2{margin:8px 0 0}
.document-sheet p.doc-kicker,.document-sheet p.doc-subtitle,.document-sheet p.doc-note,.document-sheet .request-note p{margin:0}
.document-sheet p.doc-note{margin-top:12px}
.document-sheet p.desk-checked{margin:12px 0 0;color:var(--c-ink)}
.eyebrow{margin-bottom:8px;font-size:12px;line-height:16px;font-weight:500;letter-spacing:.08em;text-transform:uppercase;color:var(--c-muted)}
.dialog-meta{margin-bottom:12px;font-size:13px;color:var(--c-muted)}
.artifact{margin:12px 0;padding:16px 18px;border-radius:14px;background:var(--c-page);color:var(--c-ink);font:14px/22px Geist,'Helvetica Neue',Arial,sans-serif;white-space:pre-wrap;overflow-wrap:anywhere}
.checks{list-style:none;margin:12px 0;padding:0}
.checks li{margin:6px 0;font-size:14px;line-height:21px;color:var(--c-matched)}
.checks li::before{content:'✓ '}
.source{border-top:1px solid var(--c-hairline)}
.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:8px 0}
.detail-grid h3{font-size:13px;font-weight:600}
.detail-grid p{margin:4px 0 0;font-size:13px;line-height:20px;color:var(--c-muted)}
.dialog-footer{flex:none;display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:16px}
.dialog-footer small{font-size:13px;line-height:18px;color:var(--c-muted)}
.dialog-footer>div{display:flex;align-items:center;gap:8px}
.directory{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px;margin:12px 0}
.department-card{min-height:76px;padding:12px 14px;border-radius:14px;background:var(--c-page);text-align:left}
.department-card strong{display:block;font-size:15px;line-height:21px;font-weight:600}
.department-card p{margin:4px 0 0;font-size:13px;line-height:18px}
.department-card:hover{background:color-mix(in srgb,var(--c-accent) 8%,var(--c-page))}
.neighbor{display:flex;justify-content:space-between;align-items:center;min-height:56px;border-top:1px solid var(--c-hairline);font-size:15px}
.neighbor small{font-size:12px;color:var(--c-muted)}
.support-documents{margin:8px 0 16px}
.evidence-document{width:100%;min-height:56px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 0;border-bottom:1px solid var(--c-hairline);font-size:15px;line-height:21px;text-align:left}
.evidence-document small{display:block;font-size:13px;line-height:18px;color:var(--c-muted)}
.evidence-document:hover{color:var(--c-accent)}
.missing-source{margin:12px 0;padding:16px;border-radius:14px;background:var(--c-held-wash)}
.missing-source h3{font-size:15px;color:var(--c-held)}
.missing-source p{margin:6px 0 0;font-size:14px;line-height:20px}
.invoice-document{margin:12px 0;padding:16px;border-radius:14px;background:var(--c-page);white-space:normal}
.paper-heading{display:flex;justify-content:space-between;gap:12px;padding-bottom:10px;border-bottom:1px solid var(--c-hairline)}
.paper-heading>span{font-size:12px;font-weight:600;letter-spacing:.06em}
.paper-heading small{font-size:12px;color:var(--c-muted)}
.invoice-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--c-hairline)}
.invoice-row strong{display:block;font-size:14px;font-weight:600}
.invoice-row small{display:block;font-size:12px;color:var(--c-muted)}
.invoice-row>b{font-size:15px;font-weight:600;font-variant-numeric:tabular-nums;text-align:right}
.receipt-hold{display:block;font-weight:400;color:var(--c-held)!important}
.paper-total{display:flex;justify-content:space-between;align-items:center;padding-top:10px}
.paper-total span{font-size:13px;color:var(--c-muted)}
.paper-total strong{font-size:20px;font-weight:600;font-variant-numeric:tabular-nums}
.invoice-record>p,.invoice-split,.invoice-change{margin:4px 0 10px;font-size:13px;line-height:19px;color:var(--c-muted)}
.receipt-document h3{margin-top:12px}
dialog.review-sheet[open]{height:min(900px,90svh)}
.review-sheet .dialog-footer{margin-top:12px}

/* Phone: header, the scene at sceneShare of the viewport, then one bottom panel that never scrolls the page. */
@media(max-width:850px){
 .topbar{height:var(--p-header-h,48px);gap:0;padding:0 6px 0 12px}
 .brand>span{display:none}
 .brand img{width:28px;height:28px}
 .quiet{padding:0 10px}
 .book{padding:0 10px}
 .book:not(.prominent) .book-rest{display:none}
 .book.prominent{margin-left:4px;padding:0 14px}
 body:has(#stop-work:not([hidden])) .brand{display:none}
 .experience{height:calc(100svh - var(--p-header-h,48px));display:flex;flex-direction:column}
 .world{position:relative;inset:auto;flex:0 1 var(--p-scene,66svh);min-height:140px}
 .beat-chip{left:12px;bottom:12px;max-width:calc(100% - 24px)}
 .inbox-item span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
 /* R7: names only, plus a 6px dot in the tab colour once the room's document has landed. */
 .inbox-item[data-landed]::after{content:'';flex:none;width:6px;height:6px;margin-left:6px;border-radius:50%;background:var(--c-accent)}
 .inbox-item[data-status=held]::after,.inbox-item[data-status=blocked]::after,.inbox-item[data-status=pending]::after{background:var(--c-held)}
 .inbox-item[data-status=approved]::after{background:var(--stamp-color)}
 .caption{position:relative;left:auto;bottom:auto;width:auto;height:auto;min-height:0;order:3;flex:1 0 auto;flex-direction:column;align-items:stretch;justify-content:space-between;gap:12px;padding:16px var(--p-pad) calc(12px + env(safe-area-inset-bottom));border-radius:20px 20px 0 0;background:var(--c-surface);-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none}
 .experience[data-doc=shown] .caption{width:auto;padding-top:12px;border-radius:0}
 .caption[data-kind=decision]{flex-wrap:nowrap;padding-block:16px calc(12px + env(safe-area-inset-bottom))}
 .caption-text{flex:none;min-height:calc(var(--p-caption-h) - 32px)}
 .caption-eyebrow{display:block;margin-bottom:4px;font-size:12px;line-height:16px;font-weight:500;letter-spacing:.02em;color:var(--c-muted)}
 .caption-actions{flex-direction:column;align-items:stretch;gap:0;margin-left:0}
 .caption-actions .primary{width:100%;min-height:var(--p-btn-h);border-radius:16px;font-size:17px}
 .caption-actions .text-button{width:100%}
 /* R4: while beats run, Skip to the result fills the primary slot as a tonal button; the secondary slot stays empty. */
 .caption-actions:has(.phone-tonal){justify-content:flex-start;min-height:calc(var(--p-btn-h) + 44px)}
 .caption-actions .phone-tonal{min-height:var(--p-btn-h);border-radius:16px;background:color-mix(in srgb,var(--c-accent) 8%,transparent);color:var(--c-accent);font-size:17px;font-weight:600}
 .document{position:relative;inset:auto;z-index:auto;order:2;flex:none;width:auto;padding:12px var(--p-pad) 0;border-radius:20px 20px 0 0;background:var(--c-surface);box-shadow:none;overflow:visible}
 .document>:not(.doc-peek){display:none}
 .doc-peek{position:relative;display:flex;align-items:center;gap:12px;width:100%;min-height:var(--p-peek);padding:10px 14px 8px;border-radius:14px;background:var(--c-page);text-align:left}
 .peek-grabber{position:absolute;top:4px;left:50%;width:32px;height:4px;border-radius:2px;background:rgba(34,29,38,.16);translate:-50% 0}
 .peek-text{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:4px}
 .peek-text strong{max-width:100%;font-size:15px;line-height:20px;font-weight:600}
 .peek-text .doc-tab{margin:0;padding:2px 8px;font-size:12px;line-height:16px}
 .doc-peek>b{font-size:17px;font-weight:600;font-variant-numeric:tabular-nums}
 dialog{position:fixed;inset:auto 0 0 0;margin:0;width:100%;max-width:none;height:var(--p-sheet);max-height:var(--p-sheet);padding:6px var(--p-pad) calc(12px + env(safe-area-inset-bottom));border-radius:20px 20px 0 0}
 dialog[open]{animation:sheet-in var(--t-sheet) var(--ease-standard) both}
 dialog::before{content:'';flex:none;align-self:center;width:36px;height:5px;margin:4px 0 14px;border-radius:3px;background:rgba(34,29,38,.18)}
 dialog::backdrop{background:rgba(34,29,38,.4)}
 dialog.review-sheet[open]{height:var(--p-sheet)}
 .dialog-close{align-self:stretch;min-height:48px}
 dialog h2{font-size:22px;line-height:28px}
 /* The sheet scrolls only its body; the header and the footer (Download, Approve) sit outside the
    scroller, as in the desktop panel, so no footer ever covers a row, a source or a focused control. */
 .document-sheet #dialog-body{display:flex;flex-direction:column;overflow:hidden;padding-right:0}
 .document-sheet .doc-head{padding:0 0 12px}
 .document-sheet .doc-body{flex:1 1 auto;min-height:0;padding:0 0 16px;overflow:auto}
 .document-sheet .doc-body :is(.art-button,.evidence-document):focus-visible{outline-offset:-3px}
 .document-sheet .doc-actions{padding:12px 0;justify-content:stretch}
 .document-sheet .doc-actions>*{flex:1 1 auto}
 .document-sheet .doc-close{display:none}
 .detail-grid{grid-template-columns:1fr}
 .dialog-footer{flex-direction:column;align-items:stretch}
 .dialog-footer>div{flex-direction:column-reverse;align-items:stretch}
}
@media(max-width:850px) and (max-height:600px){.caption-detail{display:none}.caption-text{min-height:0}.caption{flex:1 1 auto;min-height:0;overflow-y:auto}}
/* L2: below 360 the Book pill keeps only its first word so the header fits with Stop shown. */
@media(max-width:360px){.book .book-rest{display:none}}
@keyframes sheet-in{from{transform:translateY(24%);opacity:0}to{transform:none;opacity:1}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Optional business context uses the existing sheet, never an overlay over running work. */
.business-label{display:block;margin:20px 0 8px;font-weight:600;font-size:14px}
.business-field{display:block;box-sizing:border-box;width:100%;font:inherit;line-height:1.5;color:inherit;background:#fffefa;border:1px solid #c9c5bc;border-radius:12px;padding:12px;min-height:48px}
.business-field:focus-visible{outline:3px solid #456d6a;outline-offset:3px}
#business-form .primary,.business-manual button{margin-top:16px;min-height:48px}
.business-manual{margin-top:24px}.business-manual summary{cursor:pointer;padding:12px 0;min-height:24px}
.business-boundary{font-size:13px;line-height:1.5;color:#5b605b;margin:20px 0}.business-actions{display:flex;gap:16px;margin-top:24px}
.business-error{color:#973e2e;font-size:14px;line-height:1.5;padding:12px;border-radius:8px;background:#fff0e9}
