body {
    margin: 0;
    padding-top: 84px;
    font-family: system-ui, sans-serif;
    background: #0f0f0f;
    color: #eaeaea;
}

/* --- HEADER --- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    height: 60px;
    width: 100%;
    background: #0b0b0b;
    border-bottom: 1px solid #222;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 2000;
    box-sizing: border-box;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.topbar-center {
    display: flex;
    gap: 8px;
}

.view-link {
    display: inline-block;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #eaeaea;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    width: 92px;
    text-align: center;
    text-decoration: none;
}

.view-link:hover {
    border-color: #7f5af0;
    background: #1f1f1f;
}

.view-link.active {
    border-color: #7f5af0;
    background: #2a2a2a;
}


.view-btn {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #eaeaea;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.view-btn.active {
    border-color: #7f5af0;
    background: #2a2a2a;
}

.topbar-right {
    display: flex;
    gap: 8px;
}

.logout-form {
    margin: 0;
    display: flex;
}

.icon-btn {
    background: none;
    border: 1px solid #333;
    color: #eaeaea;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
}

.icon-btn:hover {
    border-color: #7f5af0;
    background: #1a1a1a;
}

/* --- CALENDAR --- */
.app-name {
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* --- LANDING --- */
.landing {
    min-height: 100vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 2rem 1rem 7rem;
    box-sizing: border-box;
}

.landing-card {
    width: min(100%, 36rem);
    padding: 2rem;
    border: 1px solid #2d2d2d;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(26, 26, 26, 0.96), rgba(17, 17, 17, 0.96));
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.landing-card h1 {
    margin-top: 0;
}

.login-actions {
    display: flex;
    justify-content: center;
}

.login-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    padding: 0.75rem 1.25rem;
    border: 1px solid #444;
    color: #eaeaea;
    text-decoration: none;
    border-radius: 999px;
    min-width: 15rem;
    background: #1b1b1b;
}

.login-btn:hover {
    border-color: #7f5af0;
    background: #232323;
}

.login-disclaimer {
    margin: 0.85rem 0 0;
    color: #b7b7b7;
    font-size: 0.92rem;
}

.login-disclaimer a {
    color: #c7b5ff;
}

.legal-details {
    margin-top: 1.5rem;
    text-align: left;
    border: 1px solid #2f2f2f;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.legal-details summary {
    cursor: pointer;
    padding: 0.95rem 1rem;
    font-weight: 600;
}

.legal-details-body {
    padding: 0 1rem 1rem;
    color: #d1d1d1;
}

.legal-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.legal-links a {
    color: #c7b5ff;
}

.legal-page {
    min-height: 100vh;
    padding: 2rem 1rem 4rem;
    box-sizing: border-box;
}

.legal-page-card {
    width: min(100%, 52rem);
    margin: 0 auto;
    padding: 2rem;
    border: 1px solid #2d2d2d;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(26, 26, 26, 0.96), rgba(17, 17, 17, 0.96));
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    box-sizing: border-box;
}

.legal-page-card h1 {
    margin-top: 0;
}

.legal-page-card h2 {
    margin-top: 1.75rem;
    font-size: 1.15rem;
}

.legal-page-card p,
.legal-page-card li {
    color: #d1d1d1;
    line-height: 1.6;
}

.legal-page-card ul {
    padding-left: 1.25rem;
}

.legal-back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 1.25rem;
    color: #c7b5ff;
    text-decoration: none;
}

.legal-back-link:hover {
    text-decoration: underline;
}

