/* Map overlays and the Data & Layers drawer frame, shared by the logged-in Site Studio (templates/site_studio.html)
   and the logged-out demo (templates/studio_demo.html). Premium UI pass, 2026-11-09 (agent B); Acrelume Option A,
   2026-11-18: the mockup's map chrome (static/mockups/acrelume/a/studio.html): white surfaces, 1 px hairlines, 32 px
   controls, radius 6/8, no shadows on map controls (only on popups, which are popovers), the accent only on Save,
   the pin and the analysis radius.
   Loaded after every other studio stylesheet; uses the --ac-* / --st-* tokens from studio-tokens.css.
   Covers: layers drawer frame (+ the demo's layer rows), search / coordinates / analysis-radius card, map toolbar
   (Map | Satellite | Terrain, Layers, Save), the site pin, zoom control, attribution and popups.
   Map colours (voltage, flood, substations, radius): static/js/studio-map.js. */

/* Street tiles a little quieter, like the mockup's neutral base map (OSM tiles; the "Dark" base map has its own filter) */
.ss-studio-v2 .leaflet-tile-pane .leaflet-layer:not(.ss-tiles-dark) img.leaflet-tile[src*="tile.openstreetmap.org"] { filter: saturate(.55) contrast(.97) brightness(1.02); }
.dark-mode .ss-studio-v2 .leaflet-tile-pane .leaflet-layer:not(.ss-tiles-dark) img.leaflet-tile[src*="tile.openstreetmap.org"],
.ss-studio-v2.dark-mode .leaflet-tile-pane .leaflet-layer:not(.ss-tiles-dark) img.leaflet-tile[src*="tile.openstreetmap.org"] { filter: saturate(.45) brightness(.86) contrast(.95); }
.ss-studio-v2 #map, .ss-studio-v2 .leaflet-container { background: var(--ac-bg); font-family: var(--ac-font); }

/* =====================================================================================================
   Layers drawer (left): a white panel with a hairline edge, no shadow (as the mockup's layers panel)
   ===================================================================================================== */
.ss-studio-v2 #dataLayersCard {
    background: var(--st-panel) !important; color: var(--st-text);
    border: 0 !important; border-right: 1px solid var(--ac-border) !important; border-radius: 0 !important;
    box-shadow: none !important; font-family: var(--ac-font);
}
.ss-studio-v2 #dataLayersCard > .card-header {
    height: 48px; min-height: 48px; padding: 0 52px 0 var(--st-sp-4) !important; display: flex; align-items: center;
    background: transparent !important; border: 0 !important; border-bottom: 1px solid var(--ac-border) !important;
}
.ss-studio-v2 #dataLayersCard > .card-header .card-title {
    display: flex; align-items: center; gap: var(--st-sp-2); font-size: 13px; font-weight: 600;
    letter-spacing: 0; color: var(--ac-text);
}
.ss-studio-v2 #dataLayersCard > .card-header .card-title .icon { width: var(--st-ic); height: var(--st-ic); color: var(--st-text-2); stroke-width: var(--st-ic-stroke); }
.ss-studio-v2 #dataLayersCard .card-content { height: calc(100% - 48px) !important; background: transparent !important; padding-top: var(--st-sp-2); }
.ss-studio-v2 .ss-drawer-close {
    top: 8px; right: 8px; width: var(--st-h-ctl); height: var(--st-h-ctl); border-radius: var(--st-r-md); color: var(--st-text-2);
    transition: background-color var(--st-dur) var(--st-ease), color var(--st-dur) var(--st-ease);
}
.ss-studio-v2 .ss-drawer-close:hover { background: var(--st-fill-hover); color: var(--st-text); }
.ss-studio-v2 .ss-drawer-close:focus-visible { outline: none; box-shadow: var(--st-focus); }
.ss-studio-v2 .ss-drawer-close svg { width: var(--st-ic); height: var(--st-ic); stroke-width: var(--st-ic-stroke); }
/* thin, quiet scrollbar inside the drawer */
.ss-studio-v2 #dataLayersCard .card-content, .sd-layers-body { scrollbar-width: thin; scrollbar-color: var(--st-fill-strong) transparent; }

