/* ============================================================
   BN IA — Design tokens
   Paleta funcional: cada estado da conversa tem sua cor.
   ============================================================ */
:root {
  --bg: #0a0d13;
  --bg-elevated: #12161f;
  --bg-card: #151a24;
  --line: #232a3a;
  --line-soft: #1a2030;

  --text: #e9ecf4;
  --text-dim: #8b93a8;
  --text-faint: #565f75;

  --listen: #35e0c1;   /* ouvindo você */
  --think: #8a7cff;    /* pensando */
  --speak: #ff9f4a;    /* BN falando */
  --danger: #ff5c72;

  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --font-display: 'Space Mono', 'JetBrains Mono', monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(120% 100% at 50% -10%, #131a26 0%, var(--bg) 55%);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
}

::selection { background: var(--think); color: #0a0d13; }

.eyebrow {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ============================================================
   Fundo ambiente com anéis de sinal (usado no login e como eco no app)
   ============================================================ */
.signal-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
}
.signal-field .ring {
  position: absolute;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
}
.signal-field .ring:nth-child(1) { width: 260px; height: 260px; }
.signal-field .ring:nth-child(2) { width: 440px; height: 440px; animation: ring-breathe 7s ease-in-out infinite; }
.signal-field .ring:nth-child(3) { width: 640px; height: 640px; animation: ring-breathe 9s ease-in-out infinite 1s; }
.signal-field .ring:nth-child(4) { width: 900px; height: 900px; animation: ring-breathe 11s ease-in-out infinite 2s; }

@keyframes ring-breathe {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.03); opacity: 0.9; }
}

/* ============================================================
   LOGIN / REGISTRO
   ============================================================ */
.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
  text-align: center;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.3em;
  color: var(--text-faint);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 42px;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--listen), var(--think) 60%, var(--speak));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  color: var(--text-dim);
  font-size: 14.5px;
  max-width: 320px;
  line-height: 1.5;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px 24px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
}

.tabs {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 22px;
}
.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 0;
  border-radius: 999px;
  transition: all .2s ease;
}
.tab-btn.active {
  background: var(--line);
  color: var(--text);
}

.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 500;
}
.field input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 15px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus {
  border-color: var(--think);
  box-shadow: 0 0 0 3px rgba(138,124,255,0.18);
}

.btn-primary {
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  color: #0a0d13;
  background: linear-gradient(135deg, var(--listen), var(--think));
  margin-top: 6px;
  transition: transform .15s ease, opacity .15s ease;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; }

.form-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin-top: 10px;
  text-align: center;
}

.auth-foot {
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  margin-top: 28px;
  letter-spacing: 0.02em;
}

/* ============================================================
   APP DE VOZ
   ============================================================ */
.voice-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.voice-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px calc(10px + env(safe-area-inset-top));
}

.topbar-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.topbar-brand .name {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.08em;
}
.topbar-brand .hello {
  font-size: 12px;
  color: var(--text-faint);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, color .15s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-soft); }

.topbar-actions { display: flex; gap: 8px; }

.voice-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 30px;
  position: relative;
}

.status-label {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  transition: color .25s ease;
}
.status-label.state-listening { color: var(--listen); }
.status-label.state-thinking { color: var(--think); }
.status-label.state-speaking { color: var(--speak); }

.orb-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  opacity: 0;
  transform: scale(0.8);
}

.orb-core {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #232b3d, #10141c 70%);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.02) inset, 0 20px 50px -15px rgba(0,0,0,0.7);
  transition: box-shadow .3s ease, border-color .3s ease;
  z-index: 2;
}

.orb-core .bars {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 40px;
}
.orb-core .bars span {
  display: block;
  width: 4px;
  border-radius: 3px;
  background: var(--text-faint);
  height: 10px;
  transition: background .3s ease;
}

/* Idle: leve respiração */
.orb-wrap.state-idle .orb-core .bars span { animation: idle-bar 3.2s ease-in-out infinite; }
.orb-wrap.state-idle .orb-core .bars span:nth-child(2) { animation-delay: .3s; }
.orb-wrap.state-idle .orb-core .bars span:nth-child(3) { animation-delay: .6s; }
.orb-wrap.state-idle .orb-core .bars span:nth-child(4) { animation-delay: .9s; }
.orb-wrap.state-idle .orb-core .bars span:nth-child(5) { animation-delay: 1.2s; }
@keyframes idle-bar {
  0%, 100% { height: 8px; opacity: .5; }
  50% { height: 18px; opacity: .8; }
}

/* Listening */
.orb-wrap.state-listening .orb-core { border-color: var(--listen); box-shadow: 0 0 0 1px rgba(53,224,193,0.15) inset, 0 0 40px -6px rgba(53,224,193,0.45); }
.orb-wrap.state-listening .orb-core .bars span { background: var(--listen); animation: listen-bar 1s ease-in-out infinite; }
.orb-wrap.state-listening .orb-core .bars span:nth-child(1) { animation-delay: 0s; }
.orb-wrap.state-listening .orb-core .bars span:nth-child(2) { animation-delay: .1s; }
.orb-wrap.state-listening .orb-core .bars span:nth-child(3) { animation-delay: .2s; }
.orb-wrap.state-listening .orb-core .bars span:nth-child(4) { animation-delay: .3s; }
.orb-wrap.state-listening .orb-core .bars span:nth-child(5) { animation-delay: .4s; }
@keyframes listen-bar {
  0%, 100% { height: 10px; }
  50% { height: 34px; }
}
.orb-wrap.state-listening .orb-ring { border-color: var(--listen); animation: ring-pulse 1.8s ease-out infinite; }
.orb-wrap.state-listening .orb-ring:nth-child(2) { animation-delay: .5s; }
.orb-wrap.state-listening .orb-ring:nth-child(3) { animation-delay: 1s; }

/* Thinking */
.orb-wrap.state-thinking .orb-core { border-color: var(--think); box-shadow: 0 0 0 1px rgba(138,124,255,0.15) inset, 0 0 40px -6px rgba(138,124,255,0.5); }
.orb-wrap.state-thinking .orb-core .bars span { background: var(--think); height: 14px; animation: think-bar 1.1s ease-in-out infinite; }
.orb-wrap.state-thinking .orb-core .bars span:nth-child(2) { animation-delay: .15s; }
.orb-wrap.state-thinking .orb-core .bars span:nth-child(3) { animation-delay: .3s; }
.orb-wrap.state-thinking .orb-core .bars span:nth-child(4) { animation-delay: .45s; }
.orb-wrap.state-thinking .orb-core .bars span:nth-child(5) { animation-delay: .6s; }
@keyframes think-bar { 0%, 100% { transform: scaleY(0.5); } 50% { transform: scaleY(1.3); } }

