:root {
    --bg-color: #F3F7FA;
    --text-main: #0B1523;
    --text-muted: #5C728D;
    --primary: #0C66E4;
    --surface: #ffffff;
    --border: #E2ECF5;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --safe-bottom: 70px;
}

html {
    scrollbar-gutter: stable;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "IBM Plex Sans", "Inter", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-color);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

/* Sticky top wrapper (header + search + categories) */
.sticky-top-wrapper {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(243, 247, 250, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 236, 245, 0.9);
}

/* New Header Layout */
.app-header-new {
    padding: 16px 16px 12px;
}

.app-header-new .header-top-row {
    margin-bottom: 0;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.brand-city {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
}

.brand-logo img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.city-selector {
    display: flex;
    flex-direction: column;
}

.city-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.city-name {
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.city-name:hover {
    color: var(--primary);
}

.city-caret {
    display: inline-block;
    transition: transform 0.2s ease, color 0.2s ease;
}

.city-name:hover .city-caret {
    transform: translateY(1px);
    color: var(--primary) !important;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Search toggle button in header */
.search-toggle-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--border, #e2e8f0);
    background: var(--card-bg, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted, #64748b);
    padding: 0;
    flex-shrink: 0;
}

.search-toggle-btn:hover {
    border-color: var(--accent, #6366f1);
    color: var(--accent, #6366f1);
}

.search-toggle-btn.active {
    background: var(--accent, #6366f1);
    border-color: var(--accent, #6366f1);
    color: #fff;
}

.search-toggle-btn svg {
    width: 16px;
    height: 16px;
}

/* AI assistant header button — pill with icon + label */
.search-toggle-btn.assistant-toggle-btn {
    width: auto;
    min-width: 40px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    gap: 6px;
}

.assistant-toggle-btn .assistant-btn-text {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

/* Desktop Inline Search */
div.desktop-search-wrap,
#desktop-search-wrap {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 20px;
    padding: 4px 12px;
    height: 36px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

div.desktop-search-wrap:focus-within,
#desktop-search-wrap:focus-within {
    border-color: var(--accent, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.desktop-search-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted, #94a3b8);
    flex-shrink: 0;
}

input.desktop-search-input,
#desktop-search-input {
    border: 0 !important;
    outline: none !important;
    background: transparent !important;
    background-color: transparent !important;
    font-size: 0.88rem !important;
    font-family: inherit !important;
    color: var(--text-main, #0f172a) !important;
    width: 160px;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.desktop-search-input::placeholder {
    color: var(--text-muted, #94a3b8);
}


/* Search panel */
.search-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    opacity: 0;
    padding: 0 16px;
}

.search-panel.open {
    max-height: 60px;
    opacity: 1;
    margin-top: 8px;
}

.search-panel-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    max-width: 600px;
    margin: 0 auto;
}

.search-panel-icon {
    color: var(--text-muted, #94a3b8);
    flex-shrink: 0;
}

.search-panel-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-main, #1e293b);
    padding: 6px 0;
    min-width: 0;
}

.search-panel-input::placeholder {
    color: var(--text-muted, #94a3b8);
}

.search-clear-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--bg-muted, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted, #64748b);
    padding: 0;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.search-clear-btn:hover {
    background: var(--border, #e2e8f0);
}

/* Search results count badge */
.search-results-count {
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
    white-space: nowrap;
    flex-shrink: 0;
}


.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
}

/* Header Popovers (Profile & Notifications) */
.profile-dropdown,
.notif-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 240px;
    padding: 16px;
    display: none;
    flex-direction: column;
}

.profile-dropdown {
    align-items: stretch;
    gap: 8px;
}

.profile-name-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    text-align: left;
}

.profile-email-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: left;
    word-break: break-all;
}

#profile-logout-btn {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s;
    width: 100%;
    margin-top: 4px;
}

#profile-logout-btn:hover {
    background: #fee2e2;
}

/* Notifications Popover Specifics */
.notif-popover {
    min-width: 300px;
    max-height: 400px;
    overflow-y: auto;
    gap: 10px;
}

.notif-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    font-weight: 700;
    font-size: 0.9rem;
}

.notif-close-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
}

.notif-close-btn:hover {
    color: var(--text-main);
    border-color: var(--primary);
}

.notif-popover-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.notif-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 16px 0;
}

.notif-item {
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.notif-item:hover {
    background: #f1f5f9;
}

.notif-item-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.notif-item-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-backdrop {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: transparent;
}

#notif-popover.notif-popover {
    position: fixed;
    top: 62px;
    right: 12px;
    z-index: 510;
}

.menu-toggle-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 50%;
    background: var(--card-bg, #fff);
    color: var(--text-muted, #64748b);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.menu-toggle-btn:hover,
.menu-toggle-btn[aria-expanded="true"] {
    border-color: var(--accent, #6366f1);
    color: var(--accent, #6366f1);
}

.nav-notif-icon {
    position: relative;
}

.nav-notif-badge {
    top: -7px;
    right: -9px;
}

.main-search {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0 16px;
    height: 48px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    margin-bottom: 16px;
}

.main-search input {
    border: none;
    background: transparent;
    outline: none;
    margin-left: 12px;
    width: 100%;
    font-family: "IBM Plex Sans", "Inter", sans-serif;
    font-size: 1rem;
}

/* Filters Row */
.filters-row {
    display: flex;
    overflow-x: auto;
    gap: 0;
    margin-bottom: 20px;
    scrollbar-width: none;
    padding: 3px;
    width: fit-content;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.filters-row::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    height: 42px;
    padding: 8px 18px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

#date-filters-row {
    display: grid;
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.12fr) minmax(0, 0.8fr) minmax(0, 1.36fr);
    width: calc(100% - 32px);
    max-width: none;
    overflow: hidden;
    padding: 2px;
    margin: 0 auto 8px;
}

#date-filters-row .filter-pill {
    min-width: 0;
    width: 100%;
    height: 38px;
    padding: 6px 5px;
    font-size: 0.72rem;
}

#date-filters-row .filter-pill-location {
    gap: 3px;
    padding-inline: 5px;
}

#date-filters-row .filter-pill-location svg {
    width: 14px;
    height: 14px;
}

#date-filters-row .filter-pill-location .location-filter-caret {
    width: 11px;
    height: 11px;
}

.filter-pill:hover {
    border-color: #0862F0;
    color: #0862F0;
}

.filter-pill.active {
    background: rgba(8, 98, 240, 0.10);
    color: #0862F0;
    font-weight: 600;
    box-shadow: none;
}

.filter-pill-calendar {
    min-width: 58px;
    width: 58px;
    padding: 8px;
    border-left: 1px solid var(--border);
    border-radius: 0 10px 10px 0;
}

.filter-pill-calendar svg {
    width: 20px;
    height: 20px;
}

body.theme-dark .filters-row {
    background: #0F172A;
    border-color: #1E293B;
}

body.theme-dark .filter-pill-calendar {
    border-left-color: #1E293B;
}

.filter-pill-location {
    gap: 6px;
    min-width: max-content;
    border-left: 1px solid var(--border);
    border-radius: 0 10px 10px 0;
}

.filter-pill-location svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}

.filter-pill-location .location-filter-caret {
    width: 14px;
    height: 14px;
}

body.theme-dark .filter-pill-location {
    border-left-color: #1E293B;
}

/* Profile Widget */
.profile-widget {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: url("/static/placeholder.jpg") center/cover;
    border: 2px solid #2563eb;
}

.profile-info {
    flex: 1;
}

.profile-greeting {
    font-weight: 700;
    font-size: 1rem;
}

.profile-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.progress-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    width: 100%;
}

.progress-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 2px;
    width: 33%;
}

.profile-arrow {
    color: var(--text-muted);
    font-size: 1.5rem;
}

