:root {
  --void: #07080a;
  --ink: #d8dedf;
  --muted: #7e898b;
  --line: rgba(216, 222, 223, 0.18);
  --glass: rgba(13, 16, 18, 0.58);
  --aura: #d8dedf;
  --warm: #f4f8f8;
  --signal: #d7c9a1;
  --cyan: #9ed8d0;
  --danger: #b8c0c2;
  color-scheme: dark;
  font-family:
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--void);
  color: var(--ink);
}

body {
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  appearance: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stage {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 68% 66%, rgba(216, 222, 223, 0.045), transparent 18rem),
    radial-gradient(circle at 50% 52%, rgba(244, 248, 248, 0.075), transparent 34rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 42%),
    var(--void);
}

.stage::before {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 52%, black, transparent 68%);
  opacity: 0.18;
}

.stage::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(7, 8, 10, 0.82), transparent 28%, transparent 72%, rgba(7, 8, 10, 0.82)),
    linear-gradient(180deg, rgba(7, 8, 10, 0.72), transparent 22%, transparent 74%, rgba(7, 8, 10, 0.82));
}

#particleCanvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1200ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
}

.is-entered #particleCanvas {
  opacity: 1;
}

.is-memory-workspace #particleCanvas,
.is-child-memory-workspace #particleCanvas {
  opacity: 0;
}

.is-child-memory-workspace .memory-dock {
  opacity: 0;
  pointer-events: none;
}

.loader {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 9;
  display: flex;
  width: min(460px, 64vw);
  height: 1px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
  transform: translate3d(-50%, -50%, 0);
  transition:
    opacity 900ms cubic-bezier(0.19, 0.91, 0.36, 0.99),
    visibility 900ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
}

.loader-wrap {
  position: relative;
  z-index: 2;
  min-width: 150px;
  padding: 0 28px;
  text-align: center;
  background: linear-gradient(90deg, transparent, var(--void) 28%, var(--void) 72%, transparent);
}

.loading-word,
.enter-button {
  display: block;
  width: 100%;
  border: 0;
  color: rgba(216, 222, 223, 0.4);
  font-size: 11px;
  letter-spacing: 0.28em;
  line-height: 1;
  background: transparent;
}

.enter-button {
  position: absolute;
  top: 50%;
  left: 50%;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.36),
    0 0 22px rgba(216, 222, 223, 0.24);
  transform: translate3d(-50%, -50%, 0);
  transition:
    opacity 480ms cubic-bezier(0.19, 0.91, 0.36, 0.99),
    color 220ms ease,
    text-shadow 220ms ease;
}

.enter-button:hover,
.enter-button:focus-visible {
  color: #fff;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.74),
    0 0 24px rgba(255, 255, 255, 0.36),
    0 0 48px rgba(255, 255, 255, 0.18);
}

.enter-button:focus-visible {
  outline: 1px solid rgba(216, 222, 223, 0.82);
  outline-offset: 8px;
}

.is-ready .loading-word {
  opacity: 0;
}

.is-ready .enter-button {
  opacity: 1;
  pointer-events: auto;
}

.is-entered .loader {
  visibility: hidden;
  opacity: 0;
}

.loader-line {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 222, 223, 0.76) 42%, rgba(216, 222, 223, 0.76) 58%, transparent);
  opacity: 0.32;
  transform: translate3d(-50%, -50%, 0) scaleX(0);
  transform-origin: center;
  animation: loaderLine 1500ms cubic-bezier(0.19, 0.91, 0.36, 0.99) forwards;
}

.is-ready .loader-line {
  transform: translate3d(-50%, -50%, 0) scaleX(1);
}

.scroll-cue {
  position: fixed;
  top: 42%;
  left: 50%;
  z-index: 3;
  width: min(780px, calc(100vw - 32px));
  color: rgba(244, 248, 248, 0.82);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(17px, 3.25vw, 42px);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
  text-shadow:
    0 1px 10px rgba(0, 0, 0, 0.86),
    0 0 18px rgba(7, 8, 10, 0.72),
    0 0 26px rgba(255, 255, 255, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-50%, 20px, 0);
  transition:
    opacity 900ms cubic-bezier(0.19, 0.91, 0.36, 0.99),
    transform 900ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
}

.is-entered .scroll-cue {
  opacity: var(--cue-opacity, 1);
  transform: translate3d(-50%, var(--cue-y, 0), 0) scale(var(--cue-scale, 1));
}

.is-user-shaping .scroll-cue {
  visibility: hidden;
  opacity: 0;
}

.scroll-cue span {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.narrative-scroller {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: auto;
  scrollbar-width: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 900ms ease;
}

.narrative-scroller::-webkit-scrollbar {
  display: none;
}

.is-entered .narrative-scroller {
  opacity: 1;
  pointer-events: auto;
}

.steps {
  min-height: 2400vh;
}

.step {
  min-height: 100vh;
}

.topbar,
.agent-axis,
.agent-create-view,
.dialogue-overlay,
.memory-workspace,
.child-agent-dialogue-overlay,
.memory-dock,
.camera-permission-button,
.camera-preview {
  position: absolute;
  z-index: 3;
}

.topbar {
  top: 26px;
  left: 26px;
  right: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, -110%, 0);
  transition:
    opacity 900ms cubic-bezier(0.19, 0.91, 0.36, 0.99),
    transform 900ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
}

.is-entered .topbar {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.brand-lockup {
  display: flex;
  width: clamp(114px, 18vw, 164px);
  flex-direction: column;
  align-items: flex-start;
}

.kicker {
  width: 100%;
  margin: 0;
  color: rgba(218, 223, 223, 0.88);
  font-family: "Arial Narrow", "HelveticaNeue-CondensedBold", "Roboto Condensed", "DIN Condensed", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(19px, 3vw, 29px);
  font-stretch: condensed;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1 {
  width: 100%;
  margin: 5px 0 0;
  color: rgba(199, 207, 207, 0.76);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Heiti SC", Arial, sans-serif;
  font-size: clamp(21px, 3.4vw, 31px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: 0;
}

.state-label {
  display: none;
}

.agent-axis {
  left: 50%;
  bottom: 26px;
  display: grid;
  width: min(640px, calc(100vw - 44px));
  grid-template-columns: 28px minmax(74px, 1fr) 28px minmax(74px, 1fr) 28px;
  gap: 16px;
  align-items: center;
  justify-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-50%, 34px, 0);
  transition:
    opacity 900ms cubic-bezier(0.19, 0.91, 0.36, 0.99),
    transform 900ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
}

.is-entered .agent-axis {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
  pointer-events: auto;
}

.is-creating-agent .agent-axis {
  opacity: 0.16;
  pointer-events: none;
}

.axis-thread {
  position: relative;
  width: 100%;
  height: 18px;
  opacity: 0.84;
}

.axis-thread::before {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(244, 248, 248, 0.82), transparent);
  filter:
    drop-shadow(0 0 4px rgba(255, 255, 255, 0.42))
    drop-shadow(0 0 13px rgba(216, 222, 223, 0.16));
}

.axis-thread-left::before {
  transform: rotate(3deg);
  transform-origin: right center;
}

.axis-thread-right::before {
  transform: rotate(-3deg);
  transform-origin: left center;
}

.axis-add-button,
.axis-current-button {
  position: relative;
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.axis-add-button {
  font-size: 12px;
  transform: translateY(-10px);
}

.axis-add-button span,
.axis-add-button::before {
  position: absolute;
  width: 14px;
  height: 1.5px;
  border-radius: 999px;
  content: "";
  background: rgba(244, 248, 248, 0.78);
  box-shadow:
    0 0 5px rgba(255, 255, 255, 0.38),
    0 0 16px rgba(216, 222, 223, 0.14);
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.axis-add-button::before {
  transform: rotate(90deg);
}

.axis-add-button::after {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  content: "";
  background: rgba(244, 248, 248, 0.62);
  box-shadow:
    0 0 6px rgba(255, 255, 255, 0.24),
    0 0 18px rgba(216, 222, 223, 0.12);
  opacity: 0;
  transform: scale(0.72);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.axis-add-button.is-agent-slot span,
.axis-add-button.is-agent-slot::before {
  opacity: 0;
  transform: scale(0.36);
}

.axis-add-button.is-agent-slot::after {
  opacity: 0.62;
  transform: scale(1);
}

.axis-add-button.is-agent-slot:hover::after,
.axis-add-button.is-agent-slot:focus-visible::after {
  opacity: 0.86;
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.38),
    0 0 22px rgba(216, 222, 223, 0.18);
}

.axis-add-button:hover span,
.axis-add-button:hover::before,
.axis-add-button:focus-visible span,
.axis-add-button:focus-visible::before {
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 0 7px rgba(255, 255, 255, 0.48),
    0 0 20px rgba(216, 222, 223, 0.18);
}

.axis-add-button:focus-visible,
.axis-current-button:focus-visible {
  outline: 1px solid rgba(244, 248, 248, 0.62);
  outline-offset: 8px;
}

.axis-current-button {
  width: 28px;
  height: 28px;
  cursor: pointer;
  overflow: visible;
}

.axis-current-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 9px rgba(255, 255, 255, 0.8),
    0 0 24px rgba(216, 222, 223, 0.38),
    0 0 52px rgba(216, 222, 223, 0.14);
}

.axis-current-button.is-branch .axis-current-dot {
  width: 9px;
  height: 9px;
  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.82),
    0 0 24px rgba(216, 222, 223, 0.38),
    0 0 48px rgba(216, 222, 223, 0.16);
}

.agent-create-view {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  padding: 24px;
  place-items: center;
  background:
    radial-gradient(circle at 50% 78%, rgba(216, 222, 223, 0.08), transparent 18rem),
    linear-gradient(180deg, rgba(7, 8, 10, 0.62), rgba(7, 8, 10, 0.94));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 20px, 0);
  transition:
    opacity 420ms ease,
    visibility 420ms ease,
    transform 420ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
}

