/* ==========================================================================
   ETeext — MODE EMBARQUÉ (plan C1, lot B, 14/10/2026). Chargé sur toutes les
   pages mais SANS EFFET hors `html.embed2` (classe posée par js/embed.js avant
   le premier rendu, seulement avec `?embed=2`). Aucune valeur de style.css n'est
   modifiée : ce fichier ne fait que MASQUER ce qui ne sert pas dans le cadre et
   habiller les trois éléments propres au cadre (calque, bande, bouton).
   Repris de la maquette validée par Denis le 12/10 (prototype/app-embed/css/embed.css,
   session audience), rattaché à <html> au lieu de <body>.
   ========================================================================== */

/* --- ce qui demande un compte, ou ne sert pas à un essai : masqué --- */
html.embed2 header, html.embed2 .nk-block-head { display: none !important; }   /* en-tête et slogan */
html.embed2 #anon-banner, html.embed2 #sw-update-banner, html.embed2 #install-prompt, html.embed2 #install-ios { display: none !important; }
html.embed2 .dropdown-wrapper:has(#dropdown-ai) { display: none !important; }   /* menu IA */
html.embed2 #shareBtn, html.embed2 [data-action="openAskPage"], html.embed2 [data-action="saveNote"], html.embed2 [data-action="triggerInstall"] { display: none !important; }
html.embed2 body { padding-top: 0 !important; overflow: hidden !important; }
html.embed2 .nk-content { padding-top: 8px !important; padding-bottom: 0 !important; }
html.embed2 .nk-content, html.embed2 .row, html.embed2 .col-left { padding: 0 !important; margin: 0 !important; }
html.embed2 .editor-footer, html.embed2 .char-count-line, html.embed2 #footerMessage, html.embed2 .col-right { display: none !important; }
html.embed2 .editor-container { box-shadow: none !important; position: relative; }
html.embed2 .btn-toolbar { padding-top: 6px !important; }
/* rien après l'éditeur dans la colonne (bascule « Aperçus » incluse) */
html.embed2 .editor-container ~ * { display: none !important; }
/* dans l'éditeur : seuls la barre, la zone (dans son calque), la bande et le bouton */
html.embed2 .editor-container > *:not(.btn-toolbar):not(.embed-mirror-wrap):not(.embed-pill):not(.embed-cta):not(#editorAlert) { display: none !important; }

/* --- zone de saisie : 2 lignes au moins, hauteur qui suit le contenu (js/embed.js, `ajuster`) ---
   [15/10/2026] Retirés : `height: auto !important` et `max-height: 5.4em !important`. Le premier ÉCRASAIT la
   hauteur que le script pose en ligne (mesuré : 136,8 px demandés, 115 rendus), le second plafonnait à
   3 lignes. Une phrase de 3 lignes ou plus débordait sous la bande jaune (iPhone 14 Plus de Denis, relayé
   par Vitrine : 46 phrases sur 150 à 390 px). Le plafond est désormais dans le script, et `overflow` n'est
   plus `!important` pour que le script puisse ouvrir le défilement au-delà.
   Plafond de 8 lignes (8 × 1,45em + les marges) gardé ICI, et non dans le seul script : autoGrow (app.js), qui
   colle la zone au contenu sans plafond, s'exécute APRÈS notre script quand on tape. Mesuré : 16 lignes sinon. */
html.embed2 textarea.form-control { min-height: 3.8em !important; max-height: calc(11.6em + 1.1rem) !important; overflow: hidden; resize: none !important; font-size: 1.1rem !important; line-height: 1.45 !important; padding: .55rem 1rem .55rem .9rem !important; position: relative; z-index: 1; }
@media (max-width: 360px) { html.embed2 textarea.form-control { font-size: 1rem !important; } }
/* Android : la bande d'aération de l'app (style.css, `body.is-android`, 60 px validés le 16/07) revient dans
   le cadre. La règle ci-dessus l'écrasait (même poids, chargée après) : test Android de Denis, 14/10 — « la
   première ligne n'est pas décalée », le menu Copier/Coller d'une sélection couvrait les boutons de style.
   Même valeur que l'app ; les hauteurs mini/maxi gagnent la différence pour garder deux à trois lignes. */
html.embed2 body.is-android textarea.form-control { padding-top: 60px !important; min-height: calc(3.8em + 60px - .55rem) !important; max-height: calc(11.6em + 60px + .55rem) !important; }

/* --- calque de sélection simulée : même boîte que la zone, jamais de focus --- */
.embed-mirror-wrap { position: relative; }
.embed-mirror { position: absolute; inset: 0 0 auto 0; background: #fff; color: #111827; white-space: pre-wrap; overflow-wrap: anywhere; pointer-events: none; z-index: 2; border-radius: inherit; overflow: hidden; }
.embed-mirror mark { background: #b4d5fe; color: inherit; border-radius: 2px; }

/* --- bouton de style allumé pendant l'animation --- */
.toolbar-btn.embed-hl { outline: 3px solid #f9d423 !important; outline-offset: 2px; transform: scale(1.08); transition: transform .15s; }

/* --- bande d'invitation, pleine largeur sous la zone, retirée au premier geste --- */
.embed-pill { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; margin: 0; padding: 6px 14px; border: 0; border-radius: 0; text-align: left; font: inherit; font-size: .85rem; font-weight: 600; color: #111; background: #f9d423; cursor: pointer; animation: embed-pulse-bg 1.8s ease-in-out infinite; }
.embed-pill b { font-weight: 800; }
.embed-pill.strong { animation-duration: .9s; background: #ff8c42; color: #fff; }
@keyframes embed-pulse-bg { 0%, 100% { background: #f9d423; } 50% { background: #ffe66b; } }
@media (prefers-reduced-motion: reduce) { .embed-pill { animation: none; } }

/* --- le bouton unique et sa ligne d'explication --- */
.embed-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 12px 10px; background: var(--bg-surface, #22223b); border-top: 1px solid rgba(255,255,255,.08); }
.embed-cta button { min-height: 48px; padding: 0 18px; border: 0; border-radius: 12px; font: inherit; font-weight: 800; color: #fff; background: linear-gradient(90deg, #6c3cff, #ff3cac); cursor: pointer; white-space: nowrap; }
@media (max-width: 639px) { .embed-cta button { flex: 1 1 100%; } }   /* téléphone : le bouton prend toute la largeur, la ligne d'explication dessous */
.embed-cta button.done { background: #16c172; }
.embed-cta .hint { font-size: .95rem; color: #e6e6f0; line-height: 1.35; }
.embed-cta .hint b { color: #fff; }
@media (min-width: 640px) { .embed-cta { flex-wrap: nowrap; } .embed-cta .hint { flex: 1 1 auto; } }

/* --- POLICES DU CADRE (décision Denis 14/10, relayée par la session audience) ---
   Mesuré le 14/10 : les cinq graisses d'Inter (400 à 800) sont LE MÊME FICHIER, une police variable copiée
   sous cinq noms (empreintes md5 identiques, en latin comme en latin-ext). Le navigateur, qui met en cache
   par adresse, téléchargeait les mêmes octets une fois par graisse employée. Dans le cadre, la famille
   'InterEmbed' déclare donc UNE face par sous-ensemble, plage 400-800, vers UN fichier : 48 Ko en latin,
   85 Ko en latin-ext seulement si un caractère de cette plage est affiché (ex. les petites capitales),
   plus vietnamien et cyrillique (déjà variables) selon la langue. Plages Unicode LUES dans style.css.
   Remplace --font-family pour html.embed2 seulement : rien ne change hors du cadre. */
@font-face { font-family: 'InterEmbed'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('/fonts/Inter-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'InterEmbed'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('/fonts/Inter-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face {
            font-family: 'InterEmbed';
            font-style: normal;
            font-weight: 400 800;
            font-display: swap;
            src: url('/fonts/Inter-vietnamese.woff2') format('woff2');
            unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
        }
@font-face {
            font-family: 'InterEmbed';
            font-style: normal;
            font-weight: 400 800;
            font-display: swap;
            src: url('/fonts/Inter-cyrillic.woff2') format('woff2');
            unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
        }
html.embed2 { --font-family: 'InterEmbed', 'Noto Sans Devanagari', system-ui, -apple-system, sans-serif; font-synthesis: none; }
.embed-cta button, .embed-cta .hint b, .embed-pill, .embed-pill b { font-weight: 600; }
