/* =========================================================================
   Espace client Virtual Mail : UN SEUL habillage pour toutes les pages du menu
   (index.html : courrier, nuage, contacts, profil, recommandations ; settings.html :
   reglages, abonnement). Refonte du 05/11/2026 (demande de Yitzhak « מסודר, נעים
   לעין », GO Yossef Haim : « meme apparence partout, couleurs du site email36,
   magnifique »).

   Couleurs = celles du site public email36.com : bleu nuit du bandeau d'accueil,
   bordeaux des boutons d'action et du bouclier, or du logo. Polices maison : Fredoka
   (titres) + Rubik (texte).

   La DISPOSITION des ecrans ne change pas (menu, liste des rubriques, grille de cases,
   ordre des rubriques et des lignes) : cette feuille, chargee APRES les styles propres
   a chaque page, ne touche que la presentation. Aucun reglage ne change de comportement.
   Portee : body.vm-ui (pose en dur dans le HTML, pas par script : pas de flash).
   ========================================================================= */

.vm-ui {
    /* Marque */
    --vm-navy-900: #19213f;
    --vm-navy-800: #1f2a52;
    --vm-navy-700: #2a3866;
    --vm-navy-100: #e7eaf4;
    --vm-wine-800: #66142b;
    --vm-wine-700: #7d1a35;
    --vm-wine-600: #8e2141;
    --vm-gold-500: #c9a227;
    --vm-gold-400: #e2bb3f;
    --vm-gold-700: #7c5d0d;

    /* Surfaces et encres (clair) */
    --st-bg: #f4f3f0;
    --st-surface: #ffffff;
    --st-band: #faf9f6;
    --st-fill: #f1efea;
    --st-line: #e8e4dd;
    --st-line-strong: #d5cfc4;
    --st-ink: #19213f;
    --st-ink-2: #4a5272;
    --st-ink-3: #666d87;
    --st-accent: var(--vm-wine-600);
    --st-accent-hover: var(--vm-wine-800);
    --st-accent-text: var(--vm-wine-700);
    --st-accent-soft: rgba(142, 33, 65, .075);
    --st-accent-line: rgba(142, 33, 65, .3);
    --st-ring: rgba(42, 56, 102, .3);
    --st-navy-soft: rgba(42, 56, 102, .07);
    --st-gold-soft: #fbf3dc;
    --st-danger: #b3261e;
    --st-danger-line: rgba(179, 38, 30, .32);
    --st-danger-soft: rgba(179, 38, 30, .07);
    --st-warn-ink: #8a560a;
    --st-warn-soft: #fdf5e4;
    --st-warn-line: rgba(201, 162, 39, .38);
    --st-ok-ink: #17693b;
    --st-ok-soft: rgba(23, 105, 59, .09);
    --st-toggle-off: #cdc7bd;
    --st-radius: 18px;
    --st-radius-md: 13px;
    --st-radius-sm: 10px;
    --st-shadow: 0 1px 2px rgba(25, 33, 63, .05), 0 12px 32px -20px rgba(25, 33, 63, .22);
    --st-shadow-float: 0 2px 6px rgba(25, 33, 63, .08), 0 22px 50px -14px rgba(25, 33, 63, .32);
    --st-head-bg: #1f2a52;
    --st-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23666d87' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --st-chevron-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23ffffff' stroke-opacity='.8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

    /* Les anciennes variables des deux pages suivent le meme systeme. */
    --primary: var(--vm-wine-600);
    --primary-dark: var(--vm-wine-800);
    --primary-light: #a63356;
    --primary-50: #f9eef1;
    --primary-100: #f2dbe2;
    --primary-600: var(--vm-wine-600);
    --ring: 0 0 0 3px var(--st-ring);
    --app-bg: var(--st-bg);
    --surface: var(--st-surface);
    --line: var(--st-line);
    --line-soft: var(--st-line);
    --bg-primary: var(--st-surface);
    --bg-secondary: var(--st-band);
    --bg-tertiary: var(--st-fill);
    --border-color: var(--st-line);
    --text-primary: var(--st-ink);
    --text-secondary: var(--st-ink-2);
    --text-muted: var(--st-ink-3);
    --sh-accent: var(--vm-wine-600);
    --sh-accent-soft: var(--st-accent-soft);

    background: var(--st-bg);
    color: var(--st-ink);
    font-family: 'Rubik', system-ui, sans-serif;
    caret-color: var(--vm-wine-600);
    accent-color: var(--vm-wine-600);
}

@media (prefers-color-scheme: dark) {
    .vm-ui {
        --st-bg: #0c1124;
        --st-surface: #141b35;
        --st-band: #11182f;
        --st-fill: #1c2442;
        --st-line: #232c4b;
        --st-line-strong: #343f67;
        --st-ink: #eceef7;
        --st-ink-2: #b9bfd6;
        --st-ink-3: #9198b5;
        --st-accent: #a52a4d;
        --st-accent-hover: #bb3359;
        --st-accent-text: #f2a0b7;
        --st-accent-soft: rgba(242, 160, 183, .12);
        --st-accent-line: rgba(242, 160, 183, .35);
        --st-ring: rgba(160, 176, 240, .42);
        --st-navy-soft: rgba(160, 176, 240, .1);
        --st-gold-soft: rgba(226, 187, 63, .1);
        --st-danger: #f4978e;
        --st-danger-line: rgba(244, 151, 142, .38);
        --st-danger-soft: rgba(244, 151, 142, .1);
        --st-warn-ink: #eec65f;
        --st-warn-soft: rgba(238, 198, 95, .08);
        --st-warn-line: rgba(238, 198, 95, .28);
        --st-ok-ink: #72dca0;
        --st-ok-soft: rgba(114, 220, 160, .1);
        --st-toggle-off: #3a4468;
        --st-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -20px rgba(0, 0, 0, .7);
        --st-shadow-float: 0 2px 8px rgba(0, 0, 0, .4), 0 22px 50px -12px rgba(0, 0, 0, .75);
        --st-head-bg: #121a38;
        --primary: #a52a4d;
        --primary-dark: #bb3359;
        --primary-50: rgba(242, 160, 183, .12);
        --sh-accent: #f2a0b7;
        --st-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%239198b5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }
}