.agent-create-view.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

.agent-create-shell {
  position: relative;
  width: min(620px, calc(100vw - 36px));
  padding: 28px;
  border: 1px solid rgba(216, 222, 223, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(13, 16, 18, 0.74), rgba(7, 8, 10, 0.64)),
    rgba(7, 8, 10, 0.72);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.48),
    inset 0 0 42px rgba(216, 222, 223, 0.035);
  backdrop-filter: blur(18px);
}

.create-close-button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(216, 222, 223, 0.22);
  border-radius: 50%;
  background: rgba(216, 222, 223, 0.04);
  cursor: pointer;
}

.create-close-button::before,
.create-close-button::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 1px;
  content: "";
  background: rgba(244, 248, 248, 0.72);
}

.create-close-button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.create-close-button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.create-close-button:hover,
.create-close-button:focus-visible {
  border-color: rgba(244, 248, 248, 0.56);
  background: rgba(216, 222, 223, 0.1);
}

.create-kicker {
  margin: 0 0 12px;
  color: rgba(216, 222, 223, 0.46);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.agent-create-shell h2 {
  margin: 0 0 22px;
  color: rgba(244, 248, 248, 0.92);
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 500;
  line-height: 1.08;
}

.create-grid {
  display: grid;
  gap: 14px;
}

.create-field {
  display: grid;
  gap: 8px;
}

.create-field span {
  color: rgba(216, 222, 223, 0.56);
  font-size: 12px;
}

.create-field input,
.create-field textarea {
  width: 100%;
  border: 1px solid rgba(216, 222, 223, 0.18);
  border-radius: 8px;
  color: rgba(244, 248, 248, 0.88);
  background: rgba(7, 8, 10, 0.42);
  outline: 0;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.create-field input {
  height: 42px;
  padding: 0 12px;
}

.create-field textarea {
  min-height: 108px;
  padding: 12px;
  resize: vertical;
}

.create-field input:focus,
.create-field textarea:focus {
  border-color: rgba(244, 248, 248, 0.52);
  background: rgba(7, 8, 10, 0.62);
  box-shadow: 0 0 0 3px rgba(216, 222, 223, 0.06);
}

.create-field input::placeholder,
.create-field textarea::placeholder {
  color: rgba(216, 222, 223, 0.34);
}

.create-source-row {
  display: flex;
  margin-top: 18px;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.agent-gallery {
  display: grid;
  margin-top: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.agent-route {
  min-height: 58px;
  border: 1px solid rgba(216, 222, 223, 0.16);
  border-radius: 8px;
  color: rgba(216, 222, 223, 0.72);
  background:
    radial-gradient(circle at 50% 18%, rgba(244, 248, 248, 0.08), transparent 3.8rem),
    rgba(216, 222, 223, 0.035);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    color 180ms ease,
    background-color 180ms ease,
    transform 180ms ease;
}

.agent-route span {
  font-size: 13px;
}

.agent-route:hover,
.agent-route:focus-visible,
.agent-route.is-selected {
  border-color: rgba(244, 248, 248, 0.48);
  color: #fff;
  background-color: rgba(216, 222, 223, 0.08);
  transform: translateY(-1px);
}

.agent-model-preview {
  position: relative;
  height: 0;
  margin-top: 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 52% 48%, rgba(61, 172, 215, 0.14), transparent 54%),
    linear-gradient(180deg, rgba(11, 16, 19, 0.82), rgba(5, 7, 9, 0.94));
  box-shadow: inset 0 0 36px rgba(244, 248, 248, 0.035);
  opacity: 0;
  pointer-events: none;
  transition:
    height 220ms ease,
    margin-top 220ms ease,
    border-color 220ms ease,
    opacity 220ms ease;
}

.agent-model-preview.is-visible {
  height: 108px;
  margin-top: 14px;
  border-color: rgba(158, 216, 208, 0.18);
  opacity: 1;
}

.agent-model-preview::before,
.agent-model-preview::after {
  position: absolute;
  inset: 18px 40px;
  border-radius: 999px;
  content: "";
  background: radial-gradient(ellipse at center, rgba(244, 248, 248, 0.12), transparent 66%);
  filter: blur(12px);
  opacity: 0.42;
}

.agent-model-preview::after {
  inset: 34px 64px 22px;
  background: radial-gradient(ellipse at center, rgba(45, 158, 221, 0.22), transparent 68%);
  filter: blur(18px);
  opacity: 0.5;
}

.word-preview-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.95;
  pointer-events: none;
}

.agent-hint {
  min-height: 42px;
  margin: 16px 0 18px;
  color: rgba(216, 222, 223, 0.58);
  font-size: 13px;
  line-height: 1.6;
}

.create-agent-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(244, 248, 248, 0.36);
  border-radius: 999px;
  color: rgba(7, 8, 10, 0.92);
  background: rgba(244, 248, 248, 0.86);
  cursor: pointer;
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.create-agent-button:hover,
.create-agent-button:focus-visible {
  background: #fff;
  box-shadow: 0 0 24px rgba(244, 248, 248, 0.2);
  transform: translateY(-1px);
}

.file-button,
.ghost-button,
.memory-toggle {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(216, 222, 223, 0.08);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    transform 180ms ease;
}

.file-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ghost-button {
  padding: 0 18px;
}

.file-button:hover,
.ghost-button:hover,
.memory-toggle:hover {
  border-color: rgba(244, 248, 248, 0.62);
  background: rgba(216, 222, 223, 0.14);
  transform: translateY(-1px);
}

.file-button:focus-within,
.ghost-button:focus-visible,
.memory-toggle:focus-visible {
  outline: 2px solid rgba(244, 248, 248, 0.62);
  outline-offset: 3px;
}

.dialogue-overlay {
  top: 31%;
  right: 8%;
  display: grid;
  width: min(520px, 42vw);
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(18px, 8px, 0);
  transition:
    opacity 420ms ease,
    transform 420ms ease;
}

.dialogue-overlay.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.dialogue-mode {
  margin: 0;
  color: rgba(216, 222, 223, 0.5);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dialogue-text {
  margin: 0;
  color: rgba(244, 248, 248, 0.78);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(22px, 2.5vw, 36px);
  line-height: 1.35;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.2),
    0 0 28px rgba(255, 255, 255, 0.18),
    0 0 54px rgba(216, 222, 223, 0.1);
  filter: blur(0.25px);
}

.camera-permission-button {
  top: 28px;
  left: 50%;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(216, 222, 223, 0.22);
  border-radius: 50%;
  background: rgba(7, 8, 10, 0.18);
  cursor: pointer;
  opacity: 0;
  transform: translate3d(-50%, -16px, 0);
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    opacity 900ms cubic-bezier(0.19, 0.91, 0.36, 0.99),
    transform 900ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
}

.camera-permission-button::before {
  width: 16px;
  height: 12px;
  border: 1px solid rgba(244, 248, 248, 0.72);
  border-radius: 4px;
  content: "";
}

.camera-permission-button::after {
  position: absolute;
  width: 5px;
  height: 5px;
  border: 1px solid rgba(244, 248, 248, 0.72);
  border-radius: 50%;
  content: "";
}

.camera-permission-button:hover,
.camera-permission-button.is-active,
.camera-permission-button.is-requesting {
  border-color: rgba(244, 248, 248, 0.58);
  background: rgba(216, 222, 223, 0.12);
}

.camera-permission-button.is-requesting {
  opacity: 0.72;
  box-shadow: 0 0 18px rgba(216, 222, 223, 0.14);
}

.camera-permission-button.is-active {
  opacity: 1;
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.18),
    0 0 28px rgba(216, 222, 223, 0.12);
}

.camera-permission-button.is-failed {
  border-color: rgba(216, 222, 223, 0.18);
  opacity: 0.42;
}

.camera-permission-button:focus-visible {
  outline: 2px solid rgba(244, 248, 248, 0.62);
  outline-offset: 3px;
}

.is-entered .camera-permission-button {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

.gesture-cursor {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1000;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(244, 248, 248, 0.78);
  background:
    radial-gradient(circle, rgba(244, 248, 248, 0.12) 0 28%, rgba(244, 248, 248, 0.02) 62%, transparent 64%),
    rgba(7, 8, 10, 0.08);
  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.2),
    0 0 24px rgba(216, 222, 223, 0.12);
  opacity: 0.85;
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0) scale(1);
  visibility: hidden;
  transition:
    opacity 180ms ease,
    transform 120ms ease,
    box-shadow 160ms ease;
}

