/* ===== CSS Variables & Design Tokens — LIGHT THEME ===== */
:root {
    --bg-primary: #FAFAF8;
    --bg-secondary: #F0F0EC;
    --bg-tertiary: #E8E6E1;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-input: #ffffff;

    /* Chinese-education palette */
    --accent-red: #D94F4F;
    --accent-red-glow: rgba(217, 79, 79, 0.18);
    --accent-gold: #D4A017;
    --accent-gold-light: #F5DEB3;
    --accent-gold-glow: rgba(212, 160, 23, 0.15);
    --accent-jade: #0D9488;
    --accent-jade-light: #CCFBF1;
    --accent-jade-glow: rgba(13, 148, 136, 0.15);
    --accent-blue: #3B82F6;
    --accent-purple: #7C3AED;
    --accent-pink: #EC4899;
    --accent-teal: #0D9488;
    --accent-orange: #EA580C;

    --text-primary: #1E293B;
    --text-secondary: #475569;
    --text-muted: #94A3B8;

    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.08);
    --success-border: rgba(5, 150, 105, 0.25);
    --error: #DC2626;
    --error-bg: rgba(220, 38, 38, 0.06);
    --error-border: rgba(220, 38, 38, 0.2);
    --warning: #D97706;
    --warning-bg: rgba(217, 119, 6, 0.06);
    --warning-border: rgba(217, 119, 6, 0.2);

    --border: #E2E8F0;
    --border-hover: #CBD5E1;
    --border-focus: rgba(13, 148, 136, 0.5);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(13, 148, 136, 0.1);

    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Baloo 2', 'Inter', sans-serif;
    --font-cn: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;

    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-ui);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== Background Decoration ===== */
.bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
}

.bg-circle-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #FECDD3 0%, transparent 70%);
    top: -200px;
    right: -100px;
    animation: floatCircle 20s ease-in-out infinite;
}

.bg-circle-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #CCFBF1 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
    animation: floatCircle 25s ease-in-out infinite reverse;
}

.bg-circle-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #FEF3C7 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: floatCircle 30s ease-in-out infinite;
    opacity: 0.2;
}

.bg-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(rgba(13, 148, 136, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

@keyframes floatCircle {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 10px) scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
    .bg-circle, .logo-icon { animation: none !important; }
    * { transition-duration: 0.01ms !important; }
}

/* ===== Header ===== */
.app-header {
    position: relative;
    z-index: 10;
    padding: 1.2rem 2rem;
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.logo-icon-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: var(--radius-md);
    filter: drop-shadow(0 2px 8px rgba(0, 80, 200, 0.2));
    animation: logoPulse 3s ease-in-out infinite;
    transition: var(--transition-base);
}

.logo-icon-img:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 4px 16px rgba(0, 80, 200, 0.3));
}

@keyframes logoPulse {
    0%, 100% { filter: drop-shadow(0 2px 8px rgba(0, 80, 200, 0.2)); }
    50% { filter: drop-shadow(0 4px 16px rgba(0, 80, 200, 0.35)); }
}

.logo-text h1 {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-text .subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 400;
}

.header-stats {
    display: flex;
    gap: 0.6rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    transition: var(--transition-base);
}

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

.stat-icon {
    font-size: 1.2rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent-teal);
}

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

/* ===== Controls Section ===== */
.controls-section {
    position: relative;
    z-index: 5;
    padding: 1rem 2rem;
}

.controls-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 0.35rem;
    padding: 0.3rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
}

.mode-btn:hover {
    color: var(--text-primary);
    background: rgba(13, 148, 136, 0.06);
}

.mode-btn.active {
    background: var(--accent-teal);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 10px var(--accent-jade-glow);
}

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

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    flex: 1;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
}

.category-tab:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(212, 160, 23, 0.06);
}

.category-tab.active {
    background: linear-gradient(135deg, var(--accent-gold), #B8860B);
    color: white;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 2px 10px var(--accent-gold-glow);
}

.category-count {
    background: rgba(255, 255, 255, 0.25);
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
}

.category-tab:not(.active) .category-count {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
}

.action-btn:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
}

