/* Dialogue pack 01 is scoped to its own layer. Existing HUD/panels are intact. */
.chapter-dialogue{position:absolute;inset:0;z-index:18;color:#f1e8cf;font-family:var(--heading);--dialogue-text-scale:1;isolation:isolate;background:#121715;overflow:hidden}
.chapter-dialogue[hidden]{display:none!important}.chapter-art{position:absolute;inset:0;background:center top/cover no-repeat;z-index:-1}.chapter-art:after{content:'';position:absolute;inset:0;background:linear-gradient(transparent 32%,#070c0c44 58%,#070c0cbd)}
.chapter-dialogue-tools{position:absolute;right:24px;top:18px;display:flex;gap:8px;z-index:3}.chapter-dialogue button{font:calc(22px * var(--dialogue-text-scale))/1.35 var(--heading);color:#eee4c8;border:0;box-shadow:none;border-radius:0;background:transparent;cursor:pointer;text-align:left}.chapter-dialogue button:focus-visible{outline:2px solid #fff0ce;outline-offset:3px}.chapter-dialogue-tools button{display:flex;align-items:center;gap:9px;padding:9px 12px;background:#101312ed;font-size:19px}.chapter-dialogue img{width:30px;height:30px;object-fit:contain;flex-shrink:0;pointer-events:none}
.chapter-dialogue-content{position:absolute;bottom:20px;left:32px;right:32px;max-height:92%;display:flex;flex-direction:column;gap:9px;overflow:auto;scrollbar-width:thin}.chapter-speech{display:flex;gap:20px;align-items:center;padding:18px 26px;background:url('./assets/dialogue/ui/Dialogue_Panel.webp') center/100% 100%;min-height:93px}.chapter-speech>div{flex:1}.chapter-speech p{font:calc(26px * var(--dialogue-text-scale))/1.42 var(--heading);margin:0;color:#f1e8cf}.chapter-speech strong{display:block;color:#c9a469;font-size:calc(23px * var(--dialogue-text-scale));font-weight:400;margin-bottom:5px}.chapter-face,.chapter-speaker-icon{width:82px;height:82px;flex-shrink:0;display:block;background-repeat:no-repeat;position:relative}.chapter-face:after,.chapter-speaker-icon:after{content:'';position:absolute;inset:-4px;background:url('./assets/dialogue/ui/Speaker_Frame_normal.webp') center/100% 100%}.chapter-speaker-icon{display:grid;place-items:center;background:#151d1c}.chapter-speaker-icon img{width:43px;height:43px}.chapter-choice-prompt{color:#b9b09a;font-size:22px}.chapter-choices{display:grid;gap:6px}.chapter-choices button{display:flex;align-items:center;gap:14px;min-height:59px;padding:12px 22px;background:url('./assets/dialogue/ui/Choice_normal.webp') center/100% 100%}.chapter-choices button:hover:not(:disabled){background-image:url('./assets/dialogue/ui/Choice_hover.webp')}.chapter-choices button:active:not(:disabled){background-image:url('./assets/dialogue/ui/Choice_pressed.webp')}.chapter-choices button:disabled{color:#898372;background-image:url('./assets/dialogue/ui/Choice_disabled.webp');cursor:default}.chapter-choices button:disabled img{opacity:.4}.chapter-choices kbd{font:18px var(--heading);color:#b9b09a;min-width:15px}.chapter-choices em{font-style:normal;color:#c9a469;margin-right:14px;font-size:.88em}.chapter-choices small{font-size:.8em;margin-left:18px;color:#b9b09a}.chapter-dialogue .chapter-continue{align-self:flex-end;display:flex;align-items:center;gap:10px;padding:10px 26px;background:#111916eb;color:#d6bd86;border:1px solid #877147}
.chapter-facts{display:flex;gap:9px;overflow-x:auto;padding:5px 3px;flex-shrink:0}.chapter-facts button{display:flex;gap:7px;align-items:center;white-space:nowrap;background:#101312e8;padding:6px 11px;font-size:17px;color:#b8aa8b}.chapter-facts img{width:22px;height:22px}.chapter-facts button[aria-pressed=true]{color:#f0d298;outline:1px solid #a28a50}.chapter-fact-detail{margin:0;background:#101312ed;padding:10px 16px;font:22px/1.4 var(--heading);color:#d4c6a8}.chapter-history{position:absolute;z-index:5;inset:70px 26px 20px;padding:25px 30px;background:#101312f7;border:1px solid #877147;overflow:auto}.chapter-history p{font:calc(24px * var(--dialogue-text-scale))/1.45 var(--heading);color:#ddd0b1}.chapter-history strong{color:#c9a469}.chapter-history-open{visibility:hidden}
.chapter-timer{height:10px;background:#101312;position:relative;margin:4px 80px 20px 0}.chapter-timer-fill{height:100%;display:block;background:url('./assets/dialogue/ui/Timer_Fill_Gold.webp') left center/auto 100%}.chapter-timer-fill[data-state=low]{background-image:url('./assets/dialogue/ui/Timer_Fill_Low.webp')}.chapter-timer-fill[data-state=paused]{background-image:url('./assets/dialogue/ui/Timer_Fill_Paused.webp')}.chapter-timer-value{position:absolute;right:-80px;top:-9px;font:20px var(--heading);color:#e6d8b6;white-space:nowrap}
.chapter-dialogue[data-mode=ambient]{background:transparent;pointer-events:none}.chapter-dialogue[data-mode=ambient] .chapter-art{display:none}.chapter-dialogue[data-mode=ambient] .chapter-dialogue-content{left:auto;width:760px;right:24px;bottom:22px;max-height:70%}.chapter-dialogue[data-mode=ambient] .chapter-speech{padding:15px 22px;background-image:url('./assets/dialogue/ui/Banter_Panel.webp')}.chapter-dialogue[data-mode=ambient] .chapter-speech p{font-size:calc(22px * var(--dialogue-text-scale))}.chapter-dialogue[data-mode=ambient] .chapter-speech p+p{margin-top:12px}.chapter-dialogue[data-mode=ambient] .chapter-speech strong{display:inline;margin-right:14px;color:#8ebcc9}.chapter-dialogue[data-mode=ambient] button,.chapter-dialogue[data-mode=ambient] .chapter-history{pointer-events:auto}.chapter-dialogue[data-mode=ambient] .chapter-dialogue-tools{top:auto;bottom:12px;left:24px;right:auto}.chapter-dialogue[data-mode=beat] .chapter-art{animation:chapter-light 900ms ease-out}.chapter-dialogue[data-mode=beat] .chapter-dialogue-tools{display:none}
.chapter-dialogue[data-choice=true]:not([data-mode=ambient]) .chapter-speech{min-height:60px;padding:8px 22px;gap:16px}.chapter-dialogue[data-choice=true]:not([data-mode=ambient]) .chapter-face,.chapter-dialogue[data-choice=true]:not([data-mode=ambient]) .chapter-speaker-icon{width:44px;height:44px}.chapter-dialogue[data-choice=true]:not([data-mode=ambient]) .chapter-speaker-icon img{width:28px;height:28px}.chapter-dialogue[data-choice=true]:not([data-mode=ambient]) .chapter-speech p,.chapter-dialogue[data-choice=true]:not([data-mode=ambient]) .chapter-speech strong{display:inline;margin:0 16px 0 0}.chapter-dialogue[data-choice=true] .chapter-choices button{min-height:49px;padding:8px 20px}
@keyframes chapter-light{from{filter:brightness(2.2)}to{filter:brightness(1)}}
@media(prefers-reduced-motion:reduce){.chapter-dialogue *{animation:none!important;transition:none!important}}
.admin-dialogue-preview{height:390px;background:center top/cover no-repeat #101312;position:relative}.admin-dialogue-preview>div{position:absolute;bottom:16px;left:16px;right:16px;padding:16px 22px;background:#101312ed;color:#eee1c1;font:23px/1.4 var(--heading)}.admin-dialogue-preview strong{color:#c9a469}.admin-dialogue-preview p{margin:5px 0}

.harbour-inn-stage{container-type:size;position:absolute;inset:0;z-index:7;background:#18120d;overflow:hidden}.harbour-inn-art{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:100%;width:max(100cqw,200cqh);aspect-ratio:2}.harbour-inn-art>img{width:100%;height:100%;display:block}.harbour-inn-art>button{position:absolute;border:0;background:transparent;box-shadow:none;cursor:pointer}.harbour-inn-art>button:hover{background:#fff2ca08}.harbour-inn-art>button:focus-visible{outline:2px solid #d6bc84;outline-offset:-3px}.harbour-inn-keeper{left:77%;top:28%;width:14%;height:28%}.harbour-inn-door{left:6%;top:26%;width:15%;height:37%}.harbour-inn-controls{position:absolute;bottom:18px;right:18px}.harbour-inn-controls .icon-control{width:64px;height:64px}

.chapter-narration p{font-style:italic;color:#d6cbb3}.chapter-speech strong small{font-size:.8em;font-style:italic}.chapter-continue:disabled{cursor:default;opacity:.5}

.dialogue-voice-button{display:inline-flex;align-items:center;justify-content:center;min-width:36px;min-height:34px;padding:6px 10px;flex:none}.dialogue-voice-button[hidden]{display:none}.dialogue-voice-button[data-state="playing"]{color:#e0c792}.dialogue-voice-button[data-state="error"]{color:#c7a39a}.conversation-footer .dialogue-voice-button{margin-right:auto}

.chapter-npc-face .npc-portrait{display:block;position:relative;width:100%;height:100%;overflow:hidden}.chapter-npc-face .npc-portrait img{position:absolute;max-width:none}

/* Cinema image keeps its 7:3 ratio. The lower edge continues behind the HUD;
   the shared frame and controls retain their normal positions and stacking. */
.game-shell .view-frame:has(.chapter-dialogue.has-film){overflow:visible}
.chapter-dialogue.has-film{overflow:visible;background:#101714}
.chapter-dialogue.has-film .chapter-art{display:none}
.chapter-film{position:absolute;inset:0}
.chapter-film-video{display:block;position:absolute;left:0;top:0;width:100%;height:auto;min-height:100%;aspect-ratio:7/3;object-fit:cover;object-position:center top;background:#101714}
.chapter-film-tools button{min-height:44px;border:1px solid #9d845744;background:#141813d9}
.chapter-film-status{position:absolute;inset:0;z-index:2;display:grid;place-items:center;text-align:center;background:#080b0e;color:#ecd4a5;padding:64px 18px;box-sizing:border-box;overflow:auto}
.chapter-film-status[hidden]{display:none!important}
.chapter-film-status-card{width:min(760px,90%);margin:auto;flex:none}
.chapter-film-status strong{display:block;font:28px/1.35 Georgia,serif;margin:14px 0 8px}
.chapter-film-message{display:block;font:20px/1.5 Georgia,serif;margin-top:8px}
.chapter-film-status .rov-spinner{width:clamp(64px,9vw,144px)}
.chapter-film-status .rov-spinner img{width:100%;height:100%}
.chapter-film:not([data-state="loading"]):not([data-state="slow"]) .rov-spinner-ring{animation:none}
.chapter-film-status button[hidden]{display:none!important}
.chapter-film-status button{padding:9px 16px;margin:14px 6px 0;background:#302c22;border:1px solid #95805b}
.chapter-film-timeline{position:absolute;bottom:14px;left:28px;right:28px;display:flex;gap:16px;align-items:center;color:#e6dcc5;font:17px var(--heading);text-shadow:0 1px 4px #000}
.chapter-film-timeline progress{flex:1;min-width:50px;height:3px;accent-color:#c8ad70}.chapter-film-timeline time{font-variant-numeric:tabular-nums}
.world-loading{position:absolute;inset:0;z-index:17;display:grid;place-items:center;background:radial-gradient(ellipse at 50% 35%,#263431,#0d1514 75%);color:#e8dbc1;text-align:center;font-family:var(--heading)}
.world-loading[hidden]{display:none!important}.world-loading-card{width:min(640px,85%);padding:34px 48px;border:1px solid #8f795555;box-shadow:0 20px 80px #0006;background:#101814d9}
.world-loading-rune{display:block;color:#bca272;font-size:65px;line-height:1}.world-loading h2{font-weight:400;font-size:36px;margin:14px 0 20px}.world-loading p{font-size:23px;margin:10px 0 18px}.world-loading progress{width:100%;height:8px;accent-color:#c2a86e}.world-loading small{display:block;font:18px/1.4 var(--heading);color:#aeae9b;margin-top:18px;overflow-wrap:anywhere}.world-loading-actions{display:flex;justify-content:center;gap:15px;margin-top:24px}.world-loading button{font:19px var(--heading);padding:10px 16px;border:1px solid #7e6f50;background:#272a20;color:#ebddbd}.world-loading button:focus-visible{outline:2px solid #efdfac;outline-offset:4px}

@media(max-height:600px){.chapter-film-status{padding:64px 12px 16px}.chapter-film-status .rov-spinner{width:72px}.chapter-film-status strong{font-size:22px;margin:8px 0}.chapter-film-message{font-size:16px}.chapter-film-status button{font-size:17px;margin-top:10px}}
