.app-shell,
.stack,
.fh-action-stack,
.fh-list,
.fh-activity-log,
.auth-form,
.auth-support-form {
    display: grid;
    gap: 14px;
}

.helper-note {
    margin-top: 18px;
    padding: 18px;
    border-radius: var(--app-radius-md);
    background: var(--color-bg-surface-soft);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.helper-note strong {
    display: block;
    margin-bottom: 6px;
    color: var(--color-text-primary);
}

.fh-navbar {
    position: fixed;
    inset-block-start: 16px;
    inset-inline: 20px;
    z-index: 120;
    width: auto;
    max-width: 1280px;
    margin-inline: auto;
    padding: 12px 18px;
    border: 1px solid color-mix(in srgb, var(--app-sidebar-text) 16%, transparent);
    border-radius: 30px;
    background:
        radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--color-primary) 22%, transparent), transparent 28%),
        linear-gradient(180deg, color-mix(in srgb, var(--color-primary-strong) 88%, #081321) 0%, color-mix(in srgb, var(--color-primary) 24%, #0b1c34) 100%);
    color: var(--app-sidebar-text);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

@media (min-width: 769px) {
    .fh-navbar {
        inset-block-start: 0;
        inset-inline: 0;
        width: 100%;
        max-width: none;
        margin-inline: 0;
        padding: 16px 28px 18px;
        border-radius: 0 0 30px 30px;
        border-inline: 0;
        border-block-start: 0;
    }

    .fh-navbar-head,
    .fh-nav-panel {
        width: min(100%, 1600px);
        margin-inline: auto;
    }

    .fh-nav-toggle {
        display: none;
    }

    #fh_nav_toggle {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .fh-nav-panel {
        display: grid !important;
    }

    .fh-theme-menu-toggle {
        display: none !important;
    }

    .fh-lang-toggle {
        position: fixed !important;
        left: 18px !important;
        right: auto !important;
        bottom: 18px !important;
        top: auto !important;
        inset-inline-start: 18px !important;
        inset-inline-end: auto !important;
        inset-block-end: 18px !important;
        inset-block-start: auto !important;
        min-width: 44px !important;
        width: 44px !important;
        max-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 !important;
        border-radius: 12px !important;
        border: 1px solid #2ca7f5 !important;
        background: #2ca7f5 !important;
        background-image: none !important;
        color: #ffffff !important;
        opacity: 1 !important;
        box-shadow: 0 14px 30px rgba(20, 110, 190, 0.32) !important;
        font-size: 11px !important;
        font-weight: 900 !important;
        letter-spacing: 0.06em !important;
        z-index: 10020 !important;
    }

    .fh-lang-toggle:hover,
    .fh-lang-toggle:focus-visible {
        background: #1698ee !important;
        color: #ffffff !important;
    }
}

.fh-navbar-head,
.fh-navbar-head-actions,
.fh-nav-main,
.fh-nav-links,
.fh-nav-meta,
.fh-brand,
.auth-card-tools,
.auth-brand-banner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fh-navbar-head {
    justify-content: space-between;
}

.fh-brand {
    min-width: 0;
    text-decoration: none;
}

.fh-brand-mark {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: var(--app-sidebar-surface-strong);
    border: 1px solid color-mix(in srgb, var(--app-sidebar-text) 10%, transparent);
}

.fh-brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.fh-brand-text strong,
.fh-brand-text span {
    display: block;
}

.fh-brand-text strong {
    font-size: 18px;
    font-family: var(--font-family-heading);
}

.fh-brand-text span {
    color: color-mix(in srgb, var(--app-sidebar-text) 76%, transparent);
    font-size: 13px;
}

.fh-nav-toggle,
.fh-theme-toggle-inline,
.fh-lang-toggle-inline,
.fh-theme-toggle,
.fh-lang-toggle {
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--app-sidebar-text) 14%, transparent);
    background: var(--app-sidebar-surface);
    color: var(--app-sidebar-text);
    box-shadow: var(--shadow-sm);
}

.fh-lang-toggle {
    position: fixed;
    inset-inline-start: 16px;
    inset-block-end: 16px;
    z-index: 140;
    min-width: 58px;
    width: auto;
    padding-inline: 14px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.fh-nav-toggle {
    position: relative;
}

.fh-nav-toggle span,
.fh-nav-toggle::before,
.fh-nav-toggle::after {
    content: "";
    position: absolute;
    inset-inline-start: 12px;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform var(--motion-base) var(--ease-standard), opacity var(--motion-fast) var(--ease-standard);
}

.fh-nav-toggle::before { inset-block-start: 16px; }
.fh-nav-toggle span { inset-block-start: 23px; }
.fh-nav-toggle::after { inset-block-start: 30px; }
.fh-nav-toggle.is-open span { opacity: 0; }
.fh-nav-toggle.is-open::before { transform: translateY(7px) rotate(45deg); }
.fh-nav-toggle.is-open::after { transform: translateY(-7px) rotate(-45deg); }

.fh-nav-panel {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.fh-nav-links {
    flex-wrap: wrap;
}

.fh-nav-link,
.fh-pill,
.fh-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--app-sidebar-text) 10%, transparent);
    background: color-mix(in srgb, var(--app-sidebar-surface) 74%, transparent);
    color: var(--color-text-primary);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    transition:
        background var(--motion-fast) var(--ease-standard),
        border-color var(--motion-fast) var(--ease-standard),
        transform var(--motion-fast) var(--ease-standard);
}

.fh-nav-link:hover,
.fh-pill:hover,
.fh-logout:hover,
.fh-nav-link[aria-current="page"] {
    transform: translateY(-1px);
    background: var(--app-sidebar-surface-strong);
    border-color: color-mix(in srgb, var(--app-sidebar-text) 16%, transparent);
    color: #ffffff;
}

.fh-nav-link[aria-current="page"] {
    background: linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 26%, transparent), color-mix(in srgb, var(--app-sidebar-surface-strong) 92%, transparent));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.theme-light .fh-navbar .fh-nav-link,
