/* Átrio: marca, entrada cinematográfica e ajustes do aplicativo. Complementa atrio.css (tokens e componentes). */

body { overflow: hidden; }
#root { height: 100vh; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: min(560px, calc(100vw - 32px)); opacity: 0; pointer-events: none; transition: opacity 160ms ease-out; }
.toast.on { opacity: 1; }
.toast.err { background: var(--crit); color: #fff; }

/* O aplicativo ocupa a tela inteira (sem a faixa de aviso das maquetes) */
.app { height: 100vh; }
.rail .logo { background: transparent; color: var(--ink); }
.rail .logo svg { width: 28px; height: 28px; }
.rail a.off { opacity: 0.4; pointer-events: none; }
.rail .who { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.view { min-width: 0; min-height: 0; height: 100%; overflow: hidden; }
.view > * { height: 100%; }
.empty { display: grid; place-content: center; gap: 8px; text-align: center; color: var(--ink-2); padding: 32px; height: 100%; }
.empty h2 { font-size: 16px; color: var(--ink); }
.spin { opacity: 0.5; }

/* ===== Entrada cinematográfica ===== */
.login { position: fixed; inset: 0; background: #070b12; color: #f0efec; overflow: hidden; display: grid; place-items: center; z-index: 50; }
.login .scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.login .vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 46%, transparent 0 35%, rgba(3, 5, 9, 0.75) 100%); pointer-events: none; }
.login .grain { position: absolute; inset: -50%; opacity: 0.06; background-image: radial-gradient(#fff 0.5px, transparent 0.6px); background-size: 3px 3px; pointer-events: none; animation: grain 1.2s steps(6) infinite; }
.login-card { position: relative; z-index: 2; width: min(420px, calc(100vw - 32px)); margin-top: 22vh; padding: 28px 28px 24px; border-radius: 16px; background: rgba(14, 20, 30, 0.55); border: 1px solid rgba(255, 255, 255, 0.1); backdrop-filter: blur(14px); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); display: grid; gap: 16px; animation: rise-in 900ms 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.login-card h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.3px; }
.login-card p { color: #b9c0cc; font-size: 14px; }
.login-card label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: #b9c0cc; }
.login-card input { height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(0, 0, 0, 0.35); color: #fff; font-size: 14px; }
.login-card input:focus-visible { outline: 2px solid #6da7ec; outline-offset: 2px; }
.login-card .btn.primary { height: 44px; justify-content: center; font-size: 14px; background: #2a78d6; border-color: #2a78d6; }
.login-card .btn.ghost { height: 40px; justify-content: center; background: transparent; border-color: rgba(255, 255, 255, 0.2); color: #f0efec; }
.login-card .btn.ghost:hover { background: rgba(255, 255, 255, 0.08); }
.login-card .err { color: #ff8f8f; font-size: 13px; min-height: 18px; }
.brandline { position: absolute; z-index: 2; top: 9vh; left: 0; right: 0; display: grid; justify-items: center; gap: 10px; text-align: center; padding: 0 16px; }
.brandline .tag { text-shadow: 0 1px 16px rgba(5, 8, 14, 0.95); font-size: clamp(14px, 1.8vw, 18px); color: #b9c0cc; letter-spacing: 0.04em; animation: reveal 1400ms 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

/* cena: os arcos se desenham um a um, a luz respira e o feixe passeia */
.scene .arc { fill: none; stroke: #6da7ec; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1800ms cubic-bezier(0.3, 0.6, 0.2, 1) forwards; animation-delay: calc(var(--i) * 260ms); }
.scene .floor { stroke: #6da7ec; stroke-opacity: 0.22; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2200ms 600ms ease-out forwards; }
.scene .glow { animation: breathe 5s ease-in-out infinite; transform-origin: 800px 420px; }
.scene .beam { animation: sway 11s ease-in-out infinite; transform-origin: 800px 0; }
.scene .dust circle { animation: float 14s linear infinite; animation-delay: calc(var(--d) * -1s); }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes breathe { 0%, 100% { opacity: 0.75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); opacity: 0.55; } 50% { transform: rotate(3deg); opacity: 0.9; } }
@keyframes float { from { transform: translateY(60px); opacity: 0; } 15% { opacity: 0.8; } 85% { opacity: 0.8; } to { transform: translateY(-420px); opacity: 0; } }
@keyframes pop-dot { from { opacity: 0; transform: scale(0.2); } to { opacity: 1; transform: scale(1); } }
@keyframes reveal { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); } }

@media (prefers-reduced-motion: reduce) {
  .scene .arc, .scene .floor, .mark-draw .m-arch, .mark-draw .m-bar { stroke-dashoffset: 0 !important; }
    .scene .glow, .scene .beam, .scene .dust circle, .login .grain { animation: none !important; }
  .login-card, .brandline .tag { animation: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
}

/* ===== Caixa funcional ===== */
.inbox-app { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: 100%; min-width: 0; }
.inbox-app .thread { display: grid; grid-template-columns: minmax(0, 1fr) 320px; height: 100%; min-width: 0; }
.inbox-app .list header h1 { gap: 8px; }
.row .ago { color: var(--ink-3); font-size: 12px; text-align: right; }
.row .who { font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.row.read .who { font-weight: 500; }
.msg .by.src-flow, .msg .by.src-automation, .msg .by.src-campaign { color: var(--accent-text); }
.msg.sys-fail { border-color: var(--crit); }
.mstate { display: inline-flex; align-items: center; gap: 4px; }
.mstate.failed { color: var(--crit); font-weight: 600; }
.conv-empty { display: grid; place-content: center; text-align: center; color: var(--ink-2); gap: 6px; padding: 32px; }
.chips .chip.on { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-text); }
.tagchip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 4px 0 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 500; }
.tagchip button { border: 0; background: none; color: var(--ink-3); padding: 0 6px; height: 22px; border-radius: 999px; }
.tagchip button:hover { color: var(--crit); }
.notes-list { display: grid; gap: 8px; }
.notes-list .n { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.notes-list .n small { display: block; color: var(--ink-3); font-size: 11px; margin-bottom: 2px; }
dialog.sheet { width: min(460px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); padding: 20px; }
dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.4); }
dialog.sheet h2 { font-size: 16px; margin-bottom: 12px; }
dialog.sheet .row-f { display: grid; gap: 4px; margin-bottom: 12px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
dialog.sheet .btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ===== Editor de fluxos e regras (JSON) ===== */
.cfg { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: 100%; min-width: 0; }
.cfg .work { padding: 20px 28px 40px; }
.code { width: 100%; min-height: 380px; font: 13px/1.5 ui-monospace, "Cascadia Code", Consolas, monospace; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); resize: vertical; tab-size: 2; }
.issues { display: grid; gap: 6px; margin-top: 12px; }
.issue { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.issue.error { background: color-mix(in srgb, var(--crit) 10%, var(--surface)); }
.issue.warning { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); }
.issue svg { margin-top: 2px; flex: none; }
.issue.error svg { color: var(--crit); }
.issue.warning svg { color: var(--serious); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }

@media (max-width: 1180px) { .inbox-app .thread { grid-template-columns: minmax(0, 1fr); } .inbox-app .case { display: none; } }
@media (max-width: 900px) { .cfg { grid-template-columns: minmax(0, 1fr); } .cfg .side { max-height: 36vh; } }
@media (max-width: 760px) { .inbox-app { grid-template-columns: minmax(0, 1fr); } .inbox-app.has-sel .list { display: none; } .inbox-app:not(.has-sel) .thread { display: none; } }


/* =====================================================================================================
   Marca v2 e acabamento (Sally e o time, 27/11/2026). Padrões estudados em Cult UI (MIT) e Spell UI,
   reimplementados em CSS puro: borda que percorre o contorno, holofote que segue o cursor, aviso em ilha,
   números que rolam. Tudo respeita prefers-reduced-motion e só confirma estado; o cinema fica na entrada.
   ===================================================================================================== */

/* ----- logotipo que se escreve (entrada) ----- */
.wm { display: block; overflow: visible; }
.wm-draw .w { animation: inkdraw 850ms cubic-bezier(0.3, 0.6, 0.2, 1) both; animation-delay: calc(var(--k, 0) * 150ms + 500ms); }
.wm .w1 { --k: 0; } .wm .w2 { --k: 1; } .wm .w3 { --k: 2; } .wm .w4 { --k: 3; } .wm .w5 { --k: 4; } .wm .w6 { --k: 5; } .wm .w7 { --k: 6; } .wm .w8 { --k: 7; }
.wm-draw .wl { transform-box: fill-box; transform-origin: center; animation: pop-dot 700ms cubic-bezier(0.3, 1.6, 0.4, 1) both; animation-delay: 2.1s; }
.wm-draw .wl2 { animation-delay: 2.3s; }
@keyframes inkdraw { from { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; } 2% { opacity: 1; } to { stroke-dasharray: 1; stroke-dashoffset: 0; opacity: 1; } }
.brandline .wm { filter: drop-shadow(0 4px 40px rgba(5, 8, 14, 0.95)); }
.brandline::before { content: ""; position: absolute; z-index: -1; inset: -40px -120px; background: radial-gradient(ellipse at 50% 45%, rgba(5, 8, 14, 0.85), transparent 70%); }

/* o monograma, quando se desenha: arco, travessa e depois a luz do acento */
.mark-draw .m-arch, .mark-draw .m-bar { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1100ms 0.4s cubic-bezier(0.3, 0.6, 0.2, 1) forwards; }
.mark-draw .m-bar { animation-delay: 1.1s; animation-duration: 500ms; }
.mark-draw .m-acc { opacity: 0; transform-box: fill-box; transform-origin: center; animation: pop-dot 600ms 1.5s cubic-bezier(0.3, 1.6, 0.4, 1) forwards; }

/* ----- ambiente do tema escuro: uma luz fria vinda de cima ----- */
:root[data-theme="dark"] .conv, :root[data-theme="dark"] .page, :root[data-theme="dark"] .work { background: radial-gradient(760px 280px at 50% -40px, rgba(42, 120, 214, 0.13), transparent 70%), var(--bg); }
:root[data-theme="dark"] .rail { background: linear-gradient(180deg, color-mix(in srgb, var(--accent-btn) 9%, var(--surface)), var(--surface) 38%); }

/* ----- vidro no cabeçalho da conversa ----- */
.conv > header { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%); position: relative; z-index: 2; }

/* ----- holofote que segue o cursor (linhas e cartões) ----- */
.row, .item, .tile, .card { position: relative; isolation: isolate; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .row::before, .item::before, .tile::before, .card::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 180ms ease-out;
    background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent-text) 16%, transparent), transparent 65%);
  }
  .row:hover::before, .item:hover::before, .tile:hover::before, .card:hover::before { opacity: 1; }
}

/* ----- borda que percorre o contorno quando o campo de resposta está pronto ----- */
@property --beam { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.box { position: relative; transition: box-shadow 180ms ease-out; }
.box::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none; opacity: 0; transition: opacity 200ms ease-out;
  background: conic-gradient(from var(--beam), transparent 0 62%, color-mix(in srgb, var(--accent-text) 30%, transparent) 78%, var(--accent-text) 92%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.box:focus-within::after { opacity: 1; animation: beam 3.2s linear infinite; }
.box:focus-within { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-text) 10%, transparent); }
@keyframes beam { to { --beam: 360deg; } }
@media (prefers-reduced-motion: reduce) { .box:focus-within::after { animation: none; background: var(--accent-text); } }

/* ----- aviso em ilha: desce do alto, com ícone ----- */
.toast { top: 14px; bottom: auto; left: 50%; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 12px; border-radius: 999px; font-weight: 500;
  background: color-mix(in srgb, var(--ink) 92%, transparent); color: var(--bg); backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: translate(-50%, -22px) scale(0.9); opacity: 0; transition: transform 420ms cubic-bezier(0.2, 1.4, 0.4, 1), opacity 160ms ease-out; }
.toast.on { transform: translate(-50%, 0) scale(1); opacity: 1; }
.toast svg { color: var(--good); } .toast.err svg { color: #fff; }
.toast.err { background: var(--crit); color: #fff; }
@media (prefers-reduced-motion: reduce) { .toast, .toast.on { transition: opacity 120ms; transform: translate(-50%, 0); } }

/* ----- esqueleto de primeira carga ----- */
.skel-list { display: grid; gap: 0; width: 100%; }
.skel-row { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; gap: 8px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.skel { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--accent-text) 14%, var(--surface-2)) 50%, var(--surface-2) 100%); background-size: 220% 100%; animation: shimmer 1.4s linear infinite; }
.skel.c { grid-row: 1 / 3; width: 36px; height: 36px; border-radius: 50%; }
.skel.l1 { height: 12px; width: 55%; } .skel.l2 { height: 10px; width: 80%; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* ----- estados vazios com o padrão da marca ----- */
.empty-art { color: var(--ink-3); margin: 0 auto 8px; }
.empty-art .lamp { transform-box: fill-box; transform-origin: center; animation: breathe 4.5s ease-in-out infinite; filter: drop-shadow(0 0 6px var(--accent-text)); }
@media (prefers-reduced-motion: reduce) { .empty-art .lamp { animation: none; } }
.conv-empty .empty-art { width: 120px; height: 120px; }

/* ----- paleta de comandos ----- */
dialog.cmd { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(18px) saturate(150%); border-color: color-mix(in srgb, var(--accent-text) 25%, var(--line)); }
dialog.cmd[open] { animation: pop 220ms cubic-bezier(0.2, 1.2, 0.4, 1); }
.cmd li[role=option] { cursor: pointer; }
.cmd .cmd-l { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.cmd .cmd-l svg { color: var(--ink-3); }
.cmd li[aria-selected="true"] .cmd-l svg { color: var(--accent-text); }
.cmd .cmd-h { color: var(--ink-3); font-size: 12px; max-width: 45%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ----- transição suave entre telas ----- */
::view-transition-group(root) { animation-duration: 180ms; }
::view-transition-old(root), ::view-transition-new(root) { animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1); }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(root), ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }

/* ===== Modelos: balão do WhatsApp e estúdio ===== */
dialog.sheet.wide { width: min(980px, calc(100vw - 32px)); }
.studio { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; max-height: 66vh; }
.studio-form { overflow: auto; padding-right: 6px; min-width: 0; }
.studio-side { overflow: auto; min-width: 0; display: grid; gap: 10px; align-content: start; }
@media (max-width: 820px) { .studio { grid-template-columns: minmax(0, 1fr); max-height: 70vh; overflow: auto; } .studio-form, .studio-side { overflow: visible; } }
.wa { display: grid; gap: 4px; padding: 16px; border-radius: 12px; background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface-2)); border: 1px solid var(--line); max-width: 380px; }
.wa-bubble { background: var(--surface); border-radius: 10px 10px 10px 2px; padding: 8px 10px; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12); display: grid; gap: 4px; }
.wa-h { font-weight: 700; overflow-wrap: anywhere; }
.wa-media { display: flex; align-items: center; gap: 6px; height: 72px; justify-content: center; border-radius: 6px; background: var(--surface-2); color: var(--ink-3); font-size: 12px; }
.wa-b { white-space: pre-wrap; overflow-wrap: anywhere; }
.wa-f { color: var(--ink-3); font-size: 12px; }
.wa-btn { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border-radius: 8px; background: var(--surface); color: var(--accent-text); font-weight: 600; text-align: center; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12); overflow-wrap: anywhere; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }

