:root {
    --bg: #f2f2f0;
    --card-bg: #fcfcfb;
    --line: #ddd8d2;
    --text: #2f2d2a;
    --muted: #6f6a64;
    --accent: #c47a57;
    --accent-dark: #ab6749;
    --shadow: 0 10px 30px rgba(40, 34, 30, 0.07);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at 5% 0, #faf7f3 0%, var(--bg) 42%);
    color: var(--text);
    font-family: "Avenir Next", "Nunito Sans", "Segoe UI", sans-serif;
}

.topbar {
    height: 88px;
    padding: 16px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: #f8f7f6;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 22px;
    color: #fff;
    background: linear-gradient(135deg, #c8756a, #ce9a73);
    box-shadow: 0 8px 18px rgba(103, 77, 57, 0.2);
}

.brand-title {
    font-weight: 800;
    font-size: 36px;
    line-height: 1;
}

.brand-subtitle {
    margin-top: 2px;
    color: var(--muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-link {
    text-decoration: none;
    color: #5a524c;
    border: 1px solid #d1c9c1;
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 700;
    background: #fff;
}

.host-button {
    border: 0;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    padding: 12px 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, #c37d5f, #cb8d66);
    box-shadow: 0 8px 20px rgba(106, 75, 56, 0.25);
}

.mobile-filter-wrap {
    display: none;
}

.mobile-filter-button {
    border: 1px solid #d1c9c1;
    border-radius: 999px;
    background: #fff;
    color: #5a524c;
    font-weight: 700;
    padding: 10px 16px;
    cursor: pointer;
}

.layout {
    padding: 34px 40px 40px;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
    align-items: start;
}

.card {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
}

.sidebar {
    padding: 20px;
}

.sidebar h2 {
    margin: 0 0 18px;
    font-size: 26px;
}

.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.category-list.hierarchical {
    gap: 12px;
}

.category-group {
    display: grid;
    gap: 8px;
}

.category-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    align-items: center;
}

.collapse-toggle {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #d6cfc8;
    background: #f7f5f2;
    color: #655d56;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    touch-action: manipulation;
}

.collapse-toggle:focus-visible {
    outline: 2px solid #c37d5f;
    outline-offset: 1px;
}

.collapse-spacer {
    width: 40px;
    height: 40px;
}

.subcategory-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0 18px;
    display: grid;
    gap: 8px;
}

.subcategory-list[hidden] {
    display: none !important;
}

.category-child {
    padding-left: 8px;
    background: #fcfbfa;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 12px;
    background: #fff;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease;
    min-height: 44px;
}

.category-item:hover {
    transform: translateX(2px);
    border-color: #c6b9ae;
}

.category-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--dot-color);
    color: #fff;
}

.category-item span:nth-child(3) {
    flex: 1;
    font-size: 20px;
}

.category-child span:nth-child(3) {
    font-size: 16px;
}

.check {
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #c07b5a;
    font-size: 12px;
}

.category-toggle:not(:checked) ~ .check {
    background: #cbc5c0;
}

.upcoming-box {
    margin-top: 20px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8f7f5;
}

.upcoming-box h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.upcoming-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.upcoming-item {
    display: grid;
    grid-template-columns: 10px 1fr;
    gap: 10px;
    align-items: start;
    padding: 8px;
    border: 1px solid #e3dfd9;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.upcoming-dot {
    width: 10px;
    height: 10px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--dot-color);
}

.upcoming-meta {
    display: grid;
    gap: 2px;
}

.upcoming-title {
    font-size: 14px;
    font-weight: 700;
    color: #403832;
}

.upcoming-detail {
    font-size: 12px;
    color: #6e6762;
}

.upcoming-empty {
    margin: 10px 0 0;
    color: #6f6760;
    font-size: 13px;
}

.upcoming-empty.static-empty {
    margin: 0;
    font-size: 13px;
}

