.rk-support {
  --rk-support-width: 25rem;
  position: fixed;
  z-index: 120;
  inset-inline-end: 1.25rem;
  inset-block-end: 1.25rem;
  font-family: var(--rk-font-body);
}

.rk-support__launcher {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  float: inline-end;
  padding: 0.75rem 1rem;
  border: 1px solid #152033;
  border-radius: 0.35rem;
  background: #152033;
  color: #fff;
  box-shadow: 0 0.8rem 2rem rgba(21, 32, 51, 0.18);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
}

.rk-support__launcher:hover,
.rk-support__launcher:focus-visible,
.rk-support.is-open .rk-support__launcher {
  border-color: var(--rk-color-accent);
  background: var(--rk-color-accent);
  color: #fff;
}

.rk-support__launcher .rk-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.rk-support.is-open .rk-support__launcher {
  display: none;
}

.rk-support__panel {
  width: min(var(--rk-support-width), calc(100vw - 2rem));
  height: min(46rem, calc(100vh - 2rem));
  margin-block-end: 0.75rem;
  clear: both;
  overflow: hidden;
  border: 1px solid rgba(21, 32, 51, 0.16);
  border-top: 0.25rem solid var(--rk-color-accent);
  border-radius: 0.4rem;
  background: #fff;
  box-shadow: 0 1.2rem 3.6rem rgba(21, 32, 51, 0.24);
}

.rk-support__panel[hidden] {
  display: none;
}

.rk-support__header {
  min-height: 4.5rem;
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) 2.25rem;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--rk-color-border);
  background: #fff;
}

.rk-support__identity {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  background: var(--rk-color-accent);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
}

.rk-support__header h2,
.rk-support__header p {
  margin: 0;
  letter-spacing: 0;
}

.rk-support__header h2 {
  font-size: 1rem;
  line-height: 1.25;
}

