/*
 * The whole stylesheet for the web client. Served from /web/assets/app.css with
 * a long cache lifetime and a content hash in the URL, so it is fetched once.
 */

@font-face {
    font-family: "Outfit";
    src: url("/web/assets/outfit.fc7287273e66.ttf") format("truetype");
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Commissioner";
    src: url("/web/assets/commissioner.21156aa34705.ttf") format("truetype");
    font-weight: 300 600;
    font-display: swap;
}

/*
 * Colours from Danception's DesignTokens.kt (M3 roles) and Theme.kt (semantic
 * aliases), value for value. Each is light-dark(light, dark); data-theme pins
 * the scheme, otherwise it follows the system.
 */
:root {
    color-scheme: light dark;

    --md-primary: light-dark(#844C72, #F7B1DE);
    --md-on-primary: light-dark(#FFFFFF, #4F1E42);
    --md-primary-container: light-dark(#FFD8EE, #693459);
    --md-on-primary-container: light-dark(#693459, #FFD8EE);
    --md-error: light-dark(#BA1A1A, #FFB4AB);
    --md-error-container: light-dark(#FFDAD6, #93000A);
    --md-on-error-container: light-dark(#93000A, #FFDAD6);
    --md-background: light-dark(#FFF8F9, #181115);
    --md-on-surface: light-dark(#201A1D, #EDDFE4);
    --md-on-surface-variant: light-dark(#4F444A, #D3C2CA);
    --md-outline: light-dark(#81737A, #9C8D94);
    --md-outline-variant: light-dark(#D3C2CA, #4F444A);
    --md-surface-container-lowest: light-dark(#FFFFFF, #120C0F);
    --md-surface-container-low: light-dark(#FEF0F5, #201A1D);
    --md-surface-container: light-dark(#F8EAF0, #241E21);
    --md-surface-container-highest: light-dark(#EDDFE4, #3A3237);

    --text-body: var(--md-on-surface);
    --text-muted: var(--md-on-surface-variant);
    --text-on-accent: var(--md-on-primary);
    --surface-page: var(--md-background);
    --surface-card: var(--md-surface-container-low);
    --surface-card-raised: var(--md-surface-container);
    --surface-sheet: var(--md-surface-container-lowest);
    --border-hairline: var(--md-outline-variant);
    --border-strong: var(--md-outline);
    --accent: var(--md-primary);
    --accent-soft: var(--md-primary-container);
    --accent-on-soft: var(--md-on-primary-container);
    --danger: var(--md-error);
    --danger-bg: var(--md-error-container);
    --on-danger-bg: var(--md-on-error-container);
    --scrim: rgb(23 0 17 / 0.42);

    --day-none-bg: light-dark(rgb(79 68 74 / 0.85), #4F444A);
    --day-none-fg: light-dark(#FEF0F5, #D3C2CA);
    --day-open-bg: #FFFFFF;
    --day-open-fg: #201A1D;
    --day-open-border: light-dark(#D3C2CA, transparent);
    --day-joined-bg: light-dark(#FFD9E1, #FFB1C5);
    --day-joined-fg: light-dark(#703346, #3A071B);

    --font: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Type scale from Theme.kt's danceptionTypography(). */
    --fs-display-small: 40px;
    --fs-headline-large: 30px;
    --fs-headline-medium: 26px;
    --fs-headline-small: 22px;
    --fs-title-large: 20px;
    --fs-title-medium: 18px;
    --fs-title-small: 16px;
    --fs-body-large: 15px;
    --fs-body-medium: 14.5px;
    --fs-body-small: 13px;
    --fs-label-large: 15px;
    --fs-label-medium: 12.5px;
    --fs-label-small: 12px;
}

/* Outfit has no Greek, so a Greek page switches face entirely, as in Theme.kt. */
:root:lang(el) {
    --font: "Commissioner", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--surface-page);
    color: var(--text-body);
    font-family: var(--font);
    font-size: var(--fs-body-large);
    line-height: 1.55;
}

a { color: var(--accent); }

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-hairline);
    background: var(--surface-page);
}

.top-bar .brand {
    font-size: var(--fs-title-large);
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    color: var(--text-body);
}

.top-bar .top-title { display: none; }

.top-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.top-nav a {
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: var(--fs-label-large);
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
}

.top-nav a:hover { color: var(--text-body); }

.top-nav a[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--accent-on-soft);
}

.tab-bar { display: none; }

/* Mobile: the page title on top, the tabs at the bottom, as in the apps. */
@media (max-width: 820px) {
    .has-tabs .top-bar .brand, .top-nav { display: none; }

    .has-tabs .top-bar .top-title {
        display: block;
        font-size: var(--fs-headline-small);
        font-weight: 600;
        letter-spacing: -0.02em;
    }

    .has-tabs .top-bar { border-bottom: 0; padding-top: calc(0.75rem + env(safe-area-inset-top)); }

    .tab-bar {
        display: flex;
        position: fixed;
        inset: auto 0 0 0;
        z-index: 10;
        padding: 0.45rem 0.25rem calc(0.45rem + env(safe-area-inset-bottom));
        background: var(--surface-card);
        border-top: 1px solid var(--border-hairline);
    }

    .tab-bar a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.2rem;
        min-width: 0;
        font-size: var(--fs-label-medium);
        color: var(--text-muted);
        text-decoration: none;
    }

    .tab-bar .icon {
        display: flex;
        padding: 0.25rem 1.1rem;
        border-radius: 999px;
    }

    .tab-bar a[aria-current="page"] {
        color: var(--accent-on-soft);
        font-weight: 600;
    }

    .tab-bar a[aria-current="page"] .icon { background: var(--accent-soft); }

    .has-tabs main { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
}

main { padding: 2rem 1.25rem; }

.narrow {
    max-width: 26rem;
    margin: 0 auto;
}

h1 {
    font-size: var(--fs-headline-small);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 0.35rem;
}

input:focus-visible, button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

button {
    width: 100%;
    padding: 0.65rem 1rem;
    font: inherit;
    font-weight: 600;
    color: var(--text-on-accent);
    background: var(--accent);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

/* htmx sets this while a request is in flight. */
form.htmx-request button { opacity: 0.6; pointer-events: none; }

/* --- calendar --- */

.calendar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
    gap: 1.5rem;
    max-width: 64rem;
    margin: 0 auto;
    align-items: start;
}

@media (max-width: 820px) {
    .calendar-layout { grid-template-columns: minmax(0, 1fr); }
}

.month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 20px;
}

.month-header h1 {
    margin: 0;
    font-size: var(--fs-title-large);
    font-weight: 500;
    letter-spacing: -0.01em;
}

.month-arrow {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    color: var(--text-muted);
    background: var(--surface-card-raised);
    border-radius: 50%;
}

/* Greyed rather than hidden: the window's edge should be visible, not mysterious. */
.month-arrow:disabled { opacity: 0.35; cursor: not-allowed; }

.weekday-row, .month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
}

.weekday-row {
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-align: center;
    color: var(--text-muted);
}

.day-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    font-size: 15px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
    border-radius: 14px;
}

.day-cell.none { color: var(--day-none-fg); background: var(--day-none-bg); }
.day-cell.open { color: var(--day-open-fg); background: var(--day-open-bg); box-shadow: inset 0 0 0 1px var(--day-open-border); }
.day-cell.joined { color: var(--day-joined-fg); background: var(--day-joined-bg); }
.day-cell.blank { background: none; }

/* A day that has gone by still draws, dimmed - never hidden. */
.day-cell.past { opacity: 0.45; }

/* Inset, so it still shows next to the selected outline. Replaces the open border on today. */
.day-cell.today { box-shadow: inset 0 0 0 2px var(--accent); }

.day-cell.selected { outline: 2px solid var(--accent); outline-offset: 2px; }

a.day-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.legend {
    display: flex;
    flex-direction: column;
    gap: 11px;
    margin: 26px 0 0;
    padding: 0 14px;
    font-size: 13px;
    color: var(--text-muted);
    list-style: none;
}

.legend li { display: flex; align-items: center; gap: 11px; }

.legend .swatch { flex: none; width: 16px; height: 16px; border-radius: 5px; }
.swatch.none { background: var(--day-none-bg); }
.swatch.open { background: var(--day-open-bg); box-shadow: inset 0 0 0 1px var(--day-open-border); }
.swatch.joined { background: var(--day-joined-bg); }
.swatch.today { background: var(--day-none-bg); box-shadow: inset 0 0 0 2px var(--accent); }

.day-panel .class-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 20px 0 6px;
    padding: 0;
    list-style: none;
}

.day-panel .class-list li + li { margin-top: 0; }

.day-panel .card-row { padding: 15px 16px; }

.row-title { font-size: 16px; font-weight: 500; }
.row-meta { margin-top: 2px; font-size: 13px; color: var(--text-muted); }

.add-class {
    display: block;
    margin-top: 14px;
    padding-top: 16px;
    border-top: 1px solid var(--border-hairline);
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    color: var(--accent);
    text-decoration: none;
}

.sheet-close { margin-top: 14px; }

/* Desktop: the day sheet is the always-visible right-hand panel, not a dialog. */
@media (min-width: 821px) {
    .day-sheet {
        position: static;
        display: block;
        width: auto;
        height: auto;
        max-height: none;
        margin: 0;
        border: 1px solid var(--border-hairline);
    }

    .day-sheet .sheet-close { display: none; }
}

/* --- day panel and class detail --- */

.class-list { list-style: none; margin: 1rem 0 0; padding: 0; }

.class-list li + li { margin-top: 0.5rem; }

.wide { max-width: 52rem; margin: 0 auto; }

/*
 * A confirmation of something that just happened, not a failure. role="status"
 * rather than "alert": it is announced politely, without interrupting.
 */
.notice {
    margin: 0;
    padding: 12px 16px;
    font-size: 13.5px;
    line-height: 20px;
    color: var(--accent-on-soft);
    background: var(--accent-soft);
    border-radius: 14px;
}

/*
 * --- components ---
 * Ported from Danception's sharedUI Components.kt / Scaffolding.kt, value for
 * value; core/web/Components.kt builds the markup.
 */

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    padding: 0 1.25rem;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-on-accent);
    background: var(--accent);
    border: 0;
    border-radius: 16px;
    text-decoration: none;
    cursor: pointer;
}

.btn.soft { color: var(--accent-on-soft); background: var(--accent-soft); }
.btn.ghost { color: var(--accent); background: transparent; border: 1px solid var(--border-strong); }
.btn.danger { color: var(--on-danger-bg); background: var(--danger-bg); }
.btn.compact { width: auto; min-height: 40px; padding: 0 1rem; font-size: 14.5px; border-radius: 12px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

.link-btn {
    width: auto;
    padding: 0;
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--accent);
    background: none;
    border: 0;
    text-decoration: none;
    cursor: pointer;
}

.big-card {
    padding: 22px 18px 26px;
    background: var(--surface-card);
    border-radius: 28px;
}

.section-card {
    padding: 18px 20px;
    background: var(--surface-card);
    border-radius: 22px;
}

.stack { display: flex; flex-direction: column; gap: 12px; }

.section-label {
    margin: 0 0 8px;
    font-size: var(--fs-label-small);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.body-text { margin: 0; font-size: var(--fs-body-medium); line-height: 22.5px; }

.helper { margin: 6px 0 0; font-size: var(--fs-label-medium); line-height: 18px; color: var(--text-muted); }

.empty-state {
    margin: 0;
    padding: 40px;
    font-size: var(--fs-body-medium);
    line-height: 22.5px;
    text-align: center;
    color: var(--text-muted);
}

.warn-box {
    padding: 13px 15px;
    background: var(--surface-card-raised);
    border: 1px solid var(--danger);
    border-radius: 14px;
}

.back-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
    font-size: var(--fs-title-medium);
    font-weight: 500;
}

.back-bar a, .back-bar button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 22px;
    color: var(--text-body);
    background: none;
    border: 0;
    border-radius: 50%;
    text-decoration: none;
    cursor: pointer;
}

.hero { padding: 6px 4px 22px; }

.hero .eyebrow {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.hero h1 {
    margin: 0;
    font-size: var(--fs-headline-large);
    line-height: 1.1;
    letter-spacing: -0.025em;
}

.hero .meta { margin: 10px 0 0; font-size: 14px; color: var(--text-muted); }

.avatar {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface-card-raised);
    border-radius: 50%;
}

.avatar.large {
    width: 82px;
    height: 82px;
    font-size: 28px;
    color: var(--text-on-accent);
    background: var(--accent);
}

.chevron { font-size: 18px; line-height: 1; color: var(--text-muted); }

.pill {
    display: inline-block;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border-radius: 9px;
}

.pill.joined { color: var(--day-joined-fg); background: var(--day-joined-bg); }
.pill.danger { color: var(--on-danger-bg); background: var(--danger-bg); }
.pill.paid { color: var(--accent-on-soft); background: var(--accent-soft); }
.pill.neutral { color: var(--text-muted); background: var(--surface-card-raised); }

.segmented {
    display: flex;
    gap: 6px;
    padding: 5px;
    background: var(--surface-card-raised);
    border-radius: 14px;
}

.segmented > * {
    flex: 1;
    padding: 11px 0;
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    text-align: center;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
}

.segmented > [aria-current="true"], .segmented > [aria-pressed="true"] {
    color: var(--text-body);
    background: var(--surface-sheet);
}

.stepper { display: flex; gap: 8px; }

.stepper button {
    width: 44px;
    height: 44px;
    padding: 0;
    font: inherit;
    font-size: 19px;
    color: var(--text-body);
    background: var(--surface-card-raised);
    border: 0;
    border-radius: 13px;
    cursor: pointer;
}

.stepper button:disabled { color: var(--text-muted); opacity: 0.4; cursor: not-allowed; }

.field { display: block; margin-bottom: 14px; }

.field-pair { display: flex; gap: 12px; }

.field-pair > .field { flex: 1; min-width: 0; }

.field > .field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.field-input {
    position: relative;
    display: flex;
    align-items: center;
}

.field-input input, .field-input select, .field-input textarea {
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 0 16px;
    font: inherit;
    font-size: 15px;
    color: var(--text-body);
    background: var(--surface-sheet);
    border: 1px solid var(--border-hairline);
    border-radius: 14px;
    caret-color: var(--accent);
}

.field-input textarea { padding: 14px 16px; line-height: 22px; resize: vertical; }

.field-input input:focus-visible, .field-input select:focus-visible, .field-input textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 0;
}

.field-input.password input { padding-right: 52px; }

.field-input .reveal {
    position: absolute;
    right: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--text-muted);
    background: none;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.card-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 16px;
    color: var(--text-body);
    background: var(--surface-card);
    border-radius: 18px;
    text-decoration: none;
}

.card-row .grow { flex: 1; min-width: 0; }

.nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 17px 20px;
    color: var(--text-body);
    background: var(--surface-card);
    border-radius: 18px;
    text-decoration: none;
}

.nav-row .label { font-size: 16px; font-weight: 500; }
.nav-row .trailing { font-size: 13px; color: var(--text-muted); }

.choice-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    color: var(--text-body);
    background: var(--surface-card);
    border-radius: 20px;
    text-decoration: none;
}

.choice-row .grow { flex: 1; }
.choice-row .title { font-size: 17px; font-weight: 500; }
.choice-row .subtitle { margin-top: 4px; font-size: 13px; line-height: 19px; color: var(--text-muted); }

.capacity .count { display: flex; align-items: flex-end; gap: 10px; }

.capacity .numbers {
    font-size: var(--fs-headline-medium);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.capacity .caption { font-size: 14px; color: var(--text-muted); }

.capacity .bar {
    height: 8px;
    margin-top: 12px;
    overflow: hidden;
    background: var(--md-surface-container-highest);
    border-radius: 4px;
}

.capacity .bar > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.capacity.over .numbers { color: var(--danger); }
.capacity.over .bar { background: var(--danger-bg); }
.capacity.over .bar > span { background: var(--danger); }

.cta-bar { display: flex; flex-direction: column; gap: 10px; padding: 8px 0 26px; }

.cta-note { margin: 0; font-size: 12px; text-align: center; color: var(--text-muted); }

.pay-note {
    margin: 12px 0 0;
    padding-top: 12px;
    font-size: 13px;
    line-height: 19px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-hairline);
}

.disclosure { border-top: 1px solid var(--border-hairline); }

.disclosure > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 4px 12px;
    cursor: pointer;
    list-style: none;
}

.disclosure > summary::-webkit-details-marker { display: none; }

.disclosure > summary .label {
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.disclosure > summary .trailing { font-size: 13px; color: var(--accent); }

.logo { display: block; border-radius: 50%; }

/* A centred dialog on desktop, a sheet docked to the bottom on mobile. */
.sheet {
    width: min(28rem, calc(100% - 48px));
    max-height: calc(100% - 48px);
    padding: 26px 22px 20px;
    color: var(--text-body);
    background: var(--surface-sheet);
    border: 0;
    border-radius: 28px;
}

.sheet::backdrop { background: var(--scrim); }

.sheet .sheet-title { margin: 0; font-size: 19px; font-weight: 500; }
.sheet .sheet-subtitle { margin: 6px 0 0; font-size: 13px; line-height: 20px; color: var(--text-muted); }

@media (max-width: 820px) {
    .sheet {
        width: 100%;
        max-width: none;
        max-height: 85vh;
        margin: auto 0 0;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
        border-radius: 28px 28px 0 0;
    }
}

/* --- signed-out pages: sign in, register, forgot password, check inbox, email links --- */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.centered { text-align: center; }

.auth {
    max-width: 26rem;
    margin: 0 auto;
    padding: 8px 12px 40px;
}

@media (min-width: 821px) {
    .auth {
        margin-top: 2rem;
        padding: 36px 32px 28px;
        background: var(--surface-card);
        border-radius: 28px;
    }
}

.auth .logo { margin: 0 auto; max-width: 100%; height: auto; }

.auth .tagline {
    margin: 14px 0 34px;
    font-size: 14px;
    letter-spacing: 0.02em;
    text-align: center;
    color: var(--text-muted);
}

.auth .forgot { margin: -4px 0 14px; text-align: right; }

.auth form > .warn-box { margin-bottom: 12px; }

.auth form > .helper.centered { margin-top: 10px; }

.auth .switch-line {
    margin: 26px 0 0;
    font-size: 14px;
    text-align: center;
    color: var(--text-muted);
}

.auth .switch-line a { font-weight: 500; color: var(--accent); text-decoration: none; }

.auth .centered { margin: 18px 0 0; }

.auth .or-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 16px;
    font-size: 13.5px;
    color: var(--text-muted);
}

.auth .or-line::before,
.auth .or-line::after { content: ""; flex: 1; border-top: 1px solid currentColor; opacity: 0.35; }

/*
 * Google's re-auth button on the account page renders in an iframe; this centres it and
 * reserves its height. `color-scheme: light` matches the iframe's own, or a dark page
 * gets it painted on an opaque white box.
 */
.google-reauth { display: flex; justify-content: center; min-height: 44px; color-scheme: light; margin: 4px 0 12px; }

/* Google's branding guidelines: the full-colour G, light or dark neutral button. */
.google-signin {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: fit-content;
    min-width: 240px;
    height: 44px;
    margin: 0 auto;
    padding: 0 22px;
    border-radius: 22px;
    border: 1px solid light-dark(#747775, #8E918F);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    color: light-dark(#1F1F1F, #E3E3E3);
    background: light-dark(#FFFFFF, #131314);
}

.google-signin span { display: inline-flex; }

/* Apple's guidelines: logo and title, black on a light page, white on a dark one. */
.apple-signin {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    min-width: 240px;
    height: 44px;
    margin: 12px auto 0;
    padding: 0 22px;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    color: light-dark(#FFFFFF, #000000);
    background: light-dark(#000000, #FFFFFF);
}

.apple-signin span { display: inline-flex; }

button.apple-signin { border: 0; font-family: inherit; cursor: pointer; }

form .apple-signin { margin: 4px auto 12px; }

.auth .notice { margin-bottom: 20px; }

.lang-links { display: flex; justify-content: center; gap: 18px; margin: 10px 0 0; font-size: 13.5px; }

.lang-links a { color: var(--text-muted); text-decoration: none; }

.lang-links a[aria-current="true"] { color: var(--accent); font-weight: 500; }

/* --- class info --- */

.class-detail .hero { padding-top: 0; }

.teacher-row { display: flex; align-items: center; gap: 13px; font-size: 16px; font-weight: 500; }

.teacher-row .avatar {
    width: 44px;
    height: 44px;
    font-size: 15px;
    color: var(--accent-on-soft);
    background: var(--accent-soft);
}

.roster { margin: 0; padding: 0; list-style: none; }

.roster li { display: flex; align-items: center; gap: 11px; padding: 6px 0; font-size: 14.5px; }

/* The call to action stays in reach while the sections scroll, as the apps pin it. */
.class-detail .cta-bar {
    position: sticky;
    bottom: 0;
    margin-top: 14px;
    padding-top: 12px;
    padding-bottom: 6px;
    background: var(--surface-sheet);
}

/* Mobile: a class fills the sheet, so it reads as its own screen with a way back. */
@media (max-width: 820px) {
    .day-sheet:has(.class-detail) {
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .day-sheet:has(.class-detail) .sheet-close { display: none; }
}

/* --- tab pages: My classes, subscriptions, profile --- */

.page { max-width: 40rem; margin: 0 auto; }

.page.wide { max-width: 52rem; }

/* On mobile the top bar already carries the title. */
.page-title { margin: 0 0 6px; font-size: var(--fs-headline-small); }

@media (max-width: 820px) {
    .has-tabs .page-title { display: none; }
}

.list-card {
    display: block;
    padding: 18px 20px;
    color: var(--text-body);
    background: var(--surface-card);
    border-radius: 22px;
    text-decoration: none;
}

.list-card-top { display: flex; align-items: flex-start; gap: 12px; }
.list-card .grow { flex: 1; min-width: 0; }
.list-card .title { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.list-card .meta { margin-top: 4px; font-size: 13.5px; line-height: 20px; color: var(--text-muted); }
.list-card .meta + .meta { margin-top: 0; }
.list-card.cancelled .title { color: var(--text-muted); text-decoration: line-through; }

.card-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.spaced-top { margin-top: 14px; }

.role-form { display: flex; align-items: center; gap: 8px; margin-top: 12px; }

.role-form .field-input { flex: 1; }

.role-form select { min-height: 40px; }

/* --- staff subscriptions --- */

.balance-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-hairline);
}

.balance-row .grow { flex: 1; min-width: 0; }

.balance-label { font-size: 12px; letter-spacing: 0.04em; color: var(--text-muted); }

.balance-number { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }

.balance-number.big { font-size: 26px; }

.balance-note { margin-top: 6px; font-size: 12.5px; line-height: 17.5px; color: var(--text-muted); }

.balance-now { display: flex; align-items: baseline; gap: 10px; }

.balance-now .balance-note { margin-top: 0; font-size: 14px; }

.ledger-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface-card);
    border-radius: 16px;
}

.ledger-row .grow { flex: 1; min-width: 0; }

.ledger-row .title { font-size: 15px; font-weight: 500; }

.ledger-row .meta { margin-top: 2px; font-size: 12.5px; color: var(--text-muted); }

.ledger-delta { flex: none; width: 36px; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }

.ledger-delta.debt { color: var(--danger); }

.ledger-delta.credit { color: var(--accent-on-soft); }

.date-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 10px; margin-top: 12px; }

.disclosure .when-open { display: none; }
.disclosure[open] .when-open { display: inline; }
.disclosure[open] .when-closed { display: none; }
.disclosure > .stack { padding-bottom: 12px; }

/* --- profile --- */

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 8px 0 14px;
}

.profile-header p { margin: 0; }
.profile-name { font-size: var(--fs-headline-small); font-weight: 600; letter-spacing: -0.02em; }
.profile-email { font-size: 14px; color: var(--text-muted); }

.warn-action { margin: 8px 0 0; }

.button-row { display: flex; gap: 10px; margin-top: 4px; }
.button-row > * { flex: 1; min-height: 50px; }

.helper.spaced { margin: 0 0 14px; font-size: 13px; line-height: 19.5px; }

a.btn[data-open-sheet] { text-align: center; }
