/* NOMOI mascot widget — Ari living v12 canary (TwoThumbs prm_2699e7b4, 2026-08-14).
   Feature design: Dulshi. Name + personality: K3 (Moonshot).
   Loads on every NOMOI web tool except Packrip. Vanilla CSS, reads the
   theme rail's --brand-* vars with safe coral-v1 fallbacks so it still looks
   right if the page has no theme link at all. */

:root {
  --ari-primary: var(--brand-primary, #e8734a);
  --ari-primary-hi: var(--brand-primary-hi, #ff8f63);
  --ari-surface: var(--brand-surface, #17130f);
  --ari-surface-hi: var(--brand-surface-hi, #1f1912);
  --ari-text: var(--brand-text, #f4f1ea);
  --ari-text-muted: var(--brand-text-muted, #a09888);
  --ari-line: rgba(244, 241, 234, 0.16);
}

.ari-root {
  position: fixed;
  z-index: 2147483000;
  right: clamp(12px, 3vw, 28px);
  bottom: clamp(12px, 3vw, 28px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-family: var(--brand-font-body, "IBM Plex Sans", Arial, sans-serif);
  pointer-events: none;
  max-width: calc(100vw - 16px);
  transform: translate3d(var(--ari-drag-x, 0px), var(--ari-drag-y, 0px), 0);
  transition:
    left var(--ari-travel-ms, 0ms) cubic-bezier(.22,.74,.26,1),
    top var(--ari-travel-ms, 0ms) cubic-bezier(.22,.74,.26,1);
}
.ari-root.ari-is-dragging { transition: none !important; will-change: transform; }
.ari-root * { box-sizing: border-box; }
.ari-root [data-ari-interactive] { pointer-events: auto; }

/* Character button (the corner-docked figure). Always dismiss-visible. */
.ari-figure-wrap {
  position: relative;
  width: 76px;
  height: 76px;
  pointer-events: auto;
  transform: translate(
    calc(var(--ari-drift-x, 0px) + var(--ari-look-x, 0px)),
    calc(var(--ari-drift-y, 0px) + var(--ari-look-y, 0px))
  ) rotate(calc(var(--ari-drift-r, 0deg) + var(--ari-look-r, 0deg)));
  transition: transform 220ms cubic-bezier(.18,.82,.22,1), filter 300ms ease;
  will-change: transform;
}
.ari-root[data-ari-motion="off"] .ari-figure-wrap,
.ari-root.ari-is-dragging .ari-figure-wrap { transform: none; transition: none; }
.ari-root[data-ari-motion-state="walk"] .ari-figure-btn,
.ari-root[data-ari-motion-state="click-walk"] .ari-figure-btn,
.ari-root[data-ari-motion-state="scroll-follow"] .ari-figure-btn,
.ari-root[data-ari-motion-state="scroll-settle"] .ari-figure-btn {
  animation: ari-grounded-run .34s cubic-bezier(.35,0,.65,1) infinite;
}
.ari-root[data-ari-motion-state="walk"],
.ari-root[data-ari-motion-state="click-walk"],
.ari-root[data-ari-motion-state="scroll-follow"],
.ari-root[data-ari-motion-state="scroll-settle"] { will-change: left, top; }
.ari-root[data-ari-motion-state="walk"] .ari-figure-wrap,
.ari-root[data-ari-motion-state="click-walk"] .ari-figure-wrap,
.ari-root[data-ari-motion-state="scroll-follow"] .ari-figure-wrap,
.ari-root[data-ari-motion-state="scroll-settle"] .ari-figure-wrap { pointer-events: auto; }
.ari-figure-btn {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: grab;
  display: block;
  position: relative;
}
.ari-root.ari-is-dragging .ari-figure-btn { cursor: grabbing; }
.ari-root[data-ari-motion-state="scroll-follow"] .ari-figure-btn::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 2px;
  left: 28px;
  bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--ari-primary-hi), transparent);
  opacity: .6;
  animation: ari-scroll-thread .72s ease-in-out infinite;
}
@keyframes ari-scroll-thread {
  0%, 100% { transform: translateX(-9px) scaleX(.6); opacity: .2; }
  50% { transform: translateX(9px) scaleX(1.15); opacity: .78; }
}
.ari-root[data-ari-scroll-peek="true"] .ari-figure-wrap { opacity: .76; filter: saturate(1.15); }
.ari-figure-btn::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 18%;
  right: 18%;
  bottom: 3px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0,0,0,.42), rgba(0,0,0,0) 72%);
  filter: blur(2px);
  transform: scaleX(.86);
  transition: transform 160ms ease, opacity 160ms ease;
}
.ari-root[data-ari-motion-state="walk"] .ari-figure-btn::before,
.ari-root[data-ari-motion-state="click-walk"] .ari-figure-btn::before { transform: scaleX(1.08); opacity: .72; }
.ari-figure-btn .ari-pose-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35));
  opacity: 0;
  transform: translateY(2px) scale(0.985);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.2,.8,.2,1);
  will-change: opacity, transform;
}
.ari-root[data-ari-facing="left"] .ari-pose-frame { scale: -1 1; }
.ari-figure-btn .ari-pose-frame.ari-pose-active { opacity: 1; transform: translateY(0) scale(1); }
.ari-root[data-ari-pose="point"] .ari-pose-frame.ari-pose-active {
  transform: translateY(-2px) rotate(var(--ari-point-tilt, 0deg)) scale(1.16);
  transform-origin: 50% 64%;
}
.ari-root.ari-point-visible .ari-figure-btn { animation: ari-point-arrive .46s cubic-bezier(.2,.9,.24,1) both; }
.ari-figure-btn:hover .ari-pose-frame.ari-pose-active,
.ari-figure-btn:focus-visible .ari-pose-frame.ari-pose-active { transform: translateY(-3px) scale(1.04); }
.ari-root[data-ari-pose="point"] .ari-figure-btn:hover .ari-pose-frame.ari-pose-active,
.ari-root[data-ari-pose="point"] .ari-figure-btn:focus-visible .ari-pose-frame.ari-pose-active {
  transform: translateY(-3px) rotate(var(--ari-point-tilt, 0deg)) scale(1.18);
}
.ari-root.ari-state-entering .ari-pose-frame.ari-pose-active { animation: ari-bounce-in 0.6s cubic-bezier(.34,1.56,.64,1) both; }
.ari-root.ari-state-summarizing .ari-pose-frame.ari-pose-active { animation: ari-think-pulse 1.6s ease-in-out infinite; }
.ari-root.ari-state-done .ari-pose-frame.ari-pose-active { animation: ari-done-bounce 0.7s ease-out; }
.ari-root[data-ari-pose="idle"] .ari-pose-frame.ari-pose-active { animation: ari-breathe-loop 3.2s ease-in-out infinite; }
.ari-root[data-ari-motion-state="meditate"] .ari-pose-frame.ari-pose-active { animation: ari-meditate 5.5s ease-in-out infinite; }
.ari-root.ari-state-excited .ari-figure-wrap::before {
  content: "";
  position: absolute;
  inset: 8% 2% 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,201,105,.32), rgba(232,115,74,.08) 48%, transparent 72%);
  filter: blur(7px);
  animation: ari-thread-glow 2.1s ease-in-out infinite;
}