body.vm-ui,
.vm-ui .sh-app,
.vm-ui .dashboard { background: var(--st-bg); }
.vm-ui ::selection { background: var(--vm-navy-700); color: #fff; }
.vm-ui * { scrollbar-width: thin; scrollbar-color: var(--st-line-strong) transparent; }
.vm-ui :is(button, input, select, textarea) { font-family: inherit; }

/* =========================================================================
   MENU COMMUN (js/shell.js)
   ========================================================================= */
.vm-ui .sh-side {
    padding: 20px 14px 14px;
    background: var(--st-surface);
    border-inline-end: 1px solid var(--st-line);
}
.vm-ui .sh-brand {
    display: block;
    padding: 2px 6px 18px;
    margin-bottom: 4px;
}
/* Le vrai logo (bouclier + nom). En sombre, le nom bleu nuit du logo deviendrait
   illisible : on montre alors le bouclier seul avec le nom en clair. */
.vm-ui .sh-logo { display: block; width: 100%; max-width: 196px; height: auto; }
.vm-ui .sh-logo-dark { display: none; align-items: center; gap: 10px; }
.vm-ui .sh-logo-dark img { width: 36px; height: 36px; }
.vm-ui .sh-logo-dark span {
    font-family: 'Fredoka', 'Rubik', sans-serif;
    font-weight: 500;
    font-size: 1.25rem;
    color: var(--st-ink);
}
@media (prefers-color-scheme: dark) {
    .vm-ui .sh-logo { display: none; }
    .vm-ui .sh-logo-dark { display: flex; }
}
.vm-ui .sh-compose {
    min-height: 44px;
    margin: 0 0 10px;
    border-radius: 12px;
    background: var(--vm-wine-600);
    color: #fff;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(102, 20, 43, .25), 0 8px 18px -10px rgba(142, 33, 65, .7);
    transition: background-color .15s ease, transform .15s ease;
}
.vm-ui .sh-compose:hover { filter: none; background: var(--vm-wine-800); }
.vm-ui .sh-group {
    padding: 18px 10px 6px;
    font-size: .74rem;
    font-weight: 600;
    color: var(--st-ink-3);
}
.vm-ui .sh-link {
    position: relative;
    min-height: 42px;
    border-radius: 11px;
    color: var(--st-ink-2);
    font-size: .95rem;
    transition: background-color .15s ease, color .15s ease;
}
.vm-ui .sh-link:hover { background: var(--st-fill); color: var(--st-ink); }
.vm-ui .sh-link.on {
    background: var(--st-accent-soft);
    color: var(--st-accent-text);
    font-weight: 600;
}
.vm-ui .sh-link.on .sh-e { transform: scale(1.06); }
.vm-ui .sh-cnt { background: var(--vm-wine-600); }
.vm-ui .sh-me {
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--st-line);
    border-radius: 14px;
    background: var(--st-band);
}
.vm-ui .sh-av {
    position: relative;
    overflow: hidden;
    width: 40px;
    height: 40px;
    background: var(--vm-navy-100);
    color: var(--vm-navy-700);
    font-family: 'Fredoka', 'Rubik', sans-serif;
    font-weight: 500;
    box-shadow: 0 0 0 2px var(--st-surface), 0 0 0 3.5px var(--vm-gold-400);
}
.vm-ui .sh-av img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
@media (prefers-color-scheme: dark) {
    .vm-ui .sh-av { background: #26305a; color: #dfe4f7; }
}
.vm-ui .sh-name { color: var(--st-ink); font-weight: 500; }
.vm-ui .sh-tel { color: var(--st-ink-3); font-variant-numeric: tabular-nums; }
.vm-ui .sh-out { color: var(--st-ink-3); border-radius: 9px; }
.vm-ui .sh-out:hover { background: var(--st-fill); color: var(--st-danger); }
.vm-ui .sh-link:focus-visible,
.vm-ui .sh-compose:focus-visible,
.vm-ui .sh-tab:focus-visible,
.vm-ui .sh-out:focus-visible { outline: 2px solid var(--vm-navy-700); outline-offset: 2px; }

@media (max-width: 860px) {
    .vm-ui .sh-tabbar {
        background: color-mix(in srgb, var(--st-surface) 94%, transparent);
        -webkit-backdrop-filter: saturate(1.4) blur(12px);
        backdrop-filter: saturate(1.4) blur(12px);
        border-top: 1px solid var(--st-line);
    }
    .vm-ui .sh-tab { color: var(--st-ink-3); }
    .vm-ui .sh-tab.on { background: var(--st-accent-soft); color: var(--st-accent-text); }
    .vm-ui .sh-sheet { background: var(--st-surface); }
}

/* Bouton d'accessibilite : il se posait sur la fiche du compte, en bas du menu. Sur ces
   pages il passe du cote oppose au menu, et au-dessus de la barre d'onglets sur telephone. */
.vm-ui #a11y-toggle {
    inset-inline-start: auto;
    inset-inline-end: 22px;
    bottom: 22px;
}
.vm-ui #a11y-panel {
    inset-inline-start: auto;
    inset-inline-end: 22px;
}
@media (max-width: 860px) {
    .vm-ui #a11y-toggle { inset-inline-end: 14px; bottom: calc(96px + env(safe-area-inset-bottom)); }
    .vm-ui #a11y-panel { bottom: calc(160px + env(safe-area-inset-bottom)); }
}

/* =========================================================================
   BANDEAU DE TITRE (meme bandeau sur toutes les pages)
   Bleu nuit du site public, titre en clair, filet or.
   ========================================================================= */
