/* ===== LESSON PAGE STYLES — Matching Image 2 ===== */

/* Keep the global header menu above the lesson panel and its floating controls. */
body.lesson-page #header {
    z-index: 1101;
}

/* Lesson content and its movable contents panel share one responsive flex layout. */
.lesson-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    min-height: calc(100vh - 60px);
    overflow: visible;
    background: #0f172a;
}

/* Main video/content area — center */
.lesson-main {
    flex: 1;
    overflow: visible;
    padding: 24px;
    background: #0f172a;
    min-width: 0;
}

/* Right sidebar — "Lista de Conteúdos" — dark theme */
.lesson-sidebar {
    flex: 0 0 340px;
    width: 340px;
    box-sizing: border-box;
    background: #1e293b;
    border-left: 1px solid #475569;
    overflow: hidden;
    padding: 20px;
    transition: all 0.3s ease;
    position: sticky;
    top: calc(var(--header-h, 60px) + 12px);
    align-self: flex-start;
    height: fit-content;
    max-height: calc(100vh - 80px);
    z-index: 999;
    scrollbar-width: thin;
    scrollbar-color: #475569 #0f172a;
}

.lesson-sidebar::-webkit-scrollbar {
    width: 6px;
}

.lesson-sidebar::-webkit-scrollbar-track {
    background: #0f172a;
}

.lesson-sidebar::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

/* Sidebar header */
.lesson-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.lesson-sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    color: #f8fafc;
}

/* Keep the back link inset consistently, whichever side holds the panel. */
.lesson-navigation-row {
    padding-left: 12px;
}

.lesson-sidebar.collapsed {
    /* Keep a narrow track so the collapsed panel still separates from the player. */
    flex-basis: 64px;
    width: 64px;
    min-width: 64px;
    padding: 0;
    background: #0f172a;
    overflow: hidden;
}
.lesson-sidebar.collapsed > * { visibility: hidden; }
.lesson-sidebar.collapsed::after {
    /* Dedicated divider: the normal panel border disappears in collapsed mode. */
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #64748b;
    transform: scaleX(.5);
    transform-origin: left center;
    pointer-events: none;
    z-index: 2;
}

/* ===== SIDEBAR POSITION: LEFT / RIGHT ===== */
/* When sidebar moves to LEFT */
.lesson-layout.sidebar-left {
    flex-direction: row-reverse;
}
.lesson-layout:not(.sidebar-left) .lesson-sidebar {
    border-left: 1px solid #475569;
    border-right: none;
}
.lesson-layout:not(.sidebar-left) .lesson-sidebar.collapsed {
    border-left: 0;
}
.lesson-layout:not(.sidebar-left) .lesson-sidebar.collapsed::after { left: 0; }
.lesson-layout.sidebar-left .lesson-sidebar {
    border-left: none;
    border-right: 1px solid #475569;
}
.lesson-layout.sidebar-left .lesson-sidebar.collapsed::after {
    right: 0;
    transform-origin: right center;
}
.lesson-layout.sidebar-left .lesson-sidebar.collapsed {
    flex-basis: 64px;
    width: 64px;
    min-width: 64px;
    padding: 0;
    overflow: hidden;
    border-left: none;
    border-right: 0;
}

/* Collapsed controls (floating buttons when sidebar collapsed) */
.collapsed-sidebar-controls {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.3s ease;
}
.collapsed-sidebar-controls.position-left {
    left: calc(var(--sidebar-w, 250px) + 16px);
    right: auto;
}

/* The collapsed controls sit within the reserved panel track. Popups open toward
   the lesson player, away from the fixed site navigation. */
.collapsed-sidebar-controls:not(.position-left) .dropdown-menu {
    top: 0;
    right: calc(100% + 8px);
    left: auto;
}

.collapsed-sidebar-controls.position-left .dropdown-menu {
    top: 0;
    left: calc(100% + 8px);
    right: auto;
}

/* Settings dropdown */
.settings-dropdown {
    position: relative;
    display: inline-block;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: 1px solid #334155;
    background: #334155;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #f8fafc;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #475569;
    border-color: #f59e0b;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

/* Dropdown menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-header {
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    background: #475569;
    border-bottom: 1px solid #475569;
}

.dropdown-item {
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: #f8fafc;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-item:hover {
    background: #475569;
}

.dropdown-item i {
    width: 16px;
    font-size: 12px;
    color: #94a3b8;
}

/* Search bar */
.lesson-search {
    position: relative;
    margin-bottom: 24px;
}

.search-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #f59e0b;
}

