/* ==========================
   Ana – Summary ribbon
========================== */
#view-ana .ana-summary.ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
#view-ana .ana-summary .cell .value {
  font-weight: 600;
}

/* ==========================
   Ana – Main workspace card
========================== */
#ana-space.card--ana {
  position: relative;
  overflow: hidden;
  padding: 16px;
  background:
    radial-gradient(140% 120% at 20% -10%, rgba(255, 255, 255, 0.06), transparent 55%),
    linear-gradient(180deg, #0c1016, #050608);
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 12px 28px rgba(0, 0, 0, 0.75);
}

/* Orb | interaction layout */
#ana-space .ana-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.6fr);
  gap: 18px;
  align-items: stretch;
}

/* ==========================
   Ana – Orb panel
========================== */

.ana-orb-wrap {
  position: relative;
  min-height: 260px;
  border-radius: 18px;
  padding: 26px 16px 56px;

  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,0.08), transparent 55%),
    radial-gradient(circle at 80% 120%, rgba(0,0,0,0.95), #050507);

  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 10px 26px rgba(0,0,0,0.75);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#ana-container {
  position: relative;
  width: min(260px, 86%);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}

/* ==========================
   Ana – Orb shell
========================== */

#ana-orb,
.ana-orb {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 190px;
  max-height: 190px;
  margin: 0 auto;
}

#ana-orb .orb,
.ana-orb .orb {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  isolation: isolate;

  background: transparent;

  box-shadow:
    0 0 20px rgba(0,0,0,0.75);

  backface-visibility: hidden;
  transform: translateZ(0);
}

#ana-orb .orb::selection {
  background: transparent;
}

#ana-orb .orb::before {
  mix-blend-mode: screen;
}

#ana-orb .orb::after {
  mix-blend-mode: screen;
}

/* atmosphere fog */
#ana-orb .orb .orb-atmosphere,
.ana-orb .orb .orb-atmosphere {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  pointer-events: none;

  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(120,180,255,0.12) 0%,
      rgba(90,140,255,0.08) 38%,
      rgba(0,0,0,0) 72%
    );

  background-size: 140% 140%;
  filter: blur(8px);
  opacity: 0.18;
  animation:
  anaAtmosphereBreath 8s ease-in-out infinite,
  anaAtmosphereDrift 22s linear infinite;
}

/* outer sphere shell */
#ana-orb .orb-shell,
.ana-orb .orb-shell {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(140,190,255,0.08);
  border-radius: 50%;
  pointer-events: none;
  overflow: hidden;

  background:
    radial-gradient(
      circle at 50% 30%,
      rgba(255,255,255,0.16) 0%,
      rgba(120,170,255,0.08) 20%,
      rgba(0,0,0,0) 55%
    );

    box-shadow:
      inset 0 0 6px rgba(180,220,255,0.10),
      inset 0 0 16px rgba(120,170,255,0.06),
      0 0 8px rgba(120,170,255,0.04);

  opacity: 0.45;

  mix-blend-mode: screen;
}

/* shell reflection streak */
#ana-orb .orb-shell::before,
.ana-orb .orb-shell::before {
  content: "";
  position: absolute;
  inset: -20%;
  border-radius: 50%;

  background:
    linear-gradient(
      115deg,
      transparent 20%,
      rgba(255,255,255,0.04) 38%,
      rgba(255,255,255,0.12) 50%,
      rgba(255,255,255,0.03) 62%,
      transparent 80%
    );

  transform:
    rotate(-8deg)
    translateX(-12%);

  mix-blend-mode: screen;

  opacity: 0.92;

  filter: blur(5px);

  animation:
    anaShellReflection 14s ease-in-out infinite;
}

/* ==========================
   Ana – Orb layers
========================== */

#ana-orb .orb .lattice,
.ana-orb .orb .lattice {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  pointer-events: none;

  z-index: 2;
  opacity: 0.18;
  filter: blur(1.2px);
}

#ana-glow,
.ana-glow {
  z-index: 1;
}

