.client-schedule {
    /* Brand colors measured from the live Swimplify site. */
    --swim-navy: #1a597c;
    --swim-teal: #109c9d;
    --swim-sky: #4fc3f4;
    --swim-pale: #c1eeff;
    /* Quiet surfaces and borders derived from those colors for dense schedule UI. */
    --swim-surface: #f0fbff;
    --swim-border: rgb(26 89 124 / 20%);
    /* Card dimensions adjusted together during schedule styling. */
    --schedule-card-padding: 0.5rem;
    --schedule-card-padding-left: 0.75rem;
    --schedule-badge-padding-inline: 0.4rem;
    --schedule-badge-min-size: 0.5rem;
    --schedule-badge-max-size: 0.7rem;
    --schedule-wrapped-gap: 0.4rem;

    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    padding: clamp(1rem, 2vw, 2rem);
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    line-height: 1.5;
    color: var(--swim-navy);
    background-color: var(--swim-pale);
}

.client-schedule *,
.client-schedule *::before,
.client-schedule *::after {
    box-sizing: border-box;
}

.client-schedule h1,
.client-schedule h2 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--swim-navy);
}

.client-schedule .schedule-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 0.75rem;
    background: var(--swim-navy);
}

.client-schedule .schedule-brand img {
    display: block;
    width: min(100%, 20rem);
    height: auto;
}

.client-schedule>h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    line-height: 1.2;
}

.client-schedule>p {
    margin: 0 0 1.5rem;
}

.client-schedule #schedule+p {
    margin-top: 1.5rem;
}

.client-schedule a:not(.schedule-card) {
    color: var(--swim-navy);
    text-decoration-color: var(--swim-teal);
    text-underline-offset: 0.2em;
}

.client-schedule a:not(.schedule-card):focus-visible {
    outline: 3px solid var(--swim-navy);
    outline-offset: 3px;
}

/* Keep group names available to screen readers without adding toolbar height. */
.client-schedule .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.client-schedule .schedule-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    min-width: 0;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--swim-border);
    border-radius: 1rem;
    background: var(--swim-surface);
}

.client-schedule .schedule-view-toggle,
.client-schedule .schedule-filters,
.client-schedule .schedule-filters>fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.client-schedule .schedule-view-toggle {
    flex: 0 0 auto;
    align-self: center;
}

.client-schedule .schedule-filters {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex: 1 1 38rem;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.client-schedule .schedule-filters>fieldset {
    flex: 0 0 auto;
}

.client-schedule .schedule-filters>fieldset>legend {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--swim-navy);
    text-align: center;
}

.client-schedule .view-options {
    display: inline-flex;
    padding: 0.25rem;
    border: 1px solid var(--swim-border);
    border-radius: 0.75rem;
    background: white;
}

.client-schedule .view-option,
.client-schedule .filter-chip {
    position: relative;
    cursor: pointer;
}

/* The native inputs remain in the page and keyboard-accessible. */
.client-schedule .view-option input,
.client-schedule .filter-chip input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.client-schedule .view-option span {
    display: block;
    min-width: 5.5rem;
    padding: 0.5rem 0.9rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    color: var(--swim-navy);
}

.client-schedule .view-option:hover span {
    background: var(--swim-surface);
}

.client-schedule .view-option input:checked+span {
    color: white;
    background: var(--swim-navy);
    box-shadow: 0 1px 3px rgb(26 89 124 / 20%);
}

.client-schedule .view-option input:focus-visible+span {
    outline: 3px solid var(--swim-navy);
    outline-offset: 3px;
}

.client-schedule .filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.client-schedule .filter-chip span {
    display: inline-block;
    padding: 0.38rem 0.7rem;
    border: 1px solid var(--swim-border);
    border-radius: 999px;
    background: white;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--swim-navy);
}

.client-schedule .filter-chip:hover span {
    border-color: var(--swim-teal);
    background: var(--swim-surface);
}

.client-schedule .filter-chip input:checked+span {
    border-color: var(--swim-navy);
    background: var(--swim-navy);
    color: white;
}

.client-schedule .filter-chip input:focus-visible+span {
    outline: 3px solid var(--swim-navy);
    outline-offset: 3px;
}