/* ---------- the demo's layer rows (studio-demo.js renderLayersList) ---------- */
.sd-page .sd-layers-body { padding: 0 var(--st-sp-2) var(--st-sp-2); }
.sd-page .sd-ly { border: 0; border-radius: var(--st-r-md); padding: 10px var(--st-sp-2); margin: 0; transition: background-color var(--st-dur) var(--st-ease); }
.sd-page .sd-ly + .sd-ly { border-top: 0; margin-top: 0; }
.sd-page .sd-ly:hover { background: var(--ac-surface-2); }
.sd-page .sd-ly-top { display: flex; align-items: center; gap: var(--st-sp-3); }
.sd-page .sd-ly-name { flex: 1; min-width: 0; font-size: var(--st-fs-md); font-weight: var(--st-fw-medium); color: var(--st-text); }
.sd-page .sd-ly-src { margin-top: 2px; font-size: var(--ac-fs-xs); line-height: 1.4; color: var(--ac-text-3); }
.sd-page .sd-ly-st { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: var(--st-fs-sm); line-height: 1.4; color: var(--st-text-2); }
.sd-page .sd-ly-st::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--st-text-3); }
.sd-page .sd-ly-st[data-st="ok"]::before { background: var(--st-good); }
.sd-page .sd-ly-st[data-st="loading"]::before { background: var(--ac-text-3); animation: ss-map-pulse 1.2s ease-in-out infinite; }
.sd-page .sd-ly-st[data-st="err"]::before { background: var(--st-bad); }
.sd-page .sd-ly-st[data-st="off"]::before { display: none; }
.sd-page .sd-ly.is-off .sd-ly-leg { display: none; }
.sd-page .sd-ly-leg { display: grid; grid-template-columns: 1fr; gap: 0; margin-top: var(--st-sp-2); font-size: var(--ac-fs-sm); color: var(--ac-text-2); }
.sd-page .sd-ly-leg span { display: flex; align-items: center; gap: var(--st-sp-2); min-height: 20px; }
/* swatches: the same shapes as the logged-in legend (layers-panel.css .ss-lp-sw-*); colour from --sw */
.sd-page .sd-ly-leg i { flex: none; width: 18px; height: var(--sw-h, 3px); border-radius: 2px; background: var(--sw); }
.sd-page .sd-ly-leg i.f { width: 10px; height: 10px; border-radius: 2px; background: color-mix(in srgb, var(--sw) 35%, transparent); box-shadow: inset 0 0 0 1.5px var(--sw); }
.sd-page .sd-ly-leg i.d { width: 10px; height: 10px; border-radius: 50%; }
.sd-page .sd-ly-leg i.r { width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px var(--sw); }
.sd-page .sd-ly-leg i.r.dash { box-shadow: none; border: 1.5px dashed var(--sw); }
/* the demo switch is the shared .st-switch; the old ::after thumb is not used */
.sd-page .sd-sw.st-switch::after { content: none; }
.sd-page .sd-layers-more {
    margin: var(--st-sp-2) var(--st-sp-4) var(--st-sp-4); padding: var(--st-sp-3); border: 1px solid var(--ac-border); border-radius: var(--ac-r-lg);
    background: var(--ac-surface-2); box-shadow: none; font-size: var(--ac-fs-sm); line-height: var(--ac-lh); color: var(--ac-text-2);
}
.sd-page .sd-layers-more svg { color: var(--ac-text-2); stroke-width: var(--st-ic-stroke); }
.sd-page .sd-layers-more .sd-linkbtn { color: var(--ac-text); font-size: var(--ac-fs-sm); font-weight: 500; text-decoration: underline; text-decoration-color: var(--ac-border-strong); text-underline-offset: 2px; }
.sd-page .sd-layers-more .sd-linkbtn:hover { text-decoration-color: currentColor; }
@keyframes ss-map-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* =====================================================================================================
   Floating search card (top left of the map)
   ===================================================================================================== */
