/* =================================================================
   speaking.css  —  TCT Speaking Module (Index + Practice)
   ================================================================= */

/* ── DESIGN TOKENS ─────────────────────────────────────────────── */
:root {
    --sp-blue: #4255ff;
    --sp-blue-lt: #eef0ff;
    --sp-blue-dk: #2e3ed1;
    --sp-green: #10b981;
    --sp-amber: #f59e0b;
    --sp-red: #ef4444;
    --sp-bg: #f6f7fb;
    --sp-white: #ffffff;
    --sp-border: rgba(0, 0, 0, 0.07);
    --sp-text: #111827;
    --sp-muted: #6b7280;
    --sp-radius: 16px;
    --sp-radius-sm: 10px;
    --sp-shadow: 0 2px 12px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.04);
    --sp-shadow-lift: 0 18px 48px rgba(0, 0, 0, 0.13), 0 6px 16px rgba(0, 0, 0, 0.06);
}

/* ── PAGE WRAPPER ──────────────────────────────────────────────── */
.vi-page {
    padding: 32px 28px 72px;
}

/* =================================================================
   PAGE HEADER
   ================================================================= */
.vi-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.vi-title {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 900;
    color: var(--sp-text);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 6px;
}

.vi-subtitle {
    font-size: 0.95rem;
    color: var(--sp-muted);
    margin: 0;
}

/* ── Search ──────────────────────────────────────────────────────── */
.vi-search-box {
    position: relative;
    flex-shrink: 0;
    width: min(320px, 100%);
}

.vi-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sp-muted);
    font-size: 0.88rem;
    pointer-events: none;
}

.vi-search-input {
    width: 100%;
    padding: 11px 16px 11px 40px;
    border-radius: 999px;
    border: 1.5px solid #e5e7eb;
    background: var(--sp-white);
    font-size: 0.9rem;
    color: var(--sp-text);
    box-shadow: var(--sp-shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.vi-search-input::placeholder {
    color: var(--sp-muted);
}

.vi-search-input:focus {
    outline: none;
    border-color: var(--sp-blue);
    box-shadow: 0 0 0 4px rgba(66, 85, 255, 0.1);
}

/* ── Stats row ───────────────────────────────────────────────────── */
.vi-meta-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 36px;
}

.vi-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--sp-border);
    background: var(--sp-white);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sp-muted);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.vi-meta-chip i {
    color: var(--sp-blue);
    font-size: 0.76rem;
}

.vi-chip-green {
    background: #ecfdf5;
    border-color: #d1fae5;
    color: #047857;
}

.vi-chip-green i {
    color: #10b981;
}

/* =================================================================
   TOPIC FILTER SECTION
   ================================================================= */
.vi-filter-section {
    margin-bottom: 32px;
}

.vi-filter-section--level {
    margin-top: 15px;
}

.vi-filter-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--sp-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.vi-filter-header i {
    color: var(--sp-blue);
    font-size: 0.78rem;
}

.vi-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topic-filter-btn,
.level-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1.5px solid #e5e7eb;
    background: var(--sp-white);
    color: var(--sp-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s ease;
    white-space: nowrap;
}

.topic-filter-btn:hover,
.level-filter-btn:hover {
    border-color: var(--sp-blue);
    color: var(--sp-blue);
    background: var(--sp-blue-lt);
    transform: translateY(-1px);
}

.topic-filter-btn.active,
.level-filter-btn.active {
    background: var(--sp-blue);
    border-color: var(--sp-blue);
    color: #fff;
    box-shadow: 0 4px 14px rgba(66, 85, 255, 0.3);
}

.topic-filter-btn.active:hover,
.level-filter-btn.active:hover {
    background: var(--sp-blue-dk);
    border-color: var(--sp-blue-dk);
}

/* =================================================================
   LEVEL SECTIONS
   ================================================================= */
.vi-level-section {
    margin-bottom: 48px;
}

.vi-level-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f0f0f6;
}

.vi-level-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.vi-level-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.vi-level-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--sp-text);
    margin: 0;
    line-height: 1.3;
}

.vi-level-subtitle {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--sp-muted);
    margin-left: 6px;
}

.vi-level-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.vi-level-count {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--sp-blue-lt);
    color: var(--sp-blue);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Slider navigation arrows */
.vi-slider-nav {
    display: flex;
    gap: 6px;
}

.vi-slider-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid #e5e7eb;
    background: var(--sp-white);
    color: var(--sp-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.18s;
}

.vi-slider-btn:hover {
    background: var(--sp-blue);
    border-color: var(--sp-blue);
    color: #fff;
    box-shadow: 0 4px 12px rgba(66, 85, 255, 0.3);
}

/* =================================================================
   VIDEO TRACK — horizontal slider
   ================================================================= */
.vi-video-track-wrapper {
    overflow: hidden;
    position: relative;
}

.vi-video-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}

.vi-video-track::-webkit-scrollbar {
    display: none;
}

