/* Physical control scheme: concrete compressor / specimen observation. 
   Only presentation, no rules, messages, image crops, or behavior changes. */
:root{
 --lab-ivory:#f5f2e8;--lab-silver:#c5d2d1;--lab-dim:#92a9ad;
 --lab-carbon:#061117;--lab-steel:#21333c;--lab-line:#84999a;
 --lab-turquoise:#94d6d1;--lab-amber:#f1c67d;--lab-red:#f57869;
}
#app{background:#060b0e}
#sceneShade{background:radial-gradient(ellipse 86% 66% at 50% 45%,transparent 26%,#0306095c 100%),linear-gradient(180deg,#02060870,transparent 18% 74%,#010409c8);box-shadow:none}
#sceneShade::after{inset:8px;outline:1px solid #d0e2df12;outline-offset:-2px}
#app::before{background:repeating-linear-gradient(90deg,transparent 0 34px,#d0edf103 34px 35px,transparent 35px 70px);opacity:.4}
/* two physical telemetry instruments, joined by sparse engraved side markers */
.hud-number{border-radius:1px;min-width:118px;min-height:69px;padding:11px 11px 9px!important;background:linear-gradient(155deg,#101b21f2,#040e13ec)!important;border:1px solid #acc0bf80!important;box-shadow:0 0 0 3px #050d12b5,0 9px 28px #0009,inset 0 0 0 1px #0008!important}
.hud-number:before{height:3px!important;width:40px!important;background:var(--lab-turquoise)!important;box-shadow:0 0 13px #9ceae566}
.hud-number.timer:before{background:var(--lab-red)!important;box-shadow:0 0 13px #eb615866}
.hud-number small{color:#afc1c1!important;font:800 10px/1.32 var(--sans)!important;letter-spacing:.035em!important;margin:0 0 4px!important}
.hud-number strong{font:900 clamp(24px,6.7vw,32px)/1.08 var(--sans)!important;color:#fff9e9!important;letter-spacing:-.05em!important;font-variant-numeric:tabular-nums}
.hud-number.timer strong{color:#ffae9d!important}
.hud-number em{color:#a1babd;font:700 11px var(--sans)}
.distance{left:calc(env(safe-area-inset-left,0px) + 12px)}
.timer{right:calc(env(safe-area-inset-right,0px) + 12px)}
.hud-top-center{top:calc(env(safe-area-inset-top,0px) + 89px)!important;background:#071115e0!important;border:1px solid #d69d7770!important;border-left:3px solid #d6a17c!important;color:#f1d2af!important;font:800 9px/1.2 var(--sans)!important;letter-spacing:.17em;padding:6px 12px!important;min-width:0}
.hud-top-center:before{display:none}
#dangerMessage{top:calc(env(safe-area-inset-top,0px) + 122px)!important;max-width:calc(100% - 24px)!important;padding:4px 13px!important;background:linear-gradient(90deg,transparent,#140d0bcc 16% 84%,transparent)!important;letter-spacing:.07em!important;font-size:clamp(16px,4.7vw,22px)!important;color:#ffb19f;line-height:1.5}
#dangerMessage.critical{color:#ff6b65!important;box-shadow:0 0 25px #4c05050d}
/* bottom-left instrument is a single physical assembly with readout atop it */
.stage-info{bottom:calc(env(safe-area-inset-bottom,0px) + 308px)!important;left:calc(env(safe-area-inset-left,0px) + 12px)!important;width:125px!important;max-width:125px!important;min-width:0!important;min-height:55px;justify-content:center!important;gap:4px!important;padding:10px 7px 7px!important;background:linear-gradient(180deg,#112632f2,#06131bfa)!important;border:1px solid #9bc5cb!important;border-bottom:0!important;border-left:1px solid #9bc5cb!important;box-shadow:inset 0 1px 0 #d4f3ff36,0 -7px 22px #0008!important}
.stage-info:before{content:'TRIAL / SEQUENCE';position:absolute;top:0;left:0;width:100%;height:8px;background:repeating-linear-gradient(110deg,#b1c7c536 0 5px,transparent 5px 10px);font-size:0}
#stageText{font:900 12px/1.1 var(--sans)!important;letter-spacing:.015em;color:#f9f8ed}
#inputText{font:800 11px/1.1 var(--sans)!important;color:#a7e1e0!important}
#keypad{left:calc(env(safe-area-inset-left,0px) + 12px)!important;bottom:calc(env(safe-area-inset-bottom,0px) + 21px)!important;width:125px!important;padding:9px 8px 12px!important;border-radius:1px!important;border:1px solid #a7c6c5c4!important;background:linear-gradient(108deg,#142932f5,#080e17f5)!important;box-shadow:0 13px 34px #000d,inset 1px 1px #e8f9ee47,0 0 0 4px #01060885!important}
#keypad:before{content:'01—09  /  MEMORY';top:-17px;height:16px;background:#13252b!important;color:#d3e4e1;font:800 8px/15px var(--sans)!important;letter-spacing:.09em}
#keypad:after{content:'';position:absolute;bottom:4px;left:10px;right:10px;border-bottom:1px solid #9ac1bd50}
#keys{grid-template-columns:repeat(2,48px);grid-template-rows:repeat(5,48px);gap:5px!important}
.key{border-radius:1px!important;box-shadow:inset 0 1px #f5fff981,inset 0 -5px #0009,0 2px 1px #000c!important;background:linear-gradient(145deg,#637983,#2c4553 52%,#172932)!important;border:1px solid #b0c6ca!important;color:#fbf8eb!important;font:900 23px var(--sans)!important;transition:transform .035s linear,background .045s linear,box-shadow .045s linear!important}
.key:after{opacity:.23;top:2px;height:12px}
.key.is-down{transform:translateY(2px)}
.key.is-flash{background:#f1c850!important;color:#2b2521!important;box-shadow:0 0 23px #ffdd84a8,inset 0 0 0 2px #fff8c0!important}
.key.is-right{background:#59d9af!important;color:#08251b!important;box-shadow:0 0 19px #67ffc5b5,inset 0 0 0 2px #d5fff1!important}
.key.is-wrong{background:#ed5a57!important;color:#fff!important;box-shadow:0 0 24px #fc4b3cbb,inset 0 0 0 2px #ffaaa1!important}
#joystick{width:91px;height:91px;border:1px solid #c3d7d5a0!important;background:repeating-radial-gradient(circle at center,transparent 0 29px,#c7e0e527 29px 30px,transparent 31px 38px),radial-gradient(circle,#1028339c,#06121ce8)!important;box-shadow:inset 0 0 12px #0008,0 12px 25px #000a!important}
#joystick:before{content:'+';position:absolute;top:-12px;left:calc(50% - 4px);color:#c5dbd3;font:900 12px var(--sans)}
#joystick span{letter-spacing:.1em!important;font:800 11px var(--sans)!important}
#stickKnob{border:1px solid #d1e9e6!important;background:radial-gradient(circle at 35% 25%,#a0b9c0,#28414d 75%)!important}
#gamePrompt{left:calc(env(safe-area-inset-left,0px) + 149px)!important;right:calc(env(safe-area-inset-right,0px) + 9px)!important;bottom:calc(env(safe-area-inset-bottom,0px) + 132px)!important;min-height:50px;max-height:88px;padding:10px 8px 9px!important;background:linear-gradient(180deg,#07151ee9,#071319e8)!important;border:1px solid #c2d7cd73!important;border-left:3px solid #bdcfc4!important;border-radius:0!important;font:900 clamp(13px,3.7vw,17px)/1.5 var(--serif)!important;color:#fffdf4!important;box-shadow:0 10px 30px #000b}
#soliloquy{left:6%;right:6%;max-width:88%;text-wrap:balance;top:calc(env(safe-area-inset-top,0px) + 170px)!important;border:1px solid #d2d9cc60!important;border-inline:0!important;background:linear-gradient(90deg,transparent,#04080df0 13% 87%,transparent)!important;padding:12px 10px!important;line-height:1.65!important}
.quick-nav button{border-radius:1px!important;min-height:45px!important;min-width:55px;background:#0b1b25ee!important;box-shadow:inset 0 1px #fbfff633,0 6px 16px #0006!important;letter-spacing:.08em}
/* Intro: an observation window with its own fixed and non-scrolling engraved monologue plate */
#dialogue,#outroDialogue{background:linear-gradient(180deg,#02070a38 0%,transparent 46%,#010407bd 100%)}
.dialogue-ambient{top:calc(env(safe-area-inset-top,0px) + 106px)!important;background:#0b171dbb!important;border:1px solid #b7c9bc99!important;color:#f2efdc!important;padding:9px 18px!important;letter-spacing:.06em!important;box-shadow:0 10px 24px #0009}
.dialogue-panel{left:14px!important;right:14px!important;bottom:calc(env(safe-area-inset-bottom,0px) + 21px)!important;height:186px!important;max-height:none!important;padding:24px 21px 16px!important;border-radius:0!important;border:1px solid #d6dbca!important;border-top:4px solid #e6d8b8!important;border-left:1px solid #d6dbca!important;background:linear-gradient(114deg,#0b1720f7,#14232bf7 58%,#090f15f7)!important;box-shadow:0 0 0 5px #0007,0 16px 55px #000e,inset 0 1px #fff4d617!important}
.dialogue-panel:before{content:'PERSONAL RECORD / TRANSCRIPT';position:absolute;top:7px;left:20px;right:auto;width:auto;border:0!important;color:#c4d7d0b0;font:800 8px/1.25 var(--sans);letter-spacing:.15em}
.dialogue-panel:after{top:auto;bottom:43px;left:20px;right:20px;border-color:#cedcc451}
.dialogue-text{font:900 clamp(20px,5.4vw,27px)/1.55 var(--serif)!important;color:#fffaf0!important;letter-spacing:.006em!important;padding-top:5px}
.dialogue-footer{color:#a9b8b6!important;font:700 10px/1.2 var(--sans)!important;letter-spacing:.015em!important;border:0!important;padding-top:0!important}
.dialogue-footer span:last-child{color:#e9d6b6!important}
#countdown{background:radial-gradient(ellipse at 50% 50%,#141c1fe0,#020407eb)!important}
#countdown .warning-line{border:1px solid #e9b798!important;border-top:5px solid #e77c6b!important;border-left:1px solid #e9b798!important;background:#142029f4!important;box-shadow:0 0 0 5px #02090dcf,0 20px 60px #000e}
#countdown small{color:#eac19c!important}
/* END plates are diegetic incident records, differently lit, image dominating */
.result-screen{--endAccent:#ef8070!important;background:linear-gradient(160deg,#280e14 0%,#0d1218 50%,#050709 100%)!important}
.result-screen.is-success{--endAccent:#9edbd9!important;background:linear-gradient(160deg,#12333c 0%,#0a1e29 51%,#061018 100%)!important}
.result-screen:before{content:'';position:absolute;inset:0;background:repeating-linear-gradient(90deg,transparent 0 34px,#fff2 34px 35px,transparent 35px 69px),linear-gradient(180deg,#e26a5b2c 0 3px,transparent 3px);opacity:.26;pointer-events:none}
.result-content{max-width:470px!important;padding:calc(env(safe-area-inset-top,0px) + 16px) 15px calc(env(safe-area-inset-bottom,0px) + 12px)!important;gap:clamp(5px,1vh,10px)!important;align-items:stretch!important;justify-content:center;position:relative}
.result-content:before{content:'TEST RECORD  /  CLOSED';position:absolute;right:18px;top:calc(env(safe-area-inset-top,0px) + 6px);font:800 8px var(--sans);letter-spacing:.12em;color:#e2e8e9a8}
.end-tag{align-self:center;min-width:100px;border-top:3px solid var(--endAccent)!important;border-bottom:1px solid #f2fff52f;padding:7px 21px!important;background:#050f158f;color:var(--endAccent)!important;letter-spacing:.22em!important}
.result-content h1{font:900 clamp(22px,6.1vw,30px)/1.3 var(--serif)!important;margin:0!important;letter-spacing:.006em!important}
.result-content #resultCopy{font:800 clamp(12px,3.2vw,15px)/1.45 var(--serif)!important;color:#e2e5df!important}
.end-illustration{position:relative;width:min(100%,375px)!important;height:clamp(145px,32dvh,286px)!important;border:1px solid var(--endAccent)!important;outline:5px solid #02080992!important;box-shadow:0 20px 37px #000a!important;margin:4px auto!important}
.end-illustration:before{content:'';position:absolute;z-index:2;inset:7px;width:auto;height:auto;display:block;background:none;border:1px solid #ffffff3a;pointer-events:none}
.end-illustration:after{font:800 9px var(--sans)!important;letter-spacing:.12em!important}
#resultStats{display:block;width:fit-content;margin:0 auto!important;padding:6px 13px;border-top:1px solid var(--endAccent);font:800 12px var(--sans)!important;color:var(--endAccent)!important}
.result-content button{border-radius:1px!important;letter-spacing:.015em;transition:filter .09s,transform .07s!important}
.result-content .primary{background:#f7f2e4!important;box-shadow:0 3px 0 #aeb5ac!important;color:#081018!important}
.result-content .share{background:#94cfd4!important;box-shadow:0 3px 0 #326970!important;color:#081b20!important}
.result-content .quiet{background:#07161ce8!important;color:#ecf4ee!important;border:1px solid #97b3b6a9!important;min-height:40px}
.result-links{gap:8px}
.result-links button{min-height:43px!important;background:#0a171ee8!important;border:1px solid #91aeb39a!important}
/* record archive: specimen slots, dark missing records, unmistakable unlocked thumbnails */
#records{background:linear-gradient(150deg,#203139 0%,#0e1d25 44%,#071015 100%)!important}
#settings{background:linear-gradient(150deg,#152d33 0%,#0e1b22 40%,#080f14 100%)!important}
.panel-screen:before{left:12px;right:12px;border-inline:1px solid #d7ece91f}
.panel-head{border-bottom:2px solid #b2cccb78!important;margin-bottom:22px!important}
.panel-head h2{font:900 clamp(26px,6.5vw,34px) var(--serif)!important}
.panel-head button{background:#192d33!important;border-radius:1px!important;min-height:45px!important}
#records .record-stats p{background:#0d222abf!important;border:1px solid #a6bec279!important;border-top:3px solid #a9c8c8!important;min-height:76px}
.record-stats strong{color:#fff8ec!important}
#records .record-cards{gap:11px!important}
#records .record-card{position:relative;background:#0b1b22!important;border:1px solid #a1b7b899!important;border-radius:0!important;box-shadow:0 9px 20px #0006!important}
#records .record-card:before{content:'RECORD / ' attr(data-index);position:absolute;top:0;right:0;padding:4px 6px;background:#0c161dc7;color:#dbe9dcb9;font:800 8px var(--sans);letter-spacing:.1em;z-index:1;pointer-events:none}
#records .record-card .thumb{max-height:27dvh!important;aspect-ratio:4/5!important;object-fit:cover!important;filter:contrast(1.04)}
#records .record-card .unknown{max-height:27dvh!important;aspect-ratio:4/5!important;background:repeating-linear-gradient(-35deg,#25333a 0 9px,#18252d 9px 12px)!important;color:#afc8c5!important;letter-spacing:.04em!important}
#records .record-card .cardname{border-top:1px solid #c2dedc3f!important;font:900 clamp(11px,3.1vw,14px)/1.45 var(--serif)!important;padding:11px 9px!important;min-height:60px}
#records .record-card:disabled{cursor:default;opacity:.84}
.panel-help{color:#c5d7d5!important;line-height:1.7!important}
/* Settings: physical safety switches, no ambiguous hover affordance */
.settings-list{gap:13px!important}
.settings-list label{min-height:83px!important;background:#132830ef!important;border:1px solid #94b7b9a6!important;border-left:5px solid #7eafb2!important;border-radius:0!important;box-shadow:inset 0 1px #ffffff19,0 12px 23px #0006!important;color:#fff8e8!important;font:900 clamp(17px,4.3vw,22px) var(--serif)!important}
.settings-list label:has(input:checked){border-left-color:#9befe3!important}
.settings-list label:has(input:not(:checked)){border-left-color:#5b6b77!important}
.settings-list input{width:60px!important;height:36px!important;min-width:60px;min-height:36px;border:1px solid #d0e8e28c!important;background:#334955!important}
.settings-list input:checked{background:#267872!important}
.settings-list input:after{width:25px;height:25px;left:4px;top:4px!important;background:#f8f5e6!important}
.settings-list input:checked:after{transform:translateX(24px)!important}
/* full-frame film inspection; zoom buttons remain large enough to tap */
.viewer{background:#02060aed!important;z-index:75!important}
.viewer:before{inset:8px!important;border:1px solid #c1d2cb39!important}
#viewerStage{border:1px solid #a6c4c66e!important;background:radial-gradient(circle,#24343a,#0b151a 75%)!important;box-shadow:0 15px 45px #0008,inset 0 0 0 8px #0206076e!important}
.viewer-close{background:#21343cee!important;border-radius:1px!important;min-height:46px!important}
.viewer-controls button{border-radius:1px!important;min-width:49px!important;min-height:49px!important;background:#192e37!important}
#zoomLabel{color:#e5eee9!important}
/* interim suspension as real control-console lockout */
#resume{background:#031017dc!important}
.resume-box{background:#14262cf4!important;border:1px solid #c6d6c49a!important;border-top:5px solid #f1cc92!important;box-shadow:0 0 0 5px #02080ba3,0 22px 65px #000e!important}
.resume-box h2{font-size:clamp(22px,5.9vw,27px)!important}
.resume-box button{border-radius:1px!important}
/* debug: deliberately distinct service console, stronger information hierarchy */
.debug-screen{background:#06141aea!important}
.debug-screen header{background:#142f38f0!important;border-bottom:3px solid #8ad2c9!important}
.debug-screen header strong{letter-spacing:.08em!important}
.debug-screen header button{border-radius:1px!important}
.debug-scroll{background:repeating-linear-gradient(180deg,transparent 0 55px,#f2ffee06 56px 57px,transparent 58px 110px)}
.debug-scroll h2{border-bottom:2px solid #9fcac87b!important;font:900 21px var(--serif)!important}
.debug-btns button,.debug-lines button,.debug-images button,.debug-audio button{border-radius:1px!important;background:#19323de8!important;border-color:#88b5b5a3!important;color:#f3f6ee!important}
.debug-btns button:active,.debug-lines button:active,.debug-audio button:active{background:#356875!important}
.debug-info{background:#0a2731b8!important;border-left:3px solid #9ec9cb!important}
button:focus-visible,input:focus-visible{outline:2px solid #ffdfa5!important;outline-offset:3px!important}
button:active{filter:brightness(1.12)}
/* 1-screen play, without downsizing fingers' touch targets */
@media(max-height:705px){
 .hud-number{min-height:60px;padding:8px!important;min-width:104px}
 .hud-number strong{font-size:clamp(22px,6vw,26px)!important}
 .hud-top-center{top:calc(env(safe-area-inset-top,0px) + 77px)!important}
 #dangerMessage{top:calc(env(safe-area-inset-top,0px) + 107px)!important}
 .dialogue-panel{height:152px!important;padding:18px 17px 13px!important}
 .dialogue-panel:before{top:5px;left:16px}
 .dialogue-panel:after{bottom:37px}
 .dialogue-text{font-size:clamp(18px,5vw,22px)!important;line-height:1.48!important}
 .stage-info{bottom:calc(env(safe-area-inset-bottom,0px) + 289px)!important}
 #keypad{bottom:calc(env(safe-area-inset-bottom,0px) + 8px)!important}
 #gamePrompt{bottom:calc(env(safe-area-inset-bottom,0px) + 120px)!important;left:calc(env(safe-area-inset-left,0px) + 144px)!important}
 #joystick{bottom:calc(env(safe-area-inset-bottom,0px) + 23px)!important}
 #soliloquy{top:calc(env(safe-area-inset-top,0px) + 145px)!important}
 .end-illustration{height:clamp(106px,22dvh,172px)!important}
 .result-content{gap:4px!important;padding-top:calc(env(safe-area-inset-top,0px) + 9px)!important;padding-bottom:calc(env(safe-area-inset-bottom,0px) + 6px)!important}
 .result-content h1{font-size:clamp(19px,6vw,25px)!important}
 .result-content .primary,.result-content .share{min-height:42px!important;font-size:15px}
}
@media(max-width:340px){
 #keypad,.stage-info{left:5px!important}
 #gamePrompt{left:133px!important;right:5px!important}
 .hud-number{min-width:100px!important}
 .record-card .cardname{font-size:11px!important}
}
@media(max-height:480px) and (min-width:600px){
 .stage-info{top:calc(env(safe-area-inset-top,0px) + 10px)!important;bottom:auto!important;left:calc(env(safe-area-inset-left,0px) + 137px)!important}
 #soliloquy{left:calc(env(safe-area-inset-left,0px) + 141px)!important;right:calc(env(safe-area-inset-right,0px) + 12px)!important;max-width:calc(100% - 156px)!important;top:calc(env(safe-area-inset-top,0px) + 110px)!important}
 .hud-top-center{top:calc(env(safe-area-inset-top,0px) + 80px)!important}
}
@media(prefers-reduced-motion:reduce){.key,.settings-list input,.settings-list input:after,.result-content button{transition:none!important}}
#records .record-card:nth-child(1):before{content:'RECORD / 01'}
#records .record-card:nth-child(2):before{content:'RECORD / 02'}
#records .record-card:nth-child(3):before{content:'RECORD / 03'}

/* Audit: keep the movement label legible in short-height mobile / landscape. */
@media (max-height:705px){#joystick span{top:calc(100% + 2px)!important}}
/* The final action has the same practical touch size as the primary controls. */
.result-content .quiet{min-height:44px!important}
/* Keep the close control available while scrolling very short landscape panels. */
@media (max-height:420px) and (min-width:600px){
 .panel-head{position:sticky;top:-12px;z-index:3;background:#101f27f5;padding-top:9px;padding-bottom:9px;margin-bottom:12px!important}
 .settings-list label{min-height:69px!important;padding:10px 13px!important}
}

/* Targeted audit: in short landscape, keep the viewer's close action above
   the photograph rather than covering the upper-right image corner. */
@media (max-height:420px) and (min-width:600px){
 .viewer{padding-top:calc(env(safe-area-inset-top, 0px) + 68px)!important;padding-bottom:calc(env(safe-area-inset-bottom, 0px) + 10px)!important;justify-content:space-between!important;gap:8px!important}
 #viewerStage{height:auto!important;min-height:0!important;flex:1 1 auto!important}
 .viewer-controls{flex:0 0 auto!important}
}


/* END photograph audit: original stills are 4:5. Keep every pixel visible
   without changing the authored photographs, their taps, or result actions. */
.result-content{
 display:grid!important;
 grid-template-columns:minmax(0,1fr);
 grid-template-rows:auto auto auto auto minmax(0,1fr) auto auto auto auto auto;
 align-content:stretch!important;
 justify-content:stretch!important;
 min-height:0!important;
 height:100%!important;
 row-gap:clamp(3px,.65dvh,7px)!important;
}
.result-content > .end-tag,
.result-content > h1,
.result-content > #resultCopy,
.result-content > #resultLine,
.result-content > #resultStats{
 justify-self:center;
}
.result-content > .end-illustration{
 box-sizing:border-box;
 min-width:0;
 min-height:0!important;
 width:min(100%,375px)!important;
 max-height:100%!important;
 height:100%!important;
 margin:0 auto!important;
 align-self:stretch;
}
.result-content > .end-illustration img{
 object-fit:contain!important;
 object-position:center center!important;
}
.result-content > .result-links{
 min-height:42px;
}
/* A complete image is more important than the decorative image-strip label. */
.result-content > .end-illustration:after{
 font-size:8px!important;
 padding:2px 6px!important;
 background:#031015b8;
}
/* Landscape: a photographed experiment record beside its controls.
   Do not compress the photograph into the few pixels left by a vertical stack. */
@media (max-height:500px) and (min-width:520px){
 .result-content{
  max-width:min(940px,100%)!important;
  padding:calc(env(safe-area-inset-top,0px) + 7px) calc(env(safe-area-inset-right,0px) + 12px)
   calc(env(safe-area-inset-bottom,0px) + 7px) calc(env(safe-area-inset-left,0px) + 12px)!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1.12fr);
  grid-template-rows:auto auto auto auto auto auto auto;
  grid-template-areas:
   'tag title'
   'photo copy'
   'photo line'
   'photo stats'
   'photo replay'
   'photo share'
   'photo save'
   'photo links';
  column-gap:clamp(10px,2.8vw,27px)!important;
  row-gap:3px!important;
  align-items:center;
 }
 .result-content > .end-tag{grid-area:tag;align-self:end;justify-self:center}
 .result-content > h1{grid-area:title;align-self:end;justify-self:center;font-size:clamp(17px,2.8vw,25px)!important}
 .result-content > #resultCopy{grid-area:copy;align-self:start;font-size:clamp(10px,1.8vw,13px)!important}
 .result-content > #resultLine{grid-area:line;align-self:center;font-size:clamp(10px,1.8vw,12px)!important}
 .result-content > .end-illustration{grid-area:photo;width:min(100%,375px)!important;height:100%!important;align-self:stretch;margin:0 auto!important}
 .result-content > #resultStats{grid-area:stats;padding:3px 8px!important;font-size:11px!important}
 .result-content > #replayBtn{grid-area:replay}
 .result-content > #xShareBtn{grid-area:share}
 .result-content > #saveCardBtn{grid-area:save}
 .result-content > .result-links{grid-area:links}
 .result-content .primary,.result-content .share{min-height:40px!important}
 .result-content .quiet{min-height:40px!important}
 .result-links button{min-height:39px!important}
 .result-content:before{top:0!important}
}
/* The picture frame itself follows the still's native 4:5 aspect ratio.
   This avoids both cropped photographs and tall/sideways letterboxing. */
.result-content{
 width:100%!important;
 height:min(100%,880px)!important;
}
.result-content > .end-illustration{
 aspect-ratio:4 / 5!important;
 box-sizing:border-box!important;
 height:100%!important;
 width:auto!important;
 max-height:min(100%,470px)!important;
 max-width:100%!important;
 justify-self:center!important;
 align-self:center!important;
}

/* The two original END-specific monologues were defined but never rendered.
   Show them on the result plate, without adding dialogue pages or altering
   the already-established ending text/order. */
.result-content > #resultLine{
 color:#f5eee4!important;
 font:800 clamp(12px,3.1vw,14px)/1.4 var(--serif)!important;
 letter-spacing:.01em;
 text-shadow:0 2px 6px #000;
 margin:0!important;
}
@media (max-height:500px) and (min-width:520px){
 .result-content > #resultLine{letter-spacing:0!important}
}


/* Secret assistance service: same industrial instrumentation design as existing UI. */
.rescue-bill{z-index:95;display:flex;align-items:center;justify-content:center;padding:calc(env(safe-area-inset-top,0px) + 14px) 16px calc(env(safe-area-inset-bottom,0px) + 14px);background:rgba(4,8,10,.94)}
.rescue-bill.hidden{display:none}
.billing-paper{box-sizing:border-box;display:flex;flex-direction:column;gap:clamp(8px,2.3vh,18px);width:min(100%,440px);max-height:100%;overflow:auto;background:#dfddd0;color:#18272d;border:5px solid #525c5c;outline:1px solid #c5c2ab;padding:clamp(16px,4vw,30px);box-shadow:0 20px 60px #000e;font-family:var(--sans,sans-serif);text-align:left}
.bill-label{font-size:clamp(10px,2.65vw,13px);letter-spacing:.045em;font-weight:800;border-bottom:2px solid #637473;padding-bottom:10px}
.billing-paper h2{font:900 clamp(17px,4.8vw,25px)/1.45 var(--serif,serif);margin:0;text-align:center;color:#0f2629}
.bill-status{border:1px solid #647878;padding:9px;text-align:center;font-size:12px;font-weight:800;letter-spacing:.05em}
.bill-row{display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid #9ca29e;padding:12px 0;font-size:clamp(12px,3.5vw,15px)}
.bill-row strong{font-variant-numeric:tabular-nums;white-space:nowrap}
.bill-due{border:2px solid #813733;background:#e9d8d0;padding:12px 7px;display:flex;flex-direction:column;gap:8px;text-align:center}
.bill-due small{font-weight:800;color:#68362c}
.bill-due strong{font:bold clamp(22px,6vw,34px)/1.2 var(--sans,sans-serif);letter-spacing:-.04em;color:#942722;font-variant-numeric:tabular-nums}
.billing-paper p{font-size:12px;margin:0;line-height:1.7}
.bill-footer{margin-top:3px;text-align:center;font:800 clamp(13px,3.5vw,16px)/1.5 var(--serif,serif)}
.result-screen.is-rescue{--endAccent:#e0b25c!important;background:linear-gradient(160deg,#2d2214,#111b20 54%,#060d11)!important}
.result-screen.is-rescue .end-tag{border-color:#ddbc70!important;color:#ffe6ae!important}
@media(max-height:600px) and (orientation:landscape){.rescue-bill{padding:8px 16px}.billing-paper{width:min(680px,95vw);padding:10px 17px;gap:5px}.billing-paper h2{font-size:16px}.bill-label{padding-bottom:3px}.bill-status{padding:3px}.bill-row{padding:3px 0}.bill-due{padding:5px;gap:3px}.bill-due strong{font-size:23px}.billing-paper p{font-size:11px}.bill-footer{font-size:12px}}

/* Preserve the incident-record stamp but keep it above the END marker. */
.result-content:before{top:env(safe-area-inset-top, 0px)!important}
/* Keep the final amount together on narrow devices without changing its text. */
.nowrap-amount{white-space:nowrap}
/* Very short phones cannot accommodate the decorative audit stamp beside the END label. */
@media (max-width:430px) and (max-height:710px){.result-content:before{display:none!important}}

/* Secret END03 dialogue: above the invoice, but retain the original window styling. */
#outroDialogue.rescue-dialogue{z-index:100;background:linear-gradient(180deg,rgba(1,5,8,.04) 0%,rgba(1,5,8,.08) 52%,rgba(1,5,8,.75) 100%)}
#outroDialogue.rescue-dialogue .dialogue-panel{box-shadow:0 0 0 5px #0009,0 16px 55px #000e,inset 0 1px #fff4d617!important}

/* Horror pass 37: visual-only cues. No additional images, UI, or hit targets. */
#sceneShade,#sceneShade::before,#sceneShade::after{pointer-events:none}
#sceneShade::before{content:"";position:absolute;inset:0;background:radial-gradient(ellipse at 50% 50%,transparent 31%,rgba(235,38,34,.26) 96%);opacity:0;pointer-events:none;z-index:1}
#app.horror-warning #sceneShade::before{animation:horrorWarning .42s ease-out 1}
#app.horror-wrong #sceneShade::before{animation:horrorWrong .12s linear 1}
#app.horror-edgebeat #sceneShade::before{animation:horrorEdge .18s ease-out 1}
#app.horror-blackout #world{animation:horrorDim .13s ease-out 1}
#app.horror-lockshake #world{animation:horrorShake .20s ease-out 1}
#app.horror-startbeat #world{animation:horrorShake .27s ease-out 1}
#app.horror-noise #deathCurtain::after{content:"";position:absolute;inset:42% 0 auto;height:3px;box-shadow:0 0 6px #fff;background:repeating-linear-gradient(90deg,#efefef 0 14px,#666 14px 17px,#fff 17px 22px);animation:horrorNoise .11s steps(2,end) 1;pointer-events:none}
.key.horror-afterglow::before,.key.horror-reflect::before{content:"";position:absolute;inset:-3px;pointer-events:none;border:1px solid transparent;z-index:2}
.key.horror-afterglow::before{animation:horrorAfterGlow .72s ease-out 1}
.key.horror-reflect::before{animation:horrorReflect .17s ease-out 1}
#gamePrompt.horror-ready{animation:horrorReady .24s ease-out 1}
#progressLeds.horror-sweep i{animation:horrorLed .23s ease-out 1;}
#progressLeds.horror-sweep i:nth-child(2){animation-delay:.07s}
#progressLeds.horror-sweep i:nth-child(3){animation-delay:.14s}
#progressLeds.horror-sweep i:nth-child(4){animation-delay:.21s}
#progressLeds.horror-sweep i:nth-child(5){animation-delay:.28s}
#progressLeds.horror-sweep i:nth-child(6){animation-delay:.35s}
#progressLeds.horror-sweep i:nth-child(7){animation-delay:.42s}
#timeText.horror-lastfive{animation:horrorTimer .18s ease-out 1}
#app.horror-bill-hit .bill-due strong{animation:horrorInvoice .23s steps(2,end) 1}
@keyframes horrorWarning{0%{opacity:0}40%{opacity:.86}100%{opacity:0}}
@keyframes horrorWrong{0%{opacity:0}45%{opacity:1}100%{opacity:0}}
@keyframes horrorEdge{0%{opacity:0}45%{opacity:.53}100%{opacity:0}}
@keyframes horrorDim{0%{filter:brightness(1)}50%{filter:brightness(.72)}100%{filter:brightness(1)}}
@keyframes horrorShake{0%,100%{transform:translate(0,0)}20%{transform:translate(-1px,1px)}52%{transform:translate(2px,-1px)}75%{transform:translate(-1px,0)}}
@keyframes horrorNoise{0%{opacity:0}45%{opacity:.93}100%{opacity:0}}
@keyframes horrorAfterGlow{0%{box-shadow:inset 0 0 2px #fff8d0,0 0 10px #ffeb8b;opacity:1;border-color:#ffea95}100%{box-shadow:none;opacity:0}}
@keyframes horrorReflect{0%{border-color:#f0ffeb;box-shadow:0 0 11px #e9fff1}100%{border-color:transparent;box-shadow:none}}
@keyframes horrorReady{0%{box-shadow:0 0 0 #cdfdff}40%{box-shadow:0 0 15px #b4ffef}100%{box-shadow:0 0 0 #cdfdff}}
@keyframes horrorLed{0%,100%{filter:brightness(1)}50%{filter:brightness(2.4)}}
@keyframes horrorTimer{0%,100%{filter:brightness(1)}42%{filter:brightness(2.1);text-shadow:0 0 11px #ff4b40}}
@keyframes horrorInvoice{0%{opacity:1}32%{opacity:.2}55%{opacity:1}74%{opacity:.34}100%{opacity:1}}
@media(prefers-reduced-motion:reduce){#app.horror-warning #sceneShade::before,#app.horror-wrong #sceneShade::before,#app.horror-edgebeat #sceneShade::before,#app.horror-blackout #world,#app.horror-lockshake #world,#app.horror-startbeat #world,#app.horror-noise #deathCurtain::after,.key.horror-afterglow::before,.key.horror-reflect::before,#gamePrompt.horror-ready,#progressLeds.horror-sweep i,#timeText.horror-lastfive,#app.horror-bill-hit .bill-due strong{animation:none!important}}

/* Audit fix: desktop portrait-style game window needs room for three-line END
   monologues; leave mobile and short landscape dialogue geometry unchanged. */
@media (min-width:700px) and (min-height:706px){
 #dialogue .dialogue-panel,#outroDialogue .dialogue-panel{height:214px!important}
}

/* Short-screen audit: at 480px the narrow 4:5 END photo cannot hold the
   full English overlay in one line. Omit decoration only on tiny portrait screens. */
@media (max-width:430px) and (max-height:520px) and (orientation:portrait){
 .result-content > .end-illustration:after{display:none!important}
}


/* Cinematic horror pass: visual cues use the current world, audio and HUD.
   No images/assets, hit targets, rules or new game modes are introduced. */
#app.cinema-intro-enter #world{animation:cinemaRoomWake 1.2s ease-out 1}
#app.cinema-intro-lock #world{animation:cinemaLockShock .38s ease-out 1}
#app.cinema-intro-ceiling #world{animation:cinemaCeilingDread .76s ease-out 1}
#app.cinema-quiet #sceneShade::before{animation:cinemaQuiet .95s ease-out 1}
#warningLine.cinema-warning-line{animation:cinemaWarningLine .43s ease-out 1}
#app.cinema-time-callout #warningLine::after{content:'60';position:absolute;inset:auto 18px -3px auto;font:900 clamp(47px,14vw,80px)/1 var(--sans,sans-serif);color:#ffc1a7;opacity:0;letter-spacing:-.06em;pointer-events:none;text-shadow:0 4px 26px #ff4c24;animation:cinemaSixty .78s ease-out 1}
#app.cinema-warning-impact #world{animation:cinemaLockShock .37s ease-out 1}
#app.cinema-ignition #world{animation:cinemaIgnition .67s ease-out 1}
#app.cinema-ignition #sceneShade::before{animation:cinemaRedBurst .67s ease-out 1}
/* All keypad animation layers must remain pointer transparent. */
.key.cinema-final-glow::after{content:'';position:absolute;inset:-5px;border:1px solid #ffe9a0;box-shadow:0 0 15px #ffda83;opacity:0;pointer-events:none;animation:cinemaFinalGlow .36s ease-out 1}
#relayBar.cinema-relay-sweep{animation:cinemaRelay .28s ease-out 1}
#relayBar.cinema-rearm{animation:cinemaRearm .24s ease-out 1}
#keypad.cinema-pad-cut #keys{animation:cinemaPadCut .12s ease-out 1}
#app.cinema-unlockburst #sceneShade::before{animation:cinemaUnlock .37s ease-out 1;background:radial-gradient(ellipse at 50% 66%,transparent 17%,rgba(110,255,217,.34) 90%)}
#app.cinema-finale #sceneShade::before{animation:cinemaUnlock .59s ease-out 1;background:radial-gradient(ellipse at 50% 58%,transparent 15%,rgba(197,255,247,.47) 95%)}
#progressLeds.cinema-finale-sweep i{animation:cinemaFinalLed .4s ease-out 1}
#progressLeds.cinema-finale-sweep i:nth-child(2){animation-delay:.04s}
#progressLeds.cinema-finale-sweep i:nth-child(3){animation-delay:.08s}
#progressLeds.cinema-finale-sweep i:nth-child(4){animation-delay:.12s}
#progressLeds.cinema-finale-sweep i:nth-child(5){animation-delay:.16s}
/* Phase color affects background only: keypad and countdown remain bright. */
#app.cinema-midnight:not(.cinema-heartbeat) #sceneShade{box-shadow:inset 0 0 48px #02060755}
#app.cinema-heartbeat #sceneShade{box-shadow:inset 0 0 85px #0400038c}
#app.cinema-final-three #world{animation:cinemaLastRoom .64s ease-in-out 5}
#app.cinema-death-hit #world{animation:cinemaDeathSlab .36s ease-out 1}
#app.cinema-success-glow #world{animation:cinemaSuccess .8s ease-out 1}
#app.cinema-next-room #world{animation:cinemaColdReveal 1.3s ease-out 1}
#app.cinema-rescue-relief #world{animation:cinemaRescueRelief 1.2s ease-out 1}
#app.cinema-invoice-shock .billing-paper{animation:cinemaInvoiceShock .62s ease-out 1}
#app.cinema-invoice-shock #sceneShade::before{animation:cinemaRedBurst .62s ease-out 1}
#app.cinema-end-cold .result-screen{background-blend-mode:normal}
@keyframes cinemaRoomWake{0%{filter:brightness(.02) contrast(1.3)}35%{filter:brightness(.10)}65%{filter:brightness(1.22)}78%{filter:brightness(.57)}100%{filter:brightness(1)}}
@keyframes cinemaLockShock{0%,100%{transform:translate(0,0);filter:brightness(1)}15%{transform:translate(-4px,1px);filter:brightness(.6)}32%{transform:translate(4px,-3px);filter:brightness(1.3)}55%{transform:translate(-3px,2px)}75%{transform:translate(2px,-1px)}}
@keyframes cinemaCeilingDread{0%{filter:brightness(1)}43%{filter:brightness(.56) contrast(1.2)}58%{filter:brightness(.75)}100%{filter:brightness(1)}}
@keyframes cinemaQuiet{0%{opacity:0}28%{opacity:.48}100%{opacity:0}}
@keyframes cinemaWarningLine{0%{opacity:.18;transform:translateY(8px)}60%{opacity:1;transform:translateY(-2px)}100%{opacity:1;transform:translateY(0)}}
@keyframes cinemaSixty{0%{opacity:0;transform:scale(2.5)}25%{opacity:.8;transform:scale(1.24)}65%{opacity:.45;transform:scale(.94)}100%{opacity:0;transform:scale(.84)}}
@keyframes cinemaIgnition{0%{filter:brightness(1)}24%{filter:brightness(1.8)}45%{filter:brightness(.4)}67%{filter:brightness(1.3)}100%{filter:brightness(1)}}
@keyframes cinemaRedBurst{0%,100%{opacity:0}28%{opacity:1}56%{opacity:.15}}
@keyframes cinemaFinalGlow{0%{opacity:0;transform:scale(.97)}35%{opacity:1}100%{opacity:0;transform:scale(1.05)}}
@keyframes cinemaRelay{0%,100%{filter:brightness(1)}46%{filter:brightness(3);box-shadow:0 0 16px #5dffd4}}
@keyframes cinemaRearm{0%{filter:brightness(.3)}60%{filter:brightness(2.2)}100%{filter:brightness(1)}}
@keyframes cinemaPadCut{0%,100%{filter:brightness(1)}39%{filter:brightness(.26)}71%{filter:brightness(1.45)}}
@keyframes cinemaUnlock{0%,100%{opacity:0}38%{opacity:1}65%{opacity:.2}}
@keyframes cinemaFinalLed{0%,100%{filter:brightness(1)}53%{filter:brightness(4)}}
@keyframes cinemaLastRoom{0%,100%{transform:translate(0,0)}38%{transform:translate(1px,-1px)}62%{transform:translate(-2px,1px)}}
@keyframes cinemaDeathSlab{0%{transform:scale(1);filter:brightness(1)}32%{transform:scale(1.024);filter:brightness(1.3)}60%{filter:brightness(.14)}100%{transform:scale(1);filter:brightness(1)}}
@keyframes cinemaSuccess{0%{filter:brightness(1)}24%{filter:brightness(1.58) saturate(.82)}100%{filter:brightness(1)}}
@keyframes cinemaColdReveal{0%{filter:brightness(1.34) sepia(.06)}32%{filter:brightness(.54) saturate(.43)}100%{filter:brightness(1)}}
@keyframes cinemaRescueRelief{0%{filter:brightness(.65)}35%{filter:brightness(1.55) saturate(.65)}100%{filter:brightness(1)}}
@keyframes cinemaInvoiceShock{0%,100%{transform:translate(0,0);filter:brightness(1)}30%{transform:translate(0,2px);filter:brightness(.68)}48%{transform:translate(0,-2px);filter:brightness(1.24)}}
@media (prefers-reduced-motion:reduce){
 #app.cinema-intro-enter #world,#app.cinema-intro-lock #world,#app.cinema-intro-ceiling #world,#app.cinema-warning-impact #world,#app.cinema-ignition #world,#app.cinema-final-three #world,#app.cinema-death-hit #world,#app.cinema-success-glow #world,#app.cinema-next-room #world,#app.cinema-rescue-relief #world,#app.cinema-invoice-shock .billing-paper,#app.cinema-time-callout #warningLine::after,#app.cinema-quiet #sceneShade::before,#app.cinema-ignition #sceneShade::before,#app.cinema-invoice-shock #sceneShade::before,#warningLine.cinema-warning-line,.key.cinema-final-glow::after,#relayBar.cinema-relay-sweep,#relayBar.cinema-rearm,#keypad.cinema-pad-cut #keys,#app.cinema-unlockburst #sceneShade::before,#app.cinema-finale #sceneShade::before,#progressLeds.cinema-finale-sweep i{animation:none!important}
}


/* Visual micro-polish pass 43. Preserves existing game rules, image/audio
   files, hitboxes and the original END narratives. */
/* 01,02,03,04,16,17: Japanese line-breaking, stable first line and readable
   long vs short dialogue; text stays unchanged. */
#dialogueText,#outroText,#soliloquy,#resultName,#resultCopy,#resultLine,
#gamePrompt,.record-card .cardname,.billing-paper{
 line-break:strict;overflow-wrap:break-word;text-wrap:pretty;
}
#dialogue .dialogue-panel,#outroDialogue .dialogue-panel{justify-content:space-between!important;}
#dialogueText,#outroText{
 display:block;align-self:stretch;flex:0 1 auto;min-height:0;
 overflow:hidden!important;word-break:normal!important;
}
#dialogueText.is-long,#outroText.is-long{font-size:clamp(18px,4.9vw,23px)!important;line-height:1.42!important;}
#dialogueText.is-short,#outroText.is-short{line-height:1.52!important;}
/* 05: compact page indicator, with the tap affordance retained. */
.dialogue-footer{align-items:center;flex-shrink:0;min-height:19px;gap:12px!important;}
#dialogueCount,#outroCount{white-space:nowrap;font-variant-numeric:tabular-nums;letter-spacing:.08em;}
.dialogue-footer span:last-child{white-space:nowrap;}
/* 06,07: reserve the 60-second callout a separate corner in the warning panel. */
#countdown .warning-line{position:relative;box-sizing:border-box;min-width:min(92%,330px);max-width:calc(100% - 30px);padding:20px 24px 33px!important;text-wrap:balance;line-break:strict;}
#app.cinema-time-callout #warningLine::after{right:13px!important;bottom:2px!important;font-size:clamp(36px,10vw,56px)!important;transform-origin:center;}
/* 08,09: stable stopwatch column; baseline for unit of ceiling distance. */
#timeText{display:inline-block;min-width:5ch;text-align:center;font-variant-numeric:tabular-nums;font-feature-settings:'tnum' 1;white-space:nowrap;}
#heightText{font-variant-numeric:tabular-nums;font-feature-settings:'tnum' 1;white-space:nowrap;}
#heightText em{position:relative;vertical-align:baseline;bottom:.08em;margin-left:2px;letter-spacing:0;}
/* 10,11: stage metadata visually quieter than the active sequence readout;
   align the top sensor label to the same hardware housing below it. */
.stage-info{box-sizing:border-box!important;gap:5px!important;text-align:center;}
#stageText{font-size:12px!important;letter-spacing:.02em!important;}
#inputText{font-size:10px!important;opacity:.95;}
#keypad:before{height:16px!important;line-height:16px!important;text-align:center;}
/* 12,13: digit baseline and the single last key align on a grid cell. */
#keys .key{display:grid!important;place-items:center!important;text-align:center;line-height:1!important;font-variant-numeric:tabular-nums;font-feature-settings:'tnum' 1;}
#keys .key:last-child{justify-self:center;align-self:center;}
/* 14: intentional line break for the important instruction, no clipping. */
#gamePrompt{display:flex!important;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:0!important;}
#gamePrompt .prompt-line{display:block;white-space:nowrap;max-width:100%;line-height:1.4;}
@media(max-width:350px){#gamePrompt .prompt-line{font-size:clamp(11px,3.3vw,14px)!important;}}
/* 15: movement caption stays visually attached to its control and clear of the home area. */
#joystick span{top:calc(100% + 4px)!important;white-space:nowrap;}
/* 18,19,20: live invoice / debt overlay typography, NOT the pre-rendered
   photo inside the archived END card. */
.billing-paper{gap:clamp(8px,1.65vh,13px)!important;}
.bill-label{margin-bottom:2px;}
.bill-status{margin:1px 0 3px;}
.bill-row{display:grid!important;grid-template-columns:minmax(0,1fr) max-content;align-items:baseline!important;gap:8px!important;padding:9px 0!important;}
.bill-row span{text-align:left;}
.bill-row strong{text-align:right;font-variant-numeric:tabular-nums;letter-spacing:-.025em;white-space:nowrap;}
.bill-due{margin-top:5px;margin-bottom:4px;gap:6px!important;padding:13px 8px!important;}
.bill-due strong{white-space:nowrap;font-size:clamp(20px,5.7vw,34px)!important;}
/* 21,22,23: stable END headings and complete, consistently sized stills. */
.result-content > #resultName{line-break:strict;overflow-wrap:break-word;text-wrap:balance;max-width:100%;margin-inline:auto!important;}
.result-content > #resultCopy{line-break:strict;text-wrap:balance;margin-bottom:2px!important;}
.result-content > #resultLine{line-break:strict;text-wrap:pretty;}
.result-content > .end-illustration{flex-shrink:1;object-position:center center;}
.result-content > .end-illustration img{object-fit:contain!important;object-position:center center!important;}
/* 24,25: consistent action and two-up navigation targets. */
.result-content > #replayBtn{min-height:48px!important;}
.result-content > #xShareBtn{min-height:46px!important;}
.result-content > #saveCardBtn{min-height:44px!important;}
.result-content > .result-links{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px!important;align-items:stretch;}
.result-content > .result-links button{width:100%;min-width:0;min-height:44px!important;box-sizing:border-box;}
/* 26,27: consistent archival marker and title area. */
#records .record-card:before{padding:5px 7px;right:0!important;top:0!important;letter-spacing:.08em;}
#records .record-card .cardname{min-height:66px!important;display:flex!important;align-items:flex-start;line-break:strict;text-wrap:pretty;}
/* 28: measures align on their right edge, irrespective of number length. */
#records .record-stats p{text-align:left;}
#records .record-stats strong{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;font-feature-settings:'tnum' 1;}
/* 29: uniform safety toggles with distinct tap targets. */
#settings .settings-list label{box-sizing:border-box;gap:15px!important;padding-inline:16px!important;}
#settings .settings-list input{flex:0 0 60px;margin:0!important;}
/* 30: descriptive zoom reset, same functional action. */
.viewer-controls{max-width:100%;gap:clamp(6px,2.1vw,13px)!important;white-space:nowrap;}
#zoomReset{min-width:98px!important;font:800 12px var(--sans)!important;padding-inline:9px;}
/* Limit the polish on tiny viewports instead of sacrificing tap targets. */
@media(max-width:340px){
 #gamePrompt{padding-inline:5px!important;}
 #dialogueText.is-long,#outroText.is-long{font-size:17px!important;line-height:1.35!important;}
 .bill-row{font-size:11px!important;}
 .bill-row strong{font-size:11px;}
 .bill-due strong{font-size:clamp(18px,5.3vw,22px)!important;}
 .viewer-controls{gap:5px!important;}
 #zoomReset{min-width:91px!important;font-size:11px!important;padding-inline:5px;}
}
@media(max-height:600px) and (orientation:landscape){
 #countdown .warning-line{padding-bottom:24px!important;}
 .bill-row{padding:3px 0!important;}
 .bill-due{padding:5px!important;margin-block:2px;}
 .result-content > #replayBtn,.result-content > #xShareBtn,.result-content > #saveCardBtn{min-height:39px!important;}
 .result-content > .result-links button{min-height:39px!important;}
}

/* 11: put the stage plate clear of the keypad's engraved header; handle very
   short 568px landscape separately, keeping the upper readout on-screen. */
@media (min-height:706px){.stage-info{bottom:calc(env(safe-area-inset-bottom,0px) + 330px)!important;}}
@media (max-height:705px){.stage-info{bottom:calc(env(safe-area-inset-bottom,0px) + 312px)!important;}}
@media (max-height:480px) and (min-width:520px){
 .stage-info{top:calc(env(safe-area-inset-top,0px) + 9px)!important;bottom:auto!important;left:calc(env(safe-area-inset-left,0px) + 137px)!important;}
}

/* Requested micro-fix: remove only the grey L-shaped decoration from dialogue. */
#dialogue .dialogue-panel::after,#outroDialogue .dialogue-panel::after{content:none!important;display:none!important}
/* Immediate keypad feedback: keep correct/wrong lighting, remove push-down motion. */
#keypad .key,#keypad .key.is-down{transition:none!important;transform:none!important;will-change:auto!important}

/* Audit: keep the extended monologues visible in short landscape viewports.
   Only the eight clipped 3-line transcript layouts need a tighter line box. */
@media (orientation:landscape) and (min-width:700px) and (max-height:420px){
 #dialogueText.is-long,#outroText.is-long{font-size:21px!important;line-height:1.34!important}
}
