@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-light: rgba(139, 92, 246, 0.15);
    --accent: #c084fc;
    --accent-glow: rgba(168, 85, 247, 0.35);
    --accent-gradient: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    
    --bg: #090a0f;
    --bg-elevated: #11131c;
    --surface: rgba(20, 23, 34, 0.75);
    --surface-hover: rgba(30, 34, 48, 0.85);
    --soft: rgba(255, 255, 255, 0.04);
    
    --text: #f3f4f6;
    --text-secondary: #9ca3af;
    --muted: #6b7280;
    
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(168, 85, 247, 0.35);
    
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.15);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.15);
    
    --radius-sm: 10px;
    --radius: 18px;
    --radius-lg: 26px;
    
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 35px rgba(139, 92, 246, 0.25);
    --shell: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', 'Poppins', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 65%, rgba(99, 102, 241, 0.08) 0%, transparent 45%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ── Shell ── */
.shell { width: min(calc(100% - 40px), var(--shell)); margin-inline: auto; }
.page-shell { min-height: calc(100vh - 180px); padding-bottom: 64px; }

/* ── Header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(9, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.nav-wrap {
    min-height: 74px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 8px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.brand span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.brand strong { font-size: 17px; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.brand small { font-size: 11px; color: var(--muted); margin-top: 2px; font-weight: 500; }

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 800;
    font-size: 20px;
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.4);
    position: relative;
    overflow: hidden;
}

.brand-mark::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 60%);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.main-nav a {
    padding: 9px 16px;
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.main-nav a.active {
    background: var(--primary-light);
    color: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.3);
}

/* ── Prominent General English CTA Button ── */
.main-nav a.nav-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 50px;
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    color: #ffffff !important;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: -0.01em;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 6px;
}

.main-nav a.nav-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(168, 85, 247, 0.65);
    filter: brightness(1.12);
    background: linear-gradient(135deg, #b865ff 0%, #8b5cf6 100%);
}

.main-nav a.nav-cta-btn i {
    font-size: 14px;
    color: #ffffff;
    transition: transform 0.25s ease;
}

.main-nav a.nav-cta-btn:hover i {
    transform: scale(1.15) rotate(-8deg);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 20px;
    border-left: 1px solid var(--border);
    font-size: 13px;
}

.user-avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.3);
}

.user-name {
    color: var(--text);
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-nav-button {
    display: none;
    margin-left: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    padding: 8px 16px;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
}

/* ── Footer ── */
.site-footer {
    background: rgba(9, 10, 15, 0.95);
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

.footer-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 28px 0;
    color: var(--muted);
    font-size: 13px;
}

.footer-wrap p { margin: 0; }

/* ── Buttons ── */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
}

.button i { font-size: 0.9em; }

.button:hover {
    transform: translateY(-2px);
}

.button.primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.5);
}

.button.primary:hover {
    box-shadow: 0 15px 35px -5px rgba(139, 92, 246, 0.7);
    filter: brightness(1.1);
}

.button.primary.shimmer {
    position: relative;
    overflow: hidden;
}

.button.primary.shimmer::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(
        60deg,
        transparent 30%,
        rgba(255, 255, 255, 0.25) 50%,
        transparent 70%
    );
    transform: rotate(30deg);
    animation: shimmer 4s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(30deg); }
    20%, 100% { transform: translateX(100%) rotate(30deg); }
}

.button.secondary {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    color: var(--text);
}

.button.secondary:hover {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.1);
    color: var(--accent);
}

.button.small { min-height: 40px; padding: 8px 18px; font-size: 13px; }
.button.margin-top { margin-top: 16px; }
.full-width { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.button-row.centered { justify-content: center; }

/* ── Links & Text Gradients ── */
.text-link, .table-link, .card-link, .back-link {
    color: var(--accent);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.text-link:hover, .table-link:hover, .card-link:hover {
    color: #d8b4fe;
}

.text-link i, .card-link i {
    transition: transform 0.2s ease;
}

.text-link:hover i, .card-link:hover i {
    transform: translateX(4px);
}

.gradient-text {
    background: linear-gradient(135deg, #ffffff 0%, #d8b4fe 50%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Hero Section ── */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.7fr);
    gap: 28px;
    align-items: stretch;
    padding-top: 40px;
}

.hero-glow {
    position: absolute;
    top: 20px;
    left: 10%;
    width: clamp(280px, 80vw, 500px);
    height: 350px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.22) 0%, rgba(99, 102, 241, 0) 70%);
    filter: blur(70px);
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: clamp(32px, 5vw, 56px);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(23, 18, 43, 0.85) 0%, rgba(14, 16, 26, 0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.hero-content .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.25);
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: clamp(32px, 4.5vw, 52px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: #fff;
    margin-bottom: 16px;
}

.hero-copy {
    max-width: 640px;
    margin-bottom: 28px;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.65;
}

.hero-panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 32px;
    border-radius: var(--radius-lg);
    background: rgba(17, 19, 28, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.hero-panel:hover {
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: var(--shadow-glow);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 12px;
}

.panel-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-score {
    margin: 8px 0 4px;
    font-size: clamp(38px, 5vw, 56px);
    line-height: 1.05;
    letter-spacing: -0.04em;
    font-weight: 800;
    background: linear-gradient(135deg, #c084fc 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.score-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.hero-link { margin-top: 20px; font-size: 14px; }

/* ── Eyebrow ── */
.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 28px;
}

.stat-card {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(17, 19, 28, 0.75);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: transparent;
    transition: background 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(168, 85, 247, 0.35);
    box-shadow: var(--shadow-glow);
}

.stat-card:hover::before {
    background: var(--accent-gradient);
}

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

.stat-header span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 16px;
}

.stat-icon.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.stat-icon.amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.stat-icon.emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.stat-card strong {
    display: block;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
    letter-spacing: -0.02em;
}

.stat-card .small-stat { font-size: 22px; color: var(--accent); }
.stat-card small { color: var(--muted); font-size: 12px; margin-top: 4px; display: block; }

/* ── Section Block & Skill Cards ── */
.section-block { margin-top: 60px; }

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.section-heading h2 {
    margin-top: 4px;
    font-size: clamp(22px, 3.5vw, 32px);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.section-card {
    display: flex;
    flex-direction: column;
    min-height: 240px;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(17, 19, 28, 0.75);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

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

.section-card:hover {
    transform: translateY(-6px);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(139, 92, 246, 0.2);
}

.section-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(168, 85, 247, 0.12);
    color: var(--accent);
    font-size: 20px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    transition: all 0.3s ease;
}

/* Unique Vibrant Accents per Skill Section */
.section-card[data-section="read_complete"] .section-icon { background: rgba(16, 185, 129, 0.15); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.section-card[data-section="read_select"] .section-icon { background: rgba(168, 85, 247, 0.15); color: #c084fc; border-color: rgba(168, 85, 247, 0.3); }
.section-card[data-section="listen_type"] .section-icon { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
.section-card[data-section="interactive_reading"] .section-icon { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border-color: rgba(59, 130, 246, 0.3); }
.section-card[data-section="writing"] .section-icon { background: rgba(244, 63, 94, 0.15); color: #fb7185; border-color: rgba(244, 63, 94, 0.3); }
.section-card[data-section="speaking"] .section-icon { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border-color: rgba(139, 92, 246, 0.3); }

.section-card:hover .section-icon {
    transform: scale(1.08);
}

.difficulty-pill {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--border);
}

.section-card h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 8px;
}

.section-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 20px;
}

.section-card .card-link {
    margin-top: auto;
    font-size: 14px;
}

.large-card { min-height: 360px; }

/* ── Quick Actions ── */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 32px;
}

.quick-action-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(17, 19, 28, 0.75);
    backdrop-filter: blur(16px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-action-card:hover {
    border-color: rgba(168, 85, 247, 0.4);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.action-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 20px;
    flex-shrink: 0;
}

.action-icon.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.action-icon.rose { background: rgba(244, 63, 94, 0.15); color: #fb7185; }

.action-content { flex: 1; }
.action-content span { color: var(--accent); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.action-content strong { display: block; margin-top: 4px; font-size: 17px; font-weight: 700; color: #fff; }

.action-arrow {
    color: var(--muted);
    font-size: 18px;
    transition: transform 0.25s ease, color 0.25s ease;
}

.quick-action-card:hover .action-arrow {
    color: var(--accent);
    transform: translateX(4px);
}

/* ── Disclaimer Card ── */
.disclaimer-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-top: 32px;
    padding: 20px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(17, 19, 28, 0.5);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.disclaimer-icon {
    font-size: 20px;
    color: var(--muted);
    margin-top: 2px;
}

.disclaimer-card strong { color: var(--text); display: block; margin-bottom: 2px; }
.disclaimer-card p { margin: 0; color: var(--muted); }

/* ══════════════════════════════════════════════
   SECTIONS PAGE
══════════════════════════════════════════════ */

.sec-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* ── Page header ── */
.sec-header {
    text-align: center;
    margin-bottom: 32px;
}

/* ── Filter bar ── */
.sec-filter-wrap {
    margin-bottom: 28px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* hide scrollbar but keep scroll */
    scrollbar-width: none;
}
.sec-filter-wrap::-webkit-scrollbar { display: none; }

.sec-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    width: fit-content;
    margin: 0 auto;
    flex-wrap: nowrap;
}

.sec-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border: none;
    border-radius: 50px;
    background: transparent;
    color: var(--muted);
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.sec-filter-btn i { font-size: 12px; }

.sec-filter-btn:hover {
    background: rgba(187,134,252,0.08);
    color: var(--accent);
}

.sec-filter-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(154,78,216,0.4);
}

/* ── Card show/hide with animation ── */
.sec-card {
    transition: all 0.25s ease, opacity 0.2s ease, transform 0.25s ease;
}

.sec-card--hidden {
    display: none !important;
}

.sec-card--visible {
    animation: secCardIn 0.22s ease;
}

@keyframes secCardIn {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* When only 1 card is shown, make it centered and wider */
.sec-grid:has(.sec-card--visible:only-of-type) {
    grid-template-columns: minmax(0, 560px);
    justify-content: center;
}

/* Empty state in grid */
.sec-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: var(--muted);
}
.sec-empty-state i { font-size: 2.5rem; margin-bottom: 12px; display: block; }

/* Responsive filter bar */
@media (max-width: 720px) {
    .sec-filter-bar {
        border-radius: 16px;
        flex-wrap: wrap;
        width: 100%;
        justify-content: center;
    }
    .sec-filter-btn { font-size: 12px; padding: 8px 14px; }
}



.sec-header h1 {
    font-size: clamp(28px, 5vw, 46px);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    margin: 10px 0 12px;
}

.sec-subtitle {
    color: var(--muted);
    font-size: 1rem;
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.7;
}

.sec-subtitle strong { color: var(--accent); }

/* ── Section grid ── */
.sec-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

/* ── Section card ── */
.sec-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 26px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 22px;
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

/* Subtle colored glow on top edge */
.sec-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--sec-color, var(--accent));
    border-radius: 22px 22px 0 0;
    opacity: 0.8;
}

.sec-card:hover {
    border-color: var(--sec-color, var(--accent));
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

/* Icon */
.sec-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sec-icon-wrap {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--sec-color, var(--accent)) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--sec-color, var(--accent)) 30%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--sec-color, var(--accent));
    transition: 0.25s;
}

.sec-card:hover .sec-icon-wrap {
    background: color-mix(in srgb, var(--sec-color, var(--accent)) 25%, transparent);
    transform: scale(1.08);
}

.sec-qcount {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.sec-qcount i { color: var(--sec-color, var(--accent)); font-size: 10px; }

/* Name & description */
.sec-card h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.3;
}

.sec-card p {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.65;
    margin: 0;
    flex: 1;
}

/* Skill tags */
.sec-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sec-skill-tag {
    padding: 3px 10px;
    border-radius: 50px;
    background: color-mix(in srgb, var(--sec-color, var(--accent)) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--sec-color, var(--accent)) 25%, transparent);
    color: var(--sec-color, var(--accent));
    font-size: 11px;
    font-weight: 700;
}

/* Card footer */
.sec-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.sec-time {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.sec-time i { color: var(--sec-color, var(--accent)); }

.sec-go {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--sec-color, var(--accent));
    font-size: 13px;
    font-weight: 800;
    opacity: 0;
    transform: translateX(-6px);
    transition: 0.2s;
}

.sec-card:hover .sec-go {
    opacity: 1;
    transform: translateX(0);
}

/* ── Mixed Practice callout ── */
.sec-mixed-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px;
    background: linear-gradient(135deg, #1a0a2e, #2d1254);
    border: 1px solid rgba(187,134,252,0.3);
    border-radius: 18px;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
}

.sec-mixed-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(154,78,216,0.3);
}

