/* 忆渡 MEMORIA — design tokens */
:root {
  --void: #0b0e14;
  --void-2: #121722;
  --void-3: #1a2130;
  --paper: #e8e4d9;
  --paper-dim: #c9c3b4;
  --ember: #c4a574;
  --ember-soft: rgba(196, 165, 116, 0.35);
  --aurora: #6b8cff;
  --aurora-soft: rgba(107, 140, 255, 0.28);
  --mist: #8b93a7;
  --line: rgba(232, 228, 217, 0.1);
  --line-strong: rgba(232, 228, 217, 0.18);
  --danger: #d47a6a;
  --ok: #7dba9a;
  --glass: rgba(18, 23, 34, 0.72);
  --radius: 14px;
  --font-display: "Songti SC", "STSong", "Noto Serif SC", Georgia, "Times New Roman", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "SF Mono", "Menlo", "Consolas", "Courier New", monospace;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--void);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

#time-stream {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mist);
  font-family: var(--font-mono);
}

/* ——— Gate ——— */
.gate {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  gap: 1rem;
}

.gate__mark {
  filter: drop-shadow(0 0 18px var(--ember-soft));
  animation: mark-breathe 4.5s var(--ease) infinite;
}

.mark-ring {
  fill: none;
  stroke: var(--ember);
  stroke-width: 1.2;
  opacity: 0.7;
}

.mark-core {
  fill: var(--ember);
}

.mark-cross,
.mark-arc {
  fill: none;
  stroke: var(--aurora);
  stroke-width: 1;
  opacity: 0.75;
}

.gate h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(3.2rem, 10vw, 5.5rem);
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  line-height: 1.1;
  color: var(--paper);
  text-shadow: 0 0 40px rgba(196, 165, 116, 0.25);
}

.gate__lead {
  max-width: 34rem;
  margin: 0.25rem 0 0.5rem;
  color: var(--paper-dim);
  font-size: 1.05rem;
}

.gate__person {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0.75rem 0 0.25rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  text-align: left;
}

.gate__person-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.gate__person-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--mist);
  font-family: var(--font-mono);
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #d4b88a, #8a6f45 55%, #3a3020);
  color: #1a1408;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  box-shadow: 0 0 0 1px rgba(196, 165, 116, 0.45), 0 0 24px rgba(196, 165, 116, 0.2);
  flex-shrink: 0;
}

.avatar--sm {
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
}

.gate__note {
  max-width: 28rem;
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--mist);
}

/* Buttons */
.btn-primary {
  position: relative;
  margin-top: 0.75rem;
  border: none;
  cursor: pointer;
  min-height: 52px;
  padding: 0.9rem 2.4rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #1a1408;
  background: linear-gradient(135deg, #e0c48a, var(--ember) 45%, #9a7d4a);
  box-shadow: 0 10px 30px rgba(196, 165, 116, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(196, 165, 116, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--aurora);
  outline-offset: 3px;
}

.btn-primary:active {
  transform: translateY(0);
  filter: brightness(0.96);
}

.btn-primary__glow {
  position: absolute;
  inset: -40%;
  background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%);
  transform: translateX(-60%);
  animation: sheen 3.6s var(--ease) infinite;
  pointer-events: none;
}

.btn-ghost {
  min-height: 40px;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--paper-dim);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.btn-ghost:hover {
  color: var(--paper);
  border-color: rgba(196, 165, 116, 0.45);
  background: rgba(196, 165, 116, 0.08);
}

.btn-ghost:focus-visible {
  outline: 2px solid var(--aurora);
  outline-offset: 2px;
}

/* ——— App shell ——— */
.app {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  animation: fade-in 0.7s var(--ease);
}

.app.is-paint {
  animation: none;
  opacity: 1;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 14, 20, 0.72);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.brand__glyph {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 12px var(--ember);
}

.brand__name {
  font-family: var(--font-display);
  letter-spacing: 0.2em;
  font-size: 1.05rem;
}

.brand__sep,
.brand__sub {
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}

.topbar__person {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
  min-width: 0;
}

.topbar__person-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.topbar__person-text strong {
  font-size: 0.92rem;
  font-weight: 600;
}

.topbar__person-text span {
  font-size: 0.72rem;
  color: var(--mist);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
}

.btn-identity {
  display: grid;
  gap: 0.08rem;
  min-width: 128px;
  padding: 0.48rem 0.72rem;
  border: 1px solid rgba(196, 165, 116, 0.32);
  border-radius: 10px;
  background: rgba(196, 165, 116, 0.08);
  color: var(--paper);
  text-align: left;
  cursor: pointer;
}

.btn-identity small {
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.btn-identity strong {
  font-size: 0.8rem;
  font-weight: 560;
}

.btn-identity.is-verified {
  border-color: rgba(112, 220, 180, 0.38);
  background: rgba(112, 220, 180, 0.08);
}

.btn-identity.is-locked,
.btn-identity:disabled {
  cursor: default;
  opacity: 1;
  border-color: rgba(196, 165, 116, 0.42);
  background: rgba(196, 165, 116, 0.12);
}

.identity-panel__body {
  width: min(760px, 100vw);
  max-width: 760px;
}

.identity-panel__lead {
  margin: 0 0 1.15rem;
  color: var(--soft);
  line-height: 1.75;
}

.speaker-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.speaker-option {
  display: grid;
  gap: 0.22rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.speaker-option:hover,
.speaker-option.is-active {
  border-color: rgba(196, 165, 116, 0.52);
  background: rgba(196, 165, 116, 0.09);
  transform: translateY(-1px);
}

.speaker-option strong {
  font-size: 1rem;
}

.speaker-option span,
.speaker-option small {
  color: var(--mist);
}

.speaker-option small {
  font-family: var(--font-mono);
  font-size: 0.62rem;
}

.speaker-unknown {
  margin-top: 0.8rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mist);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.identity-assurance {
  display: flex;
  gap: 0.65rem;
  margin-top: 1.15rem;
  padding: 0.85rem;
  border: 1px solid rgba(107, 140, 255, 0.2);
  border-radius: 12px;
  background: rgba(107, 140, 255, 0.06);
}

.identity-assurance__dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 0.38rem;
  border-radius: 50%;
  background: var(--aurora);
  box-shadow: 0 0 10px var(--aurora);
}

.identity-assurance p {
  margin: 0;
  color: var(--mist);
  font-size: 0.78rem;
  line-height: 1.65;
}

.memory-proposal {
  max-width: min(620px, 92%);
  margin: 0.25rem auto 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(107, 140, 255, 0.28);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(107, 140, 255, 0.08), rgba(196, 165, 116, 0.05));
}

.memory-proposal__eyebrow {
  margin: 0 0 0.4rem;
  color: var(--aurora);
  font: 0.64rem/1.2 var(--font-mono);
  letter-spacing: 0.12em;
}

.memory-proposal__text {
  margin: 0;
  color: var(--paper);
  line-height: 1.65;
}

.memory-proposal__hint {
  margin: 0.45rem 0 0;
  color: var(--mist);
  font-size: 0.72rem;
}

.memory-proposal__subject {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: var(--ink-2);
  font-size: 12px;
}

.memory-proposal__subject select {
  min-width: 150px;
  border: 1px solid rgba(177, 214, 255, 0.22);
  border-radius: 10px;
  padding: 7px 10px;
  color: var(--ink-1);
  background: rgba(8, 18, 31, 0.82);
}

.memory-proposal__actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.memory-proposal__actions button {
  padding: 0.46rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--paper);
  cursor: pointer;
}

.memory-proposal__actions button:first-child {
  border-color: rgba(196, 165, 116, 0.4);
  background: rgba(196, 165, 116, 0.1);
}

.memory-proposal.is-resolved {
  opacity: 0.76;
}

@media (max-width: 760px) {
  .speaker-options { grid-template-columns: 1fr; }
  .btn-identity { min-width: 0; }
  .btn-identity small { display: none; }
}

.shell {
  flex: 1;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 300px;
  gap: 0;
  min-height: 0;
}

/* Rail */
.rail {
  padding: 1.25rem 1rem 1.5rem;
  border-right: 1px solid var(--line);
  background: rgba(11, 14, 20, 0.35);
  overflow: auto;
}

.rail__title {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--mist);
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: uppercase;
}

.rail__title--spaced {
  margin-top: 1.35rem;
}

.persona-card {
  margin-bottom: 0.25rem;
  padding: 0.85rem;
  border: 1px solid rgba(196, 165, 116, 0.35);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(196, 165, 116, 0.1), transparent 45%),
    var(--glass);
}

.persona-card__top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.persona-card__name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.persona-card__ver {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--ember);
  letter-spacing: 0.04em;
}

.persona-card__role {
  margin: 0;
  font-size: 0.72rem;
  color: var(--mist);
}

.persona-card__summary {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  color: var(--paper-dim);
  line-height: 1.55;
}

.persona-card__tags {
  list-style: none;
  margin: 0 0 0.55rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.persona-card__tags li {
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 165, 116, 0.3);
  background: rgba(196, 165, 116, 0.08);
  color: var(--ember);
  font-size: 0.68rem;
  font-family: var(--font-mono);
}