/* Explore Categories */
.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #061223;
    line-height: 1.15em;
    margin-bottom: 16px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.cat-card {
    height: 80px;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.cat-card-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.cat-card-img-placeholder {
    font-size: 2rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.modal-content {
    background: var(--surface);
    color: var(--text-main);
    border-radius: 24px 24px 0 0;
    padding: 24px;
    min-height: 50vh;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.modal-header h3 {
    margin-bottom: 16px;
    font-size: 1.1rem;
}

/* Authentication */
.auth-modal {
    align-items: flex-start;
    justify-content: flex-start;
    padding: env(safe-area-inset-top) 0 0;
    overflow-y: auto;
    background: rgba(11, 21, 35, 0.58);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.auth-panel {
    width: 100%;
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
    overflow-y: visible;
    border: 1px solid var(--border);
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: 0 12px 32px rgba(11, 21, 35, 0.18);
}

.auth-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.auth-panel-eyebrow {
    margin-bottom: 2px;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.auth-panel h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.35rem;
    line-height: 1.25;
}

.auth-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-color);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.auth-close-button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    margin-bottom: 22px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-color);
}

.auth-tab {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.auth-tab.active {
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(11, 21, 35, 0.14);
    color: var(--text-main);
}

.auth-status {
    margin: -6px 0 18px;
    padding: 11px 12px;
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    color: var(--text-main);
    font-size: 0.82rem;
    line-height: 1.4;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.auth-field label {
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 700;
}

.auth-field input {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    background: var(--surface);
    color: var(--text-main);
    font: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field input::placeholder {
    color: var(--text-muted);
    opacity: 0.72;
}

.auth-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.auth-submit-button {
    width: 100%;
    min-height: 46px;
    margin-top: 5px;
    padding: 0 16px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.auth-submit-button:hover {
    filter: brightness(0.94);
}

.auth-submit-button:active {
    transform: translateY(1px);
}

.auth-link-button {
    align-self: center;
    padding: 3px 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-link-button:hover {
    filter: brightness(0.82);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 16px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.auth-divider::before,
.auth-divider::after {
    height: 1px;
    flex: 1;
    background: var(--border);
    content: "";
}

.auth-google-button {
    display: flex;
    width: 100%;
    min-height: 40px;
    justify-content: center;
    overflow: hidden;
}

.auth-google-button>div,
.auth-google-button iframe {
    max-width: 100% !important;
}

.auth-tab:focus-visible,
.auth-close-button:focus-visible,
.auth-submit-button:focus-visible,
.auth-link-button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent);
    outline-offset: 2px;
}

@media (min-width: 601px) {
    .auth-modal {
        align-items: center;
        justify-content: center;
        padding: 20px;
    }

    .auth-panel {
        width: min(100%, 420px);
        max-height: min(720px, calc(100vh - 40px));
        padding: 28px;
        border: 1px solid var(--border);
        border-radius: 16px;
        box-shadow: 0 24px 64px rgba(11, 21, 35, 0.24);
    }

    /* Switch from mobile icon button to desktop inline search bar */
    button.search-toggle-btn,
    #search-toggle-btn,
    .search-panel {
        display: none !important;
    }

    /* The AI assistant chat button keeps the .search-toggle-btn class for
       styling but must stay visible on desktop alongside the inline search. */
    button#assistant-toggle-btn {
        display: flex !important;
    }

    div.desktop-search-wrap,
    #desktop-search-wrap {
        display: flex !important;
    }
}

.modal-search {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border-radius: var(--radius-full);
    padding: 0 16px;
    height: 44px;
    margin-bottom: 16px;
}

.modal-search input {
    border: none;
    background: transparent;
    outline: none;
    margin-left: 8px;
    width: 100%;
}

.modal-location {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 24px;
    cursor: pointer;
}

.modal-list-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.modal-city-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.city-pin {
    font-size: 1.2rem;
}

.city-item-name {
    font-weight: 500;
}

.city-item-region {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.modal-close {
    margin-top: 24px;
    width: 100%;
    padding: 12px;
    background: #f1f5f9;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
}

/* Explore Section (Sticky categories container) */
.explore-section {
    padding: 14px 16px 16px 16px;
    position: relative;
}

/* Categories */
.categories-scroll {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 0;
    scrollbar-width: none;
    /* Firefox */
}

.categories-scroll::-webkit-scrollbar {
    display: none;
    /* Chrome */
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 70px;
    cursor: pointer;
}

.cat-icon-container {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.category-item.active .cat-icon-container {
    border: 2px solid var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.cat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.category-item.active .cat-label {
    color: var(--primary);
    font-weight: 600;
}

/* Main Feed */
.feed-container {
    padding: 16px;
    padding-bottom: calc(var(--safe-bottom) + 20px);
}

.loading-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

#events-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 650px;
    margin: 0 auto;
    width: 100%;
}

.event-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    overflow: visible;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.event-card:active {
    transform: translateY(-1px) scale(0.995);
}

/* Ad card styles */
.ad-card {
    position: relative;
    border: 1px solid #e0d4f5;
    background: linear-gradient(135deg, #faf8ff 0%, #f0ebff 100%);
}

.ad-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.12);
}

.ad-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    background: rgba(99, 102, 241, 0.9);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    z-index: 2;
    letter-spacing: 0.05em;
}

.ad-welcome-banner {
    position: relative;
    border: 1px solid #e0d4f5;
    background: linear-gradient(135deg, #faf8ff 0%, #f0ebff 100%);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}


/* PWA Install Card on Feed */
.pwa-install-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(11, 21, 35, 0.03);
}

.pwa-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 4px;
}

.pwa-card-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.pwa-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.pwa-card-text {
    flex: 1;
}

.pwa-card-text h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.pwa-card-text p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.pwa-install-btn {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background 0.2s;
}

.pwa-install-btn:hover {
    filter: brightness(0.95);
}

/* Header styling */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.event-date-time {
    color: var(--text-main);
    font-weight: 700;
}

.meta-dot {
    color: #cbd5e1;
}

.event-location-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.loc-icon {
    font-size: 0.85rem;
}

.event-price {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.event-price.price-free {
    color: #10b981;
    background: #E6F9F2;
    font-weight: 800;
}

.event-price.price-paid {
    color: #0C66E4;
    background: #E6F4FF;
    font-weight: 800;
}

/* Body styling */
.card-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
}

.card-content-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3em;
    color: var(--text-main);
    margin: 0;
    padding: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tags row */
.event-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.card-tag-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 5px;
}

.card-tag-badge.category-badge {
    background-color: #eef2ff;
    color: #4f46e5;
}

.card-tag-badge.subcategory-badge {
    background-color: #f5f3ff;
    color: #7c3aed;
}

/* Image styling */
.card-image-wrapper {
    width: 140px;
    height: 140px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    position: relative;
}

.event-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-image-wrapper .event-parent-cycle {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 9px;
    font-weight: 700;
    color: rgba(24, 72, 94, 0.9);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1em;
    text-transform: uppercase;
    z-index: 5;
}

/* Footer & Actions */
.card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
}

.card-footer button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-footer button:hover {
    background-color: rgba(11, 21, 35, 0.04);
    color: #0B1523;
}

.card-footer button.favorite-btn,
.card-footer button.share-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
}



/* Анимация мягкой пульсации для шеринга (оранжевый акцент) */
@keyframes share-glow-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 8px rgba(249, 115, 22, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
    }
}

/* Применение анимации к кнопке шеринга — оранжевый акцент без заливки */
.card-footer button.share-btn {
    background-color: transparent;
    color: #F97316;
    animation: share-glow-pulse 3s infinite ease-in-out;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.card-footer button.share-btn .share-icon {
    stroke: #F97316;
}

/* При наведении останавливаем бесконечную пульсацию для комфортного клика */
.card-footer button.share-btn:hover {
    background-color: rgba(249, 115, 22, 0.08);
    animation-play-state: paused;
    transform: scale(1.1) !important;
}

.card-footer button.going-btn {
    padding: 7px 15px;
    /* 1px less padding to offset the 1px border */
    border-radius: var(--radius-full);
    border: 1px solid rgba(11, 21, 35, 0.15);
    background-color: transparent;
    color: #0B1523;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
    /* Прижимает кнопку "Я пойду" и последующие кнопки к правому краю */
}

.card-footer button.going-btn .action-icon {
    stroke: currentColor;
}

.card-footer button.going-btn:hover {
    background-color: rgba(11, 21, 35, 0.05);
}

.card-footer button .action-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    transition: transform 0.2s ease, fill 0.2s ease, stroke 0.2s ease;
}

/* Actions Active / Active states */
.favorite-btn.active {
    color: #eab308;
    /* Yellow/Gold */
    background-color: #fef9c3;
    /* Light yellow background */
}

.favorite-btn.active .star-icon {
    fill: #eab308;
    stroke: #eab308;
}

.going-btn.active {
    background-color: #E6F4FF;
    color: #0C66E4;
}

.going-btn.active:hover {
    background-color: #CCE8FF;
}

.going-btn.active .calendar-icon {
    fill: #0C66E4;
    stroke: #0C66E4;
}

.share-btn:active .share-icon {
    transform: scale(0.9);
}



.going-btn-details {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #d9e3ef;
    background: #fff;
    color: #536A86;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: "IBM Plex Sans", "Inter", sans-serif;
}

.going-btn-details.active {
    background: #f5a400;
    color: #fff;
    border-color: #f5a400;
}

.star-icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: transparent;
    transition: transform 0.2s ease, fill 0.2s ease, stroke 0.2s ease;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    height: var(--safe-bottom);
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    cursor: pointer;
}

.nav-item.active {
    color: var(--primary);
}

.nav-icon {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.nav-label {
    font-size: 0.65rem;
    font-weight: 500;
}

/* Event Details Screen */
/* Event Details Screen (Overlay & Bottom Drawer) */
.details-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 150;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.details-drawer {
    width: 100%;
    max-width: 600px;
    height: 100vh;
    max-height: 100vh;
    background: #ffffff;
    border-radius: 0;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(100%);
    }
}

.drawer-swipe-indicator {
    width: 40px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin: 12px auto 6px;
    flex-shrink: 0;
}

.drawer-close-row {
    padding: 0 20px 8px;
    display: flex;
    flex-shrink: 0;
}

.drawer-close-btn {
    width: 36px;
    height: 36px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    cursor: pointer;
    transition: transform 0.1s ease, background-color 0.2s;
}

.drawer-close-btn:active {
    transform: scale(0.9);
    background: #e2e8f0;
}

.drawer-close-btn svg {
    width: 20px;
    height: 20px;
}

.drawer-content {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 20px 100px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
    opacity: 1;
}

.drawer-image-wrapper {
    width: 100%;
    height: 220px;
    background: #f1f5f9;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #f1f5f9;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.drawer-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.drawer-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
}

.drawer-meta-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.drawer-date-time {
    color: #0f172a;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.drawer-location-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.drawer-address {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 2px;
}

.details-source-link {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 4px;
    text-decoration: underline;
}

.price-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.price-badge.free {
    background: #ecfdf5;
    color: #047857;
}

.price-badge.paid {
    background: #fffbeb;
    color: #b45309;
}

.drawer-actions-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    margin-top: 4px;
}

/* Favorite and Share buttons in the details drawer */
.drawer-actions-row button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease, transform 0.1s ease;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
}

.drawer-actions-row button:hover {
    background-color: rgba(15, 23, 42, 0.05);
    color: #0f172a;
}

.drawer-actions-row button:active {
    transform: scale(0.9);
}

.drawer-actions-row button .action-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    transition: transform 0.2s ease, fill 0.2s ease, stroke 0.2s ease;
}

