/* ══════════════════════════════════════════════════════════════════════════
   NOVA GLASS v4 — richer colour, more animation, readability. Loaded after v3.
   15-agent pass, curated & de-cluttered by hand. Scoped html[data-theme="glass"]
   (typing-FX + Moon polish at the very bottom are intentionally global/moon).
   ══════════════════════════════════════════════════════════════════════════ */

/* ── BACKGROUND CURATION: keep body rainbow (v3) + waves + particles only ── */
html[data-theme="glass"]::before { display: none !important; }       /* drop v3 root waves */
html[data-theme="glass"] body::after { display: none !important; }   /* drop base blob B   */

/* bottom-weighted aurora WAVES (behind content) */
html[data-theme="glass"] #mainContent::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; background-color: transparent;
  background-image:
    linear-gradient(115deg, rgba(6,182,212,0.22) 0%, rgba(99,102,241,0) 35%, rgba(168,85,247,0.20) 70%, rgba(236,72,153,0) 100%),
    linear-gradient(245deg, rgba(20,184,166,0.18) 0%, rgba(6,182,212,0) 40%, rgba(99,102,241,0.20) 75%, rgba(168,85,247,0) 100%),
    radial-gradient(120% 80% at 30% 115%, rgba(236,72,153,0.30) 0%, rgba(168,85,247,0.18) 30%, rgba(99,102,241,0) 60%),
    radial-gradient(140% 90% at 75% 120%, rgba(6,182,212,0.30) 0%, rgba(20,184,166,0.16) 32%, rgba(99,102,241,0) 62%);
  background-size: 220% 220%, 240% 240%, 180% 160%, 200% 170%;
  background-position: 0% 50%, 100% 50%, 50% 100%, 50% 100%;
  background-repeat: no-repeat; filter: saturate(1.15) blur(8px);
  will-change: background-position, transform, opacity;
  animation: gv4WaveFlowA 26s ease-in-out infinite, gv4WaveSway 18s ease-in-out infinite;
}
@keyframes gv4WaveFlowA { 0% { background-position: 0% 50%, 100% 50%, 50% 100%, 50% 100%; } 50% { background-position: 100% 45%, 0% 60%, 60% 95%, 40% 98%; } 100% { background-position: 0% 50%, 100% 50%, 50% 100%, 50% 100%; } }
@keyframes gv4WaveSway { 0% { transform: translate3d(0,0,0) scale(1.02); } 50% { transform: translate3d(-1.5%,0.8%,0) scale(1.05); } 100% { transform: translate3d(0,0,0) scale(1.02); } }

/* drifting BUBBLE particles (behind content) */
html[data-theme="glass"] body::before {
  content: ""; position: fixed; inset: -10vh 0; z-index: -1; pointer-events: none; background-repeat: no-repeat;
  background-image:
    radial-gradient(circle at 12% 90%, rgba(6,182,212,0.30) 0 10px, transparent 12px),
    radial-gradient(circle at 28% 70%, rgba(99,102,241,0.26) 0 16px, transparent 18px),
    radial-gradient(circle at 45% 95%, rgba(168,85,247,0.24) 0 7px, transparent 9px),
    radial-gradient(circle at 62% 80%, rgba(236,72,153,0.22) 0 13px, transparent 15px),
    radial-gradient(circle at 78% 92%, rgba(20,184,166,0.28) 0 9px, transparent 11px),
    radial-gradient(circle at 90% 65%, rgba(99,102,241,0.20) 0 18px, transparent 20px),
    radial-gradient(circle at 35% 55%, rgba(6,182,212,0.18) 0 6px, transparent 8px),
    radial-gradient(circle at 70% 45%, rgba(236,72,153,0.18) 0 11px, transparent 13px);
  background-size: 100% 120vh; will-change: transform; animation: gv4Float 26s linear infinite, gv4Sway 9s ease-in-out infinite alternate;
}
@keyframes gv4Float { from { background-position: 0 0; } to { background-position: 0 -120vh; } }
@keyframes gv4Sway { from { transform: translateX(-14px); opacity: 0.8; } to { transform: translateX(14px); opacity: 1; } }