.vi-video-col {
    flex: 0 0 calc((100% - 80px) / 6);
    min-width: 200px;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.vi-video-col.vi-card-hidden {
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Pagination Container */
.numbered-pagination-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.numbered-pagination-container:empty {
    display: none;
}

/* Pagination Buttons */
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    background: #f4f6f8;
    color: #111827;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover {
    background: #e2e8f0;
}

.page-btn.active {
    background: var(--sp-blue);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(66, 85, 255, 0.3);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: default;
    background: #f4f6f8;
    color: #9ca3af;
}

/* Also keep the legacy grid layout for backward compat / fallback */
.vi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.vi-col {
    display: flex;
    flex-direction: column;
}

/* =================================================================
   VIDEO CARDS
   ================================================================= */
.video-card-link {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.video-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.video-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--sp-white);
    border-radius: var(--sp-radius);
    border: 1px solid var(--sp-border);
    box-shadow: var(--sp-shadow);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--sp-shadow-lift);
}

/* ── Thumbnail (forced 16:9) ────────────────────────────────────── */
.vc-thumb {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    overflow: hidden;
    background: #0e1628;
    flex-shrink: 0;
}

.vc-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.video-card:hover .vc-img {
    transform: scale(1.05);
}

/* Dark overlay + play button — hidden until hover */
.vc-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(10, 10, 30, 0.45),
            rgba(40, 20, 80, 0.5));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.26s ease;
}

.video-card:hover .vc-overlay {
    opacity: 1;
}

.vc-play {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--sp-blue);
    padding-left: 3px;
    /* optical center for play icon */
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.video-card:hover .vc-play {
    transform: scale(1);
}

/* =================================================================
   CEFR LEVEL BADGES — bottom-left of thumbnail
   ================================================================= */
.vc-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 2;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.vc-badge-a1 {
    background: rgba(16, 185, 129, 0.9);
}

.vc-badge-a2 {
    background: rgba(6, 182, 212, 0.9);
}

.vc-badge-b1 {
    background: rgba(245, 158, 11, 0.9);
}

.vc-badge-b2 {
    background: rgba(239, 68, 68, 0.9);
}

.vc-badge-c1 {
    background: rgba(139, 92, 246, 0.9);
}

.vc-badge-c2 {
    background: rgba(59, 130, 246, 0.9);
}

/* Legacy easy/medium/hard badges */
.lv-easy {
    background: rgba(16, 185, 129, 0.9);
}

.lv-medium {
    background: rgba(245, 158, 11, 0.9);
}

.lv-hard {
    background: rgba(239, 68, 68, 0.9);
}

/* Duration chip — bottom-right */
.vc-duration {
    position: absolute;
    bottom: 9px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.69rem;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ── Card body ──────────────────────────────────────────────────── */
.vc-body {
    padding: 12px 13px 14px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 8px;
}

.vc-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--sp-text);
    line-height: 1.45;
    margin: 0;

    /* Clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;

    transition: color 0.18s;
}

.video-card:hover .vc-title {
    color: var(--sp-blue);
}

.vc-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-top: auto;
}

.vc-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--sp-muted);
    background: #f3f4f6;
    padding: 3px 8px;
    border-radius: 999px;
}

.vc-topic-chip {
    background: #fdf4ff;
    color: #9333ea;
}

.vc-topic-chip i {
    font-size: 0.62rem;
}

.vc-start {
    background: var(--sp-blue-lt);
    color: var(--sp-blue);
    margin-left: auto;
}

.video-card:hover .vc-start {
    background: var(--sp-blue);
    color: #fff;
}

/* =================================================================
   EMPTY STATE
   ================================================================= */
.vi-empty {
    text-align: center;
    padding: 90px 24px;
    color: var(--sp-muted);
}

.vi-empty i {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 20px;
    opacity: 0.45;
}

.vi-empty h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--sp-text);
    margin-bottom: 8px;
}

.vi-empty p {
    font-size: 0.95rem;
}

/* =================================================================
   FILTER TRANSITIONS — Smooth hide/show for JS filtering
   ================================================================= */
.vi-video-col {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.vi-video-col.vi-card-hidden {
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.vi-level-section {
    transition: opacity 0.35s ease, max-height 0.4s ease;
    overflow: hidden;
}

.vi-level-section.vi-section-hidden {
    opacity: 0;
    max-height: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

/* =================================================================
   PRACTICE PAGE v3 — Premium 2-Column Design (spk-*)
   ================================================================= */

/* ── Global focus-visible for all interactive spk-* elements ────── */
.spk-btn:focus-visible,
.spk-sent-btn:focus-visible,
.spk-pill-btn:focus-visible,
.spk-slider-arrow:focus-visible,
.spk-back-btn:focus-visible,
.spk-vid-ctrl-btn:focus-visible,
.spk-hide-text-btn:focus-visible,
.spk-dic-hint-btn:focus-visible,
.spk-dic-play-btn:focus-visible,
.spk-dic-input:focus-visible {
    outline: 2px solid var(--sp-blue);
    outline-offset: 2px;
}

/* ── Page shell ─────────────────────────────────────────────────── */
.spk-page {
    padding: 20px 24px 48px;
    max-width: 1400px;
    margin: 0 auto;
    background: var(--sp-bg);
    min-height: 100%;
}

/* ── Top navigation bar ──────────────────────────────────────────── */
.spk-topnav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.spk-topnav-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.spk-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--sp-white);
    color: #374151;
    border: 1.5px solid #e5e7eb;
    text-decoration: none;
    flex-shrink: 0;
    box-shadow: var(--sp-shadow);
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.spk-back-btn:hover {
    background: var(--sp-blue);
    color: #fff;
    border-color: var(--sp-blue);
    text-decoration: none;
}

/* ── Pill Menu ───────────────────────────────────────────────────── */
.spk-pill-menu {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--sp-white);
    border-radius: 999px;
    padding: 5px;
    box-shadow: var(--sp-shadow);
    border: 1px solid #f0f0f5;
    flex-grow: 1;
    justify-content: center;
    max-width: 360px;
    margin: 0 auto;
}

.spk-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 22px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--sp-muted);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.spk-pill-btn:hover:not(.spk-pill-active) {
    background: #f3f4f6;
    color: #374151;
}