.drawer-actions-row button.favorite-btn.active {
    color: #eab308;
    background-color: #fef9c3;
}

.drawer-actions-row button.favorite-btn.active .star-icon {
    fill: #eab308;
    stroke: #eab308;
}

/* Новые стили для акцентных кнопок в шторке деталей согласно макету */
.drawer-actions-row button.details-share-btn-accent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 160px;
    height: 40px;
    background-color: #F97316;
    /* Bright Orange */
    color: #FFFFFF;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    transition: background-color 0.2s ease, transform 0.1s ease;
    border: none;
}

.drawer-actions-row button.details-share-btn-accent:hover {
    background-color: #ea580c;
    color: #FFFFFF;
}

.drawer-actions-row button.details-share-btn-accent:active {
    transform: scale(0.97);
}

.drawer-actions-row button.details-share-btn-accent .share-icon {
    width: 15px;
    height: 15px;
    stroke: #FFFFFF;
    fill: none;
}

.drawer-actions-row button.details-fav-btn-accent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 40px;
    background-color: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    color: #4B5563;
    transition: all 0.2s ease, transform 0.1s ease;
}

.drawer-actions-row button.details-fav-btn-accent:hover {
    background-color: #E5E7EB;
    color: #1f2937;
}

.drawer-actions-row button.details-fav-btn-accent:active {
    transform: scale(0.95);
}

.drawer-actions-row button.details-fav-btn-accent .star-icon {
    width: 20px;
    height: 20px;
    stroke: #4B5563;
    fill: none;
}

/* Активное состояние кнопки Избранное */
.drawer-actions-row button.details-fav-btn-accent.active {
    background-color: #FEF3C7;
    /* Light Amber */
    border-color: #FCD34D;
    color: #D97706;
}

.drawer-actions-row button.details-fav-btn-accent.active .star-icon {
    fill: #F59E0B;
    stroke: #D97706;
}

.drawer-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    margin-bottom: 14px;
}

.details-parent-cycle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
    color: var(--primary);
    padding: 6px 12px;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
    border: 1px dashed #bfdbfe;
}

.drawer-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

/* Style category / tag badges in the drawer */
.details-drawer .tag-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4f46e5;
    background: #f5f3ff;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-block;
}

.drawer-description-text {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #475569;
    font-weight: 400;
    white-space: pre-wrap;
}

.drawer-description-text p {
    margin-bottom: 12px;
}

.drawer-description-text b {
    color: #0f172a;
}

.drawer-description-text a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 500;
}

.drawer-bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    z-index: 10;
}

.main-going-btn {
    width: 100%;
    background: #0f172a;
    color: #ffffff;
    border: none;
    padding: 14px 0;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    transition: transform 0.1s ease, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-going-btn:hover {
    background: #1e293b;
}

.main-going-btn:active {
    transform: scale(0.98);
}

.main-going-btn.active {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    box-shadow: none;
}

.main-going-btn.active:hover {
    background: #f1f5f9;
}

.info-block {
    margin-bottom: 16px;
}

.info-block-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.info-block-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
}

.info-block-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Category Icon Buttons (круглые иконки с подписью) ── */
.category-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.category-pill:active {
    transform: scale(0.93);
}

.cat-pill-icon {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #F4F5F7;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.cat-pill-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    transition: color 0.2s ease, font-weight 0.15s ease;
}

/* Hover */
.category-pill:hover .cat-pill-icon {
    background: #E9EAEC;
}

/* Галочка на выбранной категории (справа сверху) */
.cat-pill-icon::after {
    content: "✓";
    position: absolute;
    top: -3px;
    right: -3px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #0862F0;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
    z-index: 2;
}

.category-pill.active .cat-pill-icon::after {
    opacity: 1;
    transform: scale(1);
}

/* Active — All */
.category-pill.active.cat-pill-all .cat-pill-icon {
    border-color: #0862F0;
    background: #EEF3FF;
    box-shadow: 0 0 0 3px rgba(8, 98, 240, 0.12);
}

.category-pill.active.cat-pill-all .cat-pill-label {
    color: #0862F0;
    font-weight: 700;
}

/* Active — Fiesta */
.category-pill.active.cat-pill-fiesta .cat-pill-icon {
    border-color: #c2410c;
    background: #ffe4d6;
    box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.12);
}

.category-pill.active.cat-pill-fiesta .cat-pill-label {
    color: #c2410c;
    font-weight: 700;
}

/* Active — Sport */
.category-pill.active.cat-pill-sport .cat-pill-icon {
    border-color: #0369a1;
    background: #bae6fd;
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.12);
}

.category-pill.active.cat-pill-sport .cat-pill-label {
    color: #0369a1;
    font-weight: 700;
}

/* Active — Nature */
.category-pill.active.cat-pill-nature .cat-pill-icon {
    border-color: #047857;
    background: #c3e7d9;
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.12);
}

.category-pill.active.cat-pill-nature .cat-pill-label {
    color: #047857;
    font-weight: 700;
}

/* Active — Culture */
.category-pill.active.cat-pill-culture .cat-pill-icon {
    border-color: #4338ca;
    background: #c7cdff;
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.12);
}

.category-pill.active.cat-pill-culture .cat-pill-label {
    color: #4338ca;
    font-weight: 700;
}

/* Active — Education */
.category-pill.active.cat-pill-education .cat-pill-icon {
    border-color: #0e7490;
    background: #c5f6fa;
    box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.12);
}

.category-pill.active.cat-pill-education .cat-pill-label {
    color: #0e7490;
    font-weight: 700;
}

/* Active — Kids */
.category-pill.active.cat-pill-kids .cat-pill-icon {
    border-color: #b45309;
    background: #ffe9a6;
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.12);
}

.category-pill.active.cat-pill-kids .cat-pill-label {
    color: #b45309;
    font-weight: 700;
}

/* Active — Gastro */
.category-pill.active.cat-pill-gastro .cat-pill-icon {
    border-color: #be123c;
    background: #fecdd3;
    box-shadow: 0 0 0 3px rgba(190, 18, 60, 0.12);
}

.category-pill.active.cat-pill-gastro .cat-pill-label {
    color: #be123c;
    font-weight: 700;
}

/* Active — Market */
.category-pill.active.cat-pill-market .cat-pill-icon {
    border-color: #a16207;
    background: #fde68a;
    box-shadow: 0 0 0 3px rgba(161, 98, 7, 0.12);
}

.category-pill.active.cat-pill-market .cat-pill-label {
    color: #a16207;
    font-weight: 700;
}

/* Active — Nightlife */
.category-pill.active.cat-pill-nightlife .cat-pill-icon {
    border-color: #a21caf;
    background: #f5d0fe;
    box-shadow: 0 0 0 3px rgba(162, 28, 175, 0.12);
}

.category-pill.active.cat-pill-nightlife .cat-pill-label {
    color: #a21caf;
    font-weight: 700;
}

/* Active — Community */
.category-pill.active.cat-pill-community .cat-pill-icon {
    border-color: #15803d;
    background: #dcfce7;
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.12);
}

.category-pill.active.cat-pill-community .cat-pill-label {
    color: #15803d;
    font-weight: 700;
}

/* Fallback */
.category-pill.active.cat-pill-other .cat-pill-icon {
    border-color: #334155;
    background: #cbd5e1;
    box-shadow: 0 0 0 3px rgba(51, 65, 85, 0.12);
}

.category-pill.active.cat-pill-other .cat-pill-label {
    color: #334155;
    font-weight: 700;
}

/* Group date header inside the feed */
.feed-date-group-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    /* Slate 500 */
    letter-spacing: 0.05em;
    margin-top: 24px;
    margin-bottom: 8px;
    padding-left: 4px;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Reduce margin-top for the first header in the list */
#events-list>.feed-date-group-header:first-child {
    margin-top: 8px;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.02);
    text-align: left;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #f1f5f9;
    color: var(--primary);
}

/* Custom styling for range input */
#radius-range-input {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: var(--radius-full);
    background: #e2e8f0;
    outline: none;
    margin: 8px 0;
}

#radius-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
    transition: transform 0.1s ease;
}

#radius-range-input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* ========== Profile Screen ========== */

/* FAB Profile Button */
.profile-fab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.profile-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.profile-fab:active {
    transform: scale(0.95);
}

.profile-screen-content {
    padding: 20px 16px;
    padding-bottom: 100px;
    overflow-y: auto;
    flex-grow: 1;
}

.profile-user-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.profile-avatar-large {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-user-info {
    flex: 1;
    min-width: 0;
}

.profile-user-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-user-email {
    font-size: 0.85rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-section {
    margin-bottom: 24px;
}

.profile-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-left: 4px;
}

.profile-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.profile-setting-info {
    flex: 1;
    min-width: 0;
}

.profile-setting-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.profile-setting-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    border-radius: 28px;
    transition: background 0.25s ease;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

/* Select dropdown */
.profile-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-color);
    font-family: "IBM Plex Sans", "Inter", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
    min-width: 90px;
}

.profile-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Buttons */
.profile-login-btn,
.profile-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-family: "IBM Plex Sans", "Inter", sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.1s ease;
    border: none;
}

.profile-login-btn {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.profile-login-btn:hover {
    background: #1d4ed8;
}

.profile-login-btn:active,
.profile-logout-btn:active {
    transform: scale(0.98);
}

.profile-logout-btn {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.profile-logout-btn:hover {
    background: #fee2e2;
}

.profile-gcal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-family: "IBM Plex Sans", "Inter", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-main);
    margin-top: 10px;
    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.profile-gcal-btn:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.profile-gcal-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #16a34a;
}

.gcal-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}

.nav-item.active .nav-icon {
    color: #0862F0;
}

