@font-face {
    font-family: Figtree;
    src: url('/assets/fonts/figtree-latin.woff2') format('woff2');
    font-style: normal;
    font-weight: 400 700;
    font-display: swap
}

@font-face {
    font-family: Gloock;
    src: url('/assets/fonts/gloock-latin.woff2') format('woff2');
    font-style: normal;
    font-weight: 400;
    font-display: swap
}

:root {
    --page-background: #e6ebe2;
    --surface-background: #f6f7f2;
    --text: #1d2620;
    --text-strong: #2a332d;
    --text-muted: #4f5a52;
    --primary: #2f4a3a;
    --primary-hover: #3b5a47;
    --primary-soft: #4c6b57;
    --surface-tint: #d7e2d5;
    --surface-highlight: #c9d6c4;
    --accent-soft: #ebc9bc;
    --border-subtle: #dde3d9;
    --border: #c5cfc1;
    --accent: #b4482a;
    --danger: #a02f25;
    --success: #2f6b49;
    --on-dark: #fff;
    --hero-overlay-start: rgb(20 35 27 / 84%);
    --hero-overlay-end: rgb(20 35 27 / 35%);
    --media-background: #152019;
    --font-display: Gloock, Georgia, serif;
    --font-body: Figtree, system-ui, sans-serif;
    color: var(--text);
    font: 400 16px/1.5 var(--font-body)
}

*,
*::before,
*::after {
    box-sizing: border-box
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--page-background)
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--page-background);
    color: var(--text)
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
    margin: 0
}

ul,
ol {
    padding: 0;
    list-style: none
}

a {
    color: inherit;
    text-decoration: none
}

button,
input,
textarea {
    font: inherit;
    color: inherit
}

button {
    cursor: pointer
}

svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.12
}

img,
video,
audio {
    max-width: 100%
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap
}

.main-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 30rem;
    min-height: 100vh;
    min-height: 100dvh;
    margin-inline: auto
}

.app-main {
    flex: 1;
    padding: 20px 20px 22px
}

.page {
    display: flex;
    flex-direction: column;
    gap: 16px
}

.page>header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px
}

.page>header .text {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column
}

.page>header h1,
.profile-page>header h1 {
    font-size: 2rem
}

.page>header .text>p:first-child,
.profile-page>header p {
    margin-bottom: 4px;
    color: var(--accent);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase
}

.page>header .text>h1+p {
    margin-top: 5px;
    color: var(--text-muted)
}

.demo-badge {
    align-self: center;
    margin-top: 10px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    font-size: .7rem;
    font-weight: 700
}

.impersonation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px;
    background: #ffe5df;
    color: #761f17;
    font-size: .85rem;
    font-weight: 700
}

.impersonation form {
    margin: 0
}

.impersonation button {
    border: 1px solid currentColor;
    border-radius: 999px;
    background: transparent;
    padding: 5px 10px
}

.nav-container {
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding: 0 12px max(18px, env(safe-area-inset-bottom));
    pointer-events: none
}

.nav-container nav {
    height: 68px;
    padding: 6px;
    border-radius: 34px;
    background: var(--text);
    box-shadow: 0 12px 35px rgb(29 38 32 / 22%);
    pointer-events: auto
}

.nav-container ul {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: 100%
}

.nav-container li {
    display: flex
}

.nav-container a {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 28px;
    color: var(--surface-tint);
    font-size: .68rem;
    font-weight: 600
}

.nav-container a[aria-current=page] {
    background: var(--surface-background);
    color: var(--text);
    font-weight: 700
}

.nav-container a:focus-visible {
    outline-offset: -2px
}

.master-card {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    padding: 20px;
    border-radius: 28px;
    background: var(--primary);
    color: var(--surface-background)
}

.master-card::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -42px;
    right: -42px;
    width: 155px;
    height: 155px;
    border-radius: 50%;
    background: var(--primary-hover)
}

.master-card h2 {
    font-size: 1.5rem
}

.master-card p {
    color: var(--surface-tint);
    font-size: .82rem;
    font-weight: 600
}

