/* ══════════════════════════════════════════════════════════════
   LIAverso — design system (compartilhado por index.html e login.html)
   Visual de sistema com energia: moldura navy com aurora, painel claro,
   cartões suaves e as cores da paleta em gradientes e brilhos.
══════════════════════════════════════════════════════════════ */
:root {
  /* paleta (inalterada) */
  --teal:        #35f7ba;
  --teal-mid:    #0db88a;
  --teal-dark:   #0a8f6e;
  --teal-light:  #d0fbf2;
  --teal-bg:     #effffa;
  --teal-border: #a3f5e0;
  --lime:        #87ff21;
  --orange:      #ff9f48;
  --red:         #ff4c54;
  --yellow:      #ffe246;
  --purple:      #8b5cf6;

  --navy:        #0c1022;
  --navy-2:      #151e33;
  --navy-3:      #1e2a42;

  --bg:          #f3f4f6;
  --card:        #ffffff;
  --border:      #e5e7eb;
  --text1:       #111827;
  --text2:       #6b7280;

  /* derivados */
  --ink:         var(--text1);
  --line-2:      #eef0f3;
  --subtle:      #f8f9fb;
  --ac:          var(--teal-mid);         /* cor do agente em contexto */
  --danger:      #c2202b;
  --shadow-xs:   0 1px 2px rgba(12,16,34,.04), 0 10px 24px -16px rgba(12,16,34,.14);
  --shadow-sm:   0 1px 2px rgba(12,16,34,.05), 0 2px 6px rgba(12,16,34,.04);
  --shadow-md:   0 4px 14px rgba(12,16,34,.07), 0 1px 3px rgba(12,16,34,.05);
  --shadow-lg:   0 24px 60px -12px rgba(12,16,34,.22), 0 4px 14px rgba(12,16,34,.06);
  --focus:       0 0 0 3px rgba(13,184,138,.18);
  --r:           18px;
  --r-sm:        10px;

  --grad-brand:  linear-gradient(135deg, var(--teal) 0%, var(--teal-mid) 100%);
  --grad-text:   linear-gradient(90deg, var(--teal) 0%, var(--lime) 100%);
  --glow:        0 10px 28px -8px rgba(13,184,138,.55);
  --aurora:      radial-gradient(620px 420px at 0% 0%, rgba(53,247,186,.30), transparent 62%),
                 radial-gradient(520px 420px at 100% 8%, rgba(139,92,246,.30), transparent 62%),
                 radial-gradient(560px 460px at 78% 100%, rgba(255,76,84,.20), transparent 62%),
                 radial-gradient(420px 360px at 12% 100%, rgba(135,255,33,.12), transparent 62%);

  --f-display:   'Bricolage Grotesque', 'Geist', system-ui, sans-serif;
  --f-body:      'Geist', 'Segoe UI', system-ui, sans-serif;
  --f-mono:      'Geist Mono', ui-monospace, Menlo, monospace;
}

[x-cloak] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text1);
  background: var(--aurora), var(--navy);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--teal-light); }
:focus-visible { outline: 2px solid var(--teal-mid); outline-offset: 2px; border-radius: 6px; }
button { font-family: inherit; cursor: pointer; color: inherit; }
img { display: block; }

.ic { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor;
      stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 14px; height: 14px; }
.ic-lg { width: 20px; height: 20px; }

