/*
 * IDE viva — réplica demonstrativa da IDE do BrainChain Orchestrator.
 * Desenhada em coordenadas lógicas (1440 x 900 por padrão) e escalada por
 * transform para caber no hospedeiro. Medidas e cores: .impeccable/ref/IDE-REFERENCIA.md
 * (Aparência v2, tema Escuro). Fontes Sora e Fira Code vêm da página.
 */

.iv-root {
  --iv-bg: #050505;
  --iv-surface: #0b0b0b;
  --iv-sunken: #020202;
  --iv-elev: #151515;
  --iv-press: #1c1c1c;
  --iv-line-soft: #141414;
  --iv-line: #1d1d1d;
  --iv-line-x: #2b2b2b;
  --iv-tx: #f4f4f4;
  --iv-tx2: #a6a6a6;
  --iv-tx3: #787878;
  --iv-tx4: #4a4a4a;
  --iv-ac: #7c3aed;
  --iv-ac-light: #8b5cf6;
  --iv-ac-deep: #5b21b6;
  --iv-ac-fg: #a78bfa;
  --iv-cosmos: #aab2c8;
  --iv-term: #111113;
  --iv-term-tx: #e8e8ec;
  --iv-ok: #22c55e;
  --iv-ok-soft: #4ade80;
  --iv-err: #ef4444;
  --iv-info: #38bdf8;
  --iv-sans: "Sora", ui-sans-serif, system-ui, sans-serif;
  --iv-mono: "Fira Code", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --iv-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --iv-move: 0.52s;

  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  contain: layout paint;
  color-scheme: dark;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.iv-root.iv-fit-contain { height: 100%; }

.iv-root *,
.iv-root *::before,
.iv-root *::after { box-sizing: border-box; }

.iv-root :where(button) {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.iv-root svg { display: block; flex: none; }
.iv-root ::selection { background: rgba(124, 58, 237, 0.5); color: #fff; }
.iv-root :focus { outline: none; }
.iv-root :focus-visible { outline: 2px solid var(--iv-ac-fg); outline-offset: 1px; }

.iv-frame {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  overflow: hidden;
  background: var(--iv-bg);
  color: var(--iv-tx);
  font: 400 13px/1.3 var(--iv-sans);
  user-select: none;
  -webkit-user-select: none;
}

/* ───────────── Topbar (48px) ───────────── */
.iv-topbar {
  position: absolute;
  inset: 0 0 auto 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 16px;
  background: var(--iv-surface);
  border-bottom: 1px solid var(--iv-line);
  z-index: 3;
}
.iv-tb-left,
.iv-tb-right { display: flex; align-items: center; min-width: 0; }
.iv-tb-left { gap: 10px; }
.iv-tb-right { gap: 4px; }

.iv-logo { display: flex; align-items: center; gap: 9px; margin-right: 6px; }
.iv-logo .iv-mark { width: 20px; height: 20px; color: var(--iv-tx); }
.iv-logo-text { display: flex; flex-direction: column; gap: 2px; }
.iv-logo-text b { font: 700 14.5px/1 var(--iv-sans); letter-spacing: -0.02em; color: var(--iv-tx); }
.iv-logo-text small { font: 600 6.5px/1 var(--iv-sans); letter-spacing: 0.22em; color: var(--iv-tx2); }

.iv-tb-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: var(--iv-tx2);
  transition: background 0.14s, color 0.14s;
}
.iv-root .iv-tb-btn:hover { background: var(--iv-elev); color: var(--iv-tx); }
.iv-root .iv-tb-btn.is-active {
  background: var(--iv-elev);
  color: var(--iv-tx);
  box-shadow: inset 0 0 0 1px var(--iv-line);
}

.iv-crumb { display: flex; align-items: center; gap: 7px; margin-left: 4px; color: var(--iv-tx2); font-size: 13px; white-space: nowrap; }
.iv-crumb svg { color: var(--iv-tx4); }
.iv-crumb b { font-weight: 600; color: var(--iv-tx); }

.iv-tb-chip,
.iv-tb-layout {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border-radius: 4px;
  color: var(--iv-tx2);
  font-size: 12px;
  transition: background 0.14s, color 0.14s;
}
.iv-tb-chip:hover,
.iv-tb-layout:hover { background: var(--iv-elev); color: var(--iv-tx); }
.iv-tb-chip > svg:last-child,
.iv-tb-layout > svg:last-child { color: var(--iv-tx3); }
.iv-tb-chip[hidden] { display: none; }
.iv-tb-sep { width: 1px; height: 18px; margin: 0 6px; background: var(--iv-line); }
.iv-win { display: flex; align-items: center; }
.iv-win i {
  width: 34px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: var(--iv-tx2);
  transition: background 0.14s, color 0.14s;
}
.iv-win i:hover { background: var(--iv-elev); color: var(--iv-tx); }
.iv-win i.close:hover { background: var(--iv-err); color: #fff; }

/* ───────────── Corpo ───────────── */
.iv-body { position: absolute; inset: 48px 0 28px 0; }

/* ───────────── Barra lateral (339px) ───────────── */
.iv-sidebar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 339px;
  display: flex;
  flex-direction: column;
  background: var(--iv-surface);
  border-right: 1px solid var(--iv-line);
  z-index: 2;
  transition: transform var(--iv-move) var(--iv-ease), visibility 0s;
}
.iv-root.sb-closed .iv-sidebar {
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform var(--iv-move) var(--iv-ease), visibility 0s var(--iv-move);
}

.iv-sb-icons { flex: none; height: 40px; display: flex; align-items: center; gap: 4px; padding: 0 12px; color: var(--iv-tx3); }
.iv-sb-icons i {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  transition: background 0.14s, color 0.14s;
}
.iv-sb-icons i:hover { background: var(--iv-elev); color: var(--iv-tx); }
.iv-sb-icons .iv-sb-bell { margin-left: auto; }

.iv-sb-search {
  flex: none;
  height: 28px;
  margin: 4px 12px 0;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--iv-line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--iv-tx3);
  font-size: 12.5px;
  white-space: nowrap;
}
.iv-sb-new {
  flex: none;
  height: 30px;
  margin: 8px 12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--iv-line);
  border-radius: 4px;
  background: var(--iv-elev);
  color: var(--iv-tx);
  font-size: 12px;
  font-weight: 560;
  transition: background 0.14s, border-color 0.14s;
}
.iv-sb-new:hover { background: var(--iv-press); border-color: var(--iv-line-x); }
.iv-sb-head {
  flex: none;
  height: 28px;
  margin-top: 8px;
  padding: 0 14px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--iv-tx);
  font-size: 13px;
}
.iv-sb-head svg { color: var(--iv-tx3); }