.master-card progress {
    appearance: none;
    width: 100%;
    height: 6px;
    overflow: hidden;
    border: 0;
    border-radius: 3px;
    background: var(--primary-soft)
}

.master-card progress::-webkit-progress-bar {
    background: var(--primary-soft)
}

.master-card progress::-webkit-progress-value {
    background: var(--surface-background)
}

.master-card progress::-moz-progress-bar {
    background: var(--surface-background)
}

.master-card>a,
.master-card>button,
.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 0;
    border-radius: 24px;
    padding: 0 20px;
    font-weight: 700;
    text-decoration: none
}

.master-card>a,
.master-card>button {
    align-self: flex-start;
    background: var(--surface-background);
    color: var(--text)
}

.primary-button {
    background: var(--accent);
    color: var(--on-dark)
}

.secondary-button {
    border: 1px solid var(--border);
    background: var(--surface-background);
    color: var(--text)
}

.danger {
    color: var(--danger)
}

.secondary-card,
.content-card,
.form-card,
.message-card {
    border-radius: 28px;
    background: var(--surface-background)
}

.secondary-card {
    padding: 6px 18px
}

.secondary-card li+li {
    border-top: 1px solid var(--border-subtle)
}

.secondary-card li>a {
    min-height: 68px
}

.back-link {
    align-self: flex-start;
    color: var(--text-muted);
    font-size: .88rem;
    font-weight: 700
}

.back-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-background);
    font-size: 1.25rem
}

.round-button,
.avatar-button {
    display: grid;
    flex: none;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--surface-background);
    font-weight: 700
}

.text-button {
    border: 0;
    background: transparent;
    padding: 0;
    font-size: .8rem;
    font-weight: 700
}

.notice,
.demo-notice {
    border-radius: 16px;
    padding: 12px 14px;
    font-size: .88rem
}

.notice-error {
    background: #ffe5df;
    color: #761f17
}

.notice-success {
    background: #dceee1;
    color: #1f5637
}

.notice-warning {
    background: #fff0ce;
    color: #6e4a00
}

.demo-notice {
    display: flex;
    gap: 8px;
    background: var(--accent-soft);
    color: var(--text-strong)
}

.demo-notice strong {
    white-space: nowrap
}

.future-badge {
    align-self: flex-start;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--text);
    padding: 3px 8px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase
}

.future-control[aria-disabled=true] {
    cursor: not-allowed;
    opacity: .62
}

.filter-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px;
    scrollbar-width: none
}

.filter-pills::-webkit-scrollbar {
    display: none
}

.filter-pills button,
.filter-pills a {
    display: inline-flex;
    align-items: center;
    flex: none;
    min-height: 42px;
    border: 0;
    border-radius: 22px;
    padding: 0 16px;
    background: var(--surface-background);
    font-size: .84rem;
    font-weight: 600
}

.filter-pills [aria-pressed=true],
.filter-pills [aria-current=page] {
    background: var(--text);
    color: var(--surface-background)
}

.filter-pills button:disabled {
    cursor: not-allowed;
    opacity: .75
}

.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-top: 8px;
    padding: 4px;
    border-radius: 26px;
    background: var(--surface-background)
}

.segmented a {
    display: grid;
    min-height: 44px;
    place-items: center;
    border-radius: 22px;
    color: var(--text-muted);
    font-size: .92rem;
    font-weight: 600
}

.segmented a[aria-current=page] {
    background: var(--text);
    color: var(--surface-background);
    font-weight: 700
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 34px 22px;
    border-radius: 28px;
    background: var(--surface-background);
    text-align: center
}

.empty-state>span {
    display: grid;
    min-width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 50%;
    background: var(--page-background);
    color: var(--primary);
    font-size: 1.4rem;
    font-weight: 700
}

.empty-state h1,
.empty-state h2 {
    font-size: 1.45rem
}

.empty-state p {
    max-width: 28rem;
    color: var(--text-muted)
}

.empty-state .primary-button {
    margin-top: 7px
}

.error-state {
    margin-top: 15vh
}

.home-header {
    display: grid !important;
    grid-template-columns: 1fr auto;
    align-items: center !important;
    row-gap: 18px
}

