/* The approved map masthead. Keep both tab controls keyboard-accessible on the map. */
:root {
    --masthead-height:72px;
    --masthead-side:clamp(16px,3.1vw,52px);
    --masthead-tools-top:11px;
    --masthead-gap:7px;
    --tool:44px;
}
.atlas-wordmark { color:inherit; text-decoration:none; }
.atlas-wordmark .brand-mark { display:block; flex:none; width:48px; height:auto; }
body:has(#domestic-panel:not([inert])) .atlas-nav {
    position:absolute; inset:0 0 auto; box-sizing:border-box; height:var(--masthead-height);
    padding:6px var(--masthead-side) 12px; color:#fffdf4;
    background:linear-gradient(180deg,rgba(9,19,22,.86),rgba(9,19,22,.43) 67%,transparent);
}
body:has(#domestic-panel:not([inert])) .atlas-wordmark {
    position:relative; display:flex; width:auto; min-height:0; align-items:center; justify-content:flex-start;
    gap:8px; font:800 20px/1.45 var(--ui-font); letter-spacing:-.045em;
}
body:has(#domestic-panel:not([inert])) .atlas-wordmark::before { content:""; position:absolute; inset:-10px 0; }
body:has(#domestic-panel:not([inert])) .atlas-wordmark strong { font:inherit; letter-spacing:inherit; }
body:has(#domestic-panel:not([inert])) .atlas-tabs:not(:has(:focus-visible)) {
    position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap;
}
body:has(#domestic-panel:not([inert])) .atlas-tabs:has(:focus-visible) {
    position:absolute; top:calc(100% - 6px); left:var(--masthead-side); display:flex; padding:0 12px;
    gap:16px; border:1px solid #e5ebd94f; border-radius:10px; background:#192527;
}
#atlas-map-tools {
    top:max(var(--masthead-tools-top),env(safe-area-inset-top));
    right:calc(max(var(--masthead-side),env(safe-area-inset-right)) + var(--sbw,0px) / var(--ui-scale,1)); display:flex; align-items:center;
    gap:var(--masthead-gap); margin:0;
}
#atlas-map-tools > #atlas-locate, #atlas-map-search, #atlas-map-db, #atlas-settings-toggle {
    display:grid; place-items:center; flex:none; box-sizing:border-box; width:var(--tool); height:var(--tool); min-width:var(--tool); padding:0;
    border:1px solid rgba(229,235,217,.31); border-radius:22px; background:#172124bd; color:#f5f2e8;
}
#atlas-map-search, #atlas-map-db {
    display:inline-flex; align-items:center; justify-content:center; gap:7px; width:auto; padding:0 14px;
    color:#ccd2ca; text-decoration:none; font:600 13px/1.45 var(--ui-font);
}
#atlas-map-tools svg { flex:none; width:20px; height:20px; }
#atlas-map-search:enabled:hover, #atlas-map-db:hover, #atlas-map-tools > #atlas-locate:enabled:hover, #atlas-settings-toggle:hover { background:#263436; }
#atlas-map-search { cursor:pointer; }
#atlas-map-search:disabled { color:#9aa79f; cursor:default; }
#atlas-map-search[aria-expanded=true] { color:#efc86b; border-color:#efc86b95; background:#253031; }
#atlas-settings-menu[open] > #atlas-settings-toggle { color:#efc86b; border-color:#efc86b95; background:#253031; }
#atlas-map-tools > #atlas-locate[aria-busy=true] { color:#efc86b; }
#atlas-map-tools :is(button, a, summary):focus-visible, .atlas-wordmark:focus-visible { outline:3px solid #ffd67b; outline-offset:2px; }
#atlas-map-zoom {
    width:88px; height:44px; border:0; border-radius:10px; background:transparent; box-shadow:none;
}
#atlas-map-zoom::before {
    content:""; position:absolute; inset:auto 2px 3px; height:30px; box-sizing:border-box;
    border:1px solid rgba(229,235,217,.31); border-radius:16px; background:#172326e8; pointer-events:none;
}
#atlas-map-zoom button, #atlas-map-zoom button + button {
    position:relative; width:44px; height:44px; padding:8px 0 0; border:0; border-radius:10px;
    background:transparent; color:#f5f2e8; font:500 16px/1 system-ui;
}
#atlas-map-zoom button:disabled { color:#9aa79f; }
#atlas-map-zoom button:enabled:active { color:#efc86b; }
@media (max-width:600px) {
    :root { --masthead-height:61px; --masthead-side:14px; --masthead-tools-top:7px; --masthead-gap:4px; }
    body:has(#domestic-panel:not([inert])) .atlas-nav { padding:5px var(--masthead-side) 8px; }
    body:has(#domestic-panel:not([inert])) .atlas-wordmark { gap:6px; font-size:17px; }
    .atlas-wordmark .brand-mark { width:42px; }
    #atlas-map-search, #atlas-map-db { width:var(--tool); padding:0; }
    #atlas-map-search span, #atlas-map-db span { display:none; }
}
@media (max-width:350px) {
    /* 도구가 넷(내 위치·검색·DB·설정)이라 좁은 폰에서는 단추를 조금 줄인다(2026-11-24) */
    :root { --tool:40px; --masthead-side:11px; --masthead-gap:2px; }
    body:has(#domestic-panel:not([inert])) .atlas-wordmark { font-size:16px; }
}
/* 지도↔레퍼런스 전환 단추(2026-11-29 사용자 시안 B): 원래 아이콘(DB·지도 핀, 20px)은 그대로 두고, 그 바깥 단추 안쪽에 금색 위아래 반원 화살표 고리(지름 34)를 둔다. */
#atlas-map-db svg { width:36px; height:36px; }
/* 두 화면의 전환 단추가 글자 길이(DB·지도)와 상관없이 같은 너비가 되게 해 [검색] 단추 자리를 맞춘다 */
@media (min-width:601px) { #atlas-map-db { width:80px; padding:0; } }
/* 큰 화면 배율(ui-scale.js, 2026-11-24): 지도 위 머리·도구·확대축소를 화면 크기에 맞춰 키운다. 지도 자체는 그대로. */
body:has(#domestic-panel:not([inert])) .atlas-nav, #atlas-map-tools, #atlas-map-zoom { zoom:var(--ui-scale,1); }
