/* ==========================================================================
   TalkVance AI Pronunciation Coach - Unified Design System & Palette
   ========================================================================== */

:root {
    /* User Specified Brand Palette:
       blue:       #3cb1f5
       black-ish:  #22092B
       White-ish:  #EFFAFC
       Black (text in light theme): #1B0D21
       blue-light (text in dark theme): #84CAF0
    */
    --brand-blue: #3cb1f5;
    --brand-black-ish: #22092B;
    --brand-white-ish: #EFFAFC;
    --brand-text-light: #1B0D21;
    --brand-text-dark: #84CAF0;

    /* Default Theme: LIGHT */
    --bg-dark: #EFFAFC;
    --card-bg: #FFFFFF;
    --card-border: rgba(27, 13, 33, 0.08);
    --card-hover-border: rgba(60, 177, 245, 0.5);

    --text-primary: #1B0D21;
    --text-secondary: #4A3552;
    --text-muted: #735D7B;

    --accent-primary: #3cb1f5;
    --accent-secondary: #2196e3;
    --accent-cyan: #3cb1f5;
    --accent-hover: #1e9be0;
    --accent-glow: rgba(60, 177, 245, 0.25);

    --score-good: #10B981;
    --score-good-bg: rgba(16, 185, 129, 0.12);
    --score-ok: #F59E0B;
    --score-ok-bg: rgba(245, 158, 11, 0.12);
    --score-bad: #EF4444;
    --score-bad-bg: rgba(239, 68, 68, 0.12);

    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --shadow-card: 0 8px 30px -8px rgba(27, 13, 33, 0.08), 0 2px 6px -1px rgba(27, 13, 33, 0.04);
    --shadow-glow: 0 0 35px rgba(60, 177, 245, 0.18);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition-fast: 0.18s ease;
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-dark: #EFFAFC;
    --card-bg: #FFFFFF;
    --card-border: rgba(27, 13, 33, 0.08);
    --card-hover-border: rgba(60, 177, 245, 0.5);

    --text-primary: #1B0D21;
    --text-secondary: #4A3552;
    --text-muted: #735D7B;

    --accent-primary: #3cb1f5;
    --accent-secondary: #2196e3;
    --accent-cyan: #3cb1f5;
    --accent-hover: #1e9be0;
    --accent-glow: rgba(60, 177, 245, 0.25);

    --shadow-card: 0 8px 30px -8px rgba(27, 13, 33, 0.08), 0 2px 6px -1px rgba(27, 13, 33, 0.04);
    --shadow-glow: 0 0 35px rgba(60, 177, 245, 0.18);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-dark: #22092B;
    --card-bg: rgba(28, 7, 36, 0.9);
    --card-border: rgba(60, 177, 245, 0.2);
    --card-hover-border: rgba(60, 177, 245, 0.6);

    --text-primary: #84CAF0;
    --text-secondary: #6DAECF;
    --text-muted: #568FA9;

    --accent-primary: #3cb1f5;
    --accent-secondary: #58c0fb;
    --accent-cyan: #84CAF0;
    --accent-hover: #6cd1fc;
    --accent-glow: rgba(60, 177, 245, 0.35);

    --shadow-card: 0 20px 45px -15px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 35px rgba(60, 177, 245, 0.3);
}

/* Light Theme Element Overrides */
[data-theme="light"] body {
    background-color: #EFFAFC;
    color: #1B0D21;
}

[data-theme="light"] .brand-name,
[data-theme="light"] .brand-title,
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] .stat-value,
[data-theme="light"] .phonics-title,
[data-theme="light"] .story-title,
[data-theme="light"] .framework-title,
[data-theme="light"] .modal-title,
[data-theme="light"] .creator-title,
[data-theme="light"] .step-content strong,
[data-theme="light"] .metric-name,
[data-theme="light"] .deck-title-group h4,
[data-theme="light"] .cadence-title,
[data-theme="light"] .track-label strong,
[data-theme="light"] .sheet-title {
    color: #1B0D21 !important;
}

[data-theme="light"] .control-btn {
    background: #FFFFFF;
    border-color: rgba(27, 13, 33, 0.12);
    color: #1B0D21;
    box-shadow: 0 2px 8px rgba(27, 13, 33, 0.04);
}

[data-theme="light"] .control-btn:hover {
    background: #FFFFFF;
    border-color: #3cb1f5;
    color: #3cb1f5;
    box-shadow: 0 4px 12px rgba(60, 177, 245, 0.15);
}

[data-theme="light"] .action-btn {
    background: #FFFFFF;
    border-color: rgba(27, 13, 33, 0.14);
    color: #1B0D21;
    box-shadow: 0 2px 6px rgba(27, 13, 33, 0.04);
}

[data-theme="light"] .action-btn:hover:not(.disabled) {
    background: #FFFFFF;
    border-color: #3cb1f5;
    color: #3cb1f5;
}

[data-theme="light"] .text-canvas {
    background: #FFFFFF;
    border-color: rgba(27, 13, 33, 0.08);
    box-shadow: var(--shadow-card);
}

[data-theme="light"] .target-sentence {
    color: #1B0D21;
}

[data-theme="light"] .ipa-container {
    background: rgba(60, 177, 245, 0.06);
    border-color: rgba(60, 177, 245, 0.2);
}

[data-theme="light"] .ipa-text {
    color: #2196e3;
}

[data-theme="light"] .google-trans-bar {
    background: #FAFCFE;
    border-color: rgba(27, 13, 33, 0.08);
}

[data-theme="light"] .trans-heading {
    color: #1B0D21;
}

[data-theme="light"] .translation-text {
    color: #2D1A35;
}

[data-theme="light"] .trans-lang-select {
    background: #FFFFFF;
    color: #1B0D21;
    border-color: rgba(27, 13, 33, 0.15);
}

[data-theme="light"] .trans-mini-btn {
    background: rgba(27, 13, 33, 0.05);
    border-color: rgba(27, 13, 33, 0.1);
    color: #4A3552;
}

[data-theme="light"] .trans-mini-btn:hover {
    background: rgba(60, 177, 245, 0.12);
    color: #3cb1f5;
}

[data-theme="light"] .word-inspector {
    background: #FAFCFE;
    border-color: rgba(27, 13, 33, 0.08);
}

[data-theme="light"] .inspector-prompt {
    color: #735D7B;
}

[data-theme="light"] .inspect-val {
    color: #1B0D21;
}

[data-theme="light"] .inspect-audio-btn {
    background: #FFFFFF;
    border-color: rgba(27, 13, 33, 0.12);
    color: #1B0D21;
}

[data-theme="light"] .waveform-container {
    background: rgba(60, 177, 245, 0.06);
    border-color: rgba(60, 177, 245, 0.2);
}

[data-theme="light"] .diff-btn {
    background: rgba(27, 13, 33, 0.04);
    border-color: rgba(27, 13, 33, 0.08);
    color: #4A3552;
}

[data-theme="light"] .diff-btn.active {
    background: var(--accent-primary);
    color: #FFFFFF !important;
}

[data-theme="light"] .mode-switcher-bar {
    background: rgba(60, 177, 245, 0.06);
    border-color: rgba(27, 13, 33, 0.08);
}

[data-theme="light"] .mode-tab-btn {
    color: #735D7B;
}

[data-theme="light"] .mode-tab-btn.active {
    background: #FFFFFF;
    color: #3cb1f5;
    box-shadow: 0 2px 8px rgba(27, 13, 33, 0.06);
}

[data-theme="light"] .shadow-top-strip,
[data-theme="light"] .track-card,
[data-theme="light"] .cadence-diagnostic-box {
    background: #FAFCFE;
    border-color: rgba(27, 13, 33, 0.08);
}

[data-theme="light"] .modal-dialog {
    background: #FFFFFF !important;
    border-color: rgba(27, 13, 33, 0.12) !important;
    box-shadow: 0 25px 60px rgba(27, 13, 33, 0.18) !important;
}

[data-theme="light"] .modal-creator-card,
[data-theme="light"] .step-card {
    background: rgba(60, 177, 245, 0.05);
    border-color: rgba(27, 13, 33, 0.08);
}

[data-theme="light"] .dropdown-menu {
    background: #FFFFFF !important;
    border-color: rgba(60, 177, 245, 0.35) !important;
    box-shadow: 0 15px 40px rgba(27, 13, 33, 0.15) !important;
}

[data-theme="light"] .dropdown-item {
    color: #1B0D21 !important;
    background: transparent !important;
}

[data-theme="light"] .dropdown-item:hover {
    background: rgba(60, 177, 245, 0.1) !important;
    color: #3cb1f5 !important;
}

[data-theme="light"] .dropdown-item.active {
    background: rgba(60, 177, 245, 0.18) !important;
    color: #2196e3 !important;
}

/* Dark Theme Overrides for Titles & Headings */
[data-theme="dark"] body {
    background-color: #22092B;
    color: #84CAF0;
}

[data-theme="dark"] .brand-name,
[data-theme="dark"] .brand-title,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] .stat-value,
[data-theme="dark"] .phonics-title,
[data-theme="dark"] .story-title,
[data-theme="dark"] .framework-title,
[data-theme="dark"] .modal-title,
[data-theme="dark"] .creator-title,
[data-theme="dark"] .step-content strong,
[data-theme="dark"] .metric-name,
[data-theme="dark"] .target-sentence,
[data-theme="dark"] .sheet-title {
    color: #E2F4FD !important;
}

[data-theme="dark"] .dropdown-menu {
    background: #180620 !important;
    border-color: rgba(60, 177, 245, 0.4) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] .dropdown-item {
    color: #84CAF0 !important;
}

[data-theme="dark"] .dropdown-item:hover {
    background: rgba(60, 177, 245, 0.15) !important;
    color: #FFFFFF !important;
}

[data-theme="dark"] .dropdown-item.active {
    background: rgba(60, 177, 245, 0.25) !important;
    color: #FFFFFF !important;
}

[data-theme="light"] .app-footer {
    border-top-color: rgba(27, 13, 33, 0.08);
    color: #735D7B;
}

[data-theme="light"] .footer-link {
    color: #2196e3;
}


/* Reset & Basics */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Glowing Ambient Orbs */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
}

.bg-glow-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
    top: -100px;
    left: -100px;
}

.bg-glow-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, transparent 70%);
    bottom: -150px;
    right: -150px;
}

/* Layout */
.app-layout {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 24px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Header */
.app-header {
    width: 100%;
    padding: 10px 0 4px;
    position: relative;
    z-index: 100;
}

.navbar-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.brand-link,
.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.brand-info,
.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name,
.brand-title {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.1;
}

.brand-blue {
    color: var(--accent-primary);
}

.gradient-text {
    color: var(--accent-primary);
    background: linear-gradient(135deg, #3cb1f5, #2196e3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subline,
.brand-tagline {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

/* Enlarged & Polished Logo Badge */
.logo-badge {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(60, 177, 245, 0.25);
    overflow: hidden;
    padding: 2px;
    border: 2px solid var(--accent-primary);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.logo-badge:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(60, 177, 245, 0.45);
}

.app-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 11px;
    display: block;
}

/* Modal Logo Wrap */
.modal-logo-wrap {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: #FFFFFF;
    border: 2px solid var(--accent-primary);
    box-shadow: 0 4px 18px rgba(60, 177, 245, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    flex-shrink: 0;
    overflow: hidden;
}

.modal-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* Creator & Credit Links */
.creator-link,
.credit-link,
.footer-credit a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border-bottom: 1px dashed rgba(60, 177, 245, 0.5);
}

.creator-link:hover,
.credit-link:hover,
.footer-credit a:hover {
    color: var(--accent-hover);
    border-bottom-style: solid;
    text-shadow: 0 0 10px rgba(60, 177, 245, 0.4);
}

/* Center Master Navbar (Desktop) */
.main-navbar {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-full);
    padding: 4px 6px;
    box-shadow: 0 4px 18px -4px rgba(27, 13, 33, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: var(--radius-full);
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
    font-family: inherit;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(60, 177, 245, 0.08);
}

.nav-tab.active {
    color: #FFFFFF !important;
    background: var(--accent-primary) !important;
    box-shadow: 0 2px 10px rgba(60, 177, 245, 0.4);
}

.nav-symbol {
    font-size: 1rem;
    line-height: 1;
}

/* Practice Arena - Hero Anchor in the Middle */
.nav-tab-arena {
    padding: 7px 16px;
    background: rgba(60, 177, 245, 0.12);
    border: 1.5px solid rgba(60, 177, 245, 0.35);
    color: var(--accent-primary);
    font-weight: 700;
}

.nav-tab-arena:hover {
    background: rgba(60, 177, 245, 0.22);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.nav-tab-arena.active {
    background: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 16px rgba(60, 177, 245, 0.5);
}

.arena-mic-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    line-height: 1;
}

.nav-badge-soon {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.35);
    letter-spacing: 0.04em;
    margin-left: 2px;
}

/* Header Right Actions */
.header-actions,
.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Theme Switch Button */
.theme-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #FFFFFF;
    border: 1.5px solid rgba(27, 13, 33, 0.12);
    border-radius: var(--radius-full);
    padding: 4px 12px 4px 4px;
    cursor: pointer;
    color: #1B0D21;
    font-size: 0.84rem;
    font-weight: 700;
    font-family: inherit;
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: 0 2px 8px rgba(27, 13, 33, 0.05);
}

[data-theme="dark"] .theme-switch-btn {
    background: #180620;
    border: 1.5px solid rgba(60, 177, 245, 0.3);
    color: #84CAF0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.theme-switch-btn:hover {
    transform: translateY(-1px);
    border-color: #3cb1f5;
}

.switch-track {
    position: relative;
    width: 42px;
    height: 22px;
    background: #E0F2FA;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    border: 1px solid rgba(60, 177, 245, 0.3);
    transition: all 0.25s ease;
}

[data-theme="dark"] .switch-track {
    background: #0E0312;
    border-color: rgba(60, 177, 245, 0.4);
}

.switch-icon {
    font-size: 11px;
    line-height: 1;
    z-index: 1;
    user-select: none;
    opacity: 0.7;
}

.switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #3cb1f5;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s ease;
}

[data-theme="dark"] .switch-thumb {
    transform: translateX(20px);
    background: #84CAF0;
}

/* Control Buttons & Icons */
.control-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(60, 177, 245, 0.08);
    border-color: rgba(60, 177, 245, 0.3);
}