/* ── MESSAGE BUBBLES polish (AI text stays dark) ── */
@keyframes gv4BubBorder { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
@keyframes gv4BubFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
html[data-theme="glass"] .ai-row .message-content,
html[data-theme="glass"] .ai-content {
  position: relative;
  background: linear-gradient(170deg, rgba(255,255,255,0.80), rgba(255,255,255,0.64)) !important;
  border: 1px solid transparent !important; border-radius: 18px 18px 18px 6px !important;
  -webkit-backdrop-filter: blur(var(--g-blur)) saturate(165%); backdrop-filter: blur(var(--g-blur)) saturate(165%);
  box-shadow: var(--g-shadow), inset 0 1px 0 rgba(255,255,255,0.9) !important;
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s ease; will-change: transform;
  animation: gv4BubFloat 6s ease-in-out infinite;
}
html[data-theme="glass"] .ai-row .message-content::before,
html[data-theme="glass"] .ai-content::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: 0;
  background: linear-gradient(110deg, var(--g-accent), var(--g-accent2), var(--g-accent3), var(--g-accent4), var(--g-accent5), var(--g-accent)) 0 0 / 200% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .55; animation: gv4BubBorder 8s linear infinite;
}
html[data-theme="glass"] .ai-row .message-content::after,
html[data-theme="glass"] .ai-content::after {
  content: ""; position: absolute; inset: 1px 1px 45% 1px; border-radius: 17px 17px 40px 6px;
  background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0)); pointer-events: none; z-index: 0;
}
html[data-theme="glass"] .ai-row .message-content > *,
html[data-theme="glass"] .ai-content > * { position: relative; z-index: 1; }
html[data-theme="glass"] .ai-row .message-content:hover,
html[data-theme="glass"] .ai-content:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -10px rgba(6,182,212,0.42), inset 0 1px 0 rgba(255,255,255,0.95) !important; }
html[data-theme="glass"] .user-row .message-content {
  position: relative; background: linear-gradient(135deg, var(--g-accent), var(--g-accent2) 55%, var(--g-accent3)) !important;
  border: 1px solid rgba(255,255,255,0.35) !important; border-radius: 18px 18px 6px 18px !important;
  box-shadow: 0 8px 24px -10px rgba(99,102,241,0.5), inset 0 1px 0 rgba(255,255,255,0.4) !important;
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s ease; will-change: transform;
}
html[data-theme="glass"] .user-row .message-content::after { content: ""; position: absolute; inset: 1px 1px 50% 1px; border-radius: 17px 17px 6px 17px; background: linear-gradient(180deg, rgba(255,255,255,0.32), rgba(255,255,255,0)); pointer-events: none; }
html[data-theme="glass"] .user-row .message-content:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -10px rgba(168,85,247,0.55), inset 0 1px 0 rgba(255,255,255,0.5) !important; }

/* ── MESSAGE ENTRANCE (surface from water) ── */
html[data-theme="glass"] .ai-row, html[data-theme="glass"] .user-row { position: relative; animation: gv4MsgSurface 0.5s cubic-bezier(0.22,1,0.36,1) both; will-change: transform, opacity, filter; }
html[data-theme="glass"] .ai-row::after, html[data-theme="glass"] .user-row::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at 50% 60%, rgba(6,182,212,0.30), rgba(236,72,153,0.16) 45%, transparent 70%); animation: gv4MsgRipple 0.55s ease-out both;
}
@keyframes gv4MsgSurface { 0% { opacity: 0; transform: translateY(14px) scale(0.985); filter: blur(6px); } 60% { filter: blur(0.5px); } 100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }
@keyframes gv4MsgRipple { 0% { opacity: 0.5; transform: scale(0.6); } 100% { opacity: 0; transform: scale(1.25); } }

