﻿/* MinutAí · interface conversacional. Claro por padrão, escuro opcional. Fonte: Plus Jakarta Sans (com reserva do sistema). */

:root {
  --bg: #ffffff; --surface: #f0f4f9; --surface-2: #e4eaf3; --card: #ffffff; --line: #dbe2ec;
  --text: #121826; --muted: #4a5568; --faint: #6b7686;
  --accent: #4285f4; --accent-ink: #ffffff; --accent-soft: #e3ecfd;
  --ok: #0f7a4a; --ok-soft: #dff5ea; --warn: #8a5300; --warn-soft: #fdf0d5; --bad: #b3261e; --bad-soft: #fde4e1;
  --grad: linear-gradient(100deg, #1f5bd8 0%, #6c4ff0 55%, #c2417f 100%);
  --sombra: 0 1px 2px rgba(18, 24, 38, .06), 0 6px 20px rgba(18, 24, 38, .06);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, serif; --fonte-marca: var(--serif); /* TESTE: fonte do nome «MinutAí» e «JurisFinder»; para voltar à sem serifa: Inter, "Segoe UI", sans-serif */
  --raio: 16px; --lado: 288px; --lado-min: 68px;
}
:root[data-theme="dark"] {
  --bg: #121316; --surface: #1b1d22; --surface-2: #272a31; --card: #1b1d22; --line: #33363e;
  --text: #f1f3f7; --muted: #c0c6d2; --faint: #98a0ae;
  --accent: #8ab4ff; --accent-ink: #0b1220; --accent-soft: #1d2a45;
  --ok: #7ad9a8; --ok-soft: #14301f; --warn: #f2c06b; --warn-soft: #382a0d; --bad: #ff9c94; --bad-soft: #3d1815;
  --grad: linear-gradient(100deg, #8ab4ff 0%, #b69bff 55%, #ff8fbf 100%);
  --sombra: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121316; --surface: #1b1d22; --surface-2: #272a31; --card: #1b1d22; --line: #33363e;
    --text: #f1f3f7; --muted: #c0c6d2; --faint: #98a0ae;
    --accent: #8ab4ff; --accent-ink: #0b1220; --accent-soft: #1d2a45;
    --ok: #7ad9a8; --ok-soft: #14301f; --warn: #f2c06b; --warn-soft: #382a0d; --bad: #ff9c94; --bad-soft: #3d1815;
    --grad: linear-gradient(100deg, #8ab4ff 0%, #b69bff 55%, #ff8fbf 100%);
    --sombra: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; left: -9999px; }
[hidden] { display: none !important; }

/* ───────── estrutura ───────── */
.app { display: grid; grid-template-columns: var(--lado) 1fr; height: 100vh; transition: grid-template-columns .2s; }
.app.fechada { grid-template-columns: var(--lado-min) 1fr; }
.side { background: var(--surface); display: flex; flex-direction: column; min-height: 0; padding: 12px 10px; gap: 6px; overflow: hidden; }
.side-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 6px; }
.icone-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--muted); }
.icone-btn:hover { background: var(--surface-2); color: var(--text); }
.icone-btn svg { width: 22px; height: 22px; }
.nova-btn { display: flex; align-items: center; gap: 10px; border: 0; background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 10px 16px; font-weight: 600; margin: 4px 4px 10px; }
.nova-btn:hover { background: var(--line); }
.nova-btn svg { width: 20px; height: 20px; flex: none; }
.side-scroll { overflow-y: auto; flex: 1; min-height: 0; padding-right: 2px; }
.sec { margin-bottom: 2px; }
.sec-cab { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 9px 12px; border-radius: 12px; font-weight: 600; color: var(--text); text-align: left; }
.sec-cab:hover, .sec-cab.ativo { background: var(--surface-2); }
.sec-cab svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.sec-cab .seta { margin-left: auto; width: 16px; height: 16px; transition: transform .15s; }
.sec.aberta .seta { transform: rotate(90deg); }
.sec-itens { display: none; padding: 2px 0 6px 20px; }
.sec.aberta .sec-itens { display: block; }
.item { display: block; padding: 6px 12px; border-radius: 10px; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.item.ativo { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.item.mais { color: var(--accent); font-weight: 600; }
.rotulo-sec { padding: 14px 14px 6px; font-size: 12px; font-weight: 600; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; }
.side-rodape { display: flex; gap: 4px; padding: 6px 4px 0; border-top: 1px solid var(--line); }
.app.fechada .sec-cab span, .app.fechada .seta, .app.fechada .sec-itens, .app.fechada .rotulo-sec, .app.fechada .recentes, .app.fechada .nova-btn span, .app.fechada .marca-txt { display: none; }
.app.fechada .sec-cab { justify-content: center; padding: 10px; }
.app.fechada .nova-btn { justify-content: center; padding: 10px; }
.app.fechada .side-topo { flex-direction: column; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); position: relative; }
.topo { display: flex; align-items: center; gap: 12px; padding: 12px 24px; min-height: 60px; }
.topo .titulo { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topo .espaco { flex: 1; }
.marca { display: flex; align-items: center; gap: 8px; font-family: var(--fonte-marca); font-weight: 600; font-size: 20px; letter-spacing: -.01em; }
.marca-txt b { color: var(--accent); font-weight: 600; }
.rolagem { flex: 1; overflow-y: auto; min-height: 0; }
.coluna { max-width: 820px; margin: 0 auto; padding: 8px 24px 24px; }
.largo { max-width: 1040px; margin: 0 auto; padding: 8px 24px 40px; }

/* ───────── home ───────── */
.home { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 24px 80px; text-align: center; }
.home .logo-grande svg { width: 84px; height: 84px; }
.home h1 { font-size: 42px; line-height: 1.15; margin: 14px 0 6px; font-weight: 600; letter-spacing: -.02em; }
.home h1 .grad, .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home .sub { color: var(--muted); font-size: 18px; margin: 0 0 28px; }
.home .wm { font-family: var(--fonte-marca); font-size: 46px; font-weight: 600; letter-spacing: -.01em; margin-top: 6px; }
.home .wm b { color: var(--accent); font-weight: 600; }
.sugestoes { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; max-width: 760px; }
.chip { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 999px; padding: 9px 16px; font-size: 14px; }
.chip:hover { background: var(--surface); border-color: var(--surface-2); }

/* ───────── composer ───────── */
.composer { width: 100%; max-width: 780px; background: var(--surface); border-radius: 28px; padding: 14px 16px 10px; text-align: left; border: 1px solid transparent; }
.composer:focus-within { background: var(--bg); border-color: var(--line); box-shadow: var(--sombra); }
.composer textarea { width: 100%; border: 0; outline: 0; background: transparent; resize: none; max-height: 220px; min-height: 28px; padding: 4px 6px; line-height: 1.55; }
.composer textarea::placeholder { color: var(--faint); }
.composer-barra { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.composer-barra .espaco { flex: 1; }
.enviar { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.enviar:disabled { background: var(--surface-2); color: var(--faint); cursor: not-allowed; }
.enviar svg { width: 20px; height: 20px; }
.arquivos { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 4px 6px; }
.arq { display: inline-flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 5px 8px 5px 12px; font-size: 13px; }
.arq button { border: 0; background: transparent; color: var(--faint); padding: 0 4px; font-size: 16px; }
.composer-fixo { padding: 8px 24px 18px; display: flex; justify-content: center; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.aviso-rodape { text-align: center; font-size: 12px; color: var(--faint); padding: 0 0 10px; }

/* ───────── conversa ───────── */
.msg { display: flex; gap: 14px; margin: 22px 0; }
.msg.user { justify-content: flex-end; }
.msg.user .bolha { background: var(--surface); border-radius: 22px 22px 6px 22px; padding: 10px 18px; max-width: 80%; white-space: pre-wrap; }
.msg .avatar { flex: none; width: 30px; margin-top: 2px; }
.msg .avatar svg { width: 28px; height: 28px; }
.msg .corpo { min-width: 0; flex: 1; }
.corpo p { margin: 0 0 12px; } .corpo ul, .corpo ol { margin: 0 0 12px; padding-left: 22px; } .corpo li { margin: 3px 0; }
.corpo blockquote { margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: 0 10px 10px 0; color: var(--text); }
.corpo hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.pensando { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.pensando .brilho { background: linear-gradient(90deg, var(--faint), var(--text), var(--faint)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: brilho 1.6s linear infinite; }
@keyframes brilho { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .pensando .brilho { animation: none; color: var(--muted); } }
.erro-msg { background: var(--bad-soft); color: var(--bad); border-radius: 12px; padding: 10px 14px; }
.extras { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.busca-linha { font-size: 13px; color: var(--faint); }
details.prec { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
details.prec > summary { cursor: pointer; padding: 9px 14px; font-weight: 600; font-size: 14px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
details.prec > summary::-webkit-details-marker { display: none; }
details.prec .conteudo { padding: 2px 14px 12px; display: grid; gap: 12px; }
.prec-item .cit { font-size: 14px; font-weight: 600; }
.prec-item .ement { font-size: 13px; color: var(--muted); margin-top: 3px; }
.cartao-minuta { border: 1px solid var(--line); border-radius: var(--raio); padding: 14px 16px; background: var(--surface); }
.cartao-minuta h4 { margin: 0 0 2px; font-size: 15px; }
.cartao-minuta .linha { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.rev { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }

/* ───────── botões e etiquetas ───────── */
.btn { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 8px 18px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.btn:hover { background: var(--surface); text-decoration: none; }
.btn.primario { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primario:hover { filter: brightness(1.08); }
.btn.sm { padding: 5px 14px; font-size: 13px; }
.tag { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.tag.ok { background: var(--ok-soft); color: var(--ok); } .tag.warn { background: var(--warn-soft); color: var(--warn); } .tag.bad { background: var(--bad-soft); color: var(--bad); } .tag.info { background: var(--accent-soft); color: var(--accent); }

/* ───────── projetos, listas e páginas ───────── */
h2.pag { font-size: 28px; font-weight: 600; letter-spacing: -.01em; margin: 18px 0 6px; }
.lede { color: var(--muted); margin: 0 0 22px; max-width: 70ch; }
.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cartao { display: block; border: 1px solid var(--line); border-radius: var(--raio); padding: 18px 20px; background: var(--card); color: var(--text); }
a.cartao:hover { box-shadow: var(--sombra); text-decoration: none; border-color: var(--surface-2); }
.cartao h3 { margin: 0 0 4px; font-size: 16px; line-height: 1.35; } .cartao .meta { font-size: 13px; color: var(--faint); }
.vazio { border: 1px dashed var(--line); border-radius: var(--raio); padding: 36px 24px; text-align: center; color: var(--muted); }

.projeto-grade { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.lateral { position: sticky; top: 0; align-self: start; padding-top: 4px; }
.painel { border: 1px solid var(--line); border-radius: var(--raio); background: var(--card); }
.painel h3 { margin: 0; padding: 14px 16px 6px; font-size: 14px; }
.zona { margin: 8px 16px 14px; border: 1.5px dashed var(--line); border-radius: 14px; padding: 18px 12px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; }
.zona:hover, .zona.sobre { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.docs { list-style: none; margin: 0; padding: 0 8px 10px; display: grid; gap: 2px; }
.doc { padding: 8px 10px; border-radius: 10px; font-size: 13px; }
.doc:hover { background: var(--surface); }
.doc .nome { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.doc .info { color: var(--faint); font-size: 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }

.analise { border: 1px solid var(--line); border-radius: var(--raio); margin: 6px 0 18px; background: var(--card); overflow: hidden; }
.analise > button.cab { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: transparent; border: 0; text-align: left; font-weight: 600; }
.analise > button.cab:hover { background: var(--surface); }
.analise .seta { margin-left: auto; width: 18px; height: 18px; transition: transform .15s; color: var(--muted); }
.analise.aberta .seta { transform: rotate(180deg); }
.analise .miolo { display: none; padding: 4px 18px 18px; border-top: 1px solid var(--line); }
.analise.aberta .miolo { display: block; }
.tema { padding: 14px 0; border-bottom: 1px solid var(--line); } .tema:last-child { border-bottom: 0; }
.tema h4 { margin: 0 0 4px; font-size: 15px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tema p { margin: 4px 0; color: var(--muted); font-size: 14px; }
.tema .risco { color: var(--warn); }
.conv-abas { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 6px; }
.conv-abas .chip.ativo { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); font-weight: 600; }
.hint { color: var(--faint); font-size: 13px; }

/* ───────── diálogos ───────── */
dialog { border: 0; border-radius: 20px; padding: 0; background: var(--bg); color: var(--text); box-shadow: var(--sombra); max-width: min(94vw, 480px); width: 100%; }
dialog::backdrop { background: rgba(10, 14, 22, .5); }
dialog.grande { max-width: min(96vw, 980px); height: 90vh; }
dialog form, dialog .corpo-dlg { padding: 22px 24px; display: grid; gap: 10px; }
dialog label { font-weight: 600; font-size: 13px; }
dialog input[type=text] { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--bg); }
dialog iframe { width: 100%; height: calc(90vh - 64px); border: 0; border-radius: 0 0 20px 20px; }
.dlg-topo { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; font-weight: 600; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 20px; border-radius: 999px; font-size: 14px; z-index: 50; }
.busca-form { display: flex; gap: 10px; margin-bottom: 18px; } .busca-form input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 11px 18px; background: var(--surface); }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; } .side { position: fixed; inset: 0 auto 0 0; width: 288px; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--sombra); }
  .app.menu .side { transform: none; }
  .projeto-grade { grid-template-columns: 1fr; } .lateral { position: static; order: -1; }
  .home h1 { font-size: 32px; } .topo { padding: 10px 14px; } .coluna, .largo { padding-left: 16px; padding-right: 16px; }
}
.analise .cab > svg:not(.seta) { width: 22px; height: 22px; flex: none; color: var(--accent); }
.analise .cab .hint { margin-left: auto; margin-right: 8px; font-weight: 500; }
.analise .cab .seta { margin-left: 0; }

/* ───────── gestão: menu ⋯, edição inline, cartões, abas ───────── */
a.sec-cab { text-decoration: none; color: var(--text); }
.item-linha { position: relative; display: flex; align-items: center; border-radius: 10px; }
.item-linha:hover, .item-linha.ativo { background: var(--surface-2); }
.item-linha .item { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; background: transparent !important; }
.item-linha .item.ativo { background: transparent; }
.item-linha .item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.item-menu, .card-menu { border: 0; background: transparent; color: var(--muted); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; opacity: 0; flex: none; padding: 0; }
.item-menu svg, .card-menu svg { width: 18px; height: 18px; }
.item-linha:hover .item-menu, .item-menu:focus-visible, .item-menu[aria-expanded="true"], .item-menu.visivel, .cartao:hover .card-menu, .card-menu:focus-visible, .card-menu[aria-expanded="true"] { opacity: 1; }
.item-menu:hover, .card-menu:hover { background: var(--line); color: var(--text); }
@media (hover: none) { .item-menu, .card-menu { opacity: 1; } }
.app.fechada .item-linha { display: none; }
.pin { width: 13px; height: 13px; flex: none; color: var(--accent); }
.cartao h3 .pin { margin-right: 6px; vertical-align: -1px; }

.menu-ctx { position: fixed; z-index: 70; min-width: 236px; max-width: 320px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sombra); padding: 6px; }
.menu-ctx button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 0; background: transparent; border-radius: 9px; padding: 8px 12px; text-align: left; font-size: 14px; color: var(--text); }
.menu-ctx button:hover, .menu-ctx button:focus-visible { background: var(--surface); }
.menu-ctx button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-ctx kbd { font: inherit; font-size: 12px; color: var(--faint); }
.menu-ctx .perigo, .btn.perigo { color: var(--bad); }
.btn.perigo { border-color: var(--bad); } .btn.perigo:hover { background: var(--bad-soft); }
.mn-sep { height: 1px; background: var(--line); margin: 5px 4px; } .mn-voltar { color: var(--muted) !important; } .mn-vazio { padding: 8px 12px; color: var(--faint); font-size: 13px; }

.editavel { cursor: text; border-radius: 8px; padding: 2px 6px; margin-left: -6px; }
.editavel:hover { background: var(--surface); }
.editavel.titulo { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.editavel.tag { background: var(--surface-2); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); padding: 2px 10px; margin-left: 0; }
.fantasma { color: var(--faint); font-weight: 500; }
.inline-input { font: inherit; font-weight: 600; border: 1px solid var(--accent); border-radius: 8px; padding: 3px 8px; background: var(--bg); min-width: 220px; max-width: 46vw; }
.inline-input.curto { min-width: 200px; font-size: 13px; }

.cartao.com-menu { position: relative; padding: 0; }
.cartao-link { display: block; padding: 18px 44px 18px 20px; color: inherit; border-radius: var(--raio); }
.cartao-link:hover { text-decoration: none; background: var(--surface); }
.card-menu { position: absolute; top: 10px; right: 10px; }
.cartao.arquivado { opacity: .6; }
.alterna { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-right: 8px; cursor: pointer; }

.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 8px; }
.aba { border: 0; background: transparent; padding: 9px 16px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.aba.ativa { color: var(--accent); border-bottom-color: var(--accent); }
.aba:disabled { opacity: .4; cursor: not-allowed; }
.md-previa { padding: 18px 4px 40px; max-width: 78ch; }
.md-previa .md-h { margin: 22px 0 8px; font-weight: 600; } h3.md-h { font-size: 24px; } h4.md-h { font-size: 19px; border-bottom: 1px solid var(--line); padding-bottom: 6px; } h5.md-h { font-size: 15px; color: var(--accent); }
.md-editor { width: 100%; min-height: 62vh; margin-top: 16px; font: 13px/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--surface); color: var(--text); resize: vertical; }
.md-editor:focus { outline: 2px solid var(--accent); background: var(--bg); }

.juris-home .sub { max-width: 560px; }
.pesq-lista { width: 100%; max-width: 780px; margin-top: 34px; text-align: left; }
.pesq-linha { display: flex; align-items: center; border-radius: 12px; }
.pesq-linha:hover { background: var(--surface); }
.pesq-linha a { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: center; padding: 10px 14px; color: var(--text); }
.pesq-linha a span:first-of-type { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pesq-linha a:hover { text-decoration: none; }

/* documentos: o nome longo nunca estoura o quadro */
.painel { overflow: hidden; }
.docs { grid-template-columns: minmax(0, 1fr); }
.doc { min-width: 0; }
.arq { max-width: 100%; min-width: 0; } .arq-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; display: inline-block; vertical-align: bottom; }
.topo .editavel.titulo, .topo .inline-input { flex: 0 1 auto; }
button.item { border: 0; background: transparent; text-align: left; width: 100%; font: inherit; cursor: pointer; }
button.item.mais { color: var(--accent); font-weight: 600; }
.md-previa blockquote { background: var(--surface); border-left-color: var(--accent); }

/* editor da minuta por seção */
dialog.editor { display: none; flex-direction: column; } dialog.editor[open] { display: flex; }
.ed-barra { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 20px; border-bottom: 1px solid var(--line); }
.ed-barra .espaco { flex: 1; } .ed-barra select { border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; background: var(--bg); max-width: 260px; }
.ed-info { display: flex; flex-direction: column; gap: 4px; padding: 8px 20px; font-size: 13px; color: var(--muted); }
.ed-info b.grave, .ed-conf li.grave { color: var(--bad); } .ed-conf summary { cursor: pointer; } .ed-conf ul { margin: 6px 0 0; padding-left: 20px; max-height: 140px; overflow-y: auto; }
.ed-msg { margin: 0 20px 6px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--text); font-size: 14px; }
.ed-corpo-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr); border-top: 1px solid var(--line); }
.ed-nav { overflow-y: auto; padding: 10px 8px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.ed-nav-item { text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 8px; font-size: 13px; line-height: 1.3; color: var(--muted); }
.ed-nav-item:hover { background: var(--surface-2); color: var(--text); } .ed-nav-item.sujo::after { content: " •"; color: var(--accent); font-weight: 700; }
.ed-doc { overflow-y: auto; padding: 18px 28px 40px; scroll-behavior: smooth; }
.ed-secao { max-width: 820px; margin: 0 auto 26px; display: grid; gap: 10px; }
.ed-fixo { background: var(--surface); border-radius: 10px; padding: 8px 12px; color: var(--muted); font-size: 13.5px; white-space: pre-wrap; }
.ed-titulo, .ed-titulo-fixo { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
.ed-titulo.n1, .ed-titulo-fixo.n1 { font-size: 20px; margin-top: 8px; } .ed-titulo.n2, .ed-titulo-fixo.n2 { font-size: 16px; color: var(--muted); }
.ed-titulo { width: 100%; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; background: transparent; color: var(--text); } .ed-titulo:hover { border-color: var(--line); } .ed-titulo:focus { border-color: var(--accent); outline: 0; background: var(--bg); }
.ed-titulo-fixo { padding: 6px 8px; }
.ed-corpo { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg); color: var(--text); font: 15px/1.7 var(--font); resize: none; }
.ed-corpo:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px var(--accent-soft); }
@media (max-width: 900px) { .ed-corpo-grid { grid-template-columns: 1fr; } .ed-nav { display: none; } .ed-doc { padding: 14px; } }

/* conversas do projeto: uma fileira horizontal, da esquerda para a direita, com rolagem lateral */
.conv-abas { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; -webkit-overflow-scrolling: touch; }
.conv-abas .chip { flex: none; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-abas::-webkit-scrollbar { height: 6px; } .conv-abas::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }

.doc-topo { display: flex; align-items: center; gap: 6px; min-width: 0; }
.doc-topo .nome { flex: 1; min-width: 0; }
.doc:hover .item-menu { opacity: 1; }

.chip-menu { border: 0; background: transparent; color: var(--faint); width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; padding: 0; margin-left: 2px; flex: none; }
.chip-menu svg { width: 16px; height: 16px; } .chip-menu:hover, .chip-menu[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }
.arq { align-items: center; }

/* precedentes: ementa inteira, ações discretas e sugestões de continuação (pesquisa conversacional) */
.prec-cab { display: flex; align-items: flex-start; gap: 8px; } .prec-cab .cit { flex: 1; }
.prec-acoes { display: inline-flex; gap: 2px; flex: none; opacity: .55; } .prec-item:hover .prec-acoes, .prec-acoes:focus-within { opacity: 1; }
.icone-mini { width: 26px; height: 26px; border: 0; background: transparent; color: var(--muted); border-radius: 6px; display: inline-grid; place-items: center; padding: 0; }
.icone-mini svg { width: 15px; height: 15px; } .icone-mini:hover { background: var(--surface-2); color: var(--accent); text-decoration: none; }
.prec-item .ement { white-space: pre-line; line-height: 1.55; }
.prec-consultas { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--faint); }
.sugestoes-msg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; } .sugestoes-msg .chip { font-size: 13px; padding: 6px 12px; }

/* caixa de pesquisa + advertência discreta */
.caixa-pesq { width: 100%; max-width: 780px; display: flex; flex-direction: column; align-items: center; }
.caixa-pesq .composer { max-width: none; }
.aviso-ia { margin: 8px 0 0; font-size: 11px; font-weight: 300; letter-spacing: .01em; line-height: 1.4; color: var(--faint); text-align: center; opacity: .85; }
.composer-fixo .aviso-ia { margin-top: 6px; }

/* gráficos de pizza ancorados nas respostas com jurimetria */
.graficos { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0 10px; }
.grafico { margin: 0; flex: 1 1 230px; max-width: 320px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--card); }
.grafico figcaption { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; } .grafico svg { width: 150px; height: 150px; display: block; margin: 0 auto 6px; }
.legenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.legenda li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: center; } .legenda .ponto { width: 10px; height: 10px; border-radius: 50%; }
.legenda .rot { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .legenda .val { color: var(--muted); font-variant-numeric: tabular-nums; }
.grafico .nota { margin: 8px 0 0; font-size: 12px; color: var(--faint); }

/* arrastar e soltar */
.zona-campo { margin: 0; padding: 22px 14px; }
.zona-campo.preenchida { border-style: solid; border-color: var(--ok); background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.composer.sobre { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
dialog .zona-campo { text-align: center; }

/* auditoria de UX: logo como início, ementas recolhidas, menu de versões */
.side-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .marca-lado { text-decoration: none; color: var(--text); font-size: 18px; padding-right: 6px; } .marca-lado:hover { text-decoration: none; }
.prec-item .ement.longa { max-height: 9em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.prec-item .ement.longa.aberta { max-height: none; -webkit-mask-image: none; mask-image: none; }
.ver-mais { border: 0; background: transparent; color: var(--accent); font-size: 12.5px; padding: 2px 0; text-align: left; }
.ed-vers { position: relative; } .ed-vers > summary { list-style: none; cursor: pointer; } .ed-vers > summary::-webkit-details-marker { display: none; }
.ed-vers-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 360px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sombra); padding: 6px; display: grid; gap: 2px; }
.ed-vers-linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px; border-radius: 8px; font-size: 13px; } .ed-vers-linha:hover { background: var(--surface); } .ed-vers-linha.atual { font-weight: 600; }
.ed-vers-linha .acoes { display: inline-flex; align-items: center; gap: 6px; flex: none; }

/* topo da barra lateral: só o nome à esquerda (início) e o menu à direita; recolhida, só a figura (início) sobre o botão do menu */
.marca-lado { padding: 6px 10px; border-radius: 10px; font-size: 21px; line-height: 1; } .marca-lado:hover { background: var(--surface-2); }
.marca-fig { display: none; width: 40px; height: 40px; border-radius: 50%; place-items: center; text-decoration: none; } .marca-fig:hover { background: var(--surface-2); text-decoration: none; }
.app.fechada .marca-lado { display: none; } .app.fechada .marca-fig { display: grid; }

/* o botão do menu fica onde sempre esteve; o nome (início) encostado nele; recolhida, a figura (início) logo abaixo do menu */
.side-topo { justify-content: flex-start; gap: 0; } .marca-lado { padding: 6px 10px 6px 4px; }

/* biblioteca de doutrina */
.nota-exemplo { margin-top: 8px; font-size: 12px; color: var(--faint); line-height: 1.45; border-left: 2px solid var(--line); padding-left: 8px; }
.banner-bib { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--accent-soft); }

/* saudação: um só azul, o mesmo do «Aí» da logo (sem degradê) */
.home h1 .grad, .grad { background: none; -webkit-background-clip: border-box; background-clip: border-box; -webkit-text-fill-color: currentColor; color: var(--accent); }

/* saudação: degradê só do azul da logo para o branco (no tema claro o fim é um azul-claro, para não sumir no fundo branco) */
:root { --grad-fim: #6f95e8; }
:root[data-theme="dark"] { --grad-fim: #ffffff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --grad-fim: #ffffff; } }
.home h1 .grad, .grad { background: linear-gradient(100deg, var(--accent) 40%, var(--grad-fim) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }

/* leitor da obra */
dialog.leitor { display: none; flex-direction: column; } dialog.leitor[open] { display: flex; }
.lei-corpo { display: grid; grid-template-columns: 280px 1fr; flex: 1; min-height: 0; border-top: 1px solid var(--line); }
.lei-sum { overflow: auto; padding: 12px; border-right: 1px solid var(--line); display: grid; gap: 2px; align-content: start; }
.lei-sum h4 { margin: 4px 8px 8px; font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.lei-cap { display: flex; justify-content: space-between; gap: 8px; text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.lei-cap:hover, .lei-cap.ativo { background: var(--accent-soft); }
.lei-cap small { color: var(--faint); flex: none; }
.lei-txt { overflow: auto; padding: 16px 28px 28px; line-height: 1.65; font-size: 15px; }
.lei-txt p { margin: 0 0 12px; }
.lei-pg { margin: 18px 0 8px; font-size: 11px; color: var(--faint); border-top: 1px dashed var(--line); padding-top: 6px; }
.lei-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 12px; }
@media (max-width: 720px) { .lei-corpo { grid-template-columns: 1fr; grid-template-rows: 150px 1fr; } .lei-sum { border-right: 0; border-bottom: 1px solid var(--line); } }

/* texto corrido sempre justificado (títulos, botões, menus e linhas curtas continuam alinhados à esquerda/centro) */
.corpo p, .corpo li, .corpo blockquote, .bolha, .md-previa p, .md-previa li, .md-previa blockquote, .ement, .tema p, .lede, .cartao p, .cartao .meta, .vazio, .erro-msg, .busca-linha,
.rev li, .prec-consultas, .pesq-lista p, .doc .info, .analise .miolo p, .coluna p, .largo p, dialog p, .hint-bloco { text-align: justify; text-justify: inter-word; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.home p, .home .sub, .aviso-ia, .vazio { text-align: center; hyphens: none; }
.cit { text-align: left; hyphens: none; }

/* caixa de precedentes: abre só o suficiente para uma ementa; as demais por rolagem (a altura é ajustada ao abrir) */
details.prec .conteudo { max-height: 340px; overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y proximity; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
details.prec .conteudo::-webkit-scrollbar { width: 6px; } details.prec .conteudo::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
details.prec .prec-item { scroll-snap-align: start; }
details.prec .prec-item + .prec-item { border-top: 1px solid var(--line); padding-top: 12px; }
details.prec .ement.longa { max-height: none; -webkit-mask-image: none; mask-image: none; }
details.prec .ver-mais { display: none; }
.cartao .prec-item { padding: 2px 0; }

/* cartões (projetos, modelos, timbrados, obras): texto à esquerda, sem hifenização (evita lacunas e quebras estranhas); só a ementa dentro de cartões continua justificada */
.cartao, .cartao-link, .cartao h3, .cartao .meta, .cartao p, .cartao .cit, .cartao div:not(.ement) { text-align: left; text-justify: auto; hyphens: none; -webkit-hyphens: none; }
.cartao .ement { text-align: justify; text-justify: inter-word; hyphens: auto; -webkit-hyphens: auto; }

/* ementa em UM bloco contínuo e justificado (como a citação direta): as quebras de linha da fonte viram espaços, sem hifenização e com a última linha à esquerda */
.ement, .prec-item .ement, .cartao .ement, details.prec .ement { white-space: normal; text-align: justify; text-justify: inter-word; text-align-last: left; hyphens: none; -webkit-hyphens: none; word-spacing: normal; line-height: 1.6; }

/* em colunas estreitas (< 440px) a hifenização volta, só para a ementa não abrir lacunas largas; em colunas normais fica sem hifenização, como no JurisFinder */
details.prec .conteudo { container-type: inline-size; }
@container (max-width: 440px) { details.prec .conteudo .prec-item .ement { hyphens: auto; -webkit-hyphens: auto; } }

/* construção de modelo */
.grade-cand { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.cartao.cand { display: flex; flex-direction: column; }
.cartao.cand .linha { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cand-previa { font-size: 13px; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; display: grid; gap: 4px; }

/* caixa de pesquisa do projeto: mesma coluna (largura e margem esquerda) do bloco de análise e das conversas */
.rolagem { scrollbar-gutter: stable; }
.composer-fixo { padding-right: calc(24px + var(--sb, 0px)); }
.composer-fixo-proj { display: block; padding: 8px var(--sb, 0px) 18px 0; }
.composer-fixo-proj .projeto-grade { width: 100%; }
.composer-fixo-proj .caixa-pesq { max-width: none; }

/* prévia do timbrado */
.tb-previa { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; max-height: 190px; }
.tb-previa img { display: block; width: 100%; object-fit: cover; object-position: top; }
dialog.grande-img { max-width: min(96vw, 760px); }
.tb-grande { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* conversa no projeto: pílula com título + menu ⋯ (mesmo menu da barra lateral) */
.conv-abas .chip-conv { display: inline-flex; align-items: center; gap: 4px; padding: 0 4px 0 14px; }
.conv-abas .chip-conv a { color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; padding: 9px 0; text-decoration: none; }
.conv-abas .chip-conv .pin { margin-right: -2px; }
.conv-abas .chip-conv .chip-menu { opacity: .55; } .conv-abas .chip-conv:hover .chip-menu, .conv-abas .chip-conv .chip-menu:focus-visible, .conv-abas .chip-conv .chip-menu[aria-expanded="true"] { opacity: 1; }

/* painel lateral do projeto: abas Documentos | Minutas, com as redações do mesmo modelo agrupadas */
.painel > .abas-mini { display: flex; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); }
.aba-mini { border: 0; background: transparent; padding: 8px 12px; font-weight: 600; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.aba-mini:hover { color: var(--text); } .aba-mini.ativa { color: var(--accent); border-bottom-color: var(--accent); }
.painel > .zona { margin-top: 14px; }
.min-lista { padding: 10px 10px 12px; display: grid; gap: 8px; }
.min-item { padding: 10px 10px; border-radius: 12px; border: 1px solid var(--line); min-width: 0; }
.min-topo { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .min-rot { font-weight: 600; font-size: 13px; flex: 1 1 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.min-acoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.min-grupo { border: 1px solid var(--line); border-radius: 14px; padding: 8px; display: grid; gap: 6px; background: var(--surface); }
.min-grupo-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 2px 4px 4px; font-weight: 600; font-size: 13px; } .min-grupo-cab span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.min-grupo .min-item { background: var(--bg); }
.min-vers { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.min-vers li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px; border-radius: 6px; } .min-vers li.atual { color: var(--text); font-weight: 600; } .min-vers li:hover { background: var(--surface-2); }
.cartao.cand-prov { border-style: dashed; }

/* painéis do projeto empilhados: Documentos e, abaixo, Minutas */
.lateral .painel + .painel { margin-top: 14px; }
.painel > .zona { margin-top: 8px; }
.painel-minutas .min-lista { padding-top: 4px; }

/* construção: modelo inteiro com rolagem e botão fixo */
.constr h4 { margin: 18px 0 6px; font-size: 13px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.blocos { border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.blc { display: grid; grid-template-columns: 130px 70px 1fr; gap: 10px; align-items: start; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.5; }
.blc:first-child { border-top: 0; }
.blc-est { font-size: 12px; color: var(--faint); padding-top: 2px; }
.blc-txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.blc-txt.var { color: var(--faint); font-style: italic; }
.regra { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.barra-fixa { position: sticky; bottom: 0; padding: 12px 0; background: var(--bg); border-top: 1px solid var(--line); margin-top: 20px; }
@media (max-width: 720px) { .blc { grid-template-columns: 1fr; gap: 4px; } }

/* uso e custos */
.uso h3 { margin: 26px 0 8px; font-size: 15px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 6px 0 10px; }
.kpi { border: 1px solid var(--line); border-radius: var(--raio); padding: 14px 16px; background: var(--card); }
.kpi-v { font-size: 22px; font-weight: 600; } .kpi-r { font-size: 13px; color: var(--faint); margin-top: 2px; }
.tab-rol { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.tab-uso { width: 100%; border-collapse: collapse; font-size: 13px; }
.tab-uso th, .tab-uso td { padding: 8px 12px; text-align: left; border-top: 1px solid var(--line); vertical-align: top; }
.tab-uso thead th { border-top: 0; color: var(--faint); font-weight: 500; white-space: nowrap; }
.tab-uso .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; } .tab-uso .forte { font-weight: 600; } .tab-uso .ruim { color: var(--bad); font-weight: 600; }
.tab-uso .msg { overflow-wrap: anywhere; color: var(--faint); max-width: 520px; }
.dias { display: flex; align-items: flex-end; gap: 6px; overflow-x: auto; padding: 8px 4px; min-height: 120px; }
.dia { display: grid; justify-items: center; gap: 4px; min-width: 30px; } .dia-b { width: 20px; background: var(--accent, #3a6df0); border-radius: 4px 4px 0 0; } .dia-d { font-size: 10px; color: var(--faint); }

/* transcrição de audiência */
.tr-item { font-size: 13px; padding: 5px 8px; border-radius: 8px; overflow-wrap: anywhere; }
.tr-duvida { background: var(--warn-soft, rgba(240, 170, 40, .16)); border-radius: 6px; padding: 2px 6px; }

/* tela do projeto: duas rolagens independentes — o chat (à esquerda) e a coluna de documentos/minutas, rente à borda direita */
.proj-corpo { flex: 1; min-height: 0; display: flex; }
.proj-esq { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.proj-chat { max-width: 820px; margin: 0 auto; padding: 0 24px 24px; }
.proj-corpo > .lateral { position: static; flex: none; width: 344px; overflow-y: auto; min-height: 0; padding: 4px 14px 24px 8px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.composer-fixo-proj { display: block; padding: 8px calc(24px + var(--sb, 0px)) 18px 24px; }
.composer-fixo-proj .caixa-col { max-width: 820px; margin: 0 auto; width: 100%; }
@media (max-width: 900px) {
  .proj-corpo { flex-direction: column; overflow-y: auto; } .proj-esq { flex: none; height: 78vh; } .proj-corpo > .lateral { order: -1; width: auto; overflow: visible; padding: 4px 16px; }
}
.min-colapso > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; font-weight: 600; font-size: 13px; }
.min-colapso > summary::-webkit-details-marker { display: none; }
.min-colapso > summary .hint { font-weight: 400; }
.min-colapso[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.min-colapso > .min-item { border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }

/* edição / retrocesso / bifurcação de mensagens */
.msg-acoes { display: flex; gap: 2px; margin-top: 4px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-acoes, .msg:focus-within .msg-acoes { opacity: 1; }
.msg.user .msg-acoes { justify-content: flex-end; } .msg.user { flex-direction: column; align-items: flex-end; }
.msg-edit { width: min(100%, 640px); display: grid; gap: 8px; } .msg-edit textarea { width: 100%; min-height: 80px; resize: vertical; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font: inherit; background: var(--card); color: var(--text); }
.msg-edit .linha { display: flex; gap: 8px; justify-content: flex-end; }
@media (hover: none) { .msg-acoes { opacity: 1; } }
.painel-aud { margin-top: 12px; padding-bottom: 6px; }

/* seletor do timbrado no topo do projeto */
.sel-tim { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 4px 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.sel-tim .sel-tim-rot { color: var(--muted); }
.sel-tim select { border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 600; padding: 4px 2px; max-width: 170px; cursor: pointer; outline-offset: 2px; }
.sel-tim.falta { border-color: var(--warn, #c98a00); background: color-mix(in srgb, var(--warn, #c98a00) 12%, var(--card)); }
.sel-tim.falta select { color: var(--warn, #9a6700); }
.sel-tim .tag { margin: 0 2px 0 0; }

.topo:has(.sel-tim) { flex-wrap: wrap; row-gap: 6px; } .topo:has(.sel-tim) .titulo, .topo:has(.sel-tim) .editavel.titulo { flex: 0 1 auto; max-width: 100%; }

/* timbrado no topo do projeto: só o nome, no mesmo formato das etiquetas */
select.sel-tim { appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; background: var(--surface-2, var(--surface)); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; padding: 4px 12px; cursor: pointer; max-width: 200px; text-overflow: ellipsis; }
select.sel-tim:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topo:has(.sel-tim) { flex-wrap: wrap; row-gap: 6px; }
.doc .info.aud-linha { gap: 10px; margin-top: 8px; row-gap: 8px; }
.painel-aud .doc .btn.sm { padding: 5px 12px; }

/* rodapé da barra lateral: botões inteiros, alinhados ao texto dos itens e com respiro abaixo */
.side-rodape { flex: none; align-items: center; gap: 6px; padding: 10px 6px 6px; margin-top: 2px; }
.side-rodape .icone-btn { width: 38px; height: 38px; flex: none; }
.side { padding-bottom: 10px; }

/* a página nunca rola: o app ocupa sempre toda a janela (chat rola por dentro; a caixa de pesquisa fica na base) */
html, body { height: 100%; overflow: hidden; }
.app { height: 100vh; height: 100dvh; }
.app.fechada .side-rodape { flex-direction: column; justify-content: center; padding: 10px 0 6px; }

/* uma só rolagem de página, na borda direita: com janela baixa ou barra lateral longa, a página inteira rola junto; chat e coluna de documentos mantêm as rolagens internas */
html, body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
.app { height: auto; min-height: max(100vh, 620px); min-height: max(100dvh, 620px); }
.side { overflow: visible; }
.side-scroll { overflow: visible; }
@media (max-width: 900px) { .side { overflow-y: auto; } }

/* painel de envio com itens: o quadrado todo recebe arquivos; «+» discreto no canto superior direito */
.painel-cab { display: flex; align-items: center; justify-content: space-between; padding-right: 10px; }
.painel-cab h3 { padding-bottom: 6px; }
.painel-zona.sobre { border-color: var(--accent); background: var(--accent-soft); }
.painel-zona .docs { padding-bottom: 8px; }
.mais-env { width: 28px; height: 28px; color: var(--faint); border-radius: 50%; }
.mais-env:hover { color: var(--text); background: var(--surface-2); }
.mais-env svg { width: 16px; height: 16px; }

/* barra lateral fixa na altura da janela (não rola junto com a página) */
@media (min-width: 901px) {
  .app { align-items: start; }
  .side { position: sticky; top: 0; height: 100vh; height: 100dvh; align-self: start; overflow: hidden; }
  .side-scroll { overflow-y: auto; }
  .main { min-height: max(100vh, 620px); min-height: max(100dvh, 620px); align-self: stretch; }
}
/* setas flutuantes do chat: ir ao início ou ao fim quando se está no meio */
#setas-rol { position: fixed; z-index: 15; display: none; flex-direction: column; gap: 8px; }
#setas-rol button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--muted); display: grid; place-items: center; box-shadow: var(--sombra, 0 2px 8px rgba(0,0,0,.12)); cursor: pointer; padding: 0; }
#setas-rol button:hover { color: var(--text); background: var(--surface-2); }
#setas-rol button[hidden] { display: none; }
#setas-rol svg { width: 18px; height: 18px; }

/* altura definida: o chat e a coluna de documentos rolam por dentro, mesmo com conversas longas; a página só rola se a janela tiver menos de 620px */
.app { height: max(100vh, 620px); height: max(100dvh, 620px); min-height: 0; }
@media (min-width: 901px) { .app { align-items: stretch; } .main { min-height: 0; align-self: stretch; } .side { height: 100%; } }

/* barras de rolagem discretas: invisíveis até o mouse passar sobre a área (o espaço fica reservado, nada se desloca) */
.rolagem, .proj-corpo > .lateral, .side-scroll, .ed-doc, .ed-nav, .lei-sum, .lei-txt, details.prec .conteudo, .conv-abas {
  scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color .2s;
}
.rolagem:hover, .proj-corpo > .lateral:hover, .side-scroll:hover, .ed-doc:hover, .ed-nav:hover, .lei-sum:hover, .lei-txt:hover, details.prec .conteudo:hover, .conv-abas:hover {
  scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent;
}

/* barras ainda mais finas (2,5px) e invisíveis até o mouse passar; vale também para a rolagem da própria página, na borda direita */
@supports selector(::-webkit-scrollbar) {
  html, body, .rolagem, .proj-corpo > .lateral, .side-scroll, .ed-doc, .ed-nav, .lei-sum, .lei-txt, details.prec .conteudo, .conv-abas { scrollbar-width: auto; scrollbar-color: auto; }
  html::-webkit-scrollbar, body::-webkit-scrollbar, .rolagem::-webkit-scrollbar, .proj-corpo > .lateral::-webkit-scrollbar, .side-scroll::-webkit-scrollbar, .ed-doc::-webkit-scrollbar,
  .ed-nav::-webkit-scrollbar, .lei-sum::-webkit-scrollbar, .lei-txt::-webkit-scrollbar, details.prec .conteudo::-webkit-scrollbar, .conv-abas::-webkit-scrollbar { width: 2.5px; height: 2.5px; background: transparent; }
  html::-webkit-scrollbar-track, body::-webkit-scrollbar-track, .rolagem::-webkit-scrollbar-track, .proj-corpo > .lateral::-webkit-scrollbar-track, .side-scroll::-webkit-scrollbar-track,
  .ed-doc::-webkit-scrollbar-track, .ed-nav::-webkit-scrollbar-track, .lei-sum::-webkit-scrollbar-track, .lei-txt::-webkit-scrollbar-track, details.prec .conteudo::-webkit-scrollbar-track, .conv-abas::-webkit-scrollbar-track { background: transparent; }
  html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb, .rolagem::-webkit-scrollbar-thumb, .proj-corpo > .lateral::-webkit-scrollbar-thumb, .side-scroll::-webkit-scrollbar-thumb,
  .ed-doc::-webkit-scrollbar-thumb, .ed-nav::-webkit-scrollbar-thumb, .lei-sum::-webkit-scrollbar-thumb, .lei-txt::-webkit-scrollbar-thumb, details.prec .conteudo::-webkit-scrollbar-thumb, .conv-abas::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }
  html:hover::-webkit-scrollbar-thumb, .rolagem:hover::-webkit-scrollbar-thumb, .proj-corpo > .lateral:hover::-webkit-scrollbar-thumb, .side-scroll:hover::-webkit-scrollbar-thumb, .ed-doc:hover::-webkit-scrollbar-thumb,
  .ed-nav:hover::-webkit-scrollbar-thumb, .lei-sum:hover::-webkit-scrollbar-thumb, .lei-txt:hover::-webkit-scrollbar-thumb, details.prec .conteudo:hover::-webkit-scrollbar-thumb, .conv-abas:hover::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 38%, transparent); }
  .rolagem { scrollbar-gutter: auto; }
}

/* barra de rolagem própria (desenhada pelo site): as nativas ficam ocultas; um filete de 3px aparece só quando o mouse está sobre a área */
.rolagem, .proj-corpo > .lateral, .side-scroll, .ed-doc, .ed-nav, .lei-sum, .lei-txt, details.prec .conteudo { scrollbar-width: none; scrollbar-gutter: auto; }
.rolagem::-webkit-scrollbar, .proj-corpo > .lateral::-webkit-scrollbar, .side-scroll::-webkit-scrollbar, .ed-doc::-webkit-scrollbar, .ed-nav::-webkit-scrollbar, .lei-sum::-webkit-scrollbar,
.lei-txt::-webkit-scrollbar, details.prec .conteudo::-webkit-scrollbar { display: none; width: 0; height: 0; }
html, body { scrollbar-width: none; } html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
#sb-fino { position: fixed; z-index: 40; width: 10px; display: none; pointer-events: none; }
#sb-fino i { position: absolute; right: 2px; width: 3px; border-radius: 3px; background: color-mix(in srgb, var(--muted) 45%, transparent); pointer-events: auto; cursor: default; transition: width .12s, background .12s; }
#sb-fino i:hover, #sb-fino.arrastando i { width: 5px; background: color-mix(in srgb, var(--muted) 70%, transparent); }

/* texto do modelo alterável a pedido do usuário */
.ed-fixo, .ed-titulo-fixo { position: relative; }
.ed-alterar { position: absolute; right: 6px; top: 4px; opacity: 0; font-size: 11px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--faint); cursor: pointer; }
.ed-fixo:hover .ed-alterar, .ed-titulo-fixo:hover .ed-alterar, .ed-alterar:focus-visible { opacity: 1; }

/* preferências */
.pref { display: grid; gap: 16px; padding-bottom: 40px; }
.pref-sec { padding-bottom: 12px; }
.pref-desc { margin: 0 16px 8px; }
.pref-campo { padding: 10px 16px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.pref-campo label { font-weight: 600; font-size: 13px; }
.pref-aj { margin: 0; }
.pref-ops { display: flex; flex-wrap: wrap; gap: 8px; }
.pref-op { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.pref-op:hover { background: var(--surface); }
.pref-op.ativa { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pref-in, .pref-ta { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
.sec-cab.ativa { background: var(--accent-soft); }
a.sec-cab { text-decoration: none; color: inherit; display: flex; align-items: center; gap: 10px; }

/* citações dos autos clicáveis no chat e janela do trecho */
a.cit-trecho { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--faint); cursor: pointer; }
a.cit-trecho:hover { color: var(--accent); border-bottom-color: var(--accent); }
.trecho-txt { white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; margin: 12px 0 0; padding: 14px 16px; border-radius: 10px; background: var(--surface); font: 13px/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; max-height: 62vh; overflow: auto; }

/* tipografia e padrões do sistema */
.cartao.padrao { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cartao-link[data-acao="definir-padrao"] { cursor: pointer; }
.tp-previa { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #111; overflow: hidden; max-height: 120px; }
.tp-previa p { margin: 0; }
.pref-radio { display: inline-flex; align-items: center; gap: 6px; font-weight: 400 !important; font-size: 13px; }
.ed-tip { width: auto; max-width: 240px; padding: 6px 10px; font-size: 13px; }

/* preferências: listas suspensas com caixas de seleção (no lugar dos chips) */
.pref-dd { position: relative; max-width: 460px; }
.pref-dd > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 14px; }
.pref-dd > summary::-webkit-details-marker { display: none; }
.pref-dd > summary svg { width: 16px; height: 16px; color: var(--muted); flex: none; transition: transform .15s; } .pref-dd[open] > summary svg { transform: rotate(180deg); }
.pref-dd-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pref-dd-lista { position: absolute; z-index: 25; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--sombra, 0 6px 24px rgba(0,0,0,.14)); }
.pref-dd-op { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; text-align: left; } .pref-dd-op:hover { background: var(--surface-2); }
.pref-dd-op[hidden] { display: none; } .pref-dd-op input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.pref-dd-busca { width: 100%; box-sizing: border-box; margin: 2px 0 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }

/* memória do estilo de escrita (somente leitura) */
.mem { padding: 0 16px 6px; }
.mem h4 { margin: 14px 0 6px; font-size: 13px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.mem-regra { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.mem-regra:first-of-type { border-top: 0; }
.mem-fonte { font-size: 12px; color: var(--faint); padding: 3px 0; overflow-wrap: anywhere; }
.mem-velha { opacity: .65; }
.mem-aviso { margin: 4px 0 8px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 13px; }
.mem-hist { margin-top: 6px; }

/* a lista suspensa não pode ser cortada pela caixa da seção; a pesquisa fica fixa na primeira linha da lista */
.painel.pref-sec { overflow: visible; }
.pref-dd-busca { position: sticky; top: 0; z-index: 1; }
.pref-dd-lista { background: var(--card); }

.zona-limpar { display: block; margin: 8px auto 0; border: 0; background: none; color: var(--accent); font-size: 12px; cursor: pointer; text-decoration: underline; }

/* tabelas, código e demais elementos nas respostas do chat */
.md-tab { overflow-x: auto; margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; }
.md-tab table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md-tab th, .md-tab td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); hyphens: none; }
.md-tab th { background: var(--surface); font-weight: 600; white-space: nowrap; }
.md-tab tr:last-child td { border-bottom: 0; }
.md-tab td:not(:first-child), .md-tab th:not(:first-child) { font-variant-numeric: tabular-nums; }
code { font: 0.92em ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--surface); padding: 1px 5px; border-radius: 5px; }
pre.md-cod { background: var(--surface); padding: 12px 14px; border-radius: 10px; overflow-x: auto; font: 13px/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; text-align: left; white-space: pre; }

a.cit-web { font-size: .78em; vertical-align: super; text-decoration: none; padding: 0 2px; } a.cit-web:hover { text-decoration: underline; }

a.cit-web { font-size: inherit; vertical-align: baseline; text-decoration: none; padding: 0; color: var(--accent); } a.cit-web:hover { text-decoration: underline; }
.tag-preso { cursor: pointer; border: 1px solid color-mix(in srgb, var(--bad, #b3261e) 40%, transparent); background: color-mix(in srgb, var(--bad, #b3261e) 10%, var(--card)); color: var(--bad, #b3261e); font: inherit; font-size: 12px; font-weight: 600; }
.estilo-perg { margin: 12px 0; } .estilo-perg p { margin: 0 0 6px; }
.sim-nao { display: flex; gap: 8px; } .sim-nao .chip { padding: 6px 16px; }
.sim-nao .chip.ativo { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); font-weight: 600; }
.estilo-modelo summary { cursor: pointer; font-weight: 600; }
.estilo-msgs { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.estilo-msg { max-width: 92%; padding: 10px 14px; border-radius: 14px; line-height: 1.45; }
.estilo-msg.assistente { background: var(--surface); align-self: flex-start; }
.estilo-msg.usuario { background: var(--accent-soft); color: var(--text); align-self: flex-end; }
.estilo-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; } .estilo-form textarea { flex: 1; resize: vertical; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; background: var(--bg); color: var(--text); }
.estilo-ent { margin-top: 10px; } .estilo-ent summary { cursor: pointer; color: var(--muted); } .estilo-ent ul { margin: 6px 0 0; padding-left: 18px; }