.promo-box {
    margin-top: 26px;
    border: 1px solid #e8dfd2;
    border-radius: 20px;
    padding: 18px;
    background: linear-gradient(180deg, #f5efe6, #f2ede7);
    text-align: center;
}

.promo-art {
    margin: 0 auto 14px;
    width: 140px;
    height: 120px;
    border-radius: 12px;
    background: linear-gradient(135deg, #9fb8d2, #f6c794);
}

.promo-box p {
    margin: 0;
    color: #655d57;
    font-size: 19px;
    line-height: 1.45;
}

.calendar {
    padding: 0;
    overflow: hidden;
}

.flash {
    margin: 18px 20px 0;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 600;
}

.flash.success {
    background: #e4f6e6;
    color: #236739;
}

.flash.success.pending {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.flash-badge {
    display: inline-block;
    background: #2f6c45;
    color: #fff;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
}

.flash.error {
    background: #fde9e6;
    color: #8c2b1d;
}

.calendar-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.calendar-header h1 {
    margin: 0;
    font-size: 46px;
}

.calendar-actions {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.nav-link,
.today-link {
    text-decoration: none;
    color: #564e47;
    padding: 10px 16px;
    font-size: 20px;
}

.today-link {
    min-width: 84px;
    text-align: center;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
}

.weekday-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    border-bottom: 1px solid var(--line);
}

.weekday-row div {
    text-align: center;
    padding: 12px 0;
    color: #8a827b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 16px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
}

.day-cell {
    min-height: 172px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.day-cell:nth-child(7n) {
    border-right: 0;
}

.day-cell.muted {
    background: #f7f6f5;
}

.date-number {
    font-size: 24px;
    color: #49403a;
}

.date-number.today {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: #c07b5a;
}

.event-pill {
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    background: var(--pill-color);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 15px;
    filter: saturate(82%);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.details-panel {
    width: min(620px, 100%);
}

.event-details h3 {
    margin: 0;
    font-size: 24px;
}

.details-meta {
    margin: 8px 0;
    color: #5f5650;
    font-weight: 700;
}

.details-location {
    margin: 0;
    color: #625953;
}

.details-description {
    margin: 14px 0 0;
    color: #4f4741;
    line-height: 1.5;
}

.details-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 0;
}

.category-bubble {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #fff;
    background: var(--bubble-color, #8a8179);
    filter: saturate(75%) brightness(0.92);
    white-space: nowrap;
}

.agenda-event-bubbles {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.details-source-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.details-source-link:hover {
    text-decoration: underline;
}

.agenda-source-link {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.agenda-source-link:hover {
    text-decoration: underline;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(18, 16, 14, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.open {
    display: flex;
}

.modal-panel {
    width: min(560px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 22px 46px rgba(35, 28, 24, 0.22);
    padding: 0;
    overflow: hidden;
}

.modal-panel-head {
    flex-shrink: 0;
    padding: 18px 18px 0;
}

.modal-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 18px 18px;
    -webkit-overflow-scrolling: touch;
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-top: 18px;
}

.welcome-panel {
    width: min(600px, 100%);
}

.welcome-step-label {
    margin: 0 0 2px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9a918b;
}

.welcome-step-title {
    margin: 0 0 4px;
    font-size: 20px;
}

.welcome-help {
    margin: 0 0 14px;
    color: #625953;
    font-size: 13px;
    line-height: 1.4;
}

.welcome-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 4px;
}

.welcome-interests-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.welcome-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 2px solid #d6d1cb;
    border-radius: 12px;
    background: #faf8f6;
    color: #4e4741;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}

.welcome-option input {
    flex-shrink: 0;
}

.welcome-option.selected {
    border-color: var(--accent);
    background: #fdf3ee;
}

.welcome-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--dot-color, #8a8179);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}

.welcome-option-label {
    line-height: 1.2;
}

.welcome-presets {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.welcome-preset-btn {
    font-size: 12px;
    padding: 5px 12px;
}

.welcome-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.welcome-nav-btn {
    padding: 10px 24px;
    font-size: 15px;
}

@media (max-width: 640px) {
    .welcome-option-grid,
    .welcome-interests-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 400px) {
    .welcome-option-grid,
    .welcome-interests-grid {
        grid-template-columns: 1fr;
    }
}


.modal-head h2 {
    margin: 0;
    font-size: 30px;
}

.moderation-note {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f4f1ee;
    color: #59504a;
    font-size: 13px;
}

.submission-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.tab-button {
    border: 1px solid #d8d3cc;
    border-radius: 10px;
    padding: 8px 10px;
    background: #f4f1ee;
    color: #5a514b;
    font-weight: 700;
    cursor: pointer;
}

.tab-button.active {
    background: #e9e3dd;
    border-color: #c9beb4;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: grid;
}

.icon-button {
    border: 0;
    background: #f2f0ed;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
}

.event-form {
    display: grid;
    gap: 12px;
}

.event-form label {
    display: grid;
    gap: 6px;
    color: #5a514b;
    font-weight: 600;
}

.tag-picker {
    margin: 0;
    padding: 10px;
    border: 1px solid #d6d1cb;
    border-radius: 12px;
}

.tag-picker legend {
    padding: 0 6px;
    color: #5a514b;
    font-weight: 700;
}

.tag-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 2px;
}

.tag-options-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tag-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #4e4741;
}

.tag-option .dot {
    width: 26px;
    height: 26px;
    font-size: 12px;
}

.event-form input,
.event-form textarea,
.event-form select {
    border: 1px solid #d6d1cb;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 16px;
    font-family: inherit;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.submit-button {
    margin-top: 8px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    padding: 12px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 700;
}

.sidebar-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.sidebar-reset-link {
    font-size: 12px;
    color: #9a918b;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
    font-family: inherit;
}

.sidebar-reset-link:hover {
    color: var(--accent);
}

.agenda-layout {
    padding: 28px 40px 40px;
}

.agenda-card {
    padding: 20px;
}

.agenda-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.agenda-header h1 {
    margin: 0;
    font-size: 34px;
}

.agenda-header p {
    margin: 0;
    color: #6d6660;
    font-weight: 600;
}

.agenda-days {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.agenda-day {
    border: 1px solid #e2ddd6;
    border-radius: 12px;
    background: #fff;
    padding: 12px;
}

.agenda-day-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid #efebe6;
    padding-bottom: 8px;
}

.agenda-day-head h2,
.agenda-day-head p {
    margin: 0;
}

.agenda-day-head h2 {
    font-size: 20px;
}

.agenda-day-head p {
    color: #6f6761;
    font-weight: 600;
}

.agenda-empty {
    margin: 10px 0 0;
    color: #756d66;
}

.agenda-event-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.agenda-event-item {
    display: grid;
    grid-template-columns: 10px 1fr;
    gap: 10px;
}

.agenda-dot {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--dot-color);
}

.agenda-event-content p {
    margin: 0;
}

.agenda-event-title {
    font-weight: 700;
    color: #3f3732;
}

.agenda-event-meta,
.agenda-event-categories {
    color: #6f6761;
    font-size: 14px;
}

.agenda-event-description {
    margin-top: 4px;
    color: #55504a;
    font-size: 14px;
}

@media (max-width: 1200px) {
    .mobile-filter-wrap {
        display: block;
        padding: 18px 40px 0;
    }

    .sidebar.mobile-collapsed {
        display: none;
    }

    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 1;
    }

    .calendar {
        order: 2;
    }
}

@media (max-width: 900px) {
    .topbar {
        height: auto;
        gap: 14px;
        align-items: flex-start;
        flex-direction: column;
        padding: 20px;
    }

    .topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .mobile-filter-wrap {
        padding: 8px 20px 0;
    }

    .layout {
        padding: 20px;
        gap: 18px;
    }

    .agenda-layout {
        padding: 20px;
    }

    .agenda-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .calendar {
        overflow-x: auto;
    }

    .calendar-header h1 {
        font-size: 38px;
    }

    .brand-title {
        font-size: 34px;
    }

    .tag-options {
        grid-template-columns: 1fr;
    }

    .collapse-toggle,
    .collapse-spacer {
        width: 44px;
        height: 44px;
    }

    .category-item {
        min-height: 48px;
    }
}