.cookie-banner {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    width: min(calc(100% - 2rem), 42rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border: 1px solid #343434;
    border-radius: 14px;
    background: rgba(11, 11, 11, 0.96);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
    z-index: 2200;
}

.cookie-banner p {
    margin: 0;
    text-align: left;
}

.cookie-btn {
    border: 1px solid #5f46c7;
    background: #7f5af0;
    color: #fff;
    border-radius: 999px;
    padding: 0.65rem 1rem;
    cursor: pointer;
    white-space: nowrap;
}

.cookie-btn:hover {
    opacity: 0.9;
}

@media (max-width: 640px) {
    .landing-card {
        padding: 1.5rem;
    }

    .legal-page-card {
        padding: 1.5rem;
    }

    .login-btn {
        width: 100%;
        min-width: 0;
    }

    .cookie-banner {
        left: 1rem;
        right: 1rem;
        transform: none;
        width: auto;
        flex-direction: column;
        align-items: stretch;
    }
}

/* --- CALENDAR --- */
.calendar {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

.calendar-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.tag-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.tag-filter-label {
    color: #9ca3af;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tag-filter-select {
    min-width: 160px;
    padding: 0.45rem 0.6rem;
    border: 1px solid #333;
    border-radius: 6px;
    background: #121212;
    color: #eaeaea;
}

.tag-filter-select:hover,
.tag-filter-select:focus {
    border-color: #60a5fa;
    outline: none;
}

.list-header {
    max-width: 900px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.list-header h2 {
    margin: 0;
}

.list-header-copy {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.list-header-subtitle {
    margin: 0;
    color: #9ca3af;
    font-size: 0.92rem;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.calendar-header button {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #eaeaea;
    font-size: 1.1rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
}

.calendar-header button:hover {
    background: #2a2a2a;
}

.calendar-header button:active {
    transform: translateY(1px);
}

#monthLabel {
    font-weight: bold;
    font-size: 1.2rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
}

.day-name,
.day {
    padding: 0.75rem;
    border: 1px solid #333;
    text-align: center;
}

.day-name {
    font-weight: bold;
    background: #1a1a1a;
}

.day {
    min-height: 80px;
    min-width: 0;
    overflow: hidden;
}

.day.today {
    outline: 2px solid #7f5af0;
}

.day-number {
    margin-bottom: 0.35rem;
}

.events {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    overflow: hidden;
}

.event-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 0.2rem 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.45);
}

.event-title.accepted {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
}

.event-title.invited {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
}

.event-title.tentative {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
}

.event-title.declined {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

.event-indicator {
    height: 0.34rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.event-indicator.accepted {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.78);
}

.event-indicator.invited {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.8);
}

.event-indicator.tentative {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.82);
}

.event-indicator.declined {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.78);
}

.event-more-count {
    align-self: center;
    font-size: 0.68rem;
    line-height: 1;
    color: #d7ddff;
}

/* ===== EVENT COLORS ===== */
/* single-day event */
.day.has-event {
    background: #1f2937;
    border: 1px solid #333;
}

/* festival - start */
.day.festival-start {
    background: #243447;
    border: 1px solid #333;
}

/* festival - middle */
.day.festival-middle {
    background: #1e3a5f;
    border: 1px solid #333;
}

/* festival - end */
.day.festival-end {
    background: #243447;
    border: 1px solid #333;
}

/* ===== INTERACTION ===== */
.day[data-day] {
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.day[data-day]:hover {
    background: #2a2a2a;
    border-color: #7f5af0;
}

.month-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#todayBtn {
    background: #7f5af0;
    border: none;
    color: #fff;
    font-size: 0.7rem;
    padding: 0.3rem 0.45rem;
    border-radius: 50%;
    cursor: pointer;
}

#todayBtn:hover {
    opacity: 0.8;
}

/* ===== FORM ====== */
.event-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.event-form input,
.event-form select,
.event-form textarea {
    background: #0f0f0f;
    border: 1px solid #333;
    color: #eaeaea;
    padding: 0.4rem 0.5rem;
}

.event-form textarea {
    resize: vertical;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #111;
    border: 1px solid #333;
    padding: 1.5rem;
    width: 480px;
    max-width: 90vw;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* =========================
   DAY MODAL - EVENT ITEMS
   ========================= */

#modalEvents {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.event-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;

    padding: 0.6rem 0.8rem;
    margin-bottom: 0.4rem;

    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 6px;
    cursor: pointer;

    transition:
            background-color 0.15s ease,
            border-color 0.15s ease;
}

.event-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.event-title-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== PREPARED FOR STATUS ===== */
.event-item.accepted {
    background: rgba(0, 180, 120, 0.15);
    border-color: rgba(0, 180, 120, 0.4);
}

