/* ===========================================
   Course Unit View (Student)
   =========================================== */

.course-unit-body .main-header,
.course-unit-body .site-footer {
    display: none;
}

.course-unit-body main {
    padding-top: 0;
}

.course-unit {
    min-height: 100vh;
    background: var(--bg-light);
    color: var(--text-primary);
    direction: rtl;
    text-align: right;
}

.unit-mobile-header,
.mobile-landscape-note {
    display: none;
}

.unit-mobile-header {
    margin: 12px 14px 8px;
    padding: 14px;
    border-radius: 20px;
    background: linear-gradient(180deg, #0f172a 0%, #182235 100%);
    color: #ffffff;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
}

.unit-mobile-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.unit-mobile-header__titles {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.unit-mobile-header__titles h1 {
    margin: 0;
    font-size: 1.18rem;
    line-height: 1.35;
    color: #ffffff;
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
}

.unit-mobile-header__titles p {
    margin: 4px 0 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.72);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unit-mobile-header__back,
.unit-mobile-header__content-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    text-decoration: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.84rem;
}

.unit-mobile-header__content-btn {
    border: none;
}

.unit-mobile-header__body {
    display: grid;
    gap: 10px;
}

.unit-mobile-header__kicker {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.66);
}

.unit-mobile-header__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.unit-mobile-header__meta span {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.9);
}

.unit-mobile-header__progress {
    display: grid;
    gap: 6px;
}

.unit-mobile-header__progress-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.74);
}

.unit-mobile-header__selectors {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    align-items: end;
}

.unit-mobile-header__selector-group {
    display: grid;
    gap: 6px;
}

.unit-mobile-header__selector-group--full {
    grid-column: 1 / -1;
}

.unit-mobile-header__selectors label {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 700;
}

.unit-mobile-header__selectors select {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;
    font-family: inherit;
    font-weight: 700;
}

.mobile-landscape-note {
    margin: 0 14px 12px;
    padding: 10px 12px;
    border-radius: 16px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    line-height: 1.65;
}

.mobile-landscape-note__icon {
    font-size: 1rem;
    flex: 0 0 auto;
}

/* ═══════════════════════════════════════════════════
   Unit Hero Bar — compact horizontal strip
   Replaces the old tall hero section (2026-05-05)
═══════════════════════════════════════════════════ */

/* Keep old .unit-hero hidden (used by mobile header logic) */
.unit-hero { display: none; }

.unit-hero-bar {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    color: #ffffff;
    padding: 0 var(--space-4, 24px);
}

.unit-hero-bar__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: var(--container-xl, 1400px);
    margin-inline: auto;
    min-height: 64px;
    padding: 10px 0;
    flex-wrap: wrap;
}

/* ── Left side: back + title + chips + progress ── */
.unit-hero-bar__start {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 0;
    min-width: 0;
    flex-wrap: wrap;
}

.uhb-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s;
}
.uhb-back-btn:hover { background: rgba(255, 255, 255, 0.16); }

.uhb-title-block {
    min-width: 0;
    flex-shrink: 1;
}

.uhb-kicker {
    display: block;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uhb-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Stat chips */
.uhb-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.uhb-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
    white-space: nowrap;
}