/* Speaking */
.orb-wrap.state-speaking .orb-core { border-color: var(--speak); box-shadow: 0 0 0 1px rgba(255,159,74,0.18) inset, 0 0 50px -6px rgba(255,159,74,0.55); }
.orb-wrap.state-speaking .orb-core .bars span { background: var(--speak); animation: speak-bar .5s ease-in-out infinite; }
.orb-wrap.state-speaking .orb-core .bars span:nth-child(1) { animation-delay: 0s; }
.orb-wrap.state-speaking .orb-core .bars span:nth-child(2) { animation-delay: .08s; }
.orb-wrap.state-speaking .orb-core .bars span:nth-child(3) { animation-delay: .16s; }
.orb-wrap.state-speaking .orb-core .bars span:nth-child(4) { animation-delay: .24s; }
.orb-wrap.state-speaking .orb-core .bars span:nth-child(5) { animation-delay: .32s; }
@keyframes speak-bar { 0%, 100% { height: 12px; } 50% { height: 40px; } }

@keyframes ring-pulse {
  0% { opacity: .55; transform: scale(0.75); }
  100% { opacity: 0; transform: scale(1.35); }
}

.caption {
  max-width: 420px;
  min-height: 48px;
  text-align: center;
  color: var(--text-dim);
  font-size: 15.5px;
  line-height: 1.5;
  padding: 0 12px;
  transition: opacity .25s ease;
}
.caption.empty { opacity: 0.4; }

.voice-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 10px 20px calc(28px + env(safe-area-inset-bottom));
}