.vm-ui .settings-header,
.vm-ui .main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 72px;
    padding: 14px 32px;
    gap: 16px;
    background-color: var(--st-head-bg);
    background-image:
        radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .09) 0%, rgba(255, 255, 255, 0) 55%),
        radial-gradient(80% 120% at 0% 100%, rgba(142, 33, 65, .28) 0%, rgba(142, 33, 65, 0) 60%);
    border-bottom: 0;
    box-shadow: inset 0 -2px 0 var(--vm-gold-500), 0 6px 18px -12px rgba(25, 33, 63, .55);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    color: #fff;
}
.vm-ui .settings-page .settings-title,
.vm-ui .main-header .header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Fredoka', 'Rubik', sans-serif;
    font-weight: 500;
    font-size: 1.6rem;
    line-height: 1.2;
    color: #fff;
    letter-spacing: 0;
}
.vm-ui .settings-header > .select-control {
    width: auto;
    min-width: 0;
    min-height: 38px;
    height: 38px;
    padding-block: 0;
    padding-inline: 16px 36px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    background-color: rgba(255, 255, 255, .08);
    background-image: var(--st-chevron-light);
    color: #fff;
    font-size: .875rem;
    font-weight: 500;
}
.vm-ui .settings-header > .select-control:hover { border-color: rgba(255, 255, 255, .45); background-color: rgba(255, 255, 255, .14); }
.vm-ui .settings-header > .select-control:focus { box-shadow: 0 0 0 3px rgba(226, 187, 63, .45); border-color: var(--vm-gold-400); }
.vm-ui .settings-header option,
.vm-ui .main-header option { color: #19213f; background: #fff; }

/* Recherche et boutons du bandeau de la page courrier */
.vm-ui .main-header .search-box input {
    height: 42px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    color: #fff;
}
.vm-ui .main-header .search-box input::placeholder { color: rgba(255, 255, 255, .62); }
.vm-ui .main-header .search-box input:focus {
    background: rgba(255, 255, 255, .16);
    border-color: var(--vm-gold-400);
    box-shadow: 0 0 0 3px rgba(226, 187, 63, .35);
}
.vm-ui .main-header .search-box .search-icon { color: rgba(255, 255, 255, .7); }
.vm-ui .main-header .header-icon-btn,
.vm-ui .main-header .btn-secondary {
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .08);
    color: #fff;
}
.vm-ui .main-header .header-icon-btn:hover:not(:disabled),
.vm-ui .main-header .btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); }
.vm-ui .main-header .mobile-menu-btn { color: #fff; }

/* =========================================================================
   COMPOSANTS COMMUNS
   ========================================================================= */

/* Reperes : touche du telephone (« bouton de clavier » discret, bleu nuit) */
.vm-ui .key-badge,
.vm-ui .setting-path,
.vm-ui .set-list-key,
.vm-ui .branch-badge,
.vm-ui .settings-page .set-list-key {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 7px;
    border: 1px solid color-mix(in srgb, var(--vm-navy-700) 22%, var(--st-line));
    border-bottom-width: 2px;
    border-radius: 6px;
    background: var(--st-surface);
    color: var(--st-ink-2);
    font-family: 'Rubik', system-ui, sans-serif;
    font-size: .72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
    letter-spacing: .02em;
    white-space: nowrap;
    vertical-align: middle;
}
.vm-ui .branch-badge { min-width: 0; }

/* Champs */
.vm-ui .select-control,
.vm-ui .form-input,
.vm-ui .form-select,
.vm-ui .input-control,
.vm-ui .settings-page input[type="text"]:not(.settings-search-input),
.vm-ui .settings-page input[type="email"],
.vm-ui .settings-page input[type="tel"],
.vm-ui .settings-page input[type="number"],
.vm-ui .settings-page input[type="time"],
.vm-ui .settings-page input[type="date"],
.vm-ui .settings-page input[type="password"],
.vm-ui .settings-page input[type="url"],
.vm-ui .settings-page select {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--st-line-strong);
    border-radius: var(--st-radius-sm);
    background-color: var(--st-surface);
    color: var(--st-ink);
    font-size: .9rem;
    line-height: 1.4;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.vm-ui textarea.form-input,
.vm-ui .settings-page textarea {
    padding: 10px 12px;
    border: 1px solid var(--st-line-strong);
    border-radius: var(--st-radius-sm);
    background-color: var(--st-surface);
    color: var(--st-ink);
    font-size: .9rem;
    line-height: 1.6;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.vm-ui select.select-control,
.vm-ui select.form-input,
.vm-ui select.form-select,
.vm-ui .settings-page select {
    -webkit-appearance: none;
    appearance: none;
    padding-inline-end: 36px;
    background-image: var(--st-chevron);
    background-repeat: no-repeat;
    background-size: 12px 12px;
    background-position: left 13px center;
    cursor: pointer;
}
[dir="ltr"] .vm-ui select.select-control,
[dir="ltr"] .vm-ui select.form-input,
[dir="ltr"] .vm-ui select.form-select,
[dir="ltr"] .vm-ui .settings-page select,
.vm-ui [dir="ltr"] select { background-position: right 13px center; }
.vm-ui select[multiple] { background-image: none; padding-inline-end: 12px; }
.vm-ui .select-control:hover:not(:disabled),
.vm-ui .form-input:hover:not(:disabled),
.vm-ui .input-control:hover:not(:disabled),
.vm-ui .settings-page textarea:hover:not(:disabled) { border-color: var(--st-ink-3); }
.vm-ui .select-control:focus,
.vm-ui .form-input:focus,
.vm-ui .form-select:focus,
.vm-ui .input-control:focus,
.vm-ui .settings-page input:focus-visible:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.vm-ui .settings-page textarea:focus {
    outline: none;
    border-color: var(--vm-navy-700);
    box-shadow: 0 0 0 3px var(--st-ring);
}
@media (prefers-color-scheme: dark) {
    .vm-ui .select-control:focus,
    .vm-ui .form-input:focus,
    .vm-ui .input-control:focus,
    .vm-ui .settings-page textarea:focus { border-color: #a9b6ee; }
}
.vm-ui .select-control:disabled,
.vm-ui .form-input:disabled,
.vm-ui .input-control:disabled {
    background-color: var(--st-fill);
    color: var(--st-ink-3);
    opacity: 1;
    cursor: not-allowed;
}
.vm-ui .form-input::placeholder,
.vm-ui .input-control::placeholder,
.vm-ui .settings-page textarea::placeholder,
.vm-ui .settings-page input::placeholder { color: var(--st-ink-3); opacity: 1; }
.vm-ui .form-label { color: var(--st-ink-2); font-weight: 500; }
.vm-ui .number-control { width: 96px; min-width: 96px; }
.vm-ui button.select-control {
    -webkit-appearance: none;
    appearance: none;
    padding-inline: 14px;
    background-image: none;
    background-color: var(--st-surface);
    font-weight: 500;
    color: var(--st-ink);
    cursor: pointer;
}
.vm-ui button.select-control:hover:not(:disabled) { background-color: var(--st-fill); }

/* Boutons */
.vm-ui .btn {
    min-height: 40px;
    padding: 8px 18px;
    border: 1px solid transparent;
    border-radius: var(--st-radius-sm);
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.3;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.vm-ui .btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--st-ring); }
.vm-ui .btn-primary {
    background: var(--st-accent);
    color: #fff;
    box-shadow: 0 1px 2px rgba(102, 20, 43, .2);
}
.vm-ui .btn-primary:hover:not(:disabled) { background: var(--st-accent-hover); }
.vm-ui .btn-primary:disabled { background: var(--st-accent); opacity: .5; cursor: not-allowed; }
.vm-ui .btn-secondary,
.vm-ui button.btn-secondary {
    background: var(--st-surface);
    border: 1px solid var(--st-line-strong);
    color: var(--st-ink);
}
.vm-ui .btn-secondary:hover:not(:disabled) { background: var(--st-fill); border-color: var(--st-ink-3); }
.vm-ui .btn-secondary:disabled { opacity: .5; cursor: not-allowed; }
/* Action irreversible : encre rouge, se voit sans hurler a chaque ligne. */
.vm-ui .btn-danger {
    background: transparent;
    border: 1px solid var(--st-danger-line);
    color: var(--st-danger);
}
.vm-ui .btn-danger:hover:not(:disabled) {
    background: var(--st-danger-soft);
    border-color: var(--st-danger);
    filter: none;
}
.vm-ui .btn-icon {
    min-width: 36px;
    min-height: 36px;
    padding: 0 8px;
    border: 1px solid var(--st-line);
    background: var(--st-surface);
    border-radius: var(--st-radius-sm);
    color: var(--st-ink-2);
}
.vm-ui .btn-icon:hover:not(:disabled) { background: var(--st-fill); border-color: var(--st-line-strong); }

/* Interrupteur */
.vm-ui .toggle {
    position: relative;
    display: inline-block;
    flex: 0 0 46px;
    width: 46px;
    height: 26px;
    direction: ltr;
}
.vm-ui .toggle-slider {
    background: var(--st-toggle-off);
    border-radius: 999px;
    transition: background-color .2s ease;
}
.vm-ui .toggle-slider::before {
    width: 20px;
    height: 20px;
    left: 3px;
    right: auto;
    bottom: 3px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(25, 33, 63, .28), 0 1px 1px rgba(25, 33, 63, .08);
    transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
.vm-ui .toggle input:checked + .toggle-slider { background: var(--st-accent); }
.vm-ui .toggle input:checked + .toggle-slider::before,
[dir="rtl"] .vm-ui .toggle input:checked + .toggle-slider::before,
[dir="rtl"] .vm-ui .settings-page .toggle input:checked + .toggle-slider::before { transform: translateX(20px); }
.vm-ui .toggle input:focus-visible + .toggle-slider { outline: none; box-shadow: 0 0 0 3px var(--st-ring); }
.vm-ui .toggle:hover input:not(:disabled) + .toggle-slider { filter: brightness(.96); }
.vm-ui .toggle input:disabled + .toggle-slider { opacity: .45; cursor: not-allowed; }

/* Cases a cocher */
.vm-ui input[type="checkbox"],
.vm-ui input[type="radio"] { accent-color: var(--st-accent); }

/* Pastilles d'information */
.vm-ui .info-badge {
    min-height: 28px;
    padding: 3px 10px;
    border-radius: 8px;
    background: var(--st-fill);
    color: var(--st-ink-2);
    font-size: .82rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.vm-ui .info-badge.success { background: var(--st-ok-soft); color: var(--st-ok-ink); }
.vm-ui .info-badge.warning { background: var(--st-warn-soft); color: var(--st-warn-ink); }
.vm-ui .info-badge.danger { background: var(--st-danger-soft); color: var(--st-danger); }
.vm-ui .plan-badge {
    padding: 5px 14px;
    border: 1px solid var(--st-warn-line);
    border-radius: 999px;
    background: var(--st-gold-soft);
    color: var(--vm-gold-700);
    font-size: .85rem;
    font-weight: 600;
}
@media (prefers-color-scheme: dark) { .vm-ui .plan-badge { color: var(--vm-gold-400); } }

/* Alertes */
.vm-ui .alert {
    gap: 10px;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: var(--st-radius-md);
    font-size: .875rem;
    line-height: 1.6;
}
.vm-ui .alert-warning { background: var(--st-warn-soft); color: var(--st-warn-ink); border: 1px solid var(--st-warn-line); }
.vm-ui .alert-info { background: var(--st-navy-soft); color: var(--st-ink); border: 1px solid color-mix(in srgb, var(--vm-navy-700) 20%, transparent); }
.vm-ui .alert-success { background: var(--st-ok-soft); color: var(--st-ok-ink); border: 1px solid color-mix(in srgb, var(--st-ok-ink) 22%, transparent); }
.vm-ui .alert-error { background: var(--st-danger-soft); color: var(--st-danger); border: 1px solid var(--st-danger-line); }

/* Toasts (sans liseré lateral) */
.vm-ui .toast,
.vm-ui .toast-container .toast {
    padding: 12px 16px;
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius-md);
    background: var(--st-surface);
    color: var(--st-ink);
    box-shadow: var(--st-shadow-float);
    font-size: .9rem;
}
.vm-ui .toast-success, .vm-ui .toast-error, .vm-ui .toast-warning, .vm-ui .toast-info,
.vm-ui .toast.success, .vm-ui .toast.error, .vm-ui .toast.warning,
[dir="rtl"] .vm-ui .toast-success, [dir="rtl"] .vm-ui .toast-error,
[dir="rtl"] .vm-ui .toast-warning, [dir="rtl"] .vm-ui .toast-info { border-left-width: 1px; border-right-width: 1px; }
.vm-ui .toast-success, .vm-ui .toast.success { border-color: color-mix(in srgb, var(--st-ok-ink) 40%, var(--st-line)); background: color-mix(in srgb, var(--st-ok-soft) 60%, var(--st-surface)); }
.vm-ui .toast-error, .vm-ui .toast.error { border-color: var(--st-danger-line); background: color-mix(in srgb, var(--st-danger-soft) 70%, var(--st-surface)); }
.vm-ui .toast-warning, .vm-ui .toast.warning { border-color: var(--st-warn-line); background: var(--st-warn-soft); }

/* Fenetres */
.vm-ui .modal-overlay { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.vm-ui .modal-content,
.vm-ui .ask-modal {
    border: 1px solid var(--st-line);
    box-shadow: var(--st-shadow-float);
    color: var(--st-ink);
}
.vm-ui .modal-content h3,
.vm-ui .modal-header h3 { font-family: 'Fredoka', 'Rubik', sans-serif; font-weight: 500; font-size: 1.25rem; }
.vm-ui .loading-overlay { background: color-mix(in srgb, var(--st-bg) 82%, transparent); }
.vm-ui .loading-spinner,
.vm-ui .spinner { border-color: var(--st-line); border-top-color: var(--vm-wine-600); }

/* Anneau de focus unique */
.vm-ui :is(a, button, summary):focus-visible { outline: 2px solid var(--vm-navy-700); outline-offset: 2px; }
@media (prefers-color-scheme: dark) { .vm-ui :is(a, button, summary):focus-visible { outline-color: #a9b6ee; } }

/* =========================================================================
   PAGE REGLAGES (settings.html)
   ========================================================================= */
.vm-ui .settings-page { background: var(--st-bg); font-family: inherit; }

@media (min-width: 981px) {
    .vm-ui .set-md {
        grid-template-columns: 284px minmax(0, 1fr);
        gap: 24px;
        max-width: 1320px;
        padding: 28px 32px 112px;
    }
    .vm-ui .set-md > .settings-container { max-width: 940px; }
    /* La liste montre deja la rubrique ouverte et sa touche : le fil au-dessus de la
       carte ne faisait que repeter le titre. */
    .vm-ui .set-md > .settings-container > .key-crumb { display: none; }
    .vm-ui .set-list { top: 96px; max-height: calc(100vh - 120px); }
}

/* Liste des rubriques */
.vm-ui .set-list {
    padding: 8px;
    background: var(--st-surface);
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius);
    box-shadow: var(--st-shadow);
}
.vm-ui .set-list-group,
.vm-ui .settings-page .set-list-group {
    padding: 16px 12px 6px;
    font-size: .74rem;
    font-weight: 600;
    color: var(--st-ink-3);
}
.vm-ui .set-list-group:first-child { padding-top: 8px; }
.vm-ui .set-list-item {
    min-height: 40px;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 11px;
    color: var(--st-ink);
    transition: background-color .15s ease, color .15s ease;
}
.vm-ui .set-list-item:hover { background: var(--st-fill); }
.vm-ui .set-list-item.on { background: var(--st-accent-soft); color: var(--st-accent-text); }
.vm-ui .set-list-item.on .set-list-title { font-weight: 600; }
.vm-ui .set-list-item.on .set-list-key {
    border-color: var(--st-accent-line);
    color: var(--st-accent-text);
    background: transparent;
}
.vm-ui .set-list-icon { width: 24px; font-size: 17px; }
.vm-ui .set-list-title { font-size: .92rem; font-weight: 500; }

/* Recherche */
/* Barre mise en avant (demande de יצחק, 06/11/2026) : bandeau teinte autour, champ plus haut,
   bordure marquee, texte plus grand. Le padding du bandeau decale l'icone et la croix. */
.vm-ui .settings-search {
    margin-bottom: 22px;
    padding: 14px;
    border: 1px solid var(--st-ring);
    border-radius: 18px;
    background: var(--st-navy-soft);
}
.vm-ui .settings-page .settings-search-input {
    min-height: 58px;
    padding-inline-start: 50px;
    border: 2px solid var(--st-ring);
    border-radius: 14px;
    background: var(--st-surface);
    box-shadow: var(--st-shadow);
    font-size: 1.08rem;
    font-weight: 500;
    color: var(--st-ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.vm-ui .settings-search-input::placeholder { color: var(--st-ink-2); font-weight: 400; }
.vm-ui .settings-search-input:hover { border-color: var(--st-line-strong); }
.vm-ui .settings-search-input:focus { border-color: var(--vm-navy-700); box-shadow: 0 0 0 3px var(--st-ring), var(--st-shadow); }
.vm-ui .settings-search-icon { inset-inline-start: 32px; font-size: 1.2rem; opacity: .9; }
.vm-ui .settings-search-clear { inset-inline-end: 24px; }
.vm-ui .settings-search-results {
    margin-top: 8px;
    border: 1px solid var(--st-line);
    border-radius: 14px;
    background: var(--st-surface);
    box-shadow: var(--st-shadow);
}
.vm-ui .settings-search-count {
    padding: 10px 16px;
    font-size: .8rem;
    font-weight: 500;
    color: var(--st-ink-3);
    background: var(--st-band);
    border-bottom: 1px solid var(--st-line);
}
.vm-ui .settings-search-hit { gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--st-line); }
.vm-ui .settings-search-hit:hover,
.vm-ui .settings-search-hit:focus-visible { background: var(--st-accent-soft); }
.vm-ui .settings-search-hit-label { font-weight: 500; font-size: .95rem; color: var(--st-ink); }
.vm-ui .settings-search-hit-section { display: block; font-size: .8rem; color: var(--st-ink-3); }

/* Carte de rubrique */
.vm-ui .settings-page .settings-section {
    margin-bottom: 24px;
    background: var(--st-surface);
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius);
    box-shadow: var(--st-shadow);
    overflow: hidden;
}
.vm-ui .settings-page .section-header {
    gap: 16px;
    padding: 26px 28px 22px;
    background: var(--st-surface);
    border-bottom: 1px solid var(--st-line);
}
.vm-ui .settings-page .section-icon {
    flex: none;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background: var(--st-gold-soft);
    box-shadow: inset 0 0 0 1px var(--st-warn-line);
    font-size: 1.45rem;
}
.vm-ui .settings-page .section-title {
    font-family: 'Fredoka', 'Rubik', sans-serif;
    font-weight: 500;
    font-size: 1.55rem;
    line-height: 1.25;
    color: var(--st-ink);
    text-wrap: balance;
}
.vm-ui .settings-page .section-subtitle {
    margin-top: 4px;
    font-size: .9rem;
    line-height: 1.55;
    color: var(--st-ink-2);
}
.vm-ui .settings-page .section-content { padding: 4px 28px 16px; }

/* Ligne de reglage */
.vm-ui .settings-page .setting-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: center;
    column-gap: 36px;
    row-gap: 12px;
    padding: 18px 0;
    border-bottom: 1px solid var(--st-line);
    border-radius: 0;
    background: transparent;
}
.vm-ui .settings-page .setting-row:hover { background: transparent; }
/* Lignes ecrites en bloc libre dans le gabarit (listes, formulaires) : leur mise en
   page est gardee, seul l'espacement suit. */
.vm-ui .settings-page .setting-row[style*="block"],
.vm-ui .settings-page .setting-row[style*="column"] { display: block; }
.vm-ui .settings-page .setting-info { min-width: 0; }
.vm-ui .settings-page .setting-label {
    gap: 8px;
    margin-bottom: 2px;
    font-size: .975rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--st-ink);
}
.vm-ui .settings-page .setting-description {
    max-width: 64ch;
    font-size: .875rem;
    line-height: 1.65;
    color: var(--st-ink-2);
}
/* Colonne des controles de largeur fixe : tous les controles commencent sur la meme
   verticale, d'une ligne a l'autre et d'une rubrique a l'autre. */
.vm-ui .settings-page .setting-control {
    justify-self: stretch;
    min-width: 0;
    max-width: none;
    gap: 10px;
    justify-content: flex-end;
}
.vm-ui .settings-page .setting-control[style*="min-width"] { min-width: 0 !important; }
[dir="rtl"] .vm-ui .settings-page .setting-control { justify-content: flex-start; }
/* Les listes deroulantes ont toutes la meme largeur : elles forment une colonne. */
.vm-ui .settings-page .setting-control > .select-control:not(.number-control):not(button),
.vm-ui .settings-page .setting-control > select:not(.number-control),
.vm-ui .settings-page .setting-control > .form-select,
.vm-ui .settings-page .setting-control > input.form-input,
.vm-ui .settings-page .setting-control > .input-control {
    width: 100%;
    max-width: 100%;
}

/* Valeur par defaut : une mention, pas une etiquette. */
.vm-ui .setting-default {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    margin-inline-start: 8px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--st-fill);
    color: var(--st-ink-3);
    font-size: .72rem;
    font-weight: 500;
    line-height: 1.4;
    vertical-align: baseline;
}

/* Remarque (indisponible, verrouille, precision) */
.vm-ui .settings-page .setting-note {
    position: relative;
    margin-top: 6px;
    padding-inline-start: 14px;
    font-size: .8125rem;
    line-height: 1.55;
    color: var(--st-warn-ink);
}
.vm-ui .settings-page .setting-note::before {
    content: '';
    position: absolute;
    inset-inline-start: 2px;
    top: .62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--vm-gold-500);
}

/* Intertitres : bandeaux de sous-groupe */
.vm-ui .settings-page .setting-subgroup {
    flex-wrap: wrap;
    gap: 6px 10px;
    margin: 0 -28px;
    padding: 18px 28px 10px;
    background: var(--st-band);
    border-top: 1px solid var(--st-line);
    border-bottom: 1px solid var(--st-line);
}
.vm-ui .settings-page .setting-subgroup:first-child { margin-top: -4px; border-top: 0; }
.vm-ui .settings-page .setting-subgroup-title {
    position: relative;
    padding-inline-start: 14px;
    font-family: 'Fredoka', 'Rubik', sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--st-ink);
}
/* Petit losange or devant l'intertitre : rappelle les carres du logo. */
.vm-ui .settings-page .setting-subgroup-title::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--vm-gold-500);
    transform: translateY(-50%) rotate(45deg);
}
.vm-ui .settings-page .setting-subgroup .key-badge { white-space: normal; }
/* Un intertitre dont toutes les lignes sont masquees (reglage parent coupe) ne
   s'affiche pas : un titre suivi de rien laissait croire a un oubli. Classe posee par
   markEmptySubgroups() (settings.html) apres chaque rendu. */