.spk-pill-btn.spk-pill-active {
    background: var(--sp-blue);
    color: #fff;
    box-shadow: 0 4px 14px rgba(66, 85, 255, 0.35);
}

/* ── Main row (pure CSS flexbox, NOT Bootstrap) ─────────────────── */
.spk-main-row {
    display: flex;
    gap: 24px;
    align-items: stretch;
}

/* ══════════════════════════════════════════════════════════════════
   LEFT COLUMN — Video area
══════════════════════════════════════════════════════════════════ */
.spk-left-col {
    flex: 0 0 58%;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* RIGHT COLUMN */
.spk-right-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Video frame (16:9 aspect ratio, replaces Bootstrap ratio class) */
.spk-video-frame {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 */
    border-radius: var(--sp-radius);
    overflow: hidden;
    background: #0f1629;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.spk-video-frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--sp-radius);
}

/* Video utility controls */
.spk-vid-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.spk-vid-ctrl-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 18px;
    border-radius: 999px;
    border: 1.5px solid #e5e7eb;
    background: var(--sp-white);
    color: #6b7280;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.spk-vid-ctrl-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

/* Overall progress card */
.spk-progress-card {
    background: var(--sp-white);
    border-radius: var(--sp-radius);
    padding: 18px 20px;
    border: 1px solid #f0f0f5;
    box-shadow: var(--sp-shadow);
}

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

.spk-progress-label {
    font-size: 0.88rem;
    color: #374151;
    font-weight: 500;
}

.spk-progress-label strong {
    color: #111827;
    font-weight: 700;
}

.spk-progress-pct {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--sp-green);
}

.spk-progress-track {
    height: 10px;
    background: #f0f0f5;
    border-radius: 999px;
    overflow: hidden;
}

.spk-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sp-green) 0%, #34d399 100%);
    border-radius: 999px;
    transition: width 0.4s ease;
}

/* ══════════════════════════════════════════════════════════════════
   RIGHT COLUMN — Practice & Scoring
══════════════════════════════════════════════════════════════════ */
.spk-right-pane {
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex: 1;
    animation: spk-fade-in 0.25s ease;
}

@keyframes spk-fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pane header */
.spk-pane-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-shrink: 0;
}

.spk-pane-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.01em;
}

.spk-pane-counter {
    font-size: 0.88rem;
    color: var(--sp-muted);
    font-weight: 500;
}

/* ── 1. Sentence Slider ──────────────────────────────────────────── */
.spk-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spk-slider-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1.5px solid #e5e7eb;
    background: var(--sp-white);
    color: var(--sp-muted);
    font-size: 0.78rem;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.spk-slider-arrow:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.spk-slider-arrow:active {
    transform: scale(0.92);
}

.spk-slider-track {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    padding-bottom: 3px;
    scroll-snap-type: x mandatory;
}

.spk-slider-track::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.spk-sent-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    scroll-snap-align: center;
}

.spk-sent-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.spk-sent-btn.spk-sent-btn--active {
    background: var(--sp-blue);
    color: #fff;
    box-shadow: 0 4px 12px rgba(66, 85, 255, 0.35);
}

.spk-sent-btn--done {
    background: #d1fae5;
    color: #065f46;
}

.spk-sent-btn--done.spk-sent-btn--active {
    background: var(--sp-blue);
    color: #fff;
}

.spk-done-check {
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 0.55rem;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #10b981;
    color: #ffffff;
    border-radius: 50%;
    border: 2px solid #ffffff;
    line-height: 1;
}

/* ── 2. Transcript Card ──────────────────────────────────────────── */
.spk-transcript-card {
    position: relative;
    background: var(--sp-white);
    border-radius: var(--sp-radius);
    padding: 20px 20px 18px;
    border: 1px solid #f0f0f5;
    box-shadow: var(--sp-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.spk-transcript-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #9ca3af;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.spk-hide-text-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 14px;
    color: #374151;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.spk-hide-text-btn:hover {
    background: var(--sp-blue-lt);
    border-color: var(--sp-blue);
    color: var(--sp-blue);
}

.spk-transcript-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.55;
    letter-spacing: -0.01em;
    min-height: calc(1.3rem * 1.55 * 2); /* reserve 2-line height to prevent layout shift */
    display: flex;
    align-items: center;
    justify-content: center;
}

.spk-transcript-vi {
    margin-top: 8px;
    font-size: 0.88rem;
    color: var(--sp-muted);
    font-style: italic;
    line-height: 1.5;
}

/* ── 3. Action Row ───────────────────────────────────────────────── */
.spk-action-row {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}

.spk-action-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.spk-action-col--center {
    flex: 1;
}

