/* Shared introduction, quiet room views and deliberate keyboard focus. */
.start-overlay .research-welcome {
    width: min(920px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #b6aa91 #f4eedf;
    padding: 30px 36px 24px;
    border: 1px solid #d7cab0;
    border-radius: 23px;
    color: #342f24;
    background: rgba(255, 250, 239, .97);
    box-shadow: 0 18px 54px rgba(24, 22, 15, .25);
    text-align: left;
}
.start-overlay .research-welcome .start-kicker { margin-bottom: 12px; padding: 6px 10px; border-color: #bdc8ad; border-radius: 7px; color: #496344; background: #eaf0df; font-size: 11px; line-height: 1.35; letter-spacing: .06em; text-transform: uppercase; }
.start-overlay .research-welcome .start-title { margin: 0; color: #3a432f; font: 700 clamp(36px, 4.5vw, 49px)/1.08 Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
.start-overlay .research-welcome .start-question { max-width: 800px; margin: 15px 0 13px; color: #514c3b; font-size: 20px; line-height: 1.4; font-weight: 700; }
.welcome-lead { max-width: 800px; margin: 0; color: #6c624f; font-size: 15px; line-height: 1.6; }
.welcome-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 22px 0; padding: 0; list-style: none; }
.welcome-steps li { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 16px 13px; border: 1px solid #ded3bc; border-radius: 12px; background: #faf5e9; }
.welcome-step-number { display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px; border: 1px solid #bdc8ac; border-radius: 50%; color: #476640; background: #e9efdd; font-size: 12px; font-weight: 700; }
.welcome-steps li > div { min-width: 0; }
.welcome-steps h2 { margin: 2px 0 7px; color: #454a34; font-size: 15px; line-height: 1.3; }
.welcome-steps p { margin: 0; color: #6a614e; font-size: 13px; line-height: 1.5; }
.welcome-finale { padding: 18px 21px; border: 1px solid #bcc8a7; border-left: 4px solid #738c5c; border-radius: 12px; background: #edf1e3; }
.welcome-eyebrow { display: block; margin-bottom: 7px; color: #526b42; font-size: 10px; font-weight: 800; line-height: 1.4; letter-spacing: .07em; text-transform: uppercase; }
.welcome-finale > p { margin: 0; color: #546046; font-size: 14px; line-height: 1.55; }
.welcome-chain { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 13px 0; }
.welcome-chain > span { padding: 7px 10px; border: 1px solid #c1cbaa; border-radius: 7px; color: #3f5a36; background: #fbfdf4; font-size: 13px; font-weight: 700; line-height: 1.4; }
.welcome-chain > i { color: #7b8c62; font-size: 20px; font-style: normal; line-height: 1; }
.welcome-finale .welcome-outcome { color: #5f6b53; font-size: 13px; }
.welcome-actions { display: flex; align-items: center; gap: 20px; margin-top: 22px; }
.welcome-order { max-width: 430px; margin: 0; color: #746a55; font-size: 13px; line-height: 1.5; }
.research-welcome .start-status { margin-top: 13px; min-height: 0; color: #827660; font-size: 12px; line-height: 1.45; }
.research-welcome .primary-button,
.room-arrival .primary-button { min-height: 49px; padding: 12px 20px; border: 1px solid #315e45; border-radius: 11px; color: #fff; background: #315e45; box-shadow: none; font-size: 16px; font-weight: 700; line-height: 1.35; cursor: pointer; }
.research-welcome .primary-button { flex: 0 0 auto; }
.research-welcome .primary-button:hover:not(:disabled),
.room-arrival .primary-button:hover:not(:disabled) { border-color: #244e36; background: #244e36; transform: none; }
.research-welcome .primary-button:disabled,
.room-arrival .primary-button:disabled { color: #646c59; border-color: #c3cbb7; background: #d7dfcb; opacity: 1; cursor: default; }

.room-overview-stage { background-color: #3a3b2f; }
.room-overview-stage::after { z-index: 2; background: linear-gradient(180deg, rgba(20, 23, 17, .16), transparent 26%, transparent 70%, rgba(20, 23, 17, .13)); }
.room-art-backdrop { position: absolute; z-index: 0; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); object-fit: cover; filter: blur(5px) brightness(.65); user-select: none; pointer-events: none; }
.room-art-frame { position: absolute; z-index: 1; inset: 0; min-width: 0; min-height: 0; }
.room-art { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; user-select: none; }
.room-overview-stage .scene-heading { top: 18px; left: 24px; width: min(470px, calc(100vw - 280px)); padding: 11px 16px; }
.room-overview-stage .scene-heading h1 { font-size: clamp(21px, 2.1vw, 29px); }
.room-overview-stage .scene-heading .scene-eyebrow { font-size: 10px; }
.room-overview-stage .scene-actions { top: 18px; }
.room-overview-stage .back-button { min-height: 46px; padding: 6px 12px 6px 7px; font-size: 15px; }
.room-overview-stage .back-button .nav-arrow { width: 28px; height: 28px; flex-basis: 28px; }
.room-arrival { position: absolute; z-index: 8; right: max(24px, 3vw); bottom: 32px; width: min(365px, 37vw); max-height: calc(100vh - 188px); max-height: calc(100dvh - 188px); margin: 0; padding: 24px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; border: 1px solid #d9ceb7; border-radius: 17px; color: #3c392b; background: rgba(255, 250, 239, .96); box-shadow: 0 12px 32px rgba(22, 24, 17, .21); text-align: left; }
.room-arrival-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 12px; }
.room-eyebrow { color: #776c53; font-size: 10px; font-weight: 800; line-height: 1.4; letter-spacing: .075em; text-transform: uppercase; }
.room-status { display: inline-block; padding: 5px 7px; border: 1px solid #d6c9ad; border-radius: 6px; color: #7a6b4e; background: #f7f0e0; font-size: 10px; font-weight: 700; line-height: 1.3; }
.room-status.is-complete { color: #46643a; border-color: #b7c6a1; background: #eaf0df; }
.room-arrival h2 { margin: 0 0 12px; color: #42472f; font: 700 28px/1.16 Georgia, "Times New Roman", serif; letter-spacing: -.015em; }
.room-arrival-copy { margin: 0; color: #6a604b; font-size: 15px; line-height: 1.6; }
.room-arrival-actions { margin-top: 20px; }
.room-arrival .primary-button { width: 100%; }
.room-arrival-note { margin: 13px 0 0; color: #7b7059; font-size: 12px; line-height: 1.5; }
.room-look-button { position: absolute; z-index: 10; top: var(--back-button-top, 128px); right: 24px; min-height: 44px; padding: 9px 14px; border: 1px solid #c9c2a9; border-radius: 11px; color: #45543a; background: rgba(255, 251, 240, .94); box-shadow: 0 5px 14px rgba(20, 23, 16, .13); font-family: Arial, sans-serif; font-size: 14px; line-height: 1.4; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.room-look-button:hover { color: #304b32; border-color: #93a67c; background: #f3f7e9; }

/* Programmatic reading focus remains useful without outlining every clicked paragraph. */
body[data-input-mode="pointer"] #app :focus { outline: none; }
body[data-input-mode="keyboard"] #app :focus { outline: 3px solid #3b6855; outline-offset: 4px; }
.reception-workspace,
.ward-workspace,
.office-workspace,
.aftercare-workspace,
.synthesis-workspace { box-shadow: 0 15px 42px rgba(22, 24, 17, .25); }

@media (max-width: 1024px) {
    .room-overview-stage .scene-heading { top: 12px; left: 12px; width: min(470px, calc(100vw - 240px)); padding: 10px 12px; }
    .room-overview-stage .scene-heading h1 { font-size: 21px; }
    .room-overview-stage .scene-actions { top: 12px; right: 12px; }
    .room-overview-stage .back-button { left: 12px; }
    .room-look-button { right: 12px; }
    .room-arrival { right: 20px; bottom: 20px; width: min(345px, 39vw); padding: 21px; }
    .room-arrival h2 { font-size: 26px; }
}
@media (max-width: 800px) {
    .room-overview-stage { display: grid; grid-template-rows: 126px minmax(100px, 1fr) auto; gap: 0; }
    .room-overview-stage::after { background: linear-gradient(180deg, rgba(20, 23, 17, .1), transparent 24%); }
    .room-art-frame { position: relative; inset: auto; grid-row: 2; width: 100%; }
    .room-arrival { position: relative; grid-row: 3; right: auto; bottom: auto; width: calc(100% - 28px); max-height: min(270px, 42vh); max-height: min(270px, 42dvh); margin: 12px 14px 14px; padding: 19px 22px; }
    .room-arrival-top { margin-bottom: 9px; }
    .room-arrival h2 { margin-bottom: 9px; font-size: 25px; }
    .room-arrival-copy { font-size: 14px; line-height: 1.5; }
    .room-arrival-actions { margin-top: 14px; }
    .room-arrival .primary-button { min-height: 46px; }
    .room-arrival-note { margin-top: 10px; font-size: 11px; }
}
@media (max-width: 700px) {
    .start-overlay .research-welcome { width: calc(100vw - 24px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 23px 20px 20px; border-radius: 18px; }
    .start-overlay .research-welcome .start-title { font-size: 37px; }
    .start-overlay .research-welcome .start-question { margin-top: 13px; font-size: 18px; }
    .welcome-lead { font-size: 14px; }
    .welcome-steps { grid-template-columns: minmax(0, 1fr); gap: 9px; margin-block: 18px; }
    .welcome-steps li { padding: 12px 13px; }
    .welcome-steps h2 { margin-bottom: 5px; }
    .welcome-finale { padding: 15px; }
    .welcome-chain { gap: 6px; }
    .welcome-chain > span { padding: 6px 8px; font-size: 12px; }
    .welcome-actions { flex-direction: column; align-items: stretch; gap: 12px; margin-top: 18px; }
    .welcome-order { max-width: none; text-align: center; }
    .research-welcome .start-status { text-align: center; }
    .room-overview-stage { grid-template-rows: 110px minmax(84px, 1fr) auto; }
    .room-overview-stage .scene-heading { width: calc(100vw - 122px); padding: 9px 11px; }
    .room-overview-stage .scene-heading h1 { font-size: 17px; }
    .room-overview-stage .scene-heading .scene-eyebrow { display: none; }
    .room-overview-stage .back-button { min-height: 44px; font-size: 14px; }
    .room-arrival { width: calc(100% - 20px); margin: 10px; padding: 17px 18px; }
    .room-arrival h2 { font-size: 24px; }
    .room-look-button { right: 12px; min-height: 44px; padding: 9px 11px; font-size: 13px; }
    .location-stage:has(.room-look-button) .back-button { max-width: calc(100vw - 145px); padding-right: 9px; gap: 7px; font-size: 13px; }
    .location-stage:has(.room-look-button) .back-button > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 390px) {
    .start-overlay .research-welcome { padding: 21px 17px 18px; }
    .start-overlay .research-welcome .start-title { font-size: 33px; }
    .start-overlay .research-welcome .start-question { font-size: 17px; }
    .welcome-chain { display: grid; grid-template-columns: minmax(0, 1fr); text-align: center; }
    .welcome-chain > i { transform: rotate(90deg); font-size: 17px; }
    .room-arrival { padding: 16px; }
    .room-arrival h2 { font-size: 23px; }
    .room-look-button { padding-inline: 10px; font-size: 12px; }
    .location-stage:has(.room-look-button) .back-button { max-width: calc(100vw - 133px); font-size: 12px; }
}
@media (max-height: 600px) and (min-width: 801px) {
    .room-overview-stage .scene-heading { top: 10px; left: 12px; padding: 8px 12px; }
    .room-overview-stage .scene-heading h1 { font-size: 20px; }
    .room-overview-stage .scene-heading .scene-eyebrow { display: none; }
    .room-overview-stage .scene-actions { top: 10px; right: 12px; }
    .room-overview-stage .back-button { left: 12px; min-height: 42px; }
    .room-arrival { right: 16px; bottom: 16px; max-height: calc(100vh - 130px); max-height: calc(100dvh - 130px); padding: 19px; }
    .room-arrival h2 { font-size: 24px; }
}
@media (max-height: 430px) and (max-width: 800px) {
    .room-overview-stage { grid-template-rows: 104px minmax(70px, 1fr) auto; }
    .room-arrival { max-height: 38vh; max-height: 38dvh; margin-block: 7px; }
}
@media (max-height: 430px) and (min-width: 600px) and (max-width: 800px) {
    .room-overview-stage { display: block; }
    .room-art-frame { position: absolute; inset: 112px 42% 12px 12px; width: auto; }
    .room-arrival { position: absolute; top: 112px; right: 12px; bottom: 12px; width: calc(40% - 12px); max-height: none; margin: 0; padding: 15px; }
    .room-arrival h2 { font-size: 22px; }
    .room-arrival .primary-button { padding-inline: 12px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .research-welcome *, .room-overview-stage *, .room-look-button { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
