/* ==========================================================================
   TaxEye AI: full chat page and floating co-pilot. 2050 glass layer.
   Palette: void #050A1F, navy #0E1A3D, TaxEye blue #2F4BE0, indigo #5B5BFF,
   sky #8FA2FF, notice amber #F5A524. No teal.
   ========================================================================== */
:root {
  --ai-void: #050A1F; --ai-navy: #0E1A3D; --ai-blue: #2F4BE0; --ai-indigo: #5B5BFF; --ai-sky: #8FA2FF; --ai-amber: #F5A524;
  --ai-text: #EEF1FF; --ai-soft: #C9D1F2; --ai-muted: #98A2C7; --ai-line: rgba(255,255,255,.12); --ai-line-2: rgba(143,162,255,.32);
  --ai-glass: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.03));
  --ai-grad: linear-gradient(135deg, #2F4BE0 0%, #5B5BFF 55%, #8F7BFF 100%);
  --ai-glow: 0 0 0 1px rgba(143,162,255,.35), 0 18px 50px -18px rgba(70,90,255,.75);
}
.glass { background: var(--ai-glass); border: 1px solid var(--ai-line); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 30px 80px -30px rgba(0,0,0,.6); }

/* ---------- The orb ---------- */
.orb { position: relative; display: inline-grid; place-items: center; flex: none; border-radius: 50%; }
.orb-core { position: relative; width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 32% 26%, #fff 0 5%, #C7D1FF 12%, #7C8CFF 30%, #4459F2 50%, #22339E 72%, #0B1438 100%);
  box-shadow: 0 0 28px rgba(91,107,255,.55), inset 0 -10px 22px rgba(8,14,40,.65), inset 0 6px 14px rgba(255,255,255,.35); animation: orbBreathe 5s ease-in-out infinite; }
.orb-core::after { content: ''; position: absolute; inset: -30%; background: conic-gradient(from 0deg, transparent 0 60%, rgba(245,165,36,.55) 70%, transparent 80%, rgba(143,162,255,.6) 92%, transparent); mix-blend-mode: screen; animation: orbSpin 7s linear infinite; }
.orb-core img { position: relative; z-index: 1; width: 42%; height: auto; filter: drop-shadow(0 4px 14px rgba(8,14,40,.6)); border-radius: 12px; }
.orb-lg { width: 128px; height: 128px; margin-bottom: 6px; }
.orb-sm { width: 34px; height: 34px; }
.orb-xs { width: 28px; height: 28px; margin-top: 2px; }
.orb-fab { width: 34px; height: 34px; }
.orb-ring { position: absolute; border-radius: 50%; pointer-events: none; }
.orb-ring.r1 { inset: -12px; border: 1.5px solid rgba(143,162,255,.14); border-top-color: rgba(143,162,255,.95); border-right-color: rgba(143,162,255,.4); animation: orbSpin 5s linear infinite; }
.orb-ring.r2 { inset: -26px; border: 1px dashed rgba(143,162,255,.28); border-bottom: 1.5px solid rgba(245,165,36,.85); animation: orbSpin 11s linear infinite reverse; }
.orb-ring.r3 { inset: -52px; background: radial-gradient(circle, rgba(91,91,255,.35), transparent 65%); filter: blur(6px); animation: orbBreathe 6s ease-in-out infinite; }
.is-busy .orb-core::after, .thinking .orb-core::after { animation-duration: 1.4s; }
.is-busy .orb-ring.r1 { animation-duration: 1.6s; }
@keyframes orbSpin { to { transform: rotate(360deg); } }
@keyframes orbBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }

