:root {
    /* Thème Clair par défaut */
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

html {
    scrollbar-gutter: stable;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    /* Eliminate 300ms tap delay on all interactive elements */
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh; /* fallback */
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    /* Smooth momentum scrolling on iOS */
    -webkit-overflow-scrolling: touch;
    /* Prevent pull-to-refresh rubber-band interfering with drag */
    overscroll-behavior-y: none;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    cursor: pointer;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    transition: transform 0.2s ease;
}

.logo:hover .logo-wrapper {
    transform: translateY(-1px);
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: 0.04em; /* Espacement aéré des lettres */
    display: inline-flex;
    align-items: baseline;
    line-height: 1.1;
}

/* Thème Sombre : 'drill' en Blanc et 'Flow.' en Cyan/Bleu lumineux */
[data-theme="dark"] .logo-text .logo-white {
    color: #ffffff;
}
[data-theme="dark"] .logo-text .logo-blue {
    color: #38bdf8;
    text-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
}

/* Thème Clair : 'drill' en Slate sombre et 'Flow.' en Bleu */
[data-theme="light"] .logo-text .logo-white,
:root:not([data-theme="dark"]) .logo-text .logo-white {
    color: #0f172a;
}
[data-theme="light"] .logo-text .logo-blue,
:root:not([data-theme="dark"]) .logo-text .logo-blue {
    color: #0284c7;
}

/* Tagline / Citation */
.logo-tagline {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.tagline-faster {
    color: #38bdf8;
    font-weight: 800;
}

.nav-menu {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-btn:hover {
    color: var(--text-primary);
    background-color: rgba(100, 116, 139, 0.1);
}

.nav-btn.active {
    color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.1);
}

#nav-stats {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

/* Mascotte Girafe d'incitation Progression dans le menu */
.nav-giraffe-mascot {
    width: 26px;
    height: 26px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
    animation: giraffeMenuBounce 1.8s ease-in-out infinite;
    flex-shrink: 0;
    margin-right: 0.15rem;
    pointer-events: none;
    vertical-align: middle;
}

@keyframes giraffeMenuBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-3px) scale(1.08);
    }
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    color: var(--text-primary);
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: rgba(100, 116, 139, 0.1);
}

/* Auth button & status indicator */
#auth-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-status-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid var(--surface-color);
    box-sizing: content-box;
    pointer-events: none;
}

.auth-status-dot.auth-status-guest {
    background-color: #f59e0b;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    animation: auth-guest-pulse 2.5s infinite ease-in-out;
}

.auth-status-dot.auth-status-connected {
    background-color: #10b981;
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.6);
}

@keyframes auth-guest-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0);
    }
}

#auth-btn.auth-guest-wobble {
    animation: auth-wobble 0.8s ease-in-out;
}

@keyframes auth-wobble {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-14deg) scale(1.08); }
    40% { transform: rotate(12deg) scale(1.08); }
    60% { transform: rotate(-8deg); }
    80% { transform: rotate(4deg); }
}

/* Main Container */
#app-container {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 2rem;
}

#app-container.in-drill-mode {
    padding: 1rem 1.5rem;
}

.view-content {
    width: 100%;
    max-width: 680px;
}

.view-wide {
    max-width: 1000px; /* Plus d'espace pour les tableaux */
}

/* Typography */
.page-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.page-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

/* Cards & Forms */
.card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

select, input[type="text"], textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
    padding-right: 3rem;
}

select:focus, input[type="text"]:not(.input-section input):not(.rewrite-field):focus {
    border-color: var(--primary-color);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Drill Section */
.drill-container {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 880px; /* Plus d'espace sur PC pour les expressions longues et la correction */
    box-sizing: border-box;
}
.drill-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 1rem; 
    flex-shrink: 0;
}
.lang-pair { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.lang-badge { background: var(--primary-color); color: white; padding: 0.25rem 0.75rem; border-radius: 4px; font-size: 0.9rem; }
.drill-progress {
    display: flex;
    align-items: center;
}

.drill-gauge-container {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    user-select: none;
}

.drill-gauge-track {
    position: relative;
    width: 140px;
    height: 12px;
    background: var(--border-color);
    border-radius: 9999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .drill-gauge-track {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.drill-gauge-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #34d399, #10b981);
    border-radius: 9999px;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.drill-gauge-ticks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.drill-gauge-tick {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1.5px;
    background: var(--surface-color);
    opacity: 0.75;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 2;
}

[data-theme="dark"] .drill-gauge-tick {
    background: var(--surface-color);
    opacity: 0.85;
}

.drill-gauge-counter {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 1.6rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

@media (max-width: 380px) {
    .drill-gauge-track {
        width: 105px;
    }
}

.flashcard {
    text-align: center;
    padding: 1rem;
    margin-bottom: 0;
    border: none;
    border-radius: 12px;
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}
.drill-dynamic-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 220px;
    margin: auto;
    transform: translateY(-5vh);
    box-sizing: border-box;
}
.drill-word-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    max-width: 100%;
}
.drill-word-badges {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
    vertical-align: middle;
    flex-shrink: 0;
    white-space: nowrap;
}
.drill-word-badges .type-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    padding: 0.15rem 0.55rem !important;
    border-radius: 20px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    font-family: var(--font-sans) !important;
    line-height: 1.2 !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}
.word-source {
    font-size: 2.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: 0;
    text-align: center;
    max-width: 100%;
}
.word-source-chunk {
    display: inline;
}
.word-source-note {
    font-size: 0.62em;
    font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
    opacity: 0.75;
    font-weight: 500;
    letter-spacing: normal;
    margin-left: 0.35rem;
}
.input-section {
    display: flex;
    align-items: baseline;
    justify-content: center;
    position: relative;
    width: 260px;
    margin-left: auto;
    margin-right: auto;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.35rem;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    cursor: text;
}
.input-section:focus-within {
    border-bottom-color: var(--primary-color) !important;
}
.input-prefix {
    font-size: 1.5rem;
    font-family: var(--font-sans);
    color: var(--text-secondary);
    opacity: 0.55;
    font-weight: 500;
    user-select: none;
    pointer-events: none;
    white-space: pre;
    padding: 0;
    margin: 0;
    line-height: 1.2;
    flex-shrink: 0;
}
.input-section.has-prefix {
    justify-content: flex-start;
}
.input-section.has-prefix .input-prefix {
    display: inline-block !important;
}
.input-section input {
    font-size: 1.5rem;
    font-family: var(--font-sans);
    text-align: left;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    color: var(--text-primary);
    width: 100%;
    line-height: 1.2;
}
.input-section.has-prefix input {
    text-align: left;
    flex: 1;
    width: auto;
}
.input-section input:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}
.hidden { display: none !important; }

.result-section { 
    margin-top: 2rem; 
    animation: slideUp 0.3s ease; 
    width: 100%; 
    max-width: 760px; 
    box-sizing: border-box; 
}
.result-comparison { 
    position: relative;
    display: flex; 
    flex-direction: column; 
    gap: 0.6rem; 
    margin-bottom: 1.25rem; 
    padding: 1.25rem 1.5rem 1.35rem 1.5rem; 
    background: rgba(0,0,0,0.03); 
    border-radius: 8px; 
    text-align: left;
}

.comparison-line { 
    display: flex; 
    align-items: baseline; 
    font-size: 1.5rem; 
    text-align: left;
}
.comparison-label { 
    width: 105px; 
    min-width: 105px; 
    flex-shrink: 0; 
    text-align: right; 
    margin-right: 1.1rem; 
    font-size: 1rem; 
    color: var(--text-secondary); 
    white-space: nowrap; 
    box-sizing: border-box; 
    line-height: 1.2;
}
.comparison-text { 
    font-family: monospace; 
    font-size: 1.75rem; 
    font-weight: 600; 
    text-align: left; 
    line-height: 1.2; 
    padding: 0; 
    margin: 0; 
}
.user-saisie { color: var(--error-color); }
.expected-saisie { color: var(--success-color); }

.comparison-content-wrapper {
    display: block;
    flex: 1;
    min-width: 0;
    line-height: 1.35;
    text-align: left !important;
}