.mic-btn {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--listen), var(--think));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 15px 40px -12px rgba(53,224,193,0.5);
  transition: transform .15s ease, box-shadow .2s ease;
}
.mic-btn:active { transform: scale(0.94); }
.mic-btn.recording {
  background: linear-gradient(135deg, var(--danger), #ff8a4c);
  box-shadow: 0 15px 40px -12px rgba(255,92,114,0.55);
}
.mic-btn svg { width: 28px; height: 28px; }

.mic-hint {
  font-size: 12.5px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.continuous-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 999px;
}
.switch {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  transition: background .2s ease;
  border: none;
  flex-shrink: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform .2s ease, background .2s ease;
}
.switch.on { background: rgba(53,224,193,0.25); }
.switch.on::after { transform: translateX(14px); background: var(--listen); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(120px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13.5px;
  padding: 10px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 20;
  max-width: 86vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.no-support {
  max-width: 320px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}

/* Menu de configurações */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(4,6,10,0.6);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  z-index: 31;
  transform: translateY(100%);
  transition: transform .25s ease;
}
.sheet.show { transform: translateY(0); }
.sheet h3 { font-size: 15px; margin: 0 0 14px; font-family: var(--font-display); letter-spacing: .04em; }
.sheet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 14.5px;
}
.sheet-item:first-of-type { border-top: none; }
.sheet-logout {
  width: 100%;
  margin-top: 14px;
  background: rgba(255,92,114,0.1);
  border: 1px solid rgba(255,92,114,0.25);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-weight: 600;
  font-size: 14px;
}

@media (min-width: 720px) {
  .orb-wrap { width: 300px; height: 300px; }
  .orb-core { width: 172px; height: 172px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ============================================================
   V2: chamada contínua, anexos e cartão de download
   ============================================================ */
.call-btn {
  min-width: 220px;
  padding: 16px 30px;
  border-radius: 999px;
  border: none;
  font-size: 15.5px;
  font-weight: 700;
  color: #0a0d13;
  background: linear-gradient(135deg, var(--listen), var(--think));
  box-shadow: 0 15px 40px -12px rgba(53,224,193,0.5);
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.call-btn:active { transform: scale(0.97); }
.call-btn.active {
  background: linear-gradient(135deg, var(--danger), #ff8a4c);
  box-shadow: 0 15px 40px -12px rgba(255,92,114,0.5);
}

.attach-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 8px 8px 16px;
  font-size: 13px;
  color: var(--text-dim);
  max-width: 90vw;
}
.attach-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.attach-chip button {
  background: var(--line);
  border: none;
  color: var(--text);
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: 12px;
  flex-shrink: 0;
}

.download-card {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  background: linear-gradient(135deg, rgba(53,224,193,0.14), rgba(138,124,255,0.14));
  border: 1px solid var(--listen);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  max-width: 90vw;
}
.download-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-btn.uploading {
  color: var(--think);
  border-color: var(--think);
}

/* Controles de segurança de voz */
.sheet-item-toggle { gap: 16px; align-items: center; }
.sheet-item-toggle > div { display: flex; flex-direction: column; gap: 4px; }
.sheet-item-toggle small { color: var(--text-faint); font-size: 11px; line-height: 1.35; max-width: 235px; }
.switch { position: relative; display: inline-flex; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: var(--bg-elevated); border: 1px solid var(--line); transition: .2s ease; }
.switch-track::after { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: var(--text-faint); transition: .2s ease; }
.switch input:checked + .switch-track { background: rgba(37, 211, 193, .18); border-color: var(--listen); }
.switch input:checked + .switch-track::after { transform: translateX(20px); background: var(--listen); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--think); outline-offset: 2px; }

/* Avatar expressivo BN IA 3.1 */
.status-label.state-generating { color: #4fd8ff; }

.bn-avatar {
  width: 132px;
  height: 132px;
  overflow: visible;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.34));
}
.avatar-head {
  transform-origin: 90px 92px;
  animation: avatar-breathe 3.8s ease-in-out infinite;
}
.avatar-face, .avatar-ear { fill: url(#bnSkin); }
.avatar-ear { stroke: rgba(255,255,255,.12); stroke-width: 1.5; }
.avatar-hair { fill: url(#bnHair); stroke: rgba(255,255,255,.08); stroke-width: 1.2; }
.avatar-hair-detail { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 3; stroke-linecap: round; }
.avatar-brow { fill: none; stroke: #211915; stroke-width: 5; stroke-linecap: round; transform-box: fill-box; transform-origin: center; transition: transform .25s ease; }
.eye-white { fill: #f5f7ff; }
.eye-iris { fill: #182330; transition: transform .25s ease; }
.eye-shine { fill: #fff; }
.eye-lid { fill: none; stroke: rgba(58,32,25,.34); stroke-width: 1.4; stroke-linecap: round; }
.avatar-eye { transform-box: fill-box; transform-origin: center; animation: avatar-blink 5.4s infinite; }
.avatar-nose { fill: none; stroke: rgba(74,40,31,.55); stroke-width: 2.6; stroke-linecap: round; }
.avatar-cheek { fill: #ff8e83; opacity: .08; transition: opacity .25s ease; }
.mouth-closed { fill: none; stroke: #4f2426; stroke-width: 4; stroke-linecap: round; }
.mouth-open { fill: #36171e; stroke: #4f2426; stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center top; }
.mouth-teeth { fill: none; stroke: rgba(255,255,255,.82); stroke-width: 5; stroke-linecap: round; opacity: 0; }

@keyframes avatar-breathe {
  0%, 100% { transform: translateY(1px) scale(1); }
  50% { transform: translateY(-2px) scale(1.012); }
}
@keyframes avatar-blink {
  0%, 44%, 48%, 100% { transform: scaleY(1); }
  46% { transform: scaleY(.08); }
}

.orb-wrap.state-listening .avatar-eye-left .eye-iris { transform: translateX(-1px) scale(1.08); }
.orb-wrap.state-listening .avatar-eye-right .eye-iris { transform: translateX(1px) scale(1.08); }
.orb-wrap.state-listening .avatar-brow-left { transform: translateY(-2px) rotate(-4deg); }
.orb-wrap.state-listening .avatar-brow-right { transform: translateY(-2px) rotate(4deg); }

.orb-wrap.state-thinking .avatar-head,
.orb-wrap.state-generating .avatar-head { animation: avatar-think 2.2s ease-in-out infinite; }
.orb-wrap.state-thinking .avatar-eye-left .eye-iris,
.orb-wrap.state-thinking .avatar-eye-right .eye-iris,
.orb-wrap.state-generating .avatar-eye-left .eye-iris,
.orb-wrap.state-generating .avatar-eye-right .eye-iris { transform: translate(3px,-2px); }
.orb-wrap.state-thinking .avatar-brow-left,
.orb-wrap.state-generating .avatar-brow-left { transform: translateY(-1px) rotate(7deg); }
.orb-wrap.state-thinking .avatar-brow-right,
.orb-wrap.state-generating .avatar-brow-right { transform: translateY(-4px) rotate(4deg); }
@keyframes avatar-think {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50% { transform: rotate(2deg) translateY(-2px); }
}

.orb-wrap.state-generating .orb-core {
  border-color: #4fd8ff;
  box-shadow: 0 0 0 1px rgba(79,216,255,.16) inset, 0 0 48px -6px rgba(79,216,255,.48);
}
.orb-wrap.state-generating .orb-ring {
  border-color: #4fd8ff;
  animation: ring-pulse 1.7s ease-out infinite;
}
.orb-wrap.state-generating .orb-ring:nth-child(2) { animation-delay: .45s; }
.orb-wrap.state-generating .orb-ring:nth-child(3) { animation-delay: .9s; }

.orb-wrap.state-speaking .avatar-head { animation: avatar-talk-head .62s ease-in-out infinite alternate; }
.orb-wrap.state-speaking .mouth-closed { opacity: 0; }
.orb-wrap.state-speaking .mouth-open { opacity: 1; animation: avatar-talk-mouth .24s ease-in-out infinite alternate; }
.orb-wrap.state-speaking .mouth-teeth { opacity: .75; animation: avatar-talk-teeth .24s ease-in-out infinite alternate; }
.orb-wrap.state-speaking .avatar-cheek { opacity: .2; }
@keyframes avatar-talk-head {
  from { transform: translateY(1px) rotate(-.7deg); }
  to { transform: translateY(-2px) rotate(.7deg); }
}
@keyframes avatar-talk-mouth {
  from { transform: scaleY(.35) scaleX(.92); }
  to { transform: scaleY(1.05) scaleX(1.03); }
}
@keyframes avatar-talk-teeth {
  from { transform: translateY(-1px) scaleX(.9); }
  to { transform: translateY(2px) scaleX(1); }
}

.orb-wrap.expression-happy .mouth-closed { stroke: #5a2528; stroke-width: 4.5; }
.orb-wrap.expression-happy .avatar-cheek { opacity: .26; }
.orb-wrap.expression-happy .avatar-brow-left { transform: translateY(-2px) rotate(-5deg); }
.orb-wrap.expression-happy .avatar-brow-right { transform: translateY(-2px) rotate(5deg); }
.orb-wrap.expression-serious .avatar-brow-left { transform: translateY(2px) rotate(8deg); }
.orb-wrap.expression-serious .avatar-brow-right { transform: translateY(2px) rotate(-8deg); }
.orb-wrap.expression-concerned .avatar-brow-left { transform: translateY(-2px) rotate(-10deg); }
.orb-wrap.expression-concerned .avatar-brow-right { transform: translateY(-2px) rotate(10deg); }
.orb-wrap.expression-surprised .avatar-eye { transform: scale(1.12); animation: none; }
.orb-wrap.expression-surprised .mouth-closed { opacity: 0; }
.orb-wrap.expression-surprised .mouth-open { opacity: 1; transform: scale(.72, .78); }

.download-card::after {
  content: 'BAIXAR ZIP';
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: .12em;
  color: var(--listen);
  margin-left: auto;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .avatar-head, .avatar-eye, .mouth-open, .mouth-teeth { animation: none !important; }
}

/* ============================================================
   BN IA 3.2 — palco vivo, avatar livre e fábrica de projetos
   ============================================================ */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-body {
  --glass: rgba(13, 18, 29, .66);
  --glass-strong: rgba(14, 20, 33, .88);
  --cyan: #39e3c5;
  --violet: #8e7cff;
  --orange: #ff9d4d;
  --blue: #55cfff;
  background: #070a10;
  overflow: hidden;
}

.ambient-world {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(45, 67, 100, .13), transparent 34%),
    linear-gradient(180deg, #0a0f18 0%, #070a10 64%, #06080d 100%);
}

.ambient-glow {
  position: absolute;
  width: 52vw;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .12;
  animation: ambient-drift 15s ease-in-out infinite alternate;
}
.ambient-glow.glow-a { left: -16vw; top: 8vh; background: var(--cyan); }
.ambient-glow.glow-b { right: -18vw; bottom: -8vh; background: var(--violet); animation-delay: -6s; }

.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: .22;
  background-image:
    linear-gradient(rgba(84, 105, 140, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84, 105, 140, .08) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at 50% 47%, #000 0%, transparent 72%);
}

.ambient-stars {
  position: absolute;
  inset: 0;
  opacity: .45;
  background-image:
    radial-gradient(circle at 13% 18%, rgba(255,255,255,.7) 0 1px, transparent 1.5px),
    radial-gradient(circle at 76% 24%, rgba(85,207,255,.7) 0 1px, transparent 1.5px),
    radial-gradient(circle at 89% 66%, rgba(142,124,255,.6) 0 1px, transparent 1.5px),
    radial-gradient(circle at 22% 78%, rgba(57,227,197,.55) 0 1px, transparent 1.5px);
  background-size: 240px 220px, 310px 280px, 270px 250px, 360px 330px;
  animation: stars-float 25s linear infinite;
}

@keyframes ambient-drift {
  to { transform: translate3d(7vw, 4vh, 0) scale(1.12); }
}
@keyframes stars-float {
  to { transform: translate3d(-35px, 24px, 0); }
}

.app-body .voice-shell {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

.app-body .voice-topbar {
  position: relative;
  z-index: 20;
  margin: 12px 14px 0;
  padding: 12px 14px;
  border: 1px solid rgba(151, 175, 214, .12);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(18, 25, 39, .78), rgba(10, 14, 23, .54));
  backdrop-filter: blur(18px) saturate(1.25);
  box-shadow: 0 16px 42px rgba(0,0,0,.24), inset 0 1px rgba(255,255,255,.025);
}

.app-body .topbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.app-body .topbar-brand > div {
  display: grid;
  gap: 2px;
}
.app-body .topbar-brand .name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .16em;
  color: #f2f6ff;
}
.app-body .topbar-brand .hello {
  font-size: 11px;
  letter-spacing: .03em;
  color: #657089;
}
.brand-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 5px rgba(57,227,197,.08), 0 0 22px rgba(57,227,197,.55);
  animation: brand-pulse 2.4s ease-in-out infinite;
}
@keyframes brand-pulse {
  50% { transform: scale(.72); opacity: .62; }
}

.app-body .icon-btn {
  width: 43px;
  height: 43px;
  border-radius: 14px;
  color: #8f9ab1;
  background: rgba(17, 23, 36, .7);
  border: 1px solid rgba(146, 169, 207, .13);
  box-shadow: inset 0 1px rgba(255,255,255,.02);
}
.app-body .icon-btn:hover,
.app-body .icon-btn:focus-visible {
  color: var(--cyan);
  border-color: rgba(57,227,197,.34);
  transform: translateY(-1px);
}

.app-body .voice-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 0;
  gap: 0;
  overflow: hidden;
  display: block;
}

.stage-chrome {
  position: absolute;
  inset: 13px 15px 9px;
  border: 1px solid rgba(120, 146, 190, .09);
  border-radius: 30px;
  pointer-events: none;
  overflow: hidden;
}
.stage-chrome::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(57,227,197,.025), transparent 55%);
}
.scan-line {
  position: absolute;
  left: 7%;
  right: 7%;
  height: 1px;
  top: 12%;
  background: linear-gradient(90deg, transparent, rgba(85,207,255,.18), transparent);
  animation: scan-stage 8s ease-in-out infinite;
}
@keyframes scan-stage {
  50% { top: 88%; opacity: .35; }
}
.corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: rgba(85,207,255,.26);
}
.corner-a { left: 14px; top: 14px; border-left: 1px solid; border-top: 1px solid; }
.corner-b { right: 14px; top: 14px; border-right: 1px solid; border-top: 1px solid; }
.corner-c { left: 14px; bottom: 14px; border-left: 1px solid; border-bottom: 1px solid; }
.corner-d { right: 14px; bottom: 14px; border-right: 1px solid; border-bottom: 1px solid; }

.status-pill {
  position: absolute;
  z-index: 12;
  top: 33px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 142px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(138, 159, 198, .12);
  background: rgba(9, 13, 21, .62);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #596176;
  box-shadow: 0 0 0 4px rgba(89,97,118,.08);
  transition: .3s ease;
}
.app-body .status-label {
  font-size: 10px;
  line-height: 1;
  letter-spacing: .2em;
  white-space: nowrap;
}
.stage-listening .status-dot { background: var(--cyan); box-shadow: 0 0 0 4px rgba(57,227,197,.1), 0 0 14px rgba(57,227,197,.7); }
.stage-thinking .status-dot { background: var(--violet); box-shadow: 0 0 0 4px rgba(142,124,255,.1), 0 0 14px rgba(142,124,255,.7); }
.stage-speaking .status-dot { background: var(--orange); box-shadow: 0 0 0 4px rgba(255,157,77,.1), 0 0 14px rgba(255,157,77,.7); }
.stage-generating .status-dot { background: var(--blue); box-shadow: 0 0 0 4px rgba(85,207,255,.1), 0 0 14px rgba(85,207,255,.7); }

.agent-space {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 47%;
  width: 330px;
  height: 330px;
  transform: translate(-50%, -50%);
  transition: left .85s cubic-bezier(.2,.9,.2,1), top .85s cubic-bezier(.2,.9,.2,1), transform .85s cubic-bezier(.2,.9,.2,1);
  pointer-events: none;
}

.agent-path {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(114, 141, 184, .08);
  inset: 28px;
  animation: path-spin 26s linear infinite;
}
.agent-path.path-two {
  inset: 67px;
  animation-direction: reverse;
  animation-duration: 18s;
  border-style: solid;
  border-color: rgba(57,227,197,.045);
}
@keyframes path-spin { to { transform: rotate(360deg); } }

.app-body .orb-wrap {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  transform: none;
  transition: transform .7s cubic-bezier(.2,.85,.2,1), filter .3s ease;
}

.app-body .orb-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 218px;
  height: 218px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  z-index: 5;
}

.agent-aura {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 245px;
  height: 245px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(57,227,197,.13) 0%, rgba(57,227,197,.035) 48%, transparent 72%);
  filter: blur(1px);
  opacity: .48;
  transition: background .35s ease, transform .35s ease, opacity .35s ease;
  animation: aura-breathe 4.2s ease-in-out infinite;
}
.agent-shadow {
  position: absolute;
  left: 50%;
  top: 75%;
  width: 132px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(0,0,0,.42);
  filter: blur(13px);
  animation: shadow-breathe 4.2s ease-in-out infinite;
}
@keyframes aura-breathe {
  50% { transform: translate(-50%, -50%) scale(1.12); opacity: .75; }
}
@keyframes shadow-breathe {
  50% { transform: translateX(-50%) scale(.82); opacity: .65; }
}

.app-body .bn-avatar {
  width: 218px;
  height: 218px;
  overflow: visible;
  filter: none;
}
.app-body .avatar-head {
  transform-origin: 110px 116px;
  animation: agent-float 4.2s ease-in-out infinite;
}
@keyframes agent-float {
  0%, 100% { transform: translateY(4px) rotate(-.6deg); }
  50% { transform: translateY(-7px) rotate(.7deg); }
}

.app-body .avatar-face,
.app-body .avatar-ear { fill: url(#bnSkin); }
.avatar-face-light { fill: url(#bnFaceLight); opacity: .58; }
.app-body .avatar-hair { fill: url(#bnHair); stroke: rgba(255,255,255,.1); stroke-width: 1.2; }
.avatar-hair-lock { fill: rgba(255,255,255,.055); }
.app-body .avatar-hair-detail { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 3.3; stroke-linecap: round; }
.avatar-ear-line { fill: none; stroke: rgba(91,45,34,.34); stroke-width: 2.3; stroke-linecap: round; }
.app-body .avatar-brow { stroke: #201713; stroke-width: 6; }
.app-body .eye-white { fill: #f8faff; }
.app-body .eye-iris { fill: #536b80; transition: transform .25s ease; }
.eye-pupil { fill: #0b1119; transition: transform .25s ease; }
.app-body .eye-shine { fill: #fff; }
.app-body .eye-lid { stroke: rgba(48,28,23,.3); stroke-width: 1.5; }
.app-body .avatar-eye { animation: avatar-blink-32 5.8s infinite; }
@keyframes avatar-blink-32 {
  0%, 46%, 50%, 100% { transform: scaleY(1); }
  48% { transform: scaleY(.06); }
}
.app-body .avatar-nose { stroke: rgba(75,38,29,.55); stroke-width: 3; }
.avatar-nose-light { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 2; stroke-linecap: round; }
.app-body .avatar-cheek { fill: #ff8a7e; opacity: .09; }
.avatar-jaw-light { fill: none; stroke: rgba(255,255,255,.07); stroke-width: 2.2; stroke-linecap: round; }
.app-body .mouth-closed { stroke: #4f2024; stroke-width: 4.6; }
.app-body .mouth-open { fill: #35151c; stroke: #4f2024; stroke-width: 2.4; }
.app-body .mouth-teeth { stroke: rgba(255,255,255,.88); stroke-width: 6; }
.mouth-tongue { fill: none; stroke: #b75862; stroke-width: 5; stroke-linecap: round; opacity: 0; }

.agent-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(107, 132, 176, .11);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: orbit-spin 12s linear infinite;
}
.agent-orbit.orbit-one { width: 262px; height: 262px; }
.agent-orbit.orbit-two { width: 305px; height: 305px; animation-duration: 19s; animation-direction: reverse; border-style: dashed; }
.agent-orbit span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  left: 50%;
  top: -4px;
  background: var(--cyan);
  box-shadow: 0 0 14px currentColor;
}
.orbit-two span { background: var(--violet); left: 18%; top: 9%; }
@keyframes orbit-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.stage-idle .agent-space { animation: agent-roam-idle 12s ease-in-out infinite; }
@keyframes agent-roam-idle {
  0%, 100% { transform: translate(-50%, -50%) translateX(-12px); }
  50% { transform: translate(-50%, -50%) translateX(14px) translateY(-4px); }
}
.stage-listening .agent-space { top: 48%; }
.stage-thinking .agent-space { left: 58%; top: 45%; }
.stage-generating .agent-space { left: 28%; top: 48%; transform: translate(-50%, -50%) scale(.92); }
.stage-speaking .agent-space { top: 46%; }

.stage-listening .agent-aura { background: radial-gradient(circle, rgba(57,227,197,.2), rgba(57,227,197,.04) 50%, transparent 72%); opacity: .88; }
.stage-thinking .agent-aura { background: radial-gradient(circle, rgba(142,124,255,.2), rgba(142,124,255,.04) 50%, transparent 72%); opacity: .86; }
.stage-speaking .agent-aura { background: radial-gradient(circle, rgba(255,157,77,.22), rgba(255,157,77,.04) 50%, transparent 72%); opacity: .92; }
.stage-generating .agent-aura { background: radial-gradient(circle, rgba(85,207,255,.22), rgba(85,207,255,.04) 50%, transparent 72%); opacity: .9; }

.orb-wrap.state-listening .avatar-head { animation: agent-listen 1.7s ease-in-out infinite; }
@keyframes agent-listen {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-5px) rotate(2deg); }
}
.orb-wrap.state-listening .avatar-eye-left .eye-iris,
.orb-wrap.state-listening .avatar-eye-left .eye-pupil { transform: translateX(-2px) scale(1.06); }
.orb-wrap.state-listening .avatar-eye-right .eye-iris,
.orb-wrap.state-listening .avatar-eye-right .eye-pupil { transform: translateX(2px) scale(1.06); }

.orb-wrap.state-thinking .avatar-head,
.orb-wrap.state-generating .avatar-head { animation: agent-think-32 2.1s ease-in-out infinite; }
@keyframes agent-think-32 {
  0%, 100% { transform: translateY(2px) rotate(-3deg); }
  50% { transform: translateY(-6px) rotate(3deg); }
}
.orb-wrap.state-thinking .avatar-eye-left .eye-iris,
.orb-wrap.state-thinking .avatar-eye-left .eye-pupil,
.orb-wrap.state-thinking .avatar-eye-right .eye-iris,
.orb-wrap.state-thinking .avatar-eye-right .eye-pupil,
.orb-wrap.state-generating .avatar-eye-left .eye-iris,
.orb-wrap.state-generating .avatar-eye-left .eye-pupil,
.orb-wrap.state-generating .avatar-eye-right .eye-iris,
.orb-wrap.state-generating .avatar-eye-right .eye-pupil { transform: translate(4px, -3px); }

.orb-wrap.state-speaking .avatar-head { animation: avatar-talk-head-32 .52s ease-in-out infinite alternate; }
.orb-wrap.state-speaking .mouth-closed { opacity: 0; }
.orb-wrap.state-speaking .mouth-open { opacity: 1; animation: avatar-talk-mouth-32 .19s ease-in-out infinite alternate; }
.orb-wrap.state-speaking .mouth-teeth { opacity: .83; animation: avatar-talk-teeth-32 .19s ease-in-out infinite alternate; }
.orb-wrap.state-speaking .mouth-tongue { opacity: .72; animation: avatar-talk-tongue-32 .19s ease-in-out infinite alternate; }
.orb-wrap.state-speaking .avatar-cheek { opacity: .22; }
@keyframes avatar-talk-head-32 {
  from { transform: translateY(1px) rotate(-1.2deg); }
  to { transform: translateY(-5px) rotate(1.2deg); }
}
@keyframes avatar-talk-mouth-32 {
  from { transform: scaleY(.3) scaleX(.92); }
  to { transform: scaleY(1.08) scaleX(1.04); }
}
@keyframes avatar-talk-teeth-32 {
  from { transform: translateY(-2px) scaleX(.9); }
  to { transform: translateY(2px) scaleX(1); }
}
@keyframes avatar-talk-tongue-32 {
  from { transform: translateY(-2px) scaleX(.8); }
  to { transform: translateY(3px) scaleX(1); }
}

.orb-wrap.expression-happy .avatar-cheek { opacity: .3; }
.orb-wrap.expression-happy .avatar-brow-left { transform: translateY(-3px) rotate(-6deg); }
.orb-wrap.expression-happy .avatar-brow-right { transform: translateY(-3px) rotate(6deg); }
.orb-wrap.expression-serious .avatar-brow-left { transform: translateY(3px) rotate(10deg); }
.orb-wrap.expression-serious .avatar-brow-right { transform: translateY(3px) rotate(-10deg); }
.orb-wrap.expression-concerned .avatar-brow-left { transform: translateY(-2px) rotate(-12deg); }
.orb-wrap.expression-concerned .avatar-brow-right { transform: translateY(-2px) rotate(12deg); }
.orb-wrap.expression-surprised .avatar-eye { transform: scale(1.12); animation: none; }
.orb-wrap.expression-surprised .mouth-closed { opacity: 0; }
.orb-wrap.expression-surprised .mouth-open { opacity: 1; transform: scale(.68, .8); }

.project-forge {
  position: absolute;
  z-index: 10;
  right: 6%;
  top: 50%;
  width: min(430px, 42vw);
  min-height: 260px;
  padding: 25px;
  border: 1px solid rgba(85,207,255,.17);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(16, 25, 41, .86), rgba(8, 12, 20, .78)),
    radial-gradient(circle at 20% 20%, rgba(85,207,255,.12), transparent 50%);
  backdrop-filter: blur(20px) saturate(1.25);
  box-shadow: 0 28px 70px rgba(0,0,0,.38), inset 0 1px rgba(255,255,255,.035);
  transform: translate(40px, -50%) scale(.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease, transform .65s cubic-bezier(.2,.9,.2,1);
  overflow: hidden;
}
.project-forge.show {
  opacity: 1;
  transform: translate(0, -50%) scale(1);
}
.forge-surface {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(85,207,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(85,207,255,.045) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(#000, transparent 92%);
}
.forge-code-rain {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: .34;
}
.forge-code-rain span {
  position: absolute;
  top: -30px;
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--blue);
  animation: code-drop 2.8s linear infinite;
}
.forge-code-rain span:nth-child(1) { left: 8%; animation-delay: -.4s; }
.forge-code-rain span:nth-child(2) { left: 26%; animation-delay: -1.8s; }
.forge-code-rain span:nth-child(3) { left: 48%; animation-delay: -1.1s; }
.forge-code-rain span:nth-child(4) { left: 68%; animation-delay: -.9s; }
.forge-code-rain span:nth-child(5) { left: 84%; animation-delay: -2.2s; }
.forge-code-rain span:nth-child(6) { left: 58%; animation-delay: -2.6s; }
@keyframes code-drop {
  to { transform: translateY(300px) rotate(6deg); opacity: 0; }
}

.forge-machine {
  position: relative;
  z-index: 2;
  height: 150px;
  margin-bottom: 15px;
}
.file-sheet {
  position: absolute;
  left: 50%;
  top: 12px;
  width: 104px;
  height: 126px;
  border: 1px solid rgba(132, 220, 255, .28);
  border-radius: 13px;
  background: linear-gradient(150deg, rgba(29, 48, 72, .98), rgba(12, 20, 33, .98));
  box-shadow: 0 18px 35px rgba(0,0,0,.28);
  transform-origin: bottom center;
}
.file-sheet i {
  display: block;
  width: 62%;
  height: 5px;
  border-radius: 999px;
  background: rgba(85,207,255,.22);
  margin: 14px 0 0 16px;
}
.file-sheet i:nth-child(2) { width: 48%; background: rgba(142,124,255,.23); }
.file-sheet i:nth-child(3) { width: 68%; background: rgba(57,227,197,.2); }
.file-sheet b {
  position: absolute;
  left: 18px;
  bottom: 17px;
  font-family: var(--font-display);
  color: var(--cyan);
  font-size: 17px;
  font-weight: 400;
}
.sheet-back { transform: translateX(-80%) rotate(-12deg) scale(.9); opacity: .45; }
.sheet-mid { transform: translateX(-59%) rotate(-4deg) scale(.96); opacity: .68; }
.sheet-front { transform: translateX(-38%) rotate(4deg); }
.project-forge.is-building .sheet-back { animation: file-feed-back 1.4s ease-in-out infinite; }
.project-forge.is-building .sheet-mid { animation: file-feed-mid 1.4s ease-in-out infinite .18s; }
.project-forge.is-building .sheet-front { animation: file-feed-front 1.4s ease-in-out infinite .36s; }
@keyframes file-feed-back {
  50% { transform: translateX(-80%) translateY(-12px) rotate(-15deg) scale(.9); filter: brightness(1.35); }
}
@keyframes file-feed-mid {
  50% { transform: translateX(-59%) translateY(-14px) rotate(-2deg) scale(.96); filter: brightness(1.35); }
}
@keyframes file-feed-front {
  50% { transform: translateX(-38%) translateY(-16px) rotate(7deg); filter: brightness(1.35); }
}

.zip-pod {
  position: absolute;
  right: 13%;
  top: 48px;
  width: 74px;
  height: 72px;
  border-radius: 19px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #36d9c1, #3898e8 60%, #7768dc);
  color: #071018;
  box-shadow: 0 18px 38px rgba(49, 183, 205, .24), inset 0 1px rgba(255,255,255,.45);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .08em;
  transform: scale(.82);
  opacity: .45;
}
.zip-lock {
  position: absolute;
  width: 9px;
  height: 48px;
  left: 10px;
  top: 12px;
  border-radius: 4px;
  background: repeating-linear-gradient(180deg, rgba(7,16,24,.72) 0 5px, rgba(255,255,255,.45) 5px 9px);
}
.project-forge.is-building .zip-pod { animation: zip-charge 1.2s ease-in-out infinite; }
@keyframes zip-charge {
  50% { transform: scale(1); opacity: 1; box-shadow: 0 20px 48px rgba(49, 183, 205, .42), 0 0 35px rgba(85,207,255,.28); }
}

.delivery-trail {
  position: absolute;
  right: 3%;
  top: 82px;
  width: 88px;
  height: 2px;
  background: linear-gradient(90deg, rgba(85,207,255,.8), transparent);
  opacity: 0;
}
.project-forge.is-delivering .zip-pod {
  animation: throw-zip .9s cubic-bezier(.25,.75,.15,1) forwards;
}
.project-forge.is-delivering .delivery-trail { animation: trail-flash .9s ease-out forwards; }
@keyframes throw-zip {
  0% { transform: translate(0,0) rotate(0) scale(1); opacity: 1; }
  70% { transform: translate(150px,-65px) rotate(28deg) scale(.8); opacity: 1; }
  100% { transform: translate(250px,-100px) rotate(55deg) scale(.35); opacity: 0; }
}
@keyframes trail-flash {
  20% { opacity: 1; transform: scaleX(.5); }
  100% { opacity: 0; transform: translateX(160px) scaleX(1.8); }
}

.project-forge.is-complete {
  border-color: rgba(57,227,197,.35);
  box-shadow: 0 28px 70px rgba(0,0,0,.38), 0 0 42px rgba(57,227,197,.1), inset 0 1px rgba(255,255,255,.04);
}
.project-forge.is-complete .forge-code-rain { opacity: .08; }
.project-forge.is-complete .file-sheet { border-color: rgba(57,227,197,.33); }
.project-forge.is-complete .zip-pod { transform: scale(1); opacity: 1; }

.project-forge.is-failed {
  border-color: rgba(255, 91, 112, .42);
  box-shadow: 0 28px 70px rgba(0,0,0,.38), 0 0 42px rgba(255,91,112,.12), inset 0 1px rgba(255,255,255,.04);
  animation: forge-failed-shake .42s ease both;
}
.project-forge.is-failed .forge-code-rain { opacity: .04; }
.project-forge.is-failed .file-sheet { animation: none !important; border-color: rgba(255,91,112,.3); filter: saturate(.55); }
.project-forge.is-failed .zip-pod {
  animation: none !important;
  opacity: .72;
  transform: scale(.88) rotate(-5deg);
  background: linear-gradient(145deg, #ff6b7c, #ce4862 62%, #7b405b);
  box-shadow: 0 16px 34px rgba(255,91,112,.2);
}
.project-forge.is-failed .forge-copy strong { color: #ff7186; }
.project-forge.is-failed .forge-copy span { color: #ffd8de; }
@keyframes forge-failed-shake {
  0%, 100% { margin-right: 0; }
  25% { margin-right: -5px; }
  50% { margin-right: 5px; }
  75% { margin-right: -3px; }
}

.forge-copy {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 5px;
  text-align: center;
}
.forge-copy strong {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--blue);
}
.forge-copy span {
  color: #dbe5f6;
  font-size: 13px;
  line-height: 1.4;
}
.forge-copy small {
  color: #65728b;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-body .attach-chip {
  position: absolute;
  z-index: 15;
  left: 50%;
  bottom: 21px;
  transform: translateX(-50%);
  background: rgba(13, 19, 30, .88);
  border-color: rgba(142,124,255,.28);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 34px rgba(0,0,0,.3);
}

.delivery-dock {
  position: absolute;
  z-index: 18;
  left: 50%;
  bottom: 18px;
  width: min(520px, calc(100% - 38px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: 19px;
  background: rgba(10, 16, 26, .88);
  border: 1px solid rgba(57,227,197,.18);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 54px rgba(0,0,0,.4), 0 0 34px rgba(57,227,197,.06);
  opacity: 0;
  transform: translate(-50%, 24px) scale(.96);
  pointer-events: none;
  transition: opacity .35s ease, transform .45s cubic-bezier(.2,.9,.2,1);
}
.delivery-dock.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}
.delivery-check {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #071018;
  background: linear-gradient(145deg, var(--cyan), #55cfff);
  box-shadow: 0 10px 28px rgba(57,227,197,.24);
}
.app-body .download-card {
  flex: 1;
  min-width: 0;
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.app-body .download-card::after { display: none; }
.download-meta {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.download-meta small {
  font-family: var(--font-display);
  color: var(--cyan);
  font-size: 8px;
  letter-spacing: .16em;
}
.download-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #e9f0fc;
}
.download-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 11px;
  border-radius: 11px;
  background: rgba(57,227,197,.1);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: .09em;
  flex: 0 0 auto;
}
.delivery-dock.auto-started .download-action::after {
  content: ' • INICIADO';
  color: #92a1b9;
}

.app-body .voice-controls {
  position: relative;
  z-index: 22;
  padding: 10px 18px calc(13px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(7,10,16,0), rgba(7,10,16,.92) 32%);
}
.app-body .call-btn {
  position: relative;
  overflow: hidden;
  min-width: min(390px, 88vw);
  min-height: 58px;
  padding: 15px 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: #04110f;
  font-size: 15px;
  font-weight: 800;
  background: linear-gradient(115deg, #39e3c5, #56d5ef 52%, #8e7cff);
  box-shadow: 0 20px 48px -14px rgba(57,227,197,.48), inset 0 1px rgba(255,255,255,.45);
}
.call-btn-glow {
  position: absolute;
  width: 140px;
  height: 140px;
  left: -80px;
  top: -46px;
  border-radius: 50%;
  background: rgba(255,255,255,.38);
  filter: blur(24px);
  animation: button-shine 4s ease-in-out infinite;
}
@keyframes button-shine {
  55%, 100% { transform: translateX(520px); opacity: 0; }
}
.call-icon { display: grid; place-items: center; }
.app-body .call-btn.active {
  color: #170507;
  background: linear-gradient(115deg, #ff5c72, #ff7a5f 55%, #ffab54);
  box-shadow: 0 20px 48px -14px rgba(255,92,114,.52), inset 0 1px rgba(255,255,255,.36);
}
.app-body .mic-hint {
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: .025em;
  color: #555f74;
}

.app-body .toast {
  bottom: 94px;
  max-width: min(420px, calc(100vw - 36px));
  background: rgba(17, 23, 36, .92);
  border: 1px solid rgba(142, 165, 202, .18);
  backdrop-filter: blur(18px);
  box-shadow: 0 22px 54px rgba(0,0,0,.42);
}

.app-body .sheet {
  left: 50%;
  right: auto;
  width: min(520px, 100%);
  transform: translate(-50%, 100%);
  background: rgba(14, 19, 30, .96);
  border-color: rgba(143, 166, 204, .16);
  backdrop-filter: blur(24px);
}
.app-body .sheet.show { transform: translate(-50%, 0); }
.sheet-handle {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: #343d50;
  margin: -7px auto 17px;
}
.app-body .sheet select {
  background: #101622;
  color: var(--text);
  border: 1px solid #293249;
  border-radius: 10px;
  padding: 8px 10px;
  max-width: 190px;
}

@media (min-width: 900px) {
  .app-body .voice-topbar { margin-left: 24px; margin-right: 24px; }
  .stage-thinking .agent-space { left: 62%; }
  .stage-speaking .agent-space { left: 50%; }
  .delivery-dock { bottom: 20px; }
}

@media (max-width: 899px) {
  .agent-space {
    width: 290px;
    height: 290px;
    top: 45%;
  }
  .app-body .orb-core { width: 194px; height: 194px; }
  .app-body .bn-avatar { width: 194px; height: 194px; }
  .agent-aura { width: 220px; height: 220px; }
  .agent-orbit.orbit-one { width: 232px; height: 232px; }
  .agent-orbit.orbit-two { width: 276px; height: 276px; }

  .stage-thinking .agent-space { left: 56%; top: 43%; }
  .stage-generating .agent-space {
    left: 27%;
    top: 31%;
    transform: translate(-50%, -50%) scale(.7);
  }

  .project-forge {
    left: 50%;
    right: auto;
    top: auto;
    bottom: 72px;
    width: calc(100% - 34px);
    min-height: 210px;
    padding: 17px;
    border-radius: 23px;
    transform: translate(-50%, 24px) scale(.96);
  }
  .project-forge.show { transform: translate(-50%, 0) scale(1); }
  .forge-machine { height: 116px; margin-bottom: 8px; }
  .file-sheet { width: 79px; height: 95px; top: 5px; border-radius: 10px; }
  .file-sheet i { height: 4px; margin: 10px 0 0 12px; }
  .file-sheet b { left: 13px; bottom: 11px; font-size: 13px; }
  .zip-pod { width: 58px; height: 57px; right: 15%; top: 28px; border-radius: 15px; font-size: 12px; }
  .zip-lock { width: 7px; height: 37px; left: 8px; top: 10px; }
  .forge-copy strong { font-size: 8px; }
  .forge-copy span { font-size: 11px; }
  .forge-copy small { font-size: 9px; }

  .stage-generating .status-pill { top: 20px; }
  .stage-generating .delivery-dock { opacity: 0; }
  .delivery-dock { bottom: 9px; }
}

@media (max-width: 480px) {
  .app-body .voice-topbar { margin: 8px 9px 0; padding: 10px 11px; border-radius: 17px; }
  .app-body .icon-btn { width: 40px; height: 40px; }
  .status-pill { top: 22px; min-width: 128px; padding: 7px 11px; }
  .agent-space { width: 270px; height: 270px; top: 45%; }
  .app-body .orb-core { width: 182px; height: 182px; }
  .app-body .bn-avatar { width: 182px; height: 182px; }
  .agent-aura { width: 205px; height: 205px; }
  .agent-orbit.orbit-one { width: 220px; height: 220px; }
  .agent-orbit.orbit-two { width: 258px; height: 258px; }
  .stage-generating .agent-space { left: 24%; top: 29%; transform: translate(-50%, -50%) scale(.62); }
  .project-forge { bottom: 63px; min-height: 202px; }
  .app-body .voice-controls { padding-left: 12px; padding-right: 12px; }
  .app-body .call-btn { min-width: 100%; min-height: 56px; }
  .download-action { padding: 9px 9px; font-size: 8px; }
  .delivery-check { width: 36px; height: 36px; }
}

@media (max-height: 690px) and (max-width: 899px) {
  .agent-space { top: 40%; transform: translate(-50%, -50%) scale(.86); }
  .stage-generating .agent-space { top: 24%; transform: translate(-50%, -50%) scale(.55); }
  .project-forge { min-height: 180px; bottom: 54px; }
  .forge-machine { height: 92px; }
  .file-sheet { transform-origin: center; }
  .forge-copy small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-glow, .ambient-stars, .scan-line, .agent-path, .agent-orbit,
  .avatar-head, .avatar-eye, .project-forge *, .call-btn-glow {
    animation: none !important;
  }
}

/* Códigos lançados pelo avatar em direção à fábrica */
.stage-generating .agent-space::after {
  content: '{ }   01   </>   async   CMD:';
  position: absolute;
  z-index: 14;
  left: 67%;
  top: 48%;
  width: 190px;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: .16em;
  color: var(--blue);
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(85,207,255,.8);
  animation: agent-code-cast 1.15s linear infinite;
}
@keyframes agent-code-cast {
  0% { transform: translate(0, 8px) scale(.75); opacity: 0; filter: blur(2px); }
  18% { opacity: .9; }
  100% { transform: translate(235px, -18px) scale(1.08); opacity: 0; filter: blur(0); }
}
@media (max-width: 899px) {
  .stage-generating .agent-space::after {
    left: 59%;
    top: 64%;
    width: 145px;
    font-size: 7px;
    animation-name: agent-code-cast-mobile;
  }
  @keyframes agent-code-cast-mobile {
    0% { transform: translate(0, 0) rotate(16deg) scale(.7); opacity: 0; }
    18% { opacity: .9; }
    100% { transform: translate(118px, 116px) rotate(16deg) scale(1); opacity: 0; }
  }
}


/* BN IA 3.2.2: avatar sem caixa de renderização visível */
.app-body .orb-wrap .orb-core,
.app-body .orb-wrap.state-idle .orb-core,
.app-body .orb-wrap.state-listening .orb-core,
.app-body .orb-wrap.state-thinking .orb-core,
.app-body .orb-wrap.state-generating .orb-core,
.app-body .orb-wrap.state-speaking .orb-core {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}
.app-body .bn-avatar {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 14px 14px rgba(0,0,0,.28));
}
