/* Ewalingo — CSS avec variables dynamiques par langue */

:root {
    --bg: #f0fdf4;
    --surface: #ffffff;
    --text: #1a2e1a;
    --text-muted: #6b7e6b;
    --border: #d1e7d1;
    --primary: #10b981;
    --primary-hover: #059669;
    --primary-light: #d1fae5;
    --accent: #064e3b;
    --correct: #10b981;
    --wrong: #ef4444;
    --sidebar-bg: #064e3b;
    --sidebar-text: #d1fae5;
    --sidebar-active: #10b981;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(6,78,59,0.08);
    --gradient: linear-gradient(135deg, #10b981 0%, #34d399 50%, #6ee7b7 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 220px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem 1rem 1rem;
}

.sidebar-header h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.sidebar-lang {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.lang-flag { font-size: 1.2rem; }

.lang-switcher {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.lang-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background 0.2s;
}
.lang-chip:hover { background: rgba(255,255,255,0.2); }
.lang-chip.active { background: var(--primary); color: #fff; }

.nav-links {
    list-style: none;
    padding: 0.5rem 0;
    flex: 1;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.92rem;
    transition: background 0.15s;
}

.nav-links li a:hover { background: rgba(255,255,255,0.08); }
.nav-links li a.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }

.nav-icon { font-size: 1.1rem; width: 1.5rem; text-align: center; }
.nav-divider { border-top: 1px solid rgba(255,255,255,0.1); margin: 0.5rem 0; }

/* === MAIN CONTENT === */
.main-content {
    margin-left: 220px;
    padding: 2rem;
    max-width: 1200px;
}

.main-public {
    padding: 0;
    max-width: 100%;
}

/* === HAMBURGER === */
.hamburger {
    display: none;
    position: fixed;
    top: 0.75rem; left: 0.75rem;
    z-index: 200;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 90;
}

/* === FLASH MESSAGES === */
.flash-messages { margin-bottom: 1rem; }
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: opacity 0.3s;
}
.flash-error { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.flash-success { background: #f0fdf4; color: #16a34a; border: 1px solid #86efac; }
.flash-info { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }

/* === PAGE HEADER === */
.page-header {
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: 1.6rem;
    color: var(--accent);
}

/* === CARDS === */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

/* === GRIDS === */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    min-height: 44px;
    white-space: nowrap;
}
.btn:hover { background: #f3f4f6; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-small { padding: 0.25rem 0.6rem; font-size: 0.8rem; min-height: 32px; }
.btn-large { padding: 0.75rem 1.5rem; font-size: 1.05rem; }
.btn-full { width: 100%; }

.btn-correct { background: var(--correct); color: #fff; border-color: var(--correct); }
.btn-correct:hover { background: #059669; }
.btn-wrong { background: var(--wrong); color: #fff; border-color: var(--wrong); }
.btn-wrong:hover { background: #dc2626; }
.btn-hard { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.btn-hard:hover { background: #d97706; }
.btn-flip { background: var(--accent); color: #fff; border-color: var(--accent); }

/* === FORMS === */
.input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    min-height: 44px;
    width: 100%;
    background: var(--surface);
    color: var(--text);
}
.input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }
.input-sm { max-width: 200px; }

.input-target { border-left: 3px solid var(--primary); }
.input-native { border-left: 3px solid #059669; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.3rem; font-size: 0.9rem; }
.form-check label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.form-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.form-inline { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }

small.text-muted { font-size: 0.8rem; color: var(--text-muted); display: block; margin-top: 0.25rem; }

/* === TABLES === */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.table th, .table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table th { font-weight: 600; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; }
.table tbody tr:hover { background: #f9fafb; }
.table-compact th, .table-compact td { padding: 0.35rem 0.5rem; }

/* === TOOLBAR === */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.toolbar-actions { display: flex; gap: 0.5rem; }
.filters-form { display: flex; gap: 0.5rem; }

/* === ADD FORM === */
.add-form {
    background: #f9fafb;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

/* === DIFFICULTY BADGES === */
.diff-1 { color: var(--correct); font-weight: 700; }
.diff-2 { color: #10b981; font-weight: 700; }
.diff-3 { color: #f59e0b; font-weight: 700; }
.diff-4 { color: #f97316; font-weight: 700; }
.diff-5 { color: var(--wrong); font-weight: 700; }

/* === CATEGORIES === */
.category-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    background: #f3f4f6;
    color: var(--text);
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.15s;
}
.category-tag:hover { background: #e5e7eb; }
.category-tag-sm {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: #f3f4f6;
    font-size: 0.8rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--text-muted);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-primary { background: var(--primary); }

/* === QUICK ACTIONS === */
.quick-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* === FLASHCARDS === */
.flashcard-container { max-width: 700px; margin: 0 auto; }
.flashcard-filters { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; align-items: center; }

.flashcard {
    width: 100%;
    max-width: 550px;
    height: 300px;
    margin: 1.5rem auto;
    perspective: 1000px;
    cursor: pointer;
}

.fc-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s;
    transform-style: preserve-3d;
}

.flashcard.flipped .fc-inner { transform: rotateY(180deg); }

.fc-front, .fc-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.fc-front {
    background: var(--surface);
    border: 2px solid var(--border);
}

.fc-back {
    background: linear-gradient(135deg, #064e3b, #065f46);
    color: #fff;
    transform: rotateY(180deg);
}

.fc-word { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.fc-hint { font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 1px; }
.fc-context, .fc-grammar { font-size: 0.9rem; opacity: 0.85; margin-top: 0.3rem; }
.fc-interval { font-size: 0.8rem; opacity: 0.6; margin-top: 0.75rem; }
.fc-badge {
    position: absolute;
    top: 0.75rem; right: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}

.fc-controls {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.fc-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.fc-end { text-align: center; padding: 2rem; }
.fc-end h2 { margin-bottom: 0.5rem; }

/* === EXERCISES === */
.ex-config {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.ex-card {
    max-width: 650px;
    margin: 0 auto;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    position: relative;
}

.ex-type-badge {
    position: absolute;
    top: 0.75rem; right: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

.ex-question { font-size: 1.15rem; font-weight: 600; margin-bottom: 1.25rem; padding-right: 5rem; }

.ex-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ex-option {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    transition: all 0.15s;
}
.ex-option:hover { background: #f3f4f6; border-color: var(--primary); }
.ex-option:disabled { cursor: default; }
.ex-option-correct { background: #f0fdf4 !important; border-color: var(--correct) !important; color: #16a34a; }
.ex-option-wrong { background: #fef2f2 !important; border-color: var(--wrong) !important; color: #dc2626; }

.ex-input-area { display: flex; gap: 0.5rem; margin-bottom: 1rem; }

.ex-feedback {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}
.ex-correct { background: #f0fdf4; color: #16a34a; border: 1px solid #86efac; }
.ex-wrong { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }

/* === CONJUGATION === */
.conj-header { margin-bottom: 1.5rem; }
.conj-header h2 { color: var(--primary); }
.conj-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.conj-section { background: #f9fafb; border-radius: var(--radius); padding: 1rem; }
.conj-section h3 { font-size: 1rem; color: var(--accent); margin-bottom: 0.5rem; }

/* === CHAT === */
.chat-card { padding: 0; display: flex; flex-direction: column; max-width: 800px; }
.chat-header { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }

.chat-messages {
    flex: 1;
    min-height: 400px;
    max-height: 500px;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.msg-bubble {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    line-height: 1.5;
    font-size: 0.95rem;
    word-wrap: break-word;
}

.msg-assistant {
    align-self: flex-start;
    background: #f3f4f6;
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.msg-user {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.typing-indicator { opacity: 0.6; animation: blink 1s infinite; }

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
}

.chat-input {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}
.chat-input .input { flex: 1; }

/* === AUTH === */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 420px;
}

.auth-card h1 { text-align: center; margin-bottom: 1.5rem; color: var(--accent); }
.auth-link { text-align: center; margin-top: 1.25rem; font-size: 0.9rem; color: var(--text-muted); }
.auth-link a { color: var(--primary); }

/* === PROFILE === */
.lang-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.lang-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    background: #f9fafb;
}
.lang-active { background: #ecfdf5; border: 1px solid #a7f3d0; }

/* === LANDING === */
.landing { max-width: 1100px; margin: 0 auto; padding: 2rem; position: relative; }

.landing-hero {
    padding: 4rem 1rem 3rem;
}

.hero-split {
    display: flex;
    align-items: center;
    gap: 3rem;
    max-width: 960px;
    margin: 0 auto;
}

.hero-text {
    flex: 1;
}

.hero-mascot {
    flex: 0 0 320px;
    display: flex;
    justify-content: center;
}

.mascot-img {
    width: 300px;
    height: auto;
    animation: mascot-bounce 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 16px rgba(6,78,59,0.15));
}

@keyframes mascot-bounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-18px) rotate(1.5deg); }
    50% { transform: translateY(-6px) rotate(-1deg); }
    75% { transform: translateY(-20px) rotate(0.5deg); }
}

.hero-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    background: var(--primary-light);
    border: 1px solid #a7f3d0;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.landing-hero h1 {
    font-size: 4rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -1px;
}

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

.landing-subtitle {
    font-size: 1.4rem;
    color: var(--text);
    margin-top: 0.75rem;
    font-weight: 500;
}

.landing-desc {
    max-width: 650px;
    margin: 1.25rem 0 2rem;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.landing-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-langs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.hero-lang-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.7rem;
    border-radius: 50px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.02em;
    transition: all 0.15s;
    box-shadow: 0 1px 3px rgba(6,78,59,0.06);
}

.hero-lang-pill:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(16,185,129,0.15);
}

@media (max-width: 768px) {
    .hero-split { flex-direction: column-reverse; text-align: center; gap: 1.5rem; }
    .hero-mascot { flex: none; }
    .mascot-img { width: 220px; height: auto; }
    .landing-cta { justify-content: center; }
    .landing-desc { margin: 1rem auto 2rem; }
}

.landing-section {
    margin: 4rem 0;
}

.section-title {
    font-size: 2rem;
    color: var(--accent);
    text-align: center;
    margin-bottom: 2.5rem;
}

/* Steps */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.step-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
}

.step-number {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    margin: 0 auto 1rem;
}

.step-card h3 { color: var(--accent); margin-bottom: 0.5rem; font-size: 1rem; }
.step-card p { color: var(--text-muted); font-size: 0.85rem; }

/* Features */
.landing-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.75rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.feature-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.feature-card h3 { color: var(--accent); margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }

/* Social proof */
.social-proof {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    background: linear-gradient(135deg, var(--accent), #2d2d44);
    border-radius: var(--radius);
    padding: 2.5rem;
    color: #fff;
}

.proof-item { text-align: center; }
.proof-number {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}
.proof-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* === PRICING === */
.landing-pricing { text-align: center; margin: 4rem 0; }
.landing-pricing h2 { font-size: 2rem; color: var(--accent); margin-bottom: 2.5rem; }

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 950px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    position: relative;
}

.pricing-featured {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 0.2rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.pricing-card h3 { font-size: 1.3rem; color: var(--accent); margin-bottom: 0.5rem; }
.pricing-price { font-size: 2.5rem; font-weight: 800; color: var(--primary); margin-bottom: 1rem; }
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }

.pricing-card ul {
    list-style: none;
    margin-bottom: 1.5rem;
    text-align: left;
}

.pricing-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text);
}

/* Final CTA */
.landing-final-cta {
    text-align: center;
    padding: 4rem 1rem;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border-radius: var(--radius);
    margin: 3rem 0;
}
.landing-final-cta h2 { font-size: 1.8rem; color: var(--accent); margin-bottom: 0.5rem; }
.landing-final-cta p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 1.05rem; }

/* Footer */
.landing-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* === LESSON === */
.lesson-page { max-width: 100%; }
.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.lesson-title h2 { margin: 0 0 0.4rem; font-size: 1.2rem; }
.lesson-title-input {
    border: none;
    border-bottom: 2px solid var(--border);
    background: transparent;
    font-size: 0.95rem;
    padding: 0.3rem 0;
    width: 100%;
    max-width: 300px;
    transition: border-color 0.2s;
}
.lesson-title-input:focus { border-color: var(--primary); outline: none; }

.lesson-timer-zone { text-align: right; }
.lesson-timer {
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
}
.lesson-timer.paused { opacity: 0.5; }
.lesson-timer-btns { display: flex; gap: 0.5rem; margin-top: 0.4rem; justify-content: flex-end; }
.btn-timer { min-width: 120px; }
.btn-timer.recording { background: var(--wrong); border-color: var(--wrong); }

.lesson-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}
.lesson-col { display: flex; flex-direction: column; gap: 1rem; }
.lesson-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.lesson-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.lesson-card-header h3 { margin: 0; font-size: 1rem; }

/* Quick vocab form */
.quick-vocab-form { margin-bottom: 1rem; }
.quick-vocab-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.quick-vocab-row .input { flex: 1; }
.quick-vocab-extra {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.vocab-count-badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    min-width: 24px;
    text-align: center;
}

/* Translate widget */
.translate-widget {
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 0.75rem;
    margin: 0.75rem 0;
    border: 1px solid var(--border);
}
.translate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.translate-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.translate-dir-btns { display: flex; gap: 0.25rem; }
.translate-dir {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 4px;
    cursor: pointer;
}
.translate-dir.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.translate-result {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 0.75rem;
}
.tr-main { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.3rem; }
.tr-alt { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.tr-grammar { font-size: 0.8rem; color: var(--primary); font-style: italic; margin-bottom: 0.3rem; }
.tr-example { font-size: 0.85rem; color: var(--text); margin-bottom: 0.5rem; }

/* Lesson vocab list */
.lesson-vocab-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 0.75rem;
}
.lesson-vocab-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.lesson-vocab-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}
.lesson-vocab-item:last-child { border-bottom: none; }
.lv-target { font-weight: 600; color: var(--primary); }
.lv-sep { color: var(--text-muted); font-size: 0.75rem; }
.lv-native { color: var(--text); }
.lv-ctx { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; }

/* Lesson notes */
.lesson-notes {
    width: 100%;
    min-height: 180px;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}
.lesson-notes:focus { border-color: var(--primary); outline: none; }

/* Recording */
.rec-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}
.btn-rec {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
}
.btn-rec.recording { background: var(--wrong); border-color: var(--wrong); color: #fff; }
.rec-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--wrong);
}
.rec-dot.pulse { animation: rec-pulse 1s infinite; }
@keyframes rec-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-muted); }
.rec-status { font-size: 0.8rem; color: var(--text-muted); }
.rec-segment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}
.rec-segment:last-child { border-bottom: none; }
.rec-seg-info { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.rec-segment audio { flex: 1; height: 32px; }

/* AI assistant */
.ai-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.switch-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    cursor: pointer;
}
.switch-label input { display: none; }
.switch-slider {
    width: 32px;
    height: 18px;
    background: var(--border);
    border-radius: 9px;
    position: relative;
    transition: background 0.2s;
}
.switch-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.switch-label input:checked + .switch-slider { background: var(--primary); }
.switch-label input:checked + .switch-slider::after { transform: translateX(14px); }

.ai-comment-area { min-height: 60px; }
.ai-hint { color: var(--text-muted); font-size: 0.85rem; font-style: italic; padding: 0.75rem 0; }
.ai-comment {
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border: 1px solid #a7f3d0;
    border-radius: var(--radius);
    padding: 1rem;
}
.ai-comment-time { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.ai-block { font-size: 0.85rem; line-height: 1.5; margin-bottom: 0.4rem; }
.ai-observation { color: var(--text); }
.ai-tip { color: #1d4ed8; }
.ai-pattern { color: #7c3aed; }
.ai-challenge { color: var(--primary); font-weight: 600; }
.ai-connections { color: var(--text-muted); font-size: 0.8rem; }
.ai-countdown { font-size: 0.75rem; color: var(--text-muted); text-align: center; margin-top: 0.5rem; }

/* Mini chat */
.mini-chat {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.mini-chat-messages {
    max-height: 250px;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.mini-chat-hint { color: var(--text-muted); font-size: 0.85rem; font-style: italic; text-align: center; padding: 1rem; }
.mini-msg {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    line-height: 1.4;
    max-width: 85%;
}
.mini-msg.user { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.mini-msg.assistant { background: #f1f5f9; color: var(--text); align-self: flex-start; border-bottom-left-radius: 4px; }
.mini-msg.error { background: #fef2f2; color: var(--wrong); }
.typing { animation: typing-dots 1s infinite; }
@keyframes typing-dots { 0% { opacity: 0.3; } 50% { opacity: 1; } 100% { opacity: 0.3; } }
.mini-chat-input {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.mini-chat-input .input { flex: 1; min-height: 36px; }

/* Lesson summary bar */
.lesson-summary-bar {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-w, 240px);
    right: 0;
    background: var(--surface);
    border-top: 2px solid var(--primary);
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 50;
}

/* Conjugation quick verbs */
.conj-quick-verbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.quick-verb-list { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.quick-verb-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.quick-verb-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Conjugation tables */
.conj-header { margin-bottom: 1rem; }
.conj-header h2 { color: var(--primary); margin: 0; }
.conj-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.conj-section { background: #f8fafc; padding: 0.75rem; border-radius: var(--radius); }
.conj-section h3 { font-size: 0.9rem; color: var(--primary); margin: 0 0 0.5rem; }

/* === CONTENT === */
.content-source-tabs {
    display: flex;
    gap: 0.5rem;
}
.source-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.content-list { display: flex; flex-direction: column; gap: 0.75rem; }

.content-item {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: box-shadow 0.15s;
}
.content-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.content-item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.content-item-title {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
}
.content-item-title:hover { color: var(--primary); }

.content-item-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.content-item-summary {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.content-type-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}
.content-type-article { background: #10b981; }
.content-type-youtube { background: #ef4444; }
.content-type-text { background: #8b5cf6; }
.content-type-podcast { background: #f59e0b; }
.content-type-rss { background: #f97316; }

/* === FEEDBACK WIDGET === */
.feedback-widget {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 500;
}

.feedback-fab {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}
.feedback-fab:hover { transform: scale(1.1); box-shadow: 0 4px 16px rgba(0,0,0,0.25); }

.feedback-panel {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 320px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    padding: 1rem;
    border: 1px solid var(--border);
}

.feedback-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.feedback-types {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.fb-type-btn {
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}
.fb-type-btn:hover { background: #f3f4f6; }
.fb-type-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Feedback admin */
.fb-type {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}
.fb-type-bug { background: #ef4444; }
.fb-type-idea { background: #f59e0b; }
.fb-type-improvement { background: #10b981; }
.fb-type-feedback { background: #6b7280; }

/* === SWITCH TOGGLE === */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: 0.3s;
}
.switch-slider:before {
    content: '';
    position: absolute;
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider:before { transform: translateX(20px); }

/* === ANIMATIONS === */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* === ONBOARDING === */
.onboarding-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.onboarding-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.step-dot {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s;
}
.step-dot.active { background: var(--primary); color: #fff; }

.step-line {
    width: 60px;
    height: 3px;
    background: var(--border);
}

.onboarding-step { display: none; }
.onboarding-step.active { display: block; animation: fadeIn 0.3s ease; }

.onboarding-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}
.onboarding-card h1 { font-size: 1.8rem; color: var(--accent); margin-bottom: 0.5rem; }
.onboarding-card h2 { font-size: 1.5rem; color: var(--accent); }

.onboarding-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.level-card {
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.level-card:hover { border-color: var(--primary); }
.level-card.selected { border-color: var(--primary); background: #ecfdf5; }

.level-code { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.level-name { font-weight: 600; margin-top: 0.25rem; }
.level-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

.objectives-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.objective-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.objective-card:hover { border-color: var(--primary); }
.objective-card.selected { border-color: var(--primary); background: #ecfdf5; }
.obj-icon { font-size: 1.8rem; margin-bottom: 0.3rem; }
.objective-card small { font-size: 0.8rem; color: var(--text-muted); }

.goal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.goal-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.goal-card:hover { border-color: var(--primary); }
.goal-card.selected { border-color: var(--primary); background: #ecfdf5; }
.goal-icon { font-size: 1.5rem; }
.goal-card small { font-size: 0.75rem; color: var(--text-muted); }

.recap-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.recap-item { text-align: center; padding: 1rem; background: #f9fafb; border-radius: var(--radius); }
.recap-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; }
.recap-value { font-size: 1.3rem; font-weight: 700; color: var(--primary); margin-top: 0.25rem; }

/* === GAMIFICATION BAR === */
.gam-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Language switcher */
.lang-switcher {
    display: flex;
    gap: 0.35rem;
    padding-right: 1rem;
    border-right: 1px solid var(--border);
    margin-right: 0.5rem;
}
.lang-switch-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    border-radius: 50px;
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.15s;
    white-space: nowrap;
}
.lang-switch-btn:hover { background: var(--bg); border-color: var(--border); color: var(--text); }
.lang-switch-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}
.lang-switch-active:hover { background: var(--primary-hover); }
.lang-switch-name { display: inline; }
@media (max-width: 640px) { .lang-switch-name { display: none; } .lang-switcher { border-right: none; margin-right: 0; padding-right: 0; } }

.gam-level {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.gam-level-badge {
    background: var(--primary);
    color: #fff;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

.gam-xp-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    min-width: 80px;
}
.gam-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #8b5cf6);
    border-radius: 4px;
    transition: width 0.5s ease;
}
.gam-xp-text { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }

.gam-streak {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.gam-streak-fire {
    font-size: 1.3rem;
    font-weight: 800;
    color: #f59e0b;
}
.gam-streak-label { font-size: 0.8rem; color: var(--text-muted); }

.gam-cecr {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.gam-cecr-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
    background: #f3f4f6;
    color: var(--text);
}
.gam-cecr-target { background: var(--primary); color: #fff; }
.gam-cecr-arrow { color: var(--text-muted); }

/* Daily goal bar */
.gam-daily-goal {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}
.gam-goal-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    min-width: 60px;
}
.gam-goal-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 4px;
    transition: width 0.5s ease;
}
.gam-goal-fill.gam-goal-met {
    background: linear-gradient(90deg, #10b981, #047857);
}
.gam-goal-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Zen mode bar */
.gam-bar-zen {
    background: var(--surface);
    border: 1px solid var(--border);
}
.gam-zen-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    flex-wrap: wrap;
}
.gam-zen-item {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 500;
}
.gam-zen-sep {
    color: var(--border);
    font-size: 0.8rem;
}

/* === ACHIEVEMENTS === */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.achievement-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border-radius: var(--radius);
    text-align: center;
    transition: all 0.2s;
}
.achievement-item.unlocked { background: #f0fdf4; border: 1px solid #86efac; }
.achievement-item.locked { background: #f9fafb; border: 1px solid var(--border); opacity: 0.5; filter: grayscale(1); }
.achievement-icon { font-size: 1.8rem; }
.achievement-name { font-size: 0.8rem; font-weight: 600; margin-top: 0.25rem; }
.achievement-xp { font-size: 0.7rem; color: var(--primary); }

/* === MODALS === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

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

/* === PLACEMENT === */
.placement-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}
.placement-progress .progress-bar { flex: 1; }

.placement-question { padding: 0 1rem 1rem; }

.placement-option {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    text-align: left;
    cursor: pointer;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    transition: all 0.15s;
}
.placement-option:hover { border-color: var(--primary); background: #ecfdf5; }

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

/* === SUGGESTIONS === */
.suggestions-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.suggestion-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}
.suggestion-card:hover { transform: translateX(3px); }

.suggestion-primary { border-left: 4px solid var(--primary); }
.suggestion-accent { border-left: 4px solid var(--accent); }
.suggestion-warning { border-left: 4px solid #f59e0b; }

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

.suggestion-body { flex: 1; min-width: 0; }
.suggestion-body strong { display: block; margin-bottom: 0.15rem; }
.suggestion-body p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

.suggestion-card .btn { flex-shrink: 0; white-space: nowrap; }

.stat-highlight {
    border: 2px solid var(--primary);
    background: #ecfdf5;
}

/* gam-streak-warn removed: non-punitive design */

/* === QUIZ HERO (gaming section) === */
.quiz-hero {
    background: linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%);
    border: 2px solid var(--primary);
    position: relative;
    overflow: hidden;
}
.quiz-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: var(--primary);
    opacity: 0.04;
    border-radius: 50%;
}
.quiz-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.quiz-hero-header h2 { margin: 0; font-size: 1.3rem; }
.quiz-hero-sub { margin: 0.25rem 0 0; font-size: 0.85rem; }
.quiz-hero-score {
    display: flex;
    align-items: baseline;
    gap: 2px;
    background: var(--primary);
    color: #fff;
    border-radius: 50px;
    padding: 0.4rem 1rem;
}
.quiz-score-num { font-size: 1.4rem; font-weight: 700; }
.quiz-score-den { font-size: 0.85rem; opacity: 0.8; }

/* Quiz start screen */
.quiz-start-screen { text-align: center; padding: 1.5rem 0; }
.quiz-start-icons { font-size: 2.5rem; margin-bottom: 0.75rem; letter-spacing: 0.5rem; }
.quiz-start-screen p { margin-bottom: 1.25rem; font-size: 1rem; }
.quiz-start-btn { font-size: 1.1rem; padding: 0.75rem 2.5rem; }

/* Quiz progress bar */
.quiz-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}
.quiz-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.quiz-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.quiz-progress-text { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; min-width: 2.5rem; text-align: right; }

/* Quiz question */
.quiz-question { padding: 0.5rem 0; }
.quiz-q-text { font-size: 1.1rem; font-weight: 600; margin-bottom: 1.25rem; line-height: 1.4; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
@media (max-width: 480px) { .quiz-options { grid-template-columns: 1fr; } }

.quiz-option {
    padding: 0.85rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    font-size: 0.95rem;
    text-align: left;
    transition: all 0.15s;
}
.quiz-option:hover:not(:disabled) { border-color: var(--primary); background: rgba(59,130,246,0.04); }
.quiz-option-correct { border-color: var(--correct) !important; background: rgba(16,185,129,0.08) !important; color: var(--correct); font-weight: 600; }
.quiz-option-wrong { border-color: var(--wrong) !important; background: rgba(239,68,68,0.08) !important; color: var(--wrong); }
.quiz-option-disabled { cursor: default; opacity: 0.7; }
.quiz-option-correct.quiz-option-disabled { opacity: 1; }

/* Quiz feedback */
.quiz-feedback { padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 0.9rem; line-height: 1.5; }
.quiz-fb-correct { background: rgba(16,185,129,0.1); border-left: 3px solid var(--correct); }
.quiz-fb-wrong { background: rgba(239,68,68,0.1); border-left: 3px solid var(--wrong); }

/* Quiz result */
.quiz-result { text-align: center; padding: 2rem 0; }
.quiz-result-emoji { font-size: 3rem; margin-bottom: 0.5rem; }
.quiz-result-score { font-size: 2rem; font-weight: 700; color: var(--primary); }
.quiz-result-msg { font-size: 1.1rem; color: var(--text-muted); margin: 0.5rem 0 1.5rem; }
.quiz-result-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* === DAILY CONTENT — TILES === */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.section-header h3 { margin: 0; }

.daily-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}
@media (max-width: 640px) { .daily-tiles { grid-template-columns: 1fr; } }

.daily-tile {
    padding: 1.25rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
    min-height: 140px;
    justify-content: center;
}
.daily-tile:hover:not(.daily-tile-empty):not(.daily-tile-placeholder) {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: var(--primary);
}
.daily-tile-placeholder {
    cursor: default;
    opacity: 0.6;
}
.daily-tile-empty {
    cursor: default;
    opacity: 0.4;
}

.daily-tile-icon { font-size: 2rem; }
.daily-tile-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
}
.daily-tile-title {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text);
    margin-top: 0.25rem;
}
.daily-tile-source {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.daily-tile-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: auto;
}
.daily-tile-meta span:first-child {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.73rem;
}

/* Loading dot animation */
.daily-loading-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: pulse-dot 1s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.5); }
}

/* === PACKS DE VOCABULAIRE === */
.packs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.6rem;
}
.pack-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    background: var(--surface);
}
.pack-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.pack-icon { font-size: 1.5rem; }
.pack-info { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; }
.pack-info strong { font-size: 0.9rem; }
.pack-info span { font-size: 0.75rem; }
.pack-action {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(59,130,246,0.08);
}
.pack-imported { border-color: var(--correct); opacity: 0.7; cursor: default; pointer-events: none; }
.pack-imported .pack-action { background: rgba(16,185,129,0.15); color: var(--correct); }

/* === MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(2px);
}
.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-content-large {
    max-width: 750px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 1.1rem; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}
.modal-close:hover { color: var(--text); }

/* Modal content types */
.modal-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
}
.modal-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.modal-article-text {
    padding: 1.25rem;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text);
    max-height: 50vh;
    overflow-y: auto;
    white-space: pre-line;
}
.modal-podcast-desc {
    padding: 1.25rem 1.25rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
}
.modal-audio {
    width: calc(100% - 2.5rem);
    margin: 1rem 1.25rem;
    border-radius: 24px;
}
.modal-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

/* === TOAST === */
.toast-msg {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: var(--surface);
    padding: 0.65rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}
.toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* === UTILITIES === */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* === ANIMATIONS === */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* === MOBILE TOP BAR === */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 52px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 150;
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.mobile-topbar-logo img {
    height: 22px;
    filter: brightness(0) saturate(100%);
}
.mobile-topbar-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
}
.mobile-topbar-streak {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    color: #f59e0b;
}
.mobile-topbar-xp {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    color: var(--primary);
}
.mobile-topbar-hamburger {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.4rem;
    color: var(--text);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === BOTTOM NAVIGATION (mobile) === */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 150;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 60px;
    max-width: 500px;
    margin: 0 auto;
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.3rem 0;
    min-width: 52px;
    min-height: 44px;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item .bnav-icon {
    font-size: 1.35rem;
    line-height: 1;
}
.bottom-nav-item.active {
    color: var(--primary);
    font-weight: 700;
}

/* === RESPONSIVE — TABLET (768px - 1024px) === */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Sidebar: icons only */
    .sidebar { width: 64px; }
    .nav-text { display: none; }
    .sidebar-header h2 { font-size: 0; overflow: hidden; height: 0; margin: 0; }
    .sidebar-header { padding: 1rem 0.5rem 0.5rem; }
    .sidebar-lang span:last-child { display: none; }
    .sidebar-lang { justify-content: center; }
    .lang-switcher { display: none; }
    .sidebar-locale { padding: 0.5rem 0.25rem !important; }
    .nav-links li a { padding: 0.7rem; justify-content: center; }
    .nav-icon { width: auto; font-size: 1.25rem; }
    .main-content { margin-left: 64px; padding: 1.5rem; }

    /* Grids: 2 columns */
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .landing-features { grid-template-columns: repeat(2, 1fr); }
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
    .social-proof { grid-template-columns: repeat(2, 1fr); }
    .pricing-grid { grid-template-columns: 1fr 1fr; max-width: 700px; }
    .pricing-featured { transform: none; }
    .daily-tiles { grid-template-columns: repeat(2, 1fr); }
    .lesson-grid { grid-template-columns: 1fr 1fr; }
    .level-grid { grid-template-columns: repeat(3, 1fr); }
    .achievements-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }

    /* Lesson summary bar follows sidebar */
    .lesson-summary-bar { left: 64px; }

    /* Touch-friendly buttons */
    .btn { min-height: 44px; }
    .quiz-option { padding: 0.85rem 1rem; min-height: 44px; }
    .ex-option { padding: 0.85rem; min-height: 44px; }
}

/* === RESPONSIVE — MOBILE (< 768px) === */
@media (max-width: 768px) {
    /* Show mobile topbar and bottom nav */
    .mobile-topbar { display: flex; }
    .bottom-nav { display: block; }

    /* Hide desktop hamburger (we use topbar hamburger) */
    .hamburger { display: none; }

    /* Sidebar: slide-in drawer (opened via hamburger in topbar) */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        transition: transform 0.3s ease;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar.open ~ .sidebar-overlay { display: block; }
    .nav-text { display: inline; }
    .sidebar-header h2 { font-size: 1.4rem; }
    .sidebar-lang span:last-child { display: inline; }
    .lang-switcher { display: flex; }

    /* Main content: no sidebar margin, space for topbar + bottom nav */
    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: calc(52px + 1rem);
        padding-bottom: calc(60px + 1.5rem + env(safe-area-inset-bottom, 0px));
    }

    /* Typography: smaller headings, ensure readable body */
    body { font-size: 16px; }
    .page-header h1 { font-size: 1.3rem; }
    .section-title { font-size: 1.5rem; margin-bottom: 1.5rem; }
    .onboarding-card h1 { font-size: 1.4rem; }
    .onboarding-card h2 { font-size: 1.2rem; }

    /* Cards: less padding */
    .card { padding: 1rem; margin-bottom: 1rem; }
    .stat-card { padding: 0.85rem 0.5rem; }
    .stat-number { font-size: 1.5rem; }
    .stat-label { font-size: 0.78rem; }

    /* Grids: single column */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .grid-2 { grid-template-columns: 1fr; }
    .daily-tiles { grid-template-columns: 1fr; }
    .lesson-grid { grid-template-columns: 1fr; }
    .conj-tables { grid-template-columns: 1fr; }
    .packs-grid { grid-template-columns: 1fr; }
    .recap-grid { grid-template-columns: 1fr; }

    /* Flashcards */
    .flashcard { height: 220px; max-width: 100%; }
    .fc-word { font-size: 1.5rem; }
    .fc-front, .fc-back { padding: 1.25rem; }
    .flashcard-filters { flex-wrap: wrap; gap: 0.5rem; }
    .fc-controls { flex-wrap: wrap; }
    .fc-controls .btn { flex: 1; min-width: 80px; }

    /* Exercises: touch-friendly */
    .ex-options { grid-template-columns: 1fr; }
    .ex-option { padding: 0.85rem 1rem; min-height: 48px; font-size: 1rem; }
    .ex-card { padding: 1rem; }
    .ex-question { font-size: 1.05rem; padding-right: 3.5rem; }
    .ex-input-area { flex-direction: column; }
    .ex-input-area .btn { width: 100%; }

    /* Quiz: touch-friendly targets */
    .quiz-options { grid-template-columns: 1fr; gap: 0.5rem; }
    .quiz-option { padding: 0.9rem 1rem; min-height: 48px; font-size: 1rem; }
    .quiz-q-text { font-size: 1rem; }
    .quiz-start-btn { width: 100%; padding: 0.85rem 1.5rem; }
    .quiz-hero-header { flex-direction: column; gap: 0.5rem; }
    .quiz-hero-header h2 { font-size: 1.15rem; }
    .quiz-result-actions { flex-direction: column; }
    .quiz-result-actions .btn { width: 100%; }

    /* Buttons: touch-friendly sizing */
    .btn { min-height: 44px; padding: 0.55rem 1rem; font-size: 0.9rem; }
    .btn-small { min-height: 38px; padding: 0.35rem 0.7rem; }
    .btn-large { min-height: 48px; padding: 0.75rem 1.25rem; }
    .quick-actions { gap: 0.5rem; }
    .quick-actions .btn { flex: 1; min-width: 0; }

    /* Forms: touch-friendly */
    .input { min-height: 44px; font-size: 16px; }
    .form-row { flex-direction: column; }
    .form-inline { flex-direction: column; align-items: stretch; }

    /* Gamification bar */
    .gam-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    .gam-level { min-width: auto; }
    .lang-switcher { border-right: none; margin-right: 0; padding-right: 0; }

    /* Landing page */
    .landing { padding: 1rem; }
    .landing-hero { padding: 2rem 0.5rem 1.5rem; }
    .landing-hero h1 { font-size: 2.2rem; letter-spacing: -0.5px; }
    .landing-subtitle { font-size: 1.1rem; }
    .landing-desc { font-size: 0.95rem; }
    .hero-split { flex-direction: column-reverse; text-align: center; gap: 1.5rem; }
    .hero-mascot { flex: none; }
    .mascot-img { width: 200px; height: auto; }
    .landing-cta { justify-content: center; }
    .landing-cta .btn { width: 100%; }
    .landing-desc { margin: 1rem auto 1.5rem; }
    .hero-langs { gap: 0.35rem; }
    .hero-lang-pill { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
    .landing-features { grid-template-columns: 1fr; }
    .steps-grid { grid-template-columns: 1fr; }
    .social-proof { grid-template-columns: repeat(2, 1fr); padding: 1.25rem; gap: 1rem; }
    .proof-number { font-size: 1.5rem; }
    .pricing-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
    .pricing-featured { transform: none; }
    .pricing-card { padding: 1.5rem 1rem; }
    .landing-section { margin: 2.5rem 0; }
    .landing-final-cta { padding: 2.5rem 1rem; margin: 2rem 0; }
    .landing-final-cta h2 { font-size: 1.4rem; }
    .feature-card { padding: 1.25rem; }
    .feature-card:hover { transform: none; }
    .feature-icon { font-size: 2rem; }

    /* Suggestions */
    .suggestion-card { flex-direction: column; text-align: center; gap: 0.75rem; }
    .suggestion-card .btn { width: 100%; }
    .suggestion-icon { font-size: 1.5rem; }

    /* Chat */
    .chat-messages { min-height: 300px; max-height: 60vh; padding: 1rem; }
    .msg-bubble { max-width: 85%; font-size: 0.9rem; }
    .chat-input { padding: 0.75rem; }
    .chat-suggestions { padding: 0.5rem 0.75rem; }

    /* Onboarding */
    .onboarding-container { padding: 1rem 0.5rem; }
    .onboarding-card { padding: 1.25rem; }
    .level-grid { grid-template-columns: repeat(2, 1fr); }
    .objectives-grid { grid-template-columns: 1fr; }
    .goal-grid { grid-template-columns: repeat(2, 1fr); }
    .step-line { width: 30px; }

    /* Achievements */
    .achievements-grid { grid-template-columns: repeat(3, 1fr); }

    /* Content */
    .content-source-tabs { flex-wrap: wrap; }
    .content-item-header { flex-wrap: wrap; }
    .content-item-meta { flex-wrap: wrap; gap: 0.5rem; }

    /* Tables: horizontal scroll */
    .table { font-size: 0.82rem; }
    .table th, .table td { padding: 0.4rem 0.5rem; }

    /* Toolbar */
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-actions { justify-content: stretch; }
    .toolbar-actions .btn { flex: 1; }
    .filters-form { flex-wrap: wrap; }

    /* Lesson */
    .lesson-header { flex-direction: column; align-items: stretch; padding: 0.75rem; }
    .lesson-timer-zone { text-align: center; }
    .lesson-timer { font-size: 1.6rem; }
    .lesson-timer-btns { justify-content: center; }
    .btn-timer { min-width: 100px; }
    .lesson-summary-bar { left: 0; padding: 0.5rem 0.75rem; }
    .lesson-summary-bar { bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }

    /* Feedback widget: above bottom nav */
    .feedback-widget { bottom: calc(60px + 1rem + env(safe-area-inset-bottom, 0px)); right: 1rem; }
    .feedback-panel { width: 280px; right: -0.5rem; }
    .feedback-fab { width: 44px; height: 44px; }

    /* Toast: above bottom nav */
    .toast-msg { bottom: calc(60px + 1.5rem + env(safe-area-inset-bottom, 0px)); }

    /* Auth page */
    .auth-page { padding: 1rem; }
    .auth-card { padding: 1.5rem; }

    /* Modals */
    .modal-content { max-width: 100%; border-radius: var(--radius) var(--radius) 0 0; }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal-content-large { max-width: 100%; }

    /* Remove hover effects on touch */
    .feature-card:hover,
    .daily-tile:hover:not(.daily-tile-empty):not(.daily-tile-placeholder),
    .suggestion-card:hover,
    .pack-card:hover { transform: none; }

    /* Quick vocab */
    .quick-vocab-row { flex-direction: column; }
}

/* === RESPONSIVE — SMALL MOBILE (< 480px) === */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .stat-card { padding: 0.65rem 0.4rem; }
    .stat-number { font-size: 1.3rem; }

    .landing-hero h1 { font-size: 1.8rem; }
    .landing-subtitle { font-size: 1rem; }
    .section-title { font-size: 1.3rem; }

    .flashcard { height: 200px; }
    .fc-word { font-size: 1.3rem; }
    .fc-front, .fc-back { padding: 1rem; }

    .level-grid { grid-template-columns: 1fr 1fr; }
    .goal-grid { grid-template-columns: 1fr 1fr; }
    .achievements-grid { grid-template-columns: repeat(2, 1fr); }

    .gam-bar { gap: 0.5rem; padding: 0.5rem; }
    .gam-level-badge { font-size: 0.78rem; }

    .social-proof { grid-template-columns: 1fr 1fr; padding: 1rem; }

    .chat-messages { min-height: 250px; }
    .msg-bubble { max-width: 90%; }

    .onboarding-card { padding: 1rem; }
    .step-dot { width: 30px; height: 30px; font-size: 0.75rem; }
    .step-line { width: 20px; }

    .daily-tile { min-height: 100px; padding: 1rem 0.75rem; }

    /* Ensure no text smaller than 14px for readability */
    .stat-label, .daily-tile-meta, .fc-hint, .fc-interval { font-size: 0.78rem; }
}

/* === LANDSCAPE PHONE ADJUSTMENTS === */
@media (max-width: 768px) and (orientation: landscape) {
    .bottom-nav { height: 48px; }
    .bottom-nav-inner { height: 48px; }
    .bottom-nav-item { font-size: 0; gap: 0; }
    .bottom-nav-item .bnav-icon { font-size: 1.2rem; }
    .main-content { padding-bottom: calc(48px + 1rem); }
    .flashcard { height: 180px; }
    .chat-messages { min-height: 200px; max-height: 40vh; }
}

/* === TOUCH DEVICE ENHANCEMENTS === */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover-dependent visual effects */
    .feature-card:hover { transform: none; box-shadow: var(--shadow); }
    .nav-links li a:hover { background: transparent; }
    .nav-links li a:active { background: rgba(255,255,255,0.12); }
    .btn:hover { filter: none; }
    .btn:active { transform: scale(0.97); }
    .quiz-option:hover:not(:disabled) { border-color: var(--border); background: var(--surface); }
    .quiz-option:active:not(:disabled) { border-color: var(--primary); background: rgba(59,130,246,0.04); }
    .ex-option:hover { background: var(--surface); border-color: var(--border); }
    .ex-option:active { background: #f3f4f6; border-color: var(--primary); }
    .daily-tile:hover:not(.daily-tile-empty):not(.daily-tile-placeholder) { transform: none; box-shadow: var(--shadow); }
    .daily-tile:active:not(.daily-tile-empty):not(.daily-tile-placeholder) { background: var(--bg); }

    /* Ensure all interactive elements are at least 44x44 */
    .category-tag { min-height: 36px; padding: 0.4rem 0.85rem; }
    .fb-type-btn { min-height: 38px; padding: 0.4rem 0.7rem; }
    .source-tab { min-height: 44px; }
    .translate-dir { min-height: 36px; padding: 0.3rem 0.6rem; }
    .placement-option { min-height: 48px; padding: 0.85rem 1rem; }
    .quick-verb-btn { min-height: 36px; padding: 0.4rem 0.7rem; }
    .lang-chip { min-height: 32px; padding: 0.3rem 0.6rem; }
}
