/* Cognitive V8 — Home: live agent stage, agent picker, and the team of plush pets (see v8/home.js). */
.home.hp { --hp-c: #7c3aed; overflow: hidden; isolation: isolate; }
.home.hp::before { display: none; }

/* A slow aurora in the chosen agent's colour, with a faint grid of light behind it. */
.hp-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hp-sky i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .16; background: var(--hp-c); transition: background 1.2s ease; }
.hp-sky i:nth-child(1) { width: 560px; height: 420px; left: calc(50% - 460px); top: 4%; }
.hp-sky i:nth-child(2) { width: 460px; height: 380px; left: calc(50% + 40px); top: 18%; background: color-mix(in srgb, var(--hp-c) 55%, #22d3ee); opacity: .11; }
.hp-sky i:nth-child(3) { width: 520px; height: 360px; left: calc(50% - 200px); bottom: -180px; background: color-mix(in srgb, var(--hp-c) 50%, #f472b6); opacity: .09; }
.hp-sky::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(color-mix(in srgb, var(--text) 55%, transparent) 1px, transparent 1.3px); background-size: 34px 34px; opacity: .07;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 38%, #000 0%, transparent 72%); -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 38%, #000 0%, transparent 72%); }
:root[data-theme="dark"] .hp-sky i { opacity: .22; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hp-sky i { opacity: .22; } }

/* Hero: the agent on a small live stage next to the greeting. */
.hp-hero { display: flex; align-items: center; gap: 18px; margin: 0 0 18px; }
.hp-stage { flex: 0 0 auto; width: 132px; height: 132px; margin: -10px -6px -14px -14px; }
.hp-stage .ags-stage.sm { width: 132px; cursor: default; }
.hp-stage .ags-status { display: none; }
.hp-stage .ags-ring i { width: 5px; height: 5px; margin: -2.5px; }
.hp-stage .ags-aura { inset: 6%; }
.hp-copy { min-width: 0; }
.hp-kick { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .01em; color: var(--text2); margin: 0 0 6px; }
.hp-live { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.5); animation: hpPulse 2.6s ease-out infinite; flex-shrink: 0; }
@keyframes hpPulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.45); } 70%, 100% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } }
.home.hp .hp-ask { display: block; font-family: var(--cg-display, var(--font)); font-size: clamp(26px, 3vw, 36px); font-weight: 700; letter-spacing: -.035em; line-height: 1.08; margin: 0; color: var(--text); text-wrap: balance; }
.hp-sub { margin: 8px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--text2); max-width: 46ch; text-wrap: pretty; }

/* Composer: a quiet glow in the agent's colour while you write. */
.home.hp .composer#home { position: relative; border-color: color-mix(in srgb, var(--hp-c) 16%, var(--border)); box-shadow: var(--shadow-lg), 0 18px 60px -28px color-mix(in srgb, var(--hp-c) 55%, transparent); }
.home.hp .composer#home:focus-within { border-color: color-mix(in srgb, var(--hp-c) 45%, var(--border)); box-shadow: var(--shadow-lg), 0 0 0 4px color-mix(in srgb, var(--hp-c) 13%, transparent), 0 22px 70px -26px color-mix(in srgb, var(--hp-c) 70%, transparent); }

/* The agent picker chip. */
.chip.hp-pick { --hp-c: #7c3aed; height: 30px; padding: 0 9px 0 3px; gap: 6px; border-radius: 999px; font-weight: 600; color: var(--text); max-width: 200px;
  background: color-mix(in srgb, var(--hp-c) 8%, var(--panel)); border-color: color-mix(in srgb, var(--hp-c) 30%, var(--border)); transition: background .2s, border-color .2s, transform .2s var(--cg-ease, ease); }
.chip.hp-pick:hover { background: color-mix(in srgb, var(--hp-c) 14%, var(--panel)); border-color: color-mix(in srgb, var(--hp-c) 50%, var(--border)); color: var(--text); }
.chip.hp-pick:active { transform: scale(.97); }
.hp-pick-face { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; overflow: visible; background: color-mix(in srgb, var(--hp-c) 16%, transparent); }
.chip .hp-pick-face svg.af, .hp-pick-face svg.af { width: 24px !important; height: 24px !important; }
.chip.hp-pick > svg { width: 12px; height: 12px; opacity: .6; }

