:root {
  --navy-950: #06101f;
  --navy-900: #0b1a33;
  --navy-800: #122744;
  --navy-700: #1a3558;
  --gold-400: #e8c56a;
  --gold-500: #d4af37;
  --gold-600: #b8922a;
  --cream: #f7f1e4;
  --cream-dim: #c9c0ae;
  --rose: #c45c6a;
  --ok: #3ecf8e;
  --danger: #ff6b7a;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--cream);
  background: radial-gradient(1200px 700px at 10% -10%, #1a3a66 0%, transparent 55%),
              radial-gradient(900px 600px at 100% 0%, #3a2a12 0%, transparent 45%),
              linear-gradient(160deg, var(--navy-950), var(--navy-900) 40%, #0a1628);
  min-height: 100%;
  min-height: 100dvh;
}

.bg-glow {
  pointer-events: none;
  position: fixed;
  inset: auto -20% -30% auto;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.12), transparent 65%);
  filter: blur(10px);
  z-index: 0;
}

.view {
  position: relative;
  z-index: 1;
  min-height: 100%;
  min-height: 100dvh;
}

.hidden { display: none !important; }

/* AUTH */
#auth-view {
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(18, 39, 68, 0.92), rgba(11, 26, 51, 0.96));
  border: 1px solid rgba(232, 197, 106, 0.22);
  border-radius: 24px;
  padding: 28px 24px 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}
.brand-mark, .avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.04em;
  color: var(--navy-950);
  background: linear-gradient(145deg, var(--gold-400), var(--gold-600));
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.28);
}
.brand h1, .topbar h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.85rem;
}
.tagline, .status-line {
  margin: 2px 0 0;
  color: var(--cream-dim);
  font-size: 0.85rem;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 5px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--cream-dim);
  padding: 10px;
  border-radius: 9px;
  font: inherit;
  cursor: pointer;
}
.tab.active {
  background: rgba(232, 197, 106, 0.16);
  color: var(--gold-400);
  font-weight: 600;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--cream-dim);
}
input, textarea {
  font: inherit;
  color: var(--cream);
  background: rgba(6, 16, 31, 0.65);
  border: 1px solid rgba(232, 197, 106, 0.18);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus {
  border-color: rgba(232, 197, 106, 0.55);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
.hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--cream-dim);
  line-height: 1.4;
}
.badge-inline {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-inline.owner {
  background: rgba(232, 197, 106, 0.2);
  color: var(--gold-400);
}
.api-hint {
  margin: 16px 0 0;
  text-align: center;
  font-size: 0.72rem;
  color: rgba(201, 192, 174, 0.7);
}
.api-hint code {
  color: var(--gold-400);
  font-size: 0.72rem;
}

.btn {
  font: inherit;
  font-weight: 500;
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.12s, background 0.12s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: var(--navy-950);
  font-weight: 600;
}
.btn.gold {
  background: rgba(232, 197, 106, 0.2);
  color: var(--gold-400);
  border: 1px solid rgba(232, 197, 106, 0.35);
}
.btn.ghost {
  background: transparent;
  color: var(--cream-dim);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn.tool {
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream-dim);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 7px 12px;
  font-size: 0.8rem;
  border-radius: 999px;
}
.btn.tool.live-talk {
  border-color: rgba(62, 207, 142, 0.35);
  color: #9dffd0;
  background: rgba(62, 207, 142, 0.08);
}
.btn.tool.live-talk.listening,
.btn.tool.live-talk[aria-pressed="true"] {
  background: rgba(62, 207, 142, 0.28);
  color: #eafff5;
  box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.2);
  animation: livePulse 1.2s ease-in-out infinite;
}
.btn.send {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  padding: 0;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.live-talk-status {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: #9dffd0;
  min-height: 1.1em;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(62, 207, 142, 0.18); }
  50% { box-shadow: 0 0 0 5px rgba(62, 207, 142, 0.28); }
}

.error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 107, 122, 0.12);
  color: #ffb0b8;
  font-size: 0.85rem;
}
.error.compact { margin: 8px 0 0; }

/* CHAT */
#chat-view {
  display: flex;
  flex-direction: column;
  max-width: 760px;
  margin: 0 auto;
  height: 100%;
  height: 100dvh;
  background: rgba(11, 26, 51, 0.55);
  border-left: 1px solid rgba(232, 197, 106, 0.08);
  border-right: 1px solid rgba(232, 197, 106, 0.08);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(232, 197, 106, 0.12);
  background: rgba(6, 16, 31, 0.72);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}