.btn-check-all {
    background: linear-gradient(135deg, var(--accent-teal), #059669);
    color: white;
    border-color: transparent;
    font-weight: 600;
}

.btn-check-all:hover {
    box-shadow: 0 4px 16px var(--accent-jade-glow);
    transform: translateY(-1px);
    color: white;
}

/* ===== Practice Table ===== */
.table-section {
    position: relative;
    z-index: 3;
    padding: 0.5rem 2rem 2rem;
}

.table-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

.practice-table {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.table-header {
    display: grid;
    grid-template-columns: 50px 1.5fr 1.5fr 1.2fr 1.5fr 1.2fr 0.8fr;
    padding: 0.8rem 0;
    background: linear-gradient(135deg, #F1F5F9, #F8FAFC);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
}

.th {
    padding: 0 0.8rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.th-icon {
    font-size: 0.9rem;
}

/* Table Rows */
.table-row {
    display: grid;
    grid-template-columns: 50px 1.5fr 1.5fr 1.2fr 1.5fr 1.2fr 0.8fr;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    transition: var(--transition-fast);
    align-items: center;
}

.table-row:hover {
    background: rgba(13, 148, 136, 0.03);
}

.table-row:last-child {
    border-bottom: none;
}

.td {
    padding: 0.3rem 0.8rem;
    font-size: 0.88rem;
}

.td-stt {
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.82rem;
}

.td-vi {
    font-weight: 600;
    color: var(--accent-red);
}

/* Input Fields */
.pinyin-input, .hantu-input, .vi-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 0.88rem;
    color: var(--text-primary);
    transition: var(--transition-base);
    outline: none;
}

.hantu-input {
    font-family: var(--font-cn);
    font-size: 1.05rem;
}

.pinyin-input:focus, .hantu-input:focus, .vi-input:focus {
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px var(--accent-jade-glow);
}

.pinyin-input::placeholder, .hantu-input::placeholder, .vi-input::placeholder {
    color: var(--text-muted);
    font-weight: 300;
}

/* Result Cells */
.result-cell {
    font-size: 0.82rem;
    font-weight: 500;
}

.result-correct {
    color: var(--success);
    padding: 0.25rem 0.6rem;
    background: var(--success-bg);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid var(--success-border);
}

.result-partial {
    color: var(--warning);
    padding: 0.25rem 0.6rem;
    background: var(--warning-bg);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid var(--warning-border);
}

.result-wrong {
    color: var(--error);
    padding: 0.25rem 0.6rem;
    background: var(--error-bg);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid var(--error-border);
}

.result-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

.result-hint .hint-cn {
    font-family: var(--font-cn);
    font-style: normal;
    font-weight: 500;
    color: var(--accent-purple);
}

.result-placeholder {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: italic;
}

/* Check Button */
.check-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.8rem;
    background: linear-gradient(135deg, var(--accent-teal), #0F766E);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
}

.check-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-jade-glow);
}

.check-btn:active {
    transform: translateY(0);
}

/* Add Row Button */
.add-row-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.5rem;
    background: rgba(13, 148, 136, 0.04);
    border: 2px dashed rgba(13, 148, 136, 0.25);
    border-radius: var(--radius-md);
    color: var(--accent-teal);
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
}

.add-row-btn:hover {
    background: rgba(13, 148, 136, 0.08);
    border-color: var(--accent-teal);
}

/* ===== Summary Section ===== */
.summary-section {
    position: relative;
    z-index: 3;
    padding: 0 2rem 2rem;
}

.summary-card {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.06), rgba(212, 160, 23, 0.04));
    border-bottom: 1px solid var(--border);
}

.summary-header h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-badge {
    padding: 0.3rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--accent-jade-glow);
    color: var(--accent-teal);
    border: 1px solid var(--success-border);
}

.summary-body {
    padding: 1.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    text-align: center;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.summary-ring {
    position: relative;
    width: 100px;
    height: 100px;
}

.summary-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: var(--bg-secondary);
    stroke-width: 8;
}