.spk-center-btns {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

.spk-center-btn-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.spk-shortcut {
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 600;
    white-space: nowrap;
}

/* Base button */
.spk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

/* Nav buttons (Prev / Next) */
.spk-btn--nav {
    background: var(--sp-white);
    color: #374151;
    border: 1.5px solid #e5e7eb;
    padding: 12px 16px;
    font-size: 0.87rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.spk-btn--nav:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.spk-btn--nav:active {
    transform: translateY(0) scale(0.97);
}

.spk-btn--nav-next {
    background: var(--sp-blue-lt);
    color: var(--sp-blue);
    border-color: var(--sp-blue-lt);
}

.spk-btn--nav-next:hover {
    background: var(--sp-blue);
    color: #fff;
    border-color: var(--sp-blue);
    transform: translateY(-1px);
}

/* Replay button */
.spk-btn--replay {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--sp-white);
    color: #374151;
    border: 1.5px solid #e5e7eb;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.spk-btn--replay:hover {
    background: #f3f4f6;
    transform: scale(1.07);
}

.spk-btn--replay:active {
    transform: scale(0.95);
}

/* Record button — the hero element */
.spk-btn--record {
    background: var(--sp-blue);
    color: #fff;
    padding: 16px 32px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(66, 85, 255, 0.4);
    min-height: 52px;
}

.spk-btn--record:hover {
    background: var(--sp-blue-dk);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(66, 85, 255, 0.5);
}

.spk-btn--record:active:not(.is-recording):not(.is-scoring) {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 4px 12px rgba(66, 85, 255, 0.3);
}

.spk-btn--record.is-recording {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
    animation: record-pulse 1.2s ease-in-out infinite;
}

@keyframes record-pulse {

    0%,
    100% {
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
    }

    50% {
        box-shadow: 0 6px 32px rgba(239, 68, 68, 0.7);
    }
}

/* Scoring state — amber glow while saving to server */
.spk-btn--record.is-scoring {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
    animation: scoring-pulse 1s ease-in-out infinite;
    cursor: wait;
    pointer-events: none;
}

@keyframes scoring-pulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
    }
    50% {
        box-shadow: 0 6px 32px rgba(245, 158, 11, 0.75);
    }
}

/* ── 4. Score Panel ──────────────────────────────────────────────── */
.spk-score-panel {
    background: var(--sp-white);
    border-radius: var(--sp-radius);
    border: 1px solid #f0f0f5;
    box-shadow: var(--sp-shadow);
    overflow: hidden;
    flex: 1;
}

.spk-score-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.spk-score-cell {
    padding: 16px 14px;
}

.spk-score-cell--border-right {
    border-right: 1px solid #f0f0f5;
}

.spk-score-cell--border-bottom {
    border-bottom: 1px solid #f0f0f5;
}

.spk-score-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Circular ring SVG */
.spk-score-ring-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.spk-ring {
    width: 44px;
    height: 44px;
    transform: rotate(-90deg);
}

.spk-ring-bg {
    fill: none;
    stroke: #f0f0f5;
    stroke-width: 3.2;
}

.spk-ring-fill {
    fill: none;
    stroke: var(--sp-green);
    stroke-width: 3.2;
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease;
}

.spk-ring-fill--blue {
    stroke: var(--sp-blue);
}

.spk-ring-fill--amber {
    stroke: var(--sp-amber);
}

.spk-ring-fill--purple {
    stroke: #8b5cf6;
}

.spk-score-val {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.7rem;
    font-weight: 800;
    color: #111827;
    /* undo the SVG rotation */
    transform: rotate(0deg);
}

/* Score info column */
.spk-score-info {
    flex: 1;
    min-width: 0;
}

.spk-score-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mini horizontal bar */
.spk-score-bar-track {
    height: 5px;
    background: #f0f0f5;
    border-radius: 999px;
    overflow: hidden;
}

.spk-score-bar-fill {
    height: 100%;
    background: var(--sp-green);
    border-radius: 999px;
    width: 0%;
    transition: width 0.5s ease;
}

.spk-score-bar-fill--blue {
    background: var(--sp-blue);
}

.spk-score-bar-fill--amber {
    background: var(--sp-amber);
}

.spk-score-bar-fill--purple {
    background: #8b5cf6;
}

/* ── Toast notification ──────────────────────────────────────────── */
.spk-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 22px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: #1f2937;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    white-space: normal;
    text-align: center;
    max-width: min(90vw, 440px);
    word-break: break-word;
}

.spk-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.spk-toast.is-success {
    background: #059669;
}

.spk-toast.is-error {
    background: #dc2626;
}

.spk-toast.is-warning {
    background: #d97706;
}

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 992px) {
    .spk-page {
        padding: 16px 16px 40px;
    }

    .spk-pill-menu {
        max-width: 100%;
    }

    .spk-main-row {
        flex-direction: column;
    }

    .spk-left-col {
        flex: 1 1 auto;
        max-width: 100%;
    }

    .spk-progress-card {
        margin-top: 0;
    }
}

/* Hide keyboard shortcut hints on touch/small screens (Issue #12) */
@media (max-width: 768px) {
    .spk-shortcut {
        display: none;
    }
}