.home-header .text {
    grid-column: 1/-1
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.35rem
}

.welcome-card {
    min-height: 220px
}

.welcome-card--with-preview {
    background-image: linear-gradient(90deg, var(--hero-overlay-start), var(--hero-overlay-end)), url('/assets/website/presentation.webp');
    background-position: center;
    background-size: cover
}

.welcome-card--with-preview::before {
    display: none
}

.welcome-card h2 {
    max-width: 230px;
    margin-top: 4px
}

.welcome-card button {
    margin-top: auto
}

.home-sections li a {
    display: grid;
    grid-template-columns: 1fr auto;
    align-content: center;
    column-gap: 12px;
    padding: 8px 0
}

.home-sections li a::after {
    content: "›";
    grid-column: 2;
    grid-row: 1/span 2;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    background: var(--page-background);
    font-size: 1.6rem
}

.home-sections li:last-child a::after {
    background: var(--accent);
    color: #fff
}

.home-sections h2 {
    font-size: 1.25rem
}

.home-sections p {
    font-size: .8rem;
    color: var(--text-muted)
}

.media-dialog {
    width: min(92vw, 760px);
    border: 0;
    border-radius: 24px;
    padding: 16px;
    background: var(--surface-background);
    box-shadow: 0 25px 70px rgb(29 38 32 / 35%)
}

.media-dialog::backdrop {
    background: rgb(29 38 32 / 70%)
}

.media-dialog video {
    display: block;
    width: 100%;
    border-radius: 16px
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px
}

.dialog-header h2 {
    font-size: 1.2rem
}

.dialog-header button {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--page-background);
    font-size: 1.4rem
}

.welcome-video-dialog {
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    background: #101410;
    color: #fff;
    box-shadow: none
}

.welcome-video-dialog[open] {
    display: flex;
    flex-direction: column
}

.welcome-video-dialog .dialog-header {
    flex: none;
    margin-bottom: 8px
}

.welcome-video-dialog .dialog-header h2 {
    font-family: var(--font-body);
    font-size: 1rem
}

.welcome-video-dialog .dialog-header button {
    display: block;
    width: auto;
    min-height: 44px;
    border-radius: 22px;
    padding: 0 16px;
    background: #303830;
    color: #fff;
    font-size: .85rem
}

.welcome-video-dialog video {
    flex: 1;
    min-height: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: contain
}

.welcome-video-error {
    padding: 12px;
    text-align: center
}

.page-courses>header {
    display: block
}

.course-featured {
    margin-top: 2px
}

.course-featured-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    font-weight: 700
}

.course-featured-progress progress {
    flex: 1;
    min-width: 0
}

.course-featured>small {
    display: block;
    margin-top: 8px;
    color: var(--text-muted)
}

.course-list li a,
.catalogue-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 7px 0
}

.course-row-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0
}

.course-row-text {
    min-width: 0;
    overflow-wrap: anywhere
}

.course-row-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--text-muted);
    font-size: .78rem;
    font-weight: 700
}

.course-row-progress progress {
    appearance: none;
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 6px;
    overflow: hidden;
    border: 0;
    border-radius: 3px;
    background: var(--surface-tint)
}

.course-row-progress progress::-webkit-progress-bar {
    background: var(--surface-tint)
}

.course-row-progress progress::-webkit-progress-value {
    background: var(--primary)
}

.course-row-progress progress::-moz-progress-bar {
    background: var(--primary)
}

.catalogue-row>div {
    overflow-wrap: anywhere
}

.course-list .sur-titre,
.catalogue-list .sur-titre,
.news-list .sur-titre {
    display: block;
    color: var(--accent);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase
}

.course-list .titre,
.catalogue-list .titre,
.news-list .titre {
    display: block;
    margin: 3px 0;
    font-size: .95rem
}

.course-list .sous-titre,
.catalogue-list .sous-titre,
.news-list .sous-titre {
    color: var(--text-muted);
    font-size: .78rem
}

.course-list li small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: .7rem
}

.course-list li>a>span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: var(--page-background);
    font-size: 1.5rem
}

.media-card {
    gap: 16px
}

.media-card::before {
    display: none
}

