/* ---------- thinking orb ---------- */

#thinker {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.45s var(--ease), transform 0.6s var(--ease);
}
#thinker.on { opacity: 1; transform: none; }
/* Over an open app: a veil on the app's own area (not the dock, title or rail) that fades it and blocks its input. */
#thinker.over {
  z-index: 8;
  pointer-events: auto;
  cursor: progress;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  backdrop-filter: blur(3px) saturate(0.8);
  -webkit-backdrop-filter: blur(3px) saturate(0.8);
  transition: opacity 0.45s var(--ease), transform 0.6s var(--ease), background 0.45s var(--ease);
}
#thinker.over:not(.on) { pointer-events: none; }#thinker:not(.on) * { animation-play-state: paused; }

/* A one-line reply while the turn still works: a bubble over the orb (and the veil), closed after a while. */
#remark {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 9;
  max-width: min(520px, calc(100% - 32px));
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  color: #1d1d1b;
  line-height: 1.45;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, calc(-50% + 10px)) scale(0.96);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease), visibility 0s linear 0.5s;
}
#remark.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease), visibility 0s;
}
@media (prefers-reduced-motion: reduce) {
  #remark, #remark.show { transform: translate(-50%, -50%); }
}

/* After a long wait behind the veil: a quiet offer to lift it while the work goes on (layout.js `syncPeek`). */
#peek {
  position: absolute;
  left: 50%;
  bottom: 32px;
  z-index: 9;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100% - 32px);
  padding: 10px 20px 10px 16px;
  border: 1px solid color-mix(in srgb, var(--fg) 8%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  box-shadow: 0 6px 24px color-mix(in srgb, var(--fg) 8%, transparent);
  color: color-mix(in srgb, var(--fg) 72%, transparent);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), color 0.25s, background 0.25s, box-shadow 0.25s;
}
#peek.show { opacity: 1; transform: translate(-50%, 0); }
#peek:not(.show) { pointer-events: none; }
#peek:hover, #peek:focus-visible {
  color: var(--fg);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 8px 30px color-mix(in srgb, var(--fg) 12%, transparent);
}
#peek:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
#peek svg {
  flex: none;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}
@media (prefers-reduced-motion: reduce) {
  #peek, #peek.show { transform: translate(-50%, 0); }
}

#fire { width: min(440px, 70vmin); height: min(440px, 70vmin); }

@keyframes spin { to { transform: rotate(1turn); } }
