html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(#c9301b 0 64px, #faf9f7 64px);
}

#tt-contact-refined .cr-faq-context {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f2f4f7;
  color: #3c485c;
  font-size: 12px;
  line-height: 1.5;
}
#tt-contact-refined .cr-faq-context[hidden] { display: none; }
#tt-contact-refined .cr-faq-context span { display: block; color: #626a77; font-size: 11px; }
#tt-contact-refined .cr-faq-source { display: block; font-weight: 500; color: #3c485c; text-decoration: none; }
#tt-contact-refined .cr-faq-source:hover { text-decoration: underline; text-underline-offset: 3px; }

#tt-contact-refined :is(a, button, input, textarea, select):focus {
  outline: none !important;
}
#tt-contact-refined :is(a, button, select):focus-visible {
  box-shadow: 0 3px 16px rgb(60 72 92 / 0.2) !important;
}
@media (forced-colors: active) {
  #tt-contact-refined :is(a, button, input, textarea, select):focus-visible {
    outline: 2px solid Highlight !important;
  }
}

.cr-header,
main,
.cr-footer,
.cr-sr,
.cr-chat-launcher,
.cr-chat-scrim {
  display: none !important;
}

.cr-chat-panel,
.cr-chat-panel.is-roomy {
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  animation: none !important;
}

.cr-chat-expand {
  display: none !important;
}

.cr-chat-heading {
  min-height: 64px;
  padding: 10px 14px;
  gap: 10px;
  border-radius: 0;
  border-bottom: 0;
  background: #c9301b;
}

.cr-chat-identity {
  gap: 0;
}
/* Equivalent spacing in Safari 13, which supports grid gap but not flex gap. */
.cr-chat-identity > .cr-chat-brand-icon + div {
  margin-left: 10px;
}
.cr-chat-brand-icon {
  width: 36px;
  height: 36px;
  border-width: 1px;
}
.cr-chat-heading h2 {
  margin: 0;
  font-size: 16px;
  line-height: 21px;
}
.cr-chat-heading p {
  margin: 1px 0 0;
  font-size: 11px;
  line-height: 16px;
}
.cr-chat-heading .cr-chat-minimize {
  width: 44px;
  height: 44px;
  padding: 0;
}

.cr-chat-feed {
  padding: 18px 17px 12px;
  scroll-padding-bottom: 12px;
}

/* One size for welcome, user, streamed and completed conversation text. */
#tt-contact-refined .cr-chat-feed,
#tt-contact-refined .cr-chat-feed :is(div, p, span, a, strong, em, li, button, summary) {
  font-size: 14px !important;
  line-height: 1.5 !important;
}

#tt-contact-refined .cr-chat-feed .cr-chat-who {
  font-size: 12px !important;
  line-height: 1.4 !important;
  margin-bottom: 3px;
}

.cr-chat-message {
  gap: 0;
  margin-bottom: 14px;
}

.cr-chat-message-assistant > .cr-chat-avatar + .cr-chat-stack {
  margin-left: 8px;
}

.cr-chat-message-user {
  margin-top: 0;
}

.cr-chat-assistant-bubble p + p {
  margin-top: 4px;
}

.cr-chat-message[data-audience-prompt] .cr-chat-assistant-bubble {
  border: 0;
}
.cr-chat-message[data-audience-prompt] .cr-ai-choices[hidden] {
  display: none !important;
}
#tt-contact-refined .cr-chat-message[data-audience-prompt] .cr-ai-choices button {
  height: 22px;
  min-height: 22px;
  padding: 0 8px;
  font-weight: 400;
  font-size: 12px !important;
  line-height: 18px !important;
  color: #fff !important;
  background: var(--audience-button-color);
  border-color: var(--audience-button-color);
}
#tt-contact-refined button[data-audience-choice='advertiser'] {
  --audience-button-color: #c9301b;
}
#tt-contact-refined button[data-audience-choice='publisher'] {
  --audience-button-color: #3b6da0;
}
#tt-contact-refined button[data-audience-choice]:focus-visible {
  outline: none !important;
  box-shadow: 0 0 8px 3px #64748b40;
}

