.uspace-event-calendar-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 28px;
    font-family: inherit;
    color: #223235;
    --uspace-event-card-image-overlay-opacity: 1;
    --uspace-event-card-image-overlay-top: rgba(0, 49, 69, 0);
    --uspace-event-card-image-overlay-bottom: rgba(0, 49, 69, 0.72);
    --uspace-event-reset-bg: #ffffff;
    --uspace-event-reset-color: #17343d;
    --uspace-event-reset-border: #dce5e7;
    --uspace-event-reset-hover-bg: #ffffff;
    --uspace-event-reset-hover-color: #0a4f66;
    --uspace-event-reset-hover-border: #c5d5d8;
}

.uspace-event-calendar-wrapper button,
.uspace-event-calendar-wrapper button:hover,
.uspace-event-calendar-wrapper button:focus,
.uspace-event-calendar-wrapper button:focus-visible,
.uspace-event-calendar-wrapper button:active {
    appearance: none;
    background-image: none !important;
    border-image: none !important;
    text-shadow: none !important;
}

.uspace-event-calendar-wrapper .uspace-evt-weekday,
.uspace-event-calendar-wrapper .uspace-evt-weekday:hover,
.uspace-event-calendar-wrapper .uspace-evt-weekday:focus,
.uspace-event-calendar-wrapper .uspace-evt-weekday:focus-visible,
.uspace-event-calendar-wrapper .uspace-evt-cal-day,
.uspace-event-calendar-wrapper .uspace-evt-cal-day:hover,
.uspace-event-calendar-wrapper .uspace-evt-cal-day:focus,
.uspace-event-calendar-wrapper .uspace-evt-cal-day:focus-visible {
    background-image: none !important;
    border-image: none !important;
    text-shadow: none !important;
}

.uspace-evt-weekbar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.uspace-evt-weekbar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.uspace-evt-header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 0 0 auto;
}

.uspace-evt-list-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.uspace-evt-selected-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #768b90;
}

.uspace-evt-selected-date {
    font-size: 1.15rem;
    line-height: 1.3;
    color: #17343d;
    font-weight: 500;
}

.uspace-evt-cal-toggle {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dce5e7;
    border-radius: 999px;
    background: #ffffff;
    color: #17343d;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 18px rgba(16, 40, 45, 0.08);
}

.uspace-evt-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 18px;
    border: 1px solid var(--uspace-event-reset-border);
    border-radius: 999px;
    background: var(--uspace-event-reset-bg) !important;
    color: var(--uspace-event-reset-color);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.uspace-evt-reset[hidden] {
    display: none;
}

.uspace-event-calendar-wrapper .uspace-evt-reset:hover,
.uspace-event-calendar-wrapper .uspace-evt-reset:focus,
.uspace-event-calendar-wrapper .uspace-evt-reset:focus-visible {
    color: var(--uspace-event-reset-hover-color) !important;
    background: var(--uspace-event-reset-hover-bg) !important;
    border-color: var(--uspace-event-reset-hover-border) !important;
    transform: translateY(-1px);
    background-image: none !important;
    border-image: none !important;
    text-shadow: none !important;
    outline: none !important;
}

.uspace-event-calendar-wrapper .uspace-evt-cal-toggle:hover,
.uspace-event-calendar-wrapper .uspace-evt-cal-toggle:focus,
.uspace-event-calendar-wrapper .uspace-evt-cal-toggle:focus-visible {
    transform: translateY(-1px);
    border-color: #c5d5d8;
    background-image: none !important;
    border-image: none !important;
    text-shadow: none !important;
}

.uspace-evt-cal-toggle:focus,
.uspace-evt-cal-toggle:focus-visible {
    outline: none;
}

.uspace-evt-weekstrip {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: max-height 0.32s ease, opacity 0.28s ease, transform 0.28s ease;
}

