:root {
    --color-canvas: #f4f3ef;
    --color-surface: #fffefa;
    --color-surface-muted: #f0f1ed;
    --color-surface-translucent: rgb(255 254 250 / 0.94);
    --color-ink: #1b2738;
    --color-muted: #667286;
    --color-border: #dfe3e4;
    --color-border-strong: #bec7cb;
    --color-primary: #c85548;
    --color-primary-dark: #963a32;
    --color-primary-soft: #f9e9e5;
    --color-on-primary: #ffffff;
    --color-on-ink: #ffffff;
    --color-on-danger: #ffffff;
    --color-mint: #22966d;
    --color-violet: #7658db;
    --color-blue: #247be6;
    --color-amber: #b67b00;
    --color-danger: #b42318;
    --color-focus: #3159d9;
    --color-overlay: rgb(19 30 43 / 0.48);
    --shadow-panel: 0 18px 44px rgb(27 39 56 / 0.12);
    --shadow-control: 0 8px 24px rgb(27 39 56 / 0.1);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --header-height: 72px;
    --mobile-nav-height: 68px;
    color: var(--color-ink);
    color-scheme: light;
    font-family: "Avenir Next", Avenir, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] {
    --color-canvas: #0f1620;
    --color-surface: #151e29;
    --color-surface-muted: #202c3a;
    --color-surface-translucent: rgb(21 30 41 / 0.94);
    --color-ink: #eef3f8;
    --color-muted: #aab5c3;
    --color-border: #2b3949;
    --color-border-strong: #536477;
    --color-primary: #ff786b;
    --color-primary-dark: #ff9a8f;
    --color-primary-soft: #3a2426;
    --color-on-primary: #111923;
    --color-on-ink: #111923;
    --color-on-danger: #111923;
    --color-mint: #55c697;
    --color-violet: #a28bf0;
    --color-blue: #72a9f6;
    --color-amber: #e7b34e;
    --color-danger: #ff8a82;
    --color-focus: #8eabff;
    --color-overlay: rgb(2 8 15 / 0.72);
    --shadow-panel: 0 20px 54px rgb(0 0 0 / 0.42);
    --shadow-control: 0 10px 28px rgb(0 0 0 / 0.32);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    background: var(--color-canvas);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--color-canvas);
    color: var(--color-ink);
    font-size: 16px;
    line-height: 1.5;
    transition: background-color 180ms ease, color 180ms ease;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

a {
    color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--color-focus), transparent 22%);
    outline-offset: 3px;
}

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

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--color-ink);
    color: var(--color-on-ink);
    transform: translateY(-150%);
    transition: transform 160ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

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

.icon,
.brand__mark {
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.app-header {
    position: relative;
    z-index: 30;
    display: grid;
    grid-template-columns: auto auto minmax(260px, 1fr) auto;
    align-items: center;
    gap: clamp(18px, 2vw, 34px);
    min-height: var(--header-height);
    padding: 10px clamp(18px, 2.3vw, 40px);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-translucent);
    backdrop-filter: blur(18px) saturate(1.15);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    text-decoration: none;
    font-size: clamp(1.18rem, 1.55vw, 1.38rem);
    font-weight: 650;
    letter-spacing: -0.025em;
}

.brand__mark {
    width: 1.2rem;
    height: 1.2rem;
    color: var(--color-primary);
    stroke-width: 1.8;
}

.primary-nav {
    display: flex;
    align-items: stretch;
    gap: 4px;
    align-self: stretch;
}

.primary-nav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 13px;
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.94rem;
    font-weight: 650;
}

.primary-nav__link::after {
    position: absolute;
    right: 12px;
    bottom: -10px;
    left: 12px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--color-primary);
    content: "";
    opacity: 0;
}

.primary-nav__link.is-active {
    color: var(--color-primary-dark);
}

.primary-nav__link.is-active::after {
    opacity: 1;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(100%, 520px);
    min-height: 46px;
    padding: 0 14px;
    justify-self: center;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-muted);
    box-shadow: 0 1px 2px rgb(16 33 61 / 0.03);
}

.header-search:focus-within {
    border-color: var(--color-focus);
    box-shadow: 0 0 0 3px rgb(49 89 217 / 0.16);
}

.header-search input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--color-ink);
}