.iv-sb-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--iv-line-x) transparent;
}
.iv-sb-label {
  height: 22px;
  margin: 6px 0 2px;
  padding: 0 12px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--iv-tx3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.iv-sb-label em {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  font: 500 10px/16px var(--iv-mono);
  font-style: normal;
  letter-spacing: 0;
  text-align: center;
}

.iv-root .iv-row {
  width: 318px;
  height: 28px;
  margin: 0 10px;
  padding: 0 6px 0 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 4px;
  color: var(--iv-tx2);
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  transition: background 0.14s, color 0.14s;
}
.iv-root .iv-row:hover { background: rgba(255, 255, 255, 0.045); color: var(--iv-tx); }
.iv-root .iv-row.is-selected { background: var(--iv-elev); color: var(--iv-tx); }
.iv-root .iv-row.is-selected .iv-row-name { font-weight: 600; }
.iv-root .iv-row.is-current { background: rgba(139, 92, 246, 0.14); color: var(--iv-tx); }
.iv-root .iv-row.is-min { color: var(--iv-tx3); }
.iv-root .iv-row--l1 { padding-left: 22px; }
.iv-root .iv-row--l2 { padding-left: 52px; }
.iv-row-chev { width: 12px; display: grid; place-items: center; color: var(--iv-tx3); }
.iv-row-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; }
.iv-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.iv-row-count,
.iv-row-badge {
  flex: none;
  min-width: 18px;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--iv-tx3);
  font: 500 9.5px/15px var(--iv-mono);
  text-align: center;
}
.iv-row-count[hidden] { display: none; }
.iv-row-act { width: 20px; height: 20px; display: grid; place-items: center; color: var(--iv-tx3); border-radius: 3px; }
.iv-row-act.is-quiet { opacity: 0.55; }
.iv-row-chip {
  flex: none;
  height: 18px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--iv-tx2);
  font-size: 10.5px;
}
.iv-row-chip i { width: 5px; height: 5px; border-radius: 50%; background: var(--iv-ac-light); }
.iv-row.is-busy .iv-row-dot { animation: ivPulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

.iv-sb-foot {
  flex: none;
  height: 64px;
  padding: 0 14px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--iv-line);
  color: var(--iv-tx3);
}
.iv-avatar {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--iv-ac);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.iv-user { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.iv-user b { font-size: 12.5px; font-weight: 600; color: var(--iv-tx); line-height: 1.1; }
.iv-user small { font-size: 11px; color: var(--iv-tx3); line-height: 1.1; }

/* ───────────── Palco ───────────── */
.iv-stage {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 339px;
  right: 0;
  overflow: hidden;
  background: var(--iv-bg);
  transition: left var(--iv-move) var(--iv-ease), right var(--iv-move) var(--iv-ease);
}
.iv-root.sb-closed .iv-stage { left: 0; }
.iv-root.dr-open .iv-stage { right: 340px; }

.iv-cosmos {
  position: absolute;
  top: 0;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}
.iv-root.is-empty .iv-cosmos { opacity: 1; }

.iv-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0s 0.5s;
}
.iv-root.is-empty .iv-empty { opacity: 1; visibility: visible; transition: opacity 0.7s ease 0.12s, visibility 0s; }
.iv-empty-inner { display: flex; flex-direction: column; align-items: center; }
.iv-empty-logo { display: flex; flex-direction: column; align-items: center; animation: ivFloat 6s ease-in-out infinite; }
.iv-empty-logo .iv-mark { width: 44px; height: 44px; margin: 8px 0 14px; color: var(--iv-cosmos); }
.iv-empty-logo .iv-mark .tile { transform-origin: center; transform-box: fill-box; animation: ivTile 3.4s ease-in-out infinite; }
.iv-empty-logo .iv-mark .tile:nth-child(2) { animation-delay: 0.35s; }
.iv-empty-logo .iv-mark .tile:nth-child(3) { animation-delay: 0.7s; }
.iv-empty-logo b { font: 700 34px/1 var(--iv-sans); letter-spacing: -0.02em; color: var(--iv-tx); }
.iv-empty-logo small {
  margin-top: 10px;
  padding-left: 0.35em;
  font: 500 11px/1 var(--iv-mono);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--iv-tx2);
  opacity: 0.7;
}
.iv-root .iv-open-agent {
  height: 32px;
  margin-top: 22px;
  padding: 0 14px;
  border: 1px solid rgba(124, 58, 237, 0.45);
  border-radius: 4px;
  background: rgba(124, 58, 237, 0.14);
  color: #b8a2fc;
  font-size: 13px;
  font-weight: 560;
  pointer-events: auto;
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}
.iv-root .iv-open-agent:hover { background: rgba(124, 58, 237, 0.26); border-color: var(--iv-ac-light); color: #fff; }
.iv-root .iv-open-agent:active { background: rgba(124, 58, 237, 0.34); }

.iv-grid { position: absolute; inset: 0; transition: opacity 0.5s ease; }
.iv-links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; overflow: visible; transition: opacity 0.5s ease; }
.iv-root.is-resetting .iv-grid,
.iv-root.is-resetting .iv-links,
.iv-root.is-resetting .iv-tray { opacity: 0; }