#ana-orb .spec,
.ana-orb .spec {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(255,255,255,0.25);
  opacity: 0.35;
  pointer-events: none;
}

/* ==========================
   Ana – Orb animations
========================== */

@keyframes anaAtmosphereBreath {
  0% {
    transform: scale(0.96);
    opacity: 0.52;
  }

  50% {
    transform: scale(1.03);
    opacity: 0.82;
  }

  100% {
    transform: scale(0.96);
    opacity: 0.52;
  }
}


@keyframes anaShellReflection {
  0% {
    transform:
      rotate(-8deg)
      translateX(-14%);
    opacity: 0.45;
  }

  50% {
    transform:
      rotate(-6deg)
      translateX(10%);
    opacity: 0.82;
  }

  100% {
    transform:
      rotate(-8deg)
      translateX(-14%);
    opacity: 0.45;
  }
}

@keyframes anaAtmosphereDrift {
  0% {
    transform:
      scale(0.96)
      translate(-2%, -1%);
  }

  25% {
    transform:
      scale(1.01)
      translate(2%, -2%);
  }

  50% {
    transform:
      scale(1.04)
      translate(3%, 2%);
  }

  75% {
    transform:
      scale(1.00)
      translate(-2%, 3%);
  }

  100% {
    transform:
      scale(0.96)
      translate(-2%, -1%);
  }
}
/* ==========================
   Ana – Orb ground rings
========================== */

#ana-orb .orb-ground-rings,
.ana-orb .orb-ground-rings {
  position: absolute;
  left: 50%;
  bottom: -18%;
  width: 118%;
  height: 34%;
  transform: translateX(-50%);
  border-radius: 50%;
  pointer-events: none;

  background:
    radial-gradient(ellipse at center,
      rgb(var(--accent-rgb) / 0.18) 0%,
      rgb(var(--accent-rgb) / 0.10) 28%,
      rgb(var(--accent-rgb) / 0.035) 52%,
      transparent 72%);

  filter: blur(14px);
  opacity: 0.85;

  animation: anaGroundBreath 7s ease-in-out infinite;
}

@keyframes anaGroundBreath {
  0%, 100% {
    transform: translateX(-50%) scaleX(0.92);
    opacity: 0.45;
  }

  50% {
    transform: translateX(-50%) scaleX(1.08);
    opacity: 0.78;
  }
}

/* ==========================
   Ana – Inner volumetric sphere
========================== */

#ana-orb .orb-volume,
.ana-orb .orb-volume {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  pointer-events: none;

  background:
    radial-gradient(
      circle at 45% 38%,
      rgba(160,220,255,0.20) 0%,
      rgba(120,170,255,0.10) 28%,
      rgba(40,70,120,0.06) 52%,
      rgba(0,0,0,0) 72%
    );

  mix-blend-mode: screen;

  filter:
    blur(10px);

  opacity: 0.03;

  animation:
    anaVolumeBreath 10s ease-in-out infinite;
}

@keyframes anaVolumeBreath {
  0%, 100% {
    transform: scale(0.96);
    opacity: 0.12;
  }

  50% {
    transform: scale(1.04);
    opacity: 0.82;
  }
}

/* ==========================
   Ana – Outer halo
========================== */

#ana-orb .orb-halo,
.ana-orb .orb-halo {
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  pointer-events: none;

  background:
    radial-gradient(
      circle,
      rgba(120,180,255,0.12) 0%,
      rgba(120,180,255,0.06) 34%,
      rgba(120,180,255,0.02) 52%,
      transparent 74%
    );

  filter: blur(24px);

  opacity: 0.55;

  mix-blend-mode: screen;

  animation:
    anaHaloBreath 12s ease-in-out infinite;
}

@keyframes anaHaloBreath {
  0%, 100% {
    transform: scale(0.96);
    opacity: 0.38;
  }

  50% {
    transform: scale(1.06);
    opacity: 0.62;
  }
}

/* ==========================
   Ana – Shell reflection
========================== */

