/* ============================================================
   Project Atlas — atlas.css
   메인 지도 페이지 스타일
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    height: 100%;
    font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* 색상 변수는 :root(문서 전체)에 선언 — #atlas-wrap 밖으로 옮겨진 요소(전체화면 지도,
   라이트박스 등)도 정상적으로 색상을 받도록 함. 예전엔 #atlas-wrap 안에서만 정의돼 있어서,
   body로 재배치한 요소들이 var(--atlas-modal-bg) 등을 못 받아와 배경이 투명하게 깨졌었음. */
:root {
    --atlas-forest:   #1b3a2a;
    --atlas-moss:     #4a7c59;
    --atlas-amber:    #c87941;
    --atlas-cream:    #f4ede3;
    --atlas-sand:     #e8ddd0;
    --atlas-track:    #d4581f;
    --atlas-gold:     #d4a017;
    --atlas-text:     #1c1c1c;
    --atlas-text-mid: #5a5a5a;
    --atlas-modal-bg: #f4ede3;
    --atlas-modal-shadow: rgba(0,0,0,.5);
    --atlas-chip-bg:  rgba(255,255,255,.95);
    --atlas-search-bg: rgba(255,255,255,.97);
}

#atlas-wrap {
    position: relative;
    width: 100vw;
    height: 100dvh;
    height: 100vh;  /* 폴백 */
    height: 100dvh;
    overflow: hidden;
}

/* 다크모드 변수 오버라이드 */
html[data-theme="dark"] {
    --atlas-forest:   #0d2117;
    --atlas-moss:     #3d6b48;
    --atlas-cream:    #2a2620;
    --atlas-sand:     #3d3833;
    --atlas-text:     #f0ebe1;
    --atlas-text-mid: #b8b0a3;
    --atlas-modal-bg: #2a2620;
    --atlas-modal-shadow: rgba(0,0,0,.7);
    --atlas-chip-bg:  rgba(50,45,38,.95);
    --atlas-search-bg: rgba(50,45,38,.97);
}

html[data-theme="dark"] body { background: #1a1714; }

#atlas-main-map { width: 100%; height: 100%; }

/* ─────── 로딩 ─────── */
.atlas-loading {
    position: fixed; inset: 0; background: var(--atlas-forest);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 9999; gap: 14px;
}
.atlas-loading.hidden { display: none; }
.atlas-loading-status { color: rgba(255,255,255,.7); font-size: 13px; }
.atlas-loading-bar-wrap { width: 200px; height: 4px; background: rgba(255,255,255,.15); border-radius: 2px; overflow: hidden; }
.atlas-loading-bar { height: 100%; background: var(--atlas-track); transition: width .3s; width: 0%; }

/* ─────── 헤더 ─────── */
.atlas-header {
    position: absolute; top: 0; left: 0; right: 0; z-index: 600;
    padding: 14px 20px 0;
    height: 64px;
    background: linear-gradient(to bottom, rgba(27,58,42,.85) 0%, rgba(27,58,42,.4) 60%, transparent 100%);
    display: flex; align-items: flex-start; justify-content: space-between;
    pointer-events: none;
}
.atlas-header > * { pointer-events: auto; }
.atlas-brand-block { display: flex; align-items: center; gap: 14px; }
.atlas-logo {
    height: 44px; width: auto; display: block;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.4));
}
.atlas-brand-sub {
    color: rgba(255,255,255,.85); font-size: 12px; font-weight: 600;
    letter-spacing: 2px; text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
    line-height: 1.2; padding-top: 2px;
}