/* ───────────── Painel ───────────── */
.iv-pane {
  position: absolute;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--iv-surface);
  border: 1px solid var(--iv-line);
  border-radius: 3px;
  transition:
    left var(--iv-move) var(--iv-ease),
    top var(--iv-move) var(--iv-ease),
    width var(--iv-move) var(--iv-ease),
    height var(--iv-move) var(--iv-ease),
    transform var(--iv-move) var(--iv-ease),
    opacity 0.3s ease,
    border-color 0.16s,
    box-shadow 0.16s;
}
.iv-pane[hidden] { display: none; }
.iv-pane.is-entering { opacity: 0; transform: scale(0.955); }
.iv-pane.is-leaving { opacity: 0; transform: scale(0.97); pointer-events: none; transition-duration: 0.2s; }
.iv-pane.is-focused {
  border-color: var(--iv-ac-light);
  box-shadow: 0 0 0 1px var(--iv-ac-light);
  z-index: 1;
}

.iv-pane-head {
  flex: none;
  height: 34px;
  min-width: 0;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  background: var(--iv-elev);
  border-bottom: 1px solid var(--iv-line);
  container-type: inline-size;
  container-name: ivhead;
}
.iv-agent-dot { flex: none; width: 16px; height: 16px; display: grid; place-items: center; }
.iv-agent-dot i { width: 5px; height: 5px; border-radius: 1.5px; background: var(--pane-accent, var(--iv-ac-fg)); }
.iv-pane.is-busy .iv-agent-dot i { animation: ivPulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.iv-pane.is-pinged .iv-agent-dot i { animation: ivPing 0.9s var(--iv-ease); }
.iv-pane-name {
  min-width: 0;
  padding: 1px 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--iv-tx);
}
.iv-id-chip {
  flex: none;
  height: 18px;
  padding: 0 5px 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--iv-line-x);
  border-radius: 4px;
  background: var(--iv-press);
  color: var(--iv-tx2);
  font: 500 10px/1 var(--iv-mono);
  transition: border-color 0.14s, background 0.14s;
}
.iv-id-chip:hover { border-color: var(--iv-ac); background: #1d1730; }
.iv-id-chip small { font-size: 8px; font-weight: 700; letter-spacing: 0.05em; opacity: 0.55; }
.iv-id-chip b { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: var(--iv-tx); }
.iv-id-chip svg { color: var(--iv-tx3); opacity: 0.75; }
.iv-toks { flex: none; display: inline-flex; align-items: center; gap: 2px; margin-left: 2px; }
.iv-tok {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 1px 3px;
  border-radius: 3px;
  font: 700 9px/1.2 var(--iv-mono);
  font-variant-numeric: tabular-nums;
  opacity: 0.4;
  transition: opacity 0.3s, background 0.3s;
}
.iv-tok b { min-width: 2ch; font-weight: 700; }
.iv-tok.in { color: var(--iv-info); }
.iv-tok.out { color: var(--iv-ok-soft); }
.iv-tok.is-stale { opacity: 0.6; }
.iv-tok.is-live { opacity: 1; }
.iv-tok.in.is-live { background: rgba(56, 189, 248, 0.16); }
.iv-tok.out.is-live { background: rgba(74, 222, 128, 0.16); }
.iv-pane-actions { flex: none; margin-left: auto; display: flex; align-items: center; gap: 1px; }
.iv-pbtn {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  color: var(--iv-tx3);
  transition: background 0.14s, color 0.14s;
}
.iv-root .iv-pbtn:hover { background: var(--iv-press); color: var(--iv-tx); }
.iv-root .iv-pbtn.danger:hover { background: rgba(239, 68, 68, 0.15); color: var(--iv-err); }
@container ivhead (max-width: 318px) {
  .iv-id-chip,
  .iv-pbtn.iv-deco { display: none; }
}
@container ivhead (max-width: 214px) {
  .iv-toks { display: none; }
}

.iv-pane-sub {
  flex: none;
  height: 22px;
  padding: 2px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
  background: var(--iv-surface);
  border-bottom: 1px solid var(--iv-line);
  color: var(--iv-tx3);
  font: 400 10px/1 var(--iv-mono);
}
.iv-pane-sub .sep { opacity: 0.4; }
.iv-pane-sub .model { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--pane-accent, var(--iv-ac-fg)); }