.lang-select {
    font-size: 13px;
    font-weight: 600;
    color: #7D96AF;
    cursor: pointer;
    font-family: "IBM Plex Sans", "Inter", sans-serif;
    border: 1px solid #0f172a14;
    background: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 4px 10px #0f172a08;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237D96AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 24px;
    transition: border-color 0.2s ease;
}

.lang-select:hover {
    border-color: #7D96AF40;
}

.notif-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid #0f172a14;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px #0f172a14;
    position: relative;
}

/* Floating GPS button on map */
#use-location-btn {
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 40px;
    height: 40px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

#use-location-btn:hover {
    background-color: #f8fafc;
}

#use-location-btn:active {
    background-color: #e2e8f0;
    transform: scale(0.95);
}

/* Region selection option card */
.region-option-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.region-option-card:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.region-option-card:active {
    transform: scale(0.98);
}

.region-option-card.active {
    background: #eff6ff;
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.region-option-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
}

.region-option-card .checkmark-icon {
    display: none;
    width: 18px;
    height: 18px;
    stroke: #0f172a;
}

.region-option-card.active .checkmark-icon {
    display: block;
    stroke: var(--primary);
}

/* Macroregions layout */
.macroregions-header {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.05em;
    margin-top: 8px;
    margin-bottom: -4px;
    text-transform: uppercase;
}

.macroregions-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
}

.macroregion-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    border-radius: 23px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    box-sizing: border-box;
}

.macroregion-pill:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.macroregion-pill:active {
    transform: scale(0.96);
}

#macro-pill-south.active {
    background: #fff7ed;
    border-color: #f97316;
    color: #ea580c;
    box-shadow: 0 0 0 1px #f97316;
}

#macro-pill-north.active {
    background: #f0fdf4;
    border-color: #10b981;
    color: #16a34a;
    box-shadow: 0 0 0 1px #10b981;
}

#macro-pill-capital.active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #2563eb;
    box-shadow: 0 0 0 1px #3b82f6;
}

/* Seasonal Toggle Switch Styles */

.seasonal-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    text-transform: none !important;
    font-weight: 500;
    font-size: 0.8rem;
    color: #64748b;
}

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
}

input:checked+.slider {
    background-color: #173b2f;
}

input:checked+.slider:before {
    transform: translateX(16px);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Кнопки навигации в подробном просмотре */
.details-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 160;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.details-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 8px 32px 0 rgba(255, 255, 255, 0.1), 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.details-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.details-nav-btn.prev {
    left: calc(50% - 300px - 80px);
}

.details-nav-btn.next {
    right: calc(50% - 300px - 80px);
}

@media (max-width: 800px) {
    .details-nav-btn {
        top: 180px;
        /* Смещаем вверх на уровень картинки афиши */
        width: 44px;
        height: 44px;
        background: rgba(15, 23, 42, 0.45);
        border: 1px solid rgba(255, 255, 255, 0.15);
        color: #ffffff;
    }

    .details-nav-btn.prev {
        left: 12px;
    }

    .details-nav-btn.next {
        right: 12px;
    }
}

.drawer-content.slide-out-left {
    transform: translateX(-100px);
    opacity: 0;
}

.drawer-content.slide-out-right {
    transform: translateX(100px);
    opacity: 0;
}

.drawer-content.slide-in-left {
    transition: none !important;
    transform: translateX(-100px);
    opacity: 0;
}

.drawer-content.slide-in-right {
    transition: none !important;
    transform: translateX(100px);
    opacity: 0;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 90px;
    /* Above the bottom navigation bar */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: 90%;
    max-width: 350px;
}

.toast-message {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.08);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.toast-message.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-message.hide {
    opacity: 0;
    transform: translateY(-20px);
}

/* Share Popover Menu */
.share-popover {
    position: absolute;
    z-index: 10005;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    width: 160px;
    opacity: 0;
    transform: scale(0.95) translateY(5px);
    transition: opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.share-popover.show {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.share-popover-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #1e293b;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
    width: 100%;
    box-sizing: border-box;
}

.share-popover-item:hover {
    background-color: rgba(241, 245, 249, 0.9);
    color: #0f172a;
}

.share-popover-icon {
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
}

/* Welcome Banner Styles */
.welcome-banner {
    background: linear-gradient(135deg, #F97316 0%, #F59E0B 100%);
    border-radius: 0;
    padding: 24px 16px;
    margin: -16px -16px 16px -16px;
    position: relative;
    box-shadow: 0 10px 25px rgba(249, 115, 22, 0.15);
    color: #ffffff;
    overflow: hidden;
}

.welcome-banner-content {
    position: relative;
    z-index: 1;
}

.welcome-banner-close {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    font-size: 20px;
    font-weight: 300;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.welcome-banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.welcome-banner-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.025em;
}

.welcome-banner-subtitle {
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.45;
    opacity: 0.95;
    margin-bottom: 16px;
    max-width: calc(100% - 40px);
}

.welcome-banner-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.welcome-banner-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Calendar View Container */
.calendar-view {
    background: #ffffff;
    border-radius: 0;
    padding: 16px;
    margin: 0 -16px;
    /* Растягиваем на всю ширину от категорий до краев */
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
    min-height: calc(100vh - 200px);
}

.calendar-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 4px;
}

.calendar-month-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

#calendar-month-year {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    user-select: none;
}

.cal-nav-btn {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s;
}

.cal-nav-btn:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.calendar-close-btn {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s;
}

.calendar-close-btn:hover {
    background: #fca5a5;
    color: #b91c1c;
}

/* Weekdays */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Grid and Days */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-day {
    min-height: 85px;
    background: #f8fafc;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 6px 2px 4px 2px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    position: relative;
    border: 1px solid #e2e8f0;
    /* Легкая рамка */
}

.calendar-day:hover {
    background: #f1f5f9;
}

.calendar-day:active {
    transform: scale(0.95);
}

.calendar-day-num {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.calendar-day.today {
    border-color: var(--primary);
    background: #eff6ff;
}

.calendar-day.today .calendar-day-num {
    color: var(--primary);
    font-weight: 800;
}

.calendar-day.selected {
    background: var(--primary) !important;
    border-color: var(--primary);
}

.calendar-day.selected .calendar-day-num {
    color: #ffffff !important;
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
    pointer-events: none;
    border: 1px solid transparent;
    /* Убираем рамку у пустых ячеек */
}

/* Badges Row */
.cal-badges-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    margin-top: auto;
    width: 100%;
}

.cal-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    min-width: 16px;
    height: 14px;
    color: #ffffff;
}

.cal-badge svg {
    width: 9px;
    height: 9px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Badge types */
.cal-badge.badge-total {
    background: #64748b;
    /* Серый */
}

.cal-badge.badge-interested {
    background: #f5a400;
    /* Желтый */
}

.cal-badge.badge-going {
    background: #10b981;
    /* Зеленый */
}

/* Adaptability for selected day */
.calendar-day.selected .cal-badge {
    background: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
}

/* Floating Return to Today Button in Feed */
.scroll-today-btn {
    position: fixed;
    bottom: 80px;
    /* Парирует над нижним меню */
    right: 20px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: opacity 0.25s ease, transform 0.2s ease, background 0.2s;
    opacity: 0;
    pointer-events: none;
}

.scroll-today-btn:active {
    transform: scale(0.9);
}

.scroll-today-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-today-btn svg {
    width: 20px;
    height: 20px;
}

/* ── Темный режим (Dark Mode) ── */
body.theme-dark {
    --bg-color: #020617;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --primary: #38BDF8;
    --surface: #0F172A;
    --border: #1E293B;
}

body.theme-dark .sticky-top-wrapper {
    background: rgba(15, 23, 42, 0.85);
    border-bottom-color: #1E293B;
}

/* Настройки модальных окон и карточек */
body.theme-dark .modal-content {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
}

body.theme-dark .modal-header h3 {
    color: var(--text-main);
}

body.theme-dark .modal-search {
    background: #1E293B;
    border: 1px solid #334155;
}

body.theme-dark .modal-search input {
    color: var(--text-main);
}

body.theme-dark .city-card {
    background: #1E293B;
    border-color: #334155;
}

body.theme-dark .city-card.active {
    border-color: var(--primary);
    background: rgba(56, 189, 248, 0.08);
}

body.theme-dark .macroregion-pill {
    background: #1E293B;
    border-color: #334155;
    color: var(--text-muted);
}

body.theme-dark .macroregion-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #020617;
}

/* Настройки шторки */
body.theme-dark .details-drawer {
    background: var(--surface);
    color: #ffffff;
}

body.theme-dark .drawer-title {
    color: #ffffff !important;
}

body.theme-dark .drawer-description-text,
body.theme-dark .drawer-description-text p,
body.theme-dark .drawer-description-text span,
body.theme-dark .drawer-description-text div,
body.theme-dark .drawer-description-text li {
    color: #ffffff !important;
}

body.theme-dark .drawer-description-text b,
body.theme-dark .drawer-description-text strong {
    color: #ffffff !important;
}

body.theme-dark .drawer-description-text a {
    color: #38bdf8 !important;
}

body.theme-dark #details-performers-row,
body.theme-dark #details-performers,
body.theme-dark #details-parent-cycle-row,
body.theme-dark .ad-card .event-meta,
body.theme-dark .ad-welcome-banner p {
    color: #ffffff !important;
}

body.theme-dark .drawer-bottom-bar {
    background: #0f172a !important;
    border-top-color: #1e293b !important;
}

body.theme-dark .drawer-bottom-bar .main-going-btn {
    background: #ffffff !important;
    color: #0f172a !important;
}

body.theme-dark .drawer-swipe-indicator {
    background: #334155;
}

