/* Portela Sync · design system v5
   Fonte única · protótipo, app do CRM e plugin usam este mesmo arquivo.
   Regras · violeta em no máximo um décimo da tela · Outfit para títulos, números e rótulos · Manrope para texto. */

:root {
  --ps-tinta: #0B0B0A;
  --ps-carvao: #151513;
  --ps-carvao-2: #1C1C19;
  --ps-cinza-escuro: #55554F;
  --ps-cinza: #8B8B85;
  --ps-cinza-claro: #A9A9A2;
  --ps-fio: #E2E1DB;
  --ps-fio-escuro: rgba(255, 255, 255, 0.14);
  --ps-papel: #F5F4F0;
  --ps-branco: #FFFFFF;
  --ps-violeta: #9B8CFF;
  --ps-violeta-claro: #B3A8FF;
  --ps-violeta-tinta: #4B3BB5;
  --ps-violeta-suave: rgba(155, 140, 255, 0.14);
  --ps-erro: #FF8A7A;
  --ps-erro-tinta: #B3402F;
  --ps-fonte-display: 'Outfit', 'Segoe UI', sans-serif;
  --ps-fonte-texto: 'Manrope', 'Segoe UI', sans-serif;
  --ps-raio: 16px;
  --ps-raio-p: 10px;
}

/* ---------- Temas · claro e escuro ----------
   Cada token tem os dois valores em light-dark(). Sem escolha, segue o sistema.
   data-tema no <html> força um modo (ps.js). .tema-papel e .tema-tinta forçam num trecho da página. */
:root {
  color-scheme: light dark;
  --fundo: light-dark(var(--ps-papel), var(--ps-tinta));
  --superficie: light-dark(var(--ps-branco), var(--ps-carvao));
  --superficie-2: light-dark(#FBFAF7, var(--ps-carvao-2));
  --texto-forte: light-dark(var(--ps-tinta), var(--ps-branco));
  --texto: light-dark(#2B2B28, var(--ps-papel));
  --texto-suave: light-dark(var(--ps-cinza-escuro), var(--ps-cinza-claro));
  --texto-fraco: light-dark(#6E6E68, var(--ps-cinza));
  --fio: light-dark(var(--ps-fio), var(--ps-fio-escuro));
  --realce: light-dark(rgba(11, 11, 10, 0.045), rgba(255, 255, 255, 0.04));
  --acento: var(--ps-violeta);
  --acento-texto: light-dark(var(--ps-violeta-tinta), var(--ps-violeta));
  --erro: light-dark(var(--ps-erro-tinta), var(--ps-erro));
  --rolagem: color-mix(in srgb, var(--texto-fraco) 38%, transparent);
  --sombra: light-dark(rgba(11, 11, 10, 0.18), rgba(0, 0, 0, 0.6));
}
:root[data-tema="claro"], .tema-papel { color-scheme: light; }
:root[data-tema="escuro"], .tema-tinta { color-scheme: dark; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: clip; }
body {
  margin: 0; background: var(--fundo); color: var(--texto);
  font-family: var(--ps-fonte-texto); font-size: 14.5px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--ps-fonte-display); margin: 0; color: var(--texto-forte); font-weight: 400; }
h1 { font-size: clamp(26px, 3vw, 36px); font-weight: 300; line-height: 1.1; letter-spacing: -0.015em; }
h1 strong { font-weight: 500; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--acento-texto); outline-offset: 2px; border-radius: 4px; }
.rotulo { font-family: var(--ps-fonte-display); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--texto-fraco); }
.num { font-family: var(--ps-fonte-display); font-variant-numeric: tabular-nums; }
.suave { color: var(--texto-suave); }
.fraco { color: var(--texto-fraco); font-size: 12.5px; }
.ac { color: var(--acento-texto); }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.linha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.entre { justify-content: space-between; }
.pilha { display: grid; gap: 16px; align-content: start; }
.empurra { margin-left: auto; }

