:root {
    --bg: #07110f;
    --bg-soft: #0c1916;
    --panel: #10221e;
    --panel-2: #152b26;
    --line: rgba(255, 255, 255, 0.11);
    --text: #eefbf6;
    --muted: #9db6ad;
    --accent: #b9f227;
    --accent-dark: #86bd00;
    --cyan: #37d9d0;
    --danger: #ff6b6b;
    --warning: #ffcc66;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
    --radius: 18px;
    --radius-sm: 11px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, rgba(55, 217, 208, 0.08), transparent 28rem),
        radial-gradient(circle at 90% 20%, rgba(185, 242, 39, 0.07), transparent 30rem),
        var(--bg);
    color: var(--text);
    line-height: 1.55;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.16;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(to bottom, #000, transparent 80%);
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 4vw;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 17, 15, 0.88);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .85rem;
    color: var(--text);
    text-decoration: none;
}

.brand > span:last-child { display: grid; line-height: 1.15; }
.brand strong { font-size: 1rem; letter-spacing: .02em; }
.brand small { margin-top: .22rem; color: var(--muted); font-size: .73rem; }
.brand-mark {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 11px;
    color: #0a140e;
    font-weight: 1000;
    letter-spacing: -.08em;
    background: linear-gradient(145deg, var(--accent), #efff95);
    box-shadow: 0 8px 24px rgba(185, 242, 39, .2);
}
.brand-mark.large { width: 62px; height: 62px; border-radius: 17px; font-size: 1.35rem; margin-inline: auto; text-decoration: none; }

.main-nav { display: flex; align-items: center; gap: .35rem; }
.main-nav a, .admin-nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 750;
    font-size: .88rem;
    padding: .68rem .82rem;
    border-radius: 9px;
}
.main-nav a:hover, .admin-nav a:hover { color: var(--text); background: rgba(255,255,255,.06); }

.admin-nav {
    display: flex;
    align-items: center;
    gap: .2rem;
    overflow-x: auto;
    padding: .55rem 4vw;
    border-bottom: 1px solid var(--line);
    background: rgba(16, 34, 30, .92);
}
.admin-nav a { white-space: nowrap; }

.flash {
    position: relative;
    z-index: 900;
    max-width: 1180px;
    margin: 1rem auto;
    padding: .9rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    box-shadow: var(--shadow);
}
.flash-success { border-color: rgba(185, 242, 39, .45); }
.flash-error { border-color: rgba(255, 107, 107, .5); color: #ffd5d5; }
.flash-warning { border-color: rgba(255, 204, 102, .45); }

.hero {
    max-width: 1460px;
    margin: 0 auto;
    padding: 5.5rem 4vw 3.5rem;
}
.compact-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
}
.hero h1, .detail-header h1, .admin-heading h1, .panel-heading h1 {
    margin: .1rem 0 .6rem;
    font-size: clamp(2.2rem, 5vw, 5.7rem);
    line-height: .94;
    letter-spacing: -.055em;
    max-width: 980px;
}
.compact-hero h1 { font-size: clamp(2.4rem, 5vw, 5.2rem); }
.hero p:not(.eyebrow) { max-width: 760px; color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); }
.eyebrow {
    margin: 0 0 .4rem;
    color: var(--accent);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.hero-stat {
    flex: 0 0 auto;
    display: grid;
    min-width: 155px;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(16, 34, 30, .78);
    box-shadow: var(--shadow);
}
.hero-stat strong { font-size: 2.3rem; line-height: 1; color: var(--accent); }
.hero-stat span { color: var(--muted); font-size: .82rem; margin-top: .25rem; }

.explorer-shell {
    max-width: 1460px;
    margin: 0 auto 5rem;
    padding: 0 4vw;
}
.explorer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.search-field { flex: 1; max-width: 720px; }
.search-field input {
    width: 100%;
    min-height: 52px;
    padding: .85rem 1rem .85rem 1.15rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(16, 34, 30, .88);
    color: var(--text);
    box-shadow: 0 10px 35px rgba(0,0,0,.18);
}
.search-field input:focus, input:focus, textarea:focus, select:focus {
    outline: 2px solid rgba(185, 242, 39, .55);
    outline-offset: 2px;
    border-color: var(--accent);
}
.view-switcher {
    display: inline-flex;
    padding: .3rem;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--panel);
}
.view-button {
    min-width: 78px;
    border: 0;
    border-radius: 9px;
    padding: .68rem .9rem;
    background: transparent;
    color: var(--muted);
    font-weight: 850;
    cursor: pointer;
}
.view-button.active { color: #0b150f; background: var(--accent); }

.category-filter {
    display: flex;
    gap: .55rem;
    overflow-x: auto;
    padding: .2rem 0 1.1rem;
    scrollbar-width: thin;
}
.category-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    padding: .62rem .82rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(16, 34, 30, .68);
    font-weight: 750;
    cursor: pointer;
}
.category-chip.active, .category-chip:hover { color: var(--text); border-color: rgba(185, 242, 39, .45); background: rgba(185, 242, 39, .09); }