.persona-card__bound {
  margin: 0;
  font-size: 0.72rem;
  color: var(--mist);
  line-height: 1.45;
  border-top: 1px dashed var(--line);
  padding-top: 0.5rem;
}

.mode-pill.is-style {
  border-color: rgba(139, 147, 167, 0.45);
  background: rgba(139, 147, 167, 0.1);
  color: var(--mist);
}

.mode-pill.is-grounded {
  border-color: rgba(196, 165, 116, 0.45);
  background: rgba(196, 165, 116, 0.1);
  color: var(--ember);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.85rem;
  border-left: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline__item {
  position: relative;
  padding-left: 0.85rem;
  cursor: default;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: -1.18rem;
  top: 0.45rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--void-3);
  border: 1px solid var(--ember);
  box-shadow: 0 0 0 3px rgba(11, 14, 20, 0.9);
}

.timeline__item.is-active::before {
  background: var(--ember);
  box-shadow: 0 0 10px var(--ember-soft);
}

.timeline__era {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--aurora);
}

.timeline__title {
  margin: 0.15rem 0 0;
  font-size: 0.92rem;
  color: var(--paper);
}

.timeline__hint {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--mist);
}

.safety {
  margin-top: 1.75rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
}

.safety__label {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--mist);
  font-family: var(--font-mono);
}

.safety__state {
  margin: 0.35rem 0 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ok);
  font-family: var(--font-mono);
}

.safety__state.is-warn {
  color: var(--danger);
}

.safety__hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--mist);
  line-height: 1.45;
}

/* Stage */
.stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: calc(100dvh - 65px);
}

.stage__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 0.75rem;
}

.stage__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.mode-pill {
  flex-shrink: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(107, 140, 255, 0.35);
  background: rgba(107, 140, 255, 0.1);
  color: var(--aurora);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.stream {
  flex: 1;
  overflow: auto;
  padding: 0.5rem 1.5rem 1rem;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.msg {
  max-width: min(42rem, 100%);
  animation: rise 0.45s var(--ease);
}

.msg--user {
  align-self: flex-end;
  text-align: right;
}

.msg--assistant {
  align-self: flex-start;
}

.msg--opening .msg__bubble {
  border-color: rgba(196, 165, 116, 0.4);
  background:
    linear-gradient(135deg, rgba(196, 165, 116, 0.12), transparent 50%),
    var(--glass);
}

.msg__meta {
  margin: 0.35rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--mist);
  letter-spacing: 0.04em;
}

/* Voice live stage */
.live-stage {
  margin: 0 1.25rem 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--glass);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.live-stage__label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--paper-dim);
  min-width: 4rem;
}

.live-stage__wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 48px;
  flex: 1;
}

.live-stage__wave i {
  display: block;
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--ember);
  opacity: 0.85;
  transition: height 0.08s linear;
}

body.is-speaking .composer__orb .orb-core {
  background: radial-gradient(circle at 35% 30%, #f0e0b8, var(--ember));
  box-shadow: 0 0 22px var(--ember-soft);
}

body.is-listening .composer__orb .orb-core {
  background: radial-gradient(circle at 35% 30%, #c5d4ff, var(--aurora));
  box-shadow: 0 0 22px var(--aurora-soft);
}

body.is-listening .composer__orb .orb-ring,
body.is-speaking .composer__orb .orb-ring {
  animation-duration: 0.8s;
  border-color: var(--aurora);
}

/* Prompt transparency */
.prompt-view {
  margin-top: 1.25rem;
}

.prompt-view h3 {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--ember);
  font-weight: 600;
}

.prompt-view__hint {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  color: var(--mist);
}

.prompt-view__pre {
  margin: 0 0 0.9rem;
  max-height: 160px;
  overflow: auto;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--paper-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.vp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0 0.75rem;
  align-items: center;
}

.vp-file {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.vp-btn {
  min-height: 40px;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
}

.vp-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.vp-btn.is-live {
  background: linear-gradient(135deg, #e08a7a, var(--danger));
  color: #fff;
  box-shadow: 0 8px 24px rgba(212, 122, 106, 0.35);
}

.vp-assets-title {
  margin: 1rem 0 0.4rem;
  font-size: 0.8rem;
  color: var(--ember);
  letter-spacing: 0.06em;
}

.vp-asset-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.vp-asset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.75rem;
}

.vp-asset-row.is-active {
  border-color: rgba(196, 165, 116, 0.45);
  background: rgba(196, 165, 116, 0.08);
}

.vp-asset-id {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--paper);
  word-break: break-all;
}

.vp-asset-state {
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.vp-asset-tag {
  color: var(--ember);
  font-size: 0.72rem;
  white-space: nowrap;
}

.msg__who {
  margin: 0 0 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--mist);
}

.msg__bubble {
  display: inline-block;
  padding: 0.95rem 1.15rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(10px);
  text-align: left;
  line-height: 1.7;
  color: var(--paper);
}

.msg--user .msg__bubble {
  background: rgba(107, 140, 255, 0.12);
  border-color: rgba(107, 140, 255, 0.28);
  border-bottom-right-radius: 6px;
}

.msg--assistant .msg__bubble {
  border-left: 2px solid var(--ember);
  border-bottom-left-radius: 6px;
}

.msg__cites {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
  justify-content: flex-start;
}

.msg--user .msg__cites {
  justify-content: flex-end;
}

.cite {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 165, 116, 0.4);
  background: rgba(196, 165, 116, 0.1);
  color: var(--ember);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.cite:hover,
.cite:focus-visible {
  background: rgba(196, 165, 116, 0.2);
  outline: none;
}

.cite__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.typing {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  min-height: 1.2em;
}

.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ember);
  opacity: 0.35;
  animation: pulse-dot 1.1s ease-in-out infinite;
}

.typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing i:nth-child(3) {
  animation-delay: 0.3s;
}

.welcome-card {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  background: rgba(18, 23, 34, 0.45);
  max-width: 36rem;
}

.welcome-card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}

.welcome-card p {
  margin: 0 0 0.75rem;
  color: var(--paper-dim);
  font-size: 0.92rem;
}

.prompts {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.prompt-chip {
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--paper-dim);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.prompt-chip:hover,
.prompt-chip:focus-visible {
  border-color: rgba(196, 165, 116, 0.5);
  color: var(--paper);
  background: rgba(196, 165, 116, 0.08);
  outline: none;
}

/* Composer */
.composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: end;
  margin: 0 1.25rem;
  padding: 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.composer:focus-within {
  border-color: rgba(196, 165, 116, 0.45);
}

.composer__orb {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: none;
  background: transparent;
  flex-shrink: 0;
}

.orb-core {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0e0b8, var(--ember));
  box-shadow: 0 0 16px var(--ember-soft);
  transition: transform 0.2s var(--ease);
}

.orb-ring {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(196, 165, 116, 0.55);
  animation: orb-idle 2.8s ease-in-out infinite;
}

.composer__orb.is-live .orb-ring {
  border-color: var(--danger);
  animation: orb-live 0.9s ease-in-out infinite;
}

.composer__orb.is-live .orb-core {
  background: radial-gradient(circle at 35% 30%, #f5b0a0, var(--danger));
  box-shadow: 0 0 18px rgba(212, 122, 106, 0.55);
}

.composer__orb:focus-visible {
  outline: 2px solid var(--aurora);
  outline-offset: 2px;
}

#input {
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  max-height: 140px;
  padding: 0.65rem 0.25rem;
  width: 100%;
  min-height: 46px;
}

#input::placeholder {
  color: rgba(139, 147, 167, 0.75);
}

.btn-send {
  min-height: 44px;
  min-width: 72px;
  padding: 0 1.1rem;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: #1a1408;
  background: linear-gradient(135deg, #e0c48a, var(--ember));
  transition: opacity 0.2s, transform 0.2s, filter 0.2s;
}

.btn-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.btn-send:not(:disabled):hover {
  transform: translateY(-1px);
}

.btn-send:focus-visible {
  outline: 2px solid var(--aurora);
  outline-offset: 2px;
}

.composer__hint {
  margin: 0.5rem 1.5rem 0.85rem;
  font-size: 0.72rem;
  color: var(--mist);
  text-align: center;
  font-family: var(--font-mono);
}

/* Constellation */
.constellation {
  border-left: 1px solid var(--line);
  background: rgba(11, 14, 20, 0.4);
  padding: 1.15rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: auto;
}

.constellation__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.constellation__head h2 {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--mist);
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: uppercase;
}

.constellation__head span {
  font-size: 0.72rem;
  color: var(--ember);
  font-family: var(--font-mono);
}

#star-canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: radial-gradient(ellipse at center, rgba(107, 140, 255, 0.06), transparent 70%);
  border: 1px solid var(--line);
}

.shards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.shard {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: rgba(18, 23, 34, 0.65);
  animation: rise 0.4s var(--ease);
}

.shard.is-hot {
  border-color: rgba(196, 165, 116, 0.55);
  box-shadow: 0 0 0 1px rgba(196, 165, 116, 0.12), 0 0 20px rgba(196, 165, 116, 0.08);
}