/* =====================================================================================================
   Visão v3 (27/11/2026), depois de o Felipe dizer que o aplicativo parecia um busão. O que pesava: cinza neutro
   em todo canto (a entrada era noite azul e o aplicativo, um cinza de ônibus), uma fonte só, caixas de borda
   pesada, etiquetas demais e título sem voz. Agora: noite azul também dentro, Geist no trabalho e Instrument
   Serif nos títulos e números, profundidade no lugar de linha, e menos ruído. Fontes embutidas (licença OFL):
   o Átrio continua abrindo offline.
   ===================================================================================================== */
@font-face { font-family: "Inter Variable"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(inter-latin.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(jetbrains-mono-latin.woff2) format("woff2"); }
@font-face { font-family: "Geist Variable"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(geist-latin.woff2) format("woff2-variations"), url(geist-latin.woff2) format("woff2"); }

:root {
  --elev: 0 1px 2px rgba(16, 24, 40, 0.05), 0 12px 28px -16px rgba(16, 24, 40, 0.18);
  --elev-pop: 0 18px 50px -18px rgba(16, 24, 40, 0.35);
  --bubble-in: var(--surface-2);
  --bubble-out: color-mix(in srgb, var(--accent-btn) 13%, var(--surface));
  --hair: color-mix(in srgb, var(--line) 62%, transparent);
}
:root[data-theme="dark"] {
  --elev: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 14px 32px -18px rgba(0, 0, 0, 0.75);
  --elev-pop: 0 24px 60px -20px rgba(0, 0, 0, 0.8);
  --bubble-in: color-mix(in srgb, var(--surface-2) 92%, var(--accent-btn));
  --bubble-out: linear-gradient(180deg, color-mix(in srgb, var(--accent-btn) 34%, var(--surface)), color-mix(in srgb, var(--accent-btn) 24%, var(--surface)));
}

body { font-family: var(--font); letter-spacing: -0.003em; font-optical-sizing: auto; }
.tile .val, .hbar .v, .tbl td, .row .ago, .quiet, .kv dd, .mrow .top b { font-variant-numeric: tabular-nums; }

/* ----- títulos com voz (serifa) e o resto em Geist ----- */
.page-h h1, .side h1, .list h1, dialog.sheet h2, dialog.confirm h2, .empty h2, .login-card h1 {
  font-family: var(--display); font-weight: 400; letter-spacing: -0.012em; line-height: 1.1;
}
.page-h h1 { font-size: 34px; }
.side h1, .list h1 { font-size: 28px; }
dialog.sheet h2, dialog.confirm h2 { font-size: 26px; margin-bottom: 14px; }
.empty h2 { font-size: 24px; }
.login-card h1 { font-size: 30px; }
.login-card h1 + p { margin-top: 6px; }
.page-h .muted { margin-top: 4px; }
.tile .val { font-family: var(--display); font-weight: 400; font-size: 46px; line-height: 1; letter-spacing: -0.02em; }
.tile .val small { font-family: var(--font); font-size: 14px; letter-spacing: 0; }
.tile .lbl, .card .sub { letter-spacing: 0.01em; }
.case h3 { text-transform: none; font-size: 12px; letter-spacing: 0.02em; }

/* ----- noite azul dentro do aplicativo e menos "caixas empilhadas" ----- */
.card, .tile { border-radius: 16px; border-color: var(--hair); box-shadow: var(--elev); }
.card { padding: 20px; gap: 14px; }
.tile { padding: 18px 20px; gap: 6px; }
.grid { align-items: start; }
.row, .item, .skel-row, .tabs { border-bottom-color: var(--hair); }
.list, .side, .case, .rail { border-color: var(--hair); }
.conv > header, .composer { border-color: var(--hair); }
.row, .item { padding-top: 14px; padding-bottom: 14px; }
.row .who { font-weight: 600; }
.row .ago { color: var(--ink-3); font-size: 12px; }
:root[data-theme="light"] .rail { background: linear-gradient(180deg, color-mix(in srgb, var(--accent-btn) 7%, var(--surface)), var(--surface) 42%); }
:root[data-theme="light"] .conv, :root[data-theme="light"] .page, :root[data-theme="light"] .work { background: radial-gradient(760px 260px at 50% -40px, rgba(37, 106, 191, 0.085), transparent 70%), var(--bg); }
:root[data-theme="dark"] .list, :root[data-theme="dark"] .side, :root[data-theme="dark"] .case { background: color-mix(in srgb, var(--surface) 70%, var(--bg)); }

/* ----- lista da Caixa: uma linha quieta no lugar de duas etiquetas ----- */
.list .hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.list header { padding-bottom: 12px; }
.hd-actions { display: flex; gap: 6px; }
.quiet { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); }
.quiet svg { color: var(--ink-3); }
.quiet.team, .quiet.team svg { color: var(--accent-text); }
.row .meta { gap: 12px; align-items: center; }
.avatar { background: linear-gradient(145deg, color-mix(in srgb, var(--accent-btn) 20%, var(--surface-2)), var(--surface-2)); border-color: var(--hair); color: var(--accent-text); }

