/*
 * Milee dashboard styles, on top of Filament's own (milee_docs/13-admin-panel.md).
 * Plain CSS with no build step: registered with FilamentAsset in
 * AdminPanelProvider and copied to public/css/app by `php artisan
 * filament:assets` (run by `filament:upgrade` on every composer install).
 * Filament's styles sit in CSS layers, so these unlayered rules win.
 * Colours come from Filament's variables (--primary-*, --gray-*, …).
 */

:root {
    --ml-bg: #f6f3ee;
    --ml-surface: #ffffff;
    --ml-line: #e8e2d9;
    --ml-muted: var(--gray-500);
    --ml-radius: 0.875rem;
    --ml-radius-sm: 0.5rem;
    --ml-video: #2563eb;
    --ml-reading: #0d9488;
    --ml-gallery: #d97706;
    --ml-quiz: #7c3aed;
}

/* Surfaces: a warm page, white cards with soft corners. */
.fi-body {
    background-color: var(--ml-bg);
}

.fi-sidebar,
.fi-topbar > nav {
    background-color: #fbf9f6;
}

.fi-section,
.fi-ta-ctn,
.fi-wi-stats-overview-stat {
    border-radius: var(--ml-radius);
}

/*
 * Primary buttons in the brand's deep indigo: for this palette Filament picks a
 * light shade with dark text. A choice in a ToggleButtons group is a <label>
 * with the same classes, so only its checked one is filled; the others stay
 * Filament's white with a grey ring. Painting every label indigo made the
 * chosen option look like the rest (user report, 2026-10-14).
 */
.fi-btn.fi-color-primary:not(.fi-outlined):not(label),
input:checked + label.fi-btn.fi-color-primary:not(.fi-outlined) {
    background-color: var(--primary-700);
    color: #fff;
}

.fi-btn.fi-color-primary:not(.fi-outlined):not(label):hover,
input:checked + label.fi-btn.fi-color-primary:not(.fi-outlined):hover {
    background-color: var(--primary-800);
    color: #fff;
}

.fi-btn.fi-color-primary:not(.fi-outlined):not(label) .fi-icon,
input:checked + label.fi-btn.fi-color-primary:not(.fi-outlined) .fi-icon {
    color: currentColor;
}

/* An unchosen option: white, grey ink, and a hover that says it can be picked. */
input:not(:checked) + label.fi-btn:not(.fi-outlined) {
    background-color: #fff;
    color: var(--gray-700);
}

input:not(:checked) + label.fi-btn:not(.fi-outlined):hover {
    background-color: var(--primary-50);
    color: var(--primary-800);
}

input:not(:checked) + label.fi-btn:not(.fi-outlined) .fi-icon {
    color: var(--gray-400);
}

/* Sidebar: the workspace card (resources/views/filament/workspace.blade.php). */
.ml-workspace {
    margin: 0 0 1rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--ml-line);
    border-radius: var(--ml-radius);
    background: var(--ml-surface);
}

.ml-workspace__name {
    font-weight: 600;
    color: var(--gray-950);
    line-height: 1.3;
}

.ml-workspace__role {
    font-size: 0.8125rem;
    color: var(--ml-muted);
}

.ml-workspace__language {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-800);
}

.ml-workspace__flag {
    width: 1.25rem;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08);
}

.ml-workspace__hint {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--ml-muted);
}

/* Checklists: the "ready to publish?" card. */
.ml-check {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}


.ml-check__item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--ml-line);
    border-radius: var(--ml-radius-sm);
    background: var(--ml-surface);
}

.ml-check__item--done {
    background: var(--gray-50);
}

.ml-check__item--done .ml-check__label {
    color: var(--ml-muted);
    text-decoration: line-through;
}

.ml-check__icon {
    flex: none;
    width: 1.5rem;
    height: 1.5rem;
    color: var(--gray-300);
}

.ml-check__item--done .ml-check__icon {
    color: var(--success-600);
}

.ml-check__body {
    flex: 1;
    min-width: 0;
}

.ml-check__label {
    font-weight: 500;
    color: var(--gray-950);
}

.ml-check__hint {
    font-size: 0.8125rem;
    color: var(--ml-muted);
}

/* Course outline: lessons and their steps (course studio). */
.ml-tree {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ml-lesson {
    border: 1px solid var(--ml-line);
    border-radius: var(--ml-radius);
    background: var(--ml-surface);
}

.ml-lesson__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--ml-line);
}

.ml-lesson__number {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ml-muted);
}

.ml-lesson__title {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: var(--gray-950);
}

.ml-lesson__steps {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem 1rem;
}

.ml-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--ml-line);
    border-left: 4px solid var(--ml-type, var(--gray-300));
    border-radius: var(--ml-radius-sm);
    background: var(--ml-surface);
}

.ml-step__title {
    min-width: 0;
    font-weight: 500;
    color: var(--gray-950);
    overflow-wrap: anywhere;
}

.ml-step__meta {
    font-size: 0.8125rem;
    color: var(--ml-muted);
}

.ml-handle {
    display: inline-flex;
    flex: none;
    cursor: grab;
    color: var(--gray-400);
    touch-action: none;
}

.ml-handle:hover {
    color: var(--gray-700);
}

