/* Généré par tools/build.cjs : style de la popup de l'extension + tools/web.css */

    /* ---- Couleurs : palette du « livre de couleurs » + RÔLES (mêmes noms que le site web) ----
         Sulphur Yellow C4 M4 Y28 K0 = #F5F5B8 · Eugenia Red C7 M76 Y60 K0 = #ED3D66 · Olive Green C56 M40 Y85 K22 = #58771E ·
         Cossack Green C76 M32 Y91 K18 = #328E13 (conversion CMYK -> RVB sans profil d'impression).
         Le reste de la feuille n'utilise que ces rôles : un futur mode sombre = un second jeu de valeurs ici. */
    :root {
      --sulphur-yellow: #F5F5B8;
      --eugenia-red: #ED3D66;
      --olive-green: #58771E;
      --cossack-green: #328E13;
      --cossack-rgb: 50, 142, 19;
      --banner-bg: #E3EBD3;        /* bandeau : vert clair de l'extension (choix de l'utilisateur) ; calé sur la couleur de la tuile du logo (227,235,211) pour qu'aucun carré ne se voie */
      --brand: var(--cossack-green);   /* couleur principale : contours de focus, pistes, icônes */
      --brand-light: #2B8511;       /* début du dégradé des boutons (blanc dessus : contraste >= 4,5) */
      --brand-dark: #2A7A10;
      --brand-deep: #226A0D;
      --link: #28720F;              /* vert un peu plus foncé pour le PETIT texte (contraste >= 4,5) */
      --accent: var(--olive-green);
      --accent-strong: #4A6618;
      --accent-deep: #3F5715;
      --accent-tint: #EDF2DA;
      --accent-border: #CBD9A0;
      --chip-bg: var(--sulphur-yellow);   /* états « sélectionné / actif » */
      --soft-icon: #7F8F5A;
      --key-sp-bg: #F2F7DF;
      --key-sp-border: #D6E2B0;
      --flag-red: var(--eugenia-red);
      /* neutres (mode clair) */
      --n-page: #F4F1E9; --n-surface: #FFFFFF; --n-surface2: #FAF8F2;
      --n-line: #EFEADF; --n-line2: #E2DCCE;
      --n-text: #211F1B; --n-text-strong: #1A1A14; --n-text2: #5C574B; --n-text3: #9A947F; --n-placeholder: #B3AD9E;
      --n-scroll: #CDC5B2; --n-scroll2: #D9D2C2; --n-scroll3: #C2B9A5; --n-track: #D9D4C8;
      --n-expand-bg: #F6F3EA; --n-expand-border: #E8E2D2;
      --n-glass: rgba(255,255,255,.88); --n-glass-border: rgba(0,0,0,.10);
      --logo-g: #1A851B; --logo-t: #2E737A;
      color-scheme: light;
    }
    /* ---- Mode sombre (2.6) : second jeu de valeurs pour les mêmes rôles ----
       data-theme="dark" force le sombre, data-theme="light" force le clair, sans attribut : suit le réglage du système. */
    :root[data-theme="dark"] {
      --banner-bg: #2A3322;
      --brand: #4FA82E; --link: #8FD16F; --brand-deep: #B5E39A;
      --accent: #B9D67C; --accent-strong: #CFE6A3; --accent-deep: #DCEBB8; --accent-tint: #2F3A24; --accent-border: #4D5E36;
      --chip-bg: #4B4C1F; --soft-icon: #9DB071; --key-sp-bg: #2B3622; --key-sp-border: #465B33;
      --n-page: #14170F; --n-surface: #1F231A; --n-surface2: #191C14;
      --n-line: #2E3426; --n-line2: #3A4230;
      --n-text: #ECEADC; --n-text-strong: #F5F4E6; --n-text2: #CFCDBB; --n-text3: #A5A793; --n-placeholder: #7E816D;
      --n-scroll: #4A5240; --n-scroll2: #3F4636; --n-scroll3: #5A634C; --n-track: #444B39;
      --n-expand-bg: #252A1E; --n-expand-border: #343B2A;
      --n-glass: rgba(38,43,31,.88); --n-glass-border: rgba(255,255,255,.12);
      --logo-g: #62CC5C; --logo-t: #62B7C4;
      color-scheme: dark;
    }
    @media (prefers-color-scheme: dark) {
      :root:not([data-theme="light"]) {
      --banner-bg: #2A3322;
      --brand: #4FA82E; --link: #8FD16F; --brand-deep: #B5E39A;
      --accent: #B9D67C; --accent-strong: #CFE6A3; --accent-deep: #DCEBB8; --accent-tint: #2F3A24; --accent-border: #4D5E36;
      --chip-bg: #4B4C1F; --soft-icon: #9DB071; --key-sp-bg: #2B3622; --key-sp-border: #465B33;
      --n-page: #14170F; --n-surface: #1F231A; --n-surface2: #191C14;
      --n-line: #2E3426; --n-line2: #3A4230;
      --n-text: #ECEADC; --n-text-strong: #F5F4E6; --n-text2: #CFCDBB; --n-text3: #A5A793; --n-placeholder: #7E816D;
      --n-scroll: #4A5240; --n-scroll2: #3F4636; --n-scroll3: #5A634C; --n-track: #444B39;
      --n-expand-bg: #252A1E; --n-expand-border: #343B2A;
      --n-glass: rgba(38,43,31,.88); --n-glass-border: rgba(255,255,255,.12);
      --logo-g: #62CC5C; --logo-t: #62B7C4;
      color-scheme: dark;
      }
    }

    * { box-sizing: border-box; }
    html, body { margin: 0; padding: 0; }

    body {
      width: 440px;
      padding: 22px;
      background: var(--n-page);
      color: var(--n-text);
      font-family: 'Hanken Grotesk', 'Noto Sans', 'Segoe UI', sans-serif;
    }

    textarea, input, button { font-family: inherit; }
    textarea::placeholder { color: var(--n-placeholder); }

    /* ---- Header banner ---- */
    .banner {
      position: relative;
      background: var(--banner-bg);
      border-radius: 16px;
      padding: 13px 10px;
      display: flex;
      align-items: center;
      gap: 5px;
      box-shadow: 0 2px 8px rgba(20,40,20,.08);
    }
    .banner-title {
      display: flex;
      align-items: baseline;
      gap: 6px;
      flex: 1;
      min-width: 0;
    }

    /* logo vectoriel (flèches fines d'origine) : couleurs thémables */
    .banner .logo { width: 34px; height: 28px; margin: 0 4px 0 2px; display: block; flex: none; align-self: center; overflow: visible; }
    .banner .logo .lg { stroke: var(--logo-g); }
    .banner .logo .lt { stroke: var(--logo-t); }
    /* pied de page : version seule (le thème est dans la bannière) */
    /* Exclusion par site (2.6) : ligne fine sous les boutons de page (elle concerne CE site, pas un réglage général) ;
       la liste des sites désactivés est dans le bloc « À propos ». */
    .site-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 4px 0; }
    .site-row[hidden] { display: none; }
    .site-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
    .site-label { font: 600 13.5px 'Hanken Grotesk', sans-serif; color: var(--n-text2); }
    .site-host { font: 500 12px/1.2 'Hanken Grotesk', sans-serif; color: var(--n-text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; }
    .site-row .toggle-track { width: 40px; height: 24px; border-radius: 12px; }
    .site-row .toggle-knob { width: 18px; height: 18px; }
    .site-row .toggle.on .toggle-knob { transform: translateX(16px); }
    .site-row .toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 12px; }
    html.panel .site-row { order: 5; }
    .site-list-box { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--n-line); }
    .site-list-box[hidden] { display: none; }
    .site-list-title { font: 600 13px 'Hanken Grotesk', sans-serif; color: var(--n-text3); }
    .site-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
    .site-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 500 13px 'Hanken Grotesk', sans-serif; color: var(--n-text); padding: 4px 2px; }
    .site-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }
    .site-list button { flex: none; border: 1px solid var(--n-line2); background: var(--n-surface); color: var(--link); border-radius: 8px; padding: 3px 9px; cursor: pointer; font: 600 12px 'Hanken Grotesk', sans-serif; }
    .site-list button:hover { border-color: var(--accent-border); background: var(--chip-bg); }
    .site-list button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
    .foot-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 15px; flex-wrap: wrap; }
    .foot-row .version { margin-top: 0; }
    /* Thème : icône dans la bannière (à côté de la langue), menu à trois choix. Le menu réutilise le style du menu de langue. */
    .theme-wrap { position: relative; flex: none; }
    .theme-btn {
      width: 26px; height: 26px; padding: 0; border-radius: 50%;
      border: 1px solid var(--n-glass-border); background: var(--n-glass);
      color: var(--n-text2); cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 1px 3px rgba(0,0,0,.08);
      transition: background .2s, color .2s, border-color .2s;
    }
    .theme-btn svg { width: 15px; height: 15px; display: block; }
    /* zone de clic élargie sans changer l'apparence (comme le bouton « i ») */
    .theme-btn { position: relative; }
    .theme-btn::after { content: ""; position: absolute; inset: -3px; }
    .theme-btn:hover, .theme-btn[aria-expanded="true"] { color: var(--link); border-color: var(--accent-border); background: var(--accent-tint); }
    .theme-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
    .theme-menu { min-width: 170px; }
    .theme-item svg.ti { width: 16px; height: 16px; flex: none; color: var(--n-text2); }
    .theme-item[aria-checked="true"] svg.ti { color: var(--brand-deep); }
    html.panel .foot-row { order: 6; }
    .banner img {
      width: 46px;
      height: 46px;
      display: block;
      object-fit: contain;
      flex: none;
      align-self: center;
    }
    .banner .name-cap {
      font: 700 15px/1 'Cinzel', 'Garamond', serif;
      color: var(--n-text-strong);
      letter-spacing: .06em;
      white-space: nowrap;
      align-self: center;
    }
    .banner .name-script {
      font: 600 20px/1 'Dancing Script', cursive;
      color: var(--n-text-strong);
      white-space: nowrap;
      align-self: center;
    }
    .info-btn {
      position: relative;
      width: 26px; height: 26px;
      border-radius: 50%;
      border: 1px solid var(--n-glass-border);
      background: var(--n-glass);
      color: var(--soft-icon);
      cursor: pointer;
      font: italic 700 13px/1 Georgia, serif;
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 1px 3px rgba(0,0,0,.08);
      flex: none;
      transition: background .2s, color .2s, border-color .2s;
    }
    /* zone de clic élargie (32 px) sans changer l'apparence du bouton */
    .info-btn::after { content: ""; position: absolute; inset: -3px; }
    .info-btn:hover { color: var(--link); }
    .info-btn.active { background: var(--chip-bg); color: var(--link); border-color: var(--accent-border); }

    /* ---- Description block ---- */
    .desc-block {
      max-height: 0; opacity: 0; margin-top: 0; overflow: hidden;
      transition: max-height .3s ease, opacity .24s ease, margin-top .3s ease;
    }
    .desc-block .desc-inner {
      background: var(--n-surface);
      border: 1px solid var(--n-line);
      border-radius: 14px;
      padding: 14px 16px;
      box-shadow: 0 1px 3px rgba(0,0,0,.04);
    }
    .desc-block p {
      margin: 0;
      font: 400 13px/1.6 'Noto Sans', sans-serif;
      color: var(--n-text2);
      white-space: pre-line;
    }
    /* Première ligne (titre du projet) mise en avant */
    .desc-block p::first-line {
      font-weight: 700;
      color: var(--n-text);
    }

    /* ---- Subtitle ---- */
    .subtitle {
      text-align: center;
      font: 500 13px/1.3 'Hanken Grotesk', sans-serif;
      color: var(--n-text3);
      margin-top: 12px;
    }

    /* ---- Cards ---- */
    .card {
      background: var(--n-surface);
      border: 1px solid var(--n-line);
      box-shadow: 0 1px 3px rgba(0,0,0,.04);
    }
    .card-transcriber {
      border-radius: 18px;
      padding: 16px;
      box-shadow: 0 1px 3px rgba(0,0,0,.05);
      margin-top: 18px;
    }
    .card-row {
      border-radius: 16px;
      padding: 13px 16px;
      margin-top: 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .label-upper {
      font: 600 12px/1 'Hanken Grotesk', sans-serif;
      letter-spacing: .10em;
      text-transform: uppercase;
      color: var(--n-text3);
      margin-bottom: 9px;
    }
    .label-card { font: 600 15px 'Hanken Grotesk', sans-serif; color: var(--n-text); }

    textarea#input {
      width: 100%;
      border: none; outline: none; resize: none; overflow-y: hidden;
      background: transparent;
      font: 500 16px/1.5 'Noto Sans', sans-serif;
      color: var(--n-text);
      min-height: 26px;
      height: 26px;
      max-height: 160px;
      display: block;
    }

    /* Scrollbars discrètes assorties au thème */
    textarea#input, #output {
      scrollbar-width: thin;
      scrollbar-color: var(--n-scroll) transparent;
    }
    textarea#input::-webkit-scrollbar,
    #output::-webkit-scrollbar { width: 8px; }
    textarea#input::-webkit-scrollbar-track,
    #output::-webkit-scrollbar-track { background: transparent; }
    textarea#input::-webkit-scrollbar-thumb,
    #output::-webkit-scrollbar-thumb {
      background: var(--n-scroll2); border-radius: 4px;
      border: 2px solid transparent; background-clip: content-box;
    }
    textarea#input::-webkit-scrollbar-thumb:hover,
    #output::-webkit-scrollbar-thumb:hover { background: var(--n-scroll3); background-clip: content-box; }

    /* ---- Misal hint ---- */
    .misal-hint {
      margin-top: 10px;
      border: 1px solid var(--n-line);
      background: var(--n-surface2);
      border-radius: 10px;
      padding: 7px 12px;
      cursor: pointer;
      font: 600 13px 'Hanken Grotesk', sans-serif;
      color: var(--n-text3);
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: color .2s, border-color .2s;
    }
    .misal-hint:hover { color: var(--link); border-color: var(--accent-border); }

    /* ---- Result block ---- */
    .out-block {
      max-height: 0; opacity: 0; overflow: hidden; margin-top: 0;
      transition: max-height .3s ease, opacity .24s ease, margin-top .3s ease;
    }
    .out-divider {
      display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
    }
    .out-divider .line { flex: 1; height: 1px; background: var(--n-line); }
    .out-head {
      display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px;
    }
    .out-head .lat {
      font: 600 12px/1 'Hanken Grotesk', sans-serif;
      letter-spacing: .10em; text-transform: uppercase; color: var(--link);
    }
    .btn-copy {
      border: none; background: transparent; cursor: pointer;
      font: 600 13px 'Hanken Grotesk', sans-serif; color: var(--n-text3);
      display: flex; align-items: center; gap: 4px;
      transition: color .2s;
    }
    .btn-copy:hover { color: var(--link); }
    .out-actions { display: flex; align-items: center; gap: 14px; }
    /* Partage (2.7) : puces sous la ligne de boutons du résultat (et sous « Partager le projet » dans « À propos ») */
    .out-head { flex-wrap: wrap; row-gap: 6px; }
    .out-actions { flex-wrap: wrap; justify-content: flex-end; }
    .share-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
    .share-row[hidden] { display: none; }
    .share-chip {
      border: 1px solid var(--accent-border); background: var(--accent-tint); color: var(--link); border-radius: 999px;
      padding: 5px 11px; cursor: pointer; font: 600 12.5px 'Hanken Grotesk', sans-serif; direction: ltr;
      transition: background .15s, border-color .15s;
    }
    .share-chip:hover { background: var(--chip-bg); border-color: var(--brand); }
    .share-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
    .share-chip.done { background: var(--brand); border-color: var(--brand); color: #fff; }
    #shareRowProject { margin: 10px 0 0; }
    .about-meta { margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
    .about-meta > div { display: flex; align-items: baseline; gap: 10px; }
    .about-meta dt { margin: 0; flex: 0 0 74px; font: 600 13px 'Hanken Grotesk', sans-serif; color: var(--n-text3); }
    .about-meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font: 500 12.5px 'Noto Sans', sans-serif; color: var(--n-text); }
    .about-meta a { color: var(--link); text-decoration: none; }
    .about-meta a:hover { text-decoration: underline; }
    .about-meta a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
    .report-link {
      margin-top: 12px; border: 1px solid var(--n-line); background: var(--n-page); border-radius: 10px; padding: 7px 12px;
      cursor: pointer; font: 600 13px 'Hanken Grotesk', sans-serif; color: var(--link);
      transition: border-color .2s, background .2s;
    }
    .report-link:hover { border-color: var(--accent-border); background: var(--accent-tint); }
    .about-actions { display: flex; flex-wrap: wrap; gap: 0 8px; }
    .about-actions .report-link[hidden] { display: none; }
    .report-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
    #output {
      font: 500 16px/1.5 'Noto Sans', sans-serif;
      color: var(--accent-strong);
      min-height: 24px;
      max-height: 200px;
      overflow-y: auto;
      white-space: pre-wrap;
      word-break: break-word;
    }

    /* ---- Drapeaux (décoratifs : le nom de la langue est toujours écrit à côté) ---- */
    .flag {
      display: inline-block; width: 24px; height: 16px; border-radius: 4px; flex: none;
      box-shadow: 0 1px 2px rgba(0,0,0,.18);
    }
    .flag-ce {
      background: linear-gradient(180deg,
        #2B7A3D 0 70%,
        #fff 70% 76%,
        #D9251D 76% 84%,
        #fff 84% 91%,
        #2B7A3D 91% 100%);
    }
    .flag-en {
      background-color: #012169;
      background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2MCAzMCI+PGNsaXBQYXRoIGlkPSJ0Ij48cGF0aCBkPSJNMzAsMTUgaDMwIHYxNSB6IHYxNSBoLTMwIHogaC0zMCB2LTE1IHogdi0xNSBoMzAgeiIvPjwvY2xpcFBhdGg+PHBhdGggZD0iTTAsMCB2MzAgaDYwIHYtMzAgeiIgZmlsbD0iIzAxMjE2OSIvPjxwYXRoIGQ9Ik0wLDAgTDYwLDMwIE02MCwwIEwwLDMwIiBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iNiIvPjxwYXRoIGQ9Ik0wLDAgTDYwLDMwIE02MCwwIEwwLDMwIiBjbGlwLXBhdGg9InVybCgjdCkiIHN0cm9rZT0iI0M4MTAyRSIgc3Ryb2tlLXdpZHRoPSI0Ii8+PHBhdGggZD0iTTMwLDAgdjMwIE0wLDE1IGg2MCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEwIi8+PHBhdGggZD0iTTMwLDAgdjMwIE0wLDE1IGg2MCIgc3Ryb2tlPSIjQzgxMDJFIiBzdHJva2Utd2lkdGg9IjYiLz48L3N2Zz4=");
      background-size: cover;
      background-position: center;
    }
    .flag-fr { background: linear-gradient(90deg,#0055A4 33.3%,#fff 33.3% 66.6%,#EF4135 66.6%); }
    .flag-ru { background: linear-gradient(180deg,#fff 33.3%,#0039A6 33.3% 66.6%,#D52B1E 66.6%); }
    .flag-de { background: linear-gradient(180deg,#000 33.3%,#DD0000 33.3% 66.6%,#FFCE00 66.6%); }
    .flag-es { background: linear-gradient(180deg,#AA151B 25%,#F1BF00 25% 75%,#AA151B 75%); }
    .flag-tr { background-color: #E30A17; background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMCAyMCI+PHJlY3Qgd2lkdGg9IjMwIiBoZWlnaHQ9IjIwIiBmaWxsPSIjRTMwQTE3Ii8+PGNpcmNsZSBjeD0iMTAuNiIgY3k9IjEwIiByPSI1IiBmaWxsPSIjZmZmIi8+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMCIgcj0iNCIgZmlsbD0iI0UzMEExNyIvPjxwb2x5Z29uIHBvaW50cz0iMTcuNjAsMTAuMDAgMTUuNzksMTAuNjUgMTUuNzMsMTIuNTcgMTQuNTYsMTEuMDUgMTIuNzIsMTEuNTkgMTMuODAsMTAuMDAgMTIuNzIsOC40MSAxNC41Niw4Ljk1IDE1LjczLDcuNDMgMTUuNzksOS4zNSIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg=="); background-size: cover; background-position: center; }
    /* Arabe : pas de drapeau unique (langue de plus de vingt pays) -> pastille neutre */
    .flag-ar { display: inline-flex; align-items: center; justify-content: center; background: #EFEADF; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); color: #4A463C; font: 700 11px/1 'Segoe UI', 'Noto Sans Arabic', Tahoma, sans-serif; }
    .flag-ar::before { content: 'ع'; }

    /* ---- Sélecteur de langue (dans la bannière) ---- */
    .lang-wrap { position: relative; flex: none; }
    .lang-btn {
      display: flex; align-items: center; gap: 4px;
      height: 28px; padding: 0 6px 0 5px; border-radius: 14px;
      border: 1px solid var(--n-glass-border); background: var(--n-glass);
      color: var(--n-text2); cursor: pointer;
      font: 700 13px/1 'Hanken Grotesk', sans-serif; letter-spacing: .04em;
      box-shadow: 0 1px 3px rgba(0,0,0,.08);
      transition: background .2s, color .2s, border-color .2s;
    }
    .lang-btn:hover, .lang-btn[aria-expanded="true"] { color: var(--link); border-color: var(--accent-border); background: var(--accent-tint); }
    .lang-btn svg { transition: transform .2s; width: 10px; height: 10px; }
    .lang-btn .flag { width: 20px; height: 14px; }
    .lang-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
    .lang-btn:focus-visible, .info-btn:focus-visible, .btn-expand:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
    .lang-menu {
      position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 20;
      min-width: 190px; padding: 6px; background: var(--n-surface);
      border: 1px solid var(--n-line); border-radius: 14px;
      box-shadow: 0 10px 28px rgba(28,40,28,.18), 0 2px 6px rgba(0,0,0,.06);
    }
    .lang-menu[hidden] { display: none; }
    .lang-item {
      all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px;
      width: 100%; padding: 9px 10px; border-radius: 10px; cursor: pointer;
      font: 600 14px/1.2 'Hanken Grotesk', 'Noto Sans', sans-serif; color: var(--n-text);
    }
    .lang-item:hover, .lang-item:focus-visible { background: var(--n-page); }
    .lang-item:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
    .lang-item[aria-checked="true"] { background: var(--chip-bg); color: var(--brand-deep); }
    .lang-item .lang-name { flex: 1; }
    .lang-item .lang-code { font-size: 12px; letter-spacing: .08em; color: var(--n-text3); }
    .lang-item .lang-check { width: 16px; height: 16px; flex: none; color: var(--brand); opacity: 0; }
    .lang-item[aria-checked="true"] .lang-check { opacity: 1; }

    /* ---- Bannière étroite (panneau latéral) : le nom s'abrège selon la place réellement disponible ---- */
    .banner-title { container-type: inline-size; overflow: hidden; }
    @container (max-width: 237px) { .name-script { display: none; } }
    @container (max-width: 140px) { .name-cap { display: none; } }

    /* ---- Mode panneau latéral : même page, largeur libre ---- */
    html.panel body { width: auto; min-width: 0; padding: 14px; }
    html.panel .btn-expand { display: none; }
    /* panneau : les enveloppes de la saisie disparaissent pour que la saisie et le résultat se partagent la hauteur de la carte */
    html.panel .in-wrap, html.panel .in-main { display: contents; }

    /* ---- Panneau : réglages en haut, saisie en dessous (elle occupe toute la hauteur restante) ---- */
    html.panel body { min-height: 100vh; }
    html.panel #layout { display: flex; flex-direction: column; min-height: calc(100vh - 28px); }
    html.panel #mainCol { flex: 1; display: flex; flex-direction: column; min-height: 0; }
    html.panel #sideCol { display: none; }
    html.panel .banner { order: 0; }
    html.panel #descBlock { order: 1; }
    html.panel .subtitle { order: 2; }
    html.panel #mainCol > .card-row { order: 3; }
    html.panel .actions { order: 4; }
    html.panel #cardTranscriber { order: 5; flex: 1; min-height: 230px; display: flex; flex-direction: column; margin-top: 16px; }
    /* saisie et résultat se partagent la hauteur de la carte (défilement interne si le texte est long) */
    html.panel textarea#input { flex: 1 1 0; min-height: 96px; height: auto; max-height: none; overflow-y: auto; }
    html.panel .out-block { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
    html.panel #output { flex: 1 1 0; min-height: 80px; max-height: none; }
    html.panel .misal-hint { align-self: flex-start; }

    /* ---- Alphabet latin : aide à la saisie (carte de saisie, repliée par défaut) ---- */
    .alpha-block { margin-top: 14px; border-top: 1px solid var(--n-line); padding-top: 10px; flex: none; }
    .alpha-toggle {
      width: 100%; display: flex; align-items: center; gap: 8px; padding: 4px 0;
      border: none; background: transparent; cursor: pointer; text-align: start;
      font: 600 13px 'Hanken Grotesk', sans-serif; color: var(--n-text3); transition: color .2s;
    }
    .alpha-toggle:hover { color: var(--link); }
    .alpha-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
    .alpha-toggle .alpha-glyph { font: 600 15px 'Noto Sans', sans-serif; color: var(--link); width: 18px; text-align: center; }
    .alpha-toggle .alpha-chev { margin-inline-start: auto; transition: transform .2s; }
    .alpha-toggle[aria-expanded="true"] .alpha-chev { transform: rotate(180deg); }
    .alpha-body[hidden] { display: none; }
    .alpha-body { margin-top: 10px; }
    .alpha-field { border: 1px solid var(--n-line); background: var(--n-surface2); border-radius: 12px; padding: 8px 10px; }
    textarea#latInput {
      width: 100%; border: none; outline: none; resize: none; background: transparent; display: block;
      font: 400 17px/1.5 'Noto Sans', sans-serif; color: var(--accent-strong); min-height: 48px; max-height: 120px;
      scrollbar-width: thin; scrollbar-color: var(--n-scroll) transparent;
    }
    .alpha-field-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
    .alpha-field-actions .btn-copy { padding: 2px 0; }
    .alpha-field-actions .btn-copy.done { color: var(--link); }
    /* Écrire en latin → cyrillique (2.8) : résultat sous le champ « Lettres latines » ; les mots douteux se changent au clic */
    .rev-block { margin-top: 10px; border: 1px solid var(--accent-border); background: var(--accent-tint); border-radius: 12px; padding: 8px 12px 10px; }
    .rev-block[hidden] { display: none; }
    .rev-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
    .rev-head .lat { font: 600 12px/1 'Hanken Grotesk', sans-serif; letter-spacing: .10em; text-transform: uppercase; color: var(--link); }
    .rev-head .btn-copy { padding: 2px 0; }
    .rev-head .btn-copy.done { color: var(--link); }
    #revOut { font: 400 16px/1.5 'Noto Sans', sans-serif; color: var(--accent-strong); overflow-wrap: anywhere; }
    .rev-w { cursor: pointer; border-radius: 5px; transition: background .12s; }
    .rev-w:hover { background: var(--chip-bg); }
    .rev-w:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
    .rev-doubt { text-decoration: underline dotted; text-decoration-thickness: 2px; text-underline-offset: 4px; }
    .alpha-tools { display: flex; align-items: center; gap: 12px; }
    .alpha-shift {
      min-width: 34px; height: 30px; border: 1px solid var(--n-line2); background: var(--n-surface); border-radius: 9px; cursor: pointer;
      font: 700 15px 'Noto Sans', sans-serif; color: var(--n-text2); padding: 0 8px; transition: background .15s, border-color .15s, color .15s;
    }
    .alpha-shift:hover { background: var(--n-surface2); }
    .alpha-shift[aria-pressed="true"] { background: var(--chip-bg); border-color: var(--accent-border); color: var(--link); }
    .alpha-shift:focus-visible, .alpha-key:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
    .alpha-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; margin-top: 10px; direction: ltr; }
    .alpha-key {
      height: 38px; border: 1px solid var(--n-line); background: var(--n-surface); border-radius: 10px; cursor: pointer; padding: 0;
      font: 600 17px 'Noto Sans', sans-serif; color: var(--n-text);
      transition: background .12s, border-color .12s, color .12s, transform .06s;
    }
    .alpha-key.sp { background: var(--key-sp-bg); border-color: var(--key-sp-border); color: var(--accent-deep); }
    .alpha-key:hover { border-color: var(--accent-border); background: var(--accent-tint); color: var(--link); }
    .alpha-key:active { transform: scale(.94); }
    .alpha-sep { grid-column: 1 / -1; height: 1px; background: var(--n-line); margin: 2px 0; }

    /* ---- Panneau : barre déplaçable entre le texte cyrillique et le résultat latin ---- */
    html.panel .out-divider { cursor: row-resize; touch-action: none; user-select: none; position: relative; padding: 8px 0; margin: -8px 0 4px; }
    html.panel .out-divider .line { height: 2px; border-radius: 2px; background: var(--n-line2); transition: background .15s; }
    html.panel .out-divider::after {
      content: ""; position: absolute; left: 50%; top: 50%; width: 46px; height: 6px; margin: -3px 0 0 -23px;
      border-radius: 3px; background: var(--n-scroll); transition: background .15s;
    }
    html.panel .out-divider:hover .line, html.panel .out-divider.dragging .line { background: var(--accent-border); }
    html.panel .out-divider:hover::after, html.panel .out-divider.dragging::after, html.panel .out-divider:focus-visible::after { background: var(--brand); }
    html.panel .out-divider:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 6px; }
    body.splitting { user-select: none; cursor: row-resize; }

    /* ---- Arabe (droite à gauche) ---- */
    .banner-title { direction: ltr; }               /* le nom du projet ne s'inverse jamais */
    html[dir="rtl"] .btn-expand svg { transform: scaleX(-1); }
    html[dir="rtl"] body.wide .btn-expand svg { transform: none; }

    /* ---- Toggle ---- */
    .toggle { cursor: pointer; flex: none; }
    .toggle-track {
      width: 48px; height: 28px; border-radius: 14px;
      background: var(--n-track); position: relative; transition: background .25s;
    }
    .toggle-knob {
      position: absolute; top: 3px; left: 3px;
      width: 22px; height: 22px; border-radius: 50%;
      background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
      transition: transform .25s; transform: translateX(0);
    }
    .toggle.on .toggle-track { background: var(--brand-light); }
    .toggle.on .toggle-knob { transform: translateX(20px); }

    /* ---- Action buttons ---- */
    .actions { display: flex; gap: 12px; margin-top: 16px; }
    .btn-primary {
      flex: 1.7; border: none; border-radius: 14px; padding: 14px;
      background: linear-gradient(160deg,var(--brand-light),var(--brand-dark));
      color: #fff; font: 700 15px 'Hanken Grotesk', sans-serif; cursor: pointer;
      box-shadow: 0 8px 18px rgba(var(--cossack-rgb),.30);
      transition: filter .15s;
    }
    .btn-primary:hover { filter: brightness(1.05); }
    .btn-primary:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.4); }
    .btn-primary:disabled:hover { filter: grayscale(.4); }
    .btn-secondary {
      flex: 1; border: 1px solid var(--n-line2); border-radius: 14px; padding: 14px;
      background: var(--n-surface); color: var(--n-text2); font: 600 15px 'Hanken Grotesk', sans-serif; cursor: pointer;
      transition: background .15s;
    }
    .btn-secondary:hover { background: var(--n-surface2); }

    .version {
      text-align: center;
      font: 500 13px 'Hanken Grotesk', sans-serif;
      color: var(--n-text3);
      margin-top: 15px;
    }

    /* ---- En-tête de la carte de saisie + bouton de bascule vers la droite ---- */
    .card-head {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 9px; min-height: 26px;
    }
    .card-head .label-upper { margin-bottom: 0; }
    .btn-expand {
      width: 26px; height: 26px; padding: 0;
      border-radius: 50%;
      border: 1px solid var(--n-glass-border);
      background: var(--n-glass);
      color: var(--soft-icon);
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      flex: none;
      transition: background .2s, color .2s, border-color .2s;
    }
    /* Bouton « Agrandir » : barre verticale qui épouse la hauteur de la zone de saisie (grande surface de clic) */
    .in-wrap { display: flex; align-items: stretch; gap: 10px; }
    .in-main { flex: 1; min-width: 0; }
    .btn-expand {
      width: 32px; height: auto; min-height: 60px; align-self: stretch; border-radius: 16px;
      background: var(--n-expand-bg); border: 1px solid var(--n-expand-border); color: var(--soft-icon);
    }
    .btn-expand:hover { background: var(--accent-tint); border-color: var(--accent-border); }
    .btn-expand[hidden] { display: none; }
    /* panneau latéral déjà ouvert : le bouton devient « Réduire » (chevron retourné) */
    .btn-expand.reduce svg { transform: rotate(180deg); }
    .btn-expand:hover { color: var(--link); }
    .btn-expand svg { transition: transform .25s; }
    /* Texte volumineux : on attire l'attention sur la bascule */
    .btn-expand.attn {
      background: var(--accent-tint); color: var(--link); border-color: var(--accent-border);
      animation: nudge 1.6s ease-in-out infinite;
    }
    @keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
    @media (prefers-reduced-motion: reduce) { .btn-expand.attn { animation: none; } }

    /* ---- Mode large : la carte de saisie passe dans une colonne à droite ---- */
    #sideCol[hidden] { display: none; }
    #sideCol .card-transcriber { margin-top: 0; }
    body.wide { width: 800px; }
    body.wide #layout {
      display: grid;
      grid-template-columns: 396px minmax(0, 1fr);
      column-gap: 18px;
      align-items: start;
    }
    body.wide .btn-expand svg { transform: rotate(180deg); }
    /* hauteurs alignées sur INPUT_MAX_HEIGHT de popup.js ; la popup est plafonnée à ~600 px */
    body.wide textarea#input { max-height: 190px; }
    body.wide #output { max-height: 200px; }
  
/* ---- Surcharges propres à la version web (ajoutées APRÈS la feuille de style de la popup de l'extension) ---- */

/* ---- Couleurs : palette du « livre de couleurs » + RÔLES ----
   Les couleurs de la palette (CMYK du livre converties en RVB, sans profil d'impression) :
     Sulphur Yellow  C4 M4 Y28 K0     -> #F5F5B8
     Eugenia Red     C7 M76 Y60 K0    -> #ED3D66
     Olive Green     C56 M40 Y85 K22  -> #58771E
     Cossack Green   C76 M32 Y91 K18  -> #328E13
   Le reste de la feuille n'utilise que des RÔLES (var(--...)) : un futur mode sombre ne sera qu'un second jeu de valeurs
   pour ces rôles (voir le bloc :root[data-theme="dark"] à ajouter), sans toucher aux composants. */
:root {
  --sulphur-yellow: #F5F5B8;
  --eugenia-red: #ED3D66;
  --olive-green: #58771E;
  --cossack-green: #328E13;
  --deep-indigo: #07157E;     /* Deep Indigo C95 M85 Y10 K45 (CMYK -> RVB sans profil d'impression) : titre du bandeau */
  --cossack-rgb: 50, 142, 19;
  --olive-rgb: 88, 119, 30;
  --eugenia-rgb: 237, 61, 102;

  /* surfaces et textes (mode clair) */
  --page-bg: #F1EDE0;
  --surface: #FFFFFF;
  --surface-field: #FFFEF2;
  --banner-bg: var(--sulphur-yellow);
  --text: #1A1A14;
  --text-field: #1B1A16;
  --text-soft: #66664A;
  --banner-title: var(--text);   /* « CHECHEN » et « Latin Script » en noir sur le jaune (choix de l'utilisateur, comme l'extension) */
  --text-subtitle: #3F5715;   /* sous-titre sur le jaune : olive foncé (contraste ~7,6) */
  --placeholder: #8A8C62;
  --on-brand: #FFFFFF;

  /* couleur principale (boutons, focus, liens) */
  --brand: var(--cossack-green);
  --brand-light: #2B8511;
  --brand-dark: #2A7A10;
  --link: #28720F; /* vert un peu plus foncé pour le PETIT texte des liens (contraste >= 4,5 sur le crème) */

  /* accent olive (texte du résultat, étiquettes, touches spéciales) */
  --accent: var(--olive-green);
  --accent-strong: #4A6618;
  --accent-deep: #3F5715;
  --accent-tint: #EDF2DA;
  --accent-border: #CBD9A0;
  --result-bg-top: #F7F9E6;
  --result-bg-bottom: #EDF2D3;

  /* contours et petits fonds */
  --border-card: #E6E8C8;
  --border-field: #E4E6C2;
  --border-field-hover: #CBD59A;
  --border-dash: #DADFB0;
  --chip-bg: var(--sulphur-yellow);
  --toggle-bg: #F3F3D2;
  --key-top: #FFFFFF;
  --key-bottom: #FAFAE6;
  --key-border: #E4E6C2;
  --key-edge: #DADDB0;
  --key-sp-top: #F2F7DF;
  --key-sp-bottom: #E1ECC0;
  --key-sp-border: #BCD08A;
  --key-sp-edge: #AFC47A;
  --key-hover-border: #7FB35A;
  --shadow-rgb: 88, 119, 30;

  /* drapeau */
  --flag-red: var(--eugenia-red);

  /* reflets et voiles (blancs en mode clair, presque invisibles en mode sombre) */
  --banner-glow: rgba(255,255,255,.7); --deco-glow: rgba(255,255,255,.55); --btn-soft: rgba(255,255,255,.75);
  --note-bg: rgba(255,255,255,.7); --inset-hi: rgba(255,255,255,.7); --stripe-white: #FFFFFF;
}

/* ---- Mode sombre : second jeu de valeurs pour les mêmes rôles (2.6) ----
   Les rôles partagés avec la popup de l'extension (bandeau, vert, olive, neutres --n-*, logo) viennent du bloc sombre de popup.htm ;
   ici les rôles propres au site. data-theme="dark" force le sombre, "light" le clair, sans attribut : suit le système. */
:root[data-theme="dark"] {
  --page-bg: #14170F; --surface: #1F231A; --surface-field: #191C14;
  --text: #F5F4E6; --text-field: #ECEADC; --text-soft: #A5A793; --text-subtitle: #CFE6A3; --placeholder: #7E816D;
  --border-card: #2E3426; --border-field: #3A4230; --border-field-hover: #4D5E36; --border-dash: #2E3426;
  --result-bg-top: #232A1B; --result-bg-bottom: #1E2517; --toggle-bg: #2B3322;
  --key-top: #2B3022; --key-bottom: #232719; --key-border: #3A4230; --key-edge: #10130B;
  --key-sp-top: #33402A; --key-sp-bottom: #2A3622; --key-sp-border: #465B33; --key-sp-edge: #1C2616; --key-hover-border: #6BA84A;
  --shadow-rgb: 0, 0, 0;
  --banner-glow: rgba(255,255,255,.04); --deco-glow: rgba(255,255,255,.05); --btn-soft: rgba(255,255,255,.06);
  --note-bg: rgba(255,255,255,.05); --inset-hi: rgba(255,255,255,.05); --stripe-white: #CFCDBB;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --page-bg: #14170F; --surface: #1F231A; --surface-field: #191C14;
  --text: #F5F4E6; --text-field: #ECEADC; --text-soft: #A5A793; --text-subtitle: #CFE6A3; --placeholder: #7E816D;
  --border-card: #2E3426; --border-field: #3A4230; --border-field-hover: #4D5E36; --border-dash: #2E3426;
  --result-bg-top: #232A1B; --result-bg-bottom: #1E2517; --toggle-bg: #2B3322;
  --key-top: #2B3022; --key-bottom: #232719; --key-border: #3A4230; --key-edge: #10130B;
  --key-sp-top: #33402A; --key-sp-bottom: #2A3622; --key-sp-border: #465B33; --key-sp-edge: #1C2616; --key-hover-border: #6BA84A;
  --shadow-rgb: 0, 0, 0;
  --banner-glow: rgba(255,255,255,.04); --deco-glow: rgba(255,255,255,.05); --btn-soft: rgba(255,255,255,.06);
  --note-bg: rgba(255,255,255,.05); --inset-hi: rgba(255,255,255,.05); --stripe-white: #CFCDBB;
  }
}

/* Page : crème neutre (la palette n'est qu'en accents, pour que le mode sombre reste simple) */
html { background: var(--page-bg); }
body.web {
  width: auto; max-width: none; min-height: 100vh; margin: 0; padding: 0;
  background:
    radial-gradient(900px 420px at 85% 110px, rgba(var(--cossack-rgb), .08), rgba(var(--cossack-rgb), 0) 70%),
    radial-gradient(700px 380px at 5% 520px, rgba(var(--eugenia-rgb), .05), rgba(var(--eugenia-rgb), 0) 70%),
    var(--page-bg);
}

/* ---- En-tête : bandeau Sulphur Yellow, pleine largeur, liseré aux couleurs du drapeau ---- */
body.web .banner {
  display: block; position: relative; border-radius: 0; padding: 0;
  background:
    radial-gradient(520px 260px at 92% -20%, rgba(var(--cossack-rgb), .16), rgba(var(--cossack-rgb), 0) 70%),
    radial-gradient(420px 220px at 6% 120%, var(--banner-glow), transparent 70%),
    var(--banner-bg);
  color: var(--text);
  box-shadow: 0 6px 22px rgba(var(--shadow-rgb), .14);
}
.hero-deco { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-deco span { position: absolute; border-radius: 50%; }
.hero-deco .c1 { width: 300px; height: 300px; right: -80px; top: -140px; border: 2px solid rgba(var(--cossack-rgb), .20); background: radial-gradient(circle, var(--deco-glow), transparent 70%); }
.hero-deco .c2 { width: 190px; height: 190px; left: 34%; bottom: -120px; border: 2px solid rgba(var(--cossack-rgb), .14); }
.hero-inner { position: relative; max-width: 680px; margin: 0 auto; padding: 18px 14px 34px; }
.banner-row { display: flex; align-items: center; gap: 10px; }
body.web .banner img { width: 58px; height: 58px; padding: 0; border-radius: 0; background: none; box-shadow: none;  }
body.web .banner .name-cap { color: var(--banner-title); font-size: clamp(19px, 5.2vw, 27px); letter-spacing: .09em; }
body.web .banner .name-script { color: var(--banner-title); font-size: clamp(26px, 7vw, 40px); }
body.web .subtitle {
  margin: 14px 2px 0; text-align: start; color: var(--text-subtitle);
  font: 600 clamp(14px, 3.6vw, 17px)/1.4 'Hanken Grotesk', 'Noto Sans', sans-serif; letter-spacing: .01em;
}
.flag-stripe { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: linear-gradient(180deg, var(--stripe-white) 0 22%, var(--flag-red) 22% 78%, var(--stripe-white) 78% 100%); box-shadow: 0 -1px 0 rgba(0,0,0,.08); }
body.web .lang-btn { height: 34px; padding: 0 10px 0 8px; box-shadow: 0 3px 10px rgba(var(--shadow-rgb), .16); background: var(--n-glass); border-color: var(--n-glass-border); }
body.web .lang-btn .flag { width: 24px; height: 16px; }
body.web .lang-btn:hover, body.web .lang-btn[aria-expanded="true"] { background: var(--accent-tint); color: var(--brand); border-color: var(--accent-border); }
body.web .lang-menu { z-index: 30; }

/* ---- Carte principale : superposée au bandeau ---- */
body.web #layout { max-width: 680px; margin: 22px auto 0; padding: 0 10px 34px; position: relative; z-index: 2; }
body.web .card-transcriber {
  margin-top: 0; padding: 22px; border-radius: 24px; border: 1px solid var(--border-card);
  box-shadow: 0 22px 48px rgba(var(--shadow-rgb), .16), 0 3px 8px rgba(0,0,0,.05);
}
body.web .card-head { min-height: 0; margin-bottom: 12px; }
body.web label.label-upper {
  display: inline-block; margin: 0; padding: 6px 12px; border-radius: 999px; cursor: text;
  background: var(--chip-bg); color: var(--accent-deep); font-size: 12.5px; letter-spacing: .12em;
}

/* ---- Saisie cyrillique : un vrai champ, grand et lisible ---- */
body.web textarea#input {
  max-height: none; padding: 14px 16px; min-height: 58px;
  font: 600 21px/1.5 'Noto Sans', sans-serif; color: var(--text-field);
  background: var(--surface-field); border: 2px solid var(--border-field); border-radius: 16px; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
body.web textarea#input::placeholder { color: var(--placeholder); font-weight: 500; }
body.web textarea#input:hover { border-color: var(--border-field-hover); }
body.web textarea#input:focus { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 5px rgba(var(--cossack-rgb), .18); }

body.web .misal-hint {
  margin-top: 12px; padding: 8px 14px; border-radius: 999px; font-size: 13px;
  background: var(--surface); border: 1.5px dashed var(--border-field-hover); color: var(--accent);
}
body.web .misal-hint:hover { background: var(--chip-bg); border-style: solid; color: var(--accent-deep); }

/* ---- Résultat : panneau olive clair ---- */
body.web .out-divider { display: none; }
body.web .out-panel {
  margin-top: 0; padding: 14px 18px 16px; border-radius: 18px;
  background: linear-gradient(160deg, var(--result-bg-top) 0%, var(--result-bg-bottom) 100%);
  border: 1.5px solid var(--accent-border);
  box-shadow: inset 0 1px 0 var(--inset-hi);
}
body.web .out-head { margin-bottom: 8px; }
body.web .out-head .lat { font-size: 13px; color: var(--accent-strong); letter-spacing: .14em; }
body.web #output { max-height: none; overflow-y: visible; font: 700 clamp(20px, 5vw, 25px)/1.5 'Noto Sans', sans-serif; color: var(--accent-strong); }
body.web .out-head { flex-wrap: wrap; gap: 8px; }
body.web .out-actions { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
body.web .out-panel .btn-copy {
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  border: 1.5px solid var(--accent-border); background: var(--btn-soft); color: var(--accent);
  transition: background .15s, color .15s, transform .08s, box-shadow .15s;
}
body.web .out-panel .btn-copy:hover { background: var(--surface); color: var(--brand); }
body.web .out-panel #btnCopy {
  background: linear-gradient(160deg, var(--brand-light), var(--brand-dark)); color: var(--on-brand); border-color: transparent;
  box-shadow: 0 6px 14px rgba(var(--cossack-rgb), .30);
}
body.web .out-panel #btnCopy:hover { filter: brightness(1.07); color: var(--on-brand); }
body.web .out-panel .btn-copy:active { transform: scale(.96); }
body.web .out-panel #btnCopy.done { background: var(--brand-dark); }

/* ---- Palette : touches en relief ---- */
body.web .alpha-block { margin-top: 18px; padding-top: 16px; border-top: 1.5px dashed var(--border-dash); }
body.web .alpha-toggle {
  padding: 10px 14px; border-radius: 14px; background: var(--toggle-bg); color: var(--accent); font-size: 13.5px;
  transition: background .15s, color .15s;
}
body.web .alpha-toggle:hover { background: var(--accent-tint); color: var(--brand); }
body.web .alpha-toggle .alpha-glyph { font-size: 18px; width: 22px; }
body.web .alpha-body { margin-top: 12px; }
body.web .alpha-field { border: 2px solid var(--border-field); background: var(--surface-field); border-radius: 16px; padding: 10px 12px; }
body.web textarea#latInput { font-size: 20px; font-weight: 400; color: var(--accent-strong); min-height: 52px; }
body.web .alpha-field-actions .btn-copy { font-weight: 700; }
body.web .alpha-shift { height: 34px; min-width: 40px; border-radius: 10px; border-width: 1.5px; font-size: 17px; }
body.web .alpha-keys { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; margin-top: 14px; }
body.web .alpha-key {
  height: 48px; border-radius: 13px; font-size: 19px; font-weight: 700;
  background: linear-gradient(180deg, var(--key-top), var(--key-bottom)); border: 1px solid var(--key-border);
  box-shadow: 0 3px 0 var(--key-edge), 0 6px 10px rgba(var(--shadow-rgb), .08); color: var(--text);
  transition: transform .06s, box-shadow .06s, background .12s, color .12s, border-color .12s;
}
body.web .alpha-key.sp {
  background: linear-gradient(180deg, var(--key-sp-top), var(--key-sp-bottom)); border-color: var(--key-sp-border); color: var(--accent-deep);
  box-shadow: 0 3px 0 var(--key-sp-edge), 0 6px 10px rgba(var(--shadow-rgb), .12);
}
body.web .alpha-key:hover { transform: translateY(-1px); border-color: var(--key-hover-border); color: var(--brand); }
body.web .alpha-key:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--key-edge); }
body.web .alpha-sep { margin: 4px 0; background: var(--border-card); }

/* ---- Bas de page ---- */
.web-note {
  display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  margin: 22px auto 8px; padding: 9px 16px; max-width: 520px; border-radius: 999px;
  background: var(--note-bg); border: 1px solid var(--border-field);
  font: 600 13px/1.45 'Hanken Grotesk', 'Noto Sans', sans-serif; color: var(--accent);
}
/* logo vectoriel du bandeau (mêmes flèches que l'extension) */
body.web .banner .logo { width: 64px; height: 52px; margin: 0 6px 0 2px; }
/* sélecteur de thème (automatique / clair / sombre) sous le pied de page */
.web-theme { display: flex; justify-content: center; margin: 14px 0 8px; }
.web-note[hidden] { display: none; }
#privacyLink { white-space: nowrap; }
.web-note-title { font-weight: 800; color: var(--link); letter-spacing: .02em; }
.web-lock { flex: none; color: var(--brand); }
/* note sur les boutons « Signaler » : plus bas sous la carte (marge du haut) pour ne pas coller à son ombre */
.web-note-small {
  display: block; margin: 40px auto 6px; padding: 0 12px; background: none; border: none; border-radius: 0;
  font-size: 12.5px; font-weight: 500; color: var(--text-soft); max-width: 560px;
}
.web-foot {
  text-align: center; margin: 14px 8px 0; font: 500 13px/1.9 'Hanken Grotesk', 'Noto Sans', sans-serif; color: var(--text-soft);
}
.web-foot a, .web-link { color: var(--link); text-decoration: none; font-weight: 600; }
.web-link { border: none; background: none; padding: 0; cursor: pointer; font-family: inherit; font-size: inherit; }
.web-foot a:hover, .web-link:hover { text-decoration: underline; }
.web-foot a:focus-visible, .web-link:focus-visible, .misal-hint:focus-visible, .btn-copy:focus-visible { outline: 3px solid rgba(var(--cossack-rgb), .55); outline-offset: 2px; border-radius: 6px; }

/* écran assez large : la carte chevauche le bandeau et laisse voir le liseré du drapeau de chaque côté */
@media (min-width: 720px) {
  .hero-inner { padding: 22px 16px 64px; }
  body.web #layout { margin-top: -34px; padding: 0 16px 34px; }
}
@container (max-width: 205px) { body.web .banner .name-script { display: none; } }
@media (max-width: 480px) {
  body.web .banner img { width: 44px; height: 44px; padding: 5px; }
  body.web .banner .logo { width: 46px; height: 38px; margin: 0 4px 0 0; }
  body.web .banner .name-cap { font-size: 15px; letter-spacing: .06em; }
  body.web .banner .name-script { font-size: 21px; }
  body.web .lang-btn { height: 32px; padding: 0 8px 0 7px; }
  body.web .out-panel .btn-copy { padding: 7px 11px; }
  body.web .lang-btn #langCode { display: none; } /* sur téléphone : drapeau seul (le nom de la langue est dans le menu) */
  body.web .card-transcriber { padding: 16px; border-radius: 20px; }
  body.web textarea#input { font-size: 19px; }
  body.web .alpha-keys { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 7px; }
  body.web .alpha-key { height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---- Sélecteur de thème (automatique / clair / sombre) : propre au site ----
   (l'extension a maintenant une icône dans sa bannière ; ces règles ne viennent donc plus du style de la popup) */
.theme-seg {
  --sw: 34px; --sh: 28px;
  position: relative; display: inline-grid; grid-template-columns: repeat(3, var(--sw)); direction: ltr; --i: 0;
  padding: 2px; border: 1px solid var(--n-line2); background: var(--n-surface); border-radius: 999px;
}
.theme-seg .thumb {
  position: absolute; top: 2px; left: 2px; width: var(--sw); height: var(--sh); box-sizing: border-box; border-radius: 999px;
  background: var(--chip-bg); border: 1px solid var(--accent-border);
  transform: translateX(calc(var(--i) * var(--sw))); transition: transform .22s cubic-bezier(.4, .1, .2, 1);
}
.theme-seg button {
  position: relative; z-index: 1; height: var(--sh); padding: 0; border: 0; background: transparent; border-radius: 999px;
  color: var(--n-text3); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: color .15s;
}
.theme-seg button svg { width: 15px; height: 15px; display: block; }
.theme-seg button:hover, .theme-seg button[aria-checked="true"] { color: var(--link); }
.theme-seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .theme-seg .thumb { transition: none; } }

/* le nom « Latin Script » du bandeau de l'extension se masque à 237 px ; sur le site, c'est à 205 px (règle plus haut) */
@container (min-width: 206px) { body.web .banner .name-script { display: block; } }

/* ---- Partage : menu sous le bouton « Partager » (résultat) et sous « Partager le projet » (pied de page) ---- */
.share-wrap { position: relative; display: inline-block; }
.share-menu { min-width: 200px; z-index: 40; text-align: start; }
.share-menu.up { top: auto; bottom: calc(100% + 8px); }
.share-wrap-foot { line-height: 1.2; }
.web-foot .nowrap { white-space: nowrap; }
.share-menu .lang-item { white-space: nowrap; }
.share-menu .lang-item.done { color: var(--brand); }
/* ---- Écrire en latin -> cyrillique (prototype 2.7) : résultat sous le champ « Lettres latines » ---- */
.rev-block { margin-top: 12px; }
.rev-block[hidden] { display: none; }
body.web #revOut { max-height: none; overflow-y: visible; overflow-wrap: anywhere; font: 400 19px/1.5 'Noto Sans', sans-serif; color: var(--accent-strong); }
/* mots douteux : variantes au clic (souligné en pointillés = choix par défaut peu sûr) */
.rev-w { cursor: pointer; border-radius: 6px; transition: background .12s; }
.rev-w:hover { background: var(--chip-bg); }
.rev-w:focus-visible { outline: 3px solid rgba(var(--cossack-rgb), .55); outline-offset: 2px; }
.rev-doubt { text-decoration: underline dotted; text-decoration-thickness: 2px; text-underline-offset: 5px; }

/* ---- Téléphone / écran tactile (2.8) : zones tactiles d'au moins 44 px, double cadre du résultat cyrillique retiré ---- */
/* (le style de la popup de l'extension, repris par le site, encadre déjà « .rev-block » : sur le site le cadre est celui de .out-panel) */
body.web .rev-block { border: 0; background: none; padding: 0; border-radius: 0; }
body.web button, body.web a, body.web .alpha-key, body.web .rev-w { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@media (pointer: coarse), (max-width: 480px) {
  .theme-seg { --sw: 48px; --sh: 44px; }
  .theme-seg button svg { width: 19px; height: 19px; }
  body.web .lang-btn { min-height: 44px; }
  body.web .out-panel .btn-copy, body.web .alpha-field-actions .btn-copy { min-height: 44px; padding: 10px 16px; }
  body.web .alpha-shift { min-width: 48px; height: 44px; }
  body.web #alphaClear { min-width: 44px; min-height: 44px; font-size: 18px; }
  body.web .alpha-field-actions { gap: 4px; }
  body.web .rev-w { display: inline-block; padding: 9px 3px; margin: 0 -2px; }
  body.web .lang-item { min-height: 46px; }
  body.web .web-foot a, body.web .web-link { display: inline-block; padding: 14px 5px; }
  body.web .web-foot { line-height: 1.2; }
  /* touches de la palette : compactes comme un clavier (7 par rangée sur un téléphone courant), sans prendre tout l'écran */
  body.web .alpha-keys { grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 6px; margin-top: 10px; }
  body.web .alpha-key { height: 42px; min-width: 36px; font-size: 18px; border-radius: 11px; }
  body.web .misal-hint { min-height: 44px; }
  body.web .alpha-toggle { min-height: 48px; }
}
@supports (padding: max(0px)) {
  body.web { padding-bottom: env(safe-area-inset-bottom); }
}

/* ---- Téléphone : « dézoomer » (2.8.1) : tout le site est affiché à 85 % de sa taille sur un écran étroit, pour montrer plus de contenu ---- */
@media (max-width: 480px) {
  @supports (zoom: 1) {
    body.web { zoom: .85; }
    /* les zones à toucher gardent 44 px réels malgré le zoom (44 / 0,85 ≈ 52) */
    .theme-seg { --sw: 56px; --sh: 52px; }
    body.web .lang-btn { min-height: 52px; }
    body.web .out-panel .btn-copy, body.web .alpha-field-actions .btn-copy { min-height: 52px; }
    body.web .alpha-shift { min-width: 56px; height: 52px; }
    body.web #alphaClear { min-width: 52px; min-height: 52px; }
    body.web .misal-hint { min-height: 52px; }
    body.web .lang-item { min-height: 54px; }
    body.web .alpha-toggle { min-height: 56px; }
    body.web .rev-w { padding: 13px 6px; margin: 0 -4px; }
    body.web .web-foot a, body.web .web-link { padding: 20px 5px; }
    body.web .alpha-keys { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 7px; margin-top: 12px; }
    body.web .alpha-key { height: 49px; min-width: 42px; font-size: 20px; border-radius: 13px; }
  }
}