/* ── SUGGESTION CARDS idle breathing + colour glow ── */
html[data-theme="glass"] .suggestion-card { color: var(--g-text); will-change: transform, box-shadow; transform: translateZ(0); animation: gv4SugFloat 7s ease-in-out infinite, gv4SugGlow 12s linear infinite; }
@keyframes gv4SugFloat { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(0,-4px,0) scale(1.012); } }
@keyframes gv4SugGlow {
  0% { box-shadow: 0 6px 22px -8px rgba(6,182,212,.55); } 25% { box-shadow: 0 8px 26px -8px rgba(99,102,241,.55); }
  50% { box-shadow: 0 8px 26px -8px rgba(168,85,247,.55); } 75% { box-shadow: 0 8px 26px -8px rgba(236,72,153,.55); } 100% { box-shadow: 0 6px 22px -8px rgba(20,184,166,.55); }
}
html[data-theme="glass"] .suggestion-card:nth-child(1) { animation-delay: 0s,-0.5s; }
html[data-theme="glass"] .suggestion-card:nth-child(2) { animation-delay: -1.2s,-2.5s; }
html[data-theme="glass"] .suggestion-card:nth-child(3) { animation-delay: -2.4s,-4.5s; }
html[data-theme="glass"] .suggestion-card:nth-child(4) { animation-delay: -3.6s,-6.5s; }
html[data-theme="glass"] .suggestion-card:nth-child(5) { animation-delay: -4.8s,-8.5s; }
html[data-theme="glass"] .suggestion-card:nth-child(6) { animation-delay: -6s,-10.5s; }
html[data-theme="glass"] .suggestion-card:hover { color: var(--g-text); transform: translate3d(0,-7px,0) scale(1.04); animation-play-state: paused; box-shadow: 0 16px 40px -10px rgba(99,102,241,.7), 0 0 26px -4px rgba(168,85,247,.6); }

/* ── SIDEBAR extra ── */
html[data-theme="glass"] .chat-history > *, html[data-theme="glass"] .new-chat-btn, html[data-theme="glass"] .sidebar-settings-btn, html[data-theme="glass"] .account-btn { position: relative; overflow: hidden; transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease, background .3s ease; will-change: transform; }
html[data-theme="glass"] .chat-history > *::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 0; transform: translateY(-50%); border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--g-accent), var(--g-accent2), var(--g-accent3), var(--g-accent4), var(--g-accent5)); background-size: 100% 300%;
  animation: gv4SideEdgeFlow 6s linear infinite; transition: height .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease; box-shadow: 0 0 6px rgba(6,182,212,.6); z-index: 2;
}
html[data-theme="glass"] .chat-history > *:hover::before, html[data-theme="glass"] .chat-history > *.active::before, html[data-theme="glass"] .chat-history > *[aria-selected="true"]::before { height: 70%; box-shadow: 0 0 10px rgba(168,85,247,.7); }
html[data-theme="glass"] .chat-history > *:hover, html[data-theme="glass"] .chat-history > *.active { transform: translateX(3px); color: var(--g-text); }
html[data-theme="glass"] .new-chat-btn:hover svg, html[data-theme="glass"] .sidebar-settings-btn:hover svg, html[data-theme="glass"] .account-btn:hover svg { animation: gv4SideIconBounce .5s ease; }
html[data-theme="glass"] .local-ai-dot { background: var(--g-accent5); animation: gv4SidePulse 2.4s ease-in-out infinite; }
@keyframes gv4SideEdgeFlow { to { background-position: 0 -300%; } }
@keyframes gv4SideIconBounce { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-3px) scale(1.08); } }
@keyframes gv4SidePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(20,184,166,.55); } 50% { box-shadow: 0 0 8px 3px rgba(20,184,166,.35); } }

/* ── THINKING BAR extra liquid ── */
html[data-theme="glass"] .thinking-row.nova-enh { position: relative; isolation: isolate; overflow: visible; animation: gv4ThkGlow 7s ease-in-out infinite; will-change: box-shadow, filter; }
html[data-theme="glass"] .thinking-row.nova-enh::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none; mix-blend-mode: screen; opacity: .55;
  background: radial-gradient(120% 60% at 15% 20%, rgba(6,182,212,.45), transparent 60%), radial-gradient(100% 55% at 85% 80%, rgba(168,85,247,.40), transparent 60%), linear-gradient(115deg, transparent 30%, rgba(236,72,153,.30) 48%, rgba(20,184,166,.30) 56%, transparent 72%);
  background-size: 200% 200%, 200% 200%, 250% 100%; animation: gv4ThkCaustic 6s linear infinite; will-change: background-position;
}
@keyframes gv4ThkGlow { 0%,100% { box-shadow: 0 0 18px -4px var(--g-accent), 0 0 8px -2px var(--g-accent2); filter: saturate(1.1); } 33% { box-shadow: 0 0 22px -3px var(--g-accent3), 0 0 10px -2px var(--g-accent4); } 66% { box-shadow: 0 0 22px -3px var(--g-accent5), 0 0 10px -2px var(--g-accent); } }
@keyframes gv4ThkCaustic { 0% { background-position: 0% 0%, 100% 100%, 0% 0; } 100% { background-position: 200% 200%, -100% -100%, 250% 0; } }
html[data-theme="glass"] .thinking-row.nova-enh .nova-enh-star { position: relative; width: 22px; height: 22px; }
html[data-theme="glass"] .thinking-row.nova-enh .nova-enh-star::before { content: ""; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--g-accent); pointer-events: none; animation: gv4ThkRipple 2.6s ease-out infinite; will-change: transform, opacity; }
@keyframes gv4ThkRipple { 0% { transform: scale(.5); opacity: .8; } 70% { opacity: 0; } 100% { transform: scale(2.6); opacity: 0; } }