.uhb-chip--progress {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* Slim progress bar */
.uhb-progress {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.uhb-progress__track {
    width: 72px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.uhb-progress__fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #22c55e, #86efac);
    transition: width 0.4s ease;
}

/* ── Right side: guest CTA + nav ── */
.unit-hero-bar__end {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Inline guest prompt */
.uhb-guest {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.uhb-guest__text {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
}

.uhb-guest__btn {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.uhb-guest__btn:hover { opacity: 0.85; }

.uhb-guest__btn--primary {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #ffffff;
}

.uhb-guest__btn--ghost {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.uhb-guest__close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}
.uhb-guest__close:hover { color: #ffffff; }

/* Teacher action button */
.uhb-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}
.uhb-action-btn:hover { background: rgba(255, 255, 255, 0.15); }

/* Unit navigation: prev arrow + select dropdown + next arrow */
.uhb-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 3px;
}

.uhb-nav__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.15s;
    flex-shrink: 0;
}

.uhb-nav__btn--ghost {
    color: rgba(255, 255, 255, 0.7);
}
.uhb-nav__btn--ghost:hover { background: rgba(255, 255, 255, 0.1); }

.uhb-nav__btn--primary {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #ffffff;
}
.uhb-nav__btn--primary:hover { opacity: 0.88; }

.uhb-unit-select {
    border: none;
    background: transparent;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 6px;
    cursor: pointer;
    max-width: 160px;
    min-width: 80px;
}
.uhb-unit-select option { background: #1e293b; color: #ffffff; }

.unit-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    padding: 24px var(--space-4) 0;
    align-items: start;
    max-width: var(--container-xl);
    margin-inline: auto;
    direction: ltr;
}

.unit-main {
    grid-column: 1;
    direction: rtl;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.unit-sidebar {
    grid-column: 2;
    direction: rtl;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 16px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    position: sticky;
    top: 16px;
    align-self: start;
}

.unit-sidebar h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.sidebar-head {
    display: grid;
    gap: 8px;
}

.sidebar-head label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.sidebar-head select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: #f8fafc;
    font-family: inherit;
    color: var(--text-primary);
}

.chapter-group {
    display: none;
    background: #f8fafc;
    border-radius: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.chapter-group.active {
    display: block;
}

.chapter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.lesson-list {
    display: grid;
    gap: 6px;
}

.lesson-items {
    display: grid;
    gap: 6px;
}

.lesson-link {
    padding: 8px 10px;
    border-radius: 10px;
    text-decoration: none;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.2);
    font-size: 0.85rem;
    position: relative;
    padding-right: 32px;
}

.lesson-link.active {
    background: rgba(47, 91, 255, 0.12);
    font-weight: 700;
    border-color: rgba(47, 91, 255, 0.35);
    color: #1d4ed8;
}

.lesson-link.locked {
    color: #94a3b8;
    background: #f1f5f9;
    border-style: dashed;
}

.lesson-link.active::after {
    content: "▶";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #1d4ed8;
}

.unit-player-card {
    background: #0b1120;
    border-radius: 20px;
    padding: 16px;
    position: relative;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.15);
}

#lessonPreviewPlayer {
    width: 100%;
}

#lessonPreviewPlayer.is-hidden {
    display: none;
}

#lessonPreviewPlayer .mada-player-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 420px;
    background: #0b1120;
    border-radius: 16px;
    overflow: hidden;
}

#lessonPreviewPlayer .mada-player-placeholder,
#lessonPreviewPlayer .mada-player-container,
#lessonPreviewPlayer #plyrPlayer,
#lessonPreviewPlayer .plyr__video-embed,
#lessonPreviewPlayer .plyr__video-embed iframe,
#lessonPreviewPlayer .plyr__video-wrapper,
#lessonPreviewPlayer .plyr,
#lessonPreviewPlayer video {
    width: 100%;
    height: 100%;
}

#lessonPreviewPlayer .mada-player-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e2e8f0;
    text-align: center;
    padding: 24px;
}

.player-overlay {
    position: absolute;
    inset: 12px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e2e8f0;
    text-align: center;
    padding: 24px;
    z-index: 5;
}

/* Locked content overlay */
.player-overlay--locked {
    flex-direction: column;
    gap: 14px;
    backdrop-filter: blur(6px);
}
.player-overlay__icon {
    font-size: 2.2rem;
    line-height: 1;
}
.player-overlay__msg {
    font-size: 1rem;
    font-weight: 700;
    color: #e2e8f0;
}
.player-overlay__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}
.player-overlay__btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.player-overlay__btn--primary {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #ffffff;
}
.player-overlay__btn--ghost {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.unit-player-card.pdf-mode .player-overlay {
    display: none;
}

.pdf-viewer {
    display: none;
    background: #0b1120;
    border-radius: 16px;
    overflow: hidden;
    min-height: 420px;
    position: relative;
}

.pdf-viewer.active {
    display: block;
}

.pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pdf-left,
.pdf-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pdf-btn {
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.8rem;
}

.pdf-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
}

.pdf-canvas-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12px;
    background: #0b1120;
    min-height: 360px;
    position: relative;
}

.pdf-canvas-wrap .preview-watermark {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 66px;
    height: 66px;
    object-fit: contain;
    opacity: 0.22;
    pointer-events: none;
    z-index: 3;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    user-select: none;
}

.pdf-canvas-wrap canvas {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25);
}

.pdf-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #e2e8f0;
    text-align: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.65);
}

.lesson-info {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 18px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

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

.video-sort-header h4 {
    margin: 0 0 6px;
    font-size: 1.05rem;
}

.video-sort-header p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.video-sort-save {
    border: none;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--primary-gradient);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

.video-view-toggle {
    display: inline-flex;
    gap: 6px;
    background: rgba(47, 91, 255, 0.08);
    padding: 4px;
    border-radius: 999px;
}

.video-view-toggle .view-btn {
    border: none;
    padding: 6px 12px;
    border-radius: 999px;
    background: transparent;
    font-size: 0.8rem;
    cursor: pointer;
    color: #0f172a;
}

.video-view-toggle .view-btn.active {
    background: #ffffff;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
    font-weight: 700;
}

.video-sort-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.video-sort-list.grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.video-sort-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 12px 14px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.video-sort-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

.video-sort-item.grid-view {
    grid-template-columns: 1fr;
    text-align: right;
}

.video-sort-item.dragging {
    opacity: 0.6;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.15);
}

