/* Keep the app's navy panels, actual controls, logo and typography. */
html,body{height:100%;overflow:hidden}
.demo-layout{height:100%;display:grid;grid-template-rows:minmax(0,1fr) auto}
.app-stage{position:relative;min-width:0;min-height:0;overflow:auto;contain:layout paint;scrollbar-color:#345571 #07111e;scrollbar-width:thin}
.app-stage:has(#lockScreen:not([hidden])){overflow:hidden}
.tour{position:relative;z-index:500;border-top:1px solid #345571;background:linear-gradient(160deg,#102337,#0b1929);padding:14px 20px 10px;box-shadow:0 -12px 35px #0003;overflow:auto;min-height:0}
.tour-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px;color:var(--accent);font-size:11px}
.tour-eyebrow{font-size:10px;font-weight:700;letter-spacing:1.5px}
#tour-toggle{font-size:10px;padding:4px 7px;margin-left:auto;background:transparent;border:1px solid #345571;color:#a9c8df;white-space:nowrap}
#tour-count{white-space:nowrap}
.tour.is-compact #tour-copy,.tour.is-compact .tour-note{display:none}
.tour.is-compact #tour-chapter{margin-bottom:0}
.tour.is-compact .tour-controls{margin-top:7px;padding-top:0}
#tour-chapter{width:100%;min-width:0;padding:7px 10px;font-size:12px;margin-bottom:9px}
#tour-copy h2{font-size:17px;margin-bottom:5px}
#tour-copy p{font-size:12px;line-height:1.5;color:#adc4d7}
.tour-controls{display:flex;justify-content:space-between;gap:10px;margin-top:12px}
.tour-controls button{font-size:12px;padding:8px 13px}
.tour-note{font-size:10px;margin-top:7px;color:#7994ad}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.app-stage .brandline{flex-wrap:wrap;gap:12px}
.app-stage .headerright{flex-wrap:wrap;gap:7px}
.headerright button,.headerright select{font-size:12px;padding:8px 11px;min-width:0}
.app-stage nav{gap:20px;overflow-x:auto;scrollbar-width:thin;white-space:nowrap}
.app-stage .tab{flex:none}
.app-stage .controls,.app-stage .section-actions{flex-wrap:wrap}
.app-stage .searchbox{min-width:160px}
.app-stage .sectiontitle{gap:12px;flex-wrap:wrap}
.app-stage .tablewrap{overflow-x:auto}
.app-stage #lockScreen{padding:16px;background:rgba(2,7,16,.96)}
.lockcard{width:min(480px,100%);padding:24px;box-shadow:0 20px 50px #0008}
.lockcard .brand{margin-bottom:12px}
.lockcard p{font-size:12px}
.lockcard .note{font-size:10px;margin-top:12px}
.lockcard .controls{margin-top:15px}
.lockcard .searchbox{min-width:0}
#lockToken{font-size:12px;letter-spacing:.3px}
#lockActivate,#lockRenew{font-size:13px;padding:10px}
dialog[open]{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);margin:0;width:calc(100% - 32px);max-width:960px;max-height:calc(100% - 24px);overflow:auto;z-index:300;padding:22px;box-shadow:0 20px 80px #000c}
#app-stage:has(dialog[open])>header,#app-stage:has(dialog[open])>main{filter:blur(3px);pointer-events:none;opacity:.4}
dialog .dialoghead{margin-bottom:14px;gap:12px}
dialog .dialoghead p,dialog>p{font-size:12px}
dialog .pickscroll{max-height:220px}
dialog .dialogfoot{flex-wrap:wrap;padding-top:14px}
.windows-options{gap:8px;margin:14px 0}
.windows-options label{padding:10px}
.windows-options small{font-size:11px}
#toast{position:fixed;bottom:12px;right:12px;max-width:calc(100% - 24px);font-size:12px;padding:12px 16px}
#operation{position:fixed;bottom:12px;min-width:0;max-width:calc(100% - 24px);z-index:400}
.demo-highlight{outline:2px solid var(--accent);outline-offset:3px}
body[data-locked=""] .rowactions .primary,body[data-locked=""] #reapply{opacity:1}
@media(max-width:899px){
  .app-stage .module-nav{flex-wrap:nowrap;overflow-x:auto;white-space:nowrap;scrollbar-width:thin;scroll-snap-type:x proximity}
  .app-stage .module-tab{flex:0 0 auto;scroll-snap-align:start}
  .app-stage .map-nav{gap:16px;scroll-snap-type:x proximity}
  .app-stage .map-nav .tab{scroll-snap-align:start}
}
@media(max-width:620px){
  .wrap{padding:0 16px}
  .brandline{padding:15px 0}
  .intro{padding:20px 0 12px}
  .intro h1{font-size:23px}
  .intro p{font-size:12px}
  .headerright{width:100%}
  nav .tab{font-size:12px;padding:12px 0}
  .sectiontitle{padding:20px 0 14px}
  .sectiontitle h2{font-size:19px}
  .sectiontitle p{font-size:12px}
  .section-actions button{font-size:11px;padding:8px 10px}
  .controls>select{min-width:0;width:100%;font-size:12px}
  #gamebar{padding:12px 0}
  .status{flex-wrap:wrap;gap:8px}
  #catalogView table,#arenasView table{table-layout:fixed}
  #catalogView thead,#arenasView thead{display:none}
  #mapRows tr,#arenaRows tr{display:grid;grid-template-columns:112px minmax(0,1fr);padding:12px;gap:10px;border-bottom:1px solid var(--line)}
  #mapRows td,#arenaRows td{padding:0;border:0;min-width:0}
  #mapRows .num,#arenaRows .num{display:none}
  #mapRows .photoBox,#arenaRows .photoBox{width:112px;height:72px}
  #mapRows td:last-child,#arenaRows td:last-child{grid-column:1/-1}
  #mapRows .rowactions{flex-direction:row;flex-wrap:wrap}
  #mapRows .rowactions button{flex:1;padding:8px 10px}
  #mapRows .downloaded{align-self:center}
  #mapRows .name,#arenaRows .name{font-size:14px}
  #mapRows .description{font-size:11px}
  #mapRows .author{margin-bottom:5px}
  .vote-buttons{margin-top:7px}
  .pickscroll th:first-child{width:92px}
  .pickscroll th:last-child{width:75px}
  .pickscroll th:nth-child(3),.pickscroll td:nth-child(3){display:none}
  .pickscroll th,.pickscroll td{padding:8px}
  .pickscroll .photoBox{width:74px;height:48px}
  .saved-comparison{padding:16px}
  .saved-transition{gap:12px}
  .saved-map{width:calc(50% - 22px)}
  .saved-map strong{font-size:12px}
  .saved-arrow{font-size:20px}
  .room-head{flex-wrap:wrap}
  .room-map select{min-width:0;width:100%}
  #peerRows .action{width:100px}
  #networkView th,#networkView td{padding:8px}
  footer{flex-direction:column;gap:5px;font-size:10px}
  .tour{padding:12px 16px 9px}
  #tour-copy p{font-size:11px}
  #tour-copy h2{font-size:16px}
}
@media(min-width:900px){
  .demo-layout{grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr) 280px}
  .tour{border-top:0;border-left:1px solid #345571;padding:28px 22px;display:flex;flex-direction:column}
  .tour-top{margin-bottom:16px}
  #tour-chapter{margin-bottom:26px}
  #tour-copy h2{font-size:23px;line-height:1.25;margin-bottom:14px}
  #tour-copy p{font-size:14px;line-height:1.7}
  .tour-controls{margin-top:auto;padding-top:28px}
  .tour-note{margin-top:14px}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