#ana-orb .orb-reflection,
.ana-orb .orb-reflection {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  pointer-events: none;

  background:
    radial-gradient(
      ellipse at 38% 18%,
      rgba(255,255,255,0.20) 0%,
      rgba(180,220,255,0.10) 18%,
      rgba(120,180,255,0.04) 34%,
      transparent 58%
    );

  opacity: 0.55;
  mix-blend-mode: screen;
  filter: blur(6px);

  animation: anaReflectionBreath 9s ease-in-out infinite;
}

@keyframes anaReflectionBreath {
  0%, 100% {
    opacity: 0.38;
    transform: scale(0.98);
  }

  50% {
    opacity: 0.62;
    transform: scale(1.02);
  }
}

/* ==========================
   Ana – Depth masking
========================== */

#ana-orb .orb-depth-shadow,
.ana-orb .orb-depth-shadow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;

  background:
    radial-gradient(
      circle at 50% 72%,
      rgba(0,0,0,0.42) 0%,
      rgba(0,0,0,0.22) 26%,
      rgba(0,0,0,0.08) 42%,
      transparent 64%
    );

  mix-blend-mode: multiply;
}

/* ==========================
   Ana – Front depth mask
========================== */

#ana-orb .orb-front-mask,
.ana-orb .orb-front-mask {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 6;

  background:
    radial-gradient(
      circle at 50% 58%,
      transparent 0%,
      transparent 42%,
      rgba(0,0,0,0.06) 58%,
      rgba(0,0,0,0.22) 74%,
      rgba(0,0,0,0.42) 100%
    );

  mix-blend-mode: multiply;
}

/* ==========================
   Ana – Dialogue bubble
========================== */
#ana-dialogue {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translate(-50%, 0);

  margin-top: 0;
  padding: 6px 10px;

  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);

  font-size: 0.8rem;
  max-width: calc(100% - 32px);
  min-height: 1.6em;

  text-align: center;
  white-space: normal;

  align-items: center;
  justify-content: center;

  transition:
    opacity 180ms ease,
    transform 180ms ease;

  display: none !important;
}

#ana-dialogue.is-empty {
  opacity: 0;
  transform: translate(-50%, 2px);
  pointer-events: none;
}

/* ==========================
   Ana – Accepted suggestion
========================== */

#view-ana .list-item.accepted {
  border-color: color-mix(in oklab, var(--accent) 55%, var(--border));
  background: rgb(var(--accent-rgb) / 0.08);
  box-shadow: 0 0 8px rgb(var(--accent-rgb) / 0.35);
}

/* ==========================
   Right: interaction
========================== */
.ana-interaction {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Output card on the right */
#view-ana .ana-output {
  flex: 0 0 220px;      /* fixed slot in the grid */
  height: 220px;        /* stable height = no jump */
  max-height: 220px;
  min-height: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 75%, #000);
  background: rgba(3, 4, 6, 0.88);
  overflow-y: auto;     /* scroll suggestions inside */
  overscroll-behavior: contain;
  scroll-padding-top: 12px;
}

/* Toolbar stack under output */
.ana-toolbar-inline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ana-toolbar-inline .tool-chat {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ana-toolbar-inline #ana-input {
  flex: 1 1 auto;
}
.ana-toolbar-inline .tool-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ana-toolbar-inline .tool-buttons .btn {
  flex: 1 1 auto;
}

/* ==========================
   Responsive tweaks
========================== */
@media (max-width: 720px) {
  #ana-space .ana-main-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .ana-orb-wrap {
    min-height: 180px;
    padding: 10px;
  }
  #ana-container {
    width: min(170px, 100%);
  }
  #view-ana .ana-output {
    flex: 0 0 auto;
    height: auto;
    max-height: none;
    min-height: 130px;
  }
}

/* ==========================
   Ana – Orb breathing & voice glow
   (softer white / gold tones)
========================== */
#ana-glow,
.ana-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
  mix-blend-mode: screen;
  opacity: 0.1;
  pointer-events: none;
  transition: opacity 0.8s ease, background 0.6s ease;
}