.uspace-event-calendar-wrapper.has-selected-date .uspace-evt-weekstrip {
    max-height: 260px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.uspace-evt-weekday {
    min-width: 0;
    padding: 14px 10px;
    border: 1px solid #dde7e8;
    border-radius: 16px;
    background: #f7faf9;
    color: #4d676f;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    cursor: default;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.uspace-week-align-center .uspace-evt-weekday {
    align-items: center;
}

.uspace-week-align-right .uspace-evt-weekday {
    align-items: flex-end;
}

.uspace-evt-weekday-name {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.uspace-evt-weekday-date {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
}

.uspace-evt-weekday.has-events {
    cursor: pointer;
    background: #eef5f4;
    border-color: #c7d8d6;
    color: #17343d;
}

.uspace-event-calendar-wrapper .uspace-evt-weekday.has-events:hover,
.uspace-event-calendar-wrapper .uspace-evt-weekday.has-events:focus,
.uspace-event-calendar-wrapper .uspace-evt-weekday.has-events:focus-visible {
    transform: translateY(-2px);
    background: #e8f1f0 !important;
    border-color: #c7d8d6 !important;
    box-shadow: none !important;
    border-image: none !important;
    text-shadow: none !important;
    outline: none !important;
}

.uspace-evt-weekday.active {
    background: #17343d;
    border-color: #17343d;
    color: #ffffff;
}

.uspace-event-calendar-wrapper .uspace-evt-weekday.active.has-events:hover,
.uspace-event-calendar-wrapper .uspace-evt-weekday.active.has-events:focus,
.uspace-event-calendar-wrapper .uspace-evt-weekday.active.has-events:focus-visible {
    background: #17343d !important;
    border-color: #17343d !important;
    color: #ffffff !important;
}

.uspace-evt-weekday:disabled {
    opacity: 0.55;
    pointer-events: none;
}

.uspace-evt-list-panel {
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transition: max-height 0.36s ease, opacity 0.3s ease, transform 0.3s ease;
}

.uspace-event-calendar-wrapper.has-selected-date .uspace-evt-list-panel {
    max-height: 2400px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.uspace-evt-loader {
    display: block;
    padding: 0 16px;
    text-align: center;
    font-size: 1rem;
    color: #5f7378;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(8px);
    visibility: hidden;
    transition: max-height 0.24s ease, opacity 0.2s ease, transform 0.2s ease, padding 0.2s ease;
}

.uspace-event-calendar-wrapper.is-loading .uspace-evt-loader {
    position: absolute;
    width: 1px;
    height: 1px;
    max-height: 1px;
    padding: 0;
    opacity: 0;
    overflow: hidden;
    clip-path: inset(50%);
    visibility: visible;
}

.uspace-event-calendar-wrapper:not(.is-loading) .uspace-evt-loader {
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.uspace-evt-inner-list {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(12px);
    transition: max-height 0.36s ease, opacity 0.32s ease, transform 0.32s ease;
}

.uspace-event-calendar-wrapper.has-selected-date .uspace-evt-inner-list {
    max-height: 2200px;
    opacity: 1;
    transform: translateY(0);
}

.uspace-event-calendar-wrapper.has-selected-date.is-loading .uspace-evt-inner-list {
    min-height: var(--uspace-calendar-loading-min-height, 0);
}

.uspace-evt-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
    animation: uspaceEventCalendarCardIn 0.34s ease both;
}

.uspace-evt-media {
    position: relative;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    margin-bottom: 15px;
    border-radius: 4px;
}

.uspace-evt-media a {
    display: block;
    width: 100%;
    height: 100%;
}

.uspace-evt-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.uspace-evt-media:hover .uspace-evt-img {
    transform: scale(1.05);
}

.uspace-evt-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
}

.uspace-evt-date {
    font-size: 0.84rem;
    color: #6c8288;
    margin: 0;
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.uspace-evt-title {
    margin: 0 !important;
    font-size: 1.2rem;
    line-height: 1.4;
    color: #2f6774;
    font-weight: 500;
}

.uspace-evt-title a {
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    font-style: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    text-transform: inherit;
    text-decoration: none;
}

.uspace-evt-title a:hover {
    text-decoration: underline;
}

.uspace-evt-time {
    font-size: 0.88rem;
    color: #223235;
    margin-bottom: 12px;
}

.uspace-evt-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #566a6f;
}

.uspace-evt-empty {
    padding: 22px 18px;
    background: #f5f7f8;
    border: 1px solid #e4ebed;
    border-radius: 16px;
    text-align: center;
    color: #586d73;
}

.uspace-evt-skeleton {
    pointer-events: none;
}

.uspace-evt-skeleton-image,
.uspace-evt-skeleton-line {
    position: relative;
    overflow: hidden;
    background: #edf2f3;
}

.uspace-evt-skeleton-image::after,
.uspace-evt-skeleton-line::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.62), transparent);
    animation: uspaceEventSkeletonShimmer 1.15s ease-in-out infinite;
}