body.theme-light .fh-navbar .fh-pill,
body.theme-light .fh-navbar .fh-logout,
body.theme-light .fh-navbar .fh-pill strong,
body.theme-light .fh-navbar .fh-pill-notifications strong,
body.theme-light .fh-navbar .fh-pill-notifications,
body.theme-light .fh-navbar .fh-nav-meta,
body.theme-light .fh-navbar .fh-nav-meta span {
    color: #f4f9ff;
}

body.theme-light .fh-navbar .fh-nav-link:hover,
body.theme-light .fh-navbar .fh-pill:hover,
body.theme-light .fh-navbar .fh-logout:hover,
body.theme-light .fh-navbar .fh-nav-link:focus-visible,
body.theme-light .fh-navbar .fh-pill:focus-visible,
body.theme-light .fh-navbar .fh-logout:focus-visible {
    color: #ffffff;
}

body.theme-light .fh-navbar .fh-pill-notifications strong {
    background: rgba(143, 216, 255, 0.22);
}

body.theme-light .fh-navbar .fh-brand-text strong,
body.theme-light .fh-navbar .fh-brand-text span {
    color: #ffffff;
}

.fh-pill-notifications strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    margin-inline-start: 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--app-sidebar-text) 18%, transparent);
}

.fh-hero,
.fh-card,
.auth-card,
.fh-payment-methods,
.level-test-question,
.legal-card,
.teacher-student-card,
.teacher-answer-card,
.teacher-student-detail-card,
.teacher-student-stat-card,
.teacher-test-result-card,
.student-choice-card,
.student-test-question,
.student-test-shell {
    border: 1px solid var(--color-border);
    border-radius: var(--app-radius-lg);
    background: var(--color-bg-surface);
    box-shadow: var(--shadow-md);
}

.fh-hero,
.fh-card,
.auth-card,
.fh-payment-methods,
.teacher-student-card,
.teacher-answer-card,
.teacher-student-detail-card,
.teacher-student-stat-card,
.teacher-test-result-card,
.student-choice-card,
.student-test-question,
.student-test-shell {
    padding: 24px;
}

.fh-hero {
    background:
        radial-gradient(circle at 88% 72%, color-mix(in srgb, var(--app-primary) 22%, transparent), transparent 22%),
        radial-gradient(circle at 18% 22%, color-mix(in srgb, var(--app-primary) 12%, transparent), transparent 24%),
        linear-gradient(135deg, color-mix(in srgb, var(--color-bg-page) 94%, white) 0%, color-mix(in srgb, var(--color-bg-surface-soft) 96%, white) 100%);
    box-shadow: var(--shadow-lg);
}

.fh-card-dark {
    background:
        radial-gradient(circle at 82% 20%, color-mix(in srgb, var(--color-primary) 18%, transparent), transparent 26%),
        linear-gradient(160deg, color-mix(in srgb, var(--color-primary-strong) 94%, black) 0%, color-mix(in srgb, var(--color-primary) 34%, #0f3567) 100%);
    color: var(--app-footer-text);
    border: 1px solid color-mix(in srgb, var(--color-primary) 18%, transparent);
    box-shadow: var(--shadow-lg);
}

.fh-card-dark .fh-muted,
.fh-card-dark p {
    color: var(--app-footer-text-soft);
}

.fh-title,
.fh-subtitle,
.fh-muted,
.fh-section-copy {
    margin: 0;
}

.fh-title,
.brand-lockup h1,
.legal-head h1,
.student-step-head h2,
.teacher-student-profile-copy h1 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-extrabold);
}

.fh-title { font-size: clamp(2rem, 3vw, 3rem); line-height: 1.15; }
.fh-subtitle,
.fh-muted,
.fh-section-copy,
.fh-item-note,
.legal-head p,
.legal-section p,
.teacher-student-card-head p,
.teacher-answer-card span { color: var(--color-text-secondary); line-height: 1.85; }

.fh-hero-grid,
.fh-grid,
.fh-stat-grid,
.fh-checkout-grid,
.teacher-students-grid,
.teacher-answer-grid,
.teacher-student-stat-grid,
.student-onboarding-shell,
.teacher-student-detail-grid,
.student-choice-grid,
.fh-homework-result-summary {
    display: grid;
    gap: 20px;
}

.fh-hero-grid,
.fh-checkout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fh-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.teacher-students-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.teacher-student-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.student-onboarding-shell { grid-template-columns: 360px minmax(0, 1fr); }
.teacher-student-detail-grid { grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); }
.student-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fh-homework-result-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.fh-kpi {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    line-height: 1.1;
    font-weight: var(--font-weight-extrabold);
}

.fh-item,
.fh-activity-item,
.fh-checkout-summary-list div,
.fh-checkout-notes div,
.fh-order-summary-row,
.level-test-question,
.fh-homework-question {
    border-radius: var(--app-radius-md);
    background: var(--color-bg-surface-soft);
    border: 1px solid var(--color-border);
}

.fh-item,
.fh-activity-item,
.level-test-question,
.fh-homework-question {
    padding: 18px;
}

.fh-item-head,
.fh-activity-item,
.teacher-student-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.fh-item-title,
.level-test-question-title,
.teacher-student-card-head h4,
.teacher-student-detail-card h3 {
    margin: 0;
    color: var(--color-text-primary);
    font-family: var(--font-family-heading);
}

.fh-item-meta,
.fh-activity-content small { color: var(--color-text-secondary); }

.fh-empty {
    padding: 18px;
    border-radius: var(--app-radius-md);
    background: var(--color-bg-surface-soft);
    border: 1px dashed var(--color-border);
    color: var(--color-text-secondary);
    text-align: center;
}

.fh-activity-icon,
.teacher-student-card-avatar {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--app-primary-soft);
    color: var(--color-primary);
    font-weight: 800;
}

.fh-activity-content { display: grid; gap: 4px; }

.fh-checkout-summary-list,
.fh-checkout-notes,
.fh-order-summary-list,
.fh-homework-questions,
.level-test-options,
.level-test-list,
.student-onboarding-form,
.student-onboarding-progress,
.student-onboarding-step,
.student-test-options {
    display: grid;
    gap: 12px;
}

.fh-checkout-summary-list div,
.fh-checkout-notes div,
.fh-order-summary-row,
.level-test-option,
.fh-homework-option,
.student-test-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
}

.fh-homework-option { justify-content: space-between; }