.event-item.invited {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
}

.event-item.tentative {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
}

.event-item.declined {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

/* =========================
   EVENT ITEM - ACTIONS
   ========================= */

.event-actions {
    display: flex;
    gap: 0.25rem;
}

.event-btn {
    background: transparent;
    border: 1px solid #444;
    color: #eaeaea;
    font-size: 0.8rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    cursor: pointer;
}

.event-btn:hover {
    background: #2a2a2a;
}

.event-btn.accept:hover {
    border-color: #22c55e;
    color: #22c55e;
}

.event-btn.tentative:hover {
    border-color: #f59e0b;
    color: #f59e0b;
}

.event-btn.decline:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.event-btn.share:hover {
    border-color: #60a5fa;
    color: #60a5fa;
}

/* ===== LOGOUT ===== */
.logout-container {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
}

.logout-container form {
    display: inline-block;
}

.logout-container button {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #eaeaea;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.logout-container button:hover {
    background: #2a2a2a;
    border-color: #7f5af0;
}

/* ===== VIEW SWITCH ===== */
.hidden {
    display: none;
}

/* ===== LIST STUB ===== */
.list-stub {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    border: 1px dashed #333;
    text-align: center;
    opacity: 0.7;
}

/* ===== EVENT LIST (LIST VIEW) ===== */

#eventList {
    max-width: 900px;
    margin: 1rem auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.event-summary {
    padding: 0.6rem 0.8rem;
    border: 1px solid #333;
    background: #141414;
    cursor: pointer;
}

.event-summary:hover {
    border-color: #7f5af0;
    background: #1f1f1f;
}

.event-summary-date {
    font-size: 0.85rem;
    opacity: 0.7;
}

.event-summary-title {
    font-weight: 500;
}

.event-summary-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.event-summary-tag,
.event-tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.5rem;
    border: 1px solid rgba(96, 165, 250, 0.45);
    border-radius: 999px;
    background: rgba(96, 165, 250, 0.12);
    color: #dbeafe;
    font-size: 0.74rem;
    line-height: 1.2;
}

.event-tag-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* ===== EVENT SUMMARY STATUS ===== */

.event-summary-status {
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.45rem;
    padding: 0.1rem 0.4rem;
    width: fit-content;
    border-radius: 4px;
    border: 1px solid transparent;
}

/* ACCEPTED */
.event-summary-status.accepted {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
}

.event-summary-status.invited {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
}

/* TENTATIVE */
.event-summary-status.tentative {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
}

/* DECLINED */
.event-summary-status.declined {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

/* ===== LIST EVENT MODAL ===== */

#listEventModal .modal-content {
    max-width: 520px;
}

#listEventCard {
    margin-bottom: 0.85rem;
    cursor: default;
}


#listEventSummary {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    flex: 1;
}

#listEventTitle {
    margin-bottom: 0.75rem;
}

#listEventBody {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.list-event-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #2f2f2f;
    border-radius: 6px;
    background: #141414;
}

.list-event-label {
    color: #8f8f8f;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.list-event-value {
    line-height: 1.4;
    word-break: break-word;
}

.list-event-link {
    color: #93c5fd;
}

.list-event-participants {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 0.4rem;
}

.list-event-participants-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.list-event-participant {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #2f2f2f;
    border-radius: 6px;
    background: #141414;
}

.list-event-participant-name {
    flex: 1;
    min-width: 0;
    line-height: 1.4;
    word-break: break-word;
}

.list-event-participant .event-summary-status {
    margin-top: 0;
}

.list-event-loading {
    min-height: 1.2rem;
    margin-top: 0.85rem;
    color: #93c5fd;
}
.friend-invite-status {
    min-height: 1.2rem;
    margin: 0.6rem 0;
    color: #cfd3ff;
}

.notifications-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    border: 1px solid #333;
    padding: 0.5rem 0.6rem;
    background: #161616;
}