.header-search input::placeholder {
    color: var(--color-muted);
    opacity: 0.86;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.language-picker select {
    min-width: 62px;
    min-height: 42px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-ink);
    font-weight: 650;
}

.theme-toggle {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: var(--color-surface-muted);
    color: var(--color-muted);
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease,
        transform 160ms ease;
}

.theme-toggle:hover {
    border-color: var(--color-border-strong);
    color: var(--color-ink);
    transform: translateY(-1px);
}

.theme-toggle__moon,
:root[data-theme="dark"] .theme-toggle__sun {
    display: none;
}

:root[data-theme="dark"] .theme-toggle__moon {
    display: block;
}

.button,
.profile-button,
.filter-button,
.text-button,
.icon-button,
.site-footer__link,
.mobile-nav__link {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.94rem;
    font-weight: 650;
    line-height: 1.15;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease,
        box-shadow 160ms ease, transform 160ms ease;
}

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

.button:active {
    transform: translateY(0);
}

.button--primary {
    background: var(--color-primary);
    color: var(--color-on-primary);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--color-primary), transparent 78%);
}

.button--primary:hover {
    background: var(--color-primary-dark);
}

.button--secondary {
    border-color: var(--color-border-strong);
    background: var(--color-surface);
    color: var(--color-ink);
}

.button--secondary:hover,
.button--ghost:hover {
    border-color: var(--color-ink);
    background: var(--color-surface-muted);
}

.button--ghost {
    color: var(--color-ink);
}

.button--danger {
    border-color: var(--color-danger);
    background: var(--color-danger);
    color: var(--color-on-danger);
}

.button--danger:hover {
    background: #8e1b13;
}

.button--wide {
    width: 100%;
}

.profile-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 4px 8px 4px 4px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 650;
}

.profile-button:hover {
    background: var(--color-surface-muted);
}

.profile-button__avatar {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 3px solid var(--color-surface-muted);
    border-radius: 50%;
    background: var(--color-ink);
    color: var(--color-surface);
    font-size: 0.83rem;
    font-weight: 650;
}

.app-shell {
    display: grid;
    grid-template-columns: clamp(310px, 28vw, 380px) minmax(0, 1fr);
    min-height: calc(100dvh - var(--header-height) - 50px);
    background: var(--color-surface);
}

.discover-panel {
    position: relative;
    z-index: 4;
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: clamp(22px, 2.2vw, 34px) 14px 20px;
    border-right: 1px solid var(--color-border);
    background: var(--color-surface);
}

.discover-panel__heading {
    position: relative;
    padding: 0 10px;
}

.mobile-list-close,
.map-list-button {
    display: none;
}

.discover-panel h1 {
    max-width: 13ch;
    margin: 0;
    font-size: clamp(1.6rem, 2.1vw, 2rem);
    line-height: 1.12;
    font-weight: 680;
    letter-spacing: -0.032em;
}

.discover-panel__heading p {
    margin: 10px 0 0;
    color: var(--color-muted);
    font-size: 0.86rem;
}

.filter-disclosure {
    display: contents;
}

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

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 22px 10px 18px;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
    display: none;
}

.filter-button {
    display: inline-flex;
    min-height: 44px;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    background: var(--color-surface);
    color: var(--color-muted);
    font-size: 0.84rem;
    font-weight: 650;
}

.filter-button:hover {
    border-color: var(--color-border-strong);
    color: var(--color-ink);
}

.filter-button.is-active {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
}

.discovery-control {
    display: inline-flex;
    min-height: 44px;
    flex: 1 1 140px;
    align-items: center;
    gap: 7px;
    padding: 0 8px 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    background: var(--color-surface);
    color: var(--color-muted);
    font-size: 0.8rem;
    font-weight: 650;
}

.discovery-control select {
    min-width: 0;
    max-width: 100%;
    min-height: 34px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--color-ink);
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.discovery-control:focus-within {
    border-color: var(--color-focus);
    box-shadow: 0 0 0 3px rgb(49 89 217 / 0.15);
}

.radius-control {
    flex: 0 1 auto;
}

.custom-date-range {
    display: grid;
    flex: 1 1 100%;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    background: var(--color-surface-muted);
}