.level-test-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: normal;
    direction: ltr;
    border-radius: var(--app-radius-md);
    background: var(--color-bg-surface-soft);
    border: 1px solid var(--color-border);
    cursor: pointer;
}

.level-test-option input {
    margin: 0;
    justify-self: end;
}

.level-test-option span {
    min-width: 0;
    color: var(--color-text-primary);
    line-height: 1.7;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    text-align: left;
    justify-self: start;
}

.level-test-option:has(input:checked) {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(31, 111, 214, 0.08));
    border-color: rgba(31, 111, 214, 0.22);
}

.level-test-question,
.level-test-question-title,
.level-test-options {
    direction: ltr;
    text-align: left;
}

.fh-classroom-countdown,
.fh-classroom-access-note,
.fh-classroom-locked,
.teacher-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--app-primary-soft);
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 800;
}

.fh-classroom-access-note { border-radius: 14px; color: var(--color-text-secondary); }

.fh-checkout-side,
.fh-classroom-table-card,
.fh-order-summary-card,
.fh-payment-methods {
    display: grid;
    gap: 16px;
}

.fh-payment-grid {
    display: grid;
    gap: 14px;
}

.fh-payment-option {
    display: block;
    cursor: pointer;
}

.fh-payment-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.fh-payment-option-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    min-height: 180px;
    padding: 20px;
    border-radius: var(--app-radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-bg-surface);
    box-shadow: var(--shadow-sm);
}

.fh-payment-option-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.fh-payment-logo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: min(100%, 220px);
}

.fh-payment-card-logo,
.fh-tamara-logo {
    width: 100%;
    max-width: 100%;
    height: 40px;
    object-fit: contain;
    padding: 8px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(15, 35, 68, 0.08);
}

.fh-tamara-logo {
    width: min(100%, 160px);
    height: 42px;
}

.fh-payment-option input:checked + .fh-payment-option-card {
    border-color: color-mix(in srgb, var(--color-primary) 38%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 14%, transparent), var(--shadow-md);
}

.fh-embedded-status,
.fh-checkout-loader {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fh-checkout-loader-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: fh-pulse 1s ease-in-out infinite;
}

.fh-embedded-payment-shell {
    min-height: 720px;
    padding: 10px;
    border-radius: var(--app-radius-md);
    overflow: hidden;
    background: var(--color-bg-surface-soft);
    border: 1px solid var(--color-border);
}

.auth-page { align-content: center; }
.auth-card { width: min(100%, 620px); }
.auth-card-tools { justify-content: flex-start; margin-bottom: 12px; }
.auth-brand-banner { justify-content: center; }
.auth-brand-wide,
.brand-logo-wide { width: min(100%, 250px); height: auto; background: transparent; box-shadow: none; border: 0; }
.brand-logo.brand-logo-dark { display: none; }
.brand-logo.brand-logo-light { display: block; }
.brand-lockup { display: grid; gap: 12px; justify-items: center; text-align: center; margin-bottom: 18px; }
.brand-lockup h1 { margin: 0; font-size: clamp(2rem, 3vw, 2.5rem); }
.brand-lockup p,
.auth-links a,
.auth-legal-consent a,
.legal-back { color: var(--color-text-secondary); }

.auth-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary-strong);
    background: color-mix(in srgb, var(--color-bg-surface-strong) 88%, var(--color-primary) 12%);
    border-color: color-mix(in srgb, var(--color-primary) 22%, transparent);
    box-shadow: var(--shadow-sm);
}

.auth-theme-toggle::before {
    content: "\263E";
    font-size: 18px;
    line-height: 1;
}

.auth-theme-toggle[data-theme-state="dark"]::before {
    content: "\2600";
}

body.theme-light .auth-page .fh-lang-toggle-inline,
body.theme-light .auth-page .fh-lang-toggle {
    color: #16345f;
    background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%);
    border-color: rgba(66, 144, 222, 0.28);
    box-shadow:
        0 10px 24px rgba(50, 95, 154, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    font-weight: 900;
}

body.theme-dark .auth-theme-toggle {
    color: var(--app-footer-text);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(148, 197, 255, 0.18);
}

.auth-intro {
    display: grid;
    gap: 10px;
    margin: 22px 0 24px;
    padding: 18px 20px;
    border-radius: var(--app-radius-md);
    background: linear-gradient(135deg, var(--app-primary-soft), color-mix(in srgb, var(--color-primary) 6%, var(--color-bg-surface-strong)));
    border: 1px solid var(--color-border);
}

body.theme-dark .auth-card {
    background: rgba(9, 24, 43, 0.98);
    border-color: rgba(148, 197, 255, 0.14);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.3);
}

body.theme-dark .auth-intro,
body.theme-dark .helper-note {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 197, 255, 0.14);
}

body.theme-dark .auth-input-shell,
body.theme-dark .phone-picker-trigger,
body.theme-dark .phone-picker-menu,
body.theme-dark .auth-legal-consent {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 197, 255, 0.14);
}

body.theme-dark .auth-field-label,
body.theme-dark .brand-lockup h1,
body.theme-dark .helper-note strong {
    color: var(--app-footer-text);
}

body.theme-dark .brand-lockup p,
body.theme-dark .auth-intro p,
body.theme-dark .field-hint,
body.theme-dark .helper-note p,
body.theme-dark .auth-links a,
body.theme-dark .auth-password-hint,
body.theme-dark .auth-legal-consent-copy {
    color: var(--app-footer-text-soft);
}

body.theme-dark .auth-input,
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
    color: var(--app-footer-text);
}

body.theme-dark .auth-input::placeholder,
body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder {
    color: rgba(237, 245, 255, 0.56);
}

body.theme-dark .auth-page .btn-secondary,
body.theme-dark .auth-page .btn-google,
body.theme-dark .auth-page .auth-divider span,
body.theme-dark .auth-page .phone-field-number input,
body.theme-dark .auth-page label > input:not(.auth-input),
body.theme-dark .auth-page label > select,
body.theme-dark .auth-page label > textarea,
body.theme-dark .auth-page .auth-password-meter,
body.theme-dark .auth-page .helper-note,
body.theme-dark .auth-page .auth-links a {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 197, 255, 0.14);
    color: var(--app-footer-text);
}