.sec-mixed-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.sec-mixed-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(187,134,252,0.15);
    border: 1px solid rgba(187,134,252,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--accent);
    flex-shrink: 0;
}

.sec-mixed-left strong {
    display: block;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 3px;
}

.sec-mixed-left p {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
}

.sec-go-mixed {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 50px;
    background: rgba(187,134,252,0.15);
    border: 1px solid rgba(187,134,252,0.3);
    color: var(--accent);
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
    transition: 0.2s;
}

.sec-mixed-card:hover .sec-go-mixed {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .sec-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 580px) {
    .sec-grid { grid-template-columns: 1fr; }
    .sec-mixed-card { flex-direction: column; align-items: flex-start; }
    .sec-go-mixed { align-self: stretch; justify-content: center; }
}


/* ══════════════════════════════════════════════
   DET PRACTICE — AUTHENTIC INTERFACE
══════════════════════════════════════════════ */

/* ─── Per-question countdown timer bar ─── */
.q-timer-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.q-timer-bar {
    flex: 1;
    height: 6px;
    background: var(--soft);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.q-timer-fill {
    height: 100%;
    width: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 1s linear, background 0.5s ease;
}

.q-timer-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    min-width: 30px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.q-timer-urgent .q-timer-fill {
    animation: timerPulse 0.6s ease-in-out infinite alternate;
}

@keyframes timerPulse {
    from { opacity: 1; }
    to   { opacity: 0.55; }
}

/* ─── Read & Complete: inline partial word hint inside sentence ─── */
.det-blank-hint {
    display: inline-flex;
    align-items: baseline;
    gap: 0;
    background: rgba(187,134,252,0.1);
    border-bottom: 3px solid var(--accent);
    border-radius: 4px 4px 0 0;
    padding: 1px 4px 0;
    margin: 0 2px;
    white-space: nowrap;
}

/* Shared: visible letters (used in both blank hints & word chips) */
.word-visible {
    color: var(--accent);
    font-weight: 800;
    letter-spacing: 0.02em;
    font-style: normal;
}

/* Container for underscores */
.word-hidden {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    margin-left: 4px;
}

/* Each underscore = exactly one hidden letter */
.word-underscore {
    display: inline-block;
    width: 12px;
    color: transparent;
    border-bottom: 3px solid rgba(187,134,252,0.6);
    line-height: 1;
    transform: translateY(-2px); /* align with text baseline perfectly */
}

/* Read & Select word chip: no masking — just full word styling */
.det-word-btn.selected .word-visible    { color: var(--accent); font-weight: 800; }
.det-word-btn.selected .word-underscore { color: rgba(187,134,252,0.65); }



/* ─── Check Now button ─── */
.det-check-row {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
}

.det-check-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 50px;
    border: 2px solid rgba(187,134,252,0.4);
    background: rgba(187,134,252,0.08);
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s ease;
}

.det-check-btn:hover:not(:disabled) {
    background: rgba(187,134,252,0.18);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.det-check-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

/* ─── Answer reveal panel ─── */
.det-answer-reveal {
    margin-top: 16px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    animation: revealIn 0.22s ease;
}

@keyframes revealIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.reveal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    font-size: 0.95rem;
    font-weight: 800;
}

.reveal-correct {
    background: rgba(76,175,80,0.14);
    color: #4caf50;
    border-bottom: 1px solid rgba(76,175,80,0.2);
}

.reveal-good {
    background: rgba(245,158,11,0.14);
    color: #f59e0b;
    border-bottom: 1px solid rgba(245,158,11,0.2);
}

.reveal-wrong {
    background: rgba(244,67,54,0.1);
    color: #f44336;
    border-bottom: 1px solid rgba(244,67,54,0.2);
}

.reveal-section {
    padding: 12px 18px;
    background: var(--soft);
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.reveal-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    width: 100%;
}

