/* ==========================================================================
   S·V voice assistant — HUD, docked panel and launcher
   ========================================================================== */
.sva-launch {
  position: fixed; right: 20px; bottom: 20px; z-index: 150;
  display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 20px 0 8px;
  border-radius: 999px; background: rgba(20,20,20,.86); border: 1px solid rgba(47,206,101,.45);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  color: #f5f0eb; font: 500 14px/1 var(--body, Inter, sans-serif);
  box-shadow: 0 10px 40px rgba(0,0,0,.45), 0 0 0 0 rgba(47,206,101,.5);
  transition: transform .4s var(--ease), box-shadow .4s, opacity .3s;
  animation: svaBreath 3.2s ease-in-out infinite;
}
.sva-launch:hover { transform: translateY(-3px); }
.sva-launch .orb { width: 40px; height: 40px; border-radius: 50%; position: relative; flex: none;
  background: radial-gradient(circle at 50% 50%, #fff 0 8%, #8ee6ab 16%, #2fce65 38%, rgba(47,206,101,.15) 62%, transparent 70%); }
.sva-launch .orb::before, .sva-launch .orb::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; border: 1.5px solid rgba(47,206,101,.8); border-left-color: transparent; border-bottom-color: transparent; animation: svaSpin 2.4s linear infinite; }
.sva-launch .orb::after { inset: -3px; border-color: rgba(255,179,138,.5); border-right-color: transparent; border-top-color: transparent; animation-duration: 4s; animation-direction: reverse; }
.sva-launch small { display: block; font-size: 11px; color: #a8a49f; margin-top: 4px; letter-spacing: .02em; }
.sva-open .sva-launch, .sva-docked-on .sva-launch { opacity: 0; pointer-events: none; transform: scale(.9); }
@keyframes svaBreath { 50% { box-shadow: 0 10px 40px rgba(0,0,0,.45), 0 0 0 8px rgba(47,206,101,0); } 0%,100% { box-shadow: 0 10px 40px rgba(0,0,0,.45), 0 0 0 0 rgba(47,206,101,.35); } }
@keyframes svaSpin { to { transform: rotate(360deg); } }
@media (max-width: 520px) { .sva-launch { height: 52px; padding-right: 16px; right: 14px; bottom: 14px; } .sva-launch small { display: none; } }

/* ---------- full HUD ---------- */
.sva {
  --o: #2fce65; --o2: #8ee6ab; --hud: rgba(47,206,101,.55);
  position: fixed; inset: 0; z-index: 300; color: #f5f0eb; font-family: var(--body, Inter, sans-serif);
  background: radial-gradient(1200px 800px at 50% 45%, rgba(47,206,101,.14), transparent 60%), rgba(2,26,20,.97);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: grid; grid-template-rows: auto 1fr auto; opacity: 0; visibility: hidden; transition: opacity .5s var(--ease), visibility .5s;
  overflow: hidden;
}
.sva.on { opacity: 1; visibility: visible; }
.sva::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(47,206,101,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(47,206,101,.06) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(circle at 50% 45%, #000 0, transparent 70%); }
.sva::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px); }
.sva-corner { position: absolute; width: 28px; height: 28px; border: 1.5px solid var(--hud); pointer-events: none; }
.sva-corner.tl { top: 16px; left: 16px; border-right: 0; border-bottom: 0; } .sva-corner.tr { top: 16px; right: 16px; border-left: 0; border-bottom: 0; }
.sva-corner.bl { bottom: 16px; left: 16px; border-right: 0; border-top: 0; } .sva-corner.br { bottom: 16px; right: 16px; border-left: 0; border-top: 0; }

.sva-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 16px; padding: 28px 40px 0; }
.sva-brand { font: 600 13px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .24em; text-transform: uppercase; }
.sva-brand b { color: var(--o); font-weight: 600; }
.sva-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; border: 1px solid rgba(245,240,235,.16); font: 500 11px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; color: rgba(245,240,235,.7); }
.sva-pill i { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 10px #10b981; }
.sva-pill.offline i { background: #eab308; box-shadow: 0 0 10px #eab308; }
.sva-top .sp { flex: 1; }
.sva-ico { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(245,240,235,.16); color: #f5f0eb; transition: background .2s, border-color .2s; }
.sva-ico:hover { background: rgba(245,240,235,.08); border-color: rgba(245,240,235,.3); }
.sva-ico svg { width: 18px; height: 18px; }
.sva-ico[aria-pressed="true"] { border-color: var(--o); color: var(--o); }

.sva-mid { position: relative; z-index: 1; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 24px; align-items: center; padding: 0 40px; min-height: 0; }
.sva-stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 0; height: 100%; }
.sva-canvas { width: min(40vh, 440px, 80vw); aspect-ratio: 1; cursor: pointer; flex: none; }
.sva-state { position: relative; text-align: center; width: 100%; }
.sva-state b { display: block; font: 600 12px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .3em; color: var(--o); margin-bottom: 12px; text-transform: uppercase; }
.sva-live { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: 500 clamp(17px, 1.7vw, 22px)/1.4 var(--display, Archivo, sans-serif); min-height: 1.4em; max-width: 640px; margin: 0 auto; padding: 0 16px; color: #f5f0eb; }
.sva-live.dim { color: rgba(245,240,235,.5); }
.sva-hud-data { position: absolute; left: 0; top: 50%; transform: translateY(-50%); display: grid; gap: 18px; font: 500 11px/1.4 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; color: rgba(245,240,235,.45); }
.sva-hud-data div { border-left: 2px solid var(--hud); padding-left: 12px; }
.sva-hud-data strong { display: block; font: 600 22px/1.1 var(--display, Archivo, sans-serif); letter-spacing: 0; color: #f5f0eb; text-transform: none; }

.sva-log { align-self: stretch; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding: 24px 4px 24px 0; max-height: calc(100vh - 260px); scrollbar-width: thin; scrollbar-color: #333 transparent; mask-image: linear-gradient(transparent, #000 32px); }
.sva-msg { padding: 14px 16px; border-radius: 6px; font-size: 15px; line-height: 1.55; animation: svaIn .45s var(--ease) both; }
.sva-msg.you { align-self: flex-end; max-width: 88%; background: rgba(245,240,235,.08); color: #f5f0eb; }
.sva-msg.ai { border: 1px solid rgba(47,206,101,.3); background: linear-gradient(180deg, rgba(47,206,101,.07), rgba(47,206,101,.02)); color: rgba(245,240,235,.92); position: relative; }
.sva-msg.ai::before { content: "CHAI"; display: block; font: 600 10px/1 "JetBrains Mono", monospace; letter-spacing: .2em; color: var(--o); margin-bottom: 8px; }
.sva-msg.sys { font: 500 11px/1.5 "JetBrains Mono", monospace; letter-spacing: .08em; color: rgba(245,240,235,.45); padding: 4px 0; text-transform: uppercase; }
.sva-msg .act { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--o2); }
@keyframes svaIn { from { opacity: 0; transform: translateY(10px); } }

.sva-card { margin-top: 12px; border-radius: 6px; overflow: hidden; border: 1px solid rgba(214,164,74,.45); background: #111; animation: svaIn .5s var(--ease) both; }
.sva-card img { width: 100%; display: block; background: #fff; }
.sva-card .row { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px; }
.sva-card a { font-size: 13px; padding: 8px 12px; border-radius: 99px; border: 1px solid rgba(245,240,235,.2); color: #f5f0eb; }
.sva-card a.p { background: #f5f0eb; color: #0f0f0f; border-color: #f5f0eb; }

.sva-go { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; color: rgba(245,240,235,.75); }
.sva-go .bar { flex: 1; height: 3px; border-radius: 3px; background: rgba(245,240,235,.12); overflow: hidden; }
.sva-go .bar i { display: block; height: 100%; width: 0; background: var(--o); transition: width .25s linear; }
.sva-go button { padding: 7px 12px; border-radius: 99px; background: #f5f0eb; color: #0f0f0f; font-size: 12px; font-weight: 500; }

.sva-bottom { position: relative; z-index: 2; padding: 0 40px 32px; display: grid; gap: 16px; justify-items: center; }
.sva-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 900px; }
.sva-chips button { padding: 9px 14px; border-radius: 99px; border: 1px solid rgba(245,240,235,.16); font-size: 13px; color: rgba(245,240,235,.8); transition: .2s; }
.sva-chips button:hover { border-color: var(--o); color: #fff; background: rgba(47,206,101,.08); }
.sva-input { display: flex; align-items: center; gap: 12px; width: min(100%, 680px); }
.sva-mic { width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--o); color: #0f0f0f; box-shadow: 0 0 0 0 rgba(47,206,101,.6); transition: transform .2s, background .2s; }
.sva-mic:hover { transform: scale(1.05); }
.sva-mic svg { width: 24px; height: 24px; }
.sva-mic.rec { background: #fff; animation: svaRec 1.4s ease-out infinite; }
@keyframes svaRec { to { box-shadow: 0 0 0 22px rgba(47,206,101,0); } }
.sva-mic[disabled] { opacity: .35; cursor: not-allowed; }
.sva-text { flex: 1; display: flex; align-items: center; height: 52px; border-radius: 999px; border: 1px solid rgba(245,240,235,.18); background: rgba(20,20,20,.7); padding: 0 6px 0 20px; transition: border-color .2s; }
.sva-text:focus-within { border-color: var(--o); }
.sva-text input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: #f5f0eb; font: 400 15px var(--body, Inter, sans-serif); }
.sva-text input::placeholder { color: rgba(245,240,235,.4); }
.sva-text button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(245,240,235,.1); }
.sva-text button:hover { background: rgba(245,240,235,.2); }
.sva-text svg { width: 16px; height: 16px; }
.sva-note { font-size: 12px; color: rgba(245,240,235,.4); text-align: center; max-width: 640px; }

.sva-boot { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: #050505; font: 500 13px/2 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .12em; color: rgba(245,240,235,.7); text-transform: uppercase; transition: opacity .6s var(--ease), visibility .6s; }
.sva-boot.done { opacity: 0; visibility: hidden; }
.sva-boot p { margin: 0; color: inherit; }
.sva-boot p span { color: var(--o); }
.sva-boot .cur { display: inline-block; width: 9px; height: 15px; background: var(--o); vertical-align: -2px; animation: svaBlink 1s steps(1) infinite; }
@keyframes svaBlink { 50% { opacity: 0; } }

@media (max-width: 960px) {
  .sva { grid-template-rows: auto minmax(0, 1fr) auto; }
  .sva-mid { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); padding: 0 16px; gap: 0; }
  .sva-canvas { width: min(34vh, 72vw); }
  .sva-hud-data { display: none; }
  .sva-state { position: static; margin-top: -8px; }
  .sva-log { max-height: none; padding: 12px 0; }
  .sva-top { padding: 18px 16px 0; } .sva-bottom { padding: 0 16px 18px; }
  .sva-chips { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; width: 100%; scrollbar-width: none; }
  .sva-chips button { white-space: nowrap; }
  .sva-corner { display: none; }
  .sva-brand span { display: none; }
}

/* ---------- docked panel (after navigating) ---------- */
.sva-dock { --o: #2fce65; --o2: #8ee6ab; position: fixed; right: 20px; bottom: 20px; z-index: 160; width: min(380px, calc(100vw - 28px)); border-radius: 10px; background: rgba(14,14,14,.94); border: 1px solid rgba(47,206,101,.4); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 20px 60px rgba(0,0,0,.55); color: #f5f0eb; transform: translateY(20px); opacity: 0; visibility: hidden; transition: .45s var(--ease); }
.sva-dock.on { transform: none; opacity: 1; visibility: visible; }
.sva-dock-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 12px; border-bottom: 1px solid rgba(245,240,235,.08); }
.sva-dock canvas { width: 44px; height: 44px; flex: none; cursor: pointer; }
.sva-dock-head .t { flex: 1; min-width: 0; }
.sva-dock-head b { display: block; font: 600 11px/1 "JetBrains Mono", monospace; letter-spacing: .2em; color: var(--o, #2fce65); text-transform: uppercase; margin-bottom: 6px; }
.sva-dock-head span { font-size: 13px; color: rgba(245,240,235,.6); }
.sva-dock-head .sva-ico { width: 34px; height: 34px; }
.sva-dock-head .sva-ico svg { width: 15px; height: 15px; }
.sva-dock-body { padding: 14px 16px; font-size: 14px; line-height: 1.55; color: rgba(245,240,235,.9); max-height: 200px; overflow-y: auto; }
.sva-dock-body .play { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: #8ee6ab; }
.sva-dock-foot { display: flex; gap: 8px; padding: 0 12px 12px; }
.sva-dock-foot .sva-mic { width: 44px; height: 44px; } .sva-dock-foot .sva-mic svg { width: 18px; height: 18px; }
.sva-dock-foot .sva-text { height: 44px; }
.sva-docked-on .sva-dock { }

/* section focus ring when the assistant scrolls to something */
.sva-focus { position: relative; }
.sva-focus::after { content: ""; position: absolute; inset: -12px; border: 2px solid rgba(47,206,101,.85); border-radius: 10px; pointer-events: none; animation: svaFocus 2.6s var(--ease) forwards; z-index: 5; }
@keyframes svaFocus { 0% { opacity: 0; transform: scale(1.02); } 15% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) { .sva-launch, .sva-launch .orb::before, .sva-launch .orb::after { animation: none; } }
@media (max-width: 960px) {
  .sva-live { display: none; }
  .sva.is-listening .sva-live { display: -webkit-box; }
  .sva-pill { white-space: nowrap; }
}

/* Chai introduction card */
.chai-intro { display: grid; gap: 10px; }
.chai-intro .ci-hi { font: 600 20px/1.3 var(--display, sans-serif); color: #fff; margin: 0; letter-spacing: -0.01em; }
.chai-intro .ci-hi b { color: #8ee6ab; }
.chai-intro .ci-sub { margin: 0; color: rgba(245,240,235,.75); font-size: 14px; }
.chai-intro ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.chai-intro li { font-size: 13.5px; line-height: 1.5; color: rgba(245,240,235,.72); padding: 10px 12px; border-radius: 8px; background: rgba(245,240,235,.04); border: 1px solid rgba(245,240,235,.06); }
.chai-intro li b { display: block; color: #f5f0eb; font-size: 13.5px; margin-bottom: 2px; }
.chai-intro .ci-how { margin: 4px 0 0; font-size: 13px; color: rgba(245,240,235,.6); border-top: 1px solid rgba(245,240,235,.1); padding-top: 10px; }
.chai-intro .ci-how b { color: #8ee6ab; margin-right: 6px; }