.result-comparison .drill-word-badges {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    vertical-align: middle;
    margin-left: 0.5rem;
    white-space: nowrap;
    position: relative;
    top: -2px;
}


.result-comparison .speak-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-left: 0.45rem;
    padding: 0.25rem;
    flex-shrink: 0;
}

#result-asked .word-source-chunk {
    display: inline;
}

#result-asked .word-source-chunk.has-break {
    display: inline;
}

#result-asked .word-source-chunk.word-source-note {
    display: inline;
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 0.65em;
    font-weight: 500;
    color: var(--text-secondary);
    opacity: 0.85;
    letter-spacing: normal;
    margin-left: 0.35rem;
}

#rewrite-wrapper:focus-within {
    border-bottom-color: var(--primary-color) !important;
}

.speak-btn {
    color: #ffffff;
    transition: transform 0.2s, background-color 0.2s, color 0.2s;
    border-radius: 50%;
}
[data-theme="light"] .speak-btn {
    color: var(--text-secondary);
}
.speak-btn:hover {
    transform: scale(1.1);
    background-color: rgba(59, 130, 246, 0.1) !important;
}
.speak-btn:active {
    transform: scale(0.95);
}

input[type="text"].rewrite-field {
    border: none !important;
    background: transparent;
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
    outline: none !important;
    box-shadow: none !important;
    font-family: monospace !important;
    font-size: 1.75rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    color: var(--text-primary);
    appearance: none;
    -webkit-appearance: none;
}

#rewrite-mirror {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    font-family: monospace !important;
    font-size: 1.75rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: pre;
    display: flex;
    align-items: baseline;
    overflow: hidden;
}

[data-theme="light"] input[type="text"].rewrite-field {
    color: #000000;
}

input[type="text"].rewrite-field::placeholder {
    color: var(--text-secondary);
    opacity: 0.4;
}

.end-session-card {
    text-align: center;
    padding: 2.2rem 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}
.congrats-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--success-color);
    margin: 0;
}
.context-promo-box {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    max-width: 780px;
    text-align: left;
    box-sizing: border-box;
}

/* Grille des 3 jeux de consolidation sur l'écran de fin de drill */
.drill-consolidation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    width: 100%;
}

.consolidation-card {
    background: var(--surface-color);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    padding: 1.1rem 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    color: inherit;
}

.consolidation-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.04);
}

.consolidation-card:active {
    transform: translateY(0);
}

.consolidation-card-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.consolidation-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.consolidation-icon.icon-context {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.consolidation-icon.icon-sentence {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.consolidation-icon.icon-voice {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.consolidation-card-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    min-width: 0;
}

.consolidation-card-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
    line-height: 1.25;
}

.consolidation-badge-car {
    background: rgba(6, 182, 212, 0.18);
    color: #06b6d4;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid rgba(6, 182, 212, 0.3);
    white-space: nowrap;
}

.consolidation-card-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.35;
    margin: 0;
}

@media (max-width: 768px) {
    .drill-consolidation-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

input[type="text"].rewrite-field:focus {
    border: none;
    outline: none;
    box-shadow: none;
}

input[type="text"].rewrite-field.correct {
    color: var(--success-color) !important;
}

.status-banner { padding: 1rem; border-radius: 8px; font-weight: bold; font-size: 1.25rem; margin-bottom: 0.5rem; text-align: center; }
.keyboard-hints { display: flex; justify-content: center; gap: 1.5rem; color: var(--text-secondary); font-size: 0.9rem; }
.hint { display: flex; align-items: center; gap: 0.5rem; }
kbd { background: var(--surface-color); border: 1px solid var(--border-color); padding: 0.2rem 0.5rem; border-radius: 4px; font-family: monospace; font-size: 0.85rem; color: var(--text-primary); }

.session-actions { text-align: center; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 1rem; table-layout: fixed; }
.data-table th, .data-table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border-color); overflow: hidden; text-overflow: ellipsis; }
.data-table th { color: var(--text-secondary); font-weight: 500; }
.btn-ghost { background: none; border: none; color: var(--text-secondary); cursor: pointer; text-decoration: underline; }
.btn-ghost:hover { color: var(--error-color); }

/* Prevent table overflow on desktop */
.table-container {
    width: 100%;
    overflow-x: auto;
}

/* Bulk actions bar in Progression view */
.bulk-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(59, 130, 246, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    animation: fadeIn 0.2s ease;
}
.bulk-actions-bar.hidden {
    display: none !important;
}
#bulk-select-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
}
.bulk-buttons {
    display: flex;
    gap: 0.5rem;
}
.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    font-family: var(--font-sans);
    transition: all 0.2s;
}
.btn-primary-action {
    background-color: var(--primary-color);
    color: white;
}
.btn-primary-action:hover:not(:disabled) {
    background-color: var(--primary-hover);
}
.btn-secondary-action {
    background-color: var(--text-secondary);
    color: white;
}
.btn-secondary-action:hover:not(:disabled) {
    background-color: var(--text-primary);
    color: var(--bg-color);
}
.btn-small:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Status Cells */
.status-cell {
    user-select: none;
    text-align: center !important;
    font-size: 1rem;
    line-height: 1;
    font-weight: bold;
    white-space: nowrap;
    min-width: 80px;
    height: 48px;
}
.status-cell.valide {
    color: var(--success-color);
}

/* Stats Layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 350px));
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}
.stat-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    min-height: 72px;
}
.stat-pair-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
}
.stat-percentage-badge {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--success-color);
    background-color: rgba(16, 185, 129, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
}
.stat-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
}
.stat-label {
    color: var(--text-secondary);
    white-space: nowrap;
}
.stat-value {
    font-weight: 600;
}

/* Progress bar */
.stat-progress-container {
    background-color: var(--border-color);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}
.stat-progress-bar {
    background-color: var(--success-color);
    height: 100%;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.1, 1, 0.1, 1);
}

/* Gamification CECRL Stepper & Progress Card */
.cefr-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
}
.cefr-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(90deg, #3b82f6, #06b6d4, #10b981, #eab308, #f97316, #ef4444);
}
.cefr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.cefr-level-badge-large {
    font-size: 1.35rem;
    font-weight: 800;
    padding: 0.35rem 0.9rem;
    border-radius: 8px;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.cefr-stepper-container {
    position: relative;
    padding: 1.25rem 0.5rem 0.5rem 0.5rem;
    margin: 0.75rem 0;
}
.cefr-stepper-track-bg {
    position: absolute;
    top: 35px;
    left: 30px;
    right: 30px;
    height: 7px;
    background: var(--border-color);
    border-radius: 4px;
    z-index: 1;
    overflow: hidden;
}
.cefr-stepper-track-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #64748b, #3b82f6, #06b6d4, #10b981, #eab308, #f97316, #ef4444);
    border-radius: 4px;
    transition: width 1.2s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}
.cefr-stepper-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 3;
}
.cefr-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
    min-width: 44px;
}
.cefr-step-bubble {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface-color);
    border: 3px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}
.cefr-step-item.completed .cefr-step-bubble {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.35);
}
.cefr-step-item.active .cefr-step-bubble {
    border-color: #f59e0b;
    border-style: dashed;
    color: #f59e0b;
    background: var(--surface-color);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}
.cefr-step-item.newly-completed .cefr-step-bubble {
    animation: bubbleUnlock 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes bubbleUnlock {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); box-shadow: 0 0 22px rgba(16, 185, 129, 0.85); background: #10b981; border-color: #10b981; }
    100% { transform: scale(1); }
}
@keyframes cefrPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
    50% { box-shadow: 0 0 0 7px rgba(245, 158, 11, 0); }
}