.lesson-search i {
    position: absolute;
    left: 12px;
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

/* Units container */
.units-container {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #475569 #0f172a;
}

.units-container::-webkit-scrollbar {
    width: 6px;
}

.units-container::-webkit-scrollbar-track {
    background: #0f172a;
}

.units-container::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

/* Module styles */
.lesson-module {
    margin-bottom: 16px;
    border: 1px solid #334155;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    background: #0f172a;
}

.lesson-module:hover {
    border-color: #f59e0b;
    box-shadow: 0 2px 8px rgba(245,158,11,0.15);
}

.module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #1e293b;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.module-header > div:first-child {
    flex: 1 1 0;
    min-width: 0;
}

.module-header > div:first-child > div:last-child {
    min-width: 0;
}

.module-header:hover {
    background: #334155;
}

.module-header h4 {
    margin: 0;
    font-size: 14px;
    color: #f8fafc;
    font-weight: 600;
}

.module-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    margin-right: 10px;
    border: 1px solid #64748b;
    border-radius: 50%;
    background: #475569;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .22);
}

.lesson-module.is-current .module-number {
    border-color: #60a5fa;
    background: #2563eb;
}

.lesson-module.is-complete .module-number {
    border-color: #4ade80;
    background: #15803d;
}

.module-header span {
    font-size: 12px;
    color: #94a3b8;
    display: block;
    margin-top: 2px;
}

.module-progress {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex: 0 0 auto;
}

.progress-mini {
    width: 28px;
    flex: 0 0 28px;
    height: 4px;
    background: #334155;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #22c55e;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.btn-collapse {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    flex: 0 0 16px;
    width: 16px;
    padding: 0;
    transition: transform 0.3s ease;
}

.module-header:hover .btn-collapse {
    color: #f59e0b;
}

.lesson-module.expanded .btn-collapse {
    transform: rotate(180deg);
}

/* Lesson items */
.lesson-items {
    background: #0f172a;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.lesson-module.expanded .lesson-items {
    max-height: 300px;
}

.lesson-item {
    width: 100%;
    text-align: left;
    font: inherit;
    color: inherit;
    background: transparent;
    border: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lesson-item:last-child {
    border-bottom: none;
}

.lesson-item:hover {
    background: #1e293b;
    color: #f8fafc;
}

.lesson-item.current {
    background: #333;
    color: #f8fafc;
    border-left: 3px solid #f59e0b;
}

/* Keep the selected lesson easy to spot in the content list. */
.lesson-item.current .lesson-title,
.lesson-item.current > .fa-play {
    color: var(--primary-yellow, #ffcc00);
}

.lesson-item.completed {
    opacity: 0.7;
}

.lesson-item.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.lesson-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e293b;
    color: #f8fafc;
    flex-shrink: 0;
}

.lesson-icon svg {
    width: 14px;
    height: 14px;
}

.lesson-info {
    flex: 1;
    min-width: 0;
}

.lesson-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lesson-duration {
    font-size: 11px;
    color: #94a3b8;
    margin-left: 4px;
}

.section-icon {
    width: 14px;
    height: 14px;
}

/* Video player */
.modern-video-player {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    position: relative;
}

.lesson-media-player:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lesson-video-message {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface-card);
    color: var(--text-secondary);
}

.video-placeholder {
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e293b;
}

.video-content {
    text-align: center;
    color: #f8fafc;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.video-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #f8fafc;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.video-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

.video-progress {
    flex: 1;
    margin: 0 16px;
}

.progress-track {
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #f59e0b;
    border-radius: 2px;
}

/* Lesson header */
.lesson-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 16px;
}

.lesson-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lesson-header-icon {
    width: 40px;
    height: 40px;
    background: #f59e0b;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lesson-header-info h2 {
    margin: 0;
    font-size: 20px;
    color: #f8fafc;
}

.lesson-header-info p {
    margin: 0;
    color: #94a3b8;
    font-size: 14px;
}

.lesson-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lesson-rating {
    color: #fbbf24;
    font-size: 18px;
}

.status-badge {
    background: #22c55e;
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lesson-points {
    background: #3b82f6;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Navigation controls above description */
.lesson-nav-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin: 24px 0 16px 0;
}

.circular-nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #f59e0b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.circular-nav-btn:hover {
    background: #fbbf24;
    transform: scale(1.05);
}

.circular-nav-btn:disabled {
    background: #334155;
    color: #64748b;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.circular-nav-btn i {
    color: inherit;
    font-size: 18px;
}

.lesson-status-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rating-stars-display {
    color: #fbbf24;
    font-size: 16px;
}

