/* ============================================================
   J.A.R.V.I.S. — visual "vidro e aurora"
   Suave e moderno: vidro fosco, cantos arredondados, degradês de
   duas cores e a consciência como protagonista.
   ============================================================ */

@font-face {
  font-family: 'Saira';
  font-weight: 300 700;
  font-stretch: 75% 125%;
  font-display: swap;
  src: url('/fonts/saira-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/barlow-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/barlow-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/barlow-600.woff2') format('woff2');
}

/* Oficina Stark (design/DIRECAO-VISUAL.md): luz de holograma no escuro, titânio no que está ativo. */
:root {
  --bg: #05080b;
  --c: #bce3f5;
  --c-rgb: 188, 227, 245;
  --c2: #4f8fb5;
  --c2-rgb: 79, 143, 181;
  --sinal: #e8b45c;
  --sinal-rgb: 232, 180, 92;
  --sinal-ink: #1b1204;
  --text: #e6eef2;
  --text-rgb: 230, 238, 242;
  --muted: rgba(var(--text-rgb), 0.64);
  --faint: rgba(var(--text-rgb), 0.4);
  --stroke: rgba(var(--c-rgb), 0.1);
  --stroke-2: rgba(var(--c-rgb), 0.18);
  --glass-top: rgba(var(--c-rgb), 0.035);
  --glass-bottom: rgba(var(--c-rgb), 0.012);
  /* Sem degradê decorativo: onde antes havia ciano→roxo, agora é a luz lisa. */
  --grad: linear-gradient(var(--c), var(--c));
  --warn: #e8b45c;
  --warn-rgb: 232, 180, 92;
  --danger: #ff5a4a;
  --danger-rgb: 255, 90, 74;
  --ok: #7fd8a8;

  --font-display: 'Saira', 'Bahnschrift', 'Segoe UI', system-ui, sans-serif;
  --font-text: 'Barlow', 'Bahnschrift', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Cascadia Code', 'Cascadia Mono', Consolas, 'Roboto Mono', monospace;

  /* Molduras de projeção: cantos quase retos, sem sombra de cartão. */
  --r-lg: 6px;
  --r: 4px;
  --r-sm: 3px;
  --gap: 18px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

/* Mesa âmbar: monocromático âmbar, como a mesa holográfica 880. */
[data-theme='ambar'] {
  --bg: #0a0704;
  --c: #ffc56b;
  --c-rgb: 255, 197, 107;
  --c2: #a8742c;
  --c2-rgb: 168, 116, 44;
  --sinal: #f4efe4;
  --sinal-rgb: 244, 239, 228;
  --text: #f6ecdc;
  --text-rgb: 246, 236, 220;
}
/* Mark: vermelho hot-rod da armadura, titânio no ativo. */
[data-theme='vermelho'] {
  --bg: #0a0506;
  --c: #ff8a7a;
  --c-rgb: 255, 138, 122;
  --c2: #a8323a;
  --c2-rgb: 168, 50, 58;
  --sinal: #e8b45c;
  --sinal-rgb: 232, 180, 92;
  --text: #f5e9e6;
  --text-rgb: 245, 233, 230;
}
/* Radar: fósforo verde e oliva, de tela militar. */
[data-theme='verde'] {
  --bg: #040806;
  --c: #9ff0b8;
  --c-rgb: 159, 240, 184;
  --c2: #4f8a5c;
  --c2-rgb: 79, 138, 92;
  --sinal: #d8d27a;
  --sinal-rgb: 216, 210, 122;
  --text: #e4f1e7;
  --text-rgb: 228, 241, 231;
}
/* Grafite: branco e cinza, o mais discreto. */
[data-theme='grafite'] {
  --bg: #070808;
  --c: #e4e6e8;
  --c-rgb: 228, 230, 232;
  --c2: #7d8388;
  --c2-rgb: 125, 131, 136;
  --sinal: #e8b45c;
  --sinal-rgb: 232, 180, 92;
  --text: #eceeef;
  --text-rgb: 236, 238, 239;
}

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

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}

/* O ar da oficina: um halo discreto atrás da consciência e a grade de pontos da prancheta. */
body {
  background:
    radial-gradient(46vw 44vh at 50% 46%, rgba(var(--c2-rgb), 0.1), transparent 72%),
    radial-gradient(circle, rgba(var(--c-rgb), 0.07) 1px, transparent 1.2px) 0 0 / 28px 28px,
    var(--bg);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.5) 100%);
}

#core-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
}
.stop-a {
  stop-color: var(--c);
}
.stop-b {
  stop-color: var(--c2);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid rgba(var(--c-rgb), 0.7);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}

/* ícones de traço fino */
.icon-btn svg,
.file-btn svg,
.mic-btn svg,
.send-btn svg,
.stop-btn svg,
.ph-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================ layout ============================ */

.app {
  position: relative;
  z-index: 2;
  display: grid;
  height: 100dvh;
  grid-template-columns: minmax(260px, 21vw) minmax(0, 1fr) minmax(310px, 27vw);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    'top top top'
    'left stage right'
    'left composer right';
  gap: var(--gap) 20px;
  padding: 16px 20px 18px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}
.topbar {
  grid-area: top;
}
.col-left {
  grid-area: left;
}
.stage {
  grid-area: stage;
}
.col-right {
  grid-area: right;
}
.composer {
  grid-area: composer;
}
.col {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-height: 0;
  transition:
    opacity 0.6s var(--ease),
    transform 0.6s var(--ease),
    filter 0.6s var(--ease);
}
.mobile-tabs {
  display: none;
}

/* modo minimalista: só a consciência, a legenda e a barra de mensagem */
[data-mode='minimalista'] .app {
  grid-template-columns: 0 minmax(0, 1fr) 0;
  column-gap: 0;
}
[data-mode='minimalista'] .col {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  filter: blur(6px);
}
[data-mode='minimalista'] .col-left {
  transform: translateX(-40px);
}
[data-mode='minimalista'] .col-right {
  transform: translateX(40px);
}
[data-mode='minimalista'] .brand-sub,
[data-mode='minimalista'] .composer-hint {
  opacity: 0;
}
[data-mode='minimalista'] .composer-form {
  max-width: 620px;
}
[data-mode='minimalista'] .caption {
  max-width: min(760px, 80vw);
  font-size: 24px;
}

/* ============================ topo ============================ */

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 48px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-orb,
.pair-orb,
.boot-orb {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff 0 8%, transparent 30%),
    radial-gradient(circle at 50% 50%, var(--c) 0%, var(--c2) 70%, transparent 72%);
  box-shadow:
    0 0 18px rgba(var(--c-rgb), 0.55),
    0 0 40px rgba(var(--c2-rgb), 0.3);
  animation: breathe 5s ease-in-out infinite;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.28em;
}
.brand-sub {
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.4s;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 12px;
  border-radius: 4px;
  border: 1px solid var(--stroke);
  background: rgba(5, 9, 12, 0.6);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
#status-text {
  color: var(--text);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(var(--c-rgb), 0.9);
  animation: pulse 2.6s ease-in-out infinite;
}
[data-agent='thinking'] .status-dot,
[data-agent='speaking'] .status-dot {
  animation-duration: 0.8s;
}
[data-agent='offline'] .status-dot {
  background: var(--danger);
  box-shadow: 0 0 12px rgba(var(--danger-rgb), 0.9);
}
[data-agent='alert'] .status-dot {
  background: var(--warn);
  box-shadow: 0 0 12px rgba(var(--warn-rgb), 0.9);
  animation-duration: 0.5s;
}
.demo-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(var(--warn-rgb), 0.14);
  color: var(--warn);
}

.top-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.top-actions {
  display: flex;
  gap: 8px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: rgba(5, 9, 12, 0.5);
  color: var(--muted);
  transition:
    color 0.25s,
    border-color 0.25s,
    transform 0.25s var(--ease),
    background 0.25s;
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--stroke-2);
  transform: translateY(-1px);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}
.clock-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
}
.clock {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 30px;
  letter-spacing: 0.02em;
}
.clock-s {
  margin-left: 4px;
  font-size: 15px;
  color: var(--faint);
}
.clock-date {
  margin-top: 5px;
  font-size: 12px;
  color: var(--faint);
  text-transform: capitalize;
}

/* ============================ painéis (vidro) ============================ */

.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: var(--r-lg);
  border: 1px solid var(--stroke);
  background: rgba(5, 9, 12, 0.62);
  overflow: hidden;
}
/* marcas de canto: o painel é projetado, não um cartão */
.panel::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  --t: rgba(var(--c-rgb), 0.55);
  background:
    linear-gradient(var(--t), var(--t)) top left / 12px 1px no-repeat,
    linear-gradient(var(--t), var(--t)) top left / 1px 12px no-repeat,
    linear-gradient(var(--t), var(--t)) bottom right / 12px 1px no-repeat,
    linear-gradient(var(--t), var(--t)) bottom right / 1px 12px no-repeat;
}
[data-quality='alta'] .panel,
[data-quality='alta'] .composer-form,
[data-quality='alta'] .modal {
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
}
.col-left .panel,
.col-right #panel-brain {
  flex: 0 0 auto;
}
.col-left #panel-activity {
  flex: 1 1 0;
  min-height: 96px;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 16px 6px;
}
.ph-icon {
  width: 17px;
  height: 17px;
  flex: none;
  stroke: url(#grad-tema);
}
.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.panel-meta {
  margin-left: auto;
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-body {
  padding: 8px 16px 16px;
  min-height: 0;
}
.panel-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
}
.panel-tabs button {
  padding: 4px 11px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--faint);
  transition:
    background 0.25s,
    color 0.25s;
}
.panel-tabs button[aria-selected='true'] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}
#panel-activity .panel-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  border-radius: 6px;
}
#panel-activity .panel-tabs button { border-radius: 4px; min-height: 28px; white-space: nowrap; }
#panel-activity .ph-icon { display: none; }
.autonomy-list { overflow-y: auto; overflow-x: hidden; min-width: 0; }
.autonomy-item { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); min-width: 0; }
.autonomy-item > strong, .autonomy-item summary { display: block; font-size: 13px; overflow-wrap: anywhere; cursor: pointer; }
.autonomy-item small, .source-status { display: block; font-size: 11px; color: var(--faint); margin: 5px 0; overflow-wrap: anywhere; }
.autonomy-item p { font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.autonomy-result { font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.autonomy-result a { color: var(--text); }
.autonomy-result pre { white-space: pre-wrap; }
.autonomy-link { display: block; margin: 8px 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; color: var(--text); }
.autonomy-item.read summary { color: var(--faint); }
.autonomy-item .btn { font-size: 11px; margin-top: 6px; }
.quiet-hours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.quiet-hours label { display: grid; gap: 6px; font-size: 12px; }
.quiet-hours input { min-width: 0; width: 100%; }
.empty {
  margin: 4px 0;
  color: var(--faint);
  font-size: 13.5px;
  line-height: 1.5;
}

.big-num {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 30px;
}
.unit {
  font-size: 11px;
  color: var(--faint);
}

/* sistema */
.sys {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 10px 14px;
  align-items: center;
}
.sys-cpu {
  position: relative;
  grid-row: span 2;
  width: 86px;
  height: 86px;
}
.gauge {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.gauge circle {
  fill: none;
  stroke-width: 7;
}
.gauge-track {
  stroke: rgba(255, 255, 255, 0.07);
}
.gauge-value {
  stroke: url(#grad-tema);
  stroke-linecap: round;
  stroke-dasharray: 0 100;
  transition: stroke-dasharray 0.9s var(--ease);
}
.gauge-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.gauge-label .big-num {
  font-size: 22px;
}
.spark {
  width: 100%;
  height: 34px;
  align-self: end;
}
.spark polyline {
  fill: none;
  stroke: url(#grad-tema);
  stroke-width: 1.6;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.meter {
  grid-column: 1 / -1;
}
.meter-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.meter-val {
  color: var(--text);
}
.bar {
  position: relative;
  height: 6px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 1px;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(var(--c-rgb), 0.45);
  transition: width 0.9s var(--ease);
}
.bar.warn i {
  background: linear-gradient(90deg, #ffd27a, var(--warn));
}
.bar.danger i {
  background: linear-gradient(90deg, var(--warn), var(--danger));
}
.kv {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin: 2px 0 0;
}
.kv-3 {
  grid-template-columns: repeat(3, 1fr);
}
.kv div {
  min-width: 0;
}
.kv dt {
  font-size: 11.5px;
  color: var(--faint);
}
.kv dd {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* clima — discreto: o agora numa linha, o resto em letra miúda (abertura minimalista) */
.weather-now {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0 10px;
  align-items: center;
}
.weather-icon {
  width: 30px;
  height: 30px;
}
.weather-icon * {
  fill: none;
  stroke: url(#grad-tema);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.weather-temp {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 28px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.weather-txt {
  min-width: 0;
}
.weather-desc {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.weather-place {
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.weather-extra {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--faint);
}
.weather-extra b {
  font-weight: 500;
  color: var(--muted);
}
/* previsão numa régua fina: dia, ícone, máx/mín; sem caixinhas */
.weather-days {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 8px;
  border-top: 1px solid var(--stroke);
}
.weather-day {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 0 0;
  font-size: 11.5px;
  color: var(--faint);
  text-transform: capitalize;
}
.weather-day + .weather-day {
  padding-left: 8px;
  border-left: 1px solid var(--stroke);
}
.weather-day svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.weather-day b {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text);
}

/* atividade e rotinas */
.activity,
.routines {
  flex: 1 1 auto;
  min-height: 60px;
  list-style: none;
  margin: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}
.activity li,
.routines li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
  line-height: 1.4;
  animation: fade-in 0.45s var(--ease);
}
.activity li + li,
.routines li + li {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.activity time {
  font-family: var(--font-display);
  font-size: 11.5px;
  color: var(--faint);
  padding-top: 1px;
}
.activity span {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.activity .k-error span {
  color: #ffb3c0;
}
.activity .k-fallback span,
.activity .k-approval span {
  color: #ffd9a8;
}
.routines li {
  grid-template-columns: 8px 1fr;
}
.routines .dot {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 8px rgba(var(--c-rgb), 0.8);
}
.routines .off .dot {
  background: var(--faint);
  box-shadow: none;
}
.routines small {
  display: block;
  font-size: 11.5px;
  color: var(--faint);
}
.activity li.empty-li,
.routines li.single {
  grid-template-columns: 1fr;
  border: 0;
}
.activity li.empty-li span:first-child {
  display: none;
}

/* cérebro */
.brain-model {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
#brain-model {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brain-provider {
  font-size: 12px;
  color: var(--faint);
}
.fallback-on {
  color: var(--warn);
}

/* ============================ conversa ============================ */

.col-right .panel-chat {
  flex: 1 1 0;
  min-height: 0;
}
.text-btn {
  margin-left: auto;
  padding: 5px 12px;
  border-radius: 3px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  transition:
    color 0.25s,
    border-color 0.25s;
}
.text-btn:hover {
  color: var(--text);
  border-color: var(--stroke-2);
}
.chat-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
  overscroll-behavior: contain;
}
.chat-empty {
  margin: auto;
  max-width: 250px;
  text-align: center;
  color: var(--faint);
  font-size: 14px;
  line-height: 1.6;
}
.msg {
  max-width: 94%;
  font-size: 14.5px;
  line-height: 1.6;
  animation: rise 0.45s var(--ease);
}
.msg-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
  font-size: 11.5px;
  color: var(--faint);
}
.msg.user {
  align-self: flex-end;
}
.msg.user .msg-meta {
  justify-content: flex-end;
}
.msg.user .msg-body {
  padding: 10px 14px;
  border-radius: 6px 6px 2px 6px;
  background: linear-gradient(135deg, rgba(var(--c-rgb), 0.16), rgba(var(--c2-rgb), 0.16));
  border: 1px solid rgba(var(--c-rgb), 0.16);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.assistant {
  align-self: flex-start;
}
.msg.assistant .msg-meta span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
}
.msg.assistant .msg-meta span:first-child::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff 0 10%, transparent 35%),
    var(--grad);
  box-shadow: 0 0 10px rgba(var(--c-rgb), 0.6);
}
.msg-body {
  overflow-wrap: anywhere;
}
.msg-body p {
  margin: 0 0 0.65em;
}
.msg-body p:last-child {
  margin-bottom: 0;
}
.msg-body ul,
.msg-body ol {
  margin: 0.2em 0 0.65em;
  padding-left: 1.3em;
}
.msg-body li {
  margin: 0.2em 0;
}
.msg-body li::marker {
  color: var(--c);
}
.msg-body strong {
  font-weight: 600;
  color: #fff;
}
.msg-body h4,
.msg-body h5 {
  margin: 0.7em 0 0.3em;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
}
.msg-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
}
.msg-body pre {
  margin: 0.6em 0;
  padding: 12px 14px;
  overflow-x: auto;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--stroke);
}
.msg-body pre code {
  padding: 0;
  background: none;
  font-size: 12.5px;
  white-space: pre;
}
.msg-body blockquote {
  margin: 0.5em 0;
  padding-left: 12px;
  border-left: 2px solid rgba(var(--c-rgb), 0.5);
  color: var(--muted);
}
.msg-body a {
  color: var(--c);
}
.msg.streaming .msg-body::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--grad);
  vertical-align: middle;
  animation: pulse 0.9s ease-in-out infinite;
}
.msg.error .msg-body {
  color: #ffc2cc;
}
.msg.cancelled .msg-meta::after {
  content: '· interrompida';
  color: var(--warn);
}
.tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 8px;
}
.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--stroke);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.tool-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--grad);
}
.tool-chip.running::before {
  animation: pulse 0.8s ease-in-out infinite;
}
.tool-chip.ok::before {
  background: var(--ok);
}
.tool-chip.error::before {
  background: var(--danger);
}
.tool-chip small {
  color: var(--faint);
  font-size: 11px;
}
.chat-jump {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 4px;
  border: 1px solid var(--stroke-2);
  background: rgba(10, 14, 24, 0.9);
  color: var(--text);
  font-size: 12.5px;
}