.shard__top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.shard__id {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ember);
  letter-spacing: 0.06em;
}

.shard__level {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--aurora);
}

.shard__text {
  margin: 0;
  font-size: 0.82rem;
  color: var(--paper-dim);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shard__src {
  margin: 0.35rem 0 0;
  font-size: 0.7rem;
  color: var(--mist);
}

.trace {
  margin-top: auto;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--glass);
}

.trace__label {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--mist);
  font-family: var(--font-mono);
}

.trace__id {
  margin: 0.3rem 0 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--paper);
  word-break: break-all;
  line-height: 1.4;
}

.trace__meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--mist);
}

/* Channel drawer */
.channel {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  justify-content: end;
  align-items: stretch;
  animation: fade-in 0.25s var(--ease);
}

.channel[hidden] {
  display: none;
}

.channel__panel {
  width: min(380px, 100vw);
  height: 100%;
  padding: 1.25rem;
  background: var(--void-2);
  border-left: 1px solid var(--line-strong);
  overflow: auto;
  box-shadow: var(--shadow);
  animation: slide-left 0.35s var(--ease);
}

.channel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.channel__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.15em;
  font-size: 1.25rem;
}

.channel__grid {
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.channel__grid > div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.channel__grid dt {
  margin: 0;
  color: var(--mist);
  font-size: 0.82rem;
}

.channel__grid dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--paper);
  word-break: break-all;
}

.channel__note {
  margin: 1.25rem 0 0;
  font-size: 0.8rem;
  color: var(--mist);
  line-height: 1.55;
}

/* Animations */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sheen {
  0%,
  70% {
    transform: translateX(-70%);
  }
  100% {
    transform: translateX(70%);
  }
}

