@import url("base.css?v=5");
@import url("prompt.css?v=20");

html,
body {
  margin: 0;
  height: 100%;
  min-height: 0;
  background: #050505;
}

.chat-page-body {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  padding: 18px;
  color: #fff;
  overflow-x: hidden;
  overflow-y: hidden;
  background:
    radial-gradient(circle at top, rgba(155, 194, 255, 0.08), transparent 28%),
    #050505;
}

.chat-page-shell {
  width: min(100%, 960px);
  height: 100%;
  max-height: 920px;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.chat-overlay--page {
  --chat-page-gutter: clamp(12px, 2vw, 24px);
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  height: 100%;
  min-height: 0;
  min-width: 0;
  width: 100%;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.chat-page-subtitle {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  line-height: 1.4;
}

.chat-page-intents {
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  padding: 8px var(--chat-page-gutter) 10px;
}

.chat-page-intents[hidden] {
  display: none;
}

.chat-overlay--page .chat-overlay__top {
  grid-row: 1;
  padding: 12px var(--chat-page-gutter);
}

.chat-page-intent {
  max-width: min(100%, 260px);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font: inherit;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}


.chat-page-intent:hover,
.chat-page-intent:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
  outline: none;
}

.chat-page-status {
  min-height: 20px;
  padding: 0 14px 14px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
}

.chat-page-status.is-error {
  color: #ffb0b0;
}

.chat-page-status:empty { display: none; }
.chat-overlay--page .chat-overlay__title { overflow-wrap: anywhere; font-size: 16px; }
.chat-overlay--page .chat-msg { flex-shrink: 0; overflow-wrap: anywhere; font-size: 16px; }
.chat-overlay--page .chat-overlay__composer:focus-within { border-color: rgba(155, 194, 255, 0.6); }
.chat-overlay--page .chat-overlay__composer button:focus-visible { outline: 2px solid #9bc2ff; outline-offset: 2px; }

.chat-page-status.is-ok {
  color: #97f1b5;
}

.chat-overlay--page .chat-overlay__messages {
  grid-row: 3;
  min-height: 0;
  min-width: 0;
  padding: 16px var(--chat-page-gutter);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* The shared website drawer bottom-pins short histories with an auto spacer.
   A page conversation starts below its header and scrolls within this row. */
.chat-overlay--page .chat-overlay__messages::before {
  content: none;
}

.chat-overlay--page .chat-msg--bot:not(.chat-msg--recommendations):not(.chat-msg--checkout) {
  width: fit-content;
  max-width: 100%;
}

.chat-overlay--page .chat-msg--user {
  width: fit-content;
  max-width: 84%;
  padding: 8px 12px;
  white-space: pre-wrap;
}

@media (max-width: 768px) {
  .chat-overlay--page .chat-overlay__messages {
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
  }
}

.chat-overlay--page .chat-overlay__composer {
  grid-row: 4;
  min-width: 0;
  margin: 0 var(--chat-page-gutter) 4px;
  align-items: flex-end;
  padding: 10px 12px 10px 14px;
  border-radius: 22px;
  overflow: hidden;
}

.chat-overlay--page .chat-page-status {
  grid-row: 5;
  padding-inline: var(--chat-page-gutter);
}

.chat-page-attribution {
  grid-row: 6;
  display: flex;
  justify-content: center;
  padding: 0 var(--chat-page-gutter) 6px;
}

.chat-page-attribution a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding-inline: 4px;
  border-radius: 4px;
  color: #8a8a8a;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.chat-page-attribution a:hover { color: #f5f5f5; }
.chat-page-attribution a:focus-visible {
  color: #f5f5f5;
  outline: 2px solid #9bc2ff;
  outline-offset: 2px;
}

.chat-overlay--page .chat-overlay__composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  height: 36px;
  max-height: calc(5 * 1.4em + 12px);
  padding: 8px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-sizing: border-box;
  color: #fff;
  font: inherit;
  line-height: 1.4;
  resize: none;
  outline: none;
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior: contain;
  box-shadow: none;
  -webkit-appearance: none;
}

.chat-overlay--page .chat-overlay__composer textarea::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.chat-page-stamp {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.5);
}

.chat-msg--user .chat-page-stamp {
  color: rgba(0, 0, 0, 0.6);
  text-align: right;
}

.chat-overlay--page .chat-overlay__composer [data-chat-page-send] {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  font-size: 0;
  line-height: 1;
}

.chat-overlay--page .chat-overlay__composer [data-chat-page-send]::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  margin: auto;
  background: center / contain no-repeat url("../img/chat-send.svg");
}

.chat-overlay--page .chat-overlay__composer > .voice-chat-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border-radius: 50%;
  background: #fff;
  color: #111;
}

.chat-overlay--page .chat-overlay__composer > .voice-chat-toggle::before { content: none; }
.chat-overlay--page .chat-overlay__composer > .voice-chat-toggle[hidden],
.chat-overlay--page .chat-overlay__composer[data-primary-action="send"] > .voice-chat-toggle,
.chat-overlay--page .chat-overlay__composer[data-primary-action="voice"] > [data-chat-page-send] {
  display: none !important;
}
.chat-page-voice-controls [hidden] { display: none !important; }
.chat-page-voice-controls .is-error { color: #ffaaaa; }

@supports (-webkit-touch-callout: none) {
  .chat-overlay--page .chat-overlay__composer textarea {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  html,
  body {
    min-height: 0;
  }

  .chat-page-body {
    padding: 10px;
  }

  .chat-page-shell {
    width: 100%;
    min-height: 0;
  }

  .chat-overlay--page {
    height: 100%;
    min-height: 0;
    border-radius: 18px;
  }

  .chat-overlay--page .chat-overlay__composer {
    padding: 9px 10px 9px 12px;
    border-radius: 20px;
  }

  .chat-overlay--page .chat-overlay__composer textarea {
    min-height: 34px;
    height: 34px;
    max-height: calc(5 * 1.4em + 10px);
    padding: 7px 0;
  }
}
