/* Local map keeps its existing contents and sticky toolbar. */
#map-atlas-info { display:contents; }
#map-back[hidden] { display:none; }
html body.pack-ui #map-panel #map-back { min-width:44px; min-height:44px; font-size:26px; line-height:1; }
@media (min-height:501px), (orientation:portrait) { html body.pack-ui #map-panel > .map-tools { position:sticky; top:60px; z-index:2; background:var(--ui-panel-bg); } }
.atlas-board { position:relative; width:100%; overflow:hidden; border-radius:16px; }
.atlas-board > svg { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.atlas-world { aspect-ratio:400 / 340; width:min(100%,calc(100cqh*1.17647)); margin:0 auto; }
/* Beat legacy #world-map .current and line rules only inside the atlas. */
html body.pack-ui #map-panel.atlas-mode #world-map .atlas-island { position:absolute; transform:translate(-50%,-50%); width:29%; height:28%; min-width:44px; min-height:44px; padding:0; border:0; border-image:none; background:none; box-shadow:none; color:var(--ui-panel-fg); overflow:visible; }
html body.pack-ui #map-panel.atlas-mode #world-map .atlas-world > svg line[data-from] { stroke:var(--atlas-route); stroke-width:2.8; stroke-dasharray:7 4; opacity:1; }
.atlas-island > svg { width:100%; height:100%; pointer-events:none; }
.atlas-island-name { position:absolute; bottom:0; left:50%; transform:translateX(-50%); width:max-content; max-width:112%; box-sizing:border-box; border-radius:4px; padding:2px 5px; background:var(--ui-panel-bg); color:var(--ui-panel-fg); font-size:max(12px,calc(var(--readable-font-size,15px)*.8)); font-weight:700; line-height:1.4; white-space:normal; }
.atlas-island-mark { position:absolute; top:4px; left:50%; transform:translateX(-50%); display:grid; place-items:center; width:22px; height:22px; box-sizing:border-box; padding:0; border:1px solid var(--ui-panel-line); border-radius:50%; background:var(--ui-panel-bg); color:var(--ui-panel-fg); font-size:12px; line-height:1; }
.atlas-island[data-continent="beyond"] .atlas-island-mark { top:max(0px,calc(8px - 9.45378%)); }
.atlas-island-mark:empty { display:none; }
.atlas-island.level-locked > svg { opacity:.78; }
.atlas-coast-focus { opacity:0; }
.atlas-island:is(.current,:focus-visible) .atlas-coast-focus { opacity:1; }
.atlas-island.current .atlas-island-mark { color:var(--ui-panel-acc); border:2px solid var(--atlas-selected); }
html body.pack-ui #map-panel .atlas-region { position:absolute; transform:translate(-50%,-50%); display:flex; align-items:center; justify-content:center; width:44px; height:44px; min-width:44px; min-height:44px; padding:0; border:0; border-image:none; background:none; box-shadow:none; overflow:visible; }
.atlas-dot { display:grid; place-items:center; width:30px; height:30px; border:2px solid var(--atlas-label-fg); border-radius:50%; background:var(--atlas-node); color:var(--atlas-number); font-weight:800; font-size:12px; box-sizing:border-box; }
.atlas-region:not(.visited):not(.current) .atlas-dot { border-style:dashed; }
.atlas-region.safe .atlas-dot { background:var(--ui-panel-bg); color:var(--ui-panel-fg); font-size:19px; }
.atlas-region.boss .atlas-dot { border:3px solid var(--atlas-boss); }
.atlas-region.current .atlas-dot { box-shadow:0 0 0 4px var(--atlas-selected); }
.atlas-region.selected .atlas-dot { outline:2px solid var(--atlas-label-fg); outline-offset:5px; }
.atlas-region.warp-ready .atlas-region-name { text-decoration:underline; }
.atlas-region-name { position:absolute; top:48px; left:50%; transform:translateX(-50%); width:max-content; max-width:86px; box-sizing:border-box; padding:2px 4px; border-radius:4px; background:var(--atlas-label-bg); color:var(--atlas-label-fg); font-size:max(12px,calc(var(--readable-font-size,15px)*.8)); font-weight:700; line-height:1.4; text-wrap:balance; pointer-events:none; }
.atlas-region.label-above .atlas-region-name { top:auto; bottom:48px; }
.atlas-count { position:absolute; bottom:0; right:calc(50% + 8px); padding:1px 5px; border-radius:10px; background:var(--ui-panel-bg); color:var(--ui-panel-fg); font-size:11px; }
.atlas-count:empty, .atlas-pin:empty { display:none; }
.atlas-pin { position:absolute; top:0; left:calc(50% + 8px); min-width:18px; height:18px; line-height:18px; font-size:12px; text-align:center; border-radius:4px; background:var(--atlas-label-bg); color:var(--atlas-label-fg); font-weight:800; }
.atlas-exits { position:absolute; bottom:4px; left:6px; right:6px; display:flex; justify-content:space-between; gap:6px; flex-wrap:wrap; }
html body.pack-ui #map-panel .atlas-exit { min-height:44px; font-size:11px; padding:4px 8px; }
.atlas-directory { display:grid; gap:8px; margin-top:12px; }
html body.pack-ui #map-panel .atlas-continent-row { display:flex; align-items:center; gap:8px; width:100%; min-height:64px; text-align:left; padding:10px; flex-wrap:wrap; }
.atlas-continent-row > small { flex-basis:100%; margin-left:20px; color:var(--ui-panel-muted); word-break:keep-all; overflow-wrap:normal; }
.atlas-color-dot { display:block; flex:none; width:12px; height:12px; border-radius:50%; }
html body.pack-ui #map-panel .atlas-recommend, html body.pack-ui #map-panel .atlas-next { display:block; width:100%; min-height:44px; margin-bottom:8px; padding:10px; text-align:left; white-space:normal; overflow-wrap:anywhere; }
.atlas-detail-title { margin:0 0 6px; font-size:18px; }
.atlas-detail-subtitle { color:var(--ui-panel-muted); margin:0 0 14px; line-height:1.6; }
.atlas-detail-row { display:grid; grid-template-columns:110px minmax(0,1fr); gap:8px; padding:9px 0; border-top:1px solid var(--ui-panel-line); line-height:1.65; }
.atlas-neighbors { display:flex; flex-wrap:wrap; gap:6px; padding-bottom:8px; }
html body.pack-ui #map-panel .atlas-neighbor { min-height:44px; padding:6px 9px; font-size:12px; white-space:normal; }
html body.pack-ui #map-panel .atlas-neighbor.cross-continent { border-left-width:4px; }
.atlas-people-body { display:grid; gap:4px; }
.atlas-known-names { color:var(--ui-panel-muted); }
.atlas-quest-hint { color:var(--ui-panel-muted); line-height:1.65; }
html body.pack-ui #map-panel :is(.atlas-island,.atlas-region):focus-visible { outline:3px solid var(--atlas-selected); outline-offset:3px; }
/* A372: original relief and labels, with no layout changes to the atlas. */
.atlas-board{box-shadow:inset 0 0 0 2px var(--atlas-selected),inset 0 0 22px color-mix(in srgb,var(--atlas-route) 25%,transparent)}
.atlas-island-name,.atlas-region-name{background:color-mix(in srgb,var(--ui-panel-bg) 94%,var(--atlas-selected))!important;color:var(--ui-panel-fg)!important;border:1px solid color-mix(in srgb,var(--atlas-selected) 60%,var(--ui-panel-bg));border-radius:3px;box-shadow:0 2px 0 color-mix(in srgb,var(--atlas-route) 19%,transparent)}
.atlas-island>svg [data-terrain]{filter:drop-shadow(0px 1px 1px color-mix(in srgb,var(--atlas-route) 40%,transparent))}
.atlas-continent>svg [data-terrain]{filter:drop-shadow(0px 2px 1px color-mix(in srgb,var(--atlas-route) 33%,transparent))}

/* A439 · F374 B: one selected place, large board; local-map rules above stay intact. */
.atlas-compass { display:none; }
.atlas-info-body { display:contents; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode.atlas-mode {
 display:grid; overflow:hidden; box-sizing:border-box;
 inset:20px; margin:0; width:calc(100vw - 40px); height:calc(100dvh - 40px); max-height:none; max-width:none; transform:none;
 grid-template-columns:44px minmax(0,1fr) 44px auto; grid-template-rows:44px 46px minmax(0,1fr); gap:8px; padding:12px; border-radius:16px;
}
#map-panel.atlas-mode[hidden] { display:none!important; }
#map-panel.atlas-mode :is(.world-map-hint,.world-map-legend,#map-zoom-out,#map-zoom-in,#map-fit,#map-center) { display:none; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode > .panel-heading,
html body.pack-ui #map-panel.atlas-mode.atlas-mode .map-mode-tabs,html body.pack-ui #map-panel.atlas-mode.atlas-mode .map-zoom-tools { display:contents; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode > .map-tools { display:grid; grid-area:2/1/3/5; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; position:static; inset:auto; margin:0; padding:0; max-width:none; align-self:stretch; justify-self:stretch; align-items:stretch; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode > .map-tools::before { display:none; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-back { grid-area:1/1; width:44px; padding:0; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-back[hidden] { display:block; visibility:hidden; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-title { grid-area:1/2; align-self:center; min-width:0; max-width:none; padding:0; font-size:22px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-title::after { display:none; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-compass { display:block; grid-area:1/3; width:44px; height:44px; position:relative; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-compass::after { content:"✥"; display:grid; place-items:center; width:30px; height:30px; margin:7px; border:1px solid var(--ui-panel-line); border-radius:50%; background:var(--ui-panel-soft); color:var(--ui-panel-on-danger); font-size:26px; line-height:1; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-close { grid-area:1/4; min-height:44px; align-self:center; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode :is(#map-mode-region,#map-mode-world,#map-quests-open,.atlas-find-launch) { grid-row:1; min-width:44px; min-height:44px; margin:0; padding:4px; font-size:14px; line-height:1.2; white-space:normal; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-mode-region { grid-column:1; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-mode-world { grid-column:2; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-quests-open { grid-column:3; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-find-launch { grid-column:4; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode.atlas-mode .map-layout,
html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-atlas-info { grid-area:3/1/4/5; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .map-layout { height:100%; margin:0; border:1px solid var(--ui-panel-line); border-radius:12px; overflow:hidden; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-viewport { position:relative; height:100%; padding:0; overflow:hidden; touch-action:manipulation; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode #world-map { display:block; position:relative; width:100%; min-width:0; height:100%; min-height:0; margin:0!important; zoom:1!important; transform:none!important; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-board { position:absolute; left:0; top:0; width:100%; height:100%; max-width:none; margin:0; border-radius:0; overflow:visible; aspect-ratio:auto; transform-origin:0 0; transition:transform .35s cubic-bezier(.2,.8,.2,1); box-shadow:none; }
.atlas-world-routes { z-index:0; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode #world-map .atlas-island { z-index:1; border:0; min-width:0; min-height:0; border-radius:24px; transition:transform .3s,opacity .3s,filter .3s; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode #world-map .atlas-island:active { transform:translate(-50%,-50%) scale(.96); }
html body.pack-ui #map-panel.atlas-mode.atlas-mode #world-map .atlas-island.pressed { transform:translate(-50%,-50%) scale(1.14); z-index:3; }
.atlas-island.dim>svg,.atlas-island.dim>.atlas-island-mark { opacity:.5; filter:saturate(.55); }
.atlas-island.pressed .atlas-coast-focus { opacity:1; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-island-name { bottom:-6px; display:flex; align-items:baseline; gap:6px; padding:3px 8px; max-width:160%; width:max-content; border-radius:6px; font-size:15px; line-height:1.25; white-space:nowrap; }
.atlas-island-name small { color:var(--ui-panel-muted); font-size:13px; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-island.pressed .atlas-island-name { background:var(--ui-panel-acc)!important; color:var(--ui-panel-acc-fg)!important; border-color:var(--ui-panel-acc); }
.atlas-island.pressed .atlas-island-name small { color:var(--ui-panel-acc-fg); }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-compact .atlas-island-name { flex-direction:column; align-items:center; gap:0; bottom:-14px; font-size:12px; padding:2px 7px; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-island-mark { top:2px; bottom:auto; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-region-name { width:max-content; min-width:56px; max-width:var(--atlas-name-width); height:auto; padding:3px 7px 4px; border-radius:7px; text-wrap:wrap; word-break:keep-all; overflow-wrap:anywhere; text-align:left; line-height:1.2; font-size:max(12px,calc(var(--readable-font-size,15px)*.8)); transform:none; }
.atlas-region-name>b { display:block; font-size:inherit; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-side .atlas-region-name { left:calc(22px + var(--atlas-node-size)/2 + 5px); top:22px; transform:translateY(-50%); }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-below .atlas-region-name { left:22px; top:calc(22px + var(--atlas-node-size)/2 + 4px); transform:translateX(-50%); text-align:center; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-dot { flex:none; width:var(--atlas-node-size,28px); height:var(--atlas-node-size,28px); border:2px solid var(--ui-panel-bg); color:var(--atlas-number); transition:transform .15s; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-region:active .atlas-dot { transform:scale(.9); }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-region.selected .atlas-dot { transform:scale(1.18); outline:0; box-shadow:0 0 0 5px var(--ui-panel-bg),0 0 0 8px var(--atlas-selected); }
.atlas-region.dim { opacity:.55; }
.atlas-pin-meta { display:flex; flex-wrap:wrap; gap:2px 5px; align-items:center; font-size:11px; font-weight:600; color:var(--ui-panel-muted); }
.atlas-below .atlas-pin-meta { justify-content:center; }
.atlas-icon { display:inline-grid; place-items:center; flex:none; font-size:16px; line-height:1.15; color:var(--ui-panel-on-success); }
.act-mine,.act-mine>.atlas-icon { color:var(--ui-panel-on-resource); }.act-boss,.act-boss>.atlas-icon { color:var(--ui-panel-on-danger); }.act-fish,.act-fish>.atlas-icon { color:var(--ui-panel-on-info); }.act-warp,.act-warp>.atlas-icon { color:var(--ui-panel-on-epic); }
.atlas-mine .atlas-dot { border:2px dashed var(--ui-panel-on-resource)!important; background:var(--ui-panel-bg); color:var(--ui-panel-on-resource)!important; }
.atlas-mine .atlas-region-name { border-style:dashed; border-color:var(--ui-panel-on-resource); }
.atlas-floats { position:absolute; inset:0; z-index:4; pointer-events:none; }
.atlas-floats[hidden] { display:none; }
.atlas-floating-legend { position:absolute; top:8px; left:8px; right:8px; display:flex; flex-wrap:wrap; gap:3px 10px; width:fit-content; max-width:calc(100% - 16px); padding:5px 10px; border:1px solid var(--ui-panel-line); border-radius:10px; background:color-mix(in srgb,var(--ui-panel-bg) 92%,var(--ui-panel-clear)); font-size:12px; font-weight:600; color:var(--ui-panel-muted); }
.atlas-floating-legend>span { display:flex; align-items:center; gap:3px; white-space:nowrap; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-exits { left:auto; right:8px; bottom:8px; display:flex; justify-content:flex-end; max-width:calc(100% - 16px); pointer-events:auto; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-exit { min-height:32px; min-width:44px; padding:3px 9px; font-size:12px; border-radius:999px; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode.atlas-mode #map-atlas-info { display:none; position:relative; inset:auto; align-self:stretch; justify-self:end; width:42%; height:100%; max-height:none; min-height:0; padding:0; overflow:hidden; box-sizing:border-box; background:var(--ui-panel-bg); border:1px solid var(--ui-panel-line); border-radius:0; box-shadow:-8px 0 22px var(--ui-panel-shadow); }
html body.pack-ui #map-panel.atlas-mode.atlas-mode.atlas-mode #map-atlas-info.atlas-card-open { display:flex; flex-direction:column; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode[data-atlas-state=region] #map-atlas-info { width:44%; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .map-footer { display:contents; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-detail { flex:none; padding:14px 16px 10px; border-bottom:1px solid var(--ui-panel-line); }
.atlas-info-heading { display:flex; align-items:center; gap:10px; }
.atlas-info-titles { flex:1; min-width:0; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-detail-title { margin:0; font-size:24px; line-height:1.25; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-detail-subtitle { margin:3px 0 0; font-size:13px; line-height:1.5; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-card-close { display:block; position:static; flex:none; margin:0; min-width:44px; min-height:44px; padding:4px 8px; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-info-body { display:block; flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; padding:12px 16px 16px; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-quests { margin:12px 0 0; padding-top:12px; }
#map-panel.atlas-mode :is(#party-list,#map-summary,#map-quests)[hidden] { display:none!important; }
.atlas-info-tabs { display:flex; gap:6px; margin-top:10px; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-tab { flex:1; min-width:0; min-height:38px; padding:4px 8px; font-weight:700; }
.atlas-tab[aria-pressed=true] { background:var(--ui-panel-acc-soft); border-color:var(--ui-panel-acc); color:var(--ui-panel-on-success); }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-info-back { padding:3px 10px; min-height:32px; font-size:13px; margin-bottom:10px; }
/* Extend only the hit boxes into free space; preserve painted geometry. */
#map-detail :is(.atlas-info-back,.atlas-tab) { position:relative; }
#map-detail :is(.atlas-info-back,.atlas-tab)::before { content:""; position:absolute; left:0; right:0; height:44px; }
#map-detail .atlas-info-back::before { top:0; }
#map-detail .atlas-tab::before { top:50%; transform:translateY(-50%); }
#map-panel.atlas-mode .atlas-glance { display:none; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-detail>.atlas-detail-row { display:none; }
.atlas-statrow { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.atlas-stat { display:inline-flex; align-items:center; gap:5px; padding:4px 9px; border-radius:999px; border:1px solid var(--ui-panel-line); font-size:13px; font-weight:600; }
.atlas-region-list { display:grid; gap:6px; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-region-row { display:grid; grid-template-columns:28px minmax(0,1fr) auto; gap:4px 8px; align-items:center; text-align:left; width:100%; min-height:48px; padding:7px 10px; }
.atlas-region-row>b { font-size:15px; overflow-wrap:anywhere; }
.atlas-region-row>.atlas-pin-meta { justify-content:flex-end; max-width:120px; }
html body.pack-ui #map-panel .atlas-region-row:is(:active,.pressed,[aria-selected=true],[aria-pressed=true])>.atlas-pin-meta { color:var(--ui-panel-acc-fg); } /* A439: preserve A360/A363 pressed-child contrast on B status rows. */
.atlas-info-foot { position:absolute; bottom:0; left:0; right:0; z-index:2; display:flex; flex-wrap:wrap; gap:8px; padding:10px 16px 12px; border-top:1px solid var(--ui-panel-line); background:var(--ui-panel-bg); }
#map-panel.atlas-mode[data-atlas-state=world] .atlas-info-body { padding-bottom:80px; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode :is(.atlas-quick,.atlas-open-continent) { flex:1; min-width:100px; min-height:46px; padding:6px 10px; font-weight:700; font-size:14px; }
.atlas-open-continent { background:var(--ui-panel-acc)!important; color:var(--ui-panel-acc-fg)!important; }
.atlas-activity-tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:8px; }
.atlas-activity-tile { display:flex; gap:10px; align-items:flex-start; padding:10px 12px; border:1px solid var(--ui-panel-line); border-radius:12px; background:var(--ui-panel-soft); color:var(--ui-panel-fg); }
.atlas-activity-tile>.atlas-icon { width:36px; height:36px; border-radius:10px; background:var(--ui-panel-bg); font-size:22px; }
.atlas-activity-tile>div { min-width:0; }.atlas-activity-tile b { font-size:16px; }.atlas-activity-tile p { margin:2px 0 0; font-size:13px; color:var(--ui-panel-muted); overflow-wrap:anywhere; }
@media(max-width:699px) and (min-height:501px) {
 html body.pack-ui #map-panel.atlas-mode.atlas-mode.atlas-mode { inset:6px; width:calc(100vw - 12px); height:calc(100dvh - 12px); padding:8px; gap:6px; border-radius:12px; }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-title { font-size:18px; }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode.atlas-mode #map-atlas-info { width:100%; height:58%; align-self:end; border-radius:16px 16px 0 0; box-shadow:0 -6px 22px var(--ui-panel-shadow); }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode.atlas-mode[data-atlas-state=region] #map-atlas-info { width:100%; height:70%; }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode :is(#map-detail,.atlas-info-body) { padding-left:12px; padding-right:12px; }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-detail-title { font-size:24px; }
 .atlas-floating-legend { font-size:11px; gap:2px 8px; }
}
@media(orientation:landscape) and (max-height:500px) {
 html body.pack-ui #map-panel.atlas-mode.atlas-mode.atlas-mode { inset:6px; width:calc(100vw - 12px); height:calc(100dvh - 12px); padding:6px 8px; gap:6px; grid-template-columns:44px auto minmax(0,1fr) 44px auto; grid-template-rows:44px minmax(0,1fr); }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-title { grid-area:1/2; font-size:16px; }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-compass { grid-area:1/4; height:38px; }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-close { grid-area:1/5; min-height:44px; }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-back { width:44px; min-width:44px; min-height:44px; }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode > .map-tools { grid-area:1/3; gap:6px; }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode :is(#map-mode-region,#map-mode-world,#map-quests-open,.atlas-find-launch) { min-height:44px; font-size:13px; }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode.atlas-mode .map-layout,html body.pack-ui #map-panel.atlas-mode.atlas-mode.atlas-mode #map-atlas-info { grid-area:2/1/3/6; }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode.atlas-mode #map-atlas-info { width:52%; height:100%; }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode.atlas-mode[data-atlas-state=region] #map-atlas-info { width:57%; }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode #map-detail { padding:8px 12px 6px; }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-detail-title { font-size:19px; }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-info-body { padding:8px 12px 12px; }
 html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-info-back { margin-bottom:6px; }
}
@media(max-width:379px) and (min-height:501px) {
 .atlas-floating-legend,.atlas-exits { flex-wrap:nowrap; overflow-x:auto; justify-content:flex-start; }
 .atlas-floating-legend>span,.atlas-exits>button { flex-shrink:0; white-space:nowrap; }
}

/* Reuse A372’s compass artwork in its own header cell. */
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-compass::after { content:""; border:0; background:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%2213%22%20fill%3D%22%23fff8df%22%20stroke%3D%22%23ad976b%22%2F%3E%3Cpath%20d%3D%22M16%203%2020%2016%2016%2029%2012%2016Z%22%20fill%3D%22%23476d3b%22%2F%3E%3Cpath%20d%3D%22M3%2016%2016%2012%2029%2016%2016%2020Z%22%20fill%3D%22%23b7a174%22%2F%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%222%22%20fill%3D%22%23fff8df%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat }
.atlas-icon svg { display:block; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-icon svg { position:static; inset:auto; width:16px; height:16px; }
html body.pack-ui #map-panel.atlas-mode #party-list { display:block; margin:0; padding:0; border:0; border-radius:0; background:none; font-size:14px; }
#map-panel.atlas-mode #party-list > .atlas-detail-row { border-top:0; }
html body.pack-ui #map-panel.atlas-mode .atlas-detail-row > :is(strong,span,div) { font-size:max(14px,var(--readable-font-size,15px)); }
html body.pack-ui #map-panel.atlas-mode .atlas-detail-row > strong { font-weight:700; white-space:nowrap; } /* A439: retain a single-line information label. */
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-region-name>b { font-size:inherit; line-height:1.2; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-region-name .atlas-pin-meta { font-size:11px; line-height:1.2; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-region-name .atlas-icon svg { width:13px; height:13px; }
html body.pack-ui #map-panel.atlas-mode.atlas-mode .atlas-region-name .atlas-icon { font-size:13px; }

/* Existing region-card actions; keep the established panel and theme roles. */
html body.pack-ui #map-panel.atlas-mode .atlas-activity-action { min-width:44px; min-height:44px; max-width:100%; margin-top:8px; padding:8px 10px; white-space:normal; overflow-wrap:anywhere; color:var(--ui-panel-fg); background:var(--ui-panel-bg); border:1px solid var(--ui-panel-line); }
.atlas-social-actions { display:flex; flex-direction:column; gap:8px; align-items:stretch; }
