.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 {
    background: #e9e0d4;
    border: 1px solid #d3c5b4;
    border-radius: 5px;
    display: block;
    margin: 0;
    padding: 0;
    position: relative;
}

.tct-view-switch,
.tct-filters,
.tct-calendar-subscribe {
    box-sizing: border-box;
    height: 38px;
}

.tct-filters summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-weight: 800;
    gap: 8px;
    list-style: none;
    color: #4a3b2d;
    font-size: 13px;
    line-height: 1;
    height: 36px;
    padding: 0 13px;
}

.tct-filters summary::-webkit-details-marker {
    display: none;
}

.tct-filters summary::after {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    content: "";
    height: 7px;
    margin-left: 4px;
    transform: rotate(45deg) translateY(-2px);
    width: 7px;
}

.tct-filters[open] summary::after {
    transform: rotate(225deg) translate(-2px, -1px);
}

.tct-filter-count {
    background: #8a4f1d;
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    min-width: 20px;
    padding: 4px 6px;
    text-align: center;
}

.tct-filter-form {
    background: #fff;
    border: 1px solid #d3c5b4;
    border-radius: 6px;
    border-top: 1px solid #ded5c8;
    box-shadow: 0 16px 35px rgba(31, 25, 18, .18);
    display: grid;
    gap: 18px;
    left: 0;
    min-width: min(620px, calc(100vw - 38px));
    max-height: min(70vh, 620px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px;
    position: absolute;
    top: calc(100% + 7px);
    z-index: 100;
}

.tct-filter-form fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

.tct-filter-form legend {
    font-weight: 800;
    margin-bottom: 9px;
}

.tct-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 18px;
}

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

.tct-filter-color {
    background: var(--tct-filter-color);
    border-radius: 50%;
    height: 9px;
    width: 9px;
}

.tct-filter-form .tct-button {
    justify-self: start;
}

.tct-filter-buttons {
    align-items: center;
    display: flex;
    gap: 10px;
}

.tct-clear-filters {
    border: 1px solid #c8b8a6;
    border-radius: 4px;
    color: #5b4028;
    font-size: 13px;
    font-weight: 800;
    padding: 11px 13px;
    text-decoration: none;
}

.tct-view-actions {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: flex-start;
    margin: -4px 0 16px;
    position: relative;
}

.tct-view-switch {
    background: #e9e0d4;
    border: 1px solid #d3c5b4;
    border-radius: 5px;
    display: inline-flex;
    padding: 3px;
}

.tct-view-switch a {
    align-items: center;
    border-radius: 3px;
    color: #4a3b2d;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    height: 30px;
    padding: 0 13px;
    text-decoration: none;
}

.tct-view-switch a.is-active {
    background: #3f3123;
    color: #fff;
}

.tct-calendar-subscribe {
    align-items: center;
    background: #3f3123;
    border: 1px solid #3f3123;
    border-radius: 4px;
    color: #fff;
    display: inline-flex;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    font-weight: 800;
    gap: 8px;
    line-height: 1;
    padding: 0 13px;
    text-decoration: none;
}

.tct-view-actions .tct-calendar-subscribe {
    margin-left: auto;
}

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

.tct-calendar-subscribe svg {
    flex: 0 0 auto;
}

.tct-subscribe-dialog {
    background: #fff;
    border: 1px solid #cdbfae;
    border-radius: 8px;
    box-shadow: 0 22px 55px rgba(31, 25, 18, .28);
    color: #251f18;
    max-height: calc(100dvh - 32px);
    max-width: min(620px, calc(100vw - 32px));
    overflow-y: auto;
    padding: 24px;
    width: 620px;
}

.tct-subscribe-dialog::backdrop {
    background: rgba(25, 20, 15, .62);
}

.tct-subscribe-dialog h2 {
    font-size: 24px;
    margin: 0 34px 8px 0;
}

.tct-subscribe-dialog > p {
    margin: 0 0 20px;
}

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

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

.tct-subscribe-options section {
    background: #faf8f4;
    border: 1px solid #e3d9cc;
    border-radius: 6px;
    padding: 16px;
}