.status-completed {
    background: #22c55e;
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Voltar text */
.voltar-text {
    color: #f8fafc !important;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: opacity 0.2s ease;
}

.voltar-text:hover {
    opacity: 0.8;
}

.voltar-text i {
    color: #f8fafc !important;
    margin-right: 6px;
}

/* Lesson number */
.lesson-number {
    width: 20px;
    height: 20px;
    background: #334155;
    color: #f8fafc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 10px;
    margin-right: 8px;
    flex-shrink: 0;
}

.lesson-item.current .lesson-number {
    background: #333;
    color: #f8fafc;
}

.lesson-item.completed .lesson-number {
    background: #334155;
    color: #f8fafc;
}

/* Tablet widths keep the video and contents panel side by side. The page shell
   already consumes space for its own navigation, so viewport-wide stacking here
   would squeeze the lesson area out of view. */
@media (min-width: 769px) and (max-width: 1200px) {
    .lesson-sidebar { flex-basis: 300px; width: 300px; padding: 16px; }
    .lesson-main { padding: 16px; }
    .lesson-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding: 0;
    }
    .lesson-header-left, .lesson-header-info { min-width: 0; }
    .lesson-header-right { flex-wrap: nowrap; justify-content: flex-start; }
    .lesson-rating { display: flex; flex: 0 0 auto; white-space: nowrap; gap: 1px; }
}

@media (max-width: 768px) {
    .lesson-layout,
    .lesson-layout.sidebar-left { flex-direction: column; }
    .lesson-main { order: 1; width: 100%; padding: 16px; }
    .lesson-sidebar {
        order: 2;
        flex: 0 0 auto;
        width: 100%;
        max-height: 45vh;
        position: static;
        border: 0;
        border-top: 1px solid #475569;
    }
    .lesson-layout.sidebar-left .lesson-sidebar {
        order: 0;
        border: 0;
        border-bottom: 1px solid #475569;
    }
    .lesson-layout .lesson-sidebar.collapsed { flex-basis: 0; width: 100%; min-width: 0; height: 0; max-height: 0; border: 0; }
}