.ss-studio-v2 #locationCard {
    background: var(--st-surface) !important; color: var(--st-text);
    border: 1px solid var(--ac-border) !important; border-radius: var(--ac-r-lg) !important; box-shadow: none !important;
    font-family: var(--ac-font); min-width: 0 !important; max-width: none !important;
}
.ss-studio-v2:not(.sd-page) #locationCard .card-body { padding: var(--st-sp-1) !important; }
.ss-studio-v2 #locationCard .ss-search-wrap { position: relative; }
/* the search field sits flush inside the card: the card is the frame */
.ss-studio-v2 #locationCard #locationInput {
    width: 100% !important; height: 36px !important; padding: 0 40px 0 34px !important; border: 0 !important; border-radius: var(--st-r-md) !important;
    background: transparent !important; color: var(--st-text) !important; font-size: var(--st-fs-md) !important; box-shadow: none !important;
}
.ss-studio-v2 #locationCard #locationInput::placeholder { color: var(--st-text-3); opacity: 1; }
.ss-studio-v2 #locationCard #locationInput:focus { outline: none; background: transparent !important; box-shadow: none !important; }
/* focus shows on the whole card (the field has no frame of its own) */
.ss-studio-v2 #locationCard:has(#locationInput:focus) { border-color: var(--ac-text-2) !important; box-shadow: none !important; }
.ss-studio-v2 #locationCard .ss-search-icon { left: 10px; width: var(--st-ic); height: var(--st-ic); color: var(--st-text-2); stroke-width: var(--st-ic-stroke); }
.ss-studio-v2 #locationCard .ss-coord-btn {
    right: 2px; width: 32px; height: 32px; width: var(--st-h-ctl); height: var(--st-h-ctl); border-radius: var(--st-r-md); color: var(--st-text-2);
    transition: background-color var(--st-dur) var(--st-ease), color var(--st-dur) var(--st-ease);
}
.ss-studio-v2 #locationCard .ss-coord-btn:hover { background: var(--st-fill-hover); color: var(--st-text); }
.ss-studio-v2 #locationCard .ss-coord-btn[aria-expanded="true"] { background: var(--ac-hover); color: var(--ac-text); }
.ss-studio-v2 #locationCard .ss-coord-btn:focus-visible { outline: none; box-shadow: var(--st-focus); }
.ss-studio-v2 #locationCard .ss-coord-btn svg { width: var(--st-ic); height: var(--st-ic); stroke-width: var(--st-ic-stroke); }

/* coordinates + radius: a second block under a hairline, same inner padding everywhere */
.ss-studio-v2 #locationCard.ss-show-advanced .ss-search-wrap { margin-bottom: 0 !important; }
.ss-studio-v2 #locationCard .ss-coords {
    gap: var(--st-sp-2) !important; margin: var(--st-sp-1) 0 0 !important; padding: var(--st-sp-3) var(--st-sp-3) 0 !important;
    border-top: 1px solid var(--st-border);
}
.ss-field { display: flex; flex-direction: column; gap: var(--st-sp-1); flex: 1 1 0; min-width: 0; }
.ss-field-l { font-size: var(--st-fs-sm); font-weight: var(--st-fw-medium); color: var(--st-text-2); }
.ss-studio-v2 #locationCard .ss-field .input-field {
    flex: none !important; width: 100%; height: var(--st-h-ctl) !important; padding: 0 10px !important; border: 1px solid var(--ac-border) !important;
    border-radius: var(--st-r-md) !important; background: var(--st-surface) !important; color: var(--st-text) !important;
    font-size: var(--st-fs-md) !important; font-variant-numeric: tabular-nums; box-shadow: none !important;
    transition: border-color var(--st-dur) var(--st-ease), box-shadow var(--st-dur) var(--st-ease);
}
.ss-studio-v2 #locationCard .ss-field .input-field::placeholder { color: var(--st-text-3); opacity: 1; }
.ss-studio-v2 #locationCard .ss-field .input-field:hover { border-color: var(--ac-border-strong) !important; }
.ss-studio-v2 #locationCard .ss-field .input-field:focus { outline: none; border-color: var(--ac-text-2) !important; box-shadow: none !important; }
.ss-studio-v2 #locationCard .ss-field .input-field[aria-invalid="true"] { border-color: var(--ac-bad) !important; box-shadow: none !important; }
.ss-studio-v2 #locationCard #coordinateError {
    margin: var(--st-sp-2) var(--st-sp-3) 0 !important; padding: var(--st-sp-2) var(--st-sp-3) !important; border-radius: var(--st-r-md) !important;
    background: var(--ac-bad-tint) !important; color: var(--ac-bad) !important; font-size: var(--st-fs-sm) !important; text-align: left !important;
    border: 1px solid var(--ac-bad-line);
}