.reveal-label-bad    { color: #f44336; }
.reveal-label-missed { color: #f59e0b; }

.reveal-answer {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.reveal-answer-correct { color: #4caf50; }
.reveal-answer-wrong   { color: #f44336; }

.reveal-explanation {
    color: var(--muted);
    font-size: 0.88rem;
    gap: 8px;
}

.reveal-explanation i { color: var(--accent); }

/* Read & Select word reveal chips */
.reveal-word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.reveal-word {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
}

.reveal-word-real   { background: rgba(76,175,80,0.12);  color: #4caf50; border: 1px solid rgba(76,175,80,0.25); }
.reveal-word-bad    { background: rgba(244,67,54,0.1);   color: #f44336; border: 1px solid rgba(244,67,54,0.2); }
.reveal-word-missed { background: rgba(245,158,11,0.1);  color: #f59e0b; border: 1px solid rgba(245,158,11,0.2); }



/* ── Top Bar ── */
.det-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 70px;
    z-index: 40;
    gap: 16px;
}

.det-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 50px;
    border: 1px solid var(--border);
    transition: 0.2s;
    white-space: nowrap;
}

.det-back:hover { color: var(--accent); border-color: var(--accent); }

.det-topbar-center { display: flex; align-items: center; gap: 10px; }

.det-section-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    background: rgba(187,134,252,0.1);
    border: 1px solid rgba(187,134,252,0.25);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
}

.det-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
}

.det-timer i { color: var(--accent); }
.det-timer strong { color: var(--accent); font-size: 16px; font-weight: 800; }

/* ── Progress Bar ── */
.det-progress-bar-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.det-progress-bar-inner {
    flex: 1;
    height: 6px;
    background: var(--soft);
    border-radius: 999px;
    overflow: hidden;
}

.det-progress-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

.det-progress-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    min-width: 50px;
    text-align: right;
}

/* ── Practice Area ── */
.det-practice-area {
    max-width: 820px;
    margin: 32px auto 0;
    padding: 0 16px 80px;
}

/* ── Question Card ── */
.det-question {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: clamp(24px, 5vw, 44px);
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
    animation: detFadeIn 0.2s ease;
    margin-bottom: 16px;
}

.det-question.active { display: block; }

@keyframes detFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Question Header ── */
.det-q-header { margin-bottom: 20px; }

.det-q-type-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.det-q-type-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 50px;
    background: rgba(187,134,252,0.1);
    border: 1px solid rgba(187,134,252,0.2);
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.det-diff-pill {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.diff-easy   { background: rgba(76,175,80,0.12);  color: #4caf50; border: 1px solid rgba(76,175,80,0.25); }
.diff-medium { background: rgba(255,152,0,0.12);  color: #ff9800; border: 1px solid rgba(255,152,0,0.25); }
.diff-hard   { background: rgba(244,67,54,0.12);  color: #f44336; border: 1px solid rgba(244,67,54,0.25); }

/* ── Task Label ── */
.det-task-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(187,134,252,0.07);
    border-left: 3px solid var(--accent);
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.det-task-label i { color: var(--accent); flex-shrink: 0; font-size: 1rem; }
.det-task-label strong { color: var(--text); }

/* ─────────────────────────────────────────────
   READ & COMPLETE
───────────────────────────────────────────── */
.det-sentence-box {
    font-size: 1.35rem;
    line-height: 1.8;
    color: var(--text);
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px 26px;
    margin-bottom: 24px;
    font-weight: 500;
}

.det-blank {
    display: inline-block;
    min-width: 80px;
    padding: 2px 4px;
    border-bottom: 3px solid var(--accent);
    color: var(--accent);
    font-weight: 800;
    font-style: italic;
    letter-spacing: 2px;
}

/* Interactive Inline Blank inside Sentence */
.det-inline-blank-wrap {
    display: inline-flex;
    align-items: center;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    border: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
    border-bottom: 3px solid var(--accent);
    border-radius: 8px;
    padding: 2px 10px;
    margin: 0 4px;
    vertical-align: baseline;
    transition: all 0.2s ease;
    cursor: text;
}

.det-inline-blank-wrap:focus-within,
.det-inline-blank-wrap:hover {
    background: color-mix(in srgb, var(--accent) 25%, transparent);
    border-color: var(--accent);
    box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 40%, transparent);
}

.det-inline-prefix {
    color: var(--accent);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: 0.05em;
    user-select: none;
    margin-right: 2px;
}

.det-inline-sentence-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: inherit;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    min-width: 60px;
    max-width: 220px;
    padding: 0 2px;
}

.det-inline-sentence-input::placeholder {
    color: color-mix(in srgb, var(--accent) 60%, transparent);
    letter-spacing: 0.15em;
    font-weight: 400;
}

.det-input-wrap { margin-top: 8px; }

.det-input-label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.det-text-input {
    width: 100%;
    background: var(--soft);
    border: 2px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 14px 18px;
    outline: none;
    transition: 0.2s;
}

.det-text-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(187,134,252,0.12);
    background: #232323;
}

/* ─────────────────────────────────────────────
   READ & SELECT
───────────────────────────────────────────── */
.det-word-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.det-word-btn {
    padding: 14px 22px;
    border: 2px solid var(--border);
    border-radius: 14px;
    background: var(--soft);
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
    letter-spacing: 0.01em;
}

.det-word-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(187,134,252,0.06);
    transform: translateY(-2px);
}

.det-word-btn.selected {
    border-color: var(--accent);
    background: rgba(187,134,252,0.18);
    color: var(--accent);
    box-shadow: 0 0 0 3px rgba(187,134,252,0.1);
    transform: translateY(-2px);
}

/* ─────────────────────────────────────────────
   LISTEN & TYPE
───────────────────────────────────────────── */
.det-listen-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 28px 0 20px;
}

.det-play-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    border: none;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    cursor: pointer;
    box-shadow: 0 10px 35px rgba(154,78,216,0.5);
    transition: 0.25s;
    color: #fff;
    position: relative;
}

.det-play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 16px 45px rgba(154,78,216,0.65);
}

.det-play-btn.speaking {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    animation: pulseRing 1.2s infinite;
}

@keyframes pulseRing {
    0%   { box-shadow: 0 0 0 0   rgba(76,175,80,0.5); }
    70%  { box-shadow: 0 0 0 18px rgba(76,175,80,0);   }
    100% { box-shadow: 0 0 0 0   rgba(76,175,80,0);   }
}

.det-play-icon { font-size: 2rem; line-height: 1; }
.det-play-text { display: none; }

.det-listen-hint {
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

.det-waveform {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 56px;
}

.det-wave-bar {
    width: 4px;
    border-radius: 3px;
    background: rgba(187,134,252,0.25);
    transition: height 0.3s ease;
}

.det-play-btn.speaking ~ .det-waveform .det-wave-bar {
    animation: waveBounce 0.6s ease-in-out infinite alternate;
}

@keyframes waveBounce {
    from { transform: scaleY(0.4); opacity: 0.4; }
    to   { transform: scaleY(1.2); opacity: 1; }
}

.det-textarea {
    width: 100%;
    background: var(--soft);
    border: 2px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-size: 1rem;
    padding: 14px 18px;
    outline: none;
    resize: vertical;
    transition: 0.2s;
    line-height: 1.7;
}

.det-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(187,134,252,0.12);
}

/* ─────────────────────────────────────────────
   DET INTERACTIVE READING (Official 6-Part Experience)
───────────────────────────────────────────── */
.det-interactive-reading-stage {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px;
    margin-top: 10px;
}

.det-ir-part-tracker {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 14px;
}

.det-ir-step-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.det-ir-step-pill.active {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.det-ir-step-pill.completed {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.det-ir-passage-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 24px;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #e2e8f0;
}

/* Part 1 Inline Dropdown Blanks */
.det-ir-blank-wrap {
    display: inline-block;
    position: relative;
    margin: 0 4px;
}

.det-ir-blank-trigger {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 4px 12px;
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.det-ir-blank-trigger:hover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
}

.det-ir-blank-num {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    font-size: 0.75rem;
    color: #f8fafc;
}

.det-ir-blank-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 160px;
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
    z-index: 999;
}

.det-ir-blank-opt-item {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #e2e8f0;
    cursor: pointer;
    transition: background 0.15s ease;
}

.det-ir-blank-opt-item:hover {
    background: rgba(56, 189, 248, 0.2);
    color: #ffffff;
}

.det-ir-blank-wrap.correct .det-ir-blank-trigger {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.det-ir-blank-wrap.incorrect .det-ir-blank-trigger {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Part 2 - 6 Split View */
.det-ir-split-view {
    display: flex;
    gap: 24px;
    margin-top: 16px;
}

.det-ir-left-passage {
    flex: 1;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 24px;
    font-size: 1rem;
    line-height: 1.8;
    color: #e2e8f0;
}

.det-ir-right-options, .det-ir-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.det-ir-sentence-blank {
    background: rgba(56, 189, 248, 0.1);
    border: 2px dashed rgba(56, 189, 248, 0.4);
    border-radius: 12px;
    padding: 12px 16px;
    margin: 12px 0;
    color: #38bdf8;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
}

.det-ir-sentence-blank.filled {
    border-style: solid;
    background: rgba(56, 189, 248, 0.15);
    color: #f8fafc;
}

.det-ir-option-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px 18px;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.2s ease;
}

.det-ir-option-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.08);
}

.det-ir-option-card input[type="radio"] {
    display: none;
}

.det-ir-radio-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    margin-top: 2px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
}

.det-ir-option-card input[type="radio"]:checked + .det-ir-radio-dot {
    border-color: #38bdf8;
    background: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.det-ir-option-card.correct {
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.15) !important;
}

.det-ir-option-card.incorrect {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.15) !important;
}

.det-ir-selectable-passage {
    user-select: text;
    cursor: text;
}

.det-ir-highlight-box {
    background: rgba(30, 41, 59, 0.6);
    border: 2px dashed rgba(56, 189, 248, 0.35);
    border-radius: 14px;
    padding: 18px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #cbd5e1;
}

.det-ir-highlighted-text {
    font-size: 1rem;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .det-ir-split-view {
        flex-direction: column;
    }
}

/* ─────────────────────────────────────────────
   DET INTERACTIVE LISTENING (2-Stage Flow)
───────────────────────────────────────────── */
.det-interactive-listening-stage {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 24px;
    margin-top: 10px;
}

.det-il-top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.det-il-timer-box {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.det-il-q-counter {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #c084fc;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
}

.det-il-audio-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 20px;
    text-align: center;
}

.det-il-audio-play-btn {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border: none;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
    transition: all 0.2s ease;
}

.det-il-audio-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.5);
}

/* Stage 1 Questions */
.det-il-stage1-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 14px;
}

.det-il-stage1-num {
    font-size: 0.8rem;
    font-weight: 800;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.det-il-sentence-row {
    font-size: 1rem;
    line-height: 1.8;
    color: #e2e8f0;
}

.det-il-blank-input {
    background: rgba(15, 23, 42, 0.8);
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    border-radius: 10px;
    padding: 6px 14px;
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 600;
    outline: none;
    min-width: 180px;
    transition: all 0.2s ease;
}

.det-il-blank-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.det-il-review-panel {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
}

.det-il-review-header {
    color: #10b981;
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 12px;
}

/* Stage 2 Chat Feed */
.det-il-chat-feed {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.det-il-chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.6;
    animation: fadeIn 0.25s ease-out;
}

.det-il-chat-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.det-il-chat-bubble.speaker {
    align-self: flex-start;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f1f5f9;
    border-bottom-left-radius: 4px;
}

.det-il-bubble-sender {
    font-size: 0.75rem;
    font-weight: 800;
    opacity: 0.85;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Animated speaking indicator */
.det-il-speaking-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.det-il-speaking-label {
    color: #38bdf8;
    font-weight: 700;
    font-size: 0.9rem;
}

.det-il-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
}

.det-il-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    animation: det-il-bounce 1.2s ease-in-out infinite;
}

.det-il-dots span:nth-child(1) { animation-delay: 0s; }
.det-il-dots span:nth-child(2) { animation-delay: 0.2s; }
.det-il-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes det-il-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%            { transform: scale(1.2); opacity: 1; }
}

