/* Shared legibility and spatial navigation. Reading contents keep their own layout. */
:root { --shrine-paper:#faf9f5; --shrine-ink:#25322e; --shrine-muted:#59675f; --shrine-line:#dce1d9; --shrine-accent:#345d4c; }
.interface-active { --ui-paper:var(--shrine-paper); --ui-ink:var(--shrine-ink); --ui-muted:var(--shrine-muted); }
.interface-shell { min-height:520px; }
.interface-shell .shrine-nav { border-radius:12px; background:#faf9f5f7; box-shadow:0 5px 24px #10221d14; }
.interface-shell .shrine-nav .interface-menu-label { font-size:13px; color:#364d41; }
.interface-shell .interface-hosts { top:94px; border-radius:10px; padding:3px 8px; background:#faf9f5f2; }
.interface-shell .interface-host { font-size:14px; }
.interface-shell .interface-host-hint { color:#5a685e; font-size:11px; }
.interface-shell .invitation { max-width:420px; }
.interface-shell .invitation h1 { font-size:clamp(36px,4vw,54px); line-height:1.38; letter-spacing:-.055em; }
.interface-shell .invitation .invitation-copy { color:#e1e8e2; font-size:15px; line-height:1.9; }
.interface-shell .invitation .eyebrow { font-size:12px; letter-spacing:.04em; color:#c9d6ce; }
.interface-shell .invitation .entrance-note { color:#d0dad4; font-size:12px; }
.interface-shell .invitation .hub-intro-link { font-size:13px!important; color:#e4ece6; }
.sanctuary-destinations { position:absolute; z-index:6; right:24px; top:94px; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); width:min(584px,calc(100% - 350px)); padding:5px; border:1px solid #e2e5dc; border-radius:12px; background:#faf9f5f7; box-shadow:0 6px 25px #071c1821; }
.sanctuary-destinations button { position:relative; display:flex; flex-direction:column; justify-content:center; gap:4px; min-width:0; min-height:58px; padding:9px 12px; border:0; border-radius:8px; background:transparent; color:var(--shrine-ink); text-align:left; cursor:pointer; font-family:var(--sans,system-ui,sans-serif); }
.sanctuary-destinations button+button:before { content:''; position:absolute; width:1px; height:25px; background:#e2e7df; left:-1px; top:50%; transform:translateY(-50%); }
.sanctuary-destinations strong { font-size:14px; font-weight:650; letter-spacing:-.03em; }
.sanctuary-destinations button>span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; color:#596b5e; }
.sanctuary-destinations button:hover { background:#eaf0e7; }
.sanctuary-destinations button:first-child { background:#e9efe6; }
.interface-shell .world-wayfinder { top:184px; right:24px; }
.sanctuary-destinations button:focus-visible,.sanctuary-room-status button:focus-visible { outline:2px solid #345d4c; outline-offset:2px; }
.sanctuary-room-status { position:absolute; z-index:4; left:24px; top:156px; display:none; flex-wrap:wrap; align-items:center; gap:7px 10px; max-width:calc(100% - 320px); padding:10px 13px; border:1px solid #b9ccc15e; border-radius:10px; background:#152d2be8; color:#f3f4eb; font-size:12px; }
.sanctuary-room-status strong { font-size:13px; font-weight:600; }
.sanctuary-room-status>span { color:#c4d4c9; }
.sanctuary-room-status button { min-height:32px; padding:4px 0 4px 8px; border:0; border-left:1px solid #80998d66; background:transparent; color:#e5e9d3; font:inherit; cursor:pointer; }
.is-exploring .sanctuary-room-status { display:flex; }
.world-modal-open :is(.sanctuary-destinations,.sanctuary-room-status) { visibility:hidden; }
.interface-shell .ritual-dock.hub-dock { width:min(920px,calc(100% - 280px)); border-radius:13px; padding:8px 12px; }
.interface-shell .hub-dock .dock-action>span { font-size:14px; }
.interface-shell .hub-dock .dock-action small { font-size:11px; color:#5e6b5c; }
.interface-shell .hub-world-rituals { border-radius:9px; }
.interface-shell .hub-world-rituals button { color:#415b49; font-size:12px; }
.interface-shell .traveler-name { display:flex; flex-direction:column; align-items:center; gap:0; min-width:78px; border-radius:9px; padding:7px 11px; background:#faf9f5f5; border:1px solid #d5dfd0; box-shadow:0 3px 14px #071b1933; text-shadow:none; color:#31483c; transform:translate(-50%,-115%); text-align:center; }
.interface-shell .traveler-name .traveler-day-pillar { display:block; width:auto; height:auto; margin:0; padding:0; border:0; border-radius:0; background:none; color:#3c5f4c; font-size:13px; font-weight:700; line-height:1.5; letter-spacing:-.02em; }
.interface-shell .traveler-name .traveler-nickname { display:block; margin-top:2px; color:#59695c; font-size:11px; line-height:1.5; }
.interface-shell .traveler-name:not(.has-day-pillar) .traveler-day-pillar { display:none; }
.interface-shell .traveler-name:not(.has-day-pillar) .traveler-nickname { margin:0; font-size:12px; }

/* Menus use the same readable paper as personal readings. */
dialog.hub-dialog { width:min(1060px,calc(100vw - 40px)); height:min(900px,92dvh); max-height:92dvh; padding:0; border:1px solid #dce1d8; border-radius:16px; background:var(--shrine-paper); color:var(--shrine-ink); color-scheme:light; font-size:15px; line-height:1.8; }
dialog.hub-dialog[open] { display:flex; flex-direction:column; }
.hub-dialog .hub-header { flex:none; background:var(--shrine-paper); border-bottom:1px solid var(--shrine-line); padding:24px 30px; gap:18px; }
.hub-dialog .hub-header p { color:#65766a; font-size:10px; letter-spacing:.13em; margin-bottom:5px; }
.hub-dialog .hub-header h2 { color:#24392d; font-size:26px; font-weight:600; }
.hub-dialog :is(.hub-back,.hub-close) { display:grid; place-items:center; min-width:44px; width:44px; height:44px; background:transparent; border:1px solid #cfd8cd; border-radius:50%; color:#425c49; font-size:23px; }
.hub-dialog .hub-body { flex:1; min-height:0; overflow:auto; padding:30px; scrollbar-color:#b8c6b7 var(--shrine-paper); }
.hub-dialog.hub-is-reading .hub-body { padding:0; }
.hub-dialog .hub-footer { flex:none; padding:13px 30px; border-top:1px solid var(--shrine-line); background:#f1f3eb; color:#57695b; font-size:12px; }
.hub-dialog .hub-footer button { min-height:36px; font-size:13px; color:#345c43; }
.hub-dialog .hub-search { font-size:25px; color:#293f31; }
.hub-dialog .hub-search input { min-height:48px; font-size:16px; background:white; border-color:#c5d0c2; color:#2c4032; }
.hub-dialog .hub-feature-grid { gap:14px; }
.hub-dialog .hub-feature { background:#fffefa; border:1px solid #d8e0d3; border-radius:12px; padding:22px; min-height:154px; box-shadow:none; }
.hub-dialog .hub-feature:hover { background:#edf2e7; border-color:#91a88b; transform:translateY(-2px); }
.hub-dialog .hub-feature strong { color:#2c4935; font-size:20px; line-height:1.5; }
.hub-dialog .hub-feature-tag { color:#5f6f59; font-size:11px; }
.hub-dialog .hub-feature>span:not(.hub-feature-tag) { color:#58694f; font-size:14px; line-height:1.8; }
.hub-dialog .hub-feature i { color:#67825e; }
.hub-dialog .hub-hall-intro { border-color:var(--shrine-line); }
.hub-dialog .hub-hall-intro h3 { color:#2b4533; font-size:28px; line-height:1.5; }
.hub-dialog .hub-hall-intro p { color:#5b6d58; font-size:15px; line-height:1.85; }
.hub-dialog .hub-hall-intro span { color:#687b60; font-size:12px; }
.hub-dialog :is(.hub-note,.hub-empty,.hub-loading,.hub-explanation p) { color:#5c6e54; font-size:14px; line-height:1.9; }
.hub-dialog .hub-rituals { border-color:var(--shrine-line); }
.hub-dialog .hub-rituals h3,.hub-dialog .hub-section-link { color:#36523b; font-size:18px; }
.hub-dialog .hub-rituals button { min-height:44px; background:#eef2e6; border-color:#cdd9c0; color:#46623e; font-size:13px; }
.hub-dialog .hub-map { height:500px; background:#edf2e8; border-color:#cdd8c4; }
.hub-dialog .hub-map-place { padding:9px 4px; }
.hub-dialog .hub-map-place strong { color:#36523d; font-size:17px; }
.hub-dialog .hub-map-place small { color:#60755a; font-size:10px; }
.hub-dialog .hub-map-place .icon { color:#5d7857; }
.hub-dialog .hub-map-center strong { color:#35563b; }
.hub-dialog .hub-map-center small { color:#647b5a; }
.hub-dialog .hub-map-list { gap:0 24px; }
.hub-dialog .hub-map-row { border-color:var(--shrine-line); }
.hub-dialog .hub-map-row span { color:#354e3a; font-size:15px; }
.hub-dialog .hub-map-row button { color:#527046; min-height:44px; font-size:13px; }
.hub-dialog .hub-map-lead h3 { color:#2c4a34; font-size:26px; }
.hub-dialog .hub-map-lead p { color:#566e4c; font-size:14px; }
.hub-dialog :is(button,a,summary):focus-visible { outline:2px solid #426645; outline-offset:3px; }
.profile-dialog { background:var(--shrine-paper); color:var(--shrine-ink); }
.profile-dialog .profile-header { background:var(--shrine-paper); }
.profile-dialog .profile-header p { color:#5f725a; font-size:10px; }
.profile-dialog .profile-lead { color:#51674a; font-size:15px; }
.profile-dialog :is(.profile-field,.profile-form legend,.profile-check) { font-size:14px; color:#425b3b; }
.profile-dialog :is(.profile-field small,.profile-help,.profile-check small,.profile-privacy,.profile-status,.profile-delete) { color:#617455; font-size:12px!important; }
.profile-dialog :is(.profile-save,.profile-gender span) { font-size:15px!important; }
.profile-dialog .profile-save { min-height:50px; color:white; background:#365a40; }
.profile-dialog .profile-close { width:44px; height:44px; }
.social-dialog :is(.social-consent,.social-welcome>p:not(.social-eyebrow),.social-welcome ol,.social-person p,.social-result-section article p,.social-confirm>p:not(.social-eyebrow)) { font-size:14px; color:#536948; line-height:1.85; }
.social-dialog :is(.social-footer,.social-result-note,.social-axis-tone,.social-session-actions button) { font-size:12px; color:#607552; }
.social-dialog :is(.social-tabs button,.social-person>button,.social-person h3,.social-request-compose label) { font-size:14px; }
.social-dialog .social-close { min-height:44px; width:44px; }
dialog.npc-dialog .npc-message-text,dialog.npc-dialog .npc-message-body>p:not([class]) { font-size:17px; line-height:1.9; letter-spacing:-.02em; }
dialog.npc-dialog .npc-status { color:#576b5d; font-size:12px; }
dialog.npc-dialog .npc-disclosure { color:#59695c; font-size:11px; }
dialog.npc-dialog .npc-message--user .npc-message-text { font-size:15px; }

@media(max-width:1200px) and (min-width:761px) {
  .interface-shell .hub-dock .dock-action { flex-direction:column; gap:4px; padding:6px 5px; text-align:center; }
  .interface-shell .hub-dock .dock-action small { display:none; }
  .interface-shell .hub-dock .dock-icon { width:20px; height:23px; }
}
@media(max-width:900px) and (min-width:761px) {
  .interface-shell .hub-dock .dock-action { white-space:normal; word-break:keep-all; }
  .interface-shell .hub-dock .dock-icon { display:none; }
}
@media(max-width:1040px) and (min-width:761px) {
  .sanctuary-destinations { min-height:50px; }
  .sanctuary-destinations button { padding:8px 10px; min-height:44px; }
  .sanctuary-destinations button>span { display:none; }
  .sanctuary-destinations strong { font-size:13px; }
}
@media(max-width:760px) {
  .interface-shell { min-height:480px; }
  .interface-shell .shrine-header { top:12px; left:12px; right:12px; }
  .interface-shell .interface-hosts { top:118px; left:12px; width:calc(100% - 82px); }
  .interface-shell .interface-host { font-size:14px; }
  .interface-shell .invitation { top:184px; left:24px; max-width:calc(100% - 48px); }
  .interface-shell .invitation h1 { font-size:36px; }
  .interface-shell .invitation .invitation-copy { font-size:14px; }
  .interface-shell .invitation .entrance-note { font-size:11px; }
  .sanctuary-destinations { top:auto; right:12px; left:12px; bottom:max(12px,env(safe-area-inset-bottom)); width:auto; border-radius:13px; padding:5px 3px; }
  .sanctuary-destinations button { min-height:52px; padding:7px 2px; align-items:center; text-align:center; }
  .sanctuary-destinations strong { font-size:13px; }
  .sanctuary-destinations button>span { display:none; }
  .interface-shell .ritual-dock.hub-dock,.interface-shell .hub-world-rituals { display:none; }
  .sanctuary-room-status { top:176px; left:12px; max-width:calc(100% - 24px); padding:6px 11px; font-size:11px; gap:4px 8px; }
  .sanctuary-room-status strong { font-size:12px; }
  .interface-shell .move-controls { bottom:calc(88px + env(safe-area-inset-bottom)); }
  .interface-shell .experience-tools { bottom:calc(88px + env(safe-area-inset-bottom)); }
  .interface-shell .world-wayfinder { right:12px; top:118px; }
  .interface-shell .traveler-name .traveler-day-pillar { font-size:12px; }
  .interface-shell .traveler-name .traveler-nickname { font-size:11px; }
  dialog.hub-dialog { width:calc(100vw - 12px); max-height:calc(100dvh - 12px); height:calc(100dvh - 12px); border-radius:14px; }
  .hub-dialog .hub-header { padding:16px; gap:12px; }
  .hub-dialog .hub-header h2 { font-size:23px; }
  .hub-dialog .hub-body { padding:22px 18px; }
  .hub-dialog .hub-footer { padding:8px 16px; gap:14px; }
  .hub-dialog .hub-footer>span { display:none; }
  .hub-dialog .hub-feature { padding:19px 16px; min-height:154px; }
  .hub-dialog .hub-feature strong { font-size:18px; }
  .hub-dialog .hub-feature>span:not(.hub-feature-tag) { font-size:14px; }
  .hub-dialog .hub-search { font-size:23px; }
  .hub-dialog .hub-hall-intro { display:flex; align-items:center; gap:12px; padding:0; margin:0 0 18px; border:0; }
  .hub-dialog .hub-hall-intro img { flex:none; width:42px; height:42px; border-width:2px; }
  .hub-dialog .hub-hall-intro h3 { font-size:18px; line-height:1.55; margin:4px 0 0; }
  .hub-dialog .hub-hall-intro p { display:none; }
  .hub-dialog .hub-free-actions>button { min-height:48px; }
  .hub-dialog .hub-map { height:470px; }
  .hub-dialog .hub-map-place { width:91px; }
  .hub-dialog .hub-map-place strong { font-size:15px; }
  .hub-dialog .hub-map-place small { font-size:10px; }
  .hub-dialog .hub-map-row { padding:6px 0; }
  .hub-dialog .hub-map-row button { font-size:12px; }
  .hub-dialog .hub-map-row span { font-size:14px; }
  dialog.npc-dialog .npc-message-text,dialog.npc-dialog .npc-message-body>p:not([class]) { font-size:16px; line-height:1.85; }
  .profile-dialog .profile-lead { font-size:14px; }
  .profile-dialog .profile-form { padding:20px; }
  .social-dialog :is(.social-consent,.social-welcome>p:not(.social-eyebrow),.social-welcome ol,.social-person p,.social-result-section article p) { font-size:14px; }
}
@media(max-height:680px) and (max-width:760px) {
  .interface-shell .invitation { top:176px; }
  .interface-shell .invitation h1 { font-size:30px; }
  .interface-shell .invitation .invitation-copy { margin:12px 0 14px; font-size:13px; }
  .interface-shell .invitation .hub-intro-link { margin-top:10px!important; }
  .interface-shell .entrance-note { display:none; }
}
@media(prefers-reduced-motion:reduce) {
  .sanctuary-destinations *, .hub-dialog .hub-feature { transition:none; }
}

/* Keep a useful reading surface while a cold network loads the guide module. */
dialog.xp-dialog.xp-loading-dialog { width:min(620px,calc(100vw - 32px)); min-height:290px; padding:0; border:1px solid #dce1d8; border-radius:16px; background:var(--shrine-paper); color:var(--shrine-ink); }
.xp-loading-content { display:flex; align-items:center; flex-direction:column; gap:13px; padding:38px 24px; text-align:center; font:15px/1.8 var(--sans,system-ui,sans-serif); }
.xp-loading-content p { margin:0; color:#62745e; font-size:12px; }
.xp-loading-content h2 { margin:0; color:#2a4332; font-size:24px; font-weight:600; line-height:1.5; }
.xp-loading-content>span:not(.xp-loading-mark) { color:#5d6f54; font-size:14px; }
.xp-loading-content button { min-height:44px; margin-top:8px; padding:9px 18px; border:1px solid #bacbb2; border-radius:8px; background:#eef2e8; color:#405b39; font:inherit; cursor:pointer; }
.xp-loading-mark { display:block; width:28px; height:28px; border:2px solid #d9e1d2; border-top-color:#496c48; border-radius:50%; animation:shrine-loading-spin 1s linear infinite; }
@keyframes shrine-loading-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .xp-loading-mark { animation:none; } }