/* ── WEB-RESULT panel glass + smooth collapse ── */
html[data-theme="glass"] .nova-web-result { position: relative; border-radius: 20px; overflow: hidden; background: rgba(255,255,255,0.6) !important; border: 1px solid rgba(255,255,255,0.7) !important; -webkit-backdrop-filter: blur(var(--g-blur)) saturate(180%); backdrop-filter: blur(var(--g-blur)) saturate(180%); box-shadow: 0 8px 32px rgba(99,102,241,.18), inset 0 1px 0 rgba(255,255,255,.6) !important; color: var(--g-text); will-change: transform; animation: gv4WebIn .5s cubic-bezier(.22,1,.36,1) both; }
html[data-theme="glass"] .nova-web-result::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--g-accent), var(--g-accent2), var(--g-accent3), var(--g-accent4), var(--g-accent5), var(--g-accent)); background-size: 300% 100%; animation: gv4WebFlow 6s linear infinite; z-index: 2; }
html[data-theme="glass"] .nova-web-result-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: linear-gradient(120deg, rgba(6,182,212,.22), rgba(99,102,241,.20), rgba(168,85,247,.20), rgba(236,72,153,.18)) !important; border-bottom: 1px solid var(--g-border) !important; }
html[data-theme="glass"] .nova-web-result-title { flex: 1; font-weight: 700; font-size: 14px; background: linear-gradient(90deg, var(--g-accent2), var(--g-accent3)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
html[data-theme="glass"] .nwr-btn { width: 30px; height: 30px; border: 1px solid var(--g-border) !important; border-radius: 10px; background: rgba(255,255,255,.45) !important; color: var(--g-text) !important; transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s, background .18s; }
html[data-theme="glass"] .nwr-btn:hover { transform: translateY(-2px) scale(1.08); background: rgba(255,255,255,.75) !important; box-shadow: 0 6px 18px rgba(6,182,212,.45); }
html[data-theme="glass"] .nwr-btn:active { transform: translateY(0) scale(.92); }
html[data-theme="glass"] .nova-web-result-body { color: var(--g-text) !important; background: rgba(255,255,255,.35) !important; line-height: 1.6; transition: max-height .42s cubic-bezier(.4,0,.2,1), padding .42s cubic-bezier(.4,0,.2,1), opacity .3s; }
html[data-theme="glass"] .nova-web-result.collapsed .nova-web-result-body { max-height: 0 !important; height: 0 !important; padding-top: 0; padding-bottom: 0; opacity: 0; overflow: hidden; resize: none; }
html[data-theme="glass"] .nova-web-result.collapsed .nwr-collapse { transform: rotate(180deg); }
@keyframes gv4WebIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes gv4WebFlow { to { background-position: 300% 0; } }

/* ── BUTTONS / CHIPS extra glow + wobble ── */
html[data-theme="glass"] .icon-btn:hover, html[data-theme="glass"] .model-chip:hover, html[data-theme="glass"] .nova-fb-btn:hover, html[data-theme="glass"] .nova-fb-web:hover, html[data-theme="glass"] .send-btn:hover { animation: gv4BtnGlow 2.4s ease-in-out infinite; }
html[data-theme="glass"] .icon-btn:hover svg, html[data-theme="glass"] .nova-fb-btn:hover svg { animation: gv4BtnWobble .55s cubic-bezier(.34,1.56,.64,1); }
html[data-theme="glass"] .nova-fb-web::after { content: "✦"; position: absolute; top: -2px; right: -1px; font-size: .55em; pointer-events: none; color: var(--g-accent5); opacity: 0; transform: scale(.4); }
html[data-theme="glass"] .nova-fb-web:hover::after { animation: gv4BtnSparkle 1.1s ease-in-out infinite; }
@keyframes gv4BtnGlow { 0%,100% { filter: saturate(1); } 50% { filter: saturate(1.35) brightness(1.06); } }
@keyframes gv4BtnWobble { 0%,100% { transform: rotate(0) scale(1); } 30% { transform: rotate(-9deg) scale(1.12); } 65% { transform: rotate(6deg) scale(1.06); } }
@keyframes gv4BtnSparkle { 0%,100% { opacity: 0; transform: scale(.4) rotate(0); } 50% { opacity: 1; transform: scale(1.1) rotate(90deg); color: var(--g-accent4); } }

/* ── SETTINGS / DESIGN theme cards ── */
@keyframes gv4SetFlow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes gv4SetStars { 0%,100% { opacity: .55; transform: translate3d(0,0,0); } 50% { opacity: 1; transform: translate3d(2px,-2px,0); } }
@keyframes gv4SetRing { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
html[data-theme="glass"] .nova-theme-card.active::after { content: ""; position: absolute; inset: -2px; border-radius: 20px; padding: 2px; background: conic-gradient(from 0deg, var(--g-accent), var(--g-accent2), var(--g-accent3), var(--g-accent4), var(--g-accent5), var(--g-accent)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: gv4SetRing 6s linear infinite; pointer-events: none; }
html[data-theme="glass"] .nova-theme-swatch.glass { background: linear-gradient(120deg, var(--g-accent), var(--g-accent2), var(--g-accent3), var(--g-accent4), var(--g-accent5), var(--g-accent)) !important; background-size: 300% 300% !important; animation: gv4SetFlow 8s ease infinite; }
html[data-theme="glass"] .nova-theme-swatch.moon::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent), radial-gradient(1.5px 1.5px at 70% 60%, #cdd6ff, transparent), radial-gradient(1px 1px at 45% 80%, #fff, transparent), radial-gradient(2px 2px at 85% 25%, #a855f7, transparent); animation: gv4SetStars 4s ease-in-out infinite; }
html[data-theme="glass"] .nova-theme-meta strong { color: var(--g-text); font-weight: 700; }

/* ── HERO / TOPBAR extra ── */
@keyframes gv4HeroFlow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes gv4HeroSpec { 0% { transform: translateX(-160%) skewX(-20deg); } 60%,100% { transform: translateX(260%) skewX(-20deg); } }
@keyframes gv4HeroOrbit { from { transform: rotate(0) translateX(46px) rotate(0); } to { transform: rotate(360deg) translateX(46px) rotate(-360deg); } }
@keyframes gv4HeroOrbit2 { from { transform: rotate(180deg) translateX(38px) rotate(0); } to { transform: rotate(540deg) translateX(38px) rotate(-360deg); } }
@keyframes gv4HeroFloat2 { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
html[data-theme="glass"] .welcome-title, html[data-theme="glass"] .topbar-brand { background: linear-gradient(110deg, var(--g-accent), var(--g-accent2), var(--g-accent3), var(--g-accent4), var(--g-accent5), var(--g-accent)); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; animation: gv4HeroFlow 7s ease-in-out infinite; text-shadow: 0 1px 12px rgba(99,102,241,.18); will-change: background-position; }
html[data-theme="glass"] .welcome-logo-wrap { position: relative; animation: gv4HeroFloat2 5s ease-in-out infinite; will-change: transform; }
html[data-theme="glass"] .welcome-logo-mark, html[data-theme="glass"] .topbar-logo { position: relative; overflow: hidden; border-radius: 18px; box-shadow: 0 8px 26px rgba(6,182,212,.28), inset 0 1px 0 rgba(255,255,255,.55); }
html[data-theme="glass"] .welcome-logo-mark::after, html[data-theme="glass"] .topbar-logo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.75) 50%, transparent 65%); transform: translateX(-160%) skewX(-20deg); animation: gv4HeroSpec 4.5s ease-in-out infinite; pointer-events: none; will-change: transform; }
html[data-theme="glass"] .topbar-logo::after { animation-duration: 5.5s; }

/* ── CLARIFICATION extra glow + stagger ── */
/* Keep position:fixed (NOT relative) so the overlay stays centered above the input
   like Moon — `relative` made it flow to the top-right of the screen in glass. The
   ::before glow still anchors fine because fixed is a positioning context. */
html[data-theme="glass"] #nova-clarify-overlay { position: fixed; }
html[data-theme="glass"] #nova-clarify-overlay::before { content: ""; position: absolute; inset: -2px; z-index: -1; border-radius: inherit; pointer-events: none; background: linear-gradient(120deg, var(--g-accent), var(--g-accent2), var(--g-accent3), var(--g-accent4), var(--g-accent5), var(--g-accent)); background-size: 300% 300%; filter: blur(14px); opacity: .55; will-change: background-position, opacity; animation: gv4ClarGlow 9s ease-in-out infinite, gv4ClarBreathe 4.5s ease-in-out infinite; }
html[data-theme="glass"] .nova-cl-row { will-change: transform, opacity; opacity: 0; animation: gv4ClarRowIn .45s cubic-bezier(.22,1,.36,1) both; }
html[data-theme="glass"] .nova-cl-row:nth-child(1) { animation-delay: .10s; }
html[data-theme="glass"] .nova-cl-row:nth-child(2) { animation-delay: .18s; }
html[data-theme="glass"] .nova-cl-row:nth-child(3) { animation-delay: .26s; }
html[data-theme="glass"] .nova-cl-row:nth-child(4) { animation-delay: .34s; }
html[data-theme="glass"] .nova-cl-num { animation: gv4ClarNumPulse 3.2s ease-in-out infinite; }
html[data-theme="glass"] .nova-cl-chev { animation: gv4ClarChevBob 1.8s ease-in-out infinite; }
@keyframes gv4ClarGlow { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes gv4ClarBreathe { 0%,100% { opacity: .4; } 50% { opacity: .7; } }
@keyframes gv4ClarRowIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
@keyframes gv4ClarNumPulse { 0%,100% { transform: scale(1); box-shadow: 0 0 0 0 var(--g-accent); } 50% { transform: scale(1.08); box-shadow: 0 0 12px 2px var(--g-accent3); } }
@keyframes gv4ClarChevBob { 0%,100% { transform: translateX(0); } 50% { transform: translateX(4px); } }

/* ── SCROLLBAR / SELECTION / CARET / FOCUS ── */
@keyframes gv4ScrlHue { to { filter: hue-rotate(360deg); } }
@keyframes gv4ScrlCaret { 0%,100% { caret-color: #06b6d4; } 25% { caret-color: #a855f7; } 50% { caret-color: #ec4899; } 75% { caret-color: #14b8a6; } }
html[data-theme="glass"] ::-webkit-scrollbar-thumb { background-image: linear-gradient(135deg, #06b6d4, #6366f1, #a855f7, #ec4899, #14b8a6) !important; box-shadow: 0 0 6px rgba(99,102,241,.4); animation: gv4ScrlHue 8s linear infinite; will-change: filter; }
html[data-theme="glass"] ::selection { background-color: rgba(168,85,247,.35); color: var(--g-text); }
html[data-theme="glass"] .chat-input { caret-color: #6366f1; animation: gv4ScrlCaret 4s ease-in-out infinite; will-change: caret-color; }
html[data-theme="glass"] input:focus-visible, html[data-theme="glass"] textarea:focus-visible, html[data-theme="glass"] button:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(6,182,212,.55), 0 0 12px 2px rgba(168,85,247,.45); transition: box-shadow .2s ease; }

/* ── TYPING-FX visuals (global; both themes) ── */
.tfx-drop, .tfx-ring, .tfx-del, .tfx-moon { position: fixed; pointer-events: none; will-change: transform, opacity; z-index: 9999; }
.tfx-drop { width: 8px; height: 8px; border-radius: 50% 50% 50% 0; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.6), var(--tfxc, #06b6d4) 70%); box-shadow: 0 0 8px var(--tfxc, #06b6d4), 0 6px 10px -4px var(--tfxc, #06b6d4); transform: rotate(-45deg); animation: gv4TypeDrop .6s cubic-bezier(.3,.7,.3,1) forwards; }
@keyframes gv4TypeDrop { 0% { opacity: 0; transform: translate(0,4px) rotate(-45deg) scale(.4); } 25% { opacity: 1; transform: translate(0,-9px) rotate(-45deg) scale(1.05); } 100% { opacity: 0; transform: translate(0,12px) rotate(-45deg) scale(.7); } }
.tfx-ring { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--tfxc, #6366f1); box-shadow: 0 0 10px var(--tfxc, #6366f1), inset 0 0 6px var(--tfxc, #6366f1); animation: gv4TypeRing .6s ease-out forwards; }
@keyframes gv4TypeRing { 0% { opacity: .9; transform: scale(.3); } 70% { opacity: .5; } 100% { opacity: 0; transform: scale(3.2); } }
.tfx-del { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle, var(--tfxc, #ec4899) 0%, transparent 70%); box-shadow: 0 0 12px var(--tfxc, #ec4899); animation: gv4TypeDel .6s ease-in forwards; }
@keyframes gv4TypeDel { 0% { opacity: .9; transform: scale(1); } 40% { opacity: 1; transform: scale(1.4) rotate(15deg); } 100% { opacity: 0; transform: scale(.1) rotate(90deg); } }
.tfx-moon { font-size: 13px; line-height: 1; color: var(--tfxc, #a855f7); text-shadow: 0 0 8px var(--tfxc, #a855f7), 0 0 14px var(--tfxc, #a855f7); animation: gv4TypeStar .6s ease-out forwards; }
@keyframes gv4TypeStar { 0% { opacity: 0; transform: translateY(2px) scale(.2) rotate(-30deg); } 30% { opacity: 1; transform: translateY(-4px) scale(1.15) rotate(0deg); } 100% { opacity: 0; transform: translateY(-12px) scale(.5) rotate(45deg); } }
.tfx-moon.space { animation: gv4TypeStarSpace .6s ease-out forwards; }
@keyframes gv4TypeStarSpace { 0% { opacity: 0; transform: scale(.2); } 30% { opacity: 1; transform: scale(1.6); } 100% { opacity: 0; transform: scale(2.6) rotate(60deg); } }
.tfx-moon.del { animation: gv4TypeStarDel .6s ease-in forwards; }
@keyframes gv4TypeStarDel { 0% { opacity: 1; transform: scale(1) rotate(0); } 100% { opacity: 0; transform: scale(.1) rotate(-120deg); } }
.input-container.tfx-pulse { animation: gv4TypePulse .6s ease-out; }
@keyframes gv4TypePulse { 0% { box-shadow: 0 0 0 0 rgba(99,102,241,.35); } 60% { box-shadow: 0 0 0 6px rgba(99,102,241,0); } 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); } }

/* ── NOVA MOON polish (default dark theme; Glass untouched) ── */
@keyframes gv4MoonTwinkle { 0%,100% { opacity: .35; } 50% { opacity: .9; } }
@keyframes gv4MoonShimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes gv4MoonGlow { 0%,100% { box-shadow: 0 0 0 2px rgba(168,85,247,.35), 0 0 12px rgba(6,182,212,.25); } 50% { box-shadow: 0 0 0 2px rgba(6,182,212,.45), 0 0 18px rgba(168,85,247,.35); } }
html[data-theme="moon"] #welcomeScreen::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(1.5px 1.5px at 20% 30%, rgba(168,85,247,.7), transparent), radial-gradient(1.5px 1.5px at 70% 60%, rgba(6,182,212,.6), transparent), radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,.5), transparent), radial-gradient(1px 1px at 85% 20%, rgba(255,255,255,.45), transparent), radial-gradient(1.5px 1.5px at 55% 15%, rgba(168,85,247,.5), transparent);
  background-repeat: no-repeat; animation: gv4MoonTwinkle 6s ease-in-out infinite; will-change: opacity;
}
html[data-theme="moon"] input:focus-visible, html[data-theme="moon"] textarea:focus-visible, html[data-theme="moon"] button:focus-visible { outline: none; animation: gv4MoonGlow 3s ease-in-out infinite; border-radius: 8px; }
html[data-theme="moon"] .chat-input { caret-color: #06b6d4; }
html[data-theme="moon"] .topbar-brand, html[data-theme="moon"] .welcome-title { background-image: linear-gradient(100deg, currentColor 0%, currentColor 35%, #a855f7 48%, #06b6d4 55%, currentColor 68%, currentColor 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; animation: gv4MoonShimmer 8s linear infinite; will-change: background-position; }

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  html[data-theme="glass"] #mainContent::after, html[data-theme="glass"] body::before { animation: none !important; }
  html[data-theme="glass"] [class] { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
  .tfx-drop, .tfx-ring, .tfx-del, .tfx-moon { animation: gv4TypeFade .6s ease forwards !important; }
  @keyframes gv4TypeFade { 0% { opacity: .8; } 100% { opacity: 0; } }
  .input-container.tfx-pulse { animation: none !important; }
  html[data-theme="moon"] #welcomeScreen::after, html[data-theme="moon"] .topbar-brand, html[data-theme="moon"] .welcome-title { animation: none !important; }
}
