.tct-page {
    background: #f7f4ef;
    color: #251f18;
    padding: 32px 0 56px;
}

.tct-container {
    margin: 0 auto;
    max-width: 1180px;
    padding: 0 18px;
}

.tct-header {
    margin-bottom: 24px;
}

.tct-kicker {
    color: #86613d;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.tct-header h1 {
    font-size: 36px;
    line-height: 1.15;
    margin: 0;
}

.tct-intro {
    font-size: 17px;
    line-height: 1.6;
    margin: 12px 0 0;
    max-width: 850px;
}

.tct-toolbar,
.tct-filters {
    align-items: center;
    background: #fff;
    border: 1px solid #ded5c8;
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 14px;
}

.tct-toolbar h2 {
    font-size: 24px;
    line-height: 1.05;
    margin: 0;
}

.tct-month-heading {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.tct-today-link {
    color: #86613d;
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1;
    margin-top: 0;
    text-decoration: none;
}

.tct-today-link:hover,
.tct-today-link:focus {
    color: #3f3123;
    text-decoration: underline;
}

.tct-filters {
    justify-content: flex-start;
}

.tct-filters label {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.tct-button {
    background: #3f3123;
    border: 1px solid #3f3123;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    line-height: 1;
    padding: 10px 12px;
    text-decoration: none;
}

.tct-button:hover,
.tct-button:focus {
    background: #6f4b2a;
    border-color: #6f4b2a;
    color: #fff;
}

.tct-button--primary {
    background: #8a4f1d;
    border-color: #8a4f1d;
}

.tct-month-arrow {
    align-items: center;
    color: #fff;
    font-size: 30px;
    height: 42px;
    justify-content: center;
    padding: 0;
    width: 42px;
}

.tct-month-arrow span {
    display: block;
    line-height: 1;
    margin-top: -2px;
}

.tct-calendar {
    margin-bottom: 34px;
}

.tct-weekdays,
.tct-week {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.tct-week {
    background: #e5dccf;
    border-left: 1px solid #e5dccf;
    border-right: 1px solid #e5dccf;
    margin-bottom: 1px;
    position: relative;
}

.tct-weekday {
    background: #3f3123;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 8px;
    text-align: center;
}

.tct-day {
    background: #fff;
    border: 0;
    grid-row: 1;
    min-height: calc(148px + (var(--tct-week-lanes, 0) * 43px));
    padding: 8px;
}

.tct-day--blank {
    background: #eee7dc;
}

.tct-day--today {
    background: #fff4cf;
    box-shadow: inset 0 0 0 2px #b7791f;
}

.tct-day--today h3 span {
    background: #f1d58a;
    color: #000 !important;
    font-weight: 800;
    -webkit-text-fill-color: #000;
}

.tct-day h3 {
    align-items: center;
    display: flex;
    font-size: 14px;
    justify-content: flex-end;
    line-height: 1;
    margin: 0 0 8px;
}

.tct-day h3 span {
    background: #f0e8dc;
    border-radius: 50%;
    display: inline-grid;
    height: 28px;
    place-items: center;
    width: 28px;
}

.tct-day-events {
    margin-top: calc(var(--tct-week-lanes, 0) * 43px);
}

.tct-mobile-multi-day-events {
    display: none;
}

.tct-event {
    background: var(--tct-event-bg);
    border-left: 4px solid var(--tct-event-color);
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px var(--tct-event-bg-hover);
    margin: 7px 0;
    position: relative;
}

.tct-event--multi-day {
    bottom: auto;
    border-left-width: 0;
    border-radius: 4px;
    left: calc(((var(--tct-start-col) - 1) * 100% / 7) + 5px);
    margin: 0;
    position: absolute;
    top: calc(42px + (var(--tct-lane) * 43px));
    width: calc((var(--tct-span) * 100% / 7) - 10px);
    z-index: 2;
}

.tct-event--multi-day .tct-event-trigger {
    align-items: center;
    display: flex;
    gap: 8px;
    min-height: 34px;
    overflow: hidden;
}

.tct-event--multi-day .tct-event-time {
    flex: 0 0 auto;
    margin: 0;
}

.tct-event--multi-day .tct-event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tct-event-trigger {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: block;
    padding: 7px;
    text-align: left;
    width: 100%;
}

.tct-event-trigger:hover,
.tct-event-trigger:focus {
    background: var(--tct-event-bg-hover);
    outline: 2px solid transparent;
}

.tct-event-time {
    color: #765439;
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 3px;
}

.tct-event-title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.tct-event-popup {
    background: #fff;
    border: 1px solid #cdbfae;
    border-top: 4px solid var(--tct-event-color);
    border-radius: 6px;
    box-shadow: 0 18px 40px rgba(31, 25, 18, 0.22);
    font-size: 13px;
    line-height: 1.45;
    max-width: min(360px, calc(100vw - 32px));
    opacity: 0;
    padding: 14px;
    pointer-events: none;
    position: fixed;
    transform: translateY(8px);
    transition: opacity 120ms ease, transform 120ms ease;
    width: 360px;
    z-index: 10000;
}

.tct-event-popup.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.tct-event-popup h4 {
    font-size: 17px;
    line-height: 1.25;
    margin: 0 28px 8px 0;
}

.tct-event-category {
    margin: 0 0 8px;
}

.tct-event-category span {
    background: var(--tct-event-bg-hover);
    border: 1px solid var(--tct-event-color);
    border-radius: 999px;
    color: #2f251c;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 5px 8px;
}

.tct-event-popup p {
    margin: 0 0 7px;
}

.tct-event-close {
    align-items: center;
    background: #f0e8dc;
    border: 1px solid #d9cabb;
    border-radius: 50%;
    color: #3f3123;
    cursor: pointer;
    display: inline-flex;
    font-size: 18px;
    height: 26px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: absolute;
    right: 10px;
    top: 10px;
    width: 26px;
}

.tct-event-link {
    align-items: center;
    display: inline-flex;
    gap: 5px;
}

.tct-event-link span {
    font-size: 13px;
    line-height: 1;
}

.tct-event-meta {
    color: #6d5b4a;
    font-weight: 700;
}

.tct-submit {
    background: #fff;
    border: 1px solid #ded5c8;
    border-radius: 6px;
    padding: 18px;
}

.tct-submit-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
}

.tct-submit-header h2 {
    margin: 0;
}

.tct-submit-panel {
    border-top: 1px solid #eadfce;
    margin-top: 16px;
    padding-top: 16px;
}

.tct-notice {
    border-radius: 4px;
    font-weight: 700;
    margin: 0 0 16px;
    padding: 10px 12px;
}

.tct-notice--ok {
    background: #e8f5ec;
    border: 1px solid #9bd3aa;
    color: #18562c;
}

.tct-notice--error {
    background: #fbeaea;
    border: 1px solid #e4a1a1;
    color: #7c1d1d;
}

.tct-submit-form {
    display: grid;
    gap: 14px;
}

.tct-submit-form label {
    display: grid;
    font-weight: 700;
    gap: 6px;
}

.tct-submit-form input,
.tct-submit-form select,
.tct-submit-form textarea {
    border: 1px solid #cabdac;
    border-radius: 4px;
    font: inherit;
    padding: 9px;
    width: 100%;
}

.tct-checkbox {
    align-items: center;
    display: flex !important;
    gap: 8px;
}

.tct-checkbox input {
    width: auto;
}

.tct-form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tct-submit-recurrence {
    background: #fbfaf8;
    border: 1px solid #eadfce;
    border-radius: 6px;
    padding: 14px;
}

.tct-recurrence-details summary {
    background: #f0e8dc;
    border: 1px solid #d9cabb;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    margin-bottom: 12px;
    padding: 9px 11px;
}

.tct-recurrence-fields,
.tct-recurrence-options {
    display: grid;
    gap: 12px;
}

.tct-recurrence-fields label {
    display: grid;
    font-weight: 700;
    gap: 6px;
}

.tct-recurrence-weekly {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.tct-recurrence-weekly > span {
    flex-basis: 100%;
    font-weight: 700;
}

.tct-recurrence-weekly label {
    align-items: center;
    display: inline-flex;
    gap: 5px;
}

.tct-recurrence-weekly input[type="checkbox"] {
    width: auto;
}

@media (max-width: 900px) {
    .tct-toolbar {
        display: grid;
        gap: 8px;
        grid-template-columns: 42px minmax(0, 1fr) 42px;
    }

    .tct-month-heading {
        min-width: 0;
    }

    .tct-toolbar h2 {
        font-size: clamp(17px, 5vw, 22px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tct-month-arrow {
        width: 42px;
    }

    .tct-weekdays,
    .tct-week {
        grid-template-columns: 1fr;
    }

    .tct-weekday,
    .tct-day--blank {
        display: none;
    }

    .tct-day {
        grid-column: 1 !important;
        grid-row: auto;
        min-height: 0;
    }

    .tct-day-events {
        margin-top: 0;
    }

    .tct-event--multi-day {
        display: none;
    }

    .tct-mobile-multi-day-events {
        display: block;
        margin-bottom: 7px;
    }

    .tct-event--mobile-multi-day {
        border-left-width: 0;
    }

    .tct-event--mobile-multi-day .tct-event-trigger {
        align-items: center;
        display: flex;
        gap: 8px;
    }

    .tct-form-grid {
        grid-template-columns: 1fr;
    }
}