@media (max-width: 640px) {
    .spk-transcript-text {
        font-size: 0.95rem;
        min-height: calc(0.95rem * 1.55 * 2);
    }

    /* Stack action row vertically on mobile (Issue #1) */
    .spk-action-row {
        flex-direction: column;
        gap: 12px;
    }

    .spk-action-col--center {
        order: -1;
        width: 100%;
    }

    .spk-center-btns {
        flex-direction: column;
        align-items: stretch;
    }

    .spk-center-btn-wrap {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .spk-btn--record {
        width: 100%;
        padding: 14px 16px;
        font-size: 0.88rem;
        justify-content: center;
    }

    .spk-btn--replay {
        width: 44px;
        height: 44px;
        font-size: 0.95rem;
    }

    /* Prev/Next become a horizontal row under center actions */
    .spk-action-col:not(.spk-action-col--center) {
        width: 100%;
    }

    .spk-btn--nav {
        width: 100%;
        justify-content: center;
    }

    /* Score grid single-column on small screens (Issue #2) */
    .spk-score-grid {
        grid-template-columns: 1fr;
    }

    .spk-score-cell--border-right {
        border-right: none;
    }

    .spk-score-cell {
        padding: 12px 14px;
        border-bottom: 1px solid #f0f0f5;
    }

    .spk-score-cell:last-child {
        border-bottom: none;
    }

    .spk-score-name {
        font-size: 0.78rem;
        white-space: normal;
    }

    /* Smaller textarea on mobile (Issue #14) */
    .spk-dic-input {
        font-size: 1rem;
        padding: 12px 14px;
    }

    .spk-dic-feedback {
        font-size: 0.95rem;
        gap: 6px;
    }
}

/* Legacy Index-page responsive (preserved) */
@media (max-width: 1200px) {
    .vi-video-col {
        flex: 0 0 calc((100% - 48px) / 4);
        min-width: 190px;
    }
}

@media (max-width: 960px) {
    .vi-video-col {
        flex: 0 0 calc((100% - 32px) / 3);
        min-width: 180px;
    }
}

@media (max-width: 640px) {
    .vi-page {
        padding: 20px 16px 48px;
    }

    .vi-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .vi-search-box {
        width: 100%;
    }

    .vi-level-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .vi-filter-pills {
        gap: 6px;
    }

    .topic-filter-btn {
        padding: 6px 14px;
        font-size: 0.78rem;
    }

    .vi-video-col {
        flex: 0 0 calc((100% - 16px) / 2);
        min-width: 160px;
    }
}

/* =================================================================
   DICTATION — Video overlay (hides subtitles, keeps audio)
   ================================================================= */
.spk-vid-overlay {
    position: absolute;
    inset: 0;
    background-color: #000;
    z-index: 10;
    border-radius: var(--sp-radius);
    pointer-events: none;
}

/* =================================================================
   DICTATION — Quick controls row (Ẩn video)
   ================================================================= */
.spk-dic-quick-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* =================================================================
   DICTATION — Wide sentence button variant (labeled "Câu: X")
   ================================================================= */
.spk-sent-btn--wide {
    width: auto;
    min-width: 72px;
    height: 38px;
    border-radius: 22px;
    padding: 0 16px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    background: var(--sp-white);
    border: 1.5px solid #e5e7eb;
    color: #374151;
}

.spk-sent-btn--wide:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
}

/* Active state inherits the default spk-sent-btn--active (blue) — same as pronunciation slider */

/* =================================================================
   DICTATION — Typing area (clean "piece of paper" style)
   ================================================================= */
.spk-dic-input {
    width: 100%;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: var(--sp-radius-sm);
    padding: 16px 18px;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--sp-text);
    resize: none;
    outline: none;
    line-height: 1.6;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.spk-dic-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.spk-dic-input:focus {
    border-color: var(--sp-blue);
    box-shadow: 0 0 0 4px rgba(66, 85, 255, 0.1);
    background: var(--sp-white);
}

/* =================================================================
   DICTATION — Masked feedback row
   ================================================================= */
.spk-dic-feedback {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-height: 52px;
    padding: 4px 0;
    font-size: 1.1rem;
    letter-spacing: 1.5px;
    font-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Segoe UI Mono', Menlo, monospace;
}

/* Each word is a rounded box with a dashed border by default */
.spk-dic-word {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 1.5px dashed #fca5a5;
    border-radius: 8px;
    gap: 1px;
    background: #fff5f5;
    transition: border-color 0.2s, background 0.2s;
}

/* Word currently being typed */
.spk-dic-word--active {
    border-style: solid;
    border-color: var(--sp-green);
    background: rgba(16, 185, 129, 0.05);
}

/* Fully correct word */
.spk-dic-word--done {
    border-style: solid;
    border-color: var(--sp-green);
    background: rgba(16, 185, 129, 0.08);
}

/* Character state classes */
.char-untyped {
    color: var(--sp-red);
    font-weight: 600;
}

.char-correct {
    color: var(--sp-green);
    font-weight: bold;
}

.char-incorrect {
    color: var(--sp-red);
    font-weight: bold;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* =================================================================
   DICTATION — Bottom action bar
   ================================================================= */
.spk-dic-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #f0f0f5;
    gap: 12px;
}

/* Hint button — circular, amber accent */
.spk-dic-hint-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1.5px solid #e5e7eb;
    background: var(--sp-white);
    color: var(--sp-amber);
    font-size: 1.05rem;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: background 0.18s, border-color 0.18s, transform 0.15s;
}