/* barra de mensagem */
.composer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.composer-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  max-width: 720px;
  padding: 8px 8px 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--stroke-2);
  background: rgba(5, 9, 12, 0.78);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}
.composer-form:focus-within {
  border-color: rgba(var(--c-rgb), 0.45);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.45),
    0 0 0 3px rgba(var(--c-rgb), 0.08);
}
#input {
  flex: 1;
  min-width: 0;
  max-height: 132px;
  padding: 9px 4px;
  border: 0;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
}
#input::placeholder {
  color: var(--faint);
}
.file-btn,
.mic-btn,
.send-btn,
.stop-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transition:
    transform 0.2s var(--ease),
    opacity 0.2s,
    box-shadow 0.3s;
}
.file-btn svg,
.mic-btn svg,
.send-btn svg,
.stop-btn svg {
  width: 19px;
  height: 19px;
}
.file-btn:hover:not(:disabled),
.mic-btn:hover,
.stop-btn:hover {
  background: rgba(255, 255, 255, 0.09);
}
.send-btn {
  border: 0;
  background: var(--sinal);
  color: var(--sinal-ink);
  box-shadow: 0 0 18px rgba(var(--sinal-rgb), 0.28);
}
.send-btn svg {
  stroke-width: 2.3;
}
.send-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}
.send-btn:disabled {
  opacity: 0.3;
  box-shadow: none;
  cursor: default;
}
.stop-btn {
  color: var(--warn);
}
.mic-btn.listening {
  border: 0;
  background: var(--grad);
  color: #051018;
  animation: mic-ring 1.3s ease-out infinite;
}
.vivo-btn.ativo {
  border: 0;
  background: var(--grad);
  color: #051018;
  animation: mic-ring 1.3s ease-out infinite;
}
.file-btn.uploading {
  color: var(--c);
  animation: mic-ring 1.3s ease-out infinite;
}
.file-btn:disabled {
  cursor: wait;
  opacity: 0.7;
}
.composer-hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--faint);
  transition: opacity 0.4s;
}

/* ============================ consciência ============================ */

.stage {
  position: relative;
  min-height: 0;
  min-width: 0;
}
.rings {
  position: absolute;
  left: 0;
  top: 0;
  width: 400px;
  height: 400px;
  pointer-events: none;
  overflow: visible;
  opacity: 0;
  transition: opacity 1.4s var(--ease);
}
.rings.ready {
  opacity: 1;
}
.rings .ring {
  fill: none;
  stroke: rgba(var(--text-rgb), 1);
}
.rings .ring-grad {
  fill: none;
  stroke: url(#grad-tema);
}
.rings .sat {
  fill: var(--c);
}
.rings .sat-glow {
  fill: rgba(var(--c-rgb), 0.18);
}
[data-agent='alert'] .rings .ring-grad {
  stroke: var(--warn);
}
[data-agent='offline'] .rings {
  opacity: 0.35;
}
.core-hit {
  position: absolute;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.caption {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(640px, 94%);
  max-height: 34%;
  overflow: hidden;
  text-align: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 300;
  line-height: 1.45;
  color: rgba(var(--text-rgb), 0.94);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
  transition: opacity 0.9s var(--ease);
  pointer-events: none;
}
.caption.faded {
  opacity: 0;
}
.caption .speaker {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============================ modo desenvolvedor ============================ */
.app[data-developer='1'] {
  grid-template-columns: 0 minmax(0, 1fr) 0;
}
.app[data-developer='1'] .col,
.app[data-developer='1'] .caption,
.app[data-developer='1'] .thoughts,
.app[data-developer='1'] .rings {
  opacity: 0;
  pointer-events: none;
}
.app[data-developer='1'] .stage {
  grid-column: 1 / -1;
}
.app[data-developer='1'] #core-canvas {
  opacity: 0.18;
}

@media (max-width: 820px) {
  .app[data-developer='1'] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      'top'
      'stage'
      'composer';
  }
  .app[data-developer='1'] .stage {
    grid-area: stage;
    grid-column: auto;
  }
  .app[data-developer='1'] .col,
  .app[data-developer='1'] .mobile-tabs {
    display: none;
  }
}

/* nuvem de pensamentos */
.thoughts {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.thoughts svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.thoughts path {
  fill: none;
  stroke: rgba(var(--text-rgb), 0.28);
  stroke-width: 1;
  transition: opacity 0.6s;
}
.thoughts path.kw {
  stroke: rgba(var(--text-rgb), 0.16);
  stroke-dasharray: 1 6;
  stroke-linecap: round;
}
.thoughts path.flow {
  stroke: var(--sinal);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 2 70;
  animation: flow 1.6s linear infinite;
}
.thoughts path.old {
  opacity: 0.35;
}
/* Região acesa: chamada de HUD (nome da região, marcador, ferramenta), sublinhada pela linha
   que chega do núcleo. Sem pílula: é projeção, não botão. */
.tnode {
  position: absolute;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 1px;
  max-width: 240px;
  padding: 2px 4px 5px 0;
  border-bottom: 1px solid rgba(var(--c-rgb), 0.3);
  background: linear-gradient(90deg, rgba(5, 9, 12, 0.72), rgba(5, 9, 12, 0));
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transform: translate(0, -50%);
  animation: node-in 0.3s var(--ease) both;
  /* posição sem transição: o fio é desenhado já no lugar final e o nó tem de estar lá */
  transition: opacity 0.4s;
}
.tnode .tregiao {
  grid-column: 1 / -1;
  font: 500 10.5px/1.2 var(--font-display);
  letter-spacing: 0.06em;
  color: rgba(var(--c-rgb), 0.72);
}
.tnode.running .tregiao {
  color: var(--sinal);
}
.tnode.kw .tregiao {
  display: none;
}
.tnode.left {
  transform: translate(-100%, -50%);
  flex-direction: row-reverse;
  padding: 2px 9px 2px 12px;
}
.tnode .port {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 1px;
  transform: rotate(45deg);
  background: var(--c);
  box-shadow: 0 0 8px rgba(var(--c-rgb), 0.6);
}
.tnode.running .port {
  background: var(--sinal);
  box-shadow: 0 0 10px rgba(var(--sinal-rgb), 0.85);
  animation: pulse 0.8s ease-in-out infinite;
}
.tnode.ok .port {
  background: var(--c);
  box-shadow: none;
}
.tnode.error .port {
  background: var(--danger);
  box-shadow: 0 0 10px rgba(var(--danger-rgb), 0.8);
}
.tnode .tlabel {
  overflow: hidden;
  text-overflow: ellipsis;
}
.tnode .tbadge {
  font-size: 11px;
  color: var(--faint);
}
.tnode .tprev {
  position: absolute;
  top: 100%;
  left: 20px;
  margin-top: 4px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  font-weight: 400;
  color: var(--faint);
}
.tnode.kw {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 2px 4px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 400;
  color: rgba(var(--text-rgb), 0.62);
  animation:
    node-in 0.6s var(--ease) both,
    float 7s ease-in-out infinite;
}
.tnode.kw .port {
  width: 5px;
  height: 5px;
  box-shadow: none;
  opacity: 0.8;
}
.tnode.old {
  opacity: 0.4;
}
.tnode.leaving {
  opacity: 0;
}

/* ============================ avisos ============================ */

.banner,
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 18px;
  border-radius: 4px;
  border: 1px solid var(--stroke-2);
  background: rgba(12, 16, 28, 0.92);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  animation: rise 0.35s var(--ease);
}
.banner {
  top: 78px;
  z-index: 20;
  border-color: rgba(var(--danger-rgb), 0.35);
  color: #ffd1d9;
}
.banner.info {
  border-color: var(--stroke-2);
  color: var(--text);
}
.toast {
  bottom: 104px;
  z-index: 40;
  max-width: min(460px, 90vw);
  text-align: center;
}

/* ============================ janelas ============================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 4, 8, 0.55);
  animation: fade-in 0.25s var(--ease);
}
.modal {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid var(--stroke-2);
  background: rgba(7, 11, 15, 0.97);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: modal-in 0.4s var(--ease);
  scrollbar-width: thin;
}
.modal-wide {
  width: min(600px, 100%);
}
.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 10px;
  background: linear-gradient(180deg, rgba(20, 25, 40, 0.98), rgba(20, 25, 40, 0.85));
}
.modal-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}
.modal-head .icon-btn {
  margin-left: auto;
}
.modal-alert {
  border-color: rgba(var(--warn-rgb), 0.45);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(var(--warn-rgb), 0.15);
}
.modal-alert .ph-icon {
  stroke: var(--warn);
}
.approval-desc {
  margin: 8px 20px 10px;
  font-size: 15px;
  line-height: 1.55;
}
.approval-command {
  margin: 0 20px;
  padding: 12px 14px;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(var(--warn-rgb), 0.25);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.approval-command:empty {
  display: none;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 20px 20px;
}

a.btn {
  display: inline-block;
  text-decoration: none;
}
/* Digitação: cursor piscando no fim da resposta enquanto ela ainda está sendo "escrita". */
.msg.digitando .msg-body > :last-child::after,
.msg.digitando .msg-body:empty::after {
  content: '';
  display: inline-block;
  width: 0.5em;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: rgba(var(--c-rgb), 0.85);
  box-shadow: 0 0 10px rgba(var(--c-rgb), 0.6);
  animation: cursor-pisca 0.9s steps(1) infinite;
}
@keyframes cursor-pisca {
  50% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .msg.digitando .msg-body > :last-child::after {
    animation: none;
  }
}
.btn {
  padding: 9px 18px;
  border-radius: 4px;
  border: 1px solid var(--stroke-2);
  background: rgba(255, 255, 255, 0.05);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  transition:
    background 0.25s,
    transform 0.2s var(--ease),
    box-shadow 0.25s;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn-primary {
  border: 0;
  background: var(--sinal);
  color: var(--sinal-ink);
  box-shadow: 0 0 18px rgba(var(--sinal-rgb), 0.25);
}
.btn-primary:hover {
  background: var(--grad);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
}

/* configurações */
.settings {
  padding: 0 20px 20px;
}
.settings-sec {
  padding: 14px 0 16px;
}
.settings-sec + .settings-sec {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.settings-sec h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}
.field-label {
  font-size: 12.5px;
  color: var(--faint);
}
.field-note {
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
#discord-origem-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
#discord-origem {
  flex: 1 1 240px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--stroke-2);
  border-radius: 4px;
  font: inherit;
}
.field-note.error {
  color: #ffb3c0;
}
.field-note.ok {
  color: var(--ok);
}
.row {
  display: flex;
  gap: 8px;
}
.row > input,
.row > select {
  flex: 1;
  min-width: 0;
}
input[type='text'],
select {
  padding: 10px 14px;
  border-radius: 4px;
  border: 1px solid var(--stroke-2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
input[type='text']:focus,
select:focus {
  border-color: rgba(var(--c-rgb), 0.5);
}
select option {
  background: #10141f;
}
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.swatch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px 6px 7px;
  border-radius: 4px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.swatch i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}
.swatch[aria-checked='true'],
.seg button[aria-checked='true'] {
  color: var(--text);
  border-color: rgba(var(--c-rgb), 0.5);
  background: rgba(var(--c-rgb), 0.1);
}
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  align-self: flex-start;
}
.seg button {
  padding: 6px 15px;
  border-radius: 3px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  cursor: pointer;
}
.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-ui {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.25s;
}
.toggle-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s var(--ease);
}
.toggle input:checked + .toggle-ui {
  background: var(--sinal);
}
.toggle input:checked + .toggle-ui::after {
  transform: translateX(18px);
}
.toggle input:focus-visible + .toggle-ui {
  outline: 2px solid rgba(var(--c-rgb), 0.7);
  outline-offset: 2px;
}
.pair-result {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 8px;
}
.pair-qr {
  width: 170px;
  height: 170px;
  padding: 8px;
  border-radius: 6px;
  background: #fff;
}
.pair-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}
.pair-code {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.1em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pair-url {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.pair-steps {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.devices-title {
  margin: 18px 0 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--faint);
}
.devices {
  list-style: none;
  margin: 0;
  padding: 0;
}
.devices li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  font-size: 13.5px;
}
.devices li + li {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.devices li small {
  display: block;
  color: var(--faint);
  font-size: 12px;
}
.devices li .btn {
  margin-left: auto;
  padding: 5px 12px;
  font-size: 12px;
}
kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--stroke-2);
  background: rgba(255, 255, 255, 0.04);
}

/* tela de pareamento do celular */
.pair-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(60vw 50vh at 50% 20%, rgba(var(--c-rgb), 0.14), transparent 70%),
    radial-gradient(50vw 50vh at 50% 100%, rgba(var(--c2-rgb), 0.14), transparent 70%),
    var(--bg);
}
.pair-card {
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 30px 24px 24px;
  border-radius: 8px;
  border: 1px solid var(--stroke-2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow);
}
.pair-orb {
  width: 58px;
  height: 58px;
  margin: 0 auto 8px;
}
.pair-card h1 {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
}
.pair-card p {
  margin: 0 0 10px;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}
.pair-card label {
  font-size: 12.5px;
  color: var(--faint);
}
.pair-card input {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.08em;
}
.pair-card .btn {
  margin-top: 8px;
  padding: 12px;
}
.pair-error {
  min-height: 1.2em;
  margin: 0;
  color: #ffb3c0;
  font-size: 13px;
  text-align: center;
}

/* inicialização */
.boot {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition:
    opacity 1s var(--ease),
    visibility 1s;
}
.boot.done {
  opacity: 0;
  visibility: hidden;
}
.boot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.boot-orb {
  width: 64px;
  height: 64px;
}
.boot-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.5em;
  margin-right: -0.5em;
  animation: boot-in 1.2s var(--ease) both;
}
.boot-line {
  font-size: 13px;
  color: var(--faint);
}

/* ============================ animações ============================ */

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.85);
  }
}
@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.06);
    filter: brightness(1.15);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes node-in {
  from {
    opacity: 0;
    filter: blur(4px);
  }
}
@keyframes float {
  0%,
  100% {
    margin-top: 0;
  }
  50% {
    margin-top: -7px;
  }
}
@keyframes flow {
  to {
    stroke-dashoffset: -72;
  }
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}
@keyframes boot-in {
  from {
    opacity: 0;
    letter-spacing: 1em;
  }
}
@keyframes mic-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--c-rgb), 0.55);
  }
  100% {
    box-shadow: 0 0 0 16px rgba(var(--c-rgb), 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================ telas menores ============================ */

@media (max-width: 1280px) {
  .app {
    grid-template-columns: minmax(240px, 22vw) minmax(0, 1fr) minmax(290px, 28vw);
  }
  .brand-sub {
    display: none;
  }
}

/* notebook 1366x768 e janelas baixas: tudo um pouco mais compacto */
@media (max-height: 860px) and (min-width: 821px) {
  .app {
    gap: 10px 16px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .col {
    gap: 10px;
  }
  .panel-head {
    padding: 11px 14px 4px;
  }
  .panel-body {
    padding: 6px 14px 12px;
  }
  .sys {
    grid-template-columns: 72px 1fr;
    gap: 7px 12px;
  }
  .sys-cpu {
    width: 72px;
    height: 72px;
  }
  .gauge-label .big-num {
    font-size: 19px;
  }
  .spark {
    height: 26px;
  }
  .meter-top {
    margin-bottom: 4px;
    font-size: 12px;
  }
  .bar {
    height: 5px;
  }
  .weather-temp {
    font-size: 24px;
  }
  .weather-extra,
  .weather-days {
    margin-top: 6px;
  }
  .col-left #panel-activity {
    min-height: 80px;
  }
  .clock {
    font-size: 26px;
  }
}

/* celular e janelas estreitas */
@media (max-width: 820px) {
  html,
  body {
    font-size: 14px;
  }
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(190px, 36dvh) auto minmax(0, 1fr) auto;
    grid-template-areas:
      'top'
      'stage'
      'tabs'
      'pages'
      'composer';
    gap: 10px;
    padding: 10px 12px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .col {
    display: contents;
  }
  .app[data-tab='activity']:not([data-developer='1']) {
    grid-template-rows: auto minmax(120px, 18dvh) auto minmax(0, 1fr) auto;
  }
  .app[data-tab='activity'] .caption {
    font-size: 13px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  .panel {
    grid-area: pages;
    display: none;
  }
  .app[data-tab='chat'] [data-tab-page='chat'],
  .app[data-tab='system'] [data-tab-page='system'],
  .app[data-tab='weather'] [data-tab-page='weather'],
  .app[data-tab='brain'] [data-tab-page='brain'],
  .app[data-tab='activity'] [data-tab-page='activity'] {
    display: flex;
  }
  .mobile-tabs {
    grid-area: tabs;
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--stroke);
  }
  .mobile-tabs button {
    flex: 1 1 0;
    min-width: 0;
    padding: 7px 4px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--faint);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-tabs button.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
  }
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 42px;
  }
  .brand-text {
    display: none;
  }
  .status-pill {
    justify-self: center;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 7px 13px 7px 11px;
    font-size: 12px;
  }
  #status-text {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .demo-badge,
  .clock-date,
  #btn-fullscreen {
    display: none;
  }
  .top-right {
    gap: 8px;
  }
  .top-actions {
    gap: 6px;
  }
  .icon-btn {
    width: 34px;
    height: 34px;
  }
  .clock {
    font-size: 21px;
  }
  .clock-s {
    font-size: 12px;
  }
  .caption {
    font-size: 16px;
    max-height: none;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
  .caption .speaker {
    display: none;
  }
  .composer-hint {
    display: none;
  }
  .composer-form {
    border-radius: 8px;
  }
  .mic-btn {
    width: 44px;
    height: 44px;
  }
  .pair-result {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  [data-mode='minimalista'] .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      'top'
      'stage'
      'composer';
  }
  [data-mode='minimalista'] .mobile-tabs,
  [data-mode='minimalista'] .panel {
    display: none !important;
  }
  .banner {
    top: 60px;
    width: max-content;
    max-width: 92vw;
    text-align: center;
    font-size: 12px;
  }
  .toast {
    bottom: 88px;
  }
}