.custom-date-range label {
    display: grid;
    gap: 5px;
    color: var(--color-muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.custom-date-range input {
    width: 100%;
    min-height: 42px;
    padding: 8px;
    border: 1px solid var(--color-border-strong);
    border-radius: 7px;
    background: var(--color-surface);
    color: var(--color-ink);
    font: inherit;
}

.custom-date-range input:focus {
    border-color: var(--color-focus);
    outline: 0;
    box-shadow: 0 0 0 3px rgb(49 89 217 / 0.15);
}

.custom-date-range small {
    grid-column: 1 / -1;
    color: var(--color-muted);
    font-size: 0.72rem;
}

.event-list {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.event-card {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 12px;
    width: 100%;
    min-height: 104px;
    padding: 16px 12px 15px 16px;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-ink);
    text-align: left;
    cursor: pointer;
}

.event-card:last-child {
    border-bottom: 0;
}

.event-card:hover {
    background: var(--color-surface-muted);
}

.event-card.is-selected {
    background: var(--color-primary-soft);
}

.event-card.is-selected::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--color-primary);
    content: "";
}

.event-card__icon,
.event-detail__category {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.35);
}

.event-detail__cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0 0 14px;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
}

.event-detail__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-detail__external-actions {
    display: grid;
    gap: 8px;
    margin: 14px 0;
}

.event-detail__external-actions .button {
    justify-content: center;
    text-decoration: none;
}

.owner-actions {
    display: grid;
    gap: 8px;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-field input {
    width: 20px;
    height: 20px;
}

.event-card__icon--coral,
.map-pin--coral {
    background: var(--color-primary);
}

.event-card__icon--mint,
.map-pin--mint {
    background: var(--color-mint);
}

.event-card__icon--violet,
.map-pin--violet {
    background: var(--color-violet);
}

.event-card__icon--amber,
.map-pin--amber {
    background: var(--color-amber);
}

.event-card__icon--blue,
.map-pin--blue {
    background: var(--color-blue);
}

.event-card__content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.event-card__content strong {
    overflow: hidden;
    font-size: 0.98rem;
    font-weight: 650;
    letter-spacing: -0.015em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-card__time {
    color: var(--color-muted);
    font-size: 0.84rem;
}

.event-card.is-selected .event-card__time {
    color: var(--color-primary-dark);
}

.event-card__place {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    overflow: hidden;
    color: var(--color-muted);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-card__place .icon {
    width: 0.9rem;
    height: 0.9rem;
}

.event-card__distance {
    align-self: end;
    color: var(--color-muted);
    font-size: 0.76rem;
    white-space: nowrap;
}

.event-list__empty {
    margin: auto;
    padding: 30px 24px;
    color: var(--color-muted);
    font-size: 0.9rem;
    line-height: 1.55;
    text-align: center;
}

.event-list-more {
    margin: 16px 0 0;
}

.map-region {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) clamp(292px, 24vw, 340px);
    background: var(--color-canvas);
}

.map-canvas {
    position: relative;
    min-width: 0;
    min-height: 640px;
    overflow: hidden;
    background: #e7edf2;
    isolation: isolate;
}

.map-canvas__image {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 220ms ease;
    user-select: none;
}

.map-canvas__live {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.google-map__surface {
    width: 100%;
    height: 100%;
    filter: none;
    image-rendering: auto;
    transform: none;
}

.map-user-location {
    position: relative;
    width: 26px;
    height: 26px;
    transform: translateY(50%);
    pointer-events: none;
}

.map-user-location__halo,
.map-user-location__dot {
    position: absolute;
    border-radius: 50%;
}

.map-user-location__halo {
    inset: 0;
    border: 1px solid rgb(26 115 232 / 0.72);
    background: rgb(26 115 232 / 0.18);
    box-shadow: 0 0 0 4px rgb(255 255 255 / 0.56);
}

.map-user-location__dot {
    inset: 6px;
    border: 3px solid #fff;
    background: #1a73e8;
    box-shadow: 0 2px 6px rgb(16 33 61 / 0.35);
}

body.is-maps-requested .map-canvas__image,
body.is-maps-requested .map-pin,
body.is-maps-ready .map-canvas__image,
body.is-maps-ready .map-pin {
    display: none;
}

body.is-connected-no-maps .map-canvas__image,
body.is-connected-no-maps .map-pin,
body.is-connected-no-maps .map-controls,
body.is-connected-no-maps .map-create-button {
    display: none;
}

body.is-connected-no-maps .map-canvas {
    background:
        radial-gradient(circle at 50% 38%, rgb(255 255 255 / 0.72), transparent 34%),
        var(--color-canvas);
}

.map-canvas__image.is-reference-only {
    opacity: 0.3;
    filter: grayscale(0.65);
}

:root[data-theme="dark"] .map-canvas__image {
    filter: brightness(0.62) saturate(0.72) contrast(1.08);
}

:root[data-theme="dark"] .map-canvas__image.is-reference-only {
    opacity: 0.42;
    filter: grayscale(0.7) brightness(0.54) contrast(1.08);
}

.map-canvas::after {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgb(255 255 255 / 0.08), transparent 20%);
    content: "";
    pointer-events: none;
}

.map-status {
    position: absolute;
    top: 14px;
    left: 50%;
    z-index: 5;
    max-width: calc(100% - 180px);
    padding: 7px 11px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-translucent);
    color: var(--color-muted);
    font-size: 0.74rem;
    font-weight: 650;
    text-align: center;
    transform: translateX(-50%);
    backdrop-filter: blur(8px);
}

.map-location-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 8;
    display: grid;
    width: min(calc(100% - 40px), 520px);
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 22px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-translucent);
    box-shadow: var(--shadow-panel);
    transform: translate(-50%, -50%);
    backdrop-filter: blur(18px);
}

