:root {
    --app-ink: #1f2a26;
    --app-flame: #fc3c2a;
    --app-flame-deep: #7f211a;
    --app-clay: #b94a35;
    --app-marigold: #e8b64f;
    --app-parchment: #f8f1e7;
    --app-paper: #fffaf1;
    --app-mist: #dfd2c1;
    --app-muted: #68746f;
    --app-shadow: 0 22px 58px rgba(45, 35, 26, 0.13);
    --app-mobile-tabbar-height: 4.85rem;
}

html {
    background: var(--app-parchment);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 8%, rgba(252, 60, 42, 0.18), transparent 28rem),
        radial-gradient(circle at 80% 12%, rgba(232, 182, 79, 0.18), transparent 24rem),
        linear-gradient(135deg, #fff9ec 0%, var(--app-parchment) 48%, #fff1ec 100%);
    color: var(--app-ink);
    font-family: "Aptos", "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

.app-appbar {
    border-bottom: 1px solid rgba(255, 248, 236, 0.2);
    background: linear-gradient(110deg, var(--app-flame-deep), var(--app-flame)) !important;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff8ec;
    text-decoration: none;
}

.app-brand:hover {
    color: #fff8ec;
    text-decoration: none;
}

.app-brand-mark {
    display: inline-grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border: 1px solid rgba(255, 248, 236, 0.35);
    border-radius: 999px;
    background: rgba(255, 248, 236, 0.14);
    font-family: Georgia, serif;
    font-weight: 800;
}

.app-brand strong,
.app-brand small {
    display: block;
    line-height: 1.05;
}

.app-brand small {
    color: rgba(255, 248, 236, 0.76);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-auth-button,
.app-action-row .mud-button-root,
.app-dashboard-actions .mud-button-root,
.app-section-navigation .mud-button-root {
    border-radius: 999px !important;
    font-weight: 800 !important;
    text-transform: none !important;
}

.app-drawer {
    border-right: 1px solid rgba(252, 60, 42, 0.14);
    background: linear-gradient(180deg, rgba(255, 250, 241, 0.98), rgba(239, 228, 213, 0.92)) !important;
}

.app-drawer .mud-drawer-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-height: 100%;
    padding: 1.25rem 1rem;
}

.app-drawer-intro,
.app-drawer-note {
    border-radius: 1.35rem;
    padding: 1rem;
    background: rgba(252, 60, 42, 0.08);
}

.app-drawer-intro h2 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: 1.25rem;
    line-height: 1.15;
}

.app-nav .mud-nav-link {
    border-radius: 1rem;
    margin-bottom: 0.3rem;
}

.app-nav .mud-nav-link.active:not(.mud-nav-link-disabled) {
    background: rgba(252, 60, 42, 0.12);
    color: var(--app-flame-deep);
    font-weight: 800;
}

.app-drawer-note {
    margin-top: auto;
    border: 1px solid rgba(252, 60, 42, 0.18);
    background: rgba(255, 250, 241, 0.74);
}

.app-drawer-note span,
.app-eyebrow,
.app-card-kicker,
.app-priority-card span {
    color: var(--app-clay);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.app-drawer-note strong {
    display: block;
    margin-top: 0.25rem;
}

.app-drawer-note p {
    margin: 0.35rem 0 0;
    color: var(--app-muted);
    font-size: 0.88rem;
}

.app-mobile-tabbar {
    display: none;
}

.app-main {
    min-height: 100vh;
    padding-top: 4.25rem;
}

.app-page-shell {
    width: 100%;
    padding: clamp(1.25rem, 3vw, 3rem);
}

.app-hero,
.app-course-preview {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(20rem, 0.85fr);
    gap: clamp(1.25rem, 4vw, 3.5rem);
    align-items: stretch;
}

.app-hero {
    margin-bottom: clamp(1.5rem, 4vw, 3.5rem);
}

.app-card,
.app-hero-copy,
.app-hero-card,
.app-priority-card,
.app-course-preview,
.app-dashboard-card,
.app-not-found {
    border: 1px solid rgba(252, 60, 42, 0.13);
    border-radius: 1.6rem !important;
    box-shadow: var(--app-shadow);
    animation: app-rise 420ms ease both;
}

.app-hero-copy,
.app-course-preview,
.app-dashboard-card,
.app-priority-card,
.app-not-found {
    background: rgba(255, 250, 241, 0.84) !important;
}

.app-hero-copy {
    padding: clamp(1.5rem, 5vw, 4rem);
}

.app-hero-card {
    padding: clamp(1.25rem, 4vw, 2rem);
    background: linear-gradient(160deg, var(--app-flame), var(--app-flame-deep)) !important;
    color: #fff8ec;
    animation-delay: 80ms;
}

.app-priority-card,
.app-dashboard-card {
    height: 100%;
    padding: 1.35rem;
}

.app-hero h1,
.app-page-header h1,
.app-not-found h1 {
    max-width: 12ch;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 8vw, 6.5rem);
    line-height: 0.9;
    letter-spacing: -0.07em;
}