body.theme-dark .auth-page .btn-secondary:hover,
body.theme-dark .auth-page .btn-google:hover,
body.theme-dark .auth-page .btn-secondary:focus-visible,
body.theme-dark .auth-page .btn-google:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(148, 197, 255, 0.2);
    color: var(--app-footer-text);
}

body.theme-dark .auth-page .auth-divider span {
    color: var(--app-footer-text-soft);
}

body.theme-dark .auth-page .auth-links a {
    text-decoration-color: rgba(148, 197, 255, 0.24);
}

body.theme-dark .auth-page .btn-primary {
    color: #04121f;
}

body.theme-dark .auth-page .auth-input-shell {
    overflow: hidden;
}

body.theme-dark .auth-page .auth-input,
body.theme-dark .auth-page .auth-input-shell input,
body.theme-dark .auth-page .phone-field input,
body.theme-dark .auth-page .phone-field select {
    background: transparent !important;
    box-shadow: none !important;
    color: var(--app-footer-text) !important;
}

body.theme-dark .auth-page .auth-legal-consent a,
body.theme-dark .auth-page .legal-back {
    color: #8fd8ff;
    text-decoration-color: rgba(143, 216, 255, 0.4);
}

body.theme-dark .auth-page .auth-legal-consent a:hover,
body.theme-dark .auth-page .auth-legal-consent a:focus-visible,
body.theme-dark .auth-page .legal-back:hover,
body.theme-dark .auth-page .legal-back:focus-visible {
    color: #dff4ff;
}

body.theme-dark .auth-page input:-webkit-autofill,
body.theme-dark .auth-page input:-webkit-autofill:hover,
body.theme-dark .auth-page input:-webkit-autofill:focus,
body.theme-dark .auth-page textarea:-webkit-autofill,
body.theme-dark .auth-page select:-webkit-autofill {
    -webkit-text-fill-color: var(--app-footer-text) !important;
    caret-color: var(--app-footer-text);
    box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.04) inset !important;
    border-radius: inherit;
    transition: background-color 9999s ease-in-out 0s;
}

.auth-intro-kicker {
    display: inline-flex;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--color-bg-surface);
    color: var(--color-primary-strong);
    font-size: 13px;
    font-weight: 800;
}

.auth-field { display: grid; gap: 8px; }
.auth-field-label { font-weight: var(--font-weight-semibold); color: var(--color-primary-strong); }

.auth-input-shell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 0 14px;
    border-radius: 18px;
    border: 1px solid var(--color-border);
    background: linear-gradient(180deg, var(--color-bg-surface-strong) 0%, var(--color-bg-surface-soft) 100%);
    box-shadow: var(--shadow-sm);
}

.auth-input-shell:focus-within {
    border-color: var(--color-border-strong);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 16%, transparent);
}

.auth-input-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--app-primary-soft);
    color: var(--color-primary-strong);
    font-weight: var(--font-weight-extrabold);
}

.auth-input { flex: 1; width: auto; min-width: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.auth-input-toggle { border: 0; background: transparent; color: var(--color-primary); font-weight: var(--font-weight-semibold); padding: 0; }

.auth-divider { position: relative; margin: 18px 0; text-align: center; }
.auth-divider::before { content: ""; position: absolute; inset: 50% 0 auto; border-top: 1px solid var(--color-border); }
.auth-divider span { position: relative; display: inline-block; padding: 0 12px; background: var(--color-bg-surface); color: var(--color-text-secondary); font-weight: var(--font-weight-semibold); }
.auth-links { display: grid; gap: 8px; margin-top: 18px; }

.btn-google {
    border-color: var(--color-border);
    background: linear-gradient(180deg, var(--color-bg-surface-strong), var(--color-bg-surface));
    color: var(--color-text-primary);
    justify-content: center;
}

.btn-google:hover,
.btn-google:focus-visible {
    border-color: var(--color-border-strong);
    background: color-mix(in srgb, var(--color-bg-surface-strong) 92%, var(--color-primary) 8%);
}

body.theme-dark .btn-google {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 197, 255, 0.16);
    color: var(--app-footer-text);
}

.btn-google-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.btn-google-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.auth-legal-consent {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-surface-soft);
}

.auth-legal-consent-copy {
    display: block;
    line-height: 1.9;
}

.auth-legal-consent input {
    width: 18px;
    height: 18px;
    margin: 4px 0 0;
    accent-color: var(--color-primary);
}

.auth-legal-consent a {
    color: var(--color-primary-strong);
    font-weight: var(--font-weight-bold);
    text-decoration-thickness: 1.5px;
}

.auth-legal-consent a:hover,
.auth-legal-consent a:focus-visible,
.legal-back:hover,
.legal-back:focus-visible {
    color: var(--color-primary);
}

.phone-field { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 12px; }
.phone-picker,
.phone-field-number { position: relative; }

.phone-picker-trigger {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    background: linear-gradient(180deg, var(--color-bg-surface-strong), var(--color-bg-surface-soft));
    box-shadow: var(--shadow-sm);
}

.phone-picker-menu {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-start: 0;
    width: 260px;
    max-height: 240px;
    overflow: auto;
    padding: 8px;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-surface-strong);
    box-shadow: var(--shadow-lg);
    z-index: 20;
}

.phone-picker-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 0;
    border-radius: 14px;
    background: transparent;
}

.phone-picker-option:hover,
.phone-picker-option.is-selected { background: var(--app-primary-soft); }

.legal-page { padding-top: 48px; padding-bottom: 48px; }
.legal-card {
    width: min(920px, 100%);
    margin: 0 auto;
    padding: 32px;
    border-radius: var(--app-radius-lg);
    border: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-bg-surface-strong) 94%, transparent);
    box-shadow: var(--shadow-md);
}

.legal-head,
.legal-section { display: grid; gap: 12px; }

.legal-back {
    width: fit-content;
    color: var(--color-primary-strong);
    text-decoration: none;
    font-weight: var(--font-weight-bold);
}

.legal-head h1,
.legal-section h2 {
    color: var(--color-text-primary);
}

.legal-head p,
.legal-section p {
    color: var(--color-text-secondary);
    line-height: 1.9;
}

.legal-section {
    padding-top: 18px;
    border-top: 1px solid var(--color-border);
}

