/* The world is the workspace while inside an institution. */
body.world-interior-mode { overflow:hidden; background:#eaf0f6; }
.world-interior-mode #app { display:block; height:100svh; }
.world-interior-mode .workspace { margin:0!important; width:100%; }
.world-interior-mode main.animate-in { animation:none!important; transform:none!important; }
.world-interior-mode .sidebar,.world-interior-mode .topbar,.world-interior-mode .footer-note { display:none!important; }
.world-interior-mode .main,.world-interior-mode main,.world-interior-mode .content,.world-interior-mode .main-content { margin:0!important; padding:0!important; max-width:none!important; width:100%; }
.wi-world { position:relative; width:100%; height:100svh; min-height:520px; overflow:hidden; color:#334153; background:#e9f0f8; font-family:inherit; }
#wi-canvas { position:absolute; inset:0; outline:none; }
#wi-canvas:focus-visible { outline:3px solid #507fba; outline-offset:-3px; }
#wi-canvas canvas { display:block; width:100%; height:100%; }
.wi-world button { font:inherit; font-size:14px; line-height:1.4; min-height:40px; padding:8px 13px; border:1px solid #cad7e6; border-radius:9px; background:#fff; color:#395d89; cursor:pointer; transition:background .15s; }
.wi-world button:hover { background:#e9f1fc; }
.wi-world button:focus-visible { outline:3px solid #527eb6; outline-offset:3px; }
.wi-world button:disabled { opacity:.48; cursor:not-allowed; }
.wi-world button.wi-primary { color:white; background:#396cb2; border-color:#396cb2; }
.wi-world button.wi-primary:hover:not(:disabled) { background:#2c5994; }
.wi-top { position:absolute; inset:0 0 auto; z-index:8; min-height:64px; padding:12px 22px; background:rgba(250,252,255,.94); border-bottom:1px solid #d9e3ed; display:flex; justify-content:space-between; align-items:center; gap:16px; }
.wi-top>div { display:flex; align-items:center; gap:12px; min-width:0; }
.wi-top>div>span { font-size:15px; font-weight:700; color:#536a89; white-space:nowrap; }
.wi-top strong { font-size:16px; font-weight:650; padding-left:12px; border-left:1px solid #ccd6e3; }
.wi-top button { flex-shrink:0; }
.wi-top #wi-bag-count { background:#e3edfa; border-radius:5px; padding:1px 5px; margin-left:4px; }
.wi-objective { position:absolute; top:88px; left:28px; z-index:4; max-width:min(420px,calc(100% - 56px)); padding:16px 19px; background:rgba(255,255,255,.94); border-left:4px solid #edbc8b; border-radius:0 12px 12px 0; box-shadow:0 3px 20px #3148630d; pointer-events:none; }
.wi-objective small { display:block; color:#60799a; font-size:12px; font-weight:650; letter-spacing:.02em; }
.wi-objective h1 { font-size:21px!important; line-height:1.45!important; margin:5px 0!important; font-weight:700!important; color:#334153!important; }
.wi-objective>span { color:#64768a; font-size:13px; }
.wi-dialog { position:absolute; z-index:6; bottom:62px; left:50%; transform:translateX(-50%); width:min(660px,calc(100% - 48px)); padding:19px 24px 20px; border-radius:15px; border:1px solid #d4e0ed; background:rgba(255,255,255,.97); box-shadow:0 8px 26px #29426018; }
.wi-speaker { display:flex; gap:10px; align-items:center; }
.wi-speaker-line { display:block; width:4px; height:34px; background:#eab98a; border-radius:3px; }
.wi-speaker>div { flex:1; }
.wi-speaker strong { display:block; color:#3d5f8e; font-size:16px; }
.wi-speaker small { display:block; color:#738297; font-size:12px; margin-top:2px; }
.wi-speaker button { min-height:32px; padding:5px 9px; font-size:12px; border-color:transparent; }
.wi-dialog>p { font-size:16px; line-height:1.75; margin:13px 0; color:#37495c; }
.wi-dialog-actions { display:flex; flex-wrap:wrap; gap:9px; }
.wi-controls { position:absolute; z-index:5; bottom:12px; left:24px; right:24px; display:flex; gap:10px; align-items:center; justify-content:flex-end; color:#586e86; font-size:12px; }
.wi-controls>span { display:none; background:rgba(255,255,255,.9); padding:7px 10px; border-radius:6px; margin-right:auto; }
.wi-controls button { min-height:32px; font-size:12px; padding:6px 10px; }
#wi-status { position:absolute; top:80px; right:24px; width:min(380px,calc(100% - 48px)); z-index:12; }
.wi-notice { background:#fff9f0; border:1px solid #e7c7a5; color:#765433; border-radius:8px; padding:10px 13px; font-size:13px; line-height:1.5; margin-bottom:7px; box-shadow:0 4px 15px #3349660a; }
.wi-notice button { font-size:12px; min-height:30px; margin:6px 0 0; }
.wi-error { background:#fff4f2; border-color:#e2b7b2; color:#924b45; }
#wi-panel { position:absolute; z-index:7; right:24px; bottom:62px; max-height:calc(100% - 240px); width:min(420px,calc(100% - 48px)); overflow:auto; overscroll-behavior:contain; border-radius:14px; }
#wi-panel:empty { display:none; }
.wi-panel-open .wi-dialog { display:none; }
.wi-item-panel,.wi-workbag { border:1px solid #d3dfed; background:rgba(255,255,255,.98); padding:22px; border-radius:14px; box-shadow:0 6px 24px #29426018; }
.wi-panel-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:16px; }
.wi-panel-heading h2 { font-size:21px; line-height:1.4; margin:4px 0 0; color:#354c69; }
.wi-panel-heading small { color:#687d98; font-size:12px; }
.wi-panel-heading button { min-height:30px; padding:4px 8px; font-size:12px; flex-shrink:0; }
.wi-item-panel>p,.wi-workbag>p { font-size:14px; line-height:1.8; color:#536579; margin:12px 0; }
.wi-item-facts { border-top:1px solid #e4eaf2; border-bottom:1px solid #e4eaf2; padding:7px 0; margin:12px 0; }
.wi-item-facts p { font-size:14px; line-height:1.55; margin:8px 0; font-weight:600; color:#466387; }
.wi-item-panel>button { margin-top:8px; }
.wi-small { display:block; font-size:12px!important; color:#728197!important; line-height:1.6!important; margin:14px 0 0!important; }
.wi-saved { font-size:13px; font-weight:600; color:#426b9b; padding:10px 0; }
.wi-scope-actions,.wi-proposal-actions { display:flex; flex-direction:column; gap:9px; margin:15px 0; }
.wi-warning { border-left:3px solid #e3b489; padding-left:12px; }
.wi-result { margin:14px 0; padding:12px 14px; background:#edf3fc; border-radius:8px; font-size:13px; line-height:1.6; }
.wi-result strong { font-size:14px; color:#365c8d; }
.wi-result p { margin:6px 0 0; color:#586c86; }
.wi-result-revisit { background:#fcf0e5; }
.wi-result-revisit strong { color:#8d5f39; }
.wi-result-metrics { display:flex; justify-content:space-between; gap:12px; padding-top:12px; }
.wi-result-metrics b { display:block; font-size:21px; }
.wi-result-metrics small { display:block; font-size:11px; line-height:1.6; margin-top:3px; color:#64778f; }
.wi-evidence-list { border-top:1px solid #dce5ef; }
.wi-evidence-list button { width:100%; display:flex; justify-content:space-between; gap:12px; padding:13px 0; border:0; border-bottom:1px solid #dce5ef; border-radius:0; text-align:left; color:#405a78; }
.wi-evidence-list small { color:#7a8aa1; white-space:nowrap; }
.wi-workbag h3 { font-size:15px; margin:20px 0 8px; }
.wi-scene-loading { position:absolute; left:50%; top:45%; transform:translate(-50%,-50%); width:min(420px,80%); padding:18px 22px; border-radius:12px; background:rgba(255,255,255,.94); color:#536e91; line-height:1.7; text-align:center; }
@media (max-width:900px) {
 .wi-top>div>span { display:none; }
 .wi-top strong { padding-left:0; border:0; font-size:14px; }
 .wi-top { padding:10px 14px; gap:8px; }
 .wi-top>div { gap:8px; }
 .wi-top button { padding:7px 10px; font-size:12px; }
 .wi-objective { top:82px; left:18px; padding:12px 14px; max-width:340px; }
 .wi-objective h1 { font-size:18px!important; }
 #wi-status { top:200px; right:18px; width:min(340px,calc(100% - 36px)); }
 #wi-panel { right:18px; max-height:calc(100% - 270px); }
}
@media (max-width:600px) {
 .interior-near-hint { display:none; }
 .wi-world { min-height:500px; }
 .wi-top { min-height:62px; flex-wrap:wrap; }
 .wi-top>div:first-child { flex:1; }
 .wi-top strong { max-width:150px; line-height:1.4; }
 .wi-top>div:last-child>button:first-child { display:none; }
 .wi-objective { top:80px; left:12px; max-width:calc(100% - 24px); padding:9px 12px; }
 .wi-objective h1 { font-size:16px!important; line-height:1.4!important; }
 .wi-objective small,.wi-objective>span { font-size:11px; }
 .wi-dialog { width:calc(100% - 24px); bottom:57px; padding:13px 15px; border-radius:12px; max-height:45svh; overflow:auto; }
 .wi-dialog>p { font-size:14px; line-height:1.7; margin:10px 0; }
 .wi-speaker strong { font-size:14px; }
 .wi-speaker small { font-size:11px; }
 .wi-dialog-actions button { font-size:13px; }
 .wi-controls { left:12px; right:12px; bottom:10px; gap:6px; }
 .wi-controls>span { display:none; }
 .wi-controls button { background:#ffffffeb; }
 #wi-status { top:177px; right:12px; width:calc(100% - 24px); }
 #wi-panel { right:12px; width:calc(100% - 24px); bottom:57px; max-height:48svh; }
 .wi-item-panel,.wi-workbag { padding:16px; }
 .wi-panel-heading h2 { font-size:18px; }
 .wi-notice { font-size:12px; padding:7px 10px; }
}
@media (prefers-reduced-motion:reduce) { .wi-world button { transition:none; } }

.wi-chapter-steps{list-style:none;margin:14px 0 18px;padding:0;border-top:1px solid #dce5ef}
.wi-chapter-steps li{display:flex;justify-content:space-between;padding:6px 2px;border-bottom:1px solid #e5ebf1;color:#3c516a;font-size:14px}
.wi-chapter-steps strong{font-size:12px;color:#46698c}
.wi-samples{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.wi-samples button{font-size:13px;min-height:37px;padding:6px}
.wi-samples button[aria-pressed="true"],.wi-sample-tools button[aria-pressed="true"]{border:1px solid #3468a4;background:#eaf2fd;color:#244c7f}
.wi-sample-tools{display:flex;gap:8px}
.wi-sample-tools button{min-height:33px;font-size:13px}
.wi-sample-panel .wi-pair{margin:12px 0 4px;font-weight:650;color:#3c5776}
.wi-sample-panel>button+button{margin-left:6px}
@media(max-width:600px){
 .wi-top>div:last-child>button:first-child{display:inline-block}
 .wi-top>div{gap:4px}
 .wi-top strong{max-width:105px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}
 .wi-top button{padding:6px 7px}
 .wi-sample-panel .wi-panel-heading{margin-bottom:8px}
}

.wi-history{margin-top:16px;border-top:1px solid #dbe3eb;padding-top:12px;color:#314c67;font-size:.88rem}
.wi-history summary{cursor:pointer;font-weight:650}
.wi-history li+li{margin-top:10px}
.wi-history li p{margin:.15em 0}

@media(max-width:600px){
 .wi-world:has(.wi-sample-panel) .wi-objective,
 .wi-world:has(.wi-sample-panel) .wi-controls{display:none}
 .wi-world:has(.wi-sample-panel) #wi-panel{bottom:max(8px,env(safe-area-inset-bottom));max-height:51%}
 .wi-sample-panel{padding:12px 14px}
 .wi-sample-panel .wi-panel-heading{margin-bottom:6px;align-items:center}
 .wi-sample-panel .wi-panel-heading small{display:none}
 .wi-sample-panel .wi-panel-heading h2{margin:0}
 .wi-sample-panel>p{line-height:1.5;margin:7px 0}
 .wi-sample-panel .wi-pair{margin:7px 0 0}
}

.wi-life-entry{margin:15px 0;padding:11px 14px;border-inline-start:3px solid #92b6dc;background:#f2f6fb}
.wi-life-entry p{margin:0 0 9px;color:#38536d;font-size:14px;line-height:1.6}
.wi-life-entry button{min-height:36px}

.wi-optical-panel .wi-demo-question{padding:9px 12px;border-left:3px solid #9cbde3;background:#eef4fc}
.wi-demo-question strong{display:block;color:#315576;font-size:12px}
.wi-demo-controls{border:0;padding:0;margin:12px 0;display:flex;flex-wrap:wrap;gap:6px}
.wi-demo-controls legend{margin:0 0 5px;padding:0;font-size:13px;font-weight:650;color:#405675}
.wi-demo-controls button{min-height:34px;padding:5px 10px;font-size:13px}
.wi-demo-controls [aria-pressed="true"]{border-color:#326ca8;background:#e7f0fb;color:#234f83}
.wi-demo-run{display:flex;align-items:center;gap:12px;margin:12px 0}
.wi-demo-run small{color:#62758a}
.wi-demo-result{border-top:1px solid #dbe4ef;padding-top:10px;color:#3f5269}
.wi-demo-result strong{color:#335477}
.wi-demo-result p,.wi-demo-log li{margin:4px 0;font-size:13px;line-height:1.6}
.wi-demo-log{margin:8px 0}.wi-demo-log summary{cursor:pointer;color:#345b86;font-size:13px}
.wi-demo-log ul{padding-left:18px}
.wi-optical-fallback{display:flex;align-items:center;justify-content:center;gap:9px;height:52px;border-radius:7px;background:#e7eff8;color:#365473}
.wi-optical-fallback i{width:27px;border-top:2px dashed #648ab8}
.wi-optical-fallback b{width:22px;height:22px;border:1px dashed #7691a9;border-radius:50%}
.wi-optical-fallback .wi-optical-part{border:6px solid #768997}
@media(max-width:650px){
 .wi-world:has(.wi-optical-panel) .wi-objective,.wi-world:has(.wi-optical-panel) .wi-controls{display:none}
 .wi-world:has(.wi-optical-panel) #wi-panel{bottom:max(8px,env(safe-area-inset-bottom));max-height:50%}
 .wi-optical-panel{padding:12px 14px}.wi-optical-panel .wi-demo-controls{margin:8px 0}
}

.wi-world:has(.wi-optical-panel) .wi-objective{display:none}
