:root {
    --bg: #030b12;
    --panel: rgba(5, 15, 25, 0.82);
    --panel-soft: rgba(8, 21, 34, 0.56);
    --panel-strong: rgba(5, 15, 25, 0.94);
    --border: rgba(172, 231, 226, 0.2);
    --line: rgba(172, 231, 226, 0.2);
    --line-strong: rgba(172, 231, 226, 0.36);
    --text: #f4f8fb;
    --muted: #b5c3ce;
    --subtle: #8297a5;
    --teal: #83e6cf;
    --teal-bright: #a5fff0;
    --accent: #83e6cf;
    --accent-strong: #62d7bf;
    --glow: 0 0 34px rgba(131, 230, 207, 0.24);
    --category-ufo: #32d8d4;
    --category-ghost: #a65cff;
    --category-cryptid: #67d65d;
    --category-other: #d9af19;
    --radius: 8px;
    --header-h: 76px;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
    --max: 1360px;
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
    background: var(--bg);
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 10%, rgba(104, 221, 208, 0.08), transparent 18rem),
        linear-gradient(180deg, #02080f 0%, #06121b 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button {
    color: inherit;
}

svg {
    display: block;
}

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    width: 1.15em;
    height: 1.15em;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.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: 900;
    border-bottom: 1px solid transparent;
    background: rgba(3, 10, 17, 0.58);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: top 180ms ease, background 180ms ease, border-color 180ms ease;
}