/* analysis radius: label + area on one line, preset chips below (replaces the old slider) */
.ss-studio-v2 #locationCard #analysisRadiusContainer.ss-radius,
.ss-radius {
    margin: 0 !important; padding: var(--st-sp-4) var(--st-sp-3) var(--st-sp-3) !important;
    background: transparent !important; border: 0 !important; border-radius: 0 !important;
}
.ss-radius-h { display: flex; align-items: baseline; justify-content: space-between; gap: var(--st-sp-2); margin: 0 0 var(--st-sp-2) !important; }
.ss-radius-t { font-size: var(--st-fs-sm); font-weight: var(--st-fw-medium); color: var(--st-text-2); }
.ss-radius .analysis-radius-acres {
    margin: 0; padding: 0; background: none; border: 0; font-size: var(--st-fs-sm); font-weight: var(--st-fw-medium);
    color: var(--st-text); font-variant-numeric: tabular-nums;
}
/* the chips are one A segmented control: hairline frame, hairlines between, the chosen one filled */
.ss-radius-chips {
    display: grid; grid-template-columns: repeat(5, auto); gap: 0; padding: 0 !important; border-radius: var(--ac-r); overflow: hidden;
    background: var(--ac-surface); border: 1px solid var(--ac-border); box-shadow: none;
}
.ss-rchip {
    height: var(--st-h-ctl-sm); padding: 0 var(--st-sp-2); border: 0; border-radius: 0; background: transparent;
    color: var(--ac-text-2); font: inherit; font-size: var(--st-fs-sm); font-weight: 500; white-space: nowrap; cursor: pointer;
    font-variant-numeric: tabular-nums;
    transition: background-color var(--st-dur) var(--st-ease), color var(--st-dur) var(--st-ease);
}
.ss-rchip + .ss-rchip { border-left: 1px solid var(--ac-border); }
.ss-rchip:hover { color: var(--ac-text); }
.ss-rchip[aria-pressed="true"] { background: var(--ac-hover); color: var(--ac-text); box-shadow: none; }
.ss-rchip:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px var(--ac-text-2); }
.ss-radius-custom[hidden] { display: none !important; }
.ss-radius-custom { display: flex; align-items: flex-end; flex-wrap: wrap; gap: var(--st-sp-2); margin: var(--st-sp-3) 0 0 !important; }
.ss-field-inline { position: relative; flex: 0 1 140px; }
.ss-field-inline .ss-field-u { position: absolute; right: var(--st-sp-3); bottom: 8px; font-size: var(--st-fs-sm); color: var(--st-text-2); pointer-events: none; }
.ss-studio-v2 #locationCard .ss-field-inline .input-field { padding-right: 32px !important; -moz-appearance: textfield; appearance: textfield; }
.ss-field-inline .input-field::-webkit-inner-spin-button, .ss-field-inline .input-field::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ss-studio-v2 #locationCard .ss-field-u { right: var(--st-sp-3) !important; }
.ss-radius-apply {
    height: var(--st-h-ctl); padding: 0 var(--st-sp-3); border: 1px solid var(--ac-border-strong); border-radius: var(--ac-r);
    background: var(--st-surface); color: var(--st-text); font: inherit; font-size: var(--st-fs-md); font-weight: var(--st-fw-medium); cursor: pointer;
    transition: background-color var(--st-dur) var(--st-ease);
}
.ss-radius-apply:hover { background: var(--ac-hover); }
.ss-radius-apply:focus-visible { outline: none; box-shadow: var(--st-focus); }
.ss-radius-hint { flex-basis: 100%; font-size: var(--st-fs-sm); color: var(--st-text-2); }

/* the demo's search card */
.sd-page #locationCard .sd-search-hint { color: var(--st-text-2); font-size: var(--st-fs-sm); }
.sd-page #locationCard .sd-search-hint svg { stroke-width: var(--st-ic-stroke); }
.sd-page #locationCard .sd-h1 { font-size: var(--st-fs-lg); font-weight: var(--st-fw-semibold); letter-spacing: var(--st-tracking-tight); color: var(--st-text); }
.sd-page #locationCard .sd-intro { font-size: var(--st-fs-sm); line-height: var(--st-lh); color: var(--st-text-2); }
.sd-page #locationCard .sd-hero + .ss-search-wrap { border-top-color: var(--st-border); }
.sd-page #locationCard .sd-examples { border-top-color: var(--st-border); color: var(--st-text-2); font-size: var(--st-fs-sm); }
.sd-page #locationCard .sd-ex {
    height: 24px; display: inline-flex; align-items: center; padding: 0 8px; border: 1px solid var(--ac-border); border-radius: var(--ac-r-xs);
    background: var(--ac-surface); color: var(--ac-text-2); font-size: var(--ac-fs-sm); font-weight: 400;
}
.sd-page #locationCard .sd-ex:hover { background: var(--ac-hover); color: var(--ac-text); }
.sd-page #locationCard .sd-ex.on { background: var(--ac-hover); border-color: var(--ac-border-strong); color: var(--ac-text); font-weight: 500; }

