/* ROAM Atlas 2 — original map-first experience */
body.leonida-theme[data-roam-page="map"] .atlas-main.wrap{width:min(1600px,calc(100% - 30px));max-width:1600px;display:flex;flex-direction:column;padding-top:14px;min-width:0}
body.leonida-theme[data-roam-page="map"] .atlas-main>.explorer-heading{order:0;display:flex;flex-wrap:wrap;gap:8px 24px;justify-content:space-between;align-items:end;margin:0 0 13px}
body.leonida-theme[data-roam-page="map"] .atlas-main>.explorer-heading h1{font-size:clamp(30px,4vw,51px);line-height:1.04;letter-spacing:-.02em}
body.leonida-theme[data-roam-page="map"] .atlas-main>.explorer-heading>p{font-size:12px;line-height:1.5;margin:0;max-width:52ch}
body.leonida-theme[data-roam-page="map"] .atlas-main>.atlas-layout{display:block!important;order:1!important;position:relative;width:100%;min-width:0}
body.leonida-theme[data-roam-page="map"] .atlas-main>.map-quick{order:2!important}
body.leonida-theme[data-roam-page="map"] .atlas-main>.atlas-evidence-intro{order:3!important;margin-top:12px}
body.leonida-theme[data-roam-page="map"] .atlas-main>.field-notice{order:4!important}
body.leonida-theme[data-roam-page="map"] .atlas-main>.data-note{order:5!important}
body.leonida-theme[data-roam-page="map"] .atlas-main>p:not(.data-note){order:6!important}
body.leonida-theme[data-roam-page="map"] .atlas-main>.guide-section{order:7!important}
body.leonida-theme[data-roam-page="map"] .atlas-main>.journey-strip{order:8!important}
body.leonida-theme[data-roam-page="map"] .atlas-layout>.map-section{width:100%;min-width:0;display:flex!important;flex-direction:column;order:0!important}
body.leonida-theme[data-roam-page="map"] .map-section>#map-frame{order:0!important}
body.leonida-theme[data-roam-page="map"] .map-section>.map-help{order:1!important;margin:12px 0 0}
body.leonida-theme[data-roam-page="map"] .map-section>#place-detail{order:2!important}
body.leonida-theme[data-roam-page="map"] .map-section>.map-legend{order:3!important;padding:12px 0;margin:10px 0 2px;border-bottom:1px solid var(--line)}
body.leonida-theme[data-roam-page="map"] .map-section>p:not(.map-help){order:4!important}
body.leonida-theme[data-roam-page="map"] #map-frame{box-sizing:border-box;width:100%;height:clamp(610px,calc(100dvh - 170px),960px)!important;max-width:100%;border:1px solid #537a8f;border-radius:15px;background:#2867a0;overflow:hidden;box-shadow:0 16px 40px #07091940}
body.leonida-theme[data-roam-page="map"] #map-frame canvas{touch-action:none;width:100%;height:100%}
body.leonida-theme[data-roam-page="map"] .map-toolbar{z-index:20;top:14px;right:14px;gap:5px;filter:drop-shadow(0 4px 9px #0007)}
body.leonida-theme[data-roam-page="map"] .map-toolbar button{box-sizing:border-box;width:47px;height:47px;min-width:47px;min-height:47px;border-radius:10px;background:#1c2030eb;border:1px solid #d0c1d577;color:#fff7f1;font:700 25px/1 system-ui}
body.leonida-theme[data-roam-page="map"] .map-toolbar #map-fit{margin-top:7px}
body.leonida-theme[data-roam-page="map"] .map-toolbar button:is(:hover,:focus-visible){background:#50374f;outline-offset:2px}
body.leonida-theme[data-roam-page="map"] .map-pin{width:29px;height:29px;border:2px solid #f7ffff;background:#335168;color:white;font-size:19px;box-shadow:0 3px 12px #06132990;pointer-events:auto}
body.leonida-theme[data-roam-page="map"] .map-pin.cluster{width:45px;height:45px;border:2px solid #f8fff6;background:#79d0a0;color:#113b28;font:750 13px/1 system-ui;box-shadow:0 0 0 7px #41c39240,0 4px 17px #0c243590}
body.leonida-theme[data-roam-page="map"] .map-pin.cluster[data-density=medium]{width:49px;height:49px;background:#ffd06d;color:#372707;box-shadow:0 0 0 8px #ffbc3b4a,0 4px 17px #0c243590}
body.leonida-theme[data-roam-page="map"] .map-pin.cluster[data-density=high]{width:52px;height:52px;background:#fca87b;color:#382115;box-shadow:0 0 0 9px #fc87534d,0 4px 17px #0c243590}
body.leonida-theme[data-roam-page="map"] .map-pin.selected{outline:3px solid white;outline-offset:3px;z-index:3}
body.leonida-theme[data-roam-page="map"] .map-legend .density-low{background:#79d0a0}
body.leonida-theme[data-roam-page="map"] .map-legend .density-medium{background:#ffd06d}
body.leonida-theme[data-roam-page="map"] .map-legend .density-high{background:#fca87b}
body.leonida-theme[data-roam-page="map"] .map-caption{z-index:6;padding:8px 12px;background:#132337ed;color:#f6fbff;font-size:9px;letter-spacing:0}
body.leonida-theme[data-roam-page="map"] .roam-map-stamp{position:absolute;z-index:7;bottom:43px;left:12px;border-radius:10px;background:#1a2438de;color:white;border:1px solid #c5dae655;box-shadow:0 4px 16px #0007;padding:9px 12px;display:flex;flex-direction:column;gap:3px;pointer-events:none;backdrop-filter:blur(8px)}
body.leonida-theme[data-roam-page="map"] .roam-map-stamp strong{font:800 12px/1 system-ui;letter-spacing:.07em}
body.leonida-theme[data-roam-page="map"] .roam-map-stamp span{font:500 9px/1.3 system-ui;color:#c9d6e0}
body.leonida-theme[data-roam-page="map"] .atlas-layout>.map-panel{position:absolute!important;top:14px;left:14px;right:auto;z-index:1300;order:0!important;width:148px;min-width:0;max-width:calc(100% - 80px);padding:0!important;border:0!important;border-radius:13px;background:none;box-shadow:none;margin:0}
body.leonida-theme[data-roam-page="map"] .atlas-layout>.map-panel>.map-panel-toggle{display:flex!important;list-style:none;align-items:center;justify-content:center;gap:8px;min-height:49px;width:148px;box-sizing:border-box;margin:0;padding:10px 14px;border:1px solid #edbed06b;border-radius:12px;background:#211b31f0;color:#fff3f5;box-shadow:0 5px 22px #0008;font:700 14px/1.2 system-ui;cursor:pointer;backdrop-filter:blur(8px)}
body.leonida-theme[data-roam-page="map"] .map-panel-toggle::-webkit-details-marker{display:none}
body.leonida-theme[data-roam-page="map"] .map-panel-toggle::marker{content:""}
body.leonida-theme[data-roam-page="map"] .map-panel-toggle .filters-glyph{font:700 20px/1 system-ui;color:#ffd0df}
body.leonida-theme[data-roam-page="map"] .map-panel-toggle .map-filter-count{background:#ffcfb8;color:#432733;padding:2px 6px;border-radius:30px;font:700 11px/1 system-ui}
body.leonida-theme[data-roam-page="map"] .atlas-layout>.map-panel[open]{width:min(415px,calc(100% - 80px));max-height:min(73dvh,700px);overflow-y:auto;overscroll-behavior:contain;border:1px solid #edbed06b!important;background:var(--panel);border-radius:14px;box-shadow:0 10px 40px #0009;scrollbar-width:thin}
body.leonida-theme[data-roam-page="map"] .atlas-layout>.map-panel[open]>.map-panel-toggle{position:sticky;top:0;z-index:1;width:100%;border:0;border-bottom:1px solid var(--line);border-radius:13px 13px 0 0;box-shadow:none}
body.leonida-theme[data-roam-page="map"] .atlas-layout>.map-panel .map-panel-content{display:flex;flex-direction:column;gap:0;padding:14px!important;min-width:0}
body.leonida-theme[data-roam-page="map"] .atlas-layout>.map-panel:not([open])>.map-panel-content{display:none!important}
body.leonida-theme[data-roam-page="map"] .atlas-layout>.map-panel .atlas-filters{order:0;border:0;border-bottom:1px solid var(--line);padding:0 0 14px}
body.leonida-theme[data-roam-page="map"] .atlas-layout>.map-panel .atlas-results{order:1;border:0;padding:14px 0}
body.leonida-theme[data-roam-page="map"] .atlas-layout>.map-panel .map-lists{order:2;margin:0;padding:14px 0 0;border:0;border-top:1px solid var(--line);background:none}
body.leonida-theme[data-roam-page="map"] .atlas-layout>.map-panel .place-list{max-height:min(30dvh,255px);overflow-y:auto}
body.leonida-theme[data-roam-page="map"] .map-quick{display:flex;align-items:center;flex-wrap:wrap;gap:10px 16px;margin:14px 0;padding:11px 14px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
body.leonida-theme[data-roam-page="map"] .map-quick h2{font-size:16px;margin:0}
body.leonida-theme[data-roam-page="map"] .map-quick p{font-size:11px;margin:4px 0 0}
body.leonida-theme[data-roam-page="map"] .map-quick-actions{display:flex;flex:1;align-items:center;flex-wrap:nowrap!important;gap:8px;overflow-x:auto!important;max-width:100%;padding:4px 0}
body.leonida-theme[data-roam-page="map"] .map-quick-actions button{white-space:nowrap;flex:0 0 auto;border-radius:9px;font-size:12px;min-height:40px;padding:8px 12px}
body.leonida-theme[data-roam-page="map"] #map-frame.expanded{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;border-radius:0!important;border:0!important;z-index:1100!important}
body.leonida-theme[data-roam-page="map"] #roam-map-floating-filters{display:none;position:absolute;z-index:1200;top:13px;left:13px;align-items:center;justify-content:center;padding:11px 14px;min-height:47px;border-radius:12px;border:1px solid #edbed06b;background:#211b31f0;color:#fff4f6;font:700 14px/1 system-ui;box-shadow:0 4px 16px #0008}
body.leonida-theme[data-roam-page="map"] #map-frame.expanded #roam-map-floating-filters{display:inline-flex}
body.leonida-theme[data-roam-page="map"] .atlas-layout:has(#map-frame.expanded)>.map-panel[open]{position:fixed!important;top:72px;left:13px;z-index:1400}
@media(max-width:850px){
body.leonida-theme[data-roam-page="map"] .atlas-main.wrap{width:calc(100% - 18px);padding-top:8px}
body.leonida-theme[data-roam-page="map"] .atlas-main>.explorer-heading{gap:3px;margin-bottom:9px;padding-inline:6px}
body.leonida-theme[data-roam-page="map"] .atlas-main>.explorer-heading h1{font-size:clamp(27px,6vw,38px)}
body.leonida-theme[data-roam-page="map"] .atlas-main>.explorer-heading>p{font-size:11px}
body.leonida-theme[data-roam-page="map"] #map-frame{height:clamp(540px,calc(100dvh - 165px),850px)!important;border-radius:12px}
body.leonida-theme[data-roam-page="map"] .atlas-layout>.map-panel{top:10px;left:10px}
body.leonida-theme[data-roam-page="map"] .atlas-layout>.map-panel>.map-panel-toggle{min-height:47px;width:132px;font-size:13px}
body.leonida-theme[data-roam-page="map"] .atlas-layout>.map-panel[open]{width:calc(100% - 20px);max-width:calc(100% - 20px);max-height:70dvh}
body.leonida-theme[data-roam-page="map"] .map-toolbar{top:10px;right:10px}
body.leonida-theme[data-roam-page="map"] .map-toolbar button{width:46px;height:46px}
body.leonida-theme[data-roam-page="map"] .map-quick>div:first-child{width:100%}
body.leonida-theme[data-roam-page="map"] .map-quick-actions{width:100%;flex:1 1 100%}
body.leonida-theme[data-roam-page="map"] .roam-map-stamp{left:10px;bottom:42px}
body.leonida-theme[data-roam-page="map"] .atlas-layout:has(#map-frame.expanded)>.map-panel[open]{top:70px;left:10px;width:calc(100vw - 20px);max-width:calc(100vw - 20px)}
body.leonida-theme[data-roam-page="map"] #map-frame.expanded{height:100dvh!important}
}
@media(max-width:440px){
body.leonida-theme[data-roam-page="map"] .atlas-main>.explorer-heading>p{font-size:10px}
body.leonida-theme[data-roam-page="map"] .map-pin.cluster[data-density=high]{width:49px;height:49px}
}
@media(prefers-reduced-motion:reduce){body.leonida-theme[data-roam-page="map"] .map-pin.cluster{transition:none}}
