/* =====================================================================
   Charte reprise de la messagerie podologue.fr (même maquette, mêmes couleurs)
   ===================================================================== */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter-latin-wght-normal-Gz7AlRl.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter-latin-ext-wght-normal-1Br77OV.woff2") format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Couleurs : trois modes (Compte › Apparence), plus « Automatique » ----------
   <html data-theme="auto | clair | ardoise | nuit"> ; « auto » suit l'appareil (Clair ou Ardoise).
   Toute couleur passe par ces variables : aucune ne s'écrit en dur dans les règles. */
:root {
    color-scheme: light;
    --ink: #13262B;
    --muted: #5B6C6F;
    --faint: #8A999B;
    --line: #E1E6E3;
    --line-strong: #CFD7D3;
    --bg: #F3F5F2;
    --paper: #fff;
    --sunken: #FAFBFA;          /* zones en retrait : barres d'outils, liste de gauche */
    --hover: #F6F8F6;
    --hover-strong: #E9EDEA;
    --cobalt: #2F45C9;          /* liens, éléments actifs */
    --cobalt-dark: #22349E;     /* texte sur fond cobalt clair */
    --cobalt-soft: #E8EBFB;
    --cobalt-line: #CBD2F4;
    --cobalt-fill: #2F45C9;     /* boutons pleins */
    --cobalt-fill-hover: #22349E;
    --on-fill: #fff;
    --selection: #EEF1FC;
    --depot: #F7F8FE;
    --blush: #E0917A;
    --blush-soft: #FBEAE4;
    --blush-ink: #7A3A26;
    --blush-line: #F2CDBF;
    --danger: #A04A31;
    --ok: #237A4B;
    --ok-s: #DFF1E6;
    --ok-s-hover: #D2EBDC;
    --ok-line: #BFE0CB;
    --warn: #8C5E08;
    --warn-s: #FAEFD6;
    --warn-line: #EFD9A6;
    --teal: #22625F;
    --teal-s: #E0F1F0;
    --neutral: #4F5E61;
    --neutral-s: #E8ECEA;
    --neutral-s2: #EEF1EF;
    --switch-off: #C9D1CD;
    --knob: #fff;
    --scroll: #D3DAD6;
    --scroll-hover: #BCC6C1;
    --scroll-active: #98A6A0;
    --code-bg: rgba(19, 38, 43, .06);
    /* Éléments inversés : notification, filtre choisi, étiquette de glissement */
    --inverse: #13262B;
    --on-inverse: #fff;
    --inverse-muted: #B9C4C2;
    --inverse-accent: #AEB9F5;
    /* En-tête de la fenêtre d'écriture */
    --chrome: #13262B;
    --on-chrome: #fff;
    --overlay: rgba(19, 38, 43, .35);
    --shadow: rgba(19, 38, 43, .16);
    /* Pastilles des correspondants (texte, fond) */
    --av1-t: #2F45C9; --av1-f: #E8EBFB;
    --av2-t: #0E6E78; --av2-f: #DDF0F1;
    --av3-t: #8C5E08; --av3-f: #FAEFD6;
    --av4-t: #4F5E61; --av4-f: #E8ECEA;
    --av5-t: #A04A31; --av5-f: #FBEAE4;
    --font: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Sombre A « Ardoise » : les gris-verts de la charte, assombris */
:root[data-theme="ardoise"] {
    color-scheme: dark;
    --ink: #E4ECEA; --muted: #A3B5B3; --faint: #7F9492; --line: #25363A; --line-strong: #33474B;
    --bg: #0E1618; --paper: #152124; --sunken: #111C1F; --hover: #1B2A2E; --hover-strong: #22333A;
    --cobalt: #9AA7F8; --cobalt-dark: #C6CDFB; --cobalt-soft: #222C57; --cobalt-line: #3A4687;
    --cobalt-fill: #4458DC; --cobalt-fill-hover: #5568E4; --on-fill: #fff; --selection: #1E2850; --depot: #1A2446;
    --blush: #EBA58F; --blush-soft: #3C2721; --blush-ink: #F2BBA9; --blush-line: #5A3A30; --danger: #F0A994;
    --ok: #72CF9F; --ok-s: #16352B; --ok-s-hover: #1C4234; --ok-line: #24523F;
    --warn: #E7BE6C; --warn-s: #352A10; --warn-line: #5A4718;
    --teal: #79CEC9; --teal-s: #133633;
    --neutral: #B5C5C3; --neutral-s: #22333A; --neutral-s2: #1E2D31;
    --switch-off: #3A4C50; --knob: #E4ECEA;
    --scroll: #2C3D41; --scroll-hover: #3A4C50; --scroll-active: #52676B;
    --code-bg: rgba(255, 255, 255, .08);
    --inverse: #E4ECEA; --on-inverse: #0E1618; --inverse-muted: #5B6C6F; --inverse-accent: #2F45C9;
    --chrome: #22333A; --on-chrome: #E4ECEA;
    --overlay: rgba(0, 0, 0, .55); --shadow: rgba(0, 0, 0, .5);
    --av1-t: #9AA7F8; --av1-f: #222C57;
    --av2-t: #79CEC9; --av2-f: #133633;
    --av3-t: #E7BE6C; --av3-f: #352A10;
    --av4-t: #B5C5C3; --av4-f: #22333A;
    --av5-t: #F2BBA9; --av5-f: #3C2721;
}

/* Sombre B « Nuit » : bleu nuit profond, plus contrasté */
:root[data-theme="nuit"] {
    color-scheme: dark;
    --ink: #E8EBF7; --muted: #A7AECB; --faint: #7D84A6; --line: #232944; --line-strong: #313859;
    --bg: #0A0D18; --paper: #121627; --sunken: #0E1120; --hover: #191E33; --hover-strong: #20263F;
    --cobalt: #A3AFFF; --cobalt-dark: #C9D0FF; --cobalt-soft: #232A5C; --cobalt-line: #3C4690;
    --cobalt-fill: #4A5EE6; --cobalt-fill-hover: #5B6EF0; --on-fill: #fff; --selection: #202760; --depot: #1C2250;
    --blush: #EFA992; --blush-soft: #3D2623; --blush-ink: #F4C0AF; --blush-line: #5C3830; --danger: #F3AE99;
    --ok: #74D3A4; --ok-s: #13332B; --ok-s-hover: #1A4136; --ok-line: #22503E;
    --warn: #EBC272; --warn-s: #352C12; --warn-line: #5A4A1C;
    --teal: #7BD2CE; --teal-s: #11322F;
    --neutral: #B8BED8; --neutral-s: #20263F; --neutral-s2: #1B2037;
    --switch-off: #363D5E; --knob: #E8EBF7;
    --scroll: #262C47; --scroll-hover: #363D5E; --scroll-active: #4E5680;
    --code-bg: rgba(255, 255, 255, .08);
    --inverse: #E8EBF7; --on-inverse: #0A0D18; --inverse-muted: #5E6480; --inverse-accent: #2F45C9;
    --chrome: #20263F; --on-chrome: #E8EBF7;
    --overlay: rgba(0, 0, 0, .6); --shadow: rgba(0, 0, 0, .55);
    --av1-t: #A3AFFF; --av1-f: #232A5C;
    --av2-t: #7BD2CE; --av2-f: #11322F;
    --av3-t: #EBC272; --av3-f: #352C12;
    --av4-t: #B8BED8; --av4-f: #20263F;
    --av5-t: #F4C0AF; --av5-f: #3D2623;
}

/* « Automatique » : Ardoise quand l'appareil est en mode sombre (mêmes valeurs que plus haut) */
@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] {
        color-scheme: dark;
        --ink: #E4ECEA; --muted: #A3B5B3; --faint: #7F9492; --line: #25363A; --line-strong: #33474B;
        --bg: #0E1618; --paper: #152124; --sunken: #111C1F; --hover: #1B2A2E; --hover-strong: #22333A;
        --cobalt: #9AA7F8; --cobalt-dark: #C6CDFB; --cobalt-soft: #222C57; --cobalt-line: #3A4687;
        --cobalt-fill: #4458DC; --cobalt-fill-hover: #5568E4; --on-fill: #fff; --selection: #1E2850; --depot: #1A2446;
        --blush: #EBA58F; --blush-soft: #3C2721; --blush-ink: #F2BBA9; --blush-line: #5A3A30; --danger: #F0A994;
        --ok: #72CF9F; --ok-s: #16352B; --ok-s-hover: #1C4234; --ok-line: #24523F;
        --warn: #E7BE6C; --warn-s: #352A10; --warn-line: #5A4718;
        --teal: #79CEC9; --teal-s: #133633;
        --neutral: #B5C5C3; --neutral-s: #22333A; --neutral-s2: #1E2D31;
        --switch-off: #3A4C50; --knob: #E4ECEA;
        --scroll: #2C3D41; --scroll-hover: #3A4C50; --scroll-active: #52676B;
        --code-bg: rgba(255, 255, 255, .08);
        --inverse: #E4ECEA; --on-inverse: #0E1618; --inverse-muted: #5B6C6F; --inverse-accent: #2F45C9;
        --chrome: #22333A; --on-chrome: #E4ECEA;
        --overlay: rgba(0, 0, 0, .55); --shadow: rgba(0, 0, 0, .5);
        --av1-t: #9AA7F8; --av1-f: #222C57;
        --av2-t: #79CEC9; --av2-f: #133633;
        --av3-t: #E7BE6C; --av3-f: #352A10;
        --av4-t: #B5C5C3; --av4-f: #22333A;
        --av5-t: #F2BBA9; --av5-f: #3C2721;
    }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--cobalt); }