/* ---------- Barras de rolagem discretas ----------
   Fina, sem setas e sem trilho, na cor do tema. A faixa útil tem 10px para o mouse pegar, o que se vê tem 4px. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; }
::-webkit-scrollbar-thumb { background: var(--rolagem); background-clip: content-box; border: 3px solid transparent; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--texto-fraco); }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--rolagem) transparent; } }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 9px; font-family: var(--ps-fonte-display); font-size: 18px; font-weight: 300; line-height: 1; color: var(--texto-forte); white-space: nowrap; }
.logo strong { font-weight: 500; }
.logo svg { width: 32px; height: 24px; }
.logo circle { fill: none; stroke: currentColor; stroke-width: 3.5; }
.logo .ponto { fill: var(--ps-violeta); stroke: none; }

/* ---------- Estrutura do painel interno ---------- */
.app { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns 0.2s ease; }
.lateral { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px; padding: 22px 14px; border-right: 1px solid var(--fio); background: var(--fundo); }
.lateral-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px 0 10px; }
.menu { display: grid; gap: 2px; }
.menu a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--ps-raio-p); color: var(--texto-fraco); font-weight: 600; font-size: 13.5px; }
.menu a:hover { color: var(--texto-forte); background: var(--realce); }
.menu a[aria-current] { color: var(--texto-forte); background: var(--realce); }
.menu a[aria-current] .ic { color: var(--acento); }
.menu .conta { margin-left: auto; font-family: var(--ps-fonte-display); font-size: 12px; color: var(--texto-fraco); }
.lateral .rotulo { padding: 0 10px 6px; display: block; }
.usuario { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--fio); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--superficie-2); border: 1px solid var(--fio); font-family: var(--ps-fonte-display); font-size: 12px; color: var(--texto-forte); flex-shrink: 0; }
.avatar.p { width: 22px; height: 22px; font-size: 10px; }
.conteudo { padding: 30px 36px 64px; min-width: 0; }
.topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 26px; }
.topo .rotulo { display: block; margin-bottom: 8px; }
.grade { display: grid; gap: 16px; }
.g2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- Menu recolhido · faixa só de ícones ----------
   data-menu="recolhido" no <html>, gravado pelo ps.js. No celular o menu já é uma barra de ícones, então não se aplica. */
@media (min-width: 761px) {
  :root[data-menu="recolhido"] .app { grid-template-columns: 64px minmax(0, 1fr); }
  :root[data-menu="recolhido"] .lateral { padding-inline: 10px; align-items: center; }
  :root[data-menu="recolhido"] .lateral-topo { flex-direction: column; gap: 14px; padding: 0; }
  :root[data-menu="recolhido"] :is(.logo span, .menu a span, .lateral .rotulo, .usuario b, .sair span) { display: none; }
  :root[data-menu="recolhido"] .menu a { justify-content: center; padding: 10px; }
  :root[data-menu="recolhido"] .usuario { flex-direction: column; padding: 12px 0 0; }
  :root[data-menu="recolhido"] .usuario .btn-icone { margin: 0; }
}

/* ---------- Cartão ---------- */
.cartao { background: var(--superficie); border: 1px solid var(--fio); border-radius: var(--ps-raio); padding: 20px; min-width: 0; }
.cartao > h2 { margin-bottom: 14px; }
.cartao-topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin-bottom: 14px; }
.kpi .v { font-family: var(--ps-fonte-display); font-weight: 200; font-size: 38px; line-height: 1.1; color: var(--texto-forte); font-variant-numeric: tabular-nums; margin-top: 8px; }
.kpi .v small { font-size: 16px; font-weight: 300; color: var(--texto-fraco); }

