/* Loaded last. Dialogue always fits the visible window; weapon chip (the owner's editor brief, parts 7–9). */

/* Dialogue: pinned to the bottom of the visible window at every size. Long text scrolls inside the box;
   the Next and choice buttons stay in view, so the page itself never has to scroll. */
.dialogue-window,.cinematic-space .dialogue-window,.dialogue-window.choice-menu{
  position:fixed!important;left:max(10px,3vw)!important;right:max(10px,3vw)!important;top:auto!important;
  bottom:calc(64px + env(safe-area-inset-bottom,0px))!important;margin:0!important; /* clears the footer bar (MENU) */
  max-height:min(72vh,calc(100vh - 84px));max-height:min(72dvh,calc(100dvh - 84px));
  display:flex!important;align-items:stretch;z-index:6;overflow:hidden}
.dialogue-window .speech-body{display:flex;flex-direction:column;min-height:0;overflow:auto;overscroll-behavior:contain}
.dialogue-window #spoken-text{flex:0 0 auto}
.dialogue-window .speech-controls{position:sticky;bottom:0;flex:none;padding-top:10px;background:linear-gradient(#06101d00,#06101d 30%)}
.dialogue-window .portrait{flex:none}
@media (max-width:800px){
  .dialogue-window .portrait{width:72px!important;float:none!important;margin:12px 0 0 12px!important;align-self:flex-start}
  .dialogue-window .speaker{min-height:0!important;padding-top:0!important}}
@media (max-height:560px){.dialogue-window .portrait{display:none}.dialogue-window #spoken-text{font-size:15px;min-height:0}}
.dialogue-window .speech-controls button:focus-visible{outline:2px solid #f2b33d;outline-offset:2px}

/* Weapon chip: what you hold, and what the wheel cycles through. */
#weapon-select-hud{position:fixed;right:max(16px,env(safe-area-inset-right,0px));bottom:120px;z-index:3;pointer-events:none;
  display:flex;gap:6px;align-items:center;font:600 11px monospace;letter-spacing:.1em}
#weapon-select-hud[hidden]{display:none}
#weapon-select-hud span{padding:5px 8px;border:1px solid #ffffff22;background:#06101daa;color:#7f949b}
#weapon-select-hud span.on{color:#06101d;background:#f2b33d;border-color:#f2b33d}
#weapon-select-hud i{font-style:normal;font-weight:400;color:#7f949b;padding-left:2px}
#weapon-select-hud.fresh span.on{box-shadow:0 0 0 2px #f2b33d55}
/* While a conversation is open, the screen behind it is exactly one window tall, so nothing below needs scrolling. */
#screen:has(.dialogue-window){height:100vh;height:100dvh;min-height:0!important;overflow:hidden}
#screen.conversation-live:has(.dialogue-window){position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;min-height:0!important;overflow:visible;pointer-events:none}
#screen.conversation-live .cinematic-space{pointer-events:none}
#screen.conversation-live .dialogue-window{position:fixed!important;left:auto!important;right:1rem!important;top:auto!important;bottom:5.5rem!important;width:min(30rem,calc(100vw - 2rem))!important;max-height:min(65dvh,38rem)!important;display:flex!important;flex-direction:column!important;pointer-events:auto}
#screen.conversation-live .conversation-minimize{position:relative;z-index:8;flex:none}
#screen.conversation-live .speech-body{flex:none;max-height:35dvh}

/* Guidance card: the next step for the chosen topic (world-markers.js). */
#guidance-card{position:fixed;left:max(16px,env(safe-area-inset-left,0px));top:120px;z-index:4;max-width:min(360px,calc(100vw - 32px));padding:10px 12px;border:1px solid #7ff0ff66;border-left:3px solid #7ff0ff;background:#06101de0;color:#dfeef0;font:13px/1.45 system-ui,sans-serif}
#guidance-card b{display:block;font:700 11px Consolas,monospace;letter-spacing:.12em;color:#7ff0ff;margin-bottom:4px}
#guidance-card p{margin:0 0 8px}
#guidance-card button{font-size:10px;padding:5px 8px}
#guidance-card.done{border-left-color:#6cff9e}
.guide-topics{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px;margin:12px 0}
/* Rook's cargo board: one line per job (what, where, hold space, legality, pay and who pays). */
/* Rook's cargo board: the sticky buttons would cover the job list in the chat panel, so they follow the list instead (the panel scrolls). */.dialogue-window .speech-body:has(>.rook-board) .speech-controls{position:static;background:none}.rook-board{list-style:none;margin:8px 0 10px;padding:0;display:grid;gap:6px;font-size:13px;line-height:1.45}.rook-board li{padding:7px 10px;border-left:3px solid #38e8ff;background:rgba(56,232,255,.06)}.rook-board b{color:#f2b33d}.rook-board em{color:#ff8a7a;font-style:normal}
/* A conversation that ends in a list of choices (talk-choice.js opts.menu; Zen Zephyr's five teachings, 18 Nov 2026): one choice a row, left aligned. */
.dialogue-window .speech-controls.talk-menu{display:flex;flex-direction:column;align-items:stretch;gap:5px}.speech-controls.talk-menu #speech-status{align-self:flex-end}.speech-controls.talk-menu [data-action=speech-replay]{align-self:flex-end}.speech-controls.talk-menu .talk-menu-choice{text-align:left;justify-content:flex-start;white-space:normal;line-height:1.35}.speech-controls.talk-menu .talk-menu-choice.quiet{align-self:flex-start;min-width:6rem;text-align:center}
#screen.conversation-live .dialogue-window:has(.talk-menu){max-height:min(84dvh,46rem)!important;width:min(36rem,calc(100vw - 2rem))!important}#screen.conversation-live .dialogue-window:has(.talk-menu) .conversation-thread{max-height:4.6rem}#screen.conversation-live .speech-body:has(.talk-menu){position:relative}#screen.conversation-live .speech-body:has(.talk-menu) #spoken-text{padding-right:5.6rem}.conversation-live .speech-controls.talk-menu [data-action=speech-replay]{position:absolute;top:.45rem;right:1rem}.speech-controls.talk-menu #speech-status{display:none}#screen.conversation-live .speech-body:has(.talk-menu){max-height:none;flex:1 1 auto;min-height:0;overflow:auto}.dialogue-window .speech-controls.talk-menu{position:static;background:none;flex-wrap:nowrap}.conversation-live .speech-controls.talk-menu .talk-menu-choice{min-height:0;padding:.35rem .7rem;font-size:.72rem}
/* Zen Zephyr's teaching menu is see-through, the hall shows behind it (the owner, 18 Nov 2026: "opaque" meaning translucent). */
#screen.conversation-live .dialogue-window:has(.talk-menu){background:rgba(6,16,29,.42)!important;backdrop-filter:blur(2px)!important;-webkit-backdrop-filter:blur(2px)!important}#screen.conversation-live .dialogue-window:has(.talk-menu) .speech-body,#screen.conversation-live .dialogue-window:has(.talk-menu) .conversation-thread,#screen.conversation-live .dialogue-window:has(.talk-menu) .conversation-thread>*{background-color:rgba(10,24,36,.30)!important}#screen.conversation-live .speech-controls.talk-menu .talk-menu-choice:not(.quiet){background:rgba(92,255,226,.62)!important}#screen.conversation-live .speech-controls.talk-menu .talk-menu-choice:not(.quiet):hover,#screen.conversation-live .speech-controls.talk-menu .talk-menu-choice:not(.quiet):focus-visible{background:rgba(160,255,238,.85)!important}
/* Mission offer card (talk-choice.js opts.offer, 19 Nov 2026): name, short description, cost or reward; a greyed ACCEPT while the player cannot pay */
.dialogue-window .talk-offer{display:flex;flex-direction:column;gap:.2rem;margin:.45rem 0 .35rem;padding:.45rem .7rem;border-left:3px solid rgba(92,255,226,.7);background:rgba(6,16,29,.55);font-size:.78rem;line-height:1.35}.dialogue-window .talk-offer b{letter-spacing:.06em;text-transform:uppercase}.dialogue-window .talk-offer span{opacity:.85}.dialogue-window .talk-offer .talk-offer-money{color:#5cffe2;opacity:1}.dialogue-window .talk-offer .talk-offer-money.cost{color:#ffcf5c}.dialogue-window .talk-offer .talk-offer-need{color:#ff7a7a;opacity:1;font-weight:700}.dialogue-window .speech-controls button[disabled]{opacity:.45;cursor:not-allowed;filter:grayscale(1)}
