.fvchk-app {
    --fvchk-bg: #0f172a;
    --fvchk-bg-panel: #16213a;
    --fvchk-bg-input: #1b2740;
    --fvchk-border: #2a3a5c;
    --fvchk-text: #e6ecf5;
    --fvchk-text-muted: #93a2c0;
    --fvchk-primary: #3b82f6;
    --fvchk-primary-hover: #2563eb;
    --fvchk-success: #22c55e;
    --fvchk-error: #ef4444;
    --fvchk-warning: #f59e0b;
    --fvchk-radius: 12px;

    background: var(--fvchk-bg);
    color: var(--fvchk-text);
    border-radius: var(--fvchk-radius);
    padding: 24px;
    max-width: 720px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.fvchk-app * { box-sizing: border-box; }
.fvchk-app .hidden { display: none !important; }

/* ── Header ─────────────────────────────────────────────────── */
.fvchk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}
.fvchk-header-left { display: flex; align-items: center; gap: 10px; }
.fvchk-logo-icon {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--fvchk-primary), #6366f1);
    border-radius: 9px;
    color: #fff;
}
.fvchk-title { font-size: 17px; font-weight: 600; color: var(--fvchk-text); }

.fvchk-lang-select select {
    background: var(--fvchk-bg-input);
    color: var(--fvchk-text);
    border: 1px solid var(--fvchk-border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
}

/* ── Onglets ────────────────────────────────────────────────── */
.fvchk-tabs {
    display: flex;
    gap: 6px;
    background: var(--fvchk-bg-input);
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 20px;
}
.fvchk-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--fvchk-text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.fvchk-tab:hover { color: var(--fvchk-text); }
.fvchk-tab.active {
    background: var(--fvchk-primary);
    color: #fff;
}

/* ── Panneaux ───────────────────────────────────────────────── */
.fvchk-panel { display: none; }
.fvchk-panel.active { display: block; }

.fvchk-label {
    display: block;
    font-size: 13px;
    color: var(--fvchk-text-muted);
    margin-bottom: 8px;
}

.fvchk-textarea, .fvchk-input {
    width: 100%;
    background: var(--fvchk-bg-input);
    border: 1px solid var(--fvchk-border);
    border-radius: 10px;
    color: var(--fvchk-text);
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    font-family: inherit;
}
.fvchk-textarea:focus, .fvchk-input:focus {
    outline: none;
    border-color: var(--fvchk-primary);
}

.fvchk-textarea-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    gap: 12px;
}
.fvchk-char-count { font-size: 12px; color: var(--fvchk-text-muted); }

.fvchk-btn-primary {
    background: var(--fvchk-primary);
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
    white-space: nowrap;
}
.fvchk-btn-primary:hover:not(:disabled) { background: var(--fvchk-primary-hover); }
.fvchk-btn-primary:disabled { opacity: .45; cursor: not-allowed; }

/* ── Résultat écrit ─────────────────────────────────────────── */
.fvchk-result { margin-top: 22px; }
.fvchk-result-summary {
    font-size: 14px;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 9px;
    margin-bottom: 16px;
}
.fvchk-result-summary.no-errors { background: rgba(34,197,94,.12); color: var(--fvchk-success); }
.fvchk-result-summary.has-errors { background: rgba(245,158,11,.12); color: var(--fvchk-warning); }

.fvchk-block { margin-bottom: 18px; }
.fvchk-block h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--fvchk-text-muted); margin: 0 0 10px; }

.fvchk-annotated {
    background: var(--fvchk-bg-input);
    border: 1px solid var(--fvchk-border);
    border-radius: 10px;
    padding: 14px;
    font-size: 14px;
    line-height: 1.7;
}
.fvchk-annotated mark.fvchk-err {
    background: rgba(239,68,68,.18);
    color: #fca5a5;
    border-bottom: 2px solid var(--fvchk-error);
    padding: 0 2px;
    border-radius: 3px;
    cursor: help;
}