.ring-fill {
    fill: none;
    stroke: var(--accent-teal);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 264;
    stroke-dashoffset: 264;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.ring-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-details {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.summary-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.88rem;
}

.summary-detail-label {
    color: var(--text-secondary);
}

.summary-detail-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Pinyin Helper ===== */
.pinyin-helper {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 100;
    min-width: 320px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(15px);
    overflow: hidden;
}

.helper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.08), rgba(212, 160, 23, 0.05));
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.helper-toggle {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.helper-toggle:hover {
    background: var(--bg-secondary);
}

.helper-body {
    padding: 0.8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: var(--transition-base);
}

.helper-body.collapsed {
    display: none;
}

.tone-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.tone-label {
    min-width: 24px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.tone-btn {
    width: 36px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.tone-btn:hover {
    background: var(--accent-jade-light);
    border-color: var(--accent-teal);
    color: var(--accent-teal);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.tone-btn:active {
    transform: translateY(0);
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    animation: slideInToast 0.3s ease forwards;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.info { border-left: 3px solid var(--accent-teal); }

@keyframes slideInToast {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== Confetti ===== */
.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
}

.confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: confettiFall 2.5s ease forwards;
}

@keyframes confettiFall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ===== Autocomplete ===== */
.autocomplete-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    margin-top: 4px;
    max-height: 180px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.autocomplete-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: var(--transition-fast);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: rgba(13, 148, 136, 0.06);
}

.autocomplete-item .ac-vi {
    color: var(--accent-red);
    font-weight: 500;
}

.autocomplete-item .ac-extra {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--font-cn);
}

/* Vietnamese input wrapper for autocomplete */
.vi-input-wrapper {
    position: relative;
    width: 100%;
}

/* ===== Guide Toggle Button (Header) ===== */
.guide-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.2rem;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(13, 148, 136, 0.06));
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-full);
    color: var(--accent-purple);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
}

.guide-toggle-btn:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.14), rgba(13, 148, 136, 0.1));
    border-color: var(--accent-purple);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.12);
}

.guide-icon {
    font-size: 1.1rem;
}

/* ===== Guide Overlay ===== */
.guide-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.45);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.guide-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== Guide Modal ===== */
.guide-modal {
    width: 90%;
    max-width: 780px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 0 40px rgba(13, 148, 136, 0.05);
    overflow: hidden;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.guide-overlay.active .guide-modal {
    transform: translateY(0) scale(1);
}

/* Modal Header */
.guide-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4rem 1.8rem;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.06), rgba(212, 160, 23, 0.04));
    border-bottom: 1px solid var(--border);
}

.guide-title-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.guide-title-icon {
    font-size: 2rem;
}

.guide-modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.guide-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.guide-close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-base);
}

.guide-close-btn:hover {
    background: var(--error-bg);
    border-color: var(--error);
    color: var(--error);
}

/* Modal Body */
.guide-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1.8rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(13, 148, 136, 0.2) transparent;
}

.guide-modal-body::-webkit-scrollbar {
    width: 5px;
}

.guide-modal-body::-webkit-scrollbar-thumb {
    background: rgba(13, 148, 136, 0.2);
    border-radius: 10px;
}

/* Guide Steps */
.guide-step {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-base);
}

.guide-step:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.guide-step:last-child {
    margin-bottom: 0;
}

.guide-step-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 1.2rem;
    background: #F8FAFC;
    border-bottom: 1px solid var(--border);
}

.step-number {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-teal), #0F766E);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.guide-step-header h3 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.guide-step-content {
    padding: 1rem 1.2rem;
}

.guide-step-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.6rem;
}

.guide-step-content p:last-child {
    margin-bottom: 0;
}

/* Mode Cards */
.guide-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.guide-mode-card {
    display: flex;
    gap: 0.7rem;
    padding: 0.9rem;
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
}

.guide-mode-card:hover {
    border-color: var(--accent-teal);
    background: rgba(13, 148, 136, 0.03);
}

.guide-mode-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.guide-mode-card strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.guide-mode-card p {
    font-size: 0.8rem !important;
    margin: 0 !important;
}

/* Tags */
.guide-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.6rem 0;
}