/* ----- balões: mais redondos, sem borda, com cantinho de fala ----- */
.msg { border: 0; border-radius: 18px 18px 18px 6px; padding: 10px 14px; background: var(--bubble-in); max-width: min(560px, 80%); }
.msg.out { border-radius: 18px 18px 6px 18px; background: var(--bubble-out); }
.msg.bot { border: 1px dashed color-mix(in srgb, var(--accent-text) 35%, var(--axis)); background: transparent; border-radius: 18px 18px 6px 18px; }
.msg .by { font-weight: 600; color: var(--accent-text); }
.day { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }

/* ----- botões e campos ----- */
.btn { height: 34px; padding: 0 14px; border-radius: 10px; border-color: var(--hair); background: color-mix(in srgb, var(--surface) 70%, var(--surface-2)); transition: background 140ms ease-out, border-color 140ms ease-out, transform 140ms ease-out, box-shadow 140ms ease-out; }
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--accent-text) 28%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn.primary { height: 36px; border-color: transparent; color: #fff; background: linear-gradient(180deg, color-mix(in srgb, #fff 16%, var(--accent-btn)), var(--accent-btn) 62%); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 8px 18px -10px color-mix(in srgb, var(--accent-btn) 90%, transparent); }
.btn.primary:hover { filter: brightness(1.07); border-color: transparent; }
.field { height: 36px; border-radius: 10px; border-color: var(--hair); background: var(--surface-2); transition: border-color 140ms ease-out, box-shadow 140ms ease-out; }
.field:focus-visible { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-text) 20%, transparent); }
textarea.field { border-radius: 12px; }
.chip { border-color: var(--hair); height: 28px; padding: 0 12px; }
.badge { height: 24px; padding: 0 10px; }
.tabs button { height: 30px; border-radius: 8px; }

/* ----- casca: a barra lateral com mais presença ----- */
.rail { padding-top: 14px; }
.app { grid-template-columns: 60px minmax(0, 1fr); }
.rail a, .rail button { width: 42px; height: 42px; border-radius: 12px; }
.rail a[aria-current="page"] { background: color-mix(in srgb, var(--accent-btn) 16%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-text) 22%, transparent), 0 10px 22px -12px color-mix(in srgb, var(--accent-btn) 80%, transparent); }
.rail a[aria-current="page"]::before { left: -9px; box-shadow: 0 0 12px var(--accent-btn); }
.rail .who { background: linear-gradient(145deg, color-mix(in srgb, var(--accent-btn) 25%, var(--surface-2)), var(--surface-2)); color: var(--accent-text); }
@media (max-width: 760px) { .app { grid-template-columns: 48px minmax(0, 1fr); } }