.ml-handle__icon {
    width: 1.25rem;
    height: 1.25rem;
}

.ml-type-video {
    --ml-type: var(--ml-video);
}

.ml-type-reading {
    --ml-type: var(--ml-reading);
}

.ml-type-gallery {
    --ml-type: var(--ml-gallery);
}

.ml-type-quiz {
    --ml-type: var(--ml-quiz);
}

.ml-type-icon {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--ml-type, var(--gray-500));
}

/* Phone frame for previews. */
.ml-phone {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    padding: 0.75rem;
    border-radius: 2.25rem;
    background: #1c1917;
    box-shadow: 0 20px 40px -20px rgb(0 0 0 / 0.45);
}

.ml-phone__screen {
    /* A phone's shape, short enough to see whole on a laptop screen. */
    height: clamp(30rem, calc(100vh - 9rem), 45rem);
    overflow-y: auto;
    border-radius: 1.75rem;
    background: var(--ml-surface);
    scrollbar-width: thin;
}

.ml-phone__bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--ml-line);
    font-weight: 600;
}

/* Course studio (App\Filament\Resources\Courses\Pages\CourseContent): the tree on the left, readiness on the right. */
.ml-studio {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 1100px) {
    .ml-studio {
        grid-template-columns: minmax(0, 1fr) 20rem;
    }

    .ml-studio__aside {
        position: sticky;
        top: 5rem;
    }
}

.ml-studio__main,
.ml-studio__aside {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.ml-subheading {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.ml-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--ml-muted);
}

.ml-hint__icon {
    flex: none;
    width: 1rem;
    height: 1rem;
}

.ml-lesson__heading {
    flex: 1;
    min-width: 0;
}

.ml-lesson--focus,
.ml-step--focus {
    box-shadow: 0 0 0 3px var(--primary-200);
}

.ml-lesson__empty,
.ml-questions__empty {
    font-size: 0.875rem;
    color: var(--ml-muted);
}

.ml-lesson__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px dashed var(--ml-line);
    background: #fcfbf9;
    border-radius: 0 0 var(--ml-radius) var(--ml-radius);
}

.ml-row-actions {
    display: flex;
    flex: none;
    align-items: center;
    gap: 0.125rem;
}

.ml-step-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.ml-step__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.ml-step__kind {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ml-type, var(--ml-muted));
}

.ml-step__problem {
    margin-top: 0.125rem;
    font-size: 0.8125rem;
    color: var(--danger-600);
}

.ml-type-badge {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 2.75rem;
    border-radius: var(--ml-radius-sm);
    background: color-mix(in srgb, var(--ml-type, var(--gray-400)) 12%, white);
}

.ml-thumb {
    flex: none;
    width: 4rem;
    height: 2.75rem;
    border-radius: var(--ml-radius-sm);
    object-fit: cover;
    background: var(--gray-100);
}

.ml-thumb--small {
    width: 2.25rem;
    height: 2.25rem;
}

.ml-thumb--empty {
    display: inline-block;
}

.ml-slides {
    display: flex;
    flex: none;
    align-items: center;
    gap: 0.25rem;
}

.ml-slides__more {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ml-muted);
}

/* A quiz step's questions, under the step. */
.ml-questions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
    margin-left: 1.5rem;
    padding: 0.5rem 0.75rem;
    border-left: 2px solid color-mix(in srgb, var(--ml-quiz) 35%, white);
}

.ml-questions__list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ml-question {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: var(--ml-radius-sm);
    background: var(--gray-50);
    font-size: 0.875rem;
}

.ml-question__number {
    flex: none;
    font-weight: 600;
    color: var(--ml-muted);
}

.ml-question__text {
    flex: 1;
    min-width: 0;
    color: var(--gray-900);
    overflow-wrap: anywhere;
}

.ml-tree__add {
    display: flex;
}

.fi-sortable-ghost {
    opacity: 0.4;
}

/* An empty course: what a course is made of, and the first button. */
.ml-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 0.5rem;
    text-align: center;
}

.ml-empty__heading {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-950);
}

.ml-empty__text {
    max-width: 32rem;
    color: var(--ml-muted);
}

.ml-diagram {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.ml-diagram__box {
    width: 10rem;
    padding: 0.75rem;
    border: 1px solid var(--ml-line);
    border-radius: var(--ml-radius-sm);
    background: var(--ml-bg);
}

.ml-diagram__label {
    font-weight: 600;
    color: var(--gray-950);
}

.ml-diagram__hint {
    font-size: 0.75rem;
    color: var(--ml-muted);
}

.ml-diagram__arrow {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--gray-400);
}

/* "Ready to publish?" */
.ml-ready__text,
.ml-ready__count {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.ml-ready__count {
    font-weight: 600;
    color: var(--danger-700);
}

.ml-ready__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.ml-check--compact .ml-check__item {
    padding: 0.5rem;
    font-size: 0.8125rem;
}

.ml-check__item--problem .ml-check__icon {
    color: var(--warning-500);
}

.ml-check__item--ok .ml-check__icon {
    color: var(--success-600);
}

.ml-facts {
    display: flex;
    gap: 1.5rem;
}

.ml-facts dt {
    font-size: 0.75rem;
    color: var(--ml-muted);
}

.ml-facts dd {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-950);
}