@keyframes ari-bounce-in {
  0% { opacity: 0; transform: translateY(38px) scale(0.7); }
  60% { opacity: 1; transform: translateY(-8px) scale(1.05); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ari-think-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes ari-done-bounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.18) rotate(-4deg); }
  60% { transform: scale(0.96) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes ari-breathe-loop {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  45% { transform: translateY(-2px) rotate(-0.8deg) scale(1.018); }
  60% { transform: translateY(-1px) rotate(0.5deg) scale(1.01); }
}
@keyframes ari-thread-glow {
  0%, 100% { opacity: .45; transform: scale(.92); }
  50% { opacity: 1; transform: scale(1.08); }
}
@keyframes ari-grounded-run {
  0%, 100% { transform: translate3d(-1px, 0, 0) rotate(-2deg) scaleY(.98); }
  25% { transform: translate3d(1px, -3px, 0) rotate(1.5deg) scaleY(1.02); }
  50% { transform: translate3d(2px, 0, 0) rotate(2deg) scaleY(.98); }
  75% { transform: translate3d(0, -3px, 0) rotate(-1.5deg) scaleY(1.02); }
}
@keyframes ari-point-arrive {
  0% { transform: translateY(3px) scale(.9); }
  55% { transform: translateY(-5px) scale(1.18); }
  82% { transform: translateY(1px) scale(1.08); }
  100% { transform: translateY(0) scale(1.12); }
}
@keyframes ari-meditate {
  0%, 100% { transform: translateY(0) scale(1); filter: saturate(.88); }
  48% { transform: translateY(-1px) scale(1.012); filter: saturate(1); }
}

.ari-root[data-ari-perch-edge="top"] .ari-figure-btn::before { bottom: 0; transform: scaleX(.72); }
.ari-root[data-ari-perch-edge="left"] .ari-figure-btn::before { transform: translateX(5px) scaleX(.76); }
.ari-root[data-ari-perch-edge="right"] .ari-figure-btn::before { transform: translateX(-5px) scaleX(.76); }

/* First contact is a small playable cloud, not a conventional chat panel. */
.ari-root.ari-state-welcome {
  flex-direction: row;
  align-items: center;
  gap: 2px;
  filter: drop-shadow(0 18px 36px rgba(0,0,0,.28));
}
.ari-root.ari-state-welcome .ari-figure-wrap {
  width: 88px;
  height: 88px;
  flex: none;
  order: 2;
}
.ari-root.ari-state-welcome > [data-ari-interactive]:first-child { order: 1; }
.ari-welcome-spark {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 2px;
  pointer-events: auto;
  transform-origin: 100% 70%;
  animation: ari-welcome-cloud 3.4s ease-in-out infinite;
}
.ari-welcome-action {
  position: relative;
  isolation: isolate;
  min-width: 144px;
  min-height: 62px;
  padding: 11px 27px 10px 23px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 54% 46% 48% 52% / 58% 52% 48% 42%;
  background:
    radial-gradient(circle at 25% 19%, rgba(255,255,255,.15), transparent 23%),
    linear-gradient(140deg, color-mix(in srgb, var(--ari-primary) 28%, var(--ari-surface-hi)), rgba(18,15,12,.94) 68%);
  color: var(--ari-text);
  box-shadow:
    -11px 9px 0 -6px color-mix(in srgb, var(--ari-surface-hi) 92%, transparent),
    13px 13px 0 -8px color-mix(in srgb, var(--ari-primary) 31%, var(--ari-surface-hi)),
    0 16px 38px rgba(0,0,0,.34),
    inset 2px 2px rgba(255,255,255,.055);
  backdrop-filter: blur(18px) saturate(1.2);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  transition: transform .22s cubic-bezier(.18,.88,.2,1.2), border-color .18s ease, filter .18s ease;
}
.ari-welcome-action::before,
.ari-welcome-action::after {
  content: "";
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255,255,255,.11);
  background: color-mix(in srgb, var(--ari-surface-hi) 90%, transparent);
  border-radius: 50%;
  pointer-events: none;
}
.ari-welcome-action::before { width: 31px; height: 25px; left: -13px; bottom: 2px; }
.ari-welcome-action::after { width: 23px; height: 19px; right: -9px; top: 4px; }
.ari-welcome-action:hover,
.ari-welcome-action:focus-visible {
  transform: translate3d(-3px,-3px,0) rotate(-1deg) scale(1.035);
  border-color: rgba(255,143,99,.72);
  filter: brightness(1.08);
  outline: 2px solid color-mix(in srgb, var(--ari-primary-hi) 64%, transparent);
  outline-offset: 3px;
}
.ari-welcome-hi {
  font-family: var(--brand-font-display, "Instrument Serif", Georgia, serif);
  font-size: 24px;
  line-height: .98;
  color: var(--ari-primary-hi);
  letter-spacing: -.015em;
}
.ari-welcome-drag {
  margin-top: 6px;
  color: var(--ari-text-muted);
  font-size: 10px;
  line-height: 1;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.ari-welcome-close {
  width: 44px;
  height: 44px;
  margin: -16px 0 0 -12px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  background: color-mix(in srgb, var(--ari-surface-hi) 88%, transparent);
  color: var(--ari-text-muted);
  box-shadow: 0 8px 18px rgba(0,0,0,.22);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 17px;
  line-height: 1;
  transition: transform .18s ease, color .18s ease, background .18s ease;
}
.ari-welcome-close:hover,
.ari-welcome-close:focus-visible {
  color: var(--ari-text);
  background: var(--ari-primary);
  transform: rotate(8deg) scale(1.08);
  outline: none;
}
.ari-root[data-ari-motion-state="welcome-enter"] .ari-figure-btn {
  animation: ari-welcome-hop .34s cubic-bezier(.38,0,.62,1) infinite;
}
.ari-root[data-ari-motion-state="welcome-enter"] .ari-figure-btn::after {
  content: "";
  position: absolute;
  left: 17%;
  right: 17%;
  bottom: 7px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--ari-primary-hi), transparent);
  opacity: .72;
  animation: ari-welcome-thread .48s ease-in-out infinite alternate;
}
.ari-root[data-ari-motion-state="welcome-play"] .ari-figure-btn {
  animation: ari-welcome-ready 1.8s cubic-bezier(.18,.82,.22,1) infinite;
}
.ari-welcome-spark.ari-welcome-spark-popping { animation: ari-welcome-pop .24s ease-in both; pointer-events: none; }
@keyframes ari-welcome-cloud {
  0%, 100% { transform: translate3d(0,0,0) rotate(-.25deg); }
  48% { transform: translate3d(-2px,-5px,0) rotate(.7deg); }
  72% { transform: translate3d(1px,-2px,0) rotate(-.45deg); }
}
@keyframes ari-welcome-hop {
  0%, 100% { transform: translate3d(-2px,1px,0) rotate(-2deg) scaleY(.97); }
  50% { transform: translate3d(3px,-7px,0) rotate(2.5deg) scaleY(1.025); }
}
@keyframes ari-welcome-thread {
  from { transform: translateX(-7px) scaleX(.54); opacity: .25; }
  to { transform: translateX(7px) scaleX(1.14); opacity: .8; }
}
@keyframes ari-welcome-ready {
  0%, 100% { transform: translate3d(0,0,0) rotate(0); }
  14% { transform: translate3d(0,-5px,0) rotate(-2deg); }
  28% { transform: translate3d(0,0,0) rotate(1.5deg); }
  40%, 84% { transform: translate3d(0,0,0) rotate(0); }
}
@keyframes ari-welcome-pop {
  0% { opacity: 1; transform: scale(1); filter: blur(0); }
  44% { opacity: .95; transform: scale(1.06,.88); filter: blur(0); }
  100% { opacity: 0; transform: translate3d(-10px,-13px,0) scale(.62); filter: blur(5px); }
}