a:hover { color: var(--cobalt-dark); }

button, input, select, textarea { font: inherit; color: inherit; }

:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--cobalt);
    outline-offset: 2px;
    border-radius: 6px;
}

h1 { font-size: 24px; letter-spacing: -.02em; line-height: 1.25; margin: 0 0 6px; }
h2 { font-size: 17px; letter-spacing: -.01em; margin: 0 0 12px; }
p { margin: 0 0 12px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Logo ---------- */
.logo {
    display: inline-flex; align-items: baseline;
    font-weight: 800; letter-spacing: -.03em; font-size: 19px;
    text-decoration: none; color: var(--ink);
}
.logo:hover { color: var(--ink); }
.logo .dot {
    display: inline-block; width: .42em; height: .42em;
    background: var(--blush); border-radius: 50%; margin: 0 .06em;
}
.logo .tld { color: var(--muted); font-weight: 500; }
.logo .appname {
    margin-left: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0;
    color: var(--cobalt); background: var(--cobalt-soft);
    border-radius: 6px; padding: 2px 7px; align-self: center;
}

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid transparent; border-radius: 10px;
    padding: 10px 18px; font-weight: 600; font-size: 14.5px;
    text-decoration: none; cursor: pointer; line-height: 1.3;
}
.btn-primary { background: var(--cobalt-fill); color: var(--on-fill); }
.btn-primary:hover { background: var(--cobalt-fill-hover); color: var(--on-fill); }
.btn-secondary { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { background: var(--hover); color: var(--ink); }
.btn-danger { background: var(--paper); border-color: var(--blush-line); color: var(--blush-ink); }
.btn-danger:hover { background: var(--blush-soft); color: var(--blush-ink); }
.btn-small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; color: var(--cobalt); font-weight: 600; cursor: pointer; }