/* ---------- Page shell ---------- */
body.ai-page { background: var(--ai-void); }
body.ai-page .header { position: sticky; top: 0; background: rgba(5,10,31,.72); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(255,255,255,.08); box-shadow: none; }
body.ai-page .header .mega-trigger, body.ai-page .header .header-cta .btn-ghost { color: var(--ai-text); }
body.ai-page .header .mega-trigger:hover, body.ai-page .header .mega-trigger[aria-expanded="true"] { background: rgba(255,255,255,.08); color: #fff; }
body.ai-page .header .palette-btn { background: rgba(255,255,255,.06); border-color: var(--ai-line); color: var(--ai-soft); }
body.ai-page .header .palette-btn kbd { background: rgba(255,255,255,.08); border-color: var(--ai-line); color: var(--ai-soft); }
body.ai-page .header .menu-btn { color: #fff; }
body.ai-page .logo img.on-light { display: none; }
body.ai-page .logo img.on-dark { display: block; }

.ai-app { position: relative; display: grid; grid-template-columns: 300px minmax(0, 1fr); height: calc(100dvh - 73px); overflow: hidden; color: var(--ai-text); isolation: isolate; }
.ai-aurora { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(120% 80% at 50% 0%, #101C4A 0%, var(--ai-void) 60%); }
.ai-aurora i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: auroraDrift 22s ease-in-out infinite alternate; }
.ai-aurora .b1 { width: 52vw; height: 52vw; left: 18%; top: -28vw; background: radial-gradient(circle, #2F4BE0, transparent 65%); }
.ai-aurora .b2 { width: 40vw; height: 40vw; right: -10vw; top: 8vh; background: radial-gradient(circle, #6B4BFF, transparent 65%); animation-delay: -7s; opacity: .45; }
.ai-aurora .b3 { width: 34vw; height: 34vw; left: -8vw; bottom: -14vw; background: radial-gradient(circle, rgba(245,165,36,.75), transparent 62%); animation-delay: -14s; opacity: .22; }
.ai-aurora .grid { inset: 0; width: auto; height: auto; border-radius: 0; filter: none; opacity: .5; animation: none;
  background-image: linear-gradient(rgba(143,162,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(143,162,255,.07) 1px, transparent 1px);
  background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 10%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 30%, #000 10%, transparent 70%); }
@keyframes auroraDrift { 0% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(4vw,3vh,0) scale(1.08); } 100% { transform: translate3d(-3vw,-2vh,0) scale(.96); } }

/* ---------- Sidebar ---------- */
.ai-side { margin: 14px 0 14px 14px; border-radius: 24px; padding: 16px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; z-index: 3; scrollbar-width: thin; scrollbar-color: rgba(143,162,255,.3) transparent; }
.ai-side-head { display: flex; align-items: center; gap: 10px; }
.ai-side-head div { flex: 1; min-width: 0; line-height: 1.25; }
.ai-side-head strong { display: block; font-size: 16px; color: #fff; }
.ai-side-head small { color: var(--ai-muted); font-size: 12px; }
.ai-icon-btn.ai-side-close, .ai-icon-btn.ai-side-open { display: none; }
.ai-new { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid transparent; color: #fff; font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer;
  background: linear-gradient(rgba(14,26,61,.9), rgba(14,26,61,.9)) padding-box, var(--ai-grad) border-box; transition: box-shadow .25s, transform .25s; }
.ai-new:hover { box-shadow: var(--ai-glow); transform: translateY(-1px); }
.ai-new kbd { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--ai-muted); border: 1px solid var(--ai-line); border-radius: 6px; padding: 2px 6px; font-weight: 500; }
.ai-group { display: grid; gap: 8px; }
.ai-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ai-muted); }
.ai-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ai-roles button { display: flex; align-items: center; gap: 7px; padding: 9px 10px; min-height: 40px; border-radius: 12px; border: 1px solid var(--ai-line); background: rgba(255,255,255,.04); color: var(--ai-soft); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: .2s; }
.ai-roles button:hover { border-color: var(--ai-line-2); color: #fff; }
.ai-roles button[aria-checked="true"] { background: var(--ai-grad); border-color: transparent; color: #fff; box-shadow: 0 10px 24px -12px rgba(91,91,255,.9); }
.ai-tools { display: grid; gap: 2px; }
.ai-tools button, .ai-tools a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; min-height: 40px; border-radius: 11px; border: 0; background: none; color: var(--ai-soft); font: inherit; font-size: 14px; text-align: left; cursor: pointer; transition: .18s; }
.ai-tools button:hover, .ai-tools a:hover { background: rgba(255,255,255,.07); color: #fff; }
.ai-tools svg, .ai-history svg { color: var(--ai-sky); flex: none; }
.ai-history-wrap { flex: 1; min-height: 80px; align-content: start; }
.ai-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ai-history li { position: relative; display: flex; }
.ai-history button[data-open] { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 8px 32px 8px 10px; min-height: 38px; border-radius: 10px; border: 0; background: none; color: var(--ai-soft); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.ai-history button[data-open] span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-history button[data-open]:hover, .ai-history button[aria-current="true"] { background: rgba(255,255,255,.08); color: #fff; }
.ai-del { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--ai-muted); cursor: pointer; opacity: 0; }
.ai-history li:hover .ai-del, .ai-del:focus-visible { opacity: 1; }
.ai-del:hover { color: #fff; background: rgba(255,255,255,.08); }
.ai-empty { color: var(--ai-muted); font-size: 13px; padding: 4px 10px; }
.ai-side-foot { display: grid; gap: 10px; padding-top: 4px; }
.ai-stat { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: linear-gradient(135deg, rgba(245,165,36,.16), rgba(245,165,36,.04)); border: 1px solid rgba(245,165,36,.35); color: #FFE2B0; font-size: 12.5px; line-height: 1.35; }
.ai-stat b { color: var(--ai-amber); font-size: 14px; }
.ai-side-foot p { font-size: 11.5px; color: var(--ai-muted); line-height: 1.5; }

/* ---------- Main column ---------- */
.ai-main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; min-width: 0; }
.ai-top { display: flex; align-items: center; gap: 12px; padding: 16px 24px 8px; }
.ai-title { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.ai-title span { font-weight: 700; font-size: 16px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-title small { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ai-muted); }
.ai-title small i { width: 7px; height: 7px; border-radius: 50%; background: #3DD68C; box-shadow: 0 0 0 0 rgba(61,214,140,.6); animation: livePulse 2.4s infinite; }
.is-busy .ai-title small i { background: var(--ai-amber); box-shadow: 0 0 0 0 rgba(245,165,36,.6); }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(61,214,140,.55); } 70% { box-shadow: 0 0 0 8px rgba(61,214,140,0); } 100% { box-shadow: 0 0 0 0 rgba(61,214,140,0); } }
.ai-top-actions { display: flex; align-items: center; gap: 8px; }
.ai-icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--ai-line); background: rgba(255,255,255,.05); color: var(--ai-soft); cursor: pointer; transition: .2s; }
.ai-icon-btn:hover { color: #fff; border-color: var(--ai-line-2); background: rgba(255,255,255,.1); }
.ai-trial { background: var(--ai-grad) !important; border: 0 !important; box-shadow: 0 12px 30px -14px rgba(91,91,255,1); }
.ai-scroll { overflow-y: auto; padding: 8px 24px 28px; scrollbar-width: thin; scrollbar-color: rgba(143,162,255,.3) transparent; }

/* Hero */
.ai-hero { max-width: 900px; margin: 0 auto; padding-top: 3vh; text-align: center; display: grid; justify-items: center; gap: 18px; animation: heroIn .7s cubic-bezier(.2,.8,.2,1) both; }
@keyframes heroIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.ai-hello { font-size: clamp(30px, 4.2vw, 52px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; color: #fff; margin-top: 12px; }
.ai-hello .grad { display: block; background: linear-gradient(92deg, #FFFFFF 0%, #B9C4FF 35%, #9C8BFF 65%, #F5A524 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ai-sub { max-width: 620px; color: var(--ai-soft); font-size: 16.5px; line-height: 1.6; }
.ai-caps { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ai-caps span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: var(--ai-soft); background: rgba(255,255,255,.05); border: 1px solid var(--ai-line); }
.ai-caps svg { color: var(--ai-sky); }
.ai-prompts { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; text-align: left; }
.ai-prompt { position: relative; display: grid; gap: 6px; align-content: start; padding: 16px; min-height: 132px; border-radius: 18px; border: 1px solid var(--ai-line); color: var(--ai-soft); font: inherit; font-size: 13.5px; line-height: 1.45; text-align: left; cursor: pointer; overflow: hidden;
  background: var(--ai-glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s; }
.ai-prompt::before { content: ''; position: absolute; inset: 0; background: radial-gradient(400px circle at 0% 0%, rgba(143,162,255,.18), transparent 45%); opacity: 0; transition: opacity .3s; }
.ai-prompt:hover { transform: translateY(-3px); border-color: var(--ai-line-2); box-shadow: var(--ai-glow); }
.ai-prompt:hover::before { opacity: 1; }
.ai-prompt b { color: #fff; font-size: 14.5px; }
.ai-prompt-ic { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--ai-grad); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 22px -10px rgba(91,91,255,.9); margin-bottom: 4px; }

/* Thread */
.ai-thread { max-width: 840px; margin: 0 auto; display: grid; gap: 26px; padding-top: 10px; }
.ai-msg { animation: msgIn .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ai-msg.user { justify-self: end; max-width: 80%; }
.ai-bubble { padding: 12px 16px; border-radius: 20px 20px 6px 20px; background: var(--ai-grad); color: #fff; font-size: 15px; line-height: 1.55; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 16px 36px -18px rgba(91,91,255,.9); overflow-wrap: anywhere; }
.ai-msg.bot { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; align-items: start; }
.ai-answer { min-width: 0; display: grid; gap: 12px; }
.ai-md { color: #E3E8FF; font-size: 15.5px; line-height: 1.72; overflow-wrap: anywhere; }
.ai-md p { margin: 0 0 10px; }
.ai-md p:last-child { margin-bottom: 0; }
.ai-md h4 { font-size: 15.5px; color: #fff; margin: 14px 0 6px; }
.ai-md ul, .ai-md ol { margin: 4px 0 10px; padding-left: 22px; }
.ai-md li { margin: 4px 0; }
.ai-md li::marker { color: var(--ai-sky); }
.ai-md strong { color: #fff; }
.ai-md em { color: var(--ai-soft); }
.ai-md code { font-family: var(--mono); font-size: .88em; padding: 1px 6px; border-radius: 6px; background: rgba(143,162,255,.14); color: #DCE2FF; }
.ai-md a { color: #B5C2FF; text-decoration: underline; text-decoration-color: rgba(181,194,255,.4); text-underline-offset: 3px; }
.ai-md a.cite { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; margin: 0 2px; border-radius: 6px; font-size: 11px; font-weight: 700; text-decoration: none; vertical-align: 2px; color: #fff; background: rgba(91,91,255,.35); border: 1px solid rgba(143,162,255,.55); }
.ai-md a.cite:hover { background: var(--ai-indigo); }
.ai-caret { display: inline-block; width: 8px; height: 1.05em; margin-left: 2px; vertical-align: -2px; border-radius: 2px; background: linear-gradient(var(--ai-sky), var(--ai-indigo)); animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.ai-think { display: flex; align-items: center; gap: 6px; min-height: 28px; }
.ai-think span { width: 7px; height: 7px; border-radius: 50%; background: var(--ai-sky); animation: think 1.2s ease-in-out infinite; }
.ai-think span:nth-child(2) { animation-delay: .15s; } .ai-think span:nth-child(3) { animation-delay: .3s; }
.ai-think em { margin-left: 8px; font-style: normal; font-size: 13.5px; color: var(--ai-muted); background: linear-gradient(90deg, var(--ai-muted) 0%, #fff 50%, var(--ai-muted) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.8s linear infinite; }
@keyframes think { 0%, 100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(-5px); opacity: 1; } }
@keyframes shimmer { to { background-position: -200% 0; } }
.ai-extra:empty { display: none; }
.ai-extra { display: grid; gap: 12px; }
.ai-sources { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ai-src-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ai-muted); margin-right: 2px; }
.ai-src { display: inline-flex; align-items: center; gap: 7px; max-width: 320px; padding: 6px 11px 6px 6px; border-radius: 12px; border: 1px solid var(--ai-line); background: rgba(255,255,255,.05); color: var(--ai-soft); font-size: 12.5px; transition: .2s; }
.ai-src:hover { border-color: var(--ai-line-2); color: #fff; background: rgba(255,255,255,.09); }
.ai-src i { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 7px; background: rgba(91,91,255,.35); color: #fff; font-style: normal; font-weight: 700; font-size: 11px; flex: none; }
.ai-src svg { color: var(--ai-sky); flex: none; }
.ai-src span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-src small { color: var(--ai-muted); font-size: 11px; white-space: nowrap; }
.ai-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-cta { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; min-height: 40px; border-radius: 12px; border: 1px solid var(--ai-line-2); background: rgba(255,255,255,.05); color: #fff; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: .2s; }
.ai-cta:hover { background: rgba(255,255,255,.1); color: #fff; }
.ai-cta.primary { background: var(--ai-grad); border-color: transparent; box-shadow: 0 12px 28px -14px rgba(91,91,255,1); }
.ai-cta.primary:hover { box-shadow: var(--ai-glow); }
.ai-cta:disabled { opacity: .6; cursor: progress; }
.ai-tools-row { display: flex; gap: 2px; }
.ai-tool { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 9px; background: none; color: var(--ai-muted); cursor: pointer; transition: .18s; }
.ai-tool:hover { color: #fff; background: rgba(255,255,255,.08); }
.ai-tool[aria-pressed="true"] { color: var(--ai-sky); background: rgba(91,91,255,.2); }
.ai-tool.ok { color: #3DD68C; }
.ai-follow { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-follow button { padding: 8px 13px; min-height: 38px; border-radius: 99px; border: 1px dashed rgba(143,162,255,.45); background: rgba(91,91,255,.08); color: #DCE2FF; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: .2s; text-align: left; }
.ai-follow button:hover { border-style: solid; background: rgba(91,91,255,.22); color: #fff; }

/* Lead card inside the chat */
.glass-card { background: var(--ai-glass); border: 1px solid var(--ai-line-2); border-radius: 18px; -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 24px 60px -30px rgba(70,90,255,.8); }
.ai-lead { padding: 18px; display: grid; gap: 12px; min-width: 0; }
.ai-lead b { font-size: 16px; color: #fff; }
.ai-lead > p { color: var(--ai-soft); font-size: 13.5px; }
.ai-lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ai-lead label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ai-muted); }
.ai-lead input, .ai-lead select { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--ai-line); background: rgba(5,10,31,.55); color: #fff; font: inherit; font-size: 14.5px; }
.ai-lead input:focus, .ai-lead select:focus { outline: none; border-color: var(--ai-sky); box-shadow: 0 0 0 3px rgba(143,162,255,.25); }
.ai-lead select option { color: #0E1A3D; }
.ai-lead .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ai-lead-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ai-lead-row a { color: var(--ai-sky); font-size: 13px; }
.ai-lead-err { color: #FFB4A8; font-size: 13px; }

/* Composer */
.ai-composer { padding: 6px 24px 14px; }
.ai-composer-box { position: relative; max-width: 840px; margin: 0 auto; padding: 14px 12px 10px 18px; border-radius: 24px; background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.04)); border: 1px solid var(--ai-line); -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 30px 70px -30px rgba(0,0,0,.8); transition: border-color .25s, box-shadow .25s; }
.ai-composer-box::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: conic-gradient(from var(--ai-angle, 0deg), transparent 0 55%, rgba(143,162,255,.9) 70%, rgba(245,165,36,.8) 80%, transparent 92%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .3s; pointer-events: none; }
.ai-composer-box:focus-within { border-color: rgba(143,162,255,.4); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 0 0 4px rgba(91,91,255,.14), 0 30px 70px -30px rgba(0,0,0,.8); }
.ai-composer-box:focus-within::before, .is-busy .ai-composer-box::before { opacity: 1; animation: borderSpin 4s linear infinite; }
@property --ai-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes borderSpin { to { --ai-angle: 360deg; } }
.ai-composer textarea { width: 100%; min-height: 28px; max-height: 220px; resize: none; border: 0; outline: none; background: transparent; color: #fff; font: inherit; font-size: 16px; line-height: 1.55; padding: 2px 0; }
.ai-composer textarea::placeholder { color: var(--ai-muted); }
.ai-composer-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.ai-role-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: rgba(91,91,255,.18); border: 1px solid rgba(143,162,255,.3); color: #DCE2FF; font-size: 12px; font-weight: 700; }
.ai-hint { flex: 1; font-size: 12px; color: var(--ai-muted); }
.ai-hint kbd, .cp-note kbd { font-family: var(--mono); font-size: 10.5px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--ai-line); color: var(--ai-soft); }
.ai-count { font-size: 11.5px; color: var(--ai-muted); font-variant-numeric: tabular-nums; }
.ai-send { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 14px; border: 0; background: var(--ai-grad); color: #fff; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 12px 26px -12px rgba(91,91,255,1); transition: transform .2s, box-shadow .2s; }
.ai-send:hover { transform: translateY(-1px) scale(1.04); box-shadow: var(--ai-glow); }
.ai-stop { background: rgba(255,255,255,.12); box-shadow: none; }
.ai-disclaimer { max-width: 840px; margin: 8px auto 0; text-align: center; font-size: 11.5px; color: var(--ai-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .ai-prompts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .ai-app { grid-template-columns: minmax(0, 1fr); }
  .ai-side { position: fixed; top: 10px; bottom: 10px; left: 10px; width: min(320px, calc(100vw - 40px)); margin: 0; z-index: 80; transform: translateX(-115%); transition: transform .35s cubic-bezier(.2,.8,.2,1); background: rgba(10,16,42,.92); }
  .ai-side.open { transform: none; }
  .ai-icon-btn.ai-side-close, .ai-icon-btn.ai-side-open { display: grid; }
  .ai-scrim { position: fixed; inset: 0; z-index: 79; background: rgba(2,5,16,.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
  .ai-top { padding: 12px 14px 6px; }
  .ai-scroll { padding: 6px 14px 20px; }
  .ai-composer { padding: 6px 10px 10px; }
  .ai-hint { display: none; }
  .ai-count { margin-left: auto; }
}
@media (max-width: 640px) {
  .ai-prompts { grid-template-columns: minmax(0, 1fr); }
  .ai-prompt { min-height: 0; grid-template-columns: 38px minmax(0, 1fr); column-gap: 12px; }
  .ai-prompt .ai-prompt-ic { grid-row: span 2; margin: 0; }
  .ai-orb-lg, .orb-lg { width: 96px; height: 96px; }
  .ai-hero { padding-top: 3vh; gap: 14px; }
  .ai-sub { font-size: 15px; }
  .ai-caps span:nth-child(n+5) { display: none; }
  .ai-trial, [data-ai-download] { display: none !important; }
  .ai-msg.user { max-width: 92%; }
  .ai-msg.bot { grid-template-columns: 24px minmax(0, 1fr); gap: 10px; }
  .orb-xs { width: 24px; height: 24px; }
  .ai-lead-grid { grid-template-columns: minmax(0, 1fr); }
  .ai-src { max-width: 100%; }
}

/* ---------- Floating co-pilot (all other pages) ---------- */
.cp-fab { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 8px; min-height: 52px; border-radius: 99px; color: #fff; font: inherit; font-weight: 700; cursor: pointer;
  background: linear-gradient(135deg, rgba(14,26,61,.92), rgba(30,40,110,.92)); border: 1px solid rgba(143,162,255,.4); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 18px 40px -12px rgba(14,26,61,.6), 0 0 0 5px rgba(91,91,255,.12); transition: transform .25s, box-shadow .25s; }
.cp-fab:hover { transform: translateY(-2px); box-shadow: 0 22px 50px -12px rgba(47,75,224,.7), 0 0 0 6px rgba(91,91,255,.18); }
.cp-panel { position: fixed; right: 20px; bottom: 84px; z-index: 50; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 110px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 26px; color: var(--ai-text); isolation: isolate;
  background: rgba(7,12,34,.88); border: 1px solid rgba(143,162,255,.28); -webkit-backdrop-filter: blur(26px) saturate(160%); backdrop-filter: blur(26px) saturate(160%); box-shadow: 0 40px 100px -30px rgba(5,10,31,.85), inset 0 1px 0 rgba(255,255,255,.1); animation: panelIn .3s cubic-bezier(.2,.8,.2,1) both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.cp-aurora { position: absolute; inset: 0 0 auto 0; height: 220px; z-index: -1; overflow: hidden; pointer-events: none; }
.cp-aurora i { position: absolute; width: 260px; height: 260px; border-radius: 50%; filter: blur(60px); opacity: .55; }
.cp-aurora i:first-child { left: -60px; top: -140px; background: #2F4BE0; }
.cp-aurora i:last-child { right: -80px; top: -120px; background: #6B4BFF; opacity: .4; }
.cp-head { display: flex; align-items: center; gap: 10px; padding: 14px 12px 12px 16px; background: none; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.cp-head-t { flex: 1; min-width: 0; line-height: 1.25; }
.cp-head-t strong { font-size: 15.5px; }
.cp-head-t p { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ai-muted); }
.cp-head-t p i { width: 6px; height: 6px; border-radius: 50%; background: #3DD68C; animation: livePulse 2.4s infinite; }
.cp-hbtn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.05); color: var(--ai-soft); cursor: pointer; }
.cp-hbtn:hover { color: #fff; background: rgba(255,255,255,.1); }
.cp-body { flex: 1; overflow-y: auto; padding: 16px; display: block; background: none; scrollbar-width: thin; scrollbar-color: rgba(143,162,255,.3) transparent; }
.cp-intro { display: grid; gap: 12px; margin-bottom: 14px; }
.cp-hello { color: var(--ai-soft); font-size: 14.5px; line-height: 1.55; }
.cp-roles, .cp-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-roles button { padding: 7px 11px; min-height: 36px; border-radius: 99px; border: 1px solid var(--ai-line); background: rgba(255,255,255,.04); color: var(--ai-soft); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.cp-roles button[aria-pressed="true"] { background: var(--ai-grad); border-color: transparent; color: #fff; }
.cp-suggest button { padding: 9px 12px; min-height: 38px; border-radius: 12px; border: 1px solid var(--ai-line); background: rgba(255,255,255,.05); color: #E3E8FF; font: inherit; font-size: 13px; text-align: left; cursor: pointer; transition: .2s; }
.cp-suggest button:hover { border-color: var(--ai-line-2); background: rgba(91,91,255,.16); }
.ai-thread.compact { gap: 18px; padding: 0; max-width: none; }
.ai-thread.compact .ai-msg.bot { grid-template-columns: 24px minmax(0, 1fr); gap: 10px; }
.ai-thread.compact .orb-xs { width: 24px; height: 24px; }
.ai-thread.compact .ai-md { font-size: 14.5px; line-height: 1.62; }
.ai-thread.compact .ai-bubble { font-size: 14.5px; }
.ai-thread.compact .ai-msg.user { max-width: 88%; }
.ai-thread.compact .ai-lead-grid { grid-template-columns: minmax(0, 1fr); }
.cp-foot { display: flex; gap: 8px; align-items: center; margin: 0 12px; padding: 6px 6px 6px 14px; border-radius: 18px; background: rgba(255,255,255,.07); border: 1px solid var(--ai-line); }
.cp-foot:focus-within { border-color: rgba(143,162,255,.5); box-shadow: 0 0 0 3px rgba(91,91,255,.18); }
.cp-foot input { flex: 1; min-width: 0; min-height: 40px; border: 0; outline: none; background: none; color: #fff; font: inherit; font-size: 15px; }
.cp-foot input::placeholder { color: var(--ai-muted); }
.cp-foot .ai-send { width: 40px; height: 40px; border-radius: 12px; }
.cp-note { font-size: 11px; color: var(--ai-muted); padding: 8px 16px 12px; text-align: center; background: none; }
@media (max-width: 640px) {
  .cp-fab { right: 16px; bottom: 16px; width: 58px; height: 58px; min-height: 58px; padding: 0; justify-content: center; }
  .cp-fab .orb-fab { width: 40px; height: 40px; }
  .cp-fab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cp-panel { right: 8px; left: 8px; width: auto; bottom: 84px; height: min(600px, calc(100dvh - 100px)); }
}

@media (prefers-reduced-motion: reduce) {
  .orb-core, .orb-core::after, .orb-ring, .ai-aurora i, .ai-hero, .ai-msg, .ai-caret, .ai-think span, .ai-think em, .ai-title small i, .cp-panel, .cp-head-t p i, .ai-composer-box::before { animation: none !important; }
  .ai-prompt, .ai-new, .ai-send, .cp-fab, .ai-side { transition: none !important; }
}
.ai-group, .ai-history, .ai-history li { min-width: 0; }
.ai-history { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .ai-side { top: 82px; bottom: 10px; } }
/* Long-form guide inside the chat hero (dark glass) */
.ai-guide { width: 100%; margin-top: 40px; text-align: left; }
.ai-guide .guide-section { background: none; border-top: 1px solid var(--ai-line); padding: 40px 0 10px; }
.ai-guide .wrap { padding: 0; max-width: none; }
.ai-guide .guide-wrap { grid-template-columns: 220px minmax(0, 1fr); gap: 36px; }
.ai-guide .guide-toc { top: 16px; background: var(--ai-glass); border-color: var(--ai-line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.ai-guide .guide-toc-h, .ai-guide .guide-note { color: var(--ai-muted) !important; border-color: var(--ai-line) !important; }
.ai-guide .guide-toc a { color: var(--ai-soft); }
.ai-guide .guide-toc a:hover, .ai-guide .guide-ask { color: var(--ai-sky); }
.ai-guide .guide-toc .btn-primary { background: var(--ai-grad); border: 0; color: #fff; }
.ai-guide .eyebrow { color: var(--ai-sky); }
.ai-guide .guide h2, .ai-guide .guide h3, .ai-guide .guide strong { color: #fff; }
.ai-guide .guide p, .ai-guide .guide li, .ai-guide .lead { color: var(--ai-soft); font-size: 16px; }
.ai-guide .guide li::marker { color: var(--ai-sky); }
@media (max-width: 900px) { .ai-guide .guide-wrap { grid-template-columns: minmax(0, 1fr); } .ai-guide .guide-toc { position: static; } }