/* Animations d'augmentation de points sur la page Statistique */
.points-gain-badge {
    position: absolute;
    top: -12px;
    right: -6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.08rem 0.4rem;
    border-radius: 9999px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
    animation: pointsBadgePop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    letter-spacing: -0.01em;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

@keyframes pointsBadgePop {
    0% {
        opacity: 0;
        transform: translateY(6px) scale(0.6);
    }
    50% {
        opacity: 1;
        transform: translateY(-2px) scale(1.12);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.points-counter-animating {
    color: #10b981 !important;
    text-shadow: 0 0 16px rgba(16, 185, 129, 0.65);
    display: inline-block;
    animation: pointsCounterPulse 0.4s ease-in-out infinite alternate;
}

@keyframes pointsCounterPulse {
    0% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1.12);
    }
}
.cefr-step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.cefr-step-threshold {
    font-size: 0.68rem;
    color: var(--text-secondary);
    opacity: 0.85;
}
.cefr-step-threshold .thresh-short {
    display: none;
}

/* Jauge du palier en cours : objectif à gauche, avancement en haut à droite */
.cefr-tier-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.85rem;
}
.cefr-tier-goal {
    flex: 1 1 auto;
    min-width: 0;
}
.cefr-tier-pct {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    margin-left: auto;
}
@media (max-width: 600px) {
    /* Mobile : avancement sur une ligne en tête, objectif pleine largeur dessous */
    .cefr-tier-head {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .cefr-tier-pct {
        order: -1;
        justify-content: space-between;
        margin-left: 0;
        padding-bottom: 0.5rem;
        border-bottom: 1px dashed var(--border-color);
    }
    .cefr-tier-goal {
        font-size: 0.8rem;
        line-height: 1.45;
    }
}

@media (max-width: 600px) {
    .cefr-step-item {
        min-width: 36px;
    }
    .cefr-step-bubble {
        width: 32px;
        height: 32px;
        font-size: 0.72rem;
        border-width: 2px;
    }
    .cefr-stepper-track-bg {
        top: 29px;
        left: 24px;
        right: 24px;
    }
    /* Le libellé répète le contenu de la bulle : on le masque et on garde un seuil compact */
    .cefr-step-label {
        display: none;
    }
    .cefr-step-threshold {
        font-size: 0.62rem;
        font-weight: 600;
        font-variant-numeric: tabular-nums;
        letter-spacing: -0.01em;
    }
    .cefr-step-threshold .thresh-full {
        display: none;
    }
    .cefr-step-threshold .thresh-short {
        display: inline;
    }
    .cefr-step-item.completed .cefr-step-threshold {
        color: var(--primary-color);
        opacity: 1;
    }
    .cefr-step-item.active .cefr-step-threshold {
        color: #f59e0b;
        opacity: 1;
    }
}

/* Checkbox alignment */
.data-table th input[type="checkbox"],
.data-table td input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.mobile-menu-btn {
    display: none !important;
}

.btn-drill-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    font-family: var(--font-sans);
    transition: all 0.2s;
}

.btn-drill-action.btn-secondary-action {
    background-color: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.btn-drill-action.btn-secondary-action:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .btn-drill-action.btn-secondary-action {
    background-color: #1e293b;
    color: #f8fafc;
    border: 1px solid #475569;
}

[data-theme="dark"] .btn-drill-action.btn-secondary-action:hover {
    background-color: rgba(248, 113, 113, 0.15);
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.4);
}

[data-theme="dark"] .btn-drill-action.btn-secondary-action kbd {
    background-color: #334155;
    color: #f8fafc;
    border-color: #64748b;
}

/* Mobile Swipe to Ignore Component */
.swipe-to-confirm {
    width: 100%;
    margin-bottom: 0.25rem;
}

.swipe-track {
    position: relative;
    width: 100%;
    height: 48px;
    border-radius: 24px;
    background: rgba(239, 68, 68, 0.08);
    border: 1.5px solid rgba(239, 68, 68, 0.25);
    overflow: hidden;
    user-select: none;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

[data-theme="dark"] .swipe-track {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
}

.swipe-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.45));
    border-radius: 24px;
    pointer-events: none;
    transition: width 0.05s ease-out;
}

.swipe-label {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ef4444;
    pointer-events: none;
    transition: opacity 0.15s ease;
    padding-left: 42px;
    padding-right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    box-sizing: border-box;
}

[data-theme="dark"] .swipe-label {
    color: #fca5a5;
}

.swipe-thumb {
    position: absolute;
    left: 3px;
    top: 3px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ef4444;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    cursor: grab;
    touch-action: none;
    z-index: 2;
}

.swipe-thumb:active {
    cursor: grabbing;
}

[data-theme="dark"] .swipe-thumb {
    background: #dc2626;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.5);
}

.mobile-only-btn {
    display: none !important;
    margin-top: auto !important;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Responsive / Mobile optimizations */
@media (max-width: 640px) {
    .mobile-menu-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        color: var(--text-primary);
    }
    
    .mobile-only-btn {
        display: block !important;
    }
    
    #mobile-action-container {
        display: flex !important;
    }

    .app-header {
        position: relative;
        padding: 0.75rem 1rem;
    }

    .logo-tagline {
        display: none;
    }

    .nav-menu {
        display: none !important;
        position: absolute;
        top: 100%;
        right: 1rem;
        background-color: var(--surface-color);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        box-shadow: var(--shadow);
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.5rem;
        z-index: 1000;
        min-width: 180px;
        animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .nav-menu.open {
        display: flex !important;
    }

    .nav-btn {
        width: 100%;
        text-align: left;
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
    }

    #nav-stats {
        justify-content: flex-start;
    }

    /* Main Container & Cards padding reduction */
    #app-container,
    #app-container.in-drill-mode {
        padding: 1rem 0.5rem;
    }
    .view-content,
    .drill-container {
        max-width: 100%;
    }
    .card {
        padding: 1.25rem 1rem;
    }
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* Drill / Exercise */
    .drill-header {
        margin-bottom: 1rem;
    }
    .drill-word-wrapper {
        gap: 0.4rem;
        margin-bottom: 1.2rem;
        padding: 0 0.25rem;
        box-sizing: border-box;
    }
    .word-source {
        font-size: clamp(1.4rem, 6vw, 1.85rem);
        margin-bottom: 0;
        line-height: 1.3;
        text-align: center;
        max-width: 100%;
        overflow-wrap: break-word;
        word-break: normal;
    }
    .word-source-chunk.has-break {
        display: block;
    }
    .word-source-chunk.word-source-note {
        display: block;
        margin-top: 0.2rem;
        font-size: 0.82em;
    }
    .input-section {
        width: fit-content;
        min-width: 180px;
        max-width: 260px;
        margin-left: auto;
        margin-right: auto;
    }
    .input-section input, .input-prefix {
        font-size: 1.3rem;
    }
    .flashcard {
        padding: 1rem 0.5rem;
        margin-bottom: 0;
    }
    .drill-dynamic-area {
        min-height: 380px;
        transform: none;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .status-banner {
        padding: 0.75rem;
        margin-bottom: 1rem;
        font-size: 1.1rem;
    }
    .result-comparison {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    .result-actions-bar {
        padding: 0 1rem;
    }
    .end-session-card {
        padding: 1.25rem 0.75rem;
        gap: 0.75rem;
    }
    .congrats-title {
        font-size: 1.6rem;
    }
    .context-promo-box {
        padding: 1rem 0.85rem;
    }
}

/* Multi-select Dropdown Filters */
.progress-filters {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.progress-filters input[type="text"]#prog-search {
    height: 38px;
    padding: 0 0.85rem;
    font-size: 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    color: var(--text-primary);
    box-sizing: border-box;
    margin: 0;
    width: 220px;
}
.progress-filters input[type="text"]#prog-search:focus {
    border-color: var(--primary-color);
    outline: none;
}
.filter-dropdown-wrapper {
    position: relative;
    display: inline-block;
}
.filter-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 38px;
    padding: 0 0.85rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    font-family: var(--font-sans);
    box-sizing: border-box;
}
.filter-dropdown-btn:hover,
.filter-dropdown-btn.active {
    border-color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.08);
}
.filter-count-badge {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
}
.filter-dropdown-popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    z-index: 50;
    min-width: 190px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.filter-dropdown-popover.hidden {
    display: none !important;
}
.filter-popover-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.filter-quick-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    user-select: none;
    line-height: 1;
}
.filter-quick-btn {
    background: transparent;
    border: none;
    padding: 0.15rem 0.25rem;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    line-height: 1;
    font-family: inherit;
    transition: all 0.15s ease;
    opacity: 0.75;
}
.filter-quick-btn:hover {
    opacity: 1;
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.12);
}
.filter-quick-sep {
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.4;
    user-select: none;
}
.filter-badge-neutral {
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-weight: 500;
}