/* ---------- Botões ---------- */
.btn, .btn-fantasma {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  font-family: var(--ps-fonte-display); font-size: 14px; letter-spacing: 0.02em; white-space: nowrap;
  padding: 10px 20px; border-radius: 999px; border: 1px solid transparent; transition: background 0.2s ease, border-color 0.2s ease;
}
.btn { background: var(--ps-violeta); color: var(--ps-tinta); font-weight: 500; }
.btn:hover { background: var(--ps-violeta-claro); }
.btn-fantasma { background: transparent; color: var(--texto-forte); border-color: var(--fio); font-weight: 400; }
.btn-fantasma:hover { border-color: var(--texto-fraco); }
.btn-p { padding: 6px 14px; font-size: 13px; }
.btn-perigo { color: var(--erro); }
.btn .ic, .btn-fantasma .ic { width: 16px; height: 16px; }

/* ---------- Selo ---------- */
.selo { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--fio); font-size: 12px; color: var(--texto-suave); white-space: nowrap; }
.selo-acento { border-color: transparent; background: var(--ps-violeta-suave); color: var(--acento-texto); }
.selo-erro { border-color: color-mix(in srgb, var(--erro) 45%, transparent); color: var(--erro); }
.selo i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Formulário ---------- */
.campo { display: grid; gap: 6px; }
.campo > label, .campo > .pergunta { font-size: 13px; font-weight: 600; color: var(--texto-forte); }
.campo .ajuda { font-size: 12.5px; color: var(--texto-fraco); }
input[type=text], input[type=email], input[type=tel], input[type=search], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--texto-forte); background: var(--superficie-2);
  border: 1px solid var(--fio); border-radius: var(--ps-raio-p); padding: 10px 12px;
}
textarea { resize: vertical; min-height: 84px; }
::placeholder { color: var(--texto-fraco); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--acento-texto); outline-offset: 0; border-color: transparent; }
.fichas { display: flex; flex-wrap: wrap; gap: 8px; }
.fichas label { cursor: pointer; }
.fichas input { position: absolute; opacity: 0; }
.fichas span { display: inline-block; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--fio); font-size: 13px; color: var(--texto-suave); }
.fichas input:checked + span { background: var(--ps-violeta-suave); border-color: transparent; color: var(--acento-texto); }
.fichas input:focus-visible + span { outline: 2px solid var(--acento-texto); outline-offset: 2px; }
.chave { appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--superficie-2); border: 1px solid var(--fio); position: relative; cursor: pointer; flex-shrink: 0; margin: 0; }
.chave::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--texto-fraco); transition: transform 0.2s ease; }
.chave:checked { background: var(--ps-violeta-suave); border-color: var(--acento-texto); }
.chave:checked::after { transform: translateX(14px); background: var(--acento-texto); }
.busca { position: relative; flex: 1 1 260px; max-width: 420px; }
.busca .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--texto-fraco); }
.busca input { padding-left: 38px; border-radius: 999px; }
.soltar { border: 1px dashed var(--fio); border-radius: var(--ps-raio-p); padding: 18px; text-align: center; color: var(--texto-fraco); font-size: 13px; }

