/* ═══════════════════════════════════════════════════════════════════════════
   CONSELHEIROS — visual Nexus Core (fundo escuro, roxo como detalhe)
   Escopo: tudo dentro de .cs-root. Controles recebem .orion-cs via JS para
   escapar das regras globais de <button>/<input> do main.css.
   ═══════════════════════════════════════════════════════════════════════════ */

.cs-root {
    --cs-bg: #0c0c11; --cs-s1: #131319; --cs-s2: #1a1a22; --cs-s3: #23232d;
    --cs-line: rgba(255,255,255,.07); --cs-line2: rgba(255,255,255,.12);
    --cs-tx: #ededf2; --cs-mut: #9b9bab; --cs-dim: #6c6c7c;
    --cs-acc: #7c6fd6; --cs-acc2: #b3aae6; --cs-ok: #34d399; --cs-warn: #fbbf24; --cs-err: #f87171;
    color: var(--cs-tx); font-size: 14px; line-height: 1.5;
}
:where(.cs-root) *, :where(.cs-root) *::before, :where(.cs-root) *::after { box-sizing: border-box; }
:where(.cs-root) [hidden] { display: none !important; }
:where(.cs-root) :where(button, a):focus-visible { outline: 2px solid var(--cs-acc2); outline-offset: 2px; }

.orion-cs { font: inherit; color: inherit; margin: 0; -webkit-appearance: none; appearance: none; box-shadow: none; transform: none; min-height: 0; text-transform: none; letter-spacing: normal; }
:where(button).orion-cs { background: none; border: 0; padding: 0; border-radius: 0; cursor: pointer; gap: normal; width: auto; }
:where(input, textarea, select).orion-cs { background: transparent; border: 0; border-radius: 0; padding: 0; outline: none; width: auto; }
@media (max-width: 768px) { .cs-root .orion-cs { min-height: 0 !important; } }

/* ─── Botões ─────────────────────────────────────────────────────────────── */
.cs-root .cs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 11px; font-weight: 600; font-size: 13px; white-space: nowrap; background: var(--cs-s3); color: var(--cs-tx); border: 1px solid var(--cs-line2); transition: background .15s, border-color .15s, opacity .15s; }
.cs-root .cs-btn:hover { background: #2b2b37; }
.cs-root .cs-btn.pri { background: var(--cs-acc); border-color: transparent; color: #fff; }
.cs-root .cs-btn.pri:hover { background: #8a7ee0; }
.cs-root .cs-btn.ghost { background: transparent; }
.cs-root .cs-btn.ghost:hover { background: var(--cs-s2); }
.cs-root .cs-btn.danger { color: var(--cs-err); }
.cs-root .cs-btn.sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 9px; }
.cs-root .cs-btn[disabled] { opacity: .45; cursor: not-allowed; }
.cs-root .cs-icon-btn { width: 32px; height: 32px; border-radius: 9px; display: inline-grid; place-items: center; color: var(--cs-mut); }
.cs-root .cs-icon-btn:hover { background: var(--cs-s3); color: var(--cs-tx); }

/* ─── Campos ─────────────────────────────────────────────────────────────── */
.cs-root .cs-field { display: flex; flex-direction: column; gap: 6px; }
.cs-root .cs-field > label, .cs-root .cs-lbl { font-size: 12px; font-weight: 600; color: var(--cs-mut); }
.cs-root .cs-field .cs-hint { font-size: 11.5px; color: var(--cs-dim); font-weight: 400; }
.cs-root .cs-input, .cs-root .cs-textarea, .cs-root .cs-select {
    width: 100%; background: var(--cs-bg); border: 1px solid var(--cs-line2); border-radius: 10px;
    padding: 9px 12px; color: var(--cs-tx); font-size: 13.5px; transition: border-color .15s;
}
.cs-root .cs-input { height: 40px; }
.cs-root .cs-select { height: 40px; }
.cs-root .cs-textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.cs-root .cs-textarea.tall { min-height: 180px; }
.cs-root .cs-textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.cs-root .cs-input:focus, .cs-root .cs-textarea:focus, .cs-root .cs-select:focus { border-color: var(--cs-acc); }
.cs-root .cs-input::placeholder, .cs-root .cs-textarea::placeholder { color: var(--cs-dim); }
.cs-root .cs-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cs-root .cs-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cs-root .cs-stack { display: flex; flex-direction: column; gap: 14px; }

/* ─── Estrutura geral ────────────────────────────────────────────────────── */
.cs-page { max-width: 1240px; margin: 0 auto; padding: 4px 0 40px; }
.cs-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.cs-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.cs-head p { margin: 4px 0 0; color: var(--cs-mut); font-size: 13.5px; max-width: 620px; }
.cs-head .cs-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cs-crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--cs-mut); font-size: 12.5px; margin-bottom: 8px; text-decoration: none; }
.cs-crumb:hover { color: var(--cs-tx); }
.cs-section-title { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 12px; }
.cs-section-title h2 { margin: 0; font-size: 15px; font-weight: 700; }
.cs-card { background: var(--cs-s1); border: 1px solid var(--cs-line); border-radius: 16px; }
.cs-muted { color: var(--cs-mut); }
.cs-dim { color: var(--cs-dim); }