.search-input-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.search-clear-btn {
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.55;
    line-height: 1;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.search-clear-btn:hover {
    opacity: 1;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}
.search-clear-btn.hidden {
    display: none !important;
}

.filter-results-count {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 38px;
    padding: 0 0.9rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    user-select: none;
    font-family: var(--font-sans);
    box-sizing: border-box;
}

[data-theme="light"] .filter-results-count {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Focus Subtabs (Pool actif vs Mots ignorés) */
.focus-subtabs-wrapper {
    user-select: none;
}
.focus-subtab-btn {
    border-radius: 7px;
    font-family: var(--font-sans);
    outline: none;
    transition: all 0.2s ease;
}
.focus-subtab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--text-primary) !important;
}
.focus-subtab-btn.active {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* Table action button (ignorer / réactiver) */
.btn-table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-table-action:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}
.btn-table-action.btn-reactivate:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

/* Progression Table: Desktop & Mobile Card Layout (Approche A) */
.col-desktop {
    display: table-cell;
}
.col-mobile {
    display: none !important;
}

@media (max-width: 680px) {
    .progress-filters {
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    .progress-filters input[type="text"] {
        width: 100% !important;
    }
    .filter-results-count {
        margin-left: auto;
        height: 36px;
        font-size: 0.8rem;
        padding: 0 0.75rem;
    }
    .table-container {
        width: 100%;
        overflow-x: visible;
    }
    .data-table thead {
        display: none !important;
    }
    .col-desktop {
        display: none !important;
    }
    .col-mobile {
        display: block !important;
        width: 100% !important;
    }
    .data-table, .data-table tbody {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    .data-table tr {
        display: block;
        width: 100%;
        background: var(--surface-color);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        margin-bottom: 0.75rem;
        padding: 0.85rem 1rem;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
        box-sizing: border-box;
    }
    .data-table tr:hover {
        border-color: rgba(99, 102, 241, 0.3);
    }
    .data-table td {
        padding: 0 !important;
        border: none !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
    .mobile-card-top {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .mobile-card-words {
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
        min-width: 0;
        flex: 1;
    }
    .mobile-word-source {
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--text-primary);
        line-height: 1.35;
        word-break: break-word;
    }
    .mobile-word-target {
        font-size: 0.95rem;
        font-weight: 500;
        color: var(--primary-color);
        line-height: 1.35;
        word-break: break-word;
    }
    .mobile-card-status {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 32px;
    }
    .mobile-card-bottom {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-top: 0.55rem;
        padding-top: 0.45rem;
        border-top: 1px solid var(--border-color);
        font-size: 0.75rem;
        color: var(--text-secondary);
        flex-wrap: wrap;
    }
    .mobile-attempts {
        margin-left: auto;
        font-weight: 500;
        color: var(--text-secondary);
        font-size: 0.75rem;
    }
    .about-note-item {
        padding: 0.8rem 0.95rem;
        gap: 0.75rem;
    }
    .about-note-text {
        font-size: 0.88rem;
    }
}

/* Stacking comparison lines on small/mobile screens */
@media (max-width: 540px) {
    .comparison-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
        margin-bottom: 0.5rem;
    }
    .comparison-label {
        min-width: 0;
        text-align: left;
        margin-right: 0;
        font-size: 0.8rem;
    }
    .result-actions-bar .drill-word-badges {
        width: auto;
        justify-content: flex-start;
        margin-left: 0;
    }
    .comparison-text {
        font-size: 1.25rem;
    }
    input[type="text"].rewrite-field {
        font-size: 1.25rem !important;
        max-width: 100%;
    }
    .bulk-actions-bar {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    .bulk-buttons {
        width: 100%;
        justify-content: flex-end;
    }
    .keyboard-hints {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}

/* --- Styles de la page Le Projet --- */
.about-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem;
}
.about-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, border-color 0.2s;
}
.about-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}
.about-card h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-top: 0;
}
.about-card p, .about-card li {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}
/* ==========================================================================
   Schéma de Processus en Cycle Continu (Page À Propos)
   ========================================================================== */
.about-process-section {
    margin: 1.75rem 0 2rem 0;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

[data-theme="dark"] .about-process-section {
    background: rgba(15, 23, 42, 0.45);
    border-color: rgba(255, 255, 255, 0.08);
}

.about-process-image-wrap {
    width: 100%;
    max-width: 660px;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .about-process-image-wrap {
    background: #ffffff;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.about-process-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.about-process-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    width: 100%;
    max-width: 780px;
}

.process-step-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.8rem 0.9rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.process-step-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

.process-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.process-step-dot.dot-drill {
    background: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.process-step-dot.dot-test {
    background: #eab308;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
}

.process-step-dot.dot-review {
    background: #a855f7;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
}

.process-step-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.process-step-text strong {
    font-size: 0.88rem;
    color: var(--text-primary);
    font-weight: 700;
}

.process-step-text span {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .about-process-steps {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }
}

.pillar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}
.pillar-box {
    background: rgba(100, 116, 139, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    text-align: center;
    transition: background 0.2s;
}
.pillar-box:hover {
    background: rgba(100, 116, 139, 0.1);
}
.pillar-icon {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
    transition: transform 0.2s ease, color 0.2s ease;
}
.pillar-box:hover .pillar-icon {
    transform: translateY(-2px);
    color: #34d399;
}
.pillar-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.15rem;
}
.pillar-desc {
    font-size: 0.75rem !important;
    color: var(--text-secondary);
    line-height: 1.3;
    display: block;
}
.about-notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 1.25rem;
}
.about-note-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 1.15rem;
    background: rgba(100, 116, 139, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: transform 0.2s, border-color 0.2s, background-color 0.2s;
}
.about-note-item:hover {
    border-color: var(--primary-color);
    background: rgba(100, 116, 139, 0.09);
    transform: translateY(-1px);
}
.about-note-icon {
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
}
.about-note-text {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 0;
}
.about-note-text strong {
    color: var(--text-primary);
}
.credits-banner {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.03) 0%, rgba(16, 185, 129, 0.03) 100%);
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}
.avatar-badge {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--success-color) 100%);
    color: white;
    font-weight: 800;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}
.linkedin-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background-color: #0077b5;
    color: white !important;
    padding: 0.65rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 0.5rem;
    border: none;
    cursor: pointer;
}
.linkedin-badge-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 119, 181, 0.35);
}
.tags-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.5rem;
}
.tag-badge {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-sans);
}

/* --- Styles des badges de type de mot (drill) --- */
.type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
}
.type-badge.hidden {
    display: none !important;
}
.type-badge.verbe {
    background-color: rgba(244, 63, 94, 0.15) !important;
    color: #fb7185 !important;
    border: 1px solid rgba(244, 63, 94, 0.35) !important;
}
.type-badge.nom {
    background-color: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(59, 130, 246, 0.35) !important;
}
.type-badge.adjectif {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
}
.type-badge.adverbe {
    background-color: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}
.type-badge.conjonction {
    background-color: rgba(6, 182, 212, 0.15) !important;
    color: #22d3ee !important;
    border: 1px solid rgba(6, 182, 212, 0.35) !important;
}
.type-badge.pronom {
    background-color: rgba(168, 85, 247, 0.15) !important;
    color: #c084fc !important;
    border: 1px solid rgba(168, 85, 247, 0.35) !important;
}
.type-badge.preposition,
.type-badge.préposition {
    background-color: rgba(14, 165, 233, 0.15) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(14, 165, 233, 0.35) !important;
}
.type-badge.expression {
    background-color: rgba(236, 72, 153, 0.15) !important;
    color: #f472b6 !important;
    border: 1px solid rgba(236, 72, 153, 0.35) !important;
}