/* ─────── 검색 ─────── */
.atlas-search-wrap { position: relative; display: flex; align-items: center; gap: 8px; }
.atlas-search-toggle, .atlas-theme-toggle {
    width: 38px; height: 38px; border-radius: 50%; border: none;
    background: var(--atlas-search-bg); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,.2);
    transition: background .2s, transform .2s; font-size: 18px;
    color: var(--atlas-text);
}
.atlas-search-toggle:hover, .atlas-theme-toggle:hover { filter: brightness(1.1); transform: scale(1.05); }
.atlas-search-bar {
    display: none;
    background: var(--atlas-search-bg); border-radius: 22px;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    padding: 5px 8px 5px 14px;
    align-items: center; gap: 6px;
}
.atlas-search-bar.open { display: flex; }
.atlas-search-bar.shake { animation: atlas-shake .5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes atlas-shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(3px); }
    30%, 50%, 70% { transform: translateX(-5px); }
    40%, 60% { transform: translateX(5px); }
}
.atlas-search-input {
    border: none; outline: none; background: transparent;
    font-family: inherit; font-size: 13px; width: 180px;
    color: var(--atlas-text);
}
.atlas-search-clear {
    width: 24px; height: 24px; border: none; border-radius: 50%;
    background: var(--atlas-sand); color: var(--atlas-text-mid);
    cursor: pointer; font-size: 12px; line-height: 1;
}
.atlas-search-clear:hover { background: #d4c8bb; }

.atlas-search-result {
    position: absolute; top: 46px; right: 0;
    background: var(--atlas-search-bg); border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    width: 320px;
    max-height: 360px;
    overflow-y: auto;
    display: none;
    padding: 4px;
}
.atlas-search-result.show { display: block; }
.atlas-search-empty {
    padding: 16px 12px; font-size: 12px; color: var(--atlas-text-mid);
    text-align: center;
}
.atlas-search-summary {
    padding: 8px 12px 6px; font-size: 11px; color: var(--atlas-text-mid);
    border-bottom: 1px solid var(--atlas-sand); margin-bottom: 2px;
}
.atlas-search-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 8px;
    cursor: pointer; transition: background .15s;
    font-size: 12.5px;
}
.atlas-search-item:hover { background: var(--atlas-sand); }
.atlas-search-region-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.atlas-search-region-label {
    font-size: 11px; color: var(--atlas-text-mid); font-weight: 600;
    flex-shrink: 0; min-width: 32px;
}
.atlas-search-course-name {
    flex: 1; color: var(--atlas-text); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.atlas-search-item .atlas-diff { font-size: 10px; padding: 2px 7px; flex-shrink: 0; }
.atlas-search-more {
    padding: 8px 12px; font-size: 11px; color: var(--atlas-text-mid);
    text-align: center; font-style: italic;
}

/* ─────── 필터 칩 (가로 스크롤) ─────── */
.atlas-filter {
    position: absolute; top: 70px; left: 16px; right: 16px;
    z-index: 500;
    display: flex; gap: 6px;
    white-space: nowrap;
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.atlas-filter::-webkit-scrollbar { display: none; }
.atlas-chip {
    flex-shrink: 0;
    background: var(--atlas-chip-bg); color: var(--atlas-text);
    border: none; border-radius: 18px;
    padding: 6px 14px; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all .2s;
    user-select: none; font-family: inherit;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.atlas-chip:hover  { box-shadow: 0 3px 8px rgba(0,0,0,.25); filter: brightness(1.05); }
.atlas-chip.active { background: var(--atlas-forest); color: #fff; box-shadow: 0 3px 8px rgba(27,58,42,.4); }
html[data-theme="dark"] .atlas-chip.active { background: var(--atlas-moss); }

/* ─────── 모달 ─────── */
.atlas-modal {
    display: none;
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px); max-width: 480px;
    max-height: calc(100% - 32px);
    background: var(--atlas-modal-bg); border-radius: 16px;
    box-shadow: 0 20px 55px var(--atlas-modal-shadow);
    z-index: 2000; overflow: hidden;
}
.atlas-modal.open { display: flex; flex-direction: column; }

.atlas-mini-wrap {
    position: relative; border-radius: 10px; overflow: hidden;
    margin: 4px 0 10px; background: var(--atlas-sand);
}
#atlas-mini-map { width: 100%; height: 360px; }
.atlas-mini-loading {
    position: absolute; inset: 0; background: var(--atlas-sand);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: var(--atlas-text-mid); z-index: 10;
}

/* 코스명 위 작은 지역 라벨 (예: "경기 · 광주시") */
.atlas-region-name { display: block; color: var(--atlas-text-mid); font-size: 12px; font-weight: 600; margin-bottom: 2px; }

/* 미니맵의 Leaflet attribution 작게 */
#atlas-mini-map .leaflet-control-attribution {
    background: rgba(255,255,255,.7); font-size: 9px;
    padding: 1px 5px; line-height: 1.4;
    margin: 0; border-radius: 0 0 0 4px;
}

/* 난이도·SW Point 배지 — 지도 우하단 오버레이 */
.atlas-map-badges {
    position: absolute; right: 8px; bottom: 8px;
    display: flex; align-items: center; gap: 6px;
    z-index: 1100; pointer-events: none;
}
.atlas-map-badges > * { pointer-events: auto; }

.atlas-diff {
    font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 10px; white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
    color: #fff;
    background: #607d8b; /* 레벨 조회 실패 시 폴백 — 보통은 JS가 인라인 background로 덮어씀 */
}


.atlas-info { padding: 14px 18px 18px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.atlas-title { font-size: 17px; font-weight: 700; color: var(--atlas-text); margin: 0; line-height: 1.35; }

.atlas-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5px;
    border: 1.5px solid var(--atlas-sand); border-radius: 10px; overflow: hidden;
    background: var(--atlas-sand);   /* gap이 구분선 역할 */
    margin: 10px 0 4px;
}
.atlas-stat { padding: 9px 4px; text-align: center; background: var(--atlas-modal-bg); }
html[data-theme="light"] .atlas-stat { background: #fff; }
.atlas-stat-lbl { font-size: 10px; color: var(--atlas-text-mid); margin-bottom: 3px; }
.atlas-stat-val { font-size: 13px; font-weight: 700; color: var(--atlas-text); line-height: 1.25; }
.atlas-stat-val small { display: block; font-size: 10px; font-weight: 600; color: var(--atlas-text-mid); }
html[data-theme="light"] .atlas-stat-val { color: var(--atlas-forest); }
.atlas-stat-up .atlas-stat-val { color: #e53935; }
.atlas-stat-down .atlas-stat-val { color: #1e88e5; }
html[data-theme="light"] .atlas-stat-up .atlas-stat-val { color: #c62828; }
html[data-theme="light"] .atlas-stat-down .atlas-stat-val { color: #1565c0; }
.atlas-stat-val.atlas-stat-desc { font-size: 11px; font-weight: 600; color: var(--atlas-text-mid); }
html[data-theme="light"] .atlas-stat-val.atlas-stat-desc { color: var(--atlas-text-mid); }

/* ────── SWTI 블록 (점수 + 문구 + 구간 비율) ────── */
.atlas-swti-block { margin-bottom: 6px; }
.atlas-swti-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.atlas-swti-summary {
    display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; justify-content: flex-end;
    font-size: 12px; color: var(--atlas-text-mid); text-align: right;
}
.atlas-swti-summary strong { font-size: 14px; font-weight: 700; color: var(--atlas-text); }
html[data-theme="light"] .atlas-swti-summary strong { color: var(--atlas-forest); }
.atlas-summary-sep { opacity: .45; }
.atlas-swti-disclaimer { font-size: 11px; color: var(--atlas-text-mid); line-height: 1.5; margin: 2px 0 10px; }
.atlas-swti-score {
    display: inline-flex; align-items: baseline; gap: 6px;
    padding: 6px 12px; border-radius: 10px;
    background: var(--atlas-forest); color: #fff; flex-shrink: 0;
}
html[data-theme="dark"] .atlas-swti-score { background: var(--atlas-moss); color: #111; }
.atlas-swti-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; opacity: .85; }
.atlas-swti-num { font-size: 22px; font-weight: 800; line-height: 1; }
.atlas-swti-phrase { font-size: 13px; font-weight: 600; color: var(--atlas-text); line-height: 1.45; }
.atlas-swti-phrase:empty { display: none; }

.atlas-ratio-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--atlas-sand); }
.atlas-ratio-seg { height: 100%; transition: width .3s; }
.atlas-ratio-up   { background: #e53935; }
.atlas-ratio-flat { background: #b0bec5; }
.atlas-ratio-down { background: #1e88e5; }
.atlas-ratio-legend { display: flex; gap: 12px; margin-top: 5px; font-size: 10px; color: var(--atlas-text-mid); }
.atlas-ratio-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.atlas-stat-note { font-size: 10px; color: var(--atlas-text-mid); text-align: right; margin: 2px 0 12px; }

/* ────── 고도표 (SVG 직접 렌더링) ────── */
.atlas-elev-chart-wrap {
    position: relative; margin: 0 0 10px;
    background: var(--atlas-modal-bg); border: 1.5px solid var(--atlas-sand);
    border-radius: 12px; overflow: hidden;
    aspect-ratio: 640 / 150;  /* viewBox 비율과 동일 — preserveAspectRatio="none"이어도 왜곡 없음 */
}
html[data-theme="light"] .atlas-elev-chart-wrap { background: #fff; }
.atlas-elev-chart-loading {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: var(--atlas-text-mid); background: var(--atlas-sand);
}
#atlas-elev-chart { width: 100%; height: 100%; }
.atlas-elev-svg { width: 100%; height: 100%; display: block; }

.atlas-elev-grid { stroke: var(--atlas-sand); stroke-width: 1; stroke-dasharray: 3 3; }
.atlas-elev-tick { stroke: var(--atlas-sand); stroke-width: 1; }
.atlas-elev-axis-label { font-size: 9px; fill: var(--atlas-text-mid); font-weight: 500; }

.atlas-elev-line {
    stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.15));
}
.atlas-elev-peak { stroke: var(--atlas-modal-bg); stroke-width: 2; }
html[data-theme="light"] .atlas-elev-peak { stroke: #fff; }
.atlas-elev-peak-label {
    font-size: 10px; font-weight: 700; fill: var(--atlas-text);
    paint-order: stroke; stroke: var(--atlas-modal-bg); stroke-width: 3px; stroke-linejoin: round;
}
html[data-theme="light"] .atlas-elev-peak-label { stroke: #fff; }

.atlas-elev-empty {
    display: flex; align-items: center; justify-content: center; height: 100%;
    font-size: 11px; color: var(--atlas-text-mid);
}

/* 이미지 슬라이드 */
.atlas-img-slider {
    position: relative; border-radius: 10px; overflow: hidden;
    margin-bottom: 10px; background: var(--atlas-sand);
    height: 175px;
}
.atlas-img-track { display: flex; height: 100%; transition: transform .4s cubic-bezier(.4, 0, .2, 1); }
.atlas-img-slide { flex: 0 0 100%; height: 100%; background-size: cover; background-position: center; cursor: pointer; }
.atlas-img-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 30px; height: 30px; border-radius: 50%; border: none;
    background: rgba(255,255,255,.85); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: var(--atlas-text);
    box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: background .2s;
    z-index: 5;
}
.atlas-img-arrow:hover { background: #fff; }
.atlas-img-arrow.prev { left: 8px; }
.atlas-img-arrow.next { right: 8px; }
.atlas-img-arrow:disabled { opacity: 0; pointer-events: none; }
.atlas-img-dots { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; z-index: 5; }
.atlas-img-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.5); transition: all .2s; cursor: pointer; }
.atlas-img-dot.active { background: #fff; width: 16px; border-radius: 3px; }
.atlas-img-counter {
    position: absolute; top: 8px; right: 8px;
    background: rgba(0,0,0,.55); color: #fff;
    font-size: 10px; padding: 3px 8px; border-radius: 10px; z-index: 5;
}

/* 태그 */
.atlas-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.atlas-tag {
    font-size: 11px; padding: 3px 9px; background: var(--atlas-sand);
    color: var(--atlas-text-mid); border-radius: 9px;
    cursor: pointer; transition: background .15s;
    border: none; font-family: inherit;
}
.atlas-tag:hover { background: #d4c8bb; }

/* 설명 + 더보기 */
.atlas-desc-wrap { position: relative; margin-bottom: 14px; }
.atlas-desc { font-size: 12.5px; color: var(--atlas-text-mid); line-height: 1.6; overflow: hidden; max-height: 60px; transition: max-height .35s ease; }
.atlas-desc.expanded { max-height: 600px; }
.atlas-desc-fade {
    position: absolute; bottom: 24px; left: 0; right: 0; height: 30px;
    background: linear-gradient(transparent, var(--atlas-modal-bg));
    pointer-events: none; display: block;
}
.atlas-desc.expanded + .atlas-desc-fade { display: none; }
.atlas-desc-more {
    display: block; margin-top: 4px;
    font-size: 11.5px; color: var(--atlas-track); font-weight: 600;
    background: none; border: none; cursor: pointer; padding: 2px 0;
    font-family: inherit;
}
.atlas-desc-more:hover { text-decoration: underline; }
.atlas-desc-more.hidden { display: none; }

/* 버튼 */
.atlas-btn-row { display: flex; gap: 8px; }
.atlas-book {
    flex: 1; background: var(--atlas-track); color: #fff; border: none;
    padding: 12px; border-radius: 9px; font-size: 13px; font-weight: 700;
    text-decoration: none; text-align: center; cursor: pointer;
    font-family: inherit; transition: background .2s;
}
.atlas-book:hover { background: #be4c16; }
.atlas-close-btn {
    background: var(--atlas-sand); color: var(--atlas-text-mid); border: none;
    padding: 12px 16px; border-radius: 9px; font-size: 16px;
    cursor: pointer; transition: background .2s; line-height: 1;
}
.atlas-close-btn:hover { background: #d4c8bb; }

/* ─────── 마커 ─────── */
.atlas-pin {
    width: 28px; height: 28px;
    border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
    box-shadow: 0 3px 10px rgba(0,0,0,.35);
    border: 2.5px solid rgba(255,255,255,.7);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: transform .2s;
}
.atlas-pin:hover { transform: rotate(-45deg) scale(1.2); }
.atlas-pin span { transform: rotate(45deg); font-size: 12px; }
.atlas-pin-icon-img { width: 60%; height: 60%; transform: rotate(45deg); object-fit: contain; pointer-events: none; }

.atlas-pin-featured {
    width: 36px; height: 36px;
    border: 3px solid var(--atlas-gold);
    animation: atlas-pulse 2s infinite;
}
.atlas-pin-featured span { font-size: 15px; }
@keyframes atlas-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(212, 160, 23, 0.6); }
    70%  { box-shadow: 0 0 0 12px rgba(212, 160, 23, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 160, 23, 0); }
}

.atlas-pin-label {
    background: rgba(255,255,255,.95) !important;
    border: none !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.2) !important;
    color: #1b3a2a !important;
    font-family: 'Noto Sans KR', sans-serif !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 3px 8px !important;
    white-space: nowrap !important;
    letter-spacing: -0.2px !important;
}
.atlas-pin-label::before { display: none !important; }
.atlas-pin-label.featured {
    background: var(--atlas-gold) !important;
    color: #fff !important;
    font-weight: 700 !important;
}

/* 시작/끝/원점회귀 마커 */
.atlas-se-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px 4px 8px; border-radius: 14px;
    font-size: 11px; font-weight: 700; color: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,.35);
    white-space: nowrap;
    border: 2px solid #fff;
    position: relative;
}
.atlas-se-pill-icon { font-size: 13px; line-height: 1; }
.atlas-se-start { background: #2e7d32; }
.atlas-se-end   { background: #c62828; }
.atlas-se-loop  { background: linear-gradient(135deg, #2e7d32, #c87941); }

.atlas-se-anchor-top    { transform: translate(-50%, -100%) translateY(-6px); }
.atlas-se-anchor-bottom { transform: translate(-50%, 0) translateY(6px); }
.atlas-se-anchor-left   { transform: translate(-100%, -50%) translateX(-6px); }
.atlas-se-anchor-right  { transform: translate(0, -50%) translateX(6px); }

/* 클러스터 */
.marker-cluster-small  div { background: rgba(46,125,50,.9);  color:#fff; }
.marker-cluster-medium div { background: rgba(200,121,65,.9); color:#fff; }
.marker-cluster-large  div { background: rgba(180,60,30,.9);  color:#fff; }
.marker-cluster-small  { background: rgba(46,125,50,.3); }
.marker-cluster-medium { background: rgba(200,121,65,.3); }
.marker-cluster-large  { background: rgba(180,60,30,.3); }

/* 베이스맵 컨트롤 */
.leaflet-control-layers {
    background: rgba(255,255,255,.95);
    border: none; border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,.2);
    font-family: 'Noto Sans KR', sans-serif; font-size: 12px;
}
.leaflet-control-layers-toggle { width: 36px; height: 36px; background-size: 20px 20px; }
.leaflet-control-layers-expanded { padding: 10px 14px; }
.leaflet-control-layers label { margin: 4px 0; cursor: pointer; }
.leaflet-control-layers input[type="radio"] { margin-right: 6px; }

/* 메인 지도 토스트 */
.atlas-toast {
    position: absolute;
    top: 130px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(27,58,42,.95);
    color: #fff;
    padding: 10px 18px;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 6px 20px rgba(0,0,0,.3);
    z-index: 1500;
    transition: opacity .25s;
    max-width: 80%;
    text-align: center;
}
html[data-theme="dark"] .atlas-toast { background: rgba(74,124,89,.95); }
.atlas-toast-info { background: rgba(27,58,42,.95); }

/* ─────── 모바일 ─────── */
@media (max-width: 600px) {
    .atlas-brand-sub { display: none; }
    .atlas-search-input { width: 140px; }
    .atlas-search-result { width: calc(100vw - 32px); max-width: 320px; max-height: 50vh; }
    .atlas-search-course-name { font-size: 12px; }
    .atlas-filter { top: 66px; }
    #atlas-mini-map { height: 320px; }
    .atlas-swti-num { font-size: 20px; }
    .atlas-stat-val { font-size: 12px; }
}

/* ─────── 이미지 라이트박스 (새창 대신 팝업으로 크게 보기) ─────── */
.atlas-lightbox {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 99999;  /* body 최상위 배치 + 항상 최상단 (mapfull보다도 위) */
    align-items: center; justify-content: center;
}
.atlas-lightbox.open { display: flex; }
.atlas-lightbox-img {
    max-width: 92vw; max-height: 88vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.atlas-lightbox-close {
    position: absolute; top: 16px; right: 16px;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,.12); color: #fff; border: none;
    font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.atlas-lightbox-close:hover { background: rgba(255,255,255,.22); }
.atlas-lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255,255,255,.12); color: #fff; border: none;
    font-size: 28px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.atlas-lightbox-nav:hover { background: rgba(255,255,255,.22); }
.atlas-lightbox-prev { left: 16px; }
.atlas-lightbox-next { right: 16px; }
.atlas-lightbox-count {
    position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,.85); font-size: 12px;
    background: rgba(0,0,0,.4); padding: 4px 12px; border-radius: 12px;
}
@media (max-width: 600px) {
    .atlas-lightbox-nav { width: 40px; height: 40px; font-size: 24px; }
    .atlas-lightbox-prev { left: 6px; }
    .atlas-lightbox-next { right: 6px; }
}


/* ─────── 지도 크게 보기 ─────── */
.atlas-map-expand {
    /* 좌하단 배치 — 우상단은 Leaflet 지도종류 버튼, 우하단은 난이도 배지가 이미 차지함 */
    position: absolute; bottom: 8px; left: 8px; z-index: 1100;
    display: none;                      /* GPX 로드 후 JS가 표시 */
    padding: 10px 16px; border: none; border-radius: 10px;
    background: rgba(255,255,255,.93); color: #333;
    font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.atlas-map-expand:hover { background: #fff; }
html[data-theme="dark"] .atlas-map-expand { background: rgba(30,30,30,.9); color: #eee; }

.atlas-mapfull {
    display: none; position: fixed; inset: 0; z-index: 99998;  /* body 최상위 배치 + 항상 최상단 */
    background: var(--atlas-modal-bg); flex-direction: column;
}
html[data-theme="light"] .atlas-mapfull { background: #fff; }
.atlas-mapfull.open { display: flex; }
.atlas-mapfull-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 14px; border-bottom: 1px solid var(--atlas-sand); flex-shrink: 0;
}
.atlas-mapfull-title {
    font-size: 14px; font-weight: 700; color: var(--atlas-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.atlas-mapfull-close {
    width: 36px; height: 36px; flex-shrink: 0; border: none; border-radius: 50%;
    /* 배경(--atlas-modal-bg)이 다크/라이트에서 밝기가 반대라 아이콘 대비도 반대로 지정 */
    background: rgba(255,255,255,.16); color: #fff;
    font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
html[data-theme="light"] .atlas-mapfull-close { background: rgba(0,0,0,.4); color: #fff; }
.atlas-mapfull-close:hover { background: rgba(255,255,255,.28); }
html[data-theme="light"] .atlas-mapfull-close:hover { background: rgba(0,0,0,.6); }
.atlas-mapfull-map { flex: 1; min-height: 0; }