.client-schedule .schedule-grid {
    display: grid;
    /* Preserve one column per visible weekday and scroll when they cannot fit. */
    grid-template-columns: repeat(var(--day-count, 7), minmax(9.75rem, 1fr));
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.client-schedule .schedule-day {
    padding: 0.5rem;
    border-radius: 1rem;
    background: white;
    box-shadow: 0 4px 16px rgb(26 89 124 / 10%);
    min-width: 0;
}

.client-schedule .schedule-day>h2 {
    margin: 0 0 0.75rem;
    padding: 0.3rem 0 0.6rem;
    border-bottom: 2px solid var(--swim-sky);
    font-size: 1.125rem;
    line-height: 1.25;
    text-align: center;
}

.client-schedule .schedule-day>p {
    margin: 0;
    padding: 0.8rem;
    border: 1px dashed var(--swim-border);
    border-radius: 0.75rem;
    font-size: 0.875rem;
    text-align: center;
}

.client-schedule .schedule-card {
    --location-accent: var(--swim-navy);
    --location-background: var(--swim-surface);
    --location-text: var(--swim-navy);
    display: block;
    min-width: 0;
    padding: var(--schedule-card-padding);
    padding-left: var(--schedule-card-padding-left);
    border: 0;
    border-left: 6px solid var(--location-accent);
    border-radius: 0.875rem;
    background: var(--location-background);
    box-shadow: 0 2px 8px rgb(26 89 124 / 7%);
    color: var(--location-text);
    text-decoration: none;
}

/* Preserve the old cards' location colors and darker left edge. Evergreen's
   darker teal keeps the small white card text readable. */
.client-schedule .schedule-card--denver {
    --location-accent: var(--swim-navy);
    --location-background: #d1dee5;
}

.client-schedule .schedule-card--evergreen {
    --location-accent: #285d5f;
    --location-background: #387d7f;
    --location-text: white;
}

.client-schedule .schedule-card--thornton {
    --location-accent: #244661;
    --location-background: #2d5878;
    --location-text: white;
}

.client-schedule .schedule-card+.schedule-card {
    margin-top: 0.6rem;
}

.client-schedule .schedule-card:hover {
    box-shadow: 0 6px 16px rgb(26 89 124 / 14%);
    transform: translateY(-2px);
}

.client-schedule .schedule-card:focus-visible {
    outline: 3px solid var(--swim-navy);
    outline-offset: 3px;
}

.client-schedule .schedule-location {
    display: inline-block;
    max-width: 100%;
    margin-left: auto;
    padding: 0.12rem var(--schedule-badge-padding-inline);
    border-radius: 999px;
    background: var(--swim-surface);
    font-size: var(--schedule-badge-max-size);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--swim-navy);
    overflow-wrap: anywhere;
}

.client-schedule .schedule-location--wrapped {
    margin-left: 0;
    /* The pill extends into card padding so its text aligns with the time. */
    transform: translateX(calc(0px - var(--schedule-badge-padding-inline)));
}

.client-schedule .schedule-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.25rem 0.4rem;
}

.client-schedule .schedule-card-top--badge-wrapped {
    row-gap: var(--schedule-wrapped-gap);
}

.client-schedule .schedule-card-top--badge-wrapped + .schedule-card-heading {
    margin-top: var(--schedule-wrapped-gap);
}

.client-schedule .schedule-card-time-row {
    display: flex;
    flex: 1 1 4rem;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.1rem 0.45rem;
    min-width: min-content;
}

.client-schedule .schedule-card .schedule-time {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.client-schedule .schedule-recurring-day {
    font-size: 0.8rem;
    font-weight: 600;
}

.client-schedule .schedule-card-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.4rem;
    margin-top: 0.55rem;
}

.client-schedule .schedule-card h2 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
    color: inherit;
}

.client-schedule .schedule-card p {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    line-height: 1.4;
}

.client-schedule .schedule-spots {
    font-weight: 600;
}

.client-schedule .schedule-card .schedule-next-lesson {
    margin-top: 0.7rem;
    font-style: italic;
}

