:root {
  color-scheme: dark;
  --page: #17120e;
  --page-soft: #211912;
  --panel: #2a2018;
  --panel-deep: #1d1712;
  --paper: #ead8b6;
  --paper-soft: #d8c39f;
  --ink: #2a2119;
  --cream: #f3e6ca;
  --cream-soft: #cdbb99;
  --muted: #9d8b70;
  --line: #5f4834;
  --line-light: #8c6c4b;
  --amber: #d68c3e;
  --amber-dark: #8c5427;
  --sage: #79917b;
  --danger: #b7634d;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--page);
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--cream);
  background: var(--page);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

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

.app-shell {
  width: min(1600px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 24px 16px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 64px;
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
}

.brand {
  display: flex;
  align-items: baseline;
  width: fit-content;
  gap: 13px;
  color: var(--cream);
  text-decoration: none;
}

.brand-cn {
  font-family: "Songti SC", "STSong", serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.brand-sub,
.panel-eyebrow,
.footer,
.scene-hud span {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.12em;
}

.brand-sub {
  color: var(--muted);
  font-size: 9px;
}

.room-title {
  display: grid;
  gap: 3px;
  text-align: center;
}

.room-title span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.room-title strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.device-status {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--cream-soft);
  font-size: 11px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border: 1px solid #b8c5ac;
  background: var(--sage);
  box-shadow: 2px 2px 0 #263127;
}

.workspace {
  display: grid;
  grid-template-columns: 276px minmax(520px, 1fr) 310px;
  gap: 14px;
  min-height: 766px;
  padding-top: 14px;
}

.panel {
  border: 2px solid var(--line);
  background: var(--panel);
  box-shadow: 5px 5px 0 #0c0907;
}

.setup-panel,
.journal-panel {
  padding: 24px 21px;
}

.panel-eyebrow {
  display: block;
  color: var(--amber);
  font-size: 8px;
  font-weight: 700;
}

.setup-panel h1 {
  max-width: 220px;
  margin: 10px 0 8px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.35;
}

.panel-lead {
  margin: 0 0 19px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.role-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.role-card {
  display: grid;
  min-width: 0;
  border: 2px solid #4f3d2e;
  padding: 5px;
  color: var(--cream-soft);
  background: var(--panel-deep);
  cursor: pointer;
  text-align: left;
  box-shadow: 3px 3px 0 #120d0a;
}

.role-card:hover {
  border-color: var(--line-light);
}

.role-card.active {
  border-color: var(--amber);
  color: var(--cream);
  box-shadow: 3px 3px 0 var(--amber-dark);
}

.role-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 0.72;
  object-fit: cover;
  object-position: 50% 24%;
  border: 1px solid #6a4d35;
  image-rendering: pixelated;
}

.role-card span {
  display: grid;
  gap: 2px;
  padding: 8px 4px 5px;
}

.role-card strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 13px;
}

.role-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-card {
  display: grid;
  gap: 8px;
  margin-top: 13px;
  border: 2px solid #4f3d2e;
  padding: 12px;
  background: var(--panel-deep);
  box-shadow: 3px 3px 0 #120d0a;
}

.weather-card > div {
  display: grid;
  gap: 4px;
}

.weather-card span,
.weather-card small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.weather-card strong {
  color: var(--cream-soft);
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
}

.weather-card button,
.scene-director button {
  border: 1px solid var(--line-light);
  border-radius: 0;
  padding: 7px 9px;
  color: var(--cream);
  background: #38291e;
  cursor: pointer;
}

.weather-card button:hover,
.scene-director button:hover,
.scene-director button.active {
  border-color: var(--amber);
  color: #23170f;
  background: var(--amber);
}

.weather-card.syncing button {
  opacity: 0.65;
  cursor: wait;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 7px;
  color: var(--muted);
  font-size: 9px;
}

.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.form-stack {
  display: grid;
}

.field {
  display: grid;
  gap: 7px;
  padding: 11px 0;
  border-bottom: 1px solid #4c3a2c;
}

.field > span {
  color: var(--muted);
  font-size: 9px;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  outline: 0;
  padding: 2px 0 5px;
  color: var(--cream);
  background: var(--panel);
  font-size: 12px;
}

