/* Radar — estilo único, enxuto. Ícones em SVG herdam a cor do texto (currentColor). */
:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #fff;
  --ink: #111827;
  --ink-2: #374151;
  /* muted e faint também aparecem em texto pequeno: ambos com contraste ≥ 4,5:1 sobre --panel e --bg. */
  --muted: #5b6271;
  --faint: #636a78;
  --line: #e5e7eb;
  --line-2: #f0f1f3;
  --brand: #155eef;
  --brand-ink: #0b46bf;
  --brand-soft: #eef4ff;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --bad: #b42318;
  --bad-soft: #fef3f2;
  --violet: #6941c6;
  --violet-soft: #f4f3ff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
  --shadow-up: 0 -4px 16px rgba(16, 24, 40, .06);
  /* Preenchimentos com texto branco por cima ficam separados das cores de texto. */
  --brand-fill: #155eef;
  --brand-fill-hover: #0b46bf;
  --violet-fill: #6941c6;
  --violet-fill-hover: #53389e;
  --on-brand: #fff;
  --toast-bg: #111827;
  --toast-ink: #fff;
  --topbar-bg: rgba(255, 255, 255, .92);
  --backdrop: rgba(17, 24, 39, .35);
  --line-strong: #cfd4dc;
  --row-hover: #fafbfc;
  --amber: #d97706;
  --mark: #fef08a;
  --meter: #c7d7fe;
  --reuse: #b45309;
  --reuse-bg: #fff7e6;
  --f-pdf: #b42318; --f-pdf-bg: #fee4e2;
  --f-docx: #1d4ed8; --f-docx-bg: #dbeafe;
  --f-pptx: #c2410c; --f-pptx-bg: #ffedd5;
  --f-xlsx: #15803d; --f-xlsx-bg: #dcfce7;
  --f-eml: #a16207; --f-eml-bg: #fef9c3;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