.tct-subscribe-options h3 {
    font-size: 17px;
    margin: 0 0 7px;
}

.tct-subscribe-options p {
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 14px;
}

.tct-copy-status {
    color: #276338;
    display: inline-block;
    font-size: 13px;
    font-weight: 800;
    margin-left: 8px;
}

.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-list {
    margin-bottom: 34px;
}

.tct-list-day {
    align-items: stretch;
    display: grid;
    gap: 12px;
    grid-template-columns: 58px minmax(0, 1fr);
    margin-bottom: 12px;
}

.tct-list-date {
    align-items: center;
    color: #71563b;
    display: flex;
    flex-direction: column;
    padding-top: 7px;
}

.tct-list-date span {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
}

.tct-list-date strong {
    font-size: 28px;
    line-height: 1.1;
}

.tct-list-day--today .tct-list-date {
    background: #f1d58a;
    border-radius: 5px;
    color: #2c2117;
    padding-bottom: 7px;
}

.tct-list-events {
    display: grid;
    gap: 7px;
}

.tct-event--list {
    margin: 0;
}

.tct-event--list .tct-event-trigger {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(74px, auto) minmax(0, 1fr);
    min-height: 46px;
    padding: 9px 12px;
}

.tct-event--list .tct-event-time {
    margin: 0;
}

.tct-event--list .tct-event-title {
    font-size: 14px;
}

.tct-list-empty {
    background: #fff;
    border: 1px solid #ded5c8;
    border-radius: 6px;
    padding: 20px;
}

.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--popup-open {
    z-index: 10001;
}

.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-view-actions {
        align-items: center;
        flex-wrap: wrap;
    }

    .tct-view-switch {
        align-self: flex-start;
    }

    .tct-view-actions .tct-calendar-subscribe {
        margin-left: 0;
    }

    .tct-filters {
        position: static;
    }

    .tct-filter-form {
        left: 0;
        min-width: 0;
        right: 0;
    }

    .tct-filter-options {
        display: grid;
        gap: 4px 14px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tct-filter-options label {
        min-height: 38px;
    }

    .tct-list-day {
        gap: 8px;
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .tct-event--list .tct-event-trigger {
        align-items: start;
        gap: 2px;
        grid-template-columns: 1fr;
    }

    .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;
    }
}

@media (max-width: 600px) {
    .tct-page {
        padding: 22px 0 40px;
    }

    .tct-container {
        padding: 0 12px;
    }

    .tct-header h1 {
        font-size: clamp(27px, 9vw, 34px);
    }

    .tct-intro {
        font-size: 15px;
        line-height: 1.5;
    }

    .tct-toolbar {
        padding: 10px;
    }

    .tct-view-actions {
        gap: 8px;
    }

    .tct-view-switch a,
    .tct-filters summary {
        padding: 0 11px;
    }

    .tct-view-switch,
    .tct-filters,
    .tct-calendar-subscribe {
        height: 42px;
    }

    .tct-view-switch a {
        height: 34px;
    }

    .tct-filters summary {
        height: 40px;
    }

    .tct-calendar-subscribe {
        justify-content: center;
    }

    .tct-clear-filters {
        align-items: center;
        display: inline-flex;
        min-height: 42px;
    }

    .tct-filter-form {
        max-height: min(68vh, 540px);
        padding: 14px;
    }

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

    .tct-list-day {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .tct-list-date strong {
        font-size: 24px;
    }

    .tct-event-popup {
        left: 12px !important;
        max-height: calc(100dvh - 24px);
        max-width: none;
        overflow-y: auto;
        right: 12px;
        top: 50% !important;
        transform: translateY(calc(-50% + 8px));
        width: auto;
    }

    .tct-event-popup.is-open {
        transform: translateY(-50%);
    }

    .tct-submit {
        padding: 14px;
    }

    .tct-subscribe-dialog {
        max-height: calc(100dvh - 24px);
        max-width: calc(100vw - 24px);
        padding: 20px 16px 16px;
    }

    .tct-subscribe-dialog h2 {
        font-size: 21px;
    }

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

    .tct-submit-header {
        align-items: stretch;
        flex-direction: column;
    }
}