.gesture-cursor.is-visible {
  opacity: 0.85;
  visibility: visible;
}

.gesture-cursor.is-pinching {
  transform: translate3d(-50%, -50%, 0) scale(0.82);
  border-color: rgba(244, 248, 248, 0.94);
  background:
    radial-gradient(circle, rgba(244, 248, 248, 0.28) 0 26%, rgba(244, 248, 248, 0.05) 62%, transparent 64%),
    rgba(7, 8, 10, 0.12);
  box-shadow:
    0 0 12px rgba(255, 255, 255, 0.36),
    0 0 32px rgba(216, 222, 223, 0.2);
}

.gesture-cursor.is-lost {
  opacity: 0.24;
  transform: translate3d(-50%, -50%, 0) scale(0.88);
  visibility: visible;
}

.gesture-selected {
  outline: 1px solid rgba(244, 248, 248, 0.56);
  outline-offset: 8px;
}

.camera-preview {
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  object-fit: cover;
  border: 0;
  border-radius: 0;
  opacity: 0;
  pointer-events: none;
  transform: scaleX(-1);
  transition: opacity 180ms ease;
}

.camera-preview.is-visible {
  opacity: 0;
}

.memory-dock {
  top: 88px;
  right: 24px;
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  opacity: 0;
  transform: translate3d(0, -24px, 0);
  transition:
    opacity 900ms cubic-bezier(0.19, 0.91, 0.36, 0.99),
    transform 900ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
}

.is-entered .memory-dock {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.is-memory-workspace .memory-dock,
.is-memory-workspace .agent-axis,
.is-memory-workspace .scroll-cue,
.is-memory-workspace .camera-permission-button {
  opacity: 0;
  pointer-events: none;
}

.is-child-memory-workspace .child-agent-dialogue-overlay,
.is-child-memory-workspace .agent-axis,
.is-child-memory-workspace .scroll-cue,
.is-child-memory-workspace .camera-permission-button {
  opacity: 0;
  pointer-events: none;
}

.memory-toggle {
  position: relative;
  display: grid;
  width: 62px;
  min-width: 62px;
  height: 62px;
  min-height: 62px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(244, 248, 248, 0.24);
  border-radius: 50%;
  color: rgba(244, 248, 248, 0.86);
  font-size: 13px;
  letter-spacing: 0;
  animation: memoryTextBreath 1s ease-in-out infinite alternate;
  background:
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.22), transparent 0.82rem),
    radial-gradient(circle at 54% 58%, rgba(216, 222, 223, 0.06), transparent 1.7rem),
    rgba(216, 222, 223, 0.035);
  box-shadow:
    inset 0 0 18px rgba(255, 255, 255, 0.045),
    0 0 18px rgba(216, 222, 223, 0.08);
  backdrop-filter: blur(14px);
}

.memory-toggle::before,
.memory-toggle::after {
  position: absolute;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.memory-toggle::before {
  inset: 8px;
  border: 1px solid rgba(244, 248, 248, 0.07);
}

.memory-toggle::after {
  top: 13px;
  left: 15px;
  width: 12px;
  height: 5px;
  background: rgba(255, 255, 255, 0.22);
  filter: blur(1px);
  transform: rotate(-24deg);
}

.memory-dock.is-previewing .memory-toggle {
  border-color: rgba(244, 248, 248, 0.42);
  box-shadow:
    inset 0 0 22px rgba(255, 255, 255, 0.06),
    0 0 22px rgba(216, 222, 223, 0.14);
}

.memory-dock.is-child-memory-open {
  z-index: 5;
  opacity: 0.14;
  pointer-events: none;
}

.is-child-memory-workspace .memory-dock.is-child-memory-open {
  opacity: 0;
}

.memory-dock.is-child-memory-open .memory-toggle {
  border-color: rgba(244, 248, 248, 0.5);
  box-shadow:
    inset 0 0 26px rgba(255, 255, 255, 0.08),
    0 0 24px rgba(244, 248, 248, 0.16),
    0 0 52px rgba(158, 216, 208, 0.14);
  transform: scale(1.04);
}

.memory-panel {
  display: none;
  max-height: 0;
  margin-top: 10px;
  padding: 0 14px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(216, 222, 223, 0.76);
  background:
    radial-gradient(circle at 28% 0%, rgba(244, 248, 248, 0.1), transparent 9rem),
    rgba(7, 8, 10, 0.36);
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(-6px);
  transition:
    max-height 240ms ease,
    padding 240ms ease,
    opacity 220ms ease,
    border-color 220ms ease,
    transform 220ms ease;
}

.memory-dock.is-open .memory-panel {
  max-height: 0;
  padding: 0;
  border-color: transparent;
  opacity: 0;
  transform: translateY(-6px);
}

.memory-workspace {
  position: fixed;
  inset: 0;
  z-index: 7;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 46%, rgba(244, 248, 248, 0.06), transparent 18rem),
    radial-gradient(circle at 50% 54%, rgba(158, 216, 208, 0.05), transparent 34rem),
    linear-gradient(180deg, rgba(5, 7, 8, 0.18), rgba(5, 7, 8, 0.62));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  filter:
    drop-shadow(0 0 18px rgba(244, 248, 248, 0.08))
    drop-shadow(0 0 58px rgba(158, 216, 208, 0.08));
  transform: translate3d(0, 18px, 0) scale(0.985);
  transform-origin: 50% 52%;
  transition:
    opacity 520ms ease,
    visibility 520ms ease,
    transform 700ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
  --memory-dot-start-x: calc(100vw - 55px);
  --memory-dot-start-y: 118px;
  --memory-dot-end-x: 50vw;
  --memory-dot-end-y: 38vh;
}

.memory-workspace.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
}

.memory-workspace::before,
.memory-workspace::after {
  position: absolute;
  left: 50%;
  top: 52%;
  content: "";
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.memory-workspace::before {
  width: min(720px, 72vmin);
  height: min(720px, 72vmin);
  border: 1px solid rgba(244, 248, 248, 0.045);
  box-shadow:
    inset 0 0 58px rgba(244, 248, 248, 0.025),
    0 0 96px rgba(158, 216, 208, 0.055);
}

.memory-workspace::after {
  width: min(960px, 88vmin);
  height: min(960px, 88vmin);
  border: 1px solid rgba(158, 216, 208, 0.035);
  filter: blur(0.4px);
  opacity: 0.9;
}

.memory-workspace-back {
  position: absolute;
  top: 28px;
  right: 30px;
  z-index: 2;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  opacity: 0.72;
}

.memory-workspace-back::before,
.memory-workspace-back::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 1px;
  content: "";
  background: rgba(244, 248, 248, 0.62);
}

.memory-workspace-back::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.memory-workspace-back::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.memory-page-label {
  position: absolute;
  left: 42px;
  top: 128px;
  z-index: 2;
  display: grid;
  gap: 4px;
  color: rgba(244, 248, 248, 0.78);
  pointer-events: none;
}

.memory-page-label span {
  color: rgba(125, 220, 190, 0.58);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.memory-page-label strong {
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 400;
  letter-spacing: 0;
}

.memory-flight-dot {
  position: fixed;
  left: 0;
  top: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(244, 248, 248, 0.96);
  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.8),
    0 0 32px rgba(158, 216, 208, 0.26);
  opacity: 0;
  transform: translate3d(var(--memory-dot-start-x), var(--memory-dot-start-y), 0) scale(0.8);
}

.memory-flight-dot,
.portrait-anchor,
.support-anchor {
  display: none;
}

.memory-workspace[data-stage="dot-flight"] .memory-flight-dot {
  animation: memoryDotFlight 680ms cubic-bezier(0.19, 0.91, 0.36, 0.99) forwards;
}

.memory-workspace[data-stage="portrait-contact"] .memory-flight-dot,
.memory-workspace[data-stage="terrain-return"] .memory-flight-dot,
.memory-workspace[data-stage="memory-network"] .memory-flight-dot {
  opacity: 0;
  transform: translate3d(var(--memory-dot-end-x), var(--memory-dot-end-y), 0) scale(2.4);
}

.portrait-anchor {
  position: absolute;
  left: 50%;
  top: 38%;
  width: min(190px, 34vw);
  aspect-ratio: 0.72;
  border-radius: 48% 48% 44% 44%;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0) scale(0.94);
  transition:
    opacity 380ms ease,
    transform 520ms cubic-bezier(0.19, 0.91, 0.36, 0.99),
    filter 320ms ease;
}

.portrait-anchor::before,
.portrait-anchor::after,
.portrait-anchor span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  content: "";
}

