/* ==========================================================================
   Bus eller godis-kartan
   ========================================================================== */

:root {
    --bg: #0f0b12;
    --bg-glow: #1b1020;
    --surface: #1a1420;
    --surface-2: #241b2c;
    --border: #372a42;
    --text: #f4ece2;
    --muted: #b6a8bb;

    --orange: #f18e14;
    --orange-deep: #dd6e0f;
    --orange-soft: #f8c78e;
    --slime: #94b145;
    --slime-deep: #5b7b2b;
    --witch: #a77bff;
    --blood: #e2454a;

    --font-display: "Creepster", "Impact", fantasy;
    --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 12px 40px rgba(0, 0, 0, .45);
    --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(1200px 600px at 85% -10%, rgba(241, 142, 20, .12), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(167, 123, 255, .10), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
}

h1, h2, h3, .display {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: .04em;
    line-height: 1.1;
    color: var(--orange);
    margin: 0 0 .5em;
}

h1 { font-size: clamp(2.4rem, 6vw, 4rem); text-shadow: 0 0 28px rgba(241, 142, 20, .35); }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h3 { font-size: 1.5rem; }

p { margin: 0 0 1em; }

a { color: var(--orange-soft); }
a:hover { color: var(--orange); }

:focus-visible { outline: 3px solid var(--witch); outline-offset: 2px; }

/* --- Header ------------------------------------------------------------ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: var(--header-h);
    padding: 0 clamp(16px, 3vw, 32px);
    background: rgba(15, 11, 18, .88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1.6rem;
    letter-spacing: .05em;
    color: var(--orange);
    white-space: nowrap;
}
.brand img { width: 40px; height: auto; filter: drop-shadow(0 0 10px rgba(241, 142, 20, .5)); }
.brand-accent { color: var(--text); }
.brand:hover { color: var(--orange); }

.site-nav { display: flex; align-items: center; gap: .25rem; }
.site-nav a, .nav-link-button {
    padding: .45rem .8rem;
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: .95rem;
}
.site-nav a:hover, .nav-link-button:hover { background: var(--surface-2); color: var(--orange-soft); }
.site-nav a.active { color: var(--orange); background: rgba(241, 142, 20, .12); }
.site-nav a.btn { color: #1a0d00; margin-left: .4rem; }
.site-nav a.btn:hover { color: #1a0d00; }
.nav-form { margin: 0; }
.nav-link-button { background: none; border: 0; font-family: inherit; cursor: pointer; }
.nav-user { color: var(--muted); font-weight: 600; }

.nav-toggle { display: none; }
.nav-toggle-label { display: none; }

@media (max-width: 1040px) {
    .brand { font-size: 1.3rem; }
    .brand img { width: 34px; }
    .nav-toggle-label {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        cursor: pointer;
    }
    .nav-toggle-label span,
    .nav-toggle-label span::before,
    .nav-toggle-label span::after {
        display: block;
        width: 24px;
        height: 3px;
        border-radius: 2px;
        background: var(--orange);
        position: relative;
        content: "";
    }
    .nav-toggle-label span::before { position: absolute; top: -8px; }
    .nav-toggle-label span::after { position: absolute; top: 8px; }

    .site-nav {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        padding: .75rem 16px 1rem;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }
    .site-nav a, .nav-link-button { padding: .75rem 1rem; font-size: 1.05rem; text-align: left; width: 100%; }
    .site-nav a.btn { margin: .4rem 0 0; text-align: center; }
    .nav-toggle:checked ~ .site-nav { display: flex; }
}

/* --- Layout ------------------------------------------------------------ */

.site-main { flex: 1; width: 100%; }
.site-main:not(.site-main--bleed) { padding: clamp(24px, 5vw, 56px) 16px; }

.container { max-width: 1100px; margin: 0 auto; }
.container-narrow { max-width: 560px; margin: 0 auto; }

.site-footer {
    padding: 2rem 16px;
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
    border-top: 1px solid var(--border);
}

.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.m-0 { margin: 0; }
.eyebrow {
    display: inline-block;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--slime);
    margin-bottom: .5rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(18px, 3vw, 28px);
}

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

.section { margin-top: clamp(40px, 6vw, 72px); }