.explorer-view { display: none; }
.explorer-view.active { display: block; }
.gta-map, .admin-map, .mini-map {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #091411;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.gta-map { height: min(72vh, 900px); min-height: 520px; }
.admin-map { height: 650px; }
.mini-map { height: 520px; }
.map-status {
    position: relative;
    z-index: 500;
    display: inline-flex;
    margin: -3.3rem 0 0 1rem;
    padding: .65rem .85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: rgba(7,17,15,.9);
    backdrop-filter: blur(10px);
    font-size: .82rem;
    font-weight: 800;
}
.map-error { min-height: 240px; display: grid; place-items: center; padding: 2rem; color: var(--muted); text-align: center; }

.map-pin-wrapper { background: none; border: 0; }
.map-pin {
    position: relative;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 4px;
    transform: rotate(-45deg);
    background: var(--pin-color, var(--accent));
    box-shadow: 0 7px 18px rgba(0,0,0,.55);
}
.map-pin > span { transform: rotate(45deg); font-size: 17px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.leaflet-container { font-family: inherit; }
.leaflet-control-zoom a { background: var(--panel) !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #10221e; color: var(--text); }
.leaflet-popup-content-wrapper { border-radius: 15px; padding: 0; box-shadow: 0 18px 48px rgba(0,0,0,.5); overflow: hidden; }
.leaflet-popup-content { margin: 0; width: auto !important; }
.leaflet-popup-close-button { color: #fff !important; background: rgba(0,0,0,.55) !important; border-radius: 999px; top: 8px !important; right: 8px !important; width: 28px !important; height: 28px !important; line-height: 25px !important; }
.map-popup-card img { width: 100%; height: 150px; object-fit: cover; background: #0a1512; }
.map-popup-body { padding: 1rem; }
.map-popup-body h3 { margin: .2rem 0 .35rem; font-size: 1.1rem; }
.map-popup-body p { margin: .35rem 0; color: var(--muted); font-size: .88rem; }
.map-popup-body a { display: inline-block; margin-top: .55rem; color: var(--accent); font-weight: 900; text-decoration: none; }
.popup-category { color: var(--accent); font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.popup-location { font-weight: 800; color: #d7ebe3 !important; }

.spot-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
}
.spot-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(160deg, rgba(21,43,38,.95), rgba(12,25,22,.95));
    box-shadow: 0 14px 40px rgba(0,0,0,.18);
    transition: transform .2s ease, border-color .2s ease;
}
.spot-card:hover { transform: translateY(-3px); border-color: rgba(185,242,39,.34); }
.spot-card[hidden] { display: none; }
.spot-card-image { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #08120f; }
.spot-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.spot-card:hover .spot-card-image img { transform: scale(1.035); }
.featured-flag {
    position: absolute;
    top: .75rem;
    left: .75rem;
    padding: .4rem .6rem;
    border-radius: 999px;
    background: var(--accent);
    color: #0a140e;
    font-size: .7rem;
    font-weight: 950;
    text-transform: uppercase;
}
.spot-card-body { padding: 1.1rem; }
.spot-card-body h2 { margin: .45rem 0 .4rem; font-size: 1.28rem; line-height: 1.15; }
.spot-card-body h2 a { text-decoration: none; }
.spot-card-body p { color: var(--muted); margin: .45rem 0; }
.category-label {
    --category-color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--category-color);
    font-size: .72rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.category-label.large { font-size: .86rem; }
.location-label { color: #d4e8e0 !important; font-size: .88rem; font-weight: 800; }
.location-label.large { font-size: 1rem; }
.text-link { color: var(--accent); font-weight: 900; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.empty-state { padding: 4rem 1rem; text-align: center; color: var(--muted); }
.empty-state h2, .empty-state h3 { color: var(--text); margin-bottom: .3rem; }

.detail-shell { max-width: 1120px; margin: 0 auto; padding: 3rem 4vw 6rem; }
.back-link { display: inline-flex; margin-bottom: 1.4rem; color: var(--muted); text-decoration: none; font-weight: 800; }
.back-link:hover { color: var(--accent); }
.back-link.centered { justify-content: center; width: 100%; margin: 1.2rem 0 0; }
.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}
.detail-header h1 { font-size: clamp(2.4rem, 7vw, 6rem); margin-top: .45rem; }
.lead { max-width: 800px; color: var(--muted); font-size: 1.15rem; }
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin: 2rem 0;
}
.gallery-item {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: var(--panel);
}
.gallery-item a { display: block; aspect-ratio: 4 / 3; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-featured { grid-column: span 4; }
.gallery-featured a { aspect-ratio: 16 / 7; }
.gallery-item figcaption { padding: .7rem .8rem; color: var(--muted); font-size: .82rem; }
.detail-section, .mini-map-section {
    margin: 1rem 0;
    padding: clamp(1.2rem, 3vw, 2rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(16, 34, 30, .82);
    box-shadow: 0 12px 36px rgba(0,0,0,.14);
}
.detail-section h2, .mini-map-section h2 { margin: 0 0 1rem; font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.025em; }
.detail-section h3 { margin: 0 0 .65rem; font-size: 1rem; color: var(--accent); }
.prose { color: #d0e2dc; white-space: normal; }
.steps-list, .check-list, .link-list { margin: 0; padding-left: 1.4rem; }
.steps-list li, .check-list li, .link-list li { padding: .35rem 0 .35rem .25rem; color: #d4e6df; }
.steps-list li::marker { color: var(--accent); font-weight: 950; }
.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-left: 2rem; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: .32rem; width: 1.25rem; height: 1.25rem; display: grid; place-items: center; border-radius: 50%; color: #0a140e; background: var(--accent); font-weight: 1000; font-size: .72rem; }
.recipe-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 2rem; }
.recipe-grid ul, .recipe-grid ol { margin: 0; padding-left: 1.3rem; }
.recipe-grid li { padding: .25rem 0; color: #d4e6df; }
.link-list a { color: var(--accent); }
.mini-map-section { margin-top: 2rem; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 42px;
    padding: .68rem 1rem;
    border: 1px solid transparent;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 900;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: #0a140e; background: var(--accent); }
.button.primary:hover { background: #d2ff58; }
.button.secondary { color: var(--text); border-color: rgba(185,242,39,.32); background: rgba(185,242,39,.08); }
.button.secondary:hover { background: rgba(185,242,39,.14); }
.button.ghost { color: var(--muted); border-color: var(--line); background: transparent; }
.button.ghost:hover { color: var(--text); background: rgba(255,255,255,.05); }
.button.danger { color: #fff; border-color: rgba(255,107,107,.35); background: rgba(255,107,107,.15); }
.button.danger:hover { background: rgba(255,107,107,.24); }
.button:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.button.wide { width: 100%; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 1.25rem; }
.icon-button:hover { color: #fff; border-color: rgba(255,107,107,.5); background: rgba(255,107,107,.12); }

.site-footer { padding: 2rem 4vw 3rem; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: .85rem; }

.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 2rem; }
.auth-shell { width: min(100%, 480px); }
.auth-card {
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(16,34,30,.92);
    box-shadow: var(--shadow);
}
.auth-card h1 { margin: 1rem 0 .3rem; text-align: center; font-size: 2rem; letter-spacing: -.04em; }
.auth-card > p { color: var(--muted); text-align: center; }

.admin-shell { max-width: 1320px; margin: 0 auto; padding: 3rem 4vw 6rem; }
.admin-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: 1.6rem; }
.admin-heading h1, .panel-heading h1 { font-size: clamp(2rem, 5vw, 4.5rem); margin-bottom: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat-card { display: grid; padding: 1.2rem; border: 1px solid var(--line); border-radius: 15px; background: rgba(16,34,30,.78); }
.stat-card strong { color: var(--accent); font-size: 2rem; line-height: 1; }
.stat-card span { margin-top: .35rem; color: var(--muted); font-size: .82rem; }
.admin-panel {
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(16,34,30,.86);
    box-shadow: 0 14px 38px rgba(0,0,0,.17);
}
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-heading h2, .admin-panel > h2 { margin: 0; font-size: 1.35rem; }
.panel-heading p { margin: .25rem 0 0; color: var(--muted); }
.split-heading { align-items: flex-start; }
.heading-actions, .form-actions, .row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.filter-form { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(190px, .5fr) auto auto; gap: .75rem; align-items: end; margin-bottom: 1rem; }

.stack-form { display: grid; gap: 1rem; }
.stack-form label, .filter-form label, .photo-editor-card label, .new-photo-card label, .section-editor-card label {
    display: grid;
    gap: .4rem;
    color: #d9ebe4;
    font-size: .86rem;
    font-weight: 800;
}
label small, .stack-form small, .admin-panel > small { color: var(--muted); font-weight: 500; }
input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: .72rem .78rem;
    background: #0a1714;
    color: var(--text);
}
textarea { resize: vertical; min-height: 90px; }
input[type="color"] { min-height: 44px; padding: .25rem; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
.checkbox-row, .radio-row { display: flex !important; align-items: center; gap: .55rem !important; }
.form-grid { display: grid; gap: .8rem; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
code { padding: .12rem .35rem; border-radius: 5px; background: rgba(255,255,255,.06); color: #e8f7f1; }

.admin-spot-list { display: grid; gap: .7rem; }
.admin-spot-row {
    display: grid;
    grid-template-columns: 120px minmax(0,1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: .75rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(7,17,15,.35);
}
.admin-spot-row > img { width: 120px; height: 90px; border-radius: 10px; object-fit: cover; background: #08120f; }
.admin-spot-main h3 { margin: .3rem 0; }
.admin-spot-main p { margin: .2rem 0; color: var(--muted); }
.admin-spot-main small { color: #718d83; }
.row-badges { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.status-badge { padding: .25rem .45rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .66rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.status-published { color: var(--accent); border-color: rgba(185,242,39,.3); }
.status-draft { color: var(--warning); border-color: rgba(255,204,102,.3); }

.two-column-admin { display: grid; grid-template-columns: minmax(300px, .65fr) minmax(0, 1.35fr); gap: 1rem; align-items: start; }
.sticky-panel { position: sticky; top: 142px; }
.category-admin-list { display: grid; gap: .7rem; }
.category-admin-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .9rem; padding: .9rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(7,17,15,.35); }
.category-admin-row h3 { margin: 0 0 .2rem; }
.category-admin-row p { margin: 0 0 .3rem; color: var(--muted); }
.category-admin-row small { color: #789388; }
.category-icon-preview { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--category-color) 18%, transparent); border: 1px solid color-mix(in srgb, var(--category-color) 45%, transparent); font-size: 1.3rem; }

.settings-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(300px, 1.1fr); gap: 1rem; align-items: start; }
.map-preview-panel { position: sticky; top: 142px; }
.map-image-preview { width: 100%; max-height: 680px; object-fit: contain; border: 1px solid var(--line); border-radius: 14px; background: #07110f; }
.help-box { padding: .9rem; border-radius: 12px; color: var(--muted); background: rgba(55,217,208,.06); border: 1px solid rgba(55,217,208,.2); }

.editor-form { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1rem; align-items: start; }
.editor-main { display: grid; gap: 1rem; min-width: 0; }
.editor-sidebar { display: grid; gap: 1rem; }
.sticky-save-panel { position: sticky; top: 142px; z-index: 10; }
.sticky-save-panel p, .danger-zone p { color: var(--muted); }
.sticky-save-panel .button + .button { margin-top: .55rem; }
.danger-zone { border-color: rgba(255,107,107,.25); }
.coordinate-readout { margin: .75rem 0 0; color: var(--muted); font-size: .84rem; }
.coordinate-readout strong { color: var(--text); }

.existing-photo-grid, .new-photo-list { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .8rem; margin-bottom: 1rem; }
.photo-editor-card, .new-photo-card { display: grid; gap: .65rem; min-width: 0; padding: .75rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(7,17,15,.45); }
.photo-editor-card > img, .new-photo-preview { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; background: #08120f; }
.new-photo-preview { display: grid; place-items: center; color: var(--muted); overflow: hidden; font-size: .8rem; }
.new-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.danger-text { color: #ffb6b6 !important; }

.section-editor-list { display: grid; gap: .8rem; }
.section-editor-card { display: grid; gap: .75rem; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(7,17,15,.42); }
.section-editor-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.section-editor-toolbar > label { flex: 1; }
.extra-content-label[hidden] { display: none !important; }

@media (max-width: 1050px) {
    .spot-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .editor-form { grid-template-columns: 1fr; }
    .editor-sidebar { grid-template-columns: 1fr 1fr; }
    .sticky-save-panel { position: static; }
    .existing-photo-grid, .new-photo-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .admin-map { height: 560px; }
}

@media (max-width: 820px) {
    .site-header { padding-inline: 1rem; }
    .brand small { display: none; }
    .main-nav a { padding-inline: .55rem; }
    .compact-hero { align-items: flex-start; flex-direction: column; }
    .hero-stat { grid-auto-flow: column; align-items: center; gap: .6rem; min-width: 0; }
    .explorer-toolbar { align-items: stretch; flex-direction: column; }
    .view-switcher { align-self: flex-start; }
    .gta-map { min-height: 440px; height: 64vh; }
    .detail-header { flex-direction: column; }
    .photo-gallery { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .gallery-featured { grid-column: span 2; }
    .recipe-grid { grid-template-columns: 1fr; gap: 1.2rem; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .filter-form { grid-template-columns: 1fr 1fr; }
    .admin-spot-row { grid-template-columns: 90px minmax(0,1fr); }
    .admin-spot-row > img { width: 90px; height: 76px; }
    .admin-spot-row .row-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .two-column-admin, .settings-layout { grid-template-columns: 1fr; }
    .sticky-panel, .map-preview-panel { position: static; }
    .category-admin-row { grid-template-columns: auto minmax(0,1fr); }
    .category-admin-row .row-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 610px) {
    .site-header { min-height: 66px; }
    .main-nav a:first-child { display: none; }
    .brand-mark { width: 38px; height: 38px; }
    .hero { padding-top: 3.6rem; }
    .hero h1, .compact-hero h1 { font-size: clamp(2.4rem, 14vw, 4.2rem); }
    .spot-grid { grid-template-columns: 1fr; }
    .gta-map { min-height: 400px; border-radius: 13px; }
    .detail-shell, .admin-shell { padding-inline: 1rem; }
    .photo-gallery { display: block; }
    .gallery-item { margin-bottom: .75rem; }
    .gallery-item a, .gallery-featured a { aspect-ratio: 4/3; }
    .detail-section, .mini-map-section { padding: 1rem; }
    .mini-map { height: 400px; }
    .admin-heading { align-items: flex-start; flex-direction: column; }
    .admin-heading .button { width: 100%; }
    .filter-form, .form-grid.two { grid-template-columns: 1fr; }
    .admin-spot-row { grid-template-columns: 1fr; }
    .admin-spot-row > img { width: 100%; height: 170px; }
    .editor-sidebar { grid-template-columns: 1fr; }
    .existing-photo-grid, .new-photo-list { grid-template-columns: 1fr; }
    .admin-map { height: 440px; }
    .split-heading, .section-editor-toolbar { align-items: stretch; flex-direction: column; }
    .heading-actions { width: 100%; }
    .heading-actions .button { flex: 1; }
    .auth-page { padding: 1rem; }
    .auth-card { padding: 1.25rem; }
}

/* Full-screen map application */
html:has(body.map-app-page),
body.map-app-page {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body.map-app-page {
    min-height: 100dvh;
    background: #07110f;
}

body.map-app-page::before { display: none; }

.map-app-shell {
    position: relative;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
}

.fullscreen-gta-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #07110f;
}

.map-topbar {
    position: absolute;
    z-index: 1100;
    top: max(14px, env(safe-area-inset-top));
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
    display: grid;
    grid-template-columns: auto minmax(220px, 620px) auto;
    align-items: center;
    gap: .8rem;
    pointer-events: none;
}

.map-topbar > * { pointer-events: auto; }

.map-brand,
.map-search,
.map-action-button,
.map-category-bar,
.map-readout {
    border: 1px solid var(--line);
    background: rgba(7, 17, 15, .9);
    box-shadow: 0 14px 38px rgba(0, 0, 0, .28);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.map-brand {
    min-width: 235px;
    display: flex;
    align-items: center;
    gap: .7rem;
    min-height: 58px;
    padding: .5rem .75rem;
    border-radius: 15px;
    color: var(--text);
    text-decoration: none;
}

.map-brand-copy { display: grid; line-height: 1.15; }
.map-brand-copy strong { font-size: .94rem; }
.map-brand-copy small { margin-top: .18rem; color: var(--muted); font-size: .68rem; }

.map-search {
    min-height: 58px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: .55rem;
    padding: 0 .9rem;
    border-radius: 15px;
}

.map-search > span:not(.sr-only) { color: var(--muted); font-size: 1.5rem; line-height: 1; }
.map-search input {
    min-width: 0;
    height: 54px;
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}
.map-search input:focus { outline: 0; border: 0; }

.map-top-actions { display: flex; gap: .55rem; justify-content: flex-end; }
.map-action-button {
    min-height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .7rem .9rem;
    border-radius: 15px;
    color: var(--text);
    text-decoration: none;
    font: inherit;
    font-size: .82rem;
    font-weight: 850;
    cursor: pointer;
}
.map-action-button:hover { border-color: rgba(185, 242, 39, .45); background: rgba(16, 34, 30, .96); }

.map-category-bar {
    position: absolute;
    z-index: 1050;
    top: calc(max(14px, env(safe-area-inset-top)) + 70px);
    left: 50%;
    width: min(900px, calc(100% - 28px));
    display: flex;
    gap: .45rem;
    overflow-x: auto;
    padding: .45rem;
    border-radius: 999px;
    transform: translateX(-50%);
    scrollbar-width: none;
}
.map-category-bar::-webkit-scrollbar { display: none; }
.map-category-bar .category-chip {
    min-height: 38px;
    padding: .48rem .72rem;
    background: transparent;
}
.map-category-bar .category-chip.active { background: rgba(185, 242, 39, .16); }
.chip-count {
    min-width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    padding-inline: .3rem;
    border-radius: 999px;
    background: rgba(255,255,255,.09);
    font-size: .7rem;
}

.map-drawer {
    position: absolute;
    z-index: 1200;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(520px, 94vw);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border-left: 1px solid var(--line);
    background: rgba(7, 17, 15, .97);
    box-shadow: -24px 0 70px rgba(0,0,0,.42);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    transform: translateX(105%);
    transition: transform .24s ease;
}
.map-drawer.open { transform: translateX(0); }

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 94px;
    padding: max(1.15rem, env(safe-area-inset-top)) 1.15rem 1rem;
    border-bottom: 1px solid var(--line);
}
.drawer-header h1 { margin: 0; font-size: 1.55rem; letter-spacing: -.035em; }
.drawer-header .eyebrow { margin-bottom: .15rem; }
.drawer-close {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255,255,255,.05);
    color: var(--text);
    font-size: 1.65rem;
    cursor: pointer;
}

.drawer-view { display: none; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.drawer-view.active { display: block; }
.drawer-summary { margin: 0; padding: 1rem 1.15rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.drawer-spot-list { display: grid; gap: .8rem; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)); }
.drawer-spot-card {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: .85rem;
    padding: .72rem;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(16,34,30,.66);
}
.drawer-spot-card[hidden] { display: none; }
.drawer-spot-card > img { width: 130px; height: 112px; border-radius: 11px; object-fit: cover; background: #08120f; }
.drawer-spot-card h2 { margin: .25rem 0; font-size: 1.08rem; line-height: 1.15; }
.drawer-spot-card p { margin: .25rem 0; color: var(--muted); font-size: .8rem; }
.drawer-card-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .65rem; }
.drawer-card-actions .button { padding: .52rem .68rem; font-size: .74rem; }

.drawer-back {
    margin: 1rem 1.15rem 0;
    border: 0;
    padding: .35rem 0;
    background: transparent;
    color: var(--accent);
    font-weight: 850;
    cursor: pointer;
}
.drawer-detail-content { padding: 1rem 1.15rem calc(1.5rem + env(safe-area-inset-bottom)); }
.drawer-loading { padding: 3rem 1rem; color: var(--muted); text-align: center; }
.drawer-detail-hero { width: 100%; max-height: 310px; object-fit: cover; border-radius: 15px; background: #08120f; }
.drawer-detail-heading { padding: 1rem 0; }
.drawer-detail-heading h2 { margin: .35rem 0; font-size: 2rem; line-height: 1; letter-spacing: -.045em; }
.drawer-detail-heading .detail-lead { color: var(--muted); font-size: 1rem; }
.drawer-content-section {
    margin-top: .85rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(16,34,30,.65);
}
.drawer-content-section h3 { margin: 0 0 .65rem; font-size: 1.15rem; }
.drawer-content-section h4 { margin: 0 0 .5rem; font-size: .92rem; }
.drawer-content-section p:last-child,
.drawer-content-section ul:last-child,
.drawer-content-section ol:last-child { margin-bottom: 0; }
.drawer-photo-gallery { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .65rem; margin-top: .85rem; }
.drawer-photo-gallery figure { margin: 0; min-width: 0; }
.drawer-photo-gallery figure.featured { grid-column: 1 / -1; }
.drawer-photo-gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; background: #08120f; }
.drawer-photo-gallery figure.featured img { aspect-ratio: 16/9; }
.drawer-photo-gallery figcaption { padding: .35rem .2rem 0; color: var(--muted); font-size: .72rem; }

.map-readout {
    position: absolute;
    z-index: 1000;
    left: max(14px, env(safe-area-inset-left));
    bottom: max(14px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .75rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: .73rem;
    font-weight: 750;
    pointer-events: none;
}
.map-readout strong { color: var(--text); }
.map-readout span + span { padding-left: .7rem; border-left: 1px solid var(--line); }

.map-pin > i {
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 6px;
    height: 6px;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 50%;
    background: #07110f;
    transform: translateX(-50%) rotate(45deg);
}

.map-popup-body .button { width: 100%; margin-top: .7rem; }
.fullscreen-gta-map .leaflet-control-zoom { margin-right: max(14px, env(safe-area-inset-right)); margin-bottom: max(14px, env(safe-area-inset-bottom)); }
.fullscreen-gta-map .leaflet-control-zoom a { width: 42px; height: 42px; line-height: 40px; font-size: 1.3rem; }
.fullscreen-gta-map .leaflet-tooltip { border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: rgba(7,17,15,.94); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.fullscreen-gta-map .leaflet-tooltip-top::before { border-top-color: rgba(7,17,15,.94); }

@media (max-width: 900px) {
    .map-topbar { grid-template-columns: minmax(0, 1fr) auto; }
    .map-brand { min-width: 0; }
    .map-brand-copy small { display: none; }
    .map-search { grid-column: 1 / -1; grid-row: 2; }
    .map-category-bar { top: calc(max(14px, env(safe-area-inset-top)) + 130px); left: max(14px, env(safe-area-inset-left)); width: calc(100% - 28px); transform: none; }
}

@media (max-width: 620px) {
    .map-topbar { gap: .55rem; }
    .map-brand { min-height: 52px; padding: .4rem .55rem; }
    .map-brand .brand-mark { width: 38px; height: 38px; }
    .map-brand-copy strong { max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .map-action-button { min-height: 52px; padding-inline: .72rem; }
    .map-action-button span { display: none; }
    .map-search { min-height: 52px; }
    .map-search input { height: 48px; font-size: .9rem; }
    .map-category-bar { top: calc(max(14px, env(safe-area-inset-top)) + 118px); }
    .map-category-bar .category-chip { font-size: .75rem; }
    .map-drawer { top: auto; width: 100%; height: min(82dvh, 760px); border-left: 0; border-top: 1px solid var(--line); border-radius: 22px 22px 0 0; transform: translateY(105%); }
    .map-drawer.open { transform: translateY(0); }
    .drawer-header { min-height: 76px; padding-top: 1rem; }
    .drawer-spot-card { grid-template-columns: 96px minmax(0,1fr); }
    .drawer-spot-card > img { width: 96px; height: 96px; }
    .drawer-card-actions { grid-column: 1 / -1; }
    .drawer-card-actions .button { flex: 1; }
    .map-readout { right: auto; max-width: calc(100% - 92px); }
    #cursor-coordinate { display: none; }
    .drawer-photo-gallery { grid-template-columns: 1fr; }
    .drawer-photo-gallery figure.featured { grid-column: auto; }
}

/* Precision location editor and shared users */
.precision-map { cursor: crosshair; }
.precision-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: end;
    margin-top: 1rem;
}
.coordinate-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .8rem; }
.coordinate-fields label { display: grid; gap: .4rem; color: #d9ebe4; font-size: .82rem; font-weight: 800; }
.coordinate-fields input { font-variant-numeric: tabular-nums; }
.nudge-panel { display: grid; gap: .4rem; }
.nudge-panel > span { color: var(--muted); font-size: .75rem; font-weight: 800; text-align: center; }
.nudge-grid { display: grid; grid-template-columns: repeat(3, 38px); grid-template-rows: repeat(2, 38px); gap: .28rem; justify-content: center; }
.nudge-grid button {
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #0a1714;
    color: var(--text);
    cursor: pointer;
}
.nudge-grid button:nth-child(1) { grid-column: 2; grid-row: 1; }
.nudge-grid button:nth-child(2) { grid-column: 1; grid-row: 2; }
.nudge-grid button:nth-child(3) { grid-column: 3; grid-row: 2; }
.nudge-grid button:nth-child(4) { grid-column: 2; grid-row: 2; }
.nudge-grid button:hover { color: var(--accent); border-color: rgba(185,242,39,.45); }
.precision-pin-wrapper .map-pin > i { width: 7px; height: 7px; background: #fff; border: 2px solid #07110f; }

.user-admin-list { display: grid; gap: .75rem; }
.user-admin-row {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    gap: .9rem;
    align-items: center;
    padding: .9rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(7,17,15,.35);
}
.user-admin-row h3 { margin: .28rem 0 .1rem; }
.user-admin-row p { margin: 0; color: var(--muted); }
.user-admin-row small { color: #789388; }
.user-avatar {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(185,242,39,.3);
    border-radius: 15px;
    color: #0b150f;
    background: var(--accent);
    font-size: 1.15rem;
    font-weight: 950;
}

@media (max-width: 720px) {
    .precision-controls { grid-template-columns: 1fr; }
    .coordinate-fields { grid-template-columns: 1fr; }
    .nudge-panel { justify-self: start; }
    .user-admin-row { grid-template-columns: auto minmax(0,1fr); }
    .user-admin-row .row-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
.stat-grid.five { grid-template-columns: repeat(5, minmax(0,1fr)); }
@media (max-width: 1050px) { .stat-grid.five { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 610px) { .stat-grid.five { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* Version 3: accurate spot markers, overlap handling, and precision editor */
.exact-spot-marker-wrapper,
.spot-cluster-wrapper,
.precision-marker-wrapper {
    border: 0;
    background: transparent;
}

.exact-spot-marker {
    --spot-color: var(--accent);
    position: relative;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 2px solid rgba(255,255,255,.96);
    border-radius: 50%;
    background: color-mix(in srgb, var(--spot-color) 84%, #07110f);
    box-shadow: 0 3px 10px rgba(0,0,0,.62), 0 0 0 2px rgba(7,17,15,.68);
    transition: transform .16s ease, box-shadow .16s ease;
}
.exact-spot-marker:hover,
.exact-spot-marker.selected {
    transform: scale(1.22);
    box-shadow: 0 5px 16px rgba(0,0,0,.7), 0 0 0 5px color-mix(in srgb, var(--spot-color) 38%, transparent);
}
.exact-spot-marker.selected::after {
    content: '';
    position: absolute;
    inset: -9px;
    border: 2px solid rgba(255,255,255,.92);
    border-radius: 50%;
    animation: selected-spot-pulse 1.6s ease-out infinite;
}
.exact-spot-icon {
    font-size: 11px;
    line-height: 1;
    opacity: 0;
    transform: scale(.75);
    transition: opacity .16s ease, transform .16s ease;
}
.map-detail-level .exact-spot-icon {
    opacity: 1;
    transform: scale(1);
}
.exact-spot-marker > i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 4px;
    border: 1px solid #07110f;
    border-radius: 50%;
    background: #fff;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 1px rgba(255,255,255,.32);
}
@keyframes selected-spot-pulse {
    0% { transform: scale(.7); opacity: .95; }
    100% { transform: scale(1.45); opacity: 0; }
}

.spot-cluster {
    width: 44px;
    height: 44px;
    display: grid;
    place-content: center;
    border: 2px solid rgba(255,255,255,.94);
    border-radius: 50%;
    color: #07110f;
    background: var(--accent);
    box-shadow: 0 7px 20px rgba(0,0,0,.58), 0 0 0 4px rgba(7,17,15,.58);
    text-align: center;
    transition: transform .16s ease;
}
.spot-cluster:hover { transform: scale(1.08); }
.spot-cluster strong { font-size: .95rem; line-height: 1; }
.spot-cluster small { margin-top: 1px; font-size: .48rem; line-height: 1; text-transform: uppercase; letter-spacing: .04em; }

.spot-preview {
    position: absolute;
    z-index: 1160;
    left: max(14px, env(safe-area-inset-left));
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 48px);
    width: min(440px, calc(100% - 28px));
    border: 1px solid var(--line);
    border-radius: 17px;
    background: rgba(7,17,15,.96);
    box-shadow: 0 20px 58px rgba(0,0,0,.52);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
}
.spot-preview[hidden] { display: none; }
.spot-preview-close {
    position: absolute;
    z-index: 2;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 50%;
    color: #fff;
    background: rgba(0,0,0,.64);
    font-size: 1.25rem;
    cursor: pointer;
}
#spot-preview-content {
    display: grid;
    grid-template-columns: 132px minmax(0,1fr);
    min-height: 145px;
}
#spot-preview-content > img {
    width: 132px;
    height: 100%;
    min-height: 145px;
    object-fit: cover;
    background: #08120f;
}
.spot-preview-copy { min-width: 0; padding: .9rem 2.6rem .85rem .9rem; }
.spot-preview-copy h2 { margin: .28rem 0; font-size: 1.15rem; line-height: 1.1; }
.spot-preview-copy p { margin: .32rem 0; color: var(--muted); font-size: .8rem; }
.spot-preview-actions { display: flex; flex-wrap: wrap; gap: .42rem; margin-top: .65rem; }
.spot-preview-actions .button { padding: .5rem .65rem; font-size: .72rem; }
.spot-choice-panel { grid-column: 1 / -1; padding: 1rem 2.8rem 1rem 1rem; }
.spot-choice-panel h2 { margin: .3rem 0 .7rem; font-size: 1.15rem; }
.spot-choice-list { display: grid; gap: .42rem; max-height: 260px; overflow-y: auto; }
.spot-choice {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0,1fr);
    align-items: center;
    gap: .65rem;
    padding: .55rem;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--text);
    background: rgba(255,255,255,.035);
    text-align: left;
    cursor: pointer;
}
.spot-choice:hover { border-color: rgba(185,242,39,.42); background: rgba(185,242,39,.07); }
.spot-choice > span:last-child { display: grid; min-width: 0; }
.spot-choice strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot-choice small { margin-top: .1rem; color: var(--muted); }
.spot-choice-dot {
    --spot-color: var(--accent);
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--spot-color);
    font-size: .8rem;
}

.map-fit-control { margin-bottom: 112px !important; }
.map-fit-control button {
    width: 42px;
    height: 42px;
    border: 0;
    color: var(--text);
    background: var(--panel);
    font: 900 1.15rem/40px inherit;
    cursor: pointer;
}
.map-fit-control button:hover { color: var(--accent); background: #183029; }

.precision-map-wrap { position: relative; }
.precision-map { cursor: grab; }
.precision-map.placement-unlocked,
.precision-map.placement-unlocked .leaflet-grab { cursor: crosshair; }
.precision-map:active { cursor: grabbing; }
.precision-center-crosshair {
    position: absolute;
    z-index: 900;
    left: 50%;
    top: 50%;
    width: 54px;
    height: 54px;
    pointer-events: none;
    transform: translate(-50%, -50%);
    opacity: .62;
}
.precision-center-crosshair::before,
.precision-center-crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255,255,255,.94);
    box-shadow: 0 0 0 1px rgba(0,0,0,.55);
}
.precision-center-crosshair::before { left: 26px; top: 0; width: 2px; height: 54px; }
.precision-center-crosshair::after { left: 0; top: 26px; width: 54px; height: 2px; }
.precision-center-crosshair span {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(7,17,15,.72);
    transform: translate(-50%, -50%);
}
.precision-center-crosshair i {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--accent);
    transform: translate(-50%, -50%);
}

.precision-marker {
    --spot-color: var(--accent);
    position: relative;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 2px solid color-mix(in srgb, var(--spot-color) 88%, #fff);
    border-radius: 50%;
    background: rgba(7,17,15,.78);
    box-shadow: 0 4px 16px rgba(0,0,0,.72), 0 0 0 4px color-mix(in srgb, var(--spot-color) 35%, transparent);
}
.precision-marker::before,
.precision-marker::after {
    content: '';
    position: absolute;
    z-index: -1;
    background: rgba(255,255,255,.88);
    box-shadow: 0 0 0 1px rgba(0,0,0,.42);
}
.precision-marker::before { left: 13px; top: -8px; width: 2px; height: 42px; }
.precision-marker::after { left: -8px; top: 13px; width: 42px; height: 2px; }
.precision-marker > span { position: absolute; right: -9px; top: -10px; font-size: 12px; filter: drop-shadow(0 1px 2px #000); }
.precision-marker > i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    border: 2px solid #07110f;
    border-radius: 50%;
    background: #fff;
    transform: translate(-50%, -50%);
}

.precision-map-hud {
    position: absolute;
    z-index: 950;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: flex;
    justify-content: space-between;
    gap: .7rem;
    pointer-events: none;
}
.precision-map-hud span {
    padding: .48rem .65rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(7,17,15,.91);
    box-shadow: 0 8px 22px rgba(0,0,0,.32);
    font-size: .72rem;
    font-weight: 780;
    backdrop-filter: blur(10px);
}
#placement-status.unlocked { color: var(--accent); border-color: rgba(185,242,39,.36); }
.precision-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;
    margin-top: .9rem;
}
.keyboard-help { margin-left: auto; color: var(--muted); font-size: .75rem; }
.precision-controls.improved { grid-template-columns: minmax(0,1fr) auto; }
.pixel-coordinate-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .8rem; }
.pixel-coordinate-fields label { display: grid; gap: .4rem; color: #d9ebe4; font-size: .82rem; font-weight: 800; }
.pixel-coordinate-fields input { font-variant-numeric: tabular-nums; }
.advanced-coordinates {
    margin-top: .9rem;
    padding: .75rem .85rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(7,17,15,.32);
}
.advanced-coordinates summary { color: var(--muted); font-size: .78rem; font-weight: 800; cursor: pointer; }
.advanced-coordinates .coordinate-fields { margin-top: .8rem; }

@media (max-width: 620px) {
    .spot-preview {
        left: max(8px, env(safe-area-inset-left));
        bottom: calc(max(8px, env(safe-area-inset-bottom)) + 48px);
        width: calc(100% - 16px);
    }
    #spot-preview-content { grid-template-columns: 92px minmax(0,1fr); min-height: 126px; }
    #spot-preview-content > img { width: 92px; min-height: 126px; }
    .spot-preview-copy { padding: .75rem 2.45rem .7rem .7rem; }
    .spot-preview-copy h2 { font-size: 1rem; }
    .spot-preview-copy p { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .spot-preview-actions .button { flex: 1; }
    .map-fit-control { margin-bottom: 108px !important; }
    .precision-map-hud { align-items: flex-start; flex-direction: column; }
    .precision-map-hud span { max-width: calc(100% - 12px); border-radius: 10px; }
    .precision-actions { align-items: stretch; }
    .precision-actions .button { flex: 1 1 150px; }
    .keyboard-help { width: 100%; margin-left: 0; }
    .pixel-coordinate-fields { grid-template-columns: 1fr; }
}

/* Version 4: direct source-pixel map engine (no geographic projection or zoom snapping) */
.pixel-map-viewport {
    position: relative;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
    contain: layout paint;
}
.pixel-map-viewport:active { cursor: grabbing; }
.pixel-map-viewport.placement-unlocked { cursor: crosshair; }
.pixel-map-image {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    transform-origin: 0 0;
    will-change: transform;
    pointer-events: none;
    -webkit-user-drag: none;
    backface-visibility: hidden;
}
.pixel-map-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    overflow: hidden;
    pointer-events: none;
}
.pixel-map-overlay > * { pointer-events: auto; }

.pixel-map-control-panel {
    position: absolute;
    z-index: 70;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(3, 42px);
    gap: 6px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(7,17,15,.93);
    box-shadow: 0 12px 34px rgba(0,0,0,.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    cursor: default;
    touch-action: auto;
}
.pixel-map-control-panel button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0;
    background: rgba(255,255,255,.055);
    color: var(--text);
    font: inherit;
    font-size: 1.25rem;
    font-weight: 850;
    cursor: pointer;
}
.pixel-map-control-panel button:hover { border-color: rgba(185,242,39,.55); background: rgba(185,242,39,.11); }
.pixel-map-zoom-slider {
    grid-column: 1 / -1;
    display: block;
    width: 138px;
    padding: 3px 2px 0;
}
.pixel-map-zoom-slider input { width: 100%; accent-color: var(--accent); cursor: pointer; }
.pixel-map-control-panel output {
    grid-column: 1 / -1;
    color: var(--muted);
    text-align: center;
    font-size: .72rem;
    font-weight: 800;
}

.pixel-spot-marker,
.pixel-editor-marker,
.pixel-spot-cluster {
    position: absolute;
    margin: 0;
    transform: translate(-50%, -50%);
    cursor: pointer;
    touch-action: none;
}
.pixel-spot-marker {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 2px solid rgba(255,255,255,.95);
    border-radius: 50%;
    padding: 0;
    background: var(--spot-color, var(--accent));
    color: #fff;
    box-shadow: 0 2px 0 #07110f, 0 5px 15px rgba(0,0,0,.5);
    font-size: 12px;
    line-height: 1;
}
.pixel-spot-marker::before {
    content: '';
    position: absolute;
    inset: -8px;
    border: 1px solid transparent;
    border-radius: 50%;
}
.pixel-spot-marker:hover::before,
.pixel-spot-marker:focus-visible::before,
.pixel-spot-marker.selected::before { border-color: rgba(255,255,255,.9); }
.pixel-spot-marker.selected { width: 32px; height: 32px; box-shadow: 0 0 0 5px rgba(185,242,39,.22), 0 6px 18px rgba(0,0,0,.52); }
.pixel-spot-marker > i,
.pixel-editor-marker > i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 5px;
    height: 5px;
    border: 1px solid #07110f;
    border-radius: 50%;
    background: #fff;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 1px rgba(255,255,255,.4);
}
.pixel-spot-marker > span { transform: translate(9px, -9px); filter: drop-shadow(0 1px 2px #000); }

.pixel-spot-cluster {
    min-width: 46px;
    height: 46px;
    display: grid;
    place-content: center;
    border: 2px solid rgba(255,255,255,.9);
    border-radius: 50%;
    padding: 0 7px;
    background: rgba(7,17,15,.94);
    color: var(--text);
    box-shadow: 0 8px 22px rgba(0,0,0,.48);
    text-align: center;
}
.pixel-spot-cluster strong { font-size: .9rem; line-height: 1; }
.pixel-spot-cluster small { margin-top: 2px; color: var(--muted); font-size: .52rem; line-height: 1; text-transform: uppercase; }

.pixel-editor-marker {
    z-index: 35;
    width: 31px;
    height: 31px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background: transparent;
    color: #fff;
}
.pixel-editor-marker::before,
.pixel-editor-marker::after {
    content: '';
    position: absolute;
    background: rgba(255,255,255,.95);
    box-shadow: 0 0 0 1px rgba(0,0,0,.65);
    pointer-events: none;
}
.pixel-editor-marker::before { left: 50%; top: -10px; width: 1px; height: 51px; transform: translateX(-50%); }
.pixel-editor-marker::after { top: 50%; left: -10px; width: 51px; height: 1px; transform: translateY(-50%); }
.pixel-editor-marker > i {
    z-index: 2;
    width: 7px;
    height: 7px;
    border: 2px solid #07110f;
    background: var(--spot-color, var(--accent));
    box-shadow: 0 0 0 2px #fff;
}
.pixel-editor-marker > span {
    position: absolute;
    z-index: 3;
    right: -10px;
    top: -12px;
    font-size: 13px;
    filter: drop-shadow(0 1px 2px #000);
}
.pixel-editor-marker:not(:disabled):hover,
.pixel-editor-marker.dragging { transform: translate(-50%, -50%) scale(1.08); }
.pixel-editor-marker:disabled { cursor: default; opacity: .95; }

.pixel-native-crosshair { z-index: 30 !important; pointer-events: none; }
.editor-map-controls { bottom: 14px; }
.editor-map-controls .pixel-map-zoom-slider { width: 148px; }

@media (max-width: 620px) {
    .public-map-controls { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 48px); }
    .pixel-map-control-panel { grid-template-columns: repeat(3, 38px); padding: 6px; }
    .pixel-map-control-panel button { width: 38px; height: 38px; }
    .pixel-map-zoom-slider { width: 126px; }
    .editor-map-controls { right: 8px; bottom: 8px; }
}

.map-resolution-warning {
    margin: .75rem 0 0;
    padding: .75rem .9rem;
    border: 1px solid rgba(245, 158, 11, .45);
    border-radius: 12px;
    background: rgba(245, 158, 11, .10);
    color: #fde7b0;
    font-size: .8rem;
    line-height: 1.45;
}