.media-card video {
    width: 100%;
    border-radius: 18px;
    background: var(--media-background)
}

.media-card>div h2 {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5
}

.lesson-list {
    padding: 0 18px
}

.lesson-list>header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-subtle)
}

.lesson-list>header img {
    width: 100%;
    height: auto;
    border-radius: 18px;
    object-fit: cover
}

.lesson-list>header small {
    color: var(--accent);
    font-weight: 700
}

.lesson-list>header h2 {
    font-size: 1.35rem
}

.lesson-list>header p {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: .85rem
}

.lesson-list li>a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0
}

.lesson-number {
    display: grid;
    flex: none;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 2px solid var(--border);
    border-radius: 50%;
    font-size: .78rem;
    font-weight: 700
}

.lesson-list li.done .lesson-number {
    border: 0;
    background: var(--primary);
    color: #fff
}

.lesson-list li.current .lesson-number {
    border: 0;
    background: var(--accent);
    color: #fff
}

.lesson-list li a>span:last-child {
    display: flex;
    flex-direction: column
}

.lesson-list li strong {
    font-size: .92rem
}

.lesson-list li small {
    color: var(--text-muted);
    font-size: .74rem
}

.content-card {
    padding: 22px
}

.rich-content {
    min-width: 0;
    overflow-wrap: anywhere
}

.rich-content .math-display {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overflow-wrap: normal
}

.rich-content .katex-display {
    margin: .75em 0
}

.rich-content h1,
.rich-content h2,
.rich-content h3 {
    margin: 1.5em 0 .55em
}

.rich-content h1:first-child,
.rich-content h2:first-child,
.rich-content h3:first-child {
    margin-top: 0
}

.rich-content p,
.rich-content ul,
.rich-content ol {
    margin: .8em 0
}

.rich-content ul {
    padding-left: 1.25rem;
    list-style: disc
}

.rich-content ol {
    padding-left: 1.25rem;
    list-style: decimal
}

.rich-content a {
    color: var(--accent);
    text-decoration: underline
}

.rich-content img {
    height: auto;
    border-radius: 18px
}

.quiz-card>h2 {
    margin-bottom: 16px
}

.quiz-card fieldset {
    margin: 20px 0;
    padding: 0;
    border: 0
}

.quiz-card legend {
    margin-bottom: 12px;
    font-family: var(--font-display);
    font-size: 1.1rem
}

.choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0;
    padding: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    background: #fff
}

.choice input {
    margin-top: 4px;
    accent-color: var(--accent)
}

.answer-feedback {
    margin-top: 10px;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: .84rem
}

.answer-feedback p {
    margin: 3px 0
}

.is-correct {
    background: #dceee1;
    color: #1f5637
}

.is-wrong {
    background: #ffe5df;
    color: #761f17
}

.joker-card {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border-subtle)
}

.joker-card h3 {
    font-size: 1.15rem
}

.joker-card p {
    margin: 6px 0 12px;
    color: var(--text-muted)
}

.success-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center
}

.success-state>span {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    font-size: 1.5rem
}

.success-state h2 {
    font-size: 1.5rem
}

.podcast-player-card audio {
    width: 100%
}

.podcast-play-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    align-self: flex-start;
    max-width: 100%;
    padding: 4px;
    border-radius: 24px;
    background: var(--surface-background);
    color: var(--text)
}

.podcast-player-layout {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px
}

.podcast-player-card .podcast-play-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 24px;
    background: var(--border-subtle);
    color: inherit;
    font-size: 1.25rem
}

.podcast-current-title {
    min-width: 0;
    max-width: 100%;
    padding: 12px 18px;
    border-radius: 18px;
    background: var(--surface-background);
    color: var(--text);
    overflow-wrap: anywhere;
    font-weight: 700
}

.podcast-play-button:disabled {
    opacity: .4;
    cursor: default
}

.podcast-paragraph.is-playing > p {
    font-weight: 700
}

.podcast-transcript > summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 1.25rem
}

.podcast-transcript figure {
    margin-top: 20px
}

.podcast-transcript figure img {
    width: 100%;
    border-radius: 18px
}