/* --- Buttons ----------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .7rem 1.25rem;
    border-radius: 999px;
    border: 2px solid transparent;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: linear-gradient(180deg, var(--orange), var(--orange-deep));
    color: #1a0d00;
    box-shadow: 0 6px 20px rgba(241, 142, 20, .3);
}
.btn-primary:hover { color: #1a0d00; box-shadow: 0 8px 28px rgba(241, 142, 20, .5); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--orange); color: var(--orange-soft); }
.btn-slime { background: var(--slime); color: #142004; }
.btn-slime:hover { color: #142004; background: #a8c456; }
.btn-danger { background: transparent; color: var(--blood); border-color: rgba(226, 69, 74, .5); }
.btn-danger:hover { background: rgba(226, 69, 74, .12); color: var(--blood); }
.btn-sm { padding: .4rem .9rem; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* --- Forms ------------------------------------------------------------- */

.form-row { margin-bottom: 1.1rem; }
.form-row-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { display: block; font-weight: 700; margin-bottom: .35rem; }
.hint { font-size: .88rem; color: var(--muted); margin-top: .3rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="time"], input[type="search"], textarea {
    width: 100%;
    padding: .7rem .9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    color-scheme: dark;
}
input:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(241, 142, 20, .25); }
textarea { min-height: 100px; resize: vertical; }

.checkbox { display: flex; align-items: flex-start; gap: .6rem; font-weight: 600; cursor: pointer; }
.checkbox input { width: 20px; height: 20px; margin-top: .2rem; accent-color: var(--orange); flex: none; }