/* ---------------------------------------------------------------- holo
   A informação aparece flutuando em volta da consciência, sem caixa e sem fundo:
   linhas finas, marcas de canto e um fio ligando cada peça ao núcleo. */

.holo {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: grid;
  grid-template-columns: 1fr var(--orbe, 320px) 1fr;
  grid-template-rows: var(--acima, 1fr) var(--orbe, 320px) 1fr;
  gap: 10px 18px;
  padding: 10px 16px 6px;
  z-index: 4;
}
.holo-zona {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.holo-zona[data-zona='cima'] {
  grid-area: 1 / 2 / 2 / 3;
  align-self: end;
  align-items: center;
  text-align: center;
}
.holo-zona[data-zona='esquerda'] {
  grid-area: 2 / 1 / 3 / 2;
  align-self: center;
  align-items: flex-end;
  text-align: right;
}
.holo-zona[data-zona='direita'] {
  grid-area: 2 / 3 / 3 / 4;
  align-self: center;
  align-items: flex-start;
}
.holo-zona[data-zona='baixo'] {
  grid-area: 3 / 2 / 4 / 3;
  align-self: start;
  align-items: center;
}
.holo-item {
  position: relative;
  width: min(340px, 100%);
  pointer-events: auto;
  color: var(--text);
  font-family: var(--font-text);
  /* a janela é a medida do texto: esticou o cartão, a letra cresce junto */
  container-type: inline-size;
  animation: holo-flutua 7s ease-in-out infinite alternate;
  transition:
    opacity 0.45s var(--ease),
    transform 0.45s var(--ease),
    filter 0.45s var(--ease);
}
.holo-zona[data-zona='esquerda'] .holo-item {
  width: min(300px, 100%);
}
.holo-item:nth-child(2) {
  animation-delay: -2.4s;
}
.holo-item:nth-child(3) {
  animation-delay: -4.8s;
}
@keyframes holo-flutua {
  from {
    transform: translate3d(0, -5px, 0);
  }
  to {
    transform: translate3d(0, 6px, 0);
  }
}


/* palco estreito: as peças descem para uma coluna só, abaixo da consciência */
.holo.holo--coluna {
  grid-template-columns: 1fr;
  grid-template-rows: var(--acima, 1fr) var(--orbe, 260px) auto auto auto;
  gap: 12px;
}
.holo--coluna .holo-zona[data-zona='cima'] {
  grid-area: 1 / 1 / 2 / 2;
}
.holo--coluna .holo-zona[data-zona='direita'] {
  grid-area: 3 / 1 / 4 / 2;
}
.holo--coluna .holo-zona[data-zona='esquerda'] {
  grid-area: 4 / 1 / 5 / 2;
}
.holo--coluna .holo-zona[data-zona='baixo'] {
  grid-area: 5 / 1 / 6 / 2;
}
.holo--coluna .holo-zona {
  align-self: start;
  align-items: stretch;
  text-align: left;
}
.holo--coluna .holo-item,
.holo--coluna .holo-zona[data-zona='esquerda'] .holo-item {
  width: 100%;
}
.holo--coluna .holo-fio {
  display: none;
}
.holo--coluna [data-lado='esquerda'] .holo-topo,
.holo--coluna [data-lado='esquerda'] .holo-linhas li,
.holo--coluna [data-lado='esquerda'] .holo-duplo,
.holo--coluna [data-lado='esquerda'] .holo-medidores {
  flex-direction: row;
  text-align: left;
  justify-content: flex-start;
}


/* painel de vidro: translúcido, borda fina acesa, canto chanfrado e leve perspectiva */
.holo-vidro {
  position: relative;
  padding: 12px 14px 13px;
  font-size: clamp(13px, calc(8px + 1.5cqi), 22px);
  background:
    linear-gradient(160deg, rgba(18, 26, 44, 0.72), rgba(8, 12, 22, 0.55)),
    radial-gradient(120% 80% at 0% 0%, rgba(var(--c-rgb), 0.1), transparent 60%);
  border: 1px solid rgba(var(--c-rgb), 0.24);
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: perspective(1200px) rotateY(0deg);
  transform-origin: 50% 50%;
  transition: transform 0.6s var(--ease);
}
[data-quality='alta'] .holo-vidro {
  backdrop-filter: blur(18px) saturate(140%);
}
.holo-zona[data-zona='esquerda'] .holo-vidro {
  transform: perspective(1200px) rotateY(-7deg);
}
.holo-zona[data-zona='direita'] .holo-vidro {
  transform: perspective(1200px) rotateY(7deg);
}
.holo-zona[data-zona='cima'] .holo-vidro {
  transform: perspective(1200px) rotateX(7deg);
}
.holo-zona[data-zona='baixo'] .holo-vidro {
  transform: perspective(1200px) rotateX(-6deg);
}
.holo--coluna .holo-vidro {
  transform: none;
}
/* risco aceso no topo, como nas telas do Stark */
.holo-vidro::before {
  content: '';
  position: absolute;
  left: 16px;
  right: 10px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--c-rgb), 0.9), rgba(var(--c-rgb), 0));
}
/* vídeo dentro do painel */
.holo-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
  background: #000;
}

/* entrada: materializa; saída: dissolve */
.holo-item.entrando {
  opacity: 0;
  filter: blur(10px);
  transform: scale(0.96);
}
.holo-item.saindo {
  opacity: 0;
  filter: blur(14px) brightness(1.4);
  transform: scale(1.04);
}
.holo-item::after {
  /* varredura de luz ao aparecer */
  content: '';
  position: absolute;
  inset: -6px -10px;
  background: linear-gradient(100deg, transparent 20%, rgba(var(--c-rgb), 0.16) 45%, transparent 70%);
  opacity: 0;
  pointer-events: none;
}
.holo-item.varre::after {
  animation: holo-varre 0.85s var(--ease);
}
@keyframes holo-varre {
  from {
    opacity: 0.9;
    transform: translateX(-30%);
  }
  to {
    opacity: 0;
    transform: translateX(30%);
  }
}

/* fio até o núcleo e marcas de canto */
.holo-fio {
  position: absolute;
  top: 18px;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--c-rgb), 0), rgba(var(--c-rgb), 0.5));
  width: 46px;
  animation: holo-fio 1.1s var(--ease) both;
}
[data-lado='direita'] .holo-fio {
  left: -50px;
}
[data-lado='esquerda'] .holo-fio {
  right: -50px;
  background: linear-gradient(270deg, rgba(var(--c-rgb), 0), rgba(var(--c-rgb), 0.5));
}
[data-lado='cima'] .holo-fio,
[data-lado='baixo'] .holo-fio {
  display: none;
}
@keyframes holo-fio {
  from {
    width: 0;
    opacity: 0;
  }
}
.holo-fio::after {
  content: '';
  position: absolute;
  right: -3px;
  top: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 10px 2px rgba(var(--c-rgb), 0.6);
}
[data-lado='esquerda'] .holo-fio::after {
  right: auto;
  left: -3px;
}

.holo-topo {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  font: 600 0.8em/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c);
  opacity: 0.9;
}
[data-lado='esquerda'] .holo-topo {
  flex-direction: row-reverse;
}
.holo-topo svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}
.holo-topo b {
  font-weight: 600;
  color: rgba(var(--text-rgb), 0.9);
  letter-spacing: 0.1em;
}
.holo-topo::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--c-rgb), 0.45), transparent);
}
[data-lado='esquerda'] .holo-topo::after {
  background: linear-gradient(270deg, rgba(var(--c-rgb), 0.45), transparent);
}

.holo-corpo {
  position: relative;
  padding: 2px 0 0;
}
.holo-vidro::after,
.holo-corpo::after {
  /* cantos finos, como no visor */
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(var(--c-rgb), 0.45);
  pointer-events: none;
}
.holo-corpo::before {
  left: -8px;
  top: -4px;
  border-right: 0;
  border-bottom: 0;
}
.holo-corpo::after {
  right: -8px;
  bottom: -6px;
  border-left: 0;
  border-top: 0;
}

.holo-texto {
  margin: 0;
  font-size: 1em;
  line-height: 1.5;
  color: rgba(var(--text-rgb), 0.86);
  text-shadow: 0 0 18px rgba(var(--c-rgb), 0.25);
}
.holo-grande {
  font: 200 clamp(34px, 13cqi, 76px) / 1 var(--font-display);
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(var(--c-rgb), 0.35));
}
.holo-sub {
  display: block;
  font: 500 0.85em/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
}

.holo-linhas {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.holo-linhas li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  animation: holo-linha 0.5s var(--ease) both;
}
[data-lado='esquerda'] .holo-linhas li {
  flex-direction: row-reverse;
  text-align: right;
}
.holo-linhas li:last-child {
  border-bottom: 0;
}
.holo-linhas li:nth-child(2) {
  animation-delay: 0.07s;
}
.holo-linhas li:nth-child(3) {
  animation-delay: 0.14s;
}
.holo-linhas li:nth-child(4) {
  animation-delay: 0.21s;
}
.holo-linhas li:nth-child(5) {
  animation-delay: 0.28s;
}
@keyframes holo-linha {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.holo-linhas b {
  font-size: 0.96em;
  font-weight: 500;
  color: rgba(var(--text-rgb), 0.92);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.holo-linhas small,
.holo-item small {
  font: 500 0.8em/1.3 var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.holo-linhas span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
  flex: 1;
}
.holo-hora {
  font: 600 0.85em/1 var(--font-mono);
  color: var(--c);
  font-style: normal;
  letter-spacing: 0.04em;
}

/* miniatura: moldura fina e brilho, sem cartão */
.holo-mini {
  width: 44px;
  height: 44px;
  object-fit: cover;
  flex: none;
  border: 1px solid rgba(var(--c-rgb), 0.35);
  box-shadow: 0 0 22px rgba(var(--c-rgb), 0.2);
  background: rgba(255, 255, 255, 0.03);
}
.holo-capa {
  width: 74px;
  height: 74px;
  object-fit: cover;
  flex: none;
  border: 1px solid rgba(var(--c-rgb), 0.35);
  box-shadow: 0 0 30px rgba(var(--c-rgb), 0.25);
}
.holo-larga {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(var(--c-rgb), 0.3);
  box-shadow: 0 0 34px rgba(var(--c-rgb), 0.18);
}
.holo-marca {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid rgba(var(--c-rgb), 0.3);
  color: var(--c);
}
.holo-marca.grande {
  width: 74px;
  height: 74px;
}
.holo-marca svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.holo-duplo {
  display: flex;
  align-items: center;
  gap: 12px;
}
[data-lado='esquerda'] .holo-duplo {
  flex-direction: row-reverse;
}
.holo-duplo > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.holo-duplo b {
  font: 500 1.15em/1.2 var(--font-display);
  color: var(--text);
}
.holo-arquivo {
  margin-bottom: 9px;
}
.holo-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-top: 11px;
  padding: 7px 13px;
  border: 1px solid rgba(var(--c-rgb), 0.42);
  color: var(--text);
  background: rgba(var(--c-rgb), 0.1);
  text-decoration: none;
  font: 500 0.92em/1 var(--font-display);
  text-transform: uppercase;
}
.holo-download:hover {
  border-color: rgba(var(--c-rgb), 0.75);
  background: rgba(var(--c-rgb), 0.18);
}

/* barrinhas de som */
.eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
  margin-top: 4px;
}
[data-lado='esquerda'] .eq {
  justify-content: flex-end;
}
.eq i {
  width: 3px;
  background: var(--grad);
  animation: eq 900ms var(--ease) infinite alternate;
}
.eq i:nth-child(1) {
  height: 40%;
}
.eq i:nth-child(2) {
  height: 75%;
  animation-delay: 120ms;
}
.eq i:nth-child(3) {
  height: 55%;
  animation-delay: 240ms;
}
.eq i:nth-child(4) {
  height: 95%;
  animation-delay: 60ms;
}
.eq i:nth-child(5) {
  height: 45%;
  animation-delay: 300ms;
}
.eq i:nth-child(6) {
  height: 80%;
  animation-delay: 180ms;
}
.eq i:nth-child(7) {
  height: 35%;
  animation-delay: 360ms;
}
@keyframes eq {
  to {
    height: 15%;
  }
}

.spark {
  width: 100%;
  height: 34px;
  margin-top: 6px;
  stroke-dasharray: 400;
  animation: desenha 1.2s var(--ease) both;
}
@keyframes desenha {
  from {
    stroke-dashoffset: 400;
  }
}

.holo-numeros {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
}
.holo-numeros > div {
  display: flex;
  flex-direction: column;
  animation: holo-linha 0.5s var(--ease) both;
}
.holo-numeros b {
  font: 200 2.3em/1 var(--font-display);
  color: var(--text);
  text-shadow: 0 0 20px rgba(var(--c-rgb), 0.3);
}

.holo-medidores {
  display: flex;
  gap: 16px;
}
[data-lado='esquerda'] .holo-medidores {
  justify-content: flex-end;
}
.medidor {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  animation: holo-linha 0.5s var(--ease) both;
}
.medidor svg {
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 10px rgba(var(--c-rgb), 0.35));
}
.medidor .trilho {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3;
}
.medidor .arco {
  fill: none;
  stroke: var(--c);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s var(--ease);
}
.medidor b {
  position: absolute;
  top: 24px;
  font: 300 1.23em/1 var(--font-display);
  color: var(--text);
}
.medidor span {
  position: absolute;
  bottom: 4px;
  font: 500 0.73em/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

/* lâmpada da casa */
.holo-luz {
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid rgba(var(--c-rgb), 0.3);
  position: relative;
}
.holo-luz::after {
  content: '';
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transition:
    background 0.6s var(--ease),
    box-shadow 0.6s var(--ease);
}
.on .holo-luz::after {
  background: var(--warn);
  box-shadow: 0 0 26px 6px rgba(var(--warn-rgb), 0.55);
}

/* alerta */
.holo-item.tom-alerta .holo-topo,
.holo-item.tom-alerta .holo-fio::after {
  color: var(--danger);
}
.holo-item.tom-alerta .holo-topo::after {
  background: linear-gradient(90deg, rgba(var(--danger-rgb), 0.5), transparent);
}
.holo-item.tom-alerta .holo-corpo::before,
.holo-item.tom-alerta .holo-corpo::after {
  border-color: rgba(var(--danger-rgb), 0.6);
  animation: pisca-canto 1.4s var(--ease) infinite;
}
@keyframes pisca-canto {
  50% {
    opacity: 0.25;
  }
}

.holo-fechar {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border: 0;
  background: none;
  color: var(--faint);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
[data-lado='esquerda'] .holo-fechar {
  right: auto;
  left: -6px;
}
.holo-item:hover .holo-fechar {
  opacity: 1;
}

/* com holograma no ar, as colunas saem de cena */
.app[data-holo='1'] .col {
  opacity: 0.12;
  filter: blur(3px);
  transform: scale(0.99);
  pointer-events: none;
}
.app[data-holo='1'] .caption {
  opacity: 0;
}

/* ---------------------------------------------------------------- passos
   O que ele está fazendo, com ícone, no canto de baixo do palco. */

.passos {
  position: absolute;
  left: 0;
  bottom: 74px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  width: min(320px, 46%);
  pointer-events: none;
  z-index: 5;
}
.passo {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 3px 2px;
  font: 500 10.5px/1.3 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition:
    opacity 0.3s var(--ease),
    transform 0.3s var(--ease);
}
.passo span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.passo.entrando,
.passo.saindo {
  opacity: 0;
  transform: translateX(-8px);
}
.p-icone {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--c);
}
.p-icone svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}
.passo.rodando .p-icone {
  animation: gira-passo 1.8s linear infinite;
}
@keyframes gira-passo {
  to {
    transform: rotate(360deg);
  }
}
.passo.feito {
  color: var(--faint);
}
.passo.feito .p-icone {
  color: var(--ok);
}
.passo.erro .p-icone {
  color: var(--danger);
}
.p-tempo {
  margin-left: auto;
  color: var(--faint);
}