/* ---------- Lista e tabela ---------- */
.lista { list-style: none; margin: 0; padding: 0; }
.lista > li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--fio); min-width: 0; }
.lista > li:first-child { border-top: 0; padding-top: 0; }
.lista > li:last-child { padding-bottom: 0; }
.lista .txt { min-width: 0; flex: 1; }
.lista .txt b { display: block; font-weight: 600; color: var(--texto-forte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista .txt span { display: block; font-size: 12.5px; color: var(--texto-fraco); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icone-caixa { width: 34px; height: 34px; border-radius: var(--ps-raio-p); display: grid; place-items: center; background: var(--superficie-2); border: 1px solid var(--fio); color: var(--texto-suave); flex-shrink: 0; }
.barra { height: 6px; border-radius: 999px; background: var(--realce); overflow: hidden; }
.barra i { display: block; height: 100%; border-radius: inherit; background: var(--texto-fraco); }
.barra.ac i { background: var(--acento); }

/* ---------- Quadro · padrão mitra-kanban adaptado ----------
   Faixa de fases numa linha só, na ordem do fluxo. O quadro tem altura fixa e só a pilha de cada fase rola.
   Cabeçalho e pilha são duas linhas da grade, herdadas por subgrid, então uma descrição longa não desalinha as fases.
   Não se arrasta cartão. A fase muda em "Mover para", dentro da ficha, e funciona no teclado e no toque. */
.tela.tela-cheia:target { display: flex; flex-direction: column; height: calc(100vh - 54px); }
.conteudo:has(.tela-cheia:target) { padding-bottom: 24px; }
.topo.compacto { align-items: center; margin-bottom: 18px; }
.topo.compacto h1 { font-size: 26px; display: inline; margin-right: 12px; }
.quadro { flex: 1; min-height: 22rem; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(212px, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 8px 12px; overflow-x: auto; padding-bottom: 8px; contain: size; }
.fase { display: grid; grid-row: span 2; grid-template-rows: subgrid; background: var(--realce); border-radius: var(--ps-raio); padding: 8px; min-width: 0; }
.fase-1 { --cor-fase: var(--texto-fraco); }
.fase-2 { --cor-fase: color-mix(in srgb, var(--acento) 25%, var(--texto-fraco)); }
.fase-3 { --cor-fase: color-mix(in srgb, var(--acento) 50%, var(--texto-fraco)); }
.fase-4 { --cor-fase: color-mix(in srgb, var(--acento) 75%, var(--texto-fraco)); }
.fase-5 { --cor-fase: var(--acento); }
.fase-topo { display: flex; flex-direction: column; gap: 6px; padding: 4px 6px; }
.fase-topo i { display: block; height: 4px; border-radius: 999px; background: var(--cor-fase); }
.fase-topo div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-family: var(--ps-fonte-display); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--texto-fraco); }
.fase-topo p { font-size: 12px; color: var(--texto-suave); }
.pilha-fase { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; padding-right: 4px; }
.cartao-fase { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; min-width: 0; background: var(--superficie); border: 1px solid var(--fio); border-left: 3px solid var(--cor-fase); border-radius: 12px; padding: 12px; font-size: 13px; transition: box-shadow 0.2s ease; }
.cartao-fase:hover { box-shadow: 0 10px 22px -12px var(--sombra); }
.cartao-fase .marcas { display: flex; gap: 6px; min-width: 0; }
.cartao-fase .marcas .selo { display: block; min-width: 0; font-size: 11px; padding: 1px 8px; overflow: hidden; text-overflow: ellipsis; }
.cartao-fase .titulo { font-weight: 600; color: var(--texto-forte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cartao-fase dl { margin: 0; display: grid; gap: 8px; }
.cartao-fase dt { font-family: var(--ps-fonte-display); font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--texto-fraco); }
.cartao-fase dd { margin: 0; color: var(--texto-forte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cartao-fase .pe { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; font-size: 12px; color: var(--texto-suave); }
.cartao-fase .pe .sem { color: var(--acento-texto); font-weight: 600; }
.cartao-fase .pe .vencido { color: var(--erro); font-weight: 600; }
.tempos { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 11px; color: var(--texto-fraco); }
.tempos span { display: inline-flex; align-items: center; gap: 4px; }
.tempos .ic { width: 14px; height: 14px; }
.mover { display: grid; gap: 6px; }
.mover button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border-radius: var(--ps-raio-p); border: 1px solid var(--fio); background: transparent; color: var(--texto-forte); font: inherit; text-align: left; cursor: pointer; }
.mover button::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--cor-fase); flex-shrink: 0; }
.mover button:hover { border-color: var(--texto-fraco); }
.mover button[aria-current] { background: var(--realce); cursor: default; }
.mover button[aria-current]::after { content: 'Atual'; margin-left: auto; font-size: 12px; color: var(--texto-fraco); }
.mover .perdido { --cor-fase: var(--erro); }
.btn-icone { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: var(--ps-raio-p); border: 1px solid var(--fio); background: transparent; color: var(--texto-suave); cursor: pointer; flex-shrink: 0; }
.btn-icone:hover { color: var(--texto-forte); border-color: var(--texto-fraco); }

/* ---------- Linha do tempo ---------- */
.tempo { list-style: none; margin: 0; padding: 0; }
.tempo li { position: relative; padding: 0 0 22px 30px; }
.tempo li::before { content: ''; position: absolute; left: 6px; top: 16px; bottom: 0; border-left: 1px dashed var(--fio); }
.tempo li:last-child { padding-bottom: 0; }
.tempo li:last-child::before { display: none; }
.tempo li::after { content: ''; position: absolute; left: 2px; top: 6px; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--texto-fraco); background: var(--superficie); }
.tempo .auto::after { border-color: var(--acento); background: var(--acento); box-shadow: 0 0 0 4px var(--ps-violeta-suave); }
.tempo .cab { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.tempo .cab b { font-weight: 600; color: var(--texto-forte); }
.tempo .corpo { margin-top: 4px; color: var(--texto-suave); }
.anexo { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 12px; border: 1px solid var(--fio); border-radius: var(--ps-raio-p); font-size: 13px; color: var(--texto-forte); }

/* ---------- Linha de sincronia · etapas do projeto ---------- */
.sincronia { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.sincronia li { position: relative; padding: 28px 10px 0 0; font-size: 13px; color: var(--texto-fraco); }
.sincronia li::before { content: ''; position: absolute; top: 7px; left: 0; right: 0; border-top: 1px dashed var(--texto-fraco); opacity: 0.6; }
.sincronia li:last-child::before { display: none; }
.sincronia li::after { content: ''; position: absolute; top: 2px; left: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--superficie); border: 1.5px solid var(--texto-fraco); }
.sincronia b { display: block; font-weight: 600; color: inherit; }
.sincronia .feita { color: var(--texto-suave); }
.sincronia .feita::before { border-top-style: solid; opacity: 1; }
.sincronia .feita::after { background: var(--texto-suave); border-color: var(--texto-suave); }
.sincronia .atual { color: var(--texto-forte); }
.sincronia .atual::after { background: var(--acento); border-color: var(--acento); box-shadow: 0 0 0 5px var(--ps-violeta-suave); }
.sincronia.em-pe { grid-auto-flow: row; }
.sincronia.em-pe li { padding: 0 0 22px 28px; }
.sincronia.em-pe li::before { top: 13px; bottom: -2px; left: 5px; right: auto; border-top: 0; border-left: 1px dashed var(--texto-fraco); }
.sincronia.em-pe .feita::before { border-left-style: solid; }
.sincronia.em-pe li::after { top: 4px; }
.sincronia.em-pe li:last-child { padding-bottom: 0; }

/* ---------- Anel de progresso ---------- */
.anel { position: relative; width: 76px; height: 76px; flex-shrink: 0; }
.anel svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.anel circle { fill: none; stroke-width: 9; }
.anel .f { stroke: var(--realce); }
.anel .v { stroke: var(--acento); stroke-linecap: round; }
.anel b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--ps-fonte-display); font-weight: 400; font-size: 17px; color: var(--texto-forte); font-variant-numeric: tabular-nums; }