.guide-tag {
    padding: 0.3rem 0.7rem;
    background: linear-gradient(135deg, var(--accent-gold), #B8860B);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Table Demo */
.guide-table-demo {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

.guide-col {
    padding: 0.7rem;
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.guide-col-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.4rem;
    display: inline-block;
}

.guide-col-header.vn { background: rgba(217, 79, 79, 0.1); color: var(--accent-red); }
.guide-col-header.pinyin { background: rgba(13, 148, 136, 0.1); color: var(--accent-teal); }
.guide-col-header.hantu { background: rgba(124, 58, 237, 0.1); color: var(--accent-purple); }
.guide-col-header.result { background: var(--bg-secondary); color: var(--text-secondary); }
.guide-col-header.check { background: rgba(5, 150, 105, 0.1); color: var(--success); }

.guide-col p {
    font-size: 0.78rem !important;
    margin: 0 !important;
}

.guide-col code {
    padding: 0.15rem 0.4rem;
    background: rgba(13, 148, 136, 0.08);
    border: 1px solid rgba(13, 148, 136, 0.15);
    border-radius: 4px;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--accent-teal);
}

.guide-col code.cn-text {
    font-family: var(--font-cn);
    color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.15);
    font-size: 0.95rem;
}

/* Result Types */
.guide-result-types {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.guide-result-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.guide-badge {
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.guide-badge.correct {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.guide-badge.partial {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.guide-badge.incorrect {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid var(--error-border);
}

.guide-result-item p {
    font-size: 0.78rem !important;
    margin: 0 !important;
}

/* Action List */
.guide-actions-demo {
    padding-top: 0.5rem;
}

.guide-action-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.guide-action-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.83rem;
    color: var(--text-secondary);
}

.guide-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.guide-action-btn.green {
    background: linear-gradient(135deg, var(--accent-teal), #059669);
    border-color: transparent;
    color: white;
}

/* Note */
.guide-note {
    padding: 0.6rem 0.8rem !important;
    background: rgba(13, 148, 136, 0.04);
    border-left: 3px solid var(--accent-teal);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.8rem !important;
    margin-top: 0.5rem !important;
}

/* Pinyin Demo */
.guide-pinyin-demo {
    margin-top: 0.5rem;
    padding: 0.8rem;
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.guide-tone-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.6rem 0;
}

.guide-tone-example {
    padding: 0.35rem 0.7rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--accent-teal);
    letter-spacing: 0.15em;
}

/* Keyboard Shortcuts */
.guide-shortcuts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.guide-shortcut {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 0.2rem 0.6rem;
    background: linear-gradient(180deg, #F8FAFC, #F1F5F9);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 6px;
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Tips */
.guide-tips {
    padding: 0.8rem 1rem;
    background: rgba(13, 148, 136, 0.04);
    border: 1px solid rgba(13, 148, 136, 0.12);
    border-radius: var(--radius-sm);
}

.guide-tips h4 {
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent-teal);
    margin-bottom: 0.5rem;
}

.guide-tips ul {
    list-style: none;
    padding: 0;
}

.guide-tips li {
    position: relative;
    padding-left: 1.2rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.guide-tips li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-teal);
    font-weight: 700;
}

.guide-tips li strong {
    color: var(--text-primary);
}

/* Modal Footer */
.guide-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.8rem;
    background: #F8FAFC;
    border-top: 1px solid var(--border);
}

.guide-modal-footer p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.guide-start-btn {
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-teal), #059669);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-base);
}

.guide-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-jade-glow);
}

/* ===== Responsive Design ===== */