@media (max-width: 820px) {
  .holo {
    grid-template-columns: 1fr;
    grid-template-rows: var(--acima, 1fr) var(--orbe, 260px) 1fr;
  }
  .holo-zona[data-zona='cima'] {
    grid-area: 1 / 1 / 2 / 2;
  }
  .holo-zona[data-zona='esquerda'],
  .holo-zona[data-zona='direita'],
  .holo-zona[data-zona='baixo'] {
    grid-area: 3 / 1 / 4 / 2;
    align-self: start;
    align-items: stretch;
    text-align: left;
  }
  .holo-item {
    width: 100%;
  }
  [data-lado='esquerda'] .holo-linhas li,
  [data-lado='esquerda'] .holo-duplo,
  [data-lado='esquerda'] .holo-topo {
    flex-direction: row;
    text-align: left;
  }
  .holo-fio {
    display: none;
  }
  .passos {
    bottom: 6px;
    width: 88%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .holo-item,
  .eq i,
  .spark,
  .holo-linhas li,
  .medidor,
  .passo.rodando .p-icone,
  .holo-item.tom-alerta .holo-corpo::before,
  .holo-item.tom-alerta .holo-corpo::after {
    animation: none;
  }
}

/* ---------------------------------------------------------------- repouso e chegada
   Sem ninguém por perto: a tela apaga e fica só a consciência respirando.
   Palma ou toque: tudo volta com uma onda de luz. */

.app[data-repouso='1'] .col,
.app[data-repouso='1'] .topbar,
.app[data-repouso='1'] .composer,
.app[data-repouso='1'] .composer-hint,
.app[data-repouso='1'] .passos,
.app[data-repouso='1'] .caption {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.6s var(--ease);
}
.app[data-repouso='1'] .stage {
  filter: saturate(0.75);
}
.app[data-repouso='1']::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(70% 60% at 50% 45%, transparent, rgba(0, 0, 0, 0.72) 100%);
  pointer-events: none;
  animation: repouso-escurece 2s var(--ease) both;
  z-index: 1;
}
@keyframes repouso-escurece {
  from {
    opacity: 0;
  }
}

/* chegada: onda de luz saindo do centro */
.app[data-chegada='1']::before {
  content: '';
  position: fixed;
  left: 50%;
  top: 44%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  border: 1px solid rgba(var(--c-rgb), 0.55);
  pointer-events: none;
  z-index: 2;
  animation: chegada-onda 1.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes chegada-onda {
  from {
    transform: scale(1);
    opacity: 0.9;
  }
  to {
    transform: scale(180);
    opacity: 0;
  }
}
.app[data-chegada='1'] .col,
.app[data-chegada='1'] .topbar,
.app[data-chegada='1'] .composer {
  animation: chegada-entra 1.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.app[data-chegada='1'] .col-left {
  animation-delay: 0.1s;
}
.app[data-chegada='1'] .col-right {
  animation-delay: 0.2s;
}
@keyframes chegada-entra {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app[data-chegada='1']::before,
  .app[data-chegada='1'] .col,
  .app[data-chegada='1'] .topbar,
  .app[data-chegada='1'] .composer,
  .app[data-repouso='1']::after {
    animation: none;
  }
}

/* galeria de fotos no holograma */
.holo-galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 6px;
}
.holo-galeria img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid rgba(var(--c-rgb), 0.25);
  animation: holo-linha 0.5s var(--ease) both;
  transition: transform 0.4s var(--ease);
}
.holo-galeria img:hover {
  transform: scale(1.06);
  border-color: rgba(var(--c-rgb), 0.7);
}

/* ---------------------------------------------------------------- janelas vivas
   Cada informação é uma janela que o senhor agarra pelo título e leva para onde quiser,
   puxa o canto para crescer e amplia com dois cliques. Várias ao mesmo tempo. */

.holo {
  display: block; /* nada de grade: cada janela tem seu lugar */
  padding: 0;
}
.holo-item {
  position: absolute;
  left: 0;
  top: 0;
  width: min(340px, 42vw);
  will-change: transform;
}
.holo-item.arrastando {
  cursor: grabbing;
  transition: none;
  animation: none;
}
.holo-item.arrastando .holo-vidro {
  transform: none;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  border-color: rgba(var(--c-rgb), 0.55);
}
.holo-item.redimensionado .holo-corpo {
  height: var(--altura, auto);
  overflow: auto;
}
.holo-topo {
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.holo-btn {
  border: 0;
  background: none;
  color: var(--faint);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  opacity: 0;
  transition: opacity 0.25s var(--ease), color 0.25s var(--ease);
}
.holo-item:hover .holo-btn,
.holo-item:focus-within .holo-btn {
  opacity: 1;
}
.holo-btn:hover {
  color: var(--text);
}
.holo-fechar {
  position: static;
  font-size: 15px;
}
.holo-puxador {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  touch-action: none;
  background: linear-gradient(135deg, transparent 50%, rgba(var(--c-rgb), 0.45) 50%, rgba(var(--c-rgb), 0.45) 60%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.holo-item:hover .holo-puxador {
  opacity: 1;
}

/* janela em foco: toma o palco; as outras recuam sem sumir */
.holo-item.em-foco {
  left: 50% !important;
  top: 50% !important;
  width: min(1000px, 88%) !important;
  transform: translate(-50%, -50%) !important;
  animation: none;
  z-index: 50;
}
.holo-item.em-foco .holo-vidro {
  transform: none !important;
  padding: 18px 22px;
}
.holo-item.em-foco .holo-corpo {
  height: auto;
  max-height: 62vh;
  overflow: auto;
}
.holo-item.em-foco .holo-galeria {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.holo-item.em-foco .holo-fio {
  display: none;
}
.holo-item.apagada {
  opacity: 0.16;
  filter: blur(2px);
  pointer-events: none;
}

/* no celular as janelas voltam a se empilhar sozinhas */
@media (max-width: 820px) {
  .holo-item {
    width: 88% !important;
  }
  .holo-puxador {
    display: none;
  }
}

/* a camada das janelas cobre a tela inteira: o senhor pode largar no canto que quiser */
.holo {
  position: fixed;
  inset: 0;
  z-index: 30;
}
.holo-item {
  pointer-events: auto;
}

/* visor 3D dentro da janela */
.holo-3d {
  position: relative;
  width: 100%;
  height: var(--altura3d, 240px);
}
.holo-item.em-foco .holo-3d {
  height: min(60vh, 560px);
}
.holo-3d canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
.holo-3d canvas:active {
  cursor: grabbing;
}
.holo-3d-dica,
.holo-3d-cred {
  position: absolute;
  left: 0;
  font: 500 9.5px/1.2 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  pointer-events: none;
}
.holo-3d-dica { bottom: 2px; }
.holo-3d-cred { top: 2px; right: 0; left: auto; opacity: 0.6; }

/* ---------------------------------------------------------------- vidro aberto
   Nada de caixa fechada: a janela desvanece nas bordas, como se continuasse fora da tela.
   Só o traço de luz no topo, as marcas de canto e o conteúdo. */

.holo-vidro {
  border: 0 !important;
  clip-path: none !important;
  background:
    radial-gradient(120% 120% at 20% 0%, rgba(var(--c-rgb), 0.08), transparent 55%),
    linear-gradient(170deg, rgba(14, 20, 34, 0.5), rgba(8, 12, 22, 0.16) 70%, transparent 100%) !important;
  box-shadow: none !important;
  -webkit-mask-image: radial-gradient(130% 115% at 30% 20%, #000 55%, rgba(0, 0, 0, 0.55) 78%, transparent 100%);
  mask-image: radial-gradient(130% 115% at 30% 20%, #000 55%, rgba(0, 0, 0, 0.55) 78%, transparent 100%);
  padding: 14px 16px 16px !important;
}
[data-quality='alta'] .holo-vidro {
  backdrop-filter: blur(22px) saturate(125%);
}
/* traço de luz que nasce no canto e some para fora */
.holo-vidro::before {
  left: 0;
  right: 0;
  background: linear-gradient(90deg, rgba(var(--c-rgb), 0.85), rgba(var(--c-rgb), 0.18) 40%, transparent 85%) !important;
}
/* marca de canto discreta, só em dois cantos */
.holo-vidro::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  border-left: 1px solid rgba(var(--c-rgb), 0.55);
  border-top: 1px solid rgba(var(--c-rgb), 0.55);
  pointer-events: none;
}
.holo-corpo::before {
  display: none;
}
.holo-corpo::after {
  right: 2px;
  bottom: 0; /* nada de sobrar 2px: isso fazia nascer barra de rolagem à toa */
  border-color: rgba(var(--c-rgb), 0.3);
}
.holo-item.arrastando .holo-vidro {
  -webkit-mask-image: none;
  mask-image: none;
  background: linear-gradient(170deg, rgba(16, 24, 40, 0.72), rgba(8, 12, 22, 0.5)) !important;
}
.holo-linhas li {
  border-bottom-color: rgba(255, 255, 255, 0.045);
}
/* texto e números maiores: o senhor lê de longe */
.holo-texto {
  font-size: 1.08em;
  line-height: 1.55;
}
.holo-linhas b {
  font-size: 1.04em;
}
.holo-topo {
  font-size: 0.85em;
  letter-spacing: 0.2em;
}
.holo-item.em-foco .holo-texto {
  font-size: 1em; /* em foco a janela já é larga: a base cresceu com ela */
  line-height: 1.6;
}
.holo-item.em-foco .holo-linhas b {
  font-size: 1em;
}
.holo-item.em-foco .holo-topo {
  font-size: 0.62em;
}
.holo-item.em-foco .holo-grande {
  font-size: clamp(56px, 11cqi, 110px);
}

/* ================================================================= JARVIS AMPLIAR
   "Jarvis, ampliar": a tela vira uma mesa holográfica. O núcleo encolhe até virar a
   raiz no centro, as janelas se abrem em órbita à volta dele e raízes de luz ligam
   cada uma ao meio — a informação sai da mesa, não de uma caixa. */

.app[data-amplo='1'] .col,
.app[data-amplo='1'] .caption,
.app[data-amplo='1'] .topbar,
.app[data-amplo='1'] .passos {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s var(--ease);
}
/* o núcleo vira só a semente no meio da mesa */
.app[data-amplo='1'] #core-canvas {
  opacity: 0.6;
  transition: opacity 0.9s var(--ease);
}
.app[data-amplo='1'] .rings {
  opacity: 0.3;
}
.app[data-amplo='1'] .thoughts {
  opacity: 0;
}

/* a mesa (como a mesa holográfica 880 das referências): um disco em perspectiva debaixo da
   semente — grade de anéis e raios girando devagar no próprio plano, e a borda com régua. */
.app[data-amplo='1'] .holo::before,
.app[data-amplo='1'] .holo::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 56%;
  width: min(94vw, 1280px);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%) perspective(1600px) rotateX(68deg);
  animation: mesa-abre 1.1s var(--ease) both;
}
.app[data-amplo='1'] .holo::before {
  background:
    radial-gradient(closest-side, rgba(var(--c-rgb), 0.14), transparent 34%),
    repeating-radial-gradient(closest-side, transparent 0 calc(12.5% - 1px), rgba(var(--c-rgb), 0.08) calc(12.5% - 1px) 12.5%),
    repeating-conic-gradient(rgba(var(--c-rgb), 0.07) 0deg 0.5deg, transparent 0.5deg 15deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 92%);
  mask-image: radial-gradient(closest-side, #000 55%, transparent 92%);
}
/* borda: aro aceso e régua (marca a cada 2°, mais forte a cada 10°) */
.app[data-amplo='1'] .holo::after {
  border: 1px solid rgba(var(--c-rgb), 0.42);
  box-shadow:
    0 0 36px rgba(var(--c-rgb), 0.1),
    inset 0 0 50px rgba(var(--c-rgb), 0.05);
  background:
    repeating-conic-gradient(rgba(var(--c-rgb), 0.6) 0deg 0.3deg, transparent 0.3deg 10deg),
    repeating-conic-gradient(rgba(var(--c-rgb), 0.28) 0deg 0.18deg, transparent 0.18deg 2deg);
  -webkit-mask-image: radial-gradient(closest-side, transparent 92%, #000 92.4% 97.4%, transparent 97.8%);
  mask-image: radial-gradient(closest-side, transparent 92%, #000 92.4% 97.4%, transparent 97.8%);
}
[data-quality='alta'] .app[data-amplo='1'] .holo::before {
  animation: mesa-abre 1.1s var(--ease) both, mesa-gira 140s linear infinite;
}
@keyframes mesa-abre {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/* gira no plano da mesa (transform só: fica no compositor, não repinta o disco) */
@keyframes mesa-gira {
  from {
    transform: translate(-50%, -50%) perspective(1600px) rotateX(68deg) rotateZ(0deg);
  }
  to {
    transform: translate(-50%, -50%) perspective(1600px) rotateX(68deg) rotateZ(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .app[data-amplo='1'] .holo::before {
    animation: none;
  }
}

/* raízes de luz: do centro até cada janela */
.holo-teia {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}
.app[data-amplo='1'] .holo-teia {
  opacity: 1;
}
.holo-teia path {
  fill: none;
  stroke: rgba(var(--c-rgb), 0.28);
  stroke-width: 1;
}
.holo-teia path.seiva {
  stroke: rgba(var(--c-rgb), 0.9);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 14 240;
  filter: drop-shadow(0 0 6px rgba(var(--c-rgb), 0.65));
  animation: holo-seiva 3.4s linear infinite;
}
@keyframes holo-seiva {
  from {
    stroke-dashoffset: 254;
  }
  to {
    stroke-dashoffset: 0;
  }
}
.holo-teia circle {
  fill: var(--c);
  filter: drop-shadow(0 0 7px rgba(var(--c-rgb), 0.8));
}
.holo-teia circle.raiz {
  fill: none;
  stroke: rgba(var(--c-rgb), 0.35);
  stroke-width: 1;
  animation: holo-raiz 3.6s var(--ease) infinite;
}
@keyframes holo-raiz {
  0% {
    r: 10;
    opacity: 0.7;
  }
  100% {
    r: 58;
    opacity: 0;
  }
}

/* as janelas na mesa: maiores, mais legíveis e com leve inclinação de profundidade */
.app[data-amplo='1'] .holo-item {
  z-index: 2;
}
.app[data-amplo='1'] .holo-item:not(.redimensionado) {
  width: clamp(300px, 29vw, 470px) !important;
}
.app[data-amplo='1'] .holo-vidro {
  transform: perspective(1500px) rotateY(var(--inc, 0deg)) rotateX(var(--inc-x, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.7s var(--ease);
  padding: 18px 22px 20px !important;
}
.app[data-amplo='1'] .holo-item.arrastando .holo-vidro,
.app[data-amplo='1'] .holo-item.em-foco .holo-vidro {
  transform: none;
}
.app[data-amplo='1'] .holo-fio {
  display: none;
}
.app[data-amplo='1'] .holo-topo {
  font-size: 0.95em;
  letter-spacing: 0.26em;
}
.app[data-amplo='1'] .holo-texto {
  font-size: 1.28em;
  line-height: 1.62;
}
.app[data-amplo='1'] .holo-linhas b,
.app[data-amplo='1'] .holo-linhas span {
  font-size: 1.2em;
}
.app[data-amplo='1'] .holo-grande {
  font-size: clamp(60px, 14cqi, 118px);
}
.app[data-amplo='1'] .holo-sub {
  font-size: 1em;
}
.app[data-amplo='1'] .holo-corpo {
  max-height: 40vh;
  overflow: auto;
}
.app[data-amplo='1'] .holo-3d {
  height: var(--altura3d, 320px);
}
.app[data-amplo='1'] .holo-galeria {
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}
.app[data-amplo='1'] .holo-capa img {
  max-height: 46vh;
}
/* na mesa, a janela em foco cobre quase tudo e o resto vira sombra */
.app[data-amplo='1'] .holo-item.em-foco {
  width: min(1180px, 92vw) !important;
}
.app[data-amplo='1'] .holo-item.em-foco .holo-texto {
  font-size: 1.05em;
}
.app[data-amplo='1'] .holo-item.em-foco .holo-galeria {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

/* celular: a mesa vira uma coluna alta, sem raízes cruzando a tela */
@media (max-width: 820px) {
  .app[data-amplo='1'] .holo-teia {
    opacity: 0.4;
  }
  .app[data-amplo='1'] .holo-item:not(.redimensionado) {
    width: 92% !important;
  }
  .app[data-amplo='1'] .holo-vidro {
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .holo-teia path.seiva,
  .holo-teia circle.raiz,
  .app[data-amplo='1'] .holo::before {
    animation: none !important;
  }
}

/* barra de rolagem das janelas: fina, na cor do tema, quase invisível */
.holo-corpo {
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--c-rgb), 0.3) transparent;
}
.holo-corpo::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.holo-corpo::-webkit-scrollbar-track {
  background: transparent;
}
.holo-corpo::-webkit-scrollbar-thumb {
  background: rgba(var(--c-rgb), 0.28);
}
.holo-corpo::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--c-rgb), 0.5);
}

/* o trilho da órbita: passa pelas janelas e gira devagar, como uma mesa de verdade */
.holo-teia ellipse.anel {
  fill: none;
  stroke: rgba(var(--c-rgb), 0.3);
  stroke-width: 1.2;
  stroke-dasharray: 3 9;
  transform-box: fill-box;
  transform-origin: center;
}
[data-quality='alta'] .holo-teia ellipse.anel {
  animation: holo-trilho 150s linear infinite;
}
@keyframes holo-trilho {
  from {
    rotate: 0deg;
  }
  to {
    rotate: 360deg;
  }
}
@media (prefers-reduced-motion: reduce) {
  .holo-teia ellipse.anel {
    animation: none !important;
  }
}

/* ---------------------------------------------------------------- fotos na tela
   "só a foto do Trump": a imagem manda na janela, o resto sai da frente. */
.holo-unica {
  display: block;
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  animation: holo-linha 0.5s var(--ease) both;
}
.holo-item.so-imagem .holo-corpo {
  padding: 0;
}
.app[data-amplo='1'] .holo-unica {
  max-height: 46vh;
}
/* galeria com legenda (os três presidentes, por exemplo) */
.holo-galeria figure {
  margin: 0;
  position: relative;
  animation: holo-linha 0.5s var(--ease) both;
}
.holo-galeria figure img {
  animation: none;
}
.holo-galeria figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 6px;
  font-size: 0.8em;
  letter-spacing: 0.04em;
  color: var(--text);
  background: linear-gradient(0deg, rgba(4, 8, 16, 0.86), transparent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app[data-amplo='1'] .holo-galeria figcaption {
  font-size: 0.95em;
  padding: 5px 8px;
}
/* "tira o texto": fica só a imagem */
.holo-item.sem-texto .holo-texto,
.holo-item.sem-texto .holo-linhas,
.holo-item.sem-texto .holo-corpo > small,
.holo-item.sem-texto figcaption,
.holo-item.sem-texto .holo-sub {
  display: none;
}

/* ================================================================ RAMIFICAÇÃO
   A informação não chega solta: o detalhe nasce preso na foto por um fio de luz,
   como um galho. A foto manda; o texto é o ramo. */

.holo-teia {
  opacity: 1; /* os galhos valem em qualquer modo, não só na mesa */
}
.holo-teia path.galho {
  stroke: rgba(var(--c-rgb), 0.42);
  stroke-width: 1.1;
}
.holo-teia path.galho-seiva {
  stroke-dasharray: 8 150;
  animation-duration: 4.2s;
}
.holo-teia circle.no {
  fill: var(--c);
  filter: drop-shadow(0 0 5px rgba(var(--c-rgb), 0.8));
}

/* o ramo é mais discreto que o assunto principal: ele acompanha, não concorre */
.holo-item.ramo .holo-vidro {
  padding: 12px 15px 14px !important;
  background:
    radial-gradient(120% 120% at 10% 0%, rgba(var(--c-rgb), 0.06), transparent 60%),
    linear-gradient(170deg, rgba(12, 18, 30, 0.42), rgba(8, 12, 22, 0.1) 72%, transparent 100%) !important;
}
.holo-item.ramo .holo-topo {
  font-size: 0.77em;
  opacity: 0.72;
}
.holo-item.ramo .holo-texto {
  font-size: 1.04em;
  line-height: 1.6;
  color: color-mix(in srgb, var(--text) 88%, transparent);
}
.app[data-amplo='1'] .holo-item.ramo .holo-texto {
  font-size: 1.2em;
}
.holo-item.ramo .holo-linhas li {
  border-bottom: 0;
  padding: 3px 0;
}
/* lista suave dentro do ramo: um traço fino no começo de cada linha */
.holo-item.ramo .holo-linhas li::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 12px;
  width: 6px;
  height: 1px;
  background: rgba(var(--c-rgb), 0.5);
}
.holo-item.ramo .holo-linhas li {
  position: relative;
  padding-left: 2px;
}

/* ================================================================== PARTIDA
   O painel abre no escuro absoluto. Uma palma acende a consciência, os sistemas
   sobem um a um e só então a interface aparece. */

.partida {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: #02040a;
  pointer-events: none;
}
.app[data-partida] .partida {
  display: flex;
}
/* tudo o mais some enquanto ele está apagado */
.app[data-partida='espera'] > *:not(.partida):not(.remoto),
.app[data-partida='ligando'] .topbar,
.app[data-partida='ligando'] .col,
.app[data-partida='ligando'] .composer,
.app[data-partida='ligando'] .composer-hint,
.app[data-partida='ligando'] .caption,
.app[data-partida='ligando'] .passos,
.app[data-partida='ligando'] .holo {
  opacity: 0 !important;
  pointer-events: none !important;
}
.app[data-partida='ligando'] .stage {
  opacity: 1 !important;
}

/* a semente: o único sinal de vida no escuro */
.partida-semente {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(var(--c-rgb), 0.9);
  box-shadow: 0 0 14px 3px rgba(var(--c-rgb), 0.45);
  animation: partida-respira 3.4s ease-in-out infinite;
}
@keyframes partida-respira {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.8);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.25);
  }
}
.partida-marca,
.partida-linhas {
  opacity: 0;
}
.partida-dica {
  position: absolute;
  bottom: 12vh;
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.34em;
  text-transform: lowercase;
  color: rgba(var(--c-rgb), 0.45);
  opacity: 0;
  transition: opacity 2.4s var(--ease);
}
.partida-dica.aparece {
  opacity: 1;
  animation: partida-respira 4s ease-in-out infinite;
}

/* ligando: a semente vira explosão, a marca se escreve e os sistemas sobem */
.app[data-partida='ligando'] .partida {
  background: radial-gradient(60% 50% at 50% 46%, rgba(var(--c-rgb), 0.07), #02040a 70%);
}
.app[data-partida='ligando'] .partida-semente {
  animation: partida-acende 1.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes partida-acende {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  55% {
    transform: scale(46);
    opacity: 0.5;
    box-shadow: 0 0 60px 20px rgba(var(--c-rgb), 0.5);
  }
  100% {
    transform: scale(120);
    opacity: 0;
  }
}
.app[data-partida='ligando'] .partida-marca {
  font-family: var(--font-display, inherit);
  font-size: clamp(22px, 3.4vw, 34px);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: var(--text);
  text-shadow: 0 0 24px rgba(var(--c-rgb), 0.5);
  animation: partida-marca 1.5s var(--ease) both;
}
@keyframes partida-marca {
  from {
    opacity: 0;
    letter-spacing: 1.4em;
    filter: blur(8px);
  }
  to {
    opacity: 1;
    letter-spacing: 0.5em;
    filter: blur(0);
  }
}
.app[data-partida='ligando'] .partida-linhas {
  opacity: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  width: min(420px, 78vw);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.partida-linhas li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: 0.12em;
  color: color-mix(in srgb, var(--text) 78%, transparent);
  animation: partida-linha 0.42s var(--ease) both;
}
.partida-linhas li b {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
  color: rgba(var(--c-rgb), 0.92);
}
.partida-linhas li i {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--c-rgb), 0.35), rgba(var(--c-rgb), 0.05));
  transform-origin: left;
  animation: partida-risco 0.5s var(--ease) both;
}
.partida-linhas li span {
  font-variant-numeric: tabular-nums;
}
.partida-linhas li.pronto {
  justify-content: center;
  margin-top: 6px;
}
.partida-linhas li.pronto b {
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--text);
  text-shadow: 0 0 18px rgba(var(--c-rgb), 0.6);
}
@keyframes partida-linha {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
@keyframes partida-risco {
  from {
    transform: scaleX(0);
  }
}
.partida.saindo {
  animation: partida-sai 0.5s var(--ease) both;
}
@keyframes partida-sai {
  to {
    opacity: 0;
    transform: scale(1.04);
  }
}
@media (prefers-reduced-motion: reduce) {
  .partida-semente,
  .partida-dica.aparece,
  .app[data-partida='ligando'] .partida-marca,
  .partida-linhas li,
  .partida-linhas li i {
    animation: none !important;
  }
}

/* a consciência nasce no meio: a marca fica em cima dela e os sistemas embaixo */
.app[data-partida='ligando'] .partida {
  justify-content: space-between;
  padding: 16vh 0 14vh;
}
.app[data-partida='ligando'] .partida-linhas {
  align-self: center;
}
@media (max-height: 620px) {
  .app[data-partida='ligando'] .partida {
    padding: 8vh 0 7vh;
  }
}

/* ============================================ NOTEBOOK QUIETO (o senhor no celular)
   Quando o celular está em uso, o notebook não precisa se esforçar: sem animações
   contínuas, um selo discreto avisando, e a consciência já roda em câmera lenta. */
:root[data-movel='1'] .thoughts,
:root[data-movel='1'] .rings,
:root[data-movel='1'] .eq,
:root[data-movel='1'] .partida-semente,
:root[data-movel='1'] .holo-teia .seiva {
  animation-play-state: paused !important;
}
:root[data-movel='1'] .stage {
  filter: saturate(0.7) brightness(0.85);
  transition: filter 0.8s ease;
}
:root[data-movel='1'] .composer::after {
  content: '📱 em uso no celular';
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(var(--c-rgb), 0.55);
  pointer-events: none;
}

/* ============================================ JANELA DE SISTEMAS
   Cada peça do Jarvis numa linha: ponto aceso pela cor do estado, nome e papel à esquerda,
   o que está acontecendo à direita. A linha do cérebro em uso ganha o risco do tema. */
.holo-sistemas .sis-boletim {
  margin: 0 0 0.7em;
  color: rgba(var(--text-rgb), 0.92);
}
.holo-sistemas .sis-grupo {
  display: block;
  margin: 0.9em 0 0.35em;
  font: 600 0.72em/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(var(--c-rgb), 0.75);
}
.holo-sistemas .sis-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
}
.sis-linha {
  display: grid;
  grid-template-columns: 0.55em minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: center;
  gap: 0.7em;
  padding: 0.42em 0.5em 0.42em 0.45em;
  border-left: 2px solid transparent;
  background: linear-gradient(90deg, rgba(var(--c-rgb), 0.04), transparent 70%);
}
.sis-linha[data-ativo='1'] {
  border-left-color: var(--c);
  background: linear-gradient(90deg, rgba(var(--c-rgb), 0.13), transparent 80%);
}
.sis-ponto {
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: rgba(var(--text-rgb), 0.28);
}
.sis-linha[data-cor='ok'] .sis-ponto {
  background: var(--ok);
  box-shadow: 0 0 8px rgba(61, 255, 180, 0.7);
}
.sis-linha[data-cor='alerta'] .sis-ponto {
  background: var(--warn);
  box-shadow: 0 0 8px rgba(var(--warn-rgb), 0.8);
  animation: sis-pisca 1.6s ease-in-out infinite;
}
.sis-linha[data-cor='falha'] .sis-ponto {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(var(--danger-rgb), 0.8);
}
@keyframes sis-pisca {
  50% {
    opacity: 0.35;
  }
}
.sis-nome,
.sis-estado {
  display: flex;
  flex-direction: column;
  gap: 0.18em;
  min-width: 0;
}
.sis-nome b {
  font-weight: 600;
  font-size: 0.95em;
}
.sis-estado {
  text-align: right;
  font-size: 0.9em;
  color: rgba(var(--text-rgb), 0.86);
}
.sis-linha[data-cor='alerta'] .sis-estado {
  color: var(--warn);
}
.sis-linha[data-cor='falha'] .sis-estado {
  color: var(--danger);
}
.sis-nome small,
.sis-estado small {
  color: var(--faint);
  overflow-wrap: anywhere;
}
.sis-rota {
  margin-top: 0.4em;
  padding-top: 0.2em;
  border-top: 1px solid rgba(var(--c-rgb), 0.14);
}
.sis-opcoes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin: 0.2em 0 0.5em;
}
.sis-opcao {
  padding: 0.42em 0.85em;
  border: 1px solid rgba(var(--c-rgb), 0.22);
  background: rgba(var(--c-rgb), 0.04);
  color: var(--muted);
  font: 500 0.85em/1 var(--font-text);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  cursor: pointer;
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
}
.sis-opcao:hover {
  color: var(--text);
  border-color: rgba(var(--c-rgb), 0.5);
}
.sis-opcao[aria-pressed='true'] {
  color: var(--bg);
  background: var(--c);
  border-color: var(--c);
}
.sis-rota > small {
  display: block;
  color: var(--faint);
}
#panel-brain .panel-head .text-btn {
  margin-left: 10px;
}