.podcast-image-preview {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in
}

.image-fullscreen-preview {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 16px;
    border: 0;
    background: rgba(0, 0, 0, .92);
    cursor: zoom-out
}

.image-fullscreen-preview[open] {
    display: flex;
    align-items: center;
    justify-content: center
}

.image-fullscreen-preview::backdrop {
    background: rgba(0, 0, 0, .92)
}

.image-fullscreen-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain
}

.page-news .future-card {
    margin-top: 2px
}

.future-card .future-badge {
    color: var(--text)
}

.news-list li {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 11px 0
}

.news-list li>a {
    display: block;
    min-height: 0;
    padding-right: 4px
}

.news-list .titre {
    font-size: 1.14rem
}

.news-list .sous-titre {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-muted);
    font-size: .78rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2
}

.news-list button {
    align-self: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    padding: 9px;
    background: var(--page-background)
}

.pagination-button {
    align-self: center
}

.article-hero {
    overflow: hidden;
    border-radius: 28px;
    background: var(--surface-background)
}

.article-hero img {
    display: block;
    width: 100%;
    max-height: 32rem;
    object-fit: cover
}

.sources h2 {
    margin-bottom: 10px
}

.sources li+li {
    margin-top: 10px
}

.sources a {
    color: var(--accent);
    font-weight: 700
}

.sources small {
    display: block;
    color: var(--text-muted)
}

.forum-list li>a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 0
}

.forum-avatar {
    display: grid;
    flex: none;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-highlight);
    font-size: .75rem;
    font-weight: 700
}

.forum-list h2 {
    font-family: var(--font-body);
    font-size: .95rem;
    font-weight: 700
}

.forum-list p {
    color: var(--text-muted);
    font-size: .75rem
}

.floating-action {
    align-self: flex-end;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 50px;
    border: 0;
    border-radius: 25px;
    padding: 0 17px;
    background: var(--accent);
    color: #fff;
    font-weight: 700
}

.floating-action small {
    font-size: .62rem;
    font-weight: 600;
    opacity: .8
}

.composer {
    display: grid;
    gap: 9px
}

.composer label {
    font-weight: 700
}

.composer textarea {
    min-height: 110px;
    resize: vertical;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    background: #fff
}

.composer button {
    justify-self: start
}

.message-list {
    display: grid;
    gap: 12px
}

.message-card {
    padding: 16px 18px
}

.message-card>header {
    display: flex;
    justify-content: space-between;
    gap: 12px
}

.message-card time {
    color: var(--text-muted);
    font-size: .72rem
}

.message-card>p {
    margin: 9px 0;
    white-space: normal
}

.search-field {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    border-radius: 24px;
    padding: 0 15px;
    background: var(--surface-background)
}

.search-field input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent
}

.search-field:has(input:disabled) {
    opacity: .7
}

.chat-page { min-width: 0; }
.chat-new { align-self: flex-start; }
.chat-history { list-style: none; margin: 0; }
.chat-history li + li { border-top: 1px solid var(--border-subtle); }
.chat-history a { display: block; padding: 12px 0; overflow-wrap: anywhere; }
.chat-header { display: flex; align-items: center; gap: 12px; }
.chat-header .back-icon { flex-shrink: 0; }
.chat-filename, .chat-sources { overflow-wrap: anywhere; }
.chat-input input[type="file"] { width: 100%; min-width: 0; }
.chat-messages { display: grid; gap: 12px; }
.chat-messages p {
    margin: 0;
    padding: 12px 16px;
    max-width: 92%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.user-message {
    justify-self: end;
    border-radius: 20px 20px 5px 20px;
    background: var(--primary);
    color: var(--on-dark);
}
.assistant-message {
    justify-self: start;
    border-radius: 20px 20px 20px 5px;
    background: var(--surface-background);
    color: var(--text);
}
.chat-input {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    min-width: 0;
}
.chat-input textarea {
    box-sizing: border-box;
    width: 100%;
    resize: vertical;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    background: var(--surface-background);
    font: inherit;
}
.chat-input button { justify-self: end; }
.chat-input [role="status"] { color: var(--text-muted); }

.auth-app {
    display: grid;
    place-items: center;
    padding: 28px 16px
}

.auth-container {
    width: min(100%, 31rem)
}

.brand {
    display: block;
    margin-bottom: 18px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.4rem
}

.brand small {
    border-radius: 999px;
    background: var(--accent-soft);
    padding: 2px 7px;
    font-family: var(--font-body);
    font-size: .65rem
}

.auth-card,
.profile-page {
    display: flex;
    flex-direction: column;
    gap: 16px
}

.form-card {
    padding: 22px
}

.form-card header>p,
.profile-page>header p {
    color: var(--accent);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase
}

.form-card header h1 {
    font-size: 1.8rem
}

.form-card header span,
.form-card>p {
    display: block;
    margin-top: 5px;
    color: var(--text-muted)
}

.form-card>h2 {
    margin-bottom: 10px;
    font-size: 1.3rem
}

.form-card form {
    display: grid;
    gap: 8px
}

.form-card label {
    margin-top: 3px;
    font-size: .82rem;
    font-weight: 700
}

.form-card input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    background: #fff
}