/* Tema escuro: aplicado por data-theme no <html> (tema.js resolve "automático" pelo sistema). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1117;
  --panel: #171b23;
  --ink: #eceef2;
  --ink-2: #c9ced8;
  --muted: #a3abb9;
  --faint: #8b93a1;
  --line: #2c323d;
  --line-2: #222731;
  --brand: #84adff;
  --brand-ink: #a9c5ff;
  --brand-soft: #18284a;
  --ok: #4fd18b;
  --ok-soft: #10291d;
  --warn: #f5b546;
  --warn-soft: #2e230c;
  --bad: #ff8a80;
  --bad-soft: #3a1718;
  --violet: #bda6ff;
  --violet-soft: #261d47;
  --shadow: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
  --shadow-up: 0 -4px 16px rgba(0, 0, 0, .4);
  --brand-fill: #2563eb;
  --brand-fill-hover: #1d4ed8;
  --violet-fill: #6d4bd6;
  --violet-fill-hover: #5a3cbb;
  --on-brand: #fff;
  --toast-bg: #2c323d;
  --toast-ink: #f3f4f6;
  --topbar-bg: rgba(23, 27, 35, .92);
  --backdrop: rgba(0, 0, 0, .6);
  --line-strong: #3d4552;
  --row-hover: #1d222b;
  --amber: #fbbf24;
  --mark: #5b4a06;
  --meter: #35508f;
  --reuse: #fbbf24;
  --reuse-bg: #33270c;
  --f-pdf: #ffa199; --f-pdf-bg: #3d1a19;
  --f-docx: #9cc0ff; --f-docx-bg: #172a4d;
  --f-pptx: #ffb27a; --f-pptx-bg: #3a2210;
  --f-xlsx: #6ee7a0; --f-xlsx-bg: #0f2e1d;
  --f-eml: #f7d36b; --f-eml-bg: #33290b;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 14px; line-height: 1.5; }
h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 8px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 7px 10px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { resize: vertical; }
.i { flex: none; vertical-align: -3px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); }
.error { color: var(--bad); display: flex; gap: 6px; align-items: center; }

/* ---------- Botões e controles ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px 12px; font-weight: 500; white-space: nowrap; box-shadow: var(--shadow); }
.btn:hover { background: var(--line-2); }
.btn.primary { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-fill-hover); }
.btn.ghost { box-shadow: none; }
.btn.sm { padding: 3px 8px; font-size: 12.5px; }
.btn.block { width: 100%; justify-content: center; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; background: transparent; border-radius: 8px; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.on { color: var(--brand); }
.icon-btn.star.on, .star.on { color: var(--amber); }
.star.on svg { fill: currentColor; }
.icon-btn.on.i-bookmark svg, #save-conv.on svg { fill: currentColor; }
.link-btn { border: 0; background: none; color: var(--brand); padding: 0; font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 0 4px 0 10px; color: var(--muted); }
.pill select { border: 0; box-shadow: none; padding: 6px 6px 6px 0; background: transparent; max-width: 220px; }
.field-icon { position: relative; display: flex; align-items: center; }
.field-icon > svg, .field-icon > i { position: absolute; left: 10px; color: var(--faint); pointer-events: none; display: flex; }
.field-icon input { width: 100%; padding-left: 32px; }
.grow { flex: 1; }
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--brand-fill); color: var(--on-brand); font-size: 11px; font-weight: 600; font-style: normal; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--line-2); color: var(--ink-2); border-radius: 6px; padding: 1px 8px; font-size: 12px; white-space: nowrap; }
.chip.alt { background: var(--violet-soft); color: var(--violet); }
.chip.more { background: transparent; color: var(--muted); }
.chip.nova { background: transparent; border: 1px dashed var(--faint); }
.chip-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 14px; color: var(--ink-2); box-shadow: var(--shadow); }
.chip-btn:hover { border-color: var(--brand); color: var(--brand); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; border-radius: 6px; padding: 1px 7px; cursor: help; }
.tag.ctx { background: var(--violet-soft); color: var(--violet); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); margin-right: 2px; }
.dot.s-Entregue, .dot.s-Vendida, .dot.s-Emexecução { background: var(--ok); }
.dot.s-Perdida, .dot.s-Cancelada { background: var(--bad); }
.dot.s-Enviada, .dot.s-Emnegociação { background: var(--amber); }
.dot.s-Emelaboração { background: var(--brand-fill); }
.ring { --v: 0; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none; font-size: 12px; font-weight: 700; color: var(--ink);
  background: radial-gradient(closest-side, var(--panel) 78%, transparent 80% 100%), conic-gradient(var(--brand) calc(var(--v) * 1%), var(--line) 0); }
.ring.sm { width: 28px; height: 28px; font-size: 10px; }
.alert { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: 8px; font-size: 13px; margin: 6px 0; }
.alert > svg { margin-top: 2px; }
.alert span { flex: 1; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.error { background: var(--bad-soft); color: var(--bad); }
.toast { position: fixed; right: 20px; bottom: 20px; display: flex; gap: 8px; align-items: center; background: var(--toast-bg); color: var(--toast-ink); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 20; animation: up .2s ease-out; }
.toast.ok svg { color: #4ade80; }
.toast.error svg { color: #f87171; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Topo ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; height: 58px; padding: 0 20px; background: var(--topbar-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: var(--brand); }
.brand span { color: var(--ink); }
.brand em { font-style: normal; font-size: 10px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; cursor: help; }
.tabs { display: flex; gap: 2px; margin: 0 auto; }
.tabs button { position: relative; display: flex; align-items: center; gap: 7px; border: 0; background: none; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.tabs button:hover { background: var(--line-2); color: var(--ink); }
.tabs button.active { background: var(--brand-soft); color: var(--brand); }
.tabs .count { min-width: 16px; height: 16px; font-size: 10px; }
.context { display: flex; align-items: center; gap: 8px; }
.ia-dot { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--faint); background: var(--line-2); cursor: help; }
.ia-dot.on { color: var(--ok); background: var(--ok-soft); }
main { max-width: 1240px; margin: 0 auto; padding: 20px; }
.tab { display: none; }
.tab.active { display: block; }

/* ---------- Perguntar (chat) ---------- */
.chat-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; height: calc(100vh - 98px); }
.chat-layout > * { min-height: 0; }
.chat-layout.no-side { grid-template-columns: 1fr; }
.chat-layout.no-side .convs { display: none; }
.convs { display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.toggle input { display: none; }
.toggle:has(input:checked) { color: var(--amber); }
.toggle:has(input:checked) svg { fill: currentColor; }
#conv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
#conv-list li { display: flex; align-items: center; gap: 2px; border-radius: 8px; padding-right: 2px; }
#conv-list li:hover, #conv-list li.active { background: var(--panel); box-shadow: var(--shadow); }
#conv-list .open { flex: 1; min-width: 0; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 0; text-decoration: none; }
#conv-list .del { opacity: 0; }
#conv-list li:hover .del { opacity: 1; }
#conv-list .del.confirm { opacity: 1; color: var(--bad); background: var(--bad-soft); }
#conv-list .empty { color: var(--faint); font-size: 13px; gap: 6px; padding: 8px; }
.chat-main { display: flex; flex-direction: column; min-width: 0; max-width: 860px; width: 100%; margin: 0 auto; }
.conv-bar { display: flex; align-items: center; gap: 2px; padding-bottom: 8px; }
.conv-bar input { flex: 1; border-color: transparent; background: transparent; font-weight: 600; font-size: 15px; }
.conv-bar input:hover { border-color: var(--line); }
.briefing { display: flex; align-items: center; gap: 8px; background: var(--brand-soft); color: var(--brand-ink); border-radius: 8px; padding: 4px 4px 4px 12px; font-size: 13px; margin-bottom: 8px; }
.briefing span { flex: 1; cursor: help; }
.chat { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 4px 2px 16px; }
.welcome { margin: auto; text-align: center; color: var(--faint); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.welcome h2 { color: var(--ink); font-size: 22px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.msg.user { align-self: flex-end; background: var(--brand-fill); color: var(--on-brand); padding: 9px 14px; border-radius: 14px 14px 4px 14px; max-width: 75%; }
.msg.bot { background: transparent; }
.typing { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); }
.answer-head { display: flex; gap: 6px; align-items: center; justify-content: flex-end; min-height: 4px; }
.answer-head .info { color: var(--faint); cursor: help; display: inline-flex; }
.answer { font-size: 15px; color: var(--ink-2); line-height: 1.6; }
.cite { background: var(--brand-soft); color: var(--brand-ink); border-radius: 4px; padding: 0 5px; font-weight: 500; cursor: help; }
.rcards { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.rcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color .15s; }
.rcard:hover { border-color: var(--line-strong); }
.rhead { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; }
.rt { flex: 1; min-width: 0; }
.rt h4 { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb { display: flex; gap: 0; opacity: .55; }
.rcard:hover .fb, .fb:has(.on) { opacity: 1; }
.fb .on { color: var(--brand); background: var(--brand-soft); }
.chev { color: var(--faint); transition: transform .2s; display: flex; }
.rcard.open .chev { transform: rotate(180deg); }
.rbody { display: none; padding: 0 14px 14px 64px; color: var(--ink-2); }
.rcard.open .rbody { display: flex; flex-direction: column; gap: 8px; }
.why { background: var(--line-2); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.facts { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-2); }
.facts span { display: inline-flex; align-items: center; gap: 5px; cursor: help; }
.facts svg { color: var(--faint); }
.facts.big { font-size: 14px; gap: 20px; margin: 14px 0 10px; }
details > summary { cursor: pointer; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary:hover { color: var(--ink); }
details[open] > summary { color: var(--ink); margin-bottom: 6px; }
.factors { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; font-size: 12.5px; }
.factors em { font-style: normal; color: var(--faint); }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar div { height: 100%; background: var(--brand-fill); border-radius: 3px; }
blockquote { margin: 4px 0; padding: 6px 10px; border-left: 3px solid var(--line); font-size: 13px; color: var(--ink-2); }
blockquote small { display: block; color: var(--faint); }
.rbody h5 { font-size: 12px; color: var(--muted); margin-top: 6px; }
.sources { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; }
.sources a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.sources a:hover { color: var(--brand); }
.also { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; margin-top: 8px; }
.also b { color: var(--ink-2); font-weight: 500; }
.ask { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px 6px 6px 14px; box-shadow: var(--shadow-lg); margin-bottom: 4px; }
.ask:focus-within { border-color: var(--brand); }
.ask input { flex: 1; border: 0; box-shadow: none; padding: 8px 0; font-size: 15px; }
.ask .send { background: var(--brand-fill); color: var(--on-brand); }
.ask .send:hover { background: var(--brand-fill-hover); color: var(--on-brand); }
.memory { display: inline-flex; align-items: center; gap: 4px; background: var(--violet-soft); color: var(--violet); border-radius: 999px; padding: 2px 4px 2px 8px; font-size: 12px; font-weight: 500; white-space: nowrap; cursor: help; }
.memory .forget { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 50%; background: transparent; color: inherit; padding: 0; }
.memory .forget:hover { background: var(--panel); }

/* ---------- Projetos ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.explore { display: flex; gap: 20px; align-items: flex-start; }
.filters { width: 260px; flex: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 78px; max-height: calc(100vh - 100px); overflow: auto; }
.filters-head { display: flex; justify-content: space-between; align-items: center; }
#proj-static { display: flex; flex-direction: column; gap: 8px; }
.filters input, .filters select { width: 100%; font-size: 13px; padding: 6px 8px; }
.filters .field-icon input { padding-left: 32px; }
.seg, .mode { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.seg label, .mode label { display: flex; align-items: center; gap: 3px; cursor: pointer; }
.seg input, .mode input { width: auto !important; margin: 0; }
.range { display: grid; grid-template-columns: 16px 1fr 1fr; gap: 6px; align-items: center; color: var(--faint); }
fieldset { border: 0; border-top: 1px solid var(--line-2); padding: 10px 0 0; margin: 0; }
legend { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); display: flex; width: 100%; align-items: center; }
legend .mode { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; }
.facet { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.facet:hover { background: var(--line-2); }
.facet input { width: auto !important; margin: 0; accent-color: var(--brand); }
.facet span { flex: 1; }
.facet em { font-style: normal; color: var(--faint); font-size: 12px; }
.facet.on { color: var(--brand); font-weight: 500; }
.results { flex: 1; min-width: 0; }
.summary { color: var(--muted); font-size: 13px; display: flex; gap: 12px; align-items: center; }
.summary span { display: inline-flex; gap: 4px; align-items: center; color: var(--faint); cursor: help; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s, box-shadow .15s; outline: none; }
.pcard:hover, .pcard:focus { border-color: var(--brand); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.ptop { display: flex; justify-content: space-between; align-items: center; }
.ptop .icons { display: flex; gap: 6px; color: var(--faint); }
.pcard h4 { font-size: 15px; line-height: 1.35; }
.snippet { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
.pfoot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 10px; gap: 8px; }
.stat { display: inline-flex; align-items: center; gap: 4px; color: var(--faint); font-size: 12.5px; cursor: help; }
.pages { display: flex; gap: 4px; justify-content: center; margin-top: 16px; }
.pages button { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; width: 34px; height: 34px; }
.pages .on { background: var(--brand-fill); color: var(--on-brand); border-color: var(--brand-fill); }
.empty-state { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--faint); padding: 48px 0; }

/* ---------- Diálogos e detalhe do projeto ---------- */
dialog { background: var(--panel); color: var(--ink); border: 0; border-radius: 16px; padding: 20px 24px; box-shadow: var(--shadow-lg); width: min(760px, 94vw); max-height: 90vh; overflow: auto; }
dialog.wide { width: min(920px, 95vw); }
dialog::backdrop { background: var(--backdrop, rgba(17, 24, 39, .45)); backdrop-filter: blur(2px); }
dialog pre, .preview { white-space: pre-wrap; font: 12.5px/1.55 ui-monospace, Consolas, monospace; background: var(--bg); padding: 12px; border-radius: 8px; max-height: 60vh; overflow: auto; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.dlg-head h3 { font-size: 19px; margin: 2px 0; }
.actions { display: flex; gap: 2px; }
.quality { display: inline-flex; align-items: center; gap: 6px; }
.lead { color: var(--ink-2); font-size: 14.5px; margin: 12px 0; }
.sect-title { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 16px 0 8px; font-weight: 600; }
details.sec { border-top: 1px solid var(--line-2); padding: 10px 0; }
details.sec > summary { font-weight: 500; }
details.sec > summary em { font-style: normal; margin-left: auto; background: var(--line-2); border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.doclist { list-style: none; margin: 0; padding: 0; }
.doclist li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; color: var(--faint); }
.doclist li:hover { background: var(--line-2); }
.doclist a, .doc-link { flex: 1; display: flex; gap: 10px; align-items: center; color: var(--ink-2); text-decoration: none; min-width: 0; }
.doclist a svg, .doc-link svg { color: var(--faint); }
.doclist a span, .doc-link span { display: flex; flex-direction: column; min-width: 0; }
.doclist small, .doc-link small { color: var(--faint); font-size: 12px; }
.ents { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 3px; }
.ents li small, .ents a.muted { color: var(--faint); font-size: 12px; margin-left: 4px; }
.related, .hist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.related li, .hist li { display: flex; justify-content: space-between; gap: 10px; }
.related small, .hist small { color: var(--faint); white-space: nowrap; }

/* ---------- Formulários ---------- */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.form-grid label > span { display: flex; align-items: center; gap: 6px; }
.form-grid .span2 { grid-column: span 2; }
.form-grid .span3 { grid-column: 1 / -1; }
details.more { margin: 10px 0; }
details.more[open] > summary svg { transform: rotate(90deg); }
.assist { display: flex; gap: 8px; align-items: flex-start; background: var(--violet-soft); border-radius: 10px; padding: 8px; margin: 8px 0 12px; }
.assist textarea { flex: 1; border-color: transparent; background: var(--panel); }
.icon-btn.magic { background: var(--violet-fill); color: var(--on-brand); width: 38px; height: 38px; }
.icon-btn.magic:hover { background: var(--violet-fill-hover); color: var(--on-brand); }
.similar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.pick { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; cursor: pointer; color: var(--muted); background: var(--panel); transition: all .12s; }
.pick:hover { border-color: var(--faint); }
.pick input { display: none; }
.pick.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); font-weight: 500; }
.pick.nova { border-style: dashed; }
.pick-new { width: 96px; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; border-style: dashed; }
.chips + .chips { margin-top: 10px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 10px; cursor: pointer; }

/* ---------- Enviar ---------- */
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px dashed var(--line); border-radius: 16px; padding: 28px; background: var(--panel); color: var(--faint); text-align: center; transition: all .15s; }
.drop strong { color: var(--ink-2); font-weight: 500; }
.drop small { font-size: 11.5px; letter-spacing: .03em; }
.drop.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.link { color: var(--brand); cursor: pointer; }
.drop .target { margin-top: 8px; }
.upload-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; margin-top: 20px; align-items: start; }
.upload-layout:has(.jobs:empty) { display: none; }
.upload-layout > *, .results, .explore > * { min-width: 0; }
select { max-width: 100%; text-overflow: ellipsis; }
.jobs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.jobs li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.jobs li:hover { background: var(--panel); }
.jobs li.active { background: var(--panel); box-shadow: var(--shadow); outline: 1px solid var(--line); }
.jobs strong { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.fmt { width: 38px; flex: none; text-align: center; border-radius: 6px; padding: 3px 0; font-size: 10px; font-weight: 700; text-transform: uppercase; background: var(--line-2); color: var(--muted); }
.f-pdf { background: var(--f-pdf-bg); color: var(--f-pdf); }
.f-docx { background: var(--f-docx-bg); color: var(--f-docx); }
.f-pptx { background: var(--f-pptx-bg); color: var(--f-pptx); }
.f-xlsx, .f-csv { background: var(--f-xlsx-bg); color: var(--f-xlsx); }
.f-vtt, .f-srt { background: var(--violet-soft); color: var(--violet); }
.f-eml { background: var(--f-eml-bg); color: var(--f-eml); }
.st { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; white-space: nowrap; color: var(--muted); }
.st-aguardando_revisao { color: var(--warn); }
.st-indexado { color: var(--ok); }
.st-rejeitado, .st-erro { color: var(--bad); }
.job-detail { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow); }
.job-detail:empty { display: none; }
.job-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.job-head h3 { display: flex; gap: 8px; align-items: center; font-size: 16px; word-break: break-all; }
.steps { list-style: none; display: flex; gap: 4px; padding: 0; margin: 14px 0; flex-wrap: wrap; }
.steps li { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); background: var(--line-2); border-radius: 999px; padding: 3px 10px 3px 6px; cursor: help; }
.steps .e-ok svg { color: var(--ok); }
.steps .e-aviso { background: var(--warn-soft); color: var(--warn); }
.steps .e-erro { background: var(--bad-soft); color: var(--bad); }
.steps .e-ignorada { opacity: .6; }
.done { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px; color: var(--ok); }
.done p { color: var(--ink-2); }
.review-meta { display: flex; gap: 14px; align-items: center; justify-content: flex-end; color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.review-meta > span { display: inline-flex; align-items: center; gap: 4px; cursor: help; }
.legend { gap: 3px !important; }
.cdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; cursor: help; flex: none; }
.cdot.c4, .cdot.c3 { background: var(--ok); }
.cdot.c2 { background: var(--amber); }
.cdot.c1, .cdot.c0 { background: var(--bad); }
.alts { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.alts::before { content: "ou:"; font-size: 11.5px; color: var(--faint); }
.alts button { border: 1px dashed var(--line); background: var(--panel); border-radius: 6px; font-size: 11.5px; padding: 0 6px; color: var(--muted); }
.alts button:hover { border-color: var(--brand); color: var(--brand); }
.dest { display: flex; flex-direction: column; gap: 4px; }
.dest .opt { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--ink-2); }
.dest .opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.dest .opt input[type=radio] { accent-color: var(--brand); margin: 0; }
.dest .opt > span:last-child { display: flex; flex-direction: column; }
.dest .opt small { color: var(--muted); font-size: 12px; }
.dest .opt select { flex: 1; min-width: 0; }
.dest .novo { padding: 10px 4px 4px; }
.ents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.ent h6 { display: flex; gap: 5px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.ent ul { margin: 0; padding-left: 16px; font-size: 13px; color: var(--ink-2); }
.ent small { color: var(--faint); }

/* ---------- Insights e métricas ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; box-shadow: var(--shadow); cursor: help; }
.tile svg { grid-row: span 2; color: var(--brand); background: var(--brand-soft); border-radius: 10px; padding: 8px; width: 38px; height: 38px; }
.tile strong { font-size: 22px; line-height: 1.1; }
.tile span { color: var(--muted); font-size: 12.5px; }
.panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.panel h4 { display: flex; gap: 8px; align-items: center; font-size: 14px; margin-bottom: 10px; cursor: default; }
.panel h4 svg { color: var(--muted); }
.panel p { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.panel p > svg { color: var(--faint); }
.panel .ents li { display: list-item; }
.panel .ents .chip + svg { margin: 0 2px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl td { padding: 5px 4px; border-bottom: 1px solid var(--line-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl a { color: var(--ink-2); }
.tbl a:hover { color: var(--brand); }
.tbl .num { text-align: right; white-space: nowrap; }
.meter { position: relative; height: 18px; min-width: 90px; background: var(--line-2); border-radius: 5px; overflow: hidden; cursor: help; }
.meter div { height: 100%; background: var(--meter); }
.meter span { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 6px; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.foot { color: var(--faint); font-size: 12px; text-align: center; margin-top: 16px; }

/* ---------- Documentos ---------- */
table.docs { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.docs th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 14px; background: var(--bg); border-bottom: 1px solid var(--line); }
table.docs td { padding: 8px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; color: var(--ink-2); }
table.docs tr:hover td { background: var(--row-hover); }

@media (max-width: 1000px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-layout .convs { display: none; }
  .chat-layout.no-side .convs { display: flex; }
  .explore { flex-direction: column; }
  .filters { width: 100%; position: static; max-height: none; }
  .upload-layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .rbody { padding-left: 14px; }
  .pill select { max-width: 150px; }
  .topbar { gap: 10px; padding: 0 14px; }
  .brand span, .brand em { display: none; }
  .tabs button { padding: 8px 10px; }
}

/* ---------- Acessibilidade ---------- */
html { -webkit-text-size-adjust: 100%; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
.panels { grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); }
.pgrid { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.ents-grid { grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; }
}
/* Telas de toque: sem hover, controles que só apareciam no hover ficam visíveis e os alvos crescem. */
@media (hover: none) {
  #conv-list .del, .fb { opacity: 1; }
  .pcard:hover { transform: none; box-shadow: var(--shadow); border-color: var(--line); }
}
@media (pointer: coarse) {
  .icon-btn { width: 40px; height: 40px; }
  .icon-btn.sm { width: 36px; height: 36px; }
  .btn { padding: 9px 14px; }
  .btn.sm { padding: 6px 10px; }
  .pick { padding: 6px 12px; }
  .facet { padding: 8px 6px; }
  .pages button { width: 40px; height: 40px; }
  .alts button { padding: 4px 8px; }
}

/* ---------- Celular ---------- */
@media (max-width: 720px) {
  body { font-size: 15px; }
  /* 16px evita o zoom automático do iOS ao focar um campo. */
  input, select, textarea { font-size: 16px !important; }
  main { padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); }

  .topbar { height: 52px; padding: 0 12px; gap: 8px; backdrop-filter: none; background: var(--panel); }
  .brand span, .brand em { display: none; }
  .context { margin-left: auto; gap: 4px; min-width: 0; }
  .pill { padding: 0 2px 0 8px; gap: 4px; min-width: 0; }
  .pill select { max-width: 104px; padding: 6px 4px 6px 0; }
  .ia-dot { width: 28px; height: 28px; }

  /* Abas viram barra de navegação inferior, ao alcance do polegar. */
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-up); }
  .tabs button { flex-direction: column; gap: 2px; padding: 6px 0; font-size: 10.5px; min-height: 52px; justify-content: center; }
  .tabs button span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabs button.active { background: none; }
  .tabs button.active svg { background: var(--brand-soft); border-radius: 999px; padding: 2px 12px; width: 44px; height: 24px; }
  .tabs .count { position: absolute; top: 2px; right: calc(50% - 22px); }

  /* Chat ocupa a tela entre o topo e a barra inferior; conversas viram gaveta lateral. */
  .chat-layout { height: calc(100dvh - 52px - 12px - 84px - env(safe-area-inset-bottom)); gap: 0; }
  .chat-layout .convs, .chat-layout.no-side .convs { display: none; }
  .chat-layout.no-side .convs { display: flex; position: fixed; top: 0; bottom: 0; left: 0; z-index: 31; width: min(300px, 86vw); background: var(--bg); padding: 16px 12px calc(16px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: slide .2s ease-out; }
  .chat-layout.no-side::before { content: ''; position: fixed; inset: 0; z-index: 30; background: var(--backdrop); }
  .welcome h2 { font-size: 19px; }
  .msg.user { max-width: 88%; }
  .answer { font-size: 15px; }
  .rhead { gap: 8px; padding: 10px; }
  .rt h4 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .rhead .ring { width: 34px; height: 34px; font-size: 11px; }
  .rbody { padding: 0 12px 12px; }
  .ask { border-radius: 12px; padding: 4px 4px 4px 12px; }

  /* Busca na linha de cima; Filtros, Ordenar e Novo dividem a de baixo sem se sobrepor. */
  .toolbar { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
  .toolbar > * { min-width: 0; }
  .toolbar .field-icon.grow { grid-column: 1 / -1; }
  .toolbar .btn, .toolbar .pill { height: 44px; box-sizing: border-box; }
  .toolbar .btn { justify-content: center; }
  .toolbar .pill { padding: 0 8px 0 12px; gap: 6px; overflow: hidden; }
  .toolbar .pill svg { flex: none; }
  .toolbar .pill select { flex: 1; width: 100%; min-width: 0; max-width: none; padding: 0; text-overflow: ellipsis; }

  /* Diálogos em tela cheia, com cabeçalho fixo. */
  dialog, dialog.wide, dialog.xl { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); }
  .dlg-head { position: sticky; top: 0; z-index: 2; background: var(--panel); padding: 12px 0 8px; margin: 0 0 6px; border-bottom: 1px solid var(--line-2); }
  .dlg-head h3 { font-size: 17px; }
  .facts.big { gap: 10px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: auto; }
  .dialog-actions { position: sticky; bottom: 0; background: var(--panel); padding: 10px 0; margin-top: 8px; }
  .dialog-actions .btn { flex: 1; justify-content: center; }

  .drop { padding: 20px 14px; }
  .drop .target { width: 100%; }
  .drop .target select { flex: 1; min-width: 0; max-width: none; }
  .job-detail { padding: 14px; border-radius: 12px; }
  .job-head { flex-wrap: wrap; }
  .review-meta { justify-content: flex-start; flex-wrap: wrap; }
  .upload-layout { margin-top: 14px; }

  .tiles { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tile { padding: 10px 12px; column-gap: 10px; }
  .tile svg { width: 32px; height: 32px; padding: 6px; }
  .tile strong { font-size: 19px; }
  .panel { padding: 12px; overflow-x: auto; }
  .meter { min-width: 56px; }

  /* Tabela de documentos vira lista de cartões. */
  table.docs, table.docs tbody { display: block; }
  table.docs thead { display: none; }
  table.docs tr { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
  table.docs td { padding: 0; border: 0; font-size: 12.5px; }
  table.docs td:first-child { grid-column: 1 / -1; font-size: 14px; }

  .toast { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@keyframes slide { from { transform: translateX(-100%); } }
.pairs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pairs li { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.pairs small { margin-left: auto; color: var(--faint); }

/* ---------- Clareza: rótulos em texto no lugar de símbolos ---------- */
.trust { display: inline-block; font-size: 11.5px; font-weight: 500; border-radius: 6px; padding: 0 7px; white-space: nowrap; cursor: help; background: var(--line-2); color: var(--muted); }
.trust.t5 { background: var(--ok-soft); color: var(--ok); }
.trust.t4 { background: var(--brand-soft); color: var(--brand-ink); }
.trust.t1 { background: var(--warn-soft); color: var(--warn); }
.match { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 0 7px; margin-right: 4px; white-space: nowrap; cursor: help; }
.match.m3 { background: var(--ok-soft); color: var(--ok); }
.match.m2 { background: var(--brand-soft); color: var(--brand-ink); }
.match.m1 { background: var(--line-2); color: var(--muted); }
.confira { font-style: normal; font-size: 11px; font-weight: 600; color: var(--warn); background: var(--warn-soft); border-radius: 5px; padding: 0 6px; cursor: help; }
.quality .ring.sm { width: 18px; height: 18px; }

/* ---------- Menu "Mais opções" ---------- */
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 260px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.menu-pop hr { border: 0; border-top: 1px solid var(--line-2); margin: 6px 0; width: 100%; }
.menu-pop button { display: flex; align-items: center; gap: 8px; border: 0; background: none; text-align: left; padding: 8px; border-radius: 8px; color: var(--ink-2); }
.menu-pop button:hover { background: var(--line-2); }
.menu-pop button svg { color: var(--muted); }
.menu-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); padding: 4px 8px 0; }
.menu-field span { display: inline-flex; align-items: center; gap: 6px; }
.menu-field em { font-style: normal; font-size: 10.5px; color: var(--violet); background: var(--violet-soft); border-radius: 4px; padding: 0 5px; }
.menu-field select { padding: 6px 8px; width: 100%; }
.menu-pop small { padding: 0 8px; font-size: 11.5px; }

/* ---------- Projetos | Documentos e páginas ---------- */
.segmented { display: inline-flex; gap: 2px; background: var(--line-2); border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.segmented button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 14px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.segmented button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.page-head { margin-bottom: 16px; }
.page-head h2 { font-size: 19px; }
#metrics-extra .panel { max-width: 420px; }

/* ---------- Primeiro acesso e estados vazios ---------- */
.lead-in { color: var(--muted); max-width: 440px; margin: -6px 0 0; }
.intro { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 10px; text-align: left; }
.intro li { display: flex; gap: 10px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.intro li > svg { color: var(--brand); flex: none; margin-top: 2px; }
.intro b { display: block; color: var(--ink); font-size: 13.5px; }
.intro span { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.intro-card { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 820px; }

.noresult { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; margin-top: 8px; }
.noresult .chip-btn, .empty-state .chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: 13px; }

/* ---------- Ações nos resultados ---------- */
.reuse { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-why { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 12px 10px; font-size: 12.5px; color: var(--muted); }
.fb-why .pick { font: inherit; }
.sources .muted { font-size: 12px; }

/* ---------- Upload: resultado primeiro, etapas recolhidas ---------- */
.ready { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; margin: 12px 0 4px; font-size: 13.5px; }
.ready span { flex: 1; }
.ready.ok { background: var(--ok-soft); color: var(--ok); }
.ready.warn { background: var(--warn-soft); color: var(--warn); }
.ready b { color: var(--ink); }
details.how { margin: 6px 0 10px; }
details.how .steps { margin: 6px 0 0; }
.done { flex-direction: column; }
.done .link-btn { margin-top: 2px; }
.toast button { border: 0; background: var(--toast-ink); color: var(--toast-bg); border-radius: 6px; padding: 3px 10px; font-weight: 600; margin-left: 4px; }

@media (max-width: 720px) {
  .menu-pop { position: fixed; top: 56px; right: 8px; left: auto; width: min(280px, calc(100vw - 16px)); }
  #ia-badge { display: none; }
  .segmented { display: flex; }
  .segmented button { flex: 1; justify-content: center; }
  .reuse .btn { flex: 1; justify-content: center; }
  .intro { grid-template-columns: 1fr; }
  .intro li { padding: 8px 10px; }
}

/* Tela de login */
.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.login-box { width: 100%; max-width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 28px 24px; }
.login-brand { text-align: center; margin-bottom: 20px; color: var(--brand); }
.login-brand h1 { margin: 6px 0 2px; font-size: 22px; color: var(--ink); }
.login-brand p { margin: 0; font-size: 12.5px; }
#login { display: grid; gap: 14px; }
#login label { display: grid; gap: 5px; font-weight: 500; }
#login input { font-size: 16px; padding: 10px 12px; }
#login .btn { padding: 10px 12px; font-size: 15px; margin-top: 4px; }
.login-erro { margin: 0; color: var(--bad); background: var(--bad-soft); border-radius: 8px; padding: 8px 10px; font-size: 13px; }

/* Detalhe do projeto: modal grande em duas colunas */
dialog.xl { width: min(1200px, 96vw); height: 92vh; max-height: 92vh; padding: 0 28px 28px; }
.pd-head { position: sticky; top: 0; z-index: 2; background: var(--panel); padding: 20px 0 14px; margin: 0; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.pd-title { min-width: 0; }
.pd-title h3 { font-size: 20px; margin: 2px 0 4px; line-height: 1.3; }
.pd-head .actions { display: flex; align-items: center; gap: 2px; flex: none; }
.pd-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 18px 0 12px; }
.pd-kpis > div { background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd-kpis small { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.pd-kpis small svg { color: var(--faint); }
.pd-kpis b { font-size: 15.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-kpis .bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.pd-kpis .bar i { display: block; height: 100%; background: var(--brand-fill); }
.pd-fontes { display: block; margin-top: 2px; opacity: .85; }
.pd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.pd-sec { margin-bottom: 22px; }
.pd-sec .sect-title em, .pd-card h6 em { font-style: normal; margin-left: 6px; background: var(--line-2); border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--muted); font-weight: 500; }
.pd-text { color: var(--ink-2); font-size: 14.5px; line-height: 1.65; }
.pd-text p { margin: 0 0 8px; }
.pd-insights { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pd-insights li { border-left: 3px solid var(--brand); background: var(--bg); border-radius: 0 8px 8px 0; padding: 8px 12px; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.pd-insights.licao li { border-color: var(--amber); }
.pd-insights.risco li { border-color: var(--bad); }
.pd-insights q { color: var(--ink-2); font-style: italic; }
.pd-insights small, .pd-docs .sub { color: var(--faint); font-size: 12px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pd-insights small a { color: var(--muted); }
.pd-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pd-docs li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.pd-docs li:hover { border-color: var(--brand); }
.pd-doc-top { display: flex; align-items: center; gap: 8px; }
.pd-doc-top a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); text-decoration: none; }
.pd-doc-top a:hover { color: var(--brand); }
.pd-doc-top a svg { color: var(--faint); flex: none; }
.pd-docs p { margin: 2px 0 0; color: var(--ink-2); font-size: 13px; }
.pd-docs .chips { margin-top: 4px; }
.icon-btn.sm { width: 30px; height: 30px; }
.pd-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 90px; }
.pd-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.pd-card h6 { margin: 0 0 8px; font-size: 13px; display: flex; align-items: center; gap: 6px; color: var(--ink); }
.pd-card h6 svg { color: var(--faint); }
details.pd-card > summary { list-style: none; cursor: pointer; }
details.pd-card > summary h6 { margin: 0; }
details.pd-card[open] > summary h6 { margin-bottom: 8px; }
.pd-dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0; font-size: 13px; }
.pd-dl dt { color: var(--muted); }
.pd-dl dd { margin: 0; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 4px; }
.pd-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: grid; gap: 2px; }
.pd-related { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.pd-related li { display: flex; flex-direction: column; }
.pd-related small { color: var(--faint); font-size: 12px; display: flex; align-items: center; gap: 4px; }
.pd-card .chips { display: flex; flex-wrap: wrap; gap: 4px; }
#viewer .dlg-head { gap: 8px; }
#viewer-title { flex: 1; min-width: 0; }

/* Paginação */
.pages { align-items: center; }
.pages button { display: inline-grid; place-items: center; }
.pages button:disabled { opacity: .35; cursor: default; }
.pages .prev svg { transform: rotate(180deg); }
.pages .gap { color: var(--faint); padding: 0 4px; }

@media (max-width: 1000px) {
  .pd-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pd-grid { grid-template-columns: 1fr; }
  .pd-side { position: static; }
}
@media (max-width: 720px) {
  dialog.xl { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); }
  .pd-head { padding: 14px 0 10px; flex-direction: column; gap: 8px; }
  .pd-head .actions { width: 100%; justify-content: flex-end; }
  .pd-head .btn span { display: none; }
  .pd-title h3 { font-size: 17px; }
  .pd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .icon-btn.sm { width: 40px; height: 40px; }
}

/* Revisão do envio: listas editáveis de entidades */
.small { font-size: 12.5px; margin: 0 0 10px; }
.elist { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.elist h6 { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-2); margin: 0; }
.elist h6 svg { color: var(--faint); }
.elist h6 em { font-style: normal; margin-left: auto; color: var(--muted); font-size: 12px; }
.elist ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.elist li { display: flex; align-items: flex-start; gap: 6px; background: var(--bg); border-radius: 6px; padding: 4px 4px 4px 8px; font-size: 13px; color: var(--ink-2); }
.elist li span { flex: 1; min-width: 0; overflow-wrap: anywhere; padding-top: 3px; }
.elist li small { color: var(--faint); }
.elist li .icon-btn.sm { width: 26px; height: 26px; }
.elist-add { display: flex; gap: 4px; align-items: center; }
.elist-add input { flex: 1; min-width: 0; padding: 5px 8px; font-size: 13px; }
.elist-add input[data-papel] { flex: 0 1 90px; }
.ents-grid.ro { margin-top: 12px; }
.check.span3 { margin-top: 0; }
.pd-doc-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.pd-doc-meta span, .pd-doc-meta a { display: inline-flex; align-items: center; gap: 4px; }
.pd-note { background: var(--brand-soft); border-radius: 8px; padding: 6px 10px; margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }
.tag.reuse { background: var(--reuse-bg); color: var(--reuse); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
@media (max-width: 720px) {
  .elist li .icon-btn.sm { width: 36px; height: 36px; }
  .elist-add input[data-papel] { flex-basis: 80px; }
}

/* Como funciona o envio: deixa claro que a revisão vem depois */
.upload-steps { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 12.5px; color: var(--muted); max-width: 620px; }
.upload-steps li { display: flex; align-items: center; gap: 6px; text-align: left; }
.upload-steps b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 11px; flex: none; }
@media (max-width: 720px) { .upload-steps { flex-direction: column; align-items: flex-start; } }

/* Foco do chat: seletor com busca entre todos os projetos */
.focus { position: relative; min-width: 0; }
.focus-btn { cursor: pointer; padding: 6px 10px; font: inherit; color: var(--muted); max-width: 240px; }
.focus-btn #focus-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.focus-btn.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.focus-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.focus-help { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.focus-help b { color: var(--ink-2); font-weight: 500; }
#focus-list { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow: auto; }
#focus-list li[role=option] { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
#focus-list li[role=option]:hover, #focus-list li.ativo { background: var(--line-2); }
#focus-list li.sel { background: var(--brand-soft); }
#focus-list li span { display: flex; flex-direction: column; min-width: 0; }
#focus-list li b { font-weight: 500; color: var(--ink); font-size: 13.5px; }
#focus-list li small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#focus-list li.geral svg { color: var(--faint); flex: none; }
#focus-list .grupo { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); padding: 10px 8px 4px; }
#focus-list .vazio { padding: 10px 8px; color: var(--muted); font-size: 13px; }
#focus-list .dot { flex: none; }
@media (max-width: 1000px) { .focus-btn { max-width: 150px; } }
@media (max-width: 720px) {
  .focus-btn { max-width: 140px; padding: 6px 8px; }
  .focus-pop { position: fixed; top: 56px; left: 8px; right: 8px; width: auto; max-height: calc(100dvh - 160px); }
  #focus-list { max-height: none; flex: 1; }
  #focus-list li[role=option] { padding: 10px 8px; }
}

/* Ajuda: guia de uso e explicação técnica */
#help { padding: 0; display: none; flex-direction: column; overflow: hidden; }
#help[open] { display: flex; }
.help-head { padding: 18px 24px 12px; margin: 0; border-bottom: 1px solid var(--line-2); flex: none; }
.help-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); flex: 1; min-height: 0; }
.help-nav { border-right: 1px solid var(--line-2); padding: 12px 10px; overflow: auto; display: flex; flex-direction: column; gap: 2px; background: var(--bg); }
.help-nav button { display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); font: inherit; cursor: pointer; }
.help-nav button svg { color: var(--faint); flex: none; }
.help-nav button:hover { background: var(--line-2); }
.help-nav button.on { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.help-nav button.on svg { color: var(--brand); }
.help-body { overflow: auto; padding: 22px 32px 40px; font-size: 14.5px; line-height: 1.65; color: var(--ink-2); outline: none; }
.help-body h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 0 0 14px; color: var(--ink); }
.help-body h2 svg { color: var(--brand); }
.help-body h4 { font-size: 15px; color: var(--ink); margin: 26px 0 8px; }
.help-body p { margin: 0 0 12px; max-width: 820px; }
.help-body ul { margin: 0 0 12px; padding-left: 20px; max-width: 820px; }
.help-body li { margin-bottom: 5px; }
.help-body code { font: 12.5px ui-monospace, Consolas, monospace; background: var(--line-2); padding: 1px 5px; border-radius: 4px; color: var(--ink); overflow-wrap: anywhere; }
.help-body kbd { font: 12px ui-monospace, Consolas, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--panel); }
.help-body .ui { font-weight: 500; color: var(--ink); background: var(--line-2); border-radius: 6px; padding: 1px 7px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.guide-steps { counter-reset: s; list-style: none; padding: 0 !important; display: grid; gap: 8px; }
.guide-steps li { counter-increment: s; position: relative; padding: 8px 12px 8px 44px; background: var(--bg); border-radius: 10px; margin: 0 !important; }
.guide-steps li::before { content: counter(s); position: absolute; left: 12px; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-fill); color: var(--on-brand); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.callout { display: flex; gap: 10px; align-items: flex-start; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; }
.callout svg { flex: none; margin-top: 3px; }
.callout.tip { background: var(--brand-soft); color: var(--ink-2); }
.callout.tip svg { color: var(--brand); }
.callout.warn { background: var(--warn-soft); color: var(--ink-2); }
.callout.warn svg { color: var(--warn); }
.tbl-wrap { overflow-x: auto; margin: 0 0 14px; }
.guide-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.guide-tbl th { text-align: left; font-weight: 600; color: var(--ink); background: var(--bg); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.guide-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.guide-tbl td:first-child { color: var(--ink); white-space: nowrap; }
.guide-tbl td svg { vertical-align: -2px; color: var(--faint); }

/* Fluxos desenhados: caixas ligadas por setas */
.flow { list-style: none; margin: 14px 0 18px; padding: 0 !important; display: flex; flex-wrap: wrap; align-items: stretch; gap: 26px; }
.flow .node { position: relative; flex: 1 1 140px; display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel); box-shadow: var(--shadow); margin: 0 !important; }
.flow .node svg { color: var(--brand); margin-bottom: 2px; }
.flow .node b { color: var(--ink); font-size: 13.5px; line-height: 1.3; }
.flow .node small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.flow .node.hl { border-color: var(--brand); background: var(--brand-soft); }
.flow .node:not(:last-child)::after { content: '→'; position: absolute; right: -21px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 18px; }
.flow.v { flex-direction: column; gap: 22px; max-width: 560px; }
.flow.v .node { flex: none; flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.flow.v .node svg { align-self: center; margin: 0; }
.flow.v .node small { flex-basis: 100%; padding-left: 24px; }
.flow.v .node:not(:last-child)::after { content: '↓'; right: auto; left: 22px; top: auto; bottom: -21px; transform: none; }
.arch { margin: 10px 0 18px; }
.arch .flow { margin: 0; }
.arch-down { display: grid; place-items: center; color: var(--faint); margin: 6px 0; }
.er { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 10px 0 18px; }
.er-box { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--panel); max-width: 520px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.er-box b { font: 600 13px ui-monospace, Consolas, monospace; color: var(--ink); }
.er-box small { color: var(--muted); font-size: 12px; }
.er-box.hl { border-color: var(--brand); background: var(--brand-soft); }
.er-rel { font: 12px ui-monospace, Consolas, monospace; color: var(--faint); padding-left: 18px; border-left: 2px solid var(--line); margin-left: 18px; }
.er-split { display: flex; flex-wrap: wrap; gap: 10px; }
.intro-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }

@media (max-width: 1000px) {
  .help-grid { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .help-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line-2); padding: 8px; }
  .help-nav button { white-space: nowrap; flex: none; }
}
@media (max-width: 720px) {
  #help { padding: 0; }
  .help-head { padding: 12px 16px 8px; }
  .help-body { padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); font-size: 15px; }
  .help-nav button span { font-size: 13px; }
  .flow { flex-direction: column; gap: 22px; }
  .flow .node { flex: none; }
  .flow .node:not(:last-child)::after { content: '↓'; right: auto; left: 22px; top: auto; bottom: -21px; transform: none; }
  .guide-tbl td:first-child { white-space: normal; }
}

/* Logo de quem desenvolve: a versão segue o tema */
.impact-logo { display: inline-flex; align-items: center; }
.impact-logo img { display: block; height: auto; }
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
.made-by { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.convs .made-by { margin-top: auto; padding: 14px 4px 4px; }
.made-by.in-menu { display: none; border-top: 1px solid var(--line-2); margin-top: 6px; padding: 10px 8px 2px; }
.made-by.login { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); left: 0; right: 0; justify-content: center; }

/* Seletor de tema no menu */
.theme-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--line-2); border-radius: 8px; padding: 2px; }
.theme-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 0; background: none; border-radius: 6px; padding: 5px 4px; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.theme-seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
@media (max-width: 720px) {
  /* No celular a lista de conversas fica escondida: o crédito aparece no menu. */
  .made-by.in-menu { display: flex; }
  .made-by.login { position: static; margin: 20px 0 0; }
  .login-page { grid-template-rows: 1fr auto; }
}
#conv-list .conv-group { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 6px 4px; background: none !important; box-shadow: none !important; }
#conv-list .conv-group:first-child { padding-top: 2px; }
#conv-list .conv-group svg { color: var(--faint); }
.flow.parallel { gap: 10px; }
.flow.parallel .node::after { content: none !important; }