/* Stage 2 Turn Option Cards */
.det-il-turn-opt-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.2s ease;
}

.det-il-turn-opt-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.08);
}

.det-il-turn-opt-card input[type="radio"] {
    display: none;
}

.det-il-turn-opt-card input[type="radio"]:checked + .det-ir-radio-dot {
    border-color: #38bdf8;
    background: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.det-il-turn-opt-card.correct {
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.18) !important;
}

.det-il-turn-opt-card.incorrect {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.18) !important;
}

.det-il-turn-opt-card.selected {
    border-color: rgba(56, 189, 248, 0.7);
    background: rgba(56, 189, 248, 0.12);
}

.det-il-radio-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
}

.det-il-radio-dot.active {
    border-color: #38bdf8;
    background: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.det-il-turn-opt-text {
    flex: 1;
    line-height: 1.5;
    color: #e2e8f0;
}

.det-passage-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.det-reading-question {
    margin-bottom: 18px;
}

.det-reading-q-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.5;
}

.det-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.det-option {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border: 2px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.18s ease;
    background: var(--soft);
}

.det-option:hover {
    border-color: var(--accent);
    background: rgba(187,134,252,0.06);
}

.det-option input[type="radio"] { display: none; }

.det-option:has(input:checked) {
    border-color: var(--accent);
    background: rgba(187,134,252,0.14);
    box-shadow: 0 0 0 3px rgba(187,134,252,0.1);
}

.det-option-letter {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
    transition: 0.18s;
}

.det-option:has(input:checked) .det-option-letter {
    background: var(--accent);
    color: #121212;
}

.det-option-text {
    color: var(--text);
    font-size: 0.97rem;
    line-height: 1.5;
    padding-top: 5px;
}

/* ─────────────────────────────────────────────
   WRITING
───────────────────────────────────────────── */
.det-writing-prompt {
    position: relative;
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px 26px 22px 32px;
    margin-bottom: 14px;
    border-left: 4px solid var(--accent);
}

.det-quote-icon {
    position: absolute;
    top: 16px;
    left: -2px;
    color: rgba(187,134,252,0.3);
    font-size: 1.4rem;
    display: none;
}

.det-writing-prompt p, .det-speaking-prompt p {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.6;
    margin: 0;
}

.det-writing-tips {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 14px;
    padding: 8px 12px;
    background: rgba(255,152,0,0.07);
    border-radius: 8px;
    border: 1px solid rgba(255,152,0,0.15);
}

.det-writing-tips i { color: #ff9800; }

.det-writing-area {
    width: 100%;
    background: var(--soft);
    border: 2px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-size: 0.97rem;
    padding: 16px 18px;
    outline: none;
    resize: vertical;
    line-height: 1.8;
    transition: 0.2s;
    min-height: 240px;
}

.det-writing-area:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(187,134,252,0.12);
}

/* Word meter */
.det-word-meter { margin-top: 10px; }

.det-word-meter-bar {
    height: 5px;
    background: var(--soft);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

.det-word-meter-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff9800, #4caf50);
    transition: width 0.3s ease;
}

.det-word-meter-labels {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
}

.det-word-target { color: var(--muted); }

/* ─────────────────────────────────────────────
   SPEAKING
───────────────────────────────────────────── */
.det-speaking-prompt {
    position: relative;
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px 26px;
    margin-bottom: 24px;
    border-left: 4px solid #bb86fc;
}

.det-recorder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px 20px;
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: 20px;
    margin-bottom: 18px;
}

.det-rec-ring {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.det-rec-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    transform: rotate(-90deg);
}

.det-rec-track {
    fill: none;
    stroke: var(--border);
    stroke-width: 5;
}

.det-rec-progress {
    fill: none;
    stroke: var(--accent);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 339.3;
    stroke-dashoffset: 339.3;
    transition: stroke-dashoffset 1s linear;
}

.det-rec-main-btn {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(154,78,216,0.5);
    transition: 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.det-rec-main-btn:hover { transform: scale(1.08); }

.det-recorder.recording .det-rec-main-btn {
    background: linear-gradient(135deg, #e53935, #b71c1c);
    box-shadow: 0 8px 28px rgba(229,57,53,0.5);
    animation: pulseRing 1.2s infinite;
}

.det-rec-status {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
}

.det-rec-timer {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.det-rec-msg {
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

.det-speaking-checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px;
    background: rgba(76,175,80,0.06);
    border: 1px solid rgba(76,175,80,0.2);
    border-radius: 14px;
}

.det-speaking-checklist li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

.det-speaking-checklist i { color: #4caf50; }

/* ── Navigation ── */
.det-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 0 10px;
}

.det-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 50px;
    border: 2px solid var(--border);
    background: var(--soft);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.det-nav-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.det-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.det-nav-btn[hidden] { display: none; }

.det-nav-next,
.det-nav-submit {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 6px 20px rgba(154,78,216,0.35);
}

.det-nav-next:hover:not(:disabled),
.det-nav-submit:hover:not(:disabled) {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
    box-shadow: 0 10px 28px rgba(154,78,216,0.55);
}

.det-nav-submit {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    border-color: #4caf50;
}

.det-nav-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #43a047, #1b5e20);
    border-color: #43a047;
    box-shadow: 0 10px 28px rgba(76,175,80,0.45);
}

/* Dot indicators */
.det-nav-dots {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.det-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
}

.det-dot.active {
    background: var(--accent);
    transform: scale(1.4);
}

.det-dot.answered {
    background: rgba(76,175,80,0.7);
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .det-topbar { padding: 10px 14px; }
    .det-topbar-center { display: none; }
    .det-practice-area { padding: 0 10px 80px; }
    .det-question { padding: 20px 18px; border-radius: 18px; }
    .det-sentence-box { font-size: 1.1rem; padding: 16px; }
    .det-word-btn { padding: 11px 16px; font-size: 0.95rem; }
    .det-play-btn { width: 84px; height: 84px; }
    .det-play-icon { font-size: 1.6rem; }
    .det-nav { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(18,18,18,0.97); padding: 12px 16px; border-top: 1px solid var(--border); backdrop-filter: blur(12px); margin: 0; }
    .det-nav-btn { padding: 10px 16px; font-size: 0.85rem; }
    .det-nav-dots { display: none; }
}

.disclaimer-card strong { color: var(--text); }
.disclaimer-card p { margin: 4px 0 0; }

/* ── Page Heading ── */
.page-heading { padding: 50px 0 26px; }
.page-heading h1 { font-size: clamp(30px, 5vw, 48px); color: #fff; }
.page-heading > p:last-child { max-width: 680px; color: var(--muted); margin-top: 8px; }

/* ── Practice ── */
.practice-heading, .result-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 38px 0 22px;
}

.practice-heading h1, .result-hero h1 { font-size: clamp(28px, 4vw, 44px); color: #fff; }
.practice-heading p, .result-hero p { max-width: 680px; color: var(--muted); margin-top: 6px; }

.timer-card {
    min-width: 145px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    text-align: right;
    flex-shrink: 0;
}

.timer-card span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.timer-card strong { display: block; font-size: 26px; color: var(--accent); }

.practice-shell { max-width: 880px; }

.practice-progress-wrap {
    margin-bottom: 14px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.practice-progress-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: var(--soft); }
.progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: 0.25s;
}

/* ── Question Card ── */
.question-card {
    display: none;
    min-height: 460px;
    padding: clamp(22px, 5vw, 42px);
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.question-card.active {
    display: block;
    animation: questionIn 0.18s ease;
}

@keyframes questionIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.question-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
}

.question-type { color: var(--accent); font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }

.question-card h2 {
    max-width: 740px;
    margin: 0 0 10px;
    font-size: clamp(20px, 3.5vw, 28px);
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: #fff;
}

.question-instruction { margin: 0 0 22px; color: var(--muted); font-size: 0.9rem; }

/* ── Passage ── */
.passage-box, .mini-passage {
    margin-bottom: 22px;
    padding: 18px;
    border-left: 4px solid var(--accent);
    border-radius: 0 12px 12px 0;
    background: rgba(187,134,252,0.06);
}

.passage-box p { margin: 8px 0 0; color: var(--text); line-height: 1.7; }

/* ── Inputs ── */
.field-label { display: block; margin: 16px 0 7px; color: var(--muted); font-size: 13px; font-weight: 700; }

.text-input, textarea, select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--soft);
    color: var(--text);
    outline: none;
    transition: 0.2s;
}

.text-input, select { min-height: 46px; padding: 10px 14px; }
textarea { padding: 12px 14px; resize: vertical; }

.text-input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(187,134,252,0.15);
}

/* ── Listen button ── */
.listen-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 18px;
    padding: 12px 18px;
    border: 0;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(154,78,216,0.35);
    transition: 0.3s;
}

.listen-button:hover { box-shadow: 0 10px 28px rgba(154,78,216,0.55); transform: translateY(-1px); }
.listen-button.speaking { background: linear-gradient(135deg, #4caf50, #2e7d32); }

/* ── Word Grid (Read & Select) ── */
.word-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.word-choice {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: var(--soft);
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: 0.2s;
}

.word-choice:hover { border-color: var(--accent); color: var(--accent); }

.word-choice.selected {
    border-color: var(--accent);
    background: rgba(187,134,252,0.15);
    color: var(--accent);
    box-shadow: 0 0 0 3px rgba(187,134,252,0.1);
}

/* ── Radio Options (Interactive Reading) ── */
.option-list { display: grid; gap: 10px; margin-top: 22px; }

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
    background: var(--soft);
}

.radio-option:hover { border-color: var(--accent); background: rgba(187,134,252,0.06); }
.radio-option input { margin-top: 4px; accent-color: var(--accent); }
.radio-option span { color: var(--text); }

/* ── Writing ── */
.writing-area { min-height: 260px; }
.writing-metrics { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 13px; }

/* ── Recorder ── */
.recorder-box {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--soft);
}

