/* V69 — Pro AI: switch, council animation, richer answers */

/* ── Pro switch ─────────────────────────────────────────────────────────── */
.ai-pro-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 9px; border-radius: 999px; cursor: pointer; touch-action: manipulation;
  font: 800 10.5px/1 inherit; letter-spacing: .6px; text-transform: uppercase;
  color: rgba(255,255,255,.62); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  transition: transform .18s ease, background .25s ease, color .25s ease, border-color .25s ease, box-shadow .3s ease;
}
.ai-pro-btn svg { flex: 0 0 auto; }
.ai-pro-btn:active { transform: scale(.94); }
.ai-pro-btn.locked { opacity: .75; }
.ai-pro-btn.on {
  color: #fff; border-color: transparent;
  background: linear-gradient(120deg, #9f5dff, #ff5fa2 55%, #f5c842);
  background-size: 200% 100%; animation: proSheen 4s ease-in-out infinite;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset, 0 4px 16px rgba(159,93,255,.45);
}
@keyframes proSheen { 0%,100% { background-position: 0% 50% } 50% { background-position: 100% 50% } }
@media (max-width: 480px) { .ai-pro-btn span { display: none; } .ai-pro-btn { padding: 0 8px; } }

/* A quiet glow around the whole input row while Pro is on */
.ai-panel.pro-on .ai-input-row { box-shadow: 0 1px 0 rgba(159,93,255,.35), 0 10px 28px -14px rgba(159,93,255,.55); }
.ai-panel.pro-on .ai-spark { background: linear-gradient(120deg, #9f5dff, #ff5fa2, #f5c842); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ── Council animation ──────────────────────────────────────────────────── */
.ai-state.pc-row { display: block; padding: 4px 0 8px; transition: opacity .32s ease, transform .32s ease; }
.ai-state.pc-row.pc-out { opacity: 0; transform: scale(.94) translateY(-4px); }
.pc {
  --R: 54px; --c0: #9f5dff; --c1: #38bdf8; --c2: #ff5fa2; --c3: #f5c842;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px 6px 4px; border-radius: 18px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(159,93,255,.14), transparent 70%);
  border: 1px solid rgba(255,255,255,.07);
}
.pc-arena { position: relative; width: 156px; height: 156px; }
.pc-halo { position: absolute; inset: 14px; border-radius: 50%; background: radial-gradient(circle, rgba(159,93,255,.30), transparent 68%); animation: pcHalo 3.2s ease-in-out infinite; }
.pc-ring { position: absolute; inset: 0; animation: pcSpin 16s linear infinite; }
.pc-slot { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--a)); }
.pc-beam { position: absolute; left: 0; top: -1px; height: 2px; width: var(--R); transform-origin: 0 50%; opacity: .0; border-radius: 2px; transition: width .9s cubic-bezier(.7,0,.2,1), opacity .4s ease; background: linear-gradient(90deg, transparent, var(--c)); }
.pc-beam[data-i="0"], .pc-orb[data-i="0"], .pc-name[data-i="0"] { --c: var(--c0); }
.pc-beam[data-i="1"], .pc-orb[data-i="1"], .pc-name[data-i="1"] { --c: var(--c1); }
.pc-beam[data-i="2"], .pc-orb[data-i="2"], .pc-name[data-i="2"] { --c: var(--c2); }
.pc-beam[data-i="3"], .pc-orb[data-i="3"], .pc-name[data-i="3"] { --c: var(--c3); }
.pc-orb {
  position: absolute; left: var(--R); top: 0; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: color-mix(in srgb, var(--c) 28%, #0b0b12); border: 1.5px solid color-mix(in srgb, var(--c) 55%, transparent);
  transform: rotate(calc(var(--a, 0deg) * -1)); transition: left .9s cubic-bezier(.7,0,.2,1), opacity .4s ease, box-shadow .4s ease, background .4s ease, filter .4s ease;
  opacity: .5;
}
.pc-ico { animation: pcSpinRev 16s linear infinite; }
.pc-orb::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--c); opacity: 0; }
.pc-orb[data-s="think"] { opacity: 1; box-shadow: 0 0 14px 1px color-mix(in srgb, var(--c) 70%, transparent); animation: pcBob 1.3s ease-in-out infinite; }
.pc-orb[data-s="think"]::after { animation: pcRipple 1.5s ease-out infinite; }
.pc-orb[data-s="done"] { opacity: 1; background: var(--c); box-shadow: 0 0 16px 2px color-mix(in srgb, var(--c) 65%, transparent); animation: pcPop .45s cubic-bezier(.34,1.5,.64,1); }
.pc-orb[data-s="fail"] { opacity: .22; filter: grayscale(1); }
.pc[data-stage="think"] .pc-beam, .pc[data-stage="fuse"] .pc-beam { opacity: .55; }

.pc-core { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; transition: transform .6s cubic-bezier(.34,1.4,.64,1), filter .6s ease; }
.pc-core i { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, var(--c0), var(--c1), var(--c3), var(--c2), var(--c0)); animation: pcSpin 4s linear infinite; filter: blur(.4px); box-shadow: 0 0 22px rgba(159,93,255,.55); }
.pc-core::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: #0b0b12; }
.pc[data-stage="wait"] .pc-core { transform: scale(.8); filter: saturate(.6) brightness(.8); }