.fvchk-error-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fvchk-error-item {
    background: var(--fvchk-bg-input);
    border: 1px solid var(--fvchk-border);
    border-radius: 10px;
    padding: 12px 14px;
}
.fvchk-error-type {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 6px;
}
.fvchk-type-orthographe { background: rgba(59,130,246,.15); color: #93c5fd; }
.fvchk-type-grammaire { background: rgba(245,158,11,.15); color: #fcd34d; }
.fvchk-type-conjugaison { background: rgba(168,85,247,.15); color: #d8b4fe; }

.fvchk-error-fix { display: block; font-size: 14px; margin: 4px 0; }
.fvchk-error-fix del { color: #f87171; text-decoration: line-through; }
.fvchk-error-fix ins { color: var(--fvchk-success); text-decoration: none; font-weight: 600; }
.fvchk-error-explanation { font-size: 13px; color: var(--fvchk-text-muted); margin: 4px 0 0; }

.fvchk-corrected-head { display: flex; align-items: center; justify-content: space-between; }
.fvchk-corrected-text {
    background: var(--fvchk-bg-input);
    border: 1px solid var(--fvchk-border);
    border-radius: 10px;
    padding: 14px;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}
.fvchk-copy-btn {
    display: flex; align-items: center; gap: 6px;
    background: transparent;
    border: 1px solid var(--fvchk-border);
    color: var(--fvchk-text-muted);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}
.fvchk-copy-btn:hover { color: var(--fvchk-text); border-color: var(--fvchk-primary); }

/* ── Oral ───────────────────────────────────────────────────── */
.fvchk-speech-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px 0;
}
.fvchk-mic-btn {
    width: 76px; height: 76px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--fvchk-primary), #6366f1);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 0 0 0 rgba(59,130,246,.5);
}
.fvchk-mic-btn svg { width: 30px; height: 30px; }
.fvchk-mic-btn:hover { transform: scale(1.05); }
.fvchk-mic-btn.recording {
    background: linear-gradient(135deg, var(--fvchk-error), #f97316);
    animation: fvchk-pulse 1.4s infinite;
}
@keyframes fvchk-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239,68,68,.45); }
    70% { box-shadow: 0 0 0 16px rgba(239,68,68,0); }
    100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
.fvchk-mic-label { font-size: 13px; color: var(--fvchk-text-muted); }

.fvchk-transcript-box {
    background: var(--fvchk-bg-input);
    border: 1px solid var(--fvchk-border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 18px;
}
.fvchk-transcript-box h4 { font-size: 13px; color: var(--fvchk-text-muted); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.fvchk-transcript-box p { font-size: 14px; margin: 0 0 12px; line-height: 1.5; }

.fvchk-scores { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.fvchk-score-item { display: grid; grid-template-columns: 100px 1fr 44px; align-items: center; gap: 10px; }
.fvchk-score-label { font-size: 13px; color: var(--fvchk-text-muted); }
.fvchk-score-bar { background: var(--fvchk-bg-input); border-radius: 6px; height: 8px; overflow: hidden; }
.fvchk-score-fill { height: 100%; background: linear-gradient(90deg, var(--fvchk-primary), #6366f1); border-radius: 6px; transition: width .4s ease; }
.fvchk-score-value { font-size: 13px; font-weight: 600; text-align: right; }

.fvchk-summary { font-size: 14px; line-height: 1.6; margin: 0 0 16px; }

.fvchk-tips-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fvchk-tips-list li {
    background: var(--fvchk-bg-input);
    border: 1px solid var(--fvchk-border);
    border-radius: 9px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.5;
}

.fvchk-disclaimer { font-size: 12px; color: var(--fvchk-text-muted); font-style: italic; margin-top: 14px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
    .fvchk-app { padding: 16px; }
    .fvchk-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .fvchk-lang-select select { width: 100%; }
    .fvchk-textarea-foot { flex-direction: column; align-items: stretch; }
    .fvchk-score-item { grid-template-columns: 80px 1fr 36px; }
}