.video-sort-item.active {
    border-color: rgba(47, 91, 255, 0.35);
    background: rgba(47, 91, 255, 0.08);
}

.video-sort-item.viewed {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.08);
}

.video-sort-item.viewed::after {
    content: "✓";
    position: absolute;
    top: 10px;
    left: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.9);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
}

/* Locked video items */
.video-sort-item--locked {
    cursor: default;
    opacity: 0.72;
    border-color: rgba(148, 163, 184, 0.25);
    background: rgba(148, 163, 184, 0.05);
}
.video-sort-item--locked:hover {
    background: rgba(148, 163, 184, 0.09);
    border-color: rgba(148, 163, 184, 0.35);
}
.video-lock-icon {
    background: rgba(148, 163, 184, 0.15) !important;
    font-size: 0.95rem;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.video-lock-msg {
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
}

.video-index {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(47, 91, 255, 0.12);
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #1d4ed8;
}

.video-info .video-title {
    min-width: 0;
    font-weight: 700;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-info .video-meta {
    min-width: 0;
    font-size: 0.8rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drag-handle {
    font-size: 1.1rem;
    color: #64748b;
    cursor: grab;
}

.video-sort-item.grid-view .drag-handle {
    display: none;
}

.video-sort-item.grid-view .video-index {
    margin-bottom: 8px;
}

.video-sort-status {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #16a34a;
}

.mobile-video-sheet-hint,
.mobile-video-fab,
.mobile-video-sheet {
    display: none;
}

.mobile-video-sheet-hint {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(47, 91, 255, 0.08), rgba(14, 165, 233, 0.08));
    color: #334155;
    font-size: 0.84rem;
    line-height: 1.7;
    border: 1px dashed rgba(59, 130, 246, 0.28);
}

.video-info {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.lesson-info h2 {
    margin: 0 0 8px;
    font-size: 1.2rem;
}

.lesson-info p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

.lesson-info-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Lesson prev/next navigation below player */
.lesson-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0 4px;
    direction: rtl;
}

.lesson-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 14px;
    background: #f1f5f9;
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s;
    white-space: nowrap;
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lesson-nav-btn:hover {
    background: #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.lesson-nav-btn.primary {
    background: var(--primary, #6c47ff);
    color: #ffffff;
    border-color: transparent;
}

.lesson-nav-btn.primary:hover {
    background: var(--primary-dark, #5535e0);
}

.lesson-nav-btn span.nav-label {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.7;
    display: block;
}

.lesson-nav-spacer {
    flex: 1;
}

.lesson-videos {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 18px;
}

.lesson-videos h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.video-list {
    display: grid;
    gap: 10px;
}

.video-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    text-align: right;
}

.video-item.active {
    border-color: var(--primary-color);
    background: rgba(47, 91, 255, 0.08);
}

.item-title {
    font-weight: 600;
    color: #0f172a;
}

.item-meta {
    font-size: 0.8rem;
    color: #64748b;
}

.play-label {
    font-size: 0.8rem;
    color: #0f172a;
}

.unit-tabs {
    margin-top: 28px;
    padding: 0 0 50px;
}

.unit-main .unit-tabs {
    margin-top: 16px;
    padding: 0 0 24px;
}

.unit-main .unit-tabs > .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.tabs-header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: #ffffff;
    border-radius: 18px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.content-viewer-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    background: #ffffff;
    border-radius: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.mobile-tab-shortcuts-wrap,
.mobile-tab-shortcuts {
    display: none;
}

.mobile-tab-shortcuts-wrap {
    position: relative;
}

.mobile-tab-shortcuts-note {
    display: none;
    margin: 0 0 8px;
    font-size: 0.76rem;
    color: #64748b;
}

.mobile-tab-shortcut {
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: #ffffff;
    color: #0f172a;
    padding: 10px 12px;
    border-radius: 14px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.84rem;
    text-align: center;
    cursor: pointer;
}

.mobile-tab-shortcut.active {
    background: rgba(47, 91, 255, 0.1);
    border-color: rgba(47, 91, 255, 0.3);
    color: #1d4ed8;
}

.viewer-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.viewer-chip.guest {
    background: rgba(148, 163, 184, 0.18);
    color: #334155;
}

.viewer-note {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.6;
}
.unit-tab-btn {
    border: none;
    background: rgba(47, 91, 255, 0.08);
    color: #0f172a;
    padding: 8px 14px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

.unit-tab-btn.active {
    background: var(--primary-gradient);
    color: #ffffff;
}

.video-segment-nav {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.video-segment-nav--integrated {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.video-segment-btn {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: #f8fafc;
    color: #0f172a;
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-align: right;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.video-segment-btn:hover:not(:disabled) {
    background: #eef2ff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.video-segment-btn.primary {
    background: rgba(47, 91, 255, 0.1);
    border-color: rgba(47, 91, 255, 0.25);
}

.video-segment-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.video-segment-label {
    font-size: 0.76rem;
    color: #64748b;
}

.video-segment-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.tab-panel {
    display: none;
    margin-top: 16px;
}

.tab-panel.active {
    display: block;
}

.tab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.tab-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    display: grid;
    gap: 8px;
}

.tab-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tab-action.ghost {
    background: #f1f5f9;
    color: #0f172a;
}

.tab-title {
    font-weight: 700;
    color: #0f172a;
}

.tab-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tab-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--primary-gradient);
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
}

.contact-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    gap: 12px;
    align-items: center;
}

.contact-card img {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    object-fit: cover;
}

.ai-card textarea {
    width: 100%;
    min-height: 120px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 10px;
    font-family: inherit;
    margin-bottom: 10px;
}

.ai-answer {
    margin-top: 12px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}

.empty-state {
    padding: 14px;
    background: #f1f5f9;
    border-radius: 12px;
    color: #64748b;
    font-size: 0.85rem;
    text-align: center;
}

/* ───────────────────────────────────────────
   Tablet landscape & small desktop (769px – 1100px)
   Keep two-column layout with a narrower sidebar
──────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1100px) {
    /* Hero bar: hide stats + progress on small tablets to save horizontal space */
    .uhb-stats { display: none; }
    .uhb-progress { display: none; }
    .uhb-guest__text { display: none; }
    .uhb-unit-select { max-width: 120px; }

    .hero-card {
        grid-template-columns: 1fr;
    }

    /* Two-column: player takes remaining space, sidebar fixed at 240px */
    .unit-layout {
        grid-template-columns: minmax(0, 1fr) 240px;
        gap: 16px;
        padding: 16px 16px 0;
        direction: ltr;
    }

    .unit-main {
        grid-column: 1;
        direction: rtl;
    }

    .unit-sidebar {
        grid-column: 2;
        direction: rtl;
        max-height: calc(100vh - 80px);
        position: sticky;
        top: 16px;
        align-self: start;
        padding: 12px;
        font-size: 0.9rem;
    }

    /* Sidebar headings & selects more compact */
    .unit-sidebar h3 {
        font-size: 0.92rem;
    }

    .sidebar-head select {
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    /* Tabs: scrollable row instead of wrapping */
    .tabs-header {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
        scrollbar-width: thin;
        gap: 6px;
    }

    .unit-tab-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 0.82rem;
    }

    .video-sort-header {
        align-items: flex-start;
    }

    .tab-grid,
    .video-sort-list.grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .mobile-video-fab {
        bottom: 72px;
    }

    #lessonPreviewPlayer .mada-player-wrapper {
        min-height: 280px;
    }

    .pdf-viewer {
        min-height: 280px;
    }
}

@media (max-width: 767px) {
    /* On mobile (≤767px): hide desktop hero bar, show mobile header */
    .unit-hero-bar {
        display: none;
    }

    .unit-mobile-header,
    .mobile-landscape-note {
        display: flex;
    }

    .unit-mobile-header {
        display: block;
    }

    .unit-hero {
        display: none;
    }

    .unit-nav {
        flex-direction: column;
    }

    /* Force single column on phones */
    .unit-layout {
        display: flex;
        flex-direction: column;
        padding: 0 12px;
        gap: 12px;
    }

    /* Hide sidebar on mobile — navigation is in mobile header */
    .unit-sidebar {
        display: none;
    }

    .unit-player-card {
        padding: 12px;
        border-radius: 18px;
    }

    .lesson-info {
        padding: 14px;
    }

    .lesson-nav {
        padding-top: 0;
        margin-top: -2px;
    }

    .lesson-nav-btn {
        max-width: none;
        flex: 1;
        justify-content: center;
        white-space: normal;
        text-align: center;
        line-height: 1.5;
    }

    .unit-sidebar {
        border-radius: 18px;
        padding: 14px;
    }

    .content-viewer-banner {
        padding: 10px;
        align-items: flex-start;
        flex-direction: column;
    }

    .mobile-tab-shortcuts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 10px;
    }

    .tabs-header {
        display: none;
    }

    .tab-panel {
        display: none;
        margin-top: 10px;
    }

    .tab-panel.active {
        display: block;
    }

    .tab-panel[data-tab-panel="videos"] {
        display: none !important;
    }

    .mobile-video-sheet-hint,
    .mobile-video-fab,
    .mobile-video-sheet {
        display: block;
    }

    #lessonPreviewPlayer .mada-player-wrapper {
        min-height: 220px;
    }

    .pdf-viewer {
        min-height: 220px;
    }

    .mobile-video-fab {
        position: fixed;
        left: 16px;
        bottom: 88px;
        z-index: 1100;
        border: none;
        border-radius: 999px;
        background: linear-gradient(135deg, #2563eb, #0ea5e9);
        color: #ffffff;
        box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
        padding: 10px 12px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-family: inherit;
        font-weight: 700;
    }

    .mobile-video-fab-icon {
        font-size: 1rem;
    }

    .mobile-video-fab-text {
        font-size: 0.88rem;
    }

    .mobile-video-fab-count {
        min-width: 24px;
        height: 24px;
        padding: 0 6px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.18);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.76rem;
    }

    .mobile-video-sheet {
        position: fixed;
        inset: 0;
        z-index: 1200;
        pointer-events: none;
    }

    .mobile-video-sheet.is-open {
        pointer-events: auto;
    }

    .mobile-video-sheet__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(15, 23, 42, 0.42);
        opacity: 0;
        transition: opacity 0.22s ease;
    }

    .mobile-video-sheet.is-open .mobile-video-sheet__backdrop {
        opacity: 1;
    }

    .mobile-video-sheet__panel {
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%) translateY(100%);
        width: min(92%, 460px);
        background: #ffffff;
        border-radius: 24px 24px 0 0;
        padding: 12px 14px 18px;
        max-height: 72vh;
        transition: transform 0.26s ease;
        box-shadow: 0 -20px 50px rgba(15, 23, 42, 0.18);
    }

    .mobile-video-sheet.is-open .mobile-video-sheet__panel {
        transform: translateX(-50%) translateY(0);
    }

    .mobile-video-sheet__handle {
        width: 52px;
        height: 5px;
        border-radius: 999px;
        background: #cbd5e1;
        margin: 0 auto 12px;
    }

    .mobile-video-sheet__header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 12px;
    }

    .mobile-video-sheet__header h3 {
        margin: 4px 0;
        font-size: 1rem;
        color: #0f172a;
    }

    .mobile-video-sheet__header p,
    .mobile-video-sheet__eyebrow {
        margin: 0;
        font-size: 0.8rem;
        color: #64748b;
    }

    .mobile-video-sheet__close {
        border: none;
        background: #eff6ff;
        color: #1d4ed8;
        width: 36px;
        height: 36px;
        border-radius: 999px;
        font-size: 1.3rem;
        line-height: 1;
    }

    .mobile-video-sheet__body {
        overflow-y: auto;
        display: grid;
        gap: 10px;
        padding-bottom: 10px;
    }

    .mobile-video-sheet__item {
        width: 100%;
        border: 1px solid rgba(148, 163, 184, 0.24);
        background: #f8fafc;
        border-radius: 16px;
        padding: 12px;
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 10px;
        text-align: right;
        font-family: inherit;
    }

    .mobile-video-sheet__item.active {
        background: rgba(47, 91, 255, 0.1);
        border-color: rgba(47, 91, 255, 0.32);
    }

    .mobile-video-sheet__item.viewed .mobile-video-sheet__item-index {
        background: rgba(34, 197, 94, 0.16);
        color: #15803d;
    }

    .mobile-video-sheet__item-index {
        width: 34px;
        height: 34px;
        border-radius: 12px;
        background: rgba(47, 91, 255, 0.12);
        color: #1d4ed8;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 0.9rem;
    }

    .mobile-video-sheet__item-content {
        display: grid;
        gap: 4px;
        min-width: 0;
    }

    .mobile-video-sheet__item-title {
        color: #0f172a;
        font-weight: 700;
        line-height: 1.5;
    }

    .mobile-video-sheet__item-meta {
        color: #64748b;
        font-size: 0.8rem;
    }

    body.mobile-video-sheet-open {
        overflow: hidden;
    }
}

