.sec-app {
    --sec-border: #e6e6e6;
    --sec-text: #1f2328;
    --sec-muted: #69707a;
    --sec-surface: #fff;
    --sec-soft: #f7f7f8;
    --sec-radius: 14px;
    color: var(--sec-text);
    font: inherit;
}

.sec-app * { box-sizing: border-box; }

.sec-calendar-card,
.sec-finder {
    background: var(--sec-surface);
    border: 1px solid var(--sec-border);
    border-radius: var(--sec-radius);
}

.sec-calendar-card { box-shadow: 0 1px 2px rgba(0, 0, 0, .03); }

.sec-toolbar {
    display: flex;
    justify-content: center;
    gap: 22px;
    align-items: center;
    padding: 18px;
    border-bottom: 1px solid var(--sec-border);
}

.sec-date-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sec-month-nav { width: min(100%, 420px); }

.sec-app .sec-btn,
.sec-app .sec-select,
.sec-app .sec-details-btn { font: inherit; }

.sec-app .sec-btn,
.sec-app .sec-select,
.sec-app .sec-details-btn {
    min-height: 40px;
    border: 1px solid #d8dadd;
    border-radius: 9px;
    background: #fff;
    color: var(--sec-text);
}

.sec-app .sec-btn,
.sec-app .sec-details-btn { cursor: pointer; }
.sec-app .sec-btn { padding: 0 13px; }
.sec-app .sec-btn:hover,
.sec-app .sec-details-btn:hover { background: #f3f4f5; }
.sec-app .sec-btn:disabled { opacity: .35; cursor: not-allowed; }
.sec-app .sec-icon-btn { width: 40px; min-width: 40px; padding: 0; font-size: 25px; line-height: 1; }
.sec-app .sec-select { max-width: 100%; padding: 0 34px 0 11px; }
.sec-app .sec-month-select {
    width: min(100%, 260px);
    min-width: 170px;
    padding-right: 34px;
    padding-left: 34px;
    text-align: center;
    text-align-last: center;
}

.sec-calendar-title {
    padding: 14px 16px 8px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
}

.sec-calendar-status {
    min-height: 27px;
    padding: 0 16px 8px;
    text-align: center;
    color: var(--sec-muted);
    font-size: 13px;
}
.sec-calendar-status:empty {
    min-height: 0;
    padding: 0;
}

.sec-calendar-status.is-error,
.sec-empty.is-error { color: #a12727; }
.sec-calendar-retry {
    margin-left: 6px;
    padding: 2px 7px;
    border: 1px solid #c9cbd0;
    border-radius: 6px;
    background: #fff;
    color: #31363c;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.sec-calendar-retry:hover { background: #f3f4f5; }
.sec-calendar-card .sec-calendar-scroll { transition: opacity .15s ease; }
.sec-calendar-card.is-loading .sec-calendar-scroll { opacity: .55; }
.sec-weekdays,
.sec-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.sec-days { display: block; }

.sec-weekday { text-align: center; }
.sec-day-head { display: flex; justify-content: flex-end; }
.sec-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* Hover details: intentionally light to match the click dialog and finder. */
.sec-tooltip {
    --sec-text: #1f2328;
    --sec-muted: #69707a;
    position: fixed;
    z-index: 999999;
    width: min(360px, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
    overflow: hidden;
    padding: 14px;
    border: 1px solid #dedfe2;
    border-radius: 12px;
    background: #fff;
    color: var(--sec-text);
    box-shadow: 0 14px 34px rgba(20, 24, 28, .18);
    pointer-events: none;
}
.sec-tooltip-top,
.sec-dialog-top,
.sec-upcoming-top { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.sec-tooltip-tcg,
.sec-dialog-tcg {
    --sec-event-color: #555;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .01em;
    color: #555e68;
}
.sec-tooltip-tcg::before,
.sec-dialog-tcg::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--sec-event-color);
}
.sec-tooltip-title { display: block; margin: 8px 0 3px; font-size: 15px; color: #17191c; }
.sec-tooltip-date { margin-bottom: 10px; color: var(--sec-muted); font-size: 12px; }
.sec-tooltip-details,
.sec-dialog-details { display: grid; gap: 6px; }
.sec-detail-row { display: grid; grid-template-columns: minmax(105px, .75fr) 1.25fr; gap: 10px; font-size: 12px; }
.sec-detail-label { color: var(--sec-muted); }
.sec-detail-value { font-weight: 600; color: var(--sec-text); }
.sec-tooltip-extra {
    margin: 10px 0 0;
    padding-top: 9px;
    border-top: 1px solid #e5e6e8;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
    color: #424950;
}
.sec-status-badge {
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .02em;
}
.sec-status-badge.is-cancelled { background: #7c2525; color: #fff; }

/* Finder: deliberately quieter and denser than the main calendar. */
.sec-finder {
    margin-top: 18px;
    padding: 16px 18px 18px;
    box-shadow: none;
    border-color: #e9e9ea;
}
.sec-finder-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ededee;
}
.sec-finder-head h3 {
    margin: 0 0 3px;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.012em;
}
.sec-finder-head p { margin: 0; color: var(--sec-muted); font-size: 13px; line-height: 1.4; }
.sec-finder-control { min-width: 250px; }
.sec-app .sec-finder-control .sec-select { width: 100%; }
.sec-upcoming { display: grid; gap: 8px; padding-top: 12px; }
.sec-empty,
.sec-loading {
    padding: 16px;
    border: 1px dashed #d7d9dc;
    border-radius: 9px;
    background: #fafafa;
    color: var(--sec-muted);
    text-align: center;
    font-size: 13px;
}
.sec-upcoming-card {
    --sec-event-color: #555;
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    padding: 11px 12px 11px 10px;
    border: 1px solid #e5e6e8;
    border-left: 4px solid var(--sec-event-color);
    border-radius: 9px;
    background: #fff;
}
.sec-upcoming-card.is-cancelled { opacity: .70; }
.sec-upcoming-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-right: 11px;
    border-right: 1px solid var(--sec-border);
    text-transform: uppercase;
}
.sec-upcoming-day { font-size: 23px; font-weight: 800; line-height: 1; }
.sec-upcoming-month { margin-top: 3px; color: var(--sec-muted); font-size: 10px; font-weight: 800; }
.sec-upcoming-tcg {
    color: #616973;
    font-size: 10.5px;
    font-weight: 750;
    line-height: 1.25;
    letter-spacing: .005em;
}
.sec-upcoming-title { margin: 3px 0; font-size: 15px; line-height: 1.25; }
.sec-upcoming-meta,
.sec-upcoming-extras { color: var(--sec-muted); font-size: 11.5px; line-height: 1.4; }
.sec-upcoming-extras { margin-top: 3px; }
.sec-upcoming-actions { display: flex; align-items: center; justify-content: flex-end; }
.sec-app .sec-details-btn { min-height: 38px; padding: 0 13px; font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; }

.sec-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(20, 24, 28, .42);
}
.sec-dialog-backdrop[hidden] { display: none; }
.sec-dialog {
    position: relative;
    width: min(580px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    overflow: hidden;
    overscroll-behavior: contain;
    padding: 0;
    border: 1px solid #dedfe2;
    border-radius: 14px;
    background: #fff;
    color: var(--sec-text);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .24);
}
.sec-dialog-title { margin: 12px 0 5px; font-size: 24px; line-height: 1.2; color: #17191c; }
.sec-dialog-date { margin-bottom: 18px; color: var(--sec-muted); }
.sec-dialog-details { padding: 15px; border: 1px solid #ececee; border-radius: 10px; background: #f8f8f9; gap: 9px; }
.sec-dialog .sec-detail-row { font-size: 14px; }
.sec-dialog-extra { margin-top: 18px; }
.sec-dialog-extra-label {
    color: var(--sec-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .01em;
}
.sec-dialog-extra p { margin: 6px 0 0; line-height: 1.55; white-space: pre-wrap; color: #333a41; }
.sec-day-dialog-list { display: grid; gap: 8px; margin-top: 18px; }
.sec-day-dialog-event {
    --sec-event-color: #555;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--sec-border);
    border-left: 4px solid var(--sec-event-color);
    border-radius: 8px;
    background: #fff;
    color: var(--sec-text);
    text-align: left;
    cursor: pointer;
}
.sec-day-dialog-event:hover { background: #f8f8f9; }
.sec-day-dialog-time { font-weight: 800; }
.sec-day-dialog-name { font-weight: 650; }
.sec-app .screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.sec-load-more {
    justify-self: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid #d8dadd;
    border-radius: 9px;
    background: #fff;
    color: var(--sec-text);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.sec-load-more:hover { background: #f3f4f5; }
.sec-loading-more { padding: 12px; }

.sec-app .sec-btn:focus-visible,
.sec-app .sec-select:focus-visible,
.sec-app .sec-details-btn:focus-visible,
.sec-app .sec-dialog-close:focus-visible,
.sec-app .sec-day-dialog-event:focus-visible,
.sec-app .sec-load-more:focus-visible,
.sec-calendar-retry:focus-visible {
    outline: 2px solid #24292f;
    outline-offset: 2px;
}

.sec-app button,
.sec-app select,
.sec-app input { -webkit-appearance: auto; appearance: auto; }
.sec-app button { touch-action: manipulation; }
.sec-app .sec-btn,
.sec-app .sec-details-btn,
.sec-app .sec-dialog-close,
.sec-app .sec-day-dialog-event { -webkit-tap-highlight-color: transparent; }

@media (max-width: 900px) {
    .sec-app .sec-month-select { width: 100%; min-width: 0; }
    .sec-finder-head { align-items: stretch; flex-direction: column; gap: 10px; }
    .sec-finder-control { width: 100%; min-width: 0; }
    .sec-upcoming-card { grid-template-columns: 62px minmax(0, 1fr) auto; }
}

@media (max-width: 600px) {
    .sec-month-nav { width: 100%; }
    .sec-app .sec-month-select { flex: 1; width: auto; }
    .sec-tooltip { display: none; }
}

/* =========================================================
   RESPONSIVE BASE
   ========================================================= */
.sec-app,
.sec-calendar-card,
.sec-finder,
.sec-toolbar,
.sec-date-nav,
.sec-upcoming-body,
.sec-dialog-scroll {
    min-width: 0;
}

.sec-upcoming-tcg,
.sec-upcoming-title,
.sec-upcoming-meta,
.sec-upcoming-extras,
.sec-detail-value,
.sec-dialog-title,
.sec-dialog-extra p,
.sec-day-dialog-name {
    overflow-wrap: anywhere;
    word-break: normal;
}

/* The dialog shell stays fixed while only its content area scrolls. */
.sec-dialog-scroll {
    max-height: min(760px, calc(100vh - 40px));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 24px;
}

html.sec-dialog-open,
body.sec-dialog-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

/* Do not emulate hover UI on touch-first devices. */
@media (hover: none), (pointer: coarse) {
    .sec-tooltip { display: none !important; }
}

@media (max-width: 600px) {
    .sec-app { --sec-radius: 12px; }

    .sec-calendar-card,
    .sec-finder { border-radius: 12px; }

    .sec-toolbar { padding: 12px 10px; }

    .sec-date-nav { gap: 6px; }

    /* 44px touch targets and 16px selects prevent accidental taps / iOS zoom. */
    .sec-app .sec-btn,
    .sec-app .sec-select,
    .sec-app .sec-details-btn,
    .sec-load-more {
        min-height: 44px;
    }
    .sec-app .sec-select { font-size: 16px; }
    .sec-app .sec-icon-btn {
        width: 44px;
        min-width: 44px;
        height: 44px;
        font-size: 26px;
    }

    .sec-calendar-title {
        padding: 11px 12px 5px;
        font-size: 18px;
        line-height: 1.25;
    }

    .sec-finder {
        margin-top: 14px;
        padding: 12px;
    }
    .sec-finder-head {
        gap: 8px;
        padding-bottom: 10px;
    }
    .sec-finder-head h3 {
        font-size: 18px;
        letter-spacing: -.01em;
    }
    .sec-finder-head p {
        font-size: 12.5px;
        line-height: 1.35;
    }
    .sec-upcoming {
        gap: 7px;
        padding-top: 10px;
    }
    .sec-upcoming-card {
        grid-template-columns: 50px minmax(0, 1fr);
        gap: 9px;
        padding: 10px 9px;
        border-left-width: 3px;
    }
    .sec-upcoming-date {
        align-self: stretch;
        padding-right: 8px;
    }
    .sec-upcoming-day { font-size: 21px; }
    .sec-upcoming-month { font-size: 10px; }
    .sec-upcoming-tcg { font-size: 11px; }
    .sec-upcoming-title {
        margin: 3px 0;
        font-size: 15px;
    }
    .sec-upcoming-meta,
    .sec-upcoming-extras {
        font-size: 12px;
        line-height: 1.4;
    }
    .sec-upcoming-actions {
        grid-column: 2;
        justify-content: flex-start;
        padding-left: 0;
        margin-top: 2px;
    }
    .sec-app .sec-details-btn {
        width: min(180px, 100%);
        min-height: 44px;
        padding: 0 14px;
        font-size: 12.5px;
    }

    .sec-dialog-backdrop {
        align-items: flex-end;
        min-height: 100dvh;
        padding: env(safe-area-inset-top, 0px) 0 0;
    }
    .sec-dialog {
        width: 100%;
        max-height: 92dvh;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 16px 16px 0 0;
    }
    .sec-dialog-scroll {
        max-height: 92dvh;
        padding: 22px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    }
    .sec-dialog-title {
        margin: 9px 0 5px;
        padding-right: 4px;
        font-size: 20px;
        line-height: 1.22;
    }
    .sec-dialog-date {
        margin-bottom: 14px;
        font-size: 13px;
        line-height: 1.4;
    }
    .sec-dialog-details {
        padding: 12px;
        gap: 9px;
    }
    .sec-dialog .sec-detail-row {
        grid-template-columns: 1fr;
        gap: 2px;
        font-size: 13px;
    }
    .sec-detail-label { font-size: 12px; }
    .sec-detail-value { font-size: 13.5px; }
    .sec-dialog-extra { margin-top: 14px; }
    .sec-dialog-extra p {
        font-size: 14px;
        line-height: 1.5;
    }

    .sec-day-dialog-list { gap: 7px; margin-top: 14px; }
    .sec-day-dialog-event {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 8px;
        min-height: 48px;
        padding: 10px;
    }
    .sec-day-dialog-event .sec-status-badge {
        grid-column: 2;
        justify-self: start;
    }

    .sec-empty,
    .sec-loading {
        padding: 14px 12px;
        font-size: 12.5px;
    }
    .sec-load-more { width: 100%; font-size: 13px; }
}

@media (max-width: 360px) {
    .sec-toolbar { padding-inline: 8px; }
    .sec-date-nav { gap: 4px; }
    .sec-app .sec-icon-btn {
        width: 42px;
        min-width: 42px;
    }
    .sec-app .sec-month-select {
        min-width: 0;
        padding-left: 28px;
        padding-right: 28px;
    }
}

/* =========================================================
   UNIFIED CALENDAR PRESENTATION
   One visual language from desktop through tablet to mobile.
   Breakpoints may change spacing, but never the calendar state styling.
   ========================================================= */

/* Calendar shell / navigation use the same warm neutral palette everywhere. */
.sec-app.sec-unified-calendar .sec-calendar-card {
    overflow: hidden;
    border-color: #e7e1d7;
    background: #fbfaf4;
    box-shadow: none;
}

.sec-app.sec-unified-calendar .sec-toolbar,
.sec-app.sec-unified-calendar .sec-calendar-title,
.sec-app.sec-unified-calendar .sec-calendar-status,
.sec-app.sec-unified-calendar .sec-calendar-scroll {
    background: #fbfaf4;
}

.sec-app.sec-unified-calendar .sec-toolbar {
    border-bottom-color: #ebe5db;
}

.sec-app.sec-unified-calendar .sec-btn,
.sec-app.sec-unified-calendar .sec-select {
    border-color: #ddd7cd;
    background: #fffefa;
    color: #242621;
}

.sec-app.sec-unified-calendar .sec-btn:hover {
    background: #f5f1e8;
}

.sec-app.sec-unified-calendar .sec-calendar-title {
    color: #20231f;
    letter-spacing: -.025em;
}

/* There is never a horizontally-scrolling alternate calendar anymore. */
.sec-app.sec-unified-calendar .sec-calendar-scroll {
    overflow-x: hidden !important;
    touch-action: pan-y;
    scrollbar-gutter: auto;
}

.sec-app.sec-unified-calendar .sec-calendar {
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
}

.sec-app.sec-unified-calendar .sec-weekdays,
.sec-app.sec-unified-calendar .sec-week {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: clamp(2px, .38vw, 6px);
}

.sec-app.sec-unified-calendar .sec-calendar-scroll {
    padding: 0 clamp(5px, .8vw, 12px) clamp(8px, 1vw, 14px);
}

.sec-app.sec-unified-calendar .sec-weekdays {
    margin-bottom: clamp(2px, .38vw, 6px);
}

.sec-app.sec-unified-calendar .sec-week {
    margin-bottom: clamp(2px, .38vw, 6px);
}

.sec-app.sec-unified-calendar .sec-week:last-child {
    margin-bottom: 0;
}

.sec-app.sec-unified-calendar .sec-weekday {
    min-width: 0;
    padding: clamp(7px, .7vw, 11px) 1px;
    border: 0;
    background: transparent;
    color: #75736e;
    font-size: clamp(10px, .85vw, 12px);
    font-weight: 700;
    line-height: 1.1;
}

/* Fluid cell height avoids a visual jump at tablet/mobile breakpoints. */
.sec-app.sec-unified-calendar .sec-day {
    position: relative;
    min-width: 0;
    min-height: 0;
    height: clamp(60px, 10vw, 128px);
    aspect-ratio: auto;
    overflow: hidden;
    padding: clamp(2px, .35vw, 5px);
    border: 2px solid transparent;
    border-radius: 3px;
    background: #f3f0e8;
    color: #20231f;
}

.sec-app.sec-unified-calendar .sec-day.is-outside {
    background: #f8f6f0;
    color: #aaa69f;
    opacity: .62;
}

.sec-app.sec-unified-calendar .sec-day-head {
    position: relative;
    z-index: 3;
    min-height: clamp(18px, 2vw, 27px);
    justify-content: flex-end;
    pointer-events: none;
}

.sec-app.sec-unified-calendar .sec-day-number {
    width: auto;
    height: auto;
    min-width: 18px;
    padding: 1px 2px 0 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-size: clamp(10px, .9vw, 13px);
    font-weight: 750;
    line-height: 1.1;
    box-shadow: none;
}

/*
 * Event days use a clean top accent bar rather than a full colored perimeter.
 * This keeps the calendar neutral while preserving quick category recognition.
 */
.sec-app.sec-unified-calendar .sec-day.has-events:not(.is-today) {
    border-color: transparent;
}

.sec-app.sec-unified-calendar .sec-day.has-events::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 5;
    height: 3px;
    pointer-events: none;
}

.sec-app.sec-unified-calendar .sec-day.has-events.sec-event-colors-1::before {
    background: var(--sec-event-border-1, #666);
}

.sec-app.sec-unified-calendar .sec-day.has-events.sec-event-colors-2::before {
    background: linear-gradient(
        to right,
        var(--sec-event-border-1, #666) 0 50%,
        var(--sec-event-border-2, #888) 50% 100%
    );
}

.sec-app.sec-unified-calendar .sec-day.has-events.sec-event-colors-3::before {
    background: linear-gradient(
        to right,
        var(--sec-event-border-1, #666) 0 33.333%,
        var(--sec-event-border-2, #888) 33.333% 66.666%,
        var(--sec-event-border-3, #aaa) 66.666% 100%
    );
}

.sec-app.sec-unified-calendar .sec-day.has-events.sec-event-colors-4::before {
    background: linear-gradient(
        to right,
        var(--sec-event-border-1, #666) 0 25%,
        var(--sec-event-border-2, #888) 25% 50%,
        var(--sec-event-border-3, #aaa) 50% 75%,
        var(--sec-event-border-4, #bbb) 75% 100%
    );
}

/* Today has absolute visual priority, even if one or many events occur today. */
.sec-app.sec-unified-calendar .sec-day.is-today,
.sec-app.sec-unified-calendar .sec-day.is-today.has-events {
    z-index: 4;
    border: 3px solid #d7a64a !important;
    background: #f7f2e6 !important;
    box-shadow:
        0 0 0 1px rgba(215, 166, 74, .22),
        0 0 14px rgba(215, 166, 74, .28);
}

.sec-app.sec-unified-calendar .sec-day.is-today.has-events::before {
    height: 3px;
    background: #d7a64a !important;
}

.sec-app.sec-unified-calendar .sec-day.is-today .sec-day-number {
    background: transparent;
    color: #7d5813;
    box-shadow: none;
}

/* One semantic event button per date. Its internal rows scale fluidly. */
.sec-app.sec-unified-calendar .sec-day-events {
    position: absolute;
    inset: clamp(20px, 2.5vw, 31px) 3px 3px;
    z-index: 2;
    display: flex !important;
    width: auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: clamp(2px, .35vw, 5px);
    align-items: stretch;
    justify-content: center;
    border: 0 !important;
    border-radius: 2px;
    background: transparent !important;
    color: #292b29;
    font: inherit;
    text-align: center;
    cursor: pointer;
    touch-action: manipulation;
}

.sec-app.sec-unified-calendar .sec-day-events:hover {
    background: transparent !important;
    color: inherit;
}

.sec-app.sec-unified-calendar .sec-day-events:focus-visible {
    outline: 2px solid #252827;
    outline-offset: -2px;
}

.sec-app.sec-unified-calendar .sec-day.is-outside .sec-day-events {
    opacity: .6;
}

.sec-app.sec-unified-calendar .sec-day-events.is-single {
    inset: calc(clamp(18px, 2vw, 27px) + clamp(2px, .35vw, 5px)) 3px 3px;
}

.sec-app.sec-unified-calendar .sec-cell-event-list {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: clamp(2px, .3vw, 5px);
    overflow: hidden;
}

.sec-app.sec-unified-calendar .sec-cell-event-row {
    display: flex;
    min-width: 0;
    min-height: 0;
    align-items: center;
    gap: clamp(3px, .45vw, 7px);
    color: #282b28;
}

.sec-app.sec-unified-calendar .sec-day-events.is-single .sec-cell-event-row {
    display: grid;
    height: 100%;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: stretch;
    justify-items: center;
    gap: clamp(1px, .2vw, 3px);
}

.sec-app.sec-unified-calendar .sec-day-events.is-multi .sec-cell-event-row {
    flex: 1 1 0;
    padding-left: clamp(3px, .35vw, 6px);
    border-left: 2px solid var(--sec-event-color, #666);
    text-align: left;
}

.sec-app.sec-unified-calendar .sec-cell-event-logo {
    display: block;
    width: min(72%, 78px);
    height: auto;
    max-height: 42px;
    max-width: calc(100% - 4px);
    flex: 0 0 auto;
    object-fit: contain;
    object-position: center;
}

.sec-app.sec-unified-calendar .sec-day-events.is-single .sec-cell-event-logo-slot {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sec-app.sec-unified-calendar .sec-day-events.is-single .sec-cell-event-logo {
    width: min(82%, 96px);
    height: 100%;
    max-width: calc(100% - 4px);
    max-height: 52px;
}

.sec-app.sec-unified-calendar .sec-day-events.is-multi .sec-cell-event-logo {
    width: min(34%, 46px);
    height: auto;
    max-height: 24px;
    max-width: 42%;
}

.sec-app.sec-unified-calendar .sec-cell-event-logo-fallback {
    display: inline-flex;
    min-width: clamp(20px, 2.8vw, 38px);
    height: clamp(20px, 2.8vw, 38px);
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    color: var(--sec-event-color, #555);
    font-size: clamp(7px, .7vw, 10px);
    font-weight: 850;
    line-height: 1;
}

.sec-app.sec-unified-calendar .sec-day-events.is-multi .sec-cell-event-logo-fallback {
    min-width: clamp(14px, 1.65vw, 24px);
    height: clamp(14px, 1.65vw, 24px);
}

.sec-app.sec-unified-calendar .sec-cell-event-copy {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    overflow: hidden;
}

.sec-app.sec-unified-calendar .sec-day-events.is-single .sec-cell-event-copy {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    gap: 1px;
    overflow: visible;
}

.sec-app.sec-unified-calendar .sec-cell-event-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: #272a27;
    font-size: clamp(8px, .95vw, 12.5px);
    font-weight: 780;
    line-height: 1.08;
    letter-spacing: -.018em;
    overflow-wrap: anywhere;
}

.sec-app.sec-unified-calendar .sec-day-events.is-single .sec-cell-event-title {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    -webkit-line-clamp: unset;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-wrap: normal;
}

.sec-app.sec-unified-calendar .sec-day-events.is-single .sec-cell-event-title.uses-short-title {
    letter-spacing: -.01em;
}

.sec-app.sec-unified-calendar .sec-day-events.is-multi .sec-cell-event-title {
    -webkit-line-clamp: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sec-app.sec-unified-calendar .sec-cell-event-time {
    color: #77736d;
    font-size: clamp(7px, .72vw, 10px);
    font-weight: 700;
    line-height: 1;
}

.sec-app.sec-unified-calendar .sec-cell-event-row.is-cancelled {
    opacity: .52;
    text-decoration: line-through;
}

.sec-app.sec-unified-calendar .sec-cell-event-more {
    display: block;
    color: #77736d;
    font-size: clamp(7px, .72vw, 10px);
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

/* Tablet changes layout density only; it does not switch visual systems. */
@media (max-width: 900px) {
    .sec-app.sec-unified-calendar .sec-toolbar {
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .sec-app.sec-unified-calendar .sec-calendar-scroll {
        padding-inline: 5px;
    }

    .sec-app.sec-unified-calendar .sec-weekdays,
    .sec-app.sec-unified-calendar .sec-week {
        gap: 3px;
    }

    .sec-app.sec-unified-calendar .sec-weekday {
        padding-block: 7px;
    }

    .sec-app.sec-unified-calendar .sec-day {
        height: clamp(58px, 15vw, 72px);
        padding: 2px;
    }

    .sec-app.sec-unified-calendar .sec-day-events {
        inset: 20px 1px 1px;
        padding: 2px 1px;
    }

    .sec-app.sec-unified-calendar .sec-day-events.is-single {
        inset: 20px 1px 1px;
        padding: 1px;
    }

    .sec-app.sec-unified-calendar .sec-day-events.is-single .sec-cell-event-logo {
        width: min(86%, 44px);
        max-width: calc(100% - 2px);
        height: 100%;
        max-height: 22px;
    }

    .sec-app.sec-unified-calendar .sec-day-events.is-single .sec-cell-event-logo-fallback {
        width: 17px;
        min-width: 17px;
        height: 17px;
    }

    .sec-app.sec-unified-calendar .sec-day-events.is-multi .sec-cell-event-logo {
        width: 18px;
        max-width: 42%;
        height: auto;
        max-height: 12px;
    }

    .sec-app.sec-unified-calendar .sec-day-events.is-multi .sec-cell-event-logo-fallback {
        width: 12px;
        min-width: 12px;
        height: 12px;
    }

    .sec-app.sec-unified-calendar .sec-cell-event-row {
        gap: 2px;
    }

    .sec-app.sec-unified-calendar .sec-day-events.is-multi .sec-cell-event-row {
        padding-left: 2px;
        border-left-width: 1.5px;
    }

    .sec-app.sec-unified-calendar .sec-cell-event-title {
        font-size: clamp(7px, 2vw, 9px);
    }

    .sec-app.sec-unified-calendar .sec-cell-event-time,
    .sec-app.sec-unified-calendar .sec-cell-event-more {
        font-size: clamp(6.5px, 1.75vw, 8px);
    }

    .sec-app.sec-unified-calendar .sec-day-events.is-multi .sec-cell-event-time {
        display: none;
    }
}

@media (max-width: 360px) {
    .sec-app.sec-unified-calendar .sec-weekdays,
    .sec-app.sec-unified-calendar .sec-week {
        gap: 2px;
    }

    .sec-app.sec-unified-calendar .sec-day {
        height: 56px;
    }

    .sec-app.sec-unified-calendar .sec-day-number {
        font-size: 9.5px;
    }
}


.sec-app.sec-unified-calendar .sec-day.is-outside.has-events:not(.is-today) {
    opacity: .68;
}

/* =========================================================
   DIALOG NAVIGATION
   The day-list screen has only the close control. A back control appears
   only after drilling into one event from a multi-event day.
   ========================================================= */
.sec-app .sec-dialog {
    position: relative;
    overflow: hidden;
}

.sec-app .sec-dialog-nav-rail {
    position: absolute !important;
    top: 10px !important;
    right: 16px !important;
    left: 16px !important;
    z-index: 40 !important;
    height: 46px;
    pointer-events: none;
}

.sec-app .sec-dialog .sec-dialog-back,
.sec-app .sec-dialog .sec-dialog-close {
    position: absolute !important;
    top: 0 !important;
    display: inline-flex !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #e0e1e3 !important;
    border-radius: 50% !important;
    background: #fff !important;
    color: #30363d !important;
    box-shadow: 0 3px 12px rgba(20, 24, 28, .11) !important;
    font: inherit !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    transform: none !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    touch-action: manipulation;
}

.sec-app .sec-dialog .sec-dialog-back {
    left: 0 !important;
    right: auto !important;
    font-size: 22px !important;
}

.sec-app .sec-dialog .sec-dialog-back[hidden] {
    display: none !important;
}

.sec-app .sec-dialog .sec-dialog-close {
    right: 0 !important;
    left: auto !important;
    font-size: 28px !important;
    font-weight: 400 !important;
}

.sec-app .sec-dialog .sec-dialog-back:hover,
.sec-app .sec-dialog .sec-dialog-close:hover {
    background: #f1f2f3 !important;
}

.sec-app .sec-dialog .sec-dialog-back:focus-visible,
.sec-app .sec-dialog .sec-dialog-close:focus-visible {
    outline: 2px solid #24292f !important;
    outline-offset: 2px !important;
}

/* Reserve a stable top band for the controls so titles never overlap them. */
.sec-app .sec-dialog-scroll {
    padding-top: 60px !important;
}

.sec-app .sec-dialog-top {
    min-height: 0 !important;
    padding-right: 0 !important;
}

/* Controls now live inside the dialog rather than floating above it. */
.sec-app .sec-dialog-backdrop {
    padding-top: 20px;
}

@media (max-width: 600px) {
    .sec-app .sec-dialog-backdrop {
        padding: env(safe-area-inset-top, 0px) 0 0;
    }

    .sec-app .sec-dialog-nav-rail {
        top: 8px !important;
        right: 12px !important;
        left: 12px !important;
    }

    .sec-app .sec-dialog-scroll {
        padding-top: 56px !important;
        padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    }
}


/* Finder total-limit notice. */
.sec-app .sec-upcoming-limit-note {
    padding: 10px 12px;
    border: 1px solid #e7e1d7;
    border-radius: 9px;
    background: #fbfaf4;
    color: var(--sec-muted);
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}


.sec-dialog-images {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
}
.sec-dialog-image {
    width: 112px;
    height: 112px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    flex: 0 0 auto;
}
.sec-dialog-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.sec-dialog-images-2 .sec-dialog-image {
    width: min(38vw, 132px);
    height: min(38vw, 132px);
}
@media (max-width: 600px) {
    .sec-dialog-images {
        gap: 10px;
        margin: 0 0 12px;
    }
    .sec-dialog-image {
        width: 96px;
        height: 96px;
    }
    .sec-dialog-images-2 .sec-dialog-image {
        width: min(32vw, 108px);
        height: min(32vw, 108px);
    }
}
@media (max-width: 420px) {
    .sec-dialog-images {
        gap: 8px;
    }
    .sec-dialog-image {
        width: 88px;
        height: 88px;
    }
    .sec-dialog-images-2 .sec-dialog-image {
        width: min(31vw, 96px);
        height: min(31vw, 96px);
    }
}