/* Badges de niveau CEFR dans le drill (même géométrie pill et bordure que les types) */
.type-badge.A1, .type-badge.a1 {
    background-color: rgba(59, 130, 246, 0.15) !important;
    color: #3b82f6 !important;
    border: 1px solid rgba(59, 130, 246, 0.35) !important;
}
.type-badge.A2, .type-badge.a2 {
    background-color: rgba(6, 182, 212, 0.15) !important;
    color: #06b6d4 !important;
    border: 1px solid rgba(6, 182, 212, 0.35) !important;
}
.type-badge.B1, .type-badge.b1 {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
}
.type-badge.B2, .type-badge.b2 {
    background-color: rgba(234, 179, 8, 0.15) !important;
    color: #eab308 !important;
    border: 1px solid rgba(234, 179, 8, 0.35) !important;
}
.type-badge.C1, .type-badge.c1 {
    background-color: rgba(249, 115, 22, 0.15) !important;
    color: #f97316 !important;
    border: 1px solid rgba(249, 115, 22, 0.35) !important;
}
.type-badge.C2, .type-badge.c2 {
    background-color: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

.example-highlight {
    font-weight: 700;
    color: var(--primary-color);
}


/* --- Context Drill Styles --- */
.context-word-btn {
    padding: 0.3rem 0.7rem;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: grab;
    transition: all 0.2s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    box-shadow: var(--shadow-sm);
}

.touch-drag-clone {
    background: var(--surface-color) !important;
    border: 2px solid var(--primary-color) !important;
    color: var(--text-primary) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    padding: 0.3rem 0.7rem !important;
}

.context-word-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.context-word-btn:active, .context-word-btn.dragging {
    cursor: grabbing;
    opacity: 0.8;
    transform: scale(0.95);
}

.context-word-btn.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.context-word-btn.success-match {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
    transform: scale(1.1);
    opacity: 0;
    transition: all 0.5s ease-out;
}

.context-sentence-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    transition: all 0.3s;
}

.context-sentence-card.matched {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
}

.context-sentence-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.6;
    flex: 1;
}

.context-dropzone {
    display: inline-block;
    min-width: 100px;
    height: 34px;
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    vertical-align: middle;
    margin: 0 0.4rem;
    background: rgba(0,0,0,0.02);
    transition: all 0.2s;
    cursor: pointer;
}

.context-dropzone.drag-over {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.05);
}

.context-dropzone.selectable {
    border-color: var(--primary-color);
    border-style: solid;
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.context-dropzone.success {
    border-color: var(--success-color);
    border-style: solid;
    background: var(--success-color);
    color: white;
    font-weight: 600;
    text-align: center;
    line-height: 30px;
    font-size: 1.05rem;
}


/* Segmented Control for Drill Mode */
.segmented-control .segment-btn {
    color: var(--text-secondary);
}
.segmented-control input[type="radio"]:checked + .segment-btn {
    background-color: var(--primary-color);
    color: white;
}

/* Highlight bold text in About page */
.about-content strong {
    font-weight: 700;
    color: var(--primary-color);
}

/* Report button & toast styles */
.report-btn {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid #ef4444;
    cursor: pointer;
    opacity: 1;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    transition: all 0.2s ease;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}
.report-btn .report-btn-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    margin-left: 0.35rem;
    transition: color 0.2s ease;
}
[data-theme="light"] .report-btn .report-btn-text {
    color: #dc2626;
}
.report-btn svg {
    transition: fill 0.2s ease, stroke 0.2s ease;
}
.report-btn:hover {
    opacity: 1;
    transform: scale(1.05);
    background: #ef4444;
    border-color: #ef4444;
}
.report-btn:hover .report-btn-text {
    color: #ffffff !important;
}
.report-btn:hover svg {
    fill: #ffffff !important;
    stroke: #ffffff !important;
}
.report-btn:active {
    transform: scale(0.95);
}
.report-btn.reported {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
    background: transparent;
    border-color: transparent;
}

.result-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
    margin-bottom: 0.6rem;
    padding: 0 1.5rem;
    box-sizing: border-box;
    width: 100%;
}

.result-actions-bar .drill-word-badges {
    width: 105px;
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
}

.report-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--primary-color);
    padding: 0.5rem 1.25rem;
    border-radius: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 3000;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    animation: toastPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes toastPop {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.report-modal-textarea {
    width: 100%;
    box-sizing: border-box;
    background-color: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    line-height: 1.4;
    resize: none;
    height: 68px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.report-modal-textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.report-modal-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.65;
}

/* Modal Close Button */
.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.modal-close-btn:hover {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: var(--error-color);
    color: var(--error-color);
    transform: scale(1.08) rotate(90deg);
}

/* Password Input & Toggle Eye */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-wrapper input {
    width: 100%;
    padding: 0.75rem 2.75rem 0.75rem 0.75rem !important;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-sans);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.password-input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.toggle-password-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background-color 0.2s;
}

.toggle-password-btn:hover {
    color: var(--primary-color);
    background-color: rgba(100, 116, 139, 0.1);
}

/* Forgot Password Link */
.forgot-password-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-sans);
    padding: 0;
    transition: opacity 0.2s, text-decoration 0.2s;
}

.forgot-password-btn:hover {
    text-decoration: underline;
    opacity: 0.85;
}

/* Modale Options */
.btn-theme-choice.active {
    border-color: var(--primary-color) !important;
    background: rgba(59, 130, 246, 0.14) !important;
    color: var(--primary-color) !important;
    box-shadow: 0 0 0 1px var(--primary-color);
}
.btn-theme-choice:hover:not(.active) {
    background: rgba(0, 0, 0, 0.08) !important;
}
[data-theme="dark"] .btn-theme-choice:hover:not(.active) {
    background: rgba(255, 255, 255, 0.08) !important;
}
.btn-danger:hover {
    background: #dc2626 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

/* Quick-keys : Touches de caractères spéciaux avec composant toggle sur la gauche */
.drill-special-keys-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 540px;
    margin: 0.65rem auto 0.25rem;
    user-select: none;
}

.special-keys-bar-header {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    margin-bottom: 0.45rem;
    padding-left: 0.15rem;
    box-sizing: border-box;
}

.special-keys-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0 0.6rem;
    height: 30px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.special-keys-toggle-btn:hover {
    color: var(--text-primary);
    border-color: var(--primary-color);
    background: var(--bg-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}

.special-keys-toggle-btn.is-active {
    color: var(--primary-color);
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.08);
}

.special-keys-toggle-btn .toggle-chevron {
    transition: transform 0.2s ease;
}

.special-keys-toggle-btn:not(.is-active) .toggle-chevron {
    transform: rotate(-90deg);
}

.special-keys-toggle-btn .toggle-text-chars {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
}

.drill-special-keys {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    margin: 0;
    user-select: none;
}

.special-key-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 600;
    min-width: 38px;
    height: 38px;
    padding: 0 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.special-key-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(59, 130, 246, 0.3);
}

.special-key-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

/* Rappel d'orthographe exacte sous validation tolérante */
.spelling-hint-banner {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #f59e0b;
    padding: 0.6rem 1.15rem;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 500;
    margin-top: 1rem;
    margin-bottom: 1.25rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    animation: fadeIn 0.25s ease-out;
}

/* Bannière de relance dynamique (Synonyme d'un autre niveau) */
.retry-hint-banner {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #f59e0b;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 1.25rem;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 640px;
    box-sizing: border-box;
    animation: fadeIn 0.25s ease-out;
}

@keyframes inputRetryPulse {
    0% { transform: translateX(0); border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
    100% { transform: translateX(0); border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25); }
}

.input-retry-highlight {
    animation: inputRetryPulse 0.45s ease-in-out !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25) !important;
}