/* Small always-visible dismiss X on the docked figure. */
.ari-figure-dismiss {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--ari-line);
  background: var(--ari-surface-hi);
  color: var(--ari-text-muted);
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.ari-figure-wrap:hover .ari-figure-dismiss,
.ari-figure-wrap:focus-within .ari-figure-dismiss,
.ari-root.ari-state-entering .ari-figure-dismiss,
.ari-root.ari-state-bubble .ari-figure-dismiss { opacity: 1; transform: scale(1); }
.ari-figure-dismiss:hover { background: var(--ari-primary); color: #1a1310; }

/* Speech bubble */
.ari-bubble {
  width: min(440px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  background: transparent;
  border: none;
  color: var(--ari-text);
  padding: 0;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: none;
  pointer-events: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  transform-origin: 88% 100%;
  animation: ari-cloud-bloom 0.46s cubic-bezier(.18,.88,.2,1.18) both;
}
@keyframes ari-cloud-bloom {
  0% { opacity: 0; transform: translate3d(16px, 20px, 0) scale(.72,.62) rotate(3deg); }
  62% { opacity: 1; transform: translate3d(-2px, -3px, 0) scale(1.035,.985) rotate(-.6deg); }
  82% { transform: translate3d(1px, 1px, 0) scale(.992,1.018) rotate(.2deg); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1) rotate(0); }
}
@keyframes ari-bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ari-cloud-pop-away {
  0% { opacity: 1; transform: scale(1); filter: blur(0); }
  48% { opacity: .94; transform: scale(1.055,.91); filter: blur(0); }
  100% { opacity: 0; transform: translate3d(10px, -14px, 0) scale(.68); filter: blur(5px); }
}
.ari-bubble.ari-cloud-popping { animation: ari-cloud-pop-away .26s ease-in both; pointer-events: none; }
.ari-bubble-close {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--ari-text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ari-bubble-close:hover { color: var(--ari-primary-hi); background: rgba(255,255,255,0.06); }

.ari-cloudlets {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  pointer-events: auto;
  z-index: 3;
}
.ari-cloudlet {
  position: relative;
  pointer-events: auto;
  width: auto;
  min-width: 44px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid rgba(255,143,99,.38);
  border-radius: 999px 999px 999px 17px;
  background:
    radial-gradient(circle at 22% 12%, rgba(255,255,255,.14), transparent 32%),
    linear-gradient(145deg, rgba(255,143,99,.22), rgba(22,18,16,.96) 68%);
  background-color: #1b1511;
  color: var(--ari-text);
  box-shadow: 0 9px 24px rgba(0,0,0,.28), inset 1px 1px rgba(255,255,255,.05);
  backdrop-filter: blur(16px) saturate(1.12);
  cursor: pointer;
  overflow: visible;
  animation: ari-cloudlet-arrive .16s ease-out both;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), border-color .18s ease, opacity .18s ease;
}
.ari-cloudlet::before {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  right: 6px;
  bottom: -5px;
  border-radius: 50%;
  background: var(--ari-surface-hi);
  border: 1px solid rgba(255,143,99,.28);
}
.ari-cloudlet:nth-child(2n) { border-radius: 999px 18px 999px 999px; }
.ari-cloudlet:nth-child(3n) { transform: translateY(2px); }
.ari-cloudlet-label {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -.01em;
  color: #f9f6ef;
  white-space: nowrap;
}
@keyframes ari-cloudlet-arrive {
  from { opacity: 0; transform: translate3d(0,8px,0) scale(.94); }
  to { opacity: 1; transform: translate3d(0,0,0) scale(1); }
}
.ari-cloudlet:hover,
.ari-cloudlet:focus-visible { border-color: var(--ari-primary-hi); transform: translateY(-3px) scale(1.035); outline: 2px solid rgba(255,143,99,.35); outline-offset: 2px; }
@keyframes ari-cloudlet-pop {
  0% { opacity: 1; scale: 1; }
  36% { opacity: 1; scale: 1.34 .72; }
  62% { opacity: .15; scale: .42 1.18; }
  100% { opacity: 0; scale: 0; }
}
.ari-cloudlet.ari-cloudlet-popped { animation: ari-cloudlet-pop .34s ease-out both; pointer-events: none; }
.ari-bubble-back {
  min-width: 68px;
  min-height: 32px;
  padding: 4px 11px;
  border: 1px solid rgba(255,143,99,.42);
  border-radius: 999px;
  background: rgba(255,143,99,.12);
  color: var(--ari-text);
  font: 650 13px/1 var(--brand-font-body, "IBM Plex Sans", Arial, sans-serif);
  cursor: pointer;
}
.ari-bubble-back:hover,
.ari-bubble-back:focus-visible { background: rgba(255,143,99,.25); border-color: var(--ari-primary-hi); outline: none; }
.ari-bubble-header {
  min-height: 38px;
  width: max-content;
  max-width: 100%;
  margin: 0 8px 0 0;
  padding: 5px 6px 5px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ari-surface-hi) 88%, transparent);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  backdrop-filter: blur(18px) saturate(1.15);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.ari-is-dragging .ari-bubble-header { cursor: grabbing; }