@media (max-width: 767px) and (orientation: landscape) {
    .unit-mobile-header {
        margin: 8px 12px 6px;
        padding: 12px 14px;
    }

    .unit-mobile-header__top {
        margin-bottom: 8px;
    }

    .unit-mobile-header__body {
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 10px 18px;
        align-items: start;
    }

    .unit-mobile-header__kicker,
    .unit-mobile-header__body h1,
    .unit-mobile-header__meta,
    .unit-mobile-header__progress,
    .unit-mobile-header__progress-text {
        grid-column: 2;
    }

    .unit-mobile-header__selectors {
        grid-column: 1;
        grid-row: 1 / span 5;
        align-self: stretch;
        grid-template-columns: 1fr;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 18px;
        padding: 12px;
    }

    .unit-mobile-header__body h1 {
        font-size: 1.05rem;
        line-height: 1.35;
    }

    .unit-mobile-header__meta {
        gap: 6px;
    }

    .unit-mobile-header__meta span {
        font-size: 0.72rem;
        padding: 4px 7px;
    }

    .guest-login-banner {
        margin: 6px 12px;
    }

    .guest-login-banner-inner {
        padding: 10px 12px;
        display: grid;
        grid-template-columns: auto 1fr auto auto;
        gap: 8px;
        align-items: center;
    }

    .guest-login-icon {
        display: none;
    }

    .guest-login-text {
        font-size: 0.82rem;
        line-height: 1.45;
    }

    .guest-login-actions {
        gap: 6px;
    }

    .guest-banner-btn {
        min-height: 36px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .mobile-landscape-note {
        display: none;
    }

    .unit-layout {
        grid-template-columns: minmax(0, 1fr) 290px;
        direction: ltr;
        padding: 0 12px 0;
        gap: 12px;
        align-items: start;
    }

    .unit-main {
        grid-column: 1;
    }

    .unit-sidebar {
        grid-column: 2;
        position: sticky;
        top: 10px;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }

    .unit-player-card {
        padding: 10px;
    }

    #lessonPreviewPlayer .mada-player-wrapper {
        min-height: 200px;
        max-height: 42vh;
    }

    .video-segment-nav--integrated {
        margin-top: 10px;
        padding-top: 10px;
    }

    .video-segment-btn {
        padding: 9px 10px;
    }

    .video-segment-title {
        font-size: 0.8rem;
    }

    .lesson-info {
        padding: 12px 14px;
    }

    .lesson-info h2 {
        font-size: 1.02rem;
    }

    .lesson-info p {
        font-size: 0.84rem;
        line-height: 1.55;
    }

    .lesson-nav {
        gap: 8px;
    }

    .lesson-nav-btn {
        padding: 9px 12px;
        font-size: 0.82rem;
    }

    .content-viewer-banner {
        margin-bottom: 8px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .mobile-tab-shortcuts {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
        margin-bottom: 8px;
    }

    .mobile-tab-shortcut {
        padding: 8px 10px;
        font-size: 0.76rem;
    }

    .mobile-video-fab {
        bottom: 18px;
        left: 18px;
        padding: 9px 11px;
        box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
    }
}

.course-unit-body.is-phone-layout .unit-hero {
    display: none;
}

.course-unit-body.is-phone-layout .unit-mobile-header {
    display: block;
    margin: 10px 12px 8px;
    padding: 14px;
}

.course-unit-body.is-phone-layout .unit-mobile-header__content-btn {
    min-width: 118px;
}

.course-unit-body.is-phone-layout .unit-mobile-header__body {
    display: grid;
    gap: 10px;
}

.course-unit-body.is-phone-layout .unit-mobile-header__kicker {
    display: none;
}

.course-unit-body.is-phone-layout .unit-mobile-header__selectors {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 10px;
}

.course-unit-body.is-phone-layout .unit-mobile-header__selectors label {
    display: block;
    margin-bottom: 4px;
}

.course-unit-body.is-phone-layout .unit-mobile-header__titles h1 {
    font-size: 1.08rem;
}

.course-unit-body.is-phone-layout .unit-mobile-header__titles p {
    font-size: 0.74rem;
}

.course-unit-body.is-phone-layout .unit-mobile-header__selectors select {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(255, 255, 255, 0.12);
    min-height: 46px;
}

.course-unit-body.is-phone-layout .mobile-landscape-note {
    display: flex;
    margin: 0 12px 10px;
}

.course-unit-body.is-phone-layout.is-phone-landscape .mobile-landscape-note {
    display: none;
}

.course-unit-body.is-phone-layout .guest-login-banner {
    margin: 8px 12px;
}

.course-unit-body.is-phone-layout .guest-login-banner-inner {
    padding: 10px 12px;
}

.course-unit-body.is-phone-layout .unit-layout {
    padding: 0 12px 0;
    gap: 14px;
}

.course-unit-body.is-phone-layout .unit-sidebar {
    display: none;
    border-radius: 18px;
    padding: 14px;
    max-height: none;
    position: static;
    top: auto;
}

.course-unit-body.is-phone-layout .unit-sidebar.is-open {
    display: flex;
}

.course-unit-body.is-phone-layout .sidebar-head {
    gap: 10px;
}

.course-unit-body.is-phone-layout .sidebar-head h3 {
    font-size: 1rem;
}

.course-unit-body.is-phone-layout .sidebar-head label {
    font-size: 0.78rem;
    color: #475569;
}

.course-unit-body.is-phone-layout .sidebar-head select {
    min-height: 46px;
    border-radius: 14px;
}

.course-unit-body.is-phone-layout .chapter-group {
    border-radius: 16px;
    padding: 12px;
}

.course-unit-body.is-phone-layout .chapter-header {
    font-size: 0.94rem;
    margin-bottom: 10px;
}

.course-unit-body.is-phone-layout .lesson-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    border-radius: 12px;
}