/* ---------- Formulaires ---------- */
.field { margin-bottom: 16px; }
.field label, .field legend { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.field .required-mark { color: var(--muted); font-weight: 400; }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
    width: 100%; height: 44px; padding: 0 14px;
    background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
    transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 100px; padding: 10px 14px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-soft);
}
.field input[readonly] { background: var(--bg); color: var(--muted); }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.field .errors { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; color: var(--blush-ink); font-weight: 500; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--blush); }
.field-check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 20px; }
.field-check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--cobalt); }
.field-check label { font-weight: 500; font-size: 14px; margin: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
fieldset { border: 0; margin: 0 0 8px; padding: 0; }
fieldset > legend { font-size: 15px; font-weight: 700; margin-bottom: 12px; padding: 0; }
.form-errors { margin-bottom: 16px; }

/* ---------- Messages ---------- */
.alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px; border: 1px solid transparent; }
.alert-success { background: var(--ok-s); color: var(--ok); border-color: var(--ok-line); }
.alert-error { background: var(--blush-soft); color: var(--blush-ink); border-color: var(--blush-line); }
.alert-info { background: var(--cobalt-soft); color: var(--cobalt-dark); border-color: var(--cobalt-line); }
.alert-warning { background: var(--warn-s); color: var(--warn); border-color: var(--warn-line); }
.alert strong { display: block; margin-bottom: 2px; }