/* Tablet */
@media (max-width: 1024px) {
    .header-content {
        flex-wrap: wrap;
    }

    .controls-wrapper {
        flex-wrap: wrap;
    }

    .table-header,
    .table-row {
        grid-template-columns: 40px 1.2fr 1.2fr 1fr 1.2fr 1fr 0.7fr;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .app-header {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 0.8rem;
    }

    .header-stats {
        width: 100%;
        justify-content: center;
    }

    .controls-section {
        padding: 0.8rem 1rem;
    }

    .controls-wrapper {
        justify-content: center;
    }

    .table-section {
        padding: 0.5rem 0.5rem 1rem;
    }

    .table-header {
        display: none;
    }

    .table-row {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        padding: 1rem;
        margin-bottom: 0.5rem;
        border-radius: var(--radius-md);
        border: 1px solid var(--border);
        background: white;
    }

    .td-stt {
        position: absolute;
        top: 0.5rem;
        right: 0.8rem;
        font-size: 0.75rem;
        background: var(--bg-secondary);
        padding: 0.15rem 0.5rem;
        border-radius: var(--radius-full);
    }

    .table-row {
        position: relative;
    }

    .td {
        padding: 0.2rem 0;
    }

    .practice-table {
        box-shadow: none;
        border: none;
        background: transparent;
    }

    .summary-section {
        padding: 0 0.5rem 1rem;
    }

    .summary-grid {
        gap: 1rem;
    }

    .summary-ring {
        width: 80px;
        height: 80px;
    }

    .action-buttons {
        width: 100%;
        justify-content: center;
    }

    .mode-toggle {
        width: 100%;
        justify-content: center;
    }

    .category-tabs {
        justify-content: center;
    }

    /* Guide responsive */
    .guide-text { display: none; }

    .guide-modal {
        width: 95%;
        max-height: 92vh;
    }

    .guide-modal-header {
        padding: 1rem 1.2rem;
    }

    .guide-modal-body {
        padding: 1rem 1.2rem;
    }

    .guide-modes {
        grid-template-columns: 1fr;
    }

    .guide-table-demo {
        grid-template-columns: 1fr 1fr;
    }

    .guide-result-types {
        grid-template-columns: 1fr;
    }

    .guide-modal-footer {
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
        padding: 1rem 1.2rem;
    }

    .pinyin-helper {
        left: 0.5rem;
        right: 0.5rem;
        min-width: unset;
        bottom: 0.5rem;
    }
}

/* Small Mobile */
@media (max-width: 375px) {
    html {
        font-size: 13px;
    }

    .stat-card {
        padding: 0.35rem 0.6rem;
    }

    .action-btn {
        padding: 0.45rem 0.7rem;
        font-size: 0.78rem;
    }
}

/* ===== Footer Features Bar ===== */
.footer-features {
    position: relative;
    z-index: 3;
    padding: 0 2rem;
    margin-top: 2rem;
}

.footer-features-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.8rem;
    padding: 1.2rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-teal);
}

.feature-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.feature-item p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.feature-item p strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* ===== Main Footer ===== */
.app-footer {
    position: relative;
    z-index: 3;
    background: linear-gradient(135deg, #1E3A5F 0%, #1a2f4d 40%, #162847 100%);
    color: rgba(255, 255, 255, 0.85);
    margin-top: 0;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1.3fr;
    gap: 2.5rem;
    padding: 3rem 2rem 2rem;
}

.footer-col h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Footer About */
.footer-logo-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.footer-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: brightness(1.2) drop-shadow(0 2px 6px rgba(255, 255, 255, 0.15));
    border-radius: 8px;
    flex-shrink: 0;
}

.footer-logo-group h3 {
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.footer-about p {
    font-size: 0.85rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.7);
}

/* Footer Links */
.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links li {
    position: relative;
    padding: 0.45rem 0 0.45rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-links li:last-child {
    border-bottom: none;
}

.footer-links li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.1rem;
    font-weight: 700;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.88rem;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: #60A5FA;
    padding-left: 4px;
}

/* Footer Contact */
.footer-contact h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.6rem;
    font-style: italic;
}

.contact-list {
    list-style: none;
    padding: 0;
}