.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 1.25rem;
  overflow: hidden;
  padding: 0;
}
.avatar-img-wrap {
  background: linear-gradient(145deg, var(--gold-400), var(--gold-600));
}
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  border-radius: inherit;
}

/* Companions strip + create modal */
.companions-strip {
  flex-shrink: 0;
  padding: 8px 14px 10px;
  border-bottom: 1px solid rgba(232, 197, 106, 0.1);
  background: rgba(6, 16, 31, 0.45);
}
.companions-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.companions-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-dim);
  font-weight: 600;
}
.btn.tool.create-chip {
  border-color: rgba(232, 197, 106, 0.35);
  color: var(--gold-400);
  background: rgba(232, 197, 106, 0.1);
}
.companions-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.companion-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream-dim);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}
.companion-chip.active {
  border-color: rgba(232, 197, 106, 0.55);
  background: rgba(232, 197, 106, 0.16);
  color: var(--gold-400);
  font-weight: 600;
}
.companion-chip .chip-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--navy-950);
  background: linear-gradient(145deg, var(--gold-400), var(--gold-600));
}
.companion-chip.featured .chip-mark {
  box-shadow: 0 0 0 2px rgba(232, 197, 106, 0.35);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 10, 20, 0.72);
  backdrop-filter: blur(6px);
}
.modal.hidden { display: none !important; }
.modal-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(18, 39, 68, 0.98), rgba(11, 26, 51, 0.98));
  border: 1px solid rgba(232, 197, 106, 0.28);
  border-radius: 20px;
  padding: 22px 20px 18px;
  box-shadow: var(--shadow);
}
.modal-card h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.45rem;
  color: var(--cream);
}
.modal-sub {
  margin: 6px 0 14px;
  font-size: 0.82rem;
  color: var(--cream-dim);
  line-height: 1.4;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.status-line .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 6px;
  box-shadow: 0 0 8px var(--ok);
}
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 5px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream-dim);
}
.badge.owner_free { background: rgba(232, 197, 106, 0.2); color: var(--gold-400); }
.badge.trialing { background: rgba(62, 207, 142, 0.15); color: #7dffc0; }
.badge.active { background: rgba(62, 207, 142, 0.2); color: var(--ok); }
.badge.expired { background: rgba(255, 107, 122, 0.18); color: var(--danger); }

/* Avatar panel */
.avatar-panel {
  flex-shrink: 0;
  border-bottom: 1px solid rgba(232, 197, 106, 0.12);
  background: linear-gradient(180deg, rgba(6, 16, 31, 0.85), rgba(11, 26, 51, 0.55));
  overflow: hidden;
  transition: background 0.35s ease;
}
.avatar-panel-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  border: 0;
  background: transparent;
  color: var(--cream-dim);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.avatar-panel-toggle .toggle-chevron {
  transition: transform 0.2s ease;
  color: var(--gold-400);
}
.avatar-panel.collapsed .toggle-chevron { transform: rotate(-90deg); }
.avatar-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 14px;
}
.avatar-frame {
  position: relative;
  width: min(100%, 420px);
  height: 360px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(232, 197, 106, 0.28);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35), inset 0 0 40px rgba(212, 175, 55, 0.06);
  background: #0a1628;
}
.avatar-motion {
  position: absolute;
  inset: 0;
  transform-origin: center 35%;
  animation: idleSway 5.5s ease-in-out infinite;
  will-change: transform;
}
.panel-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  transform-origin: center 30%;
  animation: breathe 4.8s ease-in-out infinite, kenburns 28s ease-in-out infinite alternate;
  will-change: transform, object-position;
  transition: opacity 0.35s ease, filter 0.4s ease;
}
.mouth-overlay {
  pointer-events: none;
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 18%;
  height: 7%;
  transform: translateX(-50%) scaleY(0.35);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(60, 20, 30, 0.55) 0%, rgba(60, 20, 30, 0.15) 55%, transparent 72%);
  opacity: 0;
  clip-path: ellipse(48% 42% at 50% 50%);
  transition: opacity 0.2s ease;
}
.blink-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 28%,
    rgba(6, 16, 31, 0.72) 42%,
    rgba(6, 16, 31, 0.72) 48%,
    transparent 58%
  );
  opacity: 0;
  animation: blink 6.8s ease-in-out infinite;
}
.emotion-glow {
  pointer-events: none;
  position: absolute;
  inset: auto 0 0 0;
  height: 38%;
  background: linear-gradient(transparent, rgba(6, 16, 31, 0.45));
  transition: background 0.45s ease, box-shadow 0.45s ease;
}
.avatar-chip {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--cream-dim);
  background: rgba(232, 197, 106, 0.1);
  border: 1px solid rgba(232, 197, 106, 0.22);
  border-radius: 999px;
  padding: 5px 12px;
}
.footer-chip {
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.7rem;
  color: rgba(201, 192, 174, 0.65);
}