.map-location-prompt[hidden] {
    display: none;
}

.map-location-prompt__icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.map-location-prompt strong {
    display: block;
    margin: 2px 0 5px;
    font-size: 1.08rem;
}

.map-location-prompt p {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.map-location-prompt__actions {
    display: flex;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 9px;
}

.map-search-area {
    position: absolute;
    top: 62px;
    left: 50%;
    z-index: 7;
    min-height: 42px;
    padding: 0 16px;
    transform: translateX(-50%);
    box-shadow: var(--shadow-control);
}

.map-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    box-shadow: var(--shadow-control);
    z-index: 6;
}

.place-autocomplete {
    min-height: 48px;
}

.place-autocomplete gmp-place-autocomplete {
    width: 100%;
    color-scheme: light;
}

:root[data-theme="dark"] .place-autocomplete gmp-place-autocomplete {
    color-scheme: dark;
}

.place-selection {
    display: block;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface-muted);
    color: var(--color-muted);
    font-size: 0.82rem;
}

.place-selection[hidden] {
    display: none;
}

.map-controls button {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    cursor: pointer;
}

.map-controls button:last-child {
    border-bottom: 0;
}

.map-controls button:hover {
    background: var(--color-surface-muted);
}

.map-pin {
    position: absolute;
    top: var(--y);
    left: var(--x);
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 4px solid white;
    border-radius: 50% 50% 50% 12px;
    color: white;
    cursor: pointer;
    filter: drop-shadow(0 8px 10px rgb(16 33 61 / 0.24));
    transform: translate(-50%, -50%) rotate(-45deg);
    transition: transform 160ms ease, filter 160ms ease;
}

.map-pin span {
    transform: rotate(45deg);
}

.map-pin:hover,
.map-pin.is-selected {
    z-index: 2;
    filter: drop-shadow(0 10px 14px rgb(16 33 61 / 0.3));
    transform: translate(-50%, -50%) rotate(-45deg) scale(1.14);
}

.map-pin.is-selected::after {
    position: absolute;
    inset: -12px;
    z-index: -1;
    border-radius: 50%;
    background: rgb(240 68 68 / 0.18);
    content: "";
}

.map-create-button {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 6;
    display: none !important;
    min-height: 48px;
    align-items: center;
    gap: 8px;
    padding: 0 17px;
    border: 0;
    border-radius: 24px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    box-shadow: var(--shadow-control);
    font-weight: 750;
    cursor: pointer;
}

.event-detail {
    position: relative;
    min-width: 0;
    padding: 62px clamp(22px, 2vw, 30px) 28px;
    overflow-y: auto;
    border-left: 1px solid var(--color-border);
    background: var(--color-surface);
}

.event-detail.is-collapsed {
    display: none;
}

@media (min-width: 901px) {
    .map-region:has(> .event-detail.is-collapsed) {
        grid-template-columns: minmax(0, 1fr);
    }
}

.event-detail__handle {
    display: none;
}

.event-detail__close {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color-muted);
    cursor: pointer;
}

.event-detail__close:hover {
    background: var(--color-surface-muted);
    color: var(--color-ink);
}