.error { color: var(--blood); font-size: .9rem; font-weight: 700; margin-top: .3rem; }
.alert {
    padding: .9rem 1.1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-weight: 700;
}
.alert-success { background: rgba(148, 177, 69, .14); border: 1px solid rgba(148, 177, 69, .4); color: #c7e07a; }
.alert-error { background: rgba(226, 69, 74, .12); border: 1px solid rgba(226, 69, 74, .4); color: #ff9a9d; }

.input-group { display: flex; gap: .5rem; }
.input-group input { flex: 1; min-width: 0; }

/* --- Notices & account ---------------------------------------------- */

.notice {
    display: flex;
    gap: .9rem;
    padding: 1rem 1.15rem;
    border-radius: var(--radius);
    background: rgba(167, 123, 255, .08);
    border: 1px solid rgba(167, 123, 255, .35);
    font-size: .92rem;
}
.notice-icon { font-size: 1.5rem; line-height: 1.2; }
.notice strong:first-child { color: #cdb5ff; }
.notice ul { margin: .35rem 0 .5rem; padding-left: 1.1rem; color: var(--muted); }
.notice li { margin-bottom: .2rem; }
.notice li strong { color: var(--text); }

.section-tight { margin: 1.5rem 0; }
.h-sm { font-size: 1.6rem; }

.data-list { margin: 0; display: grid; gap: .7rem; }
.data-list > div { display: grid; gap: .1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--border); }
.data-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.data-list dt { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.data-list dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

.danger-card { border-color: rgba(226, 69, 74, .35); }
.danger-card h3 { color: #ff9a9d; }

.prose { max-width: 760px; }
.prose ul { padding-left: 1.2rem; color: var(--muted); }
.prose li { margin-bottom: .5rem; }
.prose li strong { color: var(--text); }

.site-footer p { margin: 0 0 .3rem; }

/* --- Auth -------------------------------------------------------------- */

.auth-card { text-align: left; }
.auth-card .auth-icon { width: 72px; display: block; margin: 0 auto 1rem; filter: drop-shadow(0 0 18px rgba(241, 142, 20, .5)); }
.auth-card h1 { text-align: center; font-size: 2.6rem; }
.auth-intro { text-align: center; }
.error-tight { margin: -.6rem 0 1rem; }
.auth-footer { text-align: center; margin-top: 1.25rem; color: var(--muted); }

/* --- Map page ---------------------------------------------------------- */

.map-shell {
    position: relative;
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    min-height: 480px;
}
#map { position: absolute; inset: 0; background: #0b0a10; }

.map-panel {
    position: absolute;
    z-index: 500;
    top: 16px;
    left: 16px;
    width: 340px;
    max-height: calc(100% - 32px);
    overflow-y: auto;
    padding: 20px;
    background: rgba(26, 20, 32, .94);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.map-panel h1 { font-size: 2.2rem; margin-bottom: .3rem; }
.map-panel p { font-size: .95rem; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin: 1rem 0; }
.stat {
    padding: .6rem .75rem;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.stat strong { display: block; font-size: 1.5rem; line-height: 1.1; color: var(--orange); font-variant-numeric: tabular-nums; }
.stat span { font-size: .8rem; color: var(--muted); font-weight: 700; }

.filters { display: grid; gap: .5rem; margin: 1rem 0; }
.filters .checkbox { font-size: .95rem; }

.legend { display: grid; gap: .4rem; font-size: .88rem; color: var(--muted); margin: 1rem 0 0; padding: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: .6rem; }
.legend .pin { width: 26px; height: 26px; position: static; }

.panel-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.map-panel .panel-privacy { font-size: .8rem; margin: 1rem 0 0; }

.panel-close, .map-bar, .map-backdrop { display: none; }

.map-locate {
    position: absolute;
    z-index: 500;
    top: 16px;
    right: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

/* Mobile: the panel becomes a centred dialog, opened from a slim bar at the bottom. */
@media (max-width: 720px) {
    .map-panel {
        display: none;
        position: fixed;
        z-index: 1200;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: min(440px, calc(100vw - 32px));
        max-height: calc(100dvh - 48px);
        padding: 20px 20px 22px;
        background: var(--surface);
        backdrop-filter: none;
    }
    .map-panel.is-open { display: block; animation: dialog-in .2s ease; }
    .map-panel h1 { font-size: 2rem; padding-right: 44px; }

    .panel-close {
        display: grid;
        place-items: center;
        position: sticky;
        top: 0;
        float: right;
        width: 40px;
        height: 40px;
        margin: -6px -6px 0 0;
        border-radius: 50%;
        border: 1px solid var(--border);
        background: var(--surface-2);
        color: var(--text);
        font-size: 1.1rem;
        cursor: pointer;
        z-index: 1;
    }

    .map-backdrop:not([hidden]) {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1150;
        background: rgba(5, 3, 8, .72);
    }

    .map-bar {
        display: block;
        position: absolute;
        z-index: 500;
        left: 12px;
        right: 12px;
        bottom: 16px;
    }
    .map-bar-button {
        display: flex;
        align-items: center;
        gap: .6rem;
        width: 100%;
        padding: .45rem .45rem .45rem .8rem;
        border-radius: 999px;
        border: 1px solid var(--border);
        background: rgba(26, 20, 32, .96);
        box-shadow: var(--shadow);
        color: var(--text);
        font: inherit;
        font-size: .95rem;
        text-align: left;
        cursor: pointer;
    }
    .map-bar-button img { flex: none; filter: drop-shadow(0 0 6px rgba(241, 142, 20, .6)); }
    .map-bar-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
    .map-bar-text strong { color: var(--orange); }
    .map-bar-cta {
        flex: none;
        padding: .5rem .95rem;
        border-radius: 999px;
        background: linear-gradient(180deg, var(--orange), var(--orange-deep));
        color: #1a0d00;
        font-weight: 800;
    }

    .map-locate { top: 12px; right: auto; left: 12px; }
    .map-shell .leaflet-control-zoom { display: none; }
    .map-shell .leaflet-bottom.leaflet-right { top: 0; bottom: auto; }
}

@keyframes dialog-in { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@media (prefers-reduced-motion: reduce) { .map-panel.is-open { animation: none; } }

/* Pins */
.pin {
    position: relative;
    width: 44px;
    height: 44px;
    transition: transform .15s ease;
}
.pin img { width: 100%; height: 100%; filter: drop-shadow(0 0 8px rgba(241, 142, 20, .7)) drop-shadow(0 3px 3px rgba(0, 0, 0, .6)); }
.pin:hover { transform: scale(1.12); }
.pin--empty img { filter: grayscale(1) brightness(.6) drop-shadow(0 3px 3px rgba(0, 0, 0, .6)); }
.pin--mine img { filter: drop-shadow(0 0 10px rgba(167, 123, 255, .95)) drop-shadow(0 3px 3px rgba(0, 0, 0, .6)); }
.pin--visited::after {
    content: "✓";
    position: absolute;
    right: -4px;
    bottom: -2px;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--slime);
    color: #142004;
    font-size: 12px;
    font-weight: 900;
    border: 2px solid var(--bg);
}
.pin-glow {
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 30px;
    height: 8px;
    margin-left: -15px;
    border-radius: 50%;
    background: radial-gradient(rgba(241, 142, 20, .55), transparent 70%);
    animation: flicker 2.6s infinite ease-in-out;
}
.pin--empty .pin-glow { display: none; }
@keyframes flicker { 0%, 100% { opacity: .9; } 45% { opacity: .5; } 55% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pin-glow { animation: none; } }

/* Leaflet overrides */
.leaflet-container { font-family: var(--font-body); background: #0b0a10; }
.spooky-tiles { filter: invert(1) hue-rotate(200deg) brightness(.82) contrast(.92) saturate(.45); }
.leaflet-popup-content-wrapper {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.leaflet-popup-tip { background: var(--surface); border: 1px solid var(--border); }
.leaflet-popup-content { margin: 16px 18px; width: 280px !important; max-width: calc(100vw - 80px); font-size: 15px; line-height: 1.5; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); top: 6px; right: 6px; }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
.leaflet-control-attribution { background: rgba(15, 11, 18, .7) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--orange-soft) !important; }

.popup-title { font-family: var(--font-display); font-size: 1.6rem; color: var(--orange); letter-spacing: .04em; line-height: 1.1; margin: 0 0 .2rem; }
.popup-address { color: var(--muted); font-size: .9rem; margin: 0 0 .6rem; }
.popup-desc { margin: 0 0 .6rem; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .75rem; }
.tag {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
}
.tag--orange { color: var(--orange-soft); border-color: rgba(241, 142, 20, .4); }
.tag--slime { color: #c7e07a; border-color: rgba(148, 177, 69, .45); }
.tag--grey { color: var(--muted); }
.tag--witch { color: #cdb5ff; border-color: rgba(167, 123, 255, .45); }

.popup-section-title { font-weight: 800; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: .75rem 0 .4rem; }
.vote-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.vote-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .1rem;
    padding: .5rem .6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}
.vote-btn:hover:not([disabled]) { border-color: var(--orange); }
.vote-btn .vote-count { color: var(--muted); font-weight: 600; font-size: .76rem; }
.vote-btn.is-selected { border-color: var(--orange); background: rgba(241, 142, 20, .15); }
.vote-btn.is-selected .vote-count { color: var(--orange-soft); }
.vote-btn[disabled] { cursor: default; }
.popup-note { font-size: .82rem; color: var(--muted); margin: .6rem 0 0; }

/* --- Intro sections ---------------------------------------------------- */

.steps { counter-reset: step; }
.step { position: relative; padding-top: 3.2rem; }
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: 0;
    left: clamp(18px, 3vw, 28px);
    top: clamp(14px, 2.4vw, 22px);
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--witch);
}
.step h3 { color: var(--text); font-family: var(--font-body); font-weight: 800; font-size: 1.15rem; letter-spacing: 0; }
.step p { color: var(--muted); margin: 0; }

/* --- Badges ------------------------------------------------------------ */

.badge-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.badge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1.1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.badge-medal {
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 2.6rem;
    margin-bottom: .9rem;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .25), transparent 45%),
        conic-gradient(from 210deg, var(--orange), var(--orange-deep), #7a2f00, var(--orange-deep), var(--orange));
    box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--orange), 0 0 28px rgba(241, 142, 20, .45);
}
.badge-card h3 { color: var(--text); font-size: 1.45rem; margin-bottom: .3rem; }
.badge-card p { color: var(--muted); font-size: .92rem; margin-bottom: .75rem; }
.badge-card .badge-meta { margin-top: auto; font-size: .8rem; font-weight: 800; color: var(--slime); }
.badge-card.is-locked .badge-medal {
    background: var(--surface-2);
    box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--border);
    filter: grayscale(1);
    opacity: .55;
}
.badge-card.is-locked h3 { color: var(--muted); }
.badge-card.is-locked .badge-meta { color: var(--muted); }

.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--orange-deep), var(--orange)); border-radius: 999px; }