/* Outfit switcher */
.outfit-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 100%;
}
.outfit-chip {
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(232, 197, 106, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream-dim);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.outfit-chip:active { transform: scale(0.97); }
.outfit-chip.active {
  background: rgba(232, 197, 106, 0.2);
  border-color: rgba(232, 197, 106, 0.55);
  color: var(--gold-400);
}
.outfit-chip:focus-visible {
  outline: 2px solid rgba(232, 197, 106, 0.55);
  outline-offset: 2px;
}

@keyframes breathe {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.032) translateY(-3px); }
}
@keyframes kenburns {
  0% { object-position: center 16%; }
  100% { object-position: 48% 22%; }
}
@keyframes idleSway {
  0%, 100% { transform: rotate(-0.6deg) translateX(-2px); }
  50% { transform: rotate(0.7deg) translateX(3px); }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) scale(1) rotate(-0.4deg); }
  50% { transform: translateY(-6px) scale(1.025) rotate(0.5deg); }
}
@keyframes blink {
  0%, 90%, 100% { opacity: 0; }
  92%, 96% { opacity: 0.7; }
  94% { opacity: 0.9; }
}
@keyframes talkBounce {
  0%, 100% { transform: scale(1) translateY(0) rotate(-0.8deg); }
  25% { transform: scale(1.04) translateY(-4px) rotate(0.6deg); }
  50% { transform: scale(1.02) translateY(-2px) rotate(-0.4deg); }
  75% { transform: scale(1.05) translateY(-5px) rotate(0.9deg); }
}
@keyframes mouthTalk {
  0%, 100% { transform: translateX(-50%) scaleY(0.35) scaleX(1); opacity: 0.55; }
  30% { transform: translateX(-50%) scaleY(1.15) scaleX(1.08); opacity: 0.85; }
  55% { transform: translateX(-50%) scaleY(0.5) scaleX(0.95); opacity: 0.6; }
  80% { transform: translateX(-50%) scaleY(1.05) scaleX(1.04); opacity: 0.8; }
}
@keyframes torsoTalk {
  0%, 100% { transform: rotate(-1.2deg) translateY(0) scale(1); }
  40% { transform: rotate(1.4deg) translateY(-4px) scale(1.02); }
  70% { transform: rotate(-0.8deg) translateY(-2px) scale(1.01); }
}

/* Talking state — stronger motion + mouth */
.avatar-panel.talking .avatar-motion {
  animation: torsoTalk 0.55s ease-in-out infinite;
}
.avatar-panel.talking .panel-portrait {
  animation: talkBounce 0.7s ease-in-out infinite, kenburns 18s ease-in-out infinite alternate;
}
.avatar-panel.talking .mouth-overlay {
  opacity: 0.9;
  animation: mouthTalk 0.28s ease-in-out infinite;
}
.avatar-panel.talking .emotion-glow {
  background: linear-gradient(transparent, rgba(232, 197, 106, 0.32));
  box-shadow: 0 -20px 40px rgba(232, 197, 106, 0.12);
}

/* Emotion states via data-emotion */
.avatar-panel[data-emotion="listening"] .emotion-glow {
  background: linear-gradient(transparent, rgba(62, 207, 142, 0.18));
}
.avatar-panel[data-emotion="happy"] .emotion-glow {
  background: linear-gradient(transparent, rgba(232, 197, 106, 0.28));
}
.avatar-panel[data-emotion="happy"] .avatar-motion {
  animation: idleSway 4.2s ease-in-out infinite;
}
.avatar-panel[data-emotion="thinking"] .panel-portrait {
  animation: breathe 2.4s ease-in-out infinite, kenburns 18s ease-in-out infinite alternate;
  filter: saturate(0.92) brightness(0.96);
}
.avatar-panel[data-emotion="thinking"] .emotion-glow {
  background: linear-gradient(transparent, rgba(90, 140, 220, 0.28));
}
.avatar-panel[data-emotion="thinking"] .avatar-motion {
  animation: idleSway 7s ease-in-out infinite;
}
.avatar-panel[data-emotion="concerned"] .emotion-glow {
  background: linear-gradient(transparent, rgba(196, 92, 106, 0.22));
}
.avatar-panel[data-emotion="concerned"] .panel-portrait {
  filter: saturate(0.9) brightness(0.95);
}
.avatar-panel[data-emotion="playful"] .panel-portrait {
  animation: floaty 3.6s ease-in-out infinite, kenburns 22s ease-in-out infinite alternate;
}
.avatar-panel[data-emotion="playful"] .emotion-glow {
  background: linear-gradient(transparent, rgba(232, 120, 180, 0.22));
}
.avatar-panel[data-emotion="playful"] .avatar-motion {
  animation: idleSway 3.8s ease-in-out infinite;
}
.avatar-panel[data-emotion="serious"] .panel-portrait {
  filter: saturate(0.85) contrast(1.05);
}
.avatar-panel[data-emotion="serious"] .emotion-glow {
  background: linear-gradient(transparent, rgba(11, 26, 51, 0.55));
}
.avatar-panel[data-emotion="serious"] .avatar-motion {
  animation: idleSway 8s ease-in-out infinite;
}