.portrait-anchor::before {
  border: 1px solid rgba(244, 248, 248, 0.15);
  box-shadow:
    inset 0 0 38px rgba(244, 248, 248, 0.035),
    0 0 42px rgba(158, 216, 208, 0.08);
}

.portrait-anchor::after {
  inset: 17% 28% 12%;
  border-left: 1px solid rgba(244, 248, 248, 0.1);
  border-right: 1px solid rgba(244, 248, 248, 0.08);
  filter: blur(0.4px);
}

.portrait-anchor span {
  inset: 42% 18% 16%;
  border-top: 1px solid rgba(244, 248, 248, 0.08);
  filter: blur(0.6px);
}

.memory-workspace[data-stage="dot-flight"] .portrait-anchor,
.memory-workspace[data-stage="portrait-contact"] .portrait-anchor {
  opacity: 0.72;
}

.memory-workspace[data-stage="portrait-contact"] .portrait-anchor {
  filter:
    drop-shadow(0 0 18px rgba(255, 255, 255, 0.22))
    drop-shadow(0 0 44px rgba(158, 216, 208, 0.12));
  transform: translate3d(-50%, -50%, 0) scale(1.03);
}

.memory-workspace[data-stage="terrain-return"] .portrait-anchor,
.memory-workspace[data-stage="memory-network"] .portrait-anchor {
  opacity: 0;
  transform: translate3d(-50%, 10%, 0) scale(0.74);
}

.support-anchor {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: min(280px, 46vw);
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(244, 248, 248, 0.1), transparent 68%);
  opacity: 0;
  filter: blur(5px);
  transform: translate3d(-50%, 16px, 0);
  transition:
    opacity 520ms ease,
    transform 680ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
}

.memory-workspace[data-stage="memory-network"] .support-anchor {
  opacity: 0.46;
  transform: translate3d(-50%, 0, 0);
}

.memory-network {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(650px, 68vmin);
  height: min(650px, 68vmin);
  overflow: hidden;
  border-radius: 50%;
  opacity: 0;
  pointer-events: auto;
  filter:
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.12))
    drop-shadow(0 0 42px rgba(158, 216, 208, 0.08));
  mask-image: radial-gradient(circle at 50% 52%, #000 0 68%, transparent 87%);
  transform: translate3d(-50%, -50%, 0) scale(0.86);
  transform-origin: center;
  transition:
    opacity 680ms ease,
    transform 900ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
}

.memory-workspace[data-stage="memory-network"] .memory-network {
  opacity: 1;
  transform: translate3d(-50%, -50%, 0) scale(1);
}

.memory-network::before,
.memory-network::after {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.memory-network::before {
  border: 1px solid rgba(158, 216, 208, 0.045);
  box-shadow: inset 0 0 36px rgba(158, 216, 208, 0.025);
}

.memory-network::after {
  inset: 25%;
  border: 1px solid rgba(244, 248, 248, 0.035);
  filter: blur(0.4px);
}

.memory-link {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--length);
  height: 1px;
  background: linear-gradient(90deg, rgba(244, 248, 248, 0.04), rgba(158, 216, 208, 0.42), rgba(244, 248, 248, 0.08));
  filter:
    drop-shadow(0 0 7px rgba(158, 216, 208, 0.22))
    drop-shadow(0 0 16px rgba(244, 248, 248, 0.08));
  opacity: var(--link-alpha);
  transform: rotate(var(--angle));
  transform-origin: 0 50%;
  transition: opacity 900ms ease var(--link-delay);
}

.memory-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: block;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: rgba(158, 216, 208, 0.42);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0;
  line-height: 1;
  text-indent: 14px;
  white-space: nowrap;
  background: rgba(244, 248, 248, 0.84);
  box-shadow:
    0 0 calc(14px * var(--strength)) rgba(255, 255, 255, 0.82),
    0 0 calc(38px * var(--strength)) rgba(255, 255, 255, 0.25),
    0 0 calc(86px * var(--strength)) rgba(158, 216, 208, 0.22);
  cursor: pointer;
  opacity: var(--node-opacity);
  filter: blur(0.08px);
  transform: translate(-50%, -50%);
  animation: mainMemoryNodeFloat 4200ms ease-in-out infinite alternate;
  animation-delay: var(--node-delay);
  transition:
    color 260ms ease,
    opacity 420ms ease,
    filter 520ms ease,
    box-shadow 520ms ease,
    transform 820ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
}

.memory-node::before {
  display: none;
}

.memory-node:hover,
.memory-node:focus-visible {
  color: rgba(244, 248, 248, 0.78);
  outline: 0;
  box-shadow:
    0 0 18px rgba(255, 255, 255, 0.9),
    0 0 52px rgba(255, 255, 255, 0.3),
    0 0 104px rgba(158, 216, 208, 0.26);
}

.memory-workspace.is-main-memory-chat-active .memory-network {
  opacity: 0.26;
  filter:
    blur(1.3px)
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.08))
    drop-shadow(0 0 34px rgba(158, 216, 208, 0.06));
  transform: translate3d(-50%, -53%, 0) scale(0.92);
}

.memory-workspace.is-main-memory-chat-active .memory-link {
  opacity: calc(var(--link-alpha) * 0.42);
}

.memory-workspace.is-main-memory-chat-active .memory-node {
  opacity: calc(var(--node-opacity) * 0.46);
}

.memory-workspace.is-main-memory-point-selected .memory-link {
  opacity: calc(var(--link-alpha) * 0.24);
}

.memory-workspace.is-main-memory-point-selected .memory-node:not(.is-selected) {
  color: rgba(158, 216, 208, 0.26);
  opacity: calc(var(--node-opacity) * 0.28);
  filter: blur(0.55px);
}

.memory-workspace.is-main-memory-point-selected .memory-node.is-selected {
  z-index: 6;
  color: rgba(244, 248, 248, 0.9);
  opacity: 1;
  filter:
    blur(0.02px)
    drop-shadow(0 0 18px rgba(255, 255, 255, 0.28));
  transform:
    translate(-50%, -50%)
    translate(var(--selected-translate-x, 0px), var(--selected-translate-y, 0px))
    scale(1.42)
    rotate(-6deg);
  animation: mainMemorySelectedTwist 1600ms cubic-bezier(0.19, 0.91, 0.36, 0.99) both;
}

.memory-workspace.is-main-memory-point-selected.is-main-memory-chat-active .memory-node.is-selected {
  opacity: 1;
}

.main-memory-detail {
  position: absolute;
  left: 50%;
  top: min(62vh, calc(50% + 118px));
  z-index: 5;
  display: grid;
  width: min(620px, calc(100vw - 48px));
  gap: 10px;
  pointer-events: none;
  opacity: 0;
  filter: blur(0.18px);
  transform: translate3d(-50%, 22px, 0) scale(0.97);
  transition:
    opacity 520ms ease,
    transform 760ms cubic-bezier(0.19, 0.91, 0.36, 0.99),
    filter 520ms ease;
}

.memory-workspace.is-main-memory-point-selected .main-memory-detail {
  opacity: 1;
  filter: blur(0);
  transform: translate3d(-50%, 0, 0) scale(1);
}

.main-memory-detail-title,
.main-memory-detail-summary,
.main-memory-detail-line {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.18),
    0 0 30px rgba(158, 216, 208, 0.12);
}

.main-memory-detail-title {
  justify-self: center;
  color: rgba(244, 248, 248, 0.88);
  font-size: clamp(15px, 1.45vw, 22px);
  line-height: 1.2;
}

.main-memory-detail-summary {
  justify-self: center;
  max-width: 56ch;
  color: rgba(158, 216, 208, 0.68);
  font-size: clamp(12px, 1vw, 15px);
  line-height: 1.55;
  text-align: center;
}

.main-memory-detail-transcript {
  display: grid;
  max-width: min(58ch, 100%);
  gap: 7px;
  justify-self: center;
}

.main-memory-detail-line {
  color: rgba(244, 248, 248, 0.56);
  font-size: clamp(11px, 0.92vw, 13px);
  line-height: 1.45;
  text-align: center;
}

.main-memory-detail-line.is-user {
  color: rgba(125, 220, 190, 0.68);
}

.main-memory-chat-layer {
  position: absolute;
  left: 50%;
  bottom: clamp(44px, 8vh, 78px);
  z-index: 4;
  display: grid;
  width: min(560px, calc(100vw - 44px));
  gap: 18px;
  pointer-events: none;
  transform: translateX(-50%);
  transition:
    bottom 520ms ease,
    width 620ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
}

.main-memory-chat-layer.is-memory-detail-mode {
  bottom: clamp(26px, 5vh, 54px);
  width: min(720px, calc(100vw - 48px));
}

.main-memory-records {
  display: grid;
  min-height: 0;
  max-height: min(190px, 28vh);
  gap: 10px;
  align-content: end;
  overflow: hidden;
  pointer-events: none;
  transition: max-height 520ms ease;
}

.main-memory-chat-layer.is-memory-detail-mode .main-memory-records {
  max-height: min(260px, 30vh);
}