.field input:focus,
.field select:focus {
  border-bottom-color: var(--amber);
}

.field select {
  cursor: pointer;
}

.local-note {
  display: grid;
  gap: 5px;
  margin-top: 20px;
  border-left: 3px solid var(--sage);
  padding: 10px 12px;
  color: var(--muted);
  background: var(--panel-deep);
  font-size: 9px;
  line-height: 1.55;
}

.local-note strong {
  color: var(--cream-soft);
  font-weight: 600;
}

.scene-column {
  display: grid;
  grid-template-rows: minmax(470px, 1fr) auto auto auto;
  min-width: 0;
}

.scene-frame {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  border: 2px solid var(--line-light);
  background: #0c0c0b;
  box-shadow: 5px 5px 0 #0c0907;
}

.character-art {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 500px;
  object-fit: cover;
  object-position: 50% 44%;
  image-rendering: pixelated;
  transform-origin: 50% 68%;
  transition: opacity 140ms linear, transform 240ms ease-out;
  animation: companion-breathe 5.2s ease-in-out infinite;
}

.character-art.changing {
  opacity: 0.28;
}

.character-art[data-motion="listening"] {
  animation: companion-listen 1.9s ease-in-out infinite;
}

.character-art[data-motion="thinking"] {
  animation: companion-think 3.2s ease-in-out infinite;
}

.character-art[data-motion="speaking"] {
  animation: companion-speak 700ms ease-in-out infinite alternate;
}

@keyframes companion-breathe {
  0%, 100% { transform: scale(1); }
  52% { transform: scale(1.008) translateY(-2px); }
}

@keyframes companion-listen {
  0%, 100% { transform: scale(1.012) translateX(0); }
  50% { transform: scale(1.02) translateX(-3px); }
}

@keyframes companion-think {
  0%, 100% { transform: scale(1.004) translateY(0); }
  50% { transform: scale(1.012) translateY(2px); }
}

@keyframes companion-speak {
  from { transform: scale(1.012) translateY(0); }
  to { transform: scale(1.024) translateY(-4px); }
}

.scene-hud,
.presence-state {
  position: absolute;
  border: 2px solid #8b6746;
  color: var(--cream);
  background: rgba(29, 23, 18, 0.92);
  box-shadow: 3px 3px 0 rgba(8, 6, 4, 0.75);
}

.scene-hud {
  top: 16px;
  display: grid;
  gap: 4px;
  padding: 9px 11px;
}

.scene-hud-left {
  left: 16px;
}

.scene-hud-right {
  right: 16px;
}

.scene-hud-right strong {
  color: var(--amber);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.scene-director {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 2px solid #8b6746;
  padding: 5px;
  background: rgba(29, 23, 18, 0.92);
  box-shadow: 3px 3px 0 rgba(8, 6, 4, 0.75);
}

.scene-director > span {
  padding: 0 5px;
  color: var(--paper-soft);
  font-size: 8px;
}

.scene-director button {
  min-width: 29px;
  padding: 4px 7px;
  font-size: 9px;
}

.scene-hud span {
  color: var(--paper-soft);
  font-size: 8px;
}

.scene-hud strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 13px;
}

.presence-state {
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: var(--paper-soft);
  font-size: 9px;
}

.dialogue-card {
  position: relative;
  z-index: 2;
  min-height: 125px;
  margin: -10px 16px 0;
  border: 3px solid #5a3f2c;
  padding: 18px 20px 17px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 5px 5px 0 #22160f;
}

.dialogue-card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid #b99d72;
  pointer-events: none;
}

.speaker-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 11px;
}

.speaker-row strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 17px;
}

.speaker-row span {
  color: #78634b;
  font-size: 9px;
}

.dialogue-card p {
  position: relative;
  z-index: 1;
  margin: 13px 0 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.72;
}

.composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 15px;
}

.talk-button,
.send-button,
.text-toggle {
  border: 2px solid var(--line-light);
  border-radius: 0;
  background: var(--panel);
  cursor: pointer;
  box-shadow: 3px 3px 0 #0c0907;
}

.talk-button {
  display: grid;
  min-width: 130px;
  gap: 2px;
  padding: 10px 15px;
  text-align: left;
}

.talk-button strong {
  font-size: 12px;
}