.iv-term {
  flex: 1;
  min-height: 0;
  padding: 5px 8px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--iv-term);
  color: var(--iv-term-tx);
  font: 400 13px/17px var(--iv-mono);
  font-variant-ligatures: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  scrollbar-width: thin;
  scrollbar-color: var(--iv-line-x) transparent;
}
.iv-ln { min-height: 17px; }
.iv-ln.is-add { color: #86efac; background: rgba(34, 197, 94, 0.1); }
.iv-ln.is-del { color: #fca5a5; background: rgba(239, 68, 68, 0.1); }
.iv-ln.is-gap { margin-top: 8px; }
.iv-term .t-dot { color: var(--iv-ac-light); }
.iv-term .t-ok { color: var(--iv-ok-soft); }
.iv-term .t-b { font-weight: 600; color: var(--iv-tx); }
.iv-term .t-dim { color: #8b8b94; }
.iv-term .t-user { font-weight: 500; color: var(--iv-tx); }
.iv-term .t-prompt { font-weight: 700; color: var(--iv-ac-fg); }
.iv-term .t-flow { color: var(--iv-ac-fg); }
.iv-term .t-pass { font-weight: 600; color: var(--iv-ok-soft); }
.iv-prompt { margin-top: 17px; font-weight: 700; color: var(--iv-tx); }
.iv-pane.is-busy .iv-prompt { visibility: hidden; }

.iv-pane-foot {
  position: relative;
  flex: none;
  height: 57px;
  background: var(--iv-surface);
  border-top: 1px solid var(--iv-line);
  transition: border-color 0.16s;
}
.iv-pane-foot:focus-within { border-top-color: rgba(139, 92, 246, 0.55); }
.iv-grip {
  position: absolute;
  top: -2px;
  left: 50%;
  width: 34px;
  height: 3px;
  margin-left: -17px;
  border-radius: 99px;
  background: var(--iv-line-x);
}
.iv-input-row { height: 33px; padding: 5px 8px 3px; display: flex; }
.iv-root .iv-input {
  flex: 1;
  min-width: 0;
  height: 25px;
  margin: 0;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--iv-tx);
  caret-color: var(--iv-ac-fg);
  font: 400 13px/1.45 var(--iv-mono);
  font-variant-ligatures: none;
  user-select: text;
  -webkit-user-select: text;
}
.iv-root .iv-input::placeholder { color: var(--iv-tx3); opacity: 1; }
.iv-toolbar {
  height: 23px;
  padding: 0 7px 3px;
  display: flex;
  align-items: center;
  gap: 1px;
  color: var(--iv-tx4);
  font: 400 10px/1 var(--iv-mono);
}
.iv-tbi {
  height: 20px;
  min-width: 20px;
  padding: 0 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  color: var(--iv-tx3);
  transition: background 0.14s, color 0.14s;
}
.iv-root .iv-tbi:hover { background: var(--iv-elev); color: var(--iv-tx); }
.iv-root button.iv-tbi:active { color: var(--iv-ac-fg); }
.iv-cmd-hint { display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; color: var(--iv-tx3); font-size: 11px; white-space: nowrap; }
.iv-cmd-hint kbd {
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--iv-line-x);
  border-bottom-width: 2px;
  border-radius: 3px;
  color: var(--iv-tx2);
  font: 400 10px/1 var(--iv-mono);
}
.iv-toolbar .grow { flex: 1; }

/* Bandeja dos painéis minimizados */
.iv-tray {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  transition: opacity 0.5s ease;
}
.iv-tray:empty { display: none; }
.iv-root .iv-tray button {
  height: 28px;
  padding: 0 9px 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--iv-line);
  border-radius: 4px;
  background: var(--iv-surface);
  color: var(--iv-tx2);
  font-size: 12px;
  font-weight: 500;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.iv-root .iv-tray button:hover { background: var(--iv-elev); border-color: var(--iv-line-x); color: var(--iv-tx); }
.iv-tray button i { width: 5px; height: 5px; border-radius: 1.5px; }
.iv-tray button svg { color: var(--iv-tx3); }

/* Linha de luz entre agentes: o mesmo traço das constelações do login */
.iv-link { animation: ivLinkFade 2.7s ease forwards; }
.iv-link path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.iv-link-halo { stroke: rgba(160, 120, 255, 0.16); stroke-width: 4; stroke-dasharray: 100; stroke-dashoffset: 100; animation: ivLinkDraw 0.95s var(--iv-ease) forwards; }
.iv-link-line { stroke: rgba(190, 170, 255, 0.7); stroke-width: 1; stroke-dasharray: 100; stroke-dashoffset: 100; animation: ivLinkDraw 0.95s var(--iv-ease) forwards; }
.iv-link-pulse { stroke: #fff; stroke-width: 1.8; stroke-dasharray: 7 200; stroke-dashoffset: 7; animation: ivLinkTravel 1.05s cubic-bezier(0.5, 0, 0.2, 1) 0.1s forwards; }
.iv-link-node { fill: #fff; opacity: 0; animation: ivLinkNode 0.5s ease forwards; }

/* ───────────── Gaveta "Novos agentes" (340px) ───────────── */
.iv-drawer {
  position: absolute;
  inset: 0 0 0 auto;
  width: 340px;
  display: flex;
  flex-direction: column;
  background: var(--iv-surface);
  border-left: 1px solid var(--iv-line);
  z-index: 2;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform var(--iv-move) var(--iv-ease), visibility 0s var(--iv-move);
}
.iv-root.dr-open .iv-drawer { transform: none; visibility: visible; transition: transform var(--iv-move) var(--iv-ease), visibility 0s; }
.iv-dr-head {
  flex: none;
  height: 42px;
  padding: 0 8px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--iv-line);
}
.iv-dr-head b { font-size: 14px; font-weight: 600; color: var(--iv-tx); }
.iv-dr-modes { flex: none; padding: 12px 16px 12px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--iv-line); }
.iv-dr-modes label { display: flex; align-items: center; gap: 8px; color: var(--iv-tx2); font-size: 12.5px; cursor: pointer; }
.iv-dr-modes label:hover { color: var(--iv-tx); }
.iv-root .iv-dr-modes input {
  appearance: none;
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  margin: 0;
  border: 1.5px solid var(--iv-tx3);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
}
.iv-root .iv-dr-modes input:checked { border-color: var(--iv-ac-light); background: var(--iv-ac-light); box-shadow: inset 0 0 0 2.5px var(--iv-surface); }
.iv-root .iv-dr-modes input:disabled { opacity: 0.4; cursor: default; }
.iv-dr-modes input:disabled + span { opacity: 0.5; }
.iv-dr-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0 12px; scrollbar-width: thin; scrollbar-color: var(--iv-line-x) transparent; }
.iv-dr-label {
  margin: 14px 0 4px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--iv-tx3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.iv-root .iv-dr-item {
  width: 324px;
  height: 52px;
  margin: 2px 8px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 4px;
  text-align: left;
  transition: background 0.14s;
}
.iv-root .iv-dr-item:hover { background: var(--iv-elev); }
.iv-root .iv-dr-item:active { background: var(--iv-press); }
.iv-root .iv-dr-item:disabled { opacity: 0.4; cursor: default; background: none; }
.iv-dr-glyph { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 4px; background: rgba(255, 255, 255, 0.05); }
.iv-dr-item > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.iv-dr-item b { font-size: 13px; font-weight: 600; color: var(--iv-tx); line-height: 1; }
.iv-dr-item small { font-size: 11px; color: var(--iv-tx3); line-height: 1; }
.iv-dr-item > svg { color: var(--iv-tx4); }
.iv-dr-note { min-height: 16px; margin: 10px 16px 0; color: var(--iv-tx3); font-size: 11.5px; line-height: 1.4; }
.iv-dr-foot { flex: none; padding: 10px 12px 12px; border-top: 1px solid var(--iv-line); }
.iv-root .iv-dr-install {
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--iv-line);
  border-radius: 4px;
  background: var(--iv-elev);
  color: var(--iv-tx);
  font-size: 12px;
  font-weight: 560;
  transition: background 0.14s, border-color 0.14s;
}
.iv-root .iv-dr-install:hover { background: var(--iv-press); border-color: var(--iv-line-x); }