.icon-only-btn {
    padding: 9px;
    border-radius: 50%;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 900px) {
    .main-navbar {
        display: none !important;
    }

    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 64px !important;
        background: var(--card-bg) !important;
        border-top: 1px solid var(--card-border) !important;
        box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.12) !important;
        z-index: 998 !important;
        align-items: center !important;
        justify-content: space-around !important;
        padding: 0 6px calc(env(safe-area-inset-bottom, 0px) + 2px) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
    }

    .mobile-nav-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        text-decoration: none;
        color: var(--text-secondary);
        background: none;
        border: none;
        padding: 4px 6px;
        cursor: pointer;
        position: relative;
        flex: 1;
        min-width: 0;
        transition: transform 0.15s ease, color 0.15s ease;
    }

    .mobile-nav-icon {
        font-size: 1.25rem;
        line-height: 1;
    }

    .mobile-nav-text {
        font-size: 0.68rem;
        font-weight: 600;
        letter-spacing: -0.02em;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }

    .mobile-nav-tab.active {
        color: var(--accent-primary) !important;
    }

    .mobile-nav-tab.active .mobile-nav-icon {
        transform: scale(1.18);
    }

    /* Middle Hero Arena Button on Mobile */
    .mobile-nav-arena {
        position: relative;
        top: -12px;
    }

    .mobile-mic-circle {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: linear-gradient(135deg, #3cb1f5, #2196e3);
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 18px rgba(60, 177, 245, 0.5);
        border: 3px solid var(--bg-dark);
        transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .mobile-mic-icon {
        font-size: 1.45rem;
        line-height: 1;
    }

    .mobile-nav-arena:active .mobile-mic-circle {
        transform: scale(0.92);
    }

    .mobile-dot-soon {
        position: absolute;
        top: 4px;
        right: 14px;
        width: 7px;
        height: 7px;
        background: #f59e0b;
        border-radius: 50%;
        border: 1px solid var(--bg-dark);
    }

    /* Prevent mobile content from getting hidden under bottom nav bar */
    .app-layout {
        padding-bottom: 90px !important;
    }

    /* Keep language button safely above mobile bottom bar */
    .bottom-language-dock {
        bottom: 74px !important;
        right: 16px !important;
    }
}

/* ==========================================================================
   Bottom Floating Language Dock & Dropup Menu (High Contrast)
   ========================================================================== */
.bottom-language-dock {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 990;
}

.bottom-floating-lang-btn {
    background: #FFFFFF;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid #3cb1f5;
    box-shadow: 0 8px 24px rgba(27, 13, 33, 0.15), 0 0 0 1px rgba(60, 177, 245, 0.35);
    padding: 10px 18px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1B0D21;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

[data-theme="dark"] .bottom-floating-lang-btn {
    background: #180620;
    border: 2px solid #3cb1f5;
    color: #84CAF0;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.65), 0 0 18px rgba(60, 177, 245, 0.35);
}

.bottom-floating-lang-btn:hover {
    transform: translateY(-2px) scale(1.03);
    border-color: #3cb1f5;
    box-shadow: 0 10px 30px rgba(60, 177, 245, 0.4);
}

.bottom-floating-lang-btn .chevron-icon {
    color: #3cb1f5;
    stroke-width: 2.5;
}

.globe-prefix-icon {
    font-size: 1.05rem;
}

.language-dropdown-wrapper {
    position: relative;
}

.chevron-icon {
    transition: transform 0.2s;
}

.dropup-menu {
    top: auto !important;
    bottom: calc(100% + 12px) !important;
    right: 0 !important;
    left: auto !important;
    transform-origin: bottom right;
}

/* Mobile Bottom Sheet Elements */
.dropdown-backdrop {
    display: none;
}

.sheet-handle-bar {
    display: none;
}

.sheet-title-row {
    display: none;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--card-bg);
    border: 1.5px solid rgba(60, 177, 245, 0.35);
    border-radius: var(--radius-md);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    min-width: 230px;
    padding: 8px;
    z-index: 100;
    display: none;
    flex-direction: column;
    gap: 4px;
}

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

.dropdown-item {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.15s;
}

.dropdown-item:hover {
    background: rgba(60, 177, 245, 0.1);
    color: #3cb1f5;
}

.dropdown-item.active {
    background: rgba(60, 177, 245, 0.2);
    color: #2196e3;
    font-weight: 700;
}

.check-mark {
    color: var(--accent-primary);
    font-weight: bold;
}

/* Compact Popups (IELTS & Private Course) */
.compact-modal {
    max-width: 500px !important;
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon-badge {
    font-size: 1.7rem;
    line-height: 1;
}

.modal-subheading {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.badge-soon-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-top: 2px;
}

.modest-desc {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.ielts-features-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.ielts-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.86rem;
    color: var(--text-secondary);
    background: rgba(60, 177, 245, 0.05);
    border: 1px solid var(--card-border);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
}

.contact-card {
    background: rgba(60, 177, 245, 0.06);
    border: 1px solid rgba(60, 177, 245, 0.25);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-top: 10px;
}

.contact-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.contact-email-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.contact-email-val {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.copy-email-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-full);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

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

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.2s;
}

.stat-card:hover {
    border-color: var(--card-hover-border);
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value-group {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 6px;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: white;
}

.highlight-score {
    color: var(--accent-cyan);
}

.stat-unit {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.difficulty-card {
    justify-content: space-between;
}

.difficulty-pills {
    display: flex;
    background: rgba(0, 0, 0, 0.25);
    padding: 3px;
    border-radius: var(--radius-full);
    margin-top: 6px;
    gap: 2px;
}

.diff-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 0;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s;
}

.diff-btn:hover {
    color: var(--text-primary);
}

.diff-btn.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

/* Practice Card */
.practice-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 32px;
    position: relative;
}

.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 20px;
    flex-wrap: wrap;
    gap: 14px;
}

.practice-badge {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #A5B4FC;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.practice-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 9px 16px;
    border-radius: var(--radius-md);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.action-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.action-btn.next-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.action-btn.next-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

/* Text Canvas */
.text-canvas {
    text-align: center;
    padding: 16px 0 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.prompt-instruction {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.target-sentence {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: white;
    max-width: 850px;
    outline: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    user-select: text;
}

.target-sentence:focus {
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}

/* Phonetic Word Badges */
.word-badge {
    display: inline-block;
    padding: 2px 6px;
    margin: 2px 3px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s ease;
    border-bottom: 2px solid transparent;
}

.word-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.word-badge.good {
    background: var(--score-good-bg);
    border-color: var(--score-good);
}

.word-badge.ok {
    background: var(--score-ok-bg);
    border-color: var(--score-ok);
}

.word-badge.bad {
    background: var(--score-bad-bg);
    border-color: var(--score-bad);
}

/* Letter accuracy spans */
.letter-correct {
    color: #34D399;
}

.letter-incorrect {
    color: #F87171;
    font-weight: 800;
    text-decoration: underline;
}

/* IPA Container */
.ipa-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ipa-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ipa-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.ipa-text {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 500;
    color: #CBD5E1;
}

.user-ipa .ipa-text {
    color: var(--accent-cyan);
}

/* Google Translate Bar Widget */
.google-trans-bar {
    width: 100%;
    max-width: 850px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    backdrop-filter: blur(12px);
    transition: border-color var(--transition-fast);
}

.google-trans-bar:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.trans-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.trans-label-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.g-icon {
    font-size: 1rem;
}

.trans-heading {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-cyan);
}

.trans-controls-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trans-to-text {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.trans-lang-select {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-family: inherit;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.trans-lang-select:focus, .trans-lang-select:hover {
    border-color: var(--accent-primary);
}

.trans-mini-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.trans-mini-btn:hover {
    color: white;
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.trans-output-wrap {
    padding-top: 4px;
}

.translation-text {
    font-size: 1rem;
    color: #e2e8f0;
    font-weight: 500;
    line-height: 1.4;
}

.nav-link-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-cyan);
    border-color: rgba(56, 189, 248, 0.3);
}

.nav-link-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    color: white;
}

/* Word Inspector */
.word-inspector {
    background: rgba(13, 19, 33, 0.6);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    transition: all 0.2s;
}

.inspector-prompt {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.inspector-details {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.inspector-word-pair {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.badge-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.inspect-val {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.inspector-divider {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-muted);
}

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

.inspect-audio-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    color: white;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.inspect-audio-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--accent-primary);
}

/* Record Station */
.record-station {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-top: 10px;
}

.waveform-container {
    width: 100%;
    max-width: 500px;
    height: 50px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.waveform-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.recording-timer {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: #F87171;
    background: rgba(239, 68, 68, 0.15);
    padding: 3px 8px;
    border-radius: 4px;
}

.record-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.mic-main-btn {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.mic-main-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 14px 35px rgba(99, 102, 241, 0.55);
}

.mic-main-btn:active {
    transform: scale(0.96);
}

.mic-main-btn.recording {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.7);
    animation: pulse-ring 1.8s infinite;
}

.mic-icon, .stop-icon {
    width: 34px;
    height: 34px;
    position: relative;
    z-index: 2;
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    }
    70% {
        box-shadow: 0 0 0 22px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.record-status-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Footer */
.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
    font-size: 0.82rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 10px;
}

.footer-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.82rem;
    text-decoration: none;
    transition: color 0.15s;
}

.footer-link:hover {
    color: white;
}

.sep {
    margin: 0 4px;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal-dialog {
    background: #111827;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    max-width: 620px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: modal-enter 0.25s ease-out;
}

@keyframes modal-enter {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.modal-icon {
    font-size: 1.8rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
}

.modal-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover {
    color: white;
}

.modal-body {
    padding: 24px 28px;
    font-size: 0.92rem;
    color: #D1D5DB;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 65vh;
    overflow-y: auto;
}

.scholar-badge {
    background: rgba(99, 102, 241, 0.15);
    border-left: 3px solid var(--accent-primary);
    padding: 8px 14px;
    border-radius: 4px;
    font-weight: 600;
    color: #C7D2FE;
    font-size: 0.82rem;
}

.modal-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.feature-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.step-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.step-num {
    background: var(--accent-primary);
    color: white;
    font-weight: 800;
    font-size: 0.8rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-content strong {
    color: white;
    font-size: 0.88rem;
}

.step-content p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.modal-creator-card {
    display: flex;
    gap: 18px;
    align-items: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(56, 189, 248, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.modal-logo-img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: #ffffff;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.modal-creator-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.creator-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.creator-attribution {
    font-size: 0.92rem;
    color: var(--accent-cyan);
}

.creator-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.reference-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
    padding-top: 4px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.footer-credit {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.footer-credit strong {
    color: var(--text-secondary);
}

.modal-attribution {
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 12px;
}

.modal-footer {
    padding: 16px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
}

/* Helpers */
.hidden {
    display: none !important;
}

/* ==========================================================================
   Practice Mode Switcher Tabs
   ========================================================================== */
.mode-switcher-bar {
    display: flex;
    gap: 10px;
    padding: 0 4px 14px 4px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 16px;
}

.mode-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.18);
}

.mode-tab-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.mode-pill-pro {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: rgba(56, 189, 248, 0.25);
    color: #38bdf8;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.mode-tab-btn.active .mode-pill-pro {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.playing-pulse {
    animation: pulse-border 1.2s infinite alternate !important;
    border-color: var(--accent-cyan) !important;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 4px rgba(56, 189, 248, 0.4); }
    100% { box-shadow: 0 0 16px rgba(56, 189, 248, 0.85); }
}

/* ==========================================================================
   Shadowing Studio Styles
   ========================================================================== */
.shadowing-view {
    margin-top: 18px;
    animation: fadeIn 0.3s ease;
}

.shadowing-card-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.shadow-top-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 18px;
}

.shadow-mode-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.shadow-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-cyan);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.shadow-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.shadow-speed-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.speed-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.shadow-speed-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.shadow-speed-btn.active {
    background: var(--accent-primary);
    color: #ffffff;
    border-color: var(--accent-primary);
}

/* Guided Flow Station */
.shadow-flow-station {
    position: relative;
    background: rgba(17, 24, 39, 0.7);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.countdown-overlay {
    position: absolute;
    inset: 0;
    background: rgba(9, 13, 22, 0.94);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    animation: fadeIn 0.2s ease;
}

.countdown-digit {
    font-size: 5rem;
    font-weight: 900;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    line-height: 1;
    text-shadow: 0 0 35px rgba(56, 189, 248, 0.8);
    animation: popNumber 0.8s ease;
}

@keyframes popNumber {
    0% { transform: scale(0.6); opacity: 0; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.countdown-caption {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 10px;
}

/* Banner States */
.shadow-banner {
    width: 100%;
    max-width: 620px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    text-align: left;
    transition: all 0.3s ease;
}

.shadow-banner.status-ready {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.08);
}

.shadow-banner.status-listening {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.12);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
}

.shadow-banner.status-recording {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.12);
    box-shadow: 0 0 24px rgba(239, 68, 68, 0.2);
    animation: pulseRecording 1.5s infinite alternate;
}

@keyframes pulseRecording {
    0% { border-color: rgba(239, 68, 68, 0.4); }
    100% { border-color: rgba(239, 68, 68, 0.8); }
}

.shadow-banner.status-finished {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.12);
}

.banner-icon-col {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.banner-step-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.banner-step-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.shadow-action-row {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.shadow-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
    transition: all 0.2s ease;
}

.shadow-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.55);
}

.shadow-btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    background: #ef4444;
    color: white;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.4);
    transition: all 0.2s ease;
}

.shadow-btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* ==========================================================================
   A/B Comparison Deck
   ========================================================================== */
.shadow-deck {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.3s ease;
}

.deck-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.deck-title-group h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.deck-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cadence-score-chip {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.cadence-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.cadence-number {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent-cyan);
}

.compare-tracks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 640px) {
    .compare-tracks-grid {
        grid-template-columns: 1fr;
    }
}

.track-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.track-card.native-track {
    border-left: 3px solid var(--accent-cyan);
}

.track-card.learner-track {
    border-left: 3px solid var(--accent-primary);
}

.track-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.track-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.track-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.track-dot.native { background: var(--accent-cyan); }
.track-dot.learner { background: var(--accent-primary); }

.track-time {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.track-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.track-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s ease;
}

.track-play-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: scale(1.02);
}

.track-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.track-fill {
    height: 100%;
    width: 0%;
    transition: width 0.1s linear;
}

.track-fill.native { background: var(--accent-cyan); }
.track-fill.learner { background: var(--accent-primary); }

.deck-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.deck-action-btn {
    flex: 1;
    min-width: 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sync-btn {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--accent-cyan);
}

.sync-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    transform: translateY(-1px);
}

.whisper-btn {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
}

.whisper-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
}

.cadence-diagnostic-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.diag-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.diag-content strong {
    font-size: 0.88rem;
    color: var(--text-primary);
    display: block;
}

.diag-content p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 3px;
    line-height: 1.4;
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive Optimizations (Phones & Tablets)
   ========================================================================== */

/* Universal Mobile Enhancements */
* {
    -webkit-tap-highlight-color: transparent;
}

button, a, select, input {
    touch-action: manipulation;
}