.settings-tabs {
    display: flex;
    gap: 0.35rem;
    margin: 0 0 1rem;
    border-bottom: 1px solid #2f2f2f;
    flex-shrink: 0;
}

.settings-tab {
    margin-bottom: -1px;
    padding: 0.55rem 0.95rem;
    border: 1px solid transparent;
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.92rem;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.settings-tab:hover {
    color: #e5e7eb;
    background: rgba(31, 41, 55, 0.45);
}

.settings-tab.is-active {
    border-color: #3a3a3a;
    border-bottom-color: #141414;
    background: #141414;
    color: #f3f4f6;
}

.settings-tab-panel {
    margin-bottom: 1rem;
}

.settings-modal-content {
    width: min(620px, calc(100vw - 2rem));
    max-height: min(82vh, 760px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.settings-modal-content h3,
.settings-modal-content .day-modal-actions {
    flex-shrink: 0;
}

.settings-modal-content .day-modal-actions {
    margin-top: 0.75rem;
}

.settings-tab-panel {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.friend-section {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid #2f2f2f;
    background: #131313;
    border-radius: 6px;
}

.friend-section h4 {
    margin: 0 0 0.5rem;
}

.settings-empty-state {
    margin: 0;
    color: #9ca3af;
    line-height: 1.4;
}

.friend-actions {
    display: flex;
    gap: 0.4rem;
}

.friend-actions.hidden {
    display: none;
}

.notification-popup-modal {
    align-items: flex-start;
    justify-content: flex-end;
    padding: 5rem 1rem 0 0;
    background: transparent;
    pointer-events: none;
}

.notification-popup-modal .notification-popup-content {
    width: 360px;
    max-width: calc(100vw - 2rem);
    border: 1px solid #3a3a3a;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
}

.notification-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.notification-popup-header h3 {
    margin: 0;
    font-size: 1rem;
}

.notification-popup-body {
    margin: 0 0 0.8rem;
    font-size: 0.9rem;
    line-height: 1.35;
}

#notificationPopupActions {
    display: flex;
    gap: 0.55rem;
    margin-bottom: 0.8rem;
}

.notification-popup-btn-accept {
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(34, 197, 94, 0.65);
    color: #dcfce7;
}

.notification-popup-btn-accept:hover {
    background: rgba(34, 197, 94, 0.24);
    border-color: #22c55e;
}

.notification-popup-btn-tentative {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.65);
    color: #fef3c7;
}

.notification-popup-btn-tentative:hover {
    background: rgba(245, 158, 11, 0.24);
    border-color: #f59e0b;
}

.notification-popup-btn-decline {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.65);
    color: #fecaca;
}

.notification-popup-btn-decline:hover {
    background: rgba(239, 68, 68, 0.24);
    border-color: #ef4444;
}

.notification-popup-timer {
    height: 4px;
    background: #2a2a2a;
    border-radius: 999px;
    overflow: hidden;
}

.notification-popup-progress {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #f59e0b 100%);
    transition: width 0.1s linear;
}

.day-modal-actions {
    display: flex;
    gap: 0.55rem;
    margin-top: 0.25rem;
}

.day-modal-btn {
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    font-size: 0.9rem;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.day-modal-btn-primary {
    background: #1f2937;
    border-color: #60a5fa;
    color: #eaf2ff;
}

.day-modal-btn-primary:hover {
    background: #243447;
    border-color: #93c5fd;
}

.day-modal-btn-secondary {
    background: #1a1a1a;
    color: #eaeaea;
}

.day-modal-btn-secondary:hover {
    background: #232323;
    border-color: #7f5af0;
}

.day-modal-btn-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.48);
    color: #fecaca;
}

.day-modal-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.event-form-actions {
    display: flex;
    gap: 0.55rem;
    margin-top: 0.25rem;
}

.event-form-actions .day-modal-btn-primary {
    flex: 1;
}

.event-details-actions {
    display: flex;
    gap: 0.55rem;
    margin-top: 0.25rem;
}

.event-details-actions .day-modal-btn-primary {
    flex: 1;
}

.settings-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.settings-tag-item {
    align-items: flex-start;
}