/* ───────────── Barra de status (28px) ───────────── */
.iv-status {
  position: absolute;
  inset: auto 0 0 0;
  height: 28px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  background: var(--iv-surface);
  border-top: 1px solid var(--iv-line);
  color: var(--iv-tx3);
  font: 400 11px/1 var(--iv-mono);
  font-variant-ligatures: none;
  white-space: nowrap;
  z-index: 3;
}
.iv-st-left,
.iv-st-right { height: 100%; display: flex; align-items: center; }
.iv-st-right { margin-left: auto; padding-right: 6px; }
.iv-st-item { height: 100%; padding: 0 9px; display: flex; align-items: center; gap: 6px; border-right: 1px solid var(--iv-line-soft); }
.iv-st-item:last-child { border-right: 0; }
.iv-st-item.is-strong { color: var(--iv-tx); font-weight: 500; }
.iv-st-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--iv-ok); }
.iv-root.is-working .iv-st-dot { animation: ivBeat 1.5s ease-in-out infinite; }
.iv-st-center {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--iv-tx2);
  font-variant-numeric: tabular-nums;
}
.iv-st-center b { font-weight: 600; color: var(--iv-ok-soft); }
.iv-st-center i { font-style: normal; color: var(--iv-tx4); }

/* ───────────── Movimento ───────────── */
@keyframes ivPulse { 0%, 12%, 100% { opacity: 1; } 50%, 62% { opacity: 0.12; } }
@keyframes ivPing { 0% { transform: scale(1); } 35% { transform: scale(2.6); } 100% { transform: scale(1); } }
@keyframes ivBeat { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }
@keyframes ivFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes ivTile { 0%, 100% { opacity: 0.85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes ivLinkDraw { to { stroke-dashoffset: 0; } }
@keyframes ivLinkTravel { to { stroke-dashoffset: -100; } }
@keyframes ivLinkNode { to { opacity: 0.95; } }
@keyframes ivLinkFade { 0%, 62% { opacity: 1; } 100% { opacity: 0; } }

/* Fora da tela ou aba oculta: nada anima. */
.iv-root.is-offscreen *,
.iv-root.is-offscreen *::before,
.iv-root.is-offscreen *::after { animation-play-state: paused !important; }

/* Movimento reduzido: quadro estável; as interações continuam funcionando. */
.iv-root.is-still *,
.iv-root.is-still *::before,
.iv-root.is-still *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .iv-root *,
  .iv-root *::before,
  .iv-root *::after { animation: none !important; transition: none !important; }
}