/* --- Leaderboard ------------------------------------------------------- */

.leader-card { display: flex; gap: .9rem; align-items: center; }
.leader-icon {
    flex: none;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 1.6rem;
}
.leader-card .leader-label { font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.leader-card .leader-name { font-weight: 800; font-size: 1.1rem; color: var(--text); line-height: 1.3; }
.leader-card .leader-sub { font-size: .88rem; color: var(--muted); }

.street-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.street {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.street summary {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
}
.street summary::-webkit-details-marker { display: none; }
.street-rank {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--muted);
    min-width: 2.2ch;
    text-align: center;
}
.street:nth-child(1) .street-rank { color: var(--orange); text-shadow: 0 0 16px rgba(241, 142, 20, .6); }
.street:nth-child(2) .street-rank { color: var(--orange-soft); }
.street:nth-child(3) .street-rank { color: var(--witch); }
.street-name { font-weight: 800; font-size: 1.15rem; }
.street-meta { font-size: .88rem; color: var(--muted); }
.street-score { text-align: right; }
.street-score strong { display: block; font-size: 1.4rem; color: var(--orange); font-variant-numeric: tabular-nums; line-height: 1.1; }
.street-score span { font-size: .75rem; color: var(--muted); font-weight: 700; }
.street-body { padding: 0 1.25rem 1.25rem; border-top: 1px solid var(--border); }
.street-body .grid { margin-top: 1rem; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .7rem .5rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }

.empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--muted);
}
.empty img { width: 64px; opacity: .7; margin-bottom: .75rem; }