/* ---------- Pastilles d'état ---------- */
.tag {
    display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
    font-size: 12px; font-weight: 600; border-radius: 6px; padding: 2px 8px;
    background: var(--neutral-s); color: var(--neutral);
}
.tag-ok { background: var(--ok-s); color: var(--ok); }
.tag-attente { background: var(--cobalt-soft); color: var(--cobalt); }
.tag-alerte { background: var(--blush-soft); color: var(--blush-ink); }
.tag-neutre { background: var(--neutral-s2); color: var(--muted); }

/* ---------- Pages d'accueil (connexion, inscription) ---------- */
.auth {
    min-height: 100vh; display: flex; flex-direction: column; align-items: center;
    padding: 48px 16px 32px;
}
.auth .logo { margin-bottom: 28px; font-size: 22px; }
.auth-card {
    width: 100%; max-width: 440px; background: var(--paper);
    border: 1px solid var(--line); border-radius: 18px;
    padding: 32px; box-shadow: 0 1px 2px rgba(19, 38, 43, .04);
}
.auth-card.large { max-width: 620px; }
.auth-card > p.muted { margin-bottom: 22px; }
.auth-foot { margin-top: 20px; font-size: 13px; color: var(--muted); text-align: center; max-width: 440px; }
.adresse-future {
    display: block; font-size: 18px; font-weight: 700; letter-spacing: -.01em;
    background: var(--cobalt-soft); color: var(--cobalt-dark);
    border-radius: 12px; padding: 12px 16px; margin: 8px 0 18px; word-break: break-all;
}
.etapes { list-style: none; padding: 0; margin: 18px 0 0; counter-reset: etape; }
.etapes li { position: relative; padding: 0 0 14px 38px; counter-increment: etape; }
.etapes li::before {
    content: counter(etape); position: absolute; left: 0; top: -1px;
    width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center; font-size: 13px; font-weight: 700;
    background: var(--bg); color: var(--muted);
}
.etapes li.fait::before { content: "✓"; background: var(--ok-s); color: var(--ok); }

.etapes-2fa li { padding-bottom: 22px; }
.qr { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.qr img { background: #fff; /* un QR code se lit sur fond blanc, quel que soit le mode */ border: 1px solid var(--line); border-radius: 12px; padding: 10px; width: 200px; height: 200px; box-sizing: content-box; }
.qr p { flex: 1; min-width: 180px; margin: 0; }
.secret { display: inline-block; margin-top: 6px; font-size: 14px; letter-spacing: .05em; word-break: break-all; }
.form-code { margin-top: 12px; max-width: 320px; }
.form-code input { font-size: 20px; letter-spacing: .2em; text-align: center; }
.codes-secours {
    list-style: none; padding: 0; margin: 18px 0 22px;
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.codes-secours code { display: block; text-align: center; font-size: 16px; padding: 8px; letter-spacing: .08em; }

@media print {
    .auth-foot, .auth .btn, .auth .alert { display: none; }
    .auth-card { border: 0; box-shadow: none; }
}

/* ---------- Espace connecté ---------- */
.top {
    height: 62px; display: flex; align-items: center; gap: 18px; padding: 0 20px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 10;
}
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13.5px; }
.me {
    width: 34px; height: 34px; border-radius: 50%; background: var(--cobalt-fill); color: var(--on-fill);
    display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none;
}
.bandeau-en-tant-que {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: var(--blush-soft); color: var(--blush-ink); border-bottom: 1px solid var(--blush-line);
    padding: 8px 20px; font-size: 13.5px;
}
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 62px); }
.side { padding: 18px 12px; }
.nav-t {
    font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--faint); margin: 8px 12px 6px;
}
.nav-i {
    display: flex; align-items: center; gap: 12px; border-radius: 10px;
    padding: 8px 12px; color: var(--ink); text-decoration: none;
}
.nav-i:hover { background: var(--hover-strong); color: var(--ink); }
.nav-i[aria-current="page"] { background: var(--cobalt-soft); color: var(--cobalt); font-weight: 600; }
.nav-i .n { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.nav-i[aria-current="page"] .n { color: var(--cobalt); }
.main { padding: 28px 32px 48px; min-width: 0; }
.main > * { max-width: 1040px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 2px 0 0; color: var(--muted); }

.panel {
    background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
    padding: 22px 24px; margin-bottom: 20px;
}
.panel > h2:first-child { margin-top: 0; }

.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--faint); padding: 12px 16px; border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table .actions form { margin: 0; }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