.record-status { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.record-status [data-record-timer] { margin-left: auto; font-weight: 800; color: var(--accent); }

.record-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }

.recorder-box.recording .record-dot {
    background: var(--danger);
    box-shadow: 0 0 0 6px rgba(244,67,54,0.15);
    animation: pulse 1.2s infinite;
}

@keyframes pulse { 50% { opacity: 0.5; } }

.recorder-box audio { width: 100%; margin-top: 14px; }
.recorder-message { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.feedback-checklist { margin: 18px 0 0; padding-left: 20px; color: var(--muted); font-size: 0.9rem; }
.feedback-checklist li { margin-bottom: 4px; }

/* ── Navigation ── */
.practice-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 0 0;
}

.navigation-spacer { flex: 1; }
.practice-navigation button[hidden] { display: none; }
.practice-navigation button:disabled { cursor: not-allowed; opacity: 0.4; transform: none; }

/* ── Results ── */
.result-hero { align-items: center; }

.score-ring {
    --score: 0;
    display: grid;
    place-items: center;
    width: 180px;
    height: 180px;
    flex-shrink: 0;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--surface) 78%, transparent 80% 100%),
                conic-gradient(var(--accent) calc(var(--score)*1%), var(--soft) 0);
    box-shadow: var(--shadow);
}

.score-ring div { text-align: center; }
.score-ring strong { display: block; font-size: 36px; line-height: 1; color: var(--accent); }
.score-ring span { color: var(--muted); font-size: 12px; text-transform: uppercase; }

.result-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; }

.primary-result {
    background: linear-gradient(135deg, #1a0a2e, #3d1a6b);
    border-color: rgba(187,134,252,0.3) !important;
}

.primary-result span, .primary-result small { color: rgba(187,134,252,0.7); }
.primary-result strong { color: var(--accent); }

.insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }

.insight-card { padding: 22px; border-radius: var(--radius); }
.insight-card.success { border: 1px solid rgba(76,175,80,0.3); background: var(--success-soft); }
.insight-card.warning { border: 1px solid rgba(255,152,0,0.3); background: rgba(255,152,0,0.08); }
.insight-card h2 { margin-top: 0; color: #fff; }

/* ── Answer Review ── */
.answer-review-list, .mistake-list { display: grid; gap: 16px; }

.answer-review-card, .mistake-card, .content-card, .vocabulary-panel {
    padding: clamp(20px, 4vw, 30px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.answer-review-card.correct { border-left: 5px solid var(--success); }
.answer-review-card.incorrect { border-left: 5px solid var(--danger); }
.answer-review-card h3, .mistake-card h2 { margin: 0 0 16px; line-height: 1.35; color: #fff; }

.answer-review-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.status-badge.correct { background: var(--success-soft); color: var(--success); }
.status-badge.incorrect { background: var(--danger-soft); color: var(--danger); }

.answer-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.answer-comparison > div { padding: 14px; border-radius: 10px; background: var(--soft); border: 1px solid var(--border); }
.answer-comparison span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.answer-comparison p { margin: 6px 0 0; white-space: pre-wrap; color: var(--text); }

.feedback-box, .explanation-box {
    margin-top: 12px;
    padding: 14px;
    border-radius: 10px;
}

.feedback-box { background: var(--soft); border: 1px solid var(--border); }
.explanation-box { border: 1px solid rgba(187,134,252,0.2); background: rgba(187,134,252,0.06); }
.feedback-box p, .explanation-box p { margin: 6px 0 0; color: var(--muted); }

.action-panel { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* ── History Table ── */
.content-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }

.history-table { width: 100%; border-collapse: collapse; }
.history-table th, .history-table td { padding: 15px 16px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.history-table th { background: var(--soft); color: var(--muted); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.history-table tr:last-child td { border-bottom: 0; }
.history-table td { color: var(--text); }
.history-table tr:hover td { background: rgba(187,134,252,0.04); }

/* ── Review Toolbar ── */
.review-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.review-toolbar form { width: min(100%, 340px); }
.review-toolbar label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }

.review-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.6fr); gap: 18px; align-items: start; }
.vocabulary-panel { position: sticky; top: 88px; }
.vocabulary-panel h2 { margin-top: 0; color: #fff; }

.saved-word-list { display: grid; gap: 10px; margin-top: 20px; }
.saved-word-list article { padding: 12px; border-radius: 10px; background: var(--soft); border: 1px solid var(--border); }
.saved-word-list p, .saved-word-list small { display: block; margin: 4px 0 0; color: var(--muted); }

/* ── Alerts ── */
.alert { margin-bottom: 16px; padding: 12px 16px; border-radius: 10px; }
.success-alert { border: 1px solid rgba(76,175,80,0.3); background: var(--success-soft); color: var(--success); }

/* ── Empty State ── */
.empty-state {
    padding: 64px 24px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: rgba(30,30,30,0.7);
    text-align: center;
}

.empty-state.inner { border: 0; background: var(--surface); }
.empty-state h2 { margin-top: 0; color: #fff; }
.empty-state code { padding: 2px 7px; border-radius: 6px; background: var(--soft); color: var(--accent); }

/* ── Auth Required ── */
.auth-required-page {
    display: grid;
    place-items: center;
    padding: 24px;
    min-height: 100vh;
    background: var(--bg);
    background-image: 
        radial-gradient(circle at 50% 30%, rgba(139, 92, 246, 0.2) 0%, transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.12) 0%, transparent 50%);
}

.auth-required-card {
    width: min(100%, 500px);
    padding: clamp(32px, 6vw, 48px);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(20, 23, 34, 0.85) 0%, rgba(14, 16, 26, 0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(139, 92, 246, 0.2);
    text-align: center;
}

.auth-required-card .brand-mark.large {
    margin: 0 auto 16px;
}

.auth-required-card h1 {
    margin: 16px 0 12px;
    font-size: clamp(24px, 4.5vw, 36px);
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
    letter-spacing: -0.02em;
}

.auth-required-card p.muted {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.55;
}

.auth-required-card .back-link {
    margin-top: 24px;
    display: inline-block;
    color: var(--accent);
    font-weight: 600;
    transition: all 0.2s ease;
}

.auth-required-card .back-link:hover {
    color: #d8b4fe;
    transform: translateX(-4px);
}

/* ── Misc ── */
.muted { color: var(--muted); }

/* ── Responsive ── */
@media (max-width: 980px) {
    .main-nav {
        position: absolute;
        top: 67px;
        right: 16px;
        display: none;
        width: min(280px, calc(100vw - 32px));
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: var(--surface);
        box-shadow: var(--shadow);
    }
    .main-nav.open { display: flex; }
    .mobile-nav-button { display: block; }
    .user-menu { padding-left: 0; border-left: 0; }
    .user-name { display: none; }
    .hero { grid-template-columns: 1fr; }
    .section-grid { grid-template-columns: repeat(2, 1fr); }
    .result-grid { grid-template-columns: 1fr 1fr; }
    .primary-result { grid-column: 1 / -1; }
    .review-layout { grid-template-columns: 1fr; }
    .vocabulary-panel { position: static; }
}

@media (max-width: 720px) {
    .shell { width: min(calc(100% - 20px), var(--shell)); }
    .nav-wrap { min-height: 64px; gap: 10px; }
    .brand small, .user-menu .text-link { display: none; }
    .hero { padding-top: 20px; }
    .stats-grid, .section-grid, .quick-actions, .insight-grid, .result-grid { grid-template-columns: 1fr; }
    .section-heading, .practice-heading, .result-hero, .review-toolbar, .footer-wrap { align-items: flex-start; flex-direction: column; }
    .timer-card { width: 100%; text-align: left; }
    .question-card { min-height: 400px; border-radius: 18px; }
    .answer-comparison { grid-template-columns: 1fr; }
    .score-ring { width: 150px; height: 150px; }
    .practice-navigation {
        position: sticky;
        bottom: 0;
        z-index: 10;
        margin-inline: -10px;
        padding: 12px;
        border-top: 1px solid var(--border);
        background: rgba(18,18,18,0.95);
        backdrop-filter: blur(12px);
    }
    .practice-navigation .button { min-width: 0; flex: 1; }
    .navigation-spacer { display: none; }
    .history-table, .history-table tbody, .history-table tr, .history-table td { display: block; width: 100%; }
    .history-table thead { display: none; }
    .history-table tr { padding: 14px 16px; border-bottom: 1px solid var(--border); }
    .history-table td { display: flex; justify-content: space-between; gap: 20px; padding: 7px 0; border: 0; white-space: normal; text-align: right; }
    .history-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 800; text-align: left; }
    .history-table td:last-child::before { content: ""; }
}

/* ─────────────────────────────────────────────────────────────
   DUOLINGO-AUTHENTIC DET DESIGN SYSTEM & STYLES
───────────────────────────────────────────────────────────── */

:root {
    --duo-green: #58cc02;
    --duo-green-dark: #46a602;
    --duo-blue: #1cb0f6;
    --duo-blue-dark: #1899d6;
    --duo-purple: #ce82ff;
    --duo-purple-dark: #b05fe6;
    --duo-coral: #ff4b4b;
    --duo-coral-dark: #ea2b2b;
    --duo-gold: #ffc800;
    --duo-gold-dark: #e5b200;
}

/* Tactile 3D Buttons */
.det-check-btn, .det-nav-next, .det-nav-submit {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: #fff;
    font-weight: 700;
    border: none;
    border-bottom: 4px solid #6d28d9;
    border-radius: 14px;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.det-check-btn:hover:not(:disabled), .det-nav-next:hover:not(:disabled), .det-nav-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #b865ff 0%, #8b5cf6 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

.det-check-btn:active:not(:disabled), .det-nav-next:active:not(:disabled), .det-nav-submit:active:not(:disabled) {
    transform: translateY(2px);
    border-bottom: 2px solid #6d28d9;
}

/* Audio Word Cards (Listen & Select) */
.det-audio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.det-audio-word-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-bottom: 4px solid rgba(0, 0, 0, 0.4);
    border-radius: 14px;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.det-audio-word-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--duo-blue);
}

.det-audio-word-btn.selected {
    background: rgba(28, 176, 246, 0.15);
    border-color: var(--duo-blue);
    border-bottom-color: var(--duo-blue-dark);
    color: var(--duo-blue);
}

.det-audio-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(28, 176, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--duo-blue);
}

.det-word-check {
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.15s ease;
}

.det-audio-word-btn.selected .det-word-check {
    opacity: 1;
    transform: scale(1);
}

/* Read Aloud Display Box */
.det-read-aloud-box {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(167, 139, 250, 0.1));
    border: 2px dashed rgba(56, 189, 248, 0.4);
    border-radius: 16px;
    padding: 28px 24px;
    margin: 20px 0;
    text-align: center;
}

.det-read-aloud-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.5;
}