/* ============================================ FUNIL DA PESQUISA
   Fontes à esquerda, veias convergindo no núcleo (com o total), galhos até os resultados. */
.holo-funil {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 0.6em;
  overflow: visible;
}
.holo-funil .veia,
.holo-funil .galho {
  fill: none;
  stroke: rgba(var(--c-rgb), 0.38);
  stroke-width: 1;
}
.holo-funil .galho {
  stroke: rgba(var(--sinal-rgb), 0.6);
}
.holo-funil .fim {
  fill: var(--sinal);
}
.holo-funil .nucleo {
  fill: rgba(var(--c-rgb), 0.08);
  stroke: var(--c);
  stroke-width: 1;
}
.holo-funil text {
  font-family: var(--font-display);
  font-size: 9px;
  fill: rgba(var(--text-rgb), 0.7);
}
.holo-funil .fonte {
  text-anchor: end;
}
.holo-funil .conta {
  text-anchor: middle;
  font-size: 11px;
  font-weight: 600;
  fill: var(--c);
}
.holo-funil .saida {
  text-anchor: middle;
  fill: rgba(var(--sinal-rgb), 0.9);
}

/* ============================================ CENTRAL DE INFORMAÇÕES
   Tela inteira: estação no meio (a consciência), grupos em arco dos dois lados, troncos que se
   abrem em galhos até cada pessoa/assunto (refs XSIAM, Enterprise, aglomerados). O titânio
   marca quem está sendo falado agora. */