.event-detail__category {
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    font-size: 1.35rem;
}

.event-detail h2 {
    margin: 0 0 14px;
    font-size: clamp(1.55rem, 2.1vw, 1.9rem);
    line-height: 1.12;
    font-weight: 680;
    letter-spacing: -0.032em;
}

.event-detail__meta {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 8px 0;
    color: var(--color-muted);
    font-size: 0.91rem;
}

.event-detail__meta--accent {
    color: var(--color-primary-dark);
}

.event-detail__description {
    margin: 22px 0;
    color: var(--color-muted);
    font-size: 0.94rem;
    line-height: 1.65;
}

.event-detail__share-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.event-detail__share-actions .button {
    min-height: 46px;
    padding: 0 12px;
}

.event-detail > .button {
    margin-top: 10px;
}

.event-detail__about {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--color-border);
}

.event-detail__about h3 {
    margin: 0 0 14px;
    font-size: 0.92rem;
}

.event-detail__about p {
    margin: 8px 0;
    color: var(--color-muted);
    font-size: 0.88rem;
}

.vote-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--color-border);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
}

.vote-controls legend {
    grid-column: 1 / -1;
    margin-bottom: 8px;
    padding: 0;
    color: var(--color-ink);
    font-size: 0.92rem;
    font-weight: 750;
}

.vote-controls button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--color-surface-muted);
    color: var(--color-muted);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.vote-controls button:hover {
    border-color: var(--color-border-strong);
    color: var(--color-ink);
}

.vote-controls button[data-vote="up"][aria-pressed="true"] {
    border-color: #27945d;
    background: #ecf9f1;
    color: #11643b;
}

.vote-controls button[data-vote="down"][aria-pressed="true"] {
    border-color: #c2413a;
    background: #fff1f1;
    color: #8e1b13;
}

:root[data-theme="dark"] .vote-controls button[data-vote="up"][aria-pressed="true"] {
    border-color: #55c697;
    background: #17362b;
    color: #a7ebcf;
}

:root[data-theme="dark"] .vote-controls button[data-vote="down"][aria-pressed="true"] {
    border-color: #ff8a82;
    background: #3a2426;
    color: #ffc1bc;
}

.vote-controls button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.vote-controls strong {
    min-width: 1.5em;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.owner-actions {
    margin-top: 22px;
}

.mobile-nav {
    display: none;
}

.site-footer {
    display: flex;
    min-height: 50px;
    align-items: center;
    gap: 28px;
    padding: 0 32px;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-muted);
    font-size: 0.78rem;
}

.site-footer > :last-child {
    margin-left: auto;
}

.site-footer__link {
    min-height: 40px;
    padding: 0;
    color: var(--color-muted);
}

