/* Hide the old SVG map and homepage chrome until the 3D hub is actually on screen. */
body.hub-booting>:not(#hub-boot){visibility:hidden!important}
#hub-boot{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;text-align:center;padding:24px;background:#f4f7ea;color:#355a50;font:600 18px/1.6 "Noto Sans TC",system-ui,sans-serif}
#hub-boot[hidden],body:not(.hub-booting) #hub-boot{display:none}

/* The island is the primary surface; a narrow dossier has its own reserved rail. */
body{margin:0}body>header{height:70px;box-sizing:border-box;position:relative;z-index:30}body>main{max-width:none;padding:0}.intro{display:none!important}.explorer{display:block!important;position:relative;height:calc(100svh - 70px);min-height:570px;padding:0!important;margin:0;gap:0}.explorer>.map{position:absolute!important;inset:0!important;width:auto!important;height:auto!important;min-height:0!important;border-radius:0;overflow:hidden}.explorer>#island-panel{position:absolute!important;top:78px;right:16px;bottom:auto!important;left:auto;width:min(268px,28vw)!important;max-width:min(268px,28vw)!important;height:auto;max-height:min(430px,calc(100% - 230px))!important;padding:16px 16px 14px!important;box-sizing:border-box;overflow-y:auto!important;display:block!important;align-self:auto;font-size:12px;z-index:5;border-radius:22px;background:linear-gradient(180deg,#fffdf8f4,#f4f7ebec);border:1px solid #fff;box-shadow:0 18px 42px #16343a28,0 0 0 1px #d5dfc8;backdrop-filter:blur(16px)}.explorer>#island-panel .single-objective{margin:18px 0!important;padding:15px!important}.explorer>#island-panel .active-case-title{font-size:27px}.explorer>#island-panel .active-case-subtitle{font-size:13px}.explorer>#island-panel .single-objective b{font-size:17px}.explorer>#island-panel .season-kicker,.explorer>#island-panel .case-number{font-size:10px}.explorer>#island-panel button{font-size:12px;padding:12px;min-height:42px}.explorer>#island-panel .season-save{font-size:10px}#map-art{grid-template-rows:minmax(0,1fr) auto auto;padding-bottom:8px;gap:4px}.campaign-banner{left:26px;top:105px;max-width:32%;pointer-events:none}.campaign-banner b{font-size:clamp(21px,2.6vw,36px)}.scene-tools{max-width:calc(100% - 28px);border-radius:25px!important}.scene-destinations{gap:5px!important;padding:0 8px!important;flex-wrap:nowrap!important;overflow-x:auto;justify-content:flex-start!important}.scene-destinations button{flex:0 0 auto;font-size:10px!important;white-space:nowrap}.stage-launchers{position:fixed;z-index:25;top:14px;left:18px;right:auto;display:flex;gap:5px}.stage-launchers button{border:1px solid #c8d1bb;background:#f9f8eb;color:#426757;border-radius:20px;padding:8px 11px;min-height:36px;font-size:11px}.mist-entry{display:none!important}#world-hud,#district,#world-feed,body>main>footer{display:none!important}.stage-page #world-hud,.stage-page #district,.stage-page #world-feed{display:block!important}.stage-page .explorer{display:none!important}.stage-page>main{max-width:1180px;margin:auto;padding:24px}.stage-page .stage-launchers{position:static;justify-content:center;flex-wrap:wrap;margin:20px}.stage-return{position:sticky;top:8px;z-index:25;background:#faf5df;border:1px solid #aebfa5;border-radius:20px;padding:12px 20px;color:#365e56}.stage-sidebar-fold{display:none}
@media(max-width:900px){body>header{height:112px;min-height:112px;padding:10px 16px!important;align-content:start}body>header nav{width:auto!important;order:initial!important;position:absolute!important;left:180px;right:12px;top:15px;display:flex!important;gap:4px}.nav{font-size:11px!important;padding:6px!important}.passport{display:none}.stage-launchers{top:68px;left:12px;right:auto;max-width:calc(100% - 24px);overflow-x:auto}.stage-launchers button{white-space:nowrap;font-size:11px;min-height:44px;padding:8px 12px}.explorer{height:calc(100svh - 112px);min-height:550px}.explorer>.map{right:0!important}.explorer>#island-panel{width:min(240px,46vw)!important;max-width:min(240px,46vw)!important;right:12px;top:72px;bottom:auto!important;max-height:min(380px,calc(100% - 210px))!important;padding:14px!important}.explorer>#island-panel .active-case-title{font-size:24px}.scene-clock{max-width:145px;font-size:10px;right:10px}.campaign-banner{max-width:38%;left:17px;top:96px}.scene-tools button,.scene-tools select{font-size:12px!important;padding:10px!important;min-height:44px}.scene-destinations button{font-size:12px!important;min-height:44px;padding:10px 12px}.stage-page>main{padding:14px}}
@media(max-width:620px){body>header{height:112px}.brand small{font-size:6px}.brand{font-size:16px}body>header nav{left:155px;top:15px}.nav{font-size:10px!important}.explorer{min-height:560px}.explorer>.map{right:0}.explorer>#island-panel{top:auto!important;bottom:max(10px,env(safe-area-inset-bottom,0px))!important;left:10px!important;right:10px!important;width:auto!important;max-width:none!important;max-height:min(52dvh,420px)!important;padding:14px!important;display:none!important;box-shadow:0 16px 40px #1d4f5440}.explorer.sidebar-open>#island-panel{display:block!important;z-index:45!important}.stage-sidebar-fold{display:block;position:absolute;z-index:35;right:10px;top:12px;min-width:48px;min-height:44px;background:#faf5df;border:1px solid #c4cdb0;border-radius:20px;padding:10px 12px;font-size:12px;color:#35594d}.scene-clock{left:auto!important;right:12px;top:9px;max-width:150px}.campaign-banner{top:82px;max-width:65%}.campaign-banner b{font-size:22px}.stage-launchers{gap:4px}.stage-launchers button{font-size:11px;padding:8px 12px;min-height:44px}.scene-tools{width:calc(100% - 12px)!important}.scene-destinations{max-height:none;flex-wrap:wrap!important}.scene-destinations button{flex:1 1 calc(50% - 8px)}.bapa-harbor{max-width:140px}}

body>header>nav:not(.stage-launchers){display:none!important}
body>header>nav.stage-launchers{display:flex!important}
.stage-launchers{bottom:auto!important;height:auto!important;min-height:0!important;align-items:center!important;background:transparent!important;padding:0!important}
.stage-launchers button{height:auto!important;align-self:center}

.stage-launchers{z-index:40!important}

html{height:100%;overflow-x:hidden;overflow-y:scroll;scrollbar-gutter:stable;scrollbar-width:auto;scrollbar-color:#6d9a84 #e4efe6}
html::-webkit-scrollbar{width:14px}
html::-webkit-scrollbar-track{background:#e4efe6}
html::-webkit-scrollbar-thumb{background:#6d9a84;border-radius:8px;border:3px solid #e4efe6}
body:not(.stage-page){height:auto;min-height:100%;overflow:visible}
body:not(.stage-page) .stage-launchers{
  position:fixed!important;
  top:17px!important;
  right:16px!important;
  left:auto!important;
  bottom:auto!important;
  transform:none;
  max-width:calc(100% - 230px);
  flex-wrap:wrap;
  justify-content:flex-end;
}
body:not(.stage-page) .campaign-banner{
  top:12px!important;
  left:16px!important;
  max-width:min(240px,26vw);
  gap:2px;
  z-index:3;
}
body:not(.stage-page) .campaign-banner b{font-size:clamp(16px,1.7vw,22px)!important}
/* Old weather chip sits in the same top-left slot as the season title. */
body:not(.stage-page) .map-head,
body:not(.stage-page) .weather{display:none!important}
/* Zoomed-in island name replaces the banner; never stack both. */
body:not(.stage-page) .map:has(#island-identity:not([hidden])) .campaign-banner{display:none!important}
body:not(.stage-page) #island-identity{top:12px!important;left:16px!important;z-index:3}
body:not(.stage-page) .scene-clock small{display:none!important}
body:not(.stage-page) .scene-clock{
  left:50%!important;
  right:auto!important;
  transform:translateX(-50%)!important;
  width:max-content;
  max-width:min(280px,36vw);
  white-space:nowrap;
  text-align:center;
}
body:not(.stage-page) .explorer>#island-panel{
  top:72px!important;
  right:10px!important;
  width:min(176px,16vw)!important;
  max-width:min(176px,16vw)!important;
  max-height:min(248px,calc(100% - 250px))!important;
  padding:9px 8px 8px!important;
  border-radius:16px;
  background:linear-gradient(180deg,#fffdf89e,#f4f7eb78);
  border:1px solid #ffffff99;
  box-shadow:0 8px 20px #16343a12;
  scrollbar-width:thin;
  scrollbar-color:#ffffff73 transparent;
}
body:not(.stage-page) .explorer>#island-panel::-webkit-scrollbar{width:5px;height:5px;background:transparent}
body:not(.stage-page) .explorer>#island-panel::-webkit-scrollbar-track{background:transparent}
body:not(.stage-page) .explorer>#island-panel::-webkit-scrollbar-thumb{background:#ffffff66;border-radius:99px;border:1px solid #8aa39433}
body:not(.stage-page) .explorer>#island-panel .active-case-title{font-size:17px!important;line-height:1.35!important;margin:4px 0!important}
body:not(.stage-page) .explorer>#island-panel .active-case-subtitle{font-size:11px!important;margin:4px 0 8px!important}
body:not(.stage-page) .explorer>#island-panel .single-objective{margin:8px 0!important;padding:8px!important}
body:not(.stage-page) .explorer>#island-panel .single-objective b{font-size:13px!important}
body:not(.stage-page) .explorer>#island-panel .case-number{margin:6px 0 2px!important}
body:not(.stage-page) .explorer>#island-panel button:not(.dossier-fold){font-size:11px!important;padding:7px!important;min-height:32px!important}

/* Hub: pull the sea up under a short header, and let the page scroll to the scene tools. */
body:not(.stage-page)>header{
  height:54px;
  min-height:0!important;
  padding:0 16px 0 18px!important;
  align-items:center;
  align-content:center;
}
body:not(.stage-page) .brand{font-size:18px;gap:8px}
body:not(.stage-page) .brand-icon{width:36px;height:36px;font-size:22px;border-radius:12px}
body:not(.stage-page) .brand small{font-size:7px;margin-top:1px}
body:not(.stage-page)>main{max-width:none!important;margin:0!important;padding:0!important}
body:not(.stage-page) .explorer{
  height:auto!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  overflow:visible!important;
}
body:not(.stage-page) .explorer>.map{
  position:relative!important;
  inset:auto!important;
  top:auto!important;
  right:auto!important;
  bottom:auto!important;
  left:auto!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  overflow:visible!important;
  border-radius:0!important;
}
body:not(.stage-page) #map-art{
  position:relative!important;
  inset:auto!important;
  overflow:visible!important;
  height:auto!important;
  min-height:0!important;
  display:grid!important;
  grid-template-rows:auto auto auto!important;
  padding:0 0 12px!important;
  gap:8px!important;
}
body:not(.stage-page) .scene-viewport{
  position:relative;
  height:calc(100svh - 54px);
  min-height:520px;
  overflow:hidden;
}
body:not(.stage-page) .scene-tools,
body:not(.stage-page) .scene-destinations{
  position:relative!important;
  inset:auto!important;
  left:auto!important;
  right:auto!important;
  top:auto!important;
  bottom:auto!important;
  transform:none!important;
  display:flex!important;
  z-index:6;
}
body:not(.stage-page) .scene-tools{
  width:min(980px,calc(100% - 20px))!important;
  max-width:none!important;
  margin:0 auto;
  flex-wrap:wrap;
  justify-content:center;
  background:#fffcefe6;
}
body:not(.stage-page) .scene-destinations{
  flex-wrap:wrap!important;
  overflow:visible!important;
  max-height:none!important;
  justify-content:center!important;
  margin:0 8px 18px;
  padding:0 8px 4px!important;
}
body:not(.stage-page) .bapa-harbor{width:52px!important;max-width:52px!important}
body:not(.stage-page)>header{position:sticky;top:0;z-index:50;background:#fffef7}
body:not(.stage-page) .stage-launchers{
  position:absolute!important;
  top:50%!important;
  right:16px!important;
  left:auto!important;
  bottom:auto!important;
  transform:translateY(-50%)!important;
}
body:not(.stage-page) .stage-launchers button{min-height:34px;padding:6px 14px}
body:not(.stage-page) .stage-launchers button span{margin-left:6px;opacity:.72;font-weight:700}
/* Same action as 案件選擇; keep only one control in the hub header. */
body:not(.stage-page) #passport,
body:not(.stage-page) .passport.is-hub-hidden{display:none!important}
body:not(.stage-page) .explorer>#island-panel,
body:not(.stage-page) #island-panel{
  position:fixed!important;
  top:64px!important;
  right:12px!important;
  left:auto!important;
  z-index:40!important;
  width:min(188px,18vw)!important;
  max-width:min(200px,20vw)!important;
  height:auto;
  max-height:min(70vh,560px)!important;
  overflow:auto!important;
  padding:8px 9px 12px!important;
  border-radius:14px!important;
  background:#fffdf8f6!important;
  color:#24382f!important;
  resize:none;
  box-shadow:0 10px 24px #16343a18!important;
}
body:not(.stage-page) .explorer>#island-panel.is-user-sized,
body:not(.stage-page) #island-panel.is-user-sized{
  position:fixed!important;
  max-width:none!important;
  max-height:none!important;
}
body:not(.stage-page) #island-panel :where(h2,h3,p,small,span,b,div,button.text-button){color:#24382f!important}
body:not(.stage-page) #island-panel .primary,
body:not(.stage-page) #island-panel .primary *{color:#fffaf0!important}
body:not(.stage-page) .scene-is-night #island-panel,
body.scene-is-night #island-panel :where(h2,h3,p,small,span,b,div){color:#24382f!important}
body:not(.stage-page) .explorer>#island-panel .season-kicker{font-size:7px!important;margin:0!important;letter-spacing:.08em}
body:not(.stage-page) .explorer>#island-panel .case-number{margin:4px 0 2px!important;font-size:10px!important}
body:not(.stage-page) .explorer>#island-panel .active-case-title{font-size:15px!important;line-height:1.3!important;margin:2px 0!important}
body:not(.stage-page) .explorer>#island-panel .active-case-subtitle{font-size:10px!important;line-height:1.45!important;margin:2px 0 6px!important}
body:not(.stage-page) .explorer>#island-panel .single-objective{margin:6px 0!important;padding:7px 8px!important;border-radius:10px}
body:not(.stage-page) .explorer>#island-panel .single-objective small{font-size:7px!important}
body:not(.stage-page) .explorer>#island-panel .single-objective b{font-size:12px!important;line-height:1.4!important}
body:not(.stage-page) .explorer>#island-panel .single-objective p{font-size:10px!important;line-height:1.45!important;margin:4px 0 0!important}
body:not(.stage-page) .explorer>#island-panel button.primary{font-size:11px!important;padding:8px 10px!important;min-height:34px!important;border-radius:999px}
body:not(.stage-page) .explorer>#island-panel .season-hint-link{font-size:10px!important;margin:6px 0 2px!important}
body:not(.stage-page) .explorer>#island-panel .season-save{font-size:8px!important;display:block;margin-top:4px}
.dossier-bar{display:flex;align-items:center;gap:6px;margin:0 0 6px;cursor:grab;user-select:none;touch-action:none;min-height:28px}
.dossier-bar b{font-size:10px;letter-spacing:.12em;color:#5d735f!important}
.dossier-hint{margin-right:auto;font-size:8px;color:#8a9a84!important;letter-spacing:.02em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dossier-fold{
  box-sizing:border-box;
  width:24px;
  height:24px;
  min-width:24px;
  min-height:24px;
  max-width:24px;
  max-height:24px;
  padding:0;
  margin:0;
  border:1px solid #c9d4bc;
  border-radius:50%;
  background:#fff;
  color:#35594d;
  font:800 14px/24px "Noto Sans TC",system-ui,sans-serif;
  flex:0 0 24px;
  aspect-ratio:1/1;
  display:inline-grid;
  place-items:center;
  cursor:pointer;
  user-select:none;
}
.dossier-fold:focus-visible{outline:3px solid #db983d;outline-offset:2px}
.dossier-resize{
  position:absolute;right:2px;bottom:2px;width:18px;height:18px;cursor:ns-resize;touch-action:none;
  border-right:3px solid #7d9a86;border-bottom:3px solid #7d9a86;border-radius:0 0 8px 0;opacity:.85;z-index:2;
}
.dossier-resize-x{
  position:absolute;top:28px;left:0;bottom:22px;width:14px;cursor:ew-resize;touch-action:none;z-index:2;
}
.dossier-resize-x:after{
  content:'';position:absolute;top:50%;left:3px;width:3px;height:28px;margin-top:-14px;border-radius:2px;background:#7d9a8666;
}
#island-panel.is-collapsed,
body:not(.stage-page) .explorer>#island-panel.is-collapsed,
body:not(.stage-page) .explorer>#island-panel.is-user-sized.is-collapsed,
body:not(.stage-page) #island-panel.is-collapsed{
  position:fixed!important;
  height:fit-content!important;
  min-height:0!important;
  max-height:52px!important;
  overflow:hidden!important;
  padding:8px 10px!important;
}
#island-panel.is-collapsed>:not(.dossier-bar){display:none!important}
#island-panel.is-collapsed .dossier-hint,
#island-panel.is-collapsed .dossier-resize,
#island-panel.is-collapsed .dossier-resize-x{display:none!important}
#island-panel.is-collapsed .dossier-bar{margin:0}
#enter-island{display:none!important}
body:not(.stage-page) #district.island-open{display:block!important;position:relative;z-index:2;max-width:1100px;margin:0 auto;padding:28px 22px 72px;background:#f6f3ea;color:#35594d}.process-observation{scroll-margin-top:76px}

/* Phone/tablet only: keep desktop dossier rail intact above these widths. */
@media(max-width:900px){
  body:not(.stage-page) .explorer>#island-panel:not(.is-user-sized){
    width:min(200px,34vw)!important;
    max-width:min(210px,36vw)!important;
    top:70px!important;
  }
  body:not(.stage-page) .stage-launchers{max-width:calc(100% - 160px);flex-wrap:wrap}
  body:not(.stage-page) .scene-viewport{height:clamp(420px,68svh,720px);min-height:380px}
}
@media(max-width:620px){
  body:not(.stage-page) .explorer>#island-panel,
  body:not(.stage-page) #island-panel{
    display:none!important;
    top:auto!important;
    bottom:max(10px,env(safe-area-inset-bottom,0px))!important;
    left:10px!important;
    right:10px!important;
    width:auto!important;
    max-width:none!important;
    max-height:min(52dvh,420px)!important;
  }
  body:not(.stage-page) .explorer.sidebar-open>#island-panel,
  body:not(.stage-page).sidebar-open #island-panel{display:block!important;position:fixed!important;z-index:45!important}
  body:not(.stage-page) .campaign-banner{max-width:min(160px,48vw)!important;top:10px!important}
  body:not(.stage-page) .scene-clock{
    left:auto!important;
    right:12px!important;
    transform:none!important;
    max-width:min(180px,46vw);
  }
}