.spk-dic-hint-btn:hover {
    background: #fffbeb;
    border-color: var(--sp-amber);
    transform: scale(1.08);
}

.spk-dic-hint-btn:active {
    transform: scale(0.95);
}

.spk-dic-hint-btn.is-active {
    background: var(--sp-amber);
    border-color: var(--sp-amber);
    color: #fff;
}

/* Play/Pause button — large pill, primary blue */
.spk-dic-play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
    height: 52px;
    border-radius: 999px;
    border: none;
    background: var(--sp-blue);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(66, 85, 255, 0.4);
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.spk-dic-play-btn:hover {
    background: var(--sp-blue-dk);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(66, 85, 255, 0.5);
}

.spk-dic-play-btn:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 4px 12px rgba(66, 85, 255, 0.3);
}

/* Pause state (JS toggles this class) */
.spk-dic-play-btn.is-playing {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

/* Next button — reuses nav styles, just keeps flex-shrink: 0 */
.spk-dic-next-btn {
    flex-shrink: 0;
}

.prac-shell {
    display: grid;
    grid-template-columns: 1fr 420px;
    height: calc(100vh - 72px);
    overflow: hidden;
    background: #f6f7fb;
}

.prac-left {
    display: flex;
    flex-direction: column;
    padding: 20px 20px 16px 24px;
    overflow: hidden;
    background: #f6f7fb;
}

.prac-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.prac-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: white;
    color: #374151;
    border: 1.5px solid #e5e7eb;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.18s, color 0.18s;
}

.prac-back-btn:hover {
    background: var(--sp-blue);
    color: #fff;
    border-color: var(--sp-blue);
    text-decoration: none;
}

.prac-video-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prac-player-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 16px;
    background: #0f1629;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.prac-player-wrap iframe,
.prac-player-wrap>div {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

.prac-progress-bar {
    position: relative;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin: 12px 0 4px;
    flex-shrink: 0;
}

.prac-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--sp-blue);
    border-radius: 2px;
    transition: width 0.15s linear;
}

.prac-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #9ca3af;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.prac-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-shrink: 0;
}

.prac-ctrl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    color: #374151;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.15s;
}

.prac-ctrl-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: scale(1.05);
}

.prac-ctrl-btn.prac-ctrl-active {
    background: var(--sp-blue);
    border-color: var(--sp-blue);
    color: #fff;
}

.prac-play-btn {
    width: 58px;
    height: 58px;
    background: var(--sp-blue);
    border-color: var(--sp-blue);
    color: #fff;
    font-size: 1.15rem;
    box-shadow: 0 6px 20px rgba(66, 85, 255, 0.4);
}

.prac-play-btn:hover {
    background: var(--sp-blue-dk);
    border-color: var(--sp-blue-dk);
    color: #fff;
}

.prac-speed-btn {
    font-size: 0.75rem;
    font-weight: 700;
    width: 52px;
    border-radius: 26px;
}

.speed-label {
    font-family: inherit;
    font-weight: 800;
}

.prac-counter {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 12px;
    flex-shrink: 0;
}

.prac-mode-chip {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--sp-blue);
    margin-left: 4px;
}

/* RIGHT PANEL */
.prac-right {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-left: 1px solid #f0f0f5;
    overflow: hidden;
}

.prac-transcript-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #f0f0f5;
    flex-shrink: 0;
}

.prac-transcript-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
}

.prac-transcript-title i {
    color: var(--sp-blue);
}

.prac-sent-total-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--sp-blue-lt);
    color: var(--sp-blue);
    font-size: 0.72rem;
    font-weight: 800;
}

.prac-toggle-vi-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
}

.prac-toggle-vi-all:hover {
    border-color: var(--sp-blue);
    color: var(--sp-blue);
}

.prac-toggle-vi-all.prac-ctrl-active {
    background: var(--sp-blue);
    border-color: var(--sp-blue);
    color: #fff;
}

.prac-sentence-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px 20px;
}

.prac-sentence-list::-webkit-scrollbar {
    width: 5px;
}

.prac-sentence-list::-webkit-scrollbar-track {
    background: transparent;
}

.prac-sentence-list::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 3px;
}

.prac-sentence-list::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}

/* Sentence Row */
.prac-sentence {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 10px;
    border-radius: 12px;
    margin-bottom: 4px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.18s, border-color 0.18s;
}

.prac-sentence:hover {
    background: #f8f9fa;
}

.prac-sentence.prac-active {
    background: #eef0ff;
    border-left-color: var(--sp-blue);
}

.prac-sentence.prac-active .prac-sent-num {
    background: var(--sp-blue);
    color: #fff;
}

.prac-sentence.prac-result-ok {
    background: #f0fdf4;
    border-left-color: #10b981;
}

.prac-sentence.prac-result-fail {
    background: #fef2f2;
    border-left-color: #ef4444;
}

.prac-sent-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, color 0.18s;
    margin-top: 2px;
}

.prac-sent-body {
    flex: 1;
    min-width: 0;
}

.prac-sent-en {
    font-size: 0.93rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.5;
    margin: 0 0 3px;
    transition: color 0.25s;
}