/* Photo Prompt Frame */
.det-photo-container {
    display: flex;
    justify-content: center;
    margin: 20px 0 24px;
}

.det-photo-frame {
    width: 100%;
    max-width: 520px;
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.12);
    background: #18181b;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.det-photo-img {
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: cover;
    display: block;
}

.det-photo-illustration {
    padding: 36px 24px;
    text-align: center;
    background: linear-gradient(135deg, #18181b, #27272a);
}

.det-photo-placeholder-icon {
    font-size: 3.5rem;
    color: var(--duo-purple);
    margin-bottom: 12px;
}

.det-photo-caption {
    font-size: 1.05rem;
    color: var(--muted);
    font-style: italic;
}

/* Prep Timer Overlay Modal */
.det-prep-overlay {
    position: relative;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 16px;
    padding: 24px;
    margin: 16px 0;
    text-align: center;
    border: 2px solid var(--duo-gold);
    animation: detPulseGlow 2s infinite alternate;
}

.det-prep-overlay.det-prep-done {
    display: none;
}

@keyframes detPulseGlow {
    from { box-shadow: 0 0 10px rgba(255, 200, 0, 0.2); }
    to { box-shadow: 0 0 24px rgba(255, 200, 0, 0.5); }
}

.det-prep-box h4 {
    font-size: 1.2rem;
    color: var(--duo-gold);
    margin-top: 8px;
}

.det-prep-icon {
    font-size: 2.2rem;
    color: var(--duo-gold);
}

.det-prep-countdown {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    margin: 8px 0;
}

/* Subscore Breakdown Grid */
.subscore-section {
    margin-top: 40px;
    margin-bottom: 40px;
}

.subscore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.subscore-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--sub-color, var(--duo-green));
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.subscore-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.subscore-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sub-color, var(--duo-green));
    font-size: 1.3rem;
}

.subscore-header h3 {
    font-size: 1.1rem;
    color: #fff;
    margin: 0;
}

.subscore-header small {
    color: var(--muted);
    font-size: 0.85rem;
}

.subscore-val {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 10px;
}

.subscore-val strong {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
}

.subscore-val span {
    color: var(--muted);
    font-size: 0.95rem;
}

.subscore-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.subscore-fill {
    height: 100%;
    background: var(--sub-color, var(--duo-green));
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─────────────────────────────────────────────────────────────
   SINGLE WORD 5-SECOND FLASHCARD RUNNER (MINIMALIST)
───────────────────────────────────────────────────────────── */

.det-single-word-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.det-word-timer-wrap {
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.det-word-timer-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--duo-green), var(--duo-gold), var(--duo-coral));
    border-radius: 4px;
    transition: width 0.04s linear;
}

.det-word-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.det-word-timer-num {
    background: rgba(255, 200, 0, 0.15);
    padding: 2px 10px;
    border-radius: 12px;
    color: var(--duo-gold);
    font-weight: 700;
}

.det-word-display-box {
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    margin-bottom: 20px;
    position: relative;
}

.det-active-word-text {
    font-size: 2.4rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.det-word-feedback-badge {
    margin-top: 10px;
    padding: 4px 14px;
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    animation: popIn 0.2s ease-out;
}

.det-word-feedback-badge.fb-correct {
    background: rgba(88, 204, 2, 0.2);
    border: 1px solid var(--duo-green);
    color: var(--duo-green);
}

.det-word-feedback-badge.fb-wrong {
    background: rgba(255, 75, 75, 0.2);
    border: 1px solid var(--duo-coral);
    color: var(--duo-coral);
}

.det-word-feedback-badge.fb-done {
    background: rgba(206, 130, 255, 0.2);
    border: 1px solid var(--duo-purple);
    color: var(--duo-purple);
}

/* Minimalist Choice Buttons */
.det-choice-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.det-choice-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    font-size: 1.15rem;
    font-weight: 700;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.det-choice-btn * {
    pointer-events: none;
}

.det-choice-btn.real-btn {
    background-color: var(--duo-green);
    border-bottom: 4px solid var(--duo-green-dark);
    color: #ffffff;
}

.det-choice-btn.real-btn:hover:not(:disabled) {
    background-color: #61db02;
}

.det-choice-btn.real-btn:active:not(:disabled) {
    transform: translateY(2px);
    border-bottom: 2px solid var(--duo-green-dark);
}

.det-choice-btn.fake-btn {
    background-color: var(--duo-coral);
    border-bottom: 4px solid var(--duo-coral-dark);
    color: #ffffff;
}

.det-choice-btn.fake-btn:hover:not(:disabled) {
    background-color: #ff5e5e;
}

.det-choice-btn.fake-btn:active:not(:disabled) {
    transform: translateY(2px);
    border-bottom: 2px solid var(--duo-coral-dark);
}

.det-choice-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────────
   LISTEN & TYPE CARD
───────────────────────────────────────────────────────────── */

.det-listen-type-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 4px 0;
}