.student-onboarding-sidebar,
.teacher-student-profile-hero {
    padding: 28px;
    border-radius: var(--app-radius-lg);
    background: linear-gradient(160deg, color-mix(in srgb, var(--color-primary-strong) 92%, black) 0%, color-mix(in srgb, var(--color-primary) 72%, #1f7ed0) 100%);
    color: var(--app-footer-text);
    box-shadow: var(--shadow-lg);
}

.student-onboarding-panel { padding: 30px; }
.teacher-student-profile-page,
.student-onboarding-page { width: min(1240px, calc(100% - 40px)); }

.teachers-directory-page {
    display: grid;
    gap: 22px;
}

.teachers-directory-hero {
    padding: 28px;
}

.teachers-directory-copy {
    display: grid;
    align-content: center;
    gap: 12px;
}

.teachers-directory-kicker,
.teachers-directory-card-tag {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--app-primary-soft);
    border: 1px solid color-mix(in srgb, var(--app-primary) 18%, transparent);
    color: var(--color-primary-strong);
    font-size: 13px;
    font-weight: 800;
}

.teachers-directory-summary {
    display: grid;
    align-content: start;
    gap: 10px;
}

.teachers-directory-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.teachers-directory-card {
    display: grid;
    gap: 18px;
    text-align: right;
}

.teachers-directory-card-head {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

@media (max-width: 768px) {
    .auth-legal-consent {
        grid-template-columns: minmax(0, 1fr) 24px;
        align-items: start;
        gap: 12px;
        padding: 14px 16px;
    }

    .auth-legal-consent input {
        order: 0;
        margin: 2px 0 0;
        margin-inline-start: 0;
        justify-self: end;
    }

    .auth-legal-consent-copy {
        min-width: 0;
        line-height: 1.8;
    }

    .legal-card {
        padding: 22px;
        border-radius: 24px;
    }
}

.teachers-directory-avatar,
.fh-teacher-avatar {
    width: 96px;
    height: 96px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 28px;
    overflow: hidden;
    background: linear-gradient(135deg, #edf7ff, #d8f2ff 58%, #eaf1ff 100%);
    color: #0b4f95;
    font-size: 34px;
    font-weight: var(--font-weight-extrabold);
    border: 1px solid color-mix(in srgb, var(--app-primary) 12%, transparent);
}

.teachers-directory-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.teachers-directory-card-copy {
    display: grid;
    gap: 8px;
}

.teachers-directory-card h3 {
    margin: 0;
    font-size: 28px;
}

.teachers-directory-headline,
.teachers-directory-bio {
    margin: 0;
}

.teachers-directory-badges,
.teachers-directory-booking-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.teachers-directory-bookings {
    display: grid;
    gap: 10px;
    padding: 16px 18px;
    border-radius: var(--app-radius-md);
    background: var(--color-bg-surface-soft);
    border: 1px solid var(--color-border);
}

.teachers-directory-bookings-title {
    font-weight: 800;
}

.teachers-directory-booking-rules {
    display: grid;
    gap: 10px;
    padding: 16px 18px;
    border-radius: var(--app-radius-md);
    background: linear-gradient(180deg, color-mix(in srgb, var(--app-primary-soft) 72%, white) 0%, var(--color-bg-surface) 100%);
    border: 1px solid color-mix(in srgb, var(--app-primary) 14%, transparent);
}

.teachers-directory-booking-rules-title {
    font-weight: 800;
    color: var(--color-text-primary);
}

.teachers-directory-booking-rules-list {
    margin: 0;
    padding-inline-start: 18px;
    display: grid;
    gap: 8px;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.teachers-directory-booking-form {
    gap: 12px;
    padding: 18px;
    border-radius: var(--app-radius-md);
    background: linear-gradient(180deg, color-mix(in srgb, var(--color-bg-surface-soft) 88%, white) 0%, var(--color-bg-surface) 100%);
    border: 1px solid var(--color-border);
}

.teachers-directory-field {
    display: grid;
    gap: 8px;
}

.teachers-directory-booking-note {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(31, 111, 214, 0.06);
    border: 1px solid rgba(31, 111, 214, 0.12);
}

.teachers-directory-booking-note.is-warning {
    color: #9b5c00;
    background: rgba(255, 184, 0, 0.08);
    border-color: rgba(255, 184, 0, 0.18);
}

.teachers-directory-booking-note.is-success {
    color: #175d45;
    background: rgba(36, 183, 127, 0.08);
    border-color: rgba(36, 183, 127, 0.18);
}

.teachers-directory-readonly {
    margin-top: 6px;
}

.teachers-directory-guest-actions {
    margin-top: 6px;
}

.fh-label {
    display: block;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
}

.fh-input {
    width: 100%;
    max-width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    border-radius: var(--app-radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-bg-surface-soft);
    color: var(--color-text-primary);
}

.fh-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--app-success-soft);
    color: var(--color-success);
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
}

.fh-alert-info {
    background: var(--app-primary-soft);
    color: var(--color-primary-strong);
    border: 1px solid color-mix(in srgb, var(--app-primary) 18%, transparent);
}

@keyframes fh-pulse {
    0%, 100% { transform: scale(.7); opacity: .45; }
    50% { transform: scale(1); opacity: 1; }
}

body.theme-dark .brand-logo.brand-logo-light { display: none; }
body.theme-dark .brand-logo.brand-logo-dark { display: block; }

body.theme-dark .fh-nav-link,
body.theme-dark .fh-pill,
body.theme-dark .fh-logout {
    color: #ffffff;
}

body.theme-dark .fh-nav-link:hover,
body.theme-dark .fh-nav-link:focus-visible,
body.theme-dark .fh-pill:hover,
body.theme-dark .fh-pill:focus-visible,
body.theme-dark .fh-logout:hover,
body.theme-dark .fh-logout:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(117, 196, 255, 0.22);
}

body.theme-dark .fh-nav-link[aria-current="page"] {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(66, 196, 255, 0.2), rgba(255, 255, 255, 0.08));
    border-color: rgba(117, 196, 255, 0.24);
}

body.theme-dark .teachers-directory-avatar,
body.theme-dark .fh-teacher-avatar {
    background: linear-gradient(135deg, rgba(229, 243, 255, 0.96), rgba(193, 239, 255, 0.94), rgba(235, 241, 255, 0.92));
    color: #0b58a6;
}