.prac-sent-vi {
    font-size: 0.82rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
    display: none;
}

.prac-sent-vi.prac-vi-visible {
    display: block;
}

.prac-text-ok {
    color: #059669 !important;
}

.prac-text-fail {
    color: #dc2626 !important;
}

.prac-accuracy-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    position: relative;
}

.prac-accuracy-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s, background 0.4s;
}

.prac-accuracy-pct {
    position: absolute;
    right: 0;
    top: -18px;
    font-size: 0.72rem;
    font-weight: 700;
}

.prac-sent-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.prac-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.prac-icon-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.prac-listen-btn:hover {
    background: #eef0ff;
    color: var(--sp-blue);
    border-color: #c7d2fe;
}

.prac-vi-toggle:hover {
    background: #fdf4ff;
    color: #9333ea;
    border-color: #e9d5ff;
}

.prac-mic-btn:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: #fecaca;
}

.prac-mic-btn.prac-mic-recording {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
    animation: mic-pulse 1s ease-in-out infinite;
}

@keyframes mic-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

.prac-no-sentences {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.prac-no-sentences i {
    font-size: 2.5rem;
    margin-bottom: 16px;
    display: block;
}

.prac-no-sentences p {
    font-size: 0.9rem;
}

/* Toast */
.spk-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: #1f2937;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    white-space: nowrap;
}

.spk-toast.spk-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.spk-toast.spk-toast-success {
    background: #059669;
}

.spk-toast.spk-toast-error {
    background: #dc2626;
}

.spk-toast.spk-toast-retry {
    background: #d97706;
}


/* =================================================================
   PHASE 3 — IMPORT PANEL (mip-*)
   ================================================================= */

/* Panel shell */
.mip-panel {
    background: linear-gradient(135deg, #4255ff 0%, #2a3bef 55%, #1a2fd4 100%);
    border-radius: 20px;
    padding: 40px 44px;
    margin-bottom: 36px;
    box-shadow: 0 10px 36px rgba(66, 85, 255, 0.30), 0 2px 8px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
}

/* Decorative circles */
.mip-panel::before,
.mip-panel::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.08;
}
.mip-panel::before {
    width: 320px;
    height: 320px;
    background: #fff;
    top: -120px;
    right: -80px;
}
.mip-panel::after {
    width: 180px;
    height: 180px;
    background: #fff;
    bottom: -60px;
    left: 30px;
}

.mip-inner {
    display: flex;
    align-items: center;
    gap: 48px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

/* Left copy */
.mip-left {
    flex: 1;
    min-width: 220px;
}

.mip-yt-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 16px;
    backdrop-filter: blur(6px);
}

.mip-heading {
    font-size: clamp(1.25rem, 2.6vw, 1.85rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.25;
    margin: 0 0 12px;
    letter-spacing: -0.025em;
}

.mip-sub {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
    line-height: 1.7;
}

/* Right form */
.mip-right {
    flex: 0 0 min(460px, 100%);
}

.mip-form-area {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.mip-input-wrap {
    flex: 1;
    position: relative;
    min-width: 0;
}

.mip-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
}

.mip-input {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 44px;
    border-radius: 13px;
    border: 2px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.96);
    font-size: 0.88rem;
    color: #111827;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.mip-input::placeholder {
    color: #9ca3af;
}

.mip-input:focus {
    outline: none;
    border-color: #fff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.28);
}

.mip-input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.mip-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: 0 24px;
    border-radius: 13px;
    border: none;
    background: #fff;
    color: #4255ff;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.20);
    transition: transform 0.18s, box-shadow 0.18s, background 0.18s, color 0.18s;
}

.mip-cta-btn:hover:not(:disabled) {
    background: #f0f2ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.24);
}

.mip-cta-btn:active:not(:disabled) {
    transform: translateY(0);
}

.mip-cta-btn:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
}

.mip-feedback {
    margin-top: 10px;
    font-size: 0.83rem;
    min-height: 20px;
    line-height: 1.5;
}

.mip-feedback:empty {
    display: none;
}

.mip-feedback-error {
    color: #fca5a5;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.mip-feedback-upgrade {
    color: #fde68a;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.mip-feedback-upgrade a {
    color: #fde68a;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.mip-feedback-upgrade a:hover {
    color: #fff;
}

.mip-feedback-success {
    color: #6ee7b7;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.mip-hint {
    margin-top: 9px;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.46);
    margin-bottom: 0;
}

.mip-hint i {
    margin-right: 3px;
}

/* =================================================================
   CATALOG SEPARATOR
   ================================================================= */
.vi-catalog-separator {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 32px;
}

.vi-catalog-separator::before,
.vi-catalog-separator::after {
    content: '';
    flex: 1;
    height: 1.5px;
    background: #e5e7eb;
}

.vi-catalog-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--sp-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.vi-catalog-label i {
    color: var(--sp-blue);
    font-size: 0.75rem;
}

/* =================================================================
   PHASE 3 — BÀI NÓI CỦA TÔI (my-*)
   ================================================================= */

.my-videos-section {
    margin-bottom: 40px;
}

/* Section header */
.my-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f0f0f6;
    flex-wrap: wrap;
}

.my-sec-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.my-sec-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--sp-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.my-sec-title i {
    color: var(--sp-blue);
}

.my-locked-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.74rem;
    font-weight: 700;
}