.talk-button small {
  color: var(--muted);
  font-size: 8px;
}

.talk-button:hover,
.send-button:hover,
.text-toggle:hover {
  border-color: var(--amber);
}

.talk-button.recording {
  border-color: #da8b6f;
  background: #4a2922;
  box-shadow: 3px 3px 0 #7a3428;
}

.message-field {
  display: flex;
  min-width: 0;
  border: 2px solid var(--line);
  background: var(--page-soft);
  box-shadow: inset 0 -2px #110d0a;
}

.message-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 14px;
  color: var(--cream);
  background: transparent;
  font-size: 12px;
}

.message-field:focus-within {
  border-color: var(--amber);
}

.message-field input::placeholder {
  color: #72624f;
}

.send-button {
  padding: 0 22px;
  color: #22170f;
  border-color: #e0a45f;
  background: var(--amber);
  font-size: 12px;
  font-weight: 700;
}

.composer-tip {
  margin: 9px 1px 0;
  color: #796b58;
  font-size: 9px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.panel-heading h2 {
  margin: 8px 0 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
}

.text-toggle {
  padding: 7px 9px;
  color: var(--cream-soft);
  font-size: 9px;
}

.relationship-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 22px;
  border: 2px solid #624a36;
  padding: 15px;
  background: var(--panel-deep);
  box-shadow: 3px 3px 0 #120d0a;
}

.relationship-copy {
  display: grid;
  gap: 5px;
}

.relationship-copy span,
.mood-note > span {
  color: var(--muted);
  font-size: 9px;
}

.relationship-copy strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
}

.relationship-number {
  display: flex;
  align-items: baseline;
  color: var(--amber);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.relationship-number span {
  font-size: 25px;
}

.relationship-number small {
  font-size: 9px;
}

.meter {
  grid-column: 1 / -1;
  height: 7px;
  border: 1px solid #624a36;
  padding: 1px;
  background: #100c09;
}

.meter span {
  display: block;
  width: 8%;
  height: 100%;
  background: var(--amber);
  transition: width 220ms steps(5, end);
}

.relationship-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.mood-note {
  margin-top: 12px;
  border-left: 3px solid var(--amber);
  padding: 11px 12px;
  background: #33251a;
}

.mood-note p {
  margin: 7px 0 0;
  color: var(--cream-soft);
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
  line-height: 1.6;
}

.conversation-log,
.memory-section {
  margin-top: 22px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

.section-title strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 13px;
}

.section-title span {
  color: #776753;
  font-size: 8px;
}

#conversation-list,
.memory-list {
  display: grid;
  gap: 0;
  max-height: 188px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  scrollbar-color: var(--line-light) var(--panel);
  scrollbar-width: thin;
}

#conversation-list li {
  padding: 11px 0;
  border-bottom: 1px solid #463529;
}

#conversation-list li span {
  color: var(--amber);
  font-size: 8px;
}

#conversation-list li.user-line span {
  color: #95a892;
}

#conversation-list li p,
.memory-list li p {
  margin: 5px 0 0;
  color: var(--cream-soft);
  font-size: 10px;
  line-height: 1.55;
}

.memory-list {
  max-height: 180px;
}

.memory-list li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid #463529;
}

.memory-list time {
  color: var(--amber);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 8px;
}

.memory-list li p {
  margin: -2px 0 0;
}

.footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 44px;
  color: #6f604d;
  font-size: 8px;
}

.footer span:last-child {
  justify-self: end;
}

body[data-role="zhouxu"] {
  --amber: #c79558;
  --amber-dark: #72502e;
  --sage: #738c83;
}