[x-cloak] {
    display: none !important;
}

/*
 * Phone preview (resources/views/filament/courses/preview.blade.php,
 * quizzes/preview.blade.php and preview/steps/*): the app's screens drawn
 * small — course page, a lesson's steps, one step with back and next.
 */
.ml-pv {
    position: relative;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--gray-900);
}

.ml-pv__page {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.ml-pv__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
}

.ml-pv__title {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--gray-950);
}

.ml-pv__kind {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ml-type, var(--ml-muted));
}

.ml-pv__section {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ml-muted);
}

.ml-pv__about,
.ml-pv__text {
    white-space: pre-line;
    color: var(--gray-700);
}

.ml-pv__meta {
    font-size: 0.75rem;
    color: var(--ml-muted);
}

/* Course page: colour, cover, name. */
.ml-pv-hero {
    display: flex;
    flex-direction: column;
    background: var(--ml-course);
    color: #fff;
}

.ml-pv-hero__cover {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.ml-pv-hero__text {
    padding: 1.25rem 1rem 1rem;
}

.ml-pv-hero__title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
}

.ml-pv-hero__summary {
    margin-top: 0.375rem;
    opacity: 0.85;
}

/* Rows: lessons on the course page, steps on a lesson. */
.ml-pv-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--ml-line);
    border-radius: var(--ml-radius-sm);
    background: var(--ml-surface);
    text-align: start;
}

.ml-pv-row:hover {
    border-color: var(--gray-300);
    background: #fdfcfa;
}

.ml-pv-row__number {
    display: grid;
    flex: none;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--ml-course);
    font-weight: 700;
    color: #fff;
}

.ml-pv-row__type {
    display: grid;
    flex: none;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--ml-radius-sm);
    background: color-mix(in srgb, var(--ml-type, var(--gray-400)) 14%, white);
}

.ml-pv-row__type-icon {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--ml-type, var(--gray-500));
}

.ml-pv-row__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.ml-pv-row__title {
    font-weight: 600;
    color: var(--gray-950);
}

.ml-pv-row__meta {
    font-size: 0.75rem;
    color: var(--ml-muted);
}

.ml-pv-row__chevron {
    flex: none;
    width: 1rem;
    height: 1rem;
    color: var(--gray-400);
}

/* Top bar with back, and the step's place in its lesson. */
.ml-pv-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 3rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--ml-line);
    background: var(--ml-surface);
}

.ml-pv-bar__back {
    display: grid;
    flex: none;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
}

.ml-pv-bar__back:hover {
    background: var(--gray-100);
}

.ml-pv-bar__icon {
    width: 1.25rem;
    height: 1.25rem;
}

.ml-pv-bar__title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ml-pv-bar__count {
    flex: none;
    font-size: 0.75rem;
    color: var(--ml-muted);
}

.ml-pv-progress {
    height: 3px;
    background: var(--gray-100);
}

.ml-pv-progress span {
    display: block;
    height: 100%;
    background: var(--primary-600);
}

/* Previous / next under a step. */
.ml-pv-nav {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--ml-line);
    background: var(--ml-surface);
}

.ml-pv-nav__button {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--ml-line);
    border-radius: 999px;
    font-weight: 600;
}

.ml-pv-nav__button:disabled {
    opacity: 0.4;
    cursor: default;
}

.ml-pv-nav__button--primary {
    border-color: var(--primary-600);
    background: var(--primary-600);
    color: #fff;
}

.ml-pv-nav__icon {
    width: 1rem;
    height: 1rem;
}

/* Empty states and notices inside the phone. */
.ml-pv-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    border: 1px dashed var(--ml-line);
    border-radius: var(--ml-radius-sm);
    text-align: center;
    color: var(--ml-muted);
}

.ml-pv-empty__icon {
    width: 2rem;
    height: 2rem;
    color: var(--gray-400);
}

.ml-pv-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.875rem;
    border-radius: var(--ml-radius-sm);
    background: var(--warning-50);
    color: var(--warning-800);
}

.ml-pv-notice--danger {
    background: var(--danger-50);
    color: var(--danger-700);
}

.ml-pv-notice__icon {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
}

/* Video: its own shape, and the subtitles switch. */
.ml-pv-video {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.ml-pv-video video {
    width: 100%;
    border-radius: var(--ml-radius-sm);
    background: #000;
    object-fit: contain;
}

.ml-pv-video--portrait video {
    aspect-ratio: 9 / 16;
    max-height: 30rem;
}

.ml-pv-video--landscape video {
    aspect-ratio: 16 / 9;
}

.ml-pv-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--ml-line);
    border-radius: 999px;
    background: var(--ml-surface);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
}

button.ml-pv-chip.is-on {
    border-color: var(--primary-600);
    background: var(--primary-50);
    color: var(--primary-700);
}

.ml-pv-chip__icon {
    width: 1rem;
    height: 1rem;
}

.ml-pv-audio {
    width: 100%;
    height: 2.5rem;
}

/* Reading: Markdown drawn as the app draws it (a heading is a bold line). */
.ml-pv-prose {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--gray-800);
}