.verification-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.verification-tete h2 { margin: 0; }
.verification-tete p { margin: 2px 0 0; }
.fiche { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; margin: 0 0 18px; }
.fiche dt { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.fiche dd { margin: 2px 0 0; }
.verification-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.verification-actions form { margin: 0; }
.refus summary { list-style: none; }
.refus summary::-webkit-details-marker { display: none; }
.refus[open] { flex-basis: 100%; }
.refus[open] summary { margin-bottom: 12px; }
code { font-size: .92em; background: var(--code-bg); border-radius: 5px; padding: 1px 5px; }

.lien-secondaire { text-align: center; margin: 16px 0 0; font-size: 14px; }
.cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.cartes .panel { margin-bottom: 0; }
.form-etroit { max-width: 440px; }
.etat-securite { list-style: none; padding: 0; margin: 0 0 16px; }
.etat-securite li { padding: 6px 0 6px 26px; position: relative; }
.etat-securite li::before { position: absolute; left: 0; font-weight: 700; }
.etat-securite li.ok::before { content: "✓"; color: var(--ok); }
.etat-securite li.alerte::before { content: "!"; color: var(--blush-ink); left: 5px; }
.action-sensible summary { list-style: none; width: max-content; }
.action-sensible summary::-webkit-details-marker { display: none; }
.action-sensible[open] summary { margin-bottom: 12px; }

.form-inline { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 12px; align-items: end; }
.form-inline .field { margin-bottom: 0; }

/* Icônes en trait (mêmes tracés que le webmail) */
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: none; }

/* Interrupteur : case à cocher role="switch", libellé à gauche */
.interrupteur { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); }
.interrupteur:first-of-type { border-top: 0; }
.interrupteur label { font-weight: 600; font-size: 14px; margin: 0; cursor: pointer; }
.interrupteur label small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
input[type="checkbox"][role="switch"] {
    appearance: none; -webkit-appearance: none; flex: none; margin: 0; cursor: pointer;
    width: 38px; height: 22px; border-radius: 999px; background: var(--switch-off); position: relative; transition: background .15s;
}
input[type="checkbox"][role="switch"]::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
    background: var(--knob); box-shadow: 0 1px 2px rgba(19, 38, 43, .3); transition: transform .15s;
}
input[type="checkbox"][role="switch"]:checked { background: var(--cobalt-fill); }
input[type="checkbox"][role="switch"]:checked::after { transform: translateX(16px); background: var(--on-fill); }
input[type="checkbox"][role="switch"]:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    input[type="checkbox"][role="switch"], input[type="checkbox"][role="switch"]::after { transition: none; }
}