@media (max-width: 1190px) {
  .workspace {
    grid-template-columns: 250px minmax(480px, 1fr);
  }

  .journal-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
  }

  .journal-panel .panel-heading {
    grid-column: 1 / -1;
  }

  .conversation-log,
  .memory-section {
    margin-top: 18px;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 12px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .room-title {
    display: none;
  }

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

  .scene-column {
    grid-row: 1;
  }

  .setup-panel {
    grid-row: 2;
  }

  .journal-panel {
    grid-row: 3;
    grid-column: auto;
  }

  .scene-frame,
  .character-art {
    min-height: 440px;
  }

  .dialogue-card {
    margin-inline: 8px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 8px;
  }

  .topbar {
    min-height: 54px;
  }

  .brand-cn {
    font-size: 22px;
  }

  .brand-sub,
  .device-status span:last-child {
    display: none;
  }

  .workspace {
    gap: 10px;
    padding-top: 10px;
  }

  .scene-frame,
  .character-art {
    min-height: 390px;
  }

  .scene-hud {
    top: 10px;
  }

  .scene-hud-left {
    left: 10px;
  }

  .scene-hud-right {
    right: 10px;
  }

  .presence-state {
    right: 10px;
    bottom: 10px;
  }

  .scene-director {
    left: 10px;
    bottom: 48px;
  }

  .dialogue-card {
    min-height: 132px;
    padding: 17px;
  }

  .dialogue-card p {
    font-size: 15px;
  }

  .composer {
    grid-template-columns: 1fr auto;
  }

  .talk-button {
    grid-column: 1 / -1;
  }

  .send-button {
    padding-inline: 18px;
  }

  .setup-panel,
  .journal-panel {
    padding: 20px 17px;
  }

  .journal-panel {
    display: block;
  }

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

  .footer span:nth-child(2) {
    display: none;
  }
}

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

/* Immersive device experience: the character owns the entire surface. */
.immersive-body {
  min-height: 100svh;
  background: #0d0907;
}

.companion-shell {
  width: min(100vw, 1180px);
  min-height: 100svh;
  margin: auto;
  padding: 18px;
}

.companion-stage {
  position: relative;
  height: calc(100svh - 36px);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid #6c5038;
  border-radius: 24px;
  background: #120e0b;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}

.scene-renderer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #15100c;
  image-rendering: pixelated;
}

.scene-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  transition: opacity 180ms linear;
}

.character-rig {
  position: absolute;
  z-index: 2;
  bottom: 0;
  left: 50%;
  height: 100%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  animation: layered-breathe 5.2s ease-in-out infinite;
}

.character-rig > .character-art,
.character-rig > .character-motion {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: fill;
  image-rendering: pixelated;
  transform: none;
  animation: none;
}

.character-rig > [hidden] { display: none !important; }

.character-rig[data-video="true"] { animation: none; }

.character-rig[data-motion="listening"] { animation: layered-listen 1.9s ease-in-out infinite; }
.character-rig[data-motion="thinking"] { animation: layered-think 3.2s ease-in-out infinite; }
.character-rig[data-motion="speaking"] { animation: layered-speak 700ms ease-in-out infinite alternate; }

.weather-foreground {
  position: absolute;
  z-index: 4;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}


@keyframes layered-breathe {
  0%, 100% { transform: translateX(-50%) scale(1); }
  52% { transform: translateX(-50%) scale(1.008) translateY(-2px); }
}

@keyframes layered-listen {
  0%, 100% { transform: translateX(-50%) scale(1.006); }
  50% { transform: translateX(-50%) scale(1.014) translateX(-2px); }
}

@keyframes layered-think {
  0%, 100% { transform: translateX(-50%) scale(1.003); }
  50% { transform: translateX(-50%) scale(1.01) translateY(2px); }
}

@keyframes layered-speak {
  from { transform: translateX(-50%) scale(1.008); }
  to { transform: translateX(-50%) scale(1.017) translateY(-3px); }
}

.companion-stage > .character-art {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-position: 50% 38%;
}

.stage-vignette {
  position: absolute;
  z-index: 5;
  inset: 0;
  background: rgba(11, 7, 5, .04);
  box-shadow: inset 0 -290px 180px -120px rgba(11, 7, 5, .95), inset 0 120px 90px -100px rgba(11, 7, 5, .72);
  pointer-events: none;
}

.quiet-header {
  position: absolute;
  z-index: 6;
  top: 28px;
  left: 32px;
  display: grid;
  gap: 5px;
  text-shadow: 0 2px 8px #000;
}

.quiet-header strong {
  font: 700 23px "Songti SC", serif;
  letter-spacing: .05em;
}

.quiet-header span {
  color: #d3c1a3;
  font-size: 10px;
  letter-spacing: .08em;
}