.thin-scroll { scrollbar-width: thin; scrollbar-color: #d5d9df transparent; }
.thin-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.thin-scroll::-webkit-scrollbar-thumb { background: #d5d9df; border-radius: 6px; }

/* ── Tipografia ─────────────────────────────── */
.display { font-family: var(--f-display); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.h-page { font-family: var(--f-display); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-size: 30px; color: var(--text1); margin: 0; }
.h-card { font-weight: 600; letter-spacing: -.012em; font-size: 15.5px; line-height: 1.35; color: var(--text1); margin: 0; }
.eyebrow { font-size: 12.5px; font-weight: 500; color: var(--text2); display: inline-flex; align-items: center; gap: 6px; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--text2); }
.lede { color: var(--text2); font-size: 14px; line-height: 1.5; max-width: 62ch; margin: 4px 0 0; }
.num { font-variant-numeric: tabular-nums; }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── Botões ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px;
  font-family: var(--f-body); font-size: 13.5px; font-weight: 500; white-space: nowrap;
  color: var(--text1); background: #fff;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  box-shadow: var(--shadow-xs);
  transition: background .12s, border-color .12s, box-shadow .16s, color .12s, transform .16s, filter .16s;
  text-decoration: none;
}
.btn:hover  { background: var(--subtle); border-color: #d6dae0; }
.btn:active { box-shadow: none; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { color: var(--navy); background: var(--grad-brand); border-color: transparent; font-weight: 600; box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.45); }
.btn-primary:hover { background: var(--grad-brand); border-color: transparent; filter: saturate(1.15) brightness(1.04); transform: translateY(-1px); box-shadow: 0 14px 32px -8px rgba(13,184,138,.7), inset 0 1px 0 rgba(255,255,255,.45); }
.btn-ink     { color: #fff; background: var(--navy); border-color: var(--navy); font-weight: 600; }
.btn-ink:hover { background: var(--navy-3); border-color: var(--navy-3); }
.btn-agent { color: var(--navy); background: linear-gradient(135deg, color-mix(in srgb, var(--ac) 62%, #fff), var(--ac)); border-color: transparent; font-weight: 600; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--ac) 80%, transparent), inset 0 1px 0 rgba(255,255,255,.4); }
.btn-agent:hover { background: linear-gradient(135deg, color-mix(in srgb, var(--ac) 62%, #fff), var(--ac)); border-color: transparent; filter: saturate(1.15) brightness(1.04); transform: translateY(-1px); }
.btn-danger  { color: var(--danger); }
.btn-danger:hover { background: #fff5f5; border-color: #f6c6c9; }
.btn-quiet   { box-shadow: none; border-color: transparent; background: transparent; color: var(--text2); }
.btn-quiet:hover { background: var(--bg); border-color: transparent; color: var(--text1); }
.btn-sm  { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-lg  { height: 44px; padding: 0 20px; font-size: 14.5px; border-radius: 11px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; font-weight: 600; font-size: 13px; color: var(--teal-dark); display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn.danger { color: var(--danger); }

.kbd { font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; padding: 2px 6px; border-radius: 6px;
       border: 1px solid var(--border); background: #fff; color: var(--text2); line-height: 1.35; box-shadow: var(--shadow-xs); }

/* ── Superfícies ────────────────────────────── */
.card, .card-soft { background: var(--card); border: 1px solid rgba(12,16,34,.07); border-radius: var(--r); box-shadow: var(--shadow-xs); }
.card.selected { border-color: color-mix(in srgb, var(--ac) 70%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ac) 22%, transparent), 0 14px 30px -16px color-mix(in srgb, var(--ac) 80%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--ac) 14%, #fff), #fff 70%); }
.lift { transition: box-shadow .16s, border-color .16s, transform .16s; cursor: pointer; }
.lift:hover { box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--ac) 70%, rgba(12,16,34,.3)); border-color: color-mix(in srgb, var(--ac) 45%, #fff); transform: translateY(-3px); }
.rule, .rule-soft { border: 0; border-top: 1px solid var(--line-2); margin: 0; }
.card-dark { background: var(--aurora), var(--navy); border-color: rgba(255,255,255,.08); color: #fff; position: relative; overflow: hidden; }
.card-dark .h-card { color: #fff; } .card-dark .muted, .card-dark .lede { color: rgba(255,255,255,.66); }
.card-dark .score-ring .track { stroke: rgba(255,255,255,.14); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 14px; }

/* ── Tags / chips ───────────────────────────── */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; line-height: 1; padding: 5px 9px; border-radius: 999px; color: #374151; background: var(--bg); border: 1px solid transparent; white-space: nowrap; }
button.tag:hover { filter: brightness(.97); }
.tag-fill { background: color-mix(in srgb, var(--ac) 26%, #fff); color: var(--navy); }
.tag-ink    { background: var(--navy); color: #fff; }
.tag-ghost, .tag-idle { background: var(--bg); color: var(--text2); }
.tag-ok { background: var(--teal-light); color: #06664f; }
.tag-warn { background: color-mix(in srgb, var(--yellow) 55%, #fff); color: #6b4e00; }
.tag-risk { background: color-mix(in srgb, var(--orange) 38%, #fff); color: #8a3d05; }
.tag-crit { background: var(--red); color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ac); flex-shrink: 0; display: inline-block; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ac) 25%, transparent); }
.sticker { display: inline-flex; font-size: 11.5px; font-weight: 500; padding: 4px 9px; border-radius: 999px;
           background: rgba(255,255,255,.92); color: var(--text1); border: 1px solid rgba(12,16,34,.06);
           box-shadow: var(--shadow-xs); white-space: nowrap; backdrop-filter: blur(4px); }

/* ── Avatar de agente ───────────────────────── */
.avatar {
  --s: 36px;
  width: var(--s); height: var(--s); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: calc(var(--s) * .28);
  background: linear-gradient(135deg, color-mix(in srgb, var(--ac) 45%, #fff), var(--ac));
  overflow: hidden; font-size: calc(var(--s) * .5); line-height: 1;
  font-weight: 600; color: var(--text1);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.av-xs { --s: 22px; } .av-sm { --s: 28px; } .av-lg { --s: 48px; } .av-xl { --s: 72px; } .av-2xl { --s: 96px; }
.avatar.is-user { background: var(--grad-brand); color: var(--navy); font-size: calc(var(--s) * .36); letter-spacing: .01em; }
.av-stack { display: inline-flex; }
.av-stack .avatar { border: 2px solid #fff; border-radius: 10px; margin-left: -8px; }
.av-stack .avatar:first-child { margin-left: 0; }
.icon-chip { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: linear-gradient(135deg, color-mix(in srgb, var(--ac) 60%, #fff), var(--ac)); color: var(--navy); box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--ac) 85%, transparent); }

/* ── Formulários ────────────────────────────── */
.label { display: block; font-size: 12.5px; font-weight: 500; color: #374151; margin-bottom: 6px; }
.field {
  width: 100%; height: 40px; padding: 0 12px;
  font-family: inherit; font-size: 14px; color: var(--text1);
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-sm);
  outline: none; box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s;
}
textarea.field { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.field::placeholder { color: #9ca3af; }
.field:hover { border-color: #d6dae0; }
.field:focus { border-color: var(--teal-mid); box-shadow: var(--focus); }
.field.error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,76,84,.14); }
select.field { appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 15px; }
.field-sm { height: 34px; font-size: 13.5px; }
.help { font-size: 12.5px; color: var(--text2); margin-top: 6px; line-height: 1.45; }
.err  { font-size: 12.5px; color: var(--danger); font-weight: 500; margin-top: 5px; }
.alert-box { padding: 10px 12px; border: 1px solid #ffd5d7; border-radius: 10px; background: #fff7f7; margin: 0; }

.searchbox { position: relative; }
.searchbox .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #9ca3af; pointer-events: none; }
.searchbox .field { padding-left: 33px; }

.toggle { width: 38px; height: 22px; border-radius: 999px; border: 0; background: #d5d9df;
          position: relative; flex-shrink: 0; padding: 0; transition: background .18s; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
                 background: #fff; box-shadow: 0 1px 3px rgba(12,16,34,.25); transition: transform .18s; }
.toggle.on { background: var(--grad-brand); box-shadow: 0 4px 12px -4px rgba(13,184,138,.7); }
.toggle.on::after { transform: translateX(16px); }

/* segmented control */
.seg { display: inline-flex; padding: 4px; gap: 2px; background: rgba(12,16,34,.06); border-radius: 12px; max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 8px;
              font-size: 13px; font-weight: 500; color: var(--text2); white-space: nowrap;
              display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .12s, color .12s; }
.seg button:hover { color: var(--text1); }
.seg button.on { background: var(--navy); color: #fff; box-shadow: 0 6px 14px -6px rgba(12,16,34,.5); }
.seg .count { font-size: 11.5px; opacity: .6; font-variant-numeric: tabular-nums; }

.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 30px 20px; border: 2px dashed color-mix(in srgb, var(--teal-mid) 50%, #fff); border-radius: var(--r); cursor: pointer; background: linear-gradient(150deg, var(--teal-bg), #fff 60%, color-mix(in srgb, var(--purple) 8%, #fff)); color: var(--text2); transition: background .15s, border-color .15s, transform .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--teal-mid); color: var(--teal-dark); transform: scale(1.005); box-shadow: 0 20px 40px -24px rgba(13,184,138,.7); }
.dropzone-sm { padding: 12px; flex-direction: row; }

/* ── Shell: sidebar + painel ────────────────── */
.side { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 248px; display: flex; flex-direction: column; background: transparent; color: #fff; transition: transform .26s cubic-bezier(.2,.8,.2,1); }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; color: var(--navy); background: var(--grad-brand); box-shadow: 0 0 0 1px rgba(255,255,255,.25) inset, 0 8px 22px -6px rgba(53,247,186,.8); font-family: var(--f-display); font-weight: 800; font-size: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-name { font-family: var(--f-display); font-weight: 700; font-size: 20px; letter-spacing: -.03em; line-height: 1; color: #fff; }
.side-label { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.36); padding: 0 10px; margin: 20px 0 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 10px; border-radius: 9px; border: 1px solid transparent; background: transparent;
  font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,.66); text-align: left; position: relative;
  transition: background .12s, color .12s;
}
.nav-item .ic { color: rgba(255,255,255,.45); transition: color .12s; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(53,247,186,.24), rgba(53,247,186,.05)); color: #fff; border-color: rgba(53,247,186,.32); box-shadow: 0 8px 24px -12px rgba(53,247,186,.7); font-weight: 600; }
.nav-item.active .ic { color: var(--teal); }
.nav-badge { margin-left: auto; font-size: 11px; font-weight: 700; min-width: 19px; height: 19px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--red); color: #fff; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 3px rgba(255,76,84,.25); }
.nav-hint { margin-left: auto; font-size: 10px; color: rgba(255,255,255,.4); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.roster-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 5px 10px; border: 0; background: transparent; border-radius: 9px; color: rgba(255,255,255,.66); font-size: 13px; font-weight: 500; text-align: left; transition: background .12s; }
.roster-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.roster-item.active { background: rgba(255,255,255,.1); color: #fff; }
.roster-item .live { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgba(135,255,33,.2), 0 0 10px var(--lime); }
.side-search { white-space: nowrap; display: flex; align-items: center; gap: 8px; width: 100%; height: 38px; padding: 0 8px 0 11px; margin-top: 4px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 11px; color: rgba(255,255,255,.55); font-size: 13px; text-align: left; backdrop-filter: blur(8px); transition: border-color .12s, background .12s; }
.side-search .kbd { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); color: rgba(255,255,255,.7); box-shadow: none; }
.side-search:hover { border-color: rgba(53,247,186,.5); background: rgba(255,255,255,.1); color: #fff; }
.user-card .tool-btn { color: rgba(255,255,255,.6); } .user-card .tool-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.user-card { display: flex; align-items: center; gap: 4px; padding: 4px; margin: 8px 12px 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; backdrop-filter: blur(8px); }

.main { min-height: 100dvh; display: flex; flex-direction: column; background: radial-gradient(900px 380px at 8% -8%, rgba(53,247,186,.22), transparent 60%), radial-gradient(760px 360px at 100% -6%, rgba(139,92,246,.16), transparent 60%), #f5f7fb; }
@media (min-width: 1024px) {
  .main { margin: 10px 10px 10px 248px; min-height: calc(100dvh - 20px); border-radius: 24px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); }
  .topbar { border-radius: 24px 24px 0 0; }
}
@media (max-width: 1023px) {
  .side { transform: translateX(-100%); width: 272px; background: var(--aurora), var(--navy); }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(12,16,34,.4); }
}

.topbar {
  position: sticky; top: 0; z-index: 30; height: 56px; flex-shrink: 0;
  display: flex; align-items: center; gap: 8px; padding: 0 14px;
  background: rgba(245,247,251,.72); backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(12,16,34,.06);
}
@media (min-width: 1024px) { .topbar { padding: 0 24px; } }
.crumb { font-family: var(--f-display); font-size: 17px; font-weight: 700; letter-spacing: -.02em; color: var(--text1); white-space: nowrap; margin: 0; }
.page { padding: 20px 14px 48px; }
@media (min-width: 1024px) { .page { padding: 24px 24px 56px; } }
.wrap { max-width: 1240px; margin: 0 auto; }
.main .grid > * { min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }

/* ── Animações (discretas) ──────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .28s ease-out both; }
@keyframes drift { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(24px,-18px) scale(1.12); } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes sheen { to { background-position: 200% 0; } }
.stagger > * { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.stagger > *:nth-child(2) { animation-delay: .06s; } .stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .18s; } .stagger > *:nth-child(5) { animation-delay: .24s; } .stagger > *:nth-child(n+6) { animation-delay: .3s; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
.pop { animation: pop .18s ease-out both; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; }
@keyframes bob { 0%,80%,100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-3px); opacity: 1; } }
.typing i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--ac) 75%, #111827);
            animation: bob 1.1s infinite ease-in-out both; }
.typing i:nth-child(2) { animation-delay: .14s; } .typing i:nth-child(3) { animation-delay: .28s; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.6); opacity: .4; } }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: pulse 1s infinite ease-in-out; flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── Início ─────────────────────────────────── */
.hero-card { position: relative; overflow: hidden; border-radius: 26px; background: var(--navy); color: #fff; padding: 28px 22px; isolation: isolate;
             box-shadow: 0 30px 60px -28px rgba(12,16,34,.7); }
@media (min-width: 1024px) { .hero-card { padding: 40px 44px; } }
.hero-card .blob { position: absolute; z-index: -1; border-radius: 50%; filter: blur(60px); opacity: .75; animation: drift 14s ease-in-out infinite; }
.hero-card .grid-bg { position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
                      background-size: 36px 36px; mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 72%); }
.hero-card h2 { font-family: var(--f-display); font-weight: 700; letter-spacing: -.035em; line-height: 1.02; font-size: clamp(2rem, 4.4vw, 3.5rem); margin: 0; }
.glass-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,.86);
              background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(8px); }
.orbit { position: relative; width: 300px; height: 250px; }
.orbit .avatar { position: absolute; --s: 76px; border-radius: 24px; border: 2px solid rgba(255,255,255,.9); animation: floaty 6s ease-in-out infinite;
                 box-shadow: 0 18px 40px -10px color-mix(in srgb, var(--ac) 90%, transparent); cursor: pointer; transition: scale .2s; padding: 0; }
.orbit .avatar:hover { scale: 1.1; z-index: 3; }
.askbox { display: flex; align-items: flex-end; gap: 8px; padding: 7px; background: #fff; border: 2px solid transparent; border-radius: 18px; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(90deg, var(--teal), var(--lime), var(--purple), var(--red), var(--teal)) border-box; background-size: 100% 100%, 200% 100%; animation: sheen 6s linear infinite; box-shadow: 0 20px 50px -18px rgba(53,247,186,.55); transition: box-shadow .2s, transform .2s; }
.askbox:focus-within { box-shadow: 0 26px 60px -16px rgba(53,247,186,.8); transform: translateY(-1px); }
.askbox textarea { flex: 1; border: 0; outline: 0; resize: none; background: transparent; font-family: inherit; font-size: 16px;
                   color: var(--text1); padding: 10px 12px; line-height: 1.45; min-height: 40px; max-height: 140px; }
.askbox textarea::placeholder { color: #9ca3af; }
.prompt-chip { border: 1px solid var(--border); background: #fff; color: #374151; font-size: 13px; font-weight: 500; padding: 7px 12px; border-radius: 999px; transition: all .15s; text-align: left; box-shadow: var(--shadow-xs); }
.prompt-chip:hover { background: color-mix(in srgb, var(--ac) 16%, #fff); border-color: color-mix(in srgb, var(--ac) 55%, #fff); color: var(--navy); transform: translateY(-1px); }
.prompt-chip.glass { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: rgba(255,255,255,.9); box-shadow: none; backdrop-filter: blur(8px); }
.prompt-chip.glass:hover { background: var(--teal); border-color: var(--teal); color: var(--navy); }
.prompt-chip.block { border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.prompt-chip.block .ic { color: #9ca3af; }

/* cartão de indicador com barra segmentada */
.stat { padding: 18px; background: linear-gradient(150deg, color-mix(in srgb, var(--ac) 20%, #fff) 0%, #fff 62%); border-color: color-mix(in srgb, var(--ac) 26%, #fff); position: relative; overflow: hidden; }
.stat::after { content: ''; position: absolute; right: -40px; top: -40px; width: 130px; height: 130px; border-radius: 50%; background: var(--ac); opacity: .16; filter: blur(26px); pointer-events: none; }
.stat-top { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 500; color: var(--text1); }
.stat-n { font-family: var(--f-display); font-size: 40px; font-weight: 700; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text2); }
.ticks { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; height: 18px; }
.ticks i { border-radius: 3px; background: rgba(12,16,34,.07); }
.ticks i.on { background: linear-gradient(180deg, color-mix(in srgb, var(--ac) 70%, #fff), var(--ac)); }
.trend-up { color: var(--teal-dark); font-weight: 500; } .trend-down { color: var(--danger); font-weight: 500; }

.mini { border: 1px solid color-mix(in srgb, var(--ac) 30%, #fff); border-radius: 14px; padding: 12px 12px 12px 16px; position: relative; text-align: left; background: linear-gradient(150deg, color-mix(in srgb, var(--ac) 16%, #fff), #fff 75%); transition: transform .15s, box-shadow .15s; }
.mini::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--ac); }
.mini .n { font-family: var(--f-display); font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; display: block; }
button.mini:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -14px var(--ac); }

.agent-tile { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; min-height: 138px; padding: 12px; border: 0; border-radius: 18px; text-align: left; color: var(--navy);
              background: linear-gradient(150deg, color-mix(in srgb, var(--ac) 50%, #fff), var(--ac)); transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s; }
.agent-tile:hover { transform: translateY(-4px) scale(1.015); box-shadow: 0 22px 40px -18px var(--ac); }
.agent-tile .ph { position: absolute; inset: 0; }
.agent-tile .ph img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
.agent-tile .ph::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, var(--ac) 0%, color-mix(in srgb, var(--ac) 88%, transparent) 26%, transparent 52%); }
.agent-tile .emo { position: absolute; right: 8px; top: 2px; font-size: 54px; line-height: 1.2; filter: drop-shadow(0 8px 12px rgba(12,16,34,.2)); }
.agent-tile .nm { position: relative; font-family: var(--f-display); font-weight: 700; font-size: 17px; letter-spacing: -.02em; line-height: 1.1; }
.agent-tile .sb { position: relative; font-size: 11.5px; font-weight: 500; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.list-row + .list-row { border-top: 1px solid var(--line-2); }

.agent-card { overflow: hidden; display: flex; flex-direction: column; }
.agent-card .top { position: relative; height: 150px; background: linear-gradient(150deg, color-mix(in srgb, var(--ac) 45%, #fff), var(--ac)); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 64px; }
.agent-card .top img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.agent-card .top .sticker { position: absolute; left: 10px; bottom: 10px; }
.agent-card .name { font-family: var(--f-display); font-weight: 700; font-size: 19px; letter-spacing: -.025em; line-height: 1.2; display: flex; align-items: center; gap: 7px; margin: 0; }

.quick { display: flex; align-items: center; gap: 12px; padding: 14px; text-align: left; width: 100%; background: #fff; border: 1px solid rgba(12,16,34,.07); border-radius: var(--r); box-shadow: var(--shadow-xs); transition: border-color .16s, box-shadow .16s, transform .16s, background .16s; }
.quick:hover { border-color: color-mix(in srgb, var(--ac) 55%, #fff); background: color-mix(in srgb, var(--ac) 10%, #fff); box-shadow: 0 18px 34px -18px var(--ac); transform: translateY(-3px); }
.quick .glyph { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: linear-gradient(135deg, color-mix(in srgb, var(--ac) 55%, #fff), var(--ac)); color: var(--navy); box-shadow: 0 8px 18px -8px var(--ac); }

/* ── Anel de score ──────────────────────────── */
.score-ring { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring .track { fill: none; stroke: var(--bg); stroke-width: 3.4; }
.score-ring .val { fill: none; stroke-width: 3.6; stroke-linecap: round; transition: stroke-dasharray .9s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 3px currentColor); }
.score-ring .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* ── Linha do tempo (conformidade) ──────────── */
.tl { display: grid; grid-template-columns: repeat(13, minmax(58px, 1fr)); min-width: 780px; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.tl-col { border-left: 1px solid var(--line-2); padding: 0 4px 8px; min-height: 96px; display: flex; flex-direction: column; gap: 4px; }
.tl-col:first-child { border-left: 0; background: #fff8f8; }
.tl-col.now { background: linear-gradient(180deg, var(--teal-light), var(--teal-bg)); }
.tl-head { font-size: 11.5px; font-weight: 500; color: var(--text2); padding: 8px 2px 6px; text-align: center; text-transform: capitalize; margin: 0; }
.tl-col.now .tl-head { color: var(--teal-dark); font-weight: 600; }
.tl-pin { border: 0; border-radius: 7px; background: color-mix(in srgb, var(--pc) 42%, #fff); color: var(--navy); font-size: 11px; font-weight: 600; padding: 5px 7px; line-height: 1.2; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: inset 3px 0 0 var(--pc); transition: background .12s, transform .12s; }
.tl-pin:hover { background: color-mix(in srgb, var(--pc) 70%, #fff); transform: translateY(-1px); }

.row-item { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--r);
            box-shadow: var(--shadow-xs); position: relative; transition: box-shadow .15s, border-color .15s, transform .15s; }
.row-item::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--sc, transparent); box-shadow: 0 0 12px var(--sc, transparent); }
.row-item:hover { border-color: color-mix(in srgb, var(--sc, #9ca3af) 45%, #fff); box-shadow: 0 16px 30px -20px var(--sc, rgba(12,16,34,.4)); transform: translateY(-1px); }
.row-item.selected { border-color: color-mix(in srgb, var(--sc, var(--teal-mid)) 70%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc, var(--teal-mid)) 22%, transparent); }
.row-item.flash { animation: flash 1.5s ease-out; }
@keyframes flash { 0%,45% { box-shadow: 0 0 0 4px rgba(13,184,138,.28); border-color: var(--teal-mid); } 100% { box-shadow: var(--shadow-xs); } }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text2); }
.meta > span { display: inline-flex; align-items: center; gap: 5px; }

/* ── Gráficos ───────────────────────────────── */
.chart { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: #9ca3af; text-align: right;
           font-variant-numeric: tabular-nums; height: 214px; margin-top: -7px; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 200px; position: relative;
        background: repeating-linear-gradient(to top, var(--line-2) 0 1px, transparent 1px 25%); border-bottom: 1px solid var(--border); }
.bars .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; position: relative; padding: 0 5px; }
.bars .seg-out, .bars .seg-in { width: 100%; max-width: 44px; transition: height .5s cubic-bezier(.2,.8,.2,1), filter .12s; }
.bars .seg-out { background: linear-gradient(180deg, var(--purple), color-mix(in srgb, var(--purple) 70%, #fff)); border-radius: 6px 6px 0 0; }
.bars .seg-in { background: linear-gradient(180deg, var(--teal), var(--teal-mid)); }
.bars .col:hover .seg-in, .bars .col:hover .seg-out { filter: brightness(.93); }
.bars .tip { position: absolute; bottom: calc(var(--h) + 8px); left: 50%; transform: translateX(-50%); z-index: 2;
             background: var(--navy); color: #fff; font-size: 11.5px; line-height: 1.5; padding: 6px 9px; border-radius: 8px;
             white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .1s; box-shadow: var(--shadow-md); text-align: left; }
.bars .col:hover .tip { opacity: 1; }
.bars-x { display: flex; gap: 2px; margin-top: 6px; grid-column: 2; }
.bars-x span { flex: 1; text-align: center; font-size: 11.5px; color: var(--text2); }
.legend { display: inline-flex; align-items: center; gap: 14px; font-size: 12px; color: var(--text2); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.hbar-track { height: 8px; border-radius: 99px; background: rgba(12,16,34,.06); overflow: hidden; }
.hbar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--ac) 60%, #fff), var(--ac)); min-width: 4px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.kpi .v { font-family: var(--f-display); font-size: 36px; font-weight: 700; letter-spacing: -.04em; line-height: 1; color: var(--text1); font-variant-numeric: tabular-nums; }

/* ── Chat ───────────────────────────────────── */
.chat { display: grid; grid-template-columns: 1fr; height: calc(100dvh - 56px); min-height: 0; }
@media (min-width: 1024px) { .chat { height: calc(100dvh - 20px - 56px); border-radius: 0 0 24px 24px; overflow: hidden; } }
@media (min-width: 1200px) { .chat { grid-template-columns: 272px 1fr; } }
.chat-rail .side-label { color: #9ca3af; }
.chat-rail { display: none; flex-direction: column; border-right: 1px solid rgba(12,16,34,.06); min-height: 0; padding: 12px 8px; background: rgba(255,255,255,.6); }
@media (min-width: 1200px) { .chat-rail { display: flex; } }
.rail-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px; border: 1px solid transparent; border-radius: 11px;
             background: transparent; text-align: left; transition: background .12s; }
.rail-item:hover { background: var(--subtle); }
.rail-item.active { background: linear-gradient(90deg, color-mix(in srgb, var(--ac) 26%, #fff), #fff); border-color: color-mix(in srgb, var(--ac) 45%, #fff); box-shadow: 0 10px 22px -16px var(--ac); }
.rail-item .prev { font-size: 12.5px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; border-radius: 0 0 24px 0; background: radial-gradient(700px 340px at 50% 0%, color-mix(in srgb, var(--ac) 16%, transparent), transparent 70%); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: linear-gradient(90deg, color-mix(in srgb, var(--ac) 22%, #fff), rgba(255,255,255,.85) 55%); border-bottom: 1px solid rgba(12,16,34,.06); flex-shrink: 0; backdrop-filter: blur(10px); position: relative; z-index: 4; /* popover do Histórico acima das mensagens */ }
.chat-scroll { flex: 1; overflow-y: auto; padding: 20px 14px; min-height: 0; }
@media (min-width: 1024px) { .chat-scroll { padding: 24px; } .chat-head { padding: 10px 24px; } }
.thread { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg.me { flex-direction: row-reverse; }
.bubble { max-width: min(100%, 640px); padding: 10px 14px; font-size: 14px; line-height: 1.6; border: 1px solid var(--border); background: #fff;
          border-radius: 4px 14px 14px 14px; box-shadow: var(--shadow-xs); min-width: 0; overflow-wrap: anywhere; }
.msg.me .bubble { background: var(--grad-brand); border-color: transparent; color: var(--navy); font-weight: 500; border-radius: 16px 4px 16px 16px; box-shadow: 0 12px 26px -14px rgba(13,184,138,.8); }
.bubble.is-error { background: #fff7f7; border-color: #ffd5d7; color: #7a1c22; }
.msg-tools { display: flex; gap: 12px; align-items: center; margin-top: 5px; font-size: 11.5px; color: #9ca3af; min-height: 18px; }
.msg-tools button { border: 0; background: none; padding: 0; color: var(--text2); display: inline-flex; align-items: center; gap: 4px;
                    font: inherit; font-weight: 500; opacity: 0; transition: opacity .12s, color .12s; }
.msg:hover .msg-tools button, .msg-tools button:focus-visible, .msg-tools button.always { opacity: 1; }
.msg-tools button:hover { color: var(--text1); }
.rate { display: inline-flex; gap: 2px; }
.msg-tools .rate-btn { font-size: 13px; line-height: 1; padding: 3px 5px; border-radius: 6px; filter: grayscale(1); }
.msg-tools .rate-btn:hover { background: var(--line-2); filter: none; }
.msg-tools .rate-btn.is-on { background: var(--teal-bg); filter: none; opacity: 1; }
.msg-tools .rate-btn:disabled { cursor: wait; }
.correction { display: flex; flex-direction: column; gap: 6px; width: min(100%, 520px); margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); box-shadow: var(--shadow-xs); }
.correction textarea { resize: vertical; min-height: 64px; }
.cites { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.cites summary { cursor: pointer; list-style: none; font-size: 12px; font-weight: 500; color: var(--text2); display: inline-flex; align-items: center; gap: 6px; }
.cites summary::-webkit-details-marker { display: none; }
.cites summary::before { content: '›'; display: inline-block; transition: transform .15s; font-size: 14px; line-height: 1; }
.cites[open] summary::before { transform: rotate(90deg); }
.cites-title { font-size: 12px; font-weight: 500; color: var(--text2); margin: 0 0 6px; }
.cite-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cite details { border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--subtle); }
.cite details[open] { background: #fff; border-color: var(--border); }
.cite summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; font-size: 12.5px; min-width: 0; }
.cite summary::-webkit-details-marker { display: none; }
.cite-n { font-family: var(--f-mono); font-size: 11.5px; font-weight: 600; color: var(--teal-dark); flex-shrink: 0; }
.cite-src { font-weight: 500; color: var(--text1); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cite-meta { margin-left: auto; color: var(--text2); font-size: 11.5px; flex-shrink: 0; white-space: nowrap; }
.cite-excerpt { margin: 0 10px 8px; padding: 6px 10px; border-left: 2px solid var(--teal-border); color: var(--text1); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; }
.cite .link-btn { margin: 0 10px 8px; font-size: 12px; }
.verdict-row { margin-top: 8px; }
.verdict { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; line-height: 1; padding: 4px 8px; border-radius: 999px; border: 1px solid transparent; }
.verdict { font-weight: 600; }
/* Confiança: baixa laranja · moderada amarelo · alta verde · muito alta azul */
.verdict.conf-baixa      { background: color-mix(in srgb, var(--orange) 18%, #fff); border-color: color-mix(in srgb, var(--orange) 55%, #fff); color: #9a4a00; }
.verdict.conf-moderada   { background: color-mix(in srgb, var(--yellow) 30%, #fff); border-color: color-mix(in srgb, var(--yellow) 70%, #fff); color: #6b4e00; }
.verdict.conf-alta       { background: #ecfdf3; border-color: #a7e9c1; color: #15803d; }
.verdict.conf-muito-alta { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
/* Resposta chegando (streaming, história 33): indicador "gerando" ou "Consultando <ferramenta>…" */
.gen-status { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 12px; color: var(--text2); }
.gen-status.has-text { margin-top: 8px; }
.gen-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ac); animation: pulse 1s infinite ease-in-out; flex-shrink: 0; }
.tools-used { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--text2); }
.msg-attach { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 5px 9px; border-radius: 8px; background: rgba(255,255,255,.55); border: 1px solid rgba(12,16,34,.08); max-width: 100%; min-width: 0; }
.btn-quiet.is-on { background: var(--teal-bg); color: var(--teal-dark); }
.conv-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 16px; font-size: 13px; border: 0; border-bottom: 1px solid var(--line-2); background: #fff; color: var(--text1); }
.conv-item:hover { background: var(--subtle); }
.conv-item.active { background: var(--teal-bg); font-weight: 600; }
.read-only-note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 13px; color: var(--text2); box-shadow: none; }
.composer-wrap { flex-shrink: 0; padding: 4px 14px 14px; }
@media (min-width: 1024px) { .composer-wrap { padding: 4px 24px 18px; } }
.composer { max-width: 780px; margin: 0 auto; background: #fff; border: 1px solid rgba(12,16,34,.08); border-radius: 18px; box-shadow: 0 18px 40px -22px rgba(12,16,34,.35); padding: 7px; transition: box-shadow .14s, border-color .14s; }
.composer:focus-within { border-color: color-mix(in srgb, var(--ac) 70%, #fff); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ac) 18%, transparent), 0 22px 44px -20px var(--ac); }
.composer textarea { width: 100%; border: 0; outline: 0; resize: none; background: transparent; font-family: inherit; font-size: 14.5px; color: var(--text1);
                     padding: 8px; line-height: 1.5; max-height: 160px; min-height: 38px; display: block; }
.composer textarea::placeholder { color: #9ca3af; }
.tool-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--text2);
            display: inline-flex; align-items: center; justify-content: center; transition: background .12s, color .12s; flex-shrink: 0; cursor: pointer; }
.tool-btn:hover { background: var(--bg); color: var(--text1); }
.attach-pill { display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin-bottom: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--subtle); }
.ext { width: 34px; height: 34px; border-radius: 10px; background: var(--navy); color: var(--teal); font-size: 9.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; letter-spacing: .02em; }
.halo { margin: 18px 0 14px; box-shadow: 0 0 0 8px color-mix(in srgb, var(--ac) 22%, transparent), 0 0 0 18px color-mix(in srgb, var(--ac) 9%, transparent), 0 30px 60px -14px var(--ac) !important; animation: floaty 6s ease-in-out infinite; }
.drop-veil { position: absolute; inset: 0; z-index: 5; background: rgba(239,255,250,.94); display: flex; align-items: center; justify-content: center;
             border: 2px dashed var(--teal-mid); margin: 10px; border-radius: 16px; pointer-events: none; color: var(--teal-dark); }
audio.chat-audio { height: 36px; width: 250px; max-width: 58vw; display: block; }

/* markdown */
.md-body > *:first-child { margin-top: 0; } .md-body > *:last-child { margin-bottom: 0; }
.md-body p { margin: 0 0 9px; }
.md-body strong { font-weight: 600; }
.md-body ul, .md-body ol { margin: 0 0 9px; padding-left: 20px; }
.md-body ul { list-style: disc; } .md-body ol { list-style: decimal; }
.md-body li { margin: 3px 0; } .md-body li::marker { color: #9ca3af; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { font-weight: 600; letter-spacing: -.01em; line-height: 1.3; margin: 14px 0 6px; }
.md-body h1 { font-size: 18px; } .md-body h2 { font-size: 16px; } .md-body h3 { font-size: 15px; } .md-body h4 { font-size: 14px; }
.md-body a { color: var(--teal-dark); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.md-body code { font-family: var(--f-mono); font-size: 12.5px; background: var(--bg); padding: 1px 5px; border-radius: 5px; }
.md-body pre { background: var(--navy); color: #e5e7eb; padding: 12px 14px; border-radius: 10px; overflow-x: auto; margin: 0 0 9px; }
.md-body pre code { background: none; padding: 0; color: inherit; }
.md-body blockquote { border-left: 3px solid var(--teal-border); margin: 0 0 9px; padding: 2px 0 2px 12px; color: var(--text2); }
.md-body hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
.md-body table { border-collapse: collapse; margin: 0 0 9px; font-size: 13px; width: 100%; display: block; overflow-x: auto; }
.md-body th, .md-body td { border: 1px solid var(--border); padding: 5px 9px; text-align: left; }
.md-body th { background: var(--subtle); font-weight: 600; }

/* ── FAQ ────────────────────────────────────── */
.faq + .faq { border-top: 1px solid var(--line-2); }
.faq > button { width: 100%; text-align: left; padding: 11px 0; border: 0; background: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
                font-size: 13.5px; font-weight: 500; color: var(--text1); }
.faq > button .ic { transition: transform .2s; color: #9ca3af; }
.faq.open > button .ic { transform: rotate(180deg); }
.faq p { margin: 0; padding: 0 0 12px; font-size: 13px; line-height: 1.6; color: var(--text2); }

/* ── Modais / paleta / toasts ───────────────── */
.overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.overlay > .scrim { position: absolute; inset: 0; background: rgba(12,16,34,.6); backdrop-filter: blur(6px); }
.modal { position: relative; width: 100%; max-width: 460px; max-height: 92dvh; display: flex; flex-direction: column; background: #fff; border: 0; border-radius: 22px; box-shadow: 0 40px 100px -20px rgba(12,16,34,.6), 0 0 0 1px rgba(255,255,255,.1); }
.modal::before { content: ''; position: absolute; left: 22px; right: 22px; top: 0; height: 4px; border-radius: 0 0 6px 6px; background: linear-gradient(90deg, var(--teal), var(--lime), var(--yellow), var(--orange), var(--red), var(--purple)); }
.modal-lg { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); flex-shrink: 0; }
.modal-head .h-card { font-size: 16px; }
.modal-body { padding: 20px; overflow-y: auto; min-height: 0; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line-2); flex-shrink: 0; background: var(--subtle); border-radius: 0 0 22px 22px; }
/* Lista de agentes do documento (história 38): a LIA vem marcada e travada. */
.agent-pick { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.agent-pick-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; }
.agent-pick-row + .agent-pick-row { border-top: 1px solid var(--line-2); }
.agent-pick-row:hover { background: var(--subtle); }
.agent-pick-row.locked { cursor: default; background: var(--subtle); }
.agent-pick-row input { accent-color: var(--teal-mid); width: 16px; height: 16px; flex-shrink: 0; }
.agent-pick-emoji { width: 24px; text-align: center; font-size: 16px; flex-shrink: 0; }
.x-btn { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--text2); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .12s; }
.x-btn:hover { background: var(--bg); color: var(--text1); }

.palette { position: relative; width: 100%; max-width: 620px; align-self: flex-start; margin-top: 10vh; background: #fff; border: 2px solid transparent; border-radius: 20px; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(120deg, var(--teal), var(--purple), var(--red)) border-box; box-shadow: 0 40px 100px -20px rgba(12,16,34,.7); overflow: hidden; }
.palette input { width: 100%; height: 50px; border: 0; outline: 0; font-family: inherit; font-size: 15px; padding: 0 16px 0 44px; color: var(--text1); background: transparent; }
.palette-list { max-height: 52vh; overflow-y: auto; border-top: 1px solid var(--line-2); padding: 6px; }
.palette-group { font-size: 11.5px; font-weight: 500; color: #9ca3af; padding: 8px 10px 4px; margin: 0; }
.palette-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; font-size: 13.5px; font-weight: 500; color: var(--text1); }
.palette-item .ic { color: #9ca3af; }
.palette-item .sub { font-size: 12.5px; font-weight: 400; color: var(--text2); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.palette-item.sel { background: linear-gradient(90deg, var(--teal-light), var(--teal-bg)); }
.palette-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line-2); background: var(--subtle); font-size: 12px; color: var(--text2); align-items: center; }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 12px 11px 15px; background: var(--navy); color: #fff; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; box-shadow: 0 20px 44px -14px rgba(12,16,34,.6), 0 0 0 1px color-mix(in srgb, var(--tc, var(--teal)) 40%, transparent); font-size: 13.5px; font-weight: 500; max-width: 420px; }
.toast .pip { width: 9px; height: 9px; border-radius: 50%; background: var(--tc, var(--teal)); flex-shrink: 0; box-shadow: 0 0 12px var(--tc, var(--teal)); }
.toast button { border: 0; background: var(--teal); color: var(--navy); font-weight: 600; font-size: 12.5px; padding: 5px 10px; border-radius: 8px; white-space: nowrap; }
.toast button:hover { filter: brightness(1.08); }
.toast.error { --tc: var(--red); } .toast.warn { --tc: var(--orange); }

.popover { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--border);
           border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; z-index: 50; }
.empty { text-align: center; padding: 40px 20px; border: 2px dashed color-mix(in srgb, var(--teal-mid) 40%, #fff); border-radius: var(--r); color: var(--text2); background: linear-gradient(150deg, var(--teal-bg), #fff); }
.empty .big { font-weight: 600; font-size: 15px; color: var(--text1); margin: 0 0 4px; }

.step-n { width: 28px; height: 28px; border-radius: 10px; background: var(--grad-brand); color: var(--navy); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 8px 16px -8px rgba(13,184,138,.8); }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; padding: 0; box-shadow: 0 0 0 1px var(--border); transition: box-shadow .12s; }
.swatch.on { box-shadow: 0 0 0 2px var(--text1); }
.pin { position: absolute; transform: translate(-50%,-50%); width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff;
       background: var(--pc); color: var(--pf, var(--text1)); font-weight: 600; font-size: 11.5px; display: flex; align-items: center; justify-content: center;
       box-shadow: 0 2px 8px rgba(12,16,34,.35); transition: transform .15s; padding: 0; }
.pin.on { transform: translate(-50%,-50%) scale(1.25); z-index: 2; }

/* ── Benchmark (história 18) ── */
.bm-scroll { overflow-x: auto; }
.bm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bm-table th { text-align: left; font-weight: 600; color: var(--text2); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.bm-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.bm-table tr.bm-overall td { font-weight: 600; background: var(--subtle); }
.bm-bar { height: 6px; border-radius: 99px; background: var(--subtle); overflow: hidden; max-width: 320px; }
.bm-bar span { display: block; height: 100%; background: var(--grad-brand); transition: width .3s; }
.bm-up { color: var(--teal-dark); }
.bm-down { color: var(--danger); }

/* ── Impressão (PDF) — isola apenas #printable ── */
@media print {
  body { background: #fff !important; }
  body * { visibility: hidden !important; }
  #printable, #printable * { visibility: visible !important; animation: none !important; }
  #printable { position: fixed; left: 0; top: 0; width: 100%; max-width: none !important; margin: 0 !important;
               transform: none !important; padding: 0 !important; box-shadow: none !important; border: 0 !important; }
  @page { margin: 16mm; }
}

/* Fluxos (história 27): etapas em lista, grupo paralelo, trace e diagrama */
.fl-step { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: #fff; }
.fl-step-error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,76,84,.10); }
.fl-group { border-left: 3px solid var(--teal-light); padding-left: 10px; }
.fl-child { background: var(--subtle); }
.fl-id { width: 110px; height: 32px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.fl-kind { width: 140px; height: 32px; font-size: 13px; }
.fl-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.fl-errs { margin: 0; padding-left: 18px; list-style: disc; }
.fl-pre { white-space: pre-wrap; word-break: break-word; background: var(--subtle); border-radius: 8px; padding: 8px 10px; max-height: 260px; overflow: auto; font-size: 12px; margin: 4px 0 0; }
.fl-preview { overflow-x: auto; min-height: 40px; }
.fl-preview svg { max-width: 100%; height: auto; }