.my-sec-count {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--sp-muted);
    background: #f3f4f6;
    padding: 4px 12px;
    border-radius: 999px;
    flex-shrink: 0;
}

/* Empty state */
.my-empty-state {
    text-align: center;
    padding: 52px 24px;
    background: #fafafa;
    border-radius: 16px;
    border: 2px dashed #e5e7eb;
    margin-bottom: 16px;
}

.my-empty-icon {
    font-size: 2.6rem;
    color: #d1d5db;
    margin-bottom: 14px;
}

.my-empty-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--sp-text);
    margin: 0 0 4px;
}

.my-empty-sub {
    font-size: 0.87rem;
    color: var(--sp-muted);
    margin: 0;
}

/* Video grid */
.my-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

/* Video card */
.my-video-card {
    background: var(--sp-white);
    border-radius: var(--sp-radius);
    border: 1.5px solid var(--sp-border);
    box-shadow: var(--sp-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.28s ease;
}

.my-video-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sp-shadow-lift);
}

.my-video-card--locked {
    opacity: 0.82;
    filter: grayscale(20%);
}

/* Thumbnail */
.my-vc-thumb {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #0e1628;
    flex-shrink: 0;
}

.my-vc-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.42s ease;
}

.my-video-card:hover .my-vc-img {
    transform: scale(1.05);
}

/* Lock overlay */
.my-vc-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.my-vc-lock-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    border: 2px solid rgba(255, 255, 255, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.35rem;
}

/* Processing overlay */
.my-vc-processing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.48);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    color: #fff;
    font-size: 1.8rem;
}

/* Private badge — top-right corner */
.my-vc-private-badge {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 800;
    color: #fff;
    background: rgba(66, 85, 255, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Card body */
.my-vc-body {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.my-vc-body--skeleton {
    gap: 8px;
}

.my-vc-title {
    font-size: 0.87rem;
    font-weight: 700;
    color: var(--sp-text);
    line-height: 1.45;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.my-video-card:hover .my-vc-title {
    color: var(--sp-blue);
}

/* Meta chips */
.my-vc-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.my-vc-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 700;
}

.my-badge-ready      { background: #ecfdf5; color: #065f46; }
.my-badge-processing { background: #fef3c7; color: #92400e; }
.my-badge-locked     { background: #f3f4f6; color: #6b7280; }
.my-badge-failed     { background: #fef2f2; color: #991b1b; }

.my-vc-duration,
.my-vc-sentences,
.my-vc-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.67rem;
    font-weight: 600;
    color: var(--sp-muted);
}

/* Action row */
.my-vc-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    flex-wrap: wrap;
}

.my-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.79rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.18s ease;
    white-space: nowrap;
    line-height: 1;
}

.my-btn:active {
    transform: scale(0.97);
}

/* Practice — blue CTA */
.my-btn-practice {
    background: var(--sp-blue);
    color: #fff;
    flex: 1;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(66, 85, 255, 0.25);
}

.my-btn-practice:hover {
    background: var(--sp-blue-dk);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(66, 85, 255, 0.35);
}

/* Upgrade — amber CTA */
.my-btn-upgrade {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    flex: 1;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.28);
}

.my-btn-upgrade:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.38);
}

/* Delete */
.my-btn-delete {
    background: #fef2f2;
    color: #dc2626;
    border: 1.5px solid #fecaca;
    padding: 8px 12px;
    flex-shrink: 0;
}

.my-btn-delete:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
    transform: translateY(-1px);
}

/* State-only (non-interactive) */
.my-btn-state {
    background: #f3f4f6;
    color: var(--sp-muted);
    flex: 1;
    justify-content: center;
    cursor: default;
}

.my-btn-state--failed {
    background: #fef2f2;
    color: #991b1b;
}

/* =================================================================
   SKELETON LOADING CARD
   ================================================================= */
.my-video-card--skeleton {
    pointer-events: none;
}

.skeleton-thumb {
    width: 100%;
    padding-bottom: 56.25%;
    position: relative;
}

.skeleton-line,
.skeleton-thumb {
    background: linear-gradient(90deg, #e5e7eb 25%, #d1d5db 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-title  { height: 14px; width: 78%; margin-bottom: 6px; }
.skeleton-meta   { height: 10px; width: 55%; margin-bottom: 6px; }
.skeleton-action { height: 34px; width: 100%; }

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

/* =================================================================
   PRACTICE PAGE — PRIVATE BADGE
   ================================================================= */
.spk-private-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(66, 85, 255, 0.09);
    border: 1.5px solid rgba(66, 85, 255, 0.22);
    color: var(--sp-blue);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

/* =================================================================
   RESPONSIVE — IMPORT PANEL + MY VIDEOS
   ================================================================= */
@media (max-width: 768px) {
    .mip-panel {
        padding: 28px 24px;
    }

    .mip-inner {
        flex-direction: column;
        gap: 28px;
    }

    .mip-right {
        flex: 0 0 100%;
    }

    .mip-form-area {
        flex-direction: column;
    }

    .mip-cta-btn {
        width: 100%;
        justify-content: center;
        height: 48px;
    }

    .mip-input {
        height: 48px;
    }

    .my-videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 480px) {
    .my-videos-grid {
        grid-template-columns: 1fr;
    }
}