/* --- House editor ------------------------------------------------------ */

.editor { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }
.editor-form { margin-top: 1.5rem; }
.address-fields { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }
.address-fields legend { font-weight: 800; color: var(--orange-soft); margin-bottom: .6rem; padding: 0; }
.form-row-address { display: grid; grid-template-columns: 1fr 6.5rem; gap: .75rem; }
.form-row-postal { display: grid; grid-template-columns: 8rem 1fr; gap: .75rem; }
.locate-status { margin: .6rem 0 0; font-size: .92rem; font-weight: 700; }
.locate-status:empty { display: none; }
.locate-status.is-ok { color: #c7e07a; }
.locate-status.is-warning { color: var(--orange-soft); }
.locate-status.is-error { color: #ff9a9d; }
.editor-map .hint { margin-top: .6rem; }
.leaflet-control-layers { background: var(--surface) !important; color: var(--text); border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; }
.leaflet-control-layers-expanded { padding: .4rem .7rem !important; }
.leaflet-control-layers label { font-weight: 700; margin: .15rem 0; }
.hint-tight { margin: -.6rem 0 1.1rem; }
#picker-map { height: 420px; border-radius: var(--radius); border: 1px solid var(--border); background: #0b0a10; }
@media (min-width: 901px) { .editor-map { position: sticky; top: calc(var(--header-h) + 16px); } }

.search-results { list-style: none; margin: .4rem 0 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.search-results:empty { display: none; }
.search-results button {
    display: block;
    width: 100%;
    text-align: left;
    padding: .6rem .8rem;
    background: var(--surface-2);
    border: 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font: inherit;
    font-size: .92rem;
    cursor: pointer;
}
.search-results li:last-child button { border-bottom: 0; }
.search-results button:hover { background: rgba(241, 142, 20, .12); }

.candy-status { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* --- Admin ------------------------------------------------------------ */

.admin-tabs { display: flex; gap: .4rem; margin: 0 0 1.25rem; border-bottom: 1px solid var(--border); }
.admin-tabs a {
    padding: .6rem 1rem;
    color: var(--muted);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}
.admin-tabs a:hover { color: var(--text); }
.admin-tabs a.active { color: var(--orange); border-bottom-color: var(--orange); }

.stats-wide { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-bottom: 1.25rem; }

.admin-search { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.admin-search input[type="search"] { flex: 1 1 260px; width: auto; }
.admin-search .checkbox { margin: 0; font-size: .95rem; }

.table-wrap { overflow-x: auto; padding: 0; }
.table-wrap .table { min-width: 760px; }
.table-wrap .table th:first-child, .table-wrap .table td:first-child { padding-left: 1.25rem; }
.table td { vertical-align: top; }
.table tr.is-suspended td { background: rgba(226, 69, 74, .06); }
.small { font-size: .85rem; }

.tag--danger { color: #ff9a9d; border-color: rgba(226, 69, 74, .5); }

.admin-actions form, .admin-actions details { margin: 0 0 .4rem; }
.admin-actions > :last-child { margin-bottom: 0; }
.suspend-form summary { list-style: none; cursor: pointer; }
.suspend-form summary::-webkit-details-marker { display: none; }
.suspend-form[open] summary { margin-bottom: .5rem; }
.suspend-form form { display: grid; gap: .4rem; min-width: 220px; }
.suspend-form label { margin: 0; font-weight: 700; color: var(--muted); }
.suspend-form input { padding: .45rem .6rem; font-size: .9rem; }
.btn-link-danger { background: none; border: 0; padding: .2rem 0; color: var(--blood); font-weight: 700; }
.btn-link-danger:hover { text-decoration: underline; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.pager span[aria-disabled] { opacity: .4; }

/* --- Toasts ------------------------------------------------------------ */

.toasts {
    position: fixed;
    z-index: 2000;
    right: 16px;
    bottom: 16px;
    display: grid;
    gap: .6rem;
    max-width: min(380px, calc(100vw - 32px));
}
.toast {
    display: flex;
    gap: .8rem;
    align-items: center;
    padding: .85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--orange);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    animation: toast-in .3s ease;
}
.toast--badge { border-left-color: var(--slime); }
.toast--error { border-left-color: var(--blood); }
.toast-icon { font-size: 1.8rem; line-height: 1; }
.toast strong { display: block; color: var(--orange-soft); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 720px) { .toasts { top: calc(var(--header-h) + 12px); bottom: auto; right: 16px; left: 16px; max-width: none; } }