.vm-ui .settings-page .setting-subgroup.is-empty { display: none; }

.vm-ui .settings-page .setting-subsection-title,
.vm-ui .settings-page .setting-subsection-header .setting-label { font-weight: 600; color: var(--st-ink); }
/* Sous-sections et fiches (boites, sources) : un simple cadre, ni fond gris ni ombre. */
.vm-ui .settings-page .setting-subsection {
    margin: 16px 0;
    padding: 0 18px;
    background: var(--st-surface);
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius-md);
}
.vm-ui .settings-page .setting-subsection-header { border-bottom-color: var(--st-line); }
.vm-ui .settings-page .mail-source-list { gap: 12px; }
.vm-ui .settings-page .mail-source-card {
    padding: 18px 20px;
    background: var(--st-surface);
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius-md);
}
.vm-ui .mail-source-key,
.vm-ui .email-item-icon {
    background: var(--vm-navy-700);
    color: #fff;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.vm-ui .mail-source-address { color: var(--st-ink-3); }
.vm-ui .settings-page .mail-source-field-label { font-weight: 500; font-size: .85rem; color: var(--st-ink-2); }
.vm-ui .settings-page .mail-source-actions { border-top-color: var(--st-line); }
.vm-ui .email-item {
    background: var(--st-surface);
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius-md);
}