.floating-dialogue {
  position: absolute;
  z-index: 6;
  left: clamp(22px, 5vw, 62px);
  right: clamp(22px, 5vw, 62px);
  bottom: 120px;
  min-height: 105px;
  border: 1px solid rgba(221, 191, 151, .46);
  border-radius: 18px;
  padding: 22px 26px;
  color: #fff6e6;
  background: rgba(27, 20, 15, .82);
  box-shadow: 0 14px 42px rgba(0, 0, 0, .34);
  backdrop-filter: blur(13px);
}

.floating-dialogue p {
  margin: 0;
  font: 600 clamp(17px, 2.2vw, 24px)/1.75 "Songti SC", serif;
  text-shadow: 0 1px 4px #000;
}

.immersive-composer {
  position: absolute;
  z-index: 7;
  left: clamp(22px, 5vw, 62px);
  right: clamp(22px, 5vw, 62px);
  bottom: 34px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
}

.hold-to-talk,
.media-share,
.quiet-input,
.quiet-send,
.sound-orb {
  border: 1px solid rgba(218, 186, 143, .44);
  color: #f5e6cf;
  background: rgba(25, 18, 13, .82);
  backdrop-filter: blur(12px);
}

.hold-to-talk {
  display: grid;
  min-width: 150px;
  gap: 2px;
  border-radius: 14px;
  padding: 11px 17px;
  text-align: left;
}

.hold-to-talk strong { font-size: 12px; }
.hold-to-talk small { color: #a8957b; font-size: 8px; }
.hold-to-talk.recording { border-color: #d78362; background: rgba(105,42,32,.88); }
.media-share {
  min-width: 76px;
  border-radius: 14px;
  padding: 0 14px;
  cursor: pointer;
}
.quiet-input { display: flex; min-width: 0; border-radius: 14px; }
.quiet-input input { width: 100%; border: 0; outline: 0; padding: 0 16px; color: #f5e6cf; background: transparent; }
.quiet-input input::placeholder { color: #8e7d68; }
.quiet-send { border-radius: 14px; padding: 0 22px; }
.hold-to-talk:hover, .media-share:hover, .quiet-send:hover, .sound-orb:hover { border-color: #e0a45f; }
.sound-orb { position: absolute; z-index: 7; top: 28px; right: 28px; border-radius: 999px; padding: 9px 12px; color: #cdbb9e; font-size: 9px; }

.media-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 80px;
  border: 1px solid rgba(218, 186, 143, .44);
  border-radius: 16px;
  padding: 8px 10px;
  color: #f5e6cf;
  background: rgba(25, 18, 13, .9);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  backdrop-filter: blur(13px);
}

.media-preview[hidden] { display: none; }
.media-preview img { width: 68px; height: 58px; border-radius: 10px; object-fit: cover; }
.media-preview > div { display: grid; min-width: 0; gap: 3px; }
.media-preview strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.media-preview small { color: #a8957b; font-size: 8px; }
.media-preview > button {
  border: 0;
  padding: 8px;
  color: #cdbb9e;
  background: transparent;
  cursor: pointer;
}

.media-memory-choice { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: #d9c7aa; font-size: 9px; }
.media-memory-choice input { width: 13px; height: 13px; margin: 0; accent-color: #d68c3e; }
.companion-stage.media-ready .floating-dialogue { bottom: 214px; }

@media (max-width: 640px) {
  .companion-shell { padding: 0; }
  .companion-stage { height: 100svh; min-height: 540px; border: 0; border-radius: 0; }
  .companion-stage > .character-art { object-position: 50% 30%; }
  .quiet-header { top: 22px; left: 20px; }
  .sound-orb { top: 20px; right: 18px; }
  .floating-dialogue { left: 14px; right: 14px; bottom: 136px; min-height: 112px; padding: 18px 19px; }
  .immersive-composer { left: 14px; right: 14px; bottom: 22px; grid-template-columns: auto minmax(0, 1fr) auto; }
  .hold-to-talk { grid-column: 1 / -1; width: 100%; text-align: center; }
  .media-share { min-height: 46px; }
  .quiet-input { min-height: 46px; }
  .companion-stage.media-ready .floating-dialogue { bottom: 230px; }
  .media-preview { grid-template-columns: 58px minmax(0, 1fr) auto; min-height: 74px; }
  .media-preview img { width: 58px; height: 52px; }
}