.site-footer__link:hover {
    color: var(--color-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.app-dialog {
    width: min(520px, calc(100vw - 32px));
    max-height: min(760px, calc(100dvh - 32px));
    padding: 0;
    overflow: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    color: var(--color-ink);
    box-shadow: var(--shadow-panel);
}

.app-dialog[open] {
    animation: dialog-in 180ms ease-out;
}

.app-dialog::backdrop {
    background: var(--color-overlay);
    backdrop-filter: blur(3px);
}

.app-dialog--map-interactive[open] {
    animation: map-dialog-fade-in 180ms ease-out;
}

.app-dialog--map-interactive::backdrop {
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.app-dialog--wide {
    width: min(680px, calc(100vw - 32px));
}

.app-dialog--side {
    margin-right: 18px;
}

.app-dialog--map-interactive[data-modeless="true"] {
    position: fixed;
    inset: 16px 18px 16px auto;
    z-index: 30;
    height: max-content;
    margin: auto 0;
}

.map-adjust-button {
    display: none;
}

.dialog-close-form {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    height: 0;
}

.icon-button {
    display: grid;
    width: 44px;
    height: 44px;
    margin: 14px 14px 0 0;
    place-items: center;
    border-radius: 50%;
    background: var(--color-surface-muted);
    color: var(--color-muted);
}

.icon-button:hover {
    color: var(--color-ink);
}

.mobile-list-close {
    display: none;
}

.app-dialog__content {
    padding: 44px clamp(22px, 4vw, 38px) 30px;
}

.app-dialog__content h2 {
    margin: 0;
    padding-right: 42px;
    font-size: clamp(1.65rem, 4vw, 2rem);
    line-height: 1.15;
    letter-spacing: -0.04em;
}

.app-dialog__content > p {
    margin: 10px 0 26px;
    color: var(--color-muted);
}

.app-dialog--side > .button {
    width: calc(100% - 60px);
    margin: 0 30px 30px;
}

.account-avatar {
    display: grid;
    width: 68px;
    height: 68px;
    margin: 24px 0 14px;
    place-items: center;
    border: 5px solid var(--color-surface-muted);
    border-radius: 50%;
    background: var(--color-ink);
    color: var(--color-on-ink);
    font-size: 1.3rem;
    font-weight: 800;
}

.account-details > p {
    margin: 12px 0 0;
    color: var(--color-muted);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 17px;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.field-grid label {
    display: grid;
    gap: 7px;
}

.field label,
.field > .field-label {
    color: var(--color-ink);
    font-size: 0.86rem;
    font-weight: 700;
}

.field label span,
.field small {
    color: var(--color-muted);
    font-weight: 500;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    outline: none;
    background: var(--color-surface);
    color: var(--color-ink);
}

.field .checkbox-field input[type="checkbox"] {
    flex: 0 0 auto;
    width: 20px;
    min-height: 20px;
    padding: 0;
}

.field textarea {
    min-height: 94px;
    resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--color-focus);
    box-shadow: 0 0 0 3px rgb(49 89 217 / 0.15);
}

.field input:user-invalid,
.field textarea:user-invalid {
    border-color: var(--color-danger);
}

.form-message {
    min-height: 24px;
    margin: 14px 0 8px;
    color: var(--color-danger);
    font-size: 0.85rem;
}

.form-note {
    margin: 18px 0 0;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: #fff8e8;
    color: #75530a;
    font-size: 0.85rem;
}

:root[data-theme="dark"] .form-note {
    background: #372f1f;
    color: #f0d393;
}

.text-button {
    min-height: 44px;
    margin-top: 12px;
    color: var(--color-primary-dark);
    font-size: 0.88rem;
    font-weight: 700;
}

.text-button:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.privacy-copy h3 {
    margin: 26px 0 8px;
    font-size: 1rem;
}

.privacy-copy p {
    line-height: 1.7;
}

.privacy-copy__links {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding-inline-start: 1.25rem;
}

.privacy-copy__links a {
    color: var(--color-primary-dark);
    text-underline-offset: 0.2em;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 26px;
}

.toast {
    position: fixed;
    right: 22px;
    bottom: 70px;
    z-index: 100;
    max-width: min(380px, calc(100vw - 32px));
    padding: 13px 17px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-ink);
    color: var(--color-on-ink);
    box-shadow: var(--shadow-panel);
    font-size: 0.88rem;
    font-weight: 650;
}

.toast:not([hidden]) {
    animation: toast-in 180ms ease-out;
}

@keyframes dialog-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }
}

