/* Olympus Agents — painel do cliente (protótipo v1)
   Linguagem visual da Olympus IA (ia.olmps.co, repo ~/repos/mapa/ia-olmps): tinta #030305,
   azul #0055FF / #4DA3FF, Inter Tight com acento em Instrument Serif itálico, rótulos em Oswald,
   números em Fira Code, verde WhatsApp só em ações de WhatsApp, botões em pílula, curva .22,1,.36,1. */

:root {
  --bg: #030305;
  --bg-2: #0A0A10;
  --card: linear-gradient(160deg, rgba(24, 24, 34, 0.92), rgba(10, 10, 16, 0.92));
  --card-solid: #101018;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #EEEEF0;
  --text-2: #A8A8B6;
  --muted: #8A8A9A;
  --accent: #0055FF;
  --accent-md: #0077FF;
  --accent-2: #4DA3FF;
  --accent-soft: rgba(0, 85, 255, 0.12);
  --accent-line: rgba(77, 163, 255, 0.28);
  --glow: rgba(0, 85, 255, 0.4);
  --wa: #25D366;
  --wa-ink: #04160B;
  --ok: #3FCF8E;
  --ok-soft: rgba(63, 207, 142, 0.1);
  --warn: #F2B33D;
  --warn-soft: rgba(242, 179, 61, 0.1);
  --bad: #FF5C5C;
  --bubble-c: #101018;
  --bubble-a: #0d2350;
  --radius: 14px;
  --radius-lg: 22px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --head: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --label: "Oswald", "Inter Tight", sans-serif;
  --body: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  --mono: "Fira Code", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #F5F6F9;
  --bg-2: #E6E9F0;
  --card: linear-gradient(160deg, #ffffff, #f8f9fc);
  --card-solid: #ffffff;
  --line: rgba(5, 6, 11, 0.08);
  --line-2: rgba(5, 6, 11, 0.14);
  --text: #05060B;
  --text-2: #3d4150;
  --muted: #535868;
  --accent-2: #0055FF;
  --accent-soft: rgba(0, 85, 255, 0.08);
  --bubble-c: #ffffff;
  --bubble-a: #e3ecff;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

/* Fundo com brilho roxo sutil, lembrando a forma 3D do site */
.glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(closest-side, rgba(0, 85, 255, 0.28), transparent 70%) 108% -30% / 900px 700px no-repeat,
    radial-gradient(closest-side, rgba(0, 85, 255, 0.12), transparent 70%) -10% 120% / 700px 560px no-repeat,
    linear-gradient(rgba(77, 163, 255, 0.045) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(77, 163, 255, 0.045) 1px, transparent 1px) 0 0 / 56px 56px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,.25) 100%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,.25) 100%);
}
.glow svg { position: absolute; right: -180px; top: -260px; width: 980px; opacity: .55; }
[data-theme="light"] .glow { opacity: 0.55; }

#app {
  position: relative; z-index: 1;
  height: 100vh; height: 100dvh;
  container-type: size;
  container-name: app;
}
.shell { height: 100%; display: grid; grid-template-columns: 248px minmax(0, 1fr); }

/* ---------- Barra lateral ---------- */
.side {
  border-right: 1px solid var(--line);
  background: rgba(3, 3, 5, 0.62);
  backdrop-filter: blur(14px);
  display: flex; flex-direction: column;
  padding: 22px 16px;
  gap: 6px;
  min-height: 0;
}
[data-theme="light"] .side { background: rgba(255, 255, 255, 0.6); }
.brand { display: flex; flex-direction: column; gap: 6px; padding: 4px 10px 22px; }
.brand img { width: 118px; height: auto; display: block; }
[data-theme="light"] .brand img, [data-theme="light"] .mobile-top img { filter: invert(1); }
.brand small {
  align-self: flex-start; font: 500 11px/1 var(--label); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-2);
  border: 1px solid var(--accent-line); border-radius: 999px; padding: 4px 9px 3px;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 999px;
  text-decoration: none; color: var(--text-2); font-weight: 600; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--accent-soft); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent-line); }
.nav a.on .ic { color: var(--accent-2); }
.nav a .ic { width: 18px; height: 18px; flex: none; }
.nav a .count {
  margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: var(--accent); color: #fff;
}
.side .spacer { flex: 1; }
.me {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font: 600 13px/1 var(--head); letter-spacing: .04em;
  background: var(--accent); color: #fff;
}
.me .who { min-width: 0; }
.me .who b { display: block; font-size: 13px; }
.me .who span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  margin-left: auto; width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; border: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { border-color: var(--accent); color: var(--text); }
.icon-btn .ic { width: 16px; height: 16px; }