/* ---------- Aviso e vazio ---------- */
.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--ps-raio-p); border: 1px solid var(--fio); background: var(--realce); font-size: 13.5px; }
.aviso.erro { border-color: color-mix(in srgb, var(--erro) 45%, transparent); color: var(--erro); }
.aviso.destaque { border-color: transparent; background: var(--ps-violeta-suave); color: var(--texto-forte); }
.link-caixa { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid var(--fio); border-radius: 999px; background: var(--superficie-2); min-width: 0; }
.link-caixa code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: var(--texto-suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }

/* ---------- Página do cliente ---------- */
.cliente { max-width: 720px; margin: 0 auto; padding: 0 20px 56px; }
.cliente-topo { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; border-bottom: 1px solid var(--fio); margin-bottom: 32px; }
.cliente h1 { margin: 10px 0 8px; }
.rodape { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--fio); font-size: 12.5px; color: var(--texto-fraco); }

/* ---------- Contrato ---------- */
.folha { color-scheme: light; background: var(--ps-branco); color: #2B2B28; border: 1px solid var(--ps-fio); border-radius: 4px; padding: clamp(28px, 7%, 64px); box-shadow: 0 30px 60px -40px rgba(11, 11, 10, 0.35); font-size: 13.5px; line-height: 1.7; }
.folha h1 { font-size: 26px; margin: 34px 0 6px; }
.folha h2 { font-family: var(--ps-fonte-display); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ps-violeta-tinta); margin: 26px 0 8px; }
.folha p + p { margin-top: 10px; }
.folha mark { background: var(--ps-violeta-suave); color: inherit; padding: 1px 4px; border-radius: 4px; }
.folha mark.falta { background: transparent; outline: 1px dashed var(--ps-erro-tinta); color: var(--ps-erro-tinta); }
.assinaturas { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 56px; }
.assinaturas div { border-top: 1px solid var(--ps-tinta); padding-top: 8px; font-size: 12.5px; }