/* ─── Avatar ─────────────────────────────────────────────────────────────── */
.cs-av { --c: var(--cs-acc); flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 45%, #0c0c11)); overflow: hidden; position: relative; }
.cs-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; z-index: 1; }
.cs-av.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 19px; }
.cs-av.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
.cs-av.xs { width: 22px; height: 22px; border-radius: 7px; font-size: 9.5px; }
.cs-av.mod { background: linear-gradient(135deg, #3a3a48, #1a1a22); color: var(--cs-acc2); }
.cs-av.me { background: linear-gradient(135deg, #2f2f3b, #1f1f28); color: var(--cs-tx); }
.cs-av-stack { display: inline-flex; }
.cs-av-stack .cs-av { border: 2px solid var(--cs-s1); margin-left: -7px; }
.cs-av-stack .cs-av:first-child { margin-left: 0; }

/* ─── Pílulas ────────────────────────────────────────────────────────────── */
.cs-pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--cs-s3); color: var(--cs-mut); white-space: nowrap; }
.cs-pill.ok { color: var(--cs-ok); background: rgba(52,211,153,.12); }
.cs-pill.warn { color: var(--cs-warn); background: rgba(251,191,36,.12); }
.cs-pill.err { color: var(--cs-err); background: rgba(248,113,113,.12); }
.cs-pill.acc { color: var(--cs-acc2); background: rgba(124,111,214,.16); }
.cs-pill .spin { width: 9px; height: 9px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: cs-spin .8s linear infinite; }
@keyframes cs-spin { to { transform: rotate(360deg); } }

/* ─── Painel: grid de conselheiros ──────────────────────────────────────── */
.cs-grid-cons { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cs-cons-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; transition: border-color .15s, transform .15s; }
.cs-cons-card:hover { border-color: var(--cs-line2); }
.cs-cons-top { display: flex; gap: 12px; align-items: center; }
.cs-cons-top h3 { margin: 0; font-size: 15.5px; font-weight: 700; }
.cs-cons-top .t { font-size: 12.5px; color: var(--cs-mut); margin-top: 2px; }
.cs-cons-bio { font-size: 13px; color: var(--cs-mut); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 39px; }
.cs-cons-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.cs-cons-actions { display: flex; gap: 8px; margin-top: auto; }
.cs-cons-actions .cs-btn { flex: 1; }
.cs-new-card { border: 1px dashed var(--cs-line2); background: transparent; border-radius: 16px; min-height: 196px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--cs-mut); font-weight: 600; width: 100%; }
.cs-new-card:hover { border-color: var(--cs-acc); color: var(--cs-tx); background: rgba(124,111,214,.05); }
.cs-new-card i { font-size: 20px; }

.cs-list { display: flex; flex-direction: column; }
.cs-row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--cs-line); text-decoration: none; color: inherit; }
.cs-row:last-child { border-bottom: 0; }
.cs-row:hover { background: var(--cs-s2); }
.cs-row .main { flex: 1; min-width: 0; }
.cs-row .main b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-row .main span { display: block; font-size: 12.5px; color: var(--cs-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-row .when { font-size: 12px; color: var(--cs-dim); white-space: nowrap; }
.cs-empty { padding: 34px 20px; text-align: center; color: var(--cs-mut); }
.cs-empty i { display: block; font-size: 26px; margin-bottom: 10px; color: var(--cs-dim); }

/* ─── Editor de conselheiro ─────────────────────────────────────────────── */
.cs-editor-hero { display: flex; align-items: center; gap: 16px; }
.cs-editor-hero h1 { margin: 0; font-size: 22px; }
.cs-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--cs-line); margin: 20px 0 22px; overflow-x: auto; scrollbar-width: none; }
.cs-tabs::-webkit-scrollbar { display: none; }
.cs-root .cs-tab { height: 40px; padding: 0 14px; font-weight: 600; font-size: 13px; color: var(--cs-mut); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.cs-root .cs-tab:hover { color: var(--cs-tx); }
.cs-root .cs-tab.on { color: var(--cs-tx); border-bottom-color: var(--cs-acc); }
.cs-panel { padding: 22px; }
.cs-panel + .cs-panel { margin-top: 14px; }
.cs-panel h3 { margin: 0 0 4px; font-size: 14.5px; }
.cs-panel > p.cs-muted { margin: 0 0 16px; font-size: 13px; }
.cs-savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 16px; border-radius: 14px; background: rgba(26,26,34,.92); backdrop-filter: blur(8px); border: 1px solid var(--cs-line2); }
.cs-savebar .msg { font-size: 12.5px; color: var(--cs-mut); }
.cs-banner { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: 12px; background: rgba(124,111,214,.1); border: 1px solid rgba(124,111,214,.3); font-size: 13px; margin-bottom: 14px; }
.cs-banner i { color: var(--cs-acc2); margin-top: 2px; }
.cs-banner.warn { background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.25); }
.cs-banner.warn i { color: var(--cs-warn); }
.cs-color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cs-root .cs-swatch { width: 28px; height: 28px; border-radius: 9px; border: 2px solid transparent; }
.cs-root .cs-swatch.on { border-color: #fff; }

/* dossiê */
.cs-dossie-sec { border-top: 1px solid var(--cs-line); padding-top: 18px; margin-top: 18px; }
.cs-dossie-sec:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.cs-dossie-sec h4 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--cs-acc2); }
.cs-ex-item { background: var(--cs-bg); border: 1px solid var(--cs-line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.cs-ex-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--cs-dim); font-weight: 600; }