.form-card form small {
    color: var(--text-muted)
}

.form-card form button {
    margin-top: 9px
}

.profile-page>header {
    margin-bottom: 2px
}

.profile-page .form-card+.form-card {
    margin-top: 14px
}

.logout-form {
    display: flex;
    justify-content: center;
    margin-top: 16px
}

.error-card {
    text-align: center
}

.status-code {
    display: grid;
    width: 64px;
    height: 64px;
    margin: 0 auto 10px;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    font-weight: 700
}

.error-card pre {
    overflow: auto;
    margin-top: 14px;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    text-align: left;
    white-space: pre-wrap
}

.error-card .primary-button {
    margin-top: 16px
}

@media (min-width:768px) {
    .course-row-content {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center
    }

    .course-row-text {
        flex: 1 1 200px
    }

    .course-row-progress {
        flex: 0 0 150px;
        max-width: 100%
    }

    .main-container {
        max-width: 1200px
    }

    .app-main {
        padding: 32px 32px 22px
    }

    .nav-container {
        width: 30rem;
        margin-inline: auto
    }

    .auth-container {
        width: min(100%, 1200px)
    }

    .content-card {
        padding: 32px
    }

    .lesson-list>header {
        flex-direction: row;
        align-items: flex-start
    }

    .lesson-list>header img {
        flex-shrink: 0;
        width: 150px;
        height: 150px
    }

    .lesson-list>header>div {
        min-width: 0
    }

    .media-card {
        display: grid;
        grid-template-columns: minmax(0, 1.5fr) minmax(14rem, 1fr);
        align-items: center
    }

    .media-card>video {
        grid-row: 1/span 2
    }

    .media-card>a {
        grid-column: 2
    }

    .page-news-detail>header,
    .page-chapter>header,
    .page-course-detail>header,
    .page-podcast>header {
        max-width: 48rem
    }

    .rich-content {
        font-size: 1.05rem;
        line-height: 1.7
    }

    .podcast-player-layout {
        flex-direction: row;
        align-items: center
    }

    .podcast-current-title {
        flex: 1
    }

    .podcast-paragraph {
        display: flex;
        align-items: flex-start;
        gap: 24px
    }

    .podcast-paragraph > p {
        flex: 1;
        min-width: 0
    }

    .podcast-paragraph > figure {
        flex: 0 1 auto;
        max-width: 40%;
        margin: .8em 0
    }

    .podcast-transcript figure img {
        width: auto;
        max-width: 100%;
        height: 120px
    }

    .podcast-image-preview {
        width: auto
    }

    .podcast-paragraph > figure {
        order: -1
    }

    .article-hero {
        max-height: 32rem
    }

    .profile-page {
        margin: auto;
        max-width: none
    }
}

@media (max-width:359px) {
    .app-main {
        padding-inline: 14px
    }

    .nav-container a {
        font-size: .61rem
    }

    .nav-container {
        padding-inline: 7px
    }

    .secondary-card {
        padding-inline: 14px
    }
}

@media (prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important
    }
}

.pagination-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1.25rem; }