.ml-pv-prose :is(h1, h2, h3, h4, h5, h6) {
    font-size: 1em;
    font-weight: 700;
}

.ml-pv-prose strong {
    font-weight: 700;
}

.ml-pv-prose em {
    font-style: italic;
}

.ml-pv-prose ul {
    padding-inline-start: 1.25rem;
    list-style: disc;
}

.ml-pv-prose ol {
    padding-inline-start: 1.25rem;
    list-style: decimal;
}

.ml-pv-prose a {
    text-decoration: underline;
}

.ml-pv-points {
    padding: 0.75rem 0.875rem;
    border-radius: var(--ml-radius-sm);
    background: color-mix(in srgb, var(--ml-reading) 10%, white);
}

.ml-pv-points__heading {
    margin-bottom: 0.25rem;
    font-weight: 700;
    color: var(--ml-reading);
}

.ml-pv-points ul {
    padding-inline-start: 1.25rem;
    list-style: disc;
}

/* Gallery: one slide at a time. */
.ml-pv-gallery {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ml-pv-slide {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ml-pv-slide__frame {
    overflow: hidden;
    aspect-ratio: 4 / 5;
    border-radius: var(--ml-radius-sm);
    background: var(--gray-100);
}

.ml-pv-slide__frame img {
    width: 100%;
    height: 100%;
}

.ml-pv-slide--panel .ml-pv-slide__frame img {
    padding: 0.5rem;
    object-fit: contain;
}

.ml-pv-slide--page .ml-pv-slide__frame img {
    object-fit: cover;
}

.ml-pv-slide__missing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 100%;
    color: var(--ml-muted);
}

.ml-pv-file {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--ml-line);
    border-radius: var(--ml-radius-sm);
    font-weight: 600;
    color: var(--primary-700);
}

.ml-pv-file__icon {
    flex: none;
    width: 1rem;
    height: 1rem;
}

.ml-pv-carousel {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ml-pv-carousel__arrow {
    display: grid;
    flex: none;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--ml-line);
    border-radius: 999px;
}

.ml-pv-carousel__arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.ml-pv-carousel__icon {
    width: 1rem;
    height: 1rem;
}

.ml-pv-carousel__dots {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.375rem;
}

.ml-pv-carousel__dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--gray-300);
}

.ml-pv-carousel__dot.is-on {
    background: var(--ml-gallery);
}

.ml-pv-carousel__count {
    flex: none;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--ml-muted);
}

/* Quiz: a card per question. */
.ml-pv-q {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 0.875rem;
    border: 1px solid var(--ml-line);
    border-radius: var(--ml-radius-sm);
    background: var(--ml-surface);
}

.ml-pv-q__number {
    font-size: 0.75rem;
    color: var(--ml-muted);
}

.ml-pv-q__text {
    font-weight: 600;
    white-space: pre-line;
    color: var(--gray-950);
}

.ml-pv-q__media {
    width: 100%;
    border-radius: var(--ml-radius-sm);
}

.ml-pv-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ml-pv-options--row {
    flex-direction: row;
}

.ml-pv-option {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--ml-line);
    border-radius: var(--ml-radius-sm);
    cursor: pointer;
}

.ml-pv-options--row .ml-pv-option {
    justify-content: center;
    font-weight: 600;
}

.ml-pv-option.is-picked {
    border-color: var(--ml-quiz);
    background: color-mix(in srgb, var(--ml-quiz) 8%, white);
}

.ml-pv-option input {
    accent-color: var(--ml-quiz);
}

.ml-pv-option__image {
    width: 3rem;
    height: 3rem;
    border-radius: 0.375rem;
    object-fit: cover;
}

.ml-pv-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--ml-radius-sm);
    font-size: 0.875rem;
}

.ml-pv-input:focus {
    border-color: var(--ml-quiz);
    outline: 2px solid color-mix(in srgb, var(--ml-quiz) 25%, transparent);
}

.ml-pv-number {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ml-pv-number__unit {
    flex: none;
    font-weight: 600;
    color: var(--gray-700);
}

.ml-pv-template {
    line-height: 2;
}

.ml-pv-gap {
    display: inline-block;
    min-width: 3.5rem;
    margin: 0 0.125rem;
    padding: 0 0.5rem;
    border-bottom: 2px solid var(--ml-quiz);
    background: color-mix(in srgb, var(--ml-quiz) 8%, white);
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.6;
    text-align: center;
    color: var(--ml-quiz);
}

.ml-pv-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

ol.ml-pv-list {
    padding-inline-start: 1.25rem;
    list-style: decimal;
    font-size: 0.8125rem;
    color: var(--gray-700);
}

.ml-pv-list--boxes li,
.ml-pv-list--targets li {
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--ml-line);
    border-radius: var(--ml-radius-sm);
}

.ml-pv-list--targets li {
    border-style: dashed;
    color: var(--gray-700);
}

.ml-pv-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.ml-pv-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.ml-pv-hotspot {
    position: relative;
}

.ml-pv-hotspot img {
    display: block;
    width: 100%;
    border-radius: var(--ml-radius-sm);
}

.ml-pv-hotspot svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    fill: color-mix(in srgb, var(--success-500) 30%, transparent);
    stroke: var(--success-600);
    stroke-width: 2;
}