.main-memory-record {
  max-width: min(58ch, 100%);
  margin: 0;
  color: rgba(244, 248, 248, 0.68);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(12px, 1vw, 15px);
  line-height: 1.48;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.18),
    0 0 28px rgba(158, 216, 208, 0.1);
  filter: blur(0.12px);
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  animation: childRecordIn 680ms cubic-bezier(0.19, 0.91, 0.36, 0.99) forwards;
}

.main-memory-record.is-user {
  justify-self: end;
  max-width: min(46ch, 86%);
  color: rgba(125, 220, 190, 0.8);
  text-align: right;
}

.main-memory-record.is-agent,
.main-memory-record.is-evo {
  justify-self: start;
  color: rgba(244, 248, 248, 0.78);
}

.main-memory-record.is-system {
  justify-self: center;
  color: rgba(158, 216, 208, 0.5);
  font-size: clamp(11px, 0.9vw, 13px);
}

.main-memory-record.is-memory {
  color: rgba(244, 248, 248, 0.52);
}

.main-memory-composer {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 52px;
  grid-template-columns: minmax(0, 1fr) 34px 30px;
  gap: 14px;
  align-items: end;
  pointer-events: auto;
  transition:
    min-height 540ms cubic-bezier(0.19, 0.91, 0.36, 0.99),
    filter 360ms ease;
}

.main-memory-chat-layer.is-memory-detail-mode .main-memory-composer {
  min-height: 126px;
}

.main-memory-composer::before {
  position: absolute;
  left: -24px;
  right: -18px;
  bottom: 0;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(125, 220, 190, 0.38), rgba(244, 248, 248, 0.16), transparent);
  filter: drop-shadow(0 0 10px rgba(125, 220, 190, 0.2));
  transition:
    height 540ms cubic-bezier(0.19, 0.91, 0.36, 0.99),
    opacity 360ms ease,
    background 360ms ease,
    box-shadow 360ms ease;
}

.main-memory-chat-layer.is-memory-detail-mode .main-memory-composer::before {
  height: 100%;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 50% 92%, rgba(125, 220, 190, 0.08), transparent 70%),
    linear-gradient(90deg, transparent, rgba(125, 220, 190, 0.16), rgba(244, 248, 248, 0.08), transparent);
  box-shadow:
    inset 0 0 0 1px rgba(244, 248, 248, 0.06),
    0 0 32px rgba(125, 220, 190, 0.06);
}

.main-memory-composer-field {
  position: relative;
  display: block;
  min-width: 0;
  align-self: stretch;
}

.main-memory-composer-field::after {
  position: absolute;
  right: 2px;
  top: 50%;
  width: 1px;
  height: 18px;
  content: "";
  background: rgba(125, 220, 190, 0.74);
  box-shadow: 0 0 12px rgba(125, 220, 190, 0.42);
  opacity: 0;
  transform: translateY(-50%);
  animation: childCaretBlink 980ms steps(2, end) infinite;
}

.main-memory-composer-input {
  width: 100%;
  height: 44px;
  min-height: 44px;
  max-height: 118px;
  padding: 9px 12px 8px 0;
  border: 0;
  color: rgba(125, 220, 190, 0.88);
  caret-color: rgba(125, 220, 190, 0.96);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(12px, 1vw, 15px);
  line-height: 1.42;
  text-shadow:
    0 0 8px rgba(125, 220, 190, 0.28),
    0 0 24px rgba(125, 220, 190, 0.12);
  background: transparent;
  outline: 0;
  overflow-y: auto;
  resize: none;
  transition:
    height 540ms cubic-bezier(0.19, 0.91, 0.36, 0.99),
    padding 360ms ease,
    color 220ms ease;
}

.main-memory-chat-layer.is-memory-detail-mode .main-memory-composer-input {
  height: 102px;
  padding: 14px 14px 14px 18px;
}

.main-memory-composer-input::placeholder {
  color: rgba(125, 220, 190, 0.28);
}

.main-memory-voice-interface {
  position: absolute;
  left: 0;
  right: 72px;
  top: 50%;
  display: grid;
  height: 34px;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
}

.main-memory-chat-layer.is-memory-detail-mode .main-memory-voice-interface {
  left: 18px;
  right: 90px;
}

.main-memory-voice-interface span {
  justify-self: center;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.68),
    0 0 24px rgba(158, 216, 208, 0.18);
  filter: blur(0.12px);
  transition:
    height 260ms cubic-bezier(0.19, 0.91, 0.36, 0.99),
    opacity 220ms ease,
    transform 260ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
}

.main-memory-chat-layer.is-voice-mode .main-memory-composer-input,
.main-memory-chat-layer.is-voice-mode .main-memory-composer-field::after,
.main-memory-chat-layer.is-voice-mode .main-memory-composer-submit {
  opacity: 0;
  pointer-events: none;
}

.main-memory-chat-layer.is-voice-mode .main-memory-voice-interface {
  opacity: 1;
}

.main-memory-voice-interface[data-phase="active"] span {
  animation: childVoicePulse 780ms ease-in-out infinite alternate;
}

.main-memory-voice-interface[data-phase="active"] span:nth-child(1) {
  height: 24px;
}

.main-memory-voice-interface[data-phase="active"] span:nth-child(2) {
  height: 34px;
  animation-delay: -160ms;
}

.main-memory-voice-interface[data-phase="active"] span:nth-child(3) {
  height: 18px;
  animation-delay: -80ms;
}

.main-memory-voice-interface[data-phase="active"] span:nth-child(4) {
  height: 30px;
  animation-delay: -260ms;
}

.main-memory-voice-interface[data-phase="active"] span:nth-child(5) {
  height: 22px;
  animation-delay: -120ms;
}

.main-memory-voice-button,
.main-memory-composer-submit {
  position: relative;
  width: 44px;
  height: 44px;
  margin: -8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  opacity: 0.74;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    filter 180ms ease;
}

.main-memory-chat-layer.is-memory-detail-mode .main-memory-voice-button,
.main-memory-chat-layer.is-memory-detail-mode .main-memory-composer-submit {
  margin-bottom: 8px;
}

.main-memory-voice-button::before {
  position: absolute;
  inset: 15px 18px;
  border: 1px solid rgba(244, 248, 248, 0.72);
  border-radius: 999px;
  content: "";
  box-shadow: 0 0 12px rgba(244, 248, 248, 0.14);
}

.main-memory-voice-button::after {
  position: absolute;
  left: 50%;
  bottom: 13px;
  width: 10px;
  height: 7px;
  border-bottom: 1px solid rgba(244, 248, 248, 0.62);
  border-left: 1px solid rgba(244, 248, 248, 0.42);
  border-right: 1px solid rgba(244, 248, 248, 0.42);
  border-radius: 0 0 999px 999px;
  content: "";
  transform: translateX(-50%);
}

.main-memory-voice-button.is-active {
  opacity: 1;
  filter:
    drop-shadow(0 0 8px rgba(255, 255, 255, 0.32))
    drop-shadow(0 0 18px rgba(216, 222, 223, 0.12));
}

.main-memory-composer-submit::before {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 13px;
  height: 1px;
  content: "";
  background: rgba(125, 220, 190, 0.7);
  box-shadow: 0 0 12px rgba(125, 220, 190, 0.24);
  transform: translateY(-50%);
}

.main-memory-composer-submit::after {
  position: absolute;
  right: 15px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 1px solid rgba(125, 220, 190, 0.7);
  border-right: 1px solid rgba(125, 220, 190, 0.7);
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.main-memory-voice-button:hover,
.main-memory-voice-button:focus-visible,
.main-memory-composer-submit:hover,
.main-memory-composer-submit:focus-visible {
  opacity: 1;
  outline: 0;
  transform: translateY(-1px);
}

.child-agent-dialogue-overlay {
  position: fixed;
  right: 14%;
  top: 33%;
  z-index: 4;
  width: min(460px, 38vw);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(24px, 14px, 0);
  transition:
    opacity 520ms ease,
    transform 680ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
}

.is-child-agent-active:not(.is-memory-workspace):not(.is-child-memory-workspace) .child-agent-dialogue-overlay {
  opacity: 1;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
}

.child-agent-records {
  display: grid;
  gap: 9px;
  margin-bottom: 22px;
}

.child-agent-record {
  max-width: 42ch;
  margin: 0;
  color: rgba(244, 248, 248, 0.6);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(12px, 1vw, 15px);
  line-height: 1.45;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.2),
    0 0 22px rgba(255, 255, 255, 0.12),
    0 0 46px rgba(158, 216, 208, 0.08);
  filter: blur(0.18px);
  opacity: 0;
  transform: translateY(8px);
  animation: childRecordIn 760ms cubic-bezier(0.19, 0.91, 0.36, 0.99) forwards;
}

.child-agent-record.is-agent {
  color: rgba(244, 248, 248, 0.76);
}

.child-agent-record.is-user {
  color: rgba(125, 220, 190, 0.78);
  text-shadow:
    0 0 8px rgba(125, 220, 190, 0.28),
    0 0 24px rgba(125, 220, 190, 0.14),
    0 0 48px rgba(158, 216, 208, 0.08);
}