/* Options Modal Scrolling & Laptop Screen Optimization */
.options-modal-card {
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.options-modal-card::-webkit-scrollbar {
    width: 6px;
}

.options-modal-card::-webkit-scrollbar-track {
    background: transparent;
}

.options-modal-card::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

@media (max-height: 720px) {
    .options-modal-card {
        padding: 1rem 1.25rem !important;
        gap: 0.75rem !important;
    }
}

@media (max-width: 580px) {
    .placement-question-row {
        grid-template-columns: 1fr auto !important;
        gap: 0.35rem 0.6rem !important;
    }
    .placement-question-row .col-expected,
    .placement-question-row .col-user {
        grid-column: span 2;
    }
}

/* Placement Test Modal & Responsive Compact Optimization (Laptops & Small Heights) */
.placement-test-card {
    box-sizing: border-box;
    margin: auto;
    max-height: calc(100vh - 2.5rem);
    max-height: calc(100dvh - 2.5rem);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.placement-test-card::-webkit-scrollbar {
    width: 6px;
}

.placement-test-card::-webkit-scrollbar-track {
    background: transparent;
}

.placement-test-card::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

@media (max-height: 760px) {
    .placement-test-card {
        padding: 1.15rem 1.35rem !important;
        gap: 0.85rem !important;
    }
}

/* ==========================================================================
   Triptyque Navigation (Style Zelda) & Compact 14" Viewport
   ========================================================================== */
.triptych-container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Viewport masquant les débordements avec overflow visible horizontalement maîtrisé */
.triptych-viewport {
    width: 100%;
    overflow: hidden;
    position: relative;
    border-radius: 16px;
    /* Supprimer tout faux reflet ou ombre résiduelle */
    box-shadow: none !important;
}

/* Bande glissante 300% */
.triptych-track {
    display: flex;
    width: 300%;
    transform: translateX(-33.333333%); /* Par défaut centré sur le Drill */
    transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

/* Chaque panneau du triptyque */
.triptych-panel {
    flex: 0 0 33.333333%;
    width: 33.333333%;
    max-width: 33.333333%;
    box-sizing: border-box;
    padding: 0 0.5rem;
    display: flex;
    flex-direction: column;
}

/* Flèches latérales : grandes, vertes, sans texte, élégamment positionnées à côté de la box */
.triptych-arrow-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--surface-color);
    border: 2px solid #10b981;
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 30;
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.25);
    transition: all 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
    outline: none;
    padding: 0;
}

@media (hover: hover) and (pointer: fine) {
    .triptych-arrow-btn:not(.triptych-arrow-inert):hover {
        background: #10b981;
        color: #ffffff;
        box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
        transform: translateY(-50%) scale(1.14);
    }
}

.triptych-arrow-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.triptych-arrow-btn:focus {
    outline: none;
}

.triptych-arrow-btn:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 3px;
}

.triptych-arrow-btn.triptych-arrow-inert,
.triptych-arrow-btn.triptych-arrow-inert:hover {
    background: var(--surface-color) !important;
    color: #10b981 !important;
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.25) !important;
    transform: translateY(-50%) scale(1) !important;
}

.triptych-arrow-prev {
    left: -78px;
}

.triptych-arrow-next {
    right: -78px;
}

@media (max-width: 900px) {
    .triptych-arrow-prev {
        left: -16px;
    }
    .triptych-arrow-next {
        right: -16px;
    }
}

@media (max-width: 720px) {
    .triptych-arrow-btn {
        width: 44px;
        height: 44px;
    }
    .triptych-arrow-btn svg {
        width: 24px;
        height: 24px;
    }
}

/* Optimisation & aération élégante de la carte Drill */
.config-card-compact {
    padding: 1.75rem 2rem !important;
    border-radius: 16px;
    box-shadow: none !important;
    border: 1px solid var(--border-color);
}

.practice-activity-card {
    background: var(--bg-color);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.practice-activity-card:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.practice-activity-card.selected {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 0 0 1px var(--primary-color), 0 4px 14px rgba(59, 130, 246, 0.15);
}

.practice-card-radio {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    opacity: 0.45;
    transition: all 0.2s ease;
}

.practice-card-radio .radio-dot {
    display: none;
}

.practice-activity-card.selected .practice-card-radio {
    color: var(--primary-color);
    opacity: 1;
}

.practice-activity-card.selected .practice-card-radio .radio-dot {
    display: block;
}

.config-card-compact .form-group {
    margin-bottom: 1.45rem !important;
}

@media (max-height: 850px) {
    #app-container {
        padding: 0.85rem 1rem !important;
    }
    .config-card-compact {
        padding: 1.45rem 1.7rem !important;
    }
    .config-card-compact .form-group {
        margin-bottom: 1.25rem !important;
    }
}

.home-drill-lang-pair-btn {
    transition: all 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
    outline: none;
}

.home-drill-lang-pair-btn:hover {
    transform: scale(1.06);
    filter: brightness(1.08);
}

.home-drill-lang-pair-btn:active {
    transform: scale(0.96);
}

/* ==========================================================================
   Donut CECRL Fromage Interactif & Grille Drill 2 Colonnes
   ========================================================================== */
.drill-config-grid {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

@media (max-width: 540px) {
    .drill-config-grid {
        flex-direction: column;
        gap: 1.2rem;
        align-items: center;
        justify-content: center;
    }

    .drill-config-grid > div {
        text-align: center !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }

    .drill-config-grid > div:nth-child(2) {
        width: 100%;
        max-width: 250px;
    }

    .drill-config-grid > div:nth-child(2) > div:first-child {
        width: 100%;
        justify-content: space-between !important;
        gap: 0.85rem;
    }

    .drill-config-grid > div:nth-child(2) > div:nth-child(2) {
        justify-content: flex-start !important;
    }
}

.cefr-donut-slice {
    cursor: pointer;
    transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, filter 0.2s ease;
    transform-origin: 70px 70px;
}

.cefr-donut-slice:hover {
    filter: brightness(1.2) drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

.cefr-donut-slice.active {
    opacity: 1;
    transform: scale(1.035);
}

.cefr-donut-slice:not(.active) {
    opacity: 0.25;
    filter: grayscale(0.75);
}

.cefr-donut-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.03em;
    fill: #ffffff;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    user-select: none;
    transition: opacity 0.2s ease;
}

.cefr-donut-slice:not(.active) ~ text[data-level] {
    opacity: 0.45;
}

#donut-center-maca image {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}

.btn-quick-volume {
    transition: all 0.18s ease;
}

.btn-quick-volume:hover {
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
}

.btn-quick-volume.active {
    background: rgba(59, 130, 246, 0.18) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    font-weight: 700 !important;
}

/* ==========================================================================
   Slider Cool & Futuriste
   ========================================================================== */
.cool-slider-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.cool-range-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(to right, #3b82f6 100%, rgba(255, 255, 255, 0.12) 100%);
    outline: none;
    cursor: pointer;
    transition: background 0.15s ease;
    margin: 0;
}

.cool-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    border: 3.5px solid #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.65), 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: grab;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, background 0.15s ease;
}

.cool-range-input::-webkit-slider-thumb:hover {
    transform: scale(1.22);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.9), 0 3px 8px rgba(0, 0, 0, 0.35);
}

.cool-range-input:active::-webkit-slider-thumb {
    cursor: grabbing;
    transform: scale(1.28);
    background: #3b82f6;
    border-color: #ffffff;
    box-shadow: 0 0 22px rgba(59, 130, 246, 1), 0 4px 12px rgba(0, 0, 0, 0.45);
}

.cool-range-input::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    border: 3.5px solid #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.65), 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: grab;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
}

.cool-range-input::-moz-range-thumb:hover {
    transform: scale(1.22);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.9);
}

.cool-range-input:active::-moz-range-thumb {
    cursor: grabbing;
    transform: scale(1.28);
    background: #3b82f6;
    border-color: #ffffff;
}

.step-tick {
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0.1rem 0.25rem;
    border-radius: 4px;
}

.step-tick:hover {
    color: var(--primary-color) !important;
    transform: translateY(-1px);
}

.step-tick.active {
    color: var(--primary-color) !important;
    transform: scale(1.18);
}

/* ==========================================================================
   Mode Atelier : Phrase à traduire (Bulle unique par mot avec lettre guide)
   ========================================================================== */
.sentence-slots-area {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.55rem 0.25rem;
    min-height: 80px;
    padding: 1.5rem 1.4rem;
    background: var(--bg-color);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    box-sizing: border-box;
    line-height: 2.2;
}