.vm-ui .settings-page .setting-control > button:not(.btn),
.vm-ui .settings-page .mail-source-fields button {
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid var(--st-line-strong);
    border-radius: var(--st-radius-sm);
    background: var(--st-surface);
    color: var(--st-ink);
    font-weight: 500;
    font-size: .9rem;
}
.vm-ui .settings-page .setting-control > button:not(.btn):hover:not(:disabled),
.vm-ui .settings-page .mail-source-fields button:hover:not(:disabled) { background: var(--st-fill); border-color: var(--st-ink-3); }

/* Cases a cocher en pastilles */
.vm-ui .settings-page input[type="checkbox"],
.vm-ui .settings-page input[type="radio"] { width: 16px; height: 16px; cursor: pointer; }
.vm-ui .settings-page .checkbox-list { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.vm-ui .settings-page .checkbox-item {
    min-height: 38px;
    padding: 6px 12px;
    border: 1px solid var(--st-line-strong);
    border-radius: var(--st-radius-sm);
    background: var(--st-surface);
    font-size: .875rem;
    color: var(--st-ink);
    transition: border-color .15s ease, background-color .15s ease;
}
.vm-ui .settings-page .checkbox-item:hover { border-color: var(--st-ink-3); }
.vm-ui .settings-page .checkbox-item:has(input:checked) {
    border-color: var(--st-accent-line);
    background: var(--st-accent-soft);
    color: var(--st-accent-text);
}
.vm-ui .settings-page .range-control input[type="range"] { width: 150px; }
.vm-ui .settings-page .range-value {
    min-width: 44px;
    padding: 2px 8px;
    border-radius: 8px;
    background: var(--st-fill);
    font-variant-numeric: tabular-nums;
    font-size: .85rem;
}
.vm-ui .time-range,
.vm-ui .fax-number {
    min-height: 32px;
    padding: 4px 10px;
    border: 1px solid var(--st-line);
    border-radius: 8px;
    background: var(--st-band);
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    font-size: .85rem;
}

/* Nouveautes et astuces */
.vm-ui .updates-hero,
.vm-ui .updates-center-section .updates-hero,
.vm-ui .tips-center-section .updates-hero {
    padding: 20px 22px;
    margin: 20px 0 8px;
    border: 1px solid var(--st-warn-line);
    border-radius: var(--st-radius-md);
    background: var(--st-gold-soft);
}
.vm-ui .updates-hero h3 { font-family: 'Fredoka', 'Rubik', sans-serif; font-weight: 500; font-size: 1.15rem; }
.vm-ui .update-entry {
    padding: 16px 18px;
    border: 1px solid var(--st-line);
    border-inline-start-width: 1px;
    border-radius: var(--st-radius-md);
    box-shadow: none;
}
.vm-ui .update-entry p { font-size: .925rem; line-height: 1.7; }
.vm-ui .updates-toolbar label { font-size: .8rem; font-weight: 500; color: var(--st-ink-2); }
.vm-ui .updates-toolbar select,
.vm-ui .updates-toolbar input { min-height: 40px; border-color: var(--st-line-strong); border-radius: var(--st-radius-sm); }

/* Grille de cases (telephone) */
.vm-ui .key-grid { gap: 12px; }
.vm-ui .key-cube {
    gap: 6px;
    min-height: 124px;
    padding: 18px;
    background: var(--st-surface);
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius);
    box-shadow: var(--st-shadow);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.vm-ui .key-cube::before { display: none; }
.vm-ui .key-cube:hover,
.vm-ui .key-cube:focus-visible {
    transform: translateY(-1px);
    border-color: var(--st-accent-line);
    box-shadow: var(--st-shadow-float);
    outline: none;
}
.vm-ui .key-cube:focus-visible { box-shadow: 0 0 0 3px var(--st-ring); }
.vm-ui .key-cube-updates,
.vm-ui .key-cube-tips { border-inline-start-width: 1px; background: var(--st-surface); }
.vm-ui .key-cube-key {
    min-width: 40px;
    height: 28px;
    padding: 0 9px;
    border-radius: 8px;
    background: var(--vm-navy-700);
    color: #fff;
    font-family: 'Rubik', system-ui, sans-serif;
    font-size: .88rem;
    font-weight: 600;
    letter-spacing: .04em;
    font-variant-numeric: tabular-nums;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25);
}
.vm-ui .key-cube-key.is-account { background: var(--st-fill); color: var(--st-ink-3); box-shadow: none; }
.vm-ui .key-cube-title { font-family: 'Fredoka', 'Rubik', sans-serif; font-size: 1.08rem; font-weight: 500; color: var(--st-ink); }
.vm-ui .key-cube-sub { font-size: .82rem; line-height: 1.5; color: var(--st-ink-2); }
.vm-ui .key-cube-more { color: var(--st-accent-text); font-weight: 500; }