.course-unit-body.is-phone-layout .content-viewer-banner {
    padding: 10px 12px;
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 10px;
}

.course-unit-body.is-phone-layout .mobile-tab-shortcuts {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 2px 4px 8px;
    margin: 0 -2px 10px;
    scrollbar-width: none;
}

.course-unit-body.is-phone-layout .mobile-tab-shortcuts::-webkit-scrollbar {
    display: none;
}

.course-unit-body.is-phone-layout .mobile-tab-shortcuts-wrap {
    display: block;
}

.course-unit-body.is-phone-layout .mobile-tab-shortcuts-note {
    display: block;
}

.course-unit-body.is-phone-layout .mobile-tab-shortcut {
    flex: 0 0 150px;
    min-height: 66px;
    padding: 12px 14px;
    border-radius: 18px;
    text-align: right;
    scroll-snap-align: start;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.course-unit-body.is-phone-layout .tabs-header {
    display: none;
}

.course-unit-body.is-phone-layout .tab-panel {
    display: none;
    margin-top: 10px;
}

.course-unit-body.is-phone-layout .tab-panel.active {
    display: block;
}

.course-unit-body.is-phone-layout .tab-panel[data-tab-panel="videos"] {
    display: none !important;
}

.course-unit-body.is-phone-layout .mobile-video-sheet-hint,
.course-unit-body.is-phone-layout .mobile-video-fab,
.course-unit-body.is-phone-layout .mobile-video-sheet {
    display: block;
}

.course-unit-body.is-phone-layout .mobile-video-fab {
    position: fixed;
    left: 16px;
    bottom: 88px;
    z-index: 1100;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
    padding: 10px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 700;
}

.course-unit-body.is-phone-layout .mobile-video-fab-icon {
    font-size: 1rem;
}

.course-unit-body.is-phone-layout .mobile-video-fab-text {
    font-size: 0.88rem;
}

.course-unit-body.is-phone-layout .mobile-video-fab-count {
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
}

.course-unit-body.is-phone-layout .mobile-video-sheet {
    position: fixed;
    inset: 0;
    z-index: 1200;
    pointer-events: none;
}

.course-unit-body.is-phone-layout .mobile-video-sheet.is-open {
    pointer-events: auto;
}

.course-unit-body.is-phone-layout .mobile-video-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.course-unit-body.is-phone-layout .mobile-video-sheet.is-open .mobile-video-sheet__backdrop {
    opacity: 1;
}

.course-unit-body.is-phone-layout .mobile-video-sheet__panel {
    position: absolute;
    right: 0;
    left: 0;
    bottom: 0;
    background: #ffffff;
    border-radius: 24px 24px 0 0;
    padding: 12px 14px 18px;
    max-height: 72vh;
    transform: translateY(100%);
    transition: transform 0.26s ease;
    box-shadow: 0 -20px 50px rgba(15, 23, 42, 0.18);
}

.course-unit-body.is-phone-layout .mobile-video-sheet.is-open .mobile-video-sheet__panel {
    transform: translateY(0);
}

.course-unit-body.is-phone-layout .mobile-video-sheet__handle {
    width: 52px;
    height: 5px;
    border-radius: 999px;
    background: #cbd5e1;
    margin: 0 auto 12px;
}

.course-unit-body.is-phone-layout .mobile-video-sheet__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.course-unit-body.is-phone-layout .mobile-video-sheet__header h3 {
    margin: 4px 0;
    font-size: 1rem;
    color: #0f172a;
}

.course-unit-body.is-phone-layout .mobile-video-sheet__header p,
.course-unit-body.is-phone-layout .mobile-video-sheet__eyebrow {
    margin: 0;
    font-size: 0.8rem;
    color: #64748b;
}

.course-unit-body.is-phone-layout .mobile-video-sheet__close {
    border: none;
    background: #eff6ff;
    color: #1d4ed8;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    font-size: 1.3rem;
    line-height: 1;
}

.course-unit-body.is-phone-layout .mobile-video-sheet__body {
    overflow-y: auto;
    display: grid;
    gap: 10px;
    padding-bottom: 10px;
}

.course-unit-body.is-phone-layout .mobile-video-sheet__item {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: #f8fafc;
    border-radius: 16px;
    padding: 12px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    text-align: right;
    font-family: inherit;
}

.course-unit-body.is-phone-layout .mobile-video-sheet__item.active {
    background: rgba(47, 91, 255, 0.1);
    border-color: rgba(47, 91, 255, 0.32);
}

.course-unit-body.is-phone-layout .mobile-video-sheet__item.viewed .mobile-video-sheet__item-index {
    background: rgba(34, 197, 94, 0.16);
    color: #15803d;
}

.course-unit-body.is-phone-layout .mobile-video-sheet__item-index {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(47, 91, 255, 0.12);
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
}

.course-unit-body.is-phone-layout .mobile-video-sheet__item-content {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.course-unit-body.is-phone-layout .mobile-video-sheet__item-title {
    color: #0f172a;
    font-weight: 700;
    line-height: 1.5;
}

.course-unit-body.is-phone-layout .mobile-video-sheet__item-meta {
    color: #64748b;
    font-size: 0.8rem;
}

body.mobile-video-sheet-open {
    overflow: hidden;
}

.course-unit-body.is-phone-layout .unit-player-card {
    padding: 12px;
    border-radius: 18px;
}

.course-unit-body.is-phone-layout #lessonPreviewPlayer .mada-player-wrapper {
    min-height: 220px;
}

.course-unit-body.is-phone-layout .pdf-viewer {
    min-height: 220px;
}

.course-unit-body.is-phone-layout.is-phone-landscape .unit-mobile-header {
    margin: 8px 12px 6px;
    padding: 10px 12px;
}

.course-unit-body.is-phone-layout.is-phone-landscape .unit-mobile-header__body {
    display: none;
}

.course-unit-body.is-phone-layout.is-phone-landscape .unit-mobile-header__top {
    margin-bottom: 0;
}

.course-unit-body.is-phone-layout.is-phone-landscape .unit-mobile-header__titles h1 {
    font-size: 1rem;
}

.course-unit-body.is-phone-layout.is-phone-landscape .unit-mobile-header__titles p {
    font-size: 0.72rem;
}

.course-unit-body.is-phone-layout.is-phone-landscape .guest-login-banner,
.course-unit-body.is-phone-layout.is-phone-landscape .mobile-landscape-note {
    display: none;
}

.course-unit-body.is-phone-layout.is-phone-landscape .unit-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
    direction: ltr;
    align-items: start;
    gap: 10px;
    padding: 0 12px 8px;
}