/* fontes */
.cs-drop { border: 1.5px dashed var(--cs-line2); border-radius: 14px; padding: 26px; text-align: center; color: var(--cs-mut); cursor: pointer; transition: border-color .15s, background .15s; }
.cs-drop:hover, .cs-drop.over { border-color: var(--cs-acc); background: rgba(124,111,214,.06); color: var(--cs-tx); }
.cs-drop i { font-size: 22px; display: block; margin-bottom: 8px; }
.cs-src-add { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cs-src-add .cs-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--cs-s2); }
.cs-src-add h4 { margin: 0; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.cs-src-add h4 i { color: var(--cs-acc2); }
.cs-src-list .cs-row { cursor: default; }
.cs-src-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--cs-s3); color: var(--cs-mut); flex: none; }
.cs-src-ico.youtube { color: #ff5a5a; background: rgba(255,90,90,.1); }
.cs-src-ico.pdf { color: #f59e0b; background: rgba(245,158,11,.1); }
.cs-src-ico.texto { color: var(--cs-acc2); background: rgba(124,111,214,.12); }
.cs-src-err { font-size: 12px; color: var(--cs-err); white-space: normal !important; }
.cs-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 16px; }
.cs-stat b { display: block; font-size: 20px; font-weight: 700; }
.cs-stat span { font-size: 12px; color: var(--cs-mut); }
.cs-hit { background: var(--cs-bg); border: 1px solid var(--cs-line); border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.cs-hit + .cs-hit { margin-top: 8px; }
.cs-hit .h { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--cs-mut); margin-bottom: 6px; }
.cs-prompt { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.55; background: var(--cs-bg); border: 1px solid var(--cs-line); border-radius: 12px; padding: 16px; max-height: 560px; overflow: auto; color: #cfcfe0; }

/* ─── Sala de reunião ───────────────────────────────────────────────────── */
.cs-room { display: grid; grid-template-columns: 270px minmax(0, 1fr); height: calc(100vh - 90px); min-height: 540px; background: var(--cs-bg); border: 1px solid var(--cs-line2); border-radius: 18px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.cs-room.solo { grid-template-columns: minmax(0, 1fr); }
.cs-room-side { background: var(--cs-s1); border-right: 1px solid var(--cs-line); display: flex; flex-direction: column; min-height: 0; }
.cs-room-side .top { padding: 18px 16px 12px; border-bottom: 1px solid var(--cs-line); }
.cs-room-side .top .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--cs-dim); font-weight: 700; margin-bottom: 10px; }
.cs-part { display: flex; align-items: center; gap: 10px; padding: 9px 16px; }
.cs-part .n { flex: 1; min-width: 0; }
.cs-part .n b { display: block; font-size: 13.5px; font-weight: 600; }
.cs-part .n span { display: block; font-size: 11.5px; color: var(--cs-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-part .st { font-size: 11px; color: var(--cs-dim); }
.cs-part.thinking .st { color: var(--cs-acc2); }
.cs-part .cs-av { transition: box-shadow .2s; }
.cs-part.thinking .cs-av { box-shadow: 0 0 0 3px rgba(124,111,214,.35); animation: cs-pulse 1.4s ease-in-out infinite; }
@keyframes cs-pulse { 50% { box-shadow: 0 0 0 5px rgba(124,111,214,.12); } }
.cs-controls { margin-top: auto; padding: 14px 16px 16px; border-top: 1px solid var(--cs-line); display: flex; flex-direction: column; gap: 8px; }
.cs-controls .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--cs-dim); font-weight: 700; margin-bottom: 2px; }
.cs-root .cs-controls .cs-btn { justify-content: flex-start; width: 100%; }
.cs-root .cs-controls .cs-btn small { margin-left: auto; font-weight: 500; color: var(--cs-dim); font-size: 11px; }

.cs-room-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.cs-room-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--cs-line); }
.cs-room-head .t { flex: 1; min-width: 0; }
.cs-room-head .t b { display: block; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-room-head .t span { display: block; font-size: 12px; color: var(--cs-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-feed { flex: 1; overflow-y: auto; padding: 22px 20px 12px; scroll-behavior: smooth; }
.cs-feed-inner { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.cs-pauta { background: var(--cs-s1); border: 1px solid var(--cs-line); border-radius: 14px; padding: 14px 16px; font-size: 13.5px; }
.cs-pauta .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--cs-acc2); font-weight: 700; margin-bottom: 6px; }
.cs-divider { display: flex; align-items: center; gap: 12px; color: var(--cs-dim); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.cs-divider::before, .cs-divider::after { content: ""; flex: 1; height: 1px; background: var(--cs-line); }

.cs-msg { display: flex; gap: 12px; align-items: flex-start; }
.cs-msg .body { flex: 1; min-width: 0; }
.cs-msg .who { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.cs-msg .who b { font-size: 13.5px; }
.cs-msg .who span { font-size: 11.5px; color: var(--cs-dim); }
.cs-msg .txt { font-size: 14px; line-height: 1.6; color: #dcdce6; overflow-wrap: anywhere; }
.cs-msg .txt p { margin: 0 0 8px; }
.cs-msg .txt p:last-child { margin-bottom: 0; }
.cs-msg .txt ul, .cs-msg .txt ol { margin: 4px 0 8px; padding-left: 20px; }
.cs-msg .txt li { margin: 2px 0; }
.cs-msg .txt b { color: var(--cs-tx); }
.cs-msg.me { flex-direction: row-reverse; }
.cs-msg.me .body { display: flex; flex-direction: column; align-items: flex-end; }
.cs-msg.me .txt { background: var(--cs-acc); color: #fff; padding: 10px 14px; border-radius: 14px 14px 4px 14px; max-width: 78%; }
.cs-msg.me .txt b { color: #fff; }
.cs-msg.mod .txt { background: var(--cs-s1); border: 1px solid rgba(124,111,214,.3); border-radius: 14px; padding: 14px 16px; }
.cs-msg.typing .txt { color: var(--cs-dim); font-style: italic; }
.cs-dots { display: inline-flex; gap: 4px; margin-left: 4px; }
.cs-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: cs-dot 1.2s infinite; }
.cs-dots i:nth-child(2) { animation-delay: .15s; } .cs-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes cs-dot { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.cs-msg .err { color: var(--cs-err); font-size: 13px; }
.cs-root .cs-src-toggle { margin-top: 8px; font-size: 11.5px; color: var(--cs-mut); display: inline-flex; align-items: center; gap: 6px; }
.cs-root .cs-src-toggle:hover { color: var(--cs-tx); }
.cs-src-pop { margin-top: 8px; display: grid; gap: 6px; }
.cs-src-pop .it { font-size: 12px; background: var(--cs-s1); border: 1px solid var(--cs-line); border-radius: 10px; padding: 8px 10px; color: var(--cs-mut); }
.cs-src-pop .it b { color: var(--cs-tx); font-weight: 600; }
.cs-src-pop a { color: var(--cs-acc2); }

.cs-composer { border-top: 1px solid var(--cs-line); padding: 12px 20px 16px; }
.cs-composer-inner { max-width: 820px; margin: 0 auto; }
.cs-mentions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.cs-root .cs-mention { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 4px; border-radius: 999px; background: var(--cs-s2); border: 1px solid var(--cs-line); font-size: 12px; color: var(--cs-mut); }
.cs-root .cs-mention:hover { color: var(--cs-tx); border-color: var(--cs-line2); }
.cs-box { display: flex; align-items: flex-end; gap: 10px; background: var(--cs-s1); border: 1px solid var(--cs-line2); border-radius: 14px; padding: 8px 8px 8px 14px; }
.cs-box:focus-within { border-color: rgba(124,111,214,.6); }
.cs-root .cs-box textarea { flex: 1; min-height: 24px; max-height: 180px; resize: none; background: transparent; border: 0; color: var(--cs-tx); font-size: 14px; line-height: 1.5; padding: 6px 0; }
.cs-root .cs-mic { width: 38px; height: 38px; border-radius: 11px; background: var(--cs-s2); border: 1px solid var(--cs-line2); color: var(--cs-mut); display: grid; place-items: center; flex: none; transition: all .2s; cursor: pointer; }
.cs-root .cs-mic:hover { color: var(--cs-tx); background: var(--cs-s3); border-color: var(--cs-line); }
.cs-root .cs-mic.rec { background: #dc2626 !important; border-color: #ef4444 !important; color: #fff !important; animation: cs-mic-pulse 1.2s infinite ease-in-out; }
@keyframes cs-mic-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    50% { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.15); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.cs-root .cs-send { width: 38px; height: 38px; border-radius: 11px; background: var(--cs-acc); color: #fff; display: grid; place-items: center; flex: none; }
.cs-root .cs-send[disabled] { opacity: .4; cursor: not-allowed; }
.cs-composer .tip { font-size: 11.5px; color: var(--cs-dim); margin-top: 7px; }

/* ─── Modal ─────────────────────────────────────────────────────────────── */
.cs-modal-bg { position: fixed; inset: 0; z-index: 1000; background: rgba(5,5,8,.7); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; }
.cs-modal { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--cs-s1); border: 1px solid var(--cs-line2); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.cs-modal .mh { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.cs-modal .mh h2 { margin: 0; font-size: 17px; }
.cs-modal .mb { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.cs-modal .mf { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }
.cs-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.cs-root .cs-pick-it { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--cs-line2); text-align: left; background: var(--cs-bg); }
.cs-root .cs-pick-it.on { border-color: var(--cs-acc); background: rgba(124,111,214,.1); }
.cs-root .cs-pick-it .n { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-root .cs-pick-it .ck { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--cs-line2); display: grid; place-items: center; font-size: 10px; color: transparent; flex: none; }
.cs-root .cs-pick-it.on .ck { background: var(--cs-acc); border-color: var(--cs-acc); color: #fff; }
.cs-seg { display: inline-flex; background: var(--cs-bg); border: 1px solid var(--cs-line2); border-radius: 11px; padding: 3px; }
.cs-root .cs-seg button { height: 32px; padding: 0 14px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--cs-mut); }
.cs-root .cs-seg button.on { background: var(--cs-s3); color: var(--cs-tx); }

/* ─── Toast ─────────────────────────────────────────────────────────────── */
.cs-toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 1100; background: #23232d; color: #ededf2; border: 1px solid rgba(255,255,255,.12); padding: 10px 16px; border-radius: 12px; font-size: 13px; box-shadow: 0 12px 40px rgba(0,0,0,.5); display: flex; gap: 10px; align-items: center; max-width: calc(100vw - 32px); }
.cs-toast.err i { color: #f87171; } .cs-toast.ok i { color: #34d399; }

/* ─── Responsivo ────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
    .cs-src-add { grid-template-columns: 1fr; }
    .cs-grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
    .cs-grid2, .cs-grid3 { grid-template-columns: 1fr; }
    .cs-room { grid-template-columns: 1fr; height: calc(100vh - 120px); border-radius: 14px; }
    .cs-room-side { display: none; }
    .cs-room-side.open { display: flex; position: absolute; inset: 0; z-index: 20; }
    .cs-room { position: relative; }
    .cs-msg.me .txt { max-width: 92%; }
    .cs-feed { padding: 16px 12px 8px; }
    .cs-composer { padding: 10px 12px 12px; }
    .cs-head h1 { font-size: 21px; }
}
@media (min-width: 761px) { .cs-root .cs-only-mobile { display: none !important; } }

/* ═══ Formato de leitura das respostas (v2) ═══════════════════════════════
   Base científica: escaneamento em camadas (títulos + negrito), sinalização
   e segmentação (Mayer), linha de ~68 caracteres, 4 cores semânticas fixas. */
.cs-root { --cs-script: #8b7cf0; --cs-insight: #5aa9f5; --cs-alerta: #f2b93b; --cs-acao: #34d399; }
.cs-msg:not(.me) .txt { max-width: 72ch; font-size: 15.5px; line-height: 1.72; color: #d4d4de; }
.cs-msg:not(.me) .txt p { margin: 0 0 14px; }
.cs-msg:not(.me) .txt > p:first-child { font-size: 16.5px; color: var(--cs-tx); }
.cs-msg .txt b { color: var(--cs-tx); font-weight: 650; }
.cs-msg .txt code { background: var(--cs-s3); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.cs-msg .txt .cs-h { font-size: 18px; letter-spacing: -.01em; margin: 26px 0 12px; color: var(--cs-tx); line-height: 1.35; }
.cs-msg .txt .cs-quote { border-left: 3px solid var(--cs-acc); padding: 2px 0 2px 14px; margin: 6px 0 18px; color: var(--cs-tx); font-size: 16px; font-weight: 600; }

/* passos recolhíveis */
.cs-step { border: 1px solid var(--cs-line); border-radius: 16px; background: var(--cs-s1); margin: 0 0 12px; }
.cs-step > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; gap: 12px; align-items: center; }
.cs-step > summary::-webkit-details-marker { display: none; }
.cs-step > summary .n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--cs-s3); font-weight: 700; font-size: 13px; color: var(--cs-acc2); flex: none; }
.cs-step > summary .t { flex: 1; font-weight: 650; font-size: 15.5px; color: var(--cs-tx); line-height: 1.4; }
.cs-step > summary .chev { color: var(--cs-dim); transition: transform .2s; }
.cs-step[open] > summary .chev { transform: rotate(180deg); }
.cs-step > .in { padding: 0 16px 14px 58px; }
.cs-step > .in > :last-child { margin-bottom: 0; }

/* etiquetas */
.cs-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.cs-chip { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(124,111,214,.14); color: var(--cs-acc2); line-height: 1.5; }

/* blocos */
.cs-co { border-radius: 12px; padding: 12px 15px; margin: 12px 0 14px; border: 1px solid; font-size: 15px; line-height: 1.65; }
.cs-co .h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.cs-co p { margin: 0 0 8px !important; font-size: 15px !important; color: inherit !important; }
.cs-co p:last-child { margin-bottom: 0 !important; }
.cs-co ul, .cs-co ol { margin: 2px 0 4px; }
.cs-co.resumo { background: linear-gradient(135deg, rgba(124,111,214,.16), rgba(124,111,214,.04)); border-color: rgba(124,111,214,.35); color: var(--cs-tx); margin: 4px 0 22px; }
.cs-co.resumo .h { color: var(--cs-acc2); }
.cs-co.script { background: rgba(139,124,240,.08); border-color: rgba(139,124,240,.35); color: #e6e2ff; }
.cs-co.script .h { color: var(--cs-script); }
.cs-co.insight { background: rgba(90,169,245,.07); border-color: rgba(90,169,245,.28); }
.cs-co.insight .h { color: var(--cs-insight); }
.cs-co.alerta { background: rgba(242,185,59,.07); border-color: rgba(242,185,59,.28); }
.cs-co.alerta .h { color: var(--cs-alerta); }
.cs-co.acao { background: rgba(52,211,153,.07); border-color: rgba(52,211,153,.28); }
.cs-co.acao .h { color: var(--cs-acao); }
.cs-root .cs-copy { font-size: 11px; font-weight: 600; color: var(--cs-acc2); background: rgba(139,124,240,.15); border-radius: 7px; padding: 4px 9px; letter-spacing: 0; text-transform: none; }
.cs-root .cs-copy:hover { background: rgba(139,124,240,.28); }

/* referências da memória no rodapé */
.cs-fontes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--cs-line); max-width: 72ch; }
.cs-fontes .l { font-size: 12px; color: var(--cs-dim); margin-right: 2px; }
.cs-root .cs-fonte-chip { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--cs-s2); border: 1px solid var(--cs-line); color: var(--cs-mut); }
.cs-root .cs-fonte-chip:hover { color: var(--cs-tx); border-color: var(--cs-line2); }

@media (max-width: 760px) {
    .cs-step > .in { padding: 0 12px 12px 12px; }
    .cs-msg:not(.me) .txt { font-size: 15px; }
}
.cs-msg.mod .txt { background: none; border: 0; padding: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   MODO CLARO — o módulo só tinha paleta escura: no tema claro o título e
   vários rótulos ficavam brancos sobre fundo claro (invisíveis) e as caixas
   continuavam pretas.
   ═══════════════════════════════════════════════════════════════════════════ */
html[data-theme="light"] .cs-root,
html[data-theme="light"] .cs-modal-bg {
    --cs-bg: #ffffff; --cs-s1: #f7f6fc; --cs-s2: #f0eef8; --cs-s3: #e6e3f3;
    --cs-line: rgba(20, 18, 37, .08); --cs-line2: rgba(20, 18, 37, .13);
    --cs-tx: #141225; --cs-mut: #5b5873; --cs-dim: #87849c;
    --cs-acc: #6d5fd6; --cs-acc2: #5b4fc4; --cs-ok: #059669; --cs-warn: #b45309; --cs-err: #dc2626;
    color: var(--cs-tx);
}
html[data-theme="light"] .cs-root .cs-btn:hover { background: #dcd8ee; }
html[data-theme="light"] .cs-root .cs-btn.pri:hover { background: #5b4fc4; }
html[data-theme="light"] .cs-av.mod { background: linear-gradient(135deg, #ece8fb, #dcd6f5); }
html[data-theme="light"] .cs-av.me { background: linear-gradient(135deg, #e6e3f3, #d6d2ea); }
html[data-theme="light"] .cs-savebar { background: rgba(255, 255, 255, .94); box-shadow: 0 10px 30px rgba(20, 18, 37, .08); }
html[data-theme="light"] .cs-root .cs-swatch.on { border-color: #141225; }
html[data-theme="light"] .cs-prompt { color: #2f2c45; }
html[data-theme="light"] .cs-room { box-shadow: 0 1px 2px rgba(20, 18, 37, .04), 0 16px 40px rgba(91, 79, 196, .08); }
html[data-theme="light"] .cs-msg .txt,
html[data-theme="light"] .cs-msg:not(.me) .txt { color: #2a2740; }
html[data-theme="light"] .cs-msg.me .txt { color: #fff; }
html[data-theme="light"] .cs-co.script { color: #3b2f8f; }
html[data-theme="light"] .cs-modal-bg { background: rgba(20, 18, 37, .35); }
html[data-theme="light"] .cs-modal { box-shadow: 0 30px 80px rgba(20, 18, 37, .2); }
html[data-theme="light"] .cs-toast { background: #141225; color: #fff; border-color: transparent; box-shadow: 0 12px 30px rgba(20, 18, 37, .2); }

/* ─── Card de Documento Executivo / PDF ─────────────────────────────────── */
.cs-doc-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, rgba(124, 111, 214, 0.16), rgba(20, 20, 30, 0.85));
    border: 1px solid rgba(124, 111, 214, 0.4);
    border-radius: 14px;
    padding: 14px 18px;
    margin: 8px 0 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    flex-wrap: wrap;
}
.cs-doc-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 20px;
    flex: none;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}
.cs-doc-info {
    flex: 1;
    min-width: 200px;
}
.cs-doc-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--cs-acc2);
    text-transform: uppercase;
    margin-bottom: 2px;
}
.cs-doc-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--cs-tx);
    line-height: 1.3;
}
.cs-doc-sub {
    font-size: 12px;
    color: var(--cs-mut);
    margin-top: 2px;
    line-height: 1.4;
}
.cs-btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--cs-acc);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 0;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    flex: none;
}
.cs-btn-pdf:hover {
    background: #9084ea;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 111, 214, 0.35);
}
.cs-msg-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--cs-mut);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--cs-line);
    border-radius: 6px;
    padding: 2px 8px;
    cursor: pointer;
    margin-left: 8px;
    transition: all .15s;
}
.cs-msg-pdf-btn:hover {
    color: #fff;
    background: rgba(124, 111, 214, 0.25);
    border-color: rgba(124, 111, 214, 0.5);
}

/* Container de Exportação de PDF (Layout A4 Executivo) */
.pdf-export-container {
    width: 210mm;
    min-height: 297mm;
    padding: 18mm 20mm;
    background: #ffffff !important;
    color: #1e293b !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -9999;
}
.pdf-export-container * {
    box-sizing: border-box;
}
.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #6366f1;
    padding-bottom: 12px;
    margin-bottom: 20px;
}
.pdf-brand .pdf-logo {
    display: block;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .05em;
    color: #4f46e5;
}
.pdf-brand .pdf-sub {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}
.pdf-meta {
    text-align: right;
    font-size: 11px;
    color: #475569;
    line-height: 1.5;
}
.pdf-title-banner {
    background: #f8fafc;
    border-left: 4px solid #6366f1;
    padding: 12px 16px;
    margin-bottom: 24px;
    border-radius: 0 8px 8px 0;
}
.pdf-title-banner h1 {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px;
    line-height: 1.3;
}
.pdf-destinatario {
    font-size: 12px;
    color: #64748b;
}
.pdf-content h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
    margin: 22px 0 12px;
}
.pdf-content p {
    color: #334155;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.6;
}
.pdf-step-box {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-bottom: 14px;
    background: #f8fafc;
    page-break-inside: avoid;
}
.pdf-step-title {
    font-weight: 700;
    font-size: 14px;
    color: #0f172a;
    padding: 10px 14px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
}
.pdf-step-body {
    padding: 12px 14px;
    color: #334155;
}
.pdf-content .cs-co {
    border-radius: 8px;
    padding: 10px 14px;
    margin: 10px 0;
    border: 1px solid;
    page-break-inside: avoid;
}
.pdf-content .cs-co.script { background: #f5f3ff; border-color: #c4b5fd; color: #4338ca; }
.pdf-content .cs-co.insight { background: #f0f9ff; border-color: #bae6fd; color: #0369a1; }
.pdf-content .cs-co.alerta { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.pdf-content .cs-co.acao { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.pdf-content .cs-co.resumo { background: #f5f3ff; border-color: #a5b4fc; color: #312e81; }
.pdf-footer {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #cbd5e1;
    padding-top: 10px;
    margin-top: 30px;
    font-size: 10px;
    color: #94a3b8;
}

/* Quando a sidebar está recolhida (modo tela cheia), expande o contêiner de conversa */
html.sidebar-collapsed .cs-feed-inner,
body.sidebar-collapsed .cs-feed-inner,
html.sidebar-collapsed .cs-composer-inner,
body.sidebar-collapsed .cs-composer-inner {
    max-width: 1060px;
    transition: max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