/* Fil d'Ariane (telephone et sous-menu 9) */
.vm-ui .key-crumb { gap: 10px; margin-bottom: 14px; }
.vm-ui .key-crumb-back {
    min-height: 36px;
    padding: 6px 14px;
    border: 1px solid var(--st-line-strong);
    background: var(--st-surface);
    color: var(--st-ink);
    font-size: .875rem;
    font-weight: 500;
}
.vm-ui .key-crumb-back:hover { background: var(--st-fill); border-color: var(--st-ink-3); }
.vm-ui .key-crumb-title { font-family: 'Fredoka', 'Rubik', sans-serif; font-weight: 500; font-size: 1.05rem; color: var(--st-ink); }
.vm-ui .key-crumb-hint { color: var(--st-ink-3); font-size: .85rem; }

/* Barre « modifications non enregistrees » : flottante, centree sur le contenu. */
.vm-ui .save-bar {
    position: fixed;
    left: calc(50% - var(--sh-side, 0px) / 2);
    right: auto;
    bottom: 22px;
    z-index: 300;
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(580px, calc(100vw - var(--sh-side, 0px) - 48px));
    padding: 10px;
    padding-inline-start: 18px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 16px;
    background: var(--st-head-bg);
    color: #fff;
    box-shadow: var(--st-shadow-float), inset 0 -2px 0 var(--vm-gold-500);
    transform: translate(-50%, calc(100% + 44px));
    opacity: 0;
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
}
.vm-ui .save-bar.visible { transform: translate(-50%, 0); opacity: 1; }
.vm-ui .save-bar > span {
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: .925rem;
    color: #fff;
}
.vm-ui .save-bar > span::before {
    content: '';
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--vm-gold-400);
    box-shadow: 0 0 0 4px rgba(226, 187, 63, .22);
}
.vm-ui .save-bar .btn-secondary {
    background: transparent;
    border-color: rgba(255, 255, 255, .28);
    color: #fff;
}
.vm-ui .save-bar .btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .5); }
.vm-ui .save-bar .btn-primary { background: var(--vm-wine-600); box-shadow: 0 2px 10px -2px rgba(0, 0, 0, .4); }
.vm-ui .save-bar .btn-primary:hover:not(:disabled) { background: #a52a4d; }

/* =========================================================================
   PAGE COURRIER / NUAGE / CONTACTS / PROFIL (index.html)
   ========================================================================= */
.vm-ui .main-content { background: var(--st-bg); }
.vm-ui .view-pane,
.vm-ui .settings-card {
    background: var(--st-surface);
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius);
    box-shadow: var(--st-shadow);
}
.vm-ui .view-pane { padding: 28px 30px; }
.vm-ui .view-pane > h2,
.vm-ui .view-pane h2:first-child,
.vm-ui .view-pane > div:first-child > h2 {
    font-family: 'Fredoka', 'Rubik', sans-serif;
    font-weight: 500;
    font-size: 1.55rem;
    color: var(--st-ink);
}
.vm-ui .view-pane h3,
.vm-ui .settings-section-title { font-family: 'Fredoka', 'Rubik', sans-serif; font-weight: 500; color: var(--st-ink); }
.vm-ui .storage-info { border: 1px solid var(--st-line); color: var(--st-ink-2); font-size: .85rem; font-variant-numeric: tabular-nums; }