/* Tablet & Mobile Screens (<= 768px) */
@media (max-width: 768px) {
    .app-layout {
        padding: 14px 14px 32px;
        gap: 18px;
    }

    /* Header & Navigation on Mobile & Tablets */
    .app-header {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 4px 0 10px;
    }

    .app-header-top-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 10px;
    }

    .brand-section {
        justify-content: flex-start;
        flex: 1;
        min-width: 0;
    }

    .brand-title {
        font-size: 1.35rem;
    }

    .brand-tagline {
        font-size: 0.72rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-top-row {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    .header-controls {
        display: contents;
    }

    .header-nav-scroll {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        overflow-x: auto;
        padding: 2px 2px 6px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .header-nav-scroll::-webkit-scrollbar {
        display: none;
    }

    .control-btn {
        padding: 8px 14px;
        font-size: 0.82rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .lang-btn {
        padding: 8px 12px;
        font-size: 0.82rem;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 12px 14px;
    }

    .stat-value {
        font-size: 1.55rem;
    }

    .difficulty-pills {
        gap: 4px;
        width: 100%;
    }

    .diff-btn {
        flex: 1;
        padding: 5px 0;
        font-size: 0.74rem;
        text-align: center;
    }

    /* Target Sentence & Canvas */
    .target-sentence {
        font-size: clamp(1.25rem, 4.8vw, 1.7rem);
        line-height: 1.35;
        padding: 6px 8px;
    }

    .ipa-sentence {
        font-size: clamp(0.95rem, 3.8vw, 1.2rem);
    }

    .text-canvas {
        padding: 10px 0 4px;
        gap: 14px;
    }

    .practice-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding-bottom: 14px;
    }

    .practice-actions {
        display: flex;
        width: 100%;
        gap: 8px;
    }

    .practice-actions .action-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 0.82rem;
    }

    /* Recording Zone */
    .mic-main-btn {
        width: 74px;
        height: 74px;
    }

    .mic-icon, .stop-icon {
        width: 30px;
        height: 30px;
    }

    .waveform-container {
        width: 100%;
        height: 52px;
    }

    /* Playback & Audio Controls */
    .audio-playback-row {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .btn-play-rec {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
    }

    /* Translation Card */
    .translation-card {
        padding: 12px 14px;
    }

    .trans-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .trans-controls-wrap {
        width: 100%;
        justify-content: space-between;
    }

    .trans-lang-select {
        flex: 1;
        max-width: 160px;
    }

    /* Word Inspector */
    .word-breakdown-container {
        gap: 6px;
        padding: 8px 0;
    }

    .word-chip {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .word-chip-ipa {
        font-size: 0.72rem;
    }

    .inspector-card {
        padding: 14px;
    }

    .inspector-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Phonics Soundboard Grid */
    .phonics-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
        gap: 10px !important;
    }

    .phoneme-card {
        padding: 12px 10px !important;
    }

    .phoneme-symbol {
        font-size: 1.5rem !important;
    }

    .phonics-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .phonics-search-input {
        width: 100% !important;
    }

    .filter-btn-group {
        overflow-x: auto;
        white-space: nowrap;
        width: 100%;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }

    /* Story Shadowing Studio */
    .story-hero-section {
        padding: 16px 12px;
    }

    .story-title {
        font-size: 1.35rem;
    }

    .story-selector-bar {
        overflow-x: auto;
        white-space: nowrap;
        width: 100%;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .deck-action-btn {
        min-width: 100% !important;
    }

    /* Communication Frameworks */
    .framework-nav-bar {
        overflow-x: auto;
        white-space: nowrap;
        width: 100%;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .fw-step-card {
        padding: 12px;
    }

    /* Modal Dialog on Mobile */
    .modal-dialog {
        margin: 10px;
        max-height: 90vh;
        border-radius: var(--radius-md);
    }

    .modal-header, .modal-body {
        padding: 16px 18px;
    }
}

/* Small Smartphone Screens (<= 480px) */
@media (max-width: 480px) {
    .app-layout {
        padding: 10px 10px 24px;
        gap: 14px;
    }

    .brand-title {
        font-size: 1.22rem;
    }

    .logo-badge {
        width: 40px;
        height: 40px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-label {
        font-size: 0.68rem;
    }

    .stat-value {
        font-size: 1.35rem;
    }

    .target-sentence {
        font-size: 1.25rem;
    }

    .mic-main-btn {
        width: 68px;
        height: 68px;
    }

    .phonics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .app-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }
}

/* Mobile Language Bottom Action Sheet (<= 640px) */
@media (max-width: 640px) {
    .dropdown-backdrop {
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0, 0, 0, 0.75) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        z-index: 99998 !important;
        display: none;
        opacity: 0;
        transition: opacity 0.25s ease;
    }

    .dropdown-backdrop.show {
        display: block !important;
        opacity: 1 !important;
    }

    .dropdown-menu {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100vw !important;
        background: var(--card-bg) !important;
        border: 1.5px solid var(--accent-primary) !important;
        border-bottom: none !important;
        border-radius: 26px 26px 0 0 !important;
        padding: 14px 18px 36px !important;
        box-shadow: 0 -15px 50px rgba(0, 0, 0, 0.5) !important;
        z-index: 99999 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        transform: translateY(100%);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
        pointer-events: none;
        visibility: hidden;
    }

    .dropdown-menu.show {
        transform: translateY(0) !important;
        pointer-events: auto !important;
        visibility: visible !important;
    }

    .sheet-handle-bar {
        display: block !important;
        width: 44px;
        height: 4px;
        background: var(--card-border) !important;
        border-radius: 2px;
        margin: 2px auto 14px;
    }

    .sheet-title-row {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--card-border);
        margin-bottom: 6px;
    }

    .sheet-title {
        font-size: 1rem;
        font-weight: 700;
        color: var(--text-primary);
        letter-spacing: -0.01em;
    }

    .sheet-close-btn {
        background: rgba(60, 177, 245, 0.1);
        border: none;
        color: var(--text-muted);
        width: 30px;
        height: 30px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        cursor: pointer;
        transition: all 0.15s ease;
    }

    .sheet-close-btn:hover {
        background: rgba(60, 177, 245, 0.2);
        color: var(--accent-primary);
    }

    .dropdown-item {
        padding: 14px 18px !important;
        font-size: 1rem !important;
        border-radius: 14px !important;
        background: rgba(60, 177, 245, 0.05) !important;
        border: 1px solid var(--card-border) !important;
        color: var(--text-primary) !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .dropdown-item.active {
        background: rgba(60, 177, 245, 0.22) !important;
        border-color: var(--accent-primary) !important;
        color: var(--accent-primary) !important;
        font-weight: 700 !important;
    }
}


/* ==========================================================================
   TalkVance Sleek Resolution, Spacing & Collision-Free UI/UX Polish
   ========================================================================== */

/* 1. Balanced Container & Clear Bottom Breathing Room */
.app-layout {
    max-width: 1200px;
    padding: 16px 24px 88px;
    gap: 18px;
}

/* 2. Sleek, Collision-Free Header & Navigation Bar */
.app-header {
    padding: 4px 0 2px;
}

.navbar-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    flex-wrap: nowrap;
}

.brand-link,
.brand-section {
    gap: 10px;
    min-width: 0;
    flex-shrink: 1;
}

.logo-badge {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    border-width: 1.5px;
    box-shadow: 0 3px 10px rgba(60, 177, 245, 0.22);
}

.app-logo-img {
    border-radius: 9px;
}

.brand-info,
.brand-text {
    min-width: 0;
}

.brand-name,
.brand-title {
    font-size: 1.28rem;
    line-height: 1.1;
}

.brand-subline,
.brand-tagline {
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 215px;
}

.main-navbar {
    gap: 2px;
    padding: 4px 5px;
    flex-shrink: 0;
    box-shadow: 0 4px 16px -4px rgba(27, 13, 33, 0.08);
}

.nav-tab {
    gap: 5px;
    padding: 6px 10px;
    font-size: 0.8rem;
    line-height: 1.2;
}

.nav-symbol {
    font-size: 0.92rem;
}

.nav-tab-arena {
    padding: 6px 13px;
}

.arena-mic-badge {
    font-size: 1rem;
}

.nav-badge-soon {
    font-size: 0.6rem;
    padding: 1px 5px;
}

.header-actions,
.header-controls {
    gap: 8px;
    flex-shrink: 0;
}

.theme-switch-btn {
    padding: 3px 10px 3px 4px;
    font-size: 0.78rem;
    gap: 6px;
}

.switch-track {
    width: 38px;
    height: 20px;
    padding: 0 4px;
}

.switch-thumb {
    width: 14px;
    height: 14px;
    top: 2px;
    left: 2px;
}

[data-theme="dark"] .switch-thumb {
    transform: translateX(18px);
}

.icon-only-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
}

/* Prevent header squeeze on 125%-150% DPI laptops (1024px - 1180px CSS viewport) */
@media (max-width: 1180px) {
    .theme-label {
        display: none;
    }

    .theme-switch-btn {
        padding: 3px;
    }

    .brand-subline,
    .brand-tagline {
        max-width: 175px;
    }
}

/* Clean 2-row header wrap on medium screens / narrow laptop windows */
@media (max-width: 1040px) and (min-width: 821px) {
    .navbar-wrapper {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .main-navbar {
        order: 3;
        width: 100%;
        justify-content: center;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .main-navbar::-webkit-scrollbar {
        display: none;
    }
}

/* Switch cleanly to mobile bottom nav <= 820px */
@media (max-width: 820px) {
    .main-navbar {
        display: none !important;
    }

    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 62px !important;
        background: var(--card-bg) !important;
        border-top: 1px solid var(--card-border) !important;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12) !important;
        z-index: 998 !important;
        align-items: center !important;
        justify-content: space-around !important;
        padding: 0 6px calc(env(safe-area-inset-bottom, 0px) + 2px) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
    }

    .app-layout {
        padding-bottom: 120px !important;
    }

    .bottom-language-dock {
        bottom: 72px !important;
        right: 14px !important;
    }
}

/* 3. Sleek Above-the-Fold Main Workspace & Stats Grid */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stats-grid {
    gap: 12px;
}

.stat-card {
    padding: 12px 16px;
    border-radius: 14px;
    box-shadow: 0 4px 18px -6px rgba(27, 13, 33, 0.08);
}

.stat-label {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

.stat-value-group {
    margin-top: 4px;
    gap: 4px;
}

.stat-value {
    font-size: 1.5rem;
    line-height: 1.15;
}

.stat-unit {
    font-size: 0.78rem;
}

.difficulty-pills {
    margin-top: 5px;
    padding: 3px;
    gap: 3px;
}

[data-theme="light"] .difficulty-pills {
    background: rgba(60, 177, 245, 0.09);
    border: 1px solid rgba(60, 177, 245, 0.16);
}

.diff-btn {
    padding: 5px 4px;
    font-size: 0.72rem;
    white-space: nowrap;
}

/* 4. Sleek Practice Card, Segmented Mode Switcher & Canvas */
.practice-card {
    padding: 20px 26px 24px;
    gap: 16px;
    border-radius: 18px;
}

.mode-switcher-bar {
    width: fit-content;
    max-width: 100%;
    align-self: center;
    padding: 4px;
    margin-bottom: 0;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-full);
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.mode-tab-btn {
    padding: 7px 15px;
    font-size: 0.82rem;
    gap: 6px;
    border: none;
}

.practice-header {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
    gap: 10px;
}

[data-theme="light"] .practice-badge {
    background: rgba(60, 177, 245, 0.12);
    border-color: rgba(60, 177, 245, 0.32);
    color: #0369A1;
}

.practice-badge {
    font-size: 0.74rem;
    padding: 4px 12px;
}

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

.action-btn {
    padding: 7px 14px;
    font-size: 0.82rem;
    border-radius: 10px;
    gap: 6px;
}

.text-canvas {
    padding: 18px 22px;
    gap: 12px;
    border-radius: 14px;
    border: 1px solid var(--card-border);
}

[data-theme="light"] .text-canvas {
    background: #F8FCFF;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .text-canvas {
    background: rgba(14, 4, 20, 0.45);
}

.prompt-instruction {
    font-size: 0.74rem;
}

.target-sentence {
    font-size: clamp(1.3rem, 2.2vw, 1.85rem);
    line-height: 1.4;
    padding: 4px 10px;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* 5. IPA Display & Google Translation Bar (Crisp Contrast, Zero Overflow) */
.ipa-container {
    width: 100%;
    max-width: 100%;
    gap: 6px;
    padding: 0;
    background: transparent !important;
    border: none !important;
}

.ipa-row {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 10px;
    max-width: 100%;
    padding: 6px 14px;
    border-radius: 12px;
}

[data-theme="light"] .ipa-row {
    background: rgba(60, 177, 245, 0.09);
    border: 1px solid rgba(60, 177, 245, 0.22);
}

[data-theme="dark"] .ipa-row {
    background: rgba(60, 177, 245, 0.1);
    border: 1px solid rgba(60, 177, 245, 0.22);
}

.ipa-label {
    font-size: 0.68rem;
}

.ipa-text {
    font-size: 0.96rem;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.google-trans-bar {
    max-width: 100%;
    padding: 10px 14px;
    gap: 6px;
    border-radius: 12px;
    text-align: left;
}

.trans-top-row {
    gap: 8px;
}

.trans-controls-wrap {
    flex-wrap: wrap;
    gap: 6px;
}

.trans-lang-select {
    max-width: 210px;
    font-size: 0.78rem;
    padding: 4px 8px;
}

.translation-text {
    font-size: 0.92rem;
    display: block;
}

/* 6. Compact Word Inspector & Mic Station */
.word-inspector {
    padding: 10px 16px;
    min-height: 46px;
    border-radius: 12px;
}

.inspector-details {
    gap: 14px 20px;
}

.inspect-val {
    font-size: 1.08rem;
}

.record-station {
    gap: 10px;
    padding-top: 2px;
}

.waveform-container {
    max-width: 440px;
    height: 42px;
    border-radius: 12px;
}

.mic-main-btn {
    width: 68px;
    height: 68px;
}

.mic-icon,
.stop-icon {
    width: 28px;
    height: 28px;
}

.record-status-label {
    font-size: 0.84rem;
}

/* 7. Light Theme Polish for Shadowing Studio, Modals & Secondary Pages */
[data-theme="light"] .shadow-flow-station,
[data-theme="light"] .shadow-deck {
    background: #F8FCFF;
    border-color: rgba(27, 13, 33, 0.1);
}

[data-theme="light"] .whisper-btn {
    background: rgba(60, 177, 245, 0.12);
    border-color: rgba(60, 177, 245, 0.35);
    color: #0369A1;
}

[data-theme="light"] .modal-body {
    color: #2D1A35;
}

[data-theme="light"] .scholar-badge {
    background: rgba(60, 177, 245, 0.12);
    color: #0369A1;
}

[data-theme="light"] .phonics-toolbar,
[data-theme="light"] .story-toolbar,
[data-theme="light"] .fw-guide-box {
    background: #FFFFFF;
    border-color: rgba(27, 13, 33, 0.09);
    box-shadow: var(--shadow-card);
}

[data-theme="light"] .search-input {
    background: #F4FAFD;
    border-color: rgba(27, 13, 33, 0.14);
    color: #1B0D21;
}

[data-theme="light"] .filter-btn,
[data-theme="light"] .story-filter-btn {
    background: rgba(27, 13, 33, 0.04);
    border-color: rgba(27, 13, 33, 0.1);
    color: #4A3552;
}

[data-theme="light"] .filter-btn:hover,
[data-theme="light"] .story-filter-btn:hover {
    color: #0369A1;
    background: rgba(60, 177, 245, 0.12);
    border-color: rgba(60, 177, 245, 0.35);
}

[data-theme="light"] .phonics-hero-badge,
[data-theme="light"] .story-hero-badge,
[data-theme="light"] .author-voice-pill {
    color: #0369A1;
}

.phonics-hero,
.story-hero,
.framework-hero {
    padding: 14px 16px 8px;
    gap: 8px;
}

.phonics-title,
.story-title,
.framework-title {
    font-size: clamp(1.5rem, 2.6vw, 2.05rem);
}

/* 8. Floating Language Dock & Footer Clearance (Zero Overlap) */
.bottom-language-dock {
    bottom: 18px;
    right: 20px;
}

.bottom-floating-lang-btn {
    padding: 8px 14px;
    font-size: 0.84rem;
    gap: 6px;
}

.app-footer {
    padding: 14px 175px 6px 0;
    gap: 6px 16px;
    font-size: 0.78rem;
}

@media (max-width: 820px) {
    .app-footer {
        padding-right: 0;
        justify-content: center;
        text-align: center;
    }

    .practice-card {
        padding: 16px 16px 20px;
    }

    .text-canvas {
        padding: 14px 14px;
    }
}


/* ==========================================================================
   Dual Translation Bar (Offline English + Clickable Word Meanings)
   ========================================================================== */
.trans-mode-pills {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border-radius: var(--radius-full);
    background: rgba(60, 177, 245, 0.08);
    border: 1px solid var(--card-border);
}

.trans-mode-pill {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.trans-mode-pill:hover {
    color: var(--accent-primary);
}

.trans-mode-pill.active {
    background: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(60, 177, 245, 0.35);
}

.offline-ready-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #059669;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

[data-theme="dark"] .offline-ready-badge {
    color: #34d399;
}

.offline-trans-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}

.offline-english-main {
    font-size: 0.98rem;
    font-weight: 600;
}

.offline-word-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.offline-word-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(60, 177, 245, 0.09);
    border: 1px solid rgba(60, 177, 245, 0.26);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.16s ease;
}

.offline-word-chip:hover {
    background: rgba(60, 177, 245, 0.2);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.offline-word-chip.selected {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(60, 177, 245, 0.35);
}

.offline-word-chip.unknown {
    opacity: 0.65;
    border-style: dashed;
}

.offline-word-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 10px;
    background: rgba(60, 177, 245, 0.09);
    border: 1px solid rgba(60, 177, 245, 0.32);
    animation: fadeIn 0.18s ease;
}

.owc-left {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px;
}

.owc-word {
    font-family: var(--font-mono);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.owc-arrow {
    color: var(--text-muted);
    font-weight: 700;
}

.owc-meaning {
    font-size: 0.92rem;
    color: var(--text-primary);
}

.owc-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(27, 13, 33, 0.06);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

[data-theme="dark"] .owc-note {
    background: rgba(255, 255, 255, 0.08);
}

.inspect-meaning-val {
    font-family: var(--font-main);
    font-size: 0.98rem;
    color: var(--accent-primary) !important;
}


/* ==========================================================================
   V4 Polish: Borderless Transparent Logo, Harmonious Header, IELTS & Private
   Modals, and Crisp Light/Dark Contrast for Stories & Phonemes
   ========================================================================== */

/* 1. Invisible Borderless Logo Container with Clean Separation */
.logo-badge,
.modal-logo-wrap {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-badge {
    width: 44px;
    height: 44px;
    margin-right: 4px;
    text-decoration: none;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), filter 0.22s ease;
}

.logo-badge:hover {
    transform: translateY(-1px) scale(1.06);
    box-shadow: none !important;
    filter: drop-shadow(0 4px 10px rgba(60, 177, 245, 0.35));
}

.modal-logo-wrap {
    width: 64px;
    height: 64px;
    margin-right: 6px;
}

.app-logo-img,
.modal-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

[data-theme="light"] .logo-dark {
    display: none !important;
}

[data-theme="dark"] .logo-light {
    display: none !important;
}

/* 2. Fixed Brand Stack & Harmonious Navbar (Zero Crashing at Any Resolution) */
.brand-section {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-shrink: 1;
}

.brand-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    gap: 2px;
}

.brand-name-link {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    line-height: 1.08;
}

.brand-name,
.brand-title {
    font-size: 1.24rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.08;
    white-space: nowrap;
}

.brand-subline,
.brand-tagline {
    font-size: 0.69rem;
    line-height: 1.25;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
    margin-top: 0;
}

.app-layout {
    max-width: 1240px;
}

.navbar-wrapper {
    gap: 10px;
}

.main-navbar {
    gap: 2px;
    padding: 3px 5px;
}

.nav-tab {
    gap: 4px;
    padding: 6px 9px;
    font-size: 0.78rem;
}

.nav-tab-arena {
    padding: 6px 12px;
}

.nav-symbol {
    font-size: 0.88rem;
}

@media (max-width: 1200px) {
    .brand-subline,
    .brand-tagline {
        max-width: 175px;
    }

    .nav-tab {
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    .nav-tab-arena {
        padding: 5px 10px;
    }
}

@media (max-width: 1080px) and (min-width: 821px) {
    .navbar-wrapper {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .main-navbar {
        order: 3;
        width: 100%;
        justify-content: center;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .brand-subline,
    .brand-tagline {
        max-width: none;
    }
}

/* 3. IELTS 5-Option Buttons Grid inside Modal */
.ielts-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
    gap: 9px;
    margin-top: 8px;
}

.ielts-option-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 13px;
    border-radius: 11px;
    background: rgba(60, 177, 245, 0.08);
    border: 1px solid rgba(60, 177, 245, 0.28);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s ease;
}

.ielts-option-btn:hover {
    background: rgba(60, 177, 245, 0.18);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.ielts-option-tag {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    background: rgba(245, 158, 11, 0.16);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.35);
    flex-shrink: 0;
}

[data-theme="dark"] .ielts-option-tag {
    color: #fbbf24;
}

.ielts-preview-notice {
    margin-top: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(60, 177, 245, 0.1);
    border: 1px solid rgba(60, 177, 245, 0.3);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* 4. Private Classes Modal Multi-Action Links */
.private-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.private-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 11px;
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.18s ease;
    border: 1px solid var(--card-border);
    background: rgba(60, 177, 245, 0.08);
    color: var(--text-primary);
}

.private-action-link:hover {
    border-color: var(--accent-primary);
    background: rgba(60, 177, 245, 0.18);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

.private-action-link.primary-cta {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff !important;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(60, 177, 245, 0.32);
}

.private-action-link.primary-cta:hover {
    filter: brightness(1.06);
    color: #ffffff !important;
}

/* 5. Complete Light & Dark Contrast Fixes for Stories & Phonemes */
[data-theme="light"] .story-prose,
[data-theme="light"] .story-paragraph,
[data-theme="light"] .story-name-group h2,
[data-theme="light"] .phonics-section-title,
[data-theme="light"] .phoneme-name,
[data-theme="light"] .articulatory-desc,
[data-theme="light"] .example-chip {
    color: #1B0D21 !important;
}

[data-theme="dark"] .story-prose,
[data-theme="dark"] .story-paragraph,
[data-theme="dark"] .story-name-group h2,
[data-theme="dark"] .phonics-section-title,
[data-theme="dark"] .phoneme-name {
    color: #E2F4FD !important;
}

[data-theme="light"] .story-paragraph {
    background: rgba(60, 177, 245, 0.04) !important;
    border-color: rgba(27, 13, 33, 0.06) !important;
}

[data-theme="light"] .story-paragraph:hover {
    background: rgba(60, 177, 245, 0.09) !important;
    border-color: rgba(60, 177, 245, 0.3) !important;
}

[data-theme="light"] .story-audio-station,
[data-theme="light"] .highlight-toggle-bar {
    background: #F4FAFD !important;
    border-color: rgba(27, 13, 33, 0.1) !important;
}

[data-theme="light"] .scrubber-slider {
    background: rgba(27, 13, 33, 0.14) !important;
}

[data-theme="light"] .btn-skip,
[data-theme="light"] .speed-pill-btn {
    background: #FFFFFF !important;
    color: #1B0D21 !important;
    border-color: rgba(27, 13, 33, 0.15) !important;
}

[data-theme="light"] .speed-pill-btn.active {
    background: var(--accent-primary) !important;
    color: #FFFFFF !important;
    border-color: var(--accent-primary) !important;
}

[data-theme="light"] .btn-shadow-paragraph {
    background: rgba(60, 177, 245, 0.14) !important;
    border-color: rgba(60, 177, 245, 0.35) !important;
    color: #0369A1 !important;
}

[data-theme="light"] .btn-shadow-paragraph:hover {
    background: var(--accent-primary) !important;
    color: #FFFFFF !important;
}

[data-theme="light"] .focus-r {
    color: #0369A1 !important;
    background: rgba(56, 189, 248, 0.16) !important;
}

[data-theme="light"] .focus-t {
    color: #B45309 !important;
    background: rgba(245, 158, 11, 0.18) !important;
    border-bottom-color: rgba(217, 119, 6, 0.6) !important;
}

[data-theme="light"] .phoneme-target-badge {
    color: #0369A1 !important;
}

[data-theme="light"] .para-modal-dialog {
    background: #FFFFFF !important;
    color: #1B0D21 !important;
    border-color: rgba(27, 13, 33, 0.12) !important;
}

[data-theme="light"] .phoneme-card {
    background: #FFFFFF !important;
    border: 1px solid rgba(27, 13, 33, 0.1) !important;
    box-shadow: 0 4px 16px -6px rgba(27, 13, 33, 0.08);
}

[data-theme="dark"] .phoneme-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
}

[data-theme="light"] .phoneme-ipa-badge {
    color: #0369A1 !important;
    background: rgba(60, 177, 245, 0.12) !important;
    border-color: rgba(60, 177, 245, 0.3) !important;
}

[data-theme="light"] .phoneme-audio-btn {
    background: rgba(60, 177, 245, 0.14) !important;
    border-color: rgba(60, 177, 245, 0.35) !important;
    color: #0369A1 !important;
}

[data-theme="dark"] .phoneme-audio-btn {
    color: #84CAF0 !important;
}

[data-theme="light"] .example-chip {
    background: rgba(60, 177, 245, 0.07) !important;
    border-color: rgba(27, 13, 33, 0.1) !important;
}

[data-theme="light"] .example-chip strong {
    color: #0369A1 !important;
}

[data-theme="light"] .phoneme-articulatory-box {
    background: #F4FAFD !important;
    border-left-color: var(--accent-primary) !important;
}

[data-theme="light"] .articulatory-label,
[data-theme="light"] .section-counter {
    color: #5B4366 !important;
}

[data-theme="light"] .section-counter {
    background: rgba(27, 13, 33, 0.06) !important;
}

[data-theme="light"] .language-tag {
    background: rgba(27, 13, 33, 0.07) !important;
    color: #4A3552 !important;
}

[data-theme="light"] .language-tag.de {
    background: rgba(234, 179, 8, 0.16) !important;
    color: #A16207 !important;
}

[data-theme="light"] .language-tag.az {
    background: rgba(14, 165, 233, 0.14) !important;
    color: #0369A1 !important;
}

[data-theme="light"] .language-tag.id {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #B91C1C !important;
}

[data-theme="light"] .language-tag.es {
    background: rgba(245, 158, 11, 0.16) !important;
    color: #B45309 !important;
}

/* About modal thank-you note */
.thiago-thanks-box {
    background: rgba(60, 177, 245, 0.08);
    border-left: 3px solid var(--accent-primary);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.86rem;
    line-height: 1.5;
}


/* ==========================================================================
   V6 Polish: Private Classes Obrounds & WhatsApp CTA, Inline Arena Controls
   (Language + Reference Speed + Pre-Record Word Taps), Azerbaijani Stories
   ========================================================================== */

/* 1. Private Classes Non-Clickable Visual Obround Badges */
.private-topics-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 2px 0 12px;
}

.private-topic-obround {
    display: inline-flex;
    align-items: center;
    padding: 5px 13px;
    border-radius: 9999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: rgba(60, 177, 245, 0.11);
    border: 1px solid rgba(60, 177, 245, 0.34);
    color: #0369A1;
    cursor: default;
    user-select: none;
    pointer-events: none;
}

[data-theme="dark"] .private-topic-obround {
    background: rgba(60, 177, 245, 0.14);
    border-color: rgba(132, 202, 240, 0.35);
    color: #93D8FA;
}

/* WhatsApp Circle-Cropped Button */
.private-action-link.wa-cta {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #ffffff !important;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.32);
}

.private-action-link.wa-cta:hover {
    filter: brightness(1.06);
    color: #ffffff !important;
    transform: translateY(-1px);
}

.wa-btn-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}

/* 2. Practice Arena: Inline Language Selector Left of Reference + Speed Pills */
.app-footer {
    padding-right: 0 !important;
}

.inline-lang-dropdown {
    position: relative;
}

.inline-lang-btn {
    border-color: rgba(60, 177, 245, 0.45) !important;
    background: rgba(60, 177, 245, 0.08) !important;
    font-weight: 700 !important;
}

.inline-lang-btn:hover {
    border-color: var(--accent-primary) !important;
    background: rgba(60, 177, 245, 0.16) !important;
}

.inline-lang-menu {
    left: 0;
    right: auto;
    top: calc(100% + 8px);
    min-width: 225px;
    z-index: 120;
}

@media (max-width: 768px) {
    .inline-lang-menu {
        left: 0;
        right: auto;
    }
}

.ref-audio-control-group {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.ref-speed-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 10px;
    background: rgba(60, 177, 245, 0.08);
    border: 1px solid var(--card-border);
}

.ref-speed-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 7px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.1;
}

.ref-speed-btn:hover {
    color: var(--accent-primary);
    background: rgba(60, 177, 245, 0.14);
}

.ref-speed-btn.active {
    background: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(60, 177, 245, 0.35);
}

/* 3. Practice Arena: Pre-Record Tappable Words & Edit Text Toggle */
.prompt-instruction {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.edit-script-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: rgba(60, 177, 245, 0.1);
    border: 1px solid rgba(60, 177, 245, 0.32);
    color: var(--accent-primary);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.16s ease;
}

.edit-script-toggle-btn:hover {
    background: rgba(60, 177, 245, 0.2);
}

.edit-script-toggle-btn.editing {
    background: #10B981;
    border-color: #10B981;
    color: #ffffff;
}

.target-sentence.editing-active {
    outline: 2px dashed var(--accent-primary);
    outline-offset: 4px;
    border-radius: 10px;
    cursor: text;
}

.word-badge.pre-record {
    display: inline-block;
    padding: 2px 6px;
    margin: 2px 1px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, color 0.15s ease;
}

.word-badge.pre-record:hover {
    background: rgba(60, 177, 245, 0.14);
    border-color: rgba(60, 177, 245, 0.38);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

.word-badge.pre-record.selected-pre-word {
    background: rgba(60, 177, 245, 0.22);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* 4. Stories Studio: Language Tabs & Azerbaijani Interactive Word Translation */
.story-lang-tabs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    gap: 6px;
    padding: 5px;
    border-radius: var(--radius-full);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-card);
    flex-wrap: wrap;
}

.story-lang-tab {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}

.story-lang-tab:hover {
    color: var(--accent-primary);
    background: rgba(60, 177, 245, 0.08);
}

.story-lang-tab.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(60, 177, 245, 0.36);
}

