@font-face {
  font-family: 'HSE Sans';
  src: url('assets/fonts/hse-sans-light.otf') format('opentype');
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: 'HSE Sans';
  src: url('assets/fonts/hse-sans-regular.otf') format('opentype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'HSE Sans';
  src: url('assets/fonts/hse-sans-bold.otf') format('opentype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --index-background-color: #000;
  --index-background-image: none;
  /* Animated blob layer on .intro-band (see .intro-band::before below) --
     tune these by hand: color/size/blur/opacity shape it, duration/easing
     pace the drift. */
  --index-blob-color: #2f6bff;
  --index-blob-size: 60vmin;
  --index-blob-blur: 120px;
  --index-blob-opacity: .6;
  --index-blob-duration: 40s;
  --index-blob-easing: ease-in-out;
  --index-font-family: 'HSE Sans', Arial, sans-serif;
  --index-text-size: 16px;
  /* Composer textarea font-size only -- stays 16px at every breakpoint on
     purpose. Below 16px, iOS Safari auto-zooms the whole page on focus. */
  --index-input-font-size: 16px;
  /* Single size for every round icon button in the widget (close, home,
     background-picker toggle/tools, composer send/history). Composer buttons
     read this through --composer-button-size (widget.css); everything else
     reads it directly. One number, one place to retune. */
  --icon-button-size: 36px;
  /* Gap from the composer's own bottom edge to the screen's bottom edge --
     shared by .dialogue-composer's own `bottom` and .dialogue__footer's
     `padding-bottom` (widget.css) so the composer sits at the same height on
     the intro screen and in the dialogue instead of jumping between them. */
  --composer-offset-bottom: max(10px, env(safe-area-inset-bottom));
  --index-meta-size: 12px;
  --index-text-line-height: 1.4;
  --index-meta-line-height: 1.35;
  color: #111;
  background: #fff;
  font-family: var(--index-font-family);
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.intro-band {
  position: relative;
  min-height: 104px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-color: var(--index-background-color);
  background-image: var(--index-background-image);
  background-position: center 44%;
  background-size: cover;
}

.intro-band::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--index-blob-size);
  height: var(--index-blob-size);
  content: '';
  background: radial-gradient(circle, var(--index-blob-color) 0%, transparent 70%);
  filter: blur(var(--index-blob-blur));
  opacity: var(--index-blob-opacity);
  animation: index-blob-drift var(--index-blob-duration) var(--index-blob-easing) infinite alternate;
}

@keyframes index-blob-drift {
  from {
    transform: translate(-50%, -50%) translate(-12%, -8%) scale(1);
  }
  to {
    transform: translate(-50%, -50%) translate(12%, 10%) scale(1.15);
  }
}

.intro-band::after {
  position: absolute;
  inset: 0;
  content: '';
  background: rgb(0 0 0 / 38%);
}

.dialogue-composer {
  /* width/min-height/grid-template-columns/padding/border-radius/gap: see the
     --composer-* custom properties in widget.css -- this selector is always
     re-scoped by body.is-standalone/is-overlay there, so only position/z-index/
     display/align-items (not part of the composer-size token set) stay here. */
  position: relative;
  z-index: 1;
  display: grid;
  align-items: center;
}

.emblem {
  display: grid;
  place-items: center;
  color: #111;
  font-size: 12px;
  font-weight: 700;
}

.dialogue-composer textarea {
  min-width: 0;
  width: 100%;
  height: 24px;
  max-height: 76px;
  margin-left: 10px;
  resize: none;
  overflow-y: hidden;
  border: 0;
  outline: 0;
  color: #202020;
  background: transparent;
  font-family: var(--index-font-family);
  font-size: var(--index-input-font-size);
  font-weight: 400;
  line-height: var(--index-text-line-height);
  letter-spacing: 0;
}

.dialogue-composer button {
  width: var(--composer-button-size);
  height: var(--composer-button-size);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #a0a0a0;
  background: transparent;
  background-clip: padding-box;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  font-size: 19px;
  line-height: 1;
  overflow: hidden;
  justify-self: end;
}

.dialogue-composer button:not(:disabled) {
  color: #fff;
  background: #111;
}

.dialogue-composer button:disabled {
  color: #929292;
  background: transparent;
  opacity: 1;
  cursor: default;
}

.dialogue {
  position: fixed;
  z-index: 10;
  top: 72px;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  color: #fff;
  background-color: #001e15;
  background-image: var(--index-background-image);
  background-position: center;
  background-size: cover;
}

.dialogue::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: '';
  background: rgb(0 13 8 / 87%);
}

.dialogue[hidden] {
  display: none !important;
}

.dialogue__header,
.dialogue__messages {
  width: min(100% - 48px, 1180px);
  margin: 0 auto;
}

.dialogue__header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  padding: 10px 0;
}

