/* Q2 — Modo Foco / paleta / passagem de bastão. Prefixo .fm-. Tema escuro do backoffice (usa as variáveis dele com fallback). */
:root { --fm-bg: #141a28; --fm-bg2: #1b2233; --fm-line: rgba(255,255,255,.09); --fm-tx: #e8edf8; --fm-mu: #8b97ad; --fm-ac: #ff7a45; --fm-ac2: #6366f1; --fm-ok: #34d399; --fm-warn: #f5a623; }
.fm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fm-next kbd, .fm-btn kbd, .fm-opt kbd, .fm-keys kbd, .fm-pal-f kbd { font: 600 10px/1 ui-monospace, monospace; padding: 2px 5px; border-radius: 4px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: var(--fm-mu); }

/* botão Próxima no topo */
.fm-next { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; margin-right: 8px; border-radius: 8px; border: 1px solid rgba(255,122,69,.55); background: rgba(255,122,69,.14); color: #ffd2bf; font: 700 13px/1 inherit; cursor: pointer; }
.fm-next:hover { background: rgba(255,122,69,.24); }
.fm-next:focus-visible, .fm-btn:focus-visible, .fm-x:focus-visible, .fm-link:focus-visible, .fm-mn button:focus-visible { outline: 2px solid var(--fm-ac); outline-offset: 2px; }
.fm-next.fm-busy { opacity: .6; cursor: progress; }
.fm-count:not(:empty) { min-width: 18px; padding: 2px 5px; border-radius: 9px; background: var(--fm-ac); color: #1a0d06; font-size: 11px; text-align: center; }

.fm-btn { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--fm-line); background: var(--fm-bg2); color: var(--fm-tx); font: 600 12px/1 inherit; cursor: pointer; }
.fm-btn:hover { border-color: rgba(255,255,255,.22); }
.fm-btn.fm-pri { background: var(--fm-ac); border-color: var(--fm-ac); color: #1a0d06; }
.fm-btn.fm-pri kbd { color: #3a1a0c; background: rgba(0,0,0,.12); border-color: rgba(0,0,0,.18); }
.fm-x { width: 28px; height: 28px; border-radius: 7px; border: 0; background: transparent; color: var(--fm-mu); font-size: 18px; cursor: pointer; }
.fm-x:hover { background: rgba(255,255,255,.08); color: var(--fm-tx); }
.fm-link { border: 0; background: none; color: var(--fm-mu); font-size: 11px; text-decoration: underline; cursor: pointer; }

/* cartão de contexto */
#wa-chat-area { position: relative; }
.fm-card { position: absolute; z-index: 40; top: 64px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); padding: 12px 14px; border-radius: 12px; background: #1d2536; border: 1px solid rgba(255,122,69,.45); box-shadow: 0 18px 40px rgba(0,0,0,.55); color: var(--fm-tx); animation: fm-in .16s ease-out; }
.fm-card.fm-t1 { border-color: rgba(52,211,153,.55); } .fm-card.fm-t2 { border-color: rgba(245,166,35,.6); } .fm-card.fm-t3 { border-color: rgba(99,102,241,.6); }
.fm-card-h { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fm-mu); }
.fm-tier { font-weight: 700; color: #ffd2bf; } .fm-t1 .fm-tier { color: #8ff0c6; } .fm-t2 .fm-tier { color: #ffd38a; } .fm-t3 .fm-tier { color: #b9bbff; }
.fm-ahead { font-weight: 700; }
.fm-card-b { margin: 8px 0 10px; font-size: 14px; line-height: 1.45; }
.fm-card-a { display: flex; gap: 8px; align-items: center; } .fm-card-a .fm-x { margin-left: auto; }
@keyframes fm-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* banner "Resumo da passagem" / menções no topo da conversa */
.fm-banner { margin: 8px 12px 0; padding: 10px 12px; border-radius: 10px; background: #262013; border: 1px solid rgba(245,166,35,.45); color: #f3e6c9; font-size: 13px; }
.fm-bn-h { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; } .fm-bn-h span { color: #c8b48a; font-size: 12px; }
.fm-bn-l { margin: 0 0 8px 18px; padding: 0; line-height: 1.5; }
.fm-bn-m { margin: 4px 0 8px; padding: 6px 8px; border-radius: 7px; background: rgba(99,102,241,.14); border: 1px solid rgba(99,102,241,.35); color: #dfe1ff; }

/* barra do Modo Foco */
.fm-focusbar { display: none; position: fixed; z-index: 60; top: 8px; left: 50%; transform: translateX(-50%); gap: 6px; align-items: center; padding: 6px 8px; border-radius: 12px; background: rgba(20,26,40,.96); border: 1px solid var(--fm-line); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.fm-fb-t { white-space: nowrap; font: 800 11px/1 inherit; letter-spacing: .08em; text-transform: uppercase; color: var(--fm-ac); padding: 0 6px; }
body.fm-focus .fm-focusbar { display: flex; }
body.fm-focus .header, body.fm-focus .sidebar, body.fm-focus .wa-metrics-bar, body.fm-focus #status-footer, body.fm-focus #wa-stale-bar, body.fm-focus #wa-status-filter-bar,
body.fm-focus .wa-view-tabs, body.fm-focus #ob-bar, body.fm-focus #ob-checklist { display: none !important; }
body.fm-focus .layout { grid-template-columns: 0 1fr !important; }
body.fm-focus #page-wa { margin-top: 48px !important; }
body.fm-focus #app .wa-layout { height: calc(100dvh - 76px) !important; min-height: 0 !important; }
body.fm-focus #wa-conv-list-panel { max-width: 260px; }
body.fm-focus .page:not(#page-wa) { opacity: .98; }

/* densidade compacta */
body.fm-dense .wa-conv-item { padding-top: 6px !important; padding-bottom: 6px !important; }
body.fm-dense .wa-conv-item .wa-conv-last, body.fm-dense .wa-conv-item .cx-preview { display: none !important; }

/* overlays (paleta, mapa de teclado, preferências) */
.fm-ov { position: fixed; inset: 0; z-index: 9500; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; background: rgba(4,7,14,.62); backdrop-filter: blur(6px); }
.fm-ov[hidden] { display: none; }
.fm-pal { width: min(680px, calc(100vw - 32px)); border-radius: 14px; background: var(--fm-bg); border: 1px solid rgba(99,102,241,.35); box-shadow: 0 40px 80px rgba(0,0,0,.7); overflow: hidden; color: var(--fm-tx); }
.fm-pal-in { padding: 12px 14px; border-bottom: 1px solid var(--fm-line); }
.fm-pal-in input { width: 100%; box-sizing: border-box; background: transparent; border: 0; outline: 0; color: var(--fm-tx); font: 500 15px/1.4 inherit; }
.fm-pal-in input::placeholder { color: #67728a; }
.fm-pal-list { list-style: none; margin: 0; padding: 6px; max-height: min(420px, 55vh); overflow-y: auto; }
.fm-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.fm-opt.fm-sel { background: rgba(99,102,241,.22); box-shadow: inset 0 0 0 1px rgba(129,140,248,.45); }
.fm-ic { width: 22px; text-align: center; color: var(--fm-mu); font-weight: 700; }
.fm-ol { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fm-lb { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-sb { font-size: 11.5px; color: var(--fm-mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-ty { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #67728a; }
.fm-fav { color: var(--fm-warn); }
.fm-pal-empty { padding: 24px; text-align: center; color: var(--fm-mu); }
.fm-pal-f { display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 14px; border-top: 1px solid var(--fm-line); font-size: 11px; color: var(--fm-mu); }
.fm-pal-ms { margin-left: auto; }

.fm-keys { width: min(980px, calc(100vw - 32px)); max-height: 80vh; display: flex; flex-direction: column; border-radius: 14px; background: var(--fm-bg); border: 1px solid var(--fm-line); color: var(--fm-tx); box-shadow: 0 40px 80px rgba(0,0,0,.7); }
.fm-keys-h { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--fm-line); }
.fm-keys-h h2 { margin: 0; font-size: 16px; } .fm-keys-h input { flex: 1; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--fm-line); background: var(--fm-bg2); color: var(--fm-tx); }
.fm-keys-b { overflow-y: auto; padding: 12px 16px 16px; columns: 2 380px; column-gap: 24px; }
.fm-kg { break-inside: avoid; margin-bottom: 14px; } .fm-kg h3 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--fm-ac); }
.fm-kg dl { margin: 0; } .fm-kr { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; border-bottom: 1px dashed rgba(255,255,255,.05); }
.fm-kr[hidden] { display: none; }
.fm-kr dt { min-width: 120px; display: flex; gap: 3px; flex-wrap: wrap; } .fm-kr dd { margin: 0; font-size: 12.5px; }
.fm-scope { font-size: 10px; color: var(--fm-mu); border: 1px solid var(--fm-line); border-radius: 4px; padding: 0 4px; }
.fm-kconf { column-span: all; } .fm-kconf ul { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.6; color: #c9d1e2; } .fm-kconf i { color: var(--fm-ac); font-style: normal; }

.fm-prefs { width: min(440px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 14px; background: var(--fm-bg); border: 1px solid var(--fm-line); color: var(--fm-tx); }
.fm-prefs h2 { margin: 0 0 4px; font-size: 16px; } .fm-prefs label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.fm-prefs label.fm-chk { flex-direction: row; align-items: center; gap: 8px; }
.fm-prefs select { height: 32px; border-radius: 8px; border: 1px solid var(--fm-line); background: var(--fm-bg2); color: var(--fm-tx); padding: 0 8px; }
.fm-pr-a { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* Menções no Meu Painel */
.fm-mentions .ch-sec-h { display: flex; justify-content: space-between; align-items: center; }
.fm-mn-n { color: var(--fm-ac); font-size: 12px; }
.fm-mn-l { list-style: none; margin: 0; padding: 0; }
.fm-mn button { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 8px 6px; border: 0; border-bottom: 1px solid var(--fm-line); background: none; color: var(--fm-tx); font: 12.5px/1.4 inherit; cursor: pointer; }
.fm-mn button:hover { background: rgba(255,255,255,.04); }
.fm-mn.fm-unread button { box-shadow: inset 3px 0 0 var(--fm-ac); }
.fm-mn-p { color: #c9d1e2; } .fm-mn-t { color: var(--fm-mu); font-size: 11px; }
.fm-mn-e { padding: 10px 4px; color: var(--fm-mu); font-size: 12.5px; }

@media (prefers-reduced-motion: reduce) { .fm-card { animation: none; } }
@media (max-width: 1366px) { .fm-next kbd { display: none; } }