/* Seletor de cliente com busca (UC07.6) */
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 260px; overflow: auto; font-weight: 400; }
.combo-list li { padding: 7px 10px; border-radius: 6px; cursor: pointer; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.combo-list li:hover, .combo-list li.ativo { background: var(--line-2); }
.combo-list .combo-new { color: var(--brand); font-weight: 500; }
.combo-list .combo-empty { color: var(--muted); cursor: default; font-size: 13px; }
.combo-list .combo-empty:hover { background: none; }
.combo-hint { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 400; min-height: 0; }
.combo-hint:empty { display: none; }
.combo-hint.novo { color: var(--brand); }
.combo-hint.erro { color: var(--bad); }

/* Registro de atividades (UC11) */
.atv-filtros .range input { width: 140px; }
table.atv { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.atv th { text-align: left; font-weight: 600; color: var(--ink); background: var(--bg); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.atv td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; color: var(--ink-2); }
table.atv tr:last-child td { border-bottom: 0; }
table.atv td:first-child { white-space: nowrap; color: var(--muted); }
table.atv td.vals { overflow-wrap: anywhere; max-width: 420px; }
table.atv a { color: var(--brand); text-decoration: none; }
table.atv a:hover { text-decoration: underline; }
table.atv .arrow { color: var(--faint); margin: 0 4px; }
.acao { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.acao.a-criar { background: var(--ok-soft); color: var(--ok); }
.acao.a-editar { background: var(--brand-soft); color: var(--brand-ink); }
.acao.a-excluir { background: var(--bad-soft); color: var(--bad); }
.acao.a-exportar { background: var(--violet-soft); color: var(--violet); }
.acao.a-sugerir { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 720px) {
  /* Tabela vira lista de cartões no celular. */
  table.atv, table.atv tbody, table.atv tr, table.atv td { display: block; width: 100%; }
  table.atv { border: 0; background: none; }
  table.atv thead { display: none; }
  table.atv tr { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
  table.atv td { border: 0; padding: 3px 0; display: grid; grid-template-columns: 80px 1fr; gap: 8px; max-width: none; }
  table.atv td::before { content: attr(data-l); color: var(--muted); font-size: 12px; }
  .atv-filtros { grid-template-columns: 1fr 1fr; }
  .atv-filtros .range { grid-column: 1 / -1; }
  .atv-filtros .range input { width: auto; flex: 1; }
}

/* Filtro "Meus projetos" (UC08.6) */
.mine { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 10px; font: inherit; font-weight: 500; color: var(--ink-2); cursor: pointer; margin-bottom: 4px; }
.mine:hover { border-color: var(--brand); color: var(--brand); }
.mine.on { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--on-brand); }

/* Exportar proposta (UC10) */
.exp-modelos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.exp-modelo { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: var(--panel); }
.exp-modelo input { position: absolute; opacity: 0; pointer-events: none; }
.exp-modelo > svg { color: var(--brand); flex: none; margin-top: 2px; }
.exp-modelo span { display: flex; flex-direction: column; gap: 2px; }
.exp-modelo b { color: var(--ink); }
.exp-modelo small { color: var(--muted); font-size: 12.5px; }
.exp-modelo em { font-style: normal; font-size: 12px; color: var(--brand); font-weight: 500; }
.exp-modelo.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.exp-modelo:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.exp-formatos { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line-2); border-radius: 8px; padding: 2px; }
.exp-formatos label { display: flex; justify-content: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-weight: 500; color: var(--muted); }
.exp-formatos label.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.exp-formatos label:focus-within { outline: 2px solid var(--brand); }
.exp-formatos input { position: absolute; opacity: 0; pointer-events: none; }
.exp-acoes { margin-left: auto; display: flex; gap: 12px; font-weight: 400; }
.exp-secoes { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.exp-secoes label { display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.exp-secoes label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.exp-secoes span { display: flex; flex-direction: column; color: var(--ink-2); }
.exp-secoes small { color: var(--muted); font-size: 11.5px; }
.exp-secoes li.off label { cursor: not-allowed; opacity: .75; }
@media (max-width: 720px) {
  .exp-modelos { grid-template-columns: 1fr; }
  .exp-secoes { grid-template-columns: 1fr; }
}
.exp-campo { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); min-width: 0; }

/* Barras de rolagem finas que seguem o tema (chat, conversas, diálogos, listas) */
:root { --scroll-thumb: #c4c9d2; --scroll-thumb-hover: #9aa1ad; }
:root[data-theme="dark"] { --scroll-thumb: #3a414d; --scroll-thumb-hover: #555e6c; }
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
/* Navegadores sem suporte a scrollbar-color (Safari) usam os pseudo-elementos. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover); }
::-webkit-scrollbar-corner { background: transparent; }

/* Aviso de dados sensíveis (IA externa no V0) */
.sensivel { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: var(--warn-soft); color: var(--ink-2); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); border-radius: 10px; padding: 10px 14px; font-size: 13px; line-height: 1.5; margin: 0 0 12px; }
.sensivel > svg { color: var(--warn); flex: none; margin-top: 1px; }
.sensivel b { color: var(--ink); }
.drop .sensivel { max-width: 620px; margin: 10px 0 2px; }
.sensivel-ok { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; font-weight: 500; color: var(--ink); cursor: pointer; }
.sensivel-ok input { margin-top: 3px; accent-color: var(--brand-fill); }
.sensivel-ok.inline { font-size: 13px; }
#sensitive-dialog { width: min(520px, 94vw); }
.sensivel-form h3 { display: flex; align-items: center; gap: 8px; }
.sensivel-form h3 svg { color: var(--warn); }
.sensivel-form p { margin: 0 0 10px; color: var(--ink-2); }
.sensivel-lista-titulo { font-weight: 600; color: var(--ink) !important; margin-bottom: 4px !important; }
.sensivel-lista { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; color: var(--ink-2); }
.sensivel-lista li { display: flex; align-items: center; gap: 8px; }
.sensivel-lista svg { color: var(--bad); flex: none; }
.sensivel-arquivos { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--muted) !important; background: var(--bg); border-radius: 8px; padding: 6px 10px; overflow-wrap: anywhere; }
.sensivel-form .sensivel-ok { background: var(--warn-soft); border-radius: 8px; padding: 10px 12px; margin: 4px 0 6px; }
.sensivel-form button[value=ok]:disabled { opacity: .5; cursor: not-allowed; }