@keyframes map-dialog-fade-in {
    from {
        opacity: 0;
    }
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

@media (min-width: 901px) {
    html,
    body {
        height: 100%;
        overflow: hidden;
    }

    body {
        display: grid;
        min-height: 0;
        grid-template-rows: var(--header-height) minmax(0, 1fr) 50px;
    }

    .app-header {
        min-height: 0;
        height: var(--header-height);
    }

    .app-shell {
        min-height: 0;
        overflow: hidden;
    }

    .discover-panel,
    .map-region,
    .map-canvas,
    .event-detail {
        min-height: 0;
    }

    .discover-panel,
    .map-region {
        overflow: hidden;
    }

    .map-canvas {
        height: 100%;
        min-height: 0;
    }

    .site-footer {
        height: 50px;
        min-height: 0;
    }
}

@media (max-width: 1180px) {
    .app-header {
        grid-template-columns: auto minmax(220px, 1fr) auto;
    }

    .primary-nav {
        display: none;
    }

    .profile-button__label {
        display: none;
    }

    .app-shell {
        grid-template-columns: 310px minmax(0, 1fr);
    }

    .map-region {
        grid-template-columns: minmax(0, 1fr) 300px;
    }
}

@media (max-width: 900px) {
    :root {
        --header-height: 112px;
    }

    body {
        padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
        overflow: hidden;
    }

    .app-header {
        position: sticky;
        top: 0;
        height: var(--header-height);
        min-height: var(--header-height);
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "brand actions"
            "search search";
        grid-template-rows: 42px 42px;
        gap: 6px 12px;
        padding: 8px 12px;
    }

    .brand {
        grid-area: brand;
    }

    .header-actions {
        grid-area: actions;
    }

    .header-actions > .button--ghost,
    .header-actions > .logged-out.button--primary {
        display: none !important;
    }

    .header-actions > .logged-in.button--primary span {
        max-width: 64px;
        overflow: hidden;
        text-overflow: clip;
        white-space: nowrap;
    }

    .header-actions > .logged-in.button--primary span::first-line {
        font-size: 0;
    }

    .header-search {
        grid-area: search;
        width: 100%;
        max-width: none;
        min-height: 42px;
        justify-self: stretch;
    }

    .app-shell {
        display: block;
        min-height: calc(100dvh - var(--header-height) - var(--mobile-nav-height));
    }

    .discover-panel {
        display: none;
    }

    .discover-panel.is-mobile-open {
        position: fixed;
        top: var(--header-height);
        right: 0;
        bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
        left: 0;
        z-index: 26;
        display: flex;
        min-height: 0;
        gap: 12px;
        padding: 14px 14px 10px;
        overflow: hidden;
        border: 0;
        background: var(--color-surface);
        box-shadow: var(--shadow-panel);
    }

    .discover-panel.is-mobile-open .discover-panel__heading {
        min-height: 0;
        flex: 0 0 auto;
        padding-right: 52px;
    }

    .discover-panel h1 {
        max-width: none;
        font-size: clamp(1.28rem, 6vw, 1.55rem);
        line-height: 1.08;
    }

    .discover-panel__heading p {
        margin-top: 5px;
        font-size: 0.78rem;
    }

    .filter-disclosure {
        position: relative;
        z-index: 5;
        display: block;
        min-width: 0;
        flex: 0 0 auto;
    }

    .mobile-filter-toggle {
        display: grid;
        width: 100%;
        min-height: 48px;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 9px;
        padding: 7px 12px;
        border: 1px solid var(--color-border);
        border-radius: 13px;
        background: var(--color-surface-muted);
        color: var(--color-ink);
        text-align: left;
        cursor: pointer;
    }

    .mobile-filter-toggle__label {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 0.8rem;
        font-weight: 650;
    }

    .mobile-filter-toggle__label .icon,
    .mobile-filter-toggle__chevron {
        width: 1rem;
        height: 1rem;
    }

    .mobile-filter-toggle__summary {
        overflow: hidden;
        color: var(--color-muted);
        font-size: 0.72rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-filter-toggle__chevron {
        transition: transform 160ms ease;
    }

    .discover-panel.filters-open .mobile-filter-toggle__chevron {
        transform: rotate(180deg);
    }

    .filter-row {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: 0;
        z-index: 4;
        display: none;
        max-height: min(
            56dvh,
            380px,
            calc(100dvh - var(--header-height) - var(--mobile-nav-height) - 104px)
        );
        flex-wrap: wrap;
        padding: 12px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        border: 1px solid var(--color-border);
        border-radius: 16px;
        background: var(--color-surface);
        box-shadow: var(--shadow-panel);
    }

    .discover-panel.filters-open .filter-row {
        display: flex;
    }

    .discovery-control,
    .radius-control {
        flex: 1 1 100%;
        justify-content: space-between;
    }

    .mobile-filter-actions {
        position: sticky;
        bottom: -12px;
        display: block;
        flex: 1 1 100%;
        margin: 4px -4px -4px;
        padding: 8px 4px 4px;
        background: linear-gradient(transparent, var(--color-surface) 22%);
    }

    .event-list {
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }

    .event-list-more {
        display: none;
    }

    .mobile-list-close {
        position: absolute;
        top: -4px;
        right: 0;
        display: grid;
        place-items: center;
    }

    .map-region {
        position: relative;
        display: block;
        min-height: calc(100dvh - var(--header-height) - var(--mobile-nav-height));
    }

    .map-canvas {
        min-height: calc(100dvh - var(--header-height) - var(--mobile-nav-height));
    }

    .map-canvas__image {
        object-position: 48% center;
    }

    .map-status {
        top: 10px;
        max-width: calc(100% - 130px);
        font-size: 0.67rem;
    }

    .map-location-prompt {
        width: min(calc(100% - 28px), 440px);
        padding: 18px;
    }

    .map-location-prompt__actions .button {
        width: 100%;
    }

    .map-search-area {
        top: 108px;
        max-width: calc(100% - 28px);
        white-space: nowrap;
    }

    .map-list-button {
        position: absolute;
        top: 54px;
        right: 14px;
        z-index: 5;
        display: flex;
        min-height: 46px;
        align-items: center;
        gap: 7px;
        padding: 0 13px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-sm);
        background: var(--color-surface);
        color: var(--color-ink);
        box-shadow: var(--shadow-control);
        font-size: 0.78rem;
        font-weight: 700;
        cursor: pointer;
    }

    .map-controls {
        top: 54px;
        left: 14px;
    }

    body.is-authenticated .map-create-button {
        display: flex !important;
    }

    .event-detail {
        position: fixed;
        right: 0;
        bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
        left: 0;
        z-index: 20;
        max-height: min(
            68dvh,
            calc(100dvh - var(--header-height) - var(--mobile-nav-height) - env(safe-area-inset-bottom)),
            680px
        );
        padding: 30px 24px 24px;
        border: 1px solid var(--color-border);
        border-bottom: 0;
        border-radius: 28px 28px 0 0;
        box-shadow: 0 -14px 36px rgb(16 33 61 / 0.14);
    }

    .event-detail__handle {
        position: absolute;
        top: 10px;
        left: 50%;
        display: block;
        width: 54px;
        height: 5px;
        border-radius: 5px;
        background: var(--color-border-strong);
        transform: translateX(-50%);
    }

    .event-detail__close {
        top: 20px;
        right: 16px;
    }

    .event-detail__category {
        width: 54px;
        height: 54px;
        margin: 18px 0 12px;
    }

    .event-detail h2 {
        max-width: calc(100% - 46px);
        font-size: 1.55rem;
    }

    .event-detail > .button {
        min-height: 48px;
    }

    .mobile-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 40;
        display: flex;
        min-height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
        align-items: flex-start;
        justify-content: space-around;
        padding: 8px 12px env(safe-area-inset-bottom);
        border-top: 1px solid var(--color-border);
        background: var(--color-surface-translucent);
        backdrop-filter: blur(18px) saturate(1.15);
    }

    .mobile-nav__link {
        display: flex;
        min-width: 78px;
        min-height: 52px;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 4px;
        border-radius: 10px;
        color: var(--color-muted);
        font-size: 0.72rem;
        font-weight: 600;
        text-decoration: none;
    }

    .mobile-nav__link .icon {
        width: 1.45rem;
        height: 1.45rem;
    }

    .mobile-nav__link.is-active {
        color: var(--color-primary-dark);
    }

    .site-footer {
        display: none;
    }

    .app-dialog,
    .app-dialog--wide,
    .app-dialog--side {
        width: 100%;
        max-width: none;
        max-height: calc(100dvh - 20px);
        margin: auto 0 0;
        border-radius: 24px 24px 0 0;
    }

    .app-dialog--side > .button {
        margin-bottom: calc(24px + env(safe-area-inset-bottom));
    }

    .map-adjust-button {
        display: flex;
    }

    .toast {
        right: 16px;
        bottom: calc(92px + env(safe-area-inset-bottom));
        left: 16px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding-right: 12px;
        padding-left: 12px;
    }

    .brand span {
        font-size: 1.08rem;
    }

    .brand__mark {
        width: 1.05rem;
        height: 1.05rem;
    }

    .header-actions {
        gap: 5px;
    }

    .theme-toggle {
        width: 42px;
        height: 42px;
    }

    .header-actions .button {
        min-width: 48px;
        padding: 0 12px;
    }

    .header-actions .button span {
        display: none;
    }

    .profile-button {
        padding-right: 4px;
    }

    .map-pin {
        width: 44px;
        height: 44px;
    }

    .event-detail {
        padding-right: 18px;
        padding-left: 18px;
    }

    .event-detail__share-actions,
    .field-grid,
    .custom-date-range {
        grid-template-columns: 1fr;
    }

    .custom-date-range small {
        grid-column: 1;
    }

    .dialog-actions {
        flex-direction: column-reverse;
    }

    .dialog-actions .button {
        width: 100%;
    }
}

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