/* ==========================================================================
   Formation Avocado — complète le design system des maquettes (flow.css)
   Tableau de bord, lecteur de parcours (cadre, consigne, barre des étapes),
   panneau des questions, annotation, interface du formateur.
   ========================================================================== */

:root {
  --f-bar-h: 132px;
  --f-callout-ink: #3b1fb8;
  --f-callout-bg: #fffdf5;
  --f-callout-border: #ffd84d;
  --f-mark-bg: #ffe066;
  --f-mark-ink: #1b1f33;
  --f-notion: #0b7f8f;
  --f-tip-ink: #8a4b00;
  --f-frame: #ff3d8b;
  --f-frame-2: #6b4ef6;
  --f-dim: rgba(13, 16, 40, .14);
  --f-pin: #ff6a00;
  --font-instr: "Fraunces", "Source Serif 4", Georgia, serif;
  --font-notion: "Source Serif 4", Georgia, serif;
  --font-tip: "Source Serif 4", Georgia, serif;
}
html[lang="ar"] {
  --font-instr: "Amiri", "Cairo", serif;
  --font-notion: "Aref Ruqaa", "Amiri", serif;
  --font-tip: "Amiri", "Cairo", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --f-callout-ink: #d9d0ff;
    --f-callout-bg: #1f2140;
    --f-callout-border: #8f7bff;
    --f-mark-bg: #ffd84d;
    --f-notion: #5fd6e4;
    --f-tip-ink: #ffc46b;
    --f-dim: rgba(0, 0, 0, .28);
  }
}
:root[data-theme="dark"] {
  --f-callout-ink: #d9d0ff;
  --f-callout-bg: #1f2140;
  --f-callout-border: #8f7bff;
  --f-mark-bg: #ffd84d;
  --f-notion: #5fd6e4;
  --f-tip-ink: #ffc46b;
  --f-dim: rgba(0, 0, 0, .28);
}

body.formation { min-height: 100vh; background: var(--bg); }
body.is-running { overflow: hidden; }
.min0 { min-width: 0; }
.grow { flex: 1 1 auto; }

/* ---- Démarrage -------------------------------------------------------------------------------------------- */
.f-boot { min-height: 100vh; display: grid; place-content: center; gap: 14px; justify-items: center; color: var(--muted); font-weight: 700; }
.fr-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--primary); animation: f-spin .8s linear infinite; display: inline-block; }
@keyframes f-spin { to { transform: rotate(360deg); } }