.course-unit-body.is-phone-layout.is-phone-landscape .unit-main {
    grid-column: 1;
}

.course-unit-body.is-phone-layout.is-phone-landscape .unit-sidebar {
    display: flex;
    grid-column: 2;
    position: sticky;
    top: 8px;
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    border-radius: 18px;
    padding: 12px;
}

.course-unit-body.is-phone-layout.is-phone-landscape .unit-player-card {
    padding: 10px;
}

.course-unit-body.is-phone-layout.is-phone-landscape #lessonPreviewPlayer .mada-player-wrapper {
    min-height: 190px;
    max-height: 52vh;
}

.course-unit-body.is-phone-layout.is-phone-landscape .lesson-info {
    padding: 12px 14px;
}

.course-unit-body.is-phone-layout.is-phone-landscape .lesson-info h2 {
    font-size: 1rem;
}

.course-unit-body.is-phone-layout.is-phone-landscape .lesson-info p {
    font-size: 0.82rem;
    line-height: 1.5;
}

.course-unit-body.is-phone-layout.is-phone-landscape .content-viewer-banner {
    display: none;
}

.course-unit-body.is-phone-layout.is-phone-landscape .mobile-tab-shortcuts-note {
    display: none;
}

.course-unit-body.is-phone-layout.is-phone-landscape .mobile-tab-shortcuts {
    gap: 8px;
    margin-bottom: 6px;
    padding-bottom: 6px;
}