.story-word-meaning-bar {
    position: sticky;
    top: 10px;
    z-index: 25;
    padding: 11px 16px;
    border-radius: 12px;
    background: rgba(60, 177, 245, 0.1);
    border: 1px solid rgba(60, 177, 245, 0.34);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

[data-theme="light"] .story-word-meaning-bar {
    background: rgba(240, 249, 255, 0.96);
    border-color: rgba(60, 177, 245, 0.42);
    box-shadow: 0 6px 18px -6px rgba(27, 13, 33, 0.12);
}

[data-theme="dark"] .story-word-meaning-bar {
    background: rgba(24, 6, 32, 0.94);
    border-color: rgba(60, 177, 245, 0.42);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.swm-prompt {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

.swm-active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.swm-left {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.story-word-chip {
    display: inline;
    padding: 1px 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
    border-bottom: 1px dashed rgba(60, 177, 245, 0.45);
}

.story-word-chip:hover {
    background: rgba(60, 177, 245, 0.18);
    color: var(--accent-primary);
}

.story-word-chip.selected {
    background: var(--accent-primary);
    color: #ffffff !important;
    border-bottom-color: transparent;
}

.az-para-translation {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-family: var(--font-main);
    font-size: 0.92rem;
    line-height: 1.55;
    background: rgba(60, 177, 245, 0.08);
    border-left: 3px solid var(--accent-primary);
    color: var(--text-secondary);
}

.az-trans-label {
    font-weight: 800;
    color: var(--accent-primary);
    margin-right: 4px;
}


/* ==========================================================================
   V7 Polish: 3-Line Brand Header, Floating Bottom-Left Mobile Hamburger Menu,
   Inline Mobile Language Dropdown, Overflow-Free Mobile Buttons & Stacked Footer
   ========================================================================== */

/* 1. 3-Line Brand Header (Zero Cropping on Mobile or Desktop) */
.brand-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    min-width: 0;
}

.brand-slogan {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.22;
    color: var(--text-secondary);
    white-space: nowrap;
}

.brand-author {
    font-size: 0.69rem;
    font-weight: 500;
    line-height: 1.22;
    color: var(--text-muted);
    white-space: nowrap;
}

@media (max-width: 480px) {
    .brand-name {
        font-size: 1.15rem !important;
    }
    .brand-slogan {
        font-size: 0.68rem;
    }
    .brand-author {
        font-size: 0.65rem;
    }
    .logo-badge {
        width: 38px !important;
        height: 38px !important;
    }
    .header-actions {
        gap: 6px !important;
    }
}

/* 2. Stacked Clean Footer (Spaced Lines) */
.app-footer.stacked-footer {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 7px !important;
    padding: 20px 14px 36px !important;
    font-size: 0.82rem;
    line-height: 1.45;
}

.app-footer.stacked-footer .footer-line {
    display: block;
    color: var(--text-secondary);
}

.app-footer.stacked-footer .footer-slogan {
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

@media (max-width: 820px) {
    .app-footer.stacked-footer {
        padding-bottom: 84px !important;
    }
}

/* 3. Replace Cluttered Mobile Bottom Bar with Floating Bottom-Left Hamburger Menu */
.mobile-bottom-nav {
    display: none !important;
}

.mobile-hamburger-fab {
    display: none;
}

.mobile-drawer-backdrop {
    display: none;
}

.mobile-nav-drawer {
    display: none;
}

@media (max-width: 820px) {
    .app-layout {
        padding-bottom: 82px !important;
    }

    .mobile-hamburger-fab {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        position: fixed;
        bottom: 14px;
        left: 14px;
        z-index: 1005;
        height: 46px;
        padding: 0 16px;
        border-radius: 9999px;
        background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
        color: #ffffff;
        border: 1.5px solid rgba(255, 255, 255, 0.25);
        box-shadow: 0 6px 20px rgba(27, 13, 33, 0.35), 0 0 0 2px rgba(60, 177, 245, 0.22);
        font-family: inherit;
        font-size: 0.86rem;
        font-weight: 800;
        cursor: pointer;
        transition: transform 0.18s ease, box-shadow 0.18s ease;
    }

    .mobile-hamburger-fab:active {
        transform: scale(0.95);
    }

    .mobile-drawer-backdrop.open {
        display: block !important;
        position: fixed;
        inset: 0;
        background: rgba(8, 3, 14, 0.65);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        z-index: 1010;
    }

    .mobile-nav-drawer.open {
        display: flex !important;
        flex-direction: column;
        gap: 8px;
        position: fixed;
        left: 14px;
        bottom: 70px;
        width: min(310px, calc(100vw - 28px));
        max-height: calc(100vh - 110px);
        overflow-y: auto;
        padding: 14px;
        border-radius: 20px;
        background: var(--card-bg);
        border: 1.5px solid rgba(60, 177, 245, 0.4);
        box-shadow: 0 16px 42px rgba(0, 0, 0, 0.45);
        z-index: 1015;
        animation: fadeIn 0.18s ease;
    }

    [data-theme="light"] .mobile-nav-drawer.open {
        background: #FFFFFF;
        box-shadow: 0 14px 36px rgba(27, 13, 33, 0.18);
    }

    [data-theme="dark"] .mobile-nav-drawer.open {
        background: #180620;
    }

    .mobile-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 2px 4px 10px;
        border-bottom: 1px solid var(--card-border);
        margin-bottom: 2px;
    }

    .mobile-drawer-title {
        font-size: 0.92rem;
        font-weight: 800;
        color: var(--text-primary);
    }

    .mobile-drawer-close {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        border: none;
        background: rgba(60, 177, 245, 0.12);
        color: var(--text-primary);
        font-size: 1rem;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-drawer-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        padding: 11px 14px;
        border-radius: 12px;
        text-decoration: none;
        background: rgba(60, 177, 245, 0.06);
        border: 1px solid var(--card-border);
        color: var(--text-primary);
        font-family: inherit;
        font-size: 0.9rem;
        font-weight: 700;
        text-align: left;
        cursor: pointer;
        transition: background 0.15s ease, border-color 0.15s ease;
    }

    .mobile-drawer-item-left {
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-drawer-item.active {
        background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
        border-color: transparent;
        color: #ffffff;
    }

    .mobile-drawer-item:hover:not(.active) {
        border-color: var(--accent-primary);
        background: rgba(60, 177, 245, 0.14);
    }
}

/* 4. Fix Mobile Language Dropdown (Pop Right Under Button, Never Trapped at Bottom!) */
@media (max-width: 640px) {
    .inline-lang-dropdown .dropdown-backdrop,
    .inline-lang-dropdown .dropdown-backdrop.show {
        display: none !important;
    }

    .inline-lang-dropdown .sheet-handle-bar {
        display: none !important;
    }

    .inline-lang-dropdown .inline-lang-menu {
        position: absolute !important;
        top: calc(100% + 6px) !important;
        bottom: auto !important;
        left: 0 !important;
        right: auto !important;
        width: min(280px, calc(100vw - 44px)) !important;
        min-width: 235px !important;
        max-width: calc(100vw - 44px) !important;
        max-height: 340px !important;
        overflow-y: auto !important;
        transform: none !important;
        border-radius: 14px !important;
        padding: 8px !important;
        gap: 4px !important;
        z-index: 250 !important;
        display: none !important;
        visibility: visible !important;
        pointer-events: auto !important;
        box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35) !important;
    }

    [data-theme="dark"] .inline-lang-dropdown .inline-lang-menu {
        background: #1B0924 !important;
    }

    [data-theme="light"] .inline-lang-dropdown .inline-lang-menu {
        background: #FFFFFF !important;
    }

    .inline-lang-dropdown .inline-lang-menu.show {
        display: flex !important;
    }

    .inline-lang-dropdown .sheet-title-row {
        display: flex !important;
        padding: 4px 6px 8px;
        margin-bottom: 4px;
    }

    .inline-lang-dropdown .dropdown-item {
        padding: 10px 12px !important;
        font-size: 0.88rem !important;
        border-radius: 10px !important;
    }
}

/* 5. Fix Mobile Overflow on Translation Pills, Practice Actions & Stories Tabs */
.google-trans-bar {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

@media (max-width: 640px) {
    .trans-top-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        width: 100%;
    }

    .trans-mode-pills {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        box-sizing: border-box;
    }

    .trans-mode-pill {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        padding: 7px 6px !important;
        font-size: 0.72rem !important;
        text-align: center;
        justify-content: center;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .trans-controls-wrap {
        width: 100% !important;
        max-width: 100% !important;
        display: flex;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .trans-controls-wrap.hidden {
        display: none !important;
    }

    .trans-lang-select {
        flex: 1 1 130px !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .practice-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .inline-lang-dropdown {
        flex: 1 1 100%;
    }

    .inline-lang-btn {
        width: 100%;
        justify-content: space-between !important;
    }

    .ref-audio-control-group {
        flex: 1 1 100%;
        width: 100%;
        justify-content: space-between;
        gap: 6px;
    }

    .ref-audio-control-group #btnPlayReference {
        flex: 0 0 auto;
    }

    .ref-speed-group {
        flex: 1 1 auto;
        justify-content: space-between;
    }

    .ref-speed-btn {
        flex: 1;
        text-align: center;
        padding: 6px 4px;
        font-size: 0.72rem;
    }

    .story-lang-tabs {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .story-lang-tab {
        flex: 1 1 130px;
        text-align: center;
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

/* Language tags for Turkish, Italian, Russian */
.language-tag.tr {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
}
.language-tag.it {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
}
.language-tag.ru {
    background: rgba(99, 102, 241, 0.16);
    color: #a5b4fc;
}
[data-theme="light"] .language-tag.tr { color: #B91C1C !important; }
[data-theme="light"] .language-tag.it { color: #047857 !important; }
[data-theme="light"] .language-tag.ru { color: #4338CA !important; }


/* ==========================================================================
   V8 Polish: Crash-Free Phonemes Mobile Cards & 2-Slide Welcome Onboarding
   ========================================================================== */

/* 1. Phonemes Card Top & Responsive Grid (Zero Clipping / Zero Double-Box) */
.phoneme-card-top {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100%;
}

.phoneme-card-top > div {
    min-width: 0;
    flex: 1;
}

.phoneme-ipa-badge {
    display: inline-block !important;
    max-width: 100%;
    font-size: clamp(1.1rem, 2.2vw, 1.45rem) !important;
    line-height: 1.25 !important;
    padding: 5px 12px !important;
    white-space: nowrap;
}

.phoneme-audio-btn {
    flex-shrink: 0 !important;
    width: 40px !important;
    height: 40px !important;
}

.phonics-section-title {
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 600px) {
    .phonics-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .phoneme-card {
        padding: 16px 16px !important;
    }

    .phoneme-ipa-badge {
        font-size: 1.28rem !important;
        white-space: nowrap !important;
    }
}

/* 2. First-Visit 2-Slide Welcome Onboarding Overlay */
.welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(10, 4, 18, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 1;
    transition: opacity 0.38s ease, visibility 0.38s ease;
}

.welcome-overlay.hidden {
    display: none !important;
}

.welcome-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.welcome-card {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    border-radius: 24px;
    padding: 26px 24px 24px;
    background: var(--card-bg);
    border: 1.5px solid rgba(60, 177, 245, 0.42);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(60, 177, 245, 0.15);
    position: relative;
}

[data-theme="light"] .welcome-card {
    background: #FFFFFF;
    box-shadow: 0 24px 60px rgba(27, 13, 33, 0.22), 0 0 0 1px rgba(60, 177, 245, 0.2);
}

[data-theme="dark"] .welcome-card {
    background: #17061F;
}

.welcome-slide {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.32s ease, transform 0.32s ease;
}

.welcome-slide.slide-hidden {
    display: none;
    opacity: 0;
    transform: translateY(10px);
}

.welcome-slide.slide-fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

.welcome-slide.slide-fade-in {
    opacity: 0;
    transform: translateY(10px);
}

.welcome-video-frame {
    width: 100%;
    max-width: 440px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(60, 177, 245, 0.3);
    background: #0b0412;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.welcome-video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: cover;
}

.welcome-brand-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.welcome-logo-box {
    width: 66px;
    height: 66px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.welcome-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.welcome-heading {
    font-size: clamp(1.22rem, 3.8vw, 1.55rem);
    font-weight: 800;
    line-height: 1.28;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

.welcome-sub {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0;
}

.welcome-guide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    text-align: left;
}

@media (max-width: 560px) {
    .welcome-card {
        padding: 20px 16px 18px;
    }

    .welcome-guide-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .welcome-video {
        max-height: 190px;
    }
}

.welcome-guide-box {
    background: rgba(60, 177, 245, 0.07);
    border: 1px solid rgba(60, 177, 245, 0.25);
    border-radius: 14px;
    padding: 14px 15px;
}

[data-theme="light"] .welcome-guide-box {
    background: #F4FAFF;
}

.welcome-guide-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin: 0 0 9px;
    letter-spacing: 0.01em;
}

.welcome-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-primary);
    font-weight: 500;
}

.welcome-footer-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 4px;
}

.welcome-dots {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.welcome-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: var(--card-border);
    transition: width 0.25s ease, background 0.25s ease;
}

.welcome-dot.active {
    width: 22px;
    background: var(--accent-primary);
}

.welcome-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 190px;
    padding: 12px 28px;
    border-radius: 9999px;
    border: none;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff;
    font-family: inherit;
    font-size: 0.96rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(60, 177, 245, 0.42);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.welcome-cta-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 8px 24px rgba(60, 177, 245, 0.52);
}

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


/* ==========================================================================
   V9 Polish: Unified Desktop + Mobile Arena Spacing, Scrollable 14-Lang Menu,
   Clean Offline Card, Welcome Video Fit & RTL Support
   ========================================================================== */
/* 1. Unified Desktop + Tablet + Mobile 14-Language Dropdown (Scrollable, Opaque, Never Trapped) */
.inline-lang-dropdown .dropdown-backdrop,
.inline-lang-dropdown .dropdown-backdrop.show,
.inline-lang-dropdown .sheet-handle-bar {
    display: none !important;
}

.inline-lang-dropdown .inline-lang-menu {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    bottom: auto !important;
    left: 0 !important;
    right: auto !important;
    width: 272px !important;
    min-width: 248px !important;
    max-width: calc(100vw - 32px) !important;
    max-height: min(380px, 58vh) !important;
    overflow-y: auto !important;
    transform: none !important;
    border-radius: 14px !important;
    padding: 8px !important;
    gap: 3px !important;
    z-index: 250 !important;
    display: none !important;
    visibility: visible !important;
    pointer-events: auto !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28) !important;
}

[data-theme="dark"] .inline-lang-dropdown .inline-lang-menu {
    background: #1B0924 !important;
}

[data-theme="light"] .inline-lang-dropdown .inline-lang-menu {
    background: #FFFFFF !important;
}

.inline-lang-dropdown .inline-lang-menu.show {
    display: flex !important;
}

.inline-lang-dropdown .sheet-title-row {
    display: flex !important;
    padding: 4px 6px 8px;
    margin-bottom: 4px;
}

.inline-lang-dropdown .dropdown-item {
    padding: 9px 12px !important;
    font-size: 0.86rem !important;
    border-radius: 10px !important;
}

/* 2. Desktop Navbar Resilience with 3-Line Brand Header & Always-Visible (i) Button */
.header-actions {
    flex-shrink: 0;
}

@media (max-width: 1160px) and (min-width: 821px) {
    .navbar-wrapper {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .main-navbar {
        order: 3;
        width: 100%;
        justify-content: center;
        overflow-x: auto;
        scrollbar-width: none;
    }
}

/* 3. Desktop Welcome Video Aspect-Safe Fit (Zero Logo Cropping) */
.welcome-video {
    aspect-ratio: 16 / 9;
    max-height: 260px;
    object-fit: contain;
    background: #ffffff;
}

/* 4. Desktop Phonemes Grid Card Width Guard */
.phonics-grid {
    grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
}

/* 5. Compact Arena Layout for Both Desktop & Mobile (Preserving Horizontal Card Padding) */
.practice-card {
    gap: 14px;
    padding: 20px 26px 22px;
}

.text-canvas {
    padding: 12px 20px 14px;
    gap: 11px;
}

.google-trans-bar {
    padding: 10px 14px;
    gap: 8px;
}

.offline-trans-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.offline-sentence-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.offline-sentence-row .offline-english-main {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.offline-copy-btn {
    flex-shrink: 0;
}

.word-inspector {
    min-height: 0;
    padding: 12px 16px;
    margin-bottom: 10px;
}

.record-station {
    gap: 10px;
    padding-top: 2px;
}

.waveform-container {
    max-height: 0;
    height: 0;
    opacity: 0;
    border-width: 0;
    margin: 0;
    pointer-events: none;
    transition: height 0.2s ease, max-height 0.2s ease, opacity 0.2s ease;
}

.waveform-container.active {
    max-height: 54px;
    height: 48px;
    opacity: 1;
    border-width: 1px;
    margin-bottom: 4px;
    pointer-events: auto;
}

#original_script[dir="rtl"] {
    direction: rtl;
    unicode-bidi: isolate;
    line-height: 1.65;
}

@media (max-width: 640px) {
    .practice-card {
        gap: 12px;
        padding: 16px 14px;
    }

    .text-canvas {
        padding: 10px 10px 12px;
        gap: 10px;
    }

    .target-sentence {
        font-size: clamp(1.38rem, 5.6vw, 1.85rem);
        padding: 4px 6px;
    }

    .google-trans-bar {
        padding: 9px 10px;
        gap: 7px;
    }

    .record-station {
        gap: 8px;
        padding-top: 0;
    }

    .mic-main-btn {
        width: 74px;
        height: 74px;
    }
}


/* ==========================================================================
   V10: Implementative Grammar — 6-Slide Speaking Studio & Locked 6-Color System
   ========================================================================== */

/* 1. Locked 6-Color Word Class Palette (Light + Dark Modes) */
.gm-block,
.gm-word {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    font-weight: 700;
    border-radius: 8px;
    line-height: 1.3;
    transition: transform 0.15s ease;
}

.gm-block {
    padding: 5px 11px;
    font-size: 0.84rem;
    border: 1.5px solid transparent;
}

.gm-word {
    padding: 2px 7px;
    font-size: 1.02rem;
    border: 1px solid transparent;
}

.gm-word.gm-highlight {
    box-shadow: 0 0 0 2px currentColor;
    font-weight: 800;
}

.gm-op {
    color: var(--text-muted);
    font-weight: 800;
    font-size: 0.9rem;
    padding: 0 2px;
    align-self: center;
}

.gm-vbadge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0 4px;
    margin-left: 2px;
    border-radius: 4px;
    background: rgba(185, 28, 28, 0.14);
    color: inherit;
    vertical-align: super;
}

/* Light Mode Exact Blueprint Hex Specs */
.gm-role-noun   { color: #1D4ED8; background: #EFF6FF; border-color: rgba(29, 78, 216, 0.28); }
.gm-role-verb   { color: #B91C1C; background: #FEF2F2; border-color: rgba(185, 28, 28, 0.28); }
.gm-role-helper { color: #0F766E; background: #F0FDFA; border-color: rgba(15, 118, 110, 0.28); }
.gm-role-adj    { color: #15803D; background: #F0FDF4; border-color: rgba(21, 128, 61, 0.28); }
.gm-role-adv    { color: #7E22CE; background: #FAF5FF; border-color: rgba(126, 34, 206, 0.28); }
.gm-role-prep   { color: #C2410C; background: #FFF7ED; border-color: rgba(194, 65, 12, 0.28); }

/* Dark Mode High-Contrast Equivalent Tints */
[data-theme="dark"] .gm-role-noun   { color: #93C5FD; background: rgba(59, 130, 246, 0.18); border-color: rgba(147, 197, 253, 0.35); }
[data-theme="dark"] .gm-role-verb   { color: #FCA5A5; background: rgba(239, 68, 68, 0.18); border-color: rgba(252, 165, 165, 0.35); }
[data-theme="dark"] .gm-role-helper { color: #5EEAD4; background: rgba(20, 184, 166, 0.18); border-color: rgba(94, 234, 212, 0.35); }
[data-theme="dark"] .gm-role-adj    { color: #86EFAC; background: rgba(34, 197, 94, 0.18); border-color: rgba(134, 239, 172, 0.35); }
[data-theme="dark"] .gm-role-adv    { color: #D8B4FE; background: rgba(168, 85, 247, 0.20); border-color: rgba(216, 180, 254, 0.35); }
[data-theme="dark"] .gm-role-prep   { color: #FDBA74; background: rgba(249, 115, 22, 0.20); border-color: rgba(253, 186, 116, 0.35); }
[data-theme="dark"] .gm-vbadge      { background: rgba(252, 165, 165, 0.2); }

/* 2. Curriculum Hub (Hero, Level Tabs A1-B2, Module Cards) */
.gm-hero {
    text-align: center;
    padding: 10px 12px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.gm-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    background: rgba(60, 177, 245, 0.14);
    border: 1px solid rgba(60, 177, 245, 0.35);
    color: var(--accent-primary);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gm-hero-title {
    font-size: clamp(1.5rem, 3vw, 2.15rem);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    margin: 0;
}

.gm-hero-sub {
    max-width: 700px;
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.gm-hub-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 8px 0 12px;
}

.gm-level-tabs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px;
    border-radius: var(--radius-full);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    flex-wrap: wrap;
}

.gm-level-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.18s ease;
}

.gm-level-tab:hover {
    color: var(--accent-primary);
    background: rgba(60, 177, 245, 0.08);
}

.gm-level-tab.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(60, 177, 245, 0.35);
}

.gm-lvl-pill {
    font-size: 0.64rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.22);
    text-transform: uppercase;
}

.gm-level-tab:not(.active) .gm-lvl-pill {
    background: rgba(245, 158, 11, 0.16);
    color: #d97706;
}

[data-theme="dark"] .gm-level-tab:not(.active) .gm-lvl-pill {
    color: #fbbf24;
}

.gm-l1-picker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.gm-l1-select {
    background: transparent;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 8px;
    cursor: pointer;
}

[data-theme="dark"] .gm-l1-select option {
    background: #180620;
    color: #ffffff;
}

.gm-level-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(60, 177, 245, 0.08);
    border: 1px solid rgba(60, 177, 245, 0.28);
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.gm-level-banner strong {
    color: var(--text-primary);
}

.gm-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.gm-module-card {
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    border-radius: 18px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.gm-module-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-primary);
    box-shadow: 0 12px 28px rgba(60, 177, 245, 0.22);
}

.gm-mod-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.gm-mod-num {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.gm-mod-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 9999px;
    background: rgba(60, 177, 245, 0.12);
    color: var(--accent-primary);
}

.gm-mod-done {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 9999px;
    background: rgba(16, 185, 129, 0.16);
    color: #059669;
}

[data-theme="dark"] .gm-mod-done {
    color: #34d399;
}

.gm-mod-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.gm-mod-desc {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0;
    flex: 1;
}

.gm-mod-footer {
    padding-top: 6px;
    border-top: 1px dashed var(--card-border);
    display: flex;
    justify-content: flex-end;
}

.gm-mod-cta {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--accent-primary);
}

.gm-coming-soon-card {
    grid-column: 1 / -1;
    background: var(--card-bg);
    border: 1.5px dashed rgba(60, 177, 245, 0.4);
    border-radius: 20px;
    padding: 34px 22px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.gm-cs-icon {
    font-size: 2.3rem;
}

.gm-coming-soon-card h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.gm-coming-soon-card p {
    max-width: 560px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.gm-cs-sub {
    font-size: 0.84rem !important;
}

/* 3. Lesson Studio Shell & 6-Step Progress Stepper */
.gm-lesson-shell {
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    border-radius: 22px;
    padding: 22px 26px 26px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.gm-lesson-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--card-border);
}

.gm-lesson-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    min-width: 200px;
}

.gm-lesson-badge {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-primary);
}

.gm-lesson-title {
    margin: 2px 0 0;
    font-size: clamp(1.1rem, 2.3vw, 1.4rem);
    font-weight: 800;
    color: var(--text-primary);
}

.gm-stepper {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.gm-stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    border-radius: 12px;
    background: rgba(60, 177, 245, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.gm-stepper-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--card-border);
    color: var(--text-primary);
    font-size: 0.74rem;
    font-weight: 800;
}

.gm-stepper-item.active {
    background: rgba(60, 177, 245, 0.16);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.gm-stepper-item.active .gm-stepper-num {
    background: var(--accent-primary);
    color: #ffffff;
}

.gm-stepper-item.done {
    border-color: rgba(16, 185, 129, 0.4);
    color: #059669;
}

[data-theme="dark"] .gm-stepper-item.done {
    color: #34d399;
}

.gm-stepper-item.done .gm-stepper-num {
    background: #10b981;
    color: #ffffff;
}

.gm-legend-drawer {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(60, 177, 245, 0.06);
    border: 1px solid var(--card-border);
}

.gm-legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 8px;
}

.gm-legend-grid.compact {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gm-legend-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gm-legend-ex {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding-left: 4px;
}

/* 4. Individual Slide Panels */
.gm-slide {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.26s ease;
}

.gm-slide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.gm-step-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 9999px;
    background: rgba(60, 177, 245, 0.14);
    color: var(--accent-primary);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.gm-weight-pill {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 9999px;
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

[data-theme="dark"] .gm-weight-pill {
    color: #34d399;
}

.gm-card-box {
    background: rgba(60, 177, 245, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

[data-theme="light"] .gm-card-box {
    background: #F8FCFF;
}

.gm-box-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.gm-rule-text {
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
}

.gm-formulas-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gm-formula-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.gm-formula-label {
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--text-muted);
    min-width: 72px;
    text-transform: uppercase;
}

.gm-formula-blocks {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.gm-watchout-box {
    border-left: 4px solid #f59e0b;
    background: rgba(245, 158, 11, 0.11);
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.gm-watchout-box strong {
    color: #b45309;
}

[data-theme="dark"] .gm-watchout-box strong {
    color: #fbbf24;
}

.gm-visual-cue {
    padding: 12px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(60, 177, 245, 0.12), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(60, 177, 245, 0.3);
    text-align: center;
}

.gm-cue-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin-bottom: 4px;
}

.gm-cue-diagram {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.5;
}

.gm-examples-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gm-example-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.gm-example-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.gm-example-tokens {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.gm-example-note {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.gm-mini-speak-btn {
    border: 1px solid rgba(60, 177, 245, 0.35);
    background: rgba(60, 177, 245, 0.1);
    color: var(--accent-primary);
    border-radius: 9999px;
    padding: 5px 12px;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.gm-mini-speak-btn:hover {
    background: var(--accent-primary);
    color: #ffffff;
}

.gm-mistake-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.gm-mistake-col {
    border-radius: 14px;
    padding: 13px 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gm-mistake-col.wrong {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.gm-mistake-col.right {
    background: rgba(16, 185, 129, 0.09);
    border: 1px solid rgba(16, 185, 129, 0.32);
}

.gm-mistake-text {
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: line-through;
    opacity: 0.85;
}

.gm-right-tokens {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

/* 5. Steps 3, 4 & 5 Speaking Practice Stage */
.gm-practice-stage {
    background: rgba(60, 177, 245, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
}

[data-theme="light"] .gm-practice-stage {
    background: #F8FCFF;
}

.gm-sub-counter {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-primary);
}

.gm-target-read {
    font-size: clamp(1.35rem, 3.2vw, 1.9rem);
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.35;
}

.gm-focus-pill {
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: rgba(60, 177, 245, 0.1);
    border: 1px solid rgba(60, 177, 245, 0.25);
    padding: 6px 14px;
    border-radius: 9999px;
}

.gm-listen-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.gm-prompt-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 24px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1.5px solid rgba(60, 177, 245, 0.35);
    width: 100%;
    max-width: 460px;
}

.gm-prompt-caption {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.gm-prompt-word-line {
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.gm-prompt-word {
    font-size: clamp(1.5rem, 4vw, 2.05rem);
    font-weight: 800;
    color: var(--accent-primary);
}

.gm-prompt-trans {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.gm-hint-box {
    width: 100%;
    max-width: 560px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.36);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.88rem;
    color: var(--text-primary);
    text-align: left;
}

.gm-safetynet-box {
    width: 100%;
    max-width: 560px;
    background: rgba(99, 102, 241, 0.1);
    border: 1.5px solid rgba(99, 102, 241, 0.35);
    border-radius: 14px;
    padding: 13px 16px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    align-items: center;
}

.gm-safetynet-model {
    font-size: 1.04rem;
    font-weight: 800;
    color: var(--text-primary);
}

.gm-safetynet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.gm-mic-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.gm-feedback-box {
    width: 100%;
    max-width: 600px;
    border-radius: 14px;
    padding: 14px 16px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.gm-feedback-box.gm-fb-pass {
    background: rgba(16, 185, 129, 0.1);
    border: 1.5px solid rgba(16, 185, 129, 0.38);
}

.gm-feedback-box.gm-fb-retry {
    background: rgba(245, 158, 11, 0.1);
    border: 1.5px solid rgba(245, 158, 11, 0.38);
}

.gm-fb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.96rem;
    color: var(--text-primary);
}

.gm-fb-score {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 800;
    color: #059669;
}

[data-theme="dark"] .gm-fb-score {
    color: #34d399;
}

.gm-fb-attempt {
    font-size: 0.76rem;
    font-weight: 800;
    color: #d97706;
}

.gm-pron-words {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 1.06rem;
    font-weight: 700;
}

.gm-pron-good { color: #059669; }
.gm-pron-ok   { color: #d97706; }
.gm-pron-bad  { color: #dc2626; text-decoration: underline; }

[data-theme="dark"] .gm-pron-good { color: #34d399; }
[data-theme="dark"] .gm-pron-ok   { color: #fbbf24; }
[data-theme="dark"] .gm-pron-bad  { color: #f87171; }

.gm-heard-line {
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.gm-fb-tip {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.45;
}

.gm-rule-reminder-bar {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(60, 177, 245, 0.1);
    border: 1px solid rgba(60, 177, 245, 0.3);
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-primary);
}

.gm-free-prompt-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 600px;
    line-height: 1.5;
    margin: 0;
}

.gm-done-sent-list {
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.gm-done-sent-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    font-size: 0.86rem;
    color: var(--text-primary);
}

.gm-done-check {
    font-weight: 800;
    color: #059669;
    flex-shrink: 0;
}

/* 6. Slide 6 Weighted Summary */
.gm-summary-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 14px;
}

.gm-score-circle {
    width: 116px;
    height: 116px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(60, 177, 245, 0.38);
}

.gm-score-big {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.gm-score-lbl {
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.9;
    text-transform: uppercase;
}

.gm-weight-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.gm-wb-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gm-wb-top {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.gm-wb-val {
    font-family: var(--font-mono);
    font-weight: 800;
    color: var(--text-primary);
}

.gm-wb-track {
    height: 7px;
    border-radius: 9999px;
    background: var(--card-border);
    overflow: hidden;
}

.gm-wb-fill {
    height: 100%;
    width: 0%;
    border-radius: 9999px;
    background: linear-gradient(90deg, var(--accent-primary), #10b981);
    transition: width 0.5s ease;
}

.gm-coaching-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.gm-coach-card {
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.gm-coach-card.strength {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.32);
}

.gm-coach-card.tip {
    background: rgba(60, 177, 245, 0.1);
    border: 1px solid rgba(60, 177, 245, 0.32);
}

.gm-coach-card p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.48;
    color: var(--text-primary);
}

/* 7. Slide Footer Action Bar */
.gm-slide-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--card-border);
}

.gm-slide-footer .action-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 700px) {
    .gm-lesson-shell {
        padding: 16px 14px 20px;
        gap: 14px;
    }

    .gm-stepper {
        grid-template-columns: repeat(3, 1fr);
    }

    .gm-mistake-compare,
    .gm-weight-breakdown,
    .gm-coaching-pair {
        grid-template-columns: 1fr;
    }

    .gm-practice-stage {
        padding: 16px 12px;
    }

    .gm-slide-footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .gm-slide-footer .action-btn {
        justify-content: center;
        width: 100%;
    }
}
/* ==========================================================================
   V11: REAL-LIFE CONVERSATIONS & ROLEPLAY STUDIO (/conversations) + 8-TAB NAVBAR
   ========================================================================== */

@media (min-width: 1025px) and (max-width: 1420px) {
    .main-navbar {
        gap: 4px;
    }

    .main-navbar .nav-tab {
        padding: 7px 10px;
        font-size: 0.82rem;
        gap: 5px;
    }

    .main-navbar .nav-tab-arena {
        padding: 6px 12px 6px 7px;
    }
}

.cv-filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 4px 0 14px;
}

.cv-level-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cv-level-tab:hover {
    border-color: rgba(60, 177, 245, 0.5);
    color: var(--text-primary);
}

.cv-level-tab.active {
    background: linear-gradient(135deg, #3cb1f5, #1e88e5);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(60, 177, 245, 0.28);
}

.cv-level-tab.active .gm-lvl-pill {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.cv-scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
}

.cv-scenario-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.cv-scenario-card:hover {
    transform: translateY(-3px);
    border-color: rgba(60, 177, 245, 0.55);
    box-shadow: 0 12px 28px rgba(60, 177, 245, 0.14);
}

.cv-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cv-avatar {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14);
}

.cv-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.cv-lvl-badge {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    color: #ffffff;
    letter-spacing: 0.03em;
}

.cv-lvl-a1 { background: #16A34A; }
.cv-lvl-a2 { background: #0284C7; }
.cv-lvl-b1 { background: #7C3AED; }
.cv-lvl-b2 { background: #BE185D; }

.cv-cat-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(60, 177, 245, 0.12);
    color: var(--accent-primary);
}

.cv-card-title {
    margin: 2px 0 0;
    font-size: 1.06rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
}

.cv-card-persona {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.cv-card-goal {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.48;
    color: var(--text-muted);
    flex: 1;
}

.cv-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--card-border);
    font-size: 0.8rem;
}

.cv-card-meta {
    color: var(--text-muted);
    font-weight: 600;
}

/* Turn-by-Turn Roleplay Studio */
.cv-studio-shell {
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cv-turn-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 10px 16px;
}

.cv-turn-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cv-step-dot {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    background: transparent;
}

.cv-step-dot.done {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.45);
    color: #059669;
}

[data-theme="dark"] .cv-step-dot.done {
    color: #34d399;
}

.cv-step-dot.active {
    background: linear-gradient(135deg, #3cb1f5, #1e88e5);
    border-color: transparent;
    color: #ffffff;
}

.cv-cheat-drawer {
    background: var(--card-bg);
    border: 1px solid rgba(60, 177, 245, 0.3);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cv-cheat-goal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.cv-target-tag {
    font-size: 0.76rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(60, 177, 245, 0.12);
    color: var(--accent-primary);
}

.cv-cheat-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.cv-cheat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cv-cheat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: rgba(60, 177, 245, 0.06);
    color: var(--text-primary);
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.cv-cheat-chip:hover {
    border-color: #3cb1f5;
    background: rgba(60, 177, 245, 0.14);
}

.cv-turn-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

.cv-partner-block {
    background: rgba(60, 177, 245, 0.06);
    border: 1px solid rgba(60, 177, 245, 0.22);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cv-partner-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cv-partner-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.cv-partner-role {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.cv-partner-question {
    font-size: clamp(1.1rem, 2vw, 1.32rem);
    font-weight: 700;
    line-height: 1.48;
    color: var(--text-primary);
}

.cv-audio-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.cv-speak-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.cv-wave-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 14px;
    border-radius: 12px;
    background: rgba(60, 177, 245, 0.08);
    border: 1px solid rgba(60, 177, 245, 0.24);
    max-width: 100%;
}

.cv-rec-timer {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.cv-type-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 2px 6px;
}

.cv-type-toggle:hover {
    color: var(--accent-primary);
}

.cv-type-box {
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cv-type-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.94rem;
    resize: vertical;
}

/* Per-Turn Assessment Card */
.cv-assessment-card {
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 18px;
    background: rgba(60, 177, 245, 0.03);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cv-assess-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.cv-assess-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cv-rel-badge {
    font-size: 0.82rem;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 999px;
}

.cv-rel-badge.rel-yes {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.cv-rel-badge.rel-partial {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.cv-rel-badge.rel-no {
    background: rgba(239, 68, 68, 0.14);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

[data-theme="dark"] .cv-rel-badge.rel-yes { color: #34d399; }
[data-theme="dark"] .cv-rel-badge.rel-partial { color: #fbbf24; }
[data-theme="dark"] .cv-rel-badge.rel-no { color: #f87171; }

.cv-meta-chip {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(60, 177, 245, 0.1);
    color: var(--text-secondary);
}

.cv-score-pill {
    font-weight: 800;
    font-size: 0.9rem;
    padding: 4px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #3cb1f5, #1e88e5);
    color: #ffffff;
}

.cv-said-box,
.cv-rewrite-box {
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cv-rewrite-box {
    border-color: rgba(16, 185, 129, 0.38);
    background: rgba(16, 185, 129, 0.06);
}

.cv-said-head,
.cv-rewrite-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cv-said-text {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
}

.cv-rel-note {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.cv-rewrite-text {
    font-size: 1rem;
    font-weight: 700;
    color: #047857;
    line-height: 1.5;
}

[data-theme="dark"] .cv-rewrite-text {
    color: #6ee7b7;
}

.cv-mini-btn {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.cv-mini-btn:hover {
    border-color: #3cb1f5;
    color: #3cb1f5;
}

.cv-mini-btn.hear-btn {
    border-color: rgba(16, 185, 129, 0.45);
    color: #059669;
}

[data-theme="dark"] .cv-mini-btn.hear-btn {
    color: #34d399;
}

.cv-coach-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cv-encouragement {
    margin: 0;
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.48;
}

.cv-imp-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cv-imp-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.28);
}

.cv-imp-label {
    flex-shrink: 0;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    background: #d97706;
    color: #ffffff;
}

.cv-imp-tip {
    font-size: 0.88rem;
    line-height: 1.48;
    color: var(--text-primary);
}

.cv-perfect-note {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #047857;
    font-size: 0.88rem;
    font-weight: 700;
}

[data-theme="dark"] .cv-perfect-note {
    color: #6ee7b7;
}

.cv-offtopic-warn {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.32);
    color: #b91c1c;
    font-size: 0.86rem;
}

[data-theme="dark"] .cv-offtopic-warn {
    color: #fca5a5;
}

/* Summary View */
.cv-sum-overall {
    margin: 4px auto 0;
    max-width: 600px;
    font-size: 0.94rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.cv-sum-bars {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.cv-sum-list {
    margin: 6px 0 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.88rem;
    line-height: 1.48;
    color: var(--text-primary);
}

.cv-review-details {
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 12px 16px;
    background: var(--card-bg);
}

.cv-review-summary {
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--text-primary);
    cursor: pointer;
}

.cv-review-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.cv-review-item {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.88rem;
}

.cv-review-q {
    color: var(--text-muted);
}

.cv-review-you {
    color: var(--text-primary);
}

.cv-review-sc {
    font-weight: 700;
    color: var(--accent-primary);
}

.cv-review-native {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #047857;
    font-weight: 600;
}

[data-theme="dark"] .cv-review-native {
    color: #6ee7b7;
}

@media (max-width: 700px) {
    .cv-turn-card {
        padding: 16px 14px;
    }

    .cv-sum-bars {
        grid-template-columns: 1fr;
    }

    .cv-partner-block {
        padding: 14px;
    }
}
/* ==========================================================================
   V12: BLUE MINIMALIST SVG ICON SYSTEM, ARENA PHONEME DIAGNOSTICS & SEQUENTIAL GRAMMAR
   ========================================================================== */

.tv-ico {
    display: inline-block;
    vertical-align: -0.18em;
    flex-shrink: 0;
    color: #3cb1f5;
    stroke: currentColor;
}

.nav-tab.active .tv-ico,
.nav-tab-arena .arena-mic-badge .tv-ico,
.mobile-drawer-item.active .tv-ico,
.action-btn.next-btn .tv-ico,
.cv-level-tab.active .tv-ico,
.gm-level-tab.active .tv-ico,
.welcome-cta-btn .tv-ico,
.trans-mode-pill.active .tv-ico,
.fw-tab-btn.active .tv-ico {
    color: #ffffff;
}

.switch-icon .tv-ico {
    width: 13px;
    height: 13px;
}

.modal-icon .tv-ico,
.modal-icon-badge .tv-ico {
    width: 22px;
    height: 22px;
    color: #3cb1f5;
}

.tv-lang-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 20px;
    padding: 0 5px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    background: rgba(60, 177, 245, 0.14);
    color: #0284c7;
    border: 1px solid rgba(60, 177, 245, 0.35);
    vertical-align: middle;
}

[data-theme="dark"] .tv-lang-pill {
    background: rgba(60, 177, 245, 0.18);
    color: #7dd3fc;
    border-color: rgba(60, 177, 245, 0.4);
}

/* About Modal — What Makes TalkVance Unique Cards */
.about-unique-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 10px 0 18px;
}

.about-unique-card {
    background: rgba(60, 177, 245, 0.06);
    border: 1px solid rgba(60, 177, 245, 0.24);
    border-radius: 14px;
    padding: 14px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.about-unique-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.about-unique-card p {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.52;
    color: var(--text-secondary);
}

@media (max-width: 680px) {
    .about-unique-grid {
        grid-template-columns: 1fr;
    }
}

/* Arena — Phoneme Weakness Diagnostic & Session Tracker (Below Mic Button) */
.phoneme-diagnostic-panel {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    text-align: left;
}

.pd-sentence-box,
.pd-session-box {
    background: var(--card-bg);
    border: 1px solid rgba(60, 177, 245, 0.26);
    border-radius: 16px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pd-sentence-box:empty {
    display: none;
}

.pd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.pd-title-group {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.pd-badge {
    font-size: 0.74rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 999px;
}

.pd-badge.good {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.pd-badge.warn {
    background: rgba(60, 177, 245, 0.14);
    color: #0284c7;
    border: 1px solid rgba(60, 177, 245, 0.35);
}

[data-theme="dark"] .pd-badge.good { color: #34d399; }
[data-theme="dark"] .pd-badge.warn { color: #7dd3fc; }

.pd-clean-msg,
.pd-session-sub {
    margin: 0;
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.pd-issue-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pd-issue-card {
    background: rgba(60, 177, 245, 0.05);
    border: 1px solid var(--card-border);
    border-left: 3px solid #3cb1f5;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pd-issue-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pd-ipa-chip {
    font-family: var(--font-mono);
    font-size: 0.94rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 8px;
    background: rgba(60, 177, 245, 0.16);
    color: #0284c7;
    border: 1px solid rgba(60, 177, 245, 0.35);
}

.pd-ipa-chip.sm {
    font-size: 0.84rem;
    padding: 2px 8px;
}

[data-theme="dark"] .pd-ipa-chip {
    color: #7dd3fc;
}

.pd-cue-tag {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.pd-miss-count {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

.pd-explain,
.pd-tip {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.54;
    color: var(--text-primary);
}

.pd-tip {
    color: var(--text-secondary);
}

.pd-word-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 2px;
}

.pd-word-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(60, 177, 245, 0.35);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.16s ease;
}

.pd-word-btn:hover {
    border-color: #3cb1f5;
    background: rgba(60, 177, 245, 0.12);
}

.pd-word-btn.mini {
    padding: 3px 9px;
    font-size: 0.76rem;
}

.pd-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.pd-reset-btn:hover {
    color: #3cb1f5;
    border-color: #3cb1f5;
}

.pd-session-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pd-session-row {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 9px 12px;
    background: rgba(60, 177, 245, 0.03);
}

.pd-session-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    list-style: none;
    font-size: 0.84rem;
}

.pd-session-summary::-webkit-details-marker {
    display: none;
}

.pd-rank {
    font-weight: 800;
    color: #3cb1f5;
    min-width: 22px;
}

.pd-session-cue {
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.pd-bar-wrap {
    flex: 1;
    height: 7px;
    border-radius: 999px;
    background: rgba(60, 177, 245, 0.14);
    overflow: hidden;
    min-width: 50px;
}

.pd-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #3cb1f5, #1e88e5);
}

.pd-session-cnt {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.pd-session-body {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Sequential Turn-by-Turn Grammar Locks & Toast */
.gm-module-card.locked {
    opacity: 0.62;
    cursor: not-allowed;
    border-style: dashed;
}

.gm-module-card.locked:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--card-border);
}

.gm-mod-locked-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(60, 177, 245, 0.1);
    color: var(--text-muted);
    border: 1px solid var(--card-border);
}

.gm-stepper-item.locked {
    opacity: 0.45;
    cursor: not-allowed;
}

.gm-lock-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid rgba(60, 177, 245, 0.45);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.32);
    opacity: 0;
    pointer-events: none;
    transition: all 0.22s ease;
    z-index: 9999;
    max-width: 92vw;
    text-align: center;
}

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

/* ==========================================================================
   V13: GRAMMAR A1-C2 + DEV UNLOCK (3333) + IELTS SPEAKING STUDIO (/ielts)
   ========================================================================== */
.gm-hub-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.gm-dev-key-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 11px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-solid, #ffffff);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.gm-dev-key-btn:hover {
    border-color: var(--primary);
    background: rgba(60, 177, 245, 0.1);
}
.gm-dev-key-btn.unlocked {
    background: rgba(29, 78, 216, 0.12);
    border-color: #3b82f6;
    color: #1d4ed8;
}
[data-theme="dark"] .gm-dev-key-btn {
    background: rgba(30, 41, 59, 0.85);
}
[data-theme="dark"] .gm-dev-key-btn.unlocked {
    background: rgba(59, 130, 246, 0.22);
    color: #93c5fd;
}
.gm-dev-modal-card {
    max-width: 400px;
    padding: 24px;
}
.gm-dev-modal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    margin-bottom: 8px;
}
.gm-dev-modal-head h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.15rem;
}
.gm-dev-modal-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 14px;
    line-height: 1.45;
}
.gm-dev-code-form {
    display: flex;
    gap: 8px;
}
.gm-dev-code-input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--bg-app);
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}
.gm-dev-code-err {
    margin-top: 8px;
    color: #dc2626;
    font-size: 0.84rem;
    font-weight: 600;
}
.gm-word.gm-role-plain {
    color: var(--text-main);
    background: transparent;
    border: none;
    padding: 2px 3px;
}

/* IELTS Speaking Studio */
.ie-hero {
    text-align: center;
    max-width: 820px;
    margin: 0 auto 18px;
}
.ie-tabs-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
    padding: 8px;
    border-radius: 16px;
    background: var(--surface-solid, #ffffff);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .ie-tabs-bar {
    background: rgba(15, 23, 42, 0.82);
}
.ie-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    border-radius: 11px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.ie-tab-btn:hover {
    color: var(--primary);
    background: rgba(60, 177, 245, 0.08);
}
.ie-tab-btn.active {
    background: linear-gradient(135deg, #2b9ae8, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.22);
}
.ie-tab-btn.active .tv-ico {
    color: #ffffff;
}
.ie-stage {
    max-width: 980px;
    margin: 0 auto 28px;
}
.ie-card {
    background: var(--surface-solid, #ffffff);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .ie-card {
    background: rgba(15, 23, 42, 0.84);
}
.ie-sec-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.12);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
}
[data-theme="dark"] .ie-sec-badge {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.2);
}
.ie-card-title {
    margin: 0 0 10px;
    font-size: 1.3rem;
    color: var(--text-main);
}
.ie-sub-title {
    font-size: 1rem;
    margin: 16px 0 8px;
    color: var(--text-main);
}
.ie-card-head-row, .ie-mock-header, .ie-vocab-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.ie-lead {
    color: var(--text-main);
    line-height: 1.6;
    margin: 0 0 14px;
    font-size: 0.96rem;
}
.ie-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}
.ie-pill-blue {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    font-weight: 700;
    font-size: 0.78rem;
}
[data-theme="dark"] .ie-pill-blue {
    background: rgba(59, 130, 246, 0.24);
    color: #93c5fd;
}
.ie-orange-hl {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 7px;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    font-weight: 700;
}
[data-theme="dark"] .ie-orange-hl {
    background: rgba(194, 65, 12, 0.24);
    color: #fdba74;
    border-color: rgba(251, 146, 60, 0.45);
}

/* Tables */
.ie-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.ie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.89rem;
}
.ie-table th, .ie-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.ie-table thead th {
    background: rgba(59, 130, 246, 0.08);
    color: var(--text-main);
    font-weight: 700;
}
.ie-table-compact td, .ie-table-compact th {
    padding: 8px 10px;
    font-size: 0.82rem;
}

/* Expandable Criteria Accordion */
.ie-acc-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}
.ie-acc-item {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-app);
}
.ie-acc-head {
    width: 100%;
    border: none;
    background: transparent;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: left;
    cursor: pointer;
    color: var(--text-main);
}
.ie-acc-head > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.ie-acc-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}
.ie-acc-chev {
    transition: transform 0.2s ease;
    color: var(--primary);
}
.ie-acc-item.open .ie-acc-chev {
    transform: rotate(180deg);
}
.ie-acc-body {
    display: none;
    padding: 0 16px 14px;
    border-top: 1px solid var(--border);
}
.ie-acc-item.open .ie-acc-body {
    display: block;
}
.ie-acc-sec h4 {
    margin: 12px 0 4px;
    font-size: 0.92rem;
    color: #1d4ed8;
}
[data-theme="dark"] .ie-acc-sec h4 {
    color: #93c5fd;
}
.ie-acc-sec p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-main);
}

/* Band Reference & Comparisons */
.ie-band-ref-grid, .ie-compare-grid, .ie-2col-tips, .ie-qtype-grid, .ie-scratch-grid, .ie-mock-grid, .ie-criteria-report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.ie-band-ref-card, .ie-tip-box, .ie-qtype-card, .ie-scratch-box, .ie-crit-card {
    padding: 14px;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: var(--bg-app);
}
.ie-tip-box.highlight {
    border-color: rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.06);
}
.ie-band-ref-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    color: #1d4ed8;
}
[data-theme="dark"] .ie-band-ref-top {
    color: #93c5fd;
}
.ie-band-ref-card p, .ie-tip-box p, .ie-scratch-box p {
    margin: 4px 0 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-main);
}
.ie-qtype-card span {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.ie-cmp-box {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1.5px solid var(--border);
}
.ie-cmp-low {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.28);
}
.ie-cmp-high {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.34);
}
.ie-cmp-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.ie-cmp-txt {
    margin: 0 0 8px;
    line-height: 1.65;
    font-size: 0.96rem;
    color: var(--text-main);
}
.ie-cmp-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Framework Blocks & Segments */
.ie-fw-block {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 700;
    border: 1px solid transparent;
}
.ie-fw-core, .ie-seg-core { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.ie-fw-slot, .ie-seg-slot { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; }
.ie-fw-linker, .ie-seg-linker { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.ie-fw-diag, .ie-seg-diag { background: #faf5ff; color: #7e22ce; border-color: #e9d5ff; }
.ie-seg {
    padding: 1px 5px;
    border-radius: 6px;
    border: 1px solid transparent;
}
[data-theme="dark"] .ie-fw-core, [data-theme="dark"] .ie-seg-core { background: rgba(29, 78, 216, 0.24); color: #93c5fd; border-color: rgba(96, 165, 250, 0.4); }
[data-theme="dark"] .ie-fw-slot, [data-theme="dark"] .ie-seg-slot { background: rgba(15, 118, 110, 0.25); color: #5eead4; border-color: rgba(45, 212, 191, 0.35); }
[data-theme="dark"] .ie-fw-linker, [data-theme="dark"] .ie-seg-linker { background: rgba(194, 65, 12, 0.26); color: #fdba74; border-color: rgba(251, 146, 60, 0.4); }
[data-theme="dark"] .ie-fw-diag, [data-theme="dark"] .ie-seg-diag { background: rgba(126, 34, 206, 0.25); color: #d8b4fe; border-color: rgba(192, 132, 252, 0.4); }

.ie-linker-bank {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 12px 0;
    font-size: 0.88rem;
}
.ie-watchout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.28);
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 12px;
}
.ie-watchout .tv-ico {
    flex-shrink: 0;
    color: #2563eb;
    margin-top: 2px;
}

/* Stepper */
.ie-stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.ie-step-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-solid, #ffffff);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}
[data-theme="dark"] .ie-step-pill {
    background: rgba(15, 23, 42, 0.84);
}
.ie-step-pill.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
}
.ie-step-pill.done {
    border-color: #16a34a;
    color: #15803d;
}
.ie-step-pill.locked {
    opacity: 0.55;
    cursor: not-allowed;
}
.ie-step-n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.2);
    font-size: 0.75rem;
}
.ie-step-pill.active .ie-step-n {
    background: rgba(255, 255, 255, 0.25);
}

/* Prompt Banner, Cue Cards & Mic Bar */
.ie-prompt-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(59, 130, 246, 0.08);
    border: 1.5px solid rgba(59, 130, 246, 0.28);
    font-size: 1.06rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 10px 0 14px;
}
.ie-cue-card {
    padding: 18px 20px;
    border-radius: 15px;
    border: 2px solid rgba(59, 130, 246, 0.35);
    background: var(--bg-app);
    margin-bottom: 14px;
}
.ie-cue-card.compact { padding: 14px 16px; }
.ie-cue-tag {
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #1d4ed8;
    margin-bottom: 6px;
}
[data-theme="dark"] .ie-cue-tag { color: #93c5fd; }
.ie-cue-card h3 { margin: 0 0 8px; font-size: 1.12rem; }
.ie-cue-card ul { margin: 4px 0 0; padding-left: 20px; line-height: 1.65; }

.ie-mic-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 14px 0 8px;
}
.ie-mic-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #2b9ae8, #1d4ed8);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.25);
    transition: transform 0.15s ease;
}
.ie-mic-btn:hover { transform: translateY(-1px); }
.ie-mic-btn.compact { padding: 9px 14px; font-size: 0.86rem; }
.ie-mic-btn.recording {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    animation: pulseMic 1.2s infinite;
}
.ie-mic-btn .tv-ico { color: #ffffff; }
.ie-live-timer {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.98rem;
    padding: 6px 11px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
}
.ie-live-timer.lg { font-size: 1.2rem; padding: 7px 14px; }
[data-theme="dark"] .ie-live-timer { color: #93c5fd; }
.ie-mic-status {
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* Diagnostics & 4-Color Pointers */
.ie-diag-card {
    margin-top: 14px;
    padding: 16px;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    background: var(--bg-app);
}
.ie-diag-top {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.ie-band-pill-lg {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2b9ae8, #1d4ed8);
    color: #ffffff;
    min-width: 92px;
}
.ie-band-pill-lg span { font-size: 0.72rem; text-transform: uppercase; opacity: 0.9; }
.ie-band-pill-lg strong { font-size: 1.55rem; line-height: 1.1; }
.ie-band-mini-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}
.ie-band-mini {
    flex: 1 1 85px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-solid, #ffffff);
    text-align: center;
}
[data-theme="dark"] .ie-band-mini { background: rgba(15, 23, 42, 0.85); }
.ie-band-mini span { display: block; font-size: 0.72rem; color: var(--text-muted); }
.ie-band-mini strong { font-size: 1.05rem; color: var(--text-main); }
.ie-heard-box {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.12);
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.5;
}
.ie-timing-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
    margin: 0 8px 10px 0;
}
.ie-timing-pill.ok { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.ie-timing-pill.warn { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
[data-theme="dark"] .ie-timing-pill.ok { background: rgba(21, 128, 61, 0.22); color: #86efac; }
[data-theme="dark"] .ie-timing-pill.warn { background: rgba(194, 65, 12, 0.24); color: #fdba74; }

.ie-4color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    margin: 10px 0;
}
.ie-ptr {
    padding: 11px 13px;
    border-radius: 11px;
    border-left: 4px solid;
    font-size: 0.86rem;
    line-height: 1.48;
}
.ie-ptr p { margin: 4px 0 0; }
.ie-ptr-green { background: #f0fdf4; border-color: #16a34a; color: #14532d; }
.ie-ptr-orange { background: #fff7ed; border-color: #ea580c; color: #7c2d12; }
.ie-ptr-red { background: #fef2f2; border-color: #dc2626; color: #7f1d1d; }
.ie-ptr-blue { background: #eff6ff; border-color: #2563eb; color: #1e3a8a; }
[data-theme="dark"] .ie-ptr-green { background: rgba(22, 163, 74, 0.18); color: #bbf7d0; }
[data-theme="dark"] .ie-ptr-orange { background: rgba(234, 88, 12, 0.18); color: #fed7aa; }
[data-theme="dark"] .ie-ptr-red { background: rgba(220, 38, 38, 0.18); color: #fecaca; }
[data-theme="dark"] .ie-ptr-blue { background: rgba(37, 99, 235, 0.18); color: #bfdbfe; }

.ie-rewrite-box, .ie-hint-box, .ie-model-box {
    padding: 12px 14px;
    border-radius: 12px;
    margin-top: 10px;
    font-size: 0.9rem;
    line-height: 1.55;
}
.ie-rewrite-box { background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.3); }
.ie-rewrite-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.ie-hint-box { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.35); }
.ie-model-box { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.32); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

/* Part 2 Keyword Sprint & Exam Box */
.ie-sprint-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.ie-sprint-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.ie-sprint-field { display: flex; flex-direction: column; gap: 5px; }
.ie-sprint-field label { font-size: 0.82rem; font-weight: 700; color: var(--text-main); }
.ie-sprint-input, .ie-scratch-area {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--surface-solid, #ffffff);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.92rem;
    box-sizing: border-box;
}
[data-theme="dark"] .ie-sprint-input, [data-theme="dark"] .ie-scratch-area { background: rgba(15, 23, 42, 0.85); }
.ie-word-cap { font-size: 0.76rem; color: var(--text-muted); text-align: right; }
.ie-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.ie-p2-exam-box { padding: 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-app); }
.ie-p2-timer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ie-phase-badge { font-weight: 700; font-size: 0.88rem; color: #1d4ed8; }
[data-theme="dark"] .ie-phase-badge { color: #93c5fd; }
.ie-vocab-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }

/* Mock Tests & Audio-First Gate */
.ie-mock-card {
    padding: 16px;
    border-radius: 15px;
    border: 1.5px solid var(--border);
    background: var(--bg-app);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}
.ie-mock-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.ie-mock-top { display: flex; justify-content: space-between; align-items: center; }
.ie-mock-card h3 { margin: 0; font-size: 1.05rem; }
.ie-mock-meta { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

.ie-audio-gate {
    padding: 20px;
    border-radius: 16px;
    border: 2px dashed rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.05);
    text-align: center;
}
.ie-audio-gate.revealed {
    border-style: solid;
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.06);
}
.ie-gate-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    color: #1d4ed8;
    margin-bottom: 10px;
}
[data-theme="dark"] .ie-gate-status { color: #93c5fd; }
.ie-hidden-q-mask {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 14px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.12);
    margin: 8px auto 14px;
    max-width: 560px;
}
.ie-revealed-q {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 8px 0 14px;
}
.ie-overall-hero {
    text-align: center;
    padding: 22px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(43, 154, 232, 0.14), rgba(29, 78, 216, 0.1));
    border: 1.5px solid rgba(59, 130, 246, 0.35);
    margin-bottom: 16px;
}
.ie-overall-hero span { font-size: 0.84rem; font-weight: 700; text-transform: uppercase; color: #1d4ed8; }
[data-theme="dark"] .ie-overall-hero span { color: #93c5fd; }
.ie-overall-hero strong { display: block; font-size: 3rem; color: #1d4ed8; line-height: 1.1; margin: 6px 0; }
[data-theme="dark"] .ie-overall-hero strong { color: #60a5fa; }
.ie-crit-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.ie-band-badge { padding: 4px 10px; border-radius: 999px; background: #1d4ed8; color: #ffffff; font-weight: 800; font-size: 0.84rem; }
.ie-crit-str, .ie-crit-up { margin: 6px 0 0; font-size: 0.88rem; line-height: 1.5; }

/* Idioms & Cohesive Agents Loop */
.ie-filter-row, .ie-card-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.ie-pill-tab {
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-app);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}
.ie-pill-tab.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
}
.ie-item-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 126px;
    overflow-y: auto;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-app);
    margin-bottom: 16px;
}
.ie-item-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-solid, #ffffff);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}
[data-theme="dark"] .ie-item-chip { background: rgba(15, 23, 42, 0.85); }
.ie-item-chip.active { background: #1d4ed8; color: #ffffff; border-color: #1d4ed8; }
.ie-item-chip.done { border-color: #16a34a; color: #15803d; }
.ie-item-chip.active.done { color: #ffffff; }
.ie-loop-box { display: flex; flex-direction: column; gap: 14px; }
.ie-loop-step {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-app);
}
.ie-step-tag {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 8px;
}
.ie-teach-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ie-target-phrase { margin: 0; font-size: 1.35rem; color: var(--text-main); }
.ie-l1-badge {
    padding: 3px 9px;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.16);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
}
.ie-logic-rule {
    margin: 0 0 8px;
    padding: 8px 11px;
    border-radius: 9px;
    background: rgba(59, 130, 246, 0.08);
    font-size: 0.86rem;
}
.ie-alert-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    color: #c2410c;
}
[data-theme="dark"] .ie-alert-inline { color: #fdba74; }
.ie-example-sent, .ie-read-text {
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--text-main);
    margin: 0 0 10px;
}
.ie-task-prompt { font-size: 1rem; font-weight: 600; margin: 0 0 10px; }
.ie-slide-nav, .ie-next-cta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.ie-summary-card { text-align: center; }
.ie-summary-score { margin: 14px auto; }
.ie-summary-score strong { display: block; font-size: 2.8rem; color: #1d4ed8; }
[data-theme="dark"] .ie-summary-score strong { color: #60a5fa; }

@media (max-width: 680px) {
    .ie-card { padding: 16px 14px; }
    .ie-tabs-bar { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
    .ie-tab-btn { flex: 0 0 auto; }
    .ie-prompt-banner { font-size: 0.98rem; }
}