.ari-bubble-controls { display: flex; align-items: center; gap: 2px; flex: none; }
.ari-bubble-controls button {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ari-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ari-bubble-controls button[hidden] { display: none !important; }
.ari-bubble-controls .ari-bubble-back {
  width: auto;
  min-width: 68px;
  min-height: 32px;
  padding: 4px 11px;
  border: 1px solid rgba(255,143,99,.42);
  background: rgba(255,143,99,.12);
  color: var(--ari-text);
}
.ari-bubble-controls button:hover,
.ari-bubble-controls button:focus-visible { color: var(--ari-primary-hi); background: rgba(255,255,255,0.07); }
.ari-voice-choice {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(255,143,99,.22);
  border-radius: 999px;
  background: rgba(0,0,0,.14);
}
.ari-bubble-controls .ari-voice-choice-btn {
  width: auto;
  min-width: 48px;
  height: 26px;
  padding: 0 8px;
  font: 650 9px/1 var(--brand-font-body, "IBM Plex Sans", Arial, sans-serif);
  letter-spacing: .025em;
}
.ari-bubble-controls .ari-voice-choice-btn[aria-pressed="true"] {
  color: #1a1310;
  background: var(--ari-primary-hi);
  box-shadow: 0 0 18px rgba(255,201,105,.22);
}
.ari-bubble-name {
  font-family: var(--brand-font-display, "Instrument Serif", Georgia, serif);
  color: var(--ari-primary-hi);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ari-bubble-body {
  width: 100%;
  margin: 0;
  padding: 18px 20px 19px;
  font-size: 14px;
  position: relative;
  isolation: isolate;
  border: 1px solid rgba(255,143,99,.28);
  border-radius: 32px 38px 16px 36px;
  background:
    radial-gradient(circle at 84% 15%, rgba(255,143,99,.13), transparent 30%),
    color-mix(in srgb, var(--ari-surface-hi) 91%, transparent);
  box-shadow: 0 22px 60px rgba(0,0,0,.38), inset 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(22px) saturate(1.12);
}
.ari-bubble-body::before,
.ari-bubble-body::after {
  content: "";
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255,143,99,.2);
  background: color-mix(in srgb, var(--ari-surface-hi) 92%, transparent);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0,0,0,.2);
}
.ari-bubble-body::before { width: 54px; height: 34px; right: 38px; top: -12px; }
.ari-bubble-body::after { width: 28px; height: 28px; right: 8px; bottom: -10px; }
.ari-bubble-sub {
  align-self: flex-end;
  max-width: 82%;
  margin: -2px 12px 0 0;
  padding: 9px 13px;
  border-radius: 18px 18px 6px 18px;
  border: 1px solid rgba(244,241,234,.12);
  background: color-mix(in srgb, var(--ari-surface) 87%, transparent);
  color: var(--ari-text-muted);
  font-size: 12px;
  line-height: 1.35;
  backdrop-filter: blur(14px);
}
.ari-bubble-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ari-bubble-btn {
  border: 1px solid var(--ari-primary);
  background: var(--ari-primary);
  color: #1a1310;
  font-weight: 700;
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ari-bubble-btn:hover { background: var(--ari-primary-hi); transform: translateY(-1px); }
.ari-bubble-btn.ari-btn-ghost {
  background: transparent;
  color: var(--ari-text-muted);
  border-color: var(--ari-line);
  font-weight: 500;
}
.ari-bubble-btn.ari-btn-ghost:hover { color: var(--ari-text); border-color: var(--ari-text-muted); }
.ari-bubble-list {
  width: calc(100% - 18px);
  margin: -3px 9px 0 0;
  padding: 14px 18px 14px 34px;
  border-radius: 24px 12px 28px 24px;
  background: color-mix(in srgb, var(--ari-surface) 88%, transparent);
  border: 1px solid var(--ari-line);
  backdrop-filter: blur(16px);
}
.ari-bubble-list li { margin-bottom: 4px; }
.ari-constellation {
  width: 100%;
  padding: 13px 14px 14px;
  border: 1px solid rgba(255,143,99,.28);
  border-radius: 34px 18px 36px 28px;
  background:
    radial-gradient(circle at 18% 0, rgba(255,201,105,.12), transparent 36%),
    color-mix(in srgb, var(--ari-surface-hi) 91%, transparent);
  box-shadow: 0 20px 56px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.045);
  backdrop-filter: blur(22px) saturate(1.15);
  overflow: hidden;
}
.ari-constellation[data-ari-discovery-mode="idea"] {
  border-radius: 18px 36px 26px 38px;
  background:
    radial-gradient(circle at 82% 4%, rgba(255,143,99,.16), transparent 38%),
    radial-gradient(circle at 12% 92%, rgba(255,201,105,.09), transparent 34%),
    color-mix(in srgb, var(--ari-surface-hi) 91%, transparent);
}
.ari-constellation[data-ari-discovery-mode="idea"] .ari-constellation-map { transform: rotate(-2deg); }
.ari-constellation[data-ari-discovery-mode="idea"] .ari-constellation-star.ari-star-active { transform: scale(1.16) rotate(-8deg); }
.ari-constellation-map {
  position: relative;
  width: 148px;
  height: 38px;
  margin: 0 auto 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ari-constellation-map::before {
  content: "";
  position: absolute;
  left: 17px;
  right: 17px;
  top: 18px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,143,99,.18), rgba(255,201,105,.72), rgba(255,143,99,.18));
  transform-origin: left;
  animation: ari-thread-draw .58s ease-out both;
}
@keyframes ari-thread-draw { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
.ari-constellation-star {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,143,99,.25);
  background: var(--ari-surface-hi);
  color: var(--ari-text-muted);
  font-size: 10px;
  transition: transform .28s cubic-bezier(.2,.9,.2,1.3), background .25s ease, color .25s ease, box-shadow .25s ease;
}
.ari-constellation-star.ari-star-active {
  color: #1a1310;
  background: var(--ari-primary-hi);
  transform: scale(1.16) rotate(8deg);
  box-shadow: 0 0 0 7px rgba(255,143,99,.08), 0 0 24px rgba(255,201,105,.26);
}
.ari-constellation-star.ari-star-complete { color: var(--ari-primary-hi); border-color: var(--ari-primary-hi); transform: scale(.82); }
.ari-constellation-stage { animation: ari-clue-arrive .28s cubic-bezier(.2,.82,.2,1) both; }
@keyframes ari-clue-arrive { from { opacity: 0; transform: translate3d(8px,5px,0) scale(.97); } to { opacity: 1; transform: none; } }
.ari-constellation-question {
  margin: 0 0 10px;
  color: var(--ari-text);
  font-family: var(--brand-font-display, "Instrument Serif", Georgia, serif);
  font-size: 17px;
  line-height: 1.2;
  text-align: center;
}
.ari-constellation-choices { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; }
.ari-constellation-chip {
  border: 1px solid var(--ari-line);
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255,255,255,.035);
  color: var(--ari-text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2,.9,.2,1.2), border-color .18s ease, background .18s ease;
}
.ari-constellation-chip:hover,
.ari-constellation-chip:focus-visible { transform: translateY(-3px) rotate(-1deg); border-color: var(--ari-primary-hi); background: rgba(255,143,99,.1); outline: none; }
.ari-constellation-custom {
  width: min(270px, 100%);
  margin: 10px auto 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) 34px;
  gap: 6px;
}
.ari-constellation-custom input {
  width: 100%;
  min-width: 0;
  height: 36px;
  border: 1px solid var(--ari-line);
  border-radius: 18px 10px 18px 18px;
  background: rgba(0,0,0,.16);
  color: var(--ari-text);
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
}
.ari-constellation-custom input:focus-visible { outline: 1px solid var(--ari-primary-hi); outline-offset: 2px; }
.ari-constellation-custom button,
.ari-constellation-send {
  border: none;
  border-radius: 999px;
  background: var(--ari-primary);
  color: #1a1310;
  font-weight: 750;
  cursor: pointer;
}
.ari-constellation-custom button { width: 36px; height: 36px; font-size: 17px; }
.ari-constellation-summary {
  margin: 0;
  padding: 9px 12px;
  border-radius: 18px 18px 8px 18px;
  background: rgba(255,143,99,.08);
  color: var(--ari-primary-hi);
  font-size: 11.5px;
  text-align: center;
}
.ari-constellation-privacy { margin: 8px 0 7px; color: var(--ari-text-muted); font-size: 10.5px; text-align: center; }
.ari-constellation-send { min-height: 42px; width: 100%; padding: 9px 15px; font-size: 12px; }
.ari-constellation-send:hover,
.ari-constellation-send:focus-visible { background: var(--ari-primary-hi); transform: translateY(-2px); outline: none; }
.ari-constellation-consent { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.ari-constellation-decline {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--ari-line);
  border-radius: 999px;
  background: transparent;
  color: var(--ari-text-muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.ari-constellation-decline:hover,
.ari-constellation-decline:focus-visible { color: var(--ari-text); border-color: var(--ari-text-muted); outline: none; }
.ari-bubble-sound {
  font-size: 13px;
  width: auto !important;
  min-width: 28px;
  padding: 0 8px;
  font-family: var(--brand-font-body, "IBM Plex Sans", Arial, sans-serif);
  font-size: 10px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.ari-bubble-sound[aria-pressed="true"] { color: var(--ari-primary-hi); }
.ari-bubble-voice {
  width: auto !important;
  min-width: 42px;
  padding: 0 8px;
  color: var(--ari-primary-hi) !important;
  font-family: var(--brand-font-body, "IBM Plex Sans", Arial, sans-serif);
  font-size: 10px;
  letter-spacing: .02em;
}
.ari-bubble-voice[data-voice-state="loading"] { animation: ari-voice-ready 1s ease-in-out infinite; }
@keyframes ari-voice-ready { 50% { opacity: .5; } }
.ari-bubble-motion { font-size: 19px; line-height: 1; }
.ari-bubble-motion[aria-pressed="true"] { color: var(--ari-primary-hi); }

.ari-ask-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px;
  width: 100%;
  gap: 9px;
  margin-top: 1px;
  padding: 0 3px 0 0;
  border: none;
  background: transparent;
  box-shadow: none;
  align-items: end;
  position: relative;
}
.ari-ask-form::before {
  content: "";
  position: absolute;
  inset: 8px 64px -6px 12px;
  border-radius: 52% 48% 44% 56%;
  background: rgba(255,143,99,.075);
  filter: blur(16px);
  pointer-events: none;
  transition: opacity .18s ease, transform .26s ease;
}
.ari-ask-form:focus-within::before { opacity: 1; transform: scale(1.04); }
.ari-ask-form.ari-ask-compact .ari-ask-input { min-height: 48px; max-height: 96px; padding-block: 11px; }
.ari-ask-form.ari-ask-compact { grid-template-columns: minmax(0, 1fr) 34px 34px; }
.ari-ask-input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  max-height: 118px;
  resize: none;
  background:
    radial-gradient(circle at 12% 10%, rgba(255,255,255,.05), transparent 34%),
    color-mix(in srgb, var(--ari-surface-hi) 91%, transparent);
  border: 1px solid rgba(255,143,99,.38);
  border-radius: 999px 34px 18px 999px;
  padding: 13px 17px 11px;
  color: var(--ari-text);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  box-shadow: 0 18px 46px rgba(0,0,0,.36), inset 0 1px rgba(255,255,255,.055);
  backdrop-filter: blur(22px) saturate(1.12);
  transition: min-height .24s ease, border-color .18s ease, box-shadow .24s ease, border-radius .24s ease, transform .24s cubic-bezier(.2,.82,.2,1);
}
.ari-ask-input:focus-visible {
  outline: 1px solid var(--ari-primary-hi);
  outline-offset: 3px;
  border-color: rgba(255,143,99,.72);
  min-height: 66px;
  border-radius: 32px 38px 18px 34px;
  transform: translateY(-2px);
  box-shadow: 0 22px 62px rgba(0,0,0,.42), 0 0 0 7px rgba(255,143,99,.055), inset 0 1px rgba(255,255,255,.07);
}
.ari-ask-submit,
.ari-ask-mic {
  border: none;
  align-self: end;
  border-radius: 999px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  font-size: 13px;
  box-shadow: 0 12px 28px rgba(0,0,0,.34);
  transform: translateY(-4px);
  transition: transform .18s cubic-bezier(.2,.9,.2,1.25), box-shadow .18s ease, background .18s ease;
}
.ari-ask-submit { background: var(--ari-primary); color: #1a1310; }
.ari-ask-mic { background: color-mix(in srgb, var(--ari-surface-hi) 92%, transparent); color: var(--ari-primary-hi); border: 1px solid var(--ari-line); transform: translateY(6px); }
.ari-ask-submit:hover,
.ari-ask-submit:focus-visible { transform: translateY(-7px) scale(1.08) rotate(-3deg); box-shadow: 0 16px 34px rgba(0,0,0,.4), 0 0 0 5px rgba(255,143,99,.09); }
.ari-ask-mic:hover,
.ari-ask-mic:focus-visible { transform: translateY(3px) scale(1.08) rotate(3deg); box-shadow: 0 16px 34px rgba(0,0,0,.4); }
.ari-ask-mic:disabled { opacity: .3; cursor: not-allowed; }
.ari-ask-mic.ari-is-listening { animation: ari-listening 1.1s ease-in-out infinite; background: var(--ari-primary); color: #1a1310; }
@keyframes ari-listening { 50% { transform: scale(.82); box-shadow: 0 0 0 7px rgba(232,115,74,.14); } }

/* Undo-dismiss toast */
.ari-undo-toast {
  pointer-events: auto;
  background: var(--ari-surface-hi);
  border: 1px solid var(--ari-line);
  color: var(--ari-text);
  border-radius: 999px;
  padding: 8px 8px 8px 14px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
  animation: ari-bubble-in 0.22s ease-out both;
}
.ari-undo-toast button {
  border: 1px solid var(--ari-primary);
  background: var(--ari-primary);
  color: #1a1310;
  font-weight: 700;
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

/* Sleeping mascot tab — permanent post-dismissal opt-back-in affordance. */
.ari-sleep-tab {
  position: fixed;
  z-index: 2147483000;
  right: clamp(12px, 3vw, 28px);
  bottom: clamp(12px, 3vw, 28px);
  pointer-events: auto;
  width: 40px;
  height: 40px;
  border-radius: 999px 999px 6px 999px;
  border: 1px solid var(--ari-line);
  background: var(--ari-surface-hi);
  cursor: pointer;
  padding: 5px;
  opacity: 0.55;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.ari-sleep-tab:hover, .ari-sleep-tab:focus-visible { opacity: 1; transform: translateY(-2px); }
.ari-sleep-tab img { width: 100%; height: 100%; object-fit: contain; }

/* Footer belt-and-braces re-entry link, injected next to any <footer>. */
.ari-wake-link {
  font-size: 11px;
  color: var(--ari-text-muted, #8a8378);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
}
.ari-wake-link:hover { opacity: 1; }

@media (max-width: 560px) {
  .ari-root { right: 10px; bottom: 10px; }
  .ari-figure-wrap { width: 60px; height: 60px; }
  .ari-root.ari-state-welcome .ari-figure-wrap { width: 78px; height: 78px; }
  .ari-welcome-action { min-width: 126px; min-height: 56px; padding: 9px 22px 9px 20px; }
  .ari-welcome-hi { font-size: 21px; }
  .ari-welcome-close { width: 44px; height: 44px; }
  .ari-bubble { width: min(380px, calc(100vw - 20px)); font-size: 13px; }
  .ari-bubble-header { width: 100%; margin-right: 0; padding-left: 6px; gap: 4px; }
  .ari-bubble-name { display: none; }
  .ari-bubble-controls { width: 100%; justify-content: flex-end; }
  .ari-bubble-controls .ari-voice-choice-btn { min-width: 44px; padding-inline: 6px; }
  .ari-root:has(.ari-bubble) .ari-figure-wrap {
    position: absolute;
    z-index: 5;
    right: 8px;
    top: 108px;
    width: 56px;
    height: 56px;
  }
  .ari-root:has(.ari-bubble) .ari-bubble-body { padding-right: 76px; min-height: 66px; }
  .ari-cloudlets {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 18px 7px 2px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 24px), transparent 100%);
  }
  .ari-cloudlets::-webkit-scrollbar { display: none; }
  .ari-cloudlet { flex: none; scroll-snap-align: start; }
}

@media (prefers-reduced-motion: reduce) {
  .ari-root.ari-state-entering .ari-figure-btn img,
  .ari-root.ari-state-summarizing .ari-figure-btn img,
  .ari-root.ari-state-done .ari-figure-btn img,
  .ari-root[data-ari-pose="idle"] .ari-pose-frame,
  .ari-root[data-ari-pose="done"] .ari-pose-frame,
  .ari-root[data-ari-motion-state="meditate"] .ari-pose-frame,
  .ari-root.ari-point-visible .ari-figure-btn,
  .ari-root.ari-state-excited .ari-figure-wrap::before,
  .ari-ask-mic.ari-is-listening,
  .ari-bubble,
  .ari-undo-toast { animation: none !important; }
  .ari-figure-btn .ari-pose-frame,
  .ari-figure-wrap,
  .ari-root { transition: none !important; transform: none !important; }
  .ari-root.ari-is-dragging {
    transform: translate3d(var(--ari-drag-x, 0px), var(--ari-drag-y, 0px), 0) !important;
  }
  .ari-root[data-ari-motion-state="walk"] .ari-figure-btn,
  .ari-root[data-ari-motion-state="click-walk"] .ari-figure-btn,
  .ari-root[data-ari-motion-state="scroll-follow"] .ari-figure-btn,
  .ari-root[data-ari-motion-state="scroll-settle"] .ari-figure-btn,
  .ari-bubble-voice { animation: none !important; }
  .ari-cloudlet,
  .ari-welcome-spark,
  .ari-welcome-spark.ari-welcome-spark-popping,
  .ari-root[data-ari-motion-state="welcome-enter"] .ari-figure-btn,
  .ari-root[data-ari-motion-state="welcome-enter"] .ari-figure-btn::after,
  .ari-root[data-ari-motion-state="welcome-play"] .ari-figure-btn,
  .ari-bubble.ari-cloud-popping,
  .ari-ask-form::before,
  .ari-constellation-map::before,
  .ari-constellation-stage,
  .ari-root[data-ari-motion-state="scroll-follow"] .ari-figure-btn::after { animation: none !important; transition: none !important; }
}

/* ---- v17 friend paradigm (prm_f1eed20a) ---- */
/* Speaking visualization: while Ari's voice plays, the porch-light glow
   breathes — presence, not a waveform. */
.ari-state-speaking .ari-figure-btn {
  animation: ari-speak-glow 1.5s ease-in-out infinite;
}
@keyframes ari-speak-glow {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(232, 115, 74, .30)); }
  50% { filter: drop-shadow(0 0 15px rgba(255, 143, 99, .65)); }
}
/* Named work-step line under the sub while a task runs (honest labor, not
   typing dots). */
.ari-bubble-step {
  align-self: flex-end;
  max-width: 82%;
  margin: 2px 12px 0 0;
  padding: 5px 12px;
  border-radius: 12px 12px 4px 12px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ari-text-muted, #a09888);
  background: rgba(0, 0, 0, .18);
}
@media (prefers-reduced-motion: reduce) {
  .ari-state-speaking .ari-figure-btn { animation: none; }
}

/* ---- v18 visual craft pass (prm_f1eed20a wave 4) ----
   The golden thread made visible: every cloud Ari speaks from trails a
   shimmering gold thread back to the creature. Ari's own words speak in
   the portfolio's serif voice; the machine parts (steps, subs, chips)
   stay sans. */

/* Ari's voice: serif, warmer, one notch larger. */
.ari-bubble-body {
  font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  font-size: 16.5px;
  line-height: 1.44;
  letter-spacing: .006em;
  background:
    radial-gradient(120% 90% at 82% 0%, rgba(255, 143, 99, .07), transparent 55%),
    linear-gradient(180deg, rgba(31, 25, 18, .985), rgba(23, 19, 15, .995));
  box-shadow:
    0 1px 0 rgba(255, 143, 99, .10) inset,
    0 18px 44px rgba(0, 0, 0, .5),
    0 3px 12px rgba(0, 0, 0, .35);
}

/* The thread tail: a thin gold line leaving the bubble's lower edge toward
   Ari, with a slow traveling bead of light. Pure CSS, anchored to the
   bubble's right (Ari perches beside its cloud). */
.ari-bubble::after {
  content: '';
  position: absolute;
  right: 34px;
  bottom: -26px;
  width: 2px;
  height: 30px;
  border-radius: 2px;
  transform: rotate(14deg);
  transform-origin: top center;
  background: linear-gradient(180deg, rgba(232, 167, 90, .85), rgba(232, 167, 90, .06));
  box-shadow: 0 0 6px rgba(232, 167, 90, .35);
  pointer-events: none;
}
.ari-bubble::before {
  content: '';
  position: absolute;
  right: 30.5px;
  bottom: -20px;
  z-index: 1;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f0c489;
  box-shadow: 0 0 8px 2px rgba(240, 196, 137, .55);
  opacity: 0;
  animation: ari-thread-bead 3.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ari-thread-bead {
  0%, 58% { opacity: 0; transform: translateY(-4px); }
  68% { opacity: .95; }
  100% { opacity: 0; transform: translateY(22px); }
}

/* The first action is the warm one: coral fill, near-black text. */
.ari-bubble-actions .ari-bubble-btn:first-child {
  background: linear-gradient(180deg, var(--ari-primary-hi, #ff8f63), var(--ari-primary, #e8734a));
  border-color: transparent;
  color: #17130f;
  font-weight: 600;
}
.ari-bubble-actions .ari-bubble-btn:first-child:hover {
  filter: brightness(1.06);
}

/* Lists inside the cloud get thread markers instead of dots. */
.ari-bubble-list li::marker {
  color: rgba(240, 196, 137, .9);
}
.ari-bubble-list li {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 15.5px;
}

@media (prefers-reduced-motion: reduce) {
  .ari-bubble::before { animation: none; opacity: 0; }
}

/* ---- v19: artifact cards + sound chip + return ritual (K3 audit fixes) ---- */
.ari-artifact {
  position: fixed;
  bottom: 132px;
  width: min(400px, calc(100vw - 28px));
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px 14px;
  border-radius: 14px 16px 14px 16px;
  border: 1px solid rgba(240, 196, 137, .22);
  background:
    linear-gradient(180deg, rgba(31, 25, 18, .985), rgba(20, 16, 12, .995));
  box-shadow: 0 22px 54px rgba(0, 0, 0, .55), 0 3px 14px rgba(0, 0, 0, .4);
  color: var(--ari-text, #f4f1ea);
  font-size: 13px;
  animation: ari-artifact-in .38s cubic-bezier(.18, .88, .26, 1.06) both;
}
.ari-artifact.ari-side-right { right: 16px; }
.ari-artifact.ari-side-left { left: 16px; }
@keyframes ari-artifact-in {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.ari-artifact-out { transition: opacity .22s ease, transform .22s ease; opacity: 0; transform: translateY(8px) scale(.98); }
.ari-artifact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(240, 196, 137, .18);
}
.ari-artifact-who {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(240, 196, 137, .85);
}
.ari-artifact-close {
  border: none;
  background: transparent;
  color: var(--ari-text-muted, #a09888);
  font-size: 15px;
  cursor: pointer;
  padding: 0 2px;
}
.ari-artifact-body {
  margin: 0;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 16px;
  line-height: 1.45;
}
.ari-artifact-list { margin: 0; padding-left: 18px; }
.ari-artifact-list li { font-family: 'Instrument Serif', Georgia, serif; font-size: 15px; line-height: 1.5; }
.ari-artifact-list li::marker { color: rgba(240, 196, 137, .9); }
.ari-artifact-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ari-artifact-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 143, 99, .4);
  background: linear-gradient(180deg, var(--ari-primary-hi, #ff8f63), var(--ari-primary, #e8734a));
  color: #17130f;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: none;
}
.ari-artifact-btn.ari-btn-ghost { background: transparent; color: var(--ari-text, #f4f1ea); border-color: rgba(244, 241, 234, .25); font-weight: 400; }
.ari-artifact-hear {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: var(--ari-text-muted, #a09888);
  font-size: 11.5px;
  letter-spacing: .04em;
  cursor: pointer;
  padding: 2px 0;
  border-bottom: 1px dotted rgba(240, 196, 137, .4);
}

/* Sound chip on the creature: always-visible voice state. */
.ari-sound-chip {
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(244, 241, 234, .3);
  background: rgba(23, 19, 15, .92);
  cursor: pointer;
  padding: 0;
  z-index: 3;
}
.ari-sound-chip::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: transparent;
}
.ari-sound-chip.ari-sound-on::after {
  background: var(--ari-primary-hi, #ff8f63);
  box-shadow: 0 0 7px rgba(255, 143, 99, .75);
}

/* Porch-light return: one breath of warm glow when the visitor comes back. */
.ari-state-returning .ari-figure-btn { animation: ari-return-glow 1.8s ease-out 1; }
@keyframes ari-return-glow {
  0% { filter: brightness(1); }
  25% { filter: brightness(1.22) drop-shadow(0 0 12px rgba(255, 143, 99, .5)); }
  100% { filter: brightness(1); }
}
@media (prefers-reduced-motion: reduce) {
  .ari-artifact { animation: none; }
  .ari-state-returning .ari-figure-btn { animation: none; }
}

/* ---- v21 slice 2: verb radial, citations, rapport, live pulse ---- */
.ari-radial {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  z-index: 4;
  pointer-events: none;
}
.ari-radial-line {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ari-text-muted, #a09888);
  max-width: 240px;
  text-align: center;
  margin-bottom: 4px;
  pointer-events: auto;
}
.ari-radial-verb {
  pointer-events: auto;
  border: 1px solid rgba(255, 143, 99, .35);
  border-radius: 999px;
  background: rgba(23, 19, 15, .96);
  color: var(--ari-text, #f4f1ea);
  font-size: 12px;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  transform: translateX(calc((var(--ari-radial-i) - (var(--ari-radial-n) - 1) / 2) * 14px)) scale(.6);
  opacity: 0;
  animation: ari-radial-in .3s cubic-bezier(.18,.88,.3,1.2) forwards;
  animation-delay: calc(var(--ari-radial-i) * 45ms);
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
}
.ari-radial-verb:first-child {
  background: linear-gradient(180deg, var(--ari-primary-hi, #ff8f63), var(--ari-primary, #e8734a));
  color: #17130f;
  font-weight: 600;
  border-color: transparent;
}
.ari-radial-verb:hover { filter: brightness(1.08); }
@keyframes ari-radial-in {
  to { transform: translateX(calc((var(--ari-radial-i) - (var(--ari-radial-n) - 1) / 2) * 14px)) scale(1); opacity: 1; }
}
.ari-radial-out { transition: opacity .18s ease; opacity: 0 !important; }
.ari-radial-out .ari-radial-verb { animation: none; }

/* Citation chips + reveal flash */
.ari-artifact-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 2px;
}
.ari-artifact-sources-label {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ari-text-muted, #a09888);
}
.ari-artifact-cite {
  border: 1px dotted rgba(240, 196, 137, .45);
  border-radius: 999px;
  background: transparent;
  color: rgba(240, 196, 137, .95);
  font-size: 11.5px;
  padding: 4px 10px;
  cursor: pointer;
}
.ari-artifact-cite:hover { background: rgba(240, 196, 137, .12); }
.ari-cite-flash {
  animation: ari-cite-flash 2.6s ease-out 1;
  border-radius: 8px;
}
@keyframes ari-cite-flash {
  0%, 12% { box-shadow: 0 0 0 3px rgba(255, 143, 99, .75), 0 0 24px rgba(255, 143, 99, .35); background: rgba(255, 143, 99, .12); }
  70% { box-shadow: 0 0 0 3px rgba(255, 143, 99, 0); background: rgba(255, 143, 99, .04); }
  100% { box-shadow: none; background: transparent; }
}

/* Rapport presence: earned closeness reads as presence scale */
[data-ari-rapport="1"] .ari-figure-btn { transform: scale(1.02); }
[data-ari-rapport="2"] .ari-figure-btn { transform: scale(1.05); }
[data-ari-rapport="3"] .ari-figure-btn { transform: scale(1.08); }

/* Live amplitude glow: when the analyser is attached, the keyframe
   animation yields to the real signal. */
.ari-root[data-ari-live-level] .ari-state-speaking .ari-figure-btn,
.ari-root[data-ari-live-level].ari-state-speaking .ari-figure-btn { animation: none; filter: none; }
.ari-root[data-ari-live-level] .ari-state-speaking .ari-figure-btn,
.ari-root[data-ari-live-level].ari-state-speaking .ari-figure-btn {
  filter: drop-shadow(0 0 calc(5px + 16px * var(--ari-speak-level, .25))) rgba(255, 143, 99, calc(.25 + .55 * var(--ari-speak-level, .25)));
}
@media (prefers-reduced-motion: reduce) {
  .ari-radial-verb { animation: none; opacity: 1; transform: none; }
  .ari-cite-flash { animation: none; box-shadow: 0 0 0 3px rgba(255, 143, 99, .5); }
}
