/* Cast art: full-size illustrations belong to profiles, miniatures live in the office. */
.client-notes{margin:18px 0;border:1px solid #d7b58f;border-left:4px solid #bd8849;border-radius:4px 13px 13px 4px;background:#fff4d9;color:#664c3e;box-shadow:0 3px 0 #c9aa8028}
.client-notes summary{padding:14px 15px;cursor:pointer;font-size:13px;font-weight:700;line-height:1.5}
.client-notes summary span{float:right;font-size:10px;font-weight:400;color:#876748}
.client-notes summary:focus-visible{outline:3px solid #ae5b45;outline-offset:3px}
.client-notes p{margin:0;padding:0 15px 14px;font-size:13px;line-height:1.85}
.client-notes .notes-reply{padding-top:12px;border-top:1px dashed #d7b58f;font-size:12px;background:#fff9ed}
.client-notes b{margin-right:5px}
.office-stage:is([data-count="4"],[data-count="5"]) .office-replay{width:32px;height:32px;min-height:32px;padding:0;font-size:0}
.office-stage:is([data-count="4"],[data-count="5"]) .office-replay:after{content:'↻';font-size:18px}
@media(max-width:760px){[data-theme="coral"] .company-route{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));row-gap:12px}.client-notes summary{font-size:12px;padding:12px}.client-notes p{padding-left:12px;padding-right:12px;font-size:12px}.client-notes summary span{float:none;display:block;margin-left:15px}}
.office-parcel{position:absolute;z-index:4;transform:translate(-50%,-100%);color:#755040;pointer-events:none;filter:drop-shadow(0 1px 0 #fff5)}
.office-parcel svg{display:block;width:100%;height:auto}
.office-scene-line{position:absolute;z-index:5;left:12px;right:12px;top:8px;margin:0;padding:8px 12px;border:1px solid #d2a48c;border-radius:12px 12px 12px 3px;background:#fffaf1f5;color:#614441;font-size:12px;line-height:1.6;box-shadow:0 3px 0 #b97e6320;pointer-events:none}
.office-stage[data-scene] .office-place{visibility:hidden}
.office-frame:has(.office-stage[data-scene]) .scene-tag{visibility:hidden}
.office-replay{position:absolute;z-index:6;right:10px;bottom:8px;padding:6px 10px;min-height:32px;border:1px solid #b77e68;border-radius:18px;background:#fff8ed;color:#794a40;font:inherit;font-size:11px;cursor:pointer;box-shadow:0 2px 0 #bb8b7060}
.office-replay:hover{background:#ffe3d3}
.office-replay:focus-visible{outline:3px solid #9d5448;outline-offset:2px}
.office-parcel[hidden],.office-scene-line[hidden],.office-replay[hidden],.office-replay:disabled{display:none}
@media(max-width:760px){
 .office-scene-line{font-size:10px;left:7px;right:7px;top:5px;padding:5px 8px}
 .office-replay{right:5px;bottom:4px;font-size:10px;min-height:28px;padding:4px 7px}
 /* The compact result stage keeps faces and hands clear; dialogue is already below it. */
 .game[data-phase="feedback"] .office-scene-line{width:1px;height:1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%)}
}
.game .office-order-jump.primary{display:none}
.office-stage{position:absolute;inset:0;overflow:hidden;isolation:isolate;background:#f6ddc7}
.office-backdrop{position:absolute;inset:0;background:url('./assets/office-start-v2.webp') center/cover;opacity:.7}
.new-office .office-backdrop{background-image:url('./assets/office-studio-v2.webp')}
.office-floor{position:absolute;inset:64% 0 0;background:linear-gradient(transparent,#f3d0ac 65%);border-bottom:13px solid #c59673}
.office-actor{position:absolute;bottom:6%;width:25%;height:88%;margin-left:-12.5%;padding:0;border:0;background:none;cursor:pointer;z-index:2;transition:filter .15s}
.office-actor:hover{filter:drop-shadow(0 0 5px #fff7e8)}
.office-actor:focus-visible{outline:3px solid #9d5448;outline-offset:-10px;border-radius:25px}
.office-actor .cast-sprite{display:block;width:100%;height:100%;overflow:visible;pointer-events:none}
.actor-name{position:absolute;bottom:0;left:50%;transform:translateX(-50%);font-size:clamp(8px,1vw,12px);white-space:nowrap;background:#fff8ed;border:1px solid #d7b69a;border-radius:10px;padding:3px 9px;color:#5b4140;box-shadow:0 2px 0 #b7876a40}
.is-speaking .actor-name{background:#ad584c;color:white;border-color:#ad584c}
.is-speaking .actor-name:before{content:'';position:absolute;left:calc(50% - 3px);top:-5px;border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:5px solid #ad584c}
.office-place{position:absolute;right:12px;top:12px;font-size:9px;letter-spacing:1px;color:#6b5349;background:#fffc;padding:5px 9px;border-radius:4px}
.office-worktable{display:none;position:absolute;left:15%;bottom:16%;width:70%;height:57%;z-index:1;transform-origin:50% 90%;pointer-events:none}
.office-worktable img{display:block;width:100%;height:100%;object-fit:contain}
.office-unpack{position:absolute;left:50%;top:66%;z-index:4;pointer-events:none}
.office-unpack i{position:absolute;left:-23px;top:-15px;width:46px;height:30px;border-radius:50%;background:#fff7e9;box-shadow:10px -8px 0 -3px #fff7e9,-10px -5px 0 -2px #fff7e9}
.office-unpack[hidden],.office-away[hidden]{display:none}
.office-away{position:absolute;left:10px;bottom:10px;z-index:5;border:1px solid #c39b77;border-radius:9px;background:#fff7e8;padding:5px 9px;color:#825a43;font-size:10px}
.office-actor .cast-sprite{transform-origin:center}
.has-table .office-worktable{display:block}
.office-frame #office-canvas{position:absolute;inset:0}
[data-theme] .avatar.cast-avatar{display:inline-block;position:relative;flex-shrink:0;width:48px;height:48px;background:#fff6e9;border:1px solid #ddc1ad;border-radius:50%;overflow:hidden;vertical-align:middle}
.cast-avatar svg{display:block;width:100%;height:100%}
[data-theme] .world-caption .cast-avatar{width:43px;height:43px}
[data-theme] .world-caption{align-items:center;min-height:57px}
[data-theme] .world-caption #world-message{font-size:13px;line-height:1.65}
[data-theme] .staff-roster{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;margin-top:15px;padding:12px 0 0;border-top:1px solid #ca927b40}
.cast-card{min-width:0;padding:9px 2px 8px;background:#fff9f0;border:1px solid #e2bdab;border-radius:13px;color:#664440;cursor:pointer;box-shadow:0 3px 0 #c3947830}
.cast-card:hover,.cast-card[aria-current=true]{border-color:#ad584c;background:#ffe9df}
[data-theme] .staff-roster .cast-card .avatar{width:48px;height:48px;border:0;background:none;display:block;margin:0 auto 4px}
.cast-card b,.cast-card small{display:block}
[data-theme] .staff-roster .cast-card b{font-size:12px}
[data-theme] .staff-roster .cast-card small{font-size:9px;color:#805f57;margin-top:3px;white-space:nowrap}
.cast-roster-label{display:flex;justify-content:space-between;align-items:center;margin-top:18px;color:#795a52;font-size:11px}
.cast-roster-label span{font-size:10px;color:#947971}
.question-speaker{display:flex;align-items:center;gap:10px;margin:0 0 14px;padding:10px 12px;background:#fcf3e9;border:1px solid #ead5c5;border-radius:14px;color:#634c49}
.question-speaker button{padding:0;background:none;border:0;cursor:pointer;flex-shrink:0}
.question-speaker p{margin:0;font-size:12px;line-height:1.6}
.question-speaker b{display:block;font-size:10px;color:#a45f50;margin-bottom:3px}
[data-theme] .letter-label .cast-avatar{width:43px;height:43px;background:#fff8ed}
[data-theme] .welcome .cast-avatar{width:66px;height:66px;border:0;background:#f9e5d5}
dialog.character-dialog{width:min(840px,calc(100vw - 24px));max-width:840px;max-height:calc(100dvh - 28px);padding:25px;background:#fff9f1;color:#523f3c;border:1px solid #c9a38d;border-radius:24px;overflow:auto}
.profile-layout{display:grid;grid-template-columns:40% 1fr;gap:30px;align-items:center}
.profile-art{position:relative;background:#fff;border-radius:16px;overflow:hidden;border-bottom:8px solid var(--cast-color)}
.original-portrait{display:block;width:100%;max-height:490px}
.profile-number{position:absolute;left:14px;top:10px;font-size:40px;line-height:1;color:var(--cast-color);opacity:.55;font-weight:800;font-style:italic}
.profile-copy h2{font-size:38px;letter-spacing:4px;margin:8px 0}
.profile-copy h2 small{display:inline-block;margin-left:15px;font-size:12px;letter-spacing:0;font-weight:400}
.profile-copy .eyebrow{color:#925b51;font-size:12px;letter-spacing:1px}
.profile-copy p{font-size:13px;line-height:1.9;margin:12px 0}
.profile-copy .profile-status{font-size:11px;color:#96756b}
.profile-copy blockquote{margin:18px 0;padding:14px 0 14px 16px;border-left:4px solid var(--cast-color);font-size:17px;line-height:1.8;font-weight:600}
.profile-copy dl{margin:18px 0}.profile-copy dt{font-size:10px;letter-spacing:1px;color:#916d62;margin-top:13px}.profile-copy dd{font-size:12px;line-height:1.75;margin:5px 0}
.profile-copy .profile-note{font-size:11px;color:#96756b;border-top:1px dashed #d6bcb0;padding-top:12px}
.profile-nav{display:flex;gap:8px;margin:18px 0}
.profile-nav button{flex:1;display:flex;align-items:center;justify-content:center;gap:5px;border:1px solid #e0c6b9;background:#fffdf9;color:#765750;border-radius:12px;padding:7px;cursor:pointer;font-size:12px}
.profile-nav button[aria-current=true]{border-color:#b36153;background:#ffe8de;font-weight:bold}
[data-theme] .profile-nav .cast-avatar{width:32px;height:32px;border:0;background:none}
.character-dialog>.primary{width:100%;margin-top:0}
@media(min-width:761px){[data-theme="coral"] .world .office-frame{aspect-ratio:1.55;transform:none;margin-top:15px}[data-theme="coral"] .world h1{font-size:27px}[data-theme="coral"] .world{padding:24px}.cast-roster-label+.staff-roster{margin-top:7px;padding-top:0;border-top:0}}
@media(max-width:760px){
 [data-theme] .game:is([data-phase="brief"],[data-phase="settlement"]) .office-order-jump.primary{display:flex;justify-content:space-between;width:100%;margin:7px 0 2px}
 [data-theme] .game:is([data-phase="brief"],[data-phase="settlement"]) .world{display:flex;flex-direction:column;padding:14px;gap:0}
 [data-theme] .game:is([data-phase="brief"],[data-phase="settlement"]) .world-head{width:100%}
 [data-theme] .game:is([data-phase="brief"],[data-phase="settlement"]) .world h1{font-size:22px;margin:8px 0 10px}
 [data-theme] .game:is([data-phase="brief"],[data-phase="settlement"]) .office-frame{width:100%;height:auto;aspect-ratio:1.8;max-height:none;transform:none;margin:0;flex-shrink:0}
 [data-theme] .game:is([data-phase="brief"],[data-phase="settlement"]) .world-caption{display:flex;width:100%;margin-top:8px;min-height:45px}
 [data-theme] .game .world-caption #world-message{font-size:11px}
 [data-theme] .world .growth{width:100%;margin-top:8px;padding:6px 0 0}
 [data-theme] .world .staff-roster{display:grid;width:100%;gap:5px;margin-top:6px;border:0;padding:0}
 .cast-roster-label{width:100%;margin-top:12px}.cast-roster-label span{font-size:9px}
 [data-theme] .staff-roster .cast-card .avatar{width:34px;height:34px;margin-bottom:3px}
 [data-theme] .staff-roster .cast-card b{font-size:10px}[data-theme] .staff-roster .cast-card small{font-size:8px}
 .cast-card{padding:5px 0;border-radius:9px}
 [data-theme] .game:is([data-phase="question"],[data-phase="feedback"]) .world{display:block;padding:8px 13px 9px}
 [data-theme] .game:is([data-phase="question"],[data-phase="feedback"]) .world-head{display:none}
 [data-theme] .game:is([data-phase="question"],[data-phase="feedback"]) .world h1,[data-theme] .game:is([data-phase="question"],[data-phase="feedback"]) .office-frame,[data-theme] .game:is([data-phase="question"],[data-phase="feedback"]) .world-caption,[data-theme] .game:is([data-phase="question"],[data-phase="feedback"]) .cast-roster-label{display:none}
 [data-theme] .game:is([data-phase="question"],[data-phase="feedback"]) .growth{display:none}
 [data-theme] .game:is([data-phase="question"],[data-phase="feedback"]) .staff-roster{margin:0;gap:5px}
 [data-theme] .game:is([data-phase="question"],[data-phase="feedback"]) .cast-card{display:flex;align-items:center;justify-content:center;gap:2px;border:0;background:none;box-shadow:none;padding:0;min-height:44px}
 [data-theme] .game:is([data-phase="question"],[data-phase="feedback"]) .cast-card[aria-current=true]{background:#ffe3d3}
 [data-theme] .game:is([data-phase="question"],[data-phase="feedback"]) .cast-card .avatar{width:30px;height:30px;margin:0}
 [data-theme] .game:is([data-phase="question"],[data-phase="feedback"]) .cast-card small{display:none}
 .question-speaker{gap:7px;margin-bottom:9px;padding:6px 8px;border-radius:10px}
 [data-theme] .question-speaker .cast-avatar{width:38px;height:38px}.question-speaker p{font-size:10px;line-height:1.45}.question-speaker b{font-size:9px;margin-bottom:1px}
 dialog.character-dialog{padding:16px;border-radius:18px}.profile-layout{grid-template-columns:37% 1fr;gap:15px;align-items:start}
 .profile-copy h2{font-size:27px;letter-spacing:2px}.profile-copy h2 small{font-size:10px;margin-left:6px}.profile-copy .eyebrow{font-size:9px}
 .profile-copy blockquote{font-size:13px;padding:8px 0 8px 9px;margin:12px 0}.profile-copy p,.profile-copy dd{font-size:11px;line-height:1.7}.profile-copy .profile-status{font-size:9px}
 .profile-copy dt{font-size:9px}.profile-copy .profile-note{font-size:10px}.profile-art{position:sticky;top:0}.profile-number{font-size:27px;left:8px;top:8px}
 .profile-nav{gap:4px}.profile-nav button{flex-direction:column;gap:2px;font-size:10px;padding:6px 2px}
}
@media(prefers-reduced-motion:reduce){.office-actor{transition:none}}
@media(max-width:760px){
 [data-theme] .cast-card b{white-space:nowrap}
 [data-theme="coral"] .shell:has(.game[data-phase="question"]) .masthead{height:46px;margin-bottom:6px}
 [data-theme="coral"] .game[data-phase="question"]{gap:9px}
 [data-theme="coral"] .game[data-phase="question"] .console{padding:10px 13px 13px}
 [data-theme="coral"] .game[data-phase="question"] .question-panel h2{font-size:23px;margin:9px 0}
 [data-theme="coral"] .game[data-phase="question"] #answer-form{padding:7px;gap:6px}
 [data-theme] .game[data-phase="feedback"] .world{padding:8px}
 [data-theme] .game[data-phase="feedback"] .office-frame{display:block;width:100%;height:142px;max-height:none;aspect-ratio:auto;transform:none;margin:0}
 [data-theme] .game[data-phase="feedback"] .office-actor{height:95%;width:22%;margin-left:-11%}
 [data-theme] .game[data-phase="feedback"] .staff-roster{display:none}
 [data-theme] .game[data-phase="feedback"] .office-place,[data-theme] .game[data-phase="feedback"] .scene-tag{display:none}
}
@media(max-width:380px) and (max-height:740px){
 [data-theme="coral"] .game[data-phase="question"] .world{display:none}
 [data-theme="coral"] .game[data-phase="question"] .question-panel h2{font-size:21px;margin:6px 0}
 [data-theme="coral"] .game[data-phase="question"] .facts{padding:7px 9px;margin:8px 0 0}
 [data-theme="coral"] .game[data-phase="question"] .keypad{gap:5px}
 [data-theme="coral"] .game[data-phase="question"] .keypad button{height:44px}
 [data-theme="coral"] .game[data-phase="question"] .answer-display{height:44px}
 [data-theme="coral"] .game[data-phase="question"] .primary{min-height:44px;height:44px}
 [data-theme="coral"] .game[data-phase="question"] .question-speaker{margin-bottom:6px}
}
@media(max-width:760px){
 [data-theme="coral"] .shell:has(.game[data-phase="feedback"]) .masthead{height:46px;margin-bottom:6px}
 [data-theme="coral"] .game[data-phase="feedback"]{gap:9px}
 [data-theme="coral"] .game[data-phase="feedback"] .console{padding:10px 13px 13px}
 [data-theme="coral"] .game[data-phase="feedback"] .question-top,[data-theme="coral"] .game[data-phase="feedback"] .facts{display:none}
 [data-theme="coral"] .game[data-phase="feedback"] .question-panel h2{font-size:18px;margin:6px 0;line-height:1.4}
 [data-theme="coral"] .game[data-phase="feedback"] .response{margin-top:10px;padding:12px 14px}
 [data-theme="coral"] .game[data-phase="feedback"] .solution-answer{font-size:39px;line-height:1.2;margin:8px 0}
 [data-theme="coral"] .game[data-phase="feedback"] .response p{font-size:12px;line-height:1.6;margin:8px 0}
 [data-theme="coral"] .game[data-phase="feedback"] .work-stamp{margin-top:10px;padding-top:8px;font-size:11px}
 [data-theme="coral"] .game[data-phase="feedback"] .next{margin-top:10px}
}
@media(max-width:380px) and (max-height:740px){[data-theme] .game[data-phase="feedback"] .office-frame{height:112px}}

/* Roster grows only after encounters, without empty slots for unseen characters. */
[data-theme] .world .staff-roster{grid-template-columns:repeat(var(--cast-count,1),minmax(0,110px))}
.profile-nav button{flex:0 1 145px}
.arrival-story{padding:14px 16px;margin:0 0 15px;border-left:3px solid #be8063;background:#fff7eb;color:#694d43}
.arrival-story>b{font-size:14px}.arrival-story p{font-size:12px;line-height:1.8;margin:8px 0 0}

.sourcing-scene{margin:18px 0;padding:17px 19px;border:1px solid #dec4b3;background:#fffaf2;border-radius:13px;color:#634a42}
.sourcing-scene>p{font-size:13px;line-height:1.8;margin:0 0 9px}.sourcing-scene>p>b{font-size:10px;color:#a56e59;margin-right:6px}
.sourcing-scene .scene-aside{font-size:11px;color:#8d776b;border-top:1px dashed #deccba;padding-top:12px;margin-top:13px}
.visitor{display:flex;align-items:flex-start;gap:11px;margin-top:14px}.visitor button{border:0;padding:0;background:none;cursor:pointer;flex-shrink:0}.visitor>div>b{font-size:11px;color:#a56e59}.visitor p{font-size:14px;line-height:1.75;margin:6px 0 0}
.sourcing-terms{font-size:13px;line-height:1.8;padding:3px 0 8px}.sourcing-terms p{font-size:12px;color:#8b6f63;margin:5px 0}.sourcing-note{font-size:11px;line-height:1.75;color:#8b6f63;border-top:1px dashed #d6c0ad;padding-top:12px}
[data-theme="coral"] .company-route{grid-template-columns:repeat(4,minmax(0,1fr));row-gap:12px}
@media(max-width:760px){.sourcing-scene{padding:13px;margin:13px 0}.sourcing-scene>p{font-size:12px}.visitor p{font-size:12px}.sourcing-terms{font-size:12px}.sourcing-terms p{font-size:11px}[data-theme="coral"] .company-route b{font-size:9px}}

/* A quote starts with the customer's budget and the company's margin target. */
.pricing-conditions{display:grid;grid-template-columns:1fr 1fr;border:1px solid #dcb798;border-radius:12px;overflow:hidden;margin:18px 0;background:#fff2db}
.pricing-conditions>span{padding:12px 15px;font-size:11px;color:#7d5549}
.pricing-conditions>span+span{border-left:1px dashed #d3ae91}
.pricing-conditions b{display:block;margin-top:5px;font-size:27px;color:#713f34;font-variant-numeric:tabular-nums}
.pricing-conditions small{font-size:12px;margin-left:3px}
.proposal-delivered{margin:20px 0;padding:14px 16px;border-left:4px solid #bc674f;background:#f8eadc;color:#65473c}
.proposal-delivered b{font-size:15px}.proposal-delivered p{font-size:12px;line-height:1.8;margin:7px 0 0}
@media(max-width:760px){.pricing-conditions>span{font-size:10px;padding:10px}.pricing-conditions b{font-size:23px}.pricing-brief .offer-facts{gap:12px}}
@media(max-width:760px){[data-theme="coral"] .company-route{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));row-gap:12px}}
.shipping-fee{display:flex;justify-content:space-between;gap:8px;border-top:1px dashed #d6b6a0;margin-top:12px;padding-top:10px;font-size:12px;color:#824f43}.shipping-receipt{margin:0 0 22px;padding:14px 18px;border:1px solid #d1aa83;border-top:0;background:#fff1d9;color:#654638}.shipping-receipt>span{display:flex;justify-content:space-between;gap:16px;font-size:13px;margin:8px 0}.shipping-receipt>span:nth-child(2){font-weight:bold;font-size:16px}.shipping-receipt small{display:block;margin-top:12px;font-size:11px;line-height:1.65}.office-stage[data-count="5"] .office-actor{width:23%;margin-left:-11.5%}

/* The receipt follows the same hand anchors as the generated action poses. */
.office-paper{position:absolute;z-index:6;background:#fff7e8;border:1px solid #846759;border-radius:1px;box-shadow:1px 2px 0 #3f2c3220;pointer-events:none;padding:2px;box-sizing:border-box}
.office-paper[hidden]{display:none}
.office-paper i{display:block;width:70%;height:1px;margin:1px 0;background:#c4a38b}
.office-paper i:last-child{width:40%;background:#d97b66}
.office-stage[data-scene="ledger"] .office-actor[data-person="yui"],.office-stage[data-scene="ledger"] .office-actor[data-person="ritsu"]{z-index:5}
[data-theme="coral"] .facts.facts-many{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 8px}
[data-theme="coral"] .facts.facts-many>span{min-width:0;white-space:normal;padding:0;border:0}
[data-theme="coral"] .facts.facts-many>span:last-child{grid-column:1/-1;border-top:1px dashed #c5a98f;padding-top:5px}

.delivery-time{position:relative;margin:16px 0;padding:14px 16px;border:1px dashed #c89977;border-radius:12px;background:#fff2dd;color:#674b43}
.delivery-time>span{font-size:10px;color:#a25a48;letter-spacing:.8px;font-weight:700}
.delivery-time h3{font-size:15px;line-height:1.6;margin:6px 0}
.delivery-time p{font-size:12px;line-height:1.75;margin:0}

/* The quote remains open until the player has enough information to reply. */
.volume-decision h2{margin:8px 0 18px;font-size:clamp(21px,3vw,27px);line-height:1.5}
.reply-calculation{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px;padding:14px 16px;background:#fff4db;border:1px dashed #c79e70;border-radius:8px;color:#664c3e}
.reply-calculation>span{font-size:12px}.reply-calculation b{display:block;font-size:22px;font-variant-numeric:tabular-nums}
.reply-calculation p{grid-column:1/-1;margin:0;padding-top:9px;border-top:1px solid #e3c6a3;font-size:16px}.reply-calculation p small{display:block;margin-top:5px;font-size:12px;line-height:1.7}
.reply-options{display:grid;gap:12px;margin:18px 0 12px}
.reply-option{display:grid;grid-template-columns:52px minmax(0,1fr) 15px;align-items:center;gap:12px;width:100%;padding:16px 14px;text-align:left;background:#fffaf5;color:#633e3c;border:2px solid #c57666;border-radius:8px 15px 15px 8px;box-shadow:0 3px 0 #c5766633;cursor:pointer;font:inherit}
.reply-option:hover{background:#ffeddf;transform:translateY(-1px)}.reply-option:focus-visible{outline:3px solid #573a62;outline-offset:3px}
.reply-number{font-size:32px;line-height:1;font-weight:800;font-variant-numeric:tabular-nums}.reply-number small{font-size:12px;margin-left:2px}
.reply-option b{display:block;font-size:14px;line-height:1.5}.reply-option>span:not(.reply-number)>small{display:block;font-size:12px;line-height:1.7;margin-top:5px}.reply-option i{font-style:normal}
.reply-note{margin:0;font-size:12px;line-height:1.7;color:#84675f}
@media(max-width:760px){.volume-decision .question-speaker{margin-bottom:14px}.volume-decision h2{margin-bottom:12px;font-size:21px}.reply-calculation{padding:10px 12px;gap:5px 10px}.reply-options{margin-top:14px;gap:10px}.reply-option{grid-template-columns:46px minmax(0,1fr) 12px;gap:8px;padding:12px 10px}.reply-number{font-size:28px}}

@media(max-width:760px) and (max-height:740px){
 [data-theme] .game[data-reply="true"] .round-head{padding-bottom:6px;margin-bottom:8px}
 .volume-decision>.eyebrow{display:none}.volume-decision .question-speaker{margin-bottom:8px}
 .volume-decision h2{font-size:19px;margin:7px 0 10px}
 .reply-calculation{padding:8px 10px;gap:4px 8px}.reply-calculation>span{font-size:11px}.reply-calculation b{display:inline;margin-left:5px;font-size:16px}
 .reply-calculation p{padding-top:4px;font-size:14px}.reply-calculation p small{font-size:11px;line-height:1.5;margin-top:2px}
 .reply-options{gap:8px;margin:10px 0 8px}.reply-option{padding:9px 8px}.reply-option b{font-size:13px}.reply-option>span:not(.reply-number)>small{font-size:11px;line-height:1.5;margin-top:3px}.reply-note{font-size:11px}
 [data-debug-focus="true"] .shell:has(.game[data-reply="true"]) .masthead{display:none}
 [data-debug-focus="true"]:has(.game[data-reply="true"]) #debug-tools:has(#debug-panel[hidden]) .debug-status{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%)}
}

/* Return to the initiating control even after browsing several profiles. */
body:has(dialog[open]){overflow:hidden}
dialog.character-dialog{overscroll-behavior:contain;scrollbar-gutter:stable}
.profile-toolbar{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;margin:0 0 16px;background:#fff9f1;border-bottom:1px dashed #d6bcb0;color:#765750}
.profile-toolbar>span{font-size:12px;font-weight:600;letter-spacing:1px}
.profile-toolbar button{min-width:84px;min-height:44px;padding:7px 12px;border:1px solid #d8b8a8;border-radius:10px;background:#fff4e8;color:#764a41;font-size:13px;display:flex;gap:14px;align-items:center;justify-content:center}
.profile-toolbar button span{font-size:22px;font-weight:400;line-height:1}
.brief-choice-jump,.brief-story-back{display:none}
.brief-choices{scroll-margin-top:16px}
html[data-debug="true"] .brief-choices,html[data-debug="true"] .brief h2,html[data-debug="true"] .console{scroll-margin-top:80px}
@media(max-width:760px){
 .character-dialog .profile-art{top:60px}
 .profile-toolbar{margin-bottom:12px}
 .profile-nav button{min-height:52px}
 .brief-choice-jump,.brief-story-back{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;width:100%;border:1px solid #d8b8a8;border-radius:9px;padding:9px 12px;background:#fff7eb;color:#874c40;font-size:12px;font-weight:600}
 .brief-choice-jump{margin:-4px 0 18px}
 .brief-story-back{margin:16px 0 0;border-style:dashed;background:transparent}
}

.compact-talk,.compact-hint{display:none}
/* On the shortest phones, keep the number pad at 44px and move optional reading. */
@media(max-width:380px) and (max-height:620px){
 [data-theme="coral"] .game[data-phase="question"] .console{padding:5px 10px 8px}
 [data-theme="coral"] .game[data-phase="question"] .round-head{padding-bottom:0;margin-bottom:4px;height:32px}
 [data-theme="coral"] .game[data-phase="question"] .question-speaker{height:44px;min-height:44px;padding:0 5px;margin-bottom:4px;gap:5px}
 [data-theme="coral"] .game[data-phase="question"] .question-speaker>p{display:none}
 [data-theme="coral"] .game[data-phase="question"] .question-speaker>button:first-child{min-width:44px;min-height:44px}
 [data-theme="coral"] .game[data-phase="question"] .compact-talk{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:1;min-height:44px;padding:0 8px;background:transparent;border:0;font-size:12px;color:#785044}
 [data-theme="coral"] .game[data-phase="question"] .question-top{display:none}
 [data-theme="coral"] .game[data-phase="question"] .question-panel h2{font-size:19px;line-height:1.35;margin:5px 0}
 [data-theme="coral"] .game[data-phase="question"] .facts{padding:5px 7px;margin:5px 0;font-size:11px}
 [data-theme="coral"] .game[data-phase="question"] .assist-line{display:block;min-height:0;height:auto;margin:0}
 [data-theme="coral"] .game[data-phase="question"] .assist-line>.text-button{display:none}
 [data-theme="coral"] .game[data-phase="question"] .notice:empty{display:none}
 [data-theme="coral"] .game[data-phase="question"] .notice:not(:empty){display:block;font-size:11px;line-height:16px;margin:2px 0}
 [data-theme="coral"] .game[data-phase="question"] #answer-form{padding:5px;gap:5px}
 [data-theme="coral"] .game[data-phase="question"] .answer-display{padding:0 8px 0 0;gap:5px}
 [data-theme="coral"] .game[data-phase="question"] .answer-display label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 [data-theme="coral"] .game[data-phase="question"] .compact-hint{display:block;min-height:44px;min-width:52px;padding:4px 8px;border:0;border-right:1px solid #dcc5b0;border-radius:7px 0 0 7px;background:#faecdb;color:#7e4e43;font-size:11px}
}

@media(max-width:380px) and (max-height:620px){
 [data-theme="coral"] .game[data-phase="question"] .facts.facts-many{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;font-size:10px;line-height:22px}
 [data-theme="coral"] .game[data-phase="question"] .facts.facts-many b{font-size:16px}
 [data-theme="coral"] .game[data-phase="question"] .facts.facts-many>span:last-child{grid-column:auto;border-top:0;padding-top:0}
}
.rush-call{display:flex;gap:12px;align-items:center;margin:18px 0;padding:14px 16px;background:#382e43;color:#fff8ed;border-radius:12px;box-shadow:0 4px 0 #c88673}
.rush-call p{margin:0;line-height:1.85}.rush-call b{color:#ffc787}.call-badge{font-size:28px;flex:none;animation:incoming-call .5s ease-in-out 3}
.rush-plan{padding:4px 16px;margin:16px 0;background:#f6e8d8;border-left:4px solid #c35f4c;border-radius:4px}.rush-plan p{font-size:13px;line-height:1.8}.rush-plan b{display:block;color:#814232}
.rush-time>span{font-variant-numeric:tabular-nums}.rush-time small{font-weight:400;font-size:11px;margin-left:8px}
.rush-epilogue{padding:12px 16px;margin-top:20px;background:#fff9ed;border:1px dashed #c79770;border-radius:10px}.rush-epilogue p{font-size:13px;line-height:1.9}.rush-epilogue b{display:block;color:#884735}
@keyframes incoming-call{0%,100%{transform:rotate(0)}25%{transform:rotate(-12deg)}75%{transform:rotate(12deg)}}
@media(prefers-reduced-motion:reduce){.call-badge{animation:none}}

/* First delivery: reveal records after they have something to record. */
.game[data-first-delivery="true"] .ledger{display:none}
.game[data-first-delivery="true"][data-phase="brief"] :is(.growth,.cast-roster-label,.staff-roster){display:none}
.game[data-first-delivery="true"] #company-route{display:none}
.money-picture{margin:16px 0 0;padding-top:12px;border-top:1px dashed #cdb493}
.money-picture figcaption{font-size:11px;color:#796050;margin-bottom:9px}
.money-picture-bar{display:flex;height:16px;gap:3px;border-radius:4px;overflow:hidden}
.money-picture-bar>span{background:#baa58a}.money-picture-bar>b{background:#b14b3f}
.money-picture-labels{display:flex;justify-content:space-between;gap:10px;margin-top:7px;font-size:12px;color:#705749}
.money-picture-labels>span:last-child{color:#9a4439}.money-picture-labels b{margin-left:5px}
@media(max-width:760px){
 [data-theme="coral"] .game[data-first-delivery="true"][data-phase="brief"] .world h1{font-size:19px}
 [data-theme="coral"] .game[data-first-delivery="true"][data-phase="brief"] .office-frame{aspect-ratio:2.2}
}

.customer-reply{padding:14px 16px;margin:18px 0;background:#fff9ed;border:1px solid #ddc9ae;border-left:3px solid #b14b3f;border-radius:4px 10px 10px 4px}
.customer-reply b{font-size:11px;color:#925546}.customer-reply p{font-size:13px;margin-top:7px;line-height:1.85;color:#604a41}
.calculation-record{margin:12px 0;color:#796050;font-size:11px}
.calculation-record summary{cursor:pointer;min-height:44px;display:flex;align-items:center;gap:9px}
.calculation-record summary::before{content:'＋';font-size:15px}.calculation-record[open] summary::before{content:'−'}
.calculation-record p{padding:0 0 12px;line-height:1.8}
.calculation-record summary:focus-visible{outline:3px solid #b14b3f;outline-offset:3px;border-radius:4px}

.order-reason{font-size:14px;color:#574338}
.order-reason p{margin:0 0 8px;padding:0;line-height:1.85}

/* Keep repeated answer taps in one place; only the reading area varies. */
.game:has(#answer-form) .question-reading{height:230px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.question-reading:focus-visible{outline:2px solid #b14b3f;outline-offset:-2px;border-radius:8px}
[data-theme] .game:has(#answer-form) .assist-line{height:52px;min-height:52px;flex-shrink:0;margin:0;overflow:auto;align-items:center}
[data-theme] .game:has(#answer-form) #answer-form{flex-shrink:0;margin:0}
@media(max-width:760px){
 [data-theme] .shell:has(#answer-form){height:100dvh;min-height:480px;display:flex;flex-direction:column;padding-bottom:max(8px,env(safe-area-inset-bottom));overflow:hidden}
 html[data-debug="true"] .shell:has(#answer-form){height:100%}
 [data-theme] .shell:has(#answer-form) .masthead{flex-shrink:0}
 [data-theme] .shell:has(#answer-form) footer{display:none}
 [data-theme] .game:has(#answer-form){flex:1;min-height:0;display:flex;flex-direction:column;overflow:visible;gap:0}
 [data-theme] .game:has(#answer-form) .world{display:none}
 [data-theme] .game:has(#answer-form) .console{flex:1;min-height:0;display:flex;flex-direction:column}
 [data-theme] .game:has(#answer-form) .round-head{flex-shrink:0}
 [data-theme] .game:has(#answer-form) #content{flex:1;min-height:0;display:flex;flex-direction:column}
 [data-theme] .game:has(#answer-form) .question-reading{height:auto;flex:1;min-height:48px}
 [data-theme] .game:has(#answer-form) .assist-line{height:44px;min-height:44px}
 [data-theme] .game:has(#answer-form) .notice{line-height:16px;font-size:11px}
 [data-theme] .game:has(#answer-form) .answer-display{height:50px;flex-shrink:0}
 [data-theme] .game:has(#answer-form) .keypad button{height:44px}
 [data-theme] .game:has(#answer-form) #answer-form>.primary{height:48px;min-height:48px}
}
@media(max-width:380px) and (max-height:620px){
 [data-theme] .game:has(#answer-form) .assist-line{height:34px;min-height:34px}
 [data-theme] .game:has(#answer-form) .answer-display{height:44px}
 [data-theme] .game:has(#answer-form) #answer-form>.primary{height:44px;min-height:44px}
}

@media(min-width:761px){
 [data-theme] .game:has(#answer-form) .console{height:calc(100dvh - 190px);min-height:510px;display:flex;flex-direction:column;align-self:start;padding:16px}
 .game:has(#answer-form) .round-head{flex-shrink:0}
 .game:has(#answer-form) #content{display:flex;flex-direction:column;flex:1;min-height:0}
 .game:has(#answer-form) .question-reading{height:auto;flex:1;min-height:48px}
 [data-theme] .game:has(#answer-form) #answer-form{padding:7px;gap:6px}
 [data-theme] .game:has(#answer-form) .answer-display{height:50px}
 [data-theme] .game:has(#answer-form) .keypad{gap:6px}
 [data-theme] .game:has(#answer-form) .keypad button{height:44px}
 [data-theme] .game:has(#answer-form) #answer-form>.primary{height:48px;min-height:48px}
}

@media(min-width:761px){
 [data-theme] .shell:has(#answer-form) .masthead{height:46px;margin-bottom:8px}
 [data-theme] .game:has(#answer-form) .console{height:calc(100dvh - 130px);min-height:590px}
 [data-theme] .game:has(#answer-form) .round-head{height:40px;margin-bottom:8px;padding-bottom:6px}
 [data-theme] .game:has(#answer-form) .assist-line{height:44px;min-height:44px}
 [data-theme] .game:has(#answer-form) .question-speaker{padding:6px 8px;margin-bottom:8px}
 [data-theme] .game:has(#answer-form) .question-speaker .cast-avatar{width:38px;height:38px}
 [data-theme] .game:has(#answer-form) .question-panel h2{font-size:23px;line-height:1.4;margin:8px 0}
}
@media(min-width:761px){
 [data-theme] .game:has(#answer-form) .console{height:calc(100dvh - 60px)}
 html[data-debug="true"] .shell:has(#answer-form) .masthead{display:none}
 html[data-debug="true"] .game:has(#answer-form) .console{height:calc(100dvh - 80px)}
}

/* A continuous workspace: only the reading area changes after an answer. */
[data-theme] .game:has(#answer-form) #answer-form{display:grid;gap:6px;padding:7px}
[data-theme] .game:has(#answer-form) .keypad{gap:6px}
[data-theme] #answer-form[data-checked="true"] .keypad button:disabled{opacity:1;color:#9e887b;background:#eee0cf;box-shadow:0 2px 0 #cebaa4;cursor:default}
[data-theme] #answer-form[data-checked="true"] .answer-display{border-color:#b45b46;background:#fff4df}
[data-theme] .game:has(#answer-form) .compact-hint{display:block;min-height:44px;min-width:52px;border:0;border-right:1px solid #dcc5b0;background:#faecdb;color:#7e4e43;font-size:11px}
[data-theme] .game:has(#answer-form) .response{margin:0;padding:8px 10px}
[data-theme] .game:has(#answer-form) .response .solution-answer{display:none}
[data-theme] .game:has(#answer-form) .response .formula{margin:7px 0;font-size:19px}
[data-theme] .game:has(#answer-form) .response p{line-height:1.65}
@media(max-width:760px){
 [data-theme] .shell:has(#answer-form) .masthead{display:none}
 [data-theme] .game:has(#answer-form) .world{display:block;flex:none;height:clamp(96px,20dvh,164px);padding:0;margin:0 0 6px}
 [data-theme] .game:has(#answer-form) .world>:not(.office-frame){display:none}
 [data-theme] .game:has(#answer-form) .office-frame{display:block;height:100%;min-height:0;aspect-ratio:auto;margin:0}
 [data-theme] .game:has(#answer-form) .office-scene-line{display:none}
 [data-theme] .game:has(#answer-form) .console{padding:7px 8px}
 [data-theme] .game:has(#answer-form) .round-head{height:24px;min-height:24px;margin:0 0 4px;padding:0;border:0}
 [data-theme] .game:has(#answer-form) .round-head li small{display:none}
 [data-theme] .game:has(#answer-form) .question-speaker{display:none}
 [data-theme] .game:has(#answer-form) .question-top{display:none}
 [data-theme] .game:has(#answer-form) .question-panel h2{font-size:19px;line-height:1.4;margin:4px 0}
 [data-theme] .game:has(#answer-form) .facts{font-size:11px;line-height:1.6;padding:5px 7px;margin:4px 0}
 [data-theme] .game:has(#answer-form) .assist-line{height:24px;min-height:24px;display:flex;justify-content:space-between;gap:4px}
 [data-theme] .game:has(#answer-form) .assist-line>.text-button{display:none}
 [data-theme] .game:has(#answer-form) .answer-display{height:44px;padding:0 8px 0 0;gap:5px}
 [data-theme] .game:has(#answer-form) .answer-display label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 [data-theme] .game:has(#answer-form) #answer-form>.primary{height:48px;min-height:48px;margin:0;font-size:15px}
 [data-theme] .game:has(#answer-form) .response-label{font-size:12px}
 [data-theme] .game:has(#answer-form) .response p{font-size:12px;margin:5px 0}
 [data-theme] .game:has(#answer-form) .response .work-stamp{margin:6px 0}
}
@media(max-width:760px) and (max-height:620px){
 [data-theme] .game:has(#answer-form) .world{height:84px;margin-bottom:4px}
 [data-theme] .game:has(#answer-form) .console{padding:4px 6px}
 [data-theme] .game:has(#answer-form) #answer-form{padding:4px;gap:4px}
 [data-theme] .game:has(#answer-form) .keypad{gap:4px}
 [data-theme] .game:has(#answer-form) #answer-form>.primary{height:44px;min-height:44px}
 [data-theme] .game:has(#answer-form) .question-panel h2{font-size:17px;margin:2px 0}
}
@media(max-width:760px){
 [data-theme] .game:has(#answer-form) .world{width:100%;max-width:none;align-self:stretch}
 [data-theme] .game:has(#answer-form) .office-frame{width:100%;max-width:none}
 [data-theme] .game:has(#answer-form) .console{width:100%;align-self:stretch}
}
@media(max-width:760px){
 [data-theme] .game:has(#answer-form) .world{height:clamp(96px,17dvh,148px)}
 html:has(#answer-form) #debug-tools:has(#debug-panel[hidden]) .debug-status{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%)}
 [data-theme] .game:has(#answer-form) .round-head>span{white-space:nowrap;font-size:10px}
 [data-theme] .game:has(#answer-form) .round-head ol{flex:1}
}
@media(max-width:760px) and (max-height:620px){
 [data-theme] .game:has(#answer-form) .world{height:84px}
}
@media(max-width:760px){
 [data-theme] .game:has(#answer-form) .response .result-mark{display:none}
 [data-theme] .game:has(#answer-form) .response-label{line-height:18px;margin:0}
 [data-theme] .game:has(#answer-form) .response .formula{font-size:18px;line-height:24px;margin:3px 0}
}
@media(max-width:760px) and (max-height:620px){
 [data-theme] .game:has(#answer-form) .world{height:80px}
 [data-theme] .game:has(#answer-form) .round-head{height:16px;min-height:16px;margin:0}
 [data-theme] .game:has(#answer-form) .round-head li strong{width:16px;height:16px;line-height:16px;font-size:9px}
 [data-theme] .game:has(#answer-form) .round-head>span i{display:none}
 [data-theme] .game:has(#answer-form) .assist-line{height:18px;min-height:18px}
 [data-theme] .game:has(#answer-form) .facts b{font-size:16px}
}
[data-theme] .game:has(#answer-form) #answer-form>.primary{margin:0}
.mini-conversation{display:none}
@media(max-width:760px){
 [data-theme] .game:has(#answer-form) .mini-conversation{display:block;position:absolute;top:3px;right:4px;z-index:8;min-height:44px;padding:0 9px;border:1px solid #d2bba2;border-radius:8px;background:#fff8eae8;color:#7e4e43;font:inherit;font-size:11px}
}

/* Keep the coral office and its conversation together during arithmetic. */
@media(max-width:760px){
 [data-theme="coral"] .game:has(#answer-form) .world{height:clamp(164px,27dvh,236px);padding:7px 8px 8px;margin-bottom:8px;display:flex;flex-direction:column;gap:7px;background:linear-gradient(150deg,#ffd4bf,#f1af97);border:1px solid #c99079;border-radius:15px;box-shadow:0 3px 0 #c8937c, inset 0 1px 0 #ffeade}
 [data-theme="coral"] .game:has(#answer-form) .office-frame{flex:1;min-height:0;width:100%;height:auto;border:3px solid #fff0dd;border-radius:9px;transform:none;box-shadow:0 0 0 1px #b2826c,0 2px 0 #b37c6150}
 [data-theme="coral"] .game:has(#answer-form) .world-caption{display:flex;flex:none;height:56px;min-height:56px;width:100%;margin:0;padding:5px 8px;gap:7px;border-radius:4px 10px 10px 10px;background:#fff9ed;box-shadow:0 2px 0 #bb7e6640}
 [data-theme="coral"] .game:has(#answer-form) .world-caption #world-message{font-size:12px;line-height:17px;max-height:51px;overflow:auto;overscroll-behavior:contain}
 [data-theme="coral"] .game:has(#answer-form) .world-caption .cast-avatar{width:32px;height:36px;flex:none}
 [data-theme="coral"] .game:has(#answer-form) .mini-conversation{display:none}
 [data-theme="coral"] .game:has(#answer-form) .console{padding:5px 8px 6px;background:#fff9ed;border:1px solid #d5a88d;border-top:3px solid #ad5046;border-radius:8px 8px 12px 12px;box-shadow:0 3px 0 #d6ae92}
 [data-theme="coral"] .game:has(#answer-form) .round-head{height:18px;min-height:18px;margin:0 0 3px}
 [data-theme="coral"] .game:has(#answer-form) .round-head>span i{display:none}
 [data-theme="coral"] .game:has(#answer-form) .assist-line{height:18px;min-height:18px}
 [data-theme="coral"] .game:has(#answer-form) #answer-form{padding:4px;gap:4px;background:#efd2b9;border-color:#d2a385;box-shadow:inset 0 1px 0 #fff5df}
 [data-theme="coral"] .game:has(#answer-form) .keypad{gap:4px}
 [data-theme="coral"] .game:has(#answer-form) #answer-form>.primary{height:44px;min-height:44px}
 [data-theme="coral"] .game:has(#answer-form) .question-panel h2{font-size:18px;line-height:1.35;margin:3px 0}
 [data-theme="coral"] .game:has(#answer-form) .facts{margin:3px 0;padding:4px 6px}
 [data-theme="coral"] .game:has(#answer-form) .facts b{font-size:17px}
}
@media(max-width:760px) and (max-height:620px){
 [data-theme="coral"] .game:has(#answer-form) .world{height:130px;padding:5px 6px 6px;gap:5px;margin-bottom:5px}
 [data-theme="coral"] .game:has(#answer-form) .world-caption{height:49px;min-height:49px;padding:3px 6px}
 [data-theme="coral"] .game:has(#answer-form) .world-caption #world-message{font-size:11px;line-height:14px;max-height:42px}
 [data-theme="coral"] .game:has(#answer-form) .console{padding:3px 5px 4px}
 [data-theme="coral"] .game:has(#answer-form) .round-head{height:14px;min-height:14px;margin:0}
 [data-theme="coral"] .game:has(#answer-form) #answer-form{gap:2px;padding:3px}
 [data-theme="coral"] .game:has(#answer-form) .keypad{gap:2px}
 [data-theme="coral"] .game:has(#answer-form) .question-panel h2{font-size:16px;margin:2px 0}
}
@media(max-width:760px){
 [data-theme="coral"] .game:has(#answer-form) .world>.world-caption{display:flex}
}
@media(max-width:760px){
 [data-theme="coral"] .game:has(#answer-form) :is(.question-reading,#world-message){scrollbar-width:thin;scrollbar-color:#c992795c transparent}
 [data-theme="coral"] .game:has(#answer-form) .world-caption #world-message{max-height:52px}
 #world-message:focus-visible{outline:2px solid #a84c43;outline-offset:2px;border-radius:3px}
}
@media(max-width:760px) and (max-height:620px){
 [data-theme="coral"] .game:has(#answer-form) .world-caption #world-message{max-height:43px}
 [data-theme="coral"] .game:has(#answer-form) .response{padding:2px 5px}
 [data-theme="coral"] .game:has(#answer-form) .response-label{font-size:11px;line-height:14px}
 [data-theme="coral"] .game:has(#answer-form) .response .formula{font-size:16px;line-height:22px;margin:2px 0}
}
@media(max-width:760px){
 html:not([data-debug="true"])[data-theme="coral"] .game:has(#answer-form) .world{height:clamp(160px,31dvh,280px)}
}
@media(max-width:760px) and (max-height:620px){
 html:not([data-debug="true"])[data-theme="coral"] .game:has(#answer-form) .world{height:160px}
}
/* Answered keys stay warm; the response carries the completion emphasis. */
[data-theme="coral"] #answer-form[data-checked="true"] .keypad button:disabled{background:#f8ecd9;color:#aa8871;box-shadow:0 2px 0 #c7aa8b}
[data-theme="coral"] .game:has(#answer-form) .response-label{display:inline-flex;align-items:center;padding:1px 7px;border:1px solid #ce9b79;border-radius:4px;background:#ffe6c4;color:#884e3d;font-weight:700}
[data-theme="coral"] .game:has(#answer-form) .response .work-stamp{display:none}
@media(max-width:760px){
 [data-theme="coral"] .game:has(#answer-form) .question-panel h2{margin-top:2px;margin-bottom:2px}
 [data-theme="coral"] .game:has(#answer-form) .facts{margin-top:2px;margin-bottom:2px}
}
@media(max-width:760px){
 [data-theme="coral"] .game:has(#answer-form) .office-place{display:none}
 [data-theme="coral"] .game:has(#answer-form) .office-replay{width:44px;height:44px;min-height:44px;right:3px;bottom:3px;padding:0;border-radius:50%;font-size:0;background:#fff9ede8}
 [data-theme="coral"] .game:has(#answer-form) .office-replay::after{content:'↻';font-size:21px}
}
/* The replay affordance belongs to the stage in every mobile scene. */
@media(max-width:760px){
 [data-theme="coral"] .game .office-replay{width:44px;height:44px;min-height:44px;right:3px;bottom:3px;padding:0;border-radius:50%;font-size:0;background:#fff9ede8}
 [data-theme="coral"] .game .office-replay::after{content:'↻';font-size:21px}
}
@media(max-width:760px){
 [data-theme="coral"] .game .office-scene-line{display:none}
}

/* Give tall phones more stage space without moving the calculator. */
@media(max-width:760px) and (min-height:780px){
 html[data-theme="coral"] .game:has(#answer-form) .world{height:clamp(236px,calc(100dvh - 560px),320px)}
}

/* A quiet cue when the fixed reading area has more content below. */
.reading-cue{display:none}
@media(max-width:760px){
 [data-theme] .game:has(#answer-form) .reading-cue:not([hidden]){display:block;flex:none;margin-left:auto;color:#8a5140;font-size:10px;line-height:18px;white-space:nowrap}
}
@media(max-width:760px){
 [data-theme="coral"] .game:has(#answer-form) .notice{max-width:100%;margin:0;line-height:16px}
}

/* The office is also the title: the player's own cast and furniture remain here. */
.at-title .shell{max-width:760px;padding:24px 20px}
.at-title .masthead,.at-title .console,.at-title footer,.at-title .world>:not(.title-heading):not(.office-frame):not(.title-menu){display:none!important}
.at-title .game{display:block!important;height:auto!important;min-height:0!important;overflow:visible;border:0;box-shadow:none;background:none}
.at-title .game .world{display:block!important;width:100%!important;height:auto!important;margin:0!important;padding:24px!important;border:1px solid #c99079;border-radius:22px;background:linear-gradient(145deg,#ffddc9,#efaf97);box-shadow:0 5px 0 #c58b73,inset 0 1px #fff1dc}
.at-title .title-heading{text-align:center;margin-bottom:20px;color:#703e34}
.title-kicker{font-size:12px;letter-spacing:2px;font-weight:700}
.title-logo{font-size:clamp(36px,7vw,58px);font-weight:950;line-height:.95;letter-spacing:-2px;margin:14px 0;color:#763e36;text-shadow:0 2px #fff0d8}
.title-logo>span{display:block;color:#b34e41;font-size:1.18em;letter-spacing:1px}
.title-dot{color:#d99c37}
.title-heading p{font-size:12px;margin:14px 0 0;line-height:1.7}
.at-title .game .office-frame{display:block!important;aspect-ratio:1.7;width:100%;height:auto!important;min-height:0;max-width:none;margin:0;border:4px solid #fff0dd;border-radius:12px;box-shadow:0 0 0 1px #b2826c,0 3px #b37c6150}
.at-title .office-frame :is(.scene-tag,.office-place,.mini-conversation,.office-replay,.office-scene-line){display:none!important}
.at-title .office-actor{pointer-events:none;animation:title-sway 5s ease-in-out infinite}
.at-title .office-actor:nth-of-type(even){animation-delay:-2s}
.at-title .actor-name{display:none}
.title-menu{display:flex;flex-direction:column;align-items:stretch;max-width:370px;margin:20px auto 0;text-align:center;color:#754b3c}
.title-note{font-size:14px;margin:0 0 14px}
.title-menu>small{font-size:11px;margin-top:13px}
.title-menu .primary{min-height:50px}
.intro-copy{order:-1;min-height:100px;text-align:left;padding:12px 15px;margin-bottom:14px;background:#fff9ed;border:1px solid #d5a88d;border-radius:4px 12px 12px 12px;box-shadow:0 2px #b37c6130}
.intro-copy b{font-size:12px;color:#a34d40}
.intro-copy p{font-size:14px;line-height:1.8;margin-top:4px}
.title-skip{align-self:center;border:0;background:none;color:#805749;text-decoration:underline;font:inherit;font-size:12px;min-height:44px;margin-top:5px}
.at-title .office-actor:focus{outline:none}
@keyframes title-sway{0%,100%{translate:0 0;rotate:-1deg}50%{translate:0 -3px;rotate:1deg}}
@media(max-width:760px){
 .at-title .shell{padding:12px 12px 20px!important}
 .at-title .game .world{padding:17px 13px!important}
 .at-title .title-heading{margin-bottom:16px}
 .at-title .title-heading p{font-size:11px}
 .at-title .title-menu{margin-top:17px}
 .at-title .game .office-frame{aspect-ratio:1.4}
}
@media(max-height:650px){.at-title .title-logo{font-size:34px;margin:8px 0}.at-title .title-heading p{margin-top:8px}.at-title .game .office-frame{aspect-ratio:1.8}.at-title .title-menu{margin-top:13px}.intro-copy{min-height:90px}}
@media(prefers-reduced-motion:reduce){.at-title .office-actor{animation:none}}

.opening-letter{position:absolute;right:8px;bottom:8px;z-index:10;max-width:80%;padding:10px 13px;text-align:left;background:#fff9ed;border:1px solid #bd8d70;border-radius:3px;box-shadow:0 3px 0 #a6765555;rotate:-2deg;animation:letter-arrives .35s ease-out;color:#704536}
.opening-letter span{display:block;font-size:10px;margin-bottom:4px}.opening-letter b{font-size:12px}
@keyframes letter-arrives{from{translate:0 15px;opacity:0;rotate:3deg}to{translate:0 0;opacity:1;rotate:-2deg}}
@media(prefers-reduced-motion:reduce){.opening-letter{animation:none}}
.at-title .game .world>.title-heading{display:block!important}
.at-title .game .world>.title-menu{display:flex!important}
.at-title .game .office-frame{flex:none!important;aspect-ratio:1.7!important}
@media(max-width:760px){.at-title .game .office-frame{aspect-ratio:1.4!important}}
@media(max-height:650px){.at-title .game .office-frame{aspect-ratio:1.8!important}}
@media(min-width:761px){.at-title .game .office-frame{height:clamp(180px,32dvh,280px)!important;aspect-ratio:auto!important}.at-title .shell{max-width:680px}}

.title-menu>.resume-place{display:block;text-align:left;line-height:1.7;margin-top:16px;padding:10px 12px;border-top:1px solid #c8927655;color:#754b3c}
.resume-place span,.resume-place strong{display:block}
.resume-place .resume-label{font-size:10px;letter-spacing:1px;color:#895e4e;margin-bottom:3px}
.resume-place strong{font-size:12px;font-weight:700;margin-bottom:2px}
.at-title .office-actor{animation:none}

/* Opening art direction: a sunlit shop window and a printed title card. */
.at-title body{background:radial-gradient(ellipse at 15% 0,#ffeecf 0,transparent 55%),repeating-linear-gradient(112deg,#fff5e900 0 72px,#df947b0b 73px 74px),#f4cfbb}
.at-title .shell{max-width:1140px;padding:clamp(18px,4vh,44px) 28px}
.at-title .game .world{position:relative;isolation:isolate;padding:30px!important;border:1px solid #c0836c;border-radius:24px;background:radial-gradient(ellipse at 0 0,#ffe7c9,transparent 65%),linear-gradient(115deg,#efac94,#f9d1b9 70%);box-shadow:0 6px 0 #b9756055,0 24px 60px #75473524,inset 0 0 0 6px #ffe3cd,inset 0 0 0 7px #ce987b55}
.at-title .world::before{content:'';position:absolute;inset:14px;border:1px dashed #a970543d;border-radius:15px;pointer-events:none;z-index:-1}
.at-title .title-heading{position:relative;margin:0 0 20px;padding:8px 0 0;animation:title-print-in .65s cubic-bezier(.2,.8,.2,1) both}
.title-kicker{display:block;font-size:11px;letter-spacing:1.7px}
.title-edition{display:inline-block;margin:12px 0 1px;background:#fff5df;color:#995038;border:1px solid #d7a982;padding:4px 13px;border-radius:3px;font-size:11px;rotate:-3deg;box-shadow:2px 2px #b56f4833}
.at-title .title-logo{font-size:clamp(45px,5.7vw,68px);line-height:.89;letter-spacing:-3px;margin:16px 0 18px;rotate:-2deg;text-shadow:0 2px #fff4de,0 5px #aa644029}
.at-title .title-logo>span{letter-spacing:-1px;color:#ae463b;font-size:1.16em}
.at-title .title-dot{display:inline-block;color:#dd9a31;animation:title-dot-in .8s cubic-bezier(.2,1.5,.5,1) both}
.at-title .title-heading p{font-size:12px;line-height:1.8;margin:0;color:#754b3c}
.at-title .game .office-frame{border:6px solid #fff4df;border-radius:14px;box-shadow:0 0 0 1px #b37b60,0 5px 0 #b6785e66,0 16px 28px #86482c25;animation:title-window-in .85s cubic-bezier(.16,.8,.2,1) both}
.at-title .office-frame::after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(118deg,transparent 32%,#ffeabb23 42%,transparent 57%);z-index:5;animation:title-light 14s ease-in-out infinite alternate}
.title-stage-decor{position:absolute;inset:0;pointer-events:none;z-index:6;overflow:hidden}
.title-open-sign{position:absolute;left:12px;top:12px;background:#a74d41;color:#fff3d9;border:2px solid #fbd4ad;border-radius:4px;padding:6px 12px;font-size:18px;line-height:1.1;letter-spacing:2px;rotate:-4deg;box-shadow:2px 3px #6f3f3233}
.title-open-sign small{display:block;font-size:8px;letter-spacing:1px;margin-top:4px}
.title-stage-caption{position:absolute;bottom:9px;left:0;right:0;text-align:center;font-size:10px;letter-spacing:1px;color:#78533e}
.title-stage-decor i{position:absolute;width:4px;height:4px;border-radius:50%;background:#fff5dc99;left:24%;top:23%;animation:title-dust 9s ease-in-out infinite}
.title-stage-decor i:nth-of-type(2){left:76%;top:40%;animation-delay:-4s;width:3px;height:3px}.title-stage-decor i:nth-of-type(3){left:55%;top:12%;animation-delay:-7s}
.at-title .title-menu{width:100%;max-width:380px;margin:22px auto 0;animation:title-menu-in .65s ease-out both}
.at-title .title-note{font-size:12px;line-height:1.8;text-align:left;margin:0 0 14px;padding:10px 12px;border-left:3px solid #b05d47;background:#fff5e660;border-radius:0 8px 8px 0}
.at-title .title-menu .primary{min-height:54px;font-size:17px;letter-spacing:1px;box-shadow:0 5px 0 #793a2d,inset 0 1px #e1a083}
.at-title .title-menu .primary:active{box-shadow:0 1px 0 #793a2d}
.at-title .title-menu>.resume-place{background:#fff7e68c;border:1px solid #c8947344;border-radius:3px 3px 9px 9px;box-shadow:2px 3px #b1785420;margin-top:18px;padding:10px 13px}
.at-title .resume-place .resume-label{font-weight:700;color:#a45441;letter-spacing:1px}
.at-title .resume-place strong{font-size:12px;line-height:1.6}
.in-opening .title-stage-caption{display:none}
.in-opening .intro-copy{box-shadow:0 3px #b6785e44;animation:title-menu-in .3s ease-out}
.at-title .opening-letter{z-index:8;bottom:24px;right:12px;background:repeating-linear-gradient(#fff9ed 0 23px,#edddc5 24px 25px);padding:14px 17px;border-left:4px solid #ad5046}
@media(min-width:900px){
 .at-title .game .world{display:grid!important;grid-template-columns:minmax(0,1.25fr) minmax(290px,.85fr);grid-template-rows:auto 1fr;column-gap:34px;align-items:center;min-height:min(620px,calc(100dvh - 90px))}
 .at-title .game .office-frame{grid-column:1;grid-row:1/3;height:clamp(340px,61dvh,520px)!important;aspect-ratio:auto!important}
 .at-title .title-heading{grid-column:2;grid-row:1;margin:0 0 18px}
 .at-title .title-menu{grid-column:2;grid-row:2;align-self:start;margin:0 auto}
 .at-title .title-logo{font-size:clamp(48px,5.4vw,68px)}
}
@media(max-width:899px){
 .at-title .shell{max-width:620px;padding:16px!important}
 .at-title .game .world{padding:20px 16px!important}
 .at-title .title-logo{font-size:46px;margin:10px 0 13px}
 .title-edition{margin-top:8px;padding:2px 10px;font-size:10px}
 .at-title .title-heading{margin-bottom:17px;padding-top:0}
 .at-title .game .office-frame{height:auto!important;aspect-ratio:1.4!important}
 .at-title .title-menu{margin-top:18px}
 .title-open-sign{padding:4px 8px;font-size:14px;left:8px;top:8px}
 .title-open-sign small{font-size:7px}.title-stage-caption{font-size:9px;letter-spacing:0}
}
@media(max-width:760px) and (max-height:740px){
 .at-title .shell{padding:10px!important}.at-title .game .world{padding:15px 13px!important}
 .at-title .title-logo{font-size:37px;margin:8px 0 10px}.at-title .title-heading{margin-bottom:12px}
 .title-kicker{font-size:10px}.title-edition{display:none}.at-title .title-heading p{font-size:11px}
 .at-title .game .office-frame{aspect-ratio:1.75!important}
 .at-title .title-menu{margin-top:14px}.at-title .title-note{padding:6px 9px;margin-bottom:10px;font-size:11px}
 .at-title .title-menu .primary{min-height:48px;font-size:15px}.at-title .title-menu>.resume-place{margin-top:13px;padding:7px 10px}
 .title-stage-caption{font-size:8px;bottom:6px}
}
@keyframes title-print-in{from{opacity:.3;transform:translateY(10px) rotate(1deg)}to{opacity:1;transform:none}}
@keyframes title-window-in{from{opacity:.4;transform:translateY(12px) scale(.975)}to{opacity:1;transform:none}}
@keyframes title-menu-in{from{opacity:.4;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes title-dot-in{from{transform:translateY(-12px) scale(.6)}to{transform:none}}
@keyframes title-light{from{opacity:.35;transform:translateX(-4%)}to{opacity:1;transform:translateX(4%)}}
@keyframes title-dust{0%,100%{translate:0 0;opacity:.1}50%{translate:8px -15px;opacity:.7}}
@media(prefers-reduced-motion:reduce){.at-title .title-heading,.at-title .title-dot,.at-title .game .office-frame,.at-title .office-frame::after,.title-stage-decor i,.at-title .title-menu,.in-opening .intro-copy{animation:none!important}}
.at-title .title-heading{animation-delay:.06s}
.at-title .title-menu{animation-delay:.16s}
@media(max-width:760px){.title-open-sign{font-size:11px;padding:3px 6px;top:6px;left:6px}.title-open-sign small{font-size:6px;margin-top:2px}}
/* Keep the printed logo's glyphs and shadow clear of the next line. */
.at-title .title-logo{line-height:1.08;rotate:-1deg;margin-bottom:18px}
.at-title .title-logo>span{line-height:1.08}
.at-title .title-heading p{position:relative;margin-top:6px}
.at-title .title-edition{margin-bottom:6px}
@media(max-width:760px) and (max-height:740px){.at-title .title-logo{font-size:34px;margin:8px 0 13px}.at-title .title-heading p{margin-top:4px}}

/* Adopted A: rounded MQ lettering, shared by title and game header. */
.masthead .logo>.mq-brand{display:block;width:58px;height:36px;flex:none}
.at-title .title-logo.title-logo-mq{display:flex;flex-direction:column;align-items:center;gap:5px;margin:10px 0 14px;rotate:0;text-shadow:none;line-height:1}
.title-logo-mq>.mq-brand{display:block;width:260px;max-width:100%;height:auto}
.at-title .title-logo-mq>.mq-full-name{font-size:12px;line-height:1.4;letter-spacing:3px;color:#8b4e40;font-weight:800}
@media(max-width:899px){.title-logo-mq>.mq-brand{width:190px}}
@media(max-width:760px) and (max-height:740px){.title-logo-mq>.mq-brand{width:140px}.at-title .title-logo.title-logo-mq{margin:6px 0 10px;gap:2px}.at-title .title-logo-mq>.mq-full-name{font-size:9px;letter-spacing:2px}}

/* A quiet settings control beside the opening title. */
.title-settings{position:absolute;right:0;top:0;width:44px;height:44px;display:grid;place-items:center;border:1px solid #c69075;border-radius:14px;background:#fff4df;color:#965343;box-shadow:0 3px 0 #c79277,inset 0 1px 0 #fff;cursor:pointer;z-index:2}
.title-settings svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round}
.title-settings:active{transform:translateY(2px);box-shadow:0 1px 0 #c79277}
.at-title .title-heading:has(.title-settings){padding-top:44px}
@media(min-width:900px){.title-settings{right:-9px;top:-9px}.at-title .title-heading:has(.title-settings){padding-top:28px}}

.play-guide{list-style:none;counter-reset:guide;padding:0;margin:18px 0;display:grid;gap:10px}
.play-guide li{counter-increment:guide;position:relative;padding:12px 12px 12px 44px;border:1px solid #dab29a;border-radius:12px;background:#fff6e7;color:#703e34}
.play-guide li::before{content:counter(guide);position:absolute;left:12px;top:12px;background:#b45544;color:#fff8e8;width:23px;height:23px;line-height:23px;text-align:center;border-radius:50%;font-weight:800}
.play-guide b{font-size:14px}.play-guide li p{margin:5px 0 0;font-size:12px;line-height:1.7}
.guide-note{border-top:1px solid #c7957955;padding:0;margin:0}
.guide-note summary{cursor:pointer;padding:14px 4px;font-weight:700;font-size:13px;min-height:44px}
.guide-note p{font-size:12px;line-height:1.8;margin:0 4px 12px}
.guide-note summary:focus-visible{outline:2px solid #b45544;outline-offset:1px}

/* Settings and guide: shared paper panel with persistent navigation. */
dialog.menu-panel{width:min(480px,calc(100vw - 24px));max-width:480px;max-height:calc(100dvh - 24px);padding:0;border:2px solid #c78f79;border-radius:22px;background:#fff9ee;color:#68483d;box-shadow:0 8px 0 #92534233,0 24px 80px #502d3b55;overflow:hidden}
dialog.menu-panel[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 22px 15px;background:#f7d6bf;border-bottom:1px solid #dbb298}
.panel-head .eyebrow{font-size:9px;letter-spacing:2px;color:#975744}.panel-head h2{margin:5px 0 0;font-size:23px;color:#744333}
.panel-head h2:focus{outline:none}
.panel-body{min-height:0;overflow:auto;overscroll-behavior:contain;padding:18px 22px;scrollbar-gutter:stable;scrollbar-width:thin}
.panel-body>p:first-child{margin:0 0 14px;font-size:13px;line-height:1.8}
dialog.menu-panel>.primary{margin:0;border-radius:0;min-height:56px;box-shadow:none;border-top:1px solid #8e493b;flex:none}
.panel-back{min-width:70px;min-height:44px;background:#fff5e4;border:1px solid #c99377;border-radius:12px;color:#854936;box-shadow:0 3px #cc997d;font-weight:700}
.save-card{padding:15px;border:1px solid #e0bca3;border-radius:13px;background:#f7ead9;box-shadow:inset 0 1px #fff}
.save-card>span{display:block;font-size:10px;color:#90634d}.save-card>b{display:block;margin:6px 0;font-size:14px;line-height:1.6}.save-card>small{display:block;font-size:11px;line-height:1.6}
.save-card>div{display:flex;gap:28px;border-top:1px dashed #cfa98b;margin-top:12px;padding-top:10px;font-size:11px}.save-card strong{font-size:19px;margin-left:7px}.save-card strong small{font-size:10px;font-weight:500}
.settings-actions{display:grid;gap:11px;margin-top:18px}
dialog.menu-panel .setting{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:56px;border:1px solid #c99577;background:#fff1d9;color:#744936;border-radius:12px;padding:12px 14px;box-shadow:0 3px #d2ad91,inset 0 1px #fff;white-space:normal}
dialog.menu-panel .setting:active{transform:translateY(2px);box-shadow:0 1px #d2ad91}
.settings-actions b{font-size:14px}.settings-actions small{display:block;font-size:10px;font-weight:400;margin-top:4px;line-height:1.6}
.sound-pill{display:flex;gap:7px;align-items:center;font-size:10px;font-weight:800;background:#e3d5c5;border:1px solid #bba08a;padding:5px 7px;border-radius:20px;flex:none}.sound-pill i{width:15px;height:15px;background:#fffaf0;border-radius:50%;box-shadow:0 1px 2px #78463544}
[aria-pressed="true"] .sound-pill{background:#b85444;border-color:#a4493b;color:#fff5df}
.panel-body .storage-note{font-size:11px;line-height:1.8;color:#826856;margin:16px 0}
.restart-section,.development-section{border-top:1px solid #e4cbb7;padding:0;font-size:11px}
.restart-section summary,.development-section summary{cursor:pointer;min-height:44px;padding:14px 0;line-height:1.5}
.restart-section p,.development-section p{font-size:11px;line-height:1.8;margin:0 0 12px}
.development-section{margin-top:6px;color:#927869}.development-section a{display:block;min-height:44px;padding:12px 0;font-size:11px}
.panel-body .play-guide{margin:10px 0 18px}.panel-body .guide-note{border:1px solid #e1c3a9;border-radius:12px;margin:8px 0;background:#fff4e1;padding:0 12px}.panel-body .guide-note[open]{background:#fffaf1}
@media(max-width:400px){.panel-head{padding:15px 16px 12px}.panel-body{padding:14px 16px}.panel-head h2{font-size:21px}.save-card{padding:12px}dialog.menu-panel>.primary{min-height:52px}}