/* On wide desktop screens, keep the lesson video at a comfortable reading size. */
@media (min-width: 1600px) {
    .lesson-main > .modern-video-player {
        max-width: 960px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* The lesson player keeps its dark canvas in both appearance modes. */
body.lesson-page {
    --surface-page: #0f172a;
    --surface-card: #1e293b;
    --surface-raised: #1e293b;
    --border-color: #334155;
    --border-raised: #334155;
    --background-light: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    background: #0f172a;
    color: #f1f5f9;
}
body.lesson-page .main-content { background: #0f172a; color: #f1f5f9; }

.lesson-nav-controls:has(.lesson-completion-actions) { flex-wrap: wrap; }

.lesson-completion-actions {
    flex-basis: 100%;
    display: flex;
    justify-content: flex-end;
    margin: 0 1rem 1rem;
}

.lesson-main > .modern-video-player {
    min-height: 320px;
}

@media (min-width: 1024px) {
    body.lesson-page .main-content { padding-top: calc(var(--header-h) + 4px); }
    .lesson-main { padding-top: 14px; }
    .lesson-main > .lesson-navigation-row { margin-bottom: 4px; }
    .lesson-main > .lesson-header { margin-bottom: 4px; }
    .lesson-main > .lesson-nav-controls { margin: 22px 0 8px; padding: 0; gap: 12px; flex-wrap: nowrap; }
    .lesson-main > .lesson-nav-controls .lesson-status-info { display: none; }
    .lesson-main > .lesson-nav-controls .circular-nav-btn { width: 40px; height: 40px; }
    .lesson-main > .lesson-nav-controls .lesson-completion-actions { flex: 1; order: 1; margin: 0; }
    .lesson-main > .lesson-nav-controls .nav-next { order: 2; }
    .lesson-main > .lesson-nav-controls .circular-nav-btn { flex-shrink: 0; }
    .lesson-main > .modern-video-player { min-height: 0; }
    .lesson-main > .modern-video-player > video {
        max-height: min(520px, max(180px, calc(100dvh - 260px))) !important;
        object-fit: contain;
    }
}

.lesson-rating { display: inline-flex; flex-wrap: nowrap; }
.lesson-star {
    border: 0;
    background: transparent;
    color: #fbbf24;
    font-size: 18px;
    padding: 3px;
    cursor: pointer;
}
.lesson-star:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.lesson-main > .modern-video-player { position: relative; }
.lesson-playback-speed {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(15, 23, 42, .94);
    color: #fff;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
}
.modern-video-player:hover .lesson-playback-speed,
.modern-video-player:focus-within .lesson-playback-speed {
    opacity: 1;
    pointer-events: auto;
}
.lesson-playback-speed select {
    background: #1e293b;
    color: #fff;
    border: 1px solid #94a3b8;
    border-radius: 4px;
}
@media (hover: none) {
    .lesson-playback-speed { opacity: 1; pointer-events: auto; }
}

/* Bilingual lesson guide */
.lesson-guide { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.lesson-guide p { margin: 0; }
.lesson-guide-pattern, .lesson-guide-contrast {
    padding: .85rem 1rem;
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    color: var(--text-primary);
}
.lesson-guide-pattern { border-inline-start: 4px solid #60a5fa; }
.lesson-guide-pattern > div { margin-top: .25rem; }
.lesson-guide-contrast { border-inline-start: 4px solid #fbbf24; }
.lesson-guide-mascot { display: flex; align-items: flex-start; gap: .85rem; padding: .25rem 0; }
.lesson-guide-mascot img { flex: 0 0 auto; width: 76px; height: 76px; object-fit: contain; }
.lesson-guide-table-wrap { overflow-x: auto; }
.lesson-guide-table { width: 100%; border-collapse: collapse; text-align: left; }
.lesson-guide-table caption { caption-side: top; text-align: left; font-weight: 700; color: var(--text-primary); padding: 0 0 .4rem; }
.lesson-guide-table th, .lesson-guide-table td { padding: .55rem .7rem; vertical-align: top; }
.lesson-guide-table th:first-child { background: #2563eb; color: #fff; }
.lesson-guide-table th:last-child { background: #16a34a; color: #fff; }
.lesson-guide-table td { border-bottom: 1px solid var(--border-color); background: var(--surface-raised); color: var(--text-primary); }
.lesson-guide-english { font-style: italic; font-weight: 650; }
.lesson-page .lesson-main .lesson-guide-reading {
    color: #67c6ff;
    font-size: .875rem;
    font-weight: 400;
    overflow-wrap: anywhere;
}
.lesson-guide-pair, .lesson-guide-pair > .lesson-guide-reading { display: block; }
.lesson-guide-reference { display: grid; min-width: 0; gap: .65rem; }
.lesson-guide-alphabet {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 5rem), 1fr));
    gap: .55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.lesson-guide-alphabet > li {
    padding: .5rem .3rem;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
}
.lesson-guide-alphabet > li > * { display: block; }
.lesson-guide-alphabet > li > i { font-size: 1.2rem; }
.lesson-guide-alphabet small { line-height: 1.35; margin-top: .2rem; }
.lesson-guide-verb-wrap { border-radius: var(--radius-md); }
.lesson-guide-verb-wrap:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.lesson-guide-verb-table { min-width: max-content; }
.lesson-guide-verb-table thead th:first-child { background: #334155; }
.lesson-guide-verb-table thead .lesson-guide-verb-form-0 { background: #14532d; color: #fff; }
.lesson-guide-verb-table thead .lesson-guide-verb-form-1 { background: #78350f; color: #fff; }
.lesson-guide-verb-table thead .lesson-guide-verb-form-2 { background: #1e3a8a; color: #fff; }
.lesson-guide-verb-table thead .lesson-guide-verb-form-3 { background: #581c87; color: #fff; }
.lesson-guide-verb-table th[scope="row"] { background: var(--background-light); }
.lesson-guide-verb-table small,
.lesson-guide-verb-table tbody .lesson-guide-reading { display: block; }
.lesson-guide-verb-table tbody small { color: var(--text-secondary); }
.lesson-guide-grammar-examples {
    display: grid;
    gap: .65rem;
    margin: 0;
    padding-inline-start: 1.25rem;
}

.lesson-guide h5 { margin: 0; font-size: 1rem; }
.lesson-guide-ipa-note { font-size: .875rem; color: var(--text-secondary); }
.lesson-guide-mascot > div { min-width: 0; }
.lesson-guide-mascot details { margin-top: .45rem; }
.lesson-guide-model-audio { display: block; width: min(100%, 20rem); margin-block: .6rem; }
.lesson-guide-mascot summary { color: var(--text-primary); cursor: pointer; text-decoration: underline; }

.lesson-start-audio { margin: 0 1rem 1rem; }
.lesson-start-audio[hidden], .lesson-main [role="tabpanel"][hidden] { display: none; }

.lesson-practice-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: .5rem 1rem 1rem;
    padding: .35rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
}
.lesson-practice-tabs button, .lesson-practice-options button {
    padding: .55rem .8rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.lesson-practice-tabs button:hover { background: var(--background-light); }
.lesson-practice-tabs button[aria-selected="true"] { background: #1d4ed8; color: #fff; }
.lesson-practice-tabs button:focus-visible, .lesson-practice-options button:focus-visible,
.lesson-match-row select:focus-visible { outline: 2px solid #67c6ff; outline-offset: 2px; }

.lesson-practice-panel { margin: 0 1rem 1rem; }
.lesson-practice-body, .lesson-practice-form { display: grid; gap: 1rem; min-width: 0; }
.lesson-practice-body h3, .lesson-practice-body p { margin: 0; }
.lesson-match-row, .lesson-practice-clue, .lesson-practice-review > li {
    padding: .8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
}
.lesson-practice-sentence { line-height: 2.1; font-size: 1.1rem; overflow-wrap: anywhere; }
.lesson-practice-round, .lesson-practice-clue, .lesson-practice-actions, .lesson-practice-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .65rem;
}
.lesson-practice-round progress { flex: 1 1 6rem; max-width: 100%; accent-color: #65a30d; }
.lesson-practice-round span { color: var(--text-secondary); }
.lesson-practice-clue p { flex: 1 1 10rem; }
.lesson-practice-clue img { object-fit: contain; }
.lesson-practice-blank {
    display: inline-block;
    min-width: 3rem;
    padding-inline: .4rem;
    border-bottom: 2px solid #67c6ff;
    color: #67c6ff;
    text-align: center;
    line-height: 1.4;
}
.lesson-practice-options button {
    min-height: 44px;
    border-color: #587088;
    background: var(--surface-raised);
    overflow-wrap: anywhere;
}
.lesson-practice-options button[aria-pressed="true"] {
    border-color: #67c6ff;
    background: #14365b;
    color: #e0f2fe;
}
.lesson-practice-options button:disabled { cursor: default; }
.lesson-practice-feedback:empty { display: none; }
.lesson-practice-correct { color: #5cff72; font-weight: 700; }
.lesson-practice-incorrect, .lesson-practice-error { color: #fecaca; font-weight: 700; }
.lesson-practice-review {
    display: grid;
    gap: .55rem;
    margin: 0;
    padding-inline-start: 1.5rem;
}

.lesson-review {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    scroll-margin-top: 5rem;
}
.lesson-review h5 { color: #67c6ff; }
.lesson-review-list { display: grid; gap: .55rem; margin: 0; padding-inline-start: 1.3rem; }
.lesson-review-group {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
}
.lesson-review-group summary { padding: .65rem .9rem; font-weight: 700; cursor: pointer; }
.lesson-number-table th[scope="col"] { background: #25496e; color: #fff; }
.lesson-number-table th[scope="row"] { font-variant-numeric: tabular-nums; }
.lesson-review-table td:first-child .lesson-guide-reading,
.lesson-number-table td .lesson-guide-reading { display: block; }

.lesson-match-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: .6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.lesson-match-choices li {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
}
.lesson-match-choices li strong {
    display: grid;
    flex: 0 0 1.8rem;
    height: 1.8rem;
    place-items: center;
    border-radius: 50%;
    background: #25496e;
    color: #fff;
}
.lesson-match-row { display: grid; gap: .45rem; min-width: 0; }
.lesson-match-row select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: .4rem .55rem;
    border: 1px solid #669bca;
    border-radius: var(--radius-md);
    background: var(--background-dark);
    color: var(--text-primary);
    font: inherit;
    color-scheme: dark;
}
.lesson-match-row select option {
    background-color: #fff;
    color: #142033;
}
.lesson-guide-verb-single { min-width: 0; }

.lesson-match-choices {
    padding: .65rem;
    border: 1px solid #426086;
    border-radius: var(--radius-md);
    background: #172d46;
    color: #fff;
    font-size: .85rem;
}
.lesson-match-choices li {
    padding: .3rem .4rem;
    border: 0;
    background: transparent;
}
.lesson-match-choices li strong { flex-basis: 1.35rem; height: 1.35rem; }

.lesson-main > .lesson-media-player.lesson-mini-player {
  position: fixed;
  inset: auto max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) auto;
  width: min(22rem, calc(100vw - 2rem));
  height: auto;
  min-height: 0;
  margin: 0;
  z-index: 1200;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .45);
}
.lesson-mini-player > video { display: block; aspect-ratio: 16 / 9; object-fit: contain; }
.lesson-mini-player .lesson-playback-speed { display: none; }
.lesson-mini-close:not([hidden]) {
  position: absolute;
  inset: .4rem .4rem auto auto;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #172033;
  color: #fff;
  font: 1.35rem/1 sans-serif;
  cursor: pointer;
}