.ml-pv-hotspot svg * {
    vector-effect: non-scaling-stroke;
}

.ml-pv-check {
    align-self: flex-start;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: var(--ml-quiz);
    font-weight: 600;
    color: #fff;
}

.ml-pv-check:disabled {
    opacity: 0.45;
    cursor: default;
}

.ml-pv-check--quiet {
    border: 1px solid var(--ml-quiz);
    background: transparent;
    color: var(--ml-quiz);
}

.ml-pv-result {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--ml-radius-sm);
}

.ml-pv-result.is-right {
    background: var(--success-50);
    color: var(--success-800);
}

.ml-pv-result.is-wrong {
    background: var(--danger-50);
    color: var(--danger-700);
}

.ml-pv-result.is-answer {
    background: color-mix(in srgb, var(--ml-quiz) 8%, white);
    color: var(--gray-800);
}

.ml-pv-result ul {
    padding-inline-start: 1.125rem;
    list-style: disc;
}

.ml-pv-result__hint {
    font-size: 0.75rem;
    color: var(--ml-muted);
}

.ml-pv-result p {
    color: var(--gray-700);
}

/* Sign-in pages: the language links under the form. */
.ml-language-switch {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    font-size: 0.875rem;
}
.ml-language-switch a {
    color: var(--gray-500);
}
.ml-language-switch a:hover {
    color: var(--primary-600);
    text-decoration: underline;
}
.ml-language-switch [aria-current] {
    color: var(--gray-950);
    font-weight: 600;
}

/* /register: "Organization / Content creator" as two cards, the chosen one outlined. */
.ml-type-cards.fi-fo-radio {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.75rem;
    margin-top: 0;
}
.ml-type-cards > .fi-fo-radio-label {
    align-self: stretch;
    padding: 1rem;
    padding-top: 1rem !important;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    background: white;
    cursor: pointer;
    transition: border-color 120ms, box-shadow 120ms;
}
.ml-type-cards > .fi-fo-radio-label:hover {
    border-color: var(--gray-300);
}
.ml-type-cards > .fi-fo-radio-label:has(.fi-radio-input:checked) {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 1px var(--primary-600);
    background: var(--primary-50);
}
.ml-type-cards .fi-fo-radio-label-text {
    font-size: 0.95rem;
}
/* /register step 1: the three languages as smaller cards, each with its flag first. */
.ml-language-cards.fi-fo-radio {
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}
.ml-language-cards > .fi-fo-radio-label {
    align-items: center;
    padding: 0.75rem 0.875rem;
    padding-top: 0.75rem !important;
}
.ml-language-cards.fi-fo-radio > .fi-fo-radio-label > .fi-radio-input {
    margin-top: 0;
}
.ml-flag-option {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}
.ml-flag-option__flag {
    width: 1.5rem;
    height: 1.5rem;
    flex: none;
}

