/* ════════════════════════════════════════════════════════════════════════════
   59-ai-agent.css  THE AI'S PAGE OVERLAY (.aia-), static/js/ai-agent.js.
   ----------------------------------------------------------------------------
   One fixed layer on <body> (pointer-events none) holding the highlight
   rings and the show mode cursors. Everything moves with transform only, so
   a frame never lays the page out. The ring is an inset box shadow plus a
   soft outer glow over the control (never an accent line or a stripe, never
   a style on the control itself). Cursor colours are the chat brass and the
   research categorical tokens (both themes come from tokens.css). Appended
   at the end of the cascade with its own namespace: nothing before it
   claims .aia-.
   ════════════════════════════════════════════════════════════════════════════ */
/* z-index 10060 (2026-10-08, was 9500): above the app's popups (search
   dropdowns, the alert dialog, the palette at 10000 to 10050), so a guided
   cursor working inside one is never drawn under it. Pointer-events none,
   so it can never take a click. */
.aia-layer{position:fixed;inset:0;z-index:10060;pointer-events:none;overflow:hidden;contain:layout style size;}

.aia-ring{position:absolute;left:0;top:0;border-radius:var(--radius-md, 6px);
  background:color-mix(in srgb, var(--rch-accent) 9%, transparent);
  box-shadow:inset 0 0 0 2px var(--rch-accent), 0 0 0 4px var(--rch-accent-glow);
  animation:aia-in 160ms var(--ease-out, ease-out) both;}
.aia-ring-l{position:absolute;left:0;top:calc(100% + 6px);padding:3px 8px;border-radius:4px;
  background:var(--rch-accent);color:var(--rch-on-accent);font-family:var(--font-sans);
  font-size:max(0.75rem, var(--fs-floor, 12px));font-weight:600;line-height:1.3;white-space:nowrap;
  box-shadow:var(--shadow-pop);}
.aia-ring-l[hidden]{display:none;}
.aia-ring-up .aia-ring-l{top:auto;bottom:calc(100% + 6px);}
.aia-ring-end .aia-ring-l{left:auto;right:0;}

.aia-cur{position:absolute;left:0;top:0;width:18px;height:18px;will-change:transform;transition:opacity 220ms linear;
  animation:aia-in 140ms var(--ease-out, ease-out) backwards;}
.aia-cur-svg{position:relative;display:block;width:18px;height:18px;transform-origin:2px 1.5px;
  filter:drop-shadow(0 1px 2px color-mix(in srgb, var(--shadow-ink) 35%, transparent));}
.aia-cur-svg path{fill:var(--aia-c);stroke:var(--bg-primary);stroke-width:1.5;stroke-linejoin:round;}
/* The press: a soft ring that spreads from the tip (ai-agent.js animates
   its transform and opacity; at rest it is invisible). */
.aia-cur-p{position:absolute;left:-9px;top:-9.5px;width:22px;height:22px;border-radius:50%;opacity:0;
  background:color-mix(in srgb, var(--aia-c) 22%, transparent);
  box-shadow:inset 0 0 0 1.5px color-mix(in srgb, var(--aia-c) 80%, transparent);}
.aia-cur-l{position:absolute;left:14px;top:16px;max-width:220px;padding:3px 8px;border-radius:4px;
  background:var(--aia-c);color:var(--rch-on-accent);font-family:var(--font-sans);
  font-size:max(0.75rem, var(--fs-floor, 12px));font-weight:600;line-height:1.3;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:var(--shadow-pop);}
.aia-cur-l:empty,.aia-cur-l[hidden]{display:none;}
.aia-cur-flip .aia-cur-l{left:auto;right:18px;}
.aia-cur-up .aia-cur-l{top:auto;bottom:4px;}
.aia-cur-out{opacity:0;}
/* Motion v3: the launch out of the pointer (the arrow grows in), the
   merge back into it, the drawn typing and the dragged divider. All
   transform and opacity only. */
.aia-cur-born .aia-cur-svg{animation:aia-born 200ms cubic-bezier(.2,.8,.3,1) both;}
.aia-cur-merge{transition:none;animation:aia-merge 160ms ease-in forwards;}
.aia-cur-merge .aia-cur-svg{animation:aia-shrink 160ms ease-in forwards;}
.aia-cur-merge .aia-cur-l{display:none;}
.aia-type{position:absolute;left:0;top:0;display:flex;align-items:center;gap:1px;overflow:hidden;
  border-radius:var(--radius-sm, 4px);background:var(--bg-elevated);color:var(--text-primary);
  box-shadow:inset 0 0 0 1.5px var(--aia-c);white-space:pre;font-variant-numeric:tabular-nums;
  animation:aia-in 90ms linear both;}
.aia-type-t{overflow:hidden;}
.aia-type-c{flex:none;width:1.5px;height:1.1em;background:var(--aia-c);animation:aia-caret 700ms steps(1) infinite;}
.aia-type-out{opacity:0;transition:opacity 160ms linear;}
.aia-gut{position:absolute;left:0;top:0;width:2px;height:2px;border-radius:1px;background:var(--aia-c);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--aia-c) 22%, transparent);will-change:transform;}
.aia-gut-out{opacity:0;transition:opacity 160ms linear;}
.aia-type-1,.aia-type-2,.aia-type-3,.aia-type-4{--aia-c:var(--rch-accent);}
.aia-type-2{--aia-c:var(--rsx-cat-4);}
.aia-type-3{--aia-c:var(--rsx-cat-6);}
.aia-type-4{--aia-c:var(--rsx-cat-1);}
.aia-cur-1{--aia-c:var(--rch-accent);}
.aia-cur-2{--aia-c:var(--rsx-cat-4);}
.aia-cur-3{--aia-c:var(--rsx-cat-6);}
.aia-cur-4{--aia-c:var(--rsx-cat-1);}

@keyframes aia-in{from{opacity:0;}to{opacity:1;}}
@keyframes aia-born{from{opacity:0;transform:scale(.45);}to{opacity:1;transform:scale(1);}}
@keyframes aia-merge{from{opacity:1;}to{opacity:0;}}
@keyframes aia-shrink{to{transform:scale(.35);}}
@keyframes aia-caret{50%{opacity:0;}}
/* Guided mode (2026-10-08, ai-agent.js Guided section): ONE calm cursor
   that walks each step when the user asked to be shown how. A touch larger
   than the quick v3 clones, a soft fade in at the pointer, and a readable
   label beside the tip saying what it does next. Transform and opacity
   only; the motion itself is ai-agent.js (smootherstep legs, a hover
   before every press). */
.aia-cur-calm{animation:aia-in 260ms var(--ease-out, ease-out) backwards;}
.aia-cur-calm .aia-cur-svg{width:22px;height:22px;transform-origin:2.4px 1.8px;
  filter:drop-shadow(0 1px 3px color-mix(in srgb, var(--shadow-ink) 40%, transparent));}
.aia-cur-calm .aia-cur-p{left:-8px;top:-8.5px;width:24px;height:24px;}
.aia-cur-calm .aia-cur-l{left:18px;top:21px;max-width:240px;padding:4px 10px;border-radius:6px;
  font-size:max(0.8125rem, var(--fs-floor, 12px));font-weight:600;letter-spacing:0;}
.aia-cur-calm.aia-cur-flip .aia-cur-l{left:auto;right:20px;}
.aia-cur-calm.aia-cur-up .aia-cur-l{top:auto;bottom:6px;}
@media (prefers-reduced-motion: reduce){
  .aia-cur,.aia-type,.aia-gut{display:none;}
  .aia-ring{animation:none;}
}