/* Liste du courrier */
.vm-ui .mail-list > div,
.vm-ui .mail-list { background: transparent; }
.vm-ui .mail-item {
    border-color: var(--st-line);
    background: var(--st-surface);
    transition: background-color .15s ease, box-shadow .15s ease;
}
.vm-ui .mail-item:hover { background: var(--st-band); box-shadow: 0 8px 22px -14px rgba(25, 33, 63, .35); }
.vm-ui .mail-item.unread { background: var(--st-surface); }
.vm-ui .mail-item.unread .mail-sender,
.vm-ui .mail-item.unread .mail-subject { color: var(--st-ink); font-weight: 600; }
.vm-ui .mail-item.unread .mail-avatar::after { background: var(--vm-wine-600); }
.vm-ui .mail-sender { color: var(--st-ink); }
.vm-ui .mail-subject { color: var(--st-ink); }
.vm-ui .mail-preview,
.vm-ui .mail-date { color: var(--st-ink-3); }
.vm-ui .mail-date { font-variant-numeric: tabular-nums; }
.vm-ui .attachment-badge { background: var(--st-fill); color: var(--st-ink-2); border-radius: 8px; }
.vm-ui .empty-state { color: var(--st-ink-3); }
.vm-ui .pagination-page.active { background: var(--vm-navy-700); color: #fff; border-color: var(--vm-navy-700); }
.vm-ui .pagination-btn:hover:not(:disabled) { border-color: var(--st-ink-3); background: var(--st-fill); }
.vm-ui .mail-toolbar { background: var(--st-surface); border-bottom: 1px solid var(--st-line); }

/* Fichiers et contacts */
.vm-ui .file-item {
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius-md);
    background: var(--st-surface);
}
.vm-ui .file-item:hover { background: var(--st-band); border-color: var(--st-line-strong); }
.vm-ui .contact-avatar,
.vm-ui .mail-avatar { font-family: 'Fredoka', 'Rubik', sans-serif; font-weight: 500; }
.vm-ui .mvp-subject { font-family: 'Fredoka', 'Rubik', sans-serif; font-weight: 500; }

/* =========================================================================
   TELEPHONE
   ========================================================================= */
@media (max-width: 860px) {
    .vm-ui .save-bar {
        left: 50%;
        bottom: calc(84px + env(safe-area-inset-bottom));
        width: calc(100vw - 24px);
    }
}

@media (max-width: 768px) {
    .vm-ui .settings-header,
    .vm-ui .main-header { min-height: 60px; padding: 10px 16px; }
    .vm-ui .settings-page .settings-title,
    .vm-ui .main-header .header-title { font-size: 1.35rem; }
    .vm-ui .settings-page .settings-container { padding: 14px 12px 120px; }
    .vm-ui .settings-page .settings-section { border-radius: 16px; margin-bottom: 16px; }
    .vm-ui .settings-page .section-header { padding: 18px 16px 16px; gap: 12px; }
    .vm-ui .settings-page .section-icon { width: 42px; height: 42px; border-radius: 12px; font-size: 1.25rem; }
    .vm-ui .settings-page .section-title { font-size: 1.3rem; }
    .vm-ui .settings-page .section-content { padding: 2px 16px 12px; }
    .vm-ui .settings-page .setting-subgroup { margin: 0 -16px; padding: 16px 16px 8px; }

    .vm-ui .settings-page .setting-row {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 12px;
        padding: 16px 0;
    }
    .vm-ui .settings-page .setting-control { justify-self: stretch; width: 100%; max-width: none; }
    .vm-ui .settings-page .setting-control > .select-control:not(.number-control):not(button),
    .vm-ui .settings-page .setting-control > select.form-input,
    .vm-ui .settings-page .setting-control > .form-select,
    .vm-ui .settings-page .setting-control > input.form-input,
    .vm-ui .settings-page .setting-control > .input-control { width: 100%; }
    /* Un simple interrupteur reste sur la ligne de son libelle : le pouce le trouve sans
       descendre, et la liste est deux fois plus courte. */
    .vm-ui .settings-page .setting-row:has(> .setting-control > .toggle:only-child) {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        column-gap: 16px;
    }
    .vm-ui .settings-page .setting-row:has(> .setting-control > .toggle:only-child) > .setting-control {
        justify-self: end;
        width: auto;
        padding-top: 2px;
    }
    .vm-ui .settings-page .setting-control[style*="min-width"] { min-width: 0 !important; }
    .vm-ui .settings-page .mail-source-card { padding: 14px; }
    .vm-ui .key-cube { min-height: 112px; padding: 14px; }
    .vm-ui .key-cube-title { font-size: 1rem; }
    .vm-ui .view-pane { padding: 20px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .vm-ui .save-bar,
    .vm-ui .key-cube,
    .vm-ui .toggle-slider,
    .vm-ui .toggle-slider::before { transition: none; }
}

/* Sous-titre du bandeau de la page reglages */
.vm-ui .settings-heading { display: grid; gap: 2px; }
.vm-ui .settings-header-sub {
    margin: 0;
    font-size: .85rem;
    color: rgba(255, 255, 255, .72);
}
@media (max-width: 768px) { .vm-ui .settings-header-sub { display: none; } }

/* Telephone : le menu lateral disparait, le logo passe dans le bandeau (en haut a
   droite), sur une tuile blanche bordee d'or comme sur la page d'accueil du site. */
@media (max-width: 860px) {
    .vm-ui .settings-header-left::before,
    .vm-ui .main-header::before {
        content: '';
        flex: none;
        width: 38px;
        height: 38px;
        border-radius: 11px;
        background: #fff url('/images/vmail-mark.png') center / 28px 28px no-repeat;
        box-shadow: 0 0 0 1.5px var(--vm-gold-400), 0 4px 10px -4px rgba(0, 0, 0, .45);
    }
    .vm-ui .settings-header-left { gap: 12px; }
}

/* Intertitre a l'interieur d'un cadre (sous-section, groupe trie) : pas de debord. */
.vm-ui .settings-page .setting-subsection .setting-subgroup,
.vm-ui .settings-page .mail-source-card .setting-subgroup {
    margin: 0 -18px;
    padding-inline: 18px;
}
.vm-ui .settings-page .setting-subsection > .setting-subgroup:first-child { border-radius: var(--st-radius-md) var(--st-radius-md) 0 0; margin-top: 0; }

/* Contenu de rubrique imbrique (groupe 5→9) : la marge interieure n'est comptee qu'une fois. */
.vm-ui .settings-page .phone-path-group { padding: 0 28px; }
.vm-ui .settings-page .phone-path-group > .section-content { padding-inline: 0; }
@media (max-width: 768px) { .vm-ui .settings-page .phone-path-group { padding: 0 16px; } }

/* Fiche du compte (page profil) : bandeau bleu nuit de la marque, pastille cerclee d'or. */
.vm-ui .vm-profile-hero {
    margin-bottom: 24px;
    padding: 28px 30px;
    border-radius: var(--st-radius);
    background-color: var(--st-head-bg);
    background-image:
        radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .09) 0%, rgba(255, 255, 255, 0) 55%),
        radial-gradient(80% 120% at 0% 100%, rgba(142, 33, 65, .3) 0%, rgba(142, 33, 65, 0) 60%);
    box-shadow: inset 0 -2px 0 var(--vm-gold-500), var(--st-shadow);
    color: #fff;
}
.vm-ui .vm-profile-av {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: #fff;
    color: var(--vm-navy-700);
    font-family: 'Fredoka', 'Rubik', sans-serif;
    font-size: 1.9rem;
    font-weight: 500;
    box-shadow: 0 0 0 3px var(--st-head-bg), 0 0 0 5px var(--vm-gold-400);
}