.contact-list li {
    position: relative;
    padding: 0.4rem 0 0.4rem 1rem;
    font-size: 0.82rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

.contact-list li strong {
    color: rgba(255, 255, 255, 0.95);
    display: block;
    margin-bottom: 0.15rem;
}

.contact-info {
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-info p {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.35rem;
}

.contact-info a {
    color: #60A5FA;
    text-decoration: none;
    transition: var(--transition-fast);
}

.contact-info a:hover {
    color: #93C5FD;
    text-decoration: underline;
}

/* Footer Bottom */
.footer-bottom {
    text-align: center;
    padding: 1rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.15);
}

.footer-bottom p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ===== Footer Responsive ===== */
@media (max-width: 1024px) {
    .footer-features-inner {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .footer-about {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .footer-features {
        padding: 0 1rem;
    }

    .footer-features-inner {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }

    .feature-item {
        padding: 1rem 0.8rem;
    }

    .feature-icon {
        font-size: 2rem;
    }

    .feature-item p {
        font-size: 0.8rem;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 2rem 1rem 1.5rem;
    }

    .footer-about {
        grid-column: auto;
    }
}

@media (max-width: 375px) {
    .footer-features-inner {
        grid-template-columns: 1fr;
    }
}

/* ===== Speak / TTS Buttons ===== */
.speak-btn {
    background: none;
    border: 2px solid var(--accent-jade);
    color: var(--accent-jade);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0.45rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-left: 0.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.speak-btn:hover {
    background: var(--accent-jade);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 2px 8px var(--accent-jade-glow);
}

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

.speak-btn.speaking {
    animation: pulse-speak 0.6s ease-in-out infinite alternate;
    background: var(--accent-jade);
    color: #fff;
}

@keyframes pulse-speak {
    from { transform: scale(1); box-shadow: 0 0 0 0 var(--accent-jade-glow); }
    to { transform: scale(1.15); box-shadow: 0 0 12px 4px var(--accent-jade-glow); }
}

.speak-hint-btn {
    background: none;
    border: 1.5px solid var(--accent-blue);
    color: var(--accent-blue);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 0.3rem;
    line-height: 1;
}

.speak-hint-btn:hover {
    background: var(--accent-blue);
    color: #fff;
    transform: scale(1.1);
}

/* Vietnamese text + speak button layout */
.td-vi {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.vi-text {
    flex: 1;
}

/* ===== Easy ("gõ theo") mode reference card ===== */
.td-vi-easy {
    display: flex;
    align-items: stretch;
}

.vi-card {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    width: 100%;
    padding: 0.5rem 0.7rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.07), rgba(20, 184, 166, 0.05));
    border: 1.5px solid var(--accent-jade-glow, rgba(16, 185, 129, 0.25));
    border-left: 4px solid var(--accent-teal);
    border-radius: var(--radius-sm);
}

.td-vi-easy .vi-text {
    flex: none;
    font-weight: 700;
    color: var(--accent-red);
}

.vi-card-pinyin {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    color: var(--accent-teal);
    font-size: 0.9rem;
}

.vi-card-hantu {
    font-family: var(--font-cn);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
}

.vi-card-hanviet {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-muted);
    text-transform: capitalize;
}

.hint-hanviet {
    font-style: italic;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* ===== Review mode (SRS) ===== */
.review-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    margin-left: 0.35rem;
    border-radius: var(--radius-full);
    background: var(--accent-orange, #ea580c);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.review-empty {
    grid-column: 1 / -1;
    padding: 3rem 1.5rem;
    text-align: center;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ===== Import / export buttons ===== */
.data-buttons {
    display: flex;
    gap: 0.4rem;
}

.data-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.7rem;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.data-btn:hover {
    border-color: var(--accent-teal);
    color: var(--accent-teal);
}

/* ===== Streak Display ===== */
.streak-display {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.4rem 1rem 0.4rem 0.7rem;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition-base);
    cursor: default;
    white-space: nowrap;
}

.streak-display.streak-active {
    border-color: var(--accent-orange);
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.08), rgba(217, 119, 6, 0.06));
    color: var(--accent-orange);
    box-shadow: 0 2px 12px rgba(234, 88, 12, 0.15);
}

.streak-fire {
    font-size: 1.1rem;
    line-height: 1;
}

.streak-count {
    font-size: 1.1rem;
    font-weight: 800;
}

.streak-display.streak-active .streak-fire {
    animation: fire-bob 1s ease-in-out infinite alternate;
}

@keyframes fire-bob {
    from { transform: translateY(0) scale(1); }
    to { transform: translateY(-2px) scale(1.1); }
}

/* ===== Progress Summary Additions ===== */
.detail-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
    margin: 0.5rem 0;
}

.streak-value {
    color: var(--accent-orange) !important;
    font-weight: 700;
}

/* ===== Responsive: Streak in Header ===== */
@media (max-width: 768px) {
    .streak-display {
        font-size: 0.8rem;
        padding: 0.3rem 0.7rem;
    }

    .speak-btn {
        font-size: 0.75rem;
        padding: 0.2rem 0.35rem;
    }
}

@media (max-width: 480px) {
    .streak-display {
        display: none;
    }
}