.central {
  position: fixed;
  inset: 0;
  z-index: 24;
  pointer-events: none;
  animation: cn-entra 0.5s var(--ease) both;
}
.central.saindo {
  animation: cn-sai 0.4s var(--ease) both;
}
@keyframes cn-entra {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes cn-sai {
  to {
    opacity: 0;
  }
}
/* com a central aberta, as colunas saem e o topo/barra de mensagem ficam por cima dela */
.app[data-central='1'] .col,
.app[data-central='1'] .rings,
.app[data-central='1'] .thoughts,
.app[data-central='1'] .passos {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.4s var(--ease);
}
.app[data-central='1'] .topbar,
.app[data-central='1'] .composer {
  position: relative;
  z-index: 26;
}
.central::before {
  /* escurece o fundo sem apagar a estação: vinheta radial */
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 0 18%, rgba(3, 5, 8, 0.72) 70%);
}
.cn-teia {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.cn-anel {
  fill: none;
  stroke: rgba(var(--c-rgb), 0.18);
  stroke-width: 1;
}
.cn-anel.gira {
  stroke: rgba(var(--c-rgb), 0.3);
  stroke-dasharray: 3 9 30 9;
  animation: cn-gira 26s linear infinite;
}
@keyframes cn-gira {
  to {
    transform: rotate(360deg);
  }
}
.cn-marcas {
  stroke: rgba(var(--c-rgb), 0.28);
  stroke-width: 1;
}
.cn-hub-rotulo {
  fill: rgba(var(--text-rgb), 0.55);
  font: 500 10.5px/1 var(--font-display);
  letter-spacing: 0.24em;
  text-anchor: middle;
  text-transform: uppercase;
}
.cn-tronco {
  fill: none;
  stroke: rgba(var(--c-rgb), 0.12);
  stroke-width: 2.2;
  transition: stroke 0.6s var(--ease);
}
.cn-tronco.aceso {
  stroke: rgba(var(--c-rgb), 0.5);
}
.cn-juncao {
  fill: var(--bg);
  stroke: rgba(var(--c-rgb), 0.6);
  stroke-width: 1.2;
}
.cn-galho {
  fill: none;
  stroke: rgba(var(--c-rgb), 0.1);
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition:
    stroke-dashoffset 0.7s var(--ease),
    stroke 0.4s var(--ease),
    stroke-width 0.4s;
}
.cn-galho.aceso {
  stroke: rgba(var(--c-rgb), 0.42);
  stroke-dashoffset: 0;
}
.cn-galho.falando {
  stroke: rgba(var(--sinal-rgb), 0.95);
  stroke-width: 1.6;
}
.cn-ponta {
  fill: rgba(var(--c-rgb), 0.5);
}
.cn-gota {
  fill: var(--sinal);
  filter: drop-shadow(0 0 4px rgba(var(--sinal-rgb), 0.9));
}
.cn-cabecalho {
  position: absolute;
  top: clamp(78px, 11vh, 104px);
  left: clamp(20px, 3vw, 44px);
  max-width: min(460px, 34vw);
}
.cn-rotulo {
  font: 500 10.5px/1 var(--font-display);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--sinal);
}
.cn-titulo {
  margin: 8px 0 12px;
  font: 300 clamp(22px, 2.3vw, 34px)/1.1 var(--font-display);
  color: var(--text);
}
.cn-contagem {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 10px 0 0;
  list-style: none;
  border-top: 1px solid rgba(var(--c-rgb), 0.18);
}
.cn-contagem li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.cn-contagem b {
  font: 500 20px/1 var(--font-display);
  color: var(--c);
  font-variant-numeric: tabular-nums;
}
.cn-fechar {
  position: absolute;
  top: clamp(78px, 11vh, 104px);
  right: clamp(20px, 3vw, 44px);
  pointer-events: auto;
  padding: 7px 12px;
  border: 1px solid rgba(var(--c-rgb), 0.3);
  border-radius: var(--r-sm);
  background: rgba(5, 9, 12, 0.6);
  color: var(--muted);
  font: 500 12px/1 var(--font-display);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.cn-fechar:hover {
  color: var(--text);
  border-color: var(--c);
}
.cn-grupo {
  position: absolute;
  transform: translate(-50%, calc(-100% - 12px));
  font: 500 10.5px/1 var(--font-display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(var(--text-rgb), 0.7);
  white-space: nowrap;
}
.cn-grupo b {
  margin-left: 4px;
  color: var(--sinal);
}
.cn-no {
  position: absolute;
  transform: translate(-30px, -50%);
  pointer-events: auto;
  transition:
    opacity 0.5s var(--ease),
    transform 0.5s var(--ease);
}
.cn-no[data-lado='esq'] {
  transform: translate(calc(-100% + 30px), -50%);
}
.cn-no[data-estado='latente'] {
  opacity: 0;
  pointer-events: none;
}
.cn-alvo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.cn-no[data-lado='esq'] .cn-alvo {
  flex-direction: row-reverse;
  text-align: right;
}
.cn-foto {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid rgba(var(--c-rgb), 0.55);
  background: rgba(5, 9, 12, 0.8);
  transition:
    border-color 0.3s,
    box-shadow 0.3s,
    transform 0.3s var(--ease);
}
.cn-foto::after {
  /* anel externo tracejado, como as órbitas das naves da Enterprise */
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(var(--c-rgb), 0.28);
}
.cn-foto img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(0.35) contrast(1.05);
}
.cn-foto i {
  font: 500 18px/1 var(--font-display);
  font-style: normal;
  color: var(--c);
}
.cn-txt {
  display: grid;
  gap: 2px;
  max-width: 190px;
}
.cn-txt b {
  font: 600 14px/1.15 var(--font-display);
  color: var(--text);
}
.cn-txt small {
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--muted);
}
.cn-txt em {
  font: 500 12px/1 var(--font-display);
  font-style: normal;
  color: var(--sinal);
  font-variant-numeric: tabular-nums;
}
.cn-no.falando .cn-foto,
.cn-no.escolhido .cn-foto {
  border-color: var(--sinal);
  box-shadow:
    0 0 0 3px rgba(var(--sinal-rgb), 0.18),
    0 0 22px rgba(var(--sinal-rgb), 0.35);
  transform: scale(1.1);
}
.cn-no.falando .cn-foto img {
  filter: none;
}
.cn-no:hover .cn-foto {
  border-color: var(--c);
}
.cn-alvo:focus-visible {
  outline: 1px solid var(--sinal);
  outline-offset: 6px;
  border-radius: 4px;
}
.cn-detalhe {
  position: absolute;
  z-index: 3;
  width: 250px;
  padding: 14px 16px 16px;
  transform: translate(-50%, 44px);
  pointer-events: auto;
  border: 1px solid rgba(var(--sinal-rgb), 0.55);
  border-radius: var(--r);
  background: rgba(5, 9, 12, 0.92);
  box-shadow: var(--shadow);
  animation: rise 0.25s var(--ease);
}
.cn-det-grupo {
  font: 500 10px/1 var(--font-display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sinal);
}
.cn-detalhe img {
  display: block;
  width: 100%;
  height: 150px;
  margin: 10px 0;
  object-fit: cover;
  border-radius: var(--r-sm);
}
.cn-detalhe h3 {
  margin: 8px 0 4px;
  font: 600 17px/1.2 var(--font-display);
}
.cn-detalhe p {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
}
.cn-det-dado {
  color: var(--sinal) !important;
  font-family: var(--font-display);
}
.cn-det-acoes {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.cn-det-acoes button {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid rgba(var(--c-rgb), 0.35);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font: 500 12px/1 var(--font-display);
  cursor: pointer;
}
.cn-det-acoes button:hover {
  border-color: var(--sinal);
  color: var(--sinal);
}
@media (max-width: 760px) {
  .cn-cabecalho {
    max-width: none;
    right: 20px;
  }
  .cn-fechar {
    top: auto;
    bottom: 96px;
  }
  .cn-no,
  .cn-no[data-lado='esq'] {
    transform: translate(-30px, -50%);
  }
  .cn-no[data-lado='esq'] .cn-alvo {
    flex-direction: row;
    text-align: left;
  }
  .cn-txt {
    max-width: 120px;
  }
  .cn-foto {
    width: 44px;
    height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cn-anel.gira {
    animation: none;
  }
  .cn-galho {
    transition: none;
  }
}

/* ============================================ JANELAS HUD (v3)
   Refs fábrica/joelho/nuvem: cabeçalho com número e etiqueta do tipo (titânio), moldura só
   de cantos, imagem com mira, e cada janela presa ao núcleo por uma chamada em cotovelo.
   Em tela larga elas moram nos trilhos laterais; a consciência fica no meio. */
.holo-item {
  animation: none; /* nada de flutuar: painel de instrumento fica parado */
}
.holo-vidro {
  padding: 0 0 12px;
  clip-path: none;
  border: 1px solid rgba(var(--c-rgb), 0.1);
  border-radius: 2px;
  background:
    linear-gradient(var(--c), var(--c)) left top / 14px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) left top / 1.5px 14px no-repeat,
    linear-gradient(var(--c), var(--c)) right top / 14px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) right top / 1.5px 14px no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / 14px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / 1.5px 14px no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / 14px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / 1.5px 14px no-repeat,
    repeating-linear-gradient(0deg, rgba(var(--c-rgb), 0.025) 0 1px, transparent 1px 3px),
    rgba(4, 8, 11, 0.84);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.holo-vidro::before {
  display: none;
}
.holo-trilhos .holo-vidro,
.holo--trilhos .holo-vidro {
  transform: none;
}
.holo-corpo {
  padding: 10px 14px 0;
}
.holo-corpo::before,
.holo-corpo::after,
.holo-vidro::after {
  display: none;
}
.holo-topo,
[data-lado='esquerda'] .holo-topo {
  flex-direction: row;
  gap: 0;
  margin: 0;
  padding: 0 8px 0 0;
  min-height: 30px;
  border-bottom: 1px solid rgba(var(--c-rgb), 0.18);
  font: 500 12px/1 var(--font-display);
  letter-spacing: 0.04em;
  text-transform: none;
  opacity: 1;
}
.holo-topo::after {
  display: none;
}
.holo-idx {
  align-self: stretch;
  display: grid;
  place-items: center;
  min-width: 30px;
  padding: 0 6px;
  border-right: 1px solid rgba(var(--c-rgb), 0.18);
  font: 500 11px/1 var(--font-display);
  color: rgba(var(--text-rgb), 0.55);
  font-variant-numeric: tabular-nums;
}
.holo-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 10px 0 8px;
  padding: 4px 7px 4px 6px;
  border-radius: 2px;
  background: var(--sinal);
  color: var(--sinal-ink);
  font: 600 10px/1 var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.holo-tag svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
}
.holo-item.tom-alerta .holo-tag {
  background: var(--danger);
  color: #fff;
}
.holo-topo b {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 500 13.5px/1.2 var(--font-display);
  letter-spacing: 0.02em;
  color: var(--text);
}
/* nos trilhos o fio antigo sai: quem liga a janela ao núcleo é a chamada */
.holo--trilhos .holo-fio {
  display: none;
}
.holo-teia .chamada {
  fill: none;
  stroke: rgba(var(--c-rgb), 0.34);
  stroke-width: 1;
}
.holo-teia .chamada-pulso {
  fill: none;
  stroke: var(--sinal);
  stroke-width: 1.6;
  stroke-dasharray: 10 400;
  stroke-linecap: round;
  animation: chamada-corre 3.2s linear infinite;
}
@keyframes chamada-corre {
  from {
    stroke-dashoffset: 410;
  }
  to {
    stroke-dashoffset: 0;
  }
}
.holo-teia .chamada-ponta {
  fill: rgba(var(--c-rgb), 0.7);
}
.holo-teia .chamada-fim {
  fill: var(--bg);
  stroke: var(--c);
  stroke-width: 1.2;
}
/* imagem com mira: cantos, cruz no centro e uma varredura quando chega */
.holo-mira {
  position: relative;
  display: block;
  line-height: 0;
}
.holo-duplo .holo-mira {
  flex: none;
}
.holo-mira img {
  display: block;
  filter: saturate(0.85) contrast(1.05);
}
.mira-cantos {
  position: absolute;
  inset: 6px;
  pointer-events: none;
  background:
    linear-gradient(var(--sinal), var(--sinal)) left top / 12px 1.5px no-repeat,
    linear-gradient(var(--sinal), var(--sinal)) left top / 1.5px 12px no-repeat,
    linear-gradient(var(--sinal), var(--sinal)) right top / 12px 1.5px no-repeat,
    linear-gradient(var(--sinal), var(--sinal)) right top / 1.5px 12px no-repeat,
    linear-gradient(var(--sinal), var(--sinal)) left bottom / 12px 1.5px no-repeat,
    linear-gradient(var(--sinal), var(--sinal)) left bottom / 1.5px 12px no-repeat,
    linear-gradient(var(--sinal), var(--sinal)) right bottom / 12px 1.5px no-repeat,
    linear-gradient(var(--sinal), var(--sinal)) right bottom / 1.5px 12px no-repeat,
    linear-gradient(rgba(var(--c-rgb), 0.5), rgba(var(--c-rgb), 0.5)) center / 1px 14px no-repeat,
    linear-gradient(rgba(var(--c-rgb), 0.5), rgba(var(--c-rgb), 0.5)) center / 14px 1px no-repeat;
}
.mira-varre {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0 46%, rgba(var(--c-rgb), 0.55) 50%, transparent 54%);
  background-size: 100% 220%;
  animation: mira-varre 1.6s var(--ease) 0.2s 1 both;
  mix-blend-mode: screen;
}
@keyframes mira-varre {
  from {
    background-position: 0 100%;
    opacity: 1;
  }
  to {
    background-position: 0 -20%;
    opacity: 0;
  }
}
/* listas: número à esquerda de cada linha, régua fina entre elas */
.holo-linhas {
  counter-reset: linha;
}
.holo-linhas li {
  counter-increment: linha;
  border-bottom: 1px solid rgba(var(--c-rgb), 0.08);
}
.holo-linhas li:last-child {
  border-bottom: 0;
}
.holo-linhas li::before {
  content: counter(linha, decimal-leading-zero);
  flex: none;
  width: 20px;
  font: 500 10.5px/1 var(--font-display);
  color: rgba(var(--text-rgb), 0.4);
  font-variant-numeric: tabular-nums;
}
@media (prefers-reduced-motion: reduce) {
  .mira-varre,
  .holo-teia .chamada-pulso {
    animation: none;
    opacity: 0;
  }
}
/* nos trilhos, tudo lê da esquerda para a direita (o lado de origem não espelha mais o conteúdo) */
.holo--trilhos [data-lado='esquerda'] .holo-linhas li,
.holo--trilhos [data-lado='esquerda'] .holo-duplo,
.holo--trilhos [data-lado='esquerda'] .holo-medidores {
  flex-direction: row;
  text-align: left;
  justify-content: flex-start;
}

/* ============================================ CENTRAIS DE AGENTES E DE AUTOMAÇÕES */
.cena {
  position: fixed;
  inset: 0;
  z-index: 24;
  animation: cn-entra 0.45s var(--ease) both;
  background: radial-gradient(ellipse at 50% 60%, rgba(5, 9, 12, 0.35), rgba(3, 5, 8, 0.9) 75%);
}
.app[data-cena] .col,
.app[data-cena] .rings,
.app[data-cena] .thoughts,
.app[data-cena] .passos,
.app[data-cena] .holo {
  opacity: 0 !important;
  pointer-events: none !important;
}
.app[data-cena] .topbar,
.app[data-cena] .composer {
  position: relative;
  z-index: 26;
}
body[data-cena='agentes'] #core-canvas,
body[data-cena='codigo'] #core-canvas {
  opacity: 0.08;
  transition: opacity 0.5s var(--ease);
}
.cena-cabecalho {
  position: absolute;
  top: clamp(78px, 11vh, 104px);
  left: clamp(20px, 3vw, 44px);
  z-index: 2;
}
.cena .cn-fechar {
  z-index: 3;
}