@keyframes mark-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.03);
    opacity: 0.88;
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes orb-idle {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes orb-live {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

@keyframes slide-left {
  from {
    transform: translateX(16px);
    opacity: 0.4;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .stream {
    scroll-behavior: auto;
  }
}

/* Responsive */
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .constellation {
    display: none;
  }
}

@media (max-width: 780px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .rail {
    display: none;
  }

  .stage {
    height: auto;
    min-height: calc(100dvh - 65px);
  }

  .topbar__person-text span {
    max-width: 40vw;
  }

  .gate h1 {
    letter-spacing: 0.18em;
    text-indent: 0.18em;
  }

  .composer {
    margin: 0 0.75rem;
  }

  .stage__header,
  .stream {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ——— Presence interface v2 ——— */
[hidden] {
  display: none !important;
}

.history-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.45rem 0;
  color: #8b948e;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-align: center;
}

.history-divider::before,
.history-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(42, 61, 49, 0.1);
}

.msg--history {
  opacity: 0.88;
}

.history-divider--current {
  margin-top: 0.9rem;
  color: #66716a;
}

:root {
  --void: #05070d;
  --void-2: #0a0e17;
  --void-3: #101827;
  --paper: #f1f4f8;
  --paper-dim: #b7c1cf;
  --ember: #d8b47b;
  --ember-soft: rgba(216, 180, 123, 0.25);
  --aurora: #5edcf5;
  --aurora-soft: rgba(94, 220, 245, 0.2);
  --violet: #9d8cff;
  --mist: #718095;
  --line: rgba(143, 180, 209, 0.1);
  --line-strong: rgba(143, 210, 229, 0.2);
  --glass: rgba(8, 13, 23, 0.78);
  --ok: #68e0ad;
  --radius: 18px;
}

html,
body {
  background:
    radial-gradient(circle at 68% 38%, rgba(68, 89, 183, 0.12), transparent 35%),
    radial-gradient(circle at 20% 100%, rgba(28, 121, 144, 0.08), transparent 35%),
    var(--void);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(115, 174, 197, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(115, 174, 197, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at center, #000 12%, transparent 76%);
}

.grain {
  opacity: 0.022;
}

.eyebrow {
  color: rgba(94, 220, 245, 0.72);
  font-size: 0.68rem;
  letter-spacing: 0.25em;
}

/* Gate: emotional presence first, technology second */
.gate {
  min-height: 100dvh;
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 0 4.5vw 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  gap: 0;
}

.gate__nav {
  width: 100%;
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.gate__nav .brand__name {
  font-size: 1.2rem;
}

.gate__link-state,
.gate__voice-state {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--paper-dim);
  font-family: var(--font-mono);
  font-size: 0.69rem;
  letter-spacing: 0.08em;
}

.gate__link-state i,
.gate__voice-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 12px rgba(104, 224, 173, 0.8);
  animation: presence-blink 2.2s ease-in-out infinite;
}

.gate__content {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(430px, 1.08fr);
  align-items: center;
  gap: clamp(2rem, 7vw, 8rem);
  padding: clamp(3rem, 8vh, 7rem) 0;
}

.gate__copy {
  max-width: 39rem;
}

.gate h1 {
  margin: 0.65rem 0 1.35rem;
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 6.2vw, 6.6rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  text-indent: 0;
  font-weight: 400;
  text-shadow: 0 0 45px rgba(94, 220, 245, 0.08);
}

.gate h1 span {
  color: transparent;
  background: linear-gradient(105deg, #f0f5f9 8%, #90e5f4 52%, #c0b7ff 92%);
  background-clip: text;
  -webkit-background-clip: text;
}

.gate__lead {
  max-width: 32rem;
  margin: 0;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.9;
  color: var(--paper-dim);
}

.gate__actions {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.gate__actions .btn-primary {
  margin: 0;
  min-height: 58px;
  padding-inline: 1.65rem;
  color: #041014;
  background: linear-gradient(120deg, #d8f9ff, #66dff3 58%, #9db1ff);
  box-shadow: 0 14px 45px rgba(61, 183, 215, 0.2), inset 0 1px 0 #fff;
}

.gate__microcopy {
  max-width: 10rem;
  color: var(--mist);
  font-size: 0.7rem;
  line-height: 1.65;
  font-family: var(--font-mono);
}

.gate__presence {
  position: relative;
  min-height: min(62vh, 620px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.gate__presence::before {
  content: "";
  position: absolute;
  width: min(36vw, 520px);
  aspect-ratio: 1;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(72, 174, 211, 0.13), rgba(91, 79, 179, 0.06) 45%, transparent 70%);
  filter: blur(8px);
}

.signal-orbit {
  position: relative;
  width: min(33vw, 440px);
  min-width: 320px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.signal-orbit__ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(104, 212, 236, 0.2);
}

.signal-orbit__ring--outer {
  inset: 1%;
  border-style: dashed;
  animation: orbit-spin 28s linear infinite;
}

.signal-orbit__ring--middle {
  inset: 13%;
  border-color: rgba(163, 142, 255, 0.28);
  box-shadow: inset 0 0 50px rgba(94, 220, 245, 0.03);
  animation: orbit-spin-reverse 20s linear infinite;
}

.signal-orbit__ring--inner {
  inset: 27%;
  border-color: rgba(216, 180, 123, 0.3);
  box-shadow: 0 0 28px rgba(216, 180, 123, 0.07);
}

.signal-orbit__scan {
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  background: conic-gradient(from 5deg, transparent 0 82%, rgba(92, 222, 246, 0.2) 92%, transparent 100%);
  animation: orbit-spin 7s linear infinite;
}

.signal-orbit__core {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #e9fbff;
  font-family: var(--font-display);
  font-size: 2.6rem;
  background:
    radial-gradient(circle at 35% 30%, rgba(165, 240, 255, 0.45), transparent 35%),
    linear-gradient(145deg, #172a3a, #111429 60%, #231e36);
  border: 1px solid rgba(163, 231, 246, 0.44);
  box-shadow: 0 0 0 10px rgba(94, 220, 245, 0.025), 0 0 65px rgba(94, 220, 245, 0.22);
  animation: core-breathe 4s ease-in-out infinite;
}

.signal-node {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aff1ff;
  box-shadow: 0 0 14px #5edcf5;
}

.signal-node--one { top: 11%; left: 28%; }
.signal-node--two { right: 5%; bottom: 42%; background: #b3a7ff; }
.signal-node--three { left: 19%; bottom: 13%; background: #d8b47b; }

.gate__person {
  width: min(100%, 410px);
  margin: -1.6rem 0 0;
  padding: 1rem 1.15rem;
  justify-content: space-between;
  border-radius: 15px;
  border-color: rgba(129, 211, 232, 0.2);
  background: rgba(7, 12, 22, 0.68);
}

.gate__person-name {
  font-size: 1.05rem;
}

.gate__telemetry {
  width: min(100%, 410px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 1rem 0 0;
}

.gate__telemetry span {
  display: flex;
  flex-direction: column;
  padding-left: 0.8rem;
  border-left: 1px solid var(--line);
}

.gate__telemetry small {
  color: var(--mist);
  font: 0.58rem/1.5 var(--font-mono);
  letter-spacing: 0.12em;
}

.gate__telemetry strong {
  color: var(--aurora);
  font: 0.69rem/1.5 var(--font-mono);
  letter-spacing: 0.08em;
}

.gate__note {
  max-width: 48rem;
  margin: 0;
  padding: 1.2rem 0 0;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
}

/* Conversation workspace */
.app {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.topbar {
  flex: 0 0 72px;
  min-height: 72px;
  padding: 0.75rem 1.2rem;
  background: rgba(5, 7, 13, 0.74);
  border-color: var(--line);
}

.brand__glyph {
  background: var(--aurora);
  box-shadow: 0 0 14px var(--aurora);
}

.topbar__person {
  border-left-color: var(--line-strong);
}

.topbar__person-text span {
  color: var(--ok);
}

.shell {
  flex: 1 1 auto;
  grid-template-columns: 255px minmax(460px, 1fr) 292px;
  gap: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.08);
}

.rail,
.stage,
.constellation {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(13, 20, 33, 0.77), rgba(6, 10, 18, 0.75));
  overflow: hidden;
}

.rail,
.constellation {
  padding: 1.2rem;
  overflow-y: auto;
}

.stage {
  position: relative;
  height: 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.015);
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 12%, rgba(94, 220, 245, 0.045), transparent 36%);
}

.stage__header {
  position: relative;
  z-index: 1;
  align-items: center;
  padding: 1.15rem 1.35rem 0.95rem;
  border-bottom: 1px solid var(--line);
}

.stage__title {
  font-size: clamp(1.35rem, 2.1vw, 1.75rem);
  letter-spacing: 0.02em;
}

.stage__signals {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 0.45rem;
}

.presence-phases {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.presence-phases span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.45rem;
  color: #526174;
  font: 0.63rem/1.4 var(--font-mono);
  letter-spacing: 0.06em;
  transition: color 0.2s, background 0.2s;
}

.presence-phases i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

body[data-presence-phase="listen"] [data-presence-phase="listen"],
body[data-presence-phase="think"] [data-presence-phase="think"],
body[data-presence-phase="speak"] [data-presence-phase="speak"] {
  color: var(--aurora);
  background: rgba(94, 220, 245, 0.08);
  border-radius: 999px;
}

body[data-presence-phase="listen"] [data-presence-phase="listen"] i,
body[data-presence-phase="think"] [data-presence-phase="think"] i,
body[data-presence-phase="speak"] [data-presence-phase="speak"] i {
  box-shadow: 0 0 9px currentColor;
  animation: presence-blink 1s ease-in-out infinite;
}

.mode-pill {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--mist);
  font-size: 0.61rem;
}

.persona-card {
  border-color: rgba(94, 220, 245, 0.18);
  background: linear-gradient(155deg, rgba(94, 220, 245, 0.07), transparent 48%), rgba(7, 12, 22, 0.72);
}

.persona-card__ver,
.persona-card__tags li,
.timeline__era,
.constellation__head span {
  color: var(--aurora);
}

.persona-card__tags li {
  border-color: rgba(94, 220, 245, 0.2);
  background: rgba(94, 220, 245, 0.055);
}

.persona-card__summary {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stream {
  position: relative;
  z-index: 1;
  padding: 1.1rem 1.45rem 1rem;
}

.welcome-card {
  max-width: 42rem;
  padding: 1.1rem 1.15rem;
  border-style: solid;
  border-color: rgba(94, 220, 245, 0.15);
  background: linear-gradient(145deg, rgba(17, 28, 43, 0.68), rgba(8, 13, 22, 0.72));
}

.welcome-card__signal {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.welcome-card__orb {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(94, 220, 245, 0.35);
  box-shadow: 0 0 22px rgba(94, 220, 245, 0.09);
}

.welcome-card__orb::before,
.welcome-card__orb::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(94, 220, 245, 0.16);
  animation: core-breathe 2.7s ease-in-out infinite;
}

.welcome-card__orb::before { inset: 7px; }
.welcome-card__orb::after { inset: 15px; background: var(--aurora); box-shadow: 0 0 10px var(--aurora); }

.welcome-card__status small {
  display: block;
  color: var(--mist);
  font: 0.59rem/1.5 var(--font-mono);
  letter-spacing: 0.16em;
}

.welcome-card__status strong {
  color: var(--paper);
  font-size: 0.88rem;
  font-weight: 500;
}

.prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.prompt-chip {
  border-color: rgba(125, 165, 190, 0.13);
  background: rgba(255, 255, 255, 0.018);
}

.prompt-chip:hover,
.prompt-chip:focus-visible {
  border-color: rgba(94, 220, 245, 0.38);
  background: rgba(94, 220, 245, 0.065);
}

.msg--assistant .msg__bubble {
  border-left-color: var(--aurora);
}

.msg--opening .msg__bubble {
  border-color: rgba(94, 220, 245, 0.25);
  background: linear-gradient(135deg, rgba(94, 220, 245, 0.08), transparent 56%), var(--glass);
}

.live-stage {
  position: relative;
  z-index: 2;
  border-color: rgba(94, 220, 245, 0.2);
  background: rgba(7, 13, 22, 0.92);
}

.live-stage__wave i {
  background: linear-gradient(to top, var(--violet), var(--aurora));
  box-shadow: 0 0 5px rgba(94, 220, 245, 0.25);
}

.composer {
  position: relative;
  z-index: 2;
  margin: 0 1.15rem;
  border-color: rgba(126, 190, 210, 0.2);
  background: rgba(8, 14, 24, 0.9);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.composer:focus-within {
  border-color: rgba(94, 220, 245, 0.45);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(94, 220, 245, 0.08);
}

.orb-core {
  background: radial-gradient(circle at 35% 30%, #e7fbff, var(--aurora));
  box-shadow: 0 0 18px var(--aurora-soft);
}

.orb-ring {
  border-color: rgba(94, 220, 245, 0.52);
}

.btn-send {
  color: #061318;
  background: linear-gradient(125deg, #c9f6ff, var(--aurora) 70%, #9fb1ff);
}

.composer__hint {
  position: relative;
  z-index: 1;
  color: #627083;
}

#star-canvas {
  border-color: rgba(94, 220, 245, 0.12);
  background: radial-gradient(ellipse at center, rgba(94, 220, 245, 0.07), rgba(75, 67, 139, 0.035) 50%, transparent 72%);
}

.trace {
  background: rgba(6, 11, 19, 0.72);
}

@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}

@keyframes orbit-spin-reverse {
  to { transform: rotate(-360deg); }
}

@keyframes core-breathe {
  0%, 100% { transform: scale(0.96); opacity: 0.82; }
  50% { transform: scale(1.04); opacity: 1; }
}

@keyframes presence-blink {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* Hands-free voice call */
.composer__orb {
  appearance: none;
  --voice-scale: 1;
}

.composer__orb.is-call::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 3px;
  width: 9px;
  height: 9px;
  border: 2px solid #08101b;
  border-radius: 50%;
  background: #62e6aa;
  box-shadow: 0 0 10px rgba(98, 230, 170, 0.7);
}

.composer__orb.is-call .orb-ring {
  border-color: rgba(94, 220, 245, 0.85);
  animation: call-pulse 1.7s ease-in-out infinite;
}

.composer__orb.is-call .orb-core {
  transform: scale(var(--voice-scale));
  background: radial-gradient(circle at 35% 30%, #edffff, #45cfe8);
  box-shadow: 0 0 22px rgba(94, 220, 245, 0.62);
}

.composer__orb.is-call.is-live .orb-ring {
  border-color: rgba(98, 230, 170, 0.95);
  animation-duration: 0.72s;
}

.composer__orb.is-call.is-live .orb-core {
  background: radial-gradient(circle at 35% 30%, #effff8, #62e6aa);
  box-shadow: 0 0 26px rgba(98, 230, 170, 0.7);
}

.composer__orb.is-connecting .orb-ring {
  border-top-color: transparent;
  animation: orbit-spin 0.8s linear infinite;
}

.composer__orb.is-error .orb-ring {
  border-color: rgba(212, 122, 106, 0.9);
}

body.is-call-active .composer__hint,
.composer__orb.is-call + #input::placeholder {
  color: rgba(94, 220, 245, 0.82);
}

.composer__footer {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  margin: 0.48rem 1.5rem 0.85rem;
}

.composer__footer .composer__hint {
  margin: 0;
  text-align: left;
}

.mic-device {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.28rem 0.48rem;
  border: 1px solid rgba(126, 190, 210, 0.16);
  border-radius: 999px;
  background: rgba(8, 14, 24, 0.72);
  color: var(--mist);
}

.mic-device__dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #627083;
  box-shadow: 0 0 8px rgba(98, 112, 131, 0.3);
}

body.is-call-active .mic-device__dot {
  background: #62e6aa;
  box-shadow: 0 0 9px rgba(98, 230, 170, 0.62);
}

#mic-device {
  width: min(12rem, 25vw);
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--paper-dim);
  font: 0.68rem/1.3 var(--font-mono);
  cursor: pointer;
  text-overflow: ellipsis;
}

#mic-device:disabled {
  cursor: default;
  opacity: 0.58;
}

#mic-device option {
  color: var(--paper);
  background: var(--void-2);
}

@keyframes call-pulse {
  0%, 100% { transform: scale(0.94); opacity: 0.64; }
  50% { transform: scale(1.05); opacity: 1; }
}

@media (max-width: 1100px) {
  .gate__content {
    grid-template-columns: minmax(0, 1fr) minmax(350px, 0.75fr);
    gap: 2rem;
  }

  .signal-orbit {
    width: 360px;
    min-width: 0;
  }

  .shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

@media (max-width: 780px) {
  .gate {
    padding-inline: 1.25rem;
  }

  .gate__nav {
    min-height: 70px;
  }

  .gate__content {
    grid-template-columns: 1fr;
    padding: 2.3rem 0;
  }

  .gate h1 {
    letter-spacing: -0.04em;
  }

  .gate__presence {
    min-height: 360px;
    order: -1;
  }

  .signal-orbit {
    width: min(88vw, 340px);
  }

  .gate__actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .gate__microcopy {
    max-width: none;
  }

  .topbar {
    flex-wrap: wrap;
    flex-basis: auto;
  }

  .brand__sub,
  .brand__sep,
  .topbar__person .avatar {
    display: none;
  }

  .topbar__actions {
    width: 100%;
    order: 3;
  }

  .topbar__actions .btn-ghost {
    flex: 1;
    padding-inline: 0.55rem;
  }

  .topbar__actions .btn-identity {
    flex: 1;
  }

  .shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 6px;
  }

  .stage {
    height: 100%;
    min-height: 0;
  }

  .stage__signals {
    display: none;
  }

  .prompts {
    grid-template-columns: 1fr;
  }

  .composer__footer {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.45rem;
    margin-inline: 1.15rem;
  }

  .mic-device {
    width: max-content;
    max-width: 100%;
  }

  #mic-device {
    width: min(15rem, 72vw);
  }
}


/* ——— Consumer chat experience v3 ———
   Mobile-first, warm and calm. Advanced archives stay available in drawers,
   while the everyday surface behaves like a familiar messaging product. */
:root {
  --void: #f3f5f1;
  --void-2: #ffffff;
  --void-3: #e9eee8;
  --paper: #202621;
  --paper-dim: #5e6861;
  --ember: #ed9b72;
  --ember-soft: rgba(237, 155, 114, 0.2);
  --aurora: #5576e6;
  --aurora-soft: rgba(85, 118, 230, 0.16);
  --violet: #8a78d8;
  --mist: #859089;
  --line: rgba(40, 58, 47, 0.1);
  --line-strong: rgba(40, 58, 47, 0.16);
  --glass: rgba(255, 255, 255, 0.9);
  --ok: #3a9a6b;
  --soft: #66716a;
  --ink-1: #202621;
  --ink-2: #66716a;
  --shadow: 0 18px 55px rgba(51, 66, 56, 0.12);
  --radius: 20px;
  color-scheme: light;
}

html,
body {
  background:
    radial-gradient(circle at 8% 6%, rgba(239, 180, 143, 0.18), transparent 28rem),
    radial-gradient(circle at 92% 15%, rgba(112, 142, 226, 0.13), transparent 32rem),
    #f6f7f3;
  color: var(--paper);
}

body::before,
#time-stream,
.grain {
  display: none;
}

.eyebrow {
  color: #7d8881;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}

.brand__glyph {
  width: 9px;
  height: 9px;
  background: linear-gradient(135deg, #f2a078, #7c8de8);
  box-shadow: 0 0 0 5px rgba(237, 155, 114, 0.1);
}

.brand__name {
  color: #252c27;
  font-family: var(--font-body);
  font-weight: 760;
  letter-spacing: 0.08em;
}

/* Welcome */
.gate {
  min-height: 100dvh;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 4rem) max(1.25rem, env(safe-area-inset-bottom));
  gap: 0;
  overflow: auto;
  color: #202621;
}

.gate__nav {
  min-height: 72px;
  border-bottom: 0;
}

.gate__nav .brand__name {
  font-size: 1.08rem;
}

.gate__nav .brand__sub {
  color: #9ba39d;
}

.gate__link-state,
.gate__voice-state {
  color: #647169;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0;
}

.gate__link-state i,
.gate__voice-state i {
  width: 7px;
  height: 7px;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(58, 154, 107, 0.1);
  animation: none;
}

.gate__content {
  flex: 1;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.72fr);
  gap: clamp(2rem, 7vw, 6rem);
  padding: clamp(2.5rem, 7vh, 5.5rem) 0;
}

.gate__copy {
  max-width: 36rem;
}

.gate h1 {
  margin: 0.55rem 0 1.1rem;
  color: #1e2520;
  font-family: var(--font-body);
  font-size: clamp(3rem, 5.5vw, 5.25rem);
  font-weight: 780;
  line-height: 1.08;
  letter-spacing: -0.055em;
  text-shadow: none;
}

.gate h1 span {
  color: #5576e6;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.gate__lead {
  max-width: 31rem;
  color: #647169;
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.8;
}

.gate__actions {
  margin-top: 1.75rem;
  gap: 1rem;
}

.gate__actions .btn-primary,
.btn-primary {
  min-height: 54px;
  margin: 0;
  padding-inline: 1.5rem;
  color: #fff;
  background: linear-gradient(135deg, #6381ec, #4e6fd8);
  box-shadow: 0 12px 30px rgba(85, 118, 230, 0.23);
  font-size: 0.96rem;
  letter-spacing: 0.02em;
}

.gate__actions .btn-primary:hover,
.btn-primary:hover {
  box-shadow: 0 14px 34px rgba(85, 118, 230, 0.3);
}

.btn-primary__glow {
  display: none;
}

.gate__microcopy {
  max-width: 12rem;
  color: #818b85;
  font-family: var(--font-body);
  font-size: 0.75rem;
  line-height: 1.55;
}

.gate__presence {
  min-height: 390px;
}

.gate__presence::before {
  width: min(31vw, 390px);
  background: radial-gradient(circle, rgba(237, 155, 114, 0.18), rgba(117, 140, 221, 0.1) 48%, transparent 70%);
  filter: blur(2px);
}

.signal-orbit {
  width: min(28vw, 330px);
  min-width: 270px;
}

.signal-orbit__ring {
  border-color: rgba(85, 118, 230, 0.18);
}

.signal-orbit__ring--middle {
  border-color: rgba(237, 155, 114, 0.3);
  box-shadow: none;
}

.signal-orbit__ring--inner {
  border-color: rgba(85, 118, 230, 0.24);
  box-shadow: none;
}

.signal-orbit__scan {
  opacity: 0.45;
}

.signal-orbit__core {
  width: 108px;
  height: 108px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 2.25rem;
  background: linear-gradient(145deg, #f0a37d, #de876b 48%, #7b83cf);
  border: 5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 16px 45px rgba(88, 93, 132, 0.2);
  animation: core-breathe 5s ease-in-out infinite;
}

.signal-node {
  background: #6e85e4;
  box-shadow: 0 0 0 5px rgba(110, 133, 228, 0.12);
}

.gate__person {
  width: min(100%, 360px);
  margin-top: -1.2rem;
  padding: 0.9rem 1rem;
  border-color: rgba(43, 62, 50, 0.1);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 40px rgba(55, 70, 60, 0.08);
  backdrop-filter: blur(18px);
}

.gate__person-name {
  color: #202621;
  font-size: 1rem;
}

.gate__person-meta {
  color: #77827b;
  font-family: var(--font-body);
}

.gate__telemetry {
  width: min(100%, 360px);
  gap: 0.5rem;
  padding-top: 0.8rem;
}

.gate__telemetry span {
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(43, 62, 50, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.56);
}

.gate__telemetry small,
.gate__telemetry strong {
  color: #7e8982;
  font-family: var(--font-body);
  letter-spacing: 0;
}

.gate__telemetry strong {
  color: #344038;
  font-size: 0.73rem;
}

.gate__note {
  max-width: 42rem;
  padding: 1rem 0 1.2rem;
  border-top-color: rgba(43, 62, 50, 0.08);
  color: #929a95;
  font-size: 0.72rem;
}

/* Everyday chat shell */
.app {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: #f3f5f1;
}

.topbar {
  flex: 0 0 68px;
  min-height: 68px;
  padding: 0.7rem clamp(0.9rem, 3vw, 2rem);
  border-bottom: 1px solid rgba(42, 61, 49, 0.08);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  box-shadow: 0 2px 16px rgba(47, 63, 52, 0.035);
}

.topbar__person {
  border-left-color: rgba(42, 61, 49, 0.1);
}

.avatar {
  color: #fff;
  background: linear-gradient(145deg, #f0a37d, #db866c 52%, #7c83cc);
  box-shadow: 0 0 0 3px rgba(237, 155, 114, 0.12);
  font-family: var(--font-body);
}

.topbar__person-text strong {
  color: #202621;
  font-size: 0.94rem;
}

.topbar__person-text span {
  color: var(--ok);
  font-family: var(--font-body);
}

.topbar__actions {
  flex-wrap: nowrap;
}

.btn-ghost,
.btn-identity {
  border-color: rgba(42, 61, 49, 0.12);
  background: #f8faf7;
  color: #59645d;
}

.btn-ghost:hover,
.btn-identity:hover {
  color: #2f3a33;
  border-color: rgba(85, 118, 230, 0.25);
  background: #f1f3fb;
}

.btn-identity {
  min-width: 116px;
  border-radius: 12px;
}

.btn-identity small {
  color: #8a948e;
}

.shell {
  flex: 1 1 auto;
  width: min(100%, 920px);
  min-height: 0;
  margin: 0 auto;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: transparent;
}

.rail,
.constellation {
  display: none;
}

.stage {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(42, 61, 49, 0.08);
  border-radius: 24px;
  background: #f7f8f5;
  box-shadow: 0 18px 60px rgba(48, 63, 53, 0.08);
  overflow: hidden;
}

.stage::before {
  display: none;
}

.stage__header {
  min-height: 67px;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(42, 61, 49, 0.07);
  background: rgba(255, 255, 255, 0.72);
}

.stage__title {
  color: #202621;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 720;
  letter-spacing: 0;
}

.stage__signals {
  align-items: flex-end;
}

.presence-phases span {
  color: #a1aaa4;
  font-family: var(--font-body);
  letter-spacing: 0;
}

body[data-presence-phase="listen"] [data-presence-phase="listen"],
body[data-presence-phase="think"] [data-presence-phase="think"],
body[data-presence-phase="speak"] [data-presence-phase="speak"] {
  color: #5576e6;
  background: rgba(85, 118, 230, 0.08);
}

.mode-pill {
  color: #8a948e;
  font-family: var(--font-body);
}

.stream {
  min-width: 0;
  padding: 1.15rem clamp(0.9rem, 3vw, 1.5rem) 1rem;
  gap: 0.9rem;
  background:
    radial-gradient(circle at 12% 4%, rgba(237, 155, 114, 0.07), transparent 18rem),
    #f7f8f5;
  overscroll-behavior: contain;
}

.msg {
  max-width: min(38rem, 82%);
}

.msg__who {
  margin-bottom: 0.28rem;
  color: #919a94;
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0;
}

.msg__bubble {
  padding: 0.78rem 1rem;
  border: 1px solid rgba(42, 61, 49, 0.08);
  background: #fff;
  color: #263029;
  line-height: 1.62;
  box-shadow: 0 5px 18px rgba(47, 63, 52, 0.055);
  backdrop-filter: none;
}

.msg--assistant .msg__bubble,
.msg--opening .msg__bubble {
  border-left: 0;
  border-color: rgba(42, 61, 49, 0.08);
  background: #fff;
}

.msg--user .msg__bubble {
  border: 0;
  background: linear-gradient(135deg, #6380e8, #506fda);
  color: #fff;
  box-shadow: 0 8px 20px rgba(85, 118, 230, 0.17);
}

.msg__meta {
  color: #a1aaa4;
  font-family: var(--font-body);
}

.msg__cites {
  margin-top: 0.45rem;
}

.cite {
  border-color: rgba(85, 118, 230, 0.18);
  background: rgba(85, 118, 230, 0.06);
  color: #6174bd;
  font-family: var(--font-body);
}

.welcome-card {
  max-width: 100%;
  padding: 1rem;
  border: 1px solid rgba(42, 61, 49, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: none;
}

.welcome-card__signal {
  margin-bottom: 0.75rem;
}

.welcome-card__orb {
  width: 38px;
  height: 38px;
  border: 0;
  background: linear-gradient(145deg, #f0a37d, #dc876b 55%, #8188d0);
  box-shadow: 0 0 0 4px rgba(237, 155, 114, 0.1);
}

.welcome-card__orb::before,
.welcome-card__orb::after {
  display: none;
}

.welcome-card__status small {
  color: #99a19c;
  font-family: var(--font-body);
  font-size: 0.66rem;
  letter-spacing: 0;
}

.welcome-card__status strong,
.welcome-card h3 {
  color: #2b352e;
}

.welcome-card h3 {
  margin-bottom: 0.35rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 720;
  letter-spacing: 0;
}

.welcome-card p {
  color: #6c7770;
  font-size: 0.86rem;
  line-height: 1.65;
}

.prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.prompt-chip {
  min-width: 0;
  border-color: rgba(42, 61, 49, 0.09);
  background: #f7f8f5;
  color: #59645d;
  border-radius: 12px;
  padding: 0.65rem 0.78rem;
}

.prompt-chip:hover,
.prompt-chip:focus-visible {
  border-color: rgba(85, 118, 230, 0.25);
  background: #f0f3fd;
  color: #425ebd;
}

.live-stage {
  margin: 0 0.9rem 0.45rem;
  border-color: rgba(85, 118, 230, 0.14);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 25px rgba(47, 63, 52, 0.06);
}

.live-stage__label {
  color: #5d6961;
  font-family: var(--font-body);
}

.live-stage__wave i {
  background: linear-gradient(to top, #f0a078, #6680e3);
  box-shadow: none;
}

.composer {
  margin: 0 0.9rem;
  padding: 0.55rem;
  gap: 0.55rem;
  border: 1px solid rgba(42, 61, 49, 0.1);
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 10px 32px rgba(48, 63, 53, 0.11);
  backdrop-filter: none;
}

.composer:focus-within {
  border-color: rgba(85, 118, 230, 0.36);
  box-shadow: 0 10px 34px rgba(48, 63, 53, 0.12), 0 0 0 3px rgba(85, 118, 230, 0.06);
}

.composer__orb {
  width: 44px;
  height: 44px;
}

.orb-ring {
  border-color: rgba(85, 118, 230, 0.42);
}

.orb-core {
  background: radial-gradient(circle at 35% 30%, #fff, #6681e4 58%);
  box-shadow: 0 0 14px rgba(85, 118, 230, 0.3);
}

.composer__orb.is-call::after {
  border-color: #fff;
  background: #42aa77;
}

.composer__orb.is-call .orb-ring {
  border-color: rgba(85, 118, 230, 0.75);
}

.composer__orb.is-call .orb-core {
  background: radial-gradient(circle at 35% 30%, #fff, #6681e4 58%);
  box-shadow: 0 0 18px rgba(85, 118, 230, 0.38);
}

.composer__orb.is-call.is-live .orb-ring {
  border-color: rgba(58, 154, 107, 0.9);
}

.composer__orb.is-call.is-live .orb-core {
  background: radial-gradient(circle at 35% 30%, #fff, #48ae7d 62%);
  box-shadow: 0 0 18px rgba(58, 154, 107, 0.35);
}

#input {
  min-width: 0;
  color: #273029;
  font-size: 0.96rem;
}

#input::placeholder {
  color: #a0a8a3;
}

.btn-send {
  min-width: 64px;
  color: #fff;
  background: #5576e6;
}

.composer__footer {
  margin: 0.4rem 1.15rem calc(0.72rem + env(safe-area-inset-bottom));
}

.composer__hint {
  color: #929b95;
  font-family: var(--font-body);
}

.mic-device {
  border-color: rgba(42, 61, 49, 0.1);
  background: #fff;
  color: #78837c;
}

#mic-device,
#mic-device option {
  color: #69746d;
  background: #fff;
  font-family: var(--font-body);
}

/* Advanced information opens as a calm sheet, not part of the daily chat. */
.channel {
  background: rgba(28, 35, 30, 0.32);
  backdrop-filter: blur(5px);
}

.channel__panel {
  background: #fff;
  border-left-color: rgba(42, 61, 49, 0.1);
  color: #263029;
}

.channel__head h2,
.channel__grid dd,
.speaker-option,
.vp-asset-id,
.memory-proposal__text {
  color: #263029;
}

.channel__grid > div {
  border-bottom-color: rgba(42, 61, 49, 0.08);
}

.channel__grid dt,
.channel__note,
.identity-panel__lead,
.speaker-option span,
.speaker-option small,
.identity-assurance p {
  color: #78837c;
}

.speaker-option,
.vp-asset-row,
.memory-proposal {
  border-color: rgba(42, 61, 49, 0.1);
  background: #f7f8f5;
}

.speaker-option:hover,
.speaker-option.is-active {
  border-color: rgba(85, 118, 230, 0.28);
  background: #f0f3fd;
}

.prompt-view__pre,
.memory-proposal__subject select {
  border-color: rgba(42, 61, 49, 0.1);
  background: #f3f5f1;
  color: #47534b;
}

@media (max-width: 780px) {
  html,
  body {
    background: #f3f5f1;
  }

  .gate {
    padding-inline: 1.15rem;
  }

  .gate__nav {
    min-height: 60px;
  }

  .gate__nav .brand__sub {
    display: none;
  }

  .gate__link-state {
    font-size: 0.72rem;
  }

  .gate__content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1.2rem 0 1rem;
  }

  .gate__copy {
    max-width: none;
  }

  .gate h1 {
    margin-top: 0.35rem;
    font-size: clamp(2.5rem, 12vw, 3.35rem);
    line-height: 1.09;
  }

  .gate__lead {
    font-size: 0.96rem;
    line-height: 1.72;
  }

  .gate__actions {
    align-items: stretch;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 1.3rem;
  }

  .gate__actions .btn-primary {
    width: 100%;
  }

  .gate__microcopy {
    max-width: none;
    text-align: center;
  }

  .gate__presence {
    min-height: 205px;
    order: 0;
  }

  .gate__presence::before {
    width: 220px;
  }

  .signal-orbit {
    width: 175px;
    min-width: 0;
  }

  .signal-orbit__core {
    width: 72px;
    height: 72px;
    border-width: 4px;
    font-size: 1.55rem;
  }

  .gate__person {
    width: min(100%, 300px);
    margin-top: -0.85rem;
    padding: 0.65rem 0.8rem;
  }

  .gate__telemetry {
    width: min(100%, 300px);
    padding-top: 0.5rem;
  }

  .gate__telemetry span {
    padding: 0.42rem 0.45rem;
  }

  .gate__telemetry small {
    display: none;
  }

  .gate__telemetry strong {
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .gate__note {
    padding-block: 0.7rem 1rem;
    line-height: 1.55;
  }

  .topbar {
    flex: 0 0 64px;
    min-height: 64px;
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
  }

  .topbar > .brand {
    display: none;
  }

  .topbar__person {
    flex: 1 1 auto;
    margin: 0;
    padding: 0;
    border: 0;
    gap: 0.5rem;
    overflow: hidden;
  }

  .topbar__person .avatar {
    display: grid;
    width: 38px;
    height: 38px;
  }

  .topbar__person-text {
    overflow: hidden;
  }

  .topbar__person-text span {
    max-width: 8.8rem;
    font-size: 0.67rem;
  }

  .topbar__actions {
    width: auto;
    min-width: 0;
    margin-left: auto;
    order: initial;
    gap: 0.3rem;
  }

  .topbar__actions .btn-identity {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 5.4rem;
    padding: 0.42rem 0.55rem;
    overflow: hidden;
  }

  .btn-identity strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar__actions .btn-ghost {
    position: relative;
    flex: 0 0 36px;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    font-size: 0;
  }

  #share-link-btn::before,
  #voice-panel-btn::before,
  #channel-btn::before,
  #reset-btn::before {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #66716a;
    font-size: 1rem;
  }

  #share-link-btn::before { content: "↗"; }
  #voice-panel-btn::before { content: "♪"; }
  #channel-btn::before { content: "•••"; letter-spacing: -0.12em; padding-right: 0.12em; }
  #reset-btn { display: none; }

  .shell {
    width: 100%;
    padding: 0;
  }

  .stage {
    height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .stage__header {
    display: none;
  }

  .stream {
    padding: 0.95rem 0.8rem 0.75rem;
    gap: 0.78rem;
  }

  .msg {
    max-width: 86%;
  }

  .msg__bubble {
    padding: 0.7rem 0.88rem;
    border-radius: 17px;
    font-size: 0.94rem;
  }

  .welcome-card {
    padding: 0.85rem;
  }

  .welcome-card__signal {
    margin-bottom: 0.6rem;
  }

  .welcome-card p {
    margin-bottom: 0.65rem;
    font-size: 0.82rem;
  }

  .prompts {
    display: flex;
    flex-direction: row;
    gap: 0.45rem;
    margin-inline: -0.15rem;
    padding: 0.15rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .prompts::-webkit-scrollbar {
    display: none;
  }

  .prompt-chip {
    flex: 0 0 auto;
    max-width: 14rem;
    padding: 0.58rem 0.72rem;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .live-stage {
    margin-inline: 0.65rem;
  }

  .composer {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    margin: 0 0.6rem;
    padding: 0.42rem;
    gap: 0.35rem;
    border-radius: 17px;
  }

  .composer__orb {
    width: 42px;
    height: 42px;
  }

  #input {
    min-height: 42px;
    max-height: 98px;
    padding: 0.55rem 0.1rem;
    font-size: 0.93rem;
  }

  .btn-send {
    min-width: 54px;
    min-height: 40px;
    padding-inline: 0.75rem;
  }

  .composer__footer {
    display: block;
    margin: 0.32rem 0.85rem calc(0.55rem + env(safe-area-inset-bottom));
  }

  .composer__footer .composer__hint {
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mic-device {
    display: none;
  }

  .channel {
    align-items: end;
    justify-content: stretch;
  }

  .channel__panel {
    width: 100%;
    height: min(82dvh, 720px);
    padding: 1.1rem 1rem calc(1.1rem + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 22px 22px 0 0;
    animation: rise 0.28s var(--ease);
  }

  .speaker-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 370px) {
  .topbar__person-text span {
    max-width: 6.5rem;
  }

  #voice-panel-btn {
    display: none;
  }

  .gate h1 {
    font-size: 2.35rem;
  }
}

/* Wang Wei — photo-driven 2.5D call presence */
.signal-orbit__core,
.avatar,
.welcome-card__orb {
  color: transparent;
  background-image: url("assets/avatar/wangwei-expression-sprite-v1.jpg");
  background-size: 200% 200%;
  background-position: 0 0;
  background-repeat: no-repeat;
}

.btn-avatar.is-active {
  border-color: rgba(85, 118, 230, 0.3);
  background: rgba(85, 118, 230, 0.09);
  color: #4f69c8;
}

.avatar-call {
  --avatar-level: 0;
  position: relative;
  flex: 0 0 286px;
  min-height: 286px;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid rgba(42, 61, 49, 0.07);
  background:
    radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.96), transparent 38%),
    linear-gradient(142deg, #edf1e9 0%, #f8f5ed 48%, #e7ece5 100%);
}

.avatar-call::before,
.avatar-call::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
}

.avatar-call::before {
  width: 15rem;
  height: 15rem;
  top: -8rem;
  left: -5rem;
  background: rgba(237, 155, 114, 0.12);
  filter: blur(20px);
}

.avatar-call::after {
  width: 18rem;
  height: 18rem;
  right: -8rem;
  bottom: -12rem;
  background: rgba(85, 118, 230, 0.11);
  filter: blur(22px);
}

.avatar-call__glow {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: -7.5rem;
  width: 24rem;
  height: 24rem;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  box-shadow:
    0 0 0 2.6rem rgba(255, 255, 255, 0.08),
    0 0 0 5.2rem rgba(255, 255, 255, 0.045);
  transition: border-color 240ms ease, box-shadow 240ms ease;
}

.avatar-portrait {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: -66px;
  width: 332px;
  height: 332px;
  overflow: hidden;
  transform: translateX(-50%);
  border-radius: 46% 46% 20% 20% / 38% 38% 18% 18%;
  filter: drop-shadow(0 18px 20px rgba(52, 64, 56, 0.13));
  animation: avatar-breathe 10.8s cubic-bezier(0.37, 0, 0.63, 1) infinite;
  transition: filter 220ms ease;
  will-change: margin-bottom;
}

.avatar-frame {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-image: url("assets/avatar/wangwei-expression-sprite-v1.jpg");
  background-repeat: no-repeat;
  background-size: 200% 200%;
  transition: opacity 125ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity;
}

.avatar-frame--neutral {
  opacity: 1;
  background-position: 0 0;
}

.avatar-frame--a,
.avatar-frame--o {
  clip-path: ellipse(19% 10.5% at 52% 51.5%);
  -webkit-mask-image: radial-gradient(ellipse 19% 10.5% at 52% 51.5%, #000 42%, rgba(0, 0, 0, 0.88) 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 19% 10.5% at 52% 51.5%, #000 42%, rgba(0, 0, 0, 0.88) 62%, transparent 100%);
}

.avatar-frame--a { background-position: 100% 0; }
.avatar-frame--o { background-position: 0 100%; }

.avatar-call[data-mouth="a"] .avatar-frame--a,
.avatar-call[data-mouth="o"] .avatar-frame--o {
  opacity: clamp(0.58, calc(0.5 + var(--avatar-level) * 0.42), 0.92);
}

.avatar-call__identity,
.avatar-call__state {
  position: absolute;
  z-index: 4;
  bottom: 0.9rem;
  display: flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 6px 22px rgba(45, 58, 50, 0.08);
  backdrop-filter: blur(14px);
}

.avatar-call__identity {
  left: 1rem;
  gap: 0.45rem;
  padding: 0.38rem 0.72rem;
}

.avatar-call__identity strong {
  color: #263029;
  font-size: 0.78rem;
}

.avatar-call__identity span {
  color: #8a948e;
  font-size: 0.64rem;
}

.avatar-call__state {
  right: 1rem;
  gap: 0.42rem;
  padding: 0.38rem 0.72rem;
  color: #69756d;
  font-size: 0.7rem;
}

.avatar-call__state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #84a08d;
  box-shadow: 0 0 0 4px rgba(132, 160, 141, 0.12);
}

.avatar-call__close {
  position: absolute;
  z-index: 5;
  top: 0.75rem;
  right: 0.8rem;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(42, 61, 49, 0.09);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.66);
  color: #717c75;
  font-size: 1.15rem;
  line-height: 1;
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.avatar-call[data-avatar-state="listen"] .avatar-call__glow {
  border-color: rgba(85, 118, 230, 0.24);
  box-shadow:
    0 0 0 2.6rem rgba(85, 118, 230, 0.045),
    0 0 0 5.2rem rgba(85, 118, 230, 0.025);
}

.avatar-call[data-avatar-state="listen"] .avatar-call__state i {
  background: #5576e6;
  box-shadow: 0 0 0 4px rgba(85, 118, 230, 0.13);
}

.avatar-call[data-avatar-state="think"] .avatar-call__state i {
  background: #e5a06f;
  box-shadow: 0 0 0 4px rgba(229, 160, 111, 0.14);
}

.avatar-call[data-avatar-state="speak"] .avatar-portrait {
  filter: drop-shadow(0 19px 22px rgba(72, 91, 78, 0.17));
}

.avatar-call[data-avatar-state="speak"] .avatar-call__state i {
  background: #62b98e;
  box-shadow: 0 0 0 4px rgba(98, 185, 142, 0.14);
}

@keyframes avatar-breathe {
  0%, 100% { margin-bottom: 0; }
  31% { margin-bottom: 0.7px; }
  58% { margin-bottom: 1.15px; }
  79% { margin-bottom: 0.25px; }
}

@keyframes avatar-status-pulse {
  0%, 100% { transform: scale(0.88); opacity: 0.68; }
  50% { transform: scale(1.08); opacity: 1; }
}

@media (max-width: 780px) {
  #avatar-toggle-btn::before {
    content: "◉";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #66716a;
    font-size: 0.9rem;
  }

  #avatar-toggle-btn.is-active::before {
    color: #5576e6;
  }

  .avatar-call {
    flex-basis: 222px;
    min-height: 222px;
  }

  .avatar-portrait {
    bottom: -52px;
    width: 258px;
    height: 258px;
  }

  .avatar-call__glow {
    bottom: -8.7rem;
    width: 21rem;
    height: 21rem;
  }

  .avatar-call__identity,
  .avatar-call__state {
    bottom: 0.62rem;
    min-height: 30px;
  }

  .avatar-call__identity {
    left: 0.65rem;
  }

  .avatar-call__identity span {
    display: none;
  }

  .avatar-call__state {
    right: 0.65rem;
  }

  .avatar-call__close {
    top: 0.55rem;
    right: 0.6rem;
    width: 30px;
    height: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .avatar-portrait,
  .avatar-call__state i {
    animation: none !important;
  }
}

/* Immersive continuous-call surface */
.call-caption,
.call-controls {
  display: none;
}

body.is-call-active {
  overflow: hidden;
  overscroll-behavior: none;
}

body.is-call-active #time-stream,
body.is-call-active .grain {
  visibility: hidden;
}

body.is-call-active .app {
  position: fixed;
  z-index: 100;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: #dfe5df;
}

body.is-call-active .topbar,
body.is-call-active .stage__header,
body.is-call-active .stream,
body.is-call-active .live-stage,
body.is-call-active .composer,
body.is-call-active .composer__footer,
body.is-call-active .rail,
body.is-call-active .constellation {
  display: none !important;
}

body.is-call-active .shell {
  position: fixed;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100dvh;
  margin: 0;
  padding: 0;
  background: transparent;
}

body.is-call-active .stage {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.is-call-active .avatar-call {
  position: absolute;
  inset: 0;
  display: block !important;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.95), transparent 34%),
    radial-gradient(circle at 12% 18%, rgba(238, 163, 125, 0.19), transparent 29%),
    radial-gradient(circle at 88% 72%, rgba(91, 118, 202, 0.16), transparent 34%),
    linear-gradient(155deg, #e8ece6 0%, #f6f3eb 48%, #dce3df 100%);
}

body.is-call-active .avatar-call::before {
  inset: -3rem;
  width: auto;
  height: auto;
  transform: scale(1.08);
  border-radius: 0;
  background-image: url("assets/avatar/wangwei-expression-sprite-v1.jpg");
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 200% 200%;
  opacity: 0.2;
  filter: blur(36px) saturate(0.72);
}

body.is-call-active .avatar-call::after {
  z-index: 3;
  inset: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(27, 34, 30, 0.08) 0%, rgba(27, 34, 30, 0) 30%, rgba(27, 34, 30, 0.02) 60%, rgba(21, 27, 24, 0.3) 100%);
  filter: none;
}

body.is-call-active .avatar-call__glow {
  z-index: 1;
  bottom: -27vh;
  width: min(108vw, 100vh);
  height: min(108vw, 100vh);
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.13);
  box-shadow:
    0 0 0 7vh rgba(255, 255, 255, 0.045),
    0 0 0 14vh rgba(255, 255, 255, 0.024);
}

body.is-call-active .avatar-portrait {
  z-index: 2;
  bottom: clamp(4.5rem, 8vh, 7.5rem);
  width: min(84vh, 820px, 88vw);
  height: min(84vh, 820px, 88vw);
  max-width: none;
  border-radius: 0;
  filter: drop-shadow(0 28px 30px rgba(50, 61, 54, 0.16));
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 84%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 84%, transparent 100%);
}

body.is-call-active .avatar-call__identity,
body.is-call-active .avatar-call__state {
  z-index: 6;
  top: max(1rem, env(safe-area-inset-top));
  bottom: auto;
  min-height: 36px;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(31, 38, 34, 0.48);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 28px rgba(30, 39, 34, 0.12);
  backdrop-filter: blur(18px);
}

body.is-call-active .avatar-call__identity {
  left: max(1rem, env(safe-area-inset-left));
}

body.is-call-active .avatar-call__identity strong,
body.is-call-active .avatar-call__identity span {
  color: #fff;
}

body.is-call-active .avatar-call__identity span {
  opacity: 0.68;
}

body.is-call-active .avatar-call__state {
  right: 50%;
  transform: translateX(50%);
}

body.is-call-active .avatar-call__state i {
  background: #65dfa7;
  box-shadow: 0 0 0 4px rgba(101, 223, 167, 0.18), 0 0 12px rgba(101, 223, 167, 0.55);
}

body.is-call-active .avatar-call__close {
  display: none;
}

body.is-call-active .call-caption {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: calc(max(7.9rem, env(safe-area-inset-bottom) + 7.1rem));
  display: block;
  width: min(38rem, calc(100vw - 2rem));
  padding: 0.72rem 1rem 0.78rem;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  background: rgba(22, 28, 25, 0.64);
  color: #fff;
  text-align: center;
  box-shadow: 0 12px 36px rgba(21, 28, 24, 0.16);
  backdrop-filter: blur(18px);
}

body.is-call-active .call-caption__speaker {
  display: block;
  margin-bottom: 0.2rem;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.69rem;
  letter-spacing: 0.04em;
}

body.is-call-active .call-caption__text {
  margin: 0;
  font-size: clamp(0.9rem, 2.3vw, 1.08rem);
  line-height: 1.55;
}

body.is-call-active .call-controls {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(1.8rem, 7vw, 3.8rem);
  transform: translateX(-50%);
}

.call-control {
  display: grid;
  justify-items: center;
  gap: 0.42rem;
  min-width: 68px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
}

.call-control > span,
.call-control > svg {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
  background: rgba(31, 38, 34, 0.55);
  box-shadow: 0 10px 28px rgba(26, 34, 29, 0.18);
  backdrop-filter: blur(18px);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.call-control:hover > span,
.call-control:hover > svg,
.call-control:focus-visible > span,
.call-control:focus-visible > svg {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.52);
}

.call-control:focus-visible {
  outline: 0;
}

.call-control small {
  font-size: 0.72rem;
  font-weight: 600;
  text-shadow: 0 1px 8px rgba(18, 25, 21, 0.35);
}

.call-control__caption-icon {
  font-size: 0.67rem;
  font-weight: 720;
}

.call-control--caption[aria-pressed="true"] > span {
  border-color: rgba(111, 139, 235, 0.7);
  background: rgba(85, 118, 230, 0.88);
}

.call-control--end > svg {
  padding: 15px;
  background: #df625d;
  border-color: rgba(255, 255, 255, 0.32);
  fill: none;
  stroke: #fff;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.is-call-active.is-speaking .avatar-call__glow {
  border-color: rgba(101, 223, 167, 0.58);
  box-shadow:
    0 0 0 7vh rgba(101, 223, 167, 0.04),
    0 0 0 14vh rgba(101, 223, 167, 0.02);
}

@media (max-width: 780px) {
  body.is-call-active .avatar-portrait {
    bottom: clamp(5.6rem, 12vh, 7.2rem);
    width: min(132vw, 72vh, 680px);
    height: min(132vw, 72vh, 680px);
  }

  body.is-call-active .avatar-call__identity {
    left: max(0.75rem, env(safe-area-inset-left));
  }

  body.is-call-active .avatar-call__state {
    right: max(0.75rem, env(safe-area-inset-right));
    transform: none;
  }

  body.is-call-active .avatar-call__identity span {
    display: none;
  }

  body.is-call-active .call-caption {
    bottom: calc(max(7.7rem, env(safe-area-inset-bottom) + 7rem));
  }
}

@media (max-width: 380px) {
  body.is-call-active .avatar-call__identity {
    display: none;
  }
}