/* A plain text link on the sign-in and sign-up pages. */
.ml-link {
    color: var(--primary-600);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ------------------------------------------------------------------
 * Dashboard and Statistics (App\Filament\Pages\Dashboard, Statistics,
 * App\Filament\Widgets\*). Colour comes in "tones" from the app's course
 * palette: a tone sets --tone (ink), --tone-soft (tile) and --tone-strong.
 * ------------------------------------------------------------------ */

.ml-tone--indigo { --tone: #4338ca; --tone-soft: #eef0ff; --tone-strong: #3730a3; }
.ml-tone--blue { --tone: #2e5fd2; --tone-soft: #e9f0fd; --tone-strong: #2149a8; }
.ml-tone--green { --tone: #2f8a2c; --tone-soft: #e8f5e7; --tone-strong: #236b21; }
.ml-tone--amber { --tone: #c27c06; --tone-soft: #fdf3dc; --tone-strong: #9a6205; }
.ml-tone--orange { --tone: #da642a; --tone-soft: #fcece3; --tone-strong: #b44d1b; }
.ml-tone--purple { --tone: #a23ca5; --tone-soft: #f7e9f7; --tone-strong: #7f2c82; }
.ml-tone--rose { --tone: #cf4039; --tone-soft: #fbe9e8; --tone-strong: #a82f29; }
.ml-tone--teal { --tone: #0f8a80; --tone-soft: #e2f4f2; --tone-strong: #0b6b63; }
.ml-tone--gray { --tone: #78716c; --tone-soft: #f2efeb; --tone-strong: #57534e; }

.ml-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* A plain white card, and its heading row. */
.ml-card {
    height: 100%;
    padding: 1.25rem 1.375rem;
    border: 1px solid var(--ml-line);
    border-radius: var(--ml-radius);
    background: var(--ml-surface);
    box-shadow: 0 1px 2px rgb(28 25 23 / 0.04), 0 8px 24px -16px rgb(28 25 23 / 0.12);
}

.ml-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ml-card__title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--gray-950);
}

.ml-card__sub {
    margin-top: 0.125rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--gray-500);
}

.ml-block-title {
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.ml-pill {
    flex: none;
    min-width: 1.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: var(--tone-soft);
    color: var(--tone-strong);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.ml-link {
    display: inline-flex;
    text-decoration: none;
    align-items: center;
    gap: 0.25rem;
    flex: none;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-600);
    white-space: nowrap;
}

.ml-link:hover {
    color: var(--primary-800);
}

.ml-link__icon {
    width: 1rem;
    height: 1rem;
    transition: transform 0.15s ease;
}

.ml-link:hover .ml-link__icon {
    transform: translateX(2px);
}

/* Nothing here (yet): an icon, a line, a hint. */
.ml-calm {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 1.75rem 1rem;
    text-align: center;
}

.ml-calm__icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.375rem;
    border-radius: 999px;
    background: var(--tone-soft);
    color: var(--tone);
}

.ml-calm__icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.ml-calm__title {
    font-weight: 600;
    color: var(--gray-900);
}

.ml-calm__hint {
    max-width: 22rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* The dashboard's greeting band. */
.ml-hero {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    overflow: hidden;
    padding: 1.75rem 2rem;
    border-radius: 1.25rem;
    color: #fff;
    background:
        radial-gradient(120% 160% at 100% 0%, rgb(140 92 214 / 0.55) 0%, transparent 55%),
        linear-gradient(135deg, #2b236d 0%, #352a85 55%, #4b2f93 100%);
    box-shadow: 0 18px 40px -24px rgb(43 35 109 / 0.7);
}

.ml-hero__art {
    position: absolute;
    top: -1.5rem;
    right: -2rem;
    width: 24rem;
    height: auto;
    pointer-events: none;
}

.ml-hero__art circle {
    fill: rgb(255 255 255 / 0.06);
}

.ml-hero__body,
.ml-hero__actions {
    position: relative;
    z-index: 1;
}

.ml-hero__body {
    min-width: 0;
}

.ml-hero__date {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgb(255 255 255 / 0.72);
}

.ml-hero__title {
    margin: 0.25rem 0 0.875rem;
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #fff;
}

.ml-hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ml-hero__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.75rem;
    border: 1px solid rgb(255 255 255 / 0.18);
    border-radius: 999px;
    background: rgb(255 255 255 / 0.1);
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgb(255 255 255 / 0.95);
}

.ml-hero__chip-icon {
    width: 1rem;
    height: 1rem;
    opacity: 0.8;
}

.ml-hero__flag {
    border-radius: 2px;
}

.ml-hero__actions .fi-btn {
    border: 1px solid rgb(255 255 255 / 0.22);
    background: rgb(255 255 255 / 0.1);
    color: #fff;
    box-shadow: none;
}

.ml-hero__actions .fi-btn:hover {
    background: rgb(255 255 255 / 0.18);
}

.ml-hero__actions .fi-btn .fi-icon {
    color: currentColor;
}

.ml-hero__actions .fi-btn.fi-color-primary {
    border-color: #fff;
    background: #fff;
    color: var(--primary-700);
}

.ml-hero__actions .fi-btn.fi-color-primary:hover {
    background: var(--primary-50);
}

@media (max-width: 640px) {
    .ml-hero {
        padding: 1.375rem 1.25rem;
    }

    .ml-hero__title {
        font-size: 1.5rem;
    }
}

/* Number cards (filament.widgets.kpis, and the Statistics counts). */
.ml-kpis__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1rem;
}

.ml-kpis__grid--compact {
    grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
    gap: 0.875rem;
}

.ml-kpi {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.125rem 1.25rem;
    border: 1px solid var(--ml-line);
    border-radius: var(--ml-radius);
    background: var(--ml-surface);
    box-shadow: 0 1px 2px rgb(28 25 23 / 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.ml-kpi--link:hover {
    border-color: color-mix(in srgb, var(--tone) 35%, var(--ml-line));
    box-shadow: 0 10px 24px -16px color-mix(in srgb, var(--tone) 60%, transparent);
    transform: translateY(-1px);
}

.ml-kpi__top {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.ml-kpi__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    background: var(--tone-soft);
    color: var(--tone);
}

.ml-kpi__icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.ml-kpi__label {
    flex: 1;
    min-width: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--gray-600);
}

.ml-kpi__go {
    width: 1rem;
    height: 1rem;
    color: var(--gray-400);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.ml-kpi--link:hover .ml-kpi__go {
    opacity: 1;
}

.ml-kpi__body {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
}

.ml-kpi__value {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--gray-950);
    font-variant-numeric: tabular-nums;
}

.ml-kpi__note {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.ml-kpi__spark {
    flex: none;
    width: 7.5rem;
    height: 2.5rem;
}

.ml-kpi__spark-area {
    fill: var(--tone);
    opacity: 0.12;
}

.ml-kpi__spark-line {
    fill: none;
    stroke: var(--tone);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ml-kpi--compact {
    gap: 0.75rem;
    padding: 1rem 1.125rem;
}

.ml-kpi--compact .ml-kpi__value {
    font-size: 1.625rem;
}

@media (max-width: 640px) {
    .ml-kpis__grid--compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.625rem;
    }

    .ml-kpi--compact {
        padding: 0.875rem;
    }

    .ml-kpi--compact .ml-kpi__top {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* What waits on the user (NeedsAttention). */
.ml-attention__list {
    display: flex;
    flex-direction: column;
    margin: -0.25rem -0.5rem;
}

.ml-attention__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.5rem;
    border-radius: 0.625rem;
    transition: background-color 0.15s ease;
}

.ml-attention__item:hover {
    background: var(--gray-50);
}

.ml-attention__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.625rem;
    background: var(--tone-soft);
    color: var(--tone);
}

.ml-attention__icon svg {
    width: 1.125rem;
    height: 1.125rem;
}

.ml-attention__label {
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-800);
}

.ml-attention__count {
    min-width: 1.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: var(--tone-soft);
    color: var(--tone-strong);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.ml-attention__chevron {
    width: 1rem;
    height: 1rem;
    color: var(--gray-400);
}

/* Getting started: a ring of progress, and the steps as cards. */
.ml-start {
    display: grid;
    gap: 1.25rem;
}

.ml-start__intro {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ml-ring {
    position: relative;
    display: grid;
    flex: none;
    place-items: center;
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 999px;
    background: conic-gradient(var(--primary-600) calc(var(--value) * 1%), var(--gray-200) 0);
}

.ml-ring::before {
    content: "";
    position: absolute;
    inset: 0.375rem;
    border-radius: inherit;
    background: var(--ml-surface);
}

.ml-ring__value {
    position: relative;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gray-900);
}

.ml-start__steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0.75rem;
}

.ml-step-card {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 1rem;
    border: 1px solid var(--ml-line);
    border-radius: 0.875rem;
    background: #fcfbf9;
}

.ml-step-card--next {
    border-color: var(--primary-200);
    background: var(--primary-50);
    box-shadow: 0 0 0 3px rgb(43 35 109 / 0.06);
}

.ml-step-card--done {
    background: var(--ml-surface);
}

.ml-step-card__mark {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    margin-bottom: 0.25rem;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.8125rem;
    font-weight: 700;
}

.ml-step-card__mark svg {
    width: 1rem;
    height: 1rem;
}

.ml-step-card--next .ml-step-card__mark {
    background: var(--primary-600);
    color: #fff;
}

.ml-step-card--done .ml-step-card__mark {
    background: var(--success-100);
    color: var(--success-700);
}

.ml-step-card__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-950);
}

.ml-step-card--done .ml-step-card__label {
    color: var(--gray-500);
    text-decoration: line-through;
}

.ml-step-card__hint {
    flex: 1;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--gray-500);
}

.ml-step-card__go {
    align-self: flex-start;
    margin-top: 0.375rem;
}

/* Drafts to pick up again (ContinueWorking). */
.ml-drafts {
    display: flex;
    flex-direction: column;
    margin: -0.25rem -0.5rem;
}

.ml-draft {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.5rem;
    border-radius: 0.625rem;
    transition: background-color 0.15s ease;
}

.ml-draft:hover {
    background: var(--gray-50);
}

.ml-draft__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    background: var(--tone-soft);
    color: var(--tone);
}

.ml-draft__icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.ml-draft__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.ml-draft__title {
    overflow: hidden;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ml-draft__meta {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.ml-draft__chevron {
    width: 1rem;
    height: 1rem;
    color: var(--gray-400);
}

/* A ranked list (TopContent) and the rank badge the tables share. */
.ml-rank {
    display: flex;
    flex-direction: column;
}

.ml-rank__row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 0;
    border-top: 1px solid #f1ede7;
}

.ml-rank__row:first-child {
    border-top: 0;
    padding-top: 0.25rem;
}

.ml-rank__n {
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.75rem;
    font-weight: 700;
}

.ml-rank__n--top {
    background: #fdf3dc;
    color: #9a6205;
}

.ml-rank__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ml-rank__title {
    overflow: hidden;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ml-rank__line {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* An engagement share: a bar and the percent (filament.partials.rate). */
.ml-rate {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    white-space: nowrap;
}

.ml-rate__bar {
    display: block;
    width: 4.5rem;
    height: 0.375rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--gray-100);
}

.ml-rate__bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--tone);
}

.ml-rate__value {
    min-width: 2.75rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--tone-strong);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ml-tone--gray .ml-rate__value {
    color: var(--gray-400);
    font-weight: 500;
}

/* Statistics page. */
.ml-stats {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.ml-stats__groups {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ml-stats__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
}

@media (min-width: 1100px) {
    .ml-stats__row {
        grid-template-columns: minmax(18rem, 1fr) minmax(0, 2fr);
    }

    .ml-stats__row--single {
        grid-template-columns: minmax(0, 1fr);
    }
}

.ml-stats__chart .fi-wi-chart,
.ml-stats__chart .fi-wi-chart > .fi-section {
    height: 100%;
}

.ml-gauge-card {
    display: flex;
    flex-direction: column;
}

.ml-gauge {
    display: grid;
    place-items: center;
    width: 11rem;
    aspect-ratio: 1;
    margin: 0.5rem auto 1.5rem;
    border-radius: 999px;
    background: conic-gradient(#2f8a2c calc(var(--value) * 1%), #ece8e2 0);
}

.ml-gauge__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 78%;
    aspect-ratio: 1;
    border-radius: 999px;
    background: var(--ml-surface);
    box-shadow: inset 0 0 0 1px #f1ede7;
}

.ml-gauge__value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--gray-950);
    font-variant-numeric: tabular-nums;
}

.ml-gauge__label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.ml-legend {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f1ede7;
}

.ml-legend__item dt {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.ml-legend__item dd {
    margin-top: 0.125rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-950);
    font-variant-numeric: tabular-nums;
}

.ml-legend__dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--tone);
}

/* The detail tabs. */
.ml-tabs-card {
    padding: 0;
    overflow: hidden;
}

.ml-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.375rem 0.875rem 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--ml-line);
    background: #fcfbf9;
    scrollbar-width: none;
}