/* =====================================================================================================
   Map toolbar (as the mockup's .map-toolbar): Map | Satellite | Terrain as one segmented control (.ss-bm-seg),
   Layers as a plain button, Save as the one filled (accent) button. 32 px, hairlines, no shadows.
   ===================================================================================================== */
.ss-studio-v2 .ss-studio-toolbar { gap: var(--st-sp-2); align-items: center; }
.ss-bm-seg {
    display: inline-flex; height: var(--ac-h-ctl); border: 1px solid var(--ac-border); border-radius: var(--ac-r); overflow: hidden;
    background: var(--ac-surface); flex: none;
}
.ss-bm-seg > button {
    display: inline-flex; align-items: center; border: 0; margin: 0; padding: 0 10px; background: transparent; color: var(--ac-text-2);
    font: 500 13px/1 var(--ac-font); white-space: nowrap; cursor: pointer; transition: background-color var(--ac-dur) var(--ac-ease), color var(--ac-dur) var(--ac-ease);
}
.ss-bm-seg > button + button { border-left: 1px solid var(--ac-border); }
.ss-bm-seg > button:hover { color: var(--ac-text); }
.ss-bm-seg > .is-on, .ss-bm-seg > [aria-pressed="true"] { background: var(--ac-hover); color: var(--ac-text); }
.ss-bm-seg > button:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px var(--ac-text-2); }
.ss-studio-v2 .ss-studio-toolbar .ss-tool-btn {
    display: inline-flex; align-items: center; gap: 6px; height: var(--ac-h-ctl); padding: 0 12px; margin: 0;
    border: 1px solid var(--ac-border-strong); border-radius: var(--ac-r); background: var(--ac-surface); color: var(--ac-text); box-shadow: none;
    font: 500 13px/1 var(--ac-font); white-space: nowrap;
    transition: background-color var(--st-dur) var(--st-ease), color var(--st-dur) var(--st-ease);
}
.ss-studio-v2 .ss-studio-toolbar .ss-tool-btn svg { width: var(--ac-ic); height: var(--ac-ic); stroke-width: var(--ac-ic-stroke); color: var(--ac-text-2); }
.ss-studio-v2 .ss-studio-toolbar .ss-tool-btn:not(.ss-tool-primary):hover { background: var(--ac-hover); color: var(--ac-text); }
.ss-studio-v2 .ss-studio-toolbar .ss-tool-btn.active,
.ss-studio-v2 .ss-studio-toolbar .ss-tool-btn.active:hover { background: var(--ac-hover); border-color: var(--ac-text-2); color: var(--ac-text); }
.ss-studio-v2 .ss-studio-toolbar .ss-tool-btn.active svg { color: var(--ac-text); }
.ss-studio-v2 .ss-studio-toolbar .ss-tool-primary {
    background: var(--ac-accent); border-color: var(--ac-accent); color: var(--ac-text-on-accent); font-weight: 500;
}
.ss-studio-v2 .ss-studio-toolbar .ss-tool-primary svg { color: currentColor; }
.ss-studio-v2 .ss-studio-toolbar .ss-tool-primary:hover { background: var(--ac-accent-hover); border-color: var(--ac-accent-hover); color: var(--ac-text-on-accent); }
.ss-studio-v2 .ss-studio-toolbar .ss-tool-btn:focus-visible { outline: none; box-shadow: var(--ac-focus-ring); position: relative; z-index: 1; }
.ss-studio-v2 .ss-ai-reopen {
    height: var(--ac-h-ctl); padding: 0 12px; gap: 6px; border-radius: var(--ac-r); background: var(--ac-surface); color: var(--ac-text);
    border: 1px solid var(--ac-border-strong); box-shadow: none; font: 500 13px/1 var(--ac-font);
}
.ss-studio-v2 .ss-ai-reopen:hover { background: var(--ac-hover); }
.ss-studio-v2 .ss-ai-reopen svg { width: 16px; height: 16px; color: var(--ac-text-2); }