.signature-reglages { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.signature-reglages .panel { margin-bottom: 0; }
.signature-editeur-tete { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.signature-editeur-tete label { margin: 0; }
.signature-editeur textarea { font-family: var(--font); font-size: 15px; line-height: 1.7; min-height: 200px; }
.signature-quand h2 { margin-bottom: 4px; }

/* Aperçu sur téléphone */
.apercu-telephone { border: 0; border-radius: 20px; padding: 18px 20px 22px; max-width: calc(100vw - 32px); background: var(--bg); color: var(--ink); }
.apercu-telephone::backdrop { background: var(--overlay); }
.apercu-telephone-tete { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.apercu-telephone-tete h2 { margin: 0; }
.telephone { width: 340px; max-width: 100%; margin: 0 auto; border: 10px solid var(--chrome); border-radius: 34px; background: var(--paper); overflow: hidden; }
.telephone-ecran { height: 560px; max-height: 70vh; overflow-y: auto; padding: 18px 16px; font-size: 14px; line-height: 1.55; }
.telephone-ecran p { margin: 0 0 10px; }
.telephone-de { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.telephone-de small { display: block; color: var(--muted); font-size: 12.5px; }
.telephone-objet { font-weight: 700; font-size: 16px; }
.apercu-signature { font-family: var(--font); white-space: pre-wrap; overflow-wrap: anywhere; margin: 14px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }

/* Compte › Apparence : quatre cartes, chacune avec une miniature de ses couleurs
   (échantillons : leurs couleurs restent fixes, quel que soit le mode en cours) */
.themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.theme-choix { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); cursor: pointer; }
.theme-choix:hover { border-color: var(--cobalt-line); }
.theme-choix:has(input:checked) { border-color: var(--cobalt); box-shadow: 0 0 0 1px var(--cobalt); }
.theme-choix:has(input:focus-visible) { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.theme-choix input { position: absolute; z-index: 1; top: 20px; right: 20px; width: 18px; height: 18px; margin: 0; accent-color: var(--cobalt-fill); }
.theme-nom b { display: block; font-size: 14.5px; }
.theme-nom small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.theme-apercu { display: flex; flex-direction: column; height: 96px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--ta-fond); }
.ta-barre { height: 16px; background: var(--ta-papier); border-bottom: 1px solid var(--ta-filet); }
.ta-corps { flex: 1; display: flex; }
.ta-menu { width: 30%; padding: 8px 6px; display: flex; flex-direction: column; gap: 5px; }
.ta-menu i { height: 6px; border-radius: 3px; background: var(--ta-filet); }
.ta-menu i:first-child { background: var(--ta-cobalt); width: 80%; height: 9px; }
.ta-liste { flex: 1; background: var(--ta-papier); border-left: 1px solid var(--ta-filet); padding: 8px; display: flex; flex-direction: column; gap: 7px; }
.ta-liste i { height: 6px; border-radius: 3px; background: var(--ta-texte); opacity: .8; }
.ta-liste i:nth-child(2) { width: 70%; opacity: .45; }
.ta-liste i:nth-child(3) { width: 85%; opacity: .45; }
.t-clair { --ta-fond: #F3F5F2; --ta-papier: #FFFFFF; --ta-filet: #E1E6E3; --ta-texte: #13262B; --ta-cobalt: #2F45C9; }
.t-ardoise { --ta-fond: #0E1618; --ta-papier: #152124; --ta-filet: #25363A; --ta-texte: #E4ECEA; --ta-cobalt: #4458DC; }
.t-nuit { --ta-fond: #0A0D18; --ta-papier: #121627; --ta-filet: #232944; --ta-texte: #E8EBF7; --ta-cobalt: #4A5EE6; }
/* Automatique : moitié claire, moitié Ardoise */
.t-auto { --ta-fond: #F3F5F2; --ta-papier: #FFFFFF; --ta-filet: #E1E6E3; --ta-texte: #13262B; --ta-cobalt: #2F45C9; position: relative; }
.t-auto::after {
    content: ""; position: absolute; inset: 0; left: 50%;
    background: linear-gradient(#152124 0 16px, #0E1618 16px); border-left: 1px solid #25363A;
}

/* Autres moyens pendant la double authentification */
.insecable { white-space: nowrap; }
.deux-f-autres { margin-top: 14px; font-size: 14px; }
.deux-f-autres form { display: inline; }

/* Réponses rapides : exemples pour commencer, puis la bibliothèque (liste | réponse choisie) */
kbd { font: 600 11px ui-monospace, "SF Mono", Menlo, Consolas, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); background: var(--paper); }
.reponses-exemples { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.reponse-rapide { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.reponse-rapide h3 { margin: 0 0 8px; font-size: 15px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.reponse-rapide pre { font-family: var(--font); white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font-size: 13.5px; line-height: 1.5; background: var(--hover); border-radius: 10px; padding: 10px 12px; }

.biblio { display: grid; grid-template-columns: 300px minmax(0, 1fr); padding: 0; overflow: hidden; }
.biblio.biblio-seule { grid-template-columns: minmax(0, 1fr); }
.biblio-liste { background: var(--sunken); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.biblio-recherche { position: relative; margin: 0 4px 6px; }
.biblio-recherche .ic { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--faint); }
.biblio-recherche input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 0 12px 0 34px; }
.biblio-recherche input:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-soft); }
.biblio-rubrique { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 10px 12px 4px; }
.biblio-groupe ul { list-style: none; margin: 0; padding: 0; }
.biblio-groupe a { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.biblio-groupe a:hover { background: var(--hover-strong); color: var(--ink); }
.biblio-groupe a[aria-current="true"] { background: var(--paper); box-shadow: 0 0 0 1px var(--line), 0 4px 12px -8px var(--shadow); }
.biblio-groupe a[aria-current="true"] strong { color: var(--cobalt); }
.biblio-groupe strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.biblio-groupe small { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.biblio-aucune { margin: 8px 12px; }
.biblio-edition { padding: 20px 24px; min-width: 0; }
.biblio-titre { font-size: 17px; margin: 0 0 14px; overflow-wrap: anywhere; }
.biblio-ligne { display: grid; grid-template-columns: minmax(0, 1fr) 180px 160px; gap: 0 12px; }
.champ-prefixe { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding-left: 12px; transition: border-color .15s, box-shadow .15s; }
.champ-prefixe span { color: var(--muted); font-weight: 600; }
.field .champ-prefixe input:not([type=checkbox]) { border: 0; box-shadow: none; padding-left: 4px; background: transparent; }
.champ-prefixe:focus-within { border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-soft); }
.biblio-raccourci .help { white-space: normal; }
.biblio-champs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.biblio-champs .muted { margin-left: 6px; }
.biblio-champs .muted:first-child { margin-left: 0; }
.champ-puce {
    display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 8px; cursor: pointer;
    border: 1px dashed var(--cobalt-line); background: var(--paper); color: var(--cobalt-dark); font-size: 12.5px; font-weight: 600;
}
.champ-puce:hover { background: var(--cobalt-soft); }
.biblio-texte textarea { min-height: 190px; line-height: 1.7; font-size: 14.5px; }
.biblio-exemple { background: var(--bg); border-radius: 12px; padding: 12px 16px; font-size: 13.5px; line-height: 1.6; margin-bottom: 16px; }
.biblio-exemple > div { white-space: pre-wrap; overflow-wrap: anywhere; }
.biblio-exemple > div.vide { color: var(--muted); }
.biblio-exemple-titre { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.biblio-exemple mark { background: var(--cobalt-soft); color: var(--cobalt-dark); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.biblio-exemple mark.a-completer { background: var(--warn-s); color: var(--warn); }
.biblio-pied { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.biblio-pied > .muted { flex: 1 1 200px; }
.biblio-pied form { margin: 0; }

@media (max-width: 960px) {
    .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .signature-reglages { grid-template-columns: 1fr; }
    .biblio { grid-template-columns: 1fr; }
    .biblio-liste { border-right: 0; border-bottom: 1px solid var(--line); max-height: 320px; overflow-y: auto; }
    .biblio-ligne { grid-template-columns: 1fr 1fr; }
    .biblio-ligne > .field:first-child { grid-column: 1 / -1; }
    .shell { grid-template-columns: 1fr; }
    .side { display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--paper); }
    .side .nav-t { display: none; }
    .nav-i { white-space: nowrap; }
    .main { padding: 20px 16px 40px; }
    .form-inline { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .auth { padding-top: 28px; }
    .auth-card { padding: 22px 18px; border-radius: 14px; }
    .field-row { grid-template-columns: 1fr; }
    .top { gap: 10px; padding: 0 14px; }
    .top .logo .appname, .top .logo .tld, .top-right .qui { display: none; }
}