/* ----- janelas e paleta com profundidade ----- */
dialog.sheet, dialog.confirm { border-radius: 20px; border-color: var(--hair); box-shadow: var(--elev-pop); background: color-mix(in srgb, var(--surface) 94%, var(--bg)); padding: 24px; }
dialog.sheet::backdrop, dialog.confirm::backdrop, dialog.cmd::backdrop { background: rgba(4, 7, 12, 0.55); backdrop-filter: blur(3px); }
dialog.cmd { border-radius: 18px; box-shadow: var(--elev-pop); }
.issue { border-radius: 10px; }
.rule-note { border-radius: 12px; }
.kvgrid .cell { border-radius: 12px; background: color-mix(in srgb, var(--surface-2) 88%, transparent); border: 1px solid var(--hair); }
.wa { border-radius: 16px; }

/* ----- painéis: os cartões entram em sequência ----- */
@media (prefers-reduced-motion: no-preference) {
  .page .tile, .page .card { animation: rise 460ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .page .tile:nth-child(2), .page .card:nth-child(2) { animation-delay: 50ms; }
  .page .tile:nth-child(3), .page .card:nth-child(3) { animation-delay: 100ms; }
  .page .tile:nth-child(4), .page .card:nth-child(4) { animation-delay: 150ms; }
  .page .tile:nth-child(5), .page .card:nth-child(5) { animation-delay: 200ms; }
  .page .tile:nth-child(6), .page .card:nth-child(6) { animation-delay: 250ms; }
}
.hbar .bar { border-radius: 0 6px 6px 0; background: linear-gradient(90deg, color-mix(in srgb, var(--b, var(--s1)) 70%, transparent), var(--b, var(--s1))); }
.seg-bar { height: 32px; }
.seg-bar > div { border-radius: 6px; }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.ident { font-family: var(--font) !important; font-weight: 600 !important; font-size: 26px !important; letter-spacing: -0.015em !important; overflow-wrap: anywhere; }
.cfg { grid-template-columns: 360px minmax(0, 1fr); }
.side header { flex-wrap: wrap; row-gap: 10px; }
@media (max-width: 900px) { .cfg { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================================================
   AURORA (caminho 2, escolhido pelo Felipe em 27/11/2026). Claro por padrão, tinta azul-marinho, e uma luz em
   degradê (azul, violeta, coral) que só aparece no símbolo, no botão principal e na fala da equipe.
   Títulos em Geist 700 bem apertada (a serifa saiu). Prancha: docs/design/rebrand/direcoes.html.
   ===================================================================================================== */
:root {
  --aurora: linear-gradient(120deg, #2f5bff 0%, #8b5cf6 55%, #ff6b6b 100%);
  --aurora-2: linear-gradient(120deg, #2f5bff, #6d4ef5);
  --bubble-out: var(--aurora-2);
  --elev: 0 1px 2px rgba(10, 22, 48, 0.04), 0 12px 28px -16px rgba(10, 22, 48, 0.16);
  --elev-pop: 0 30px 70px -28px rgba(10, 22, 48, 0.35);
}
:root[data-theme="dark"] { --bubble-out: var(--aurora-2); }

/* ----- títulos: Geist firme, sem serifa ----- */
.page-h h1, .side h1, .list h1, dialog.sheet h2, dialog.confirm h2, .empty h2, .login-card h1 { font-family: var(--font); font-weight: 700; letter-spacing: -0.045em; line-height: 1.05; }
.page-h h1 { font-size: 32px; }
.side h1, .list h1 { font-size: 26px; }
dialog.sheet h2, dialog.confirm h2 { font-size: 22px; }
.empty h2 { font-size: 20px; letter-spacing: -0.03em; }
.tile .val { font-family: var(--font); font-weight: 650; font-size: 40px; letter-spacing: -0.045em; }
.ident { font-size: 24px !important; }

/* ----- a luz da marca ----- */
.btn.primary { background: var(--aurora-2); border-color: transparent; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 22px -12px rgba(47, 91, 255, 0.75); }
.btn.primary:hover { filter: brightness(1.06) saturate(1.06); }
.msg.out { background: var(--aurora-2); color: #fff; }
.msg.out .t, .msg.out .by, .msg.out .by svg, .msg.out .status { color: rgba(255, 255, 255, 0.8); }
.msg.bot { border: 1px dashed color-mix(in srgb, #8b5cf6 45%, transparent); }
.msg.bot .by { color: #6d4ef5; }
:root[data-theme="dark"] .msg.bot .by { color: #b3a1ff; }
:root[data-theme="light"] .msg:not(.out):not(.bot) { background: #ffffff; box-shadow: 0 1px 2px rgba(10, 22, 48, 0.06), 0 0 0 1px var(--hair); }
.hbar .bar { background: var(--b, var(--aurora-2)); }
.seg-bar > div:first-child { background-image: var(--aurora-2) !important; }

/* ----- casca: símbolo no topo, item ativo com a luz ----- */
.rail .logo { width: 36px; height: 36px; margin-bottom: 14px; }
.rail .logo svg { width: 34px; height: 34px; }
.rail .logo .mark { filter: drop-shadow(0 8px 16px rgba(91, 76, 240, 0.35)); }
.rail a[aria-current="page"] { background: color-mix(in srgb, #2f5bff 10%, transparent); color: var(--accent-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, #2f5bff 22%, transparent); }
.rail a[aria-current="page"]::before { background: var(--aurora); box-shadow: none; }
:root[data-theme="light"] .rail { background: #ffffff; }
.rail .who { background: var(--aurora-2); color: #fff; border-color: transparent; }
.avatar { font-weight: 700; }

/* ----- fundo das telas: um céu de aurora bem de leve ----- */
:root[data-theme="light"] .conv, :root[data-theme="light"] .page, :root[data-theme="light"] .work {
  background: radial-gradient(700px 300px at 88% -80px, rgba(139, 92, 246, 0.10), transparent 70%), radial-gradient(640px 280px at 8% -90px, rgba(47, 91, 255, 0.10), transparent 70%), var(--bg);
}
:root[data-theme="dark"] .conv, :root[data-theme="dark"] .page, :root[data-theme="dark"] .work {
  background: radial-gradient(760px 320px at 88% -80px, rgba(139, 92, 246, 0.18), transparent 70%), radial-gradient(680px 300px at 8% -90px, rgba(47, 91, 255, 0.18), transparent 70%), var(--bg);
}
:root[data-theme="light"] .list, :root[data-theme="light"] .side, :root[data-theme="light"] .case { background: #fbfcfe; }
:root[data-theme="dark"] .list, :root[data-theme="dark"] .side, :root[data-theme="dark"] .case { background: color-mix(in srgb, var(--surface) 72%, var(--bg)); }
.card, .tile { border-radius: 18px; }

/* ----- logotipo (símbolo + nome) ----- */
.wm-lock { display: inline-flex; align-items: center; gap: 0.32em; line-height: 1; }
.wm-text { font-family: var(--font); font-weight: 700; letter-spacing: -0.065em; color: #0a1630; }
.mark-draw .m-sym { transform-box: fill-box; transform-origin: 50% 80%; animation: door-in 900ms 250ms cubic-bezier(0.2, 0.9, 0.2, 1) both; }
.mark-draw .m-tile { animation: tile-in 700ms cubic-bezier(0.2, 0.9, 0.2, 1) both; transform-box: fill-box; transform-origin: center; }
@keyframes door-in { from { opacity: 0; transform: translateY(10px) scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes tile-in { from { opacity: 0; transform: scale(0.7) rotate(-8deg); } to { opacity: 1; transform: none; } }
.empty-art { color: var(--ink-3); }
.empty-art .lamp { filter: drop-shadow(0 0 8px #8b5cf6); }

/* ----- entrada clara: a aurora atrás do cartão ----- */
.login { background: #f5f7fc; color: #0a1630; }
.login .aurora { position: absolute; inset: -12%; filter: blur(70px) saturate(120%); }
.login .aurora i { position: absolute; display: block; border-radius: 50%; animation: drift 22s ease-in-out infinite alternate; }
.login .aurora .b1 { width: 52vw; height: 52vw; left: 4%; top: -14%; background: #2f5bff; opacity: 0.42; }
.login .aurora .b2 { width: 44vw; height: 44vw; right: 2%; top: 4%; background: #8b5cf6; opacity: 0.4; animation-delay: -8s; }
.login .aurora .b3 { width: 46vw; height: 46vw; left: 30%; bottom: -22%; background: #ff6b6b; opacity: 0.34; animation-delay: -15s; }
.login .aurora .gridlines { position: absolute; inset: 0; background-image: linear-gradient(rgba(10, 22, 48, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(10, 22, 48, 0.06) 1px, transparent 1px); background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse at 50% 42%, #000 0, transparent 68%); mask-image: radial-gradient(ellipse at 50% 42%, #000 0, transparent 68%); filter: none; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(4vw, 3vh) scale(1.08); } 100% { transform: translate(-3vw, 5vh) scale(0.96); } }
.login .grain { opacity: 0.035; }
.login .vignette { background: radial-gradient(ellipse at 50% 46%, transparent 0 45%, rgba(245, 247, 252, 0.55) 100%); }
.brandline { top: 11vh; gap: 14px; }
.brandline::before { display: none; }
.brandline .wm { filter: drop-shadow(0 18px 34px rgba(91, 76, 240, 0.45)); }
.brandline .tag { color: #4b5873; text-shadow: none; font-size: clamp(15px, 1.6vw, 18px); letter-spacing: 0; }
.login-card { background: rgba(255, 255, 255, 0.74); border: 1px solid rgba(10, 22, 48, 0.08); box-shadow: 0 40px 90px -40px rgba(10, 22, 48, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.6) inset; color: #0a1630; backdrop-filter: blur(18px) saturate(140%); }
.login-card h1 { font-size: 26px; }
.login-card p, .login-card label { color: #4b5873; }
.login-card input { background: #ffffff; border-color: #dfe5f1; color: #0a1630; }
.login-card input::placeholder { color: #8a94ab; }
.login-card input:focus-visible { outline: 2px solid #2f5bff; }
.login-card .btn.primary { background: var(--aurora-2); border-color: transparent; }
.login-card .btn.ghost { background: #ffffff; border-color: #dfe5f1; color: #0a1630; }
.login-card .btn.ghost:hover { background: #f2f4fa; }
.login-card .err { color: #c62828; }
@media (prefers-reduced-motion: reduce) { .login .aurora i, .mark-draw .m-sym, .mark-draw .m-tile { animation: none !important; opacity: 1 !important; transform: none !important; } }

/* ===== Quadro do fluxo (editor visual) ===== */
.fb { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; margin-bottom: 12px; }
@media (max-width: 1280px) { .fb { grid-template-columns: minmax(0, 1fr); } .fb-inspector { position: static; } }
.fb-main { min-width: 0; border: 1px solid var(--hair); border-radius: 16px; background: color-mix(in srgb, var(--surface) 55%, var(--bg)); box-shadow: var(--elev); overflow: hidden; }
.fb-bar { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--hair); background: var(--surface); }
.fb-scroll { overflow: auto; max-height: 64vh; }
.fb-canvas { position: relative; padding: 24px 28px; min-width: max-content; background-image: radial-gradient(color-mix(in srgb, var(--ink-3) 22%, transparent) 1px, transparent 1px); background-size: 18px 18px; }
.fb-board { position: relative; z-index: 1; display: flex; gap: 52px; align-items: flex-start; }
.fb-col { display: grid; gap: 16px; width: 200px; }
.fb-col.loose { padding: 12px; border: 1px dashed var(--axis); border-radius: 14px; }
.fb-node { text-align: left; display: grid; gap: 6px; padding: 12px; border-radius: 14px; border: 1px solid var(--hair); background: var(--surface); box-shadow: var(--elev); cursor: pointer; color: inherit; font: inherit; transition: border-color 140ms ease-out, box-shadow 140ms ease-out, transform 140ms ease-out; }
.fb-node:hover { border-color: color-mix(in srgb, var(--accent-text) 40%, var(--line)); transform: translateY(-1px); }
.fb-node.on { border-color: transparent; box-shadow: 0 0 0 2px var(--accent-btn), var(--elev); }
.fb-node.trig { background: var(--aurora-2); color: #fff; border-color: transparent; }
.fb-node.trig .fb-kind, .fb-node.trig .fb-sum { color: #fff; }
.fb-kind { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.01em; color: var(--accent-text); }
.fb-start { margin-left: auto; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.fb-sum { font-size: 13px; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fb-id { font: 500 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--ink-3); }
.fb-edge { font-size: 11px; color: var(--ink-2); padding: 2px 8px; border-radius: 8px; background: var(--surface-2); justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-wires { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: visible; }
.fb-wires path { fill: none; stroke: color-mix(in srgb, var(--ink-3) 55%, transparent); stroke-width: 1.6; }
.fb-wires path.dash { stroke-dasharray: 5 5; }
.fb-wires path.hot { stroke: var(--accent-btn); stroke-width: 2.2; }
.fb-wires marker path { fill: color-mix(in srgb, var(--ink-3) 75%, transparent); stroke: none; }
.fb-inspector { position: sticky; top: 0; display: grid; gap: 10px; padding: 16px; border-radius: 16px; border: 1px solid var(--hair); background: var(--surface); box-shadow: var(--elev); }
.fb-inspector h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.fb-f { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.fb-btn { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.fb-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--hair); }

/* ===== Regra de automação em forma de frase ===== */
.rb { display: grid; gap: 14px; padding: 18px; border-radius: 16px; border: 1px solid var(--hair); background: var(--surface); box-shadow: var(--elev); margin-bottom: 12px; }
.rb-sentence { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.5; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); }
.rb .blk { flex-wrap: wrap; }
.rb .rb-sel, .rb .rb-in { width: auto; height: 30px; border-radius: 8px; }
.rb .rb-in { min-width: 170px; }
.rb .rb-x { height: 28px; padding: 0 6px; }

/* ===== Casos: linha do tempo ===== */
.case-tl { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 0; position: relative; }
.case-tl::before { content: ""; position: absolute; left: 17px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, color-mix(in srgb, #2f5bff 40%, transparent), color-mix(in srgb, #8b5cf6 30%, transparent) 60%, color-mix(in srgb, #ff6b6b 25%, transparent)); }
.case-tl li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 8px 0; position: relative; }
.case-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); position: relative; z-index: 1; box-shadow: var(--shadow); }
.case-tl .k-message.s-in .case-dot { color: var(--ink-2); }
.case-tl .k-message.s-out .case-dot { color: #fff; background: var(--aurora-2); border-color: transparent; }
.case-tl .k-agent .case-dot { color: #6d4ef5; }
.case-tl .k-closure .case-dot { color: var(--good-text); }
.case-ev { min-width: 0; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); }
.case-tl .k-message.s-out .case-ev { background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); }
.case-hd { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.case-hd time { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.case-bd { font-size: 13px; color: var(--ink-2); margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* =====================================================================================================
   GRAFITE (direção B, escolhida pelo Felipe em 28/11/2026; ref. Linear, Vercel, Attio). Monocromático: o destaque
   é a própria tinta (preto no claro, branco no escuro). Cor só para estado: verde pago, âmbar promessa, vermelho risco.
   Nenhum degradê. Inter na interface, JetBrains Mono nos números. Prancha: docs/design/rebrand/direcao-b.html.
   Esta camada vem por último e vence as anteriores (Aurora e v3) de propósito.
   ===================================================================================================== */
:root {
  --aurora: var(--ink); --aurora-2: var(--ink); --on-ink: #ffffff;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --hair: var(--line);
  --elev: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, 0.04);
  --elev-pop: 0 0 0 1px var(--line), 0 24px 60px -24px rgba(0, 0, 0, 0.28);
  --pago: #1f8a5a; --promessa: #a36a00; --risco: #d1373f;
}
:root[data-theme="dark"] { --on-ink: #08090a; --pago: #4cb782; --promessa: #f2c94c; --risco: #eb5757; --elev: 0 0 0 1px var(--line); --elev-pop: 0 0 0 1px var(--line-2, #2b2c30), 0 24px 60px -24px rgba(0, 0, 0, 0.8); }
html, body { font-family: var(--font); font-feature-settings: "cv11", "ss01", "ss03"; -webkit-font-smoothing: antialiased; }
body { letter-spacing: -0.003em; }

/* fundos lisos, sem céu de aurora */
:root[data-theme] .conv, :root[data-theme] .page, :root[data-theme] .work { background: var(--bg); }
:root[data-theme] .list, :root[data-theme] .side, :root[data-theme] .case { background: var(--surface); }
:root[data-theme="light"] .list, :root[data-theme="light"] .side, :root[data-theme="light"] .case { background: #ffffff; }
:root[data-theme] .rail { background: var(--bg); border-right: 1px solid var(--line); }
.card, .tile { border-radius: 12px; box-shadow: none; border: 1px solid var(--line); background: var(--surface); }

/* títulos: Inter firme */
.page-h h1, .side h1, .list h1, dialog.sheet h2, dialog.confirm h2, .empty h2, .login-card h1 { font-family: var(--font); font-weight: 600; letter-spacing: -0.035em; }
.page-h h1 { font-size: 26px; } .side h1, .list h1 { font-size: 20px; }
.tile .val { font-family: var(--mono); font-weight: 500; font-size: 30px; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.ident { font-size: 20px !important; }
time, .num, .mono, .t, td.n, .kv b { font-variant-numeric: tabular-nums; }

/* botões: o principal é tinta sólida */
.btn { border-radius: 8px; box-shadow: none; }
.btn.primary, .login-card .btn.primary { background: var(--ink); color: var(--on-ink); border-color: transparent; box-shadow: none; filter: none; }
.btn.primary:hover { filter: none; opacity: .9; }

/* conversa: a fala da equipe é tinta, a do cliente é superfície */
.msg.out { background: var(--ink); color: var(--on-ink); }
.msg.out .t, .msg.out .by, .msg.out .by svg, .msg.out .status { color: color-mix(in srgb, var(--on-ink) 62%, transparent); }
.msg:not(.out):not(.bot) { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
:root[data-theme="light"] .msg:not(.out):not(.bot) { background: #ffffff; box-shadow: inset 0 0 0 1px var(--line); }
.msg.bot { border: 1px dashed var(--axis); background: transparent; }
.msg.bot .by, :root[data-theme="dark"] .msg.bot .by { color: var(--ink-3); }

/* casca */
.rail .logo { width: 36px; height: 36px; margin-bottom: 14px; color: var(--ink); background: none; }
.rail .logo svg { width: 24px; height: 24px; }
.rail .logo .mark { filter: none; }
.rail a[aria-current="page"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.rail a[aria-current="page"]::before { background: var(--ink); box-shadow: none; }
.rail .who { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.avatar { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); font-weight: 600; }
.row[aria-current="true"], .item[aria-current="true"] { background: var(--surface-2); border-left-color: var(--ink); }
.dot { background: var(--ink); }

/* gráficos e barras: tinta */
.hbar .bar { background: var(--b, var(--ink)); }
.seg-bar > div:first-child { background-image: none !important; background-color: var(--ink) !important; color: var(--on-ink); }
.fb-node.trig { background: var(--ink); color: var(--on-ink); }
.case-tl::before { background: var(--line); }
.case-tl .k-message.s-out .case-dot { background: var(--ink); color: var(--on-ink); }
.case-tl .k-agent .case-dot { color: var(--ink-2); }

/* estados com cor de verdade */
.badge.good { color: var(--pago); } .badge.warn { color: var(--promessa); } .badge.crit, .badge.bad { color: var(--risco); }

/* logotipo e vazio */
.wm-text { color: currentColor; font-weight: 700; letter-spacing: -0.055em; }
.mark-draw .m-sym { animation: none; }
.empty-art { color: var(--ink-3); }

/* entrada: escura, lisa, o símbolo faz de ilustração */
.login { background: #08090a; color: #f7f8f8; }
.login .aurora, .login .grain, .login .vignette { display: none !important; }
.brandline { color: #f7f8f8; }
.brandline .wm { filter: none; color: #f7f8f8; }
.brandline .tag { color: #8a8d93; }
.login-card { background: #0f1011; border: 1px solid #1f2023; box-shadow: 0 30px 80px -30px #000; color: #f7f8f8; backdrop-filter: none; }
.login-card p, .login-card label { color: #8a8d93; }
.login-card input { background: #08090a; border-color: #2b2c30; color: #f7f8f8; font-family: var(--mono); }
.login-card input::placeholder { color: #5a5d63; }
.login-card input:focus-visible { outline: 2px solid #f7f8f8; outline-offset: 1px; }
.login-card .btn.primary { background: #f7f8f8; color: #08090a; }
.login-card .btn.ghost { background: transparent; border-color: #2b2c30; color: #f7f8f8; }
.login-card .btn.ghost:hover { background: #17181a; }
.login-card .err { color: #eb5757; }
.login .scene { display: none !important; }
a.btn, a.btn:visited { color: var(--ink); text-decoration: none; }
a.btn.primary { color: var(--on-ink); }
.hbar .bar { background: var(--b, var(--ink-2)); }
.login-card { box-shadow: none !important; }

/* ===== Foco: uma conversa por vez, a que mais custa agora ===== */
.fx { height: 100%; overflow: auto; padding: 28px 32px 40px; background: var(--bg); }
.fx-h { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.fx-eyebrow { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.fx-h h1 { font: 600 26px/1.15 var(--font); letter-spacing: -.035em; margin-top: 4px; }
.fx-keys { display: flex; gap: 6px; align-items: center; color: var(--ink-3); font-size: 12px; }
.fx-keys span { margin-right: 8px; }
kbd { font: 500 10.5px var(--mono); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); color: var(--ink-3); background: var(--surface); }
.btn kbd { margin-left: 4px; }
.btn.primary kbd { background: transparent; color: inherit; opacity: .6; border-color: currentColor; }
.fx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 20px; overflow: hidden; }
.fx-stat { padding: 14px 18px; border-right: 1px solid var(--line); display: grid; gap: 2px; }
.fx-stat:last-child { border-right: 0; }
.fx-stat b { font: 500 28px/1.1 var(--mono); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.fx-stat span { font-size: 12px; color: var(--ink-3); }
.fx-stat.crit b { color: var(--risco); } .fx-stat.warn b { color: var(--promessa); }
.fx-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .fx-grid { grid-template-columns: minmax(0, 1fr); } .fx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fx-stat:nth-child(2) { border-right: 0; } .fx-stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }
.fx-card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.fx-top { display: flex; gap: 14px; align-items: center; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.fx-av { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font: 600 16px var(--font); background: var(--surface-2); border: 1px solid var(--line); flex: none; }
.fx-id { min-width: 0; flex: 1; }
.fx-id h2 { font: 600 22px/1.15 var(--font); letter-spacing: -.03em; }
.fx-id p { color: var(--ink-3); font: 500 12.5px var(--mono); margin-top: 3px; }
.fx-score { text-align: right; }
.fx-score b { display: block; font: 500 30px/1 var(--mono); letter-spacing: -.04em; }
.fx-score span { font-size: 11px; color: var(--ink-3); }
.fx-window { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.fx-window-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--ink-2); font-size: 13px; }
.fx-clock { font: 500 34px/1 var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.fx-window.crit .fx-clock { color: var(--risco); } .fx-window.warn .fx-clock { color: var(--promessa); }
.fx-bar { height: 4px; border-radius: 2px; background: var(--line); margin: 12px 0 8px; overflow: hidden; }
.fx-bar i { display: block; height: 100%; background: var(--ink); transition: width 1s linear; }
.fx-window.crit .fx-bar i { background: var(--risco); } .fx-window.warn .fx-bar i { background: var(--promessa); }
.fx-window p { font-size: 12px; color: var(--ink-3); }
.fx-why { list-style: none; margin: 0; padding: 14px 22px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.fx-why li { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.fx-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--ink-3); }
.fx-why li.crit .fx-dot { background: var(--risco); } .fx-why li.warn .fx-dot { background: var(--promessa); } .fx-why li.info .fx-dot { background: var(--ink); }
.fx-p { font: 500 11.5px var(--mono); color: var(--ink-3); }
.fx-last { margin: 0; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.fx-last small { font: 500 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.fx-last p { margin-top: 6px; font-size: 15px; line-height: 1.5; padding-left: 12px; border-left: 2px solid var(--ink); }
.fx-compose { padding: 16px 22px 18px; }
.fx-ta { width: 100%; min-height: 84px; resize: vertical; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 12px 14px; font: 14px/1.5 var(--font); }
.fx-ta:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.fx-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.fx-side { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; position: sticky; top: 0; }
.fx-side h2 { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.fx-next { list-style: none; margin: 0; padding: 0; }
.fx-next li { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.fx-next li:last-child { border-bottom: 0; }
.fx-next li:hover { background: var(--surface-2); }
.fx-next li[aria-current="true"] { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--ink); }
.fx-rank { font: 500 11px var(--mono); color: var(--ink-3); }
.fx-who { min-width: 0; display: grid; }
.fx-who b { font-weight: 550; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-who small { font-size: 11.5px; color: var(--ink-3); }
.fx-mini, .fx-pts { font: 500 12px var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .fx-bar i { transition: none; } }

/* ===== Menu lateral com nomes (Grafite) ===== */
.app { grid-template-columns: 232px minmax(0, 1fr) !important; }
:root[data-theme] .rail { align-items: stretch; gap: 1px; padding: 10px 8px; background: var(--surface); }
:root[data-theme="light"] .rail { background: #fbfbfb; }
.rail .ws { display: flex; align-items: center; gap: 9px; padding: 6px 8px 12px; }
.rail .ws .logo { width: auto; height: auto; margin: 0; display: grid; color: var(--ink); }
.rail .ws .logo svg { width: 22px; height: 22px; }
.rail .ws b { font: 700 16px var(--font); letter-spacing: -0.05em; }
.rail .ws .env { margin-left: auto; font: 500 10px var(--mono); color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.rail .find { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; margin: 0 0 8px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-3); font: 500 12.5px var(--font); cursor: pointer; justify-content: flex-start; }
.rail .find:hover { color: var(--ink); }
.rail .find kbd { margin-left: auto; }
.rail .grp { font: 500 11px var(--font); color: var(--ink-3); padding: 12px 10px 4px; }
.rail a { width: auto; height: 30px; display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 0 10px; border-radius: 7px; color: var(--ink-2); font: 500 13px var(--font); text-decoration: none; position: relative; }
.rail a svg { width: 16px; height: 16px; flex: none; color: var(--ink-3); }
.rail a:hover { background: var(--surface-2); color: var(--ink); }
.rail a[aria-current="page"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.rail a[aria-current="page"] svg { color: var(--ink); }
.rail a[aria-current="page"]::before { display: none; }
.rail .nc { margin-left: auto; font: 500 11px var(--mono); color: var(--ink-3); }
.rail .nc.hot:not(:empty) { color: var(--risco); }
.rail .nc.hot:not(:empty)::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--risco); margin-right: 6px; vertical-align: 1px; }
.rail [data-tip]::after { display: none !important; }
.rail .me { display: flex; align-items: center; gap: 9px; padding: 10px 6px 4px; border-top: 1px solid var(--line); margin-top: 8px; }
.rail .me .who { width: 28px; height: 28px; flex: none; margin: 0; font-size: 10.5px; }
.rail .me-t { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.rail .me-t b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail .me-t small { font-size: 11px; color: var(--ink-3); }
.rail .me button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; background: none; border: 0; color: var(--ink-3); cursor: pointer; }
.rail .me button:hover { background: var(--surface-2); color: var(--ink); }
@media (max-width: 1000px) {
  .app { grid-template-columns: 56px minmax(0, 1fr) !important; }
  .rail .nl, .rail .nc, .rail .grp { display: none !important; }
  .rail a, .rail .find { justify-content: center; padding: 0; }
  .rail .ws { justify-content: center; padding: 6px 0 12px; }
  .rail .me { flex-direction: column; padding: 8px 0 0; }
}
.conv header .who p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 12px; }
.conv header .who { min-width: 0; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.inbox-app { grid-template-columns: 324px minmax(0, 1fr); }
.inbox-app .thread { grid-template-columns: minmax(0, 1fr) 280px; }
.inbox-app .conv, .inbox-app .conv > * { min-width: 0; }
.conv header { min-width: 0; }
.conv header > div:first-child { min-width: 0; flex: 1 1 auto; }
@media (max-width: 1360px) { .inbox-app .thread { grid-template-columns: minmax(0, 1fr); } .inbox-app .case { display: none; } }

/* ===== Caixa densa ===== */
.row { grid-template-columns: 32px minmax(0, 1fr) auto !important; grid-template-areas: "av who ago" "av prev meta"; gap: 2px 10px !important; padding: 10px 14px !important; align-items: center; }
.row .avatar { grid-area: av; width: 32px; height: 32px; font-size: 11px; align-self: start; margin-top: 2px; }
.row .who { grid-area: who; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.row .ago { grid-area: ago; font: 500 11px var(--mono); color: var(--ink-3); }
.row .prev { grid-area: prev; font-size: 12.5px; color: var(--ink-3); grid-column: auto !important; }
.row .meta { grid-area: meta; grid-column: auto !important; display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.row .meta .badge { height: 18px; font-size: 10.5px; padding: 0 6px; }
.st { font: 500 11px var(--font); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--ink-2); }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st.info { color: var(--ink-2); } .st.info::before { background: var(--ink); }
.st.mute { color: var(--ink-3); } .st.warn { color: var(--promessa); } .st.bad { color: var(--risco); } .st.good { color: var(--pago); }
.tabs { padding: 0 10px 8px; gap: 2px; }
.tabs button { padding: 0 9px; font-size: 12.5px; }
.tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.case a { color: var(--ink); text-underline-offset: 3px; }

/* ===== Foco no celular ===== */
@media (max-width: 700px) {
  .fx { padding: 18px 14px 32px; }
  .fx-keys { display: none; }
  .fx-h h1 { font-size: 21px; }
  .fx-stat b { font-size: 22px; }
  .fx-stat { padding: 12px 14px; }
  .fx-top { padding: 16px; gap: 12px; }
  .fx-av { width: 40px; height: 40px; font-size: 14px; }
  .fx-id h2 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fx-id p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
  .fx-score b { font-size: 22px; }
  .fx-window, .fx-why, .fx-last, .fx-compose { padding-left: 16px; padding-right: 16px; }
  .fx-window-h { flex-direction: column; align-items: flex-start; gap: 4px; }
  .fx-clock { font-size: 28px; }
  .fx-why li { font-size: 13px; }
  .fx-actions .btn kbd { display: none; }
}

/* ===== Campos e estados vazios ===== */
.field, input.field, textarea.field, select.field { background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: 8px; }
:root[data-theme="light"] .field { background: #ffffff; border-color: #e4e4e7; }
.field:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; border-color: transparent; }
.field:disabled { background: var(--surface-2); color: var(--ink-3); }
.empty:not(:has(.empty-art))::before { content: ""; display: block; width: 64px; height: 64px; margin: 0 auto 14px; background: var(--ink-3); opacity: .5;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='none' stroke='black' stroke-width='.7' d='M9 2h14a7 7 0 0 1 7 7v14a7 7 0 0 1-7 7H9a7 7 0 0 1-7-7V9a7 7 0 0 1 7-7zm7 14.5a3.5 3.5 0 0 0-3.5 3.5V30h7V20a3.5 3.5 0 0 0-3.5-3.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='none' stroke='black' stroke-width='.7' d='M9 2h14a7 7 0 0 1 7 7v14a7 7 0 0 1-7 7H9a7 7 0 0 1-7-7V9a7 7 0 0 1 7-7zm7 14.5a3.5 3.5 0 0 0-3.5 3.5V30h7V20a3.5 3.5 0 0 0-3.5-3.5z'/%3E%3C/svg%3E") center / contain no-repeat; }
.side .empty:not(:has(.empty-art))::before { width: 44px; height: 44px; }
.empty h2 { font-size: 17px; }
.empty p { color: var(--ink-3); max-width: 360px; margin-inline: auto; }
.tile .val { font-family: var(--font); font-weight: 600; font-size: 26px; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.item { padding-top: 10px; padding-bottom: 10px; }

/* ===== Respostas rápidas ===== */
.qr-host { position: relative; }
.qr-pop { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); list-style: none; margin: 0; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--elev-pop); z-index: 5; max-height: 280px; overflow: auto; }
.qr-pop li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 7px 9px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.qr-pop li b { font: 500 12px var(--mono); }
.qr-pop li span { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-pop li[aria-selected="true"] { background: var(--surface-2); }
.qr-pop li.none { display: block; color: var(--ink-3); cursor: default; }
.qr-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.qr-list li { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.qr-list li:last-child { border-bottom: 0; }
.qr-list li b { font: 500 12px var(--mono); }
.qr-list li .btn { height: 26px; padding: 0 6px; }
.qr-sheet { min-width: min(520px, 80vw); }

/* ===== Mídia na conversa ===== */
.msg.has-media { padding: 6px; display: grid; gap: 4px; }
.msg.has-media > span:not(.t):not(.media-card) { padding: 0 6px; }
.msg.has-media .t { padding: 0 6px 2px; }
.media-open { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 10px; overflow: hidden; }
.media-img { display: block; max-width: min(320px, 60vw); max-height: 320px; min-width: 120px; min-height: 80px; object-fit: cover; background: var(--surface-2); border-radius: 10px; image-rendering: auto; }
.media-audio { width: min(300px, 60vw); height: 36px; }
.media-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 500 13px var(--font); text-align: left; min-width: 220px; }
button.media-card { cursor: pointer; }
button.media-card:hover { border-color: var(--axis); }
.media-card.wait, .media-card.fail { color: var(--ink-3); }
.media-card.fail { color: var(--risco); }
.media-ic { width: 34px; height: 40px; border-radius: 6px; display: grid; place-items: center; font: 600 10px var(--mono); background: var(--surface-2); border: 1px solid var(--line); }
.media-meta { display: grid; flex: 1; min-width: 0; }
.media-meta small { color: var(--ink-3); font: 500 11px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-card.doc > svg:last-child { transform: rotate(180deg); color: var(--ink-3); }
.msg.has-media { width: fit-content; max-width: min(360px, 70%); }
.msg.has-media .media-card { min-width: 240px; }

/* ===== Importação de planilha ===== */
.imp-cols { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 12px; }
.imp-col { font: 500 11.5px var(--mono); padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
.imp-col.base { color: var(--ink-3); }
.imp { min-width: min(560px, 82vw); }

/* ===== Painéis: equipe ===== */
.team-card { margin-bottom: 16px; }
.team-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.seg-ctl { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-ctl button { height: 28px; padding: 0 10px; border: 0; background: none; color: var(--ink-3); font: 500 12px var(--font); cursor: pointer; }
.seg-ctl button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }
.team-tbl td.n, .team-tbl th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.team-tbl td.n { font-family: var(--mono); font-size: 12.5px; }
.team-who { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.team-who .avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.team-bar { display: inline-block; width: 60px; height: 4px; border-radius: 2px; background: var(--line); margin-right: 8px; vertical-align: middle; overflow: hidden; }
.team-bar i { display: block; height: 100%; background: var(--ink); }
.team-h h2 { margin: 0 0 4px; line-height: 1.3; }
.team-h .sub { margin: 0; }
.team-h > div:first-child { min-width: 0; flex: 1 1 320px; }

/* ===== Listas mais densas e filtros numa linha ===== */
.side .item { padding: 9px 14px !important; gap: 2px; }
.side .item .t { font-size: 13.5px; }
.side .item .s { font-size: 12px; color: var(--ink-3); }
.side .item .badge { height: 20px; font-size: 11px; padding: 0 7px; }
.side [role="group"] { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; }
.side [role="group"]::-webkit-scrollbar { display: none; }
.side [role="group"] .chip { flex: none; height: 26px; font-size: 12px; }

/* ===== Conexão do número ===== */
.conn-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr); gap: 28px; align-items: center; }
.conn-copy h2 { margin-bottom: 12px; }
.conn-steps { list-style: none; counter-reset: st; padding: 0; margin: 0 0 18px; display: grid; gap: 12px; }
.conn-steps li { counter-increment: st; display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; row-gap: 2px; }
.conn-steps li::before { content: counter(st); grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font: 600 12px var(--mono); color: var(--ink-2); }
.conn-steps b { font-weight: 600; font-size: 14px; }
.conn-steps span { color: var(--ink-3); font-size: 13px; line-height: 1.45; }
.btn.lg { height: 40px; padding: 0 18px; font-size: 14px; }
.conn-qr { display: grid; justify-items: center; gap: 10px; text-align: center; font-size: 12px; }
.qr-frame { position: relative; width: min(220px, 100%); aspect-ratio: 1; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.qr-art { width: 100%; height: 100%; fill: #111; display: block; }
.qr-mark { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 10px; background: #111; color: #fff; display: grid; place-items: center; }
.qr-frame::after { content: ""; position: absolute; left: 12px; right: 12px; height: 2px; top: 16px; background: linear-gradient(90deg, transparent, var(--pago, #2f9e6a), transparent); animation: qr-scan 2.4s ease-in-out infinite; }
@keyframes qr-scan { 0%, 100% { top: 16px; opacity: .2; } 50% { top: calc(100% - 18px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .qr-frame::after { animation: none; opacity: 0; } }
.conn-limits { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--surface); }
.conn-limits summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.conn-limits ul, .conn-list { margin: 10px 0 6px; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.conn-list { margin-bottom: 14px; }
.conn-bar { display: block; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 6px; }
.conn-bar i { display: block; height: 100%; background: var(--ink); transition: width .4s ease; }
@media (max-width: 760px) { .conn-hero { grid-template-columns: 1fr; } .conn-qr { order: -1; } }
.conn-page .tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.conn-page .card > .btn { justify-self: start; width: auto; }
.conn-page .stack { display: grid; gap: 16px; }
@media (max-width: 760px) { .conn-page .tiles { grid-template-columns: 1fr; } }

.conn-manual { margin-bottom: 16px; display: grid; gap: 12px; }
.conn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.conn-hook { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); padding: 12px; border: 1px dashed var(--line); border-radius: 10px; }
.conn-hook code { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.conn-manual > .btn { justify-self: start; }
@media (max-width: 760px) { .conn-grid { grid-template-columns: 1fr; } }

/* ===== Carteira (cobrança) ===== */
.wallet { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0 16px 10px; }
.wallet-empty { grid-column: 1 / -1; font-size: 12px; margin: 0; }
.w-tile { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; min-width: 0; }
.w-tile span { font-size: 11px; color: var(--ink-3); }
.w-tile b { font: 600 13.5px var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-tile.risk b { color: var(--risco); }
.w-tile.prom b { color: var(--promessa); }
.w-tile.paid b { color: var(--pago); }
.w-line { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.w-line b { font: 600 12.5px var(--mono); font-variant-numeric: tabular-nums; }
.w-line .late { color: var(--risco); }
.w-line .ok { color: var(--ink-3); }
