/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    color: #1a1a2e;
    background: #fafbfc;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== Navbar ===== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: box-shadow 0.3s;
}
.navbar.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.08); }
.nav-container {
    max-width: 1200px; margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.25rem; color: #6c5ce7; }
.logo-icon { font-size: 1.5rem; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links > a { font-size: 0.9rem; font-weight: 500; color: #555; transition: color 0.2s; }
.nav-links > a:hover { color: #6c5ce7; }
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* Nav Dropdown */
.nav-dropdown { position: relative; }
.nav-more-btn {
    background: none; border: none; padding: 0;
    font-size: 0.9rem; font-weight: 500; color: #555;
    cursor: pointer; transition: color 0.2s; line-height: inherit;
    font-family: inherit;
}
.nav-more-btn:hover { color: #6c5ce7; }
.nav-dropdown-menu {
    display: none; position: absolute; top: 100%; right: 0;
    margin-top: 8px; background: white; border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12); border: 1px solid #eee;
    min-width: 180px; padding: 8px 0; z-index: 200;
}
.nav-dropdown-menu a {
    display: block; padding: 10px 20px; font-size: 0.88rem;
    font-weight: 500; color: #555; transition: all 0.15s;
}
.nav-dropdown-menu a:hover { background: #f8f9ff; color: #6c5ce7; }
.nav-dropdown.open .nav-dropdown-menu { display: block; }

/* Secondary sections hidden by default */
.secondary-section { display: none; }
.secondary-section.visible { display: block; }

/* Secondary mode: hide homepage, show only target section */
body.secondary-mode .hero,
body.secondary-mode #daily,
body.secondary-mode #today-content,
body.secondary-mode .day-complete-banner { display: none !important; }
body.secondary-mode .secondary-section.visible { padding-top: 90px; }
.back-home-btn {
    margin-bottom: 20px; padding: 10px 18px; background: #f0f0f0;
    border: none; border-radius: 8px; font-size: 0.9rem; font-weight: 600;
    cursor: pointer; color: #333; transition: background 0.2s;
}
.back-home-btn:hover { background: #e0e0e0; }

/* ===== Hero ===== */
.hero {
    padding: 140px 24px 80px;
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 50%, #74b9ff 100%);
    color: white; text-align: center;
}
.hero.hero-compact {
    padding: 90px 24px 32px;
}
.day-complete-banner {
    position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, #27ae60, #2ecc71); color: white;
    padding: 12px 20px; border-radius: 12px; box-shadow: 0 6px 20px rgba(39,174,96,0.4);
    z-index: 1000; display: flex; align-items: center; gap: 14px;
    font-weight: 700; font-size: 0.95rem;
}
.day-complete-banner button {
    background: white; color: #27ae60; border: none; padding: 8px 16px;
    border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 0.9rem;
}
.day-complete-banner button:hover { background: #f0fff4; }
.hero-compact h1 { font-size: 2rem; margin-bottom: 8px; }
.hero-compact .hero-sub { font-size: 0.95rem; margin-bottom: 0; opacity: 0.85; }
.hero-content { max-width: 700px; margin: 0 auto; }
.hero-badge {
    display: inline-block; padding: 6px 16px; border-radius: 20px;
    background: rgba(255,255,255,0.2); font-size: 0.85rem; font-weight: 600;
    margin-bottom: 20px;
}
.hero h1 { font-size: 3rem; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.highlight { color: #ffeaa7; }
.hero-sub { font-size: 1.15rem; opacity: 0.9; margin-bottom: 40px; line-height: 1.7; }
.hero-stats {
    display: flex; justify-content: center; gap: 48px;
    margin-bottom: 40px;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-size: 2.5rem; font-weight: 800; }
.stat-label { font-size: 0.85rem; opacity: 0.8; }
.cta-btn {
    display: inline-block; padding: 16px 40px; border-radius: 12px;
    background: white; color: #6c5ce7; font-weight: 700; font-size: 1.1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.15); }

/* ===== Sections ===== */
.section { padding: 80px 0; }
.section-alt { background: #f0f2f5; }
.section-title { font-size: 2rem; font-weight: 800; text-align: center; margin-bottom: 8px; }
.section-sub { text-align: center; color: #666; margin-bottom: 48px; font-size: 1.05rem; }

/* ===== Roadmap ===== */
.roadmap-timeline { display: flex; flex-direction: column; gap: 32px; }
.phase {
    background: white; border-radius: 16px; overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #eee;
    transition: box-shadow 0.3s;
}
.phase:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.1); }
.phase-header {
    display: flex; align-items: center; gap: 20px;
    padding: 24px 32px; cursor: pointer;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
}
.phase-number {
    width: 48px; height: 48px; border-radius: 12px;
    background: #6c5ce7; color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; font-weight: 800; flex-shrink: 0;
}
.phase[data-phase="2"] .phase-number { background: #00b894; }
.phase[data-phase="3"] .phase-number { background: #e17055; }
.phase-meta h3 { font-size: 1.25rem; font-weight: 700; }
.phase-duration {
    display: inline-block; padding: 2px 10px; border-radius: 6px;
    background: #6c5ce7; color: white; font-size: 0.8rem; font-weight: 600;
    margin-top: 4px;
}
.phase[data-phase="2"] .phase-duration { background: #00b894; }
.phase[data-phase="3"] .phase-duration { background: #e17055; }
.phase-content { padding: 0 32px 32px; }
.phase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.skill-card {
    padding: 20px; border-radius: 12px; background: #f8f9ff;
    border: 1px solid #e8eaf0;
}
.skill-icon { font-size: 2rem; margin-bottom: 8px; }
.skill-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.skill-card li { font-size: 0.88rem; color: #555; padding: 3px 0; padding-left: 16px; position: relative; }
.skill-card li::before { content: "•"; position: absolute; left: 0; color: #6c5ce7; font-weight: bold; }
.phase[data-phase="2"] .skill-card li::before { color: #00b894; }
.phase[data-phase="3"] .skill-card li::before { color: #e17055; }
.phase-target {
    margin-top: 20px; padding: 16px 20px; border-radius: 10px;
    background: #fff3e0; font-size: 0.9rem; color: #555;
    border-left: 4px solid #f39c12;
}

/* ===== Daily Study ===== */
.daily-phase-tabs {
    display: flex; justify-content: center; gap: 12px;
    margin-bottom: 32px; flex-wrap: wrap;
}
.tab-btn {
    padding: 10px 24px; border-radius: 10px; border: 2px solid #ddd;
    background: white; font-weight: 600; font-size: 0.9rem;
    cursor: pointer; transition: all 0.2s;
}
.tab-btn.active { border-color: #6c5ce7; background: #6c5ce7; color: white; }
.tab-btn:hover:not(.active) { border-color: #6c5ce7; color: #6c5ce7; }
.daily-content { display: none; max-width: 800px; margin: 0 auto; }
.daily-content.active { display: block; }
.day-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.day-header h3 { font-size: 1.15rem; }
.streak-badge {
    padding: 6px 16px; border-radius: 20px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white; font-weight: 600; font-size: 0.9rem;
}
.time-block { margin-bottom: 24px; }
.time-label {
    font-weight: 700; font-size: 1rem; margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
}
.time-duration { font-size: 0.8rem; color: #6c5ce7; font-weight: 600; }
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 16px 20px; border-radius: 12px; background: white;
    border: 1px solid #eee; cursor: pointer; transition: all 0.2s;
}
.task-item:hover { border-color: #6c5ce7; box-shadow: 0 2px 8px rgba(108,92,231,0.08); }
.task-item input[type="checkbox"] { display: none; }
.checkmark {
    width: 24px; height: 24px; border-radius: 8px;
    border: 2px solid #ccc; flex-shrink: 0; margin-top: 2px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.task-item input:checked ~ .checkmark {
    background: #00b894; border-color: #00b894;
}
.task-item input:checked ~ .checkmark::after {
    content: "✓"; color: white; font-weight: 700; font-size: 0.8rem;
}
.task-item input:checked ~ .task-info { opacity: 0.5; text-decoration: line-through; }
.task-info { flex: 1; }
.task-info strong { font-size: 0.95rem; display: block; margin-bottom: 2px; }
.task-info p { font-size: 0.82rem; color: #777; }
.task-time { font-size: 0.85rem; font-weight: 700; color: #6c5ce7; flex-shrink: 0; margin-top: 2px; }
.daily-total {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-radius: 12px; background: white;
    border: 2px solid #6c5ce7; font-weight: 600; margin-top: 8px;
}
.progress-text { color: #6c5ce7; }
.daily-tip {
    padding: 14px 18px; border-radius: 10px; background: #f0f7ff;
    border-left: 4px solid #74b9ff; font-size: 0.88rem; color: #555;
    margin-top: 12px; margin-bottom: 8px;
}

/* ===== Resources ===== */
.resource-tabs {
    display: flex; justify-content: center; gap: 8px;
    margin-bottom: 32px; flex-wrap: wrap;
}
.res-tab {
    padding: 8px 18px; border-radius: 8px; border: none;
    background: #eee; font-weight: 600; font-size: 0.85rem;
    cursor: pointer; transition: all 0.2s;
}
.res-tab.active { background: #6c5ce7; color: white; }
.res-tab:hover:not(.active) { background: #ddd; }
.resource-content { display: none; }
.resource-content.active { display: block; }
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.resource-card {
    display: block; padding: 24px; border-radius: 14px; background: white;
    border: 1px solid #eee; transition: all 0.2s;
}
.resource-card:hover { border-color: #6c5ce7; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(108,92,231,0.1); }
.res-icon { font-size: 2rem; margin-bottom: 10px; }
.resource-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.resource-card p { font-size: 0.85rem; color: #666; margin-bottom: 10px; }
.res-tag {
    display: inline-block; padding: 3px 10px; border-radius: 6px;
    background: #f0f2f5; font-size: 0.75rem; font-weight: 600; color: #6c5ce7;
}
.book-card { cursor: default; }
.book-card:hover { transform: none; }

/* ===== Notebooks ===== */
.notebook-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.notebook-card {
    padding: 28px; border-radius: 16px; background: white;
    border: 2px solid #eee; transition: border-color 0.2s;
}
.notebook-card:hover { border-color: #6c5ce7; }
.nb-icon { font-size: 2.5rem; margin-bottom: 12px; }
.notebook-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 16px; }
.nb-content p { font-size: 0.9rem; margin-bottom: 8px; }
.nb-content ul { margin-bottom: 12px; }
.nb-content li { font-size: 0.85rem; color: #555; padding: 2px 0 2px 16px; position: relative; }
.nb-content li::before { content: "→"; position: absolute; left: 0; color: #6c5ce7; }
.nb-example {
    padding: 14px; border-radius: 10px; background: #f8f9ff;
    font-size: 0.82rem; line-height: 1.7; border-left: 3px solid #6c5ce7;
}
.nb-vocab { border-top: 4px solid #fdcb6e; }
.nb-writing { border-top: 4px solid #6c5ce7; }
.nb-speaking { border-top: 4px solid #00b894; }
.nb-strategy { border-top: 4px solid #e17055; }

/* ===== Progress ===== */
.progress-layout { display: grid; grid-template-columns: 360px 1fr; gap: 32px; margin-bottom: 48px; }
.score-input-panel, .progress-chart-panel {
    background: white; padding: 28px; border-radius: 16px;
    border: 1px solid #eee;
}
.score-input-panel h3, .progress-chart-panel h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; }
.score-form { display: flex; flex-direction: column; gap: 14px; }
.score-field label { display: block; font-size: 0.8rem; font-weight: 600; color: #777; margin-bottom: 4px; }
.score-field input {
    width: 100%; padding: 10px 14px; border-radius: 8px;
    border: 1px solid #ddd; font-size: 0.95rem;
    transition: border-color 0.2s;
}
.score-field input:focus { outline: none; border-color: #6c5ce7; }
.score-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.save-score-btn {
    padding: 12px; border-radius: 10px; border: none;
    background: #6c5ce7; color: white; font-weight: 700;
    cursor: pointer; font-size: 0.95rem; transition: background 0.2s;
}
.save-score-btn:hover { background: #5b4bc7; }
.score-history { margin-top: 24px; }
.score-history h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; }
.score-entry {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; border-radius: 8px; background: #f8f9ff;
    margin-bottom: 6px; font-size: 0.82rem;
}
.score-entry .score-date { font-weight: 600; }
.score-entry .score-vals { color: #555; }
.score-entry .score-overall { font-weight: 700; color: #6c5ce7; }
.score-entry .delete-score {
    background: none; border: none; color: #e17055; cursor: pointer;
    font-size: 1rem; padding: 0 4px;
}
.chart-container { position: relative; min-height: 300px; }
.no-data-msg {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    text-align: center; color: #999;
}
.no-data-msg.hidden { display: none; }
.target-line-label { text-align: center; margin-top: 12px; font-size: 0.85rem; color: #e17055; font-weight: 600; }
.target-dot { display: inline-block; width: 12px; height: 3px; background: #e17055; border-radius: 2px; vertical-align: middle; margin-right: 4px; }

/* ===== Calendar ===== */
.calendar-section {
    background: white; padding: 28px; border-radius: 16px; border: 1px solid #eee;
}
.calendar-section h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; }
.calendar-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
    margin-bottom: 16px;
}
.cal-day-header { text-align: center; font-size: 0.75rem; font-weight: 700; color: #999; padding: 6px 0; }
.cal-day {
    aspect-ratio: 1; border-radius: 10px; display: flex;
    align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 600; transition: all 0.2s;
}
.cal-day.empty { background: transparent; }
.cal-day.done { background: #00b894; color: white; }
.cal-day.partial { background: #fdcb6e; color: #333; }
.cal-day.miss { background: #fee; color: #e17055; }
.cal-day.future { background: #f0f2f5; color: #aaa; }
.cal-day.today { box-shadow: 0 0 0 2px #6c5ce7; }
.calendar-legend { display: flex; gap: 20px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: #666; }
.dot { width: 12px; height: 12px; border-radius: 4px; }
.dot-done { background: #00b894; }
.dot-partial { background: #fdcb6e; }
.dot-miss { background: #fee; border: 1px solid #e17055; }
.dot-future { background: #f0f2f5; }

/* ===== Content Tabs ===== */
.content-tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 32px; flex-wrap: wrap; }
.ctab {
    padding: 10px 20px; border-radius: 10px; border: 2px solid #eee;
    background: white; font-weight: 600; font-size: 0.88rem;
    cursor: pointer; transition: all 0.2s;
}
.ctab.active { border-color: #6c5ce7; background: #6c5ce7; color: white; }
.ctab:hover:not(.active) { border-color: #6c5ce7; color: #6c5ce7; }
.ccontent { display: none; }
.ccontent.active { display: block; }
.content-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.content-header h3 { font-size: 1.3rem; font-weight: 700; }
.content-badge {
    padding: 4px 12px; border-radius: 6px;
    background: #6c5ce7; color: white; font-size: 0.8rem; font-weight: 600;
}

/* Story Box */
.story-box {
    padding: 24px; border-radius: 14px; margin-bottom: 20px;
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border: 2px solid #f9ca24; position: relative;
}
.story-box h4 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; color: #2d3436; }
.story-box .story-text {
    font-size: 0.95rem; line-height: 2; color: #2d3436;
}
.story-box .story-text strong {
    padding: 2px 6px; border-radius: 4px; cursor: help;
    transition: background 0.2s;
}
.story-box .story-text .story-word {
    color: #6c5ce7; background: rgba(108,92,231,0.1);
    border-bottom: 2px dashed rgba(108,92,231,0.4);
}
.story-box .story-text .story-word:hover {
    background: rgba(108,92,231,0.25);
}
.story-box .story-text .story-phrasal {
    color: #00b894; background: rgba(0,184,148,0.1);
    border-bottom: 2px dashed rgba(0,184,148,0.4);
}
.story-box .story-text .story-phrasal:hover {
    background: rgba(0,184,148,0.25);
}
.story-label {
    display: inline-block; padding: 3px 10px; border-radius: 6px;
    background: rgba(255,255,255,0.6); font-size: 0.75rem; font-weight: 700;
    margin-bottom: 8px; color: #e17055;
}

/* Phrasals Box */
.phrasals-box {
    display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.phrasal-chip {
    padding: 10px 18px; border-radius: 10px;
    background: white; border: 2px solid #00b894;
    display: flex; flex-direction: column; gap: 2px;
}
.phrasal-chip .pv { font-weight: 700; color: #00b894; font-size: 0.95rem; }
.phrasal-chip .pv-def { font-size: 0.8rem; color: #555; }
.phrasal-chip .pv-ex { font-size: 0.75rem; color: #999; font-style: italic; }

/* Flashcard Tooltip */
.flashcard-tooltip {
    display: none; position: fixed; z-index: 1000;
    padding: 20px; border-radius: 14px;
    background: white; box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    border: 2px solid #6c5ce7;
    max-width: 380px; min-width: 280px;
    pointer-events: none;
    animation: tooltipFade 0.2s ease;
}
.flashcard-tooltip.visible { display: block; }
@keyframes tooltipFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.fc-word { font-size: 1.3rem; font-weight: 800; color: #6c5ce7; margin-bottom: 2px; }
.fc-ipa { font-size: 0.82rem; color: #999; margin-bottom: 4px; }
.fc-syllables {
    display: inline-block; padding: 4px 12px; border-radius: 6px;
    background: #f0f2f5; font-family: monospace; font-size: 0.9rem;
    font-weight: 600; letter-spacing: 1px; margin-bottom: 10px;
    color: #e17055;
}
.fc-mnemonic {
    padding: 12px 14px; border-radius: 10px;
    background: #ffeaa7; font-size: 0.88rem; line-height: 1.6;
    color: #2d3436; border-left: 4px solid #f9ca24;
}
.fc-mnemonic .fc-label {
    font-size: 0.72rem; font-weight: 700; color: #e17055;
    text-transform: uppercase; display: block; margin-bottom: 4px;
}
.fc-meaning {
    margin-top: 8px; font-size: 0.85rem; color: #555;
}
.fc-meaning strong { color: #333; }

/* Vocab Cards */
.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.vocab-card {
    padding: 20px; border-radius: 14px; background: white;
    border: 1px solid #eee; transition: all 0.2s; cursor: pointer;
    position: relative; overflow: hidden;
}
.vocab-card:hover { border-color: #6c5ce7; box-shadow: 0 4px 16px rgba(108,92,231,0.08); }
.vocab-card .word-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.vocab-card .word { font-size: 1.15rem; font-weight: 700; color: #6c5ce7; }
.speak-btn {
    background: none; border: none; cursor: pointer; font-size: 1.1rem;
    padding: 2px 4px; border-radius: 6px; transition: background 0.2s;
    line-height: 1;
}
.speak-btn:hover { background: #f0f2f5; }
.syllables-line {
    font-family: monospace; font-size: 0.82rem; font-weight: 600;
    color: #e17055; margin-bottom: 6px; letter-spacing: 1px;
}
/* Bóc tách cách đọc: âm tiết + âm vị */
.pron-block {
    margin: 8px 0 10px; padding: 8px 10px; border-radius: 8px;
    background: #fafbff; border: 1px solid #eef0f8;
}
.pron-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.pron-row + .pron-row { margin-top: 6px; }
.pron-label {
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: #aaa; width: 52px; flex-shrink: 0;
}
.syl-btn, .ph-btn {
    font-family: monospace; font-size: 0.78rem; font-weight: 600;
    padding: 3px 8px; border-radius: 6px; cursor: pointer;
    border: 1px solid #e0e0ea; background: white; color: #555;
    transition: all 0.15s; line-height: 1.3;
}
.syl-btn:hover, .ph-btn:hover { border-color: #6c5ce7; color: #6c5ce7; background: #f4f2ff; }
.syl-btn:active, .ph-btn:active { transform: scale(0.94); }
.syl-btn.stressed { color: #e17055; border-color: #f5cdbf; background: #fff7f4; }
.syl-btn.stressed:hover { border-color: #e17055; background: #ffeee7; }
/* màu theo loại âm để nhìn ra nguyên âm / phụ âm */
.ph-btn.ph-vowel_short { background: #f4fbf6; border-color: #d6ecdd; color: #00926f; }
.ph-btn.ph-vowel_long  { background: #eefaf3; border-color: #bfe4cf; color: #007a5e; }
.ph-btn.ph-diphthong   { background: #fffaf0; border-color: #f3e2bd; color: #b8860b; }
.ph-btn.unknown { color: #bbb; border-style: dashed; cursor: default; }

.vocab-card .ipa { font-size: 0.82rem; color: #999; }
.vocab-card .pos { font-size: 0.75rem; padding: 2px 8px; border-radius: 4px; background: #f0f2f5; color: #666; font-weight: 600; }
.vocab-card .meaning-vi { font-size: 0.9rem; color: #333; margin-bottom: 4px; }
.vocab-card .meaning-en { font-size: 0.82rem; color: #777; font-style: italic; margin-bottom: 8px; }
.vocab-card .example { font-size: 0.82rem; color: #555; padding: 8px 12px; border-radius: 8px; background: #f8f9ff; border-left: 3px solid #6c5ce7; }
.vocab-card .example strong { color: #6c5ce7; }
.vocab-hidden { filter: blur(4px); user-select: none; }
.vocab-card .reveal-hint { text-align: center; font-size: 0.75rem; color: #aaa; margin-top: 6px; }

/* Grammar Card */
.grammar-card {
    background: white; border-radius: 16px; padding: 32px;
    border: 1px solid #eee; max-width: 800px; margin: 0 auto;
}
.grammar-card h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.grammar-card .grammar-level { font-size: 0.8rem; color: #6c5ce7; font-weight: 600; margin-bottom: 16px; }
.grammar-card .grammar-explain { font-size: 0.95rem; color: #444; margin-bottom: 16px; line-height: 1.7; }
.grammar-card .grammar-formula {
    padding: 12px 20px; border-radius: 10px; background: #6c5ce7; color: white;
    font-family: monospace; font-size: 1rem; font-weight: 600;
    text-align: center; margin-bottom: 20px;
}
.grammar-card .grammar-examples { margin-bottom: 20px; }
.grammar-ex {
    padding: 14px 18px; border-radius: 10px; background: #f8f9ff;
    margin-bottom: 8px; border-left: 3px solid #6c5ce7;
}
.grammar-ex .en { font-size: 0.92rem; font-weight: 600; color: #333; }
.grammar-ex .vi { font-size: 0.82rem; color: #888; margin-top: 2px; }
.grammar-card .grammar-practice {
    padding: 16px 20px; border-radius: 10px; background: #fff3e0;
    border-left: 4px solid #f39c12; font-size: 0.9rem;
}
.grammar-card .grammar-practice strong { color: #e67e22; }

/* Grammar Exercise */
.grammar-exercise { margin-top: 20px; }
.grammar-exercise h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 10px; color: #333; }
.grammar-exercise textarea {
    width: 100%; padding: 14px; border: 2px solid #e0e0e0; border-radius: 10px;
    font-size: 0.92rem; font-family: inherit; resize: vertical; transition: border-color 0.2s;
    box-sizing: border-box;
}
.grammar-exercise textarea:focus { border-color: #6c5ce7; outline: none; }
.exercise-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn-ai-review {
    padding: 10px 24px; background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white; border: none; border-radius: 8px; font-weight: 700; font-size: 0.9rem;
    cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.btn-ai-review:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(108,92,231,0.3); }
.btn-ai-settings {
    padding: 10px 14px; background: #f0f0f0; border: none; border-radius: 8px;
    cursor: pointer; font-size: 1.1rem; transition: background 0.2s;
}
.btn-ai-settings:hover { background: #e0e0e0; }
.api-settings {
    margin-top: 12px; padding: 14px; background: #f8f9ff; border-radius: 10px;
    border: 1px solid #e0e0e0;
}
.api-settings label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; color: #555; }
.api-settings input {
    width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 0.85rem; margin-bottom: 8px; box-sizing: border-box;
}
.api-settings button {
    padding: 6px 16px; background: #6c5ce7; color: white; border: none;
    border-radius: 6px; font-size: 0.82rem; cursor: pointer;
}
.ai-feedback { margin-top: 16px; }
.ai-loading { padding: 16px; text-align: center; color: #6c5ce7; font-weight: 600; }
.ai-result {
    padding: 18px; background: #f0fff4; border-radius: 10px; border-left: 4px solid #27ae60;
    font-size: 0.9rem; line-height: 1.7; color: #333;
}
.ai-error {
    padding: 14px; background: #fff0f0; border-radius: 10px; border-left: 4px solid #e74c3c;
    font-size: 0.88rem; color: #c0392b;
}

/* Essay Card */
.essay-card {
    background: white; border-radius: 16px; padding: 32px;
    border: 1px solid #eee; max-width: 900px; margin: 0 auto;
}
.essay-card .essay-meta { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.essay-card .essay-type {
    padding: 4px 12px; border-radius: 6px;
    background: #dfe6e9; font-size: 0.8rem; font-weight: 700; color: #2d3436;
}
.essay-card .essay-band {
    padding: 4px 12px; border-radius: 6px;
    background: #00b894; color: white; font-size: 0.8rem; font-weight: 700;
}
.essay-card .essay-topic {
    font-size: 1.05rem; font-weight: 700; color: #333; margin-bottom: 16px;
    padding: 14px 18px; border-radius: 10px; background: #f8f9ff;
    border-left: 3px solid #6c5ce7;
}
.essay-card .essay-structure {
    font-size: 0.85rem; color: #6c5ce7; font-weight: 600; margin-bottom: 16px;
}
.essay-card .essay-body {
    font-size: 0.92rem; line-height: 1.9; color: #333; margin-bottom: 20px;
    white-space: pre-line;
}
.essay-card .essay-body mark {
    background: #ffeaa7; padding: 1px 4px; border-radius: 3px;
}
.essay-actions { margin-bottom: 14px; }
.btn-essay-translate {
    padding: 10px 20px; background: linear-gradient(135deg, #00b894, #55efc4);
    color: white; border: none; border-radius: 8px; font-weight: 700; font-size: 0.9rem;
    cursor: pointer; transition: transform 0.15s;
}
.btn-essay-translate:hover { transform: translateY(-1px); }
.essay-translation { margin-bottom: 20px; }
.essay-translation-body {
    padding: 18px; background: #e8f5e9; border-radius: 10px; border-left: 4px solid #27ae60;
    font-size: 0.92rem; line-height: 1.9; color: #2e7d32; white-space: pre-line;
}
.essay-card .essay-highlights h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 8px; color: #6c5ce7; }
.essay-card .highlight-list { display: flex; flex-wrap: wrap; gap: 8px; }
.highlight-chip {
    padding: 4px 12px; border-radius: 6px; background: #ffeaa7;
    font-size: 0.82rem; font-weight: 600; color: #333;
}

/* Speaking Card */
.speaking-sections { display: flex; flex-direction: column; gap: 20px; max-width: 800px; margin: 0 auto; }
.speaking-part {
    background: white; border-radius: 14px; padding: 24px;
    border: 1px solid #eee;
}
.speaking-part h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.speaking-part .part-topic { color: #6c5ce7; font-weight: 600; font-size: 0.9rem; margin-bottom: 12px; }
.speaking-part .questions { display: flex; flex-direction: column; gap: 6px; }
.speaking-part .sq { padding: 10px 14px; border-radius: 8px; background: #f8f9ff; font-size: 0.88rem; }
.speaking-part .cue-points { margin: 12px 0; }
.speaking-part .cue-points li { font-size: 0.85rem; color: #555; padding: 2px 0 2px 16px; position: relative; }
.speaking-part .cue-points li::before { content: "•"; position: absolute; left: 0; color: #6c5ce7; }
.speaking-part .sample-ideas {
    padding: 12px 16px; border-radius: 8px; background: #fff3e0;
    font-size: 0.82rem; color: #555; border-left: 3px solid #f39c12;
}
.speaking-part .time-guide {
    margin-top: 8px; font-size: 0.78rem; color: #999;
}

/* Dictation Card */
.dictation-card {
    background: white; border-radius: 16px; padding: 32px;
    border: 1px solid #eee; max-width: 800px; margin: 0 auto;
}
.dictation-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.dictation-card .dict-meta { display: flex; gap: 12px; margin-bottom: 20px; }
.dictation-card .dict-level { padding: 3px 10px; border-radius: 6px; background: #dfe6e9; font-size: 0.78rem; font-weight: 600; }
.dictation-card .dict-wc { font-size: 0.82rem; color: #999; }
.dictation-card .dict-instructions {
    padding: 16px; border-radius: 10px; background: #f0f7ff; border-left: 4px solid #74b9ff;
    margin-bottom: 20px; font-size: 0.88rem; color: #555;
}
.dictation-card .dict-instructions ol { padding-left: 20px; }
.dictation-card .dict-instructions li { margin-bottom: 4px; }
.dict-text-area {
    padding: 20px; border-radius: 10px; background: #f8f9ff;
    border: 2px dashed #ddd; margin-bottom: 16px; min-height: 120px;
    position: relative;
}
.dict-text-area .dict-text { font-size: 0.95rem; line-height: 1.8; filter: blur(6px); user-select: none; transition: filter 0.3s; }
.dict-text-area .dict-text.revealed { filter: none; user-select: text; }
.dict-reveal-btn {
    display: block; margin: 0 auto 16px; padding: 10px 24px; border-radius: 8px;
    background: #6c5ce7; color: white; border: none; font-weight: 600;
    cursor: pointer; font-size: 0.9rem;
}
.dict-reveal-btn:hover { background: #5b4bc7; }

/* Dictation Input */
.dict-progress { margin-bottom: 14px; }
.dict-progress span { font-size: 0.88rem; font-weight: 600; color: #555; }
.dict-progress-bar {
    height: 6px; background: #e0e0e0; border-radius: 3px; margin-top: 6px; overflow: hidden;
}
.dict-progress-fill {
    height: 100%; background: linear-gradient(135deg, #00b894, #55efc4);
    border-radius: 3px; transition: width 0.3s;
}
.dict-controls { display: flex; gap: 8px; margin-bottom: 14px; }
.btn-dict-listen, .btn-dict-slow {
    padding: 10px 20px; border: none; border-radius: 8px; font-weight: 700; font-size: 0.9rem;
    cursor: pointer; transition: transform 0.15s;
}
.btn-dict-listen {
    background: linear-gradient(135deg, #00b894, #55efc4); color: white;
}
.btn-dict-slow {
    background: linear-gradient(135deg, #fdcb6e, #f9ca24); color: #333;
}
.btn-dict-listen:hover, .btn-dict-slow:hover { transform: translateY(-1px); }
.dict-input-area { margin-bottom: 14px; }
.dict-input-area input[type="text"] {
    width: 100%; padding: 14px; border: 2px solid #e0e0e0; border-radius: 10px;
    font-size: 0.95rem; font-family: inherit; box-sizing: border-box;
    transition: border-color 0.2s;
}
.dict-input-area input[type="text"]:focus { border-color: #00b894; outline: none; }
.dict-btns { display: flex; gap: 8px; margin-top: 10px; }
.btn-dict-compare {
    padding: 10px 24px; background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white; border: none; border-radius: 8px; font-weight: 700; font-size: 0.9rem;
    cursor: pointer; transition: transform 0.15s;
}
.btn-dict-next {
    padding: 10px 24px; background: linear-gradient(135deg, #00b894, #55efc4);
    color: white; border: none; border-radius: 8px; font-weight: 700; font-size: 0.9rem;
    cursor: pointer; transition: transform 0.15s;
}
.btn-dict-compare:hover, .btn-dict-next:hover { transform: translateY(-1px); }
.dict-compare-result { margin: 14px 0; }
.dict-score {
    font-size: 1rem; font-weight: 700; color: #6c5ce7; margin-bottom: 8px;
}
.dict-diff {
    padding: 14px; background: #f8f9ff; border-radius: 10px; line-height: 2;
    font-size: 0.92rem;
}
.dict-word-ok { color: #27ae60; font-weight: 600; }
.dict-word-wrong {
    color: #e74c3c; font-weight: 700; text-decoration: underline wavy #e74c3c;
    cursor: help;
}
.dict-retry {
    margin-top: 8px; padding: 10px 14px; background: #fff3e0; border-radius: 8px;
    font-size: 0.85rem; color: #e65100; font-weight: 600;
}
.dict-translate {
    margin-top: 10px; padding: 10px 14px; background: #e8f5e9; border-radius: 8px;
    font-size: 0.9rem; color: #2e7d32; font-weight: 500;
}
.dict-summary {
    margin-top: 16px; padding: 18px; background: #f0fff4; border-radius: 12px;
    border: 2px solid #27ae60;
}
.dict-summary h4 { margin: 0 0 8px; color: #27ae60; }
.dict-final-score { font-size: 1.2rem; font-weight: 700; color: #333; margin-bottom: 8px; }
.dict-final-bar {
    height: 10px; background: #e0e0e0; border-radius: 5px; overflow: hidden;
}
.dict-final-fill {
    height: 100%; background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-radius: 5px; transition: width 0.5s;
}

.dict-vocab h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 8px; }
.dict-vocab .kv-list { display: flex; flex-wrap: wrap; gap: 8px; }
.dict-vocab .kv {
    padding: 4px 12px; border-radius: 6px; background: #e8f5e9;
    font-size: 0.82rem; font-weight: 600; color: #2d7d46;
}

/* Phrases Card */
.phrases-card {
    background: white; border-radius: 16px; padding: 32px;
    border: 1px solid #eee; max-width: 800px; margin: 0 auto;
}
.phrases-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; color: #6c5ce7; }
.phrases-card .phrases-sub { font-size: 0.85rem; color: #999; margin-bottom: 20px; }
.phrase-item {
    padding: 14px 18px; border-radius: 10px; background: #f8f9ff;
    margin-bottom: 8px; font-size: 0.95rem; border-left: 3px solid #6c5ce7;
    font-style: italic; color: #333;
}
.phrases-card .linking-section { margin-top: 24px; }
.phrases-card .linking-section h4 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.linking-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.linking-group h5 {
    font-size: 0.8rem; font-weight: 700; color: #6c5ce7;
    text-transform: uppercase; margin-bottom: 6px;
}
.linking-group .lw {
    display: inline-block; padding: 3px 10px; border-radius: 6px;
    background: #f0f2f5; font-size: 0.78rem; margin: 2px 4px 2px 0;
}

/* ===== Reading ===== */
.reading-card {
    background: white; border-radius: 16px; padding: 32px;
    border: 1px solid #eee; max-width: 850px; margin: 0 auto;
}
.reading-card h3 { font-size: 1.2rem; font-weight: 700; color: #6c5ce7; margin: 0 0 4px; }
.reading-sub { font-size: 0.85rem; color: #999; margin-bottom: 14px; }
.reading-vocab {
    padding: 10px 14px; background: #fff8e1; border-radius: 8px; font-size: 0.85rem;
    color: #555; margin-bottom: 14px; border-left: 3px solid #f9ca24;
}
.btn-reading-gen, .btn-reading-check {
    padding: 12px 28px; background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white; border: none; border-radius: 10px; font-weight: 700; font-size: 0.95rem;
    cursor: pointer; transition: transform 0.15s;
}
.btn-reading-gen:hover, .btn-reading-check:hover { transform: translateY(-1px); }
.reading-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.btn-reading-regen {
    background: #f0f0f0; border: none; padding: 8px 12px; border-radius: 8px;
    cursor: pointer; font-size: 1.1rem;
}
.btn-reading-regen:hover { background: #e0e0e0; }
.reading-passage {
    padding: 20px; background: #f8f9ff; border-radius: 10px;
    font-size: 0.95rem; line-height: 1.9; color: #333; margin-bottom: 14px;
}
.reading-passage mark { background: #ffeaa7; padding: 1px 4px; border-radius: 3px; }
.reading-actions { margin-bottom: 14px; }
.reading-q-title { font-size: 1rem; font-weight: 700; margin: 20px 0 10px; color: #333; }
.reading-questions { margin-bottom: 16px; }
.rq {
    padding: 14px; background: #f8f9ff; border-radius: 10px; margin-bottom: 10px;
}
.rq-text { font-size: 0.92rem; font-weight: 600; margin-bottom: 8px; color: #333; }
.rq-options { display: flex; gap: 14px; flex-wrap: wrap; }
.rq-options.rq-mc { flex-direction: column; gap: 6px; }
.rq-options label {
    display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem;
    cursor: pointer; padding: 4px 0;
}
.rq-short {
    width: 100%; padding: 10px 12px; border: 2px solid #e0e0e0; border-radius: 8px;
    font-size: 0.92rem; font-family: inherit; box-sizing: border-box;
}
.rq-short:focus { border-color: #6c5ce7; outline: none; }
.reading-score {
    margin: 16px 0 10px; font-size: 1.1rem; font-weight: 700; color: #6c5ce7;
}
.rq-result {
    padding: 8px 14px; border-radius: 8px; margin-bottom: 6px; font-size: 0.88rem;
}
.rq-result.ok { background: #e8f5e9; color: #2e7d32; }
.rq-result.wrong { background: #ffebee; color: #c62828; }

/* ===== SRS Review ===== */
.review-card {
    background: white; border-radius: 16px; padding: 32px;
    border: 1px solid #eee; max-width: 600px; margin: 0 auto;
}
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.review-header h3 { font-size: 1.2rem; font-weight: 700; color: #6c5ce7; margin: 0; }
.review-count { font-size: 0.88rem; font-weight: 600; color: #e67e22; background: #fff3e0; padding: 4px 12px; border-radius: 20px; }
.review-stats { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.review-stats span { font-size: 0.82rem; font-weight: 600; padding: 4px 10px; border-radius: 6px; }
.stat-new { background: #e3f2fd; color: #1976d2; }
.stat-learning { background: #fff3e0; color: #e65100; }
.stat-mastered { background: #e8f5e9; color: #2e7d32; }
.review-empty { text-align: center; padding: 40px 20px; }
.review-empty h3 { color: #27ae60; margin-bottom: 8px; }
.review-empty p { color: #888; }

.srs-card { text-align: center; }
.srs-progress { font-size: 0.82rem; color: #999; margin-bottom: 16px; }
.srs-front { padding: 30px 20px; background: #f8f9ff; border-radius: 14px; margin-bottom: 16px; }
.srs-word { font-size: 2rem; font-weight: 800; color: #333; margin-bottom: 4px; }
.srs-ipa { font-size: 1rem; color: #888; margin-bottom: 10px; }
.srs-speak { font-size: 1.2rem; }
.srs-answer {
    padding: 20px; background: #f0fff4; border-radius: 12px; margin-bottom: 16px;
    border: 2px solid #27ae60; text-align: left;
}
.srs-meaning-vi { font-size: 1.1rem; font-weight: 700; color: #27ae60; margin-bottom: 4px; }
.srs-meaning-en { font-size: 0.92rem; color: #555; margin-bottom: 8px; }
.srs-example { font-size: 0.88rem; color: #666; font-style: italic; margin-bottom: 8px; }
.srs-mnemonic { font-size: 0.85rem; color: #6c5ce7; background: #f3f0ff; padding: 8px 12px; border-radius: 8px; }

.btn-srs-show {
    padding: 14px 40px; background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white; border: none; border-radius: 10px; font-weight: 700; font-size: 1rem;
    cursor: pointer; transition: transform 0.15s;
}
.btn-srs-show:hover { transform: translateY(-2px); }

.srs-ratings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.srs-btn {
    padding: 12px 8px; border: none; border-radius: 10px; cursor: pointer;
    font-weight: 700; transition: transform 0.15s; text-align: center;
}
.srs-btn:hover { transform: translateY(-2px); }
.srs-label { display: block; font-size: 0.9rem; }
.srs-time { display: block; font-size: 0.72rem; opacity: 0.8; margin-top: 2px; }
.srs-again { background: #ff6b6b; color: white; }
.srs-hard { background: #f39c12; color: white; }
.srs-good { background: #27ae60; color: white; }
.srs-easy { background: #3498db; color: white; }

/* ===== Settings ===== */
.settings-card {
    background: white; border-radius: 16px; padding: 32px;
    border: 1px solid #eee; max-width: 600px; margin: 0 auto;
}
.settings-card h3 { font-size: 1.2rem; font-weight: 700; color: #333; margin-bottom: 20px; }
.setting-item { margin-bottom: 24px; }
.setting-item label { display: block; font-weight: 700; font-size: 0.92rem; margin-bottom: 8px; color: #555; }
.setting-wpd { display: flex; gap: 8px; margin-bottom: 8px; }
.wpd-btn {
    padding: 10px 24px; border: 2px solid #e0e0e0; border-radius: 8px;
    background: white; font-weight: 700; font-size: 1rem; cursor: pointer;
    transition: all 0.2s;
}
.wpd-btn.active { border-color: #6c5ce7; background: #f3f0ff; color: #6c5ce7; }
.wpd-btn:hover { border-color: #6c5ce7; }
.setting-note { font-size: 0.82rem; color: #888; }
.btn-reset-srs {
    margin-top: 8px; padding: 8px 16px; background: #fff0f0; color: #e74c3c;
    border: 1px solid #e74c3c; border-radius: 6px; font-size: 0.82rem;
    cursor: pointer; transition: background 0.2s;
}
.btn-reset-srs:hover { background: #e74c3c; color: white; }
.ctab-settings { min-width: auto; padding: 8px 12px; }

/* ===== Login ===== */
.login-overlay {
    position: fixed; inset: 0; background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.login-box {
    background: white; padding: 40px 36px; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2); width: 360px; max-width: 90vw;
}
.login-box h2 {
    text-align: center; font-size: 1.5rem; font-weight: 800;
    color: #6c5ce7; margin: 0 0 6px;
}
.login-sub { text-align: center; color: #888; font-size: 0.9rem; margin-bottom: 24px; }
.login-box input {
    width: 100%; padding: 12px 14px; border: 2px solid #e0e0e0; border-radius: 10px;
    font-size: 0.95rem; margin-bottom: 12px; box-sizing: border-box;
    transition: border-color 0.2s; font-family: inherit;
}
.login-box input:focus { border-color: #6c5ce7; outline: none; }
.login-box button {
    width: 100%; padding: 12px; background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white; border: none; border-radius: 10px; font-weight: 700; font-size: 1rem;
    cursor: pointer; transition: transform 0.15s;
}
.login-box button:hover { transform: translateY(-1px); }
.login-error {
    color: #e74c3c; font-size: 0.85rem; margin-bottom: 10px; min-height: 18px;
}

/* ===== Usage ===== */
.usage-summary { margin-bottom: 24px; }
.usage-total {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe); color: white;
    padding: 24px 32px; border-radius: 14px;
    display: flex; justify-content: space-between; align-items: center;
}
.usage-total span { font-size: 0.95rem; opacity: 0.9; }
.usage-total strong { font-size: 2rem; font-weight: 800; }
.usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; margin-bottom: 20px; }
.usage-card {
    background: white; border-radius: 14px; padding: 24px;
    border: 1px solid #eee;
}
.usage-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; color: #333; }
.usage-row {
    display: flex; justify-content: space-between; padding: 8px 0;
    border-bottom: 1px solid #f0f0f0; font-size: 0.9rem;
}
.usage-row span { color: #666; }
.usage-row strong { color: #333; font-weight: 700; }
.usage-row.total { border-bottom: none; border-top: 2px solid #6c5ce7; margin-top: 8px; padding-top: 12px; }
.usage-row.total strong { color: #6c5ce7; }
.usage-note { font-size: 0.82rem; color: #888; margin-top: 8px; }
.usage-actions { margin: 20px 0; }
.usage-admin-key { margin-top: 16px; padding: 14px; background: #f8f9ff; border-radius: 10px; }
.usage-admin-key label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; color: #555; }
.usage-admin-key input {
    width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 0.85rem; margin-bottom: 8px; box-sizing: border-box;
}
.usage-admin-key button {
    padding: 6px 16px; background: #6c5ce7; color: white; border: none;
    border-radius: 6px; font-size: 0.82rem; cursor: pointer;
}
.usage-admin-key a { color: #6c5ce7; }
.usage-progress {
    height: 8px; background: #e0e0e0; border-radius: 4px; margin-top: 10px; overflow: hidden;
}
.usage-progress-fill {
    height: 100%; background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    border-radius: 4px; transition: width 0.3s;
}

/* ===== Tips ===== */
.tips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.tip-card {
    padding: 28px; border-radius: 14px; background: white;
    border: 1px solid #eee; position: relative;
    transition: transform 0.2s;
}
.tip-card:hover { transform: translateY(-2px); }
.tip-num {
    font-size: 3rem; font-weight: 800; color: #f0f2f5; position: absolute;
    top: 12px; right: 20px; line-height: 1;
}
.tip-card h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; color: #6c5ce7; }
.tip-card p { font-size: 0.9rem; color: #555; }

/* ===== Footer ===== */
.footer {
    padding: 32px 24px; text-align: center;
    background: #1a1a2e; color: rgba(255,255,255,0.6); font-size: 0.85rem;
}
.footer a { color: #a29bfe; }
.footer-note { margin-top: 8px; font-size: 0.75rem; opacity: 0.5; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .menu-toggle { display: block; }
    .nav-links.open {
        display: flex; flex-direction: column; position: absolute;
        top: 64px; left: 0; right: 0; background: white;
        padding: 20px; gap: 16px; border-bottom: 1px solid #eee;
        z-index: 200;
    }
    .nav-dropdown-menu { position: static; box-shadow: none; border: none; margin-top: 4px; padding: 0 0 0 12px; }
    .nav-dropdown.open .nav-dropdown-menu { display: block; }
    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 24px; }
    .stat-num { font-size: 1.8rem; }
    .progress-layout { grid-template-columns: 1fr; }
    .phase-header { padding: 16px 20px; }
    .phase-content { padding: 0 20px 20px; }
    .score-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .hero { padding: 120px 16px 60px; }
    .hero h1 { font-size: 1.6rem; }
    .hero-stats { flex-wrap: wrap; gap: 16px; }
    .daily-phase-tabs { gap: 8px; }
    .tab-btn { padding: 8px 16px; font-size: 0.8rem; }
    .resource-tabs { gap: 4px; }
    .res-tab { padding: 6px 12px; font-size: 0.78rem; }
}

/* ===== Vocab Flow: Xem thẻ → Trắc nghiệm → Bài tập ===== */
.vf { max-width: 560px; margin: 0 auto; }
.vf-stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vf-stage { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vf-stage-bar { width: 100%; height: 5px; border-radius: 3px; background: #e4e6eb; transition: background 0.3s; }
.vf-stage-label { font-size: 0.82rem; font-weight: 600; color: #aaa; }
.vf-stage.on .vf-stage-bar { background: #6c5ce7; }
.vf-stage.on .vf-stage-label { color: #1a1a2e; }
.vf-round { text-align: center; font-size: 0.78rem; color: #999; margin: 6px 0 16px; }
.vf-counter { font-size: 0.95rem; font-weight: 600; color: #555; margin-bottom: 10px; }

/* Thẻ lật: 2 mặt chồng cùng ô grid → thẻ cao theo mặt dài hơn */
.vf-card { perspective: 1200px; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.vf-card-inner { display: grid; transition: transform 0.5s; transform-style: preserve-3d; }
.vf-card.flipped .vf-card-inner { transform: rotateY(180deg); }
.vf-face {
    grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden;
    background: white; border: 2px solid #ece9ff; border-radius: 18px;
    box-shadow: 0 6px 24px rgba(108,92,231,0.08); padding: 28px; min-height: 360px;
}
.vf-front { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.vf-back { transform: rotateY(180deg); }
.vf-emoji {
    width: 88px; height: 88px; border-radius: 22px; background: #f3f0ff;
    display: flex; align-items: center; justify-content: center; font-size: 3rem;
}
.vf-emoji.sm { width: 56px; height: 56px; border-radius: 16px; font-size: 1.9rem; flex-shrink: 0; }
.vf-word { font-size: 2.2rem; font-weight: 800; color: #1a1a2e; display: flex; align-items: center; gap: 8px; }
.vf-ipa { color: #999; font-size: 0.95rem; }
.vf-speak { border: none; background: none; cursor: pointer; font-size: 1.3rem; padding: 4px; border-radius: 8px; }
.vf-speak:hover { background: #f3f0ff; }
.vf-speak.sm { font-size: 0.95rem; padding: 0 4px; }
.vf-back-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.vf-back-word { font-size: 1.3rem; font-weight: 800; color: #6c5ce7; }
.vf-translate {
    margin-left: 6px; text-transform: none; letter-spacing: 0;
    border: 1.5px solid #ece9ff; background: white; border-radius: 20px; padding: 2px 10px;
    font-size: 0.72rem; font-weight: 600; cursor: pointer; color: #555;
}
.vf-translate.on { border-color: #6c5ce7; color: #6c5ce7; background: #f3f0ff; }
.vf-label {
    font-size: 0.75rem; font-weight: 700; color: #999; text-transform: uppercase;
    letter-spacing: 0.5px; margin: 16px 0 6px; display: flex; align-items: center; gap: 4px;
}
.vf-meaning { font-size: 1.15rem; font-weight: 700; color: #00a383; }
.vf-def { font-size: 1.05rem; font-weight: 600; color: #1a1a2e; line-height: 1.5; }
.vf-ex { font-size: 0.98rem; color: #444; line-height: 1.5; }
.vf-vi { font-size: 0.9rem; color: #00a383; margin-top: 4px; }
.vf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.vf-chip { padding: 6px 14px; border-radius: 20px; background: #f3f0ff; color: #5a4bd1; font-size: 0.88rem; font-weight: 600; }
.vf-tip { text-align: center; font-size: 0.82rem; color: #999; margin: 14px 0; }

.vf-actions { display: flex; gap: 10px; margin-top: 16px; }
.vf-btn {
    flex: 1; padding: 14px 20px; border-radius: 12px; border: none; cursor: pointer;
    font-weight: 700; font-size: 1rem; transition: transform 0.15s, opacity 0.15s;
}
.vf-btn.primary { background: linear-gradient(135deg, #6c5ce7, #a29bfe); color: white; }
.vf-btn.ghost { flex: 0 0 auto; background: white; border: 2px solid #e4e6eb; color: #555; }
.vf-btn:hover:not(:disabled) { transform: translateY(-1px); }
.vf-btn:disabled { opacity: 0.35; cursor: default; }

.vf-word-row {
    display: flex; align-items: center; gap: 16px; background: white; border: 2px solid #ece9ff;
    border-radius: 18px; padding: 16px 20px; margin-bottom: 14px;
}
.vf-word-row .vf-word { font-size: 1.8rem; flex: 1; }
.vf-panel { background: white; border: 2px solid #ece9ff; border-radius: 18px; padding: 24px; }
.vf-panel .vf-label:first-child { margin-top: 0; }
.vf-question { font-size: 1.1rem; margin-bottom: 16px; }
.vf-option {
    display: block; width: 100%; text-align: left; padding: 14px 18px; margin-bottom: 10px;
    border: 2px solid #e4e6eb; border-radius: 12px; background: #fafbfc;
    font-size: 0.98rem; line-height: 1.45; cursor: pointer; transition: border-color 0.15s;
    font-family: inherit; color: #1a1a2e;
}
.vf-option:hover:not(:disabled) { border-color: #6c5ce7; }
.vf-option:disabled { cursor: default; }
.vf-option.correct { border-color: #00b894; background: #e8f8f3; }
.vf-option.wrong { border-color: #e17055; background: #fdecea; }
.vf-feedback { margin-top: 12px; font-size: 0.92rem; font-weight: 600; }
.vf-feedback.correct { color: #00a383; }
.vf-feedback.wrong { color: #d35400; }

.vf-sentence { font-size: 1.35rem; font-weight: 700; line-height: 1.5; margin-bottom: 18px; color: #1a1a2e; }
.vf-blank { display: inline-block; min-width: 70px; border-bottom: 3px solid #6c5ce7; color: transparent; }
.vf-input {
    width: 100%; padding: 14px 18px; border: 2px solid #e4e6eb; border-radius: 12px;
    font-size: 1.05rem; font-family: inherit; outline: none;
}
.vf-input:focus { border-color: #6c5ce7; }
.vf-input.correct { border-color: #00b894; background: #e8f8f3; }
.vf-input.wrong { border-color: #e17055; background: #fdecea; }
.vf-hint-btn { border: none; background: none; color: #6c5ce7; font-weight: 600; cursor: pointer; margin-top: 12px; font-size: 0.92rem; padding: 0; }
.vf-hint { margin-top: 8px; color: #555; font-size: 0.92rem; }

.vf-summary { text-align: center; }
.vf-summary-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 10px; }
.vf-summary-words { color: #6c5ce7; font-weight: 600; margin-bottom: 14px; line-height: 1.7; }
.vf-summary-score { display: flex; justify-content: center; gap: 24px; color: #555; }

@media (max-width: 480px) {
    .vf-face { padding: 22px; min-height: 320px; }
    .vf-word { font-size: 1.8rem; }
    .vf-sentence { font-size: 1.15rem; }
    .vf-panel { padding: 18px; }
}
.vf-blank.filled { min-width: 0; color: inherit; padding: 0 4px; }
.vf-blank.filled.correct { color: #00a383; border-bottom-color: #00b894; }
.vf-blank.filled.wrong { color: #d35400; border-bottom-color: #e17055; }
.vf-feedback { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.vf-speak-btn {
    margin-left: 6px; border: 1.5px solid #ece9ff; background: white; border-radius: 20px;
    padding: 2px 10px; font-size: 0.72rem; font-weight: 600; cursor: pointer; color: #555;
}
.vf-speak-btn:hover { border-color: #6c5ce7; color: #6c5ce7; }
.btn-srs-known {
    margin-left: 8px; padding: 14px 24px; background: white; color: #27ae60;
    border: 2px solid #27ae60; border-radius: 10px; font-weight: 700; font-size: 1rem;
    cursor: pointer; transition: transform 0.15s;
}
.btn-srs-known:hover { transform: translateY(-2px); background: #f0fff4; }
@media (max-width: 480px) {
    .btn-srs-known { margin: 8px 0 0; width: 100%; }
    .btn-srs-show { width: 100%; }
}
.srs-pos {
    display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 6px;
    background: #f3f0ff; color: #6c5ce7; font-size: 0.8rem; font-weight: 700; vertical-align: middle;
}

/* ===== Sync status ===== */
.sync-status:empty { display: none; }
.sync-status {
    position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 300;
    max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 10px;
    background: #fff3e0; color: #b35900; border: 1px solid #ffcc80;
    font-size: 0.85rem; font-weight: 600; box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