.cr-chat-user-bubble {
  font-weight: 400;
}

.cr-chat-avatar {
  margin-top: 22px;
}

.cr-chat-composer textarea {
  min-height: 36px;
  max-height: 120px;
  font-size: 14px !important;
  transition: none;
}

/* Keep this separate from :focus-visible so older Safari accepts the selector. */
.cr-chat-composer textarea:focus {
  outline: none !important;
  border: 0 !important;
  box-shadow: none !important;
}
#tt-contact-refined .cr-chat-composer textarea:focus-visible {
  outline: none !important;
  border: 0 !important;
  box-shadow: none !important;
}
#tt-contact-refined .cr-chat-composer:focus-within {
  background: #f2f6fa;
}

#tt-contact-refined[data-mobile-chat='true'] .cr-chat-composer textarea {
  font-size: 16px !important;
}

#tt-contact-refined[data-mobile-chat='true'] .cr-chat-panel {
  /* The host animates the frame. A second height transition can leave the composer outside it. */
  transition: none;
}

#tt-contact-refined[data-mobile-chat='true'] .cr-chat-send {
  width: 44px;
  height: 44px;
}

#tt-contact-refined[data-mobile-chat='true'] .cr-chat-new-conversation {
  width: 44px;
  min-height: 44px;
}

.cr-chat-privacy {
  font-size: 11px !important;
  line-height: 1.5 !important;
}

.cr-chat-panel .cr-ai-handoff .cr-primary {
  min-height: 44px;
}

/* Put the new-conversation action alongside the existing minimize control. */
.cr-chat-tools .cr-chat-new-conversation {
  display: grid;
  place-items: center;
  width: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.cr-chat-new-conversation .cr-icon {
  width: 21px;
  height: 21px;
  stroke-width: 1.8;
}

.cr-chat-new-conversation:hover {
  background: #ffffff25;
}

.cr-chat-new-conversation:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* A landscape keyboard can leave less space than the normal header and composer require. */
#tt-contact-refined[data-compact-chat='true'] .cr-chat-feed,
#tt-contact-refined[data-compact-chat='true'] .cr-chat-toolbar,
#tt-contact-refined[data-compact-chat='true'] .cr-chat-identity,
#tt-contact-refined[data-compact-chat='true'] .cr-chat-new-conversation,
#tt-contact-refined[data-compact-chat='true'] .cr-chat-suggestion {
  display: none !important;
}

#tt-contact-refined[data-compact-chat='true'] .cr-chat-heading {
  position: absolute;
  top: auto;
  right: 4px;
  bottom: 4px;
  left: auto;
  inset: auto 4px 4px auto;
  z-index: 2;
  min-height: 44px;
  padding: 0;
  background: transparent;
}

#tt-contact-refined[data-compact-chat='true'] .cr-chat-minimize {
  background: #c9301b;
  border-radius: 50%;
}

#tt-contact-refined[data-compact-chat='true'] .cr-chat-composer-area {
  margin-top: auto;
  padding: 4px 56px 4px 4px;
}

#tt-contact-refined[data-compact-chat='true'] .cr-chat-composer {
  min-height: 44px;
  gap: 4px;
  padding: 0 4px 0 10px;
}

#tt-contact-refined[data-compact-chat='true'] .cr-chat-composer textarea {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
}

.cr-chat-toolbar:has([data-chat-draft-return][hidden]) {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Exact, current knowledge references remain visible with each answer. */
.cr-chat-panel .cr-ai-sources{display:flex;flex-direction:column;align-items:flex-start;gap:7px;margin-top:13px;font-size:12px;line-height:1.5;white-space:normal}
.cr-chat-panel .cr-ai-sources[hidden]{display:none!important}
.cr-chat-panel .cr-ai-sources .cr-chat-source-label{font-size:11px;color:#635d55}
.cr-chat-panel .cr-ai-sources a{color:#a52c20;text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere}
.cr-chat-panel .cr-ai-sources a:hover{color:#762013}
.cr-chat-panel .cr-ai-sources a:focus-visible{outline:2px solid #a52c20;outline-offset:3px}