.client-schedule .schedule-card .schedule-range {
    margin-top: 0.2rem;
    font-size: 0.8rem;
}

@media (max-width: 48rem) {
    .client-schedule .schedule-controls {
        align-items: flex-start;
        padding: 1rem;
    }

    .client-schedule .schedule-view-toggle {
        display: flex;
        flex: 0 0 100%;
        justify-content: center;
    }

    .client-schedule .schedule-filters {
        flex-basis: 100%;
    }

    .client-schedule .schedule-filters>fieldset {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .client-schedule .filter-options {
        justify-content: center;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .client-schedule .schedule-card {
        transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
    }
}

@media (prefers-reduced-motion: reduce) {
    .client-schedule .schedule-card:hover {
        transform: none;
    }
}

.client-schedule #week-calendar {
    width: min(22rem, calc(100vw - 2rem));
    padding: 1rem;
    border: 1px solid var(--swim-border);
    border-radius: 1rem;
    color: var(--swim-navy);
    background: white;
    box-shadow: 0 1rem 3rem rgb(26 89 124 / 20%);
}

.client-schedule #week-calendar::backdrop {
    background: rgb(26 89 124 / 25%);
}

.client-schedule .calendar-month-controls {
    display: grid;
    grid-template-columns: 2.75rem 1fr 2.5rem;
    align-items: center;
    text-align: center;
}

.client-schedule .calendar-month-controls h2 {
    margin: 0;
    font-size: 1.1rem;
}

.client-schedule .calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.2rem;
    margin: 1rem 0;
    text-align: center;
}

.client-schedule .calendar-weekday {
    font-size: 0.75rem;
    color: var(--swim-navy);
}

.client-schedule .calendar-days button {
    aspect-ratio: 1;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.client-schedule .calendar-days button:hover:not(:disabled),
.client-schedule .calendar-days button.selected-week {
    background: var(--swim-pale);
}

.client-schedule .calendar-days button.outside-month {
    opacity: 0.45;
}

.client-schedule .calendar-days button:disabled {
    opacity: 0.3;
    cursor: default;
}

.client-schedule .calendar-days button:focus-visible {
    outline: 3px solid var(--swim-navy);
}

.client-schedule .lesson-week-controls:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--swim-border);
    border-radius: 1rem;
    background: var(--swim-surface);
}

.client-schedule .week-navigation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.client-schedule .all-dates-option span {
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
}

.client-schedule .lesson-week-controls button {
    min-height: 2.5rem;
    border: 1px solid var(--swim-border);
    border-radius: 0.65rem;
    background: white;
    color: var(--swim-navy);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.client-schedule #previous-week,
.client-schedule #next-week {
    width: 2.5rem;
    padding: 0;
    font-size: 1.4rem;
}

.client-schedule #week-range-button {
    padding: 0 1rem;
}

.client-schedule .lesson-week-controls button:hover:not(:disabled) {
    border-color: var(--swim-teal);
    background: var(--swim-pale);
}

.client-schedule .lesson-week-controls button:focus-visible {
    outline: 3px solid var(--swim-navy);
    outline-offset: 2px;
}

.client-schedule .lesson-week-controls button:disabled {
    opacity: 0.45;
    cursor: default;
}

.client-schedule .calendar-month-controls button,
.client-schedule #week-calendar form button {
    min-height: 2.75rem;
    border: 1px solid var(--swim-border);
    border-radius: 0.7rem;
    background: var(--swim-surface);
    color: var(--swim-navy);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.client-schedule .calendar-month-controls button {
    width: 2.75rem;
    padding: 0;
    font-size: 1.5rem;
}

.client-schedule #week-calendar form {
    display: flex;
    justify-content: flex-end;
}

.client-schedule #week-calendar form button {
    padding: 0 1rem;
    border-color: var(--swim-navy);
    background: var(--swim-navy);
    color: white;
}

.client-schedule .calendar-month-controls button:hover,
.client-schedule #week-calendar form button:hover {
    border-color: var(--swim-teal);
}

.client-schedule .calendar-month-controls button:focus-visible,
.client-schedule #week-calendar form button:focus-visible {
    outline: 3px solid var(--swim-navy);
    outline-offset: 2px;
}
