/* Traducteur FR ⇄ ZGH — styles de l'outil (chartre commune : CSS vanilla,
   gradient #2c3e50/#34495e, police Pointu pour le Tifinagh).
   Layout deux panneaux type Google Translate, responsive (empilé < 768px). */

.trad-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* L'attribut hidden doit TOUJOURS gagner sur les display:flex/block des
   classes (sinon « Merci », suggestion et toolbar restent visibles). */
.trad-container [hidden] { display: none !important; }

/* ---- Barre du haut : logo à gauche, compte Google à droite ---- */
.trad-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 0;
}
.trad-account-zone {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
}

/* ---- Logo « ⵉⵎⴰⵙⵙⵏ translate » (identité du site : police Pointu) ---- */
.trad-logo {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0;
    font-weight: 600;
}
.trad-logo-name {
    font-family: 'Pointu', 'Segoe UI', sans-serif;
    font-size: 1.25em;
    color: #2c3e50;
}
.trad-logo-translate {
    font-family: inherit;
    font-size: 0.95em;
    font-weight: 400;
    color: #718096;
}

/* ---- Panneau principal ---- */
.trad-panel {
    margin-top: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 5px rgba(44, 62, 80, 0.08);
    overflow: visible;
}

/* ---- Barre de langues ---- */
.trad-langbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: nowrap;
    overflow-x: auto;
}
.trad-langbar-side {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}
.trad-langbar-target { justify-content: flex-start; }