/* ---------- Protótipo · troca de tela sem JS ---------- */
.tela { display: none; scroll-margin-top: 999px; }
.tela:target, .conteudo:not(:has(.tela:target)) .tela:first-child { display: block; }

/* ---------- Telas menores ---------- */
@media (max-width: 1080px) {
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .lateral { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--fio); }
  .lateral-topo { flex: 1; padding: 0; } /* só a logo e o botão. O resto mora na gaveta, mais abaixo */
  .tela.tela-cheia:target { height: auto; }
  .quadro { flex: none; height: 30rem; contain: none; }
  .conteudo { padding: 22px 16px 48px; }
  .sincronia:not(.em-pe) { grid-auto-flow: row; }
  .sincronia:not(.em-pe) li { padding: 0 0 22px 28px; }
  .sincronia:not(.em-pe) li::before { top: 13px; bottom: -2px; left: 5px; right: auto; border-top: 0; border-left: 1px dashed var(--texto-fraco); }
  .sincronia:not(.em-pe) li::after { top: 4px; }
  .assinaturas { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .nao-imprime { display: none !important; } .folha { border: 0; box-shadow: none; padding: 0; } }

/* ---------- Componentes do app ---------- */
input[type=password], input[type=file], input[type=url] {
  width: 100%; font: inherit; color: var(--texto-forte); background: var(--superficie-2);
  border: 1px solid var(--fio); border-radius: var(--ps-raio-p); padding: 10px 12px;
}
input[type=file] { padding: 7px 12px; font-size: 13px; }
button { font-family: inherit; }
.conteudo > .aviso { margin-bottom: 16px; }
/* quadro ocupando a tela · o main vira a coluna flex que dá a altura */
.conteudo.cheia { height: 100vh; display: flex; flex-direction: column; padding-bottom: 24px; }
.tabela { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabela th { text-align: left; font-family: var(--ps-fonte-display); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--texto-fraco); padding: 8px 12px; border-bottom: 1px solid var(--fio); white-space: nowrap; }
.tabela td { padding: 11px 12px; border-bottom: 1px solid var(--fio); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela td a { color: var(--texto-forte); font-weight: 600; }
.rola-x { overflow-x: auto; }
/* formulário que abre no lugar, sem modal e sem JS */
details.abre > summary { cursor: pointer; list-style: none; font-size: 12.5px; color: var(--texto-fraco); }
details.abre > summary::-webkit-details-marker { display: none; }
details.abre > summary:hover { color: var(--texto-forte); }
details.abre[open] > summary { margin-bottom: 12px; }
.form-grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grade .inteiro { grid-column: 1 / -1; }
.link { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; color: var(--texto-fraco); cursor: pointer; }
.link:hover { color: var(--texto-forte); }
button.chave { padding: 0; }
.chave[aria-pressed="true"] { background: var(--ps-violeta-suave); border-color: var(--acento-texto); }
.chave[aria-pressed="true"]::after { transform: translateX(14px); background: var(--acento-texto); }
.entrar { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.entrar .cartao { width: min(100%, 380px); display: grid; gap: 18px; padding: 28px; }
.resposta { padding: 12px 0; border-top: 1px solid var(--fio); }
.resposta:first-child { border-top: 0; padding-top: 0; }
.resposta p { color: var(--texto-forte); white-space: pre-wrap; }
@media (max-width: 760px) {
  .conteudo.cheia { height: auto; }
  .form-grade { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Cabeçalho · ações sempre em uma linha ----------
   A busca encolhe antes de qualquer botão descer, em qualquer largura. */
.topo > .linha { flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
.topo .linha { flex-wrap: nowrap; }
.topo .linha > form.linha { flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
.topo .busca { flex: 1 1 160px; min-width: 0; }
.topo select { flex-shrink: 0; }

/* ---------- Sair · botão embaixo do nome, no pé da lateral. Com o menu recolhido ou no celular fica só o ícone ---------- */
.gaveta { display: contents; } /* no computador não existe como caixa, os menus seguem filhos da lateral */
.usuario > div { min-width: 0; }
.usuario b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sair { display: flex; align-items: center; gap: 6px; margin-top: 2px; padding: 2px 0; background: none; border: 0; font: inherit; font-size: 12.5px; color: var(--texto-fraco); cursor: pointer; }
.sair:hover { color: var(--texto-forte); }
.sair .ic { width: 15px; height: 15px; }
:root[data-menu="recolhido"] .sair .ic { width: 18px; height: 18px; }

/* ---------- Janela · <dialog> nativo, aberto por data-abre no ps.js ---------- */
.janela { width: min(680px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 26px; border: 1px solid var(--fio); border-radius: var(--ps-raio); background: var(--superficie); color: var(--texto); box-shadow: 0 24px 64px rgb(0 0 0 / 0.35); }
.janela::backdrop { background: rgb(11 11 10 / 0.6); }
.janela h2 { font-size: 24px; font-weight: 300; margin-top: 8px; }

@media (max-width: 760px) {
  .app { grid-template-rows: auto minmax(0, 1fr); } /* a barra do topo fica da altura do conteúdo, sem esticar */
  /* tela do quadro · ocupa a altura visível inteira e o quadro vai até o fim, com rolagem dentro de cada fase */
  .app:has(.conteudo.cheia) { height: 100dvh; min-height: 0; }
  .conteudo.cheia { min-height: 0; padding-bottom: 12px; }
  .conteudo.cheia .quadro { flex: 1; height: auto; contain: size; }
  .topo > .linha { flex-basis: 100%; }
  .topo :is(.btn, .btn-fantasma) { padding-inline: 14px; } /* sobra mais espaço para a busca */
  .topo > .linha:has(> form.linha) { flex-wrap: wrap; } /* busca, etapa e Filtrar numa linha, Novo lead na outra · só na lista de empresas */
  /* gaveta · o menu entra pela lateral esquerda, por cima da tela. Abre e fecha pelo botão da barra (data-gaveta no <html>, ps.js) */
  .gaveta { position: fixed; inset: 0 auto 0 0; z-index: 30; width: min(280px, 84vw); display: flex; flex-direction: column; gap: 28px; padding: 22px 14px; background: var(--fundo); border-right: 1px solid var(--fio); overflow-y: auto; visibility: hidden; transform: translateX(-100%); transition: transform 0.25s ease, visibility 0.25s; }
  :root[data-gaveta] .gaveta { visibility: visible; transform: none; box-shadow: 24px 0 64px rgb(0 0 0 / 0.35); }
  .lateral::after { content: ''; position: fixed; inset: 0; z-index: 25; background: rgb(11 11 10 / 0.6); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
  :root[data-gaveta] .lateral::after { opacity: 1; pointer-events: auto; }
}

/* ---------- Agenda · item de lista com ações embaixo e o horário em destaque ---------- */
.lista > li.em-pe { flex-direction: column; align-items: stretch; gap: 8px; }
.horario { font-family: var(--ps-fonte-display); font-size: 19px; font-weight: 300; color: var(--texto-forte); min-width: 58px; font-variant-numeric: tabular-nums; }

/* ---------- Conversa · balões. Quem escreve de fora fica à esquerda, a Ana e a equipe à direita ---------- */
.baloes { list-style: none; margin: 0; padding: 0 4px 0 0; display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.balao { max-width: min(84%, 560px); align-self: flex-start; padding: 10px 14px; border-radius: 14px 14px 14px 4px; background: var(--superficie-2); border: 1px solid var(--fio); }
.balao p { color: var(--texto-forte); overflow-wrap: anywhere; }
.balao.de-ana, .balao.de-equipe { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--realce); }
.balao .quem { display: block; margin-bottom: 4px; font-size: 11.5px; color: var(--texto-fraco); }
.balao.de-ana .quem::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--acento); vertical-align: 1px; }
.balao .nota { display: block; margin-top: 6px; font-size: 12px; color: var(--texto-fraco); overflow-wrap: anywhere; }
.balao .nota.erro { color: var(--erro); }
.balao .anexo { display: block; max-width: 100%; margin-top: 8px; border-radius: 10px; }
.balao img.anexo { max-height: 240px; }
.balao audio.anexo { width: 260px; height: 36px; }

/* ---------- Movimento · curto e discreto ----------
   Entrada da tela, resposta ao toque e abertura de janela. Nada passa de meio segundo e nada se repete.
   Quem pede menos movimento no sistema não vê nenhum (prefers-reduced-motion). */
@view-transition { navigation: auto; } /* troca de página esmaece em vez de piscar */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.18s; }
.lateral { view-transition-name: lateral; } /* o menu fica parado enquanto o conteúdo troca */
@keyframes surge { from { opacity: 0; transform: translateY(8px); } }
@keyframes aparece { from { opacity: 0; } }
@keyframes cresce { from { transform: scaleX(0); } }
@keyframes abre-janela { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.conteudo > * { animation: surge 0.35s ease backwards; }
.conteudo > :nth-child(2) { animation-delay: 0.05s; }
.conteudo > :nth-child(3) { animation-delay: 0.1s; }
.conteudo > :nth-child(n + 4) { animation-delay: 0.15s; }
.pilha-fase > * { animation: surge 0.3s ease backwards; }
.pilha-fase > :nth-child(1) { animation-delay: 0.1s; }
.pilha-fase > :nth-child(2) { animation-delay: 0.14s; }
.pilha-fase > :nth-child(3) { animation-delay: 0.18s; }
.pilha-fase > :nth-child(n + 4) { animation-delay: 0.22s; }
.barra i { transform-origin: left; animation: cresce 0.5s 0.2s ease-out backwards; }
.janela[open] { animation: abre-janela 0.22s ease; }
.janela[open]::backdrop { animation: aparece 0.22s ease; }
.btn, .btn-fantasma, .btn-icone { transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.1s ease; }
:is(.btn, .btn-fantasma, .btn-icone):active { transform: scale(0.97); }
.menu a, .sair, .link, .tabela td, input, select, textarea { transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease; }
.cartao-fase { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.cartao-fase:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
