/* SPADA assistant, HUD styling to match the site. */
.spa { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 900; font-family: var(--font-sans); }
.spa-launch {
  display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.8rem 1.1rem 0.8rem 0.9rem;
  background: var(--cobalt); color: #fff; border: 1px solid rgba(157,187,255,0.35); border-radius: 999px;
  font: 600 0.95rem var(--font-sans); cursor: pointer; box-shadow: 0 12px 34px rgba(36,72,200,0.45), 0 0 0 0 rgba(157,187,255,0.5);
  transition: transform var(--t-base), background var(--t-base); animation: spa-pulse 3s infinite;
}
.spa-launch:hover { transform: translateY(-2px); background: var(--cobalt-deep); }
.spa-launch svg { width: 20px; height: 20px; }
@keyframes spa-pulse { 0%, 100% { box-shadow: 0 12px 34px rgba(36,72,200,0.45), 0 0 0 0 rgba(157,187,255,0.45); } 50% { box-shadow: 0 12px 34px rgba(36,72,200,0.45), 0 0 0 10px rgba(157,187,255,0); } }
.spa.open .spa-launch { animation: none; }

.spa-panel {
  position: absolute; right: 0; bottom: calc(100% + 0.9rem); width: min(400px, calc(100vw - 2.5rem));
  height: min(600px, calc(100vh - 7rem)); display: flex; flex-direction: column;
  background: rgba(7,12,31,0.94); backdrop-filter: blur(14px); border: 1px solid rgba(157,187,255,0.25);
  border-radius: var(--radius); box-shadow: 0 30px 80px rgba(7,12,31,0.7); padding: 0; overflow: hidden;
}
.spa-panel.hud-frame { --b: 18px; padding: 0; }
.spa-panel[hidden] { display: none !important; }
.spa-panel.hud-frame::before { display: none; }
.spa-head { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1rem; border-bottom: 1px solid var(--color-border); }
.spa-head strong { display: block; font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.04em; }
.spa-head .marker { position: static; margin-top: 0.2rem; }
.spa-close { background: none; border: 0; color: var(--slate); cursor: pointer; width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--radius); }
.spa-close:hover { color: var(--contrail); background: rgba(157,187,255,0.08); }
.spa-close svg { width: 18px; height: 18px; }
.spa-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.spa-msg { max-width: 88%; padding: 0.65rem 0.85rem; border-radius: 10px; font-size: 0.92rem; line-height: 1.5; }
.spa-msg p { margin: 0; max-width: none; }
.spa-bot { align-self: flex-start; background: rgba(157,187,255,0.09); border: 1px solid var(--color-border); color: var(--contrail); border-top-left-radius: 2px; }
.spa-user { align-self: flex-end; background: var(--cobalt); color: #fff; border-top-right-radius: 2px; }
.spa-bot a { color: var(--sky); text-decoration: underline; text-underline-offset: 0.15em; }
.spa-typing { display: flex; gap: 4px; padding: 0.8rem 0.9rem; }
.spa-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--sky); animation: spa-dot 1s infinite; }
.spa-typing span:nth-child(2) { animation-delay: 0.15s; } .spa-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes spa-dot { 0%, 100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.spa-quick { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 1rem 0.6rem; }
.spa-quick button { font: 500 0.8rem var(--font-sans); color: var(--sky); background: none; border: 1px solid rgba(157,187,255,0.35); border-radius: 999px; padding: 0.35rem 0.75rem; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.spa-quick button:hover { background: rgba(157,187,255,0.12); color: var(--contrail); }
.spa-form { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid var(--color-border); }
.spa-form input { flex: 1; padding: 0.7rem 0.9rem; background: var(--deep); border: 1px solid var(--color-border); border-radius: var(--radius); color: var(--contrail); font: 400 0.95rem var(--font-sans); min-width: 0; }
.spa-form input:focus { outline: none; border-color: var(--sky); }
.spa-form button { width: 44px; height: 44px; display: grid; place-items: center; background: var(--cobalt); color: #fff; border: 0; border-radius: var(--radius); cursor: pointer; }
.spa-form button svg { width: 18px; height: 18px; }
.spa-note { margin: 0; padding: 0 1rem 0.8rem; font-size: 0.72rem; color: var(--slate); max-width: none; }
@media (max-width: 480px) { .spa { right: 0.75rem; bottom: 0.75rem; } .spa-launch span { display: none; } .spa-launch { padding: 0.9rem; } }
@media (prefers-reduced-motion: reduce) { .spa-launch, .spa-typing span { animation: none; } }