.child-agent-record.is-system {
  color: rgba(158, 216, 208, 0.58);
  font-size: clamp(11px, 0.9vw, 13px);
}

.child-agent-record.is-keyword {
  margin-top: 8px;
  letter-spacing: 0.03em;
}

.child-composer {
  position: relative;
  display: grid;
  width: min(420px, 100%);
  min-height: 44px;
  grid-template-columns: minmax(0, 1fr) 28px 24px;
  gap: 12px;
  align-items: center;
  opacity: 0;
  pointer-events: auto;
  transform: translateY(10px);
  animation: childComposerIn 760ms cubic-bezier(0.19, 0.91, 0.36, 0.99) 180ms forwards;
}

.child-composer::before {
  position: absolute;
  left: -22px;
  right: 18px;
  bottom: -4px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(125, 220, 190, 0.34), rgba(244, 248, 248, 0.12), transparent);
  filter: drop-shadow(0 0 8px rgba(125, 220, 190, 0.18));
}

.child-composer-field {
  position: relative;
  min-width: 0;
  pointer-events: auto;
}

.child-composer-field::after {
  position: absolute;
  right: 2px;
  top: 50%;
  width: 1px;
  height: 18px;
  content: "";
  background: rgba(125, 220, 190, 0.72);
  box-shadow: 0 0 12px rgba(125, 220, 190, 0.42);
  opacity: 0;
  transform: translateY(-50%);
  animation: childCaretBlink 980ms steps(2, end) infinite;
}

.child-composer-input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 0;
  border: 0;
  color: rgba(125, 220, 190, 0.88);
  caret-color: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(12px, 1vw, 15px);
  line-height: 1;
  text-shadow:
    0 0 8px rgba(125, 220, 190, 0.28),
    0 0 24px rgba(125, 220, 190, 0.12);
  background: transparent;
  outline: 0;
}

.child-composer-input::placeholder {
  color: rgba(125, 220, 190, 0.28);
}

.child-voice-interface {
  position: absolute;
  left: 0;
  right: 68px;
  top: 50%;
  display: grid;
  height: 34px;
  grid-template-columns: repeat(7, 1fr);
  gap: 11px;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
}

.child-voice-interface span {
  justify-self: center;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.72),
    0 0 22px rgba(255, 255, 255, 0.24),
    0 0 42px rgba(216, 222, 223, 0.12);
  filter: blur(0.12px);
  transition:
    height 260ms cubic-bezier(0.19, 0.91, 0.36, 0.99),
    opacity 220ms ease,
    transform 260ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
}

.child-agent-dialogue-overlay.is-voice-mode .child-composer-input,
.child-agent-dialogue-overlay.is-voice-mode .child-composer-field::after,
.child-agent-dialogue-overlay.is-voice-mode .child-composer-submit {
  opacity: 0;
  pointer-events: none;
}

.child-agent-dialogue-overlay.is-voice-mode .child-voice-interface {
  opacity: 1;
}

.child-voice-interface[data-phase="idle"] span {
  height: 8px;
  opacity: 1;
  transform: scaleY(1);
}

.child-voice-interface[data-phase="start"] span:nth-child(1),
.child-voice-interface[data-phase="start"] span:nth-child(2),
.child-voice-interface[data-phase="start"] span:nth-child(3) {
  height: 28px;
}

.child-voice-interface[data-phase="start"] span:nth-child(2) {
  height: 34px;
}

.child-voice-interface[data-phase="active"] span {
  animation: childVoicePulse 780ms ease-in-out infinite alternate;
}

.child-voice-interface[data-phase="active"] span:nth-child(1) {
  height: 28px;
}

.child-voice-interface[data-phase="active"] span:nth-child(2) {
  height: 18px;
  animation-delay: -120ms;
}

.child-voice-interface[data-phase="active"] span:nth-child(3) {
  height: 36px;
  animation-delay: -260ms;
}

.child-voice-interface[data-phase="active"] span:nth-child(4) {
  height: 24px;
  animation-delay: -90ms;
}

.child-voice-interface[data-phase="active"] span:nth-child(5) {
  height: 32px;
  animation-delay: -210ms;
}

.child-voice-interface[data-phase="active"] span:nth-child(6) {
  height: 20px;
  animation-delay: -330ms;
}

.child-voice-interface[data-phase="active"] span:nth-child(7) {
  height: 30px;
  animation-delay: -60ms;
}

.child-voice-interface[data-phase="ending"] span:nth-child(5),
.child-voice-interface[data-phase="ending"] span:nth-child(6),
.child-voice-interface[data-phase="ending"] span:nth-child(7) {
  height: 28px;
}

.child-voice-interface[data-phase="ending"] span:nth-child(7) {
  height: 34px;
}

.child-voice-button,
.child-composer-submit {
  position: relative;
  width: 44px;
  height: 44px;
  margin: -8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  opacity: 0.74;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    filter 180ms ease;
}

.child-voice-button::before {
  position: absolute;
  inset: 15px 18px;
  border: 1px solid rgba(244, 248, 248, 0.72);
  border-radius: 999px;
  content: "";
  box-shadow: 0 0 12px rgba(244, 248, 248, 0.14);
}

.child-voice-button::after {
  position: absolute;
  left: 50%;
  bottom: 13px;
  width: 10px;
  height: 7px;
  border-bottom: 1px solid rgba(244, 248, 248, 0.62);
  border-left: 1px solid rgba(244, 248, 248, 0.42);
  border-right: 1px solid rgba(244, 248, 248, 0.42);
  border-radius: 0 0 999px 999px;
  content: "";
  transform: translateX(-50%);
}

.child-voice-button.is-active {
  opacity: 1;
  filter:
    drop-shadow(0 0 8px rgba(255, 255, 255, 0.32))
    drop-shadow(0 0 18px rgba(216, 222, 223, 0.12));
}

.child-composer-submit::before {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 13px;
  height: 1px;
  content: "";
  background: rgba(125, 220, 190, 0.7);
  box-shadow: 0 0 12px rgba(125, 220, 190, 0.24);
  transform: translateY(-50%);
}

.child-composer-submit::after {
  position: absolute;
  right: 15px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 1px solid rgba(125, 220, 190, 0.7);
  border-right: 1px solid rgba(125, 220, 190, 0.7);
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.child-voice-button:hover,
.child-voice-button:focus-visible,
.child-composer-submit:hover,
.child-composer-submit:focus-visible {
  opacity: 1;
  transform: translateY(-1px);
}

.child-memory-workspace {
  position: fixed;
  inset: 0;
  z-index: 7;
  width: 100vw;
  min-width: 0;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  border-radius: 0;
  background:
    radial-gradient(circle at 52% 46%, rgba(244, 248, 248, 0.06), transparent 18rem),
    radial-gradient(circle at 50% 54%, rgba(158, 216, 208, 0.05), transparent 34rem),
    linear-gradient(180deg, rgba(5, 7, 8, 0.18), rgba(5, 7, 8, 0.62));
  opacity: 0;
  pointer-events: none;
  filter:
    drop-shadow(0 0 18px rgba(244, 248, 248, 0.08))
    drop-shadow(0 0 58px rgba(158, 216, 208, 0.08));
  transform: translate3d(0, 18px, 0) scale(0.985);
  transform-origin: 50% 52%;
  transition:
    opacity 520ms ease,
    transform 700ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
}

.child-memory-workspace.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
}