.dialogue__home {
  /* Hidden for now, same as embed.js's home-button -- the whole widget
     opening on click/focus makes a separate "home" button redundant.
     grid-column is pinned here (and on the two siblings below) because
     display:none drops this out of .dialogue__header's grid flow entirely;
     without it, auto-placement shifts the other two into this column's now-
     empty 42px slot. */
  display: none;
  grid-column: 1;
  width: var(--icon-button-size);
  height: var(--icon-button-size);
  place-items: center;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 50%;
  color: #fff;
  background: rgb(0 0 0 / 30%);
  appearance: none;
  -webkit-appearance: none;
  line-height: 1;
}

.dialogue__identity {
  /* Left corner for now, in the space .dialogue__home leaves free while it's
     hidden -- spans into column 2 so it isn't squeezed into the bare 42px
     column 1. */
  grid-column: 1 / 3;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 9px;
}

.dialogue__identity > div {
  display: grid;
  gap: 2px;
}

.dialogue__identity strong {
  font-size: 12px;
}

.dialogue__identity span:not(.dialogue__avatar) {
  color: rgb(255 255 255 / 70%);
  font-size: 10px;
}

.dialogue__avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #111;
  background: #fff;
  font-size: 10px;
  font-weight: 400;
}

.icon-button {
  /* #close-dialogue, the last child of .dialogue__header -- pinned to match the
     explicit grid-column on .dialogue__home/.dialogue__identity above. */
  grid-column: 3;
  width: var(--icon-button-size);
  height: var(--icon-button-size);
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 50%;
  color: #fff;
  background: rgb(0 0 0 / 24%);
  appearance: none;
  -webkit-appearance: none;
  font-size: 22px;
  line-height: 1;
}

.dialogue__messages {
  max-width: 780px;
  display: grid;
  gap: 14px;
  padding: 28px 0;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
}

.user-message {
  justify-self: end;
  max-width: min(610px, 86%);
  padding: 13px 17px;
  border-radius: 8px;
  color: #171717;
  background: #fff;
  font-size: 13px;
  line-height: 1.4;
}

.operator-message {
  width: min(650px, 90%);
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 9px;
}

.operator-message img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.operator-message__content {
  padding: 14px 17px;
  border-radius: 8px;
  background: #003d98;
  font-size: 13px;
  line-height: 1.4;
}

.operator-message__content strong {
  display: block;
  margin-bottom: 4px;
}

.dialogue__footer {
  display: grid;
  gap: 8px;
  padding: 10px 0 max(14px, env(safe-area-inset-bottom));
}

.operator-button {
  min-height: 40px;
  justify-self: center;
  padding: 9px 14px;
  border: 1px solid rgb(255 255 255 / 40%);
  border-radius: 5px;
  color: #fff;
  background: rgb(0 0 0 / 18%);
  font-size: 13px;
}

.operator-button:disabled {
  cursor: wait;
  opacity: .68;
}

.operator-handoff-card {
  width: min(650px, 90%);
  display: grid;
  gap: 14px;
  padding: 17px 18px;
  border-radius: 8px;
  color: #fff;
  background: #000;
  box-shadow: 0 10px 34px rgb(0 0 0 / 14%);
}

.operator-handoff-card.is-error {
  border: 1px solid rgb(255 155 155 / 55%);
}

.operator-handoff-card > strong {
  font-size: 14px;
}

.operator-handoff-card > p {
  margin: 0;
  color: rgb(255 255 255 / 76%);
  font-size: 12px;
  line-height: 1.45;
}

.operator-handoff-card > button,
.operator-contact-form button {
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid rgb(255 255 255 / 42%);
  border-radius: 50px;
  color: #fff;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.operator-handoff-card > button:first-of-type,
.operator-contact-form button[type='submit'] {
  color: #111;
  background: #fff;
}

.operator-contact-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
}

.operator-contact-form input {
  min-width: 0;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid rgb(255 255 255 / 32%);
  border-radius: 50px;
  outline: 0;
  color: #fff;
  background: rgb(0 0 0 / 18%);
}

.operator-contact-form input:focus {
  border-color: #fff;
}

.operator-contact-form__error {
  color: #ffbcbc !important;
}

@media (max-width: 560px) {
  .operator-contact-form {
    grid-template-columns: 1fr;
  }

  .operator-contact-form button,
  .operator-handoff-card > button {
    width: 100%;
  }
}

.dialogue-composer {
  /* geometry: see .dialogue-composer's comment above -- .direct-dialogue
     .dialogue-composer in widget.css always re-scopes the --composer-* tokens */
  display: grid;
  align-items: center;
  margin: 0 auto;
  color: #151515;
}

.dialogue-composer > span {
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 680px) {
  :root {
    --index-text-size: 14px;
    --index-meta-size: 11px;
  }

  .intro-band {
    min-height: 96px;
  }

  .dialogue {
    top: 66px;
    grid-template-rows: 58px minmax(0, 1fr) auto;
  }

  .dialogue__header,
  .dialogue__messages,
  .dialogue__footer {
    width: calc(100% - 22px);
  }

  .dialogue__messages {
    padding: 24px 0;
  }

  .dialogue__identity strong {
    font-size: 11px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}