.uspace-evt-skeleton-line {
    height: 14px;
    border-radius: 999px;
}

.uspace-evt-skeleton-date {
    width: 58%;
}

.uspace-evt-skeleton-title {
    width: 88%;
    height: 22px;
}

.uspace-calendar-linked-grid-hidden {
    display: none !important;
}

.uspace-event-carousel-container,
.uspace-event-list-container {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.uspace-calendar-linked-grid-leaving {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.uspace-evt-cal-overlay[hidden] {
    display: none;
}

.uspace-evt-cal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.uspace-evt-cal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 25, 30, 0.48);
    backdrop-filter: blur(2px);
}

.uspace-evt-cal-panel {
    position: relative;
    width: min(100%, 420px);
    background: linear-gradient(180deg, #0f3642 0%, #0c2c36 100%);
    border-radius: 24px;
    padding: 22px;
    color: #fff;
    box-sizing: border-box;
    box-shadow: 0 24px 60px rgba(10, 33, 40, 0.22);
}

.uspace-evt-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 12px;
}

.uspace-evt-cal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.2;
    color: #d7e8ec;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.uspace-evt-cal-nav {
    display: flex;
    gap: 8px;
}

.uspace-evt-cal-nav button {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #d7e8ec;
    border-radius: 999px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.uspace-event-calendar-wrapper .uspace-evt-cal-nav button:hover,
.uspace-event-calendar-wrapper .uspace-evt-cal-nav button:focus,
.uspace-event-calendar-wrapper .uspace-evt-cal-nav button:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
    border-image: none !important;
    text-shadow: none !important;
}

.uspace-evt-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    text-align: center;
}

.uspace-evt-cal-dow {
    font-size: 0.78rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.05em;
    padding-bottom: 6px;
}

.uspace-evt-cal-day {
    width: 100%;
    min-width: 0;
    aspect-ratio: 1 / 1;
    border: 1px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.65);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
    cursor: default;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.uspace-evt-cal-day.empty {
    visibility: hidden;
}

.uspace-evt-cal-day.has-events {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(215, 232, 236, 0.45);
    color: #fff;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(215, 232, 236, 0.28);
}

.uspace-event-calendar-wrapper .uspace-evt-cal-day.has-events:hover,
.uspace-event-calendar-wrapper .uspace-evt-cal-day.has-events:focus,
.uspace-event-calendar-wrapper .uspace-evt-cal-day.has-events:focus-visible {
    background: rgba(215, 232, 236, 0.16);
    transform: translateY(-1px);
    border-image: none !important;
    text-shadow: none !important;
}

.uspace-evt-cal-day.active {
    background: #d7e8ec;
    border-color: #d7e8ec;
    color: #14323d;
    font-weight: 700;
}

.uspace-evt-cal-day:disabled {
    opacity: 1;
    pointer-events: none;
}

@keyframes uspaceEventCalendarCardIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes uspaceEventSkeletonShimmer {
    to {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .uspace-evt-weekstrip,
    .uspace-evt-list-panel,
    .uspace-evt-loader,
    .uspace-evt-inner-list,
    .uspace-event-carousel-container,
    .uspace-event-list-container,
    .uspace-evt-item,
    .uspace-evt-img,
    .uspace-evt-skeleton-image::after,
    .uspace-evt-skeleton-line::after {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 900px) {
    .uspace-evt-weekstrip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .uspace-event-calendar-wrapper {
        gap: 22px;
    }

    .uspace-evt-inner-list {
        row-gap: 28px;
        column-gap: 20px;
    }

    .uspace-evt-weekbar-head {
        align-items: flex-start;
    }

    .uspace-evt-header-actions {
        align-items: flex-end;
        flex-direction: column-reverse;
    }

    .uspace-evt-weekstrip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .uspace-evt-cal-overlay {
        padding: 16px;
    }

    .uspace-evt-cal-panel {
        padding: 18px;
        border-radius: 18px;
    }

    .uspace-evt-cal-grid {
        gap: 6px;
    }
}
