#researchScreen{position:fixed;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;background:#283843;color:#344b59}#researchScreen[hidden]{display:none!important}#researchCanvas{display:block;width:min(100%,calc(100dvh * 1.777));height:auto;touch-action:none}.research-top{position:absolute;top:12px;left:16px;right:16px;display:flex;justify-content:space-between;align-items:start;background:none;border:0;box-shadow:none;padding:0;pointer-events:none}.research-top>div,.research-top>button,.research-dock{background:#edf8e9ee;border:2px solid #81bcb2;border-radius:14px;padding:9px 16px;box-shadow:0 3px #233a4940}.research-top strong,.research-top small{display:block}.research-top button{pointer-events:auto;min-height:44px}.research-dock{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);display:flex;gap:12px;align-items:center;width:max-content;max-width:95%;font-size:13px}.research-dock button{margin:0;min-height:44px}.robot-research{color:#324753}.robot-research header{background:#d2eee4;padding:16px;border:2px solid #91bdb5;border-radius:16px}.robot-summary{display:flex;flex-wrap:wrap;gap:8px}.robot-summary span{background:#f9f4e4;border:1px solid #a2c2ba;border-radius:9px;padding:8px}.robot-upgrades{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.robot-upgrades article{background:#e0eee8;border:2px solid #92bab3;border-radius:14px;padding:14px}.robot-upgrades article h3{margin:0 0 8px}.robot-upgrades article small{display:block;min-height:32px}.robot-upgrades button{width:100%;background:#f4c8d9}.robot-upgrades progress{width:100%;accent-color:#4b9e98}.robot-research .research-note{font-size:12px}@media(max-width:650px){.robot-upgrades{grid-template-columns:1fr}.research-dock{gap:5px;padding:6px;font-size:11px}.research-dock span{max-width:140px}.research-dock button{padding:6px;font-size:11px}.research-top{top:6px}.research-top>div{padding:6px}.research-top small{display:none}}

.research-icon{width:68px;height:68px;object-fit:contain;float:right;margin:0 0 10px 8px}.robot-upgrades article{min-height:215px}.robot-upgrades progress{clear:both}