body.theme-dark .teachers-directory-bookings,
body.theme-dark .teachers-directory-booking-form {
    background: var(--color-bg-surface-soft);
    border-color: var(--color-border);
}

body.theme-dark .teachers-directory-booking-rules {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(148, 197, 255, 0.16);
}

body.theme-dark .teachers-directory-booking-rules-title {
    color: var(--app-footer-text);
}

body.theme-dark .teachers-directory-booking-rules-list,
body.theme-dark .teachers-directory-booking-note {
    color: var(--app-footer-text-soft);
}

body.theme-dark .teachers-directory-booking-note {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 197, 255, 0.14);
}

body.theme-dark .teachers-directory-booking-note.is-warning {
    color: #ffd37a;
    background: rgba(255, 184, 0, 0.1);
    border-color: rgba(255, 184, 0, 0.2);
}

body.theme-dark .teachers-directory-booking-note.is-success {
    color: #b6ffd8;
    background: rgba(36, 183, 127, 0.12);
    border-color: rgba(36, 183, 127, 0.2);
}

body.theme-dark .page .fh-hero,
body.theme-dark .page .fh-card,
body.theme-dark .page .fh-item,
body.theme-dark .page .fh-empty,
body.theme-dark .page .fh-activity-item,
body.theme-dark .page .fh-order-summary-row,
body.theme-dark .page .fh-checkout-summary-list div,
body.theme-dark .page .fh-checkout-notes div,
body.theme-dark .page .fh-purchase-shell,
body.theme-dark .page .fh-checkout-side,
body.theme-dark .page .fh-order-summary-card,
body.theme-dark .page .fh-payment-methods,
body.theme-dark .page .fh-payment-option-card,
body.theme-dark .page .fh-embedded-payment-shell,
body.theme-dark .page .fh-checkout-alert,
body.theme-dark .page .teacher-student-card,
body.theme-dark .page .teacher-answer-card,
body.theme-dark .page .teacher-student-detail-card,
body.theme-dark .page .teacher-student-stat-card,
body.theme-dark .page .teacher-test-result-card,
body.theme-dark .page .student-choice-card,
body.theme-dark .page .student-test-question,
body.theme-dark .page .student-test-shell,
body.theme-dark .page .student-onboarding-panel {
    background: linear-gradient(180deg, rgba(11, 25, 45, 0.98), rgba(14, 32, 56, 0.98));
    border-color: rgba(148, 197, 255, 0.14);
    box-shadow: 0 24px 54px rgba(0, 0, 0, 0.26);
}

body.theme-dark .page .fh-hero {
    background:
        radial-gradient(circle at 88% 72%, rgba(79, 195, 255, 0.16), transparent 22%),
        radial-gradient(circle at 18% 22%, rgba(79, 195, 255, 0.08), transparent 24%),
        linear-gradient(135deg, rgba(10, 25, 47, 0.98) 0%, rgba(17, 40, 69, 0.98) 100%);
}

body.theme-dark .page .fh-card-dark,
body.theme-dark .page .student-onboarding-sidebar,
body.theme-dark .page .teacher-student-profile-hero {
    background:
        radial-gradient(circle at 82% 20%, rgba(79, 195, 255, 0.14), transparent 26%),
        linear-gradient(160deg, rgba(10, 30, 59, 0.98) 0%, rgba(22, 71, 133, 0.94) 100%);
    border-color: rgba(148, 197, 255, 0.18);
    color: var(--app-footer-text);
}

body.theme-dark .page .fh-title,
body.theme-dark .page .fh-item-title,
body.theme-dark .page .teacher-student-card-head h4,
body.theme-dark .page .teacher-student-detail-card h3,
body.theme-dark .page .student-step-head h2,
body.theme-dark .page .teacher-student-profile-copy h1 {
    color: var(--app-footer-text);
}

body.theme-dark .page .fh-subtitle,
body.theme-dark .page .fh-muted,
body.theme-dark .page .fh-section-copy,
body.theme-dark .page .fh-item-meta,
body.theme-dark .page .fh-item-note,
body.theme-dark .page .fh-activity-content small,
body.theme-dark .page .teacher-student-card-head p,
body.theme-dark .page .teacher-answer-card span,
body.theme-dark .page .student-onboarding-brand p,
body.theme-dark .page .student-onboarding-note span,
body.theme-dark .page .student-onboarding-progress-copy span,
body.theme-dark .page .student-test-head span {
    color: var(--app-footer-text-soft);
}

body.theme-dark .page .fh-kpi {
    color: #f3f8ff;
}

body.theme-dark .page .fh-badge,
body.theme-dark .page .teacher-status-pill,
body.theme-dark .page .student-onboarding-kicker,
body.theme-dark .page .student-step-chip-index,
body.theme-dark .page .teachers-directory-kicker,
body.theme-dark .page .teachers-directory-card-tag {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(148, 197, 255, 0.18);
    color: #e6f3ff;
}

body.theme-dark .page .student-step-chip,
body.theme-dark .page .student-onboarding-note,
body.theme-dark .page .student-onboarding-progress,
body.theme-dark .page .student-test-option,
body.theme-dark .page .teacher-student-card-badges .teacher-status-pill,
body.theme-dark .page .fh-classroom-countdown,
body.theme-dark .page .fh-classroom-access-note,
body.theme-dark .page .fh-classroom-locked {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 197, 255, 0.12);
    color: var(--app-footer-text-soft);
}

body.theme-dark .page .student-step-chip.is-active,
body.theme-dark .page .student-choice-card:has(input:checked),
body.theme-dark .page .student-test-option:has(input:checked) {
    background: linear-gradient(135deg, rgba(43, 176, 255, 0.18), rgba(255, 255, 255, 0.05));
    border-color: rgba(79, 195, 255, 0.28);
}

body.theme-dark .page .student-choice-card strong,
body.theme-dark .page .student-test-question strong,
body.theme-dark .page .student-test-option span,
body.theme-dark .page .student-onboarding-note strong,
body.theme-dark .page .student-onboarding-brand h1,
body.theme-dark .page .student-onboarding-progress-copy strong,
body.theme-dark .page .student-step-chip strong,
body.theme-dark .page .teacher-student-detail-card strong,
body.theme-dark .page .teacher-student-profile-copy .teacher-student-profile-kicker {
    color: var(--app-footer-text);
}