.app-hero-card h2,
.app-course-preview h2,
.app-priority-card h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1;
    letter-spacing: -0.045em;
}

.app-hero-card h2,
.app-course-preview h2 {
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.app-priority-card h2 {
    margin: 0.4rem 0;
    font-size: 1.55rem;
}

.app-lede,
.app-page-header p,
.app-course-preview p,
.app-priority-card p {
    color: var(--app-muted);
    line-height: 1.55;
}

.app-lede,
.app-page-header p,
.app-course-preview p {
    max-width: 46rem;
    font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.app-chip-row,
.app-action-row,
.app-dashboard-actions,
.app-dashboard-header,
.app-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.app-chip-row {
    margin-bottom: 2rem;
}

.app-action-row {
    margin-top: 2rem;
}

.app-progress-list,
.app-course-flow {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.5rem;
}

.app-progress-list article,
.app-course-flow article {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.9rem;
    padding: 1rem;
    border-radius: 1.2rem;
    background: rgba(255, 248, 236, 0.1);
}

.app-course-flow {
    margin-top: 0;
}

.app-course-flow article {
    background: rgba(252, 60, 42, 0.07);
}

.app-progress-list span {
    display: inline-grid;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    border-radius: 999px;
    background: var(--app-marigold);
    color: var(--app-ink);
    font-weight: 900;
}

.app-course-flow span {
    display: inline-grid;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    border-radius: 999px;
    background: var(--app-flame);
    color: #fff8ec;
    font-weight: 900;
}

.app-priority-card .mud-icon-root {
    color: var(--app-flame);
}

.app-logo-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1.2rem;
}

.app-logo-strip img {
    width: 100%;
    height: 12rem;
    border-radius: 1.1rem;
    object-fit: contain;
    padding: 0.8rem;
    background: rgba(255, 250, 241, 0.94);
}

.app-hero-photo {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.app-hero-photo img {
    width: 100%;
    max-height: 17rem;
    border-radius: 1.25rem;
    object-fit: cover;
}

.app-hero-photo p {
    color: rgba(255, 248, 236, 0.82);
    line-height: 1.55;
}

.app-course-preview {
    margin-top: clamp(1.5rem, 5vw, 4rem);
    padding: clamp(1.5rem, 4vw, 3rem);
    background: linear-gradient(135deg, rgba(245, 199, 189, 0.58), rgba(255, 250, 241, 0.74)) !important;
    box-shadow: none;
}

.app-dashboard-header,
.app-status-row {
    justify-content: space-between;
}

.app-dashboard-header span,
.app-status-row span {
    color: var(--app-muted);
    font-size: 0.85rem;
    font-weight: 800;
}

.app-dashboard-header strong {
    display: block;
    margin-top: 0.25rem;
    font-family: Georgia, serif;
    font-size: 1.45rem;
}

.app-progress,
.app-alert,
.app-stat-grid,
.app-course-grid {
    margin-top: 1.25rem;
}

.app-course-card {
    height: 100%;
    border: 1px solid rgba(252, 60, 42, 0.13);
    border-radius: 1.6rem !important;
    background: rgba(255, 250, 241, 0.86) !important;
    box-shadow: var(--app-shadow);
}

.app-bio-card {
    height: 100%;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid rgba(252, 60, 42, 0.13);
    border-radius: 1.6rem !important;
    background: rgba(255, 250, 241, 0.86) !important;
    box-shadow: var(--app-shadow);
}

.app-bio-copy {
    color: var(--app-muted);
    line-height: 1.6;
}

.app-bio-photo {
    display: grid;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.app-bio-photo-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-bio-photo img {
    width: 100%;
    height: clamp(17rem, 32vw, 24rem);
    border-radius: 1.25rem;
    object-fit: cover;
}

.app-bio-next-step {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.app-course-meta {
    color: var(--app-muted);
}

.app-course-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0 1rem 1rem !important;
}

.app-player-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.app-player-header h1 {
    max-width: 14ch;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.8rem, 6vw, 5rem);
    line-height: 0.92;
    letter-spacing: -0.06em;
}

.app-player-header p {
    max-width: 44rem;
    color: var(--app-muted);
    font-size: 1.1rem;
    line-height: 1.55;
}

.app-player-shell {
    display: grid;
    grid-template-columns: minmax(16rem, 0.35fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.app-section-rail,
.app-player-panel,
.app-question-card {
    border: 1px solid rgba(252, 60, 42, 0.13);
    border-radius: 1.6rem !important;
    background: rgba(255, 250, 241, 0.86) !important;
    box-shadow: var(--app-shadow);
}

.app-section-rail {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 7rem);
    min-height: 0;
    overflow: hidden;
    position: sticky;
    top: 5.5rem;
    padding: 1rem;
}

.app-section-list {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0.75rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.25rem;
    scrollbar-color: rgba(252, 60, 42, 0.62) rgba(252, 60, 42, 0.08);
}

.app-section-item {
    border-radius: 1rem !important;
}

.app-section-item.selected {
    background: rgba(252, 60, 42, 0.12);
    color: var(--app-flame-deep);
    font-weight: 800;
}

.app-player-panel,
.app-question-card {
    padding: clamp(1rem, 3vw, 1.5rem);
}

.app-section-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.app-section-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin: 1rem 0 1.25rem;
}

.app-section-navigation-bottom {
    margin: 1.5rem 0 0;
}

.app-sample-quiz,
.app-answer-list,
.app-lesson-copy,
.app-picture-grid {
    margin-top: 1.25rem;
}

.app-answer-list p,
.app-lesson-copy p {
    color: var(--app-muted);
    line-height: 1.6;
}

.app-correct-answer {
    color: var(--app-ink) !important;
    font-weight: 900;
}

.app-picture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 1rem;
}

.app-picture-grid img,
.app-video {
    width: 100%;
    border-radius: 1.25rem;
}

.app-video {
    max-height: 34rem;
    margin-top: 1.25rem;
    background: #1f2a26;
}

.app-audio {
    width: 100%;
    margin-top: 0.75rem;
}

.app-page-header {
    max-width: 70rem;
    margin-bottom: 2rem;
}

.app-not-found {
    max-width: 48rem;
    margin: 4rem auto;
    padding: clamp(1.5rem, 5vw, 3rem);
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 10000;
    max-width: 32rem;
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    background: #a94438;
    color: #fff8ec;
    box-shadow: var(--app-shadow);
}

@keyframes app-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 960px) {
    .app-hero,
    .app-course-preview,
    .app-player-shell {
        grid-template-columns: 1fr;
    }

    .app-section-rail {
        max-height: min(26rem, 70vh);
        position: static;
    }

    .app-player-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .app-appbar {
        padding-left: max(0.35rem, env(safe-area-inset-left)) !important;
        padding-right: max(0.6rem, env(safe-area-inset-right)) !important;
    }

    .app-brand {
        gap: 0.55rem;
        min-width: 0;
    }

    .app-brand-mark {
        width: 2.1rem;
        height: 2.1rem;
        font-size: 0.9rem;
    }

    .app-brand strong {
        max-width: 8.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-auth-button {
        min-width: auto !important;
        padding: 0.45rem 0.75rem !important;
        white-space: nowrap;
    }

    .app-drawer {
        max-width: calc(100vw - 2rem);
        border-radius: 0 1.35rem 1.35rem 0;
        box-shadow: 18px 0 42px rgba(45, 35, 26, 0.18);
    }

    .app-drawer .mud-drawer-content {
        gap: 1rem;
        padding: 1rem 0.85rem calc(1rem + env(safe-area-inset-bottom));
    }

    .app-drawer-intro {
        padding: 0.9rem;
    }

    .app-drawer-intro h2 {
        font-size: 1.1rem;
    }

    .app-drawer-note {
        display: none;
    }

    .app-main {
        padding-bottom: calc(var(--app-mobile-tabbar-height) + env(safe-area-inset-bottom));
    }

    .app-page-shell {
        padding: 1rem;
    }

    .app-brand small {
        display: none;
    }

    .app-card,
    .app-hero-copy,
    .app-hero-card,
    .app-priority-card,
    .app-course-preview,
    .app-dashboard-card,
    .app-course-card,
    .app-bio-card,
    .app-section-rail,
    .app-player-panel,
    .app-question-card,
    .app-not-found {
        border-radius: 1.25rem !important;
        box-shadow: 0 14px 34px rgba(45, 35, 26, 0.12);
    }

    .app-hero {
        gap: 1rem;
        margin-bottom: 1.25rem;
    }

    .app-hero-copy,
    .app-hero-card,
    .app-dashboard-card,
    .app-priority-card,
    .app-bio-card,
    .app-player-panel,
    .app-section-rail,
    .app-course-preview {
        padding: 1rem;
    }

    .app-hero h1,
    .app-page-header h1,
    .app-player-header h1,
    .app-not-found h1 {
        max-width: none;
        font-size: clamp(2.15rem, 11vw, 3.2rem);
        line-height: 0.96;
        letter-spacing: -0.055em;
    }

    .app-hero-card h2,
    .app-course-preview h2 {
        font-size: clamp(1.6rem, 9vw, 2.25rem);
    }

    .app-page-header {
        margin-bottom: 1.2rem;
    }

    .app-page-header p,
    .app-player-header p,
    .app-lede,
    .app-course-preview p,
    .app-priority-card p,
    .app-bio-copy {
        font-size: 1rem;
        line-height: 1.55;
    }

    .app-chip-row {
        gap: 0.45rem;
        margin-bottom: 1rem;
    }

    .app-action-row,
    .app-dashboard-actions,
    .app-course-actions,
    .app-course-card-header,
    .app-course-card-meta,
    .app-player-actions,
    .app-test-actions,
    .app-bio-next-step {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .app-action-row,
    .app-dashboard-actions,
    .app-course-actions {
        margin-top: 1.25rem;
    }

    .app-action-row .mud-button-root,
    .app-dashboard-actions .mud-button-root,
    .app-course-actions .mud-button-root,
    .app-player-actions .mud-button-root,
    .app-section-navigation .mud-button-root,
    .app-test-actions .mud-button-root,
    .app-test-submit {
        width: 100% !important;
        min-height: 2.9rem;
    }

    .app-stat-grid,
    .app-course-grid {
        margin-top: 1rem;
    }

    .app-stat-grid .app-dashboard-card {
        min-height: auto;
    }

    .app-course-card .mud-card-content {
        padding: 1rem !important;
    }

    .app-course-card-header {
        gap: 0.75rem !important;
    }

    .app-course-card-header .mud-chip {
        align-self: flex-start;
    }

    .app-course-card-meta {
        gap: 0.45rem !important;
    }

    .app-course-actions {
        padding: 0 1rem 1rem !important;
    }

    .app-progress-list article,
    .app-course-flow article {
        grid-template-columns: 1fr;
        gap: 0.6rem;
        padding: 0.85rem;
    }

    .app-player-header {
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .app-player-actions {
        width: 100%;
    }

    .app-player-shell {
        gap: 1rem;
    }

    .app-player-panel {
        order: 1;
    }

    .app-section-rail {
        order: 2;
        max-height: min(19rem, 42vh);
    }

    .app-section-list {
        margin-top: 0.55rem;
        padding-right: 0;
    }

    .app-section-item {
        min-height: 3rem;
    }

    .app-section-heading {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .app-section-heading .mud-typography-h3 {
        font-size: clamp(1.65rem, 9vw, 2.15rem);
        line-height: 1;
    }

    .app-section-heading .mud-chip {
        align-self: flex-start;
    }

    .app-final-test-panel .app-section-heading {
        position: sticky;
        top: 4.85rem;
        z-index: 5;
        margin: -0.35rem -0.35rem 1rem;
        border: 1px solid rgba(252, 60, 42, 0.12);
        border-radius: 1rem;
        padding: 0.85rem;
        background: rgba(255, 250, 241, 0.96);
        box-shadow: 0 12px 28px rgba(45, 35, 26, 0.1);
        backdrop-filter: blur(12px);
    }

    .app-test-timer-chip,
    .app-answer-select,
    .app-answer-select .mud-input,
    .app-answer-select .mud-select,
    .app-test-question-list .mud-input-control {
        width: 100%;
    }

    .app-answer-select {
        max-width: none !important;
        min-width: 0;
    }

    .app-test-timer-chip {
        justify-content: center;
        min-height: 2.55rem;
    }

    .app-test-question-list {
        align-items: stretch !important;
    }

    .app-test-question-list > *,
    .app-question-card .mud-input-control {
        width: 100% !important;
    }

    .app-question-card {
        padding: 1rem;
    }

    .app-question-card .mud-typography-subtitle1 {
        font-size: 1.02rem;
        line-height: 1.35;
    }

    .app-answer-list {
        display: grid;
        gap: 0.45rem;
        margin-top: 0.9rem;
    }

    .app-answer-list p {
        margin: 0;
        border-radius: 0.85rem;
        padding: 0.65rem 0.75rem;
        background: rgba(252, 60, 42, 0.06);
    }

    .app-section-navigation {
        gap: 0.55rem;
        margin: 0.8rem 0 1rem;
        width: 100%;
    }

    .app-video {
        max-height: min(18rem, 58vw);
        margin-top: 0.75rem;
        border-radius: 1rem;
    }

    .app-picture-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-top: 1rem;
    }

    .app-lesson-copy {
        margin-top: 1rem;
    }

    .app-dashboard-header,
    .app-status-row,
    .app-section-navigation {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-logo-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
        margin-top: 0.8rem;
    }

    .app-logo-strip img {
        height: 6.25rem;
        border-radius: 0.9rem;
        padding: 0.55rem;
    }

    .app-hero-photo {
        gap: 0.75rem;
        margin-top: 0.75rem;
    }

    .app-hero-photo img {
        max-height: 11rem;
        border-radius: 1rem;
    }

    .app-course-preview {
        gap: 1rem;
        margin-top: 1.25rem;
    }

    .app-bio-photo {
        gap: 0.65rem;
        margin-bottom: 1rem;
    }

    .app-bio-photo-pair {
        grid-template-columns: 1fr;
    }

    .app-bio-photo img {
        height: min(18rem, 70vw);
        border-radius: 1rem;
    }

    .app-bio-next-step {
        gap: 1rem;
    }

    .app-mobile-tabbar {
        position: fixed;
        right: max(0.75rem, env(safe-area-inset-right));
        bottom: max(0.75rem, env(safe-area-inset-bottom));
        left: max(0.75rem, env(safe-area-inset-left));
        z-index: 1400;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        gap: 0.35rem;
        border: 1px solid rgba(252, 60, 42, 0.18);
        border-radius: 1.35rem;
        padding: 0.45rem;
        background: rgba(255, 250, 241, 0.92);
        box-shadow: 0 16px 38px rgba(45, 35, 26, 0.2);
        backdrop-filter: blur(18px);
    }

    .app-mobile-tab {
        display: inline-flex;
        min-width: 0;
        min-height: 3.45rem;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 0.2rem;
        border-radius: 1rem;
        color: var(--app-muted);
        font-size: 0.72rem;
        font-weight: 900;
        line-height: 1;
        text-align: center;
        text-decoration: none;
    }

    .app-mobile-tab:hover,
    .app-mobile-tab:focus {
        color: var(--app-flame-deep);
        text-decoration: none;
    }

    .app-mobile-tab.active {
        background: rgba(252, 60, 42, 0.13);
        color: var(--app-flame-deep);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