/* Adresses et numeros dans un texte hebreu : le sens se deduit du contenu, sinon
   « 0527695757@email36.com » s'affichait « email36.com@0527695757 ». */
.vm-ui .info-badge,
.vm-ui .email-item-address,
.vm-ui .mail-source-address { unicode-bidi: plaintext; }

/* Barre d'outils du nuage (page courrier) : les boutons passent a la ligne entiers. */
.vm-ui .cloud-toolbar { flex-wrap: wrap; }
.vm-ui .cloud-toolbar .btn { white-space: nowrap; }

/* =========================================================================
   PASSAGE D'UNE PAGE A L'AUTRE (05/11)
   - Pas de gabarit brut ({{ ... }}) avant que Vue ait rendu : #app[v-cloak] (reglages)
     et #app sans .loaded (courrier) restent masques, avec un indicateur discret.
   - L'ancien ecran « VMAIL / Loading your mailbox » (800 ms imposees) est supprime.
   - Transition entre documents : le menu et le bandeau ne bougent pas, seul le contenu
     se fond (Chrome/Edge ; ailleurs, navigation normale).
   ========================================================================= */
.vm-ui #loading-screen { display: none !important; }
.vm-ui #app[v-cloak] > * { display: none !important; }
.vm-ui #app[v-cloak] { min-height: 100vh; background: var(--st-bg); }
.vm-ui #app[v-cloak]::after {
    content: '';
    position: fixed;
    top: 42vh;
    left: calc(50% - var(--sh-side, 0px) / 2);
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border-radius: 50%;
    border: 3px solid var(--st-line);
    border-top-color: var(--vm-wine-600);
    animation: vm-spin .8s linear infinite;
}
@keyframes vm-spin { to { transform: rotate(360deg); } }
@media (max-width: 860px) { .vm-ui #app[v-cloak]::after { left: 50%; } }

@view-transition { navigation: auto; }
.vm-ui .sh-side { view-transition-name: vm-side; }
.vm-ui .sh-tabbar { view-transition-name: vm-tabbar; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .18s; }
@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) { animation: none !important; }
}

/* =========================================================================
   LECTURE D'UN MAIL (boites de reception / envoyes) — 05/11/2026
   Avant : un tiroir glissait par-dessus la liste depuis le cote. Demande de Yossef Haim :
   le mail ouvert prend toute la place du contenu (a cote du menu), comme une vraie page,
   et le bouton retour ramene a la liste.
   ========================================================================= */
.vm-ui .mail-view-panel {
    display: none;
    top: 0;
    bottom: 0;
    right: 260px;
    left: 0;
    width: auto;
    max-width: none;
    transform: none !important;
    transition: none;
    box-shadow: none;
    background: var(--st-bg);
    z-index: 150;
}
[dir="ltr"] .vm-ui .mail-view-panel { right: 0; left: 260px; box-shadow: none; }
.vm-ui .mail-view-panel.open { display: flex; }
.vm-ui .mail-view-panel .mvp { background: var(--st-surface); }
.vm-ui .mail-view-panel .mvp-head { padding: 18px 28px; }
.vm-ui .mail-view-panel .mvp-body { padding: 26px 28px 40px; }
.vm-ui .mail-view-panel .mvp-body > * { max-width: 920px; }
@media (max-width: 860px) {
    .vm-ui .mail-view-panel,
    [dir="ltr"] .vm-ui .mail-view-panel { right: 0; left: 0; z-index: 250; }
    .vm-ui .mail-view-panel .mvp-head { padding: 12px 16px; }
    .vm-ui .mail-view-panel .mvp-body { padding: 18px 16px 32px; }
}
/* Mail en HTML d'origine : cadre isole (sans scripts), hauteur ajustee au contenu par fitMailFrame */
.vm-ui .mvp-frame {
    display: block;
    width: 100%;
    max-width: 920px;
    min-height: 240px;
    border: 1px solid var(--st-line);
    border-radius: 12px;
    background: #fff;
}

/* Boites de reception : Virtual Mail + boites Gmail reliees en direct (05/11/2026) */
.vm-ui .mail-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 24px 4px;
}
.vm-ui .mail-box-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border: 1px solid var(--st-line);
    border-radius: 999px;
    background: var(--st-surface);
    color: var(--st-ink-2);
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.vm-ui .mail-box-chip:hover { border-color: var(--vm-wine-600); color: var(--st-ink); }
.vm-ui .mail-box-chip.active {
    background: var(--vm-navy-800, #1f2a52);
    border-color: var(--vm-navy-800, #1f2a52);
    color: #fff;
}
.vm-ui .mail-box-chip:focus-visible { outline: 3px solid var(--vm-gold, #c9a227); outline-offset: 2px; }
.vm-ui .mail-box-ico { font-size: 1rem; line-height: 1; }
@media (max-width: 860px) {
    .vm-ui .mail-boxes { margin: 10px 12px 2px; flex-wrap: nowrap; overflow-x: auto; }
    .vm-ui .mail-box-chip { flex: none; }
}

/* =========================================================================
   REGLAGES INTEGRES DANS LA PAGE COURRIER (05/11/2026)
   index.html garde settings.html dans un cadre (charge une fois) : passer du courrier aux
   reglages ne recharge plus la page. Dans le cadre, settings.html n'a pas de second menu.
   ========================================================================= */
.vm-ui .vm-settings-embed {
    height: 100vh;
    margin: 0;
}
.vm-ui .vm-settings-embed iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--st-bg);
}
@media (max-width: 860px) {
    .vm-ui .vm-settings-embed { height: calc(100vh - 84px - env(safe-area-inset-bottom)); }
}
.vm-embedded .sh-side,
.vm-embedded #shBar { display: none !important; }
.vm-embedded .sh-app { display: block; padding-bottom: 0; }
.vm-embedded #a11y-toggle { display: none !important; }
/* Telephone : la liste du courrier ne deborde plus en largeur (pastilles de pieces jointes) */
@media (max-width: 860px) {
    body.has-shell .main-content .mail-list { margin-inline: 0; width: 100%; overflow-x: hidden; }
    .vm-ui .mail-attachments { flex-wrap: wrap; overflow: hidden; max-width: 100%; }
    .vm-ui .mail-attachments .attachment-badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* =========================================================================
   LARGEUR (05/11/2026, Yossef Haim) : ni colle a un bord (« tire vers la gauche »), ni etale sur
   tout l'ecran (« trop etale, trop moche ») -> une colonne de lecture confortable, CENTREE dans
   l'espace a cote du menu.
   ========================================================================= */
@media (min-width: 861px) {
    .vm-ui .main-content .mail-list,
    .vm-ui .main-content .view-pane,
    .vm-ui .main-content .mail-boxes,
    .vm-ui .main-content .mail-toolbar,
    .vm-ui .main-content .pagination {
        max-width: 1080px !important;
        width: calc(100% - 48px) !important;
        margin-inline: auto !important;
        box-sizing: border-box;
    }
    .vm-ui .mail-view-panel .mvp-head,
    .vm-ui .mail-view-panel .mvp-body {
        width: 100%;
        max-width: 1080px;
        margin-inline: auto;
        box-sizing: border-box;
    }
    .vm-ui .mail-view-panel .mvp-body > *,
    .vm-ui .mvp-frame { max-width: none; }
}
@media (min-width: 981px) {
    .vm-ui .set-md { max-width: 1240px; margin-inline: auto; }
    .vm-ui .set-md > .settings-container { max-width: none; }
}