.ml-tabs::-webkit-scrollbar {
    display: none;
}

.ml-tabs__tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: -1px;
    padding: 0.75rem 0.875rem;
    border-bottom: 2px solid transparent;
    color: var(--gray-500);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.ml-tabs__tab:hover {
    color: var(--gray-800);
}

.ml-tabs__tab.is-active {
    border-bottom-color: var(--primary-600);
    color: var(--primary-700);
}

.ml-tabs__icon {
    width: 1.125rem;
    height: 1.125rem;
}

.ml-tabs__count {
    padding: 0.0625rem 0.4375rem;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.6875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ml-tabs__tab.is-active .ml-tabs__count {
    background: var(--primary-50);
    color: var(--primary-700);
}

.ml-tabs__panel {
    padding: 1.25rem 1.5rem 1.5rem;
}

.ml-tabs__intro {
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .ml-tabs__panel {
        padding: 1rem;
    }
}

/* The detail tables. */
.ml-table-wrap {
    overflow-x: auto;
}

.ml-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.ml-table th {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--ml-line);
    background: #faf8f5;
    color: var(--gray-500);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.ml-table th:first-child {
    border-top-left-radius: 0.5rem;
}

.ml-table th:last-child {
    border-top-right-radius: 0.5rem;
}

.ml-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f1ede7;
    vertical-align: middle;
}