/* Le slot du mot : AUCUNE BULLE FERMÉE, juste une élégante ligne de base soulignée */
.sentence-word-input-wrapper {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 0 !important;
    position: relative !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 2.5px solid var(--border-color) !important;
    border-radius: 0 !important;
    padding: 0.1rem 0.15rem 0.2rem 0.15rem !important;
    margin: 0.15rem 0.25rem !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
    cursor: text !important;
    vertical-align: baseline !important;
}

.sentence-word-input-wrapper:hover {
    border-bottom-color: rgba(59, 130, 246, 0.5) !important;
}

.sentence-word-input-wrapper:focus-within {
    border-bottom-color: var(--primary-color) !important;
    box-shadow: 0 2px 0 0 var(--primary-color) !important;
}

/* Slot spécial pour le mot clé validé (souligné violet) */
.sentence-word-input-wrapper.keyword-wrapper {
    border-bottom-color: rgba(168, 85, 247, 0.7) !important;
    background: transparent !important;
}

.sentence-word-input-wrapper.keyword-wrapper:focus-within {
    border-bottom-color: #a855f7 !important;
    box-shadow: 0 2px 0 0 #a855f7 !important;
}

.sentence-word-input-wrapper.is-correct {
    border-bottom-color: #10b981 !important;
    box-shadow: 0 2px 0 0 #10b981 !important;
}

.sentence-word-input-wrapper.is-correct .sentence-hint-letter,
.sentence-word-input-wrapper.is-correct input.sentence-word-input {
    color: #10b981 !important;
}

.sentence-word-input-wrapper.is-incorrect {
    border-bottom-color: #f59e0b !important;
    box-shadow: 0 2px 0 0 #f59e0b !important;
}

.sentence-word-input-wrapper.is-incorrect .sentence-hint-letter,
.sentence-word-input-wrapper.is-incorrect input.sentence-word-input {
    color: #f59e0b !important;
}

/* La lettre guide intégrée et appondue (directement collée au reste du mot) */
.sentence-hint-letter {
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    color: var(--primary-color) !important;
    user-select: none !important;
    pointer-events: none !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
    vertical-align: baseline !important;
}

.sentence-word-input-wrapper.keyword-wrapper .sentence-hint-letter {
    color: #a855f7 !important;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    margin-right: 0.15rem !important;
}

/* L'élément input : totalement fluide, sans boîte ni fond */
input[type="text"].sentence-word-input,
.sentence-word-input {
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    color: var(--text-primary) !important;
    font-family: inherit !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    box-sizing: content-box !important;
    vertical-align: baseline !important;
    transition: width 0.1s ease !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

input[type="text"].sentence-word-input:focus,
.sentence-word-input:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

input[type="text"].sentence-word-input::placeholder,
.sentence-word-input::placeholder {
    color: var(--text-secondary) !important;
    opacity: 0.4 !important;
    font-weight: 500 !important;
}

.sentence-punctuation {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    user-select: none;
    margin-left: -0.15rem;
    margin-right: 0.25rem;
    align-self: baseline;
}

.sentence-feedback-banner {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    animation: sentencePopIn 0.25s ease-out;
}

.sentence-feedback-banner.success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #10b981;
}

.sentence-feedback-banner.error {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--text-primary);
}

.sentence-shake {
    animation: sentenceShake 0.45s ease-in-out;
}

@keyframes sentenceShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

@keyframes sentencePopIn {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Mise en évidence du mot cible dans la phrase source */
.sentence-keyword-highlight {
    color: #a855f7 !important;
    font-weight: 800 !important;
    background: rgba(168, 85, 247, 0.12) !important;
    padding: 0.15rem 0.5rem !important;
    border-radius: 6px !important;
    border: 1px solid rgba(168, 85, 247, 0.35) !important;
    display: inline-block !important;
}

[data-theme="light"] .sentence-keyword-highlight {
    color: #7e22ce !important;
    background: rgba(168, 85, 247, 0.1) !important;
    border-color: rgba(168, 85, 247, 0.25) !important;
}

/* Boutons d'action modernes pour la fin de session */
.sentence-action-btn {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.sentence-action-btn.secondary:hover {
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    background: rgba(59, 130, 246, 0.08) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.sentence-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.45) !important;
}

.sentence-action-btn:active {
    transform: translateY(0) !important;
}

/* Tooltip Mobile & Desktop Fix */
.info-tooltip-wrapper {
    position: relative;
    cursor: pointer;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    transition: color 0.2s;
    outline: none; /* Remove focus ring */
}
.info-tooltip-wrapper .tooltip-content {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.2s, visibility 0.2s !important;
}
.info-tooltip-wrapper:hover .tooltip-content,
.info-tooltip-wrapper:focus .tooltip-content,
.info-tooltip-wrapper:focus-within .tooltip-content {
    opacity: 1 !important;
    visibility: visible !important;
}
.info-tooltip-wrapper:hover,
.info-tooltip-wrapper:focus,
.info-tooltip-wrapper:focus-within {
    color: var(--primary-color) !important;
}

/* --- Modern Form Selects --- */
.modern-select {
    width: 100%;
    box-sizing: border-box;
    font-family: var(--font-sans);
    line-height: normal; /* Fix for descenders being cut off */
    background-color: var(--surface-color);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 2.5rem 0.65rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 600;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    
    /* Custom SVG arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 14px;
}

[data-theme="dark"] .modern-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.modern-select:hover {
    border-color: var(--primary-color);
}

.modern-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Fallback base styles for standard selects (including legacy .wm-select) */
select option {
    background-color: var(--surface-color) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-sans);
    font-weight: 600;
    padding: 0.5rem;
}

@media (max-width: 600px) {
    #test-word-form {
        flex-direction: column !important;
    }
}

/* Mobile utilities */
.mobile-only { display: none !important; }

@media (max-width: 600px) {
    .mobile-only { display: inline-flex !important; }
    .desktop-only { display: none !important; }
    .hide-on-mobile { display: none !important; }
}


/* ==========================================================
   VUE PLEIN ÉCRAN DÉDIÉE : TEST DE NIVEAU (#test)
   ========================================================== */
.test-view-container {
    width: 100%;
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    box-sizing: border-box;
}

.test-view-container .drill-container {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.test-view-container .flashcard {
    text-align: center;
    padding: 1rem;
    margin-bottom: 0;
    border: none;
    border-radius: 12px;
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    position: relative;
}

#app-container.in-test-mode {
    padding: 1rem 1.5rem;
}

.test-action-bar {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    z-index: 5;
}

/* Carte Desktop pour le test */
.test-screen-card {
    max-width: 680px;
    width: 100%;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    padding: 2rem 2.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    box-sizing: border-box;
    margin: 0 auto;
}

/* Carte de résultats pleine page */
.test-results-card {
    max-width: 660px;
    width: 100%;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    padding: 2rem 2.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    box-sizing: border-box;
    margin: 0 auto;
}

/* Optimisation Mobile (< 600px) */
@media (max-width: 600px) {
    .test-view-container {
        padding: 0;
        min-height: calc(100dvh - 65px);
        min-height: calc(100vh - 65px);
        justify-content: flex-start;
    }

    .test-screen-card {
        max-width: 100%;
        width: 100%;
        min-height: calc(100dvh - 80px);
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0.25rem 0.25rem 1rem 0.25rem;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .test-results-card {
        max-width: 100%;
        width: 100%;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0.25rem 0.25rem 1.5rem 0.25rem;
        gap: 1rem;
    }

    .test-action-bar {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin-top: auto;
        padding-top: 1rem;
        width: 100%;
    }
}

/* ==========================================================================
   Mode Révision Vocale Mains Libres (Mode Voiture / Eyes-Free)
   ========================================================================== */
.voice-drill-container {
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    user-select: none;
    cursor: pointer;
}

.voice-drill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voice-progress-badge {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 9999px;
    background: rgba(6, 182, 212, 0.14);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.28);
}