body.theme-dark .drawer-close-btn {
    background: #1E293B;
    color: #F8FAFC;
}

body.theme-dark .drawer-close-btn:active {
    background: #334155;
}

body.theme-dark .details-fav-btn-accent {
    background-color: #1E293B;
    border-color: #334155;
    color: #94A3B8;
}

body.theme-dark .details-fav-btn-accent:hover {
    background-color: #334155;
    color: #F8FAFC;
}

body.theme-dark .calendar-view {
    background: #0F172A;
    border-color: #1E293B;
}
body.theme-dark .calendar-view-header,
body.theme-dark .calendar-month-nav {
    background: transparent;
}
body.theme-dark #calendar-month-year {
    color: #F8FAFC;
    font-weight: 700;
}
body.theme-dark .cal-nav-btn {
    background: #1E293B;
    color: #CBD5E1;
    border: 1px solid #334155;
}
body.theme-dark .cal-nav-btn:hover {
    background: #334155;
    color: #F8FAFC;
}
body.theme-dark .calendar-close-btn {
    background: #1E293B;
    color: #CBD5E1;
    border: 1px solid #334155;
}
body.theme-dark .calendar-close-btn:hover {
    background: #7F1D1D;
    color: #FECACA;
}
body.theme-dark .calendar-day.empty {
    background: transparent;
    border-color: transparent;
}
body.theme-dark .calendar-weekdays {
    color: #94A3B8;
}

/* Календарь */
body.theme-dark .calendar-day {
    background: #1E293B;
    border-color: #334155;
}

body.theme-dark .calendar-day:hover {
    background: #334155;
}

body.theme-dark .calendar-day.today {
    border-color: var(--primary);
    background: rgba(56, 189, 248, 0.08);
}

body.theme-dark .calendar-day.today .calendar-day-num {
    color: var(--primary);
}

/* Теги в темном режиме */
body.theme-dark .card-tag-badge.category-badge {
    background-color: #1E1B4B;
    color: #818CF8;
}

body.theme-dark .card-tag-badge.subcategory-badge {
    background-color: #2E1065;
    color: #A78BFA;
}

/* Оранжевые бейджи Fiestas и теги */
body.theme-dark .event-card.cat-style-fiesta .card-tag-badge {
    background-color: #3D1D11;
    color: #FF8A58;
}

/* Профиль/Личный Кабинет в темном режиме */
body.theme-dark #profile-screen {
    background: var(--bg-color) !important;
}

body.theme-dark #profile-user-card,
body.theme-dark #profile-settings>div,
body.theme-dark #profile-app-settings>div,
body.theme-dark #profile-calendar>div {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

/* Селектор языка в хедере */
body.theme-dark .lang-select {
    background: #1E293B !important;
    color: #F8FAFC !important;
    border-color: #334155 !important;
}

/* Кнопка поиска в хедере */
body.theme-dark .search-toggle-btn {
    background: #1E293B;
    border-color: #334155;
    color: #94A3B8;
}

