.warm-hero-with-presence {
  position: relative;
  overflow: hidden;
}

.warm-hero-with-presence .warm-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(260px, 360px);
  gap: clamp(28px, 5vw, 68px);
  align-items: end;
}

.warm-hero-copy {
  min-width: 0;
}

.warm-hero-presence {
  display: grid;
  gap: 12px;
  width: min(100%, 360px);
  justify-self: end;
  padding: 14px;
  border: 1px solid rgba(88, 72, 52, 0.24);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.72);
  color: #241f18;
  text-decoration: none;
  box-shadow: 0 24px 58px rgba(45, 34, 20, 0.16);
  backdrop-filter: blur(8px);
}

.warm-hero-presence:hover,
.warm-hero-presence:focus-visible {
  border-color: rgba(154, 114, 43, 0.58);
  transform: translateY(-2px);
}

.hero-presence-frame {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(109, 81, 43, 0.3);
  border-radius: 8px;
  background: #181611;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.hero-presence-frame::before,
.hero-presence-frame::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 8px;
  z-index: 2;
}

.hero-presence-frame::before {
  inset: 12px;
  border: 1px solid rgba(218, 176, 96, 0.3);
}

.hero-presence-frame::after {
  inset: 27px;
  border: 1px solid rgba(45, 103, 118, 0.18);
}

.hero-presence-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.98) contrast(1.03);
}

.hero-presence-copy {
  display: grid;
  gap: 4px;
}

.hero-presence-copy span {
  color: #2d6776;
  font: 800 12px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace;
  text-transform: uppercase;
}

.hero-presence-copy strong {
  color: #241f18;
  font-size: 24px;
  line-height: 1.05;
}

.hero-presence-copy em {
  color: #6a5f52;
  font-style: normal;
  font-size: 14px;
}

.warm-node-room {
  background: #f7f0e6;
  color: #241f18;
  border-top: 1px solid rgba(88, 72, 52, 0.18);
}

.warm-node-room-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 64px;
}

.warm-room-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

.warm-room-presence,
.warm-room-chat {
  border: 1px solid rgba(88, 72, 52, 0.22);
  border-radius: 8px;
  background: rgba(255, 252, 246, 0.84);
  box-shadow: 0 18px 46px rgba(55, 42, 25, 0.08);
}

.warm-room-presence {
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.talking-portrait {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(109, 81, 43, 0.28);
  border-radius: 8px;
  background: #181611;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24), 0 18px 42px rgba(37, 28, 18, 0.18);
}

.talking-portrait img,
.talking-portrait canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.talking-portrait img {
  display: block;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.98) contrast(1.03);
}

.talking-portrait canvas {
  z-index: 2;
  pointer-events: none;
}

.talking-portrait::before,
.talking-portrait::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 8px;
  z-index: 3;
}

.talking-portrait::before {
  inset: 13px;
  border: 1px solid rgba(218, 176, 96, 0.32);
}

.talking-portrait::after {
  inset: 28px;
  border: 1px solid rgba(45, 103, 118, 0.18);
}

.warm-presence-copy {
  display: grid;
  gap: 8px;
}