/* Emotion pose transition nudge */
.avatar-panel.emotion-shift .panel-portrait {
  animation: none;
  transform: scale(1.04) translateY(-4px);
  transition: transform 0.45s ease;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  min-height: 0;
}
.bubble {
  max-width: min(85%, 520px);
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95rem;
  animation: rise 0.22s ease-out;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.bubble.user {
  align-self: flex-end;
  background: linear-gradient(145deg, #264a78, #1a3558);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-right-radius: 6px;
}
.bubble.assistant {
  align-self: flex-start;
  background: linear-gradient(145deg, rgba(232, 197, 106, 0.14), rgba(18, 39, 68, 0.9));
  border: 1px solid rgba(232, 197, 106, 0.22);
  border-bottom-left-radius: 6px;
}
.bubble.break {
  align-self: center;
  max-width: 90%;
  text-align: center;
  font-size: 0.75rem;
  color: var(--cream-dim);
  background: transparent;
  border: 0;
  padding: 4px;
  opacity: 0.7;
}
.bubble .meta {
  display: block;
  margin-top: 6px;
  font-size: 0.68rem;
  opacity: 0.55;
}
.typing {
  align-self: flex-start;
  color: var(--cream-dim);
  font-size: 0.85rem;
  padding: 8px 4px;
}

.suggest-bar {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid rgba(232, 197, 106, 0.12);
  background: rgba(6, 16, 31, 0.55);
  flex-shrink: 0;
}
.suggest-bar input { flex: 1; }

.composer {
  padding: 10px 16px 16px;
  border-top: 1px solid rgba(232, 197, 106, 0.12);
  background: rgba(6, 16, 31, 0.78);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}
.composer-tools {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.send-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
#msg-input {
  flex: 1;
  resize: none;
  max-height: 140px;
  min-height: 48px;
  line-height: 1.4;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 50;
  background: rgba(6, 16, 31, 0.95);
  border: 1px solid rgba(232, 197, 106, 0.35);
  color: var(--cream);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  max-width: min(92vw, 420px);
  text-align: center;
}

@media (max-width: 640px) {
  #chat-view { border: 0; max-width: none; }
  .topbar h2 { font-size: 1.35rem; }
  .btn.ghost { padding: 8px 10px; font-size: 0.8rem; }
  .avatar-panel-toggle { display: flex; }
  .avatar-frame { height: 220px; border-radius: 14px; }
  .avatar-panel.collapsed .avatar-stage { display: none; }
  .avatar-panel.collapsed { border-bottom-color: rgba(232, 197, 106, 0.08); }
  .footer-chip { display: none; }
  .outfit-chip { padding: 7px 14px; font-size: 0.78rem; }
  .btn.tool.live-talk { flex: 1 1 auto; min-height: 36px; }
}

@media (min-width: 641px) {
  .avatar-frame { height: clamp(320px, 38vh, 400px); }
  .avatar-panel-toggle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .panel-portrait, .blink-overlay, .avatar-motion, .mouth-overlay,
  .avatar-panel.talking .panel-portrait,
  .avatar-panel.talking .avatar-motion,
  .avatar-panel.talking .mouth-overlay,
  .btn.tool.live-talk.listening {
    animation: none !important;
  }
  .mouth-overlay { opacity: 0 !important; }
}

.chip-mark { overflow: hidden; display: inline-flex; align-items: center; justify-content: center; }
.chip-avatar { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.companions-label { letter-spacing: 0.02em; }
.create-chip { font-weight: 600; }