/* Keep existing states working */
#ana-orb.idle #ana-glow { opacity: 0.08; background: radial-gradient(circle, rgba(255, 255, 255, 0.10), transparent 70%); }
#ana-orb.thinking #ana-glow { opacity: 0.18; background: radial-gradient(circle, rgba(230, 240, 255, 0.25), transparent 70%); animation: anaGlowPulse 4s ease-in-out infinite; }
#ana-orb.speaking #ana-glow { opacity: 0.28; background: radial-gradient(circle, rgba(255, 240, 200, 0.35), transparent 70%); animation: anaGlowVoice 1.4s ease-in-out infinite; }

/* New class-based states */
.ana-orb--idle .ana-glow { opacity: 0.08; background: radial-gradient(circle, rgba(255, 255, 255, 0.10), transparent 70%); }
.ana-orb--thinking .ana-glow { opacity: 0.18; background: radial-gradient(circle, rgba(230, 240, 255, 0.25), transparent 70%); animation: anaGlowPulse 4s ease-in-out infinite; }
.ana-orb--speaking .ana-glow { opacity: 0.28; background: radial-gradient(circle, rgba(255, 240, 200, 0.35), transparent 70%); animation: anaGlowVoice 1.4s ease-in-out infinite; }

@keyframes anaGlowPulse {
  0%, 100% { opacity: 0.15; }
  50%      { opacity: 0.25; }
}
@keyframes anaGlowVoice {
  0%, 100% { opacity: 0.22; }
  50%      { opacity: 0.40; }
}

/* ==========================
   Ana – Response Typography
========================== */

.ana-section-title {
  font-size: 13px;
  letter-spacing: 1.4px;
  text-transform: uppercase;

  color: var(--accent);

  margin-top: 24px;
  margin-bottom: 10px;
  font-weight: 700;

  text-shadow:
    0 0 8px rgb(var(--accent-rgb) / 0.28);

  transition:
    color .45s ease,
    text-shadow .45s ease;
}

.ana-paragraph {
  line-height: 1.75;
  margin-bottom: 16px;
  letter-spacing: 0.2px;
  color: rgba(255,255,255,0.92);
  font-size: 15px;
  max-width: 68ch;
  scroll-padding-top: 12px;
}

/* ==========================
   Ana – SVG asset orb experiment
========================== */

.ana-orb-asset {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  mix-blend-mode: screen;
}

.ana-orb-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ana-orb-shell-svg {
  fill: transparent;
  stroke: rgb(var(--accent-rgb) / 0.05);
  stroke-width: 1.2;
  filter: url(#anaOrbGlow);
}

.ana-orb-ribbon {
  fill: none;
  stroke: rgb(var(--accent-rgb) / 0.55);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#anaOrbGlow);
  transform-origin: 100px 100px;
}

.ribbon-a {
  opacity: 0.85;
  animation: anaSvgRibbonA 12s ease-in-out infinite;
}

.ribbon-b {
  opacity: 0.65;
  animation: anaSvgRibbonB 16s ease-in-out infinite;
}

.ribbon-c {
  opacity: 0.42;
  animation: anaSvgRibbonC 20s ease-in-out infinite;
}

.ana-orb-core-glow {
  animation: anaSvgCoreBreath 5s ease-in-out infinite;
}

.ana-orb-core-dot {
  fill: white;
}

@keyframes anaSvgRibbonA {
  0%,100% {
    transform: rotate(-4deg) scale(1);
  }

  50% {
    transform: rotate(5deg) scale(1.03);
  }
}

@keyframes anaSvgRibbonB {
  0%,100% {
    transform: rotate(3deg) scale(0.98);
  }

  50% {
    transform: rotate(-5deg) scale(1.02);
  }
}

@keyframes anaSvgRibbonC {
  0%,100% {
    transform: rotate(-2deg) scale(0.96);
  }

  50% {
    transform: rotate(4deg) scale(1.01);
  }
}

@keyframes anaSvgCoreBreath {
  0%, 100% { opacity: 0.65; transform: scale(0.92); transform-origin: 100px 100px; }
  50% { opacity: 1; transform: scale(1.08); transform-origin: 100px 100px; }
}