.child-memory-workspace::before,
.child-memory-workspace::after {
  position: absolute;
  left: 50%;
  top: 52%;
  content: "";
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.child-memory-workspace::before {
  width: min(720px, 72vmin);
  height: min(720px, 72vmin);
  border: 1px solid rgba(244, 248, 248, 0.045);
  box-shadow:
    inset 0 0 58px rgba(244, 248, 248, 0.025),
    0 0 96px rgba(158, 216, 208, 0.055);
}

.child-memory-workspace::after {
  width: min(960px, 88vmin);
  height: min(960px, 88vmin);
  border: 1px solid rgba(158, 216, 208, 0.035);
  filter: blur(0.4px);
  opacity: 0.9;
}

.child-memory-back {
  position: absolute;
  right: 30px;
  top: 28px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  opacity: 0.68;
  pointer-events: auto;
}

.child-memory-page-label {
  position: absolute;
  left: 42px;
  top: 128px;
  z-index: 2;
  display: grid;
  gap: 4px;
  color: rgba(244, 248, 248, 0.78);
  pointer-events: none;
}

.child-memory-page-label span {
  color: rgba(125, 220, 190, 0.58);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.child-memory-page-label strong {
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 400;
  letter-spacing: 0;
}

.child-memory-back::before,
.child-memory-back::after {
  position: absolute;
  left: 8px;
  top: 15px;
  width: 14px;
  height: 1px;
  content: "";
  background: rgba(244, 248, 248, 0.68);
  box-shadow: 0 0 12px rgba(244, 248, 248, 0.2);
}

.child-memory-back::before {
  transform: rotate(45deg);
}

.child-memory-back::after {
  transform: rotate(-45deg);
}

.child-memory-network {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(650px, 68vmin);
  height: min(650px, 68vmin);
  overflow: hidden;
  border-radius: 50%;
  pointer-events: none;
  mask-image: radial-gradient(circle at 50% 52%, #000 0 68%, transparent 87%);
  transform: translate(-50%, -50%);
}

.child-memory-workspace.is-open .child-memory-network {
  pointer-events: auto;
}

.child-memory-network::before,
.child-memory-network::after {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.child-memory-network::before {
  border: 1px solid rgba(158, 216, 208, 0.045);
  box-shadow: inset 0 0 36px rgba(158, 216, 208, 0.025);
}

.child-memory-network::after {
  inset: 25%;
  border: 1px solid rgba(244, 248, 248, 0.035);
  filter: blur(0.4px);
}

.child-memory-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: block;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: rgba(158, 216, 208, 0.42);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1;
  text-indent: 14px;
  white-space: nowrap;
  background: rgba(244, 248, 248, 0.84);
  box-shadow:
    0 0 calc(14px * var(--glow-scale)) rgba(255, 255, 255, 0.82),
    0 0 calc(38px * var(--glow-scale)) rgba(255, 255, 255, 0.25),
    0 0 calc(86px * var(--glow-scale)) rgba(158, 216, 208, 0.22);
  opacity: 0;
  cursor: pointer;
  filter: blur(0.08px);
  transform: translate(-50%, -50%);
  animation-delay: var(--node-delay);
}

.child-memory-node:hover,
.child-memory-node:focus-visible,
.child-memory-node.is-selected,
.memory-node.is-selected {
  color: rgba(244, 248, 248, 0.78);
  outline: 0;
  box-shadow:
    0 0 18px rgba(255, 255, 255, 0.92),
    0 0 52px rgba(255, 255, 255, 0.32),
    0 0 112px rgba(158, 216, 208, 0.32);
}

.child-memory-node:active,
.memory-node:active {
  transform: translate(-50%, -50%) scale(1.18);
}

.child-memory-node::after {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, rgba(244, 248, 248, 0.38), rgba(158, 216, 208, 0.18), transparent);
  filter: blur(0.35px);
  opacity: 0;
  transform: translate(-96%, -50%) rotate(var(--trail-angle, -16deg));
}

.child-memory-link {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--length);
  height: 1px;
  background: linear-gradient(90deg, rgba(244, 248, 248, 0.04), rgba(158, 216, 208, 0.42), rgba(244, 248, 248, 0.08));
  filter:
    drop-shadow(0 0 7px rgba(158, 216, 208, 0.22))
    drop-shadow(0 0 16px rgba(244, 248, 248, 0.08));
  opacity: 0;
  transform: rotate(var(--angle));
  transform-origin: 0 50%;
  transition: opacity 900ms ease var(--link-delay);
}

.child-memory-workspace[data-stage="scatter"] .child-memory-node {
  animation: childMemoryScatter 760ms cubic-bezier(0.12, 0.76, 0.18, 1) forwards;
}

.child-memory-workspace[data-stage="drift"] .child-memory-node {
  opacity: calc(0.54 + var(--strength) * 0.36);
  animation:
    childMemoryDrift var(--drift-duration) ease-in-out infinite alternate,
    childMemoryGlowBreath 1800ms ease-in-out infinite alternate;
  animation-delay: var(--node-delay), var(--node-delay-negative);
}

.child-memory-workspace[data-stage="attract"] .child-memory-node {
  opacity: calc(0.58 + var(--strength) * 0.34);
  animation: childMemoryAttract 1180ms cubic-bezier(0.19, 0.91, 0.36, 0.99) forwards;
  animation-delay: var(--node-delay-short);
}

.child-memory-workspace[data-stage="connect"] .child-memory-node,
.child-memory-workspace[data-stage="settle"] .child-memory-node {
  opacity: calc(0.58 + var(--strength) * 0.32);
  animation: childMemorySettle 2600ms ease-in-out infinite alternate;
}

.child-memory-workspace[data-stage="connect"] .child-memory-node.is-free,
.child-memory-workspace[data-stage="settle"] .child-memory-node.is-free {
  opacity: calc(0.46 + var(--strength) * 0.28);
  animation:
    childMemoryDrift var(--drift-duration) ease-in-out infinite alternate,
    childMemoryGlowBreath 1900ms ease-in-out infinite alternate;
  animation-delay: var(--node-delay-negative), var(--node-delay-short);
}

.child-memory-workspace[data-stage="drift"] .child-memory-node::after,
.child-memory-workspace[data-stage="attract"] .child-memory-node::after {
  opacity: 0.62;
  animation: childMemoryTrailPulse 1200ms ease-in-out infinite alternate;
  animation-delay: var(--node-delay-negative);
}

.child-memory-workspace[data-stage="connect"] .child-memory-node.is-free::after,
.child-memory-workspace[data-stage="settle"] .child-memory-node.is-free::after {
  opacity: 0.42;
  animation: childMemoryTrailPulse 1500ms ease-in-out infinite alternate;
  animation-delay: var(--node-delay-negative);
}

.child-memory-workspace[data-stage="connect"] .child-memory-link,
.child-memory-workspace[data-stage="settle"] .child-memory-link {
  opacity: calc(0.14 + var(--weight) * 0.42);
}

.child-memory-workspace[data-stage="settle"] .child-memory-link {
  animation: childMemoryLinkBreath 3200ms ease-in-out infinite alternate;
}

.main-agent-insight-toast {
  position: fixed;
  left: clamp(18px, 3.6vw, 48px);
  bottom: clamp(82px, 11vh, 128px);
  z-index: 34;
  display: grid;
  width: min(420px, calc(100vw - 34px));
  gap: 7px;
  padding: 15px 18px 16px 22px;
  border-left: 1px solid rgba(244, 248, 248, 0.56);
  color: rgba(244, 248, 248, 0.88);
  background:
    linear-gradient(90deg, rgba(244, 248, 248, 0.12), rgba(8, 12, 13, 0.5) 16%, rgba(8, 12, 13, 0.06)),
    radial-gradient(circle at 0 50%, rgba(158, 216, 208, 0.18), transparent 62%);
  box-shadow:
    -16px 0 34px rgba(244, 248, 248, 0.16),
    0 0 48px rgba(158, 216, 208, 0.12),
    inset 1px 0 0 rgba(255, 255, 255, 0.22);
  opacity: 0;
  pointer-events: none;
  filter: blur(0.2px);
  transform: translate3d(-18px, 20px, 0) scale(0.98);
  transition:
    opacity 340ms ease,
    filter 420ms ease,
    transform 620ms cubic-bezier(0.19, 0.91, 0.36, 0.99);
}

.main-agent-insight-toast::before,
.main-agent-insight-toast::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.main-agent-insight-toast::before {
  left: -11px;
  top: 18px;
  width: 7px;
  height: calc(100% - 36px);
  border-radius: 999px;
  background: rgba(244, 248, 248, 0.86);
  box-shadow:
    0 0 14px rgba(255, 255, 255, 0.82),
    0 0 40px rgba(158, 216, 208, 0.28);
}

.main-agent-insight-toast::after {
  inset: -32px auto -32px -64px;
  width: 150px;
  background: radial-gradient(ellipse at center, rgba(244, 248, 248, 0.14), transparent 70%);
  filter: blur(6px);
}

.main-agent-insight-toast.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translate3d(0, 0, 0) scale(1);
  animation: mainAgentInsightGlow 1800ms ease-in-out infinite alternate;
}

.main-agent-insight-kicker,
.main-agent-insight-text {
  position: relative;
  z-index: 1;
  margin: 0;
  letter-spacing: 0;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.24),
    0 0 28px rgba(158, 216, 208, 0.14);
}

.main-agent-insight-kicker {
  color: rgba(158, 216, 208, 0.7);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
}

.main-agent-insight-text {
  max-width: 36ch;
  color: rgba(244, 248, 248, 0.9);
  font-size: clamp(13px, 1.08vw, 16px);
  font-weight: 500;
  line-height: 1.48;
}