/* Fusing: orbs are drawn into the core, which blazes */
.pc[data-stage="fuse"] { --R: 14px; }
.pc[data-stage="fuse"] .pc-ring { animation-duration: 2.2s; }
.pc[data-stage="fuse"] .pc-ico { animation-duration: 2.2s; }
.pc[data-stage="fuse"] .pc-orb { opacity: .9; transform: rotate(calc(var(--a, 0deg) * -1)) scale(.7); }
.pc[data-stage="fuse"] .pc-core { transform: scale(1.35); filter: brightness(1.25) saturate(1.3); }
.pc[data-stage="fuse"] .pc-core i { animation-duration: 1.1s; box-shadow: 0 0 34px 4px rgba(255,95,162,.6); }
.pc[data-stage="fuse"] .pc-halo { animation-duration: 1.2s; }
.pc[data-stage="done"] .pc-core { animation: pcBurst .5s ease-out; }
.pc[data-stage="fb"] { filter: grayscale(.85); opacity: .75; }
.pc[data-stage="fb"] .pc-ring, .pc[data-stage="fb"] .pc-ico { animation-play-state: paused; }

.pc-names { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; max-width: 280px; }
.pc-name { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; color: rgba(255,255,255,.45); background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); transition: color .3s, background .3s, border-color .3s; }
.pc-name u { width: 6px; height: 6px; border-radius: 50%; background: var(--c); opacity: .35; transition: opacity .3s, box-shadow .3s; }
.pc-name em { font-style: normal; }
.pc-name[data-s="think"] { color: rgba(255,255,255,.85); }
.pc-name[data-s="think"] u { opacity: 1; animation: pcBlink 1s ease-in-out infinite; }
.pc-name[data-s="done"] { color: #fff; border-color: color-mix(in srgb, var(--c) 60%, transparent); background: color-mix(in srgb, var(--c) 16%, transparent); }
.pc-name[data-s="done"] u { opacity: 1; box-shadow: 0 0 8px var(--c); }
.pc-name[data-s="fail"] { opacity: .35; text-decoration: line-through; }

.pc-cap { font-size: 12.5px; font-weight: 600; min-height: 18px; text-align: center; }
.pc-cap #ai-load-txt { background: linear-gradient(90deg, rgba(255,255,255,.5) 0%, #fff 45%, rgba(255,255,255,.5) 90%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: pcShimmer 2.4s linear infinite; }
.pc-cap #ai-load-txt.pc-swap { animation: pcShimmer 2.4s linear infinite, pcCapIn .35s ease both; }

@keyframes pcSpin { to { transform: rotate(360deg) } }
@keyframes pcSpinRev { to { transform: rotate(-360deg) } }
@keyframes pcHalo { 0%,100% { transform: scale(.9); opacity: .7 } 50% { transform: scale(1.12); opacity: 1 } }
@keyframes pcBob { 0%,100% { translate: 0 0 } 50% { translate: 0 -3px } }
@keyframes pcRipple { 0% { transform: scale(1); opacity: .75 } 100% { transform: scale(1.9); opacity: 0 } }
@keyframes pcPop { 0% { scale: .6 } 100% { scale: 1 } }
@keyframes pcBlink { 0%,100% { transform: scale(1) } 50% { transform: scale(1.5) } }
@keyframes pcShimmer { to { background-position: -220% 0 } }
@keyframes pcCapIn { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }
@keyframes pcBurst { 0% { transform: scale(1.35) } 50% { transform: scale(1.9); filter: brightness(1.8) } 100% { transform: scale(1) } }

/* ── Richer answers (applies to every assistant bubble) ─────────────────── */
.ai-assistant-bubble p { margin: 0 0 .55em; }
.ai-assistant-bubble p:last-child, .ai-assistant-bubble ul:last-child, .ai-assistant-bubble ol:last-child { margin-bottom: 0; }
.ai-assistant-bubble strong { font-weight: 700; color: #fff; }
.ai-assistant-bubble .pro-t { color: var(--ai-accent, #b98aff); }
.ai-assistant-bubble .pro-y { font-weight: 500; font-size: .86em; opacity: .78; color: inherit; margin-left: 1px; }
.ai-assistant-bubble ul, .ai-assistant-bubble ol { margin: .2em 0 .6em; padding-left: 1.25em; }
.ai-assistant-bubble li { margin: .22em 0; padding-left: .1em; }
.ai-assistant-bubble li::marker { color: var(--ai-accent, #b98aff); font-weight: 700; }
.ai-assistant-bubble.typing p:last-child::after { content: ''; display: inline-block; }

/* Which brain answered */
.pro-chip { margin-left: auto; align-self: center; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; padding: 3px 9px; border-radius: 999px; color: #fff; background: linear-gradient(120deg, rgba(159,93,255,.55), rgba(255,95,162,.45)); border: 1px solid rgba(255,255,255,.16); animation: pcCapIn .4s ease both; white-space: nowrap; }
.pro-chip.off { color: rgba(255,255,255,.55); background: rgba(255,255,255,.06); }

/* Calm it down when asked or on weak devices */
@media (prefers-reduced-motion: reduce) {
  .pc *, .pc, .ai-pro-btn.on, .pro-chip { animation: none !important; transition: none !important; }
  .pc-ring { transform: none; }
}
html.lite-mode .pc *, html.eco-mode .pc *, html.lite-mode .ai-pro-btn.on, html.eco-mode .ai-pro-btn.on { animation: none !important; }
