:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --line: #e3e7ef;
  --line-2: #d3d9e5;
  --text: #0e1628;
  --muted: #5a6478;
  --faint: #8a93a6;
  --ink: #0b1430;
  --ink-2: #131f45;
  --ink-text: #c9d1e6;
  --brand: #2557d6;
  --brand-2: #1d47b5;
  --brand-soft: #eaf0fd;
  --gold: #c9a45c;
  --ok: #157347;
  --ok-soft: #e7f5ee;
  --warn: #a15c07;
  --warn-soft: #fdf3e2;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .10);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
.oculto { display: none !important; }
svg { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.etiqueta svg { width: 12px; height: 12px; vertical-align: -1px; }
.passo-ia .bolinha svg { width: 10px; height: 10px; vertical-align: 0; }
.anexo-chip svg { width: 14px; height: 14px; }
.resultado-vazio svg { width: 30px; height: 30px; color: #9aa6bf; }
.voltar svg, .lateral-rodape svg { width: 14px; height: 14px; }
.aviso > svg { width: 18px; height: 18px; margin-top: 1px; }

/* ------------------------------------------------ layout */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.lateral {
  background: var(--ink); color: var(--ink-text); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid #0a1128;
}
.marca { display: flex; align-items: center; gap: 10px; padding: 20px 18px 18px; color: #fff; text-decoration: none; }
.marca:hover { text-decoration: none; }
.marca-selo {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(140deg, #2b5fe0, #18306f); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.marca-nome { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.marca-sub { font-size: 11.5px; color: #8e9bc2; margin-top: 1px; }
.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-titulo { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6f7ca6; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--ink-text);
  font-size: 13.5px; text-decoration: none;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.ativo { background: rgba(83,128,255,.18); color: #fff; }
.nav svg { width: 17px; height: 17px; flex: none; opacity: .9; }
.lateral-rodape { margin-top: auto; padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.07); font-size: 12.5px; }
.lateral-rodape .quem { color: #fff; font-weight: 600; }
.lateral-rodape .email { color: #8290b8; overflow: hidden; text-overflow: ellipsis; }
.lateral-rodape button { margin-top: 8px; background: none; border: 0; color: #9aa7cf; padding: 0; cursor: pointer; font-size: 12.5px; }
.lateral-rodape button:hover { color: #fff; }

.principal { min-width: 0; display: flex; flex-direction: column; }
.topo-mobile { display: none; }
.conteudo { padding: 28px 34px 60px; max-width: 1240px; width: 100%; margin: 0 auto; }
.conteudo.cheio { max-width: none; padding: 0; height: 100vh; }

.cabecalho { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.cabecalho h1 { font-size: 22px; font-weight: 700; }
.cabecalho p { margin: 4px 0 0; color: var(--muted); }
.migalha { font-size: 12.5px; color: var(--faint); margin-bottom: 6px; }
.migalha a { color: var(--muted); }

/* ------------------------------------------------ componentes */
.cartao { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.cartao-corpo { padding: 18px 20px; }
.cartao-titulo { font-size: 14px; font-weight: 650; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.secao-titulo { font-size: 13px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 28px 0 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font-weight: 550; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn-primario { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primario:hover { background: var(--brand-2); }
.btn-fantasma { border-color: transparent; background: transparent; color: var(--muted); }
.btn-fantasma:hover { background: #eef1f7; color: var(--text); }
.btn-pequeno { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-perigo { color: var(--bad); }

.campo { display: flex; flex-direction: column; gap: 5px; }
.campo label { font-size: 12.5px; font-weight: 600; color: #2c3548; }
.campo .ajuda { font-size: 12px; color: var(--faint); }
.entrada, select.entrada, textarea.entrada {
  height: 38px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; padding: 0 11px; width: 100%;
  outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea.entrada { height: auto; padding: 9px 11px; resize: vertical; }
.entrada:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,87,214,.15); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.grade-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 14px; }
.grade-form .largo { grid-column: 1 / -1; }

.etiqueta {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: #eef1f7; color: #3b4559; white-space: nowrap;
}
.etiqueta.azul { background: var(--brand-soft); color: var(--brand-2); }
.etiqueta.verde { background: var(--ok-soft); color: var(--ok); }
.etiqueta.amarelo { background: var(--warn-soft); color: var(--warn); }
.etiqueta.vermelho { background: var(--bad-soft); color: var(--bad); }

.aviso { border-radius: 9px; padding: 11px 14px; font-size: 13.5px; border: 1px solid; display: flex; gap: 10px; }
.aviso.amarelo { background: var(--warn-soft); border-color: #f3d9a8; color: #6b3d05; }
.aviso.vermelho { background: var(--bad-soft); border-color: #f5c2bd; color: #7a1a12; }
.aviso.azul { background: var(--brand-soft); border-color: #c9d8fa; color: #18357f; }
.aviso.verde { background: var(--ok-soft); border-color: #bfe3cf; color: #0e4d30; }

.tabela { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabela th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tabela td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabela td.num, .tabela th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabela tr.total td { font-weight: 700; background: var(--surface-2); }
.rolagem-x { overflow-x: auto; }

.vazio { text-align: center; color: var(--muted); padding: 40px 20px; }

.busca {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-2); background: #fff; box-shadow: var(--shadow);
}
.busca:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,87,214,.12); }
.busca input { border: 0; outline: none; flex: 1; font-size: 14.5px; background: transparent; }
.busca svg { width: 18px; height: 18px; color: var(--faint); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff;
  font-size: 12.5px; font-weight: 550; color: #3b4559; cursor: pointer;
}
.chip:hover { border-color: #b9c3d8; }
.chip.ativo { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }

/* ------------------------------------------------ grades de cartoes */
.grade-cartoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px;
  display: flex; flex-direction: column; gap: 6px; cursor: pointer; text-align: left; transition: border-color .12s, box-shadow .12s, transform .12s;
  color: inherit; text-decoration: none;
}
.item:hover { border-color: #b7c4e4; box-shadow: var(--shadow-lg); text-decoration: none; transform: translateY(-1px); }
.item-topo { display: flex; align-items: center; gap: 10px; }
.item-icone { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.item-icone svg { width: 17px; height: 17px; }
.item-num { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.item-nome { font-weight: 650; font-size: 14px; }
.item-resumo { color: var(--muted); font-size: 13px; line-height: 1.45; }
.item-rodape { margin-top: auto; padding-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }

.boas-vindas { padding: 26px 28px; background: linear-gradient(120deg, #0f1c45 0%, #1b3483 100%); color: #fff; border-radius: 14px; position: relative; overflow: hidden; }
.boas-vindas h1 { font-size: 24px; font-weight: 700; }
.boas-vindas p { color: #c6d1f2; margin: 6px 0 18px; max-width: 640px; }
.boas-vindas .busca { max-width: 640px; border-color: transparent; }
.boas-vindas::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid rgba(255,255,255,.05); }
.resultados-busca { max-width: 640px; margin-top: 8px; background: #fff; border-radius: 10px; color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden; position: relative; z-index: 2; }
.resultados-busca a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--text); border-top: 1px solid var(--line); }
.resultados-busca a:first-child { border-top: 0; }
.resultados-busca a:hover { background: var(--surface-2); text-decoration: none; }

.lista { display: flex; flex-direction: column; }
.lista a, .lista .linha-lista { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); color: var(--text); }
.lista a:first-child, .lista .linha-lista:first-child { border-top: 0; }
.lista a:hover { background: var(--surface-2); text-decoration: none; }
.lista .sub { color: var(--muted); font-size: 12.5px; }
.lista .fim { margin-left: auto; color: var(--faint); font-size: 12px; white-space: nowrap; }

/* ------------------------------------------------ calculadoras */
.calc { display: grid; grid-template-columns: minmax(340px, 440px) 1fr; gap: 18px; align-items: start; }
.calc-form { position: sticky; top: 18px; }
.calc.empilhado { grid-template-columns: 1fr; }
.calc.empilhado .calc-form { position: static; }
.calc.empilhado .grade-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .calc.empilhado .grade-form { grid-template-columns: 1fr; } }
.calc-form .cartao-corpo { display: flex; flex-direction: column; gap: 14px; }
.resultado-vazio { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 48px 24px; text-align: center; color: var(--muted); background: rgba(255,255,255,.5); }
.destaque { display: flex; flex-wrap: wrap; gap: 12px; }
.destaque .bloco { flex: 1 1 160px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.destaque .bloco.principal-b { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.destaque .bloco.principal-b .rotulo { color: #aab7de; }
.destaque .rotulo { font-size: 12px; color: var(--muted); font-weight: 550; }
.destaque .valor { font-size: 21px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.destaque .valor.menor { font-size: 16px; }
.pilha { display: flex; flex-direction: column; gap: 14px; }
.passos { margin: 0; padding-left: 18px; color: #2c3548; }
.passos li { margin: 3px 0; }
.premissas { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.premissas li { margin: 3px 0; }
.fonte-legal { font-size: 12.5px; color: var(--muted); border-left: 3px solid var(--gold); padding: 4px 0 4px 12px; }
.fonte-legal q { color: #2c3548; font-style: italic; }
.downloads { display: flex; gap: 8px; flex-wrap: wrap; }
.tabela-edit input { width: 100%; height: 32px; border: 1px solid var(--line-2); border-radius: 6px; padding: 0 7px; font-size: 13px; min-width: 70px; }
.tabela-edit td { padding: 4px 4px; border-bottom: 0; }
.tabela-edit th { padding: 6px 4px; background: none; border: 0; font-size: 11.5px; }

/* ------------------------------------------------ chat */
.chat { display: grid; grid-template-columns: 270px 1fr; height: 100vh; }
.chat-lateral { border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.chat-lateral-topo { padding: 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.chat-lateral-topo .voltar { font-size: 12.5px; color: var(--muted); }
.chat-lista { overflow-y: auto; flex: 1; padding: 8px; }
.chat-lista a { display: block; padding: 8px 10px; border-radius: 7px; color: var(--text); font-size: 13px; }
.chat-lista a:hover { background: var(--surface-2); text-decoration: none; }
.chat-lista a.ativo { background: var(--brand-soft); color: var(--brand-2); }
.chat-lista .t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.chat-lista .d { font-size: 11.5px; color: var(--faint); }
.chat-centro { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.chat-topo { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-topo .titulos { min-width: 0; }
.chat-topo h2 { font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-topo .sub { font-size: 12.5px; color: var(--muted); }
.chat-topo .acoes { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.seletor { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seletor button { border: 0; background: #fff; height: 30px; padding: 0 11px; font-size: 12.5px; font-weight: 550; cursor: pointer; color: var(--muted); }
.seletor button.ativo { background: var(--ink-2); color: #fff; }
.mensagens { flex: 1; overflow-y: auto; padding: 26px 22px 18px; }
.mensagens-largura { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.msg-usuario { align-self: flex-end; max-width: 82%; background: var(--ink-2); color: #fff; padding: 11px 15px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; word-wrap: break-word; }
.msg-usuario .anexos-msg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 7px; }
.msg-usuario .anexos-msg span { background: rgba(255,255,255,.14); padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.msg-ia { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; box-shadow: var(--shadow); min-width: 0; }
.msg-ia .rotulo-ia { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.msg-ia .rotulo-ia .ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.msg-acoes { display: flex; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.passos-ia { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.passo-ia { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.passo-ia .bolinha { width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.passo-ia.ok .bolinha { background: var(--ok-soft); color: var(--ok); }
.passo-ia.falha .bolinha { background: var(--bad-soft); color: var(--bad); }
.passo-ia.rodando .bolinha { border: 2px solid #c8d3ee; border-top-color: var(--brand); animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.digitando { display: inline-flex; gap: 4px; padding: 4px 0; }
.digitando i { width: 6px; height: 6px; border-radius: 50%; background: #a3aec6; animation: pisca 1.2s infinite; }
.digitando i:nth-child(2) { animation-delay: .2s; } .digitando i:nth-child(3) { animation-delay: .4s; }
@keyframes pisca { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.compositor { padding: 12px 22px 18px; background: var(--bg); }
.compositor-caixa { max-width: 860px; margin: 0 auto; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; }
.compositor-caixa:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,87,214,.12); }
.compositor-caixa.arrastando { border-color: var(--brand); background: var(--brand-soft); }
.compositor textarea { width: 100%; border: 0; outline: none; resize: none; padding: 6px 8px; max-height: 260px; min-height: 44px; background: transparent; }
.compositor-barra { display: flex; align-items: center; gap: 8px; }
.compositor-barra .dica { font-size: 11.5px; color: var(--faint); margin-left: 4px; }
.compositor-barra .btn-primario { margin-left: auto; }
.anexos-pendentes { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 6px 6px; }
.anexo-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 3px 4px 3px 9px; font-size: 12.5px; }
.anexo-chip button { border: 0; background: none; cursor: pointer; color: var(--faint); padding: 0 4px; font-size: 15px; line-height: 1; }
.inicio-chat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; }
.inicio-chat h3 { font-size: 17px; }
.inicio-chat p { color: var(--muted); margin: 6px 0 0; }
.inicio-chat ol { margin: 10px 0 0; padding-left: 20px; color: #2c3548; font-size: 13.5px; }
.inicio-chat ol li { margin: 4px 0; }

/* markdown */
.md { font-size: 14.5px; line-height: 1.65; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1 { font-size: 18px; margin: 18px 0 10px; }
.md h2 { font-size: 16px; margin: 18px 0 8px; }
.md h3 { font-size: 14.5px; margin: 16px 0 6px; }
.md p { margin: 8px 0; }
.md ul, .md ol { margin: 8px 0; padding-left: 22px; }
.md li { margin: 3px 0; }
.md blockquote { margin: 10px 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--gold); color: #3b4559; }
.md code { font-family: var(--mono); font-size: 12.5px; background: #f1f3f8; padding: 1px 5px; border-radius: 4px; }
.md pre { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
.md pre code { background: none; color: inherit; padding: 0; }
.md table { border-collapse: collapse; margin: 10px 0; font-size: 13px; display: block; overflow-x: auto; max-width: 100%; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; }
.md th { background: var(--surface-2); font-weight: 600; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ------------------------------------------------ login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-arte { background: linear-gradient(150deg, #0b1430 0%, #152a6b 60%, #1f3f9a 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-arte::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255,255,255,.05); }
.login-arte h2 { font-size: 30px; font-weight: 700; max-width: 460px; letter-spacing: -.02em; }
.login-arte p { color: #b8c4ea; max-width: 440px; font-size: 15px; }
.login-arte ul { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 10px; color: #dbe3fb; }
.login-arte li { display: flex; gap: 10px; align-items: center; }
.login-arte li span { width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.1); display: grid; place-items: center; font-size: 12px; }
.login-form { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.login-caixa { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }
.login-caixa h1 { font-size: 22px; }
.login-caixa .sub { color: var(--muted); margin-top: -8px; }
.login-caixa .btn { height: 42px; }
.erro-form { color: var(--bad); font-size: 13px; min-height: 18px; }

/* ------------------------------------------------ abas, modal, toast */
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.abas button { border: 0; background: none; padding: 10px 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.abas button.ativo { color: var(--brand-2); border-bottom-color: var(--brand); }
.fundo-modal { position: fixed; inset: 0; background: rgba(11, 20, 48, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 460px; box-shadow: var(--shadow-lg); }
.modal-corpo { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-rodape { padding: 12px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 9px; font-size: 13.5px; z-index: 60; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); }
.toast.erro { background: var(--bad); }

/* ------------------------------------------------ responsivo */
@media (max-width: 1080px) {
  .calc { grid-template-columns: 1fr; }
  .calc-form { position: static; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .app.menu-aberto .lateral { transform: none; }
  .app.menu-aberto::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
  .topo-mobile { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
  .topo-mobile button { background: none; border: 0; color: #fff; padding: 4px; cursor: pointer; }
  .conteudo { padding: 18px 16px 50px; }
  .conteudo.cheio { height: calc(100vh - 52px); }
  .chat { grid-template-columns: 1fr; height: calc(100vh - 52px); }
  .chat-lateral { display: none; }
  .chat-topo { padding: 10px 16px; flex-wrap: wrap; }
  .chat-topo .acoes { margin-left: 0; width: 100%; }
  .mensagens { padding: 18px 16px 12px; }
  .compositor { padding: 10px 16px 14px; }
  .msg-usuario { max-width: 92%; }
  .msg-ia { padding: 14px 15px; }
  .grade-form { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-arte { display: none; }
  .boas-vindas { padding: 22px 18px; }
}