.voice-coach-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(6, 182, 212, 0.08);
    border: 1.5px solid rgba(6, 182, 212, 0.3);
    border-radius: 14px;
    padding: 12px 18px;
}

.voice-coach-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.35);
}

.voice-coach-content {
    flex: 1;
    min-width: 0;
}

.voice-coach-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    color: #06b6d4;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.voice-coach-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
}

.voice-mic-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 24px;
    padding: 0 6px;
}

.voice-mic-wave span {
    display: inline-block;
    width: 3px;
    height: 6px;
    border-radius: 3px;
    background: #06b6d4;
    opacity: 0.4;
    transition: height 0.2s ease, opacity 0.2s ease;
}

.voice-mic-wave.active span {
    opacity: 1;
    animation: voice-bar-bounce 1s infinite ease-in-out;
}

.voice-mic-wave.active span:nth-child(1) { animation-delay: 0.0s; }
.voice-mic-wave.active span:nth-child(2) { animation-delay: 0.2s; }
.voice-mic-wave.active span:nth-child(3) { animation-delay: 0.4s; }
.voice-mic-wave.active span:nth-child(4) { animation-delay: 0.1s; }

@keyframes voice-bar-bounce {
    0%, 100% { height: 6px; }
    50% { height: 22px; }
}

.voice-main-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 26px 20px;
}

.voice-source-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.voice-source-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
}

.voice-source-word {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.voice-context {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
}

.voice-target-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.voice-target-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.voice-target-word {
    font-family: var(--font-mono, monospace);
    font-size: 1.25rem;
    font-weight: 700;
    color: #06b6d4;
    padding: 4px 14px;
    background: rgba(6, 182, 212, 0.12);
    border-radius: 8px;
    border: 1px solid rgba(6, 182, 212, 0.25);
    letter-spacing: 0.02em;
    transition: filter 0.25s ease;
}

.voice-target-word.masked {
    filter: blur(8px);
    user-select: none;
}

.voice-feedback-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: stretch;
}

.voice-transcript-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px 18px;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.voice-transcript-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
}

.voice-transcript-text {
    font-family: var(--font-mono, monospace);
    font-size: 1.05rem;
    color: var(--text-primary);
    min-height: 24px;
    display: flex;
    align-items: center;
}

.voice-gauge-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 10px 18px;
}

.voice-gauge-card .circular-gauge {
    position: relative;
    width: 82px;
    height: 82px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-gauge-card .gauge-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.voice-gauge-card .gauge-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 8;
}

[data-theme="light"] .voice-gauge-card .gauge-track {
    stroke: rgba(0, 0, 0, 0.08);
}

.voice-gauge-card .gauge-value {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 326.7;
    stroke-dashoffset: 326.7;
    transition: stroke-dashoffset 0.4s ease, stroke 0.4s ease;
}

.voice-gauge-card .gauge-center-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    pointer-events: none;
}

.voice-gauge-card .score-number {
    font-size: 1.25rem;
    font-weight: 800;
    font-family: var(--font-heading, var(--font-mono, sans-serif));
    color: var(--text-primary);
    line-height: 1;
}

.voice-gauge-card .score-unit {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1;
}

.voice-grade-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.76rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.voice-grade-badge.excellent {
    background: rgba(16, 185, 129, 0.16);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.voice-grade-badge.good {
    background: rgba(132, 204, 22, 0.16);
    color: #84cc16;
    border-color: rgba(132, 204, 22, 0.3);
}

.voice-grade-badge.imprecise {
    background: rgba(245, 158, 11, 0.16);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
}

.voice-grade-badge.fail {
    background: rgba(239, 68, 68, 0.16);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.voice-driving-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    padding: 8px 14px;
    border-radius: 8px;
    text-align: center;
}

.voice-driving-hint strong {
    color: var(--text-primary);
}

.voice-pause-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 13, 26, 0.88);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    z-index: 100;
}

.voice-pause-box {
    text-align: center;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px;
}

.voice-pause-box h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
}

.voice-pause-box p {
    font-size: 0.95rem;
    color: #94a3b8;
    margin: 0;
}

.voice-end-container {
    padding: 2.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 768px) {
    .voice-drill-container {
        padding: 16px;
    }
    .voice-source-word {
        font-size: 2.2rem;
    }
    .voice-feedback-row {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   STYLE BD - LE PROJET (CSS ONLY ARROWS)
   ========================================================================== */
.about-bd-section {
    margin: 4rem 0;
    position: relative;
}
.about-bd-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 4rem;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
}
.bd-container {
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    padding: 0 1rem;
}

/* Ligne centrale retirée, l'utilisateur a barré les cercles mais n'a pas redessiné de ligne centrale dans sa dernière capture */

.bd-panel {
    display: flex;
    width: 100%;
    position: relative;
    z-index: 2;
    margin-bottom: 3rem; /* Espace fixe entre les boîtes */
}
.bd-panel:last-child {
    margin-bottom: 0;
}

.bd-panel.left-align { justify-content: flex-start; }
.bd-panel.right-align { justify-content: flex-end; }

/* La bulle prend 45% de l'espace, laissant 10% au centre */
.bd-bubble {
    width: 45%;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 1.25rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    position: relative;
    z-index: 3;
}
.bd-bubble strong { color: var(--primary-color); }

/* ==========================================================
   FLÈCHES CSS (Gérées avec ::after pour la ligne et ::before pour la tête)
   ========================================================== */

/* Couleur des flèches (#5e95ff avec opacité ou juste primary color) */
:root {
    --bd-arrow-color: #6a9cff;
}

/* Flèche de Gauche à Droite (LTR) */
.has-ltr-arrow::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 45%;
    width: 32.5%;
    height: calc(50% + 3rem);
    border-top: 6px solid var(--bd-arrow-color);
    border-right: 6px solid var(--bd-arrow-color);
    border-top-right-radius: 16px;
    box-sizing: border-box;
    z-index: 1;
}
.has-ltr-arrow::before {
    content: '';
    position: absolute;
    top: calc(100% + 3rem);
    left: 77.5%;
    transform: translateX(-50%);
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 20px solid var(--bd-arrow-color);
    z-index: 4; /* Passe par-dessus la bordure de la boîte suivante ! */
}

/* Flèche de Droite à Gauche (RTL) */
.has-rtl-arrow::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 22.5%;
    width: 32.5%;
    height: calc(50% + 3rem);
    border-top: 6px solid var(--bd-arrow-color);
    border-left: 6px solid var(--bd-arrow-color);
    border-top-left-radius: 16px;
    box-sizing: border-box;
    z-index: 1;
}
.has-rtl-arrow::before {
    content: '';
    position: absolute;
    top: calc(100% + 3rem);
    left: 22.5%;
    transform: translateX(-50%);
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 20px solid var(--bd-arrow-color);
    z-index: 4;
}

/* Flèche RTL LONGUE (pour sauter le séparateur) */
.has-rtl-arrow-long {
    margin-bottom: 6rem; /* Plus d'espace pour le séparateur */
}
.has-rtl-arrow-long::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 22.5%;
    width: 32.5%;
    height: calc(50% + 6rem); /* S'adapte au margin-bottom */
    border-top: 6px solid var(--bd-arrow-color);
    border-left: 6px solid var(--bd-arrow-color);
    border-top-left-radius: 16px;
    box-sizing: border-box;
    z-index: 1;
}
.has-rtl-arrow-long::before {
    content: '';
    position: absolute;
    top: calc(100% + 6rem);
    left: 22.5%;
    transform: translateX(-50%);
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 20px solid var(--bd-arrow-color);
    z-index: 4;
}

/* Séparateur absolu dans la box 4 */
.bd-separator-abs {
    position: absolute;
    top: calc(100% + 2rem);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    z-index: 5;
}
.bd-grass {
    position: absolute;
    color: var(--success-color); /* Vert pour l'herbe */
    opacity: 0.5; /* Discret */
    z-index: 0;
    pointer-events: none;
}
.bd-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: var(--border-color);
    z-index: 0;
    opacity: 0.5;
}

.bd-grass {
    color: #22c55e !important;
    opacity: 1 !important;
}