/* The picker. */
.hp-menu { position: fixed; z-index: 1000; display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4); border: 1px solid var(--border); box-shadow: 0 24px 70px -12px rgba(15,10,40,.28), 0 2px 8px rgba(0,0,0,.06);
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top left; transition: opacity .18s ease, transform .28s var(--cg-ease, ease); }
.hp-menu.up { transform-origin: bottom left; transform: translateY(6px) scale(.98); }
.hp-menu.in { opacity: 1; transform: none; }
.hp-menu-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text3); }
.hp-menu-q { flex: 1; border: 0; outline: 0; background: transparent; font-size: 14px; color: var(--text); }
.hp-menu-l { overflow-y: auto; padding: 6px 6px 10px; overscroll-behavior: contain; }
.hp-grp-h { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); padding: 10px 10px 4px; }
.hp-grp-b.grid { display: grid; grid-template-columns: 1fr 1fr; }
.hp-opt { --hp-c: #7c3aed; display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 12px; text-align: left; transition: background .15s; }
.hp-opt:hover, .hp-opt:focus-visible { background: color-mix(in srgb, var(--hp-c) 9%, var(--hover)); outline: none; }
.hp-opt.on { background: color-mix(in srgb, var(--hp-c) 11%, transparent); }
.hp-opt-face { width: 36px; height: 36px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--hp-c) 12%, transparent); }
.hp-opt-face svg.af { width: 36px; height: 36px; }
.hp-opt-t { min-width: 0; display: flex; flex-direction: column; flex: 1; }
.hp-opt-t b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.hp-opt-t small { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-opt-ck { color: var(--hp-c); display: grid; }
/* The search hides rows with [hidden]; the display rules above must not bring them back. */
.hp-opt[hidden], .hp-grp[hidden], .hp-none[hidden] { display: none; }
.hp-none { padding: 18px; text-align: center; color: var(--text2); font-size: 13px; }

/* Status line under the composer. */
.home.hp .hp-status { align-items: center; gap: 8px; margin: 12px 4px 0; font-size: 12.5px; color: var(--text2); }
.hp-status b { color: var(--text); font-weight: 600; }
.hp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hp-c); box-shadow: 0 0 10px var(--hp-c); animation: hpBreathe 3.2s ease-in-out infinite; }
@keyframes hpBreathe { 50% { opacity: .45; transform: scale(.8); } }
.hp-need { color: var(--warn); font-weight: 600; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; }
.hp-tip { color: var(--text3); }
.hp-tip::before { content: '·'; margin-right: 8px; }

/* Starters. */
.home.hp .suggest { margin-top: 16px; }
.home.hp .sug { background: color-mix(in srgb, var(--panel) 80%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.home.hp .sug:hover { border-color: color-mix(in srgb, var(--hp-c) 45%, var(--border)); background: color-mix(in srgb, var(--hp-c) 7%, var(--panel)); }

/* The team. */
.hp-team { margin-top: 34px; padding-top: 18px; border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.hp-team-h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text2); margin: 0 4px 10px; }
.hp-team-r { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-end; }
.hp-mate, .hp-more { --hp-c: #7c3aed; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 76px; padding: 6px 2px 8px; border-radius: 16px; transition: background .25s, transform .35s var(--cg-ease, ease); }
.hp-mate:hover { background: color-mix(in srgb, var(--hp-c) 8%, transparent); }
.hp-mate-f { width: 56px; height: 56px; display: grid; place-items: center; position: relative; }
.hp-mate-f::before { content: ''; position: absolute; inset: 8px 6px 2px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--hp-c) 30%, transparent), transparent 70%); opacity: 0; transition: opacity .3s; }
.hp-mate:hover .hp-mate-f::before, .hp-mate.on .hp-mate-f::before { opacity: 1; }
.hp-mate-f svg.af { width: 54px; height: 54px; position: relative; }
.hp-mate-n { font-size: 12px; font-weight: 500; color: var(--text2); }
.hp-mate.on .hp-mate-n { color: var(--text); font-weight: 600; }
.hp-mate.on::after { content: ''; position: absolute; bottom: 1px; left: 50%; width: 16px; height: 3px; margin-left: -8px; border-radius: 3px; background: var(--hp-c); }
.hp-more { justify-content: center; height: 86px; color: var(--text2); }
.hp-more b { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; border-radius: 14px; font-size: 13px; color: var(--text); background: var(--hover); border: 1px dashed var(--border2); transition: background .2s, border-color .2s; }
.hp-more span { font-size: 12px; }
.hp-more:hover b { background: var(--active); border-color: var(--text3); }

/* First arrival: the page settles in once per visit, the team says hi one by one. */
.home.hp-enter .hp-hero, .home.hp-enter .composer#home, .home.hp-enter .hp-status, .home.hp-enter .suggest { animation: hpRise .7s var(--cg-ease, ease) both; }
.home.hp-enter .composer#home { animation-delay: .08s; }
.home.hp-enter .hp-status, .home.hp-enter .suggest { animation-delay: .16s; }
.home.hp-enter .hp-team-h { animation: hpRise .7s var(--cg-ease, ease) .3s both; }
.home.hp-enter .hp-mate, .home.hp-enter .hp-more { animation: hpPop .6s var(--cg-ease, ease) both; animation-delay: calc(.38s + var(--d, 7) * 60ms); }
@keyframes hpRise { from { opacity: 0; transform: translateY(10px); } }
@keyframes hpPop { from { opacity: 0; transform: translateY(12px) scale(.9); } }

.home.hp .wm-actions { justify-content: flex-start; margin: 14px 0 0; }

@media (max-width: 640px) {
  .hp-hero { gap: 8px; align-items: flex-start; }
  .hp-stage, .hp-stage .ags-stage.sm { width: 88px; height: 88px; }
  .hp-stage { margin: -6px -2px -6px -4px; }
  .home.hp .hp-ask { font-size: 24px; }
  .hp-sub { font-size: 13.5px; }
  .chip.hp-pick { max-width: 140px; flex-shrink: 0; }
  .hp-team-r { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .hp-team-r::-webkit-scrollbar { display: none; }
  .hp-mate, .hp-more { flex: 0 0 auto; width: 68px; }
  .hp-grp-b.grid { grid-template-columns: 1fr; }
  .hp-tip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hp-sky i, .hp-live, .hp-dot { animation: none; }
  .home.hp-enter * { animation: none !important; }
  .hp-menu { transition: none; }
}
/* Home stays still: no spinning ring, no pet walking out of its stage. */
.hp-stage .ags-ring > div { animation: none; }