.settings-tag-item.is-editing {
    border-color: #365b86;
    background: #18202b;
}

.settings-tag-edit {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: min(100%, 240px);
}

.settings-tag-input {
    background: #0f0f0f;
    border: 1px solid #365b86;
    border-radius: 6px;
    color: #eaeaea;
    padding: 0.45rem 0.55rem;
}

.settings-tag-input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.18);
}

.settings-tag-count {
    color: #9ca3af;
}

.settings-tag-actions {
    justify-content: flex-end;
}

.settings-admin-item {
    align-items: flex-start;
}

.settings-admin-actions {
    justify-content: flex-end;
}

.settings-admin-list {
    max-height: min(46vh, 430px);
    overflow-y: auto;
    padding-right: 0.2rem;
    margin-bottom: 0;
}

.settings-tag-empty {
    justify-content: center;
    color: #9ca3af;
}

.settings-mini-btn {
    padding: 0.28rem 0.7rem;
    font-size: 0.82rem;
}

.icon-btn.has-pending-notifications {
    position: relative;
}

.notifications-pending-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #f59e0b;
    color: #111;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    font-weight: 700;
    border: 1px solid #111;
    box-sizing: border-box;
}

.friend-invite-btn {
    width: auto;
    align-self: flex-start;
    min-width: 0;
}

.remove-friend-confirm-content {
    max-width: 360px;
}

.remove-friend-confirm-text {
    margin: 0.25rem 0 1rem;
    line-height: 1.4;
}

.remove-friend-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}


.notification-item-actionable {
    border-color: #2c4e7d;
}

.notification-item-actionable:hover {
    border-color: #60a5fa;
    background: #18202b;
}

.notification-item-button {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    background: transparent;
    border: none;
    color: inherit;
    padding: 0;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.notification-item-button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.notification-item-content {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 0.2rem;
}

.notification-item-title {
    font-weight: 600;
}

.notification-item-description {
    color: #d9d9d9;
    font-size: 0.9rem;
    line-height: 1.35;
}

.notification-item-meta {
    color: #8f8f8f;
    font-size: 0.78rem;
}

.notification-item-hint {
    align-self: center;
    color: #93c5fd;
    font-size: 0.8rem;
    white-space: nowrap;
}

.notification-detail-content {
    max-width: 560px;
}

.notification-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.notification-detail-header h3 {
    margin: 0;
}

.notification-detail-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notification-detail-intro {
    margin: 0;
    line-height: 1.45;
}

.notification-detail-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification-detail-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #2f2f2f;
    border-radius: 6px;
    background: #141414;
}

.notification-detail-label {
    color: #8f8f8f;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.notification-detail-value {
    line-height: 1.4;
    word-break: break-word;
}

.notification-detail-link {
    color: #93c5fd;
}

.notification-detail-status {
    min-height: 1.2rem;
    margin: 0.75rem 0 0;
    color: #93c5fd;
}

.notification-detail-status.is-error {
    color: #fca5a5;
}

.notification-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1rem;
}

.notification-detail-actions .day-modal-btn {
    flex: 1 1 140px;
}

.notification-detail-btn-accept {
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(34, 197, 94, 0.65);
    color: #dcfce7;
}

.notification-detail-btn-accept:hover {
    background: rgba(34, 197, 94, 0.24);
    border-color: #22c55e;
}

.notification-detail-btn-tentative {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.65);
    color: #fef3c7;
}

.notification-detail-btn-tentative:hover {
    background: rgba(245, 158, 11, 0.24);
    border-color: #f59e0b;
}

.notification-detail-btn-decline {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.65);
    color: #fecaca;
}

.notification-detail-btn-decline:hover {
    background: rgba(239, 68, 68, 0.24);
    border-color: #ef4444;
}

