@media (min-width:851px) {
    body:has(> .atlas-shell) .mast-inner { max-width:none; padding-inline:clamp(16px,2vw,32px); }
}
.atlas-shell {
    --rail:clamp(304px,25vw,388px);
    --gutter:clamp(16px,2vw,32px);
    display:flex;
    flex-direction:column;
    height:calc(100dvh - var(--mast-height,69px));
    min-height:380px;
}
.world-map { position:relative; flex:1; min-height:0; display:grid; grid-template-columns:minmax(0,1fr) var(--rail); grid-template-rows:auto minmax(0,1fr); background:#1b1d24; }
.world-map [hidden] { display:none !important; }
.atlas-head { grid-area:1/1; display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:18px; padding:13px var(--gutter); background:#1e2027; border-bottom:1px solid var(--line); }
.atlas-title { justify-self:center; text-align:center; }
.atlas-title h1 { margin:0; font:650 clamp(1.35rem,1.55vw,1.65rem)/1.12 Sans,sans-serif; letter-spacing:-.03em; }
.atlas-title p { margin-top:3px; color:var(--muted); font-size:.78rem; }
.atlas-actions { display:flex; justify-self:end; align-items:center; gap:clamp(12px,1.6vw,24px); }
.atlas-search { display:flex; align-items:center; width:min(100%,380px); min-width:100px; height:42px; border:1px solid #535662; border-radius:7px; background:#292c35; overflow:hidden; }
.atlas-search:focus-within { outline:2px solid var(--gold); outline-offset:1px; }
.atlas-search input { min-width:0; flex:1; width:100%; height:100%; background:none; border:0; outline:0; padding:0 12px; font-size:.92rem; }
.atlas-search input::placeholder { color:#c0c2cb; }
.atlas-search button { align-self:stretch; width:42px; color:var(--gold); }
.atlas-search button:hover,.atlas-search button:focus-visible { background:#41404a; outline-offset:-3px; }
.atlas-filter { display:flex; align-items:center; gap:8px; min-height:42px; white-space:nowrap; font-size:.9rem; font-weight:650; cursor:pointer; }
.atlas-filter input { appearance:none; position:relative; width:28px; height:17px; margin:0; border:1px solid #85858c; border-radius:12px; background:#35373e; cursor:pointer; }
.atlas-filter input::before { content:""; position:absolute; left:3px; top:3px; width:9px; height:9px; border-radius:50%; background:#d3d2d5; }
.atlas-filter input:checked { background:var(--gold); border-color:var(--gold); }
.atlas-filter input:checked::before { transform:translateX(11px); background:#2b241a; }
.atlas-switch { display:none; }

.atlas-stage { grid-area:2/1; min-width:0; min-height:0; position:relative; overflow:hidden; isolation:isolate; background:#243242; overscroll-behavior:contain; }
.atlas-preview,.atlas-gl,.atlas-pins { position:absolute; inset:0; }
.atlas-preview { overflow:hidden; touch-action:none; background:radial-gradient(ellipse at center,#253544,#162331); }
.atlas-preview > img { position:absolute; max-width:none; pointer-events:none; width:100%; height:100%; }
.atlas-cell { position:absolute; background:#eeb95122; border:1px solid #eeb951b0; pointer-events:none; }
.atlas-world,.atlas-key,.atlas-gl .maplibregl-ctrl-group { background:#20242df5; color:var(--ink); border:1px solid #676d79; box-shadow:0 2px 8px #11182138; border-radius:6px; }
.atlas-world { flex:none; padding:0 12px; height:38px; font-weight:650; font-size:.85rem; box-shadow:none; }
.atlas-world:hover,.atlas-gl .maplibregl-ctrl-group button:hover { background:#383c47; }
.atlas-gl .maplibregl-ctrl-top-right .maplibregl-ctrl { margin:14px 14px 0 0; }
.atlas-gl .maplibregl-ctrl-group button { width:35px; height:36px; }
.atlas-gl .maplibregl-ctrl-group button + button { border-color:#50535d; }
.atlas-gl .maplibregl-ctrl-icon { filter:invert(1); }
.atlas-key { pointer-events:none; position:absolute; left:14px; bottom:14px; display:flex; align-items:center; gap:11px; padding:7px 11px; font-size:.75rem; font-weight:600; }
.atlas-key > span:first-child { color:#d4d1cb; }
.atlas-scale { display:inline-flex; align-items:center; gap:4px; font-variant-numeric:tabular-nums; }
.atlas-scale i { width:9px; height:9px; background:var(--fill); border:1px solid var(--ring); border-radius:50%; }
.atlas-credit { position:absolute; bottom:0; right:0; padding:2px 6px; background:#20242de8; color:#dcdee4; font-size:.68rem; }
.atlas-credit a:hover,.atlas-panel .raid-allowance a,.world-map noscript a { text-decoration:underline; }

[data-density="0"] { --fill:#53464a; --ring:#c0a7a1; --label:#fff8ed; }
[data-density="1"] { --fill:#815a4c; --ring:#d0aa94; --label:#fff8ed; }
[data-density="2"] { --fill:#ca9173; --ring:#e8c3a9; --label:#291e19; }
[data-density="3"] { --fill:#e9a457; --ring:#ffce8b; --label:#2c2018; }
[data-density="4"] { --fill:#ffce69; --ring:#ffe8ab; --label:#292117; }
.atlas-pin { position:absolute; display:grid; place-items:center; width:var(--diameter); height:var(--diameter); padding:0; border:2px solid var(--ring); border-radius:50%; background:var(--fill); color:var(--label); font:750 15px/1 Cond,sans-serif; font-variant-numeric:tabular-nums; box-shadow:0 0 0 1px #282934b3,0 2px 6px #18202b6b; }
.atlas-pin::after { content:""; position:absolute; width:max(100%,44px); height:max(100%,44px); border-radius:50%; }
.atlas-preview .atlas-pin { transform:translate(-50%,-50%); }
.atlas-pin:hover,.atlas-pin:focus-visible,.atlas-pin.is-highlighted { z-index:2; outline:2px solid #fff5df; outline-offset:2px; }
.atlas-arrival { animation:atlas-arrive .8s ease-out; }
@keyframes atlas-arrive { from { box-shadow:0 0 0 2px #ffce69aa; } to { box-shadow:0 0 0 14px #ffce6900; } }

.atlas-panel { grid-area:1/2/3; display:flex; flex-direction:column; min-width:0; min-height:0; overflow:hidden; background:#20222a; border-left:1px solid #42444e; }
.atlas-panel-head { flex:none; padding:17px 22px 15px; border-bottom:1px solid var(--line); }
.atlas-panel-head h2 { margin:0; font:740 1.65rem/1.1 Cond,sans-serif; }
.atlas-panel-head p { color:#c4c4cb; margin-top:4px; font-size:.85rem; }
.atlas-panel-head button,.atlas-pager button { font-weight:650; font-size:.85rem; background:#30333d; border:1px solid #535764; border-radius:5px; padding:6px 12px; }
.atlas-panel-head button { float:right; margin-left:8px; }
.atlas-panel-body,.atlas-active { display:flex; flex:1; flex-direction:column; min-height:0; }
.atlas-results,.atlas-active-list { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#555965 transparent; }
.atlas-panel-body:has(.atlas-active:not([hidden])) .atlas-results { flex:0 1 auto; max-height:43%; }
.atlas-active h2 { flex:none; padding:13px 22px 9px; border-bottom:1px solid var(--line); font:740 1.35rem/1.15 Cond,sans-serif; }
.atlas-active .atlas-count { color:var(--muted); font:600 .8rem/1 Sans,sans-serif; }
.atlas-result { display:flex; align-items:center; gap:11px; width:100%; min-height:53px; padding:9px 22px; text-align:left; border-bottom:1px solid #383a44; }
.atlas-result:hover,.atlas-result:focus-visible { background:#30333c; }
.atlas-result:focus-visible { outline-offset:-3px; }
.atlas-result strong,.atlas-result small { display:block; }
.atlas-result strong { font-weight:640; font-size:.95rem; }
.atlas-result small { color:var(--muted); font-size:.78rem; }
.atlas-result img { width:38px; height:38px; flex:none; object-fit:contain; }
.atlas-count { margin-left:auto; padding-left:10px; font:670 1.1rem/1 Cond,sans-serif; font-variant-numeric:tabular-nums; color:#f0dcc0; }
.atlas-panel .raid-allowance,.atlas-pager { flex:none; padding:12px 22px; margin:0; border-top:1px solid var(--line); font-size:.8rem; }
.atlas-panel .raid-allowance { background:#1d1f26; color:#c4c4cb; }
.atlas-panel .raid-allowance span,.atlas-panel .raid-allowance a { display:block; }
.atlas-panel .raid-allowance a { color:var(--gold); text-underline-offset:2px; }
.atlas-pager { display:flex; justify-content:space-between; }
.atlas-detail { position:fixed; width:min(390px,95vw); max-height:88dvh; padding:0; border:1px solid #626974; border-radius:14px; background:var(--surface); color:var(--ink); overflow:auto; box-shadow:0 14px 80px #0009; }
.atlas-detail::backdrop { background:#0b1018b8; }
.atlas-detail>button { position:sticky; top:8px; float:right; z-index:3; width:40px; height:40px; margin:8px 8px -48px 0; border:1px solid #78808c; border-radius:50%; background:#20252dec; font:1.65rem/1 Sans,sans-serif; }
.atlas-detail .encounter { display:block; width:100%; margin:0; }
.atlas-detail .action-feedback { color:var(--ink); }
.atlas-detail [data-encounter]:not(:has(.encounter)) { padding:24px 58px 24px 20px; }
@media (min-width:851px) and (max-width:1150px) {
    .atlas-head { grid-column:1/-1; }
    .atlas-panel { grid-row:2; }
}
@media (max-width:850px) {
    .world-map { grid-template-columns:100%; grid-template-rows:auto minmax(0,min(98vw,62%)) minmax(105px,1fr); }
    .atlas-head { grid-template-columns:minmax(0,1fr) auto; gap:9px 12px; padding:10px 15px; }
    .atlas-actions { display:contents; }
    .atlas-world { grid-area:2/1; justify-self:start; height:35px; padding-inline:9px; }
    .atlas-title { grid-area:2/1/3/-1; }
    .atlas-title h1 { font-size:1.2rem; }
    .atlas-title p { margin-top:1px; font-size:.69rem; }
    .atlas-switch { grid-area:2/2; display:flex; justify-self:end; border:1px solid #494c56; border-radius:6px; padding:3px; }
    .atlas-switch button { min-height:33px; padding:0 10px; border-radius:3px; color:var(--muted); font-size:.82rem; font-weight:650; }
    .atlas-switch [aria-pressed="true"] { background:#45413a; color:#ffda88; }
    .atlas-search { grid-area:1/1; width:100%; max-width:none; }
    .atlas-filter { grid-area:1/2; justify-self:end; font-size:.84rem; gap:6px; }
    .atlas-panel { position:relative; z-index:2; grid-area:3/1; border:0; border-top:1px solid #636474; }
    .world-map[data-display="results"] .atlas-panel { grid-row:2/4; }
    .world-map[data-display="results"] .atlas-stage { visibility:hidden; }
    .world-map:not([data-display="results"]) .atlas-panel :is(.raid-allowance,.atlas-pager) { display:none; }
    .atlas-panel-head { padding:9px 15px; display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
    .atlas-panel-head h2 { font-size:1.36rem; }
    .atlas-panel-head p { font-size:.76rem; margin:0; }
    .atlas-panel-head button { order:1; margin:0 0 0 auto; }
    .atlas-result { padding:8px 15px; min-height:48px; }
    .atlas-active h2 { padding:10px 15px; }
    .world-map:not([data-display="results"]) .atlas-panel-body { display:block; overflow:auto; overscroll-behavior:contain; }
    .world-map:not([data-display="results"]) .atlas-panel-body :is(.atlas-results,.atlas-active-list) { max-height:none; overflow:visible; }
    .atlas-detail { margin:auto 0 0; width:100%; max-width:none; max-height:83dvh; border-radius:18px 18px 0 0; padding-bottom:env(safe-area-inset-bottom); }
    .atlas-key { left:9px; bottom:22px; gap:8px; font-size:.69rem; padding:5px 8px; }
}
@media (max-width:365px) {
    .atlas-head { padding-inline:10px; gap:8px; }
    .atlas-search input { font-size:.81rem; padding-inline:7px; }
    .atlas-switch button { padding-inline:5px; font-size:.77rem; }
    .atlas-title h1 { font-size:1.08rem; }
    .atlas-title p { font-size:.64rem; }
}