.panel-label {
  margin: 0 0 8px;
  color: var(--warm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  text-transform: uppercase;
}

#memoryText {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

@keyframes loaderLine {
  to {
    transform: translate3d(-50%, -50%, 0) scaleX(1);
  }
}

@keyframes memoryTextBreath {
  0% {
    color: rgba(244, 248, 248, 0.48);
    text-shadow:
      0 0 4px rgba(244, 248, 248, 0.08),
      0 0 12px rgba(216, 222, 223, 0.06);
  }

  100% {
    color: rgba(255, 255, 255, 0.96);
    text-shadow:
      0 0 8px rgba(244, 248, 248, 0.42),
      0 0 20px rgba(216, 222, 223, 0.22);
  }
}

@keyframes memoryDotFlight {
  0% {
    opacity: 0;
    transform: translate3d(var(--memory-dot-start-x), var(--memory-dot-start-y), 0) scale(0.72);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0.92;
    transform: translate3d(var(--memory-dot-end-x), var(--memory-dot-end-y), 0) scale(1.52);
  }
}

@keyframes memoryNetworkDrift {
  0% {
    transform: translate3d(-50%, -50%, 0) scale(1) rotate(-2deg);
  }

  100% {
    transform: translate3d(-50%, -51.5%, 0) scale(1.018) rotate(2.5deg);
  }
}

@keyframes mainMemoryNodeFloat {
  from {
    transform: translate(-50%, -50%) scale(0.96);
  }

  to {
    transform: translate(calc(-50% + var(--drift-x)), calc(-50% + var(--drift-y))) scale(1.08);
  }
}

@keyframes mainMemorySelectedTwist {
  0% {
    transform:
      translate(-50%, -50%)
      translate(0, 0)
      scale(1.04)
      rotate(0deg);
  }

  58% {
    transform:
      translate(-50%, -50%)
      translate(var(--selected-translate-x, 0px), var(--selected-translate-y, 0px))
      scale(1.54)
      rotate(-13deg);
  }

  100% {
    transform:
      translate(-50%, -50%)
      translate(var(--selected-translate-x, 0px), var(--selected-translate-y, 0px))
      scale(1.42)
      rotate(-6deg);
  }
}

@keyframes childRecordIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes childComposerIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes childCaretBlink {
  50% {
    opacity: 1;
  }
}

@keyframes childVoicePulse {
  to {
    opacity: 0.78;
    transform: scaleY(0.72);
  }
}

@keyframes childMemoryScatter {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.16);
  }

  100% {
    opacity: calc(0.52 + var(--strength) * 0.36);
    transform: translate(calc(-50% + var(--scatter-x)), calc(-50% + var(--scatter-y))) scale(calc(1.02 * var(--glow-scale)));
  }
}

@keyframes childMemoryDrift {
  0% {
    transform: translate(calc(-50% + var(--scatter-x)), calc(-50% + var(--scatter-y))) scale(calc(0.96 * var(--glow-scale)));
  }

  45% {
    transform: translate(calc(-50% + var(--drift-x-alt)), calc(-50% + var(--drift-y-alt))) scale(calc(1.18 * var(--glow-scale)));
  }

  100% {
    transform: translate(calc(-50% + var(--drift-x)), calc(-50% + var(--drift-y))) scale(calc(1.04 * var(--glow-scale)));
  }
}

@keyframes childMemoryAttract {
  0% {
    transform: translate(calc(-50% + var(--attract-x)), calc(-50% + var(--attract-y))) scale(calc(1.12 * var(--glow-scale)));
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes childMemorySettle {
  from {
    transform: translate(-50%, -50%) scale(0.96);
  }

  to {
    transform: translate(calc(-50% + 3px), calc(-50% - 4px)) scale(1.08);
  }
}

@keyframes childMemoryLinkBreath {
  from {
    opacity: calc(0.1 + var(--weight) * 0.3);
  }

  to {
    opacity: calc(0.18 + var(--weight) * 0.46);
  }
}

@keyframes mainAgentInsightGlow {
  from {
    box-shadow:
      -14px 0 30px rgba(244, 248, 248, 0.12),
      0 0 42px rgba(158, 216, 208, 0.1),
      inset 1px 0 0 rgba(255, 255, 255, 0.18);
  }

  to {
    box-shadow:
      -20px 0 44px rgba(244, 248, 248, 0.22),
      0 0 68px rgba(158, 216, 208, 0.18),
      inset 1px 0 0 rgba(255, 255, 255, 0.3);
  }
}

@keyframes childMemoryGlowBreath {
  from {
    box-shadow:
      0 0 calc(14px * var(--glow-scale)) rgba(255, 255, 255, 0.76),
      0 0 calc(40px * var(--glow-scale)) rgba(255, 255, 255, 0.22),
      0 0 calc(82px * var(--glow-scale)) rgba(158, 216, 208, 0.18);
  }

  to {
    box-shadow:
      0 0 calc(18px * var(--glow-scale)) rgba(255, 255, 255, 0.9),
      0 0 calc(52px * var(--glow-scale)) rgba(255, 255, 255, 0.3),
      0 0 calc(104px * var(--glow-scale)) rgba(158, 216, 208, 0.26);
  }
}

@keyframes childMemoryTrailPulse {
  from {
    opacity: 0.38;
    transform: translate(-92%, -50%) rotate(var(--trail-angle, -16deg)) scaleX(0.72);
  }

  to {
    opacity: 0.72;
    transform: translate(-98%, -50%) rotate(var(--trail-angle, -16deg)) scaleX(1.12);
  }
}

@media (max-width: 720px) {
  .main-agent-insight-toast {
    left: 16px;
    bottom: 92px;
    width: min(360px, calc(100vw - 32px));
    padding: 13px 15px 14px 18px;
  }

  .main-agent-insight-text {
    max-width: 31ch;
  }

  .loader {
    width: min(340px, 78vw);
  }

  .scroll-cue {
    top: 38%;
    font-size: 18px;
    letter-spacing: 0.12em;
  }

  .topbar {
    top: 16px;
    left: 16px;
    right: 16px;
  }

  .memory-dock {
    top: 80px;
    right: 16px;
  }

  .memory-workspace-back {
    top: 20px;
    right: 20px;
  }

  .memory-page-label {
    left: 20px;
    top: 104px;
  }

  .portrait-anchor {
    width: min(150px, 42vw);
  }

  .memory-network {
    top: 53%;
    width: min(480px, 82vmin);
    height: min(480px, 82vmin);
  }

  .memory-node {
    font-size: 9px;
    text-indent: 11px;
  }

  .main-memory-detail {
    top: 56%;
    width: min(360px, calc(100vw - 34px));
    gap: 8px;
  }

  .main-memory-detail-transcript {
    display: none;
  }

  .child-agent-dialogue-overlay {
    top: 30%;
    right: 18px;
    left: 18px;
    width: auto;
  }

  .child-memory-workspace {
    inset: 0;
    width: 100vw;
    height: 100vh;
  }

  .child-memory-page-label {
    left: 20px;
    top: 104px;
  }

  .child-memory-back {
    right: 20px;
    top: 22px;
  }

  .child-memory-network {
    top: 53%;
    width: min(480px, 82vmin);
    height: min(480px, 82vmin);
  }

  .child-memory-node {
    font-size: 9px;
    text-indent: 11px;
  }

  .child-composer {
    width: min(360px, 100%);
    grid-template-columns: minmax(0, 1fr) 26px 22px;
    gap: 10px;
  }

  .main-memory-chat-layer {
    bottom: 28px;
    width: min(420px, calc(100vw - 32px));
    gap: 12px;
  }

  .main-memory-chat-layer.is-memory-detail-mode {
    bottom: 18px;
    width: min(430px, calc(100vw - 24px));
  }

  .main-memory-records {
    max-height: 18vh;
  }

  .main-memory-composer {
    grid-template-columns: minmax(0, 1fr) 26px 22px;
    gap: 10px;
  }

  .main-memory-chat-layer.is-memory-detail-mode .main-memory-composer {
    min-height: 108px;
  }

  .main-memory-chat-layer.is-memory-detail-mode .main-memory-composer-input {
    height: 86px;
    padding-left: 14px;
  }

  .main-memory-voice-interface {
    right: 58px;
    gap: 10px;
  }

  .child-voice-interface {
    right: 58px;
    gap: 8px;
  }

  .child-voice-interface span {
    width: 8px;
    height: 8px;
  }

  .camera-permission-button {
    top: 18px;
    left: 50%;
  }

  .dialogue-overlay {
    top: 42%;
    right: 16px;
    left: 16px;
    width: auto;
  }

  .dialogue-text {
    font-size: 22px;
  }

  .agent-axis {
    bottom: 20px;
    width: min(430px, calc(100vw - 28px));
    grid-template-columns: 24px minmax(48px, 1fr) 24px minmax(48px, 1fr) 24px;
    gap: 10px;
  }

  .axis-add-button {
    width: 24px;
    height: 24px;
    transform: translateY(-8px);
  }

  .axis-add-button span,
  .axis-add-button::before {
    width: 12px;
    height: 1.5px;
  }

  .agent-create-view {
    padding: 14px;
    align-items: end;
  }

  .agent-create-shell {
    max-height: calc(100vh - 28px);
    padding: 22px;
    overflow: auto;
  }

  .create-source-row,
  .agent-gallery {
    grid-template-columns: 1fr;
  }

  .agent-model-preview.is-visible {
    height: 86px;
  }
}

@media (min-width: 520px) and (max-width: 720px) {
  .agent-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  #particleCanvas,
  .loader,
  .scroll-cue,
  .topbar,
  .agent-axis,
  .agent-create-view,
  .memory-dock,
  .memory-workspace,
  .child-agent-dialogue-overlay,
  .main-memory-chat-layer {
    transition-duration: 0.01ms !important;
  }
}