.site-header.is-scrolled,
.site-header.is-open {
    border-bottom-color: transparent;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.site-header.is-scrolled {
    top: 14px;
}

.site-header.is-open {
    top: 10px;
}

.header-inner {
    width: min(calc(100% - 56px), var(--max));
    min-height: var(--header-h);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 38px;
    border: 1px solid transparent;
    border-radius: 0;
    overflow: visible;
    transition: width 220ms ease, min-height 220ms ease, padding 220ms ease, border-color 220ms ease, border-radius 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.site-header.is-scrolled .header-inner,
.site-header.is-open .header-inner {
    width: min(calc(100% - 32px), 1120px);
    min-height: 64px;
    padding: 0 20px;
    border-color: rgba(131, 230, 207, 0.22);
    border-radius: 999px;
    background: rgba(3, 12, 20, 0.84);
    box-shadow: 0 20px 58px rgba(0, 0, 0, 0.38), 0 0 38px rgba(95, 214, 191, 0.12);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    background-clip: padding-box;
}

.site-header::before,
.site-header::after {
    content: none;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    min-width: max-content;
    color: #eef8f8;
    font-size: 28px;
    line-height: 1;
}

.brand-mark {
    width: 46px;
    height: 46px;
    color: var(--accent);
}

.brand-mark circle,
.brand-mark path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.45;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 36px;
    margin-left: auto;
    color: rgba(246, 251, 255, 0.9);
    font-size: 15px;
}

.site-nav > a,
.nav-dropdown-button,
.login-link,
.nav-link-button {
    color: rgba(246, 251, 255, 0.9);
    transition: color 150ms ease;
}

.site-nav > a:hover,
.site-nav > a:focus-visible,
.nav-dropdown-button:hover,
.nav-dropdown-button:focus-visible,
.login-link:hover,
.login-link:focus-visible,
.nav-link-button:hover,
.nav-link-button:focus-visible,
.site-nav > a.is-active {
    color: var(--accent);
}

.site-nav > a.is-active {
    position: relative;
    font-weight: 760;
}

.site-nav > a.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -22px;
    width: 6px;
    height: 3px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 18px rgba(131, 230, 207, 0.8);
    transform: translateX(-50%);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.nav-dropdown-button .icon {
    width: 14px;
    height: 14px;
    transition: transform 160ms ease;
}

.nav-dropdown.is-open .nav-dropdown-button .icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 18px);
    left: 50%;
    min-width: 210px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(5, 15, 25, 0.96);
    box-shadow: var(--shadow);
    transform: translate(-50%, 8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.nav-dropdown.is-open .dropdown-menu {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.dropdown-menu a {
    display: block;
    padding: 11px 12px;
    border-radius: 6px;
    color: var(--muted);
}

.dropdown-menu a:hover,
.dropdown-menu a:focus-visible {
    color: var(--text);
    background: rgba(131, 230, 207, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 26px;
    margin-left: auto;
}

.header-logout-form {
    margin: 0;
}

.nav-link-button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.user-menu {
    position: relative;
    z-index: 1001;
    display: inline-flex;
    align-items: center;
    margin-left: 2px;
}

.user-menu-button {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(131, 230, 207, 0.28);
    border-radius: 50%;
    color: var(--accent);
    background: rgba(4, 14, 24, 0.58);
    box-shadow: 0 0 0 rgba(131, 230, 207, 0);
    cursor: pointer;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, background 150ms ease;
}

.user-menu-button:hover,
.user-menu-button:focus-visible,
.user-menu-button.is-active,
.user-menu.is-open .user-menu-button {
    border-color: rgba(131, 230, 207, 0.7);
    background: rgba(131, 230, 207, 0.1);
    box-shadow: 0 0 24px rgba(131, 230, 207, 0.22);
}

.user-menu-button:hover,
.user-menu-button:focus-visible {
    transform: translateY(-1px);
}

.user-avatar,
.user-avatar img,
.user-avatar-fallback {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.user-avatar {
    display: grid;
    place-items: center;
    overflow: hidden;
    background: rgba(131, 230, 207, 0.12);
}

.user-avatar img {
    object-fit: cover;
}

.user-avatar-fallback {
    display: grid;
    place-items: center;
    color: #061611;
    background: linear-gradient(135deg, #9cf0dd, #52cdb8);
    font-size: 15px;
    font-weight: 800;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    z-index: 1200;
    min-width: 210px;
    padding: 9px;
    border: 1px solid rgba(131, 230, 207, 0.24);
    border-radius: 50%;
    background: rgba(4, 13, 22, 0.96);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.48), 0 0 30px rgba(95, 214, 191, 0.12);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
}

.user-menu.is-open .user-dropdown,
.user-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.user-dropdown-link {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 0 11px;
    border: 0;
    border-radius: 6px;
    color: rgba(246, 251, 255, 0.88);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.user-dropdown-link:hover,
.user-dropdown-link:focus-visible {
    color: var(--accent);
    background: rgba(131, 230, 207, 0.09);
}

.user-dropdown-divider {
    height: 1px;
    margin: 8px 4px;
    background: rgba(172, 231, 226, 0.14);
}

.user-dropdown-form {
    margin: 0;
}

.mobile-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
}

.mobile-toggle-line {
    width: 19px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 160ms ease, opacity 160ms ease;
}

.site-header.is-open .mobile-toggle-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.site-header.is-open .mobile-toggle-line:nth-child(2) {
    opacity: 0;
}

.site-header.is-open .mobile-toggle-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.icon-menu-close {
    display: none;
}

.site-header.is-open .icon-menu-open {
    display: none;
}

.site-header.is-open .icon-menu-close {
    display: block;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 760;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-1px);
}

.button-primary {
    color: #061611;
    background: linear-gradient(180deg, #94ead7, #67d6be);
    box-shadow: 0 16px 36px rgba(90, 220, 190, 0.22);
}

.button-ghost {
    color: var(--text);
    border-color: rgba(184, 232, 227, 0.26);
    background: rgba(6, 15, 25, 0.52);
}

.button-ghost:hover,
.button-ghost:focus-visible {
    border-color: rgba(131, 230, 207, 0.55);
    background: rgba(131, 230, 207, 0.08);
}

.button-small {
    min-height: 46px;
    padding: 0 23px;
    font-size: 15px;
}

.site-nav > .button.button-small {
    border-radius: 999px;
}

.mobile-nav-only {
    display: none;
}

.explore-shell {
    height: calc(100vh - var(--header-h));
    min-height: 620px;
}

.map-stage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #020a11;
}

.explore-map {
    position: absolute;
    inset: 0;
    z-index: 1;
    height: 100%;
    min-height: 520px;
}

.map-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(circle at 52% 50%, transparent 0 33%, rgba(3, 11, 18, 0.22) 58%, rgba(3, 11, 18, 0.58) 100%),
        linear-gradient(90deg, rgba(3, 11, 18, 0.34), transparent 30%, transparent 68%, rgba(3, 11, 18, 0.42));
}

.leaflet-popup.event-preview-popup .leaflet-popup-content {
    margin: 0;
}

.leaflet-popup.event-preview-popup .leaflet-popup-content {
    width: 360px !important;
}

.leaflet-popup.event-preview-popup .leaflet-popup-content-wrapper {
    overflow: hidden;
    border-radius: var(--radius);
}

.event-popup-card {
    width: 360px;
    overflow: hidden;
    color: var(--text);
    background: rgba(5, 15, 25, 0.96);
}

.event-popup-media {
    min-height: 148px;
    position: relative;
    background-size: cover;
    background-position: center;
}

.event-popup-marker,
.event-popup-status {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.event-popup-marker {
    left: 16px;
    top: 16px;
    width: 42px;
    height: 42px;
    border: 1px solid color-mix(in srgb, var(--popup-color, var(--accent)) 58%, white 24%);
    border-radius: 8px;
    color: var(--popup-color, var(--accent));
    background: color-mix(in srgb, var(--popup-color, var(--accent)) 20%, #08121c 80%);
    box-shadow: 0 0 24px color-mix(in srgb, var(--popup-color, var(--accent)) 58%, transparent);
}

.event-popup-marker svg,
.event-popup-footer svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.event-popup-status {
    right: 16px;
    top: 16px;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(132, 230, 165, 0.35);
    border-radius: 6px;
    color: #d6ffe2;
    background: rgba(19, 93, 53, 0.62);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.event-popup-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.event-badge {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    border: 1px solid rgba(172, 231, 226, 0.18);
    border-radius: 999px;
    color: rgba(235, 247, 248, 0.92);
    background: rgba(4, 14, 24, 0.72);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.event-badge--community {
    color: #cdeeff;
    border-color: rgba(83, 178, 255, 0.34);
    background: rgba(40, 119, 184, 0.18);
}

.event-badge--historical {
    color: #e6d8ff;
    border-color: rgba(166, 92, 255, 0.42);
    background: rgba(94, 54, 151, 0.24);
}

.event-badge--featured {
    color: #fff0ba;
    border-color: rgba(230, 180, 65, 0.44);
    background: rgba(143, 98, 24, 0.22);
}

.event-badge--historical-date {
    color: #d8fff0;
    border-color: rgba(105, 214, 153, 0.4);
    background: rgba(41, 117, 81, 0.2);
}

.event-popup-body {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.event-popup-meta-row,
.event-popup-footer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.event-popup-meta-row {
    justify-content: space-between;
    color: rgba(232, 240, 244, 0.78);
    font-size: 13px;
}

.event-popup-category {
    color: var(--accent);
    font-weight: 800;
    text-transform: uppercase;
}

.event-popup-card h3 {
    margin: 0;
    color: var(--text);
    font-size: 19px;
    line-height: 1.25;
}

.event-popup-location {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    color: rgba(232, 240, 244, 0.82);
    font-size: 14px;
}

.event-popup-location svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    margin-top: 2px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.event-popup-description {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: rgba(232, 240, 244, 0.84);
    font-size: 14px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.event-popup-footer {
    flex-wrap: wrap;
    color: rgba(232, 240, 244, 0.78);
    font-size: 13px;
}

.event-popup-footer span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.event-popup-footer button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    margin-left: auto;
    border: 1px solid rgba(172, 231, 226, 0.22);
    border-radius: 50%;
    color: rgba(232, 240, 244, 0.82);
    background: rgba(2, 10, 18, 0.58);
    cursor: pointer;
}

.event-popup-footer button:hover,
.event-popup-footer button:focus-visible,
.event-popup-footer button.is-saved {
    color: var(--accent);
    border-color: rgba(131, 230, 207, 0.48);
}

.event-popup-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #061611;
    background: linear-gradient(180deg, #94ead7, #67d6be);
    font-size: 14px;
    font-weight: 800;
}

.control-panel,
.detail-panel {
    position: absolute;
    z-index: 5;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(6, 17, 28, 0.9), rgba(5, 14, 23, 0.78));
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.control-panel {
    left: 28px;
    top: 28px;
    width: min(310px, calc(100vw - 56px));
    max-height: calc(100% - 56px);
    display: flex;
    flex-direction: column;
    padding: 22px;
    overflow: auto;
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

body.filters-collapsed .control-panel {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-28px);
    pointer-events: none;
}

.panel-head {
    position: relative;
}

.panel-head h1 {
    margin: 0;
    font-size: 27px;
    line-height: 1.12;
}

.panel-head p {
    margin: 10px 0 20px;
    color: rgba(232, 240, 244, 0.84);
}

.panel-close {
    display: none;
}

.panel-collapse {
    position: absolute;
    top: 0;
    right: 0;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(184, 232, 227, 0.2);
    border-radius: var(--radius);
    color: var(--accent);
    background: rgba(3, 10, 17, 0.52);
    cursor: pointer;
}

.panel-collapse .icon {
    width: 17px;
    height: 17px;
    transform: rotate(180deg);
}

.search-form {
    display: grid;
    gap: 14px;
}

.search-field,
.select-wrap {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(184, 232, 227, 0.22);
    border-radius: var(--radius);
    color: var(--muted);
    background: rgba(3, 10, 17, 0.52);
}

.search-field {
    padding: 0 14px;
}

.search-field input,
.select-wrap select {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
}

.search-field input::placeholder {
    color: rgba(213, 226, 233, 0.68);
}

.filter-group {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

.filter-group h2,
.filter-group label {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 760;
}

.filter-list {
    display: grid;
    gap: 7px;
}

.filter-chip {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 11px;
    border: 1px solid rgba(184, 232, 227, 0.17);
    border-radius: var(--radius);
    color: rgba(232, 240, 244, 0.9);
    background: rgba(255, 255, 255, 0.035);
    text-align: left;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.filter-chip:hover,
.filter-chip:focus-visible,
.filter-chip.is-active {
    border-color: rgba(131, 230, 207, 0.74);
    color: var(--accent);
    background: rgba(131, 230, 207, 0.09);
}

.chip-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    color: var(--accent);
    background: rgba(131, 230, 207, 0.12);
}

.chip-icon .icon {
    width: 17px;
    height: 17px;
}

.chip-all {
    color: var(--accent);
    background: rgba(131, 230, 207, 0.14);
}

.chip-ufo {
    color: var(--category-ufo);
    background: color-mix(in srgb, var(--category-ufo) 22%, #06121b 78%);
    box-shadow: inset 0 0 18px color-mix(in srgb, var(--category-ufo) 18%, transparent);
}

.chip-ghost {
    color: var(--category-ghost);
    background: color-mix(in srgb, var(--category-ghost) 24%, #06121b 76%);
    box-shadow: inset 0 0 18px color-mix(in srgb, var(--category-ghost) 18%, transparent);
}

.chip-cryptid {
    color: var(--category-cryptid);
    background: color-mix(in srgb, var(--category-cryptid) 22%, #06121b 78%);
    box-shadow: inset 0 0 18px color-mix(in srgb, var(--category-cryptid) 18%, transparent);
}

.chip-other {
    color: var(--category-other);
    background: color-mix(in srgb, var(--category-other) 24%, #06121b 76%);
    box-shadow: inset 0 0 18px color-mix(in srgb, var(--category-other) 18%, transparent);
}

.select-wrap {
    position: relative;
    padding: 0 13px;
}

.select-wrap select {
    appearance: none;
    height: 100%;
    cursor: pointer;
}

.select-chevron {
    width: 14px;
    height: 14px;
}

.reset-button,
.save-button,
.panel-close,
.detail-close,
.panel-collapse,
.desktop-filter-tab,
.mobile-filter-toggle,
.mobile-locate {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.reset-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    padding: 0;
    color: rgba(232, 240, 244, 0.7);
    text-align: left;
}

.reset-button:hover,
.reset-button:focus-visible {
    color: var(--accent);
}

.detail-panel {
    top: 28px;
    right: 28px;
    width: min(350px, calc(100vw - 56px));
    max-height: calc(100% - 56px);
    overflow: hidden auto;
    opacity: 0;
    visibility: hidden;
    transform: translateX(18px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.detail-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

.detail-close {
    position: absolute;
    right: 18px;
    top: 18px;
    z-index: 2;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: rgba(245, 251, 252, 0.9);
    background: rgba(3, 10, 17, 0.52);
}

.detail-drag {
    display: none;
}

.detail-media {
    position: relative;
    min-height: 180px;
    background:
        linear-gradient(180deg, rgba(3, 10, 17, 0.04), rgba(3, 10, 17, 0.88)),
        var(--detail-image, linear-gradient(135deg, #071725, #10263a));
    background-size: cover;
    background-position: center;
}

.detail-category-icon {
    position: absolute;
    left: 24px;
    top: 26px;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: var(--detail-color, var(--accent));
    box-shadow: 0 0 32px color-mix(in srgb, var(--detail-color, var(--accent)) 70%, transparent);
}

.detail-content {
    padding: 20px 24px 24px;
}

.detail-content h2 {
    margin: 0 0 16px;
    font-size: 24px;
    line-height: 1.2;
    text-wrap: balance;
}

.detail-meta {
    display: grid;
    gap: 9px;
    margin: 0 0 12px;
    color: rgba(232, 240, 244, 0.78);
    font-size: 14px;
}

.detail-meta span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.detail-meta .icon {
    color: var(--accent);
}

.category-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    color: #dffbf6;
    background: color-mix(in srgb, var(--detail-color, var(--accent)) 30%, #07111b 70%);
    font-size: 13px;
    font-weight: 760;
}

.detail-description {
    display: -webkit-box;
    margin: 20px 0 26px;
    overflow: hidden;
    color: rgba(232, 240, 244, 0.84);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.evidence-group h3 {
    margin: 0 0 14px;
    font-size: 14px;
}

.evidence-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.evidence-badge {
    display: grid;
    justify-items: center;
    gap: 8px;
    color: rgba(232, 240, 244, 0.84);
    font-size: 12px;
    line-height: 1.25;
    text-align: center;
}

.evidence-badge span {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--detail-color, var(--accent)) 42%, transparent);
    border-radius: 50%;
    color: var(--detail-color, var(--accent));
    background: color-mix(in srgb, var(--detail-color, var(--accent)) 12%, transparent);
}

.report-button {
    width: 100%;
    margin-top: 28px;
}

.save-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    color: rgba(244, 249, 252, 0.9);
}

.save-button.is-saved {
    color: var(--accent);
}

.desktop-filter-tab {
    position: absolute;
    left: 28px;
    top: 28px;
    z-index: 6;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 760;
    background: rgba(5, 15, 25, 0.86);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.desktop-filter-tab .icon {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

body.filters-collapsed .desktop-filter-tab {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

.mobile-filter-toggle,
.mobile-locate {
    display: none;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 1000;
    max-width: min(420px, calc(100% - 40px));
    padding: 13px 18px;
    border: 1px solid rgba(131, 230, 207, 0.36);
    border-radius: var(--radius);
    color: var(--text);
    background: rgba(4, 14, 23, 0.92);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 16px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 1180px) {
    .header-inner {
        gap: 24px;
    }

    .site-nav {
        gap: 22px;
    }

    .control-panel {
        width: 288px;
    }

    .detail-panel {
        width: 326px;
    }

}

@media (max-width: 980px) {
    :root {
        --header-h: 70px;
    }

    body {
        overflow: hidden;
    }

    .header-inner {
        width: min(calc(100% - 36px), var(--max));
        min-height: var(--header-h);
    }

    .brand {
        font-size: 23px;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
    }

    .site-nav {
        position: absolute;
        left: 18px;
        right: 18px;
        top: calc(100% + 10px);
        display: grid;
        gap: 0;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: rgba(4, 13, 22, 0.96);
        box-shadow: var(--shadow);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        pointer-events: none;
        transition: opacity 160ms ease, visibility 160ms ease, transform 160ms ease;
    }

    .site-header.is-open .site-nav {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .site-nav > a,
    .site-nav .button,
    .nav-dropdown-button,
    .nav-link-button {
        width: 100%;
        justify-content: space-between;
        padding: 14px 12px;
        border-radius: 6px;
    }

    .site-nav > a:hover,
    .site-nav > a:focus-visible,
    .site-nav .button:hover,
    .site-nav .button:focus-visible,
    .nav-dropdown-button:hover,
    .nav-dropdown-button:focus-visible,
    .nav-link-button:hover,
    .nav-link-button:focus-visible {
        background: rgba(131, 230, 207, 0.08);
    }

    .site-nav > a.is-active::after {
        left: 12px;
        bottom: 7px;
        transform: none;
    }

    .nav-dropdown {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        min-width: 0;
        margin: 0 0 8px 14px;
        padding: 0 0 0 12px;
        border: 0;
        border-left: 1px solid rgba(131, 230, 207, 0.2);
        background: transparent;
        box-shadow: none;
        transform: none;
        display: none;
        opacity: 1;
        visibility: visible;
    }

    .nav-dropdown.is-open .dropdown-menu {
        display: block;
        transform: none;
    }

    .desktop-user-menu {
        display: none;
    }

    .site-nav .mobile-nav-only {
        display: flex;
    }

    .mobile-logout-form {
        width: 100%;
        margin: 0;
    }

    .header-logout-form {
        width: 100%;
    }

    .user-menu {
        width: 100%;
        display: grid;
        justify-items: start;
        padding: 8px 12px;
    }

    .user-dropdown {
        position: static;
        width: 100%;
        min-width: 0;
        display: none;
        margin-top: 10px;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
    }

    .user-menu.is-open .user-dropdown,
    .user-dropdown.is-open {
        display: grid;
        transform: none;
    }

    .mobile-toggle {
        display: flex;
        margin-left: auto;
    }

    .explore-shell {
        min-height: 0;
        height: calc(100dvh - var(--header-h));
    }

    .control-panel {
        position: fixed;
        inset: var(--header-h) 0 0 0;
        z-index: 950;
        width: auto;
        max-height: none;
        padding: 26px 22px;
        border-radius: 0;
        border-width: 1px 0 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(16px);
        pointer-events: none;
        transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
    }

    .control-panel.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .panel-close {
        position: absolute;
        top: 0;
        right: 0;
        width: 42px;
        height: 42px;
        display: grid;
        place-items: center;
        color: var(--text);
    }

    .panel-collapse,
    .desktop-filter-tab,
    body.filters-collapsed .desktop-filter-tab {
        display: none;
    }

    .detail-panel {
        position: fixed;
        top: auto;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 940;
        width: auto;
        max-height: min(78dvh, 680px);
        border-radius: 16px;
        transform: translateY(24px);
    }

    .detail-panel.is-open {
        transform: translateY(0);
    }

    .detail-drag {
        position: absolute;
        top: 10px;
        left: 50%;
        z-index: 3;
        width: 62px;
        height: 4px;
        display: block;
        border-radius: 999px;
        background: rgba(245, 251, 252, 0.36);
        transform: translateX(-50%);
    }

    .detail-media {
        min-height: 156px;
    }

    .mobile-filter-toggle,
    .mobile-locate {
        position: absolute;
        z-index: 6;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--line);
        color: var(--text);
        background: rgba(5, 15, 25, 0.82);
        box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(14px);
    }

    .mobile-filter-toggle {
        left: 18px;
        bottom: 26px;
        gap: 10px;
        min-height: 50px;
        padding: 0 18px;
        border-radius: var(--radius);
        font-weight: 760;
    }

    .mobile-locate {
        right: 18px;
        bottom: 26px;
        width: 54px;
        height: 54px;
        border-radius: 50%;
        color: var(--accent);
    }
}

@media (max-width: 640px) {
    body {
        font-size: 15px;
    }

    .header-inner {
        width: min(calc(100% - 28px), var(--max));
    }

    .brand {
        gap: 11px;
        font-size: 20px;
    }

    .brand-mark {
        width: 35px;
        height: 35px;
    }

    .panel-head h1 {
        font-size: 24px;
    }

    .search-form .button {
        width: 100%;
    }

    .detail-content {
        padding: 20px 20px 22px;
    }

    .detail-content h2 {
        font-size: 22px;
    }

    .evidence-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .leaflet-popup.event-preview-popup .leaflet-popup-content,
    .event-popup-card {
        width: min(330px, calc(100vw - 34px)) !important;
    }

    .event-popup-media {
        min-height: 126px;
    }

    .event-popup-card h3 {
        font-size: 18px;
    }

    .event-popup-description {
        -webkit-line-clamp: 2;
    }

}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