/* ---------- Área principal ---------- */
.main { min-width: 0; min-height: 0; overflow-y: auto; scroll-behavior: smooth; }
.page { max-width: 1120px; margin: 0 auto; padding: 34px 40px 80px; }
.page.narrow { max-width: 860px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.head .t { min-width: 0; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; text-decoration: none; margin-bottom: 10px; }
.crumb:hover { color: var(--text); }
.crumb .ic { width: 14px; height: 14px; }
h1, h2 { font-family: var(--head); font-weight: 600; margin: 0; text-wrap: balance; }
h1 { font-size: 46px; line-height: 1.02; letter-spacing: -0.04em; }
h2 { font-size: 24px; line-height: 1.1; letter-spacing: -0.025em; }
h1 em, h2 em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; color: var(--accent-2); }
h3 {
  margin: 0; font: 500 12.5px/1.2 var(--label); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-2);
  display: inline-flex; align-items: center; gap: 10px;
}
h3::before { content: ""; width: 16px; height: 1px; background: currentColor; opacity: .7; }
.lead { color: var(--text-2); margin: 12px 0 0; max-width: 58ch; font-size: 16.5px; text-wrap: pretty; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Botões em pílula */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: transform .25s var(--ease), background-color .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
  background: rgba(255, 255, 255, 0.02);
}
.btn:hover { border-color: rgba(77, 163, 255, 0.45); background: rgba(0, 85, 255, 0.08); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 10px 34px -12px var(--glow); }
.btn.primary:hover { background: var(--accent-md); border-color: var(--accent-md); box-shadow: 0 14px 40px -12px var(--glow); }
.btn.wa { background: var(--wa); border-color: var(--wa); color: var(--wa-ink); box-shadow: 0 10px 34px -12px rgba(37, 211, 102, .5); }
.btn.wa:hover { background: #2EE06F; border-color: #2EE06F; }
.btn .arr { transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn.white { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn.ghost { border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { color: var(--text); background: var(--accent-soft); }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px -50px rgba(0, 0, 0, .8);
}
.card.pad { padding: 22px 24px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

/* Métricas do topo */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat { padding: 18px 20px; }
.stat .k { font: 500 11.5px/1.2 var(--label); color: var(--muted); text-transform: uppercase; letter-spacing: .16em; }
.stat .v { font: 600 36px/1.05 var(--head); letter-spacing: -0.04em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: inherit; }
.bar.warn i { background: var(--warn); }

/* Lista de agentes */
.agents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.agent {
  padding: 22px; display: flex; flex-direction: column; gap: 14px; cursor: pointer; text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.agent { transition: border-color .25s var(--ease), transform .35s var(--ease), box-shadow .35s var(--ease); }
.agent:hover { border-color: var(--accent-line); transform: translateY(-3px); box-shadow: 0 30px 70px -40px var(--glow); }
.agent-top { display: flex; align-items: center; gap: 12px; }
.agent-mark {
  width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center;
  font: 400 italic 26px/1 var(--serif); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.agent-top .n { min-width: 0; }
.agent-top .n b { display: block; font: 600 22px/1.1 var(--head); letter-spacing: -0.025em; }
.agent-top .n span { color: var(--muted); font-size: 13px; }
.agent p { margin: 0; color: var(--text-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.agent .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.agent .row b { color: var(--text); font: 500 13px var(--mono); }
.agent.new {
  border-style: dashed; align-items: center; justify-content: center; text-align: center; min-height: 250px;
  color: var(--text-2);
}
.agent.new .plus { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.agent.new .plus .ic { width: 22px; height: 22px; }

/* Selos de status */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font: 500 11.5px/1.2 var(--mono); white-space: nowrap; border: 1px solid transparent;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(63, 207, 142, .22); }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(242, 179, 61, .25); }
.pill.off { background: rgba(255,255,255,.04); color: var(--muted); border-color: var(--line-2); }
.pill.accent { background: var(--accent-soft); color: var(--accent-2); border-color: var(--accent-line); }
.pill.plain::before { display: none; }

/* Detalhe do agente */
.agent-hero { display: flex; align-items: center; gap: 18px; }
.agent-hero .agent-mark { width: 64px; height: 64px; border-radius: 18px; font-size: 36px; }
.hero-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; color: var(--muted); font-size: 14px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.notice {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid rgba(242, 179, 61, 0.35); background: var(--warn-soft); color: var(--text); margin-bottom: 20px;
}
.notice .ic { width: 20px; height: 20px; color: var(--warn); flex: none; margin-top: 2px; }
.notice.info { border-color: var(--accent-line); background: var(--accent-soft); }
.notice.info .ic { color: var(--accent-2); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.sec-edit { opacity: .85; }
.sec p { margin: 0; color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--text-2); background: transparent;
}
button.chip { cursor: pointer; }
button.chip:hover, .chip.on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.rules { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.rules li { display: flex; gap: 14px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.rules .tag {
  flex: none; font: 500 10.5px/1 var(--label); letter-spacing: .14em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 6px; margin-top: 1px; width: 62px; text-align: center;
}
.rules .tag.sempre { background: var(--ok-soft); color: var(--ok); }
.rules .tag.nunca { background: rgba(255, 107, 107, .12); color: var(--bad); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text-2); }
.facts { display: flex; flex-direction: column; }
.facts div { padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.facts div:first-child { border-top: 0; padding-top: 0; }
.facts b { display: block; font-weight: 600; margin-bottom: 2px; }
.facts span { color: var(--text-2); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; align-items: start; }
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 6px; }
.timeline .dot.o { background: var(--muted); }
.timeline .w { color: var(--muted); font-size: 12px; display: block; }
.timeline li.fresh { animation: fresh 1.6s ease-out; }
@keyframes fresh { from { background: var(--accent-soft); } to { background: transparent; } }
.mini-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-metrics div { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.mini-metrics b { display: block; font: 600 26px/1.1 var(--head); letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.mini-metrics span { font-size: 12px; color: var(--muted); }

/* ---------- Chat com o assistente ---------- */
.chat-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; height: calc(100cqh - 34px - 40px - 110px); min-height: 460px; }
.chat { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.chat-h .avatar { background: var(--accent); color: #fff; font: 400 italic 20px/1 var(--serif); }
.chat-h b { display: block; font-size: 14px; }
.chat-h span { font-size: 12px; color: var(--ok); }
.chat-h select {
  margin-left: auto; height: 34px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card-solid);
  padding: 0 12px; font-size: 13px; font-weight: 600;
}
.msgs { flex: 1; overflow-y: auto; padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.m { max-width: 78%; padding: 13px 16px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; flex: none; }
.m.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; box-shadow: 0 10px 30px -16px var(--glow); }
.m.bot { align-self: flex-start; background: var(--bubble-c); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.m p { margin: 0 0 6px; }
.m p:last-child { margin: 0; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.proposal { margin-top: 10px; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--card-solid); }
.proposal .ph { padding: 10px 14px; font: 500 11.5px/1.2 var(--label); letter-spacing: .16em; text-transform: uppercase; color: var(--accent-2); border-bottom: 1px solid var(--line); }
.diff { display: grid; grid-template-columns: 1fr 1fr; }
.diff > div { padding: 12px 14px; font-size: 13.5px; }
.diff > div + div { border-left: 1px solid var(--line); }
.diff .lb { display: block; font: 500 11px/1 var(--label); letter-spacing: .16em; text-transform: uppercase; margin-bottom: 6px; }
.diff .old .lb { color: var(--muted); }
.diff .old span:not(.lb) { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255,107,107,.6); }
.diff .new .lb { color: var(--ok); }
.proposal .pa { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.steps { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.steps li .ic { width: 16px; height: 16px; }
.steps li.done { color: var(--text); }
.steps li.done .ic { color: var(--ok); }
.steps li.run .ic { color: var(--accent-2); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.compose { border-top: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.sugs { display: flex; gap: 8px; flex-wrap: wrap; }
.compose-row { display: flex; gap: 10px; align-items: flex-end; }
.compose textarea {
  flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: 11px 16px; border-radius: 22px;
  border: 1px solid var(--line-2); background: var(--card-solid); outline: none; line-height: 1.45;
}
.compose textarea:focus { border-color: var(--accent); }
.send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.send .ic { width: 18px; height: 18px; }
.chat-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; }
.chat-side ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Conversas ---------- */
.convs { display: grid; grid-template-columns: 360px minmax(0, 1fr); height: calc(100cqh - 34px - 40px - 110px); min-height: 460px; overflow: hidden; }
.conv-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.conv-filter { padding: 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card-solid); }
.search .ic { width: 16px; height: 16px; color: var(--muted); }
.search input { border: 0; background: transparent; outline: none; flex: 1; min-width: 0; }
.conv-items { overflow-y: auto; flex: 1; min-height: 0; }
.ci { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; text-decoration: none; }
.ci:hover { background: var(--accent-soft); }
.ci.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.ci .l1 { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.ci .l1 b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci .l1 span { color: var(--muted); font-size: 12px; flex: none; }
.ci .l2 { color: var(--text-2); font-size: 13px; margin: 3px 0 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci .l3 { display: flex; gap: 6px; align-items: center; }
.thread { display: flex; flex-direction: column; min-height: 0; }
.thread-h { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.thread-h > div { min-width: 0; }
.thread-h b { display: block; }
.thread-h span { color: var(--muted); font-size: 12.5px; }
.wa { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 8px; min-height: 0;
  background: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0) 0 0 / 18px 18px; }
[data-theme="light"] .wa { background: radial-gradient(circle at 1px 1px, rgba(0,0,0,0.05) 1px, transparent 0) 0 0 / 18px 18px; }
.wm { max-width: 72%; padding: 8px 12px 6px; border-radius: 12px; font-size: 14px; flex: none; }
.wm small { display: block; text-align: right; font-size: 11px; color: var(--muted); margin-top: 2px; }
.wm.c { align-self: flex-start; background: var(--bubble-c); border: 1px solid var(--line); }
.wm.a, .wm.h { align-self: flex-end; background: var(--bubble-a); }
.wm .who { display: block; font: 500 10.5px/1.3 var(--label); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 3px; }
.wm.h .who { color: var(--ok); }
.wsys { align-self: center; font-size: 12px; color: var(--muted); padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card-solid); }
.readonly { padding: 12px 20px; flex-wrap: wrap; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.readonly .ic { width: 15px; height: 15px; }
.empty { display: grid; place-items: center; text-align: center; color: var(--muted); padding: 40px; height: 100%; }

/* ---------- Conta ---------- */
.conn { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.conn:first-of-type { border-top: 0; }
.logo-box { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font: 700 14px/1 var(--head); flex: none; color: #fff; }
.conn .x { min-width: 0; flex: 1; }
.conn .pill { flex: none; }
.conn .x b { display: block; font-size: 14px; }
.conn .x span { color: var(--muted); font-size: 13px; }
.code {
  font: 400 12.5px/1.55 var(--mono); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; color: var(--text-2); overflow-x: auto; white-space: pre; margin: 10px 0 0;
}
.cost { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.cost:first-of-type { border-top: 0; }
.cost span { color: var(--muted); font-size: 12.5px; display: block; }
.cost b { white-space: nowrap; }

/* ---------- Novo agente ---------- */
.wizard-steps { display: flex; gap: 8px; margin-bottom: 26px; flex-wrap: wrap; }
.ws { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.ws i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; background: var(--line); color: var(--text-2); }
.ws.on { border-color: var(--accent); color: var(--text); }
.ws.on i { background: var(--accent); color: #fff; }
.ws i { font-family: var(--mono); }
.ws.done i { background: var(--ok); color: #05150d; }
.models { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.model { padding: 20px; cursor: pointer; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: 8px; }
.model:hover { border-color: var(--line-2); }
.model.on { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft), 0 24px 60px -40px var(--glow); }
.model b { font: 600 19px/1.15 var(--head); letter-spacing: -0.025em; }
.model p { margin: 0; color: var(--text-2); font-size: 14px; }
.model span { color: var(--muted); font-size: 12.5px; margin-top: auto; }
.form { display: flex; flex-direction: column; gap: 18px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.field .hint { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line-2); background: var(--card-solid); border-radius: 12px; padding: 11px 14px; outline: none;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choice { display: flex; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; align-items: flex-start; background: var(--card); }
.choice.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice .radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; margin-top: 3px; }
.choice.on .radio { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 45%, transparent 50%); }
.choice b { display: block; font-size: 14.5px; }
.choice span { color: var(--text-2); font-size: 13.5px; }
.wizard-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 26px; }
.review { display: grid; grid-template-columns: 160px 1fr; gap: 10px 18px; font-size: 14px; }
.review dt { color: var(--muted); }
.review dd { margin: 0; }
.build { display: flex; flex-direction: column; gap: 10px; }
.build li { font-size: 15px; }

/* ---------- Modal / toast ---------- */
.overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { width: min(460px, 100%); padding: 26px; }
.modal h2 { margin-bottom: 8px; }
.modal p { color: var(--text-2); margin: 0 0 18px; }
.modal .acts { display: flex; justify-content: flex-end; gap: 10px; }
.qr { width: 168px; height: 168px; border-radius: 14px; background: #fff; padding: 12px; margin: 4px auto 18px; display: block; }
.toast {
  position: absolute; left: 50%; top: 22px; transform: translateX(-50%); z-index: 60; box-shadow: 0 18px 50px -20px rgba(0,0,0,.7);
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 8px; animation: toastIn .25s ease-out;
}
.toast .ic { width: 16px; height: 16px; color: #1EB257; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.ic { display: inline-block; vertical-align: middle; }

/* Barra inferior (celular) */
.tabbar { display: none; }

/* ---------- Responsivo (container queries) ---------- */
@container app (max-width: 1180px) {
  .agents, .models { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-wrap { grid-template-columns: minmax(0, 1fr); }
  .chat-side { display: none; }
}
@container app (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .convs { grid-template-columns: 300px minmax(0, 1fr); }
}
@container app (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .side { display: none; }
  .page { padding: 20px 18px 40px; }
  h1 { font-size: 30px; }
  .agents, .models { grid-template-columns: minmax(0, 1fr); }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat .v { font-size: 26px; }
  .row2, .diff { grid-template-columns: 1fr; }
  .diff > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .chat-wrap, .convs { height: calc(100cqh - 20px - 40px - 64px - 96px); }
  .convs { grid-template-columns: 1fr; }
  .convs.has-thread .conv-list { display: none; }
  .convs:not(.has-thread) .thread { display: none; }
  .m { max-width: 90%; }
  .wm { max-width: 86%; }
  .review { grid-template-columns: 1fr; gap: 2px; }
  .review dd { margin-bottom: 10px; }
  .mobile-top { display: flex !important; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line);
    background: rgba(5,5,5,.9); backdrop-filter: blur(14px); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  [data-theme="light"] .tabbar { background: rgba(255,255,255,.92); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 6px 0; }
  .tabbar a .ic { width: 20px; height: 20px; }
  .tabbar a.on { color: var(--text); }
  .tabbar a.on .ic { color: var(--accent-2); }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 auto; }
}
.mobile-top { display: none; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.mobile-top img { width: 104px; }
[data-theme="light"] .mobile-top img { filter: invert(1); }

/* ---------- Login ---------- */
.login { height: 100%; display: grid; place-items: center; padding: 24px; overflow-y: auto; }
.login-card { width: min(440px, 100%); padding: 36px 34px; }
.login-logo { width: 132px; display: inline-block; vertical-align: middle; }
[data-theme="light"] .login-logo { filter: invert(1); }
.login-tag { display: inline-block; vertical-align: middle; margin-left: 10px; font: 500 11px/1 var(--label); letter-spacing: .18em; text-transform: uppercase; color: var(--accent-2); border: 1px solid var(--accent-line); border-radius: 999px; padding: 4px 9px 3px; }
.login h1 { font-size: 38px; }
.or { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.btn.white { background: #fff; border-color: #fff; color: #05060B; }
.btn.white:hover { background: #E6E9F0; border-color: #E6E9F0; }

/* ---------- Avisos ---------- */
.evs { display: flex; flex-direction: column; margin-top: 6px; }
.ev { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.ev .x { flex: 1; min-width: 0; }
.ev .x b { display: block; font-size: 14px; }
.ev .x span { color: var(--muted); font-size: 13px; }
.tgls { display: flex; gap: 6px; flex: none; }
.tgl { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.tgl.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.tgl.on::before { content: "✓ "; color: var(--accent-2); }
.tgl[disabled] { opacity: .35; cursor: not-allowed; }
.conn .btn { flex: none; }
@container app (max-width: 760px) {
  .ev { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ---------- Primeiros passos ---------- */
.onb-progress { min-width: 180px; }
.onb-progress b { font: 600 28px/1 var(--head); letter-spacing: -0.03em; margin-right: 6px; }
.onb-progress span { color: var(--muted); font-size: 13px; }
.onb-h { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.onb-n { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font: 500 15px/1 var(--mono); background: var(--accent-soft); color: var(--accent-2); box-shadow: inset 0 0 0 1px var(--accent-line); }
.onb.done .onb-n { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1px rgba(63,207,142,.3); }
.onb-n .ic { width: 18px; height: 18px; }
.onb-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.tut { width: 100%; aspect-ratio: 16 / 10; border-radius: 14px; background: #000; border: 1px solid var(--line-2); display: block; }
.onb-side { display: flex; flex-direction: column; align-items: flex-start; }
.onb-side .field { width: 100%; }
.onb-list { margin: 0 0 16px; padding-left: 20px; color: var(--text-2); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.onb-list li::marker { color: var(--accent-2); font-family: var(--mono); }
.prompt-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.code.prompt { white-space: pre-wrap; font-size: 12.5px; }
.spin { animation: spin 1s linear infinite; }
@container app (max-width: 980px) { .onb-body { grid-template-columns: minmax(0, 1fr); } }

.demo { font: 400 10.5px/1.3 var(--mono); color: var(--muted); letter-spacing: .02em; }
.brand .demo { margin-top: 2px; }