.ml-table tbody tr:last-child td {
    border-bottom: 0;
}

.ml-table tbody tr:hover td {
    background: #fcfaf7;
}

.ml-table .ml-table__num {
    color: var(--gray-800);
    font-weight: 500;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.ml-table .ml-table__zero {
    color: var(--gray-400);
    font-weight: 400;
}

.ml-table .ml-table__rate {
    text-align: right;
    white-space: nowrap;
}

.ml-table__rank {
    width: 2.75rem;
}

.ml-table__name {
    min-width: 14rem;
}

.ml-table__who {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ml-table__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ml-table__title {
    font-weight: 600;
    line-height: 1.35;
    color: var(--gray-900);
}

.ml-table__sub {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.ml-table__flag {
    font-size: 1.375rem;
    line-height: 1;
}

.ml-table__action {
    width: 1%;
    text-align: right;
    white-space: nowrap;
}

.ml-avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--primary-50);
    color: var(--primary-700);
    font-size: 0.8125rem;
    font-weight: 700;
}

/* Every leaderboard of the language. */
.ml-boards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
    gap: 0.75rem;
}

.ml-board {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--ml-line);
    border-radius: 0.75rem;
    background: var(--ml-surface);
}

.ml-board__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    background: var(--tone-soft);
    color: var(--tone);
}

.ml-board__icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.ml-board__title {
    display: -webkit-box;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--gray-900);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* A leaderboard in its modal: the first three with medals. */
.ml-podium {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.ml-podium__row {
    display: grid;
    grid-template-columns: 2rem 2rem minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
}

.ml-podium__rank {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.75rem;
    font-weight: 700;
}

.ml-podium__row--1 { background: #fdf6e3; }
.ml-podium__row--1 .ml-podium__rank { background: #f4b53e; color: #fff; }
.ml-podium__row--2 { background: #f5f4f2; }
.ml-podium__row--2 .ml-podium__rank { background: #a8a29e; color: #fff; }
.ml-podium__row--3 { background: #fcefe7; }
.ml-podium__row--3 .ml-podium__rank { background: #da642a; color: #fff; }

.ml-podium__name {
    overflow: hidden;
    font-weight: 600;
    color: var(--gray-900);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ml-podium__score {
    font-weight: 700;
    color: var(--gray-950);
    font-variant-numeric: tabular-nums;
}

.ml-podium__time {
    min-width: 4rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* The activity chart's card matches the others, and keeps its height on a phone. */
.fi-wi-chart > .fi-section {
    height: 100%;
    border-radius: var(--ml-radius);
}

.fi-wi-chart .fi-wi-chart-canvas-ctn {
    height: 17rem;
}

@media (max-width: 640px) {
    .fi-wi-chart .fi-section-header {
        flex-wrap: wrap;
    }

    .fi-wi-chart .fi-section-header-text-ctn {
        flex: 1 1 14rem;
    }

    .fi-wi-chart .fi-wi-chart-canvas-ctn {
        height: 15rem;
    }

    .ml-rank__row {
        grid-template-columns: auto minmax(0, 1fr);
        row-gap: 0.375rem;
    }

    .ml-rank__row .ml-rate {
        grid-column: 2;
    }

    .ml-rank__title {
        white-space: normal;
    }
}