.det-lt-difficulty {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--diff-color, #ffc800);
    background: color-mix(in srgb, var(--diff-color, #ffc800) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--diff-color, #ffc800) 40%, transparent);
    width: fit-content;
}

.det-lt-player {
    display: flex;
    justify-content: center;
}

.det-lt-play-btn {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 28px;
    background: rgba(28, 176, 246, 0.1);
    border: 2px solid rgba(28, 176, 246, 0.35);
    border-bottom: 4px solid rgba(28, 176, 246, 0.5);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    max-width: 460px;
    color: var(--text);
}

.det-lt-play-btn:hover:not(.det-lt-exhausted) {
    background: rgba(28, 176, 246, 0.18);
    border-color: var(--duo-blue);
}

.det-lt-play-btn.det-lt-playing {
    background: rgba(28, 176, 246, 0.22);
    border-color: var(--duo-blue);
    animation: ltPulse 0.9s ease-in-out infinite alternate;
}

.det-lt-play-btn.det-lt-exhausted {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}

@keyframes ltPulse {
    from { box-shadow: 0 0 0 0 rgba(28, 176, 246, 0.3); }
    to   { box-shadow: 0 0 0 12px rgba(28, 176, 246, 0); }
}

.det-lt-play-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--duo-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(28, 176, 246, 0.4);
}

.det-lt-play-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.det-lt-play-label {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.det-lt-play-counter {
    font-size: 0.85rem;
    color: var(--duo-blue);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.det-lt-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.det-lt-input {
    font-size: 1.05rem;
    padding: 14px 16px;
}

/* ─────────────────────────────────────────────────────────────
   LISTEN & TYPE — word-by-word diff reveal
───────────────────────────────────────────────────────────── */

.lt-word-diff {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

/* Each token is a small column: user word on top, correct below */
.lt-diff-word {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

/* Correct word — green pill */
.lt-diff-ok {
    background: rgba(88, 204, 2, 0.15);
    border: 1.5px solid rgba(88, 204, 2, 0.45);
    color: #58cc02;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
}

/* Wrong word container */
.lt-diff-bad {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* User's wrong word — red, struck through */
.lt-diff-user {
    background: rgba(255, 75, 75, 0.15);
    border: 1.5px solid rgba(255, 75, 75, 0.45);
    color: #ff4b4b;
    padding: 4px 9px;
    border-radius: 7px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: line-through;
    text-decoration-color: rgba(255, 75, 75, 0.7);
}

/* "missing" placeholder */
.lt-diff-missing {
    font-style: italic;
    opacity: 0.7;
    text-decoration: none;
}

/* Correct word shown below the wrong one — green */
.lt-diff-correct {
    background: rgba(88, 204, 2, 0.15);
    border: 1.5px solid rgba(88, 204, 2, 0.45);
    color: #58cc02;
    padding: 4px 9px;
    border-radius: 7px;
    font-size: 0.9rem;
    font-weight: 700;
}
/* ─────────────────────────────────────────────────────────────
   SECTION DASHBOARD & FILTER BAR STYLES (FULL DESKTOP VISIBILITY)
───────────────────────────────────────────────────────────── */

.sec-page {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 30px 16px;
}

.sec-header {
    text-align: center;
    margin-bottom: 30px;
}

.sec-header h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    color: #ffffff;
    margin: 6px 0;
}

.sec-subtitle {
    color: var(--muted);
    font-size: 1.05rem;
}

.sec-filter-wrap {
    width: 100%;
    margin-bottom: 36px;
}

.sec-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(30, 30, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.sec-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.sec-filter-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: translateY(-1px);
}

.sec-filter-btn.active {
    background: var(--duo-purple, #ce82ff);
    color: #ffffff;
    border-color: var(--duo-purple, #ce82ff);
    border-bottom: 3px solid var(--duo-purple-dark, #b05fe6);
    box-shadow: 0 4px 14px rgba(206, 130, 255, 0.35);
    font-weight: 700;
}

.sec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}

.sec-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--sec-color, var(--duo-green));
    border-radius: 18px;
    padding: 24px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.sec-card:hover {
    transform: translateY(-4px);
    border-color: var(--sec-color, var(--duo-green));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.sec-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.sec-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sec-color, var(--duo-green));
    font-size: 1.4rem;
}

.sec-qcount {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--sec-color, var(--duo-green));
    background: color-mix(in srgb, var(--sec-color, var(--duo-green)) 15%, transparent);
    padding: 4px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sec-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px;
}

.sec-card p {
    font-size: 0.95rem;
    color: var(--muted);
    margin: 0 0 16px;
    line-height: 1.5;
    flex-grow: 1;
}

.sec-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.sec-skill-tag {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3px 10px;
    border-radius: 8px;
}

.sec-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.9rem;
    font-weight: 600;
}

.sec-time {
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sec-go {
    color: var(--sec-color, var(--duo-green));
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

/* ─────────────────────────────────────────────────────────────
   READ AND COMPLETE (C-Test Paragraph & Letter Boxes)
───────────────────────────────────────────────────────────── */

.det-ctest-header {
    text-align: center;
    margin-bottom: 24px;
}

.det-ctest-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
}

.det-ctest-title {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--duo-purple, #ce82ff);
    margin-bottom: 18px;
}

.det-ctest-passage-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 28px 24px;
    line-height: 2.4;
    font-size: 1.12rem;
    color: #e0e0e0;
    font-weight: 400;
    margin-bottom: 24px;
}

.ctest-word-group {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin: 0 4px;
    vertical-align: middle;
}

.ctest-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 34px;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    text-transform: lowercase;
    box-sizing: border-box;
}

.ctest-box-given {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.ctest-box-input {
    background: rgba(0, 0, 0, 0.35);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-bottom: 3px solid var(--duo-purple, #ce82ff);
    color: var(--duo-purple, #ce82ff);
    outline: none;
    transition: all 0.15s ease;
    padding: 0;
}

.ctest-box-input:focus {
    background: rgba(206, 130, 255, 0.15);
    border-color: var(--duo-purple, #ce82ff);
    border-bottom-width: 3.5px;
    box-shadow: 0 0 0 3px rgba(206, 130, 255, 0.25);
}

.ctest-reveal-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ctest-reveal-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.9rem;
}

.ctest-reveal-item.ok {
    background: rgba(88, 204, 2, 0.15);
    border: 1px solid var(--duo-green);
    color: var(--duo-green);
}

.ctest-reveal-item.bad {
    background: rgba(255, 75, 75, 0.15);
    border: 1px solid var(--duo-coral);
    color: var(--duo-coral);
}

.ctest-box-input.ctest-box-ok {
    background: rgba(88, 204, 2, 0.25) !important;
    border-color: #58cc02 !important;
    border-bottom-color: #58cc02 !important;
    color: #58cc02 !important;
}

.ctest-box-input.ctest-box-bad {
    background: rgba(255, 75, 75, 0.25) !important;
    border-color: #ff4b4b !important;
    border-bottom-color: #ff4b4b !important;
    color: #ff4b4b !important;
}

/* ── Streak Badge ── */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-left: 8px;
}

/* ── DET Subscores Grid ── */
.subscores-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 20px;
}

.subscore-card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(17, 19, 28, 0.75);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.subscore-card:hover {
    transform: translateY(-4px);
    border-color: rgba(168, 85, 247, 0.35);
    box-shadow: var(--shadow-glow);
}

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

.subscore-header h4 {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.subscore-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 15px;
}

.subscore-icon.cyan { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.subscore-icon.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.subscore-icon.amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.subscore-icon.rose { background: rgba(244, 63, 94, 0.15); color: #fb7185; }

.subscore-val {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.subscore-desc {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.subscore-bar-bg {
    width: 100%;
    height: 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    margin-top: 14px;
    overflow: hidden;
}

.subscore-bar-fill {
    height: 100%;
    border-radius: 10px;
    background: var(--accent-gradient);
    transition: width 0.6s ease;
}

/* ── Recent Activity Section ── */
.dashboard-two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.activity-card, .det-scale-card {
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(17, 19, 28, 0.75);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.activity-header h3, .det-scale-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(168, 85, 247, 0.3);
}

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

.activity-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent);
    font-size: 16px;
}

.activity-details strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.activity-details small {
    color: var(--muted);
    font-size: 12px;
}

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

.score-badge {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 800;
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* ── DET Score Scale Estimator ── */
.det-scale-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 8px 0 20px;
}

.scale-bands {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scale-band {
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.scale-band.active {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.3);
}

.scale-range {
    font-weight: 800;
    font-size: 14px;
    color: var(--accent);
}

.scale-label {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.scale-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

.scale-band.active .scale-tag {
    background: var(--accent-gradient);
    color: #fff;
}

/* Responsive Grid for Dashboard */
@media (max-width: 980px) {
    .subscores-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
    .subscores-grid { grid-template-columns: 1fr; }
}

/* ── Delete Action & Flash Alerts ── */
.action-cell {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: flex-end;
}

.inline-delete-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

.delete-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
    transform: scale(1.06);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.alert-flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 14px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    font-weight: 600;
}

.alert-flash.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert-flash.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* ─────────────────────────────────────────────────────────────
   MASTER ADAPTIVE & RESPONSIVE DESIGN SYSTEM
   Supports Mobile (320px+), Tablet (768px+), Laptop & Desktop
───────────────────────────────────────────────────────────── */

/* ── Global Shell Padding & Breakpoints ── */
@media (max-width: 1240px) {
    .shell { width: min(calc(100% - 32px), 1200px); }
}

@media (max-width: 980px) {
    /* Header & Navigation */
    .nav-wrap { position: relative; min-height: 68px; }
    .mobile-nav-button { display: inline-flex; align-items: center; justify-content: center; z-index: 101; }
    
    .main-nav {
        position: absolute;
        top: 74px;
        right: 16px;
        display: none;
        width: min(300px, calc(100vw - 32px));
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 18px;
        background: rgba(17, 19, 28, 0.95);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border: 1px solid var(--border-hover);
        border-radius: var(--radius);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
        z-index: 99;
    }
    
    .main-nav.open { display: flex; animation: navDrawerIn 0.25s cubic-bezier(0.4, 0, 0.2, 1); }

    @keyframes navDrawerIn {
        from { opacity: 0; transform: translateY(-10px) scale(0.95); }
        to   { opacity: 1; transform: translateY(0) scale(1); }
    }

    .main-nav a { padding: 12px 18px; border-radius: 12px; width: 100%; text-align: left; }
    .main-nav a.nav-cta-btn { margin-left: 0; margin-top: 6px; justify-content: center; width: 100%; padding: 12px 18px; }
    
    .user-menu {
        padding-left: 12px;
        gap: 8px;
    }
    .user-name { max-width: 80px; }

    /* Hero Section */
    .hero { grid-template-columns: 1fr; gap: 20px; padding-top: 24px; overflow: hidden; }
    .hero-glow { display: none !important; }
    .hero-content { padding: 24px 20px; }
    .hero h1 { font-size: clamp(26px, 5vw, 38px); word-break: break-word; }

    /* Grids & Cards */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .section-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .dashboard-two-col { grid-template-columns: 1fr; gap: 20px; margin-top: 36px; }
    .result-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .badges-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }

    /* Split View Practice Questions */
    .det-split-layout { grid-template-columns: 1fr; gap: 20px; }
    .passage-box { max-height: 280px; overflow-y: auto; position: relative; top: 0; }
}

@media (max-width: 720px) {
    /* Header User Menu */
    .user-name { display: none; }
    .user-menu { border-left: none; padding-left: 0; }

    /* Buttons & Rows */
    .button-row { flex-direction: column; width: 100%; }
    .button-row .button { width: 100%; }
    .quick-actions { grid-template-columns: 1fr; }

    /* History Table Mobile Cards */
    .history-table, .history-table tbody, .history-table tr, .history-table td { display: block; width: 100%; }
    .history-table thead { display: none; }
    .history-table tr {
        padding: 16px;
        margin-bottom: 12px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: rgba(17, 19, 28, 0.75);
    }
    .history-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        padding: 8px 0;
        border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
        text-align: right;
    }
    .history-table td:last-child { border-bottom: none; }
    .history-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        text-align: left;
    }
    .action-cell { justify-content: flex-end; width: 100%; margin-top: 4px; }

    /* Result & Profile Header */
    .result-hero { flex-direction: column; text-align: center; gap: 20px; align-items: center; }
    .score-ring { margin: 0 auto; }
    .profile-hero { flex-direction: column; text-align: center; gap: 18px; padding: 28px 24px; }
    .profile-tags { justify-content: center; }
    .daily-card-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 580px) {
    .shell { width: min(calc(100% - 24px), 100%); }
    .page-shell { padding-bottom: 40px; }

    /* Single Column Grids for Small Phones */
    .stats-grid { grid-template-columns: 1fr; }
    .section-grid { grid-template-columns: 1fr; }
    .result-grid { grid-template-columns: 1fr; }
    .badges-grid { grid-template-columns: 1fr; }

    /* Audio & Word Option Grids */
    .det-audio-grid, .det-word-grid, .read-select-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }

    /* Cards & Containers */
    .hero-content, .hero-panel, .activity-card, .det-scale-card, .auth-required-card, .daily-challenge-card {
        padding: 22px 18px;
    }

    .daily-options { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

    .answer-comparison { grid-template-columns: 1fr; }

    .action-panel { flex-direction: column; width: 100%; gap: 12px; }
    .action-panel .button { width: 100%; }

    .footer-wrap { flex-direction: column; text-align: center; gap: 12px; }
}

/* ── Profile Hero & Details ── */
.profile-hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 36px 40px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(23, 18, 43, 0.85) 0%, rgba(14, 16, 26, 0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    margin-top: 40px;
}

.profile-avatar-large {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 800;
    font-size: 38px;
    box-shadow: 0 0 35px rgba(168, 85, 247, 0.5);
    flex-shrink: 0;
}

.profile-info h1 {
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin: 4px 0 6px;
}

.profile-email {
    color: var(--text-secondary);
    font-size: 0.98rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.profile-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.profile-tag.purple {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.3);
    color: var(--accent);
}

.badge-summary-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 50px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    font-weight: 700;
    font-size: 13px;
}

/* ── Milestone Achievement Badges ── */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.badge-card {
    display: flex;
    flex-direction: column;
    padding: 26px;
    border-radius: var(--radius);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.badge-card.unlocked {
    background: rgba(20, 23, 34, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: var(--shadow);
}

.badge-card.unlocked:hover {
    transform: translateY(-5px);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: var(--shadow-glow);
}

.badge-card.locked {
    background: rgba(17, 19, 28, 0.4);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    opacity: 0.65;
}

.badge-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.badge-icon-box {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 20px;
}

.badge-card.unlocked .badge-icon-box {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.4);
}

.badge-card.locked .badge-icon-box {
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    border: 1px solid var(--border);
}

.badge-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-status-pill.unlocked {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status-pill.locked {
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    border: 1px solid var(--border);
}

.badge-card h3 {
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.badge-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.badge-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12px;
}

.badge-category {
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge-progress {
    color: var(--muted);
    font-weight: 600;
}

/* ── Daily Challenge Card ── */
.daily-challenge-card {
    padding: 32px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(30, 24, 18, 0.85) 0%, rgba(17, 19, 28, 0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(245, 158, 11, 0.15);
}

.daily-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.daily-card-header h2 {
    font-size: clamp(22px, 3.5vw, 30px);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.eyebrow.amber {
    color: #fbbf24;
}

.daily-date-badge {
    padding: 6px 14px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.daily-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.daily-points-badge {
    padding: 4px 12px;
    border-radius: 50px;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.daily-question-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.6;
    margin-bottom: 22px;
}

.daily-input-wrap {
    width: 100%;
}

.daily-input {
    width: 100%;
    min-height: 50px;
    padding: 14px 20px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-hover);
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

.daily-input:focus {
    border-color: #fbbf24;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
}

.daily-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.daily-option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.daily-option-label:hover {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.4);
}

.daily-result-box {
    padding: 20px 24px;
    border-radius: var(--radius);
    margin-top: 14px;
}

.daily-result-box.correct {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.daily-result-box.incorrect {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.result-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.daily-result-box.correct .result-status { color: #34d399; }
.daily-result-box.incorrect .result-status { color: #f87171; }

.result-feedback { color: var(--text); font-size: 0.95rem; margin-bottom: 6px; }
.result-correct-key { color: var(--text-secondary); font-size: 0.9rem; }
.result-correct-key strong { color: #fff; }

/* ── Mobile Badges Toggle ── */
.show-more-wrap {
    display: none;
    margin-top: 20px;
    text-align: center;
}

.show-more-badges-btn {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

@media (max-width: 720px) {
    .show-more-wrap {
        display: block;
        margin-top: 16px;
    }
    
    .badges-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
        width: 100% !important;
    }

    .badge-card {
        width: 100% !important;
    }
    
    .badge-card.badge-hidden-mobile {
        display: none !important;
    }
    
    .badges-grid.expanded .badge-card.badge-hidden-mobile {
        display: flex !important;
        animation: fadeInBadge 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

@keyframes fadeInBadge {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Admin Control Panel ── */
.admin-hero {
    position: relative;
    padding: 36px 40px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(30, 20, 48, 0.9) 0%, rgba(14, 16, 26, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 35px rgba(245, 158, 11, 0.15);
    margin-top: 40px;
}

.admin-hero-content h1 {
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 800;
    color: #fff;
    margin: 4px 0 8px;
}

.admin-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 50px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    font-weight: 700;
    font-size: 13px;
    margin-top: 12px;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
    overflow-x: auto;
}

.admin-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.admin-tab-btn:hover {
    color: #fff;
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
}

.admin-tab-btn.active {
    background: var(--accent-gradient);
    color: #fff !important;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(168, 85, 247, 0.4);
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-filter-form {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.admin-filter-form select {
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-hover);
    color: #fff;
    outline: none;
}

.q-prompt-cell {
    max-width: 320px;
    white-space: normal !important;
    word-break: break-word;
}

.diff-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.diff-badge.easy { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.diff-badge.medium { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.diff-badge.hard { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 980px) {
    .analytics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 580px) {
    .analytics-grid { grid-template-columns: 1fr; }
}

/* ── Modal Dialog ── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 20px;
}

.modal-card {
    background: rgba(20, 23, 34, 0.95);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-lg);
    width: min(600px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
    animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 22px; font-weight: 800; color: #fff; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 28px; cursor: pointer; transition: color 0.2s; }
.modal-close:hover { color: #fff; }

.modal-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-hover);
    color: #fff;
    outline: none;
    font-size: 14px;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.3);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Custom Glassmorphic Scrollbars ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.25); }
::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.35); border-radius: 50px; }
::-webkit-scrollbar-thumb:hover { background: rgba(168, 85, 247, 0.65); }

/* ── Top Glow Accent Lines & Interactive Press States ── */
.admin-hero::before, .profile-hero::before, .daily-challenge-card::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.7), transparent);
    pointer-events: none;
}

.daily-challenge-card::before {
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.8), transparent);
}

.button:active, .admin-tab-btn:active, .delete-btn:active, .nav-cta-btn:active {
    transform: scale(0.97) !important;
}

.admin-table th { background: rgba(168, 85, 247, 0.08); }
.admin-table tr { transition: background 0.2s ease; }
.admin-table tr:hover td { background: rgba(168, 85, 247, 0.06); }

/* ── Result Photo Thumbnail Styling ── */
.result-photo-wrap {
    width: 100%;
    max-width: 440px;
    margin: 12px 0 16px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-hover);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.result-photo-img {
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: cover;
    display: block;
}

/* ─── Read, Then Speak Section (Duolingo DET Style) ─── */
.det-read-speak-container {
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.det-prep-top-bar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.det-prep-top-bar i {
    color: #38bdf8;
}

.det-read-speak-header {
    margin-bottom: 24px;
}

.det-read-speak-main-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-heading, #f8fafc);
    margin-bottom: 6px;
}

.det-read-speak-subtitle {
    font-size: 1rem;
    color: var(--text-muted, #94a3b8);
    margin: 0;
}

.det-read-speak-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 26px 30px;
    text-align: left;
    margin: 20px 0 28px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.det-read-speak-prompt-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-heading, #f8fafc);
    margin: 0 0 14px 0;
    line-height: 1.5;
}

.det-read-speak-bullets {
    margin: 0;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-body, #cbd5e1);
    font-size: 1rem;
    line-height: 1.6;
}

.det-read-speak-bullets li {
    font-weight: 500;
}

/* ─────────────────────────────────────────────
   DET SITE FOOTER (Responsive & Centered on Mobile)
───────────────────────────────────────────── */
.det-site-footer {
    background: rgba(9, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 30px 24px;
    font-family: 'Poppins', sans-serif;
    margin-top: 40px;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5);
}

.det-footer-container {
    max-width: 1200px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.det-footer-brand {
    flex: 1;
    min-width: 220px;
}

.det-footer-logo {
    color: #bb86fc;
    font-size: 1.4rem;
    font-weight: 800;
    text-shadow: 0 0 15px rgba(187, 134, 252, 0.5);
}

.det-footer-sub {
    color: #9e9e9e;
    font-size: 0.82rem;
    margin-top: 3px;
}

.det-footer-center {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.det-footer-links {
    display: flex;
    justify-content: center;
    gap: 22px;
    flex-wrap: wrap;
}

.det-footer-links a {
    color: #cfcfcf;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.det-footer-links a:hover {
    color: #bb86fc;
}

.det-footer-copy {
    color: #777;
    font-size: 0.82rem;
    text-align: center;
}

.det-footer-copy a {
    color: #bb86fc;
    text-decoration: none;
    font-weight: 600;
}

.det-footer-social {
    flex: 1;
    min-width: 220px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.det-footer-social a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(187, 134, 252, 0.08);
    border: 1px solid rgba(187, 134, 252, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bb86fc;
    text-decoration: none;
    transition: all 0.3s ease;
}

.det-footer-social a:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 18px rgba(187, 134, 252, 0.6);
    background: rgba(187, 134, 252, 0.18);
}

@media (max-width: 768px) {
    .det-footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .det-footer-brand {
        text-align: center;
        width: 100%;
    }

    .det-footer-center {
        width: 100%;
    }

    .det-footer-social {
        justify-content: center;
        width: 100%;
    }
}