.trad-lang-chip {
    border: none;
    background: none;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: background 0.15s, color 0.15s;
}
.trad-lang-chip:hover { background: #edf2f7; }
.trad-lang-chip.active {
    color: #2c3e50;
    border-bottom-color: #2c3e50;
    background: #ebf2f8;
}
/* En mode auto : la langue effectivement détectée est soulignée en pointillé */
.trad-lang-chip.detected { border-bottom-color: #a0aec0; border-bottom-style: dashed; }
.trad-lang-chip-target { cursor: default; }

.trad-swap-btn {
    font-size: 1.25em;
    padding: 6px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    flex: 0 0 auto;
    transition: background 0.15s, transform 0.15s;
}
.trad-swap-btn:hover { background: #edf2f7; transform: scale(1.08); }

.trad-variant-select {
    padding: 6px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    background: #fff;
    color: #2c3e50;
    max-width: 160px;
}

/* ---- Compte Google ---- */
.trad-gsi-btn { flex: 0 0 auto; }
.trad-account {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 4px 2px 2px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f7fafc;
}
.trad-account-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}
.trad-account-name {
    font-size: 0.85em;
    color: #2c3e50;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 768px) {
    .trad-account-name { display: none; }
}

/* ---- Espace compte : déclencheur + panneau (dropdown) ---- */
.trad-account-zone { position: relative; }

.trad-account-trigger {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    background: #f7fafc;
    border-radius: 999px;
    padding: 3px 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.trad-account-trigger:hover { background: #edf2f7; border-color: #cbd5e0; }
.trad-account-anon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px;
    color: #2c3e50;
    font-size: 0.9em;
    font-weight: 600;
}
.trad-account-icon { font-size: 1.05em; }
.trad-account-caret { color: #718096; font-size: 0.8em; margin-inline-start: 2px; }
@media (max-width: 768px) {
    .trad-account-anon-label { display: none; }
}

.trad-account-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1200;
    width: 340px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(44, 62, 80, 0.18);
    padding: 16px;
    text-align: start;
}

.trad-ap-head { margin-bottom: 12px; }
.trad-ap-userbox { display: flex; align-items: center; gap: 10px; }
.trad-ap-avatar { width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto; }
.trad-ap-idents { min-width: 0; }
.trad-ap-name { font-weight: 600; color: #2c3e50; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trad-ap-email { font-size: 0.85em; color: #718096; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trad-ap-anon-title { font-weight: 600; color: #2c3e50; font-size: 1.05em; }
.trad-ap-anon-sub { font-size: 0.85em; color: #718096; margin-top: 2px; }

/* Plan + jauges */
.trad-ap-usage {
    background: #f7fafc;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.trad-ap-usage-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.trad-ap-plan-badge {
    font-size: 0.82em;
    font-weight: 600;
    color: #2c3e50;
    background: #e2e8f0;
    border-radius: 999px;
    padding: 3px 10px;
}
.trad-ap-reset { font-size: 0.75em; color: #a0aec0; }
.trad-ap-gauge {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin-top: 6px;
}
.trad-ap-gauge-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 999px;
    transition: width 0.3s ease;
}
.trad-ap-gauge-fill.warn { background: linear-gradient(135deg, #dd6b20, #ed8936); }
.trad-ap-gauge-fill.full { background: linear-gradient(135deg, #c53030, #e53e3e); }
.trad-ap-gauge-label { font-size: 0.78em; color: #718096; margin: 3px 0 4px; }

.trad-ap-section { margin-top: 4px; }
.trad-ap-hint { font-size: 0.85em; color: #718096; margin: 0 0 10px; }
.trad-ap-block { width: 100%; justify-content: center; }

/* Bloc abonnement Premium (offre + badge abonné) */
.trad-ap-premium {
    border: 1px solid #ecd9a6;
    background: linear-gradient(135deg, #fffdf6, #fdf6e3);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.trad-ap-premium-head { font-weight: 700; color: #7a5b12; font-size: 0.98em; }
.trad-ap-premium-price { font-size: 0.9em; font-weight: 600; color: #9a7b1c; margin: 2px 0; }
.trad-ap-ttc { font-size: 0.78em; font-weight: 500; color: #b09a5c; }
.trad-ap-premium-sub { font-size: 0.82em; color: #8a7a4e; margin: 2px 0 10px; }
.trad-ap-offers .trad-ap-premium:last-child { margin-bottom: 10px; }
.trad-ap-premium-cta {
    background: linear-gradient(135deg, #d4a017, #b8860b);
    color: #fff;
    border: none;
}
.trad-ap-premium-on { text-align: center; }
.trad-ap-premium-badge {
    display: inline-block;
    font-size: 0.82em;
    font-weight: 700;
    color: #7a5b12;
    background: #f3e3b3;
    border: 1px solid #e4cf8f;
    border-radius: 999px;
    padding: 3px 12px;
    margin-bottom: 4px;
}

/* Bloc Google + séparateur */
.trad-ap-google { display: flex; justify-content: center; min-height: 40px; margin-bottom: 4px; }
.trad-ap-sep {
    display: flex;
    align-items: center;
    text-align: center;
    color: #a0aec0;
    font-size: 0.8em;
    margin: 10px 0;
}
.trad-ap-sep::before, .trad-ap-sep::after {
    content: "";
    flex: 1;
    border-top: 1px solid #e2e8f0;
}
.trad-ap-sep span { padding: 0 10px; }

/* Onglets connexion / inscription */
.trad-ap-tabs {
    display: flex;
    gap: 4px;
    background: #edf2f7;
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 10px;
}
.trad-ap-tab {
    flex: 1;
    border: none;
    background: none;
    padding: 7px 8px;
    border-radius: 6px;
    font-size: 0.88em;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.trad-ap-tab.active { background: #fff; color: #2c3e50; box-shadow: 0 1px 3px rgba(44, 62, 80, 0.12); }

.trad-ap-form { display: flex; flex-direction: column; gap: 8px; }
.trad-ap-input {
    box-sizing: border-box;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 0.95em;
    font-family: inherit;
}
.trad-ap-input:focus { outline: none; border-color: #34495e; box-shadow: 0 0 0 2px rgba(52, 73, 94, 0.15); }
.trad-ap-msg { font-size: 0.85em; padding: 8px 10px; border-radius: 8px; }
.trad-ap-msg.ok  { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }
.trad-ap-msg.err { background: #fff5f5; color: #c53030; border: 1px solid #feb2b2; }
.trad-ap-link {
    border: none;
    background: none;
    color: #34495e;
    text-decoration: underline;
    font-size: 0.85em;
    cursor: pointer;
    padding: 4px;
}

/* Toast (retour de validation email) */
.trad-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 20px);
    z-index: 2000;
    max-width: 90vw;
    padding: 12px 18px;
    border-radius: 10px;
    color: #fff;
    font-size: 0.92em;
    background: #2c3e50;
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
}
.trad-toast.show { opacity: 1; transform: translate(-50%, 0); }
.trad-toast.ok  { background: #276749; }
.trad-toast.err { background: #c53030; }

@media (max-width: 768px) {
    .trad-account-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
        overflow-y: auto;
    }
}

/* ---- Deux panneaux saisie | traduction ---- */
.trad-boxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.trad-box {
    display: flex;
    flex-direction: column;
    min-height: 220px;
    padding: 14px 16px 8px;
}
.trad-box-source { border-right: 1px solid #e2e8f0; }
.trad-box-target { background: #f7fafc; border-radius: 0 0 14px 0; }

.trad-box-source textarea {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    border: none;
    background: none;
    resize: none;
    font-size: 1.35em;
    line-height: 1.5;
    font-family: inherit;
    color: #1a202c;
    min-height: 150px;
}
.trad-box-source textarea:focus { outline: none; }
.trad-box-source textarea.tifinagh-input { font-family: 'Pointu', sans-serif; }

.trad-output-head {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    min-height: 22px;
}

.trad-result-text {
    flex: 1;
    font-size: 1.35em;
    line-height: 1.5;
    color: #1a202c;
    word-break: break-word;
    min-height: 110px;
}
.tifinagh-text { font-family: 'Pointu', sans-serif; }

/* ---- Translittérations ---- */
.trad-translit-box {
    margin: 6px 0;
    padding: 8px 12px;
    border-radius: 8px;
    background: #eef2f6;
    color: #4a5568;
    font-size: 1.05em;
    line-height: 1.5;
    word-break: break-word;
}
.trad-translit-arab { font-size: 1.2em; }
.trad-translit-tag {
    display: inline-block;
    margin-inline-end: 8px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #dde5ec;
    color: #718096;
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

/* ---- Pieds de box / barres d'outils ---- */
.trad-box-footer {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 0 4px;
    border-top: 1px solid #e8edf2;
    margin-top: 8px;
}
.trad-box-footer-spacer { flex: 1; }
.trad-charcount { color: #a0aec0; font-size: 0.8em; }

.trad-icon-btn {
    border: none;
    background: none;
    font-size: 1.05em;
    padding: 8px 10px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 8px;
    color: #4a5568;
    cursor: pointer;
    transition: background 0.15s;
}
.trad-icon-btn:hover:not(:disabled) { background: #e2e8f0; }
.trad-icon-btn:disabled { opacity: 0.4; cursor: default; }
.trad-icon-btn.selected { background: #ebf8ff; box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.25); }
/* Toggles (translit / correspondance) actifs */
.trad-icon-btn.on { background: #2c3e50; color: #fff; }
.trad-icon-btn.on .tifinagh-text { color: #fff; }
.trad-icon-btn .tifinagh-text { font-size: 0.95em; }

.trad-spinner { color: #718096; }

.trad-status {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.8em;
    background: #edf2f7;
    color: #4a5568;
}
.trad-status-complete { background: #f0fff4; color: #276749; }
.trad-status-partial  { background: #fffaf0; color: #975a16; }
.trad-status-stub     { background: #fff5f5; color: #c53030; }

/* ---- Erreurs / merci ---- */
.trad-error {
    margin: 12px 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
}
.trad-fb-thanks {
    display: block;
    margin: 6px 16px;
    color: #276749;
    font-size: 0.9em;
}

/* ---- Correspondance des fragments ---- */
.trad-align-section {
    margin: 4px 16px 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}
.trad-align-section h3 { color: #2c3e50; font-size: 1em; margin: 0 0 10px; }
.trad-hint { font-weight: normal; color: #a0aec0; font-size: 0.85em; }

/* Deux colonnes miroir des boxes de traduction : source | cible. */
.trad-align-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}
.trad-align-col { min-width: 0; }
.trad-align-col + .trad-align-col {
    border-left: 1px solid #e2e8f0;
    padding-left: 16px;
}
.trad-align-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a0aec0;
}
.trad-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.trad-chip {
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(44, 62, 80, 0.15);
    background: #f7fafc; /* fond neutre, remplacé par la couleur du groupe d'alignement */
    cursor: default;
    transition: box-shadow 0.1s, border-color 0.1s;
    font-size: 1.05em;
    color: #1a202c;
}
/* Survol/toucher : on accentue le groupe (le fond reste la couleur du groupe) */
.trad-chip.linked {
    border-color: #2c3e50;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.35);
}
/* Insertion cible sans source (particules ⴰⵔ, articles…) */
.trad-chip-inserted { border-style: dashed; color: #718096; }
/* Token source absorbé (réfléchi, copule fusionnée…) : pas de segment cible propre */
.trad-chip-absorbed { border-style: dotted; color: #a0aec0; }
/* Fragment avec alternatives sélectionnables (champ moteur optionnel) */
.trad-chip-alts { cursor: pointer; }
.trad-chip-caret { color: #718096; font-size: 0.85em; }

/* Menu d'alternatives */
.trad-alt-menu {
    position: absolute;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    min-width: 120px;
    background: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(44, 62, 80, 0.18);
    overflow: hidden;
}
.trad-alt-item {
    border: none;
    background: none;
    text-align: start;
    padding: 8px 14px;
    font-size: 1.05em;
    font-family: inherit;
    cursor: pointer;
}
.trad-alt-item:hover { background: #edf2f7; }
.trad-alt-item.current { color: #a0aec0; }

/* ---- Suggestion ---- */
.trad-suggest-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 16px 14px;
    flex-wrap: wrap;
}
.trad-suggest-label {
    flex-basis: 100%;
    color: #718096;
    font-size: 0.9em;
}
.trad-suggest-box textarea {
    flex: 1;
    min-width: 200px;
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 1.05em;
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    resize: vertical;
}
.trad-suggest-box textarea:focus { outline: none; border-color: #34495e; }
.trad-suggest-box textarea.tifinagh-input { font-family: 'Pointu', sans-serif; }

.trad-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    font-size: 1.05em;
    color: #fff;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
}
.trad-btn:hover:not(:disabled) { transform: translateY(-1px); opacity: 0.92; }
.trad-btn:disabled { opacity: 0.5; cursor: wait; }
.trad-btn-small { padding: 8px 16px; font-size: 0.95em; }

/* ---- Mobile (empilé, cibles tactiles plus grandes) ---- */
@media (max-width: 768px) {
    .trad-container { padding: 10px; }
    .trad-boxes { grid-template-columns: 1fr; }
    .trad-box-source {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    .trad-box { min-height: 150px; }
    .trad-box-source textarea { min-height: 90px; font-size: 1.2em; }
    .trad-result-text { min-height: 70px; font-size: 1.2em; }
    .trad-langbar { padding: 6px 8px; }
    .trad-lang-chip { padding: 10px 10px; font-size: 0.88em; }
    .trad-icon-btn { min-width: 44px; min-height: 44px; }
    /* Correspondance : colonnes empilées sur mobile (comme les boxes). */
    .trad-align-cols { grid-template-columns: 1fr; gap: 12px 0; }
    .trad-align-col + .trad-align-col {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #e2e8f0;
        padding-top: 12px;
    }
}

/* ---- Typographie MOBILE : les tailles em se calent sur le conteneur —
   sans réduction de la base, les libellés gardent leur taille desktop
   (retour utilisateur : « Détection automatique » etc. trop grands). ---- */
@media (max-width: 768px) {
    .trad-container { font-size: 15px; }
    .trad-logo-name { font-size: 1.15em; }
    .trad-logo-translate { font-size: 0.85em; }
    .trad-lang-chip { font-size: 0.85em; padding: 9px 8px; }
    .trad-swap-btn { font-size: 1.1em; padding: 5px 10px; }
    .trad-variant-select { font-size: 0.85em; padding: 5px 8px; }
    .trad-legal-line { font-size: 0.78em; }
    .trad-status { font-size: 0.75em; }
    .trad-charcount { font-size: 0.75em; }
    .trad-translit-box { font-size: 0.95em; }
}

@media (max-width: 480px) {
    .trad-container { font-size: 14px; }
    .trad-variant-select { max-width: 110px; font-size: 0.8em; }
    .trad-lang-chip { padding: 9px 6px; font-size: 0.8em; }
    .trad-logo-name { font-size: 1.05em; }
    .trad-account-panel { padding: 12px; }
}

/* ---- Zone de facturation (TVA) dans le bloc d'offres ---- */
.trad-ap-zone { margin-bottom: 10px; }
.trad-ap-zone-label {
    display: block;
    font-size: 0.8em;
    color: #718096;
    margin-bottom: 4px;
}
.trad-ap-zone-select { width: 100%; }

/* ---- Maroc : due diligence TVA B2B (questionnaire progressif) ---- */
.trad-ap-ma {
    border: 1px solid #d7e3ef;
    background: #f7fafc;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.trad-ap-ma-q { margin-bottom: 8px; }
.trad-ap-ma-q:last-child { margin-bottom: 0; }
.trad-ap-ma-label {
    display: block;
    font-size: 0.8em;
    color: #4a5568;
    font-weight: 600;
    margin-bottom: 4px;
}
.trad-ap-ma-opt {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85em;
    color: #2d3748;
    margin-right: 14px;
    cursor: pointer;
}
.trad-ap-ma-hint { font-size: 0.76em; color: #718096; margin-top: 4px; }

/* ---- Résiliation « en un clic » (bouton bien visible) ---- */
.trad-ap-cancel-btn {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
    font-weight: 600;
    margin-bottom: 8px;
}
.trad-ap-cancel-btn:hover { background: #fed7d7; }
.trad-ap-reactivate-btn {
    background: #f0fff4;
    color: #276749;
    border: 1px solid #c6f6d5;
    font-weight: 600;
    margin-bottom: 8px;
}
.trad-ap-reactivate-btn:hover { background: #c6f6d5; }
.trad-ap-cancel-notice {
    font-size: 0.82em;
    color: #c53030;
    font-weight: 600;
    margin: 4px 0 6px;
}
/* Crédit ponctuel : « Valable jusqu'au … » (bloc actif). */
.trad-ap-credit-info {
    font-size: 0.82em;
    color: #2f855a;
    font-weight: 600;
    margin: 4px 0 8px;
}
/* Mention de renonciation au droit de rétractation, sous le bouton d'achat. */
.trad-ap-fineprint {
    font-size: 0.72em;
    color: #8a7a4e;
    line-height: 1.35;
    margin: 6px 0 2px;
}

/* ==========================================================================
   Ligne d'information légale (sous la zone de saisie du traducteur)
   ========================================================================== */
.trad-legal-line {
    margin: 12px 4px 0;
    padding: 10px 14px;
    font-size: 0.82em;
    line-height: 1.5;
    color: #718096;
    background: #f7fafc;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    text-align: center;
}
.trad-legal-line a,
.trad-legal-line button.trad-legal-inline-link {
    color: #34495e;
    text-decoration: underline;
    font-weight: 600;
    white-space: nowrap;
}
.trad-legal-line button.trad-legal-inline-link {
    border: none;
    background: none;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
}
.trad-legal-line .trad-legal-sep { color: #cbd5e0; padding: 0 4px; }

/* ==========================================================================
   Modale « Formulaire de contact »
   ========================================================================== */
/* La modale vit HORS de .trad-container (overlay plein écran) : la règle
   scopée .trad-container [hidden] ne la couvre pas — il faut la sienne,
   sinon display:flex écrase l'attribut hidden et elle reste figée à l'écran. */
.trad-modal-overlay[hidden] { display: none !important; }

.trad-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(26, 32, 44, 0.55);
}
.trad-modal {
    width: 460px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(44, 62, 80, 0.32);
    padding: 20px;
    text-align: start;
}
.trad-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}
.trad-modal-title { margin: 0; font-size: 1.15em; color: #2c3e50; font-weight: 700; }
.trad-modal-close {
    border: none;
    background: none;
    font-size: 1.4em;
    line-height: 1;
    color: #718096;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 8px;
}
.trad-modal-close:hover { background: #edf2f7; }
.trad-modal-sub { font-size: 0.86em; color: #718096; margin: 0 0 14px; }
.trad-modal-form { display: flex; flex-direction: column; gap: 10px; }
.trad-modal-form label { font-size: 0.82em; font-weight: 600; color: #4a5568; }
.trad-modal-form textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 120px;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 0.95em;
    font-family: inherit;
    resize: vertical;
}
.trad-modal-form textarea:focus,
.trad-modal-form .trad-ap-input:focus {
    outline: none;
    border-color: #34495e;
    box-shadow: 0 0 0 2px rgba(52, 73, 94, 0.15);
}

@media (max-width: 768px) {
    .trad-legal-line .trad-legal-sep { padding: 0 2px; }
}

/* ==========================================================================
   Pages légales publiées (CGU, Confidentialité, Mentions légales)
   ========================================================================== */
.trad-legal {
    max-width: 820px;
    margin: 24px auto 48px;
    padding: 0 20px;
    color: #2d3748;
    line-height: 1.65;
}
.trad-legal-back {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 0.9em;
    color: #34495e;
    text-decoration: none;
}
.trad-legal-back:hover { text-decoration: underline; }
.trad-legal h1 {
    font-size: 1.7em;
    color: #2c3e50;
    margin: 8px 0 4px;
    line-height: 1.25;
}
.trad-legal h2 {
    font-size: 1.25em;
    color: #2c3e50;
    margin: 30px 0 10px;
    padding-top: 12px;
    border-top: 1px solid #edf2f7;
}
.trad-legal h3 { font-size: 1.05em; color: #34495e; margin: 20px 0 8px; }
.trad-legal p { margin: 10px 0; }
.trad-legal ul { margin: 10px 0; padding-inline-start: 22px; }
.trad-legal li { margin: 5px 0; }
.trad-legal a { color: #2b6cb0; }
.trad-legal strong { color: #1a202c; }
.trad-legal code {
    background: #edf2f7;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.88em;
}
.trad-legal-meta {
    font-size: 0.85em;
    color: #718096;
    margin-bottom: 8px;
}
.trad-legal-note {
    background: #fffaf0;
    border: 1px solid #feebc8;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.9em;
    color: #7b5310;
    margin: 16px 0;
}
.trad-legal-table-wrap { overflow-x: auto; margin: 14px 0; }
.trad-legal table {
    border-collapse: collapse;
    width: 100%;
    min-width: 480px;
    font-size: 0.9em;
}
.trad-legal th, .trad-legal td {
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    text-align: start;
    vertical-align: top;
}
.trad-legal th { background: #f7fafc; color: #2c3e50; font-weight: 600; }
.trad-legal-footer {
    margin-top: 36px;
    padding-top: 14px;
    border-top: 1px solid #edf2f7;
    font-size: 0.8em;
    color: #a0aec0;
}
.trad-legal-footer a { color: #718096; }
@media (max-width: 768px) {
    .trad-legal { padding: 0 14px; }
    .trad-legal h1 { font-size: 1.45em; }
    .trad-legal h2 { font-size: 1.15em; }
}

/* ---- Bouton conversion z2ⵣ : affiche la transcription latine sous les touches
   du clavier tifinagh + convertit la saisie latine en tifinagh (Ctrl+E).
   Piloté par TifinaghConversion (base_withTifKeyboard) ; VERT quand actif. ---- */
.conversion-toggle-btn .conversion-text { font-weight: 600; font-size: 0.9em; }
.conversion-toggle-btn.active,
.conversion-toggle-btn.active:hover { background: #27ae60; color: #fff; }
.conversion-toggle-btn.active .conversion-text { color: #fff; }