.rk-support__header p {
  margin-top: 0.1rem;
  color: var(--rk-color-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.rk-support__icon-button {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rk-color-muted);
  cursor: pointer;
}

.rk-support__icon-button:hover,
.rk-support__icon-button:focus-visible {
  color: var(--rk-color-accent);
}

.rk-support__gate {
  height: calc(100% - 4.5rem);
  padding: 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rk-support__intro {
  margin: 0 0 0.9rem;
  color: #475467;
  font-size: 0.82rem;
  line-height: 1.55;
}

.rk-support__form,
.rk-support__field {
  display: grid;
  gap: 0.35rem;
}

.rk-support__form {
  gap: 0.7rem;
}

.rk-support__form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.rk-support__field label {
  color: #344054;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
}

.rk-support__field input,
.rk-support__field select,
.rk-support__field textarea,
.rk-support__composer textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cfd6df;
  border-radius: 0.25rem;
  background: #fff;
  color: #152033;
  font: inherit;
  font-size: 0.82rem;
}

.rk-support__field input,
.rk-support__field select {
  height: 2.45rem;
  padding: 0 0.65rem;
}

.rk-support__field textarea {
  min-height: 5.25rem;
  resize: vertical;
  padding: 0.6rem 0.65rem;
  line-height: 1.45;
}

.rk-support__field input:focus,
.rk-support__field select:focus,
.rk-support__field textarea:focus,
.rk-support__composer textarea:focus {
  outline: 2px solid rgba(214, 63, 47, 0.2);
  outline-offset: 1px;
  border-color: var(--rk-color-accent);
}

.rk-support__field--language {
  grid-template-columns: auto 8rem;
  align-items: center;
  justify-content: end;
}

.rk-support__honeypot {
  position: absolute !important;
  inset-inline-start: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.rk-support__consent {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  gap: 0.35rem 0.5rem;
  align-items: start;
  color: #667085;
  font-size: 0.68rem;
  line-height: 1.45;
}

.rk-support__consent input {
  margin: 0.2rem 0 0;
}

.rk-support__consent a {
  grid-column: 2;
  color: var(--rk-color-accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.rk-support__start {
  width: 100%;
  justify-content: center;
  gap: 0.5rem;
}

.rk-support__status {
  min-height: 1rem;
  margin: 0;
  color: #166534;
  font-size: 0.7rem;
  line-height: 1.4;
}

.rk-support__status.is-error {
  color: #b42318;
}

.rk-support__conversation {
  height: calc(100% - 4.5rem);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: #f6f8fb;
}

.rk-support__conversation[hidden] {
  display: none;
}

.rk-support__messages {
  min-height: 0;
  padding: 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rk-support__message {
  width: min(88%, 21rem);
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.35rem;
  font-size: 0.8rem;
  line-height: 1.55;
}

.rk-support__message p {
	margin: 0;
	overflow-wrap: anywhere;
	white-space: pre-wrap;
}

.rk-support__message p a {
	color: var(--rk-color-accent);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 0.14em;
}

.rk-support__message.has-products {
	width: min(96%, 22.5rem);
}

.rk-support__products {
	margin: 0.7rem -0.8rem -0.7rem;
	border-top: 1px solid #e2e8f0;
}

.rk-support__product {
	display: grid;
	grid-template-columns: 3rem minmax(0, 1fr) 1rem;
	align-items: center;
	gap: 0.65rem;
	min-height: 4.35rem;
	padding: 0.65rem 0.8rem;
	color: #152033;
	text-decoration: none;
}

.rk-support__product + .rk-support__product {
	border-top: 1px solid #e7ebf0;
}

.rk-support__product:hover,
.rk-support__product:focus-visible {
	background: #f8fafc;
	color: var(--rk-color-accent);
}

.rk-support__product-media {
	width: 3rem;
	height: 3rem;
	display: grid;
	place-items: center;
	background: #fff;
}

.rk-support__product-media:empty {
	background: #f1f4f8;
}

.rk-support__product-media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.rk-support__product-copy,
.rk-support__product-meta,
.rk-support__product-summary {
	display: block;
	min-width: 0;
}

.rk-support__product-copy strong {
	display: block;
	margin: 0.08rem 0 0.15rem;
	font-size: 0.75rem;
	line-height: 1.3;
}

.rk-support__product-meta {
	color: var(--rk-color-accent);
	font-size: 0.57rem;
	font-weight: 800;
	line-height: 1.3;
	text-transform: uppercase;
}

.rk-support__product-summary {
	display: -webkit-box;
	overflow: hidden;
	color: #667085;
	font-size: 0.66rem;
	line-height: 1.35;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.rk-support__product-arrow {
	color: var(--rk-color-accent);
	font-size: 1rem;
}

.rk-support__message-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
}

.rk-support__message small {
  display: block;
  margin-top: 0.35rem;
  opacity: 0.7;
  font-size: 0.62rem;
}

.rk-support__message--assistant {
  border: 1px solid #e2e8f0;
  border-inline-start: 0.2rem solid var(--rk-color-accent);
  background: #fff;
  color: #152033;
}

.rk-support__message--user {
  margin-inline-start: auto;
  background: #152033;
  color: #fff;
}

.rk-support__conversation-footer {
  padding: 0.75rem;
  border-top: 1px solid #dfe5ec;
  background: #fff;
}

.rk-support__remaining {
  margin: 0 0 0.4rem;
  color: #667085;
  font-size: 0.66rem;
}

.rk-support__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.7rem;
  gap: 0.45rem;
  align-items: end;
}

.rk-support__composer textarea {
  min-height: 2.8rem;
  max-height: 7rem;
  resize: vertical;
  padding: 0.55rem 0.65rem;
  line-height: 1.4;
}

.rk-support__composer button {
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--rk-color-accent);
  border-radius: 0.25rem;
  background: var(--rk-color-accent);
  color: #fff;
  cursor: pointer;
}

.rk-support__composer button:hover,
.rk-support__composer button:focus-visible {
  background: #fff;
  color: var(--rk-color-accent);
}

.rk-support__finish {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.55rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #667085;
  font: inherit;
  font-size: 0.68rem;
  cursor: pointer;
}

.rk-support__restart {
  width: 100%;
  margin-top: 0.55rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--rk-color-accent);
  border-radius: 0.25rem;
  background: #fff;
  color: var(--rk-color-accent);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 750;
  cursor: pointer;
}

.rk-support__restart:hover,
.rk-support__restart:focus-visible {
  background: var(--rk-color-accent);
  color: #fff;
}

.rk-support__finish:hover,
.rk-support__finish:focus-visible {
  color: var(--rk-color-accent);
}

.rk-support button:disabled,
.rk-support input:disabled,
.rk-support select:disabled,
.rk-support textarea:disabled {
  cursor: wait;
  opacity: 0.6;
}

.rk-support[dir='rtl'] .rk-support__message-label {
  text-transform: none;
}

@media (max-width: 36rem) {
  .rk-support {
    inset-inline: 0.6rem;
    inset-block-end: 0.6rem;
  }

  .rk-support__launcher {
    padding: 0.7rem;
  }

  .rk-support__launcher span {
    display: none;
  }

  .rk-support__panel {
    width: 100%;
    height: min(42rem, calc(100dvh - 1.2rem));
    margin-block-end: 0;
  }

  .rk-support__form-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rk-support * {
    scroll-behavior: auto !important;
  }
}
