/* ==========================================================================
   TypingPediaWeb - Learn Typing (Advanced & Responsive)
   Modeled directly after TypingGuru Android App
   ========================================================================== */

:root {
    --tp-teal-primary: #0d9488;
    --tp-teal-dark: #0f766e;
    --tp-teal-light: #ccfbf1;
    --tp-teal-subtle: #f0fdfa;
    --tp-slate-950: #020617;
    --tp-slate-900: #0f172a;
    --tp-slate-800: #1e293b;
    --tp-slate-700: #334155;
    --tp-slate-600: #475569;
    --tp-slate-500: #64748b;
    --tp-slate-400: #94a3b8;
    --tp-slate-200: #e2e8f0;
    --tp-slate-100: #f1f5f9;
    --tp-slate-50: #f8fafc;
    --tp-emerald: #10b981;
    --tp-emerald-subtle: #ecfdf5;
    --tp-rose: #ef4444;
    --tp-rose-subtle: #fef2f2;
    --tp-amber: #f59e0b;
    --tp-amber-subtle: #fffbeb;
    --tp-indigo: #6366f1;
    --tp-indigo-subtle: #eef2ff;
    --tp-card-radius: 16px;
    --tp-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --tp-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --tp-shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --tp-font-kruti: 'Kruti Dev 010', 'Walkman-Chanakya', sans-serif;
}

.tp-learn-page {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background: #f8fafc;
    min-height: calc(100vh - 120px);
    padding: 30px 16px 60px;
    color: var(--tp-slate-800);
}

.tp-learn-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* ─── Breadcrumbs Navigation Bar (SEO Rich Snippets) ─── */
.tp-breadcrumbs-bar {
    margin-bottom: 14px;
    padding: 4px 0;
}

.tp-breadcrumbs-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.tp-breadcrumbs-list {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
}

.tp-crumb-item {
    display: inline-flex;
    align-items: center;
}

.tp-crumb-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #475569;
    text-decoration: none;
    transition: color 0.15s ease;
}

.tp-crumb-link:hover {
    color: #0284c7;
    text-decoration: underline;
}

.tp-crumb-sep {
    color: #cbd5e1;
    font-size: 0.72rem;
    user-select: none;
}

.tp-crumb-item.is-active {
    color: #0f172a;
    font-weight: 700;
}

.tp-crumb-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #334155;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.tp-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
}

/* Mobile App Banner (Hidden on desktop, clean on mobile) */
.tp-mobile-app-banner {
    display: none;
}

@media (max-width: 768px) {
    .tp-mobile-app-banner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        background: #ffffff;
        border: 1.5px solid #bfdbfe;
        border-radius: 14px;
        padding: 9px 12px;
        margin-bottom: 14px;
        box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
        width: 100%;
        box-sizing: border-box;
    }
    .tp-mob-banner-left {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        flex: 1;
    }
    .tp-mob-banner-logo-img {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        object-fit: cover;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
        flex-shrink: 0;
    }
    .tp-mob-banner-text {
        display: flex;
        flex-direction: column;
        line-height: 1.2;
        min-width: 0;
    }
    .tp-mob-banner-text strong {
        font-size: 0.84rem;
        color: #0f172a;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .tp-mob-banner-text span {
        font-size: 0.7rem;
        color: #64748b;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .tp-mob-banner-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
    }
    .tp-btn-mob-view {
        padding: 6px 10px;
        font-size: 0.72rem;
        font-weight: 700;
        border-radius: 8px;
        border: 1px solid #cbd5e1;
        background: #f8fafc;
        color: #475569;
        cursor: pointer;
    }
    .tp-btn-mob-download {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 6px 11px;
        font-size: 0.72rem;
        font-weight: 800;
        border-radius: 8px;
        background: #2563eb;
        color: #ffffff;
        text-decoration: none;
        white-space: nowrap;
    }
}

/* ─── Sleek Compact Header ─── */
.tp-learn-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

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