body.theme-dark .search-toggle-btn.active {
    background: var(--accent, #6366f1);
    border-color: var(--accent, #6366f1);
    color: #fff;
}

/* Панель поиска */
body.theme-dark .search-panel-input {
    color: #F8FAFC;
}

body.theme-dark .search-clear-btn {
    background: #334155;
    color: #94A3B8;
}

body.theme-dark .desktop-search-wrap {
    background: #1E293B !important;
    border-color: #334155 !important;
}

body.theme-dark .desktop-search-input {
    color: #F8FAFC !important;
}

/* Кнопка Уведомлений в хедере */
body.theme-dark .notif-btn {
    background: #1E293B !important;
    border-color: #334155 !important;
}

/* Кнопка "Я пойду" / "Иду" в карточке */
body.theme-dark .card-footer button.going-btn {
    background-color: transparent;
    color: #F8FAFC;
    border-color: rgba(248, 250, 252, 0.2) !important;
}

body.theme-dark .card-footer button.going-btn .action-icon {
    stroke: currentColor;
}

body.theme-dark .card-footer button.going-btn:hover {
    background-color: rgba(248, 250, 252, 0.08);
}

body.theme-dark .going-btn.active {
    background-color: #075985;
    color: #38BDF8;
}

body.theme-dark .going-btn.active .calendar-icon {
    fill: #38BDF8;
    stroke: #38BDF8;
}

body.theme-dark .going-btn.active:hover {
    background-color: #0c4a6e;
}

/* FREE/бесплатно бейджи */
body.theme-dark .event-price.price-free {
    color: #34D399;
    background: #064E3B;
}

body.theme-dark .event-price.price-paid {
    color: #38BDF8;
    background: #0C4A6E;
}

/* Кнопка Позвать друзей в шторке деталей */
body.theme-dark .details-share-btn-accent {
    background-color: #F97316 !important;
    color: #FFFFFF !important;
}

body.theme-dark .details-share-btn-accent:hover {
    background-color: #ea580c !important;
}

/* Плавающая кнопка возврата в темном режиме */
body.theme-dark .scroll-today-btn {
    background: rgba(15, 23, 42, 0.85);
    border-color: #1E293B;
    color: var(--primary);
}

/* Липкий контейнер категорий в темном режиме */
body.theme-dark .explore-section {
    background: rgba(15, 23, 42, 0.95) !important;
    border-bottom: 1px solid #1E293B !important;
}

/* Неактивные кружки категорий в темном режиме */
body.theme-dark .cat-pill-icon {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

/* Активные иконки и тексты категорий в темном режиме */
body.theme-dark .category-pill.active.cat-pill-all .cat-pill-icon {
    border-color: #38BDF8 !important;
    background: #1E293B !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15) !important;
}

body.theme-dark .category-pill.active.cat-pill-all .cat-pill-label {
    color: #38BDF8 !important;
    font-weight: 700 !important;
}

body.theme-dark .category-pill.active.cat-pill-fiesta .cat-pill-icon {
    border-color: #F97316 !important;
    background: #3D1D11 !important;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15) !important;
}

body.theme-dark .category-pill.active.cat-pill-fiesta .cat-pill-label {
    color: #FF8A58 !important;
    font-weight: 700 !important;
}

body.theme-dark .category-pill.active.cat-pill-sport .cat-pill-icon {
    border-color: #38BDF8 !important;
    background: #0F2D4A !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15) !important;
}

body.theme-dark .category-pill.active.cat-pill-sport .cat-pill-label {
    color: #38BDF8 !important;
    font-weight: 700 !important;
}

body.theme-dark .category-pill.active.cat-pill-nature .cat-pill-icon {
    border-color: #34D399 !important;
    background: #063124 !important;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15) !important;
}

body.theme-dark .category-pill.active.cat-pill-nature .cat-pill-label {
    color: #34D399 !important;
    font-weight: 700 !important;
}

body.theme-dark .category-pill.active.cat-pill-culture .cat-pill-icon {
    border-color: #A78BFA !important;
    background: #23154C !important;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15) !important;
}

body.theme-dark .category-pill.active.cat-pill-culture .cat-pill-label {
    color: #A78BFA !important;
    font-weight: 700 !important;
}

body.theme-dark .category-pill.active.cat-pill-education .cat-pill-icon {
    border-color: #22D3EE !important;
    background: #0E3D44 !important;
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15) !important;
}

body.theme-dark .category-pill.active.cat-pill-education .cat-pill-label {
    color: #22D3EE !important;
    font-weight: 700 !important;
}

body.theme-dark .category-pill.active.cat-pill-kids .cat-pill-icon {
    border-color: #FBBF24 !important;
    background: #3D2E0B !important;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15) !important;
}

body.theme-dark .category-pill.active.cat-pill-kids .cat-pill-label {
    color: #FBBF24 !important;
    font-weight: 700 !important;
}

body.theme-dark .category-pill.active.cat-pill-gastro .cat-pill-icon {
    border-color: #F43F5E !important;
    background: #4C0519 !important;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15) !important;
}

body.theme-dark .category-pill.active.cat-pill-gastro .cat-pill-label {
    color: #F43F5E !important;
    font-weight: 700 !important;
}

body.theme-dark .category-pill.active.cat-pill-market .cat-pill-icon {
    border-color: #F59E0B !important;
    background: #3B2C0E !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15) !important;
}

body.theme-dark .category-pill.active.cat-pill-market .cat-pill-label {
    color: #F59E0B !important;
    font-weight: 700 !important;
}

body.theme-dark .category-pill.active.cat-pill-nightlife .cat-pill-icon {
    border-color: #E879F9 !important;
    background: #3B0764 !important;
    box-shadow: 0 0 0 3px rgba(232, 121, 249, 0.15) !important;
}

body.theme-dark .category-pill.active.cat-pill-nightlife .cat-pill-label {
    color: #E879F9 !important;
    font-weight: 700 !important;
}

body.theme-dark .category-pill.active.cat-pill-community .cat-pill-icon {
    border-color: #34D399 !important;
    background: #064E3B !important;
    box-shadow: 0 0 0 3px rgba(52, 211, 253, 0.15) !important;
}

body.theme-dark .category-pill.active.cat-pill-community .cat-pill-label {
    color: #34D399 !important;
    font-weight: 700 !important;
}

body.theme-dark .category-pill.active.cat-pill-other .cat-pill-icon {
    border-color: #94A3B8 !important;
    background: #1E293B !important;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15) !important;
}

body.theme-dark .category-pill.active.cat-pill-other .cat-pill-label {
    color: #94A3B8 !important;
    font-weight: 700 !important;
}

/* PC Desktop Layout & Adaptive Styles (>=1024px) */
/* ========================================== */
@media (min-width: 1024px) {

    /* === GLOBAL RESETS === */
    body {
        padding-bottom: 0 !important;
    }

    .app-container {
        padding-bottom: 0 !important;
        background: var(--bg-color) !important;
        overflow-x: hidden !important;
        /* Prevent horizontal bleed */
    }

    /* Disable sticky wrapper on desktop — children use fixed positioning */
    .sticky-top-wrapper {
        position: static !important;
        background: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border-bottom: none !important;
    }

    /* === STATIC HEADER (Fixed at top center, max-width 1200px) === */
    .app-header-new {
        position: fixed !important;
        top: 0 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 100% !important;
        max-width: 1200px !important;
        height: 68px !important;
        z-index: 110 !important;
        background: var(--surface) !important;
        border-bottom: 1px solid var(--border) !important;
        box-sizing: border-box !important;
    }

    /* Desktop Inline Search Bar width tuning */
    .desktop-search-wrap {
        width: 220px !important;
    }

    .desktop-search-wrap:focus-within {
        width: 280px !important;
    }

    /* === TOP NAVIGATION (Fixed right below header, max-width 1200px) === */
    .bottom-nav {
        position: fixed !important;
        top: 68px !important;
        bottom: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 100% !important;
        max-width: 1200px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 40px !important;
        padding: 0 20px !important;
        background: var(--surface) !important;
        border-top: none !important;
        border-bottom: 1px solid var(--border) !important;
        box-shadow: 0 2px 8px rgba(11, 21, 35, 0.03) !important;
        height: 60px !important;
        /* Крупнее! Было 48px */
        z-index: 105 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
    }

    .bottom-nav .nav-item {
        flex: none !important;
        flex-direction: row !important;
        gap: 0 !important;
        padding: 14px 24px !important;
        /* Больше паддинги */
        border-radius: 0 !important;
        color: var(--text-muted) !important;
        font-size: 1.35rem !important;
        /* Ещё крупнее! Было 1.15rem */
        font-weight: 600 !important;
        cursor: pointer !important;
        border-bottom: 3px solid transparent !important;
        background: transparent !important;
        transition: color 0.2s, border-color 0.2s !important;
    }

    .bottom-nav .nav-item .nav-icon {
        display: none !important;
    }

    .bottom-nav .nav-label {
        font-size: 1.35rem !important;
        font-weight: 600 !important;
    }

    .bottom-nav .nav-item.active {
        color: var(--primary) !important;
        border-bottom-color: var(--primary) !important;
        font-weight: 700 !important;
        background: transparent !important;
    }

    .bottom-nav .nav-item:hover {
        color: var(--primary) !important;
    }

    /* === CATEGORIES BAR (Fixed below navigation) === */
    .explore-section {
            display: block !important;
            position: fixed !important;
            top: 140px !important;
            /* 12px air below 68px header + 60px nav */
            left: 50% !important;
            transform: translateX(-50%) !important;
            width: 100% !important;
            max-width: 1200px !important;
            z-index: 99 !important;
            background: var(--surface) !important;
            border-bottom: none !important;
            padding: 8px 24px !important;
            margin: 0 !important;
            box-sizing: border-box !important;
        }

        /* === EVENT COLLECTION BAR (Fixed directly below categories) === */
        #date-filters-row {
            position: fixed !important;
            top: 252px !important;
            /* 68 header + 60 nav + 12 air + ~99 categories (incl. padding) + 13 air */
            left: 50% !important;
            transform: translateX(-50%) !important;
        width: min(100% - 48px, 620px) !important;
        max-width: none !important;
        height: 46px !important;
        z-index: 100 !important;
        background: var(--surface) !important;
        padding: 2px !important;
        margin: 0 !important;
        border: 1px solid var(--border) !important;
        border-radius: 14px !important;
        box-sizing: border-box !important;
    }

    .explore-section::after {
        display: none !important;
    }

    /* === UNIFIED OPAL HEADER BACKGROUND (Prevents card bleed through gaps) === */
    .feed-container::before {
        content: "" !important;
        position: fixed !important;
        top: 0 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 100% !important;
        max-width: 1200px !important;
        height: 308px !important;
                /* 68 header + 60 nav + 12 air + 99 categories + 13 air + 46 filters */
        background: var(--surface) !important;
        z-index: 94 !important;
        /* Right below categories, above scrolling feed cards */
        pointer-events: none !important;
        box-sizing: border-box !important;
        border-bottom: 1px solid var(--border) !important;
        box-shadow: 0 4px 12px rgba(11, 21, 35, 0.03) !important;
    }

    /* === TAB-SPECIFIC POSITIONING & MARGINS === */
    /* 1. Feed / Home (collection controls are visible) */
    .feed-container.tab-home {
        margin-top: 308px !important;
                /* Header(68) + nav(60) + 12 air + categories(99) + 13 air + filters(46) + 10 air */
        padding: 0 32px 40px !important;
    }

    /* 2. Calendar Tab (date filters are hidden) */
    .feed-container.tab-calendar::before {
        height: 128px !important;
    }

    .feed-container.tab-calendar {
        margin-top: 128px !important;
        /* 68px header + 60px navigation */
        padding: 0 32px 40px !important;
    }

    /* Поддержка темного режима для всех фиксированных панелей */
    body.theme-dark .sticky-top-wrapper,
    body.theme-dark .app-header-new,
    body.theme-dark .bottom-nav,
    body.theme-dark .filters-row,
    body.theme-dark .explore-section,
    body.theme-dark .feed-container::before {
        background: #0F172A !important;
        border-color: #1E293B !important;
    }

    .categories-scroll {
        justify-content: center !important;
        gap: 16px !important;
        padding: 4px 0 !important;
        overflow: visible !important;
    }

    .category-pill {
        flex-shrink: 0 !important;
        width: auto !important;
        min-width: 68px !important;
        max-width: 88px !important;
    }

    .cat-pill-icon {
        flex-shrink: 0 !important;
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        min-height: 52px !important;
        border-radius: 50% !important;
        aspect-ratio: 1 / 1 !important;
    }

    .cat-pill-label {
        font-size: 0.7rem !important;
        white-space: nowrap !important;
    }

    /* === DATE GROUP HEADERS (e.g. "TODAY, JULY 12") === */
    .feed-date-group-header {
        grid-column: 1 / -1 !important;
        margin-top: 28px !important;
        margin-bottom: 12px !important;
        padding: 0 4px !important;
    }

    /* === 3-COLUMN EVENT GRID === */
    #events-list {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px !important;
        align-items: stretch !important;
        /* Карточки в одной строке растягиваются по высоте */
        padding: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }

    /* Prevent card content from overflowing grid columns */
    .event-card {
        overflow: hidden !important;
        min-width: 0 !important;
        /* Allow flex/grid shrink */
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        height: 100% !important;
    }

    /* Booking-style card desktop full-width image overrides */
    .event-card.b-card {
        flex-direction: column !important;
        min-height: 0 !important;
    }

    .event-card.b-card .b-card-image-wrap {
        flex: 0 0 auto !important;
        width: 100% !important;
        height: 200px !important;
        min-height: 0 !important;
    }

    .event-card.b-card .b-card-info {
        padding: 14px 16px !important;
        flex: 1 1 auto !important;
    }

    .card-body {
        flex-grow: 1 !important;
        display: flex !important;
        justify-content: space-between !important;
        gap: 16px !important;
    }

    .card-content-left {
        flex-grow: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }

    .event-tags-row {
        margin-top: auto !important;
        /* Прижимает теги к низу контентной области */
    }

    .event-title {
        font-size: 0.95rem !important;
        margin-bottom: 12px !important;
    }

    .card-image-wrapper {
        width: 120px !important;
        height: 120px !important;
    }

    /* === PWA INSTALL CARD === */
    .pwa-install-card {
        grid-column: 1 / -1 !important;
        justify-self: center !important;
        width: auto !important;
        max-width: 560px !important;
        margin: 16px auto !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        gap: 14px !important;
        padding: 20px 24px !important;
        box-sizing: border-box !important;
    }

    .pwa-card-content {
        flex: none !important;
        justify-content: center !important;
    }

    .pwa-card-text h4,
    .pwa-card-text p {
        text-align: center !important;
    }

    .pwa-install-btn {
        width: auto !important;
        min-width: 180px !important;
        padding: 10px 28px !important;
        margin-top: 0 !important;
    }

    /* === WELCOME BANNER === */
    .welcome-banner {
        grid-column: 1 / -1 !important;
        width: calc(100% + 64px) !important;
        max-width: none !important;
        margin: 0 -32px 24px -32px !important;
        border-radius: 0 !important;
        padding: 24px 32px !important;
        box-sizing: border-box !important;
    }

    .welcome-banner-title {
        font-size: 1.5rem !important;
        margin-bottom: 10px !important;
    }

    .welcome-banner-subtitle {
        font-size: 0.95rem !important;
        max-width: 900px !important;
        margin-bottom: 18px !important;
    }

    .welcome-banner-tag {
        font-size: 0.85rem !important;
        padding: 8px 16px !important;
    }

    /* === FULL-WIDTH GRID CHILDREN === */
    .feed-empty-header {
        grid-column: 1 / -1 !important;
    }

    .loading-state {
        grid-column: 1 / -1 !important;
    }

    /* === CALENDAR VIEW === */
    .calendar-view {
        max-width: 700px !important;
        margin: 24px auto !important;
        border: 1px solid var(--border) !important;
        border-radius: var(--radius-lg) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
        min-height: auto !important;
        background: var(--surface) !important;
    }

    body.theme-dark .calendar-view {
        background: #0F172A !important;
        border-color: #1E293B !important;
    }

    .calendar-close-btn {
        display: none !important;
    }

    /* === PROFILE SCREEN === */
    #profile-screen {
        max-width: 600px !important;
        height: 80% !important;
        top: 10% !important;
        border-radius: 20px !important;
        border: 1px solid var(--border) !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12) !important;
    }

    #profile-screen header {
        border-radius: 20px 20px 0 0 !important;
    }

    /* === SCROLL-TO-TOP BUTTON === */
    .scroll-today-btn {
        right: 40px !important;
        bottom: 40px !important;
    }
}

