/* Floating AI dock — sits above screen, below TX overlay */
.ai-dock {
  position: fixed; right: 18px; bottom: 18px; z-index: 9500;
  display: grid; gap: 10px; width: min(360px, 92vw);
  font-family: "Roboto Mono", ui-monospace, monospace;
}

/* Toggle pill */
.ai-toggle {
  all: unset; cursor: pointer;
  padding: 10px 14px; border-radius: 999px;
  color: #bff7ff; background: rgba(0,229,255,.08);
  box-shadow: 0 0 0 1px rgba(0,229,255,.12) inset;
  letter-spacing: .04em; font-size: 12px;
}
.ai-toggle[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* Panel */
.ai-panel {
  border-radius: 14px;
  background:
    radial-gradient(140% 120% at 50% 0%, rgba(0,229,255,.05), rgba(0,0,0,.7)),
    #0b0f14;
  box-shadow:
    0 0 0 1px rgba(0,229,255,.12) inset,
    0 20px 60px rgba(0,0,0,.65);
  overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto;
}

/* Header */
.ai-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-bottom: 1px solid rgba(0,229,255,.10);
  color: #95f0ff; font-size: 12px; letter-spacing: .04em;
}
.ai-head .glitch {
  position:relative; display:inline-block;
  text-shadow: 1px 0 rgba(255,60,60,.35), -1px 0 rgba(60,160,255,.35);
}

/* Messages */
.ai-body {
  position: relative; padding: 12px; height: 260px; overflow: auto;
}
.ai-msg {
  margin: 8px 0; max-width: 90%;
  padding: 8px 10px; border-radius: 10px;
  background: rgba(0,229,255,.06); color: #bff7ff;
  box-shadow: 0 0 0 1px rgba(0,229,255,.10) inset;
}
.ai-msg.user { margin-left: auto; background: rgba(140,255,46,.08); }

/* Input row */
.ai-foot {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
  padding: 10px; border-top: 1px solid rgba(0,229,255,.10);
}
.ai-input {
  background: #0a0f14; border: 1px solid #2a3a4a; color: #cfe;
  padding: 10px 12px; border-radius: 8px;
}
.ai-send {
  all: unset; cursor: pointer; padding: 10px 12px; border-radius: 8px;
  color: #bff7ff; background: rgba(0,229,255,.10);
  box-shadow: 0 0 0 1px rgba(0,229,255,.14) inset;
}

/* CRT scanlines */
.ai-panel::before {
  content:""; position:absolute; inset:0; pointer-events:none;
  background-image: repeating-linear-gradient(to bottom, rgba(255,255,255,0.02) 0 1px, rgba(0,0,0,0) 2px 3px);
  mix-blend-mode: screen; opacity: .45; animation: aiNoise .7s steps(2) infinite;
}
@keyframes aiNoise { 50% { transform: translateY(1px); } }

/* Tiny “burst” when AI replies */
.ai-msg.ai { position: relative; }
.ai-msg.ai::after {
  content:""; position:absolute; inset:-1px; border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(0,229,255,.35), transparent);
  opacity: 0; filter: blur(4px);
}
.ai-msg.ai.glitch::after { animation: aiShimmer 650ms ease-out forwards; opacity: .8; }
@keyframes aiShimmer {
  0% { transform: translateX(-60%); opacity: 0; }
  40% { opacity: .8; } 100% { transform: translateX(60%); opacity: 0; }
}
