.hf-assistant {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1035;
  font-family: 'Lato', sans-serif;
  color: #253b45;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 0s linear 160ms;
}

.hf-assistant.is-ready {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.hf-assistant__launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #00889b;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(29, 64, 75, .24);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.hf-assistant__launcher:hover,
.hf-assistant__launcher:focus {
  background: #006d7d;
  color: #fff;
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(29, 64, 75, .3);
}

.hf-assistant__launcher:focus-visible,
.hf-assistant__close:focus-visible,
.hf-assistant__quick button:focus-visible,
.hf-assistant__composer textarea:focus-visible,
.hf-assistant__composer button:focus-visible,
.hf-assistant__action:focus-visible {
  outline: 3px solid #253b45;
  outline-offset: 3px;
}

.hf-assistant__launcher-icon,
.hf-assistant__launcher-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.hf-assistant__launcher-icon svg { fill: currentColor; }

.hf-assistant.is-open .hf-assistant__launcher { display: none; }

.hf-assistant__panel {
  width: min(390px, calc(100vw - 32px));
  height: min(590px, calc(100vh - 44px));
  min-height: 420px;
  overflow: hidden;
  border: 1px solid #dfeaed;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 56px rgba(28, 60, 72, .22);
}

.hf-assistant__panel[hidden] { display: none !important; }

.hf-assistant__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 15px 17px 14px 19px;
  border-bottom: 1px solid #e7eff1;
  background: #f3fafb;
}

.hf-assistant__eyebrow {
  display: block;
  margin-bottom: 2px;
  color: #00889b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hf-assistant__header h2 {
  margin: 0;
  color: #253b45;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

.hf-assistant__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0 0 3px;
  border: 1px solid #d5e4e7;
  border-radius: 50%;
  background: #fff;
  color: #425b65;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.hf-assistant__body {
  height: calc(100% - 190px);
  min-height: 245px;
  padding: 18px;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
  overscroll-behavior: contain;
}

.hf-assistant__message {
  width: fit-content;
  max-width: 88%;
  margin: 0 0 12px;
  padding: 11px 13px;
  border-radius: 15px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.hf-assistant__message p { margin: 0; }

.hf-assistant__message--assistant {
  margin-right: auto;
  border: 1px solid #e1ecee;
  border-bottom-left-radius: 5px;
  background: #f6fafb;
  color: #314b55;
}

.hf-assistant__message--user {
  margin-left: auto;
  border-bottom-right-radius: 5px;
  background: #00889b;
  color: #fff;
}

.hf-assistant__message--thinking { opacity: .72; }

.hf-assistant__staging-note {
  display: block;
  margin-top: 8px;
  color: #657c85;
  font-size: 12px;
  line-height: 1.4;
}

.hf-assistant__action {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-top: 9px;
  padding: 7px 11px;
  border: 1px solid #b7dce1;
  border-radius: 9px;
  background: #fff;
  color: #007f91;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.hf-assistant__action:hover,
.hf-assistant__action:focus {
  background: #eef8f9;
  color: #006d7d;
  text-decoration: none;
}

.hf-assistant__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hf-assistant__quick[hidden] { display: none !important; }

.hf-assistant__quick button {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #cfe3e6;
  border-radius: 999px;
  background: #fff;
  color: #3f5963;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
}

.hf-assistant__quick button:hover,
.hf-assistant__quick button:focus {
  border-color: #8bc3ca;
  background: #f1f9fa;
  color: #007f91;
  outline: none;
}

.hf-assistant__composer {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  min-height: 74px;
  padding: 11px 12px 9px;
  border-top: 1px solid #e3edef;
  background: #fff;
}

.hf-assistant__composer textarea {
  width: 100%;
  min-height: 46px;
  max-height: 90px;
  resize: none;
  padding: 11px 12px;
  border: 1px solid #cadde1;
  border-radius: 12px;
  background: #fff;
  color: #253b45;
  font: 400 14px/1.4 'Lato', sans-serif;
  box-shadow: none;
}

.hf-assistant__composer textarea:focus {
  border-color: #00889b;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 136, 155, .11);
}

.hf-assistant__composer button {
  min-height: 46px;
  padding: 0 15px;
  border: 0;
  border-radius: 12px;
  background: #00889b;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.hf-assistant__composer button:hover,
.hf-assistant__composer button:focus { background: #006d7d; }
.hf-assistant__composer button:disabled { opacity: .55; cursor: wait; }

.hf-assistant__privacy {
  height: 38px;
  margin: 0;
  padding: 1px 14px 10px;
  background: #fff;
  color: #71868e;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 600px) {
  .hf-assistant {
    right: 14px;
    bottom: 14px;
  }

  .hf-assistant__launcher {
    width: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    gap: 0;
  }

  .hf-assistant__launcher-label {
    display: none;
  }

  .hf-assistant__panel {
    width: calc(100vw - 24px);
    height: min(620px, calc(100dvh - 24px));
    min-height: 390px;
    border-radius: 18px;
  }

  .hf-assistant.is-open {
    right: 12px;
    bottom: 12px;
  }

  .hf-assistant__body { padding: 15px; }

  /* iOS Safari zooms form controls below 16px when they receive focus. */
  .hf-assistant__composer textarea {
    font-size: 16px;
  }
}

@media (max-height: 540px) {
  .hf-assistant__panel {
    height: calc(100dvh - 20px);
    min-height: 0;
  }
  .hf-assistant.is-open { bottom: 10px; }
  .hf-assistant__header { min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
  .hf-assistant__body { height: calc(100% - 176px); min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hf-assistant,
  .hf-assistant__launcher { transition: none; }
}
