/* ──────────────────────────────────────────────────────────────────────────────
   fileWindow — le CORPS des fenêtres de lecture de fichiers (public/js/fileWindow*.js) et le zoom de la barre (aqZoom.js).
   La coque, la barre et les flèches sont dans aqWindow.css (à charger AVANT).

   Réglages validés (planche v2, 2026-10-10) : AUCUNE carte (le texte est posé sur le fond de la fenêtre), pas de filet visible,
   interligne 1,72. La COLONNE et la TAILLE du texte, depuis la recette du 2026-10-16, sont celles de l'éditeur Scribe (--text-column-w et --text-size,
   variables.css : une seule valeur chacune pour l'édition et la lecture, donc les mêmes retours à la ligne ; c'était 570 px et 18 px). Le zoom agrandit
   le TEXTE (--fw-zoom) ; la colonne grandit avec lui puis se recompose dans la fenêtre : jamais de défilement horizontal.
   ────────────────────────────────────────────────────────────────────────────── */

/* ── Corps ────────────────────────────────────────────────────────────────── */
.fw-host { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.fw-scroll {
    flex: 1;
    min-width: 0;
    min-height: 0;
    padding: 0 28px;
    overflow-x: hidden;                 /* le texte se recompose, il ne déborde jamais */
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;                /* le pincement est géré en JS (aqZoom) */
    outline: none;
}
.fw-empty { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; color: var(--color-text-secondary, #86868b); font-size: 14px; text-align: center; }
.fw-empty p { margin: 0; }
.fw-skel { height: 14px; margin: 14px 0; border-radius: 7px; background: color-mix(in srgb, var(--color-text, #1d1d1f) 9%, transparent); animation: fw-pulse 1.2s ease-in-out infinite; }
@keyframes fw-pulse { 50% { opacity: .45; } }

/* ── Texte continu (Markdown) ─────────────────────────────────────────────── */
.fw-md {
    --fw-zoom: 1;
    box-sizing: border-box;
    max-width: calc(var(--text-column-w) * var(--fw-zoom));      /* la colonne de l'éditeur Scribe (variables.css), qui suit la taille du texte… puis le plafond, c'est la fenêtre */
    margin: 0 auto;
    padding: 8px 0 72px;
    font-size: calc(var(--text-size) * var(--fw-zoom));       /* la taille du texte de l'éditeur Scribe (variables.css) ; 15 px sur téléphone, par la variable */
    line-height: 1.72;
    color: var(--color-text, #1d1d1f);
    overflow-wrap: anywhere;
}
.fw-md h1, .fw-md h2, .fw-md h3, .fw-md h4 { margin: 1.5em 0 .5em; line-height: 1.25; letter-spacing: -.01em; }
.fw-md > h1:first-child { margin-top: .2em; font-size: 1.6em; font-weight: 700; }
.fw-md-body > h1 { font-size: 1.45em; font-weight: 700; }
.fw-md h2 { font-size: 1.28em; font-weight: 650; }
.fw-md h3 { font-size: 1.12em; font-weight: 650; }
.fw-md h4 { font-size: 1em; font-weight: 650; }
.fw-md p { margin: 0 0 .9em; }
.fw-md ul, .fw-md ol { margin: .4em 0 .9em; padding-left: 1.5em; }
.fw-md li { margin: .25em 0; }
.fw-md li > p { margin: 0; }
.fw-md ul.contains-task-list, .fw-md li.task-list-item { list-style: none; }
.fw-md li.task-list-item input { margin: 0 .5em 0 -1.4em; vertical-align: middle; }
.fw-md a { color: var(--color-primary, #007aff); text-decoration: underline; text-underline-offset: .15em; text-decoration-thickness: 1px; }
.fw-md strong { font-weight: 650; }
.fw-md blockquote { margin: 1em 0; padding: .4em 1.1em; border-radius: 12px; background: color-mix(in srgb, var(--color-text, #1d1d1f) 5%, transparent); color: var(--color-text-secondary, #86868b); }
.fw-md blockquote p:last-child { margin-bottom: 0; }
.fw-md code { padding: .08em .35em; border-radius: 6px; background: color-mix(in srgb, var(--color-text, #1d1d1f) 8%, transparent); font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .88em; }
.fw-md pre { margin: 1em 0; padding: .9em 1.1em; border-radius: 12px; background: color-mix(in srgb, var(--color-text, #1d1d1f) 7%, transparent); font-size: .86em; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.fw-md pre code { padding: 0; background: none; font-size: 1em; }
.fw-md hr { height: 2px; margin: 1.8em auto; width: 3em; border: 0; border-radius: 1px; background: color-mix(in srgb, var(--color-text, #1d1d1f) 18%, transparent); }
.fw-md img, .fw-md video, .fw-md svg { max-width: 100%; height: auto; border-radius: 10px; }
.fw-md table { width: 100%; margin: 1em 0; border-collapse: collapse; table-layout: auto; font-size: .92em; }
.fw-md th, .fw-md td { padding: .45em .7em; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.fw-md th { font-weight: 650; background: color-mix(in srgb, var(--color-text, #1d1d1f) 7%, transparent); }
.fw-md tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--color-text, #1d1d1f) 3.5%, transparent); }
/* Un saut de page du fichier : en lecture continue, un simple repère (le document PAGINÉ se voit dans Imprimer). */
.fw-md .scribe-page-break { margin: 1.8em 0; text-align: center; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--color-text-tertiary, #aeaeb2); }
.fw-muted { color: var(--color-text-secondary, #86868b); }
/* Un document texte (.txt : fileWindowText.js) : la MÊME colonne, la même police et le même interligne que le Markdown (`.fw-md`) ; le texte garde ses retours à la ligne (jamais interprété). */
.fw-txt-body { white-space: pre-wrap; }
/* Images distantes : non chargées tant qu'on ne le demande pas (fileWindowImages.js). Une ligne discrète, un repère à la place de l'image : ni carte, ni couleur.
   Même ligne pour « Début du fichier (100 Ko sur X) » (.fw-truncated : fileWindowActions.truncatedNote), quand la route de lecture a coupé le texte ; `.fw-md .fw-truncated` pour
   l'emporter sur `.fw-md p` (sans lui, la marge du paragraphe Markdown prenait le dessus : mesuré en vrai Chrome, 11,7 px au lieu de 14,3 px). Ce n'est PAS `.fw-note` :
   cette classe est celle de l'ARTICLE d'une note Scribe lue (scribeReading.js) -- la mise en page d'une mention (13 px, grise, en ligne) l'avait rendu petit et gris. */
.fw-img-notice, .fw-truncated, .fw-md .fw-truncated { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 1.1em; font-size: 13px; line-height: 1.45; color: var(--color-text-secondary, #86868b); }
.fw-img-show { flex: none; height: 28px; padding: 0 12px; border: 0; border-radius: 14px; background: color-mix(in srgb, var(--color-text, #1d1d1f) 9%, transparent); color: var(--color-text, #1d1d1f); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .15s; }
.fw-img-show:hover { background: color-mix(in srgb, var(--color-text, #1d1d1f) 14%, transparent); }
.fw-img-show:focus-visible { outline: 2px solid var(--color-primary, #007aff); outline-offset: 2px; }
.fw-img-blocked { display: inline-block; max-width: 100%; padding: .1em .6em; border-radius: 8px; background: color-mix(in srgb, var(--color-text, #1d1d1f) 7%, transparent); color: var(--color-text-secondary, #86868b); font-size: .85em; overflow-wrap: anywhere; }

/* ── Le volet Informations de la page, ouvert DEPUIS la fenêtre (⋯ → Informations, Ctrl I) ────────────────────────────────────────
   Le volet (#fislide-panel, --z-panel dans app.css) est celui de la page : tant qu'une fenêtre est ouverte il passe DEVANT elle (--z-window-panel,
   variables.css) mais DERRIÈRE les boîtes de dialogue que l'un ou l'autre ouvre (Partager, Renommer… : --z-modal-backdrop), et la fenêtre prend
   toute la place qui reste (largeur et marge du volet : les variables de app.css ; le bloc « À CÔTÉ d'un volet » plus bas). Sous 901 px le volet recouvre
   (plein écran sous 600 px) : la fenêtre ne bouge pas. Le VOILE, lui, ne bouge jamais : un seul flou sur tout l'écran, derrière la fenêtre
   ET derrière le volet (le rétrécir laissait le Nuage net autour du volet et dans la bande qui le sépare de la fenêtre) ; seule la
   fenêtre se décale (--aqw-room, aqWindow.css). */
body:has(.aqw-backdrop) .fislide-panel { z-index: var(--z-window-panel); }
.fislide-panel:focus { outline: none; }          /* le focus posé sur le volet à son ouverture au clavier est technique (Tab entre ensuite dans ses contrôles, qui ont le leur) : pas de cercle autour de tout le volet */
@media (min-width: 901px) {
    body:has(#fislide-panel.visible) .aqw-backdrop { --aqw-room: calc(var(--fislide-w, 400px) + 2 * var(--fislide-gap, 20px)); }
}
/* Le volet AURORE (#chat-slide-panel, templates/partials/chat-panel.php) : mêmes couches, même place -- à côté de la fenêtre, comme celui d'Informations (les deux s'excluent, chat-panel.php).
   Sa largeur et sa marge sont les variables de app.css (--notif-slide-w/gap) ; un clic ou une saisie dans Aurore ne touche pas la fenêtre (touches : fileWindow.js, écran fichier : auroreFile.js). */
body:has(.aqw-backdrop) #chat-slide-panel { z-index: var(--z-window-panel); }
@media (min-width: 901px) {
    body:has(#chat-slide-panel.visible) .aqw-backdrop { --aqw-room: calc(var(--notif-slide-w, 440px) + 2 * var(--notif-slide-gap, 20px)); }
}
/* ── À CÔTÉ d'un volet : alignée sur lui, et sur TOUTE la place qui reste ──────────────────────────────────────────────────────────────────
   Un volet ouvert (Aurore, ou celui d'un Flow) et la fenêtre sont deux surfaces flottantes de la même page : même haut, même bas, la MÊME marge partout (--float-gap, variables.css :
   en haut, en bas, à gauche, et entre la fenêtre et le volet -- --aqw-room est la largeur du volet PLUS ses deux marges). Elle prend toute la place à gauche du volet, quelle que soit la taille
   propre au fichier (--aqw-w / --aqw-h de api.setSize) : une image ou une vidéo remplit la place, elle ne garde plus ses proportions. Les flèches ← → n'ont plus de place DEHORS : elles
   rentrent, comme sous 1091 px. Le plein écran (.aqw-backdrop--max) a sa règle (aqWindow.css) ; sous 901 px le volet recouvre, la fenêtre ne bouge pas. */
@media (min-width: 901px) {
    body:is(:has(#fislide-panel.visible), :has(#chat-slide-panel.visible)) .aqw-backdrop:not(.aqw-backdrop--max) .aqw { --aqw-w: 100% !important; --aqw-h: 100% !important; }
    body:is(:has(#fislide-panel.visible), :has(#chat-slide-panel.visible)) .aqw-backdrop:not(.aqw-backdrop--max) .aqw-rail { left: var(--float-gap, 20px); width: calc(100% - var(--float-gap, 20px) - var(--aqw-room)); transform: none; }
    body:is(:has(#fislide-panel.visible), :has(#chat-slide-panel.visible)) .aqw-backdrop:not(.aqw-backdrop--max) .aqw-nav.aqw-ib { width: 40px; height: 40px; margin-top: -20px; }
    body:is(:has(#fislide-panel.visible), :has(#chat-slide-panel.visible)) .aqw-backdrop:not(.aqw-backdrop--max) .aqw-nav--prev { right: auto; left: 8px; }
    body:is(:has(#fislide-panel.visible), :has(#chat-slide-panel.visible)) .aqw-backdrop:not(.aqw-backdrop--max) .aqw-nav--next { left: auto; right: 8px; }
}

/* ── Lecteur PDF (fileWindowPdf.js) : PdfPreview posé DANS la fenêtre, sans sa barre ─────────────────────────────────────────────
   Les pages (blanches) sont posées sur un fond neutre, sans cadre sombre ; le volet des miniatures se SUPERPOSE aux pages (il n'en
   change pas la largeur : PdfPreview ne les recompose pas à son ouverture). Signatures et annotations posées : lecture seule. */
.fwp-view { flex: 1; min-width: 0; min-height: 0; display: flex; position: relative; outline: none; }
.pdfprev-overlay.pdfprev-embed {
    position: relative;
    inset: auto;
    z-index: auto;
    flex: 1;
    width: 100%;
    min-width: 0;
    min-height: 0;
    background: transparent;
    color: var(--color-text, #1d1d1f);
}
.pdfprev-embed .pdfprev-body { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.pdfprev-embed .pdfprev-main { background: color-mix(in srgb, var(--color-text, #1d1d1f) 6%, var(--color-surface, #fff)); padding: 18px 0 28px; outline: none; }
.pdfprev-embed .pdfprev-page { box-shadow: 0 2px 14px rgba(0, 0, 0, .16); }
.pdfprev-embed .pdfprev-sidebar {
    position: absolute;
    z-index: 3;
    top: 0;
    bottom: 0;
    left: 0;
    background: var(--aqw-pop, var(--color-surface, #fff));
    border: 0;
    box-shadow: 8px 0 28px rgba(0, 0, 0, .18);
}
.pdfprev-embed .pdfprev-sidebar.collapsed { box-shadow: none; }
.pdfprev-embed .pdfprev-thumb:hover { background: color-mix(in srgb, var(--color-text, #1d1d1f) 6%, transparent); }
.pdfprev-embed .pdfprev-thumb-canvas-wrap { box-shadow: 0 1px 5px rgba(0, 0, 0, .2); }
.pdfprev-embed .pdfprev-thumb.active .pdfprev-thumb-canvas-wrap { outline-color: var(--color-primary, #007aff); }
.pdfprev-embed .pdfprev-thumb-label, .pdfprev-embed .pdfprev-thumb.active .pdfprev-thumb-label { color: var(--color-text-secondary, #86868b); }
.pdfprev-embed .pdfprev-error { color: var(--color-danger, #d70015); background: color-mix(in srgb, var(--color-danger, #d70015) 9%, transparent); }
.pdfprev-embed .pdfsign-placed { pointer-events: none; border-color: transparent; }
.fwp-tools { display: flex; align-items: center; gap: 6px; }
.fwp-pages { display: inline-flex; align-items: center; gap: 2px; }
.fwp-pages .aqw-ib[disabled] { opacity: .35; cursor: default; }
.fwp-pages .aqw-ib[disabled]:hover { background: transparent; color: var(--color-text-secondary, #86868b); }
.fwp-count, .fwp-marker {
    min-width: 62px;
    height: 30px;
    padding: 0 8px;
    border: 0;
    border-radius: 15px;
    background: transparent;
    color: var(--color-text-secondary, #86868b);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.fwp-count:hover, .fwp-count[aria-expanded="true"] { background: color-mix(in srgb, var(--color-text, #1d1d1f) 9%, transparent); color: var(--color-text, #1d1d1f); }
.fwp-count:focus-visible, .fwp-marker:focus-visible { outline: 2px solid var(--color-primary, #007aff); outline-offset: 2px; }
.fwp-marker { display: none; }

/* ── Zoom de la barre : « − 100% + » (aqZoom.js), jamais sur le contenu ───── */
.aqz { display: inline-flex; align-items: center; gap: 2px; }
.aqz-pct {
    min-width: 54px;
    height: 30px;
    padding: 0 6px;
    border: 0;
    border-radius: 15px;
    background: transparent;
    color: var(--color-text-secondary, #86868b);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.aqz-pct:hover { background: color-mix(in srgb, var(--color-text, #1d1d1f) 9%, transparent); color: var(--color-text, #1d1d1f); }
.aqz-pct:focus-visible { outline: 2px solid var(--color-primary, #007aff); outline-offset: 2px; }
.aqz .aqw-ib[disabled] { opacity: .35; cursor: default; }
.aqz .aqw-ib[disabled]:hover { background: transparent; color: var(--color-text-secondary, #86868b); }

/* ── Image (fileWindowImage.js) : la scène, posée sur un fond neutre, sans cadre ─────────────────────────────────────────────────
   La fenêtre prend les proportions de l'image (api.setSize, animée : aqWindow.css). */
.fwi { position: relative; flex: 1; min-width: 0; min-height: 0; display: flex; }
.fwi-stage {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    outline: none;
    touch-action: none;                  /* le pincement, le glisser et le balayage sont gérés en JS */
    user-select: none;
    -webkit-user-select: none;
    background: color-mix(in srgb, var(--color-text, #1d1d1f) 5%, var(--color-surface, #fff));
}
.fwi-stage.fwi-zoomed { cursor: grab; }
.fwi-stage.fwi-zoomed:active { cursor: grabbing; }
.fwi-img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center; will-change: transform; transition: filter .25s ease; -webkit-user-drag: none; }
.fwi-img.fwi-blur { filter: blur(10px); }
.fwi-badge {
    position: absolute;
    z-index: 2;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 12px;
    border-radius: 14px;
    background: color-mix(in srgb, #000 62%, transparent);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
.fwi-badge.visible { opacity: 1; }
.aqw--max .fwi-stage { background: #000; }

/* ── La barre flottante (fileWindowFloat.js) : une pastille en bas du corps, jamais sur le contenu ───────────────────────────── */
.fwf {
    position: absolute;
    z-index: 3;
    left: 50%;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    max-width: calc(100% - 24px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;                /* seule la pastille (et la bulle) reçoit le clic : le reste laisse passer vers l'image */
}
.fwf-row {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 5px 8px;
    border-radius: 26px;
    background: color-mix(in srgb, var(--color-surface, #fff) 86%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
}
.fwf-pop { pointer-events: auto; }
.fwf-pop[hidden] { display: none; }
.fwf-sep { flex: none; width: 10px; }                                  /* un simple intervalle : aucun filet */
.fwf-rating { display: inline-flex; align-items: center; }
.fwf-star { width: 30px; height: 30px; }
.fwf-star svg { width: 16px; height: 16px; }
.fwf-star.fwf-star-on, .fwf-star.fwf-star-on:hover { color: #f5b50a; background: transparent; }
.fwf-btn:focus-visible, .aqz .aqw-ib:focus-visible, .aqz-pct:focus-visible { outline: 2px solid var(--color-primary, #007aff); outline-offset: 2px; }
.fwi-exif {
    min-width: 240px;
    max-width: min(340px, 86vw);
    max-height: 42vh;
    overflow: auto;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--aqw-pop, var(--color-surface, #fff));
    color: var(--color-text, #1d1d1f);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .34);
    font-size: 13px;
}
.fwi-exif-head { margin-bottom: 8px; font-weight: 700; }
.fwi-exif table { width: 100%; border-collapse: collapse; }
.fwi-exif td { padding: 3px 0; vertical-align: top; overflow-wrap: anywhere; }
.fwi-exif td:first-child { padding-right: 14px; white-space: nowrap; color: var(--color-text-secondary, #86868b); }
.fwi-exif a { color: var(--color-primary, #007aff); }

/* Le fondu du plein écran : après 2,5 s sans geste, la barre de titre, les flèches et la barre flottante s'effacent (réveil au moindre geste).
   Les boutons des flèches ont leur propre `pointer-events: auto` (aqWindow.css) : sans la règle dédiée, ils resteraient cliquables, invisibles. */
.aqw-backdrop--max .aqw-bar, .aqw-backdrop--max .fwf, .aqw-backdrop--max .fws { transition: opacity .35s ease; }
.aqw-backdrop--max .aqw-rail { transition: opacity .35s ease, left var(--aqw-slide), width var(--aqw-slide); }          /* le fondu ET le glissement avec le volet (aqWindow.css) : une règle de plein écran qui ne dirait que l'opacité écraserait le second */
.aqw-backdrop--max.fw-idle .aqw-bar, .aqw-backdrop--max.fw-idle .aqw-rail, .aqw-backdrop--max.fw-idle .fwf, .aqw-backdrop--max.fw-idle .fws { opacity: 0; pointer-events: none; }
.aqw-backdrop--max.fw-idle .aqw-nav.aqw-ib, .aqw-backdrop--max.fw-idle .fwf-row, .aqw-backdrop--max.fw-idle .fwf-pop { pointer-events: none; }
.aqw-backdrop--max.fw-idle { cursor: none; }
/* Image et vidéo (celles qui ont la pastille .fwf, seules à effacer leurs contrôles) : tout devient NOIR avec eux -- la bande de la barre de titre s'efface aussi, sans bande
   blanche. Le texte et la fiche (ni pastille, ni fondu) gardent le fond du thème. Le fond suit le fondu (la transition est posée sur l'état de base, pas seulement sur l'état effacé). */
.aqw-backdrop--max:has(.fwf) .aqw { transition: var(--aqw-transition), background-color .35s ease; }
.aqw-backdrop--max.fw-idle .aqw { background: #000; }

/* ── La bande de vignettes (fileWindowStrip.js) : dans le pied de la coque, en plein écran seulement ──────────────────────────────────────────
   Le pied (`.aqw-footer`, des boutons d'action) n'a ici ni marge ni alignement : la bande le remplit. `.fws-mark` est le repère FIXE au centre, les vignettes défilent
   dessous ; le remplissage latéral de la rangée (moitié de la largeur moins la moitié d'une vignette) met la première et la dernière sous le repère. La bande se pose PAR-DESSUS
   le média (fileWindowMedia.css) : les flèches ← → (`.aqw-rail`) restent au centre de l'écran. */
.aqw-footer:has(.fws) { display: block; padding: 0; }
.fws { position: relative; height: 84px; overflow: hidden; }
.fws-mark { position: absolute; z-index: 2; left: 50%; top: 50%; width: 60px; height: 60px; transform: translate(-50%, -50%); border-radius: 10px; pointer-events: none;
    box-shadow: 0 0 0 2px var(--color-primary, #007aff), 0 0 0 5px color-mix(in srgb, var(--color-primary, #007aff) 25%, transparent); }
.fws-track { position: relative; display: flex; align-items: center; gap: 5px; height: 100%; box-sizing: border-box; padding: 10px calc(50% - 27px); overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; cursor: grab; user-select: none; }
.fws-track::-webkit-scrollbar { display: none; }
.fws-drag .fws-track { cursor: grabbing; }
.fws-item { flex: none; position: relative; width: 54px; height: 54px; margin: 0; padding: 0; border: 0; border-radius: 7px; overflow: hidden; cursor: pointer; opacity: .5; font: inherit;
    background: color-mix(in srgb, var(--color-text, #1d1d1f) 9%, transparent); color: var(--color-text-secondary, #86868b); transition: opacity .15s, transform .15s; }
.fws-item:hover { opacity: .82; transform: scale(1.06); }
.fws-item.fws-on { opacity: 1; transform: scale(1.1); }
.fws-item:focus-visible { outline: 2px solid var(--color-primary, #007aff); outline-offset: 2px; }
.fws-item img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.fws-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; color: rgba(255, 255, 255, .92);
    text-shadow: 0 1px 6px rgba(0, 0, 0, .7); background: rgba(0, 0, 0, .18); pointer-events: none; }
.fws-sheet, .fws-audio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.fws-icon { display: flex; pointer-events: none; }
.fws-icon svg { width: 22px; height: 22px; }
.fws-ext { font-size: 8.5px; font-weight: 700; letter-spacing: .05em; line-height: 1; text-transform: uppercase; pointer-events: none; }
.fws-audio { background: rgba(244, 63, 94, .13); color: #f43f5e; }

/* ── Les outils d'une image (imageTools.js) : leurs boîtes s'ouvrent dans le Modal de l'application ─────────────────────────────────────────── */
.fit-lead { margin: 0 0 14px; font-size: 13px; line-height: 1.45; color: var(--color-text-secondary, #86868b); }
.fit-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.fit-row .form-label { flex: none; min-width: 64px; margin: 0; }
.fit-range { flex: 1; min-width: 0; accent-color: var(--color-primary, #007aff); }
.fit-value { flex: none; min-width: 40px; text-align: right; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fit-tip, .fit-note { margin: 0 0 14px; font-size: 11.5px; line-height: 1.4; color: var(--color-text-tertiary, #aeaeb2); }
.fit-out { margin-top: 12px; }
.fit-result { padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, #22c55e 9%, transparent); }
.fit-result .btn { margin: 4px 0 8px; }
.fit-note { margin: 0; overflow-wrap: anywhere; }
.fit-meta { margin: 0; font-size: 12px; font-weight: 600; color: var(--color-text-secondary, #86868b); }
.fit-warn { margin: 0; font-size: 12px; color: #d97706; }
.fit-error { padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, #ef4444 9%, transparent); color: #dc2626; font-size: 12.5px; }
.fit-error p { margin: 0 0 6px; }
.fit-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 6px; }
.fit-actions { display: flex; flex-wrap: wrap; gap: 8px; }          /* « Copier » et « Télécharger en .txt » : ensemble, à droite du compte, et ils passent à la ligne sur un écran étroit */
.fit-ocr { box-sizing: border-box; width: 100%; padding: 10px; border-radius: 10px; resize: vertical; font: 12px/1.5 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--color-text, #1d1d1f);
    background: color-mix(in srgb, var(--color-text, #1d1d1f) 6%, transparent); border: 0; }
.fit-foot { display: flex; justify-content: flex-end; margin-top: 16px; }

/* ── Texte (fileWindowText.js) ─────────────────────────────────────────────── */
.fwx { --fw-zoom: 1; box-sizing: border-box; max-width: calc(760px * var(--fw-zoom)); margin: 0 auto; padding: 8px 0 72px; font-size: calc(14px * var(--fw-zoom)); color: var(--color-text, #1d1d1f); }
.fwx-pre { margin: 0; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .95em; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.fwx-csv-wrap { overflow: auto; border-radius: 12px; }
.fwx-csv { width: max-content; min-width: 100%; border-collapse: collapse; font-size: .95em; }
.fwx-csv th, .fwx-csv td { padding: .45em .8em; text-align: left; white-space: nowrap; }
.fwx-csv th { position: sticky; top: 0; font-weight: 650; background: color-mix(in srgb, var(--color-text, #1d1d1f) 8%, var(--color-surface, #fff)); }
.fwx-csv tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--color-text, #1d1d1f) 3.5%, transparent); }
.fwx-foot { margin-top: 10px; font-size: .85em; color: var(--color-text-tertiary, #aeaeb2); }

/* ── Fiche (fileWindowFiche.js) : ce que la fenêtre montre d'un fichier qu'aucun lecteur ne sait lire ───────────────────────────── */
.fwk { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 28px; text-align: center; }
.fwk-icon { width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; border-radius: 20px; background: color-mix(in srgb, var(--color-text, #1d1d1f) 7%, transparent); color: var(--color-text-secondary, #86868b); }
.fwk-icon svg { width: 34px; height: 34px; }
.fwk-name { max-width: 100%; margin: 6px 0 0; font-size: 17px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.fwk-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--color-text-secondary, #86868b); }
.fwk-pill { padding: 2px 10px; border-radius: 12px; background: color-mix(in srgb, var(--color-text, #1d1d1f) 8%, transparent); font-weight: 600; }
.fwk-text { max-width: 320px; margin: 4px 0 10px; font-size: 13.5px; line-height: 1.5; color: var(--color-text-secondary, #86868b); }
.fwk-dl { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 20px; border-radius: 19px; }
.fwk-dl svg { width: 17px; height: 17px; }

@media (max-width: 640px) {
    .fwp-marker { display: block; flex: none; align-self: center; margin-bottom: max(6px, env(safe-area-inset-bottom, 0px)); }   /* le repère de page a sa bande, jamais sur le texte */
    .fw-scroll { padding: 0 var(--scribe-pad-x); }          /* la marge du texte de l'éditeur sur téléphone (variables.css) : mêmes retours à la ligne */
    .fwf .aqz { display: none; }          /* le zoom est au pincement, comme dans la barre de titre (aqWindow.css) : sans lui la pastille tient dans l'écran (elle en débordait de chaque côté à 390 px) */
}
@media (max-width: 340px) {
    .fwf-star { width: 26px; height: 26px; }      /* les plus petits écrans : cinq étoiles plus étroites, la pastille y tient encore */
}
@media (max-width: 768px) {
    .fws { height: 76px; }
    .fws-track { padding: 10px calc(50% - 24px); }
    .fws-item { width: 48px; height: 48px; }
    .fws-mark { width: 54px; height: 54px; }
}
@media (prefers-reduced-motion: reduce) {
    .fws-item { transition: none; }
    .fw-skel { animation: none; }
    .aqw-backdrop--max:has(.fwf) .aqw { transition: none; }       /* (plus spécifique que la règle de la coque : sans cette ligne le fond noir se fondrait malgré la demande) */
}