body.theme-dark .page .fh-activity-icon,
body.theme-dark .page .teacher-student-card-avatar,
body.theme-dark .page .student-choice-card-check {
    background: rgba(79, 195, 255, 0.14);
    color: #8fd8ff;
}

body.theme-dark .page .fh-table thead th,
body.theme-dark .page .fh-table tbody td {
    border-bottom-color: rgba(148, 197, 255, 0.12);
}

body.theme-dark .page .fh-table thead th {
    background: rgba(10, 24, 42, 0.98);
    color: var(--app-footer-text-soft);
}

body.theme-dark .page .fh-table tbody tr:hover {
    background: rgba(79, 195, 255, 0.06);
}

body.theme-dark .page .fh-btn-soft,
body.theme-dark .page .btn-secondary,
body.theme-dark .page .fh-room-state,
body.theme-dark .page .fh-input {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 197, 255, 0.14);
    color: var(--app-footer-text);
}

body.theme-dark .page .fh-btn-soft:hover,
body.theme-dark .page .btn-secondary:hover,
body.theme-dark .page .fh-room-state:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(148, 197, 255, 0.2);
}

body.theme-dark .page .fh-payment-option-card-tamara {
    background: linear-gradient(135deg, rgba(41, 14, 84, 0.98) 0%, rgba(78, 27, 132, 0.96) 100%);
    border-color: rgba(172, 124, 255, 0.28);
    color: #f3eefe;
}

body.theme-dark .page .fh-payment-copy,
body.theme-dark .page .fh-payment-title,
body.theme-dark .page .fh-checkout-alert,
body.theme-dark .page .fh-embedded-status {
    color: var(--app-footer-text-soft);
}

body.theme-dark .page .fh-payment-card-logo,
body.theme-dark .page .fh-tamara-logo {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(206, 220, 241, 0.8);
}

body.theme-dark .auth-page label > input:not(.auth-input),
body.theme-dark .auth-page label > select,
body.theme-dark .auth-page label > textarea,
body.theme-dark .auth-page .phone-field-number input,
body.theme-dark .auth-page .phone-picker-trigger,
body.theme-dark .auth-page .auth-password-meter,
body.theme-dark .auth-page .auth-divider span {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(148, 197, 255, 0.14) !important;
    color: var(--app-footer-text) !important;
}

body.theme-dark .auth-page .auth-divider::before {
    border-top-color: rgba(148, 197, 255, 0.16);
}

body.theme-dark .auth-page .field-hint,
body.theme-dark .auth-page .auth-password-hint,
body.theme-dark .auth-page .auth-legal-consent-copy {
    color: var(--app-footer-text-soft);
}

body.theme-dark .auth-page .auth-legal-consent {
    align-items: start;
}

body.theme-dark .auth-page .auth-legal-consent-copy a {
    color: #8fd8ff !important;
    font-weight: var(--font-weight-bold);
    text-decoration-color: rgba(143, 216, 255, 0.45);
}

body.theme-dark .auth-page .auth-legal-consent-copy a:hover,
body.theme-dark .auth-page .auth-legal-consent-copy a:focus-visible {
    color: #dff4ff !important;
}

body.theme-light .page .fh-hero,
body.theme-light .page .fh-card,
body.theme-light .page .fh-item,
body.theme-light .page .fh-empty,
body.theme-light .page .fh-activity-item,
body.theme-light .page .fh-order-summary-row,
body.theme-light .page .fh-checkout-summary-list div,
body.theme-light .page .fh-checkout-notes div,
body.theme-light .page .fh-purchase-shell,
body.theme-light .page .fh-checkout-side,
body.theme-light .page .fh-order-summary-card,
body.theme-light .page .fh-payment-methods,
body.theme-light .page .fh-payment-option-card,
body.theme-light .page .teacher-student-card,
body.theme-light .page .teacher-answer-card,
body.theme-light .page .teacher-student-detail-card,
body.theme-light .page .teacher-student-stat-card,
body.theme-light .page .teacher-test-result-card,
body.theme-light .page .student-choice-card,
body.theme-light .page .student-test-question,
body.theme-light .page .student-test-shell,
body.theme-light .page .student-onboarding-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 255, 0.96));
    border-color: rgba(18, 62, 117, 0.1);
}

body.theme-light .page .fh-title,
body.theme-light .page .fh-item-title,
body.theme-light .page .teacher-student-card-head h4,
body.theme-light .page .teacher-student-detail-card h3,
body.theme-light .page .student-step-head h2,
body.theme-light .page .teacher-student-profile-copy h1,
body.theme-light .page .student-onboarding-brand h1,
body.theme-light .page .student-onboarding-progress-copy strong,
body.theme-light .page .student-choice-card strong,
body.theme-light .page .student-test-question strong {
    color: #123a68 !important;
}

body.theme-light .page .fh-subtitle,
body.theme-light .page .fh-muted,
body.theme-light .page .fh-section-copy,
body.theme-light .page .fh-item-meta,
body.theme-light .page .fh-item-note,
body.theme-light .page .fh-activity-content small,
body.theme-light .page .teacher-student-card-head p,
body.theme-light .page .teacher-answer-card span,
body.theme-light .page .student-onboarding-brand p,
body.theme-light .page .student-onboarding-note span,
body.theme-light .page .student-onboarding-progress-copy span,
body.theme-light .page .student-test-head span,
body.theme-light .page .fh-empty {
    color: #5b7799 !important;
}

body.theme-light .page .fh-kpi {
    color: #0d3565;
}

body.theme-light .page .fh-badge,
body.theme-light .page .teacher-status-pill,
body.theme-light .page .student-onboarding-kicker,
body.theme-light .page .student-step-chip-index,
body.theme-light .page .teachers-directory-kicker,
body.theme-light .page .teachers-directory-card-tag,
body.theme-light .page .fh-classroom-countdown,
body.theme-light .page .fh-classroom-access-note,
body.theme-light .page .fh-classroom-locked {
    background: rgba(31, 111, 214, 0.08);
    border-color: rgba(31, 111, 214, 0.14);
    color: #1e568f !important;
}