.tp-learn-title-block {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tp-learn-main-title {
    font-size: 1.45rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.2;
}

.tp-learn-sub-count {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--tp-theme-text, #475569);
    background: var(--tp-theme-subtle, #e2e8f0);
    border: 1px solid var(--tp-theme-border, #cbd5e1);
    padding: 3px 9px;
    border-radius: 12px;
}

/* ─── Compact Segmented Language Switcher ─── */
.tp-lang-tabs {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    padding: 3px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    gap: 3px;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tp-lang-tabs::-webkit-scrollbar {
    display: none;
}

.tp-lang-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 9px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-align: left;
    flex-shrink: 0;
}

.tp-lang-tab:hover:not(.active) {
    background: #f8fafc;
    color: #0f172a;
}

.tp-lang-flag {
    font-size: 1.1rem;
    line-height: 1;
}

.tp-lang-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: #334155;
    line-height: 1;
}

.tp-lang-count {
    background: #f1f5f9;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 12px;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* ─── Per-Language Color Variables ─── */
.tp-learn-page.tp-lang-theme-english {
    --tp-theme-primary: #2563eb;
    --tp-theme-primary-hover: #1d4ed8;
    --tp-theme-subtle: #eff6ff;
    --tp-theme-border: #bfdbfe;
    --tp-theme-text: #1e40af;
    --tp-theme-shadow: rgba(37, 99, 235, 0.2);
}

.tp-learn-page.tp-lang-theme-mangal {
    --tp-theme-primary: #059669;
    --tp-theme-primary-hover: #047857;
    --tp-theme-subtle: #ecfdf5;
    --tp-theme-border: #a7f3d0;
    --tp-theme-text: #065f46;
    --tp-theme-shadow: rgba(5, 150, 105, 0.2);
}

.tp-learn-page.tp-lang-theme-krutidev {
    --tp-theme-primary: #ea580c;
    --tp-theme-primary-hover: #c2410c;
    --tp-theme-subtle: #fff7ed;
    --tp-theme-border: #fed7aa;
    --tp-theme-text: #9a3412;
    --tp-theme-shadow: rgba(234, 88, 12, 0.2);
}

/* Tab Active State with Distinct Language Colors */
.tp-lang-tab.active .tp-lang-name {
    color: #ffffff !important;
}

.tp-lang-tab.active .tp-lang-count {
    background: rgba(255, 255, 255, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
}

.tp-lang-tab[data-font="english"].active {
    background: #2563eb !important;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28) !important;
}

.tp-lang-tab[data-font="mangal"].active {
    background: #059669 !important;
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.28) !important;
}

.tp-lang-tab[data-font="krutidev"].active {
    background: #ea580c !important;
    box-shadow: 0 3px 10px rgba(234, 88, 12, 0.28) !important;
}

/* ─── Dashboard Section ─── */
.tp-learn-dashboard {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ─── Compact Controls Strip ─── */
.tp-curriculum-header-strip {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 8px 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

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

/* ─── Search Input in Strip ─── */
.tp-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 8px 14px;
    min-width: 220px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tp-search-wrap:focus-within {
    border-color: #0284c7;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.tp-search-wrap svg {
    width: 15px;
    height: 15px;
    color: #94a3b8;
    flex-shrink: 0;
}

.tp-search-wrap input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.82rem;
    color: #0f172a;
    width: 100%;
}

/* ─── Control Pills (Duration & Backspace) ─── */
.tp-control-pill {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tp-control-pill:hover {
    border-color: #0284c7;
    background: #ffffff;
}

.tp-pill-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    flex-shrink: 0;
}

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

.tp-pill-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.tp-pill-lbl {
    font-size: 0.6rem;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

.tp-pill-val {
    font-size: 0.82rem;
    font-weight: 800;
    color: #1e293b;
}

.tp-pill-arrow {
    width: 13px;
    height: 13px;
    color: #94a3b8;
    margin-left: 2px;
    transition: transform 0.2s;
}

.tp-duration-pill.open .tp-pill-arrow {
    transform: rotate(180deg);
}

.tp-duration-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: #ffffff;
    border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.15);
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 3px;
    z-index: 50;
    animation: tpFadeInDown 0.18s ease-out;
}

.tp-duration-pill.open .tp-duration-menu {
    display: flex;
}

.tp-duration-opt {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 9px 12px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 800;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s;
}

.tp-duration-opt:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.tp-duration-opt.active {
    background: #eff6ff;
    color: #0284c7;
}

/* Backspace Switch Pill */
.tp-backspace-pill.is-allowed {
    border-color: #a7f3d0;
    background: #f0fdf4;
}

.tp-backspace-pill.is-allowed .tp-pill-icon {
    color: #16a34a;
    background: #dcfce7;
}

.tp-backspace-pill.is-allowed .tp-pill-val {
    color: #15803d;
}

.tp-backspace-pill.is-disabled {
    border-color: #fca5a5;
    background: #fef2f2;
}

.tp-backspace-pill.is-disabled .tp-pill-icon {
    color: #dc2626;
    background: #fee2e2;
}

.tp-backspace-pill.is-disabled .tp-pill-val {
    color: #b91c1c;
}

.tp-toggle-switch {
    width: 32px;
    height: 18px;
    border-radius: 20px;
    background: #cbd5e1;
    position: relative;
    transition: background 0.2s;
    margin-left: 4px;
}

.tp-toggle-handle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tp-backspace-pill.is-allowed .tp-toggle-switch {
    background: #22c55e;
}

.tp-backspace-pill.is-allowed .tp-toggle-handle {
    transform: translateX(14px);
}

.tp-backspace-pill.is-disabled .tp-toggle-switch {
    background: #ef4444;
}

/* ==========================================================================
   CURRICULUM LAYOUT: TWO-COLUMN (DESKTOP) & HORIZONTAL CHIP BAR (MOBILE)
   ========================================================================== */
.tp-curriculum-container {
    display: flex;
    gap: 18px;
    align-items: stretch;
}

/* ─── Left Sidebar (Desktop) ─── */
.tp-curriculum-sidebar {
    width: 295px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tp-sidebar-cat-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tp-sidebar-cat-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 2px 0 2px 4px;
}

.tp-sidebar-units-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Chapter Tab Card (Desktop) */
.tp-unit-tab {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.tp-unit-tab:hover:not(.active) {
    border-color: #94a3b8;
    background: #f8fafc;
    transform: translateY(-1px);
}

.tp-unit-tab-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.tp-unit-tab-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: all 0.15s;
}

.tp-unit-tab-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.tp-unit-tab-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.25;
    white-space: normal;
    word-break: break-word;
}

.tp-unit-tab-subtitle {
    font-size: 0.7rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tp-unit-count-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 2px 7px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}

/* Active Chapter Tab */
.tp-unit-tab.active {
    background: var(--tp-theme-primary, #0f172a) !important;
    border-color: var(--tp-theme-primary, #0f172a) !important;
    box-shadow: 0 3px 10px var(--tp-theme-shadow, rgba(15, 23, 42, 0.15)) !important;
}

.tp-unit-tab.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3.5px;
    background: #ffffff;
    border-radius: 0 3px 3px 0;
}

.tp-unit-tab.active .tp-unit-tab-title {
    color: #ffffff !important;
}

.tp-unit-tab.active .tp-unit-tab-subtitle {
    color: rgba(255, 255, 255, 0.85) !important;
}

.tp-unit-tab.active .tp-unit-tab-icon {
    background: rgba(255, 255, 255, 0.18) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}

.tp-unit-tab.active .tp-unit-count-badge {
    background: rgba(255, 255, 255, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
}

/* ─── Right Canvas: Modern Curriculum Stage ─── */
.tp-curriculum-stage {
    flex: 1;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 480px;
}

/* Stage Header Banner: Compact & Non-AI */
.tp-stage-header {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.tp-stage-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.tp-stage-chapter-badge {
    background: var(--tp-theme-primary, #0f172a);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    padding: 3px 9px;
    border-radius: 6px;
    text-transform: uppercase;
    white-space: nowrap;
}

.tp-stage-heading-wrap {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.tp-stage-title {
    font-size: 1.12rem;
    font-weight: 900;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}

.tp-stage-subtitle {
    font-size: 0.76rem;
    color: #64748b;
    margin: 0;
    line-height: 1.25;
}

.tp-stage-count-tag {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 3px 9px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ─── Lessons List: Compact Clean Cards ─── */
.tp-stage-lessons-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tp-lessons-loading {
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Compact Lesson Card */
.tp-lesson-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.tp-lesson-card:hover {
    border-color: var(--tp-theme-primary, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--tp-theme-shadow, rgba(37, 99, 235, 0.08));
}

.tp-lesson-card.is-recommended {
    border-color: var(--tp-theme-border, #bfdbfe);
    background: #ffffff;
}

.tp-card-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.tp-lesson-index-badge {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--tp-theme-subtle, #f1f5f9);
    border: 1px solid var(--tp-theme-border, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tp-lesson-card.is-recommended .tp-lesson-index-badge {
    background: var(--tp-theme-subtle, #eff6ff);
    border-color: var(--tp-theme-border, #bfdbfe);
}

.tp-idx-num {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--tp-theme-primary, #334155);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.tp-lesson-card.is-recommended .tp-idx-num {
    color: var(--tp-theme-primary, #2563eb);
}

.tp-lesson-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0;
}

/* Headline with Title & Tags Inline */
.tp-lesson-headline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tp-lesson-title {
    font-size: 1.02rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.25;
}

.tp-lesson-title.is-krutidev {
    font-family: 'Kruti Dev 010', 'KrutiDev010', monospace;
    font-size: 1.2rem;
}

.tp-lesson-tags-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.tp-tag {
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 4px;
    padding: 1px 6px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.tp-tag-row {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.tp-tag-shift {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.tp-tag-hand {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Miniature 3D Keycaps Preview Strip */
.tp-lesson-keycaps-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tp-keycaps-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.tp-keycaps-cluster {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.tp-kc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 23px;
    height: 23px;
    padding: 0 5px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #cbd5e1;
    border-bottom: 2px solid #94a3b8;
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    user-select: none;
    transition: transform 0.1s;
}

.tp-kc:hover {
    transform: translateY(1px);
    border-bottom-width: 1px;
}

.tp-kc-text {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
}

/* ─── Start Practice Buttons (Clean & Professional) ─── */
.tp-card-right {
    flex-shrink: 0;
}

.tp-btn-practice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: all 0.12s ease;
    white-space: nowrap;
    user-select: none;
    letter-spacing: 0.01em;
}

/* Primary Button */
.tp-btn-practice.is-primary {
    background: var(--tp-theme-primary, #0f172a);
    color: #ffffff;
    box-shadow: 0 2px 6px var(--tp-theme-shadow, rgba(15, 23, 42, 0.15));
}

.tp-btn-practice.is-primary:hover {
    background: var(--tp-theme-primary-hover, #1e293b);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px var(--tp-theme-shadow, rgba(15, 23, 42, 0.2));
}

/* Secondary Button */
.tp-btn-practice.is-secondary {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #1e293b;
}

.tp-btn-practice.is-secondary:hover {
    background: var(--tp-theme-subtle, #e2e8f0);
    border-color: var(--tp-theme-primary, #94a3b8);
    color: var(--tp-theme-primary, #1e293b);
    transform: translateY(-1px);
}

.tp-btn-practice .tp-btn-icon {
    font-size: 0.72rem;
}

/* ==========================================================================
   MOBILE RESPONSIVE EXCELLENCE (@media max-width: 992px)
   Chapters transform into sleek thumb-scrollable horizontal chip bar
   ========================================================================== */
@media (max-width: 992px) {
    .tp-curriculum-container {
        flex-direction: column;
        gap: 10px;
    }

    /* Transform Sidebar into Native Horizontal Chip Bar */
    .tp-curriculum-sidebar {
        width: 100%;
        display: flex;
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
        margin-bottom: 4px;
    }

    .tp-curriculum-sidebar::-webkit-scrollbar {
        display: none;
    }

    .tp-sidebar-cat-group {
        display: contents; /* Unwraps category wrapper so tabs flow horizontally */
    }

    .tp-sidebar-cat-title {
        display: none; /* Hide category titles on mobile for compact pill row */
    }

    .tp-sidebar-units-list {
        display: flex;
        flex-direction: row;
        gap: 8px;
        flex-shrink: 0;
    }

    .tp-unit-tab {
        padding: 7px 12px;
        border-radius: 20px;
        white-space: nowrap;
        flex-shrink: 0;
        gap: 6px;
        box-shadow: none;
    }

    .tp-unit-tab.active::before {
        display: none; /* remove desktop left bar on pill */
    }

    .tp-unit-tab-subtitle {
        display: none; /* hide verbose subtitle on mobile chip pills */
    }

    .tp-unit-tab-icon {
        width: auto;
        height: auto;
        background: transparent;
        border: none;
        font-size: 0.9rem;
    }

    .tp-unit-tab-title {
        font-size: 0.8rem;
    }

    .tp-unit-count-badge {
        font-size: 0.65rem;
        padding: 1px 6px;
        border-radius: 10px;
    }

    .tp-curriculum-stage {
        padding: 14px;
        border-radius: 14px;
        min-height: auto;
    }
}

@media (max-width: 640px) {
    .tp-learn-page {
        padding: 10px 8px 36px !important;
    }

    .tp-learn-header {
        gap: 10px;
        margin-bottom: 10px;
    }

    .tp-header-top-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .tp-learn-title-block {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .tp-learn-main-title {
        font-size: 1.15rem !important;
        margin: 0 !important;
        line-height: 1.25 !important;
    }

    .tp-learn-sub-count {
        font-size: 0.72rem !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        padding: 2px 8px !important;
    }

    .tp-lang-tabs {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        padding: 3px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        gap: 3px !important;
    }

    .tp-lang-tab {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        justify-content: center !important;
        padding: 6px 2px !important;
        gap: 3px !important;
        text-align: center !important;
    }

    .tp-lang-name {
        font-size: 0.72rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .tp-lang-flag {
        font-size: 0.95rem !important;
    }

    .tp-lang-count {
        font-size: 0.62rem !important;
        padding: 1px 4px !important;
    }

    .tp-curriculum-sidebar {
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 6px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding: 2px 0 6px 0 !important;
        margin-bottom: 6px !important;
    }

    .tp-unit-tab {
        padding: 6px 11px !important;
        border-radius: 18px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        gap: 5px !important;
    }

    .tp-unit-tab-title {
        font-size: 0.78rem !important;
        font-weight: 700 !important;
    }

    .tp-curriculum-stage {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 10px !important;
        border-radius: 14px !important;
        gap: 10px !important;
    }

    .tp-curriculum-header-strip {
        width: 100% !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        padding: 8px !important;
        margin-bottom: 2px !important;
    }

    .tp-curriculum-strip-controls {
        display: flex !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .tp-curriculum-strip-controls .tp-control-pill {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        height: 38px !important;
        padding: 0 8px !important;
        box-sizing: border-box !important;
        justify-content: center !important;
        font-size: 0.72rem !important;
        border-radius: 10px !important;
    }

    .tp-pill-val {
        font-size: 0.74rem !important;
    }

    .tp-toggle-switch {
        width: 28px !important;
        height: 16px !important;
    }

    .tp-toggle-handle {
        width: 12px !important;
        height: 12px !important;
    }

    .tp-backspace-pill.is-allowed .tp-toggle-handle {
        transform: translateX(12px) !important;
    }

    .tp-search-wrap {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        height: 38px !important;
        padding: 0 12px !important;
        border-radius: 10px !important;
    }

    .tp-stage-header {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 8px 10px !important;
        border-radius: 10px !important;
        margin-bottom: 2px !important;
    }

    .tp-stage-header-info {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex-wrap: nowrap !important;
        min-width: 0 !important;
    }

    .tp-stage-chapter-badge {
        font-size: 0.62rem !important;
        padding: 2px 7px !important;
    }

    .tp-stage-title {
        font-size: 0.95rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .tp-stage-count-tag {
        font-size: 0.68rem !important;
        padding: 2px 7px !important;
    }

    .tp-lesson-card {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 10px !important;
        gap: 8px !important;
    }

    .tp-card-left {
        gap: 10px !important;
        min-width: 0 !important;
    }

    .tp-lesson-index-badge {
        width: 32px !important;
        height: 32px !important;
        border-radius: 8px !important;
        font-size: 0.8rem !important;
        flex-shrink: 0 !important;
    }

    .tp-idx-num {
        font-size: 0.84rem !important;
        font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
        font-weight: 800 !important;
        line-height: 1 !important;
    }

    .tp-lesson-title {
        font-size: 0.88rem !important;
    }

    .tp-kc {
        min-width: 20px !important;
        height: 20px !important;
        font-size: 0.72rem !important;
        padding: 0 3px !important;
    }

    .tp-btn-practice {
        padding: 8px 12px !important;
        font-size: 0.78rem !important;
        gap: 4px !important;
        border-radius: 8px !important;
    }
}

/* ==========================================================================
   PRACTICE ARENA STYLES
   ========================================================================== */

.tp-practice-arena {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: tpFadeIn 0.25s ease-out;
}

/* Arena Top Bar & Live HUD */
.tp-arena-nav {
    background: var(--tp-slate-900);
    border-radius: var(--tp-card-radius);
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    color: #ffffff;
    box-shadow: var(--tp-shadow-md);
    flex-wrap: wrap;
}

.tp-arena-nav-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tp-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.tp-btn-back:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}

.tp-btn-back svg {
    width: 15px;
    height: 15px;
}

.tp-arena-lesson-info {
    display: flex;
    flex-direction: column;
}

.tp-arena-lesson-tag {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--tp-teal-light);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tp-arena-lesson-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.01em;
}

/* HUD Metrics */
.tp-arena-hud {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.tp-hud-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.tp-hud-lbl {
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--tp-slate-400);
    letter-spacing: 0.06em;
}

.tp-hud-val-wrap {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.tp-hud-val {
    font-size: 1.25rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
}

.tp-hud-unit {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--tp-slate-400);
}

.tp-speed-val {
    color: #38bdf8;
}

.tp-acc-val {
    color: #4ade80;
}

.tp-err-val {
    color: #f87171;
}

/* Timer item */
.tp-hud-timer {
    background: rgba(255, 255, 255, 0.07);
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tp-hud-timer .tp-hud-val {
    color: #fde047;
}

.tp-hud-timer .tp-hud-icon {
    width: 13px;
    height: 13px;
    color: #fde047;
    margin-right: 2px;
}

.tp-hud-actions {
    display: flex;
    align-items: center;
}

.tp-hud-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 8px;
    border: none;
    background: var(--tp-teal-primary);
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.tp-hud-btn:hover {
    background: var(--tp-teal-dark);
}

.tp-hud-btn svg {
    width: 13px;
    height: 13px;
}

/* ─── Target Guidance Strip ─── */
.tp-target-guide {
    background: #ffffff;
    border: 1px solid var(--tp-slate-200);
    border-radius: 12px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--tp-shadow-sm);
    gap: 14px;
    flex-wrap: wrap;
}

.tp-guide-target {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-guide-sub {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--tp-slate-400);
    letter-spacing: 0.05em;
}

.tp-guide-char-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 34px;
    padding: 0 8px;
    border-radius: 6px;
    background: var(--tp-teal-light);
    border: 2px solid var(--tp-teal-primary);
    color: var(--tp-teal-dark);
    font-size: 1.15rem;
    font-weight: 900;
    box-shadow: 0 2px 5px rgba(13, 148, 136, 0.2);
}

.tp-guide-hint {
    font-size: 0.88rem;
    color: var(--tp-slate-700);
    flex: 1;
    min-width: 200px;
}

.tp-guide-hint strong {
    color: var(--tp-slate-900);
}

.tp-guide-badges {
    display: flex;
    gap: 6px;
}

.tp-guide-mode-badge,
.tp-guide-backspace-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 16px;
    background: var(--tp-slate-100);
    color: var(--tp-slate-700);
    border: 1px solid var(--tp-slate-200);
}

/* ─── Practice Focus Environment: Keep site header visible as requested ─── */
body.tp-zen-practice-mode footer.tp-site-footer,
body.tp-zen-practice-mode .tp-breadcrumbs,
body.tp-zen-practice-mode .tp-learn-header,
body.tp-zen-practice-mode .tp-mobile-app-banner {
    display: none !important;
}

body.tp-zen-practice-mode #tpMainHeader,
body.tp-zen-practice-mode header.dribbble-header {
    display: block !important;
    position: relative !important;
    z-index: 9999 !important;
}

body.tp-zen-practice-mode {
    background: #f8fafc !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: hidden;
}

body.tp-zen-practice-mode #page {
    padding-top: 0 !important;
    margin: 0 !important;
}

body.tp-zen-practice-mode .tp-learn-page {
    padding: 12px 14px 24px !important;
    max-width: 1080px !important;
    margin: 0 auto !important;
}

/* ─── Typing Master Curriculum Drill Mode Selector Bar ─── */
.tp-drill-mode-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 6px 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.tp-drill-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tp-drill-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 7px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tp-drill-tab:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.tp-drill-tab.active {
    background: #5911f0;
    border-color: #470dc4;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(89, 17, 240, 0.25);
}

.tp-drill-progress-info {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
}

/* ─── Typing Master Practice Stage Wrapper ─── */
.tp-stage-wrapper {
    position: relative;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: var(--tp-card-radius);
    padding: 16px 20px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    min-height: 130px;
    box-sizing: border-box;
    cursor: text;
    margin-bottom: 16px;
}

.tp-stage-wrapper:focus-within {
    border-color: #5911f0;
    box-shadow: 0 0 0 3px rgba(89, 17, 240, 0.15);
}

/* ─── 1. Key Drill 3D Keycaps Stage (Matching Screenshot 1) ─── */
.tp-keydrill-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    padding: 10px 0;
    user-select: none;
}

.tp-keydrill-groups-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 28px;
    width: 100%;
}

.tp-keydrill-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tp-keydrill-subrow {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tp-kd-keycap {
    min-width: 52px;
    height: 52px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 4px 0 #94a3b8, 0 6px 10px rgba(15, 23, 42, 0.06);
    font-size: 24px;
    font-weight: 700;
    color: #1e3a8a;
    box-sizing: border-box;
    transition: all 0.1s ease;
    user-select: none;
}

.tp-kd-keycap.is-space {
    min-width: 86px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* Active 3D Green Highlight matching Screenshot 1 */
.tp-kd-keycap.is-active-target {
    background: linear-gradient(180deg, #84cc16 0%, #65a30d 100%) !important;
    border-color: #4d7c0f !important;
    box-shadow: 0 4px 0 #365314, 0 6px 14px rgba(101, 163, 13, 0.4) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
}

.tp-kd-keycap.is-typed-correct {
    background: #f1f5f9;
    border-color: #e2e8f0;
    box-shadow: 0 2px 0 #cbd5e1;
    color: #94a3b8;
    transform: translateY(2px);
    opacity: 0.45;
}

.tp-kd-keycap.is-typed-error {
    background: #fee2e2 !important;
    border-color: #ef4444 !important;
    color: #b91c1c !important;
    animation: tpShake 0.2s ease-in-out;
}

/* ─── 2. Word & Sentence Drill Stream Stage (Matching Screenshots 2 & 3) ─── */
.tp-words-stage {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    min-height: 120px;
    padding: 16px 20px;
    font-family: 'Merriweather', 'Georgia', 'Rubik', serif;
    font-size: 40px;
    line-height: 1.35;
    overflow-x: auto;
    white-space: nowrap;
    user-select: none;
    scrollbar-width: none;
}

.tp-words-stage::-webkit-scrollbar {
    display: none;
}

/* Pointer Triangle ▶ */
.tp-drill-pointer {
    display: inline-flex;
    align-items: center;
    color: #1e1b4b;
    font-size: 26px;
    margin-right: 12px;
    transform: translateY(-4px);
    user-select: none;
}

/* Active Word */
.tp-active-word {
    display: inline-flex;
    align-items: baseline;
    color: #1e1b4b;
    font-weight: 700;
    margin-right: 32px;
}

/* Characters inside active word */
.tp-char-box {
    display: inline-block;
    transition: opacity 0.08s ease;
}

/* Active Character Underlined (matching Screenshots 2 & 3: l̲ or a̲) */
.tp-char-box.is-active-char {
    border-bottom: 4px solid #1e1b4b;
    color: #1e1b4b;
    font-weight: 800;
}

/* Typed Character Hides and Arrow Advances (User requirement) */
.tp-char-box.is-typed-hidden {
    display: none !important;
}

/* Upcoming Words (Sage Green matching Screenshots 2 & 3) */
.tp-upcoming-words {
    display: inline-flex;
    align-items: baseline;
    gap: 32px;
    color: #557a46;
    font-weight: 500;
}

.tp-upcoming-word {
    display: inline-block;
}

/* Enter Symbol ↵ (Matching Screenshot 3) */
.tp-enter-sym {
    display: inline-block;
    color: #557a46;
    font-weight: 700;
    font-size: 34px;
    margin-left: 12px;
    transform: translateY(2px);
}

.tp-enter-sym.is-active-target {
    color: #1e1b4b !important;
    animation: tpPulsePointer 0.8s infinite alternate;
}

/* ─── 3 Columns × 2 Rows Practice Word Stage (Matching TypingGuru App) ─── */

.tp-stage-wrapper:focus-within {
    border-color: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}

.tp-grid-stage {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 12px 18px;
    width: 100%;
    align-items: center;
}

@media (max-width: 768px) {
    .tp-drill-mode-bar {
        padding: 6px 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .tp-drill-tabs {
        width: 100%;
        justify-content: space-between;
        gap: 4px;
    }
    .tp-drill-tab {
        flex: 1;
        justify-content: center;
        padding: 6px 6px;
        font-size: 11px;
    }
    .tp-drill-progress-info {
        text-align: center;
        font-size: 11px;
    }
    .tp-keydrill-groups-wrap {
        gap: 12px;
    }
    .tp-kd-keycap {
        min-width: 38px;
        height: 38px;
        font-size: 17px;
        padding: 0 4px;
        box-shadow: 0 3px 0 #94a3b8;
    }
    .tp-kd-keycap.is-space {
        min-width: 58px;
        font-size: 11px;
    }
    .tp-words-stage {
        font-size: 26px;
        min-height: 80px;
        padding: 12px 10px;
    }
    .tp-drill-pointer {
        font-size: 18px;
        margin-right: 6px;
    }
    .tp-active-word {
        margin-right: 18px;
    }
    .tp-upcoming-words {
        gap: 16px;
    }
    .tp-enter-sym {
        font-size: 22px;
    }
    .tp-grid-stage {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px 12px;
    }
}

@media (max-width: 480px) {
    .tp-grid-stage {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.tp-chunk-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-height: 42px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tp-chunk-boxes {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}

/* Individual Character & Space Boxes */
.tp-box {
    height: 38px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    user-select: none;
    font-family: inherit;
    transition: all 0.12s ease;
}

.tp-box-char {
    width: 38px;
    font-size: 1.3rem;
    font-weight: 800;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    color: #64748b;
}

.tp-box-space {
    min-width: 62px;
    padding: 0 10px;
    font-size: 0.8rem;
    font-weight: 800;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

/* Active Box: Vibrant Royal Blue 3D Key Matching User Screenshot */
.tp-box.is-current-active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    border: 2px solid #1d4ed8 !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.45), inset 0 1px 1px rgba(255,255,255,0.6) !important;
    transform: translateY(-1px);
}

/* Correct Typed Box: Olive/Green border matching Screenshot */
.tp-box.is-typed-correct {
    border-color: #84cc16 !important;
    background: #f7fee7 !important;
    color: #65a30d !important;
}

/* Incorrect Typed Box */
.tp-box.is-typed-incorrect {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    color: #dc2626 !important;
    animation: tpShake 0.18s ease-in-out;
}

/* Active chunk's upcoming pending boxes (periwinkle tint from Screenshot) */
.tp-chunk-item.is-current-chunk .tp-box-char:not(.is-current-active):not(.is-typed-correct):not(.is-typed-incorrect) {
    border-color: #bfdbfe;
    background: #f8fafc;
    color: #1e40af;
}

.tp-chunk-item.is-current-chunk .tp-box-space:not(.is-current-active):not(.is-typed-correct):not(.is-typed-incorrect) {
    border-color: #bfdbfe;
    background: #f8fafc;
    color: #3b82f6;
}

/* Completed chunk boxes: crisp green border matching user screenshot */
.tp-chunk-item.is-completed .tp-box-char {
    border-color: #84cc16 !important;
    color: #6366f1 !important;
    background: #ffffff !important;
}

.tp-chunk-item.is-completed .tp-box-space {
    border-color: #84cc16 !important;
    color: #94a3b8 !important;
    background: #ffffff !important;
}

/* Green Checkmark matching user screenshot */
.tp-chunk-check {
    color: #22c55e;
    font-size: 1.45rem;
    font-weight: 900;
    line-height: 1;
    margin-left: 4px;
    display: inline-flex;
    align-items: center;
    user-select: none;
    text-shadow: 0 1px 2px rgba(34, 197, 94, 0.25);
}

/* Hidden Touch Input */
.tp-mobile-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    left: 0;
    bottom: 0;
}

.tp-mobile-focus-bar {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px;
    background: var(--tp-slate-100);
    border-radius: 8px;
    color: var(--tp-slate-600);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.tp-mobile-focus-bar svg {
    width: 16px;
    height: 16px;
    color: var(--tp-teal-primary);
}

/* ==========================================================================
   DYNAMIC AUTHENTIC VIRTUAL KEYBOARD (COMPOSE-STYLE FROM TYPINGGURU)
   ========================================================================== */

.tp-keyboard-card {
    background: #ffffff;
    border: 1px solid var(--tp-slate-200);
    border-radius: var(--tp-card-radius);
    padding: 16px 20px;
    box-shadow: var(--tp-shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tp-keyboard-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tp-kb-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--tp-slate-800);
}

.tp-kb-title svg {
    width: 18px;
    height: 18px;
    color: var(--tp-teal-primary);
}

.tp-kb-toggle-btn {
    border: none;
    background: var(--tp-slate-100);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--tp-slate-600);
    cursor: pointer;
    transition: background 0.15s;
}

.tp-kb-toggle-btn:hover {
    background: var(--tp-slate-200);
    color: var(--tp-slate-900);
}

/* Viewport matching TypingGuru App Screenshots */
.tp-keyboard-viewport {
    position: relative;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 16px 16px 175px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    transition: all 0.25s ease;
}

.tp-keyboard-card.minimized .tp-keyboard-viewport {
    display: none;
}

/* 5 Rows Keyboard Board */
.tp-vkb-board {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    user-select: none;
    position: relative;
    z-index: 10;
}

.tp-vkb-row {
    display: flex;
    gap: 5px;
    width: 100%;
}

/* ─── Typing Master Color-Coded 3D Keycaps (Matching User Screenshots) ─── */
.tp-vkb-key {
    flex: 1;
    min-height: 52px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 7px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px 6px;
    box-shadow: 0 3px 0 #94a3b8, 0 4px 6px rgba(0,0,0,0.06);
    position: relative;
    transition: background 0.1s ease, transform 0.1s ease, border-color 0.1s ease;
    box-sizing: border-box;
    cursor: default;
    user-select: none;
}

.tp-key-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.tp-key-bottom-row {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    width: 100%;
}

.tp-vkb-key .tp-key-eng {
    font-size: 0.82rem;
    font-weight: 800;
    color: inherit;
    line-height: 1;
}

.tp-vkb-key .tp-key-shift {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    line-height: 1;
}

.tp-vkb-key .tp-key-main {
    font-size: 0.95rem;
    font-weight: 800;
    color: inherit;
    line-height: 1;
}

/* Finger Color Zones Matching Typing Master Screenshots */
/* Left & Right Pinky: Soft Blue/Periwinkle */
.tp-vkb-key.finger-pinky {
    background: #eef2ff;
    border-color: #c7d2fe;
    box-shadow: 0 3px 0 #a5b4fc, 0 3px 6px rgba(30, 64, 175, 0.08);
    color: #1e40af;
}

/* Left & Right Ring: Soft Peach/Orange */
.tp-vkb-key.finger-ring {
    background: #fff7ed;
    border-color: #fed7aa;
    box-shadow: 0 3px 0 #fdba74, 0 3px 6px rgba(194, 65, 12, 0.08);
    color: #c2410c;
}

/* Left & Right Middle: Soft Mint Green */
.tp-vkb-key.finger-mid {
    background: #f0fdf4;
    border-color: #bbf7d0;
    box-shadow: 0 3px 0 #86efac, 0 3px 6px rgba(21, 128, 61, 0.08);
    color: #15803d;
}

/* Left Index: Soft Lilac/Purple */
.tp-vkb-key.finger-l-index {
    background: #faf5ff;
    border-color: #e9d5ff;
    box-shadow: 0 3px 0 #d8b4fe, 0 3px 6px rgba(126, 34, 206, 0.08);
    color: #7e22ce;
}

/* Right Index: Soft Lavender/Pink */
.tp-vkb-key.finger-r-index {
    background: #fdf2f8;
    border-color: #fbcfe8;
    box-shadow: 0 3px 0 #f472b6, 0 3px 6px rgba(190, 24, 93, 0.08);
    color: #be185d;
}

/* Spacebar / Thumb: Warm Cream/Tan */
.tp-vkb-key.finger-thumb {
    background: #fefce8;
    border-color: #fde047;
    box-shadow: 0 3px 0 #eab308, 0 3px 6px rgba(133, 77, 14, 0.08);
    color: #854d0e;
}

/* Active Highlight States (Vivid 3D Button) */
.tp-vkb-key.is-active-key {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.2) !important;
}

/* Active Middle Finger: Vivid Lime Green (Screenshot 1) */
.tp-vkb-key.finger-mid.is-active-key {
    background: linear-gradient(180deg, #84cc16 0%, #65a30d 100%) !important;
    border-color: #4d7c0f !important;
    box-shadow: 0 1px 0 #365314, 0 0 16px rgba(101, 163, 13, 0.6) !important;
    color: #ffffff !important;
}
.tp-vkb-key.finger-mid.is-active-key .tp-key-eng,
.tp-vkb-key.finger-mid.is-active-key .tp-key-main,
.tp-vkb-key.finger-mid.is-active-key .tp-key-shift {
    color: #ffffff !important;
}

/* Active Ring Finger: Vivid Coral/Orange (Screenshot 2) */
.tp-vkb-key.finger-ring.is-active-key {
    background: linear-gradient(180deg, #fb923c 0%, #ea580c 100%) !important;
    border-color: #c2410c !important;
    box-shadow: 0 1px 0 #9a3412, 0 0 16px rgba(234, 88, 12, 0.6) !important;
    color: #ffffff !important;
}
.tp-vkb-key.finger-ring.is-active-key .tp-key-eng,
.tp-vkb-key.finger-ring.is-active-key .tp-key-main,
.tp-vkb-key.finger-ring.is-active-key .tp-key-shift {
    color: #ffffff !important;
}

/* Active Pinky Finger: Vivid Royal Blue (Screenshot 3) */
.tp-vkb-key.finger-pinky.is-active-key {
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%) !important;
    border-color: #1e40af !important;
    box-shadow: 0 1px 0 #172554, 0 0 16px rgba(37, 99, 235, 0.6) !important;
    color: #ffffff !important;
}
.tp-vkb-key.finger-pinky.is-active-key .tp-key-eng,
.tp-vkb-key.finger-pinky.is-active-key .tp-key-main,
.tp-vkb-key.finger-pinky.is-active-key .tp-key-shift {
    color: #ffffff !important;
}

/* Active Index Finger: Vivid Purple/Magenta */
.tp-vkb-key.finger-l-index.is-active-key,
.tp-vkb-key.finger-r-index.is-active-key {
    background: linear-gradient(180deg, #a855f7 0%, #7e22ce 100%) !important;
    border-color: #6b21a8 !important;
    box-shadow: 0 1px 0 #581c87, 0 0 16px rgba(126, 34, 206, 0.6) !important;
    color: #ffffff !important;
}
.tp-vkb-key.finger-l-index.is-active-key .tp-key-eng,
.tp-vkb-key.finger-l-index.is-active-key .tp-key-main,
.tp-vkb-key.finger-r-index.is-active-key .tp-key-eng,
.tp-vkb-key.finger-r-index.is-active-key .tp-key-main {
    color: #ffffff !important;
}

/* Active Spacebar */
.tp-vkb-key.finger-thumb.is-active-key {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%) !important;
    border-color: #b45309 !important;
    box-shadow: 0 1px 0 #78350f, 0 0 16px rgba(217, 119, 6, 0.6) !important;
    color: #ffffff !important;
}
.tp-vkb-key.finger-thumb.is-active-key .tp-key-main {
    color: #ffffff !important;
}

/* Fallback Generic Active Key */
.tp-vkb-key.is-active-key:not(.finger-pinky):not(.finger-ring):not(.finger-mid):not(.finger-l-index):not(.finger-r-index):not(.finger-thumb) {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%) !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
}

/* Shift Key Highlight State */
.tp-vkb-key.is-shift-key {
    background: linear-gradient(180deg, #6366f1 0%, #4338ca 100%) !important;
    border-color: #3730a3 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 0 #312e81, 0 0 14px rgba(99, 102, 241, 0.6) !important;
    transform: translateY(2px);
}
.tp-vkb-key.is-shift-key .tp-key-main,
.tp-vkb-key.is-shift-key .tp-key-eng {
    color: #ffffff !important;
}

/* Width Ratios for Modifier Keys matching TypingKeyboard.kt */
.tp-key-w-1-5 { flex: 1.5; }
.tp-key-w-1-8 { flex: 1.8; }
.tp-key-w-2-2 { flex: 2.2; }
.tp-key-w-space { flex: 6.2; }
.tp-key-w-mod { flex: 1.15; font-size: 0.72rem; }

/* Dual Real Virtual Hands (Left and Right simultaneously) */
.tp-virtual-hand {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    height: auto;
    pointer-events: none;
    z-index: 30;
    opacity: 0.82;
    transform-origin: top left;
    transition: left 0.16s cubic-bezier(0.2, 0.8, 0.2, 1),
                top 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.4));
}

/* Hands Legend */
.tp-hands-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding-top: 8px;
    border-top: 1px solid var(--tp-slate-100);
    font-size: 0.75rem;
    color: var(--tp-slate-500);
    flex-wrap: wrap;
}

.tp-hand-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.tp-hand-dot.left {
    background: var(--tp-teal-primary);
}

.tp-hand-dot.right {
    background: var(--tp-indigo);
}

/* ─── Mobile App Download Modal ─── */
.tp-mob-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: tpFadeIn 0.2s ease;
}

.tp-mob-modal-dialog {
    background: #ffffff;
    border-radius: 24px;
    max-width: 500px;
    width: 100%;
    padding: 28px 24px 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: tpSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.tp-modal-close-btn {
    position: absolute;
    top: 14px;
    right: 16px;
    background: var(--tp-slate-100);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: var(--tp-slate-600);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.tp-modal-close-btn:hover {
    background: var(--tp-slate-200);
    color: var(--tp-slate-900);
}

.tp-mob-modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.tp-mob-icon-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 8px;
}

.tp-mob-modal-logo-img {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
    display: inline-block;
    vertical-align: middle;
}

.tp-mob-icon-phone {
    font-size: 42px;
    line-height: 1;
}

.tp-mob-badge-verified {
    position: absolute;
    bottom: -4px;
    right: -12px;
    background: #0284c7;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.tp-mob-pill {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.tp-mob-modal-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--tp-slate-900);
    margin: 0 0 8px;
    line-height: 1.3;
}

.tp-mob-modal-desc {
    font-size: 0.88rem;
    color: var(--tp-slate-600);
    line-height: 1.5;
    margin: 0;
}

.tp-mob-features-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
    background: #f8fafc;
    border: 1px solid var(--tp-slate-200);
    border-radius: 16px;
    padding: 14px;
}

.tp-mob-feat-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.tp-mob-feat-icon {
    font-size: 20px;
    line-height: 1.2;
    flex-shrink: 0;
}

.tp-mob-feat-info strong {
    display: block;
    font-size: 0.85rem;
    color: var(--tp-slate-900);
    margin-bottom: 2px;
}

.tp-mob-feat-info p {
    font-size: 0.78rem;
    color: var(--tp-slate-500);
    margin: 0;
    line-height: 1.35;
}

.tp-mob-playstore-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.tp-playstore-btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: #000000;
    color: #ffffff;
    padding: 12px 28px;
    border-radius: 12px;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s, box-shadow 0.15s;
    width: 100%;
    max-width: 280px;
    justify-content: center;
}

.tp-playstore-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    color: #ffffff;
}

.tp-playstore-logo {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.tp-playstore-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.tp-play-sub {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #94a3b8;
    text-transform: uppercase;
    line-height: 1;
}

.tp-play-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: #ffffff;
}

.tp-play-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--tp-slate-500);
    font-weight: 600;
}

.tp-play-rating {
    color: #d97706;
    font-weight: 800;
}

.tp-play-sep {
    color: var(--tp-slate-300);
}

.tp-mob-modal-footer {
    text-align: center;
    border-top: 1px solid var(--tp-slate-100);
    padding-top: 12px;
}

.tp-btn-continue-web {
    background: none;
    border: none;
    color: var(--tp-slate-500);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}

.tp-btn-continue-web:hover {
    color: var(--tp-teal-primary);
    background: var(--tp-slate-50);
}

/* ─── Modal Styles ─── */
.tp-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: tpFadeIn 0.2s ease-out;
}

.tp-modal-dialog {
    background: #ffffff;
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 28px;
    text-align: center;
    animation: tpScaleUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tp-modal-trophy {
    font-size: 3.5rem;
    margin-bottom: 8px;
    animation: tpBounce 1s infinite alternate;
}

.tp-modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--tp-slate-900);
    margin: 0 0 4px;
}

.tp-modal-sub {
    font-size: 0.9rem;
    color: var(--tp-slate-500);
    margin: 0 0 24px;
}

.tp-modal-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.tp-modal-stat-card {
    background: var(--tp-slate-50);
    border: 1px solid var(--tp-slate-200);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tp-modal-stat-lbl {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--tp-slate-400);
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.tp-modal-stat-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--tp-slate-900);
    font-variant-numeric: tabular-nums;
}

.tp-modal-stat-unit {
    font-size: 0.72rem;
    color: var(--tp-slate-500);
    font-weight: 600;
}

.tp-modal-actions {
    display: flex;
    gap: 12px;
}

.tp-modal-btn {
    flex: 1;
    height: 46px;
    border-radius: 12px;
    border: none;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.18s;
}

.tp-modal-btn-retry {
    background: var(--tp-slate-100);
    color: var(--tp-slate-700);
}

.tp-modal-btn-retry:hover {
    background: var(--tp-slate-200);
    color: var(--tp-slate-900);
}

.tp-modal-btn-next {
    background: linear-gradient(135deg, var(--tp-teal-primary), var(--tp-teal-dark));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.tp-modal-btn-next:hover {
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.45);
    transform: translateY(-1px);
}

/* ─── Font Support for Kruti Dev ─── */
.font-krutidev .tp-target-box,
.font-krutidev .tp-guide-char-box,
.font-krutidev .tp-key-chip,
.font-krutidev .tp-vkb-key .tp-key-main {
    font-family: var(--tp-font-kruti) !important;
}

/* ─── Keyframe Animations ─── */
@keyframes tpSpin {
    to { transform: rotate(360deg); }
}

/* ─── Landscape Rotate Overlay for Mobile ─── */
.tp-rotate-landscape-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: tpFadeInOverlay 0.25s ease-out;
}

@keyframes tpFadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tp-rotate-landscape-box {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 28px 24px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
}

.tp-rotate-phone-anim {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 2.4rem;
    margin-bottom: 16px;
}

.tp-rotate-arrow {
    animation: tpRotatePhoneAnim 2s infinite ease-in-out;
    display: inline-block;
}

@keyframes tpRotatePhoneAnim {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
    100% { transform: rotate(0deg); }
}

.tp-rotate-landscape-box h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #f8fafc;
}

.tp-rotate-landscape-box p {
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0 0 20px 0;
}

.tp-rotate-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tp-btn-rotate-fs {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #ffffff;
    border: none;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.tp-btn-rotate-fs:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.5);
}

.tp-btn-rotate-dismiss {
    background: transparent;
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tp-btn-rotate-dismiss:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

@keyframes tpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes tpBounce {
    from { transform: translateY(0); }
    to { transform: translateY(-6px); }
}

@keyframes tpShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */

@media (max-width: 900px) {
    .tp-learn-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .tp-lang-tabs {
        width: 100%;
        overflow-x: auto;
    }

    .tp-arena-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .tp-arena-hud {
        width: 100%;
        justify-content: space-between;
    }

    .tp-vkb-key {
        min-height: 40px;
        padding: 3px 4px;
    }

    .tp-vkb-key .tp-key-main {
        font-size: 0.85rem;
    }

    .tp-vkb-key .tp-key-shift {
        font-size: 0.6rem;
    }
}

@media (max-width: 640px) {
    .tp-learn-page {
        padding: 16px 10px 40px;
    }

    .tp-learn-main-title {
        font-size: 1.4rem;
    }

    .tp-learn-toolbar {
        padding: 10px 14px;
        flex-direction: column;
        align-items: stretch;
    }

    .tp-toolbar-controls {
        justify-content: space-between;
    }

    .tp-control-pill {
        flex: 1;
        padding: 0 8px;
    }

    .tp-lessons-grid {
        grid-template-columns: 1fr;
    }

    .tp-stage-wrapper {
        padding: 14px;
    }

    .tp-mobile-focus-bar {
        display: flex;
    }

    .tp-target-guide {
        padding: 8px 12px;
    }

    .tp-guide-hint {
        font-size: 0.82rem;
    }

    .tp-arena-hud {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .tp-hud-item {
        align-items: flex-start;
        background: rgba(255, 255, 255, 0.05);
        padding: 8px 10px;
        border-radius: 8px;
    }

    .tp-hud-actions {
        grid-column: span 2;
    }

    .tp-hud-btn {
        width: 100%;
        justify-content: center;
    }

    .tp-keyboard-viewport {
        padding: 8px 6px 70px;
        border-radius: 12px;
    }

    .tp-vkb-row {
        gap: 2px;
    }

    .tp-vkb-key {
        min-height: 34px;
        padding: 2px 2px;
        border-radius: 4px;
    }

    .tp-vkb-key .tp-key-main {
        font-size: 0.72rem;
    }

    .tp-vkb-key .tp-key-shift {
        font-size: 0.5rem;
    }

    .tp-virtual-hand {
        width: 180px;
    }

    .tp-hands-legend {
        display: none;
    }

    .tp-modal-dialog {
        padding: 20px 16px;
    }
}

/* ==========================================================================
   SEO EDUCATIONAL CONTENT & EXAM GUIDELINES
   High-Authority, Handcrafted Layout for Google Rank #1
   ========================================================================== */
.tp-seo-guide-section {
    margin-top: 36px;
    border-top: 1px solid #e2e8f0;
    padding-top: 36px;
}

.tp-seo-container {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

/* Header & Badges */
.tp-seo-header, .tp-seo-subhead {
    margin-bottom: 16px;
}

.tp-seo-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 3px 8px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.tp-seo-h2 {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    margin: 0 0 10px 0;
    letter-spacing: -0.01em;
}

.tp-seo-lead {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
    margin: 0;
    max-width: 900px;
}

.tp-seo-p {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

/* 2-Column Grid Cards */
.tp-seo-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 16px;
}

.tp-seo-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.tp-card-icon-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.tp-seo-icon {
    font-size: 1.3rem;
}

.tp-seo-h3 {
    font-size: 1.08rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.tp-card-p {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.tp-seo-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tp-seo-list li {
    font-size: 0.86rem;
    color: #334155;
    line-height: 1.45;
}

.tp-seo-list code, .tp-seo-card code, .tp-seo-callout code, .tp-seo-mini-table code {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Callout Box */
.tp-seo-callout {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: 12px;
    padding: 14px 18px;
    margin-top: 18px;
}

.tp-callout-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.tp-callout-content {
    font-size: 0.88rem;
    color: #1e3a8a;
    line-height: 1.5;
}

/* Mini Table */
.tp-seo-mini-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.tp-seo-mini-table th, .tp-seo-mini-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.84rem;
}

.tp-seo-mini-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    border-radius: 4px;
}

.tp-seo-mini-table td {
    color: #1e293b;
}

/* Exam Standards Table */
.tp-table-responsive {
    overflow-x: auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.tp-exam-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    min-width: 650px;
}

.tp-exam-table th {
    background: #0f172a;
    color: #ffffff;
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

.tp-exam-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    line-height: 1.4;
}

.tp-exam-table tr:last-child td {
    border-bottom: none;
}

.tp-exam-table tr:hover td {
    background: #f8fafc;
}

/* 4-Step Routine Cards */
.tp-routine-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.tp-routine-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 16px;
    position: relative;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.tp-routine-step {
    font-size: 1.4rem;
    font-weight: 900;
    color: #cbd5e1;
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.tp-routine-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0;
}

.tp-routine-desc {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
    margin: 0;
}

/* Course Portal Cards (Internal Links) */
.tp-course-cards-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 16px;
}

.tp-course-portal-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tp-course-portal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.tp-course-portal-card.is-current {
    border-color: #2563eb;
    background: #f8faff;
}

.tp-portal-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 0.65rem;
    font-weight: 800;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 2px 7px;
    border-radius: 6px;
    color: #475569;
}

.tp-course-portal-card.is-current .tp-portal-badge {
    background: #dbeafe;
    border-color: #bfdbfe;
    color: #1e40af;
}

.tp-portal-flag {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.tp-portal-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0;
}

.tp-portal-desc {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.45;
    margin: 0 0 14px 0;
    flex-grow: 1;
}

.tp-portal-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.74rem;
    color: #64748b;
    border-top: 1px dashed #e2e8f0;
    padding: 8px 0;
    margin-bottom: 12px;
}

.tp-portal-meta strong {
    color: #1e293b;
}

.tp-portal-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 8px 14px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.tp-portal-link:hover {
    background: #1e293b;
}

.tp-portal-active-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: default;
}

/* FAQ Accordion */
.tp-faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.tp-faq-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.tp-faq-item[open] {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.tp-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    font-size: 0.94rem;
    font-weight: 800;
    color: #0f172a;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.tp-faq-question::-webkit-details-marker {
    display: none;
}

.tp-faq-chevron {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.tp-faq-item[open] .tp-faq-chevron {
    transform: rotate(180deg);
}

.tp-faq-answer {
    padding: 0 18px 16px 18px;
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.6;
}

.tp-faq-answer p {
    margin: 0;
}

.tp-faq-answer strong {
    color: #1e293b;
}

/* Mobile Responsive Adjustments for SEO Sections */
@media (max-width: 992px) {
    .tp-routine-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .tp-course-cards-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tp-seo-grid-2 {
        grid-template-columns: 1fr;
    }
    .tp-routine-cards {
        grid-template-columns: 1fr;
    }
    .tp-seo-h2 {
        font-size: 1.3rem;
    }
}