.research-tabs{display:flex;gap:6px;margin:14px 0}.research-tabs button{flex:1;padding:10px 5px;min-height:46px}.research-tabs button[aria-pressed="true"]{background:#b9ded2;outline:2px solid #548b87;outline-offset:1px}.robot-summary{margin-top:12px}

/* Research surfaces follow the approved mint/ivory/navy robot; scope overrides to this room. */
@layer global-ui {
 html body #modal:has(.robot-research){width:min(920px,calc(100vw - 20px))!important;max-height:calc(100dvh - 20px)!important;padding:0!important;border:2px solid #7bb7ac!important;background:#ecf2e6!important;border-radius:18px!important;overflow-x:hidden!important;box-shadow:0 12px 45px #12273477!important}
 html body #modal:has(.robot-research) #modalContent{padding:0!important;background:none!important}
 html body #modal .robot-research{padding:20px!important;background:#edf3e8!important;color:#344452!important}
 html body #modal .robot-research :is(p,small,strong,b,span,h2,h3,button){color:#344452!important}
 html body #modal .robot-research>header{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;height:auto!important;min-height:0!important;padding:16px 38px 16px 18px!important;margin:0 0 12px!important;background:#c7e2d7!important;border:1px solid #72a99f!important;border-radius:12px!important;box-shadow:inset 0 -4px #a9ccc1!important}
 html body #modal .robot-research header h2{margin:4px 0!important;padding:0!important;font-size:25px!important;line-height:1.3!important;background:none!important;border:0!important;box-shadow:none!important}
 html body #modal .robot-research header p{font-size:12px!important;margin:4px 0!important}
 html body #modal .robot-research header small{font-size:11px!important;display:block!important}
 html body #modal .research-wallet{background:#f9f4df!important;padding:10px 14px!important;border:1px solid #a3b8a1!important;border-radius:10px!important;flex-shrink:0!important;text-align:right!important}
 html body #modal .research-wallet strong{display:block!important;font-size:21px!important;letter-spacing:.02em!important}
 html body #modal .robot-summary{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:8px!important;margin:0 0 14px!important}
 html body #modal .robot-summary>span{padding:8px 10px!important;background:#f9f8ee!important;border:1px solid #c2d3c9!important;border-radius:8px!important;min-width:0!important}
 html body #modal .robot-summary small{display:block!important;font-size:11px!important;line-height:1.3!important}
 html body #modal .robot-summary b{display:block!important;font-size:19px!important;margin-top:3px!important}
 html body #modal .research-tabs{position:sticky!important;top:0!important;z-index:3!important;gap:6px!important;margin:0 -2px 10px!important;padding:8px 2px!important;background:#edf3e8!important}
 html body #modal .research-tabs button{margin:0!important;border:1px solid #819c9a!important;background:#dae5df!important;min-height:48px!important;border-radius:9px!important;box-shadow:none!important;font-size:14px!important}
 html body #modal .research-tabs button[aria-pressed=true]{background:#344c59!important;color:#f5f4df!important;outline:0!important;border-bottom:4px solid #e8a7c5!important}
 html body #modal .research-group-hint{font-size:12px!important;margin:0 0 12px!important}
 html body #modal .robot-upgrades{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important}
 html body #modal .robot-upgrades article{display:flex!important;flex-direction:column!important;min-height:0!important;min-width:0!important;padding:14px!important;background:#fffdf1!important;border:1px solid #aac4ba!important;border-radius:13px!important;box-shadow:0 3px #c3d5cd!important}
 html body #modal .research-card-title{display:flex!important;align-items:center!important;gap:10px!important;min-height:56px!important}
 html body #modal .research-icon{float:none!important;flex:0 0 56px!important;width:56px!important;height:56px!important;margin:0!important;object-fit:contain!important}
 html body #modal .research-cannon-mark{display:grid!important;place-items:center!important;background:#344c59!important;color:#e1ece4!important;border:3px solid #91c8bc!important;border-radius:12px!important;font-size:16px!important;box-shadow:inset 0 -6px #d297b9!important}
 html body #modal .research-card-title h3{font-size:16px!important;line-height:1.35!important;margin:0 0 4px!important}
 html body #modal .research-level{display:inline-block!important;padding:2px 7px!important;border-radius:5px!important;background:#dcece3!important;font-size:11px!important}
 html body #modal .robot-upgrades progress{height:6px!important;margin:10px 0 0!important;border:0!important;border-radius:5px!important;overflow:hidden!important;accent-color:#568f83!important}
 html body #modal .robot-upgrades progress::-webkit-progress-bar{background:#dfe8df!important}
 html body #modal .robot-upgrades progress::-webkit-progress-value{background:#568f83!important}
 html body #modal .research-card-hint{font-size:12px!important;line-height:1.6!important;margin:10px 0!important;min-height:38px!important}
 html body #modal .research-compare{display:grid!important;grid-template-columns:minmax(0,1fr) 26px minmax(0,1fr)!important;gap:4px!important;background:#e6eee8!important;padding:10px!important;border-radius:9px!important;margin-top:auto!important;min-height:80px!important;align-items:center!important}
 html body #modal .research-metric{grid-column:1/-1!important;font-size:11px!important;line-height:1.3!important;margin-bottom:3px!important}
 html body #modal .research-compare>div{text-align:center!important;min-width:0!important}
 html body #modal .research-compare small{font-size:10px!important;min-height:0!important;display:block!important;margin-bottom:3px!important}
 html body #modal .research-compare strong{display:block!important;font-size:21px!important;line-height:1.2!important;white-space:normal!important;overflow-wrap:anywhere!important}
 html body #modal .research-next{padding:5px!important;background:#c3e5d7!important;border-radius:7px!important}
 html body #modal .research-arrow{text-align:center!important;font-size:21px!important}
 html body #modal .research-max{grid-column:2/4!important;justify-self:center!important;font-size:13px!important}
 html body #modal .research-cost{display:flex!important;justify-content:space-between!important;align-items:center!important;gap:6px!important;min-height:36px!important;font-size:11px!important;padding:7px 1px!important}
 html body #modal .research-cost strong{font-size:16px!important}
 html body #modal .robot-upgrades button{min-height:46px!important;margin:0!important;padding:9px 8px!important;font-size:13px!important;background:#ecc5d5!important;border:1px solid #ad849e!important;border-radius:8px!important;box-shadow:0 3px #94758c!important}
 html body #modal .robot-upgrades button:disabled{opacity:1!important;background:#e3e8e2!important;color:#657469!important;border-color:#b8c6ba!important;box-shadow:none!important}
 html body #modal .is-locked .research-compare{opacity:.7!important}
 html body #modal .research-footer{position:sticky!important;bottom:0!important;z-index:4!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;background:#edf3e8f5!important;border-top:1px solid #b0cbbf!important;margin:20px -20px -20px!important;padding:10px 20px!important;box-shadow:0 -5px 12px #edf3e8a0!important}
 html body #modal .research-footer p{margin:2px 0!important;font-size:11px!important;line-height:1.5!important}
 html body #modal .research-status{min-height:17px!important;color:#32745a!important}
 html body #modal #researchDone{flex-shrink:0!important;width:auto!important;min-height:46px!important;margin:0!important;padding:10px 16px!important;background:#bcded0!important;border:1px solid #8bb4a5!important;border-radius:9px!important;font-size:13px!important}
 html body #researchScreen .research-top>div,html body #researchScreen .research-top>button,html body #researchScreen .research-dock{background:#edf5e8f0!important;border-color:#83b9ac!important}
 @media(max-width:620px){
  html body #modal .robot-research{padding:12px!important}
  html body #modal .robot-research>header{display:block!important;padding:12px 34px 12px 12px!important}
  html body #modal .robot-research header h2{font-size:22px!important}
  html body #modal .robot-research header p{display:none!important}
  html body #modal .research-wallet{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;margin-top:9px!important;padding:7px 9px!important}
  html body #modal .research-wallet strong{font-size:19px!important}
  html body #modal .robot-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;margin-bottom:8px!important}
  html body #modal .robot-summary>span{padding:6px 8px!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:4px!important}
  html body #modal .robot-summary small{font-size:10px!important}
  html body #modal .robot-summary b{font-size:16px!important;margin:0!important}
  html body #modal .research-tabs button{font-size:12px!important;padding:8px 4px!important;min-height:46px!important}
  html body #modal .robot-upgrades{grid-template-columns:1fr!important}
  html body #modal .research-card-hint{min-height:0!important}
  html body #modal .research-footer{bottom:0!important;margin:16px -12px -12px!important;padding:8px 12px!important;gap:7px!important}
  html body #modal .research-footer>div{flex:1!important;min-width:0!important}
  html body #modal .research-footer p{font-size:10px!important}
  html body #modal #researchDone{font-size:12px!important;padding:8px 10px!important;min-height:46px!important}
 }
 @media(max-height:480px){
  html body #modal .robot-research>header{padding:8px 38px 8px 12px!important}
  html body #modal .robot-research header p{display:none!important}
  html body #modal .robot-summary{display:none!important}
  html body #modal .research-footer{padding-top:6px!important;padding-bottom:6px!important}
 }
}


/* Room-coordinate controls scale with the contained canvas, not screen pixels. */
.research-scene-overlay{position:absolute;width:min(100%,calc(100dvh * 1.777));aspect-ratio:1100/619;pointer-events:none}
#researchLeave{position:absolute;left:82%;top:86%;transform:translate(-50%,-50%);pointer-events:auto;min-height:44px;min-width:106px;margin:0;padding:8px 14px;border:2px solid #81bcb2;border-radius:14px;background:#edf8e9ee;box-shadow:0 3px #233a4940}
@media(max-height:480px){#researchLeave{left:89%;top:85%;font-size:12px;padding:6px 10px}.research-dock{gap:6px;padding:6px 10px}.research-dock #researchHint{display:none}}