body.theme-light .page .student-step-chip,
body.theme-light .page .student-onboarding-note,
body.theme-light .page .student-onboarding-progress,
body.theme-light .page .student-test-option {
    background: rgba(246, 250, 255, 0.98);
    border: 1px solid rgba(18, 62, 117, 0.1);
    color: #5b7799;
}

body.theme-light .page .student-step-chip.is-active,
body.theme-light .page .student-choice-card:has(input:checked),
body.theme-light .page .student-test-option:has(input:checked) {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(31, 111, 214, 0.08));
    border-color: rgba(31, 111, 214, 0.2);
}

body.theme-light .page .fh-activity-icon,
body.theme-light .page .teacher-student-card-avatar,
body.theme-light .page .student-choice-card-check {
    background: rgba(31, 111, 214, 0.1);
    color: #1f5d97;
}

body.theme-light .page .fh-btn-soft,
body.theme-light .page .btn-secondary,
body.theme-light .page .fh-room-state,
body.theme-light .page .fh-input {
    background: rgba(248, 251, 255, 0.98);
    border-color: rgba(18, 62, 117, 0.1);
    color: #123a68;
}

body.theme-light .page .fh-table thead th {
    background: rgba(255, 255, 255, 0.98);
    color: #5b7799;
}

@media (max-width: 1024px) {
    .fh-hero-grid,
    .fh-grid,
    .fh-checkout-grid,
    .student-onboarding-shell,
    .teacher-student-detail-grid { grid-template-columns: 1fr; }
    .fh-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .teacher-student-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .fh-navbar {
        inset-block-start: 10px;
        inset-inline: 8px;
        padding: 12px;
        border-radius: 24px;
    }

    .fh-navbar-head {
        position: relative;
        justify-content: center;
        min-height: 44px;
        padding-inline: 52px;
        gap: 0;
    }

    .fh-navbar-head-actions {
        display: contents;
    }

    .fh-brand {
        min-width: 0;
        flex: 0 1 auto;
        gap: 8px;
        justify-content: center;
        max-width: 100%;
    }

    .fh-brand-mark { width: 44px; height: 44px; border-radius: 14px; }
    .fh-brand-logo { width: 32px; height: 32px; }
    .fh-brand-text {
        min-width: 0;
    }
    .fh-brand-text strong {
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .fh-brand-text span { display: none; }
    .fh-navbar-head-actions .fh-theme-toggle-inline,
    .fh-navbar-head-actions .fh-nav-toggle {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        border-radius: 14px;
    }
    #fh_nav_toggle,
    #fh_theme_toggle {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }
    #fh_nav_toggle {
        inset-inline-start: 0;
    }
    #fh_theme_toggle {
        display: none;
    }
    .fh-nav-toggle::before { inset-block-start: 14px; }
    .fh-nav-toggle span { inset-block-start: 21px; }
    .fh-nav-toggle::after { inset-block-start: 28px; }
    .fh-nav-panel { display: none; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--app-sidebar-text) 12%, transparent); }
    .fh-navbar.is-open .fh-nav-panel { display: grid; }
    .fh-nav-main,
    .fh-nav-links,
    .fh-nav-meta { display: grid; width: 100%; }
    .fh-nav-link,
    .fh-pill,
    .fh-logout,
    .fh-theme-menu-toggle { width: 100%; }
    .fh-theme-menu-toggle {
        min-height: 44px;
        padding: 10px 16px;
        border-radius: 999px;
        border: 1px solid color-mix(in srgb, var(--app-sidebar-text) 10%, transparent);
        background: color-mix(in srgb, var(--app-sidebar-surface) 74%, transparent);
        color: var(--app-sidebar-text);
        font: inherit;
        font-weight: var(--font-weight-semibold);
        text-align: center;
        justify-content: center;
        box-shadow: none;
    }
    body.is-landing-nav-open::after { content: ""; position: fixed; inset: 0; background: var(--app-overlay); z-index: 30; }
    .auth-card,
    .fh-hero,
    .fh-card,
    .student-onboarding-sidebar,
    .student-onboarding-panel,
    .teacher-student-profile-hero { padding: 20px; border-radius: 24px; }
    .teachers-directory-card-head { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .teachers-directory-card { text-align: center; }
    .teachers-directory-badges,
    .teachers-directory-booking-pills,
    .teachers-directory-guest-actions { justify-content: center; }
    .phone-field,
    .student-choice-grid,
    .fh-homework-result-summary,
    .fh-stat-grid,
    .teacher-student-stat-grid,
    .teacher-answer-grid { grid-template-columns: 1fr; }
    .teacher-student-profile-page,
    .student-onboarding-page { width: min(100% - 16px, 100%); }

    .fh-classroom-table {
        min-width: 0;
    }

    .fh-classroom-table thead {
        display: none;
    }

    .fh-classroom-table tbody {
        display: grid;
        gap: 14px;
    }

    .fh-classroom-table tr {
        display: grid;
        gap: 10px;
        padding: 14px;
        border-radius: 20px;
        background: var(--color-bg-surface-soft);
        border: 1px solid var(--color-border);
        box-shadow: var(--shadow-sm);
    }

    .fh-classroom-table td {
        display: grid;
        grid-template-columns: minmax(92px, 120px) minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        padding: 0;
        border: 0;
        text-align: start;
    }

    .fh-classroom-table td::before {
        content: attr(data-label);
        color: var(--color-text-secondary);
        font-size: 12px;
        font-weight: 800;
    }

    .fh-classroom-table .fh-classroom-action-btn,
    .fh-classroom-table .fh-classroom-locked,
    .fh-classroom-table .fh-classroom-access-note,
    .fh-classroom-table .fh-classroom-countdown,
    .fh-classroom-table .admin-status {
        justify-self: start;
    }

    .fh-classroom-table .fh-classroom-action-btn {
        width: 100%;
        justify-content: center;
    }

    .level-test-option {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .level-test-option span {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .fh-title,
    .brand-lockup h1,
    .teacher-student-profile-copy h1,
    .student-step-head h2 { font-size: clamp(1.6rem, 8vw, 2.2rem); }
}