/* =====================================================================================================
   Site pin (static/js/studio-map.js pinIcon): the mockup's teardrop in the accent, white outline and core, no shadow
   ===================================================================================================== */
.ss-pin { background: none; border: 0; }
.ss-pin-svg { position: absolute; left: 0; top: 0; overflow: visible; display: block; }
.ss-pin-body { fill: var(--ac-accent, #E4572E); stroke: #fff; stroke-width: 1.5; }
.ss-pin-core { fill: #fff; }
.ss-pin { animation: ss-pin-drop .32s var(--st-ease, ease-out) both; transform-origin: 50% 100%; }
@keyframes ss-pin-drop { from { opacity: 0; translate: 0 -8px; } to { opacity: 1; translate: 0 0; } }

/* =====================================================================================================
   Leaflet controls: zoom, attribution, popups
   ===================================================================================================== */
.ss-studio-v2 .leaflet-bar { border: 1px solid var(--ac-border) !important; border-radius: var(--ac-r); box-shadow: none; overflow: hidden; }
.ss-studio-v2 .leaflet-bar a {
    width: var(--st-h-ctl); height: var(--st-h-ctl); line-height: var(--st-h-ctl); background: var(--st-surface); color: var(--st-text-2);
    border-bottom: 1px solid var(--st-border); font: 400 18px/var(--st-h-ctl) var(--st-font);
    transition: background-color var(--st-dur) var(--st-ease), color var(--st-dur) var(--st-ease);
}
.ss-studio-v2 .leaflet-bar a:last-child { border-bottom: 0; }
.ss-studio-v2 .leaflet-bar a:hover { background: var(--st-fill); color: var(--st-text); }
.ss-studio-v2 .leaflet-bar a.leaflet-disabled { color: var(--st-text-3); background: var(--st-surface); }
.ss-studio-v2 .leaflet-bar a:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px var(--ac-text-2); }

/* Attribution: smaller and quieter, but complete and readable (the licences require it) */
.ss-studio-v2 .leaflet-control-attribution {
    margin: 0 !important; padding: 1px 6px !important; border-radius: var(--ac-r-xs) 0 0 0;
    background: color-mix(in srgb, var(--ac-surface) 85%, transparent) !important;
    color: var(--ac-text-3) !important; font: 400 10px/1.5 var(--ac-font) !important; letter-spacing: 0;
}
.ss-studio-v2 .leaflet-control-attribution a { color: var(--ac-text-2) !important; text-decoration: none; }
.ss-studio-v2 .leaflet-control-attribution a:hover { color: var(--st-text) !important; text-decoration: underline; text-underline-offset: 2px; }

/* Popups (lines, substations, zones) in the same type and surfaces */
.ss-studio-v2 .leaflet-popup-content-wrapper {
    border-radius: var(--ac-r); background: var(--ac-surface); color: var(--ac-text);
    border: 1px solid var(--ac-border); box-shadow: var(--ac-menu-shadow);
}
.ss-studio-v2 .leaflet-popup-content { margin: var(--st-sp-2) var(--st-sp-3); font: 400 var(--ac-fs-sm)/var(--ac-lh) var(--ac-font); }
.ss-studio-v2 .leaflet-popup-content strong { font-weight: var(--st-fw-semibold); }
.ss-studio-v2 .leaflet-popup-content small { color: var(--st-text-2); }
.ss-studio-v2 .leaflet-popup-tip { background: var(--ac-surface); box-shadow: none; border: 1px solid var(--ac-border); }
.ss-studio-v2 .leaflet-container a.leaflet-popup-close-button { color: var(--st-text-2); }

/* =====================================================================================================
   Responsive
   ===================================================================================================== */
/* Drawer open on a desktop: the search card shares the top edge with the toolbar, which drops its view labels */
@media (min-width: 769px) and (max-width: 1599px) {
    .ss-studio-v2 .feature-cards-container:has(#dataLayersCard.ss-open) ~ .ss-studio-toolbar .ss-tool-btn:not(.ss-tool-primary) span,
    .ss-studio-v2:has(#dataLayersCard.ss-open) .ss-studio-toolbar .ss-tool-btn:not(.ss-tool-primary) span { display: none; }
    .ss-studio-v2:has(#dataLayersCard.ss-open) .ss-studio-toolbar .ss-tool-btn:not(.ss-tool-primary) { padding: 0 10px; }
}
@media (min-width: 769px) {
    /* never let the search card run under the toolbar */
    .ss-studio-v2:not(.sd-page) .feature-cards-container:has(#dataLayersCard.ss-open) #locationCard {
        width: min(420px, calc(100% - var(--ss-ai-w) - 332px - 380px)) !important;
    }
}
/* Too narrow for both side by side: the search card drops below the toolbar row instead of running under it */
@media (min-width: 769px) and (max-width: 1279px) {
    .ss-studio-v2.sd-page .feature-cards-container:has(#dataLayersCard.ss-open) #locationCard {
        top: 64px !important; width: min(352px, calc(100% - var(--ss-ai-w) - 288px - 16px)) !important;
    }
}
@media (min-width: 769px) and (max-width: 1439px) {
    .ss-studio-v2:not(.sd-page) .feature-cards-container:has(#dataLayersCard.ss-open) #locationCard {
        top: 60px !important; width: min(420px, calc(100% - var(--ss-ai-w) - 332px - 12px)) !important;
    }
}
@media (min-width: 769px) and (max-width: 1100px) {
    .ss-studio-v2 .ss-studio-toolbar .ss-tool-btn:not(.ss-tool-primary) { padding: 0 10px; }
}
/* Phone: attribution wraps instead of being cut off; bigger hit areas */
@media (max-width: 768px) {
    .ss-studio-v2 .leaflet-control-attribution {
        max-width: calc(100vw - 64px) !important; white-space: normal !important; overflow: visible !important; text-overflow: clip !important;
        font-size: 9.5px !important; line-height: 1.4 !important; text-align: right;
    }
    .ss-studio-v2 .ss-studio-toolbar .ss-tool-btn, .ss-bm-seg { height: 36px; }
    .ss-studio-v2 .ss-studio-toolbar .ss-tool-btn { padding: 0 10px; }
    .ss-bm-seg > button { padding: 0 8px; font-size: 12px; }
    /* keep the toolbar clear of the (wrapping) attribution at the bottom of the map */
    .ss-studio-v2 .ss-studio-toolbar, .ss-studio-v2 .sd-toolbar.ss-studio-toolbar { top: calc(46vh - 100px) !important; top: calc(46dvh - 100px) !important; }
    .ss-rchip { height: 36px; padding: 0 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .ss-radius-chips { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .ss-studio-v2 #locationCard .ss-field .input-field { height: 40px !important; font-size: 16px !important; } /* no iOS zoom on focus */
}
@media (prefers-reduced-motion: reduce) {
    .ss-pin { animation: none; }
    .sd-page .sd-ly-st[data-st="loading"]::before { animation: none; }
    .ss-rchip, .ss-studio-v2 .ss-studio-toolbar .ss-tool-btn, .ss-studio-v2 .leaflet-bar a, .ss-bm-seg > button { transition: none; }
}

/* Guided tour (demo): the highlight ring must win over the card and toolbar shadows above */
.ss-studio-v2 #locationCard.sd-tour-target { box-shadow: 0 0 0 2px var(--ac-accent), 0 0 0 6px var(--ac-accent-tint) !important; }
.ss-studio-v2 .ss-studio-toolbar .ss-tool-btn.sd-tour-target { border-radius: var(--st-r-md); z-index: 5; }

/* phones: coordinates fit without cutting digits (16 px text stops iOS zoom, so tighten padding and spacing) */
@media (max-width: 600px) {
    .ss-studio-v2 #locationCard .ss-field .input-field { padding: 0 var(--st-sp-2) !important; letter-spacing: -0.01em; }
    .ss-studio-v2 #locationCard .ss-coords { gap: var(--st-sp-1) !important; }
}

/* Narrow desktops (1024 px wide): the search card and the wider Option A toolbar no longer fit on one row, so the
   toolbar moves under the search card's row (right-aligned, as before) */
@media (min-width: 769px) and (max-width: 1279px) {
    .ss-studio-v2:not(.sd-page) .ss-studio-toolbar { top: 64px; }
    .ss-studio-v2:not(.sd-page) .feature-cards-container:has(#dataLayersCard.ss-open) #locationCard { top: 12px !important; }
}
/* the demo's search card is taller (title, intro, examples): there the toolbar sits at the bottom right of the map */
@media (min-width: 769px) and (max-width: 1279px) {
    .ss-studio-v2.sd-page .sd-toolbar.ss-studio-toolbar { top: auto; bottom: 36px; }
}