.course-unit-body.is-phone-layout.is-phone-landscape .mobile-tab-shortcut {
    flex-basis: 128px;
    min-height: 54px;
    padding: 8px 12px;
    font-size: 0.75rem;
}

.course-unit-body.is-phone-layout.is-phone-landscape .video-segment-nav--integrated {
    margin-top: 8px;
    padding-top: 8px;
}

.course-unit-body.is-phone-layout.is-phone-landscape .video-segment-btn {
    padding: 8px 10px;
}

.course-unit-body.is-phone-layout.is-phone-landscape .video-segment-label {
    font-size: 0.72rem;
}

.course-unit-body.is-phone-layout.is-phone-landscape .video-segment-title {
    font-size: 0.8rem;
}

.course-unit-body.is-phone-layout.is-phone-landscape .lesson-nav {
    gap: 8px;
}

.course-unit-body.is-phone-layout.is-phone-landscape .lesson-nav-btn {
    padding: 8px 10px;
    font-size: 0.78rem;
}

.course-unit-body.is-phone-layout.is-phone-landscape .mobile-video-fab {
    bottom: 14px;
    left: 14px;
    padding: 8px 10px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
}

.course-unit-body.is-phone-layout.is-phone-landscape .mobile-video-sheet__panel {
    left: auto;
    width: min(420px, calc(100vw - 24px));
    max-height: calc(100vh - 28px);
    border-radius: 24px;
    bottom: 14px;
    right: 12px;
}