@media (max-width: 760px) {
    body {
        padding-top: 0;
    }

    .topbar {
        position: sticky;
        height: auto;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.55rem;
        padding: 0.65rem 0.75rem 0.8rem;
    }

    .topbar-left,
    .topbar-center,
    .topbar-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .app-name {
        font-size: 0.95rem;
        text-align: center;
    }

    .view-link {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        max-width: 150px;
        min-height: 40px;
    }

    .topbar-right {
        gap: 0.5rem;
    }

    .icon-btn {
        min-height: 40px;
        padding: 0.45rem 0.7rem;
    }

    .logout-form,
    .logout-form .icon-btn {
        flex: 1 1 120px;
    }

    .calendar {
        max-width: none;
        padding: 0.75rem 0.55rem 1rem;
    }

    .calendar-header {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 0.45rem;
        align-items: center;
        margin-bottom: 0.55rem;
    }

    .calendar-header button {
        min-height: 44px;
        padding: 0.35rem 0.4rem;
    }

    .month-center {
        min-width: 0;
        justify-content: center;
        gap: 0.35rem;
    }

    #monthLabel {
        min-width: 0;
        font-size: 1rem;
        text-align: center;
    }

    .calendar-grid {
        gap: 0.28rem;
    }

    .day-name,
    .day {
        padding: 0.35rem 0.18rem;
    }

    .day-name {
        font-size: 0.7rem;
        letter-spacing: 0.02em;
    }

    .day {
        min-height: 72px;
    }

    .day-number {
        margin-bottom: 0.25rem;
        font-size: 0.92rem;
    }

    .events {
        gap: 0.18rem;
    }

    .events.events-compact {
        margin-top: 0.12rem;
    }

    .event-indicator {
        height: 0.38rem;
    }

    .event-more-count {
        font-size: 0.67rem;
    }

    .modal {
        align-items: flex-end;
    }

    .modal-content,
    #listEventModal .modal-content,
    .notification-popup-modal .notification-popup-content {
        width: 100%;
        max-width: none;
        max-height: min(88vh, 100%);
        overflow-y: auto;
        margin: 0;
        padding: 1rem 0.95rem calc(1rem + env(safe-area-inset-bottom));
        border-radius: 18px 18px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .notification-popup-modal {
        align-items: flex-end;
        justify-content: center;
        padding: 0;
    }

    .notification-popup-modal .notification-popup-content {
        box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.45);
    }

    #modalEvents {
        max-height: 48vh;
        overflow-y: auto;
        padding-right: 0.1rem;
    }

    .event-item {
        align-items: stretch;
        flex-direction: column;
    }

    .event-title-wrapper,
    #listEventSummary {
        width: 100%;
    }

    .event-title-text {
        white-space: normal;
    }

    .event-actions,
    .day-modal-actions,
    .event-form-actions,
    .event-details-actions,
    #notificationPopupActions,
    .notification-detail-actions,
    .friend-actions {
        flex-wrap: wrap;
    }

    .event-actions {
        justify-content: flex-end;
    }

    .event-btn {
        min-width: 40px;
        min-height: 40px;
        padding: 0.35rem 0.55rem;
    }

    .calendar-toolbar,
    .list-header {
        gap: 0.65rem;
    }

    .tag-filter-bar {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
        gap: 0.35rem;
    }

    .tag-filter-select {
        width: 100%;
        min-width: 0;
        min-height: 40px;
    }


    .settings-tag-item {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-tag-actions {
        width: 100%;
        justify-content: stretch;
    }

    .settings-admin-item {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-admin-actions {
        width: 100%;
        justify-content: stretch;
    }

    .settings-modal-content {
        max-height: min(84vh, 100%);
    }

    .settings-tab-panel {
        padding-right: 0;
    }

    .settings-admin-list {
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }

    .settings-mini-btn {
        flex: 1 1 120px;
    }

    .friend-invite-btn {
        width: auto;
        align-self: flex-start;
        min-height: 38px;
        padding: 0.35rem 0.8rem;
    }

    .day-modal-btn,
    .event-form-actions .day-modal-btn,
    .event-details-actions .day-modal-btn,
    .notification-detail-actions .day-modal-btn {
        flex: 1 1 140px;
        min-height: 44px;
    }

    .list-event-field,
    .notification-detail-field,
    .friend-section {
        padding: 0.55rem 0.6rem;
    }
}