.warm-presence-copy h2 {
  margin: 0;
  color: #241f18;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

.warm-presence-copy p {
  margin: 0;
  color: #5f5548;
}

.warm-room-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.warm-room-fact {
  border: 1px solid rgba(88, 72, 52, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
  padding: 10px;
}

.warm-room-fact span {
  display: block;
  color: #766a5b;
  font-size: 12px;
  line-height: 1.25;
}

.warm-room-fact strong {
  display: block;
  margin-top: 3px;
  color: #2f2921;
  font-size: 14px;
  line-height: 1.25;
}

.warm-room-chat {
  min-height: 620px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  overflow: hidden;
}

.warm-room-chat-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(88, 72, 52, 0.18);
  padding: 14px 16px;
  background: rgba(248, 238, 224, 0.78);
}

.warm-room-chat-head strong {
  color: #2f2921;
}

.warm-route-chip {
  border: 1px solid rgba(45, 103, 118, 0.26);
  border-radius: 999px;
  color: #2d6776;
  background: rgba(45, 103, 118, 0.07);
  padding: 5px 10px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.history {
  min-height: 360px;
  max-height: 500px;
  overflow: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nr-message {
  max-width: min(84%, 720px);
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(88, 72, 52, 0.18);
  background: #fffaf2;
  color: #342d24;
}

.nr-message-user {
  align-self: flex-end;
  background: #f0dfc5;
}

.nr-message-node {
  align-self: flex-start;
}

.nr-message strong {
  display: block;
  margin-bottom: 5px;
  color: #8a641f;
  font-size: 13px;
}

.nr-message p {
  margin: 0;
  white-space: pre-wrap;
}

.composer {
  border-top: 1px solid rgba(88, 72, 52, 0.18);
  padding: 12px;
  background: rgba(248, 238, 224, 0.78);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
}

.composer input {
  width: 100%;
  border: 1px solid rgba(88, 72, 52, 0.25);
  border-radius: 8px;
  background: #fffaf2;
  color: #241f18;
  padding: 12px;
  font: inherit;
  font-size: 16px;
}

.composer button {
  border: 1px solid #9a722b;
  border-radius: 8px;
  background: #9a722b;
  color: #fffaf2;
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.composer button[type="button"] {
  border-color: rgba(88, 72, 52, 0.25);
  background: #fffaf2;
  color: #2f2921;
}

.composer button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.voice {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  color: #6a5f52;
  font-size: 14px;
}

.voice input {
  width: auto;
}

.voice-select {
  border: 1px solid rgba(88, 72, 52, 0.25);
  border-radius: 8px;
  background: #fffaf2;
  color: #241f18;
  padding: 7px 9px;
  font: inherit;
}

.status {
  margin: 0;
  padding: 0 16px 14px;
  background: rgba(248, 238, 224, 0.78);
  color: #6a5f52;
  font-size: 13px;
}

.status[data-mode="ok"] {
  color: #287a4c;
}

.status[data-mode="warn"] {
  color: #9a6324;
}

.status[data-mode="busy"],
.status[data-mode="speaking"] {
  color: #2d6776;
}

.warm-room-prompts {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.room-button {
  border: 1px solid rgba(88, 72, 52, 0.2);
  border-radius: 8px;
  background: #fffaf2;
  color: #2f2921;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.room-button:hover {
  border-color: #9a722b;
  color: #8a641f;
}

@media (max-width: 900px) {
  .warm-hero-with-presence .warm-hero-inner {
    grid-template-columns: 1fr;
  }

  .warm-hero-presence {
    justify-self: start;
    width: min(100%, 520px);
    grid-template-columns: 160px minmax(0, 1fr);
    align-items: center;
  }

  .warm-room-grid {
    grid-template-columns: 1fr;
  }

  .warm-room-presence {
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    align-items: center;
  }

  .warm-room-facts {
    grid-column: 1 / -1;
  }

  .warm-room-chat {
    min-height: 560px;
  }
}

@media (max-width: 640px) {
  .warm-hero-with-presence .warm-hero-inner {
    padding: 2.25rem 0 2.25rem;
  }

  .warm-hero-presence {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 11px;
    padding: 10px;
  }

  .hero-presence-copy strong {
    font-size: 20px;
  }

  .hero-presence-copy em {
    font-size: 13px;
  }

  .warm-node-room-inner {
    width: min(100% - 28px, 1180px);
    padding: 40px 0 48px;
  }

  .warm-room-presence {
    grid-template-columns: 1fr;
  }

  .talking-portrait {
    width: min(100%, 340px);
    margin: 0 auto;
  }

  .warm-room-facts {
    grid-template-columns: 1fr;
  }

  .warm-room-chat {
    min-height: 520px;
  }

  .warm-room-chat-head {
    display: grid;
  }

  .history {
    min-height: 300px;
    max-height: none;
  }

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

  .composer button,
  .voice-select {
    width: 100%;
    min-height: 44px;
  }

  .voice {
    align-items: stretch;
    flex-direction: column;
  }

  .voice input {
    align-self: flex-start;
  }
}