/* ---- agentes: tabuleiro 3D */
.ag-palco {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
.ag-palco:active {
  cursor: grabbing;
}
.ag-grade {
  stroke: rgba(var(--c-rgb), 0.07);
  stroke-width: 1;
}
.ag-arco {
  fill: none;
  stroke: rgba(var(--c-rgb), 0.32);
  stroke-width: 1.1;
  stroke-dasharray: 2 5;
}
.ag-arco.ativo {
  stroke: var(--sinal);
  stroke-width: 1.8;
  stroke-dasharray: 6 6;
  animation: ag-corre 0.9s linear infinite;
  filter: drop-shadow(0 0 4px rgba(var(--sinal-rgb), 0.7));
}
.ag-arco.falha {
  stroke: rgba(var(--danger-rgb), 0.6);
}
@keyframes ag-corre {
  to {
    stroke-dashoffset: -24;
  }
}
.ag-face {
  fill: rgba(var(--c-rgb), var(--tom));
  stroke: rgba(var(--c-rgb), 0.5);
  stroke-width: 1;
  stroke-linejoin: round;
}
.ag-face.topo {
  fill: rgba(var(--c-rgb), 0.13);
}
.ag-bloco {
  cursor: pointer;
}
.ag-bloco:hover .ag-face,
.ag-bloco.escolhido .ag-face {
  stroke: var(--sinal);
}
.ag-luz {
  fill: var(--cor);
  opacity: 0.9;
  filter: drop-shadow(0 0 6px var(--cor));
}
.ag-haste {
  stroke: rgba(var(--c-rgb), 0.35);
  stroke-width: 1;
}
.ag-alvo {
  fill: rgba(var(--sinal-rgb), 0.06);
  stroke: rgba(var(--text-rgb), 0.85);
  stroke-width: 1.2;
}
.ag-rotulos {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ag-rotulo {
  position: absolute;
  transform: translate(-50%, -100%);
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 6px;
  padding: 4px 8px;
  border: 1px solid rgba(var(--c-rgb), 0.22);
  border-radius: 2px;
  background: rgba(4, 8, 11, 0.82);
  color: var(--text);
  text-align: left;
  pointer-events: auto;
  cursor: pointer;
  white-space: nowrap;
}
.ag-rotulo i {
  grid-row: span 2;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cor);
  box-shadow: 0 0 8px var(--cor);
}
.ag-rotulo b {
  font: 600 12px/1.1 var(--font-display);
}
.ag-rotulo small {
  font-size: 10.5px;
  color: var(--muted);
}
.ag-rotulo.escolhido {
  border-color: var(--sinal);
}
.ag-numeros {
  position: absolute;
  top: calc(clamp(78px, 11vh, 104px) + 64px);
  left: clamp(20px, 3vw, 44px);
  display: grid;
  gap: 18px;
  z-index: 2;
}
.ag-numeros div {
  display: grid;
}
.ag-numeros b {
  font: 300 clamp(30px, 3.2vw, 48px)/1 var(--font-display);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ag-numeros b small {
  font-size: 0.5em;
  color: var(--muted);
}
.ag-numeros span {
  font-size: 12px;
  color: var(--muted);
}
.ag-detalhe {
  position: absolute;
  top: calc(clamp(78px, 11vh, 104px) + 48px);
  right: clamp(20px, 3vw, 44px);
  width: min(300px, 28vw);
  max-height: calc(100vh - 300px);
  overflow: auto;
  padding: 16px 18px;
  border: 1px solid rgba(var(--c-rgb), 0.18);
  border-left: 2px solid var(--sinal);
  background: rgba(4, 8, 11, 0.86);
  z-index: 2;
}
.ag-det-estado {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 10px/1 var(--font-display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cor);
}
.ag-det-estado::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cor);
  box-shadow: 0 0 8px var(--cor);
}
.ag-detalhe h3 {
  margin: 10px 0 4px;
  font: 500 20px/1.15 var(--font-display);
}
.ag-det-papel {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}
.ag-detalhe dl {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}
.ag-detalhe dt {
  font: 500 10px/1 var(--font-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.ag-detalhe dd {
  margin: 3px 0 0;
  font-size: 13px;
}
.ag-detalhe h4 {
  margin: 14px 0 6px;
  font: 500 11px/1 var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c);
}
.ag-detalhe ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.ag-detalhe li {
  display: grid;
  grid-template-columns: 42px 1fr;
  font-size: 12px;
  color: var(--muted);
  border-left: 2px solid rgba(var(--danger-rgb), 0.0);
}
.ag-detalhe time {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.ag-dica {
  position: absolute;
  left: 50%;
  bottom: 118px;
  transform: translateX(-50%);
  margin: 0;
  font-size: 11.5px;
  color: var(--faint);
  pointer-events: none;
}

/* ---- automações: relógio de 24 h em prato, feixes de luz, blocos laterais */
.au-relogio {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.au-aro {
  fill: none;
  stroke: rgba(var(--c-rgb), 0.45);
  stroke-width: 1.2;
}
.au-aro.fora {
  stroke: rgba(var(--c-rgb), 0.2);
  stroke-width: 6;
  stroke-dasharray: 1 5;
}
.au-aro.fino {
  stroke: rgba(var(--c-rgb), 0.14);
  stroke-width: 1;
  stroke-dasharray: 4 6;
}
.au-marcas {
  stroke: rgba(var(--c-rgb), 0.5);
  stroke-width: 1;
}
.au-hora {
  fill: rgba(var(--text-rgb), 0.6);
  font: 500 11px/1 var(--font-display);
  text-anchor: middle;
}
.au-faixa {
  fill: rgba(var(--c2-rgb), 0.18);
  stroke: rgba(var(--c2-rgb), 0.45);
  stroke-width: 1;
  cursor: pointer;
}
.au-faixa.escolhida {
  fill: rgba(var(--sinal-rgb), 0.2);
  stroke: var(--sinal);
}
.au-agora {
  stroke: var(--sinal);
  stroke-width: 1.4;
}
.au-agora-ponta {
  fill: var(--sinal);
  filter: drop-shadow(0 0 6px rgba(var(--sinal-rgb), 0.9));
}
.au-agora-rotulo {
  fill: var(--sinal);
  font: 600 11px/1 var(--font-display);
  text-anchor: middle;
  letter-spacing: 0.06em;
}
.au-centro {
  fill: var(--c);
}
.au-feixes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.au-feixe {
  position: absolute;
  width: 3px;
  margin-left: -1.5px;
  padding: 0;
  border: 0;
  background: linear-gradient(0deg, var(--cor), transparent);
  box-shadow: 0 0 10px var(--cor);
  opacity: 0.85;
  pointer-events: auto;
  cursor: pointer;
  animation: au-sobe 0.9s var(--ease) both;
  transform-origin: bottom;
}
.au-feixe.parada {
  opacity: 0.3;
}
.au-feixe.escolhido {
  width: 5px;
  opacity: 1;
}
@keyframes au-sobe {
  from {
    transform: scaleY(0);
  }
}
.au-feixe span {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, -6px);
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 3px 7px;
  border: 1px solid rgba(var(--c-rgb), 0.25);
  background: rgba(4, 8, 11, 0.85);
  color: var(--muted);
  font: 500 11px/1.1 var(--font-display);
  white-space: nowrap;
}
.au-feixe span b {
  color: var(--text);
  font-weight: 600;
}
.au-coluna {
  position: absolute;
  top: calc(clamp(78px, 11vh, 104px) + 84px);
  width: min(270px, 22vw);
  display: grid;
  gap: 10px;
  z-index: 2;
}
.au-esq {
  left: clamp(20px, 3vw, 44px);
  transform: perspective(900px) rotateY(10deg);
  transform-origin: left center;
}
.au-dir {
  right: clamp(20px, 3vw, 44px);
  transform: perspective(900px) rotateY(-10deg);
  transform-origin: right center;
}
.au-coluna h3 {
  margin: 0 0 2px;
  font: 500 11px/1 var(--font-display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c);
}
.au-bloco {
  display: grid;
  gap: 3px;
  padding: 10px 14px 11px;
  border: 1px solid rgba(var(--c-rgb), 0.2);
  background: rgba(4, 8, 11, 0.82);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.au-bloco:hover,
.au-bloco.escolhido {
  border-color: var(--sinal);
  background: rgba(var(--sinal-rgb), 0.08);
}
.au-bloco.parada {
  opacity: 0.5;
}
.au-fonte {
  font: 600 9.5px/1 var(--font-display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sinal);
}
.au-bloco b {
  font: 600 14px/1.2 var(--font-display);
}
.au-bloco small {
  font-size: 12px;
  color: var(--muted);
}
.au-bloco em {
  font: 500 11.5px/1 var(--font-display);
  font-style: normal;
  color: var(--c);
}
.au-vazio {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}
@media (max-width: 900px) {
  .ag-detalhe,
  .ag-numeros {
    display: none;
  }
  .au-coluna {
    position: absolute;
    top: auto;
    bottom: 110px;
    width: 46%;
    max-height: 30vh;
    overflow: auto;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ag-arco.ativo,
  .au-feixe {
    animation: none;
  }
}
.app[data-cena] .caption {
  opacity: 0;
}

/* ---- modo desenvolvedor: mapa do código em aglomerados */
.dv-mapa {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.dv-nuvem {
  fill: rgba(var(--c-rgb), 0.025);
  stroke: rgba(var(--c-rgb), 0.1);
  stroke-dasharray: 2 6;
}
.dv-area {
  fill: rgba(var(--text-rgb), 0.7);
  font: 500 11px/1 var(--font-display);
  letter-spacing: 0.12em;
  text-anchor: middle;
  text-transform: uppercase;
}
.dv-liga {
  fill: none;
  stroke: rgba(var(--c-rgb), 0.09);
  stroke-width: 0.8;
}
.dv-liga.quente {
  stroke: rgba(var(--sinal-rgb), 0.55);
  stroke-width: 1.2;
}
.dv-liga.foco {
  stroke: rgba(var(--c-rgb), 0.75);
  stroke-width: 1.2;
}
.dv-no {
  cursor: pointer;
}
.dv-no circle {
  fill: rgba(var(--c-rgb), 0.55);
  stroke: rgba(var(--c-rgb), 0.9);
  stroke-width: 0.6;
  transition: fill 0.3s;
}
.dv-no:hover circle,
.dv-no.vizinho circle {
  fill: var(--c);
}
.dv-no text {
  fill: rgba(var(--text-rgb), 0.78);
  font: 500 10.5px/1 var(--font-display);
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(3, 5, 8, 0.9);
  stroke-width: 3px;
}
.dv-no.mudado circle {
  fill: var(--sinal);
  stroke: var(--sinal);
  filter: drop-shadow(0 0 6px rgba(var(--sinal-rgb), 0.9));
}
.dv-no.mudado text {
  fill: var(--sinal);
}
.dv-no.tocado circle {
  animation: dv-pulsa 1.1s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes dv-pulsa {
  50% {
    transform: scale(1.8);
    fill: var(--sinal);
  }
}
.dv-no.escolhido circle {
  fill: #fff;
  stroke: var(--sinal);
  stroke-width: 2;
}
.dv-vazio {
  fill: var(--muted);
  font: 400 14px var(--font-display);
  text-anchor: middle;
}
.dv-arquivo {
  position: absolute;
  top: calc(clamp(78px, 11vh, 104px) + 48px);
  right: clamp(20px, 3vw, 44px);
  width: min(300px, 26vw);
  padding: 14px 16px;
  border: 1px solid rgba(var(--c-rgb), 0.18);
  border-left: 2px solid var(--sinal);
  background: rgba(4, 8, 11, 0.9);
  z-index: 2;
}
.dv-arquivo h3 {
  margin: 8px 0 2px;
  font: 500 18px/1.2 var(--font-display);
}
.dv-caminho {
  margin: 0 0 10px;
  font-size: 11.5px;
  color: var(--faint);
  word-break: break-all;
}
.dv-arquivo h4 {
  margin: 10px 0 3px;
  font: 500 10.5px/1 var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c);
}
.dv-arquivo p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* ---- modo desenvolvedor: estação de trabalho (passos | código ao vivo | motores) */
.cena-codigo {
  --dx-topo: clamp(78px, 10vh, 98px);
  --dx-base: 118px;
  --dx-borda: rgba(var(--c-rgb), 0.14);
  --dx-fundo: rgba(6, 9, 12, 0.72);
  background: radial-gradient(ellipse at 50% 0%, rgba(var(--c-rgb), 0.05), transparent 60%), rgba(3, 5, 8, 0.95);
}
.dx-topo {
  position: absolute;
  top: var(--dx-topo);
  left: clamp(16px, 2.4vw, 40px);
  right: clamp(16px, 2.4vw, 40px);
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: clamp(14px, 2vw, 32px);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--dx-borda);
}
.dx-titulo {
  min-width: 0;
}
.dx-tarefa {
  margin: 6px 0 3px;
  font: 500 clamp(18px, 1.6vw, 24px) / 1.2 var(--font-display);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dx-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dx-sub[data-estado='aprovada'] {
  color: var(--ok);
}
.dx-sub[data-estado='desfeita'],
.dx-sub[data-estado='conflito'],
.dx-sub[data-estado='blocked'] {
  color: var(--danger);
}
.dx-etapas {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dx-etapas li {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--faint);
  font: 500 11px/1 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.dx-etapas li + li::before {
  content: '';
  width: clamp(10px, 1.4vw, 26px);
  height: 1px;
  margin: 0 8px;
  background: var(--dx-borda);
}
.dx-etapas i {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(var(--text-rgb), 0.22);
  border-radius: 50%;
  font: 600 10px/1 var(--font-mono);
  font-style: normal;
}
.dx-etapas li[data-estado='feito'] {
  color: var(--text);
}
.dx-etapas li[data-estado='feito'] i {
  border-color: var(--c);
  background: rgba(var(--c-rgb), 0.16);
  color: var(--c);
}
.dx-etapas li[data-estado='feito'] + li::before {
  background: rgba(var(--c-rgb), 0.5);
}
.dx-etapas li[data-estado='agora'] {
  color: var(--sinal);
}
.dx-etapas li[data-estado='agora'] i {
  border-color: var(--sinal);
  color: var(--sinal);
  animation: dx-pulso 1.4s ease-in-out infinite;
}
.dx-etapas li[data-estado='falha'],
.dx-etapas li[data-estado='falha'] i {
  color: var(--danger);
  border-color: var(--danger);
}
@keyframes dx-pulso {
  50% {
    box-shadow: 0 0 0 5px rgba(var(--sinal-rgb), 0.14);
  }
}
.dx-relogio {
  font: 400 26px/1 var(--font-mono);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.dx-relogio.vivo {
  color: var(--sinal);
}
.dx-botoes {
  display: flex;
  gap: 8px;
}
.dx-topo .cn-fechar,
.dx-sair-modo {
  position: static;
  padding: 8px 12px;
  border: 1px solid rgba(var(--c-rgb), 0.3);
  border-radius: var(--r-sm);
  background: rgba(5, 9, 12, 0.6);
  color: var(--muted);
  font: 500 12px/1 var(--font-display);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.dx-sair-modo:hover,
.dx-topo .cn-fechar:hover {
  color: var(--text);
  border-color: var(--c);
}

.dx-grade {
  position: absolute;
  top: calc(var(--dx-topo) + 86px);
  bottom: var(--dx-base);
  left: clamp(16px, 2.4vw, 40px);
  right: clamp(16px, 2.4vw, 40px);
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(250px, 0.9fr) minmax(0, 2fr) minmax(240px, 0.8fr);
  gap: 14px;
  min-height: 0;
}
.dx-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--dx-borda);
  border-radius: var(--r-lg);
  background: var(--dx-fundo);
  overflow: hidden;
}
.dx-col h3,
.dx-card h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0;
  padding: 12px 14px 10px;
  font: 500 10.5px/1 var(--font-display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c);
}
.dx-col h3 small {
  font: 400 11px/1 var(--font-mono);
  letter-spacing: 0;
  text-transform: none;
  color: var(--faint);
}
.dx-vazio {
  margin: 0;
  padding: 18px 14px;
  font-size: 12.5px;
  color: var(--faint);
  list-style: none;
}

/* linha do tempo */
.dx-passos {
  flex: 1;
  margin: 0;
  padding: 0 10px 12px;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: thin;
}
.dx-passo {
  position: relative;
  margin: 0 0 6px;
  padding: 8px 10px 8px 12px;
  border-left: 2px solid rgba(var(--c-rgb), 0.25);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: rgba(var(--c-rgb), 0.03);
  cursor: pointer;
}
.dx-passo header {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}
.dx-passo header i {
  width: 12px;
  font-style: normal;
  color: var(--c);
}
.dx-passo header b {
  flex: 1;
  min-width: 0;
  font: 500 12.5px/1.3 var(--font-display);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dx-passo header em {
  font: 400 11px/1 var(--font-mono);
  font-style: normal;
  color: var(--faint);
}
.dx-passo header time {
  font: 400 10px/1 var(--font-mono);
  color: rgba(var(--text-rgb), 0.3);
}
.dx-passo p {
  margin: 5px 0 0 19px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}
.dx-passo pre {
  margin: 6px 0 0 19px;
  padding: 6px 8px;
  max-height: 4.6em;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.35);
  font: 400 11px/1.45 var(--font-mono);
  color: rgba(var(--text-rgb), 0.78);
  white-space: pre-wrap;
  word-break: break-word;
}
.dx-passo pre.dx-saida {
  color: var(--faint);
}
.dx-passo.aberto p {
  -webkit-line-clamp: unset;
}
.dx-passo.aberto pre {
  max-height: 22em;
  overflow-y: auto;
}
.dx-pensa {
  border-left-color: rgba(var(--text-rgb), 0.2);
  background: transparent;
}
.dx-pensa header b {
  color: var(--muted);
  font-style: italic;
}
.dx-pensa p {
  font-style: italic;
}
.dx-ferr[data-estado='rodando'] {
  border-left-color: var(--sinal);
}
.dx-ferr[data-estado='rodando'] header em {
  color: var(--sinal);
}
.dx-ferr[data-estado='ok'] {
  border-left-color: rgba(var(--c-rgb), 0.55);
}
.dx-ferr[data-estado='erro'] {
  border-left-color: var(--danger);
}
.dx-ferr[data-estado='erro'] header em {
  color: var(--danger);
}
.dx-troca {
  border-left-color: rgba(var(--c2-rgb), 0.8);
  background: transparent;
}
.dx-troca.reserva {
  border-left-color: var(--warn);
}
.dx-troca.reserva header b {
  color: var(--warn);
}
.dx-fala {
  border-left-color: var(--c);
  background: rgba(var(--c-rgb), 0.07);
}
.dx-fala p {
  color: var(--text);
  -webkit-line-clamp: 10;
}

/* código ao vivo */
.dx-abas {
  display: flex;
  gap: 2px;
  padding: 6px 6px 0;
  border-bottom: 1px solid var(--dx-borda);
  overflow-x: auto;
  scrollbar-width: none;
}
.dx-abas button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: none;
  color: var(--faint);
  font: 500 12px/1 var(--font-mono);
  white-space: nowrap;
  cursor: pointer;
}
.dx-abas button[aria-selected='true'] {
  border-color: var(--dx-borda);
  background: rgba(var(--c-rgb), 0.07);
  color: var(--text);
  box-shadow: inset 0 2px 0 var(--sinal);
}
.dx-abas b {
  font: 500 10.5px/1 var(--font-mono);
}
.dx-abas .mais {
  color: var(--ok);
}
.dx-abas .menos {
  color: var(--danger);
}
.dx-aba-mapa {
  margin-left: auto;
}
.dx-editor {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-bottom: 14px;
  font: 400 12.5px/1.6 var(--font-mono);
  scrollbar-width: thin;
}
.dx-editor[hidden],
.dx-mapa-caixa[hidden] {
  display: none;
}
.dx-caminho {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--dx-borda);
  background: rgba(6, 9, 12, 0.96);
  color: var(--muted);
  font-size: 11.5px;
}
.dx-caminho span {
  color: var(--faint);
}
.dx-l {
  display: grid;
  grid-template-columns: 52px 18px minmax(0, 1fr);
  min-width: max-content;
}
.dx-l .n {
  padding-right: 10px;
  text-align: right;
  color: rgba(var(--text-rgb), 0.25);
  user-select: none;
}
.dx-l .s {
  text-align: center;
  color: var(--faint);
  user-select: none;
}
.dx-l code {
  padding-right: 18px;
  color: rgba(var(--text-rgb), 0.82);
  white-space: pre;
  font: inherit;
}
.dx-mais {
  background: rgba(127, 216, 168, 0.1);
}
.dx-mais .s,
.dx-mais .n {
  color: var(--ok);
}
.dx-menos {
  background: rgba(var(--danger-rgb), 0.1);
}
.dx-menos .s,
.dx-menos .n {
  color: var(--danger);
}
.dx-menos code {
  color: rgba(var(--text-rgb), 0.5);
  text-decoration: line-through rgba(var(--danger-rgb), 0.35);
}
.dx-l.dx-ultima code::after {
  content: '▍';
  color: var(--sinal);
  animation: dx-cursor 1s steps(1) infinite;
}
@keyframes dx-cursor {
  50% {
    opacity: 0;
  }
}
.dx-pulo {
  color: var(--faint);
  background: rgba(var(--c-rgb), 0.03);
}
.rc-com {
  color: rgba(var(--text-rgb), 0.42);
  font-style: italic;
}
.rc-txt {
  color: #d9c38f;
}
.rc-pal {
  color: var(--c);
}
.rc-num {
  color: #c9a0dc;
}
.dx-mapa-caixa {
  position: relative;
  flex: 1;
  min-height: 0;
}
.dx-mapa-caixa .dv-arquivo {
  top: 12px;
  right: 12px;
  width: min(280px, 45%);
}

/* motores e proteção */
.dx-lado {
  gap: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.dx-card {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--dx-borda);
}
.dx-card:last-child {
  border-bottom: 0;
}
.dx-motor-atual {
  display: grid;
  gap: 3px;
  margin: 0 14px 10px;
  padding: 10px 12px;
  border-left: 2px solid var(--c);
  background: rgba(var(--c-rgb), 0.06);
}
.dx-motor-atual.reserva {
  border-left-color: var(--warn);
}
.dx-motor-atual b {
  font: 500 17px/1.1 var(--font-display);
  color: var(--text);
}
.dx-motor-atual span {
  font: 400 11px/1.2 var(--font-mono);
  color: var(--faint);
}
.dx-motor-atual small {
  font-size: 12px;
  color: var(--muted);
}
.dx-motores {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 14px;
  list-style: none;
}
.dx-motores li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  column-gap: 8px;
  align-items: center;
  font-size: 12px;
}
.dx-motores i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(var(--text-rgb), 0.3);
}
.dx-motores li[data-cor='ok'] i {
  background: var(--ok);
}
.dx-motores li[data-cor='alerta'] i {
  background: var(--warn);
}
.dx-motores li[data-cor='falha'] i {
  background: var(--danger);
}
.dx-motores span {
  color: var(--text);
}
.dx-motores em {
  grid-column: 2;
  font-style: normal;
  font-size: 11px;
  color: var(--faint);
}
.dx-dados {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 0;
  padding: 0 14px;
}
.dx-dados div {
  display: grid;
  gap: 3px;
}
.dx-dados dt {
  font: 500 9.5px/1 var(--font-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.dx-dados dd {
  margin: 0;
  font: 500 14px/1.2 var(--font-display);
  color: var(--text);
}
.dx-dados dd[data-estado='ok'],
.dx-dados dd[data-estado='ready'] {
  color: var(--ok);
}
.dx-dados dd[data-estado='falha'],
.dx-dados dd[data-estado='blocked'] {
  color: var(--danger);
}
.dx-dados dd[data-estado='working'],
.dx-dados dd[data-estado='testing'],
.dx-dados dd[data-estado='checking'] {
  color: var(--sinal);
}
.dx-testes {
  margin: 10px 14px 0;
  font-size: 12px;
  color: var(--muted);
}
.dx-testes summary {
  cursor: pointer;
}
.dx-testes pre {
  max-height: 220px;
  margin: 6px 0 0;
  padding: 8px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.4);
  font: 400 10.5px/1.45 var(--font-mono);
  white-space: pre-wrap;
}
.dx-hist ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 14px;
  list-style: none;
}
.dx-hist li {
  display: grid;
  gap: 2px;
  padding-left: 9px;
  border-left: 2px solid rgba(var(--text-rgb), 0.2);
  font-size: 12px;
}
.dx-hist li b {
  font: 500 10px/1 var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.dx-hist li[data-estado='passed'] {
  border-left-color: var(--ok);
}
.dx-hist li[data-estado='passed'] b {
  color: var(--ok);
}
.dx-hist li[data-estado='rolled_back'],
.dx-hist li[data-estado='conflict'],
.dx-hist li[data-estado='blocked'] {
  border-left-color: var(--danger);
}
.dx-hist li[data-estado='rolled_back'] b,
.dx-hist li[data-estado='conflict'] b {
  color: var(--danger);
}
.dx-hist li span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dx-hist li time {
  font: 400 10.5px/1 var(--font-mono);
  color: rgba(var(--text-rgb), 0.3);
}

@media (max-width: 1180px) {
  .dx-etapas span {
    display: none;
  }
  .dx-grade {
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 2fr);
  }
  .dx-lado {
    display: none;
  }
}
@media (max-width: 820px) {
  .dx-topo {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .dx-etapas,
  .dx-relogio {
    display: none;
  }
  .dx-grade {
    top: calc(var(--dx-topo) + 76px);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1.4fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dx-etapas li[data-estado='agora'] i,
  .dx-l.dx-ultima code::after {
    animation: none;
  }
}

/* ---- cenário Terra */
body[data-cena='globo'] #core-canvas {
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.cena-globo {
  background: radial-gradient(ellipse at 55% 50%, rgba(8, 14, 22, 0.2), rgba(2, 4, 7, 0.96) 70%);
}
.gl-tela {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
.gl-tela:active {
  cursor: grabbing;
}
.gl-rotulos {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.gl-rotulo {
  position: absolute;
  transform: translate(10px, -50%);
  display: grid;
  gap: 2px;
  padding: 5px 9px;
  border-left: 2px solid var(--sinal);
  background: rgba(4, 8, 11, 0.8);
  white-space: nowrap;
}
.gl-rotulo[hidden] {
  display: none;
}
.gl-rotulo b {
  font: 600 13px/1.1 var(--font-display);
  color: var(--text);
}
.gl-rotulo small {
  font-size: 11px;
  color: var(--muted);
}
.gl-rotulo.ativo {
  background: rgba(var(--sinal-rgb), 0.16);
}
.gl-lista {
  position: absolute;
  top: calc(clamp(78px, 11vh, 104px) + 80px);
  left: clamp(20px, 3vw, 44px);
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  z-index: 2;
}
.gl-lista button {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 6px 10px;
  border: 1px solid rgba(var(--c-rgb), 0.18);
  background: rgba(4, 8, 11, 0.7);
  color: var(--text);
  font: 500 13px/1.2 var(--font-display);
  cursor: pointer;
}
.gl-lista button b {
  color: var(--sinal);
  font-size: 11px;
}
.gl-lista button:hover {
  border-color: var(--sinal);
}
.gl-credito {
  position: absolute;
  right: 16px;
  bottom: 96px;
  margin: 0;
  font-size: 10.5px;
  color: var(--faint);
  z-index: 2;
}

/* janela de um assunto anterior: fica ao fundo, apagada; passar o mouse traz de volta */
.holo-item.antiga {
  opacity: 0.34;
  filter: saturate(0.5);
}
.holo-item.antiga:hover,
.holo-item.antiga:focus-within {
  opacity: 1;
  filter: none;
}

/* Modo clássico: cérebro, conversas anteriores e copiar */
.panel-chat { position: relative; }
.chat-cerebro {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 3px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
}
.chat-cerebro:hover, .chat-cerebro:focus { color: var(--text); border-color: var(--stroke-2); }
.chat-cerebro ~ .text-btn { margin-left: 0; }
.conversas {
  position: absolute;
  inset: 52px 10px 10px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--stroke-2);
  border-radius: 6px;
  background: rgba(6, 12, 18, 0.92);
  backdrop-filter: blur(14px);
}
.conversas[hidden] { display: none; }
.conversas-topo { display: flex; gap: 8px; align-items: center; }
.conversas-busca {
  flex: 1;
  padding: 7px 10px;
  border-radius: 3px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.conversas-topo .text-btn { margin-left: 0; }
.conversas-lista { flex: 1; margin: 0; padding: 0; list-style: none; overflow-y: auto; }
.conversa { display: flex; align-items: stretch; gap: 6px; border-bottom: 1px solid var(--stroke); }
.conversa.atual .conversa-abrir strong { color: var(--c); }
.conversa-abrir {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 6px;
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.conversa-abrir strong { font-size: 13px; font-weight: 600; }
.conversa-abrir span { font-size: 11.5px; color: var(--muted); }
.conversa-abrir:hover strong { color: var(--c); }
.conversa-apagar {
  padding: 0 10px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.conversa-apagar:hover { color: var(--warn); }
.conversas-vazio { padding: 16px 6px; color: var(--muted); font-size: 13px; }
.msg-copy {
  margin-left: auto;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s, color 0.2s;
}
.msg:hover .msg-copy, .msg-copy:focus { opacity: 1; }
.msg-copy:hover { color: var(--text); }
@media (pointer: coarse) { .msg-copy { opacity: 0.7; } }
.panel-chat .panel-head { flex-wrap: wrap; row-gap: 6px; }
.panel-chat .panel-head .text-btn { white-space: nowrap; padding: 5px 9px; }
.chat-cerebro { max-width: 128px; }
@media (max-width: 520px) {
  .panel-chat .panel-head h2, .panel-chat .panel-head .ph-icon { display: none; }
  .chat-cerebro { margin-left: 0; max-width: 112px; }
  .conversas { inset: 48px 6px 6px; }
}

/* Tela do PC no celular */
.remoto { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; background: #05080c; }
.remoto[hidden] { display: none; }
.remoto-barra { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(10,16,22,0.95); border-bottom: 1px solid var(--stroke); }
.remoto-barra #remoto-estado { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remoto-barra { flex-wrap: wrap; }
.remoto-atalhos { display: flex; gap: 4px; flex-wrap: wrap; }
.remoto-barra .btn { min-height: 34px; padding: 0 10px; font-size: 12px; }
#remoto-img, #remoto-canvas { cursor: crosshair; }
.remoto-palco { position: relative; }
#remoto-canvas { display: block; max-width: 100%; max-height: 100%; user-select: none; -webkit-user-select: none; }
#remoto-canvas[hidden], #remoto-img[hidden] { display: none; }
/* a seta do mouse do PC, desenhada aqui (anda na hora, sem esperar a imagem) */
.remoto-seta { position: absolute; left: 0; top: 0; width: 15px; height: 24px; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.7)); will-change: transform; }
.remoto-seta path { fill: #fff; stroke: #000; stroke-width: 5; stroke-linejoin: round; }
.remoto-seta[hidden] { display: none; }
#remoto-ritmo { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 11px; min-width: 52px; text-align: right; }
@media (pointer: fine) { #remoto-modo { display: none; } }
@media (max-width: 640px) {
  .remoto-atalhos [data-mods='win'] { display: none; }
  .remoto-barra #remoto-estado { flex-basis: 100%; }
}
.remoto-palco { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
#remoto-img { max-width: 100%; max-height: 100%; user-select: none; -webkit-user-select: none; }
#remoto-input { position: absolute; left: -9999px; opacity: 0; }

/* ---------------------------------------------------------------- controle do PC: janelinhas
   PIN, copiar/colar e arquivos. Por cima da tela do PC, sem tirar o vídeo do lugar. */
.remoto-dialogo { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; background: rgba(2, 5, 8, 0.62); backdrop-filter: blur(3px); }
.remoto-dialogo[hidden] { display: none; }
.remoto-caixa { width: min(520px, 100%); max-height: min(86vh, 720px); overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid rgba(var(--c-rgb), 0.28); border-radius: 10px; background: rgba(8, 13, 18, 0.97); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6); }
.remoto-caixa-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.remoto-caixa-topo b { font-size: 15px; letter-spacing: 0.02em; }
.remoto-caixa-fechar { min-height: 32px; padding: 0 10px; font-size: 18px; line-height: 1; }
.remoto-secao { display: flex; flex-direction: column; gap: 10px; }
.remoto-secao[hidden] { display: none; }
.remoto-secao p { margin: 0; color: var(--muted); font-size: 13px; }
.remoto-secao label { font-size: 12px; color: var(--muted); }
.remoto-secao input[type='password'], .remoto-secao input[type='text'], .remoto-secao textarea { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid rgba(var(--c-rgb), 0.25); border-radius: 6px; background: #05090d; color: var(--text); font: inherit; font-size: 15px; resize: vertical; }
.remoto-secao input[type='password'] { font-size: 18px; letter-spacing: 0.2em; }
.remoto-check { display: flex; align-items: center; gap: 8px; font-size: 13px !important; color: var(--text) !important; }
.remoto-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.remoto-erro { color: #ff8a80 !important; min-height: 1em; }
.remoto-nota { min-height: 1em; }
.remoto-caminho span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.remoto-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid rgba(var(--c-rgb), 0.14); border-radius: 6px; max-height: 46vh; overflow: auto; }
.remoto-lista li + li { border-top: 1px solid rgba(var(--c-rgb), 0.08); }
.remoto-lista a, .remoto-lista button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.remoto-lista a:hover, .remoto-lista button:hover { background: rgba(var(--c-rgb), 0.08); }
.remoto-lista .icone { width: 18px; flex: none; text-align: center; opacity: 0.8; }
.remoto-lista .nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remoto-lista small { flex: none; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.remoto-lista .vazio { padding: 14px 12px; color: var(--muted); font-size: 13px; }
.remoto-enviar { align-self: flex-start; cursor: pointer; }

/* ---------------------------------------------------------------- o que o Jarvis vê (câmera ao vivo) */
.olho { position: fixed; right: 14px; bottom: 96px; z-index: 70; width: min(168px, 34vw); aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; border: 1px solid rgba(var(--c-rgb), 0.45); background: #000; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 24px rgba(var(--c-rgb), 0.18); }
.olho[hidden] { display: none; }
.olho video { width: 100%; height: 100%; object-fit: cover; display: block; }
.olho-rotulo { position: absolute; left: 8px; top: 7px; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: var(--c); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.olho-rotulo::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #ff5252; vertical-align: 1px; animation: olho-pisca 1.6s ease-in-out infinite; }
@keyframes olho-pisca { 50% { opacity: 0.25; } }
.olho-botoes { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 6px; }
.olho-botoes button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 17px; line-height: 1; }
#btn-olho.ativo { color: var(--c); box-shadow: 0 0 0 1px rgba(var(--c-rgb), 0.5), 0 0 16px rgba(var(--c-rgb), 0.35); }
@media (prefers-reduced-motion: reduce) { .olho-rotulo::before { animation: none; } }

/* ------------------------------------------------------------ ticket da Prime Sea ao vivo */
.holo-corpo li.abre-ticket {
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background 0.18s var(--ease);
}
.holo-corpo li.abre-ticket:hover,
.holo-corpo li.abre-ticket:focus-visible {
  background: rgba(var(--c-rgb), 0.07);
  outline: none;
}
.holo-ticket .tk-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font: 500 12px/1.4 var(--font-mono);
  color: var(--muted);
  margin-bottom: 8px;
}
.holo-ticket .tk-info .tk-estado {
  color: var(--sinal);
}
.holo-ticket .tk-info a {
  color: var(--c);
  text-decoration: none;
  margin-left: auto;
}
.holo-ticket .tk-chat {
  list-style: none;
  margin: 0;
  padding: 2px 4px 2px 0;
  max-height: min(52vh, 540px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}
.holo-ticket .tk-msg {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 9px;
  align-items: start;
  animation: none;
}
.holo-ticket .tk-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(var(--c-rgb), 0.12);
  display: block;
}
.holo-ticket .tk-bolha {
  min-width: 0;
  padding: 7px 10px 8px;
  border-left: 2px solid rgba(var(--c-rgb), 0.35);
  background: rgba(var(--c-rgb), 0.04);
  border-radius: 0 var(--r) var(--r) 0;
}
.holo-ticket .papel-luffzin .tk-bolha {
  border-left-color: var(--sinal);
  background: rgba(var(--sinal-rgb), 0.07);
}
.holo-ticket .papel-equipe .tk-bolha,
.holo-ticket .papel-dono .tk-bolha {
  border-left-color: var(--ok);
  background: rgba(127, 216, 168, 0.06);
}
.holo-ticket .papel-loja .tk-bolha,
.holo-ticket .papel-bot .tk-bolha {
  border-left-color: rgba(var(--text-rgb), 0.25);
  background: rgba(var(--text-rgb), 0.025);
}
.holo-ticket .tk-quem {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  line-height: 1.3;
}
.holo-ticket .tk-quem b {
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.holo-ticket .tk-papel {
  font: 600 10px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.holo-ticket .papel-luffzin .tk-papel {
  color: var(--sinal);
}
.holo-ticket .papel-equipe .tk-papel,
.holo-ticket .papel-dono .tk-papel {
  color: var(--ok);
}
.holo-ticket .tk-quem time {
  margin-left: auto;
  color: var(--faint);
  font: 11px/1 var(--font-mono);
  white-space: nowrap;
}
.holo-ticket .tk-bolha p {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
}
.holo-ticket .tk-bolha code {
  font: 13px var(--font-mono);
  padding: 0 4px;
  background: rgba(var(--c-rgb), 0.1);
  border-radius: var(--r-sm);
}
.holo-ticket .tk-ref {
  margin-top: 3px;
  font-size: 12px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.holo-ticket .tk-embed {
  margin-top: 6px;
  padding: 6px 9px;
  border-left: 2px solid rgba(var(--c-rgb), 0.25);
  background: rgba(0, 0, 0, 0.18);
  font-size: 13px;
}
.holo-ticket .tk-embed p {
  font-size: 13px;
  color: var(--muted);
}
.holo-ticket .tk-img {
  display: inline-block;
  margin: 6px 6px 0 0;
}
.holo-ticket .tk-img img {
  display: block;
  max-width: min(100%, 280px);
  max-height: 220px;
  border-radius: var(--r-sm);
  object-fit: contain;
  background: rgba(0, 0, 0, 0.25);
}
.holo-ticket .tk-arq {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.holo-ticket .tk-vazio {
  color: var(--faint);
  font-size: 13px;
}
.holo-ticket .tk-responder {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  margin: 10px 0 12px;
  align-items: end;
}
.holo-ticket .tk-responder textarea {
  resize: vertical;
  min-height: 40px;
  max-height: 160px;
  padding: 8px 10px;
  font: 14px/1.4 var(--font-text);
  color: var(--text);
  background: rgba(var(--c-rgb), 0.05);
  border: 1px solid var(--stroke-2);
  border-radius: var(--r);
}
.holo-ticket .tk-responder textarea:focus {
  outline: none;
  border-color: rgba(var(--sinal-rgb), 0.6);
}
.holo-ticket .tk-enviar {
  height: 40px;
  padding: 0 16px;
  font: 600 13px var(--font-display);
  letter-spacing: 0.04em;
  color: var(--sinal-ink);
  background: var(--sinal);
  border: 0;
  border-radius: var(--r);
  cursor: pointer;
}
.holo-ticket .tk-enviar:disabled {
  opacity: 0.55;
  cursor: progress;
}
.holo-ticket .tk-aviso {
  grid-column: 1 / -1;
  min-height: 1em;
  color: var(--muted);
  font-size: 12px;
}
/* com um ticket aberto, a coluna da direita (a conversa com o Jarvis) fica legível e rola: sem véu nem desfoque */
.app[data-holo='1'][data-ticket='1'] .col-right {
  opacity: 1;
  filter: none;
  transform: none;
  pointer-events: auto;
}
.app[data-holo='1'][data-ticket='1'] .col-left {
  filter: none;
  opacity: 0.35;
}
/* uma rolagem só: rola a conversa do ticket, não a janela em volta (duas rolagens uma dentro da outra
   faziam a roda do mouse "voltar" para baixo) */
.holo-item.holo-ticket:not(.redimensionado) .holo-corpo,
.holo:not(.holo--amplo) .holo-item.no-palco.holo-ticket:not(.redimensionado) .holo-corpo,
.holo-item.em-foco.holo-ticket:not(.redimensionado) .holo-corpo {
  max-height: none;
  overflow: visible;
}