/* ---- En-tête ------------------------------------------------------------------------------------------------ */
.f-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 10px 24px; background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.f-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.f-brand b { display: block; font-size: 1.05rem; line-height: 1.1; }
.f-brand-sub { display: block; font-size: .78rem; color: var(--muted); font-weight: 700; }
.f-logo-mark svg { width: 34px; height: 34px; display: block; }
.f-brand.is-big .f-logo-mark svg { width: 48px; height: 48px; }
.f-brand.is-big b { font-size: 1.4rem; color: inherit; }
.f-nav { display: flex; gap: 4px; }
.f-nav-link { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius-pill); color: var(--text-2); font-weight: 700; font-size: .92rem; text-decoration: none !important; }
.f-nav-link:hover { background: var(--surface-2); color: var(--text); }
.f-nav-link.is-active { background: var(--primary-soft); color: var(--primary-ink); }
.f-top-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.f-user { position: relative; }
.f-user-btn { list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: var(--radius-pill); cursor: pointer; font-weight: 700; font-size: .9rem; }
.f-user-btn::-webkit-details-marker { display: none; }
.f-user-btn:hover { background: var(--surface-2); }
.f-user .menu-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 10px; z-index: 40; }
.f-user-info { padding: 6px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
@media (max-width: 720px) {
  .f-top { padding: 8px 14px; gap: 10px; }
  .f-nav-link span, .f-user-name, .f-brand-sub { display: none; }
}

/* ---- Pages du tableau de bord --------------------------------------------------------------------------------- */
.f-main { padding-block: 28px 60px; display: flex; flex-direction: column; gap: 22px; }
.f-hero { display: flex; flex-direction: column; gap: 18px; }
.f-hero h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); }
.f-stats { --gap: 14px; }
.f-stat { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.f-stat-v { font-family: var(--font-data); font-size: 1.35rem; line-height: 1.1; }
.f-continue { display: flex; align-items: center; gap: 14px; padding: 14px 18px; color: inherit; text-decoration: none !important; border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.f-toolbar { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.f-toolbar .tabs { border-bottom: 0; }
.f-tabs .count.is-unread { background: var(--danger); color: #fff; }
.f-search { max-width: 360px; margin-inline-start: auto; margin-bottom: 8px; border-radius: var(--radius-pill); }
.f-tab-panel { display: flex; flex-direction: column; gap: 22px; }
.f-cats { --gap: 8px; }
.f-cats .chip .ic { width: 1em; height: 1em; }
.f-cat { display: flex; flex-direction: column; gap: 12px; }
.f-cat-head h2 { font-size: 1.12rem; display: inline-flex; align-items: center; gap: 8px; }
.f-empty { padding: 40px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 10px; }
.f-uc { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; }
.f-uc-top { display: flex; gap: 12px; align-items: flex-start; }
.f-uc h3 { font-size: 1rem; }
.f-uc-link { color: var(--text); }
.f-uc-meta { --gap: 12px; }
.f-uc-foot { margin-top: auto; padding-top: 4px; }
.f-screens { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.f-screen { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; color: inherit; text-decoration: none !important; }
.f-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.f-question { display: flex; align-items: center; gap: 14px; padding: 12px 14px; color: inherit; text-decoration: none !important; }
.f-question.is-unread { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 12%, transparent); }
.f-question-shot { width: 120px; height: 76px; flex: none; object-fit: cover; object-position: top left; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--surface-2); }
.f-question-shot.is-empty { display: grid; place-items: center; color: var(--muted); }
.f-question-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.f-question-answer { font-size: .88rem; padding: 6px 10px; border-radius: var(--radius-xs); background: var(--success-soft); }
.f-back { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; }
.f-uc-hero { display: flex; flex-direction: column; gap: 12px; }
.f-actors { --gap: 8px; }
.f-uc-cols { align-items: start; }
.f-steps { list-style: none; display: flex; flex-direction: column; }
.f-steps > li { display: flex; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--border); }
.f-steps > li:last-child { border-bottom: 0; }
.f-step-n { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); font-weight: 800; font-family: var(--font-data); font-size: .85rem; }
.f-scenario { display: flex; flex-direction: column; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.f-scenario:last-child { border-bottom: 0; padding-bottom: 0; }
.f-filters { --gap: 12px; }
.f-filter { max-width: 340px; }

/* ---- Connexion --------------------------------------------------------------------------------------------- */
.f-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.f-auth-art { background: var(--hero-bg); color: var(--hero-fg); padding: clamp(28px, 5vw, 72px); display: flex; flex-direction: column; gap: 22px; justify-content: center; }
.f-auth-art h1 { color: inherit; font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.5rem); max-width: 20ch; }
.f-auth-art .check-list .ic { color: #fff; }
.f-auth-art .f-brand { color: inherit; }
.f-auth-art .f-brand-sub { color: inherit; opacity: .8; }
.f-auth-art .btn { align-self: flex-start; }
.f-auth-main { display: grid; place-items: center; padding: 28px 18px; }
.f-auth-card { width: min(440px, 100%); padding: 28px; }
.f-auth-seg { width: 100%; }
.f-auth-seg > button { flex: 1; justify-content: center; }
@media (max-width: 860px) { .f-auth { grid-template-columns: 1fr; } .f-auth-art { padding: 28px 20px; } }

/* ---- Fenêtres modales et messages ---------------------------------------------------------------------------- */
.f-modal { border: 0; padding: 0; background: transparent; max-width: min(620px, calc(100vw - 24px)); width: 100%; }
.f-modal.is-wide { max-width: min(1280px, calc(100vw - 24px)); }
.f-modal::backdrop { background: var(--overlay); }
.f-modal-box { background: var(--surface); color: var(--text); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.f-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.f-modal-head h2 { font-size: 1.1rem; }
.f-modal-body { padding: 18px 20px; overflow: auto; }
.f-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.f-toasts { position: fixed; z-index: 2000; inset-block-start: 16px; inset-inline-end: 16px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.f-toast { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-weight: 600; font-size: .9rem; max-width: 380px; transition: opacity .3s, transform .3s; }
.f-toast.is-success .ic { color: var(--success); }
.f-toast.is-error .ic { color: var(--danger); }
.f-toast.is-info .ic { color: var(--info); }
.f-toast.is-out { opacity: 0; transform: translateY(-6px); }
.fr-done-ic { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-accent); color: #fff; }

/* ==========================================================================
   Lecteur de parcours
   ========================================================================== */
.f-runner, .fr { position: fixed; inset: 0; }
.fr { display: grid; grid-template-rows: minmax(0, 1fr) auto; background: var(--bg); }
.fr-stage { position: relative; min-height: 0; overflow: hidden; }
.fr-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg); }
.fr-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--muted); font-weight: 700; z-index: 5; }
.fr-offpath { position: absolute; z-index: 15; inset-inline: 0; bottom: calc(var(--fr-bar-real, var(--f-bar-h)) + 10px); margin-inline: auto; width: max-content; max-width: calc(100vw - 32px); display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-pill); background: var(--warning-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent); box-shadow: var(--shadow); font-weight: 700; font-size: .9rem; }
.fr-offpath .ic { color: var(--warning); }
.fr-offpath.is-next { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.fr-offpath.is-next .ic { color: var(--success); }

/* Barre du bas */
.fr-bar { position: relative; z-index: 20; display: flex; flex-direction: column; gap: 8px; padding: 10px 18px 12px; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -12px 32px -18px rgba(var(--shadow-color), .35); min-height: var(--f-bar-h); }
.fr.is-review .fr-bar { border-top: 3px solid var(--warning); }
.fr-bar-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.fr-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; max-width: 34%; }
.fr-uc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
.fr-title .badge { flex: none; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.fr-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; padding: 4px 2px; flex: 1 1 auto; min-width: 0; }
.fr-chip { position: relative; flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: inherit; font-family: var(--font-data); font-weight: 800; font-size: .86rem; cursor: pointer; display: grid; place-items: center; transition: transform .15s ease, background .2s ease; }
.fr-chip:hover { transform: translateY(-1px); border-color: var(--primary); }
.fr-chip.is-done { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 55%, transparent); color: var(--success); }
.fr-chip.is-current { background: var(--grad); border-color: transparent; color: var(--on-primary); box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--primary) 80%, transparent); }
.fr-chip-q { position: absolute; top: -7px; inset-inline-end: -7px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--f-pin); color: #fff; font-size: .7rem; line-height: 18px; font-weight: 800; border: 2px solid var(--surface); }
.fr-chip-q.is-unread { background: var(--danger); animation: f-pulse 1.6s ease-in-out infinite; }
.fr-bar-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.fr-bar-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.fr-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fr-counter { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fr-count { font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: var(--track-label); color: var(--primary-ink); font-family: var(--font-data); }
.fr-label { font-weight: 800; font-size: .95rem; }
.fr-instr p { color: var(--text-2); font-size: .93rem; line-height: 1.5; }
.fr-instr .f-ui { background: var(--primary-soft); color: var(--primary-ink); padding: 0 .3em; border-radius: 4px; font-weight: 700; }
.fr-instr .f-notion { color: var(--f-notion); font-style: italic; }
.fr-appears { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.fr-tip { font-size: .86rem; color: var(--f-tip-ink); font-family: var(--font-tip); font-style: italic; }
html[lang="ar"] .fr-tip { font-style: normal; font-size: .98rem; }
.fr-tip b { font-family: var(--font-body); font-style: normal; }
.fr-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.fr-fill { background: linear-gradient(135deg, #ffd84d, #ff9f43); color: #3a2400; box-shadow: 0 10px 22px -12px rgba(255, 159, 67, .9); }
.fr-fill:hover { filter: brightness(1.04); transform: translateY(-1px); }
.fr-fill.is-busy { pointer-events: none; opacity: .75; }
.fr-fill.is-busy .ic { animation: f-wiggle .5s ease-in-out infinite alternate; }
@keyframes f-wiggle { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
@media (max-width: 900px) {
  :root { --f-bar-h: 168px; }
  .fr-bar { padding: 8px 10px 10px; }
  .fr-title { max-width: 40%; }
  .fr-bar-main { flex-wrap: wrap; gap: 10px; }
  .fr-actions { width: 100%; justify-content: flex-end; }
  .btn-label { display: none; }
  .fr-lang span { display: none; }
}

/* ---- Calque : cadre, consigne, (?) -------------------------------------------------------------------------- */
.fo-layer { position: absolute; inset: 0; pointer-events: none; z-index: 10; overflow: hidden; }
.fo-frame { position: absolute; border-radius: 14px; border: 3px solid var(--f-frame); box-shadow: 0 0 0 3px color-mix(in srgb, var(--f-frame) 22%, transparent), 0 0 0 9999px var(--f-dim), 0 12px 34px -10px color-mix(in srgb, var(--f-frame) 55%, transparent); transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease; animation: f-frame-in .5s ease-out; }
.fo-frame::before { content: ""; position: absolute; inset: -9px; border-radius: 18px; border: 2px dashed color-mix(in srgb, var(--f-frame-2) 70%, transparent); animation: f-pulse-border 2.2s ease-in-out infinite; }
.fo-layer.is-frame-off .fo-frame, .fo-layer.is-frame-off .fo-callout { display: none; }
@keyframes f-frame-in { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes f-pulse-border { 0%, 100% { opacity: .9; } 50% { opacity: .25; } }
@keyframes f-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.fo-callout { position: absolute; pointer-events: auto; width: min(380px, calc(100% - 24px)); background: var(--f-callout-bg); color: var(--f-callout-ink); border: 2px solid var(--f-callout-border); border-radius: 16px; padding: 10px 14px 12px; box-shadow: 0 18px 40px -16px rgba(20, 16, 60, .45); transition: top .25s ease, left .25s ease; }
.fo-callout::after { content: ""; position: absolute; left: var(--arrow-x, 24px); width: 14px; height: 14px; background: var(--f-callout-bg); border: 2px solid var(--f-callout-border); transform: translateX(-50%) rotate(45deg); display: none; }
.fo-callout[data-side="below"]::after { display: block; top: -9px; border-right: 0; border-bottom: 0; }
.fo-callout[data-side="above"]::after { display: block; bottom: -9px; border-left: 0; border-top: 0; }
.fo-head { display: flex; align-items: center; gap: 8px; }
.fo-n { width: 24px; height: 24px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-family: var(--font-data); font-weight: 800; font-size: .78rem; flex: none; font-style: normal; }
.fo-do { font-family: var(--font-body); font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--f-frame); }
.fo-min { margin-inline-start: auto; width: 26px; height: 26px; border-radius: 50%; border: 0; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; opacity: .7; }
.fo-min:hover { background: color-mix(in srgb, var(--f-callout-border) 25%, transparent); opacity: 1; }
.fo-callout.is-collapsed { width: auto; padding: 6px 8px; }
.fo-text { margin-top: 6px; font-family: var(--font-instr); font-style: italic; font-size: 1.12rem; line-height: 1.42; font-weight: 400; }
html[lang="ar"] .fo-text { font-size: 1.3rem; line-height: 1.7; }
.fo-text .f-ui { font-family: var(--font-body); font-style: normal; font-weight: 800; font-size: .86em; background: var(--f-mark-bg); color: var(--f-mark-ink); padding: .05em .4em; border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.fo-text .f-notion { font-family: var(--font-notion); color: var(--f-notion); font-weight: 600; text-decoration: underline wavy color-mix(in srgb, var(--f-notion) 55%, transparent); text-underline-offset: 4px; }
.fo-tip { margin-top: 8px; padding-top: 8px; border-top: 1px dashed color-mix(in srgb, var(--f-callout-border) 70%, transparent); font-family: var(--font-tip); font-style: italic; color: var(--f-tip-ink); font-size: .92rem; }
.fo-tip b { font-family: var(--font-body); font-style: normal; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.fo-pins { position: absolute; inset: 0; }
.fo-pin { position: absolute; pointer-events: auto; width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; border: 2px solid #fff; background: var(--f-pin); color: #fff; font: 800 1rem/1 var(--font-latin); cursor: pointer; box-shadow: 0 6px 16px -4px rgba(0, 0, 0, .45); display: grid; place-items: center; transition: transform .15s ease; }
.fo-pin:hover, .fo-pin.is-active { transform: scale(1.18); }
.fo-pin.is-answered { background: var(--success); }
.fo-pin.is-closed { background: var(--muted); }
.fo-pin.is-unread { animation: f-pulse 1.4s ease-in-out infinite; background: var(--danger); }
.fo-pin-n { position: absolute; top: -8px; inset-inline-end: -8px; background: var(--text); color: var(--surface); border-radius: 9px; font-size: .66rem; min-width: 16px; height: 16px; line-height: 16px; padding: 0 3px; }
.fo-region { position: absolute; border: 3px dashed var(--f-pin); border-radius: 8px; background: color-mix(in srgb, var(--f-pin) 10%, transparent); }

/* Sélection d'une zone à capturer */
.fz-layer { position: absolute; inset: 0; z-index: 40; cursor: crosshair; background: rgba(13, 16, 40, .18); touch-action: none; outline: none; }
.fz-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(13, 16, 40, .35), 0 0 0 4px var(--primary); border-radius: 4px; }
.fz-help { position: absolute; top: 16px; inset-inline: 0; margin-inline: auto; width: max-content; max-width: calc(100% - 32px); padding: 8px 14px; border-radius: var(--radius-pill); background: var(--surface); color: var(--text); font-weight: 700; box-shadow: var(--shadow); }

/* ---- Panneau des questions ------------------------------------------------------------------------------------ */
.ff { position: absolute; z-index: 25; top: 0; bottom: var(--fr-bar-real, var(--f-bar-h)); inset-inline-end: 0; display: flex; align-items: center; pointer-events: none; }
.ff[data-side="start"] { inset-inline-end: auto; inset-inline-start: 0; flex-direction: row-reverse; }
.ff.is-capturing .ff-panel { visibility: hidden; }
.ff-tab { pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border: 0; cursor: pointer; background: var(--grad-accent); color: #fff; border-start-start-radius: 16px; border-end-start-radius: 16px; box-shadow: var(--shadow-lg); font: inherit; font-weight: 800; font-size: .74rem; position: relative; }
.ff[data-side="start"] .ff-tab { border-radius: 0; border-start-end-radius: 16px; border-end-end-radius: 16px; }
.ff-tab-label { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .05em; }
html[lang="ar"] .ff-tab-label { transform: none; }
.ff-count { position: absolute; top: -8px; inset-inline-start: -8px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--surface); color: var(--primary-ink); font-size: .74rem; line-height: 22px; text-align: center; padding: 0 5px; border: 2px solid var(--primary); }
.ff-count.is-unread { background: var(--danger); color: #fff; border-color: #fff; animation: f-pulse 1.6s ease-in-out infinite; }
.ff-panel { pointer-events: auto; align-self: stretch; width: min(400px, calc(100vw - 56px)); background: var(--surface); border-inline-start: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.ff[data-side="start"] .ff-panel { border-inline-start: 0; border-inline-end: 1px solid var(--border); }
.ff-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ff-head h2 { font-size: 1rem; }
.ff-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.ff-label { font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: var(--track-label); color: var(--muted); margin-top: 4px; }
.ff-kind { width: 100%; }
.ff-kind > button { flex: 1; justify-content: center; }
.ff-capture { display: flex; gap: 8px; flex-wrap: wrap; }
.ff-shot { display: flex; flex-direction: column; gap: 6px; }
.ff-shot img { width: 100%; border-radius: var(--radius-xs); border: 1px solid var(--border); }
.ff-field { display: flex; flex-direction: column; gap: 6px; }
.ff-note { min-height: 96px; resize: vertical; }
.ff-interim { min-height: 1.2em; font-style: italic; color: var(--muted); font-size: .86rem; }
.ff-mic.is-on { background: var(--danger); color: #fff; animation: f-pulse 1.4s ease-in-out infinite; }
.ff-mic-status { color: var(--muted); max-width: 62%; text-align: end; }
.ff-mic-status.is-error { color: var(--danger); }
.ff-list { display: flex; flex-direction: column; gap: 10px; }
.ff-item { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.ff-item:hover { border-color: var(--primary); }
.ff-item.is-unread { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent); }
.ff-item.is-selected { border-color: var(--primary); background: var(--primary-soft); }
.ff-item-meta { --gap: 6px; }
.ff-item-note { font-size: .9rem; white-space: pre-wrap; }
.ff-thumb { width: 100%; max-height: 150px; object-fit: cover; object-position: top; border-radius: var(--radius-xs); border: 1px solid var(--border); }
.ff-answer-preview, .ff-answer { padding: 8px 10px; border-radius: var(--radius-xs); background: var(--success-soft); font-size: .88rem; }
.ff-answer p, .ff-answer-preview p { white-space: pre-wrap; }
.ff-quote { margin: 0; padding: 10px 12px; border-inline-start: 4px solid var(--primary); background: var(--surface-2); border-radius: var(--radius-xs); white-space: pre-wrap; }
.ff-shot-big img { width: 100%; border-radius: var(--radius-xs); border: 1px solid var(--border); }
.ff-who { display: flex; align-items: center; gap: 4px; }
.ff-data-page { border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 6px 10px; }
.ff-data-page summary { cursor: pointer; display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: .9rem; }
.ff-data-table { width: 100%; border-collapse: collapse; font-size: .84rem; margin: 6px 0; }
.ff-data-table th, .ff-data-table td { padding: 4px 6px; border-top: 1px solid var(--border); text-align: start; vertical-align: top; }
.ff-data-table th { color: var(--muted); font-weight: 600; width: 40%; }
.ff-data-table td:last-child { width: 1%; white-space: nowrap; }
.ff-entities { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: .88rem; }
@media (max-width: 720px) {
  .ff-panel { width: calc(100vw - 48px); }
  .ff-tab { padding: 10px 6px; }
}

/* ---- Annotation ------------------------------------------------------------------------------------------------ */
.fa-editor { display: flex; flex-direction: column; gap: 12px; }
.fa-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.fa-group { display: flex; align-items: center; gap: 8px; }
.fa-tool[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary-ink); }
.fa-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; }
.fa-swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--primary); }
.fa-range { width: 110px; accent-color: var(--primary); }
.fa-preview { width: 44px; height: 26px; border-radius: 6px; background: linear-gradient(transparent calc(50% - var(--w) / 2), color-mix(in srgb, var(--c) calc(var(--o) * 100%), transparent) 0 calc(50% + var(--w) / 2), transparent 0), repeating-conic-gradient(var(--surface-3) 0 25%, var(--surface) 0 50%) 0 0 / 10px 10px; border: 1px solid var(--border); }
.fa-stage { overflow: auto; max-height: calc(100vh - 260px); border-radius: var(--radius-xs); border: 1px solid var(--border); background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; }
.fa-canvas { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: none; }
.ff-detail .ff-who { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.ff-detail .ff-who .small { flex-basis: 100%; overflow-wrap: anywhere; }
.ff-head-tools { flex-wrap: nowrap; flex-shrink: 0; }