/* Optimization for mobile phones (max-width: 410px) to prevent button overflow */
@media (max-width: 410px) {
    .feed-container {
        padding: 12px 10px;
    }

    .event-card {
        padding: 12px;
    }

    .card-footer {
        gap: 6px;
    }

    .card-footer button.favorite-btn,
    .card-footer button.share-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .card-footer button.going-btn {
        padding: 6px 12px;
        gap: 6px;
        font-size: 12px;
    }

    .card-footer button.going-btn .action-icon {
        width: 14px;
        height: 14px;
    }

    .event-price {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}

@media (max-width: 360px) {
    .card-footer button.going-btn {
        padding: 0;
        width: 32px;
        height: 32px;
        min-width: 32px;
        border-radius: 50%;
        justify-content: center;
        gap: 0;
    }

    .card-footer button.going-btn .going-btn-text {
        display: none;
    }
}

/* Navigation drawer and feedback modal */
.side-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.side-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 510;
    width: min(320px, 85vw);
    height: 100dvh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    color: var(--text-main);
    box-shadow: -8px 0 24px rgba(15, 23, 42, 0.16);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    pointer-events: none;
}

.side-drawer.is-open {
    transform: translateX(0);
    pointer-events: auto;
}

.side-drawer-header {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 14px;
    box-sizing: border-box;
}

.side-drawer-close,
.feedback-modal-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

.side-drawer-user,
.side-drawer-item {
    width: 100%;
    min-height: 58px;
    padding: 12px 20px;
    box-sizing: border-box;
    border: 0;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    text-align: left;
}

.side-drawer-user,
.side-drawer-item {
    display: flex;
    align-items: center;
    gap: 13px;
}

.side-drawer-user,
.side-drawer-item:not(.side-drawer-theme-item) {
    cursor: pointer;
}

.side-drawer-user:hover,
.side-drawer-item:not(.side-drawer-theme-item):hover {
    background: var(--bg-muted, #f1f5f9);
}

.drawer-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 1.05rem;
}

.drawer-user-details {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.drawer-user-name {
    overflow: hidden;
    font-size: 0.95rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-user-email {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-drawer-item {
    min-height: 54px;
    font-size: 0.93rem;
    font-weight: 600;
}

.side-drawer-item-icon {
    width: 22px;
    flex-shrink: 0;
    text-align: center;
    font-size: 1.05rem;
}

.side-drawer-theme-item {
    cursor: default;
}

.side-drawer-theme-toggle {
    margin-left: auto;
}

.side-drawer-divider {
    height: 1px;
    background: var(--border);
}

.side-drawer-footer {
    margin-top: auto;
    padding: 18px 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.side-drawer-footer a {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: none;
}

.side-drawer-footer a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.feedback-modal {
    position: fixed;
    inset: 0;
    z-index: 520;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.feedback-modal-panel {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
}

.feedback-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.feedback-modal-header h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.1rem;
}

#feedback-message,
#feedback-contact {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text-main);
    font: inherit;
    font-size: 0.9rem;
}

#feedback-message {
    resize: vertical;
    min-height: 120px;
    padding: 11px 12px;
}

#feedback-contact {
    margin-top: 10px;
    padding: 11px 12px;
}

#feedback-message:focus,
#feedback-contact:focus {
    outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent);
    border-color: var(--primary);
}

.feedback-status {
    min-height: 18px;
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.feedback-status.is-error {
    color: #dc2626;
}

.feedback-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.feedback-cancel-btn,
.feedback-send-btn {
    padding: 9px 14px;
    border-radius: 6px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.feedback-cancel-btn {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
}

.feedback-send-btn {
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
}

body.theme-dark .menu-toggle-btn {
    background: #1E293B;
    border-color: #334155;
}

body.theme-dark .side-drawer,
body.theme-dark .feedback-modal-panel,
body.theme-dark #notif-popover.notif-popover {
    background: #0F172A;
    border-color: #1E293B;
}

body.theme-dark .side-drawer-user:hover,
body.theme-dark .side-drawer-item:not(.side-drawer-theme-item):hover,
body.theme-dark .notif-item:hover {
    background: #1E293B;
}

body.theme-dark .notif-item {
    background: #1E293B;
    border-color: #334155;
}

@media (min-width: 1024px) {
    .side-drawer {
        width: min(380px, 30vw);
        box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
    }

    #notif-popover.notif-popover {
        top: 76px;
        right: max(24px, calc((100vw - 1200px) / 2 + 24px));
    }
}

/* =========================================================================
   Booking-Style Event Cards (Merged from index.css)
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Card shell — switch from vertical column to horizontal Booking row
   ------------------------------------------------------------------------- */
.event-card.b-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius-lg, 16px);
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.2s ease;
    cursor: pointer;
    min-height: 132px;
}

.event-card.b-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
    border-color: #cbd5e1;
}

.event-card.b-card:active {
    transform: translateY(-1px) scale(0.997);
}

/* Category is signalled by a compact top stripe; cards remain neutral white. */
.event-card.b-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    z-index: 2;
    height: 4px;
    background: #64748b;
    pointer-events: none;
}

.event-card.b-card.cat-style-fiesta::before { background: #f97316; }
.event-card.b-card.cat-style-sport::before { background: #0284c7; }
.event-card.b-card.cat-style-nature::before { background: #059669; }
.event-card.b-card.cat-style-culture::before { background: #4f46e5; }
.event-card.b-card.cat-style-education::before { background: #0891b2; }
.event-card.b-card.cat-style-kids::before { background: #d97706; }
.event-card.b-card.cat-style-gastro::before { background: #e11d48; }
.event-card.b-card.cat-style-market::before { background: #ca8a04; }
.event-card.b-card.cat-style-nightlife::before { background: #c026d3; }
.event-card.b-card.cat-style-community::before { background: #16a34a; }

/* -------------------------------------------------------------------------
   2. Left image wrap
   ------------------------------------------------------------------------- */
.b-card-image-wrap {
    flex: 0 0 132px;
    width: 132px;
    min-height: 132px;
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
}

.b-card-image-wrap .event-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.event-card.b-card:hover .event-image {
    transform: scale(1.04);
}

.b-card-image-wrap .event-parent-cycle {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(24, 72, 94, 0.95);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1em;
    text-transform: uppercase;
    z-index: 5;
    max-width: calc(100% - 12px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -------------------------------------------------------------------------
   3. Right info column
   ------------------------------------------------------------------------- */
.b-card-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    justify-content: flex-start;
}

/* 1. Title */
.b-card-info .event-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25em;
    color: var(--text-main, #0B1523);
    margin: 0;
    padding: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -------------------------------------------------------------------------
   4. Community activity — compact counters in the former rating position
   ------------------------------------------------------------------------- */
.b-card-activity {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    background: #fbbf24;
    color: #1f2937;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    line-height: 1.2em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.b-card-activity-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-variant-numeric: tabular-nums;
}

.b-card-activity-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   5. Date & time row
   ------------------------------------------------------------------------- */
.b-card-datetime,
.b-card-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    line-height: 1.3em;
    color: #475569;
    min-width: 0;
}

.b-card-info .event-date-time {
    color: #0f172a;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------------------
   6. Location row
   ------------------------------------------------------------------------- */
.b-card-location .event-location {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #475569;
}

.b-card-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #94a3b8;
}

/* -------------------------------------------------------------------------
   7. Tags — max 2
   ------------------------------------------------------------------------- */
.b-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.b-card-tags .card-tag-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
    line-height: 1.4em;
}

.b-card-tags .card-tag-badge.category-badge {
    background-color: #eef2ff;
    color: #4f46e5;
}

.b-card-tags .card-tag-badge.subcategory-badge {
    background-color: #f5f3ff;
    color: #7c3aed;
}

.b-card-tags .card-tag-badge:nth-child(n + 3) {
    display: none;
}

/* -------------------------------------------------------------------------
   8. Footer — price on the left, actions on the right
   ------------------------------------------------------------------------- */
.b-card-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    margin-top: auto;
    padding-top: 7px;
    border-top: 1px dashed #e2e8f0;
}

.b-card-footer .event-price {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    line-height: 1.3em;
    justify-self: start;
}

.b-card-footer .event-price.price-free {
    background-color: #ecfdf5;
    color: #059669;
}

.b-card-footer .event-price.price-paid {
    background-color: #eff6ff;
    color: #0C66E4;
}

.b-card-actions {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.b-card-actions .going-btn {
    margin-left: 0;
}

.b-card-actions button.going-btn,
.b-card-actions button.favorite-btn,
.b-card-actions button.share-btn {
    display: inline-flex;
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    height: 32px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: none;
    background: none;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 6px 8px;
    line-height: 1.2em;
    white-space: nowrap;
}

.b-card-actions button.going-btn {
    border: 1px solid rgba(11, 21, 35, 0.15);
    color: #0B1523;
    background-color: transparent;
}

.b-card-actions .going-btn:hover {
    background-color: rgba(11, 21, 35, 0.05);
}

.b-card-actions .going-btn.active {
    background-color: #E6F4FF;
    border-color: #bae6fd;
    color: #0C66E4;
    text-decoration: none;
}

.b-card-actions .going-btn.active .going-btn-text::before {
    content: "✓ ";
}

.b-card-actions .going-btn .going-btn-text {
    display: inline;
}

.b-card-fav-btn .b-card-fav-label {
    display: none;
}

.b-card-actions .going-btn .action-icon {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    flex-shrink: 0;
}

.b-card-actions .b-card-fav-btn {
    color: #64748b;
    background-color: #f1f5f9;
    min-width: 0;
}

.b-card-actions .b-card-fav-btn:hover {
    background-color: #e2e8f0;
    color: #0B1523;
}

.b-card-actions .b-card-fav-btn .action-icon {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    flex-shrink: 0;
}

.b-card-actions .b-card-fav-btn .b-card-fav-label {
    font-weight: 600;
}

.b-card-actions .b-card-fav-btn.active {
    background-color: #fef3c7;
    color: #b45309;
}

.b-card-actions .b-card-fav-btn.active .action-icon {
    fill: #f59e0b;
    stroke: #f59e0b;
}

.b-card-actions button.share-btn {
    padding: 0;
    border-radius: 999px;
    color: #F97316;
    background-color: #fff7ed;
    animation: none;
}

.b-card-actions .share-btn:hover {
    background-color: #ffedd5;
    transform: scale(1.08);
}

.b-card-actions .share-btn .action-icon {
    width: 14px;
    height: 14px;
    stroke: #F97316;
}

.b-card-actions .share-btn:active .share-icon {
    transform: scale(0.9);
}

.explore-section::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 56px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--surface, #fff) 66%);
}

.categories-scroll.scroll-hint {
    animation: category-scroll-hint 700ms ease-in-out 180ms 1;
}

@keyframes category-scroll-hint {
    0%, 100% { transform: translateX(0); }
    45% { transform: translateX(-28px); }
}

/* -------------------------------------------------------------------------
   9. Responsive — stack image on top on very narrow screens
   ------------------------------------------------------------------------- */
@media (max-width: 380px) {
    .event-card.b-card {
        flex-direction: column;
        min-height: 0;
    }

    .b-card-image-wrap {
        flex: 0 0 auto;
        width: 100%;
        min-height: 0;
        height: 150px;
    }

    .b-card-info {
        padding: 12px;
    }

    .b-card-actions {
        flex-wrap: nowrap;
    }
}

@media (max-width: 360px) {
    .b-card-actions .going-btn {
        padding: 6px 8px;
    }

    .b-card-actions .going-btn .going-btn-text {
        display: inline;
    }
}

/* -------------------------------------------------------------------------
   10. Dark theme overrides
   ------------------------------------------------------------------------- */
body.theme-dark .event-card.b-card {
    background-color: #0f172a;
    border-color: #1e293b;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

body.theme-dark .event-card.b-card:hover {
    border-color: #334155;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

body.theme-dark .b-card-image-wrap {
    background: #1e293b;
}

body.theme-dark .b-card-info .event-title {
    color: #ffffff;
}

body.theme-dark .b-card-datetime,
body.theme-dark .b-card-location {
    color: #ffffff;
}

body.theme-dark .b-card-info .event-date-time,
body.theme-dark .b-card-info .event-location {
    color: #ffffff;
}

body.theme-dark .b-card-icon,
body.theme-dark .b-card-activity-icon {
    color: #cbd5e1;
}

body.theme-dark .b-card-activity,
body.theme-dark .b-card-going-count,
body.theme-dark .b-card-favorite-count {
    color: #ffffff;
}

body.theme-dark .b-card-footer {
    border-top-color: #1e293b;
}

body.theme-dark .b-card-tags .card-tag-badge.category-badge {
    background-color: #1E1B4B;
    color: #c7d2fe;
}

body.theme-dark .b-card-tags .card-tag-badge.subcategory-badge {
    background-color: #2E1065;
    color: #ddd6fe;
}

body.theme-dark .b-card-footer .event-price.price-free {
    background-color: #052e2b;
    color: #34D399;
}

body.theme-dark .b-card-footer .event-price.price-paid {
    background-color: #0c1e3a;
    color: #38BDF8;
}

body.theme-dark .b-card-actions .going-btn {
    color: #e2e8f0;
    border-color: rgba(226, 232, 240, 0.2);
}

body.theme-dark .b-card-actions .going-btn:hover {
    background-color: rgba(226, 232, 240, 0.08);
}

body.theme-dark .b-card-actions .going-btn.active {
    background-color: #075985;
    border-color: #0c4a6e;
    color: #38BDF8;
}

body.theme-dark .b-card-actions .b-card-fav-btn {
    background-color: #1e293b;
    color: #94a3b8;
}

body.theme-dark .b-card-actions .b-card-fav-btn:hover {
    background-color: #334155;
    color: #e2e8f0;
}

body.theme-dark .b-card-actions .b-card-fav-btn.active {
    background-color: #422006;
    color: #fbbf24;
}

body.theme-dark .b-card-actions .share-btn {
    background-color: #2a1608;
    color: #fb923c;
    animation: none;
}

body.theme-dark .b-card-actions .share-btn:hover {
    background-color: #431502;
}

body.theme-dark .b-card-actions .share-btn .action-icon {
    stroke: #fb923c;
}

body.theme-dark .b-card-activity {
    background: #f59e0b;
    color: #1f2937;
}
/* ═══════════════ AI ASSISTANT CHAT ═══════════════ */
.assistant-icon {
    display: block;
}

.assistant-chat {
    position: fixed;
    right: 16px;
    bottom: 84px;
    width: min(380px, calc(100vw - 32px));
    height: min(50vh, calc(100vh - 140px));
    display: flex;
    flex-direction: column;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    z-index: 1200;
    overflow: hidden;
    transition: height 0.2s ease;
}

.assistant-chat[hidden] {
    display: none;
}

.assistant-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--accent, #6366f1), #8b5cf6);
    color: #fff;
    flex-shrink: 0;
}

.assistant-chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
}

.assistant-chat-close {
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s;
}

.assistant-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.assistant-chat-clear {
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s;
    margin-right: 2px;
}

.assistant-chat-clear:hover {
    background: rgba(255, 255, 255, 0.2);
}

.assistant-chat-header-buttons {
    display: flex;
    align-items: center;
    gap: 2px;
}

.assistant-chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 120px;
    overscroll-behavior: contain;
}

.assistant-msg {
    max-width: 88%;
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-wrap;
}

.assistant-msg-bot {
    align-self: flex-start;
    background: var(--bg-secondary, #f1f5f9);
    color: var(--text, #0f172a);
    border-bottom-left-radius: 4px;
}

.assistant-msg-user {
    align-self: flex-end;
    background: var(--accent, #6366f1);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.assistant-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 14px 10px;
    flex-shrink: 0;
}

.assistant-suggestion {
    border: 1px solid var(--border, #e2e8f0);
    background: var(--card-bg, #fff);
    color: var(--text-muted, #64748b);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.assistant-suggestion:hover {
    border-color: var(--accent, #6366f1);
    color: var(--accent, #6366f1);
}

.assistant-chat-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--border, #e2e8f0);
    flex-shrink: 0;
}

.assistant-chat-input {
    flex: 1 1 auto;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 14px;
    padding: 9px 14px;
    font-size: 13.5px;
    font-family: inherit;
    line-height: 1.4;
    background: var(--card-bg, #fff);
    color: var(--text, #0f172a);
    outline: none;
    resize: none;
    min-height: 64px;
    max-height: 132px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.assistant-chat-input:focus {
    border-color: var(--accent, #6366f1);
}

.assistant-chat-input:disabled {
    opacity: 0.6;
}

.assistant-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 0;
    background: var(--accent, #6366f1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.assistant-chat-send:hover {
    filter: brightness(1.1);
}

.assistant-chat-send:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Dark theme */
body.theme-dark .assistant-chat {
    background: #1e293b;
    border-color: #334155;
}

body.theme-dark .assistant-msg-bot {
    background: #334155;
    color: #f1f5f9;
}

body.theme-dark .assistant-chat-input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

body.theme-dark .assistant-suggestion {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

@media (max-width: 480px) {
    .assistant-chat {
        right: 10px;
        bottom: 76px;
        width: calc(100vw - 20px);
        height: min(50vh, calc(100vh - 120px));
    }
}

/* Drag handle: allow the header to receive pointer drags on touch devices */
.assistant-chat-header {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* "Thinking" indicator: three bouncing dots */
.assistant-thinking {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 2px;
}

.assistant-thinking .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted, #64748b);
    animation: assistant-dot-bounce 1.2s infinite ease-in-out;
}

.assistant-thinking .dot:nth-child(2) {
    animation-delay: 0.15s;
}

.assistant-thinking .dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes assistant-dot-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* Formatted answer content: bullet lists, bold, code */
.assistant-msg-content {
    word-break: break-word;
    white-space: normal;
}

.assistant-msg-content ul {
    margin: 4px 0 4px 4px;
    padding-left: 16px;
    list-style: disc;
}

.assistant-msg-content li {
    margin: 3px 0;
}

.assistant-msg-content li + li {
    margin-top: 6px;
}

.assistant-msg-content strong {
    font-weight: 600;
}

.assistant-msg-content code {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body.theme-dark .assistant-msg-content code {
    background: rgba(255, 255, 255, 0.12);
}

body.theme-dark .assistant-thinking .dot {
    background: #94a3b8;
}

/* Clickable event links inside assistant replies */
.assistant-msg-content .assistant-event-link {
    color: var(--accent, #6366f1);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    font-weight: 500;
}

.assistant-msg-content .assistant-event-link:active {
    opacity: 0.7;
}

/* Highlighted feed card after clicking an assistant event link */
.assistant-event-highlight {
    animation: assistant-card-pulse 2.2s ease;
    border-radius: 14px;
}

@keyframes assistant-card-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.45);
    }
    40% {
        box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.35);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}
