.hs-ai-launcher,
.hs-ai-panel,
.hs-ai-order-backdrop {
  --hs-ai-ink: #1c1713;
  --hs-ai-muted: #766d66;
  --hs-ai-paper: #f7f3ed;
  --hs-ai-card: #fffdf9;
  --hs-ai-line: rgba(45, 34, 27, 0.14);
  --hs-ai-accent: #7a5a43;
  --hs-ai-accent-dark: #4d392c;
  --hs-ai-success: #47705a;
  font-family: inherit;
}

.hs-ai-launcher {
  position: fixed;
  z-index: 2100;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 60px;
  padding: 9px 17px 9px 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(34, 27, 22, 0.94);
  color: #fff;
  box-shadow: 0 20px 50px rgba(18, 12, 8, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  backdrop-filter: blur(18px);
  transition: transform 220ms ease, box-shadow 220ms ease, opacity 180ms ease;
}

.hs-ai-launcher:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 60px rgba(18, 12, 8, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hs-ai-launcher:focus-visible,
.hs-ai-panel button:focus-visible,
.hs-ai-panel textarea:focus-visible,
.hs-ai-panel input:focus-visible,
.hs-ai-order button:focus-visible,
.hs-ai-order input:focus-visible,
.hs-ai-order textarea:focus-visible,
.hs-ai-order select:focus-visible {
  outline: 3px solid rgba(167, 125, 91, 0.5);
  outline-offset: 3px;
}

.hs-ai-launcher__spark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 42px;
  border-radius: 50%;
  background: linear-gradient(145deg, #b99170, #72513d);
  font-size: 21px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  animation: hs-ai-spark 3.4s ease-in-out infinite;
}

.hs-ai-launcher__copy {
  display: grid;
  gap: 2px;
  text-align: left;
}

.hs-ai-launcher__copy strong {
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.hs-ai-launcher__copy small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  line-height: 1.25;
}

.hs-ai-launcher.is-hidden {
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
}

.hs-ai-panel {
  position: fixed;
  z-index: 2200;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  display: flex;
  width: min(438px, calc(100vw - 32px));
  height: min(760px, calc(100dvh - 44px));
  max-height: calc(100vh - 44px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 26px;
  background: var(--hs-ai-paper);
  color: var(--hs-ai-ink);
  box-shadow: 0 32px 90px rgba(16, 11, 8, 0.36);
  transform-origin: right bottom;
  animation: hs-ai-panel-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hs-ai-panel[hidden],
.hs-ai-order-backdrop[hidden] {
  display: none !important;
}

.hs-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  min-height: 72px;
  padding: 13px 15px 13px 17px;
  border-bottom: 1px solid var(--hs-ai-line);
  background: rgba(247, 243, 237, 0.94);
  backdrop-filter: blur(16px);
}

.hs-ai-identity {
  display: flex;
  align-items: center;
  gap: 11px;
}

.hs-ai-monogram,
.hs-ai-message__avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #2d241e, #735744);
  color: #fff;
  font-family: Georgia, serif;
}

.hs-ai-monogram {
  width: 43px;
  height: 43px;
  font-size: 20px;
}

.hs-ai-identity > span:last-child {
  display: grid;
  gap: 3px;
}

.hs-ai-identity strong {
  font-size: 14px;
  letter-spacing: 0.12em;
}

.hs-ai-identity small {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--hs-ai-muted);
  font-size: 12px;
}

.hs-ai-identity small i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hs-ai-success);
  box-shadow: 0 0 0 4px rgba(71, 112, 90, 0.12);
}

.hs-ai-icon-button,
.hs-ai-order__close {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--hs-ai-line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  color: var(--hs-ai-ink);
  cursor: pointer;
}

.hs-ai-icon-button {
  position: relative;
}

.hs-ai-icon-button span {
  position: absolute;
  width: 17px;
  height: 1px;
  background: currentColor;
}

.hs-ai-icon-button span:first-child { transform: rotate(45deg); }
.hs-ai-icon-button span:last-child { transform: rotate(-45deg); }

.hs-ai-body {
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 19px calc(20px + env(safe-area-inset-bottom));
  scrollbar-width: thin;
  scrollbar-color: rgba(80, 58, 44, 0.35) transparent;
}

.hs-ai-intro h2,
.hs-ai-order h2 {
  margin: 4px 0 8px;
  color: var(--hs-ai-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(27px, 5.8vw, 34px);
  font-weight: 400;
  line-height: 1.03;
  letter-spacing: -0.025em;
}

.hs-ai-intro > p:last-child,
.hs-ai-order__intro {
  margin: 0;
  color: var(--hs-ai-muted);
  font-size: 14px;
  line-height: 1.55;
}

.hs-ai-overline {
  margin: 0;
  color: var(--hs-ai-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.hs-ai-projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 19px 0;
}

.hs-ai-projects button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 7px;
  border: 1px solid var(--hs-ai-line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--hs-ai-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.hs-ai-projects button:hover { transform: translateY(-1px); }
.hs-ai-projects button.is-active {
  border-color: rgba(95, 69, 52, 0.62);
  background: #2d241e;
  color: #fff;
}

.hs-ai-projects svg,
.hs-ai-photo svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.hs-ai-thread {
  display: grid;
  gap: 11px;
  margin: 0 0 17px;
}

.hs-ai-message {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.hs-ai-message__avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  margin-top: 2px;
  font-size: 12px;
}

.hs-ai-message p {
  max-width: 86%;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--hs-ai-line);
  border-radius: 4px 15px 15px 15px;
  background: var(--hs-ai-card);
  color: #4f4741;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.hs-ai-message--user {
  justify-content: flex-end;
}

.hs-ai-message--user p {
  border-color: #2d241e;
  border-radius: 15px 15px 4px 15px;
  background: #2d241e;
  color: #fff;
}

.hs-ai-message--loading p {
  display: flex;
  min-width: 62px;
  gap: 5px;
  align-items: center;
}

.hs-ai-message--loading i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9b8879;
  animation: hs-ai-dot 1.1s ease-in-out infinite;
}

.hs-ai-message--loading i:nth-child(2) { animation-delay: 120ms; }
.hs-ai-message--loading i:nth-child(3) { animation-delay: 240ms; }

.hs-ai-result {
  margin: 0 0 17px;
  animation: hs-ai-result-in 350ms ease both;
}

.hs-ai-result__frame {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  border-radius: 18px;
  background: #ded7cf;
  box-shadow: 0 14px 34px rgba(46, 33, 24, 0.18);
}

.hs-ai-result__frame img {
  display: block;
  width: 100%;
  max-height: 440px;
  object-fit: contain;
  background: #ded7cf;
}

.hs-ai-result__frame span {
  position: absolute;
  top: 11px;
  left: 11px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(25, 20, 17, 0.7);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
  backdrop-filter: blur(8px);
}

.hs-ai-result figcaption {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 3px 0;
  color: var(--hs-ai-muted);
  font-size: 11px;
  line-height: 1.4;
}

.hs-ai-result figcaption button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--hs-ai-accent-dark);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hs-ai-composer {
  display: grid;
  gap: 12px;
}

.hs-ai-photo {
  position: relative;
}

.hs-ai-photo label {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px dashed rgba(93, 70, 54, 0.42);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.hs-ai-photo label:hover {
  border-color: var(--hs-ai-accent);
  background: rgba(255, 255, 255, 0.76);
}

.hs-ai-photo__icon {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  flex: 0 0 43px;
  border-radius: 50%;
  background: #e8dfd5;
  color: #5e4636;
}

.hs-ai-photo label > span:nth-child(2) {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.hs-ai-photo strong,
.hs-ai-prompt > span,
.hs-ai-order label > span {
  color: var(--hs-ai-ink);
  font-size: 13px;
  font-weight: 700;
}

.hs-ai-photo small {
  color: var(--hs-ai-muted);
  font-size: 11px;
}

.hs-ai-photo label > img {
  width: 58px;
  height: 58px;
  margin-left: auto;
  border-radius: 10px;
  object-fit: cover;
}

.hs-ai-photo > button {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #2d241e;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.hs-ai-prompt {
  display: grid;
  gap: 7px;
}

.hs-ai-prompt textarea,
.hs-ai-order input,
.hs-ai-order textarea,
.hs-ai-order select {
  width: 100%;
  border: 1px solid var(--hs-ai-line);
  border-radius: 13px;
  background: var(--hs-ai-card);
  color: var(--hs-ai-ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: none;
}

.hs-ai-prompt textarea {
  min-height: 90px;
  resize: vertical;
  padding: 12px 13px;
}

.hs-ai-prompt textarea::placeholder,
.hs-ai-order input::placeholder,
.hs-ai-order textarea::placeholder { color: #a09891; }

.hs-ai-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--hs-ai-muted);
  font-size: 11px;
  line-height: 1.45;
  cursor: pointer;
}

.hs-ai-consent input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 1px 0 0;
  accent-color: var(--hs-ai-accent-dark);
}

.hs-ai-powered {
  margin: -5px 0 0 24px;
  color: #958a82;
  font-size: 10px;
  line-height: 1.35;
}

.hs-ai-composer__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.hs-ai-composer__actions:has(.hs-ai-order-trigger:not([hidden])) {
  grid-template-columns: 1fr 1fr;
}

.hs-ai-primary,
.hs-ai-order-trigger {
  min-height: 48px;
  padding: 11px 15px;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.hs-ai-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #2d241e;
  background: #2d241e;
  color: #fff;
}

.hs-ai-primary svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.hs-ai-order-trigger {
  border: 1px solid #806149;
  background: #a27a5b;
  color: #fff;
}

.hs-ai-primary:hover,
.hs-ai-order-trigger:hover { transform: translateY(-1px); }
.hs-ai-primary:disabled,
.hs-ai-order-trigger:disabled { cursor: wait; opacity: 0.58; transform: none; }

.hs-ai-form-status {
  min-height: 0;
  margin: 0;
  color: #a13f38;
  font-size: 12px;
  line-height: 1.4;
}

.hs-ai-form-status:empty { display: none; }
.hs-ai-form-status.is-success { color: var(--hs-ai-success); }

.hs-ai-order-backdrop {
  position: fixed;
  z-index: 2400;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 13, 10, 0.68);
  backdrop-filter: blur(12px);
  animation: hs-ai-fade-in 180ms ease both;
}

.hs-ai-order {
  position: relative;
  width: min(760px, 100%);
  max-height: min(860px, calc(100dvh - 40px));
  overflow-y: auto;
  padding: clamp(23px, 4vw, 40px);
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 25px;
  background: var(--hs-ai-paper);
  color: var(--hs-ai-ink);
  box-shadow: 0 34px 100px rgba(12, 8, 6, 0.42);
  animation: hs-ai-order-in 240ms ease both;
}

.hs-ai-order__close {
  position: absolute;
  z-index: 2;
  top: 15px;
  right: 15px;
  font-size: 24px;
  line-height: 1;
}

.hs-ai-order__preview {
  width: 150px;
  margin: 17px 0;
  overflow: hidden;
  border-radius: 13px;
  background: #ded7cf;
  box-shadow: 0 10px 28px rgba(40, 27, 19, 0.16);
}

.hs-ai-order__preview img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.hs-ai-order form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.hs-ai-order form > label:not(.hs-ai-consent) {
  display: grid;
  gap: 7px;
}

.hs-ai-order input,
.hs-ai-order textarea,
.hs-ai-order select {
  min-height: 47px;
  padding: 10px 12px;
}

.hs-ai-order textarea {
  min-height: 82px;
  resize: vertical;
}

.hs-ai-order__wide { grid-column: 1 / -1; }
.hs-ai-honeypot { position: absolute !important; left: -9999px !important; opacity: 0 !important; }

.hs-ai-order-success {
  display: grid;
  min-height: 390px;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
}

.hs-ai-order-success > span {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  background: var(--hs-ai-success);
  color: #fff;
  font-size: 28px;
}

.hs-ai-order-success p {
  max-width: 470px;
  margin: 0 0 8px;
  color: var(--hs-ai-muted);
  font-size: 14px;
  line-height: 1.55;
}

.hs-ai-order-success .hs-ai-primary { min-width: 150px; }

@keyframes hs-ai-spark {
  0%, 78%, 100% { transform: rotate(0deg) scale(1); }
  84% { transform: rotate(12deg) scale(1.06); }
  91% { transform: rotate(-8deg) scale(1.03); }
}

@keyframes hs-ai-panel-in {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes hs-ai-order-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes hs-ai-result-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hs-ai-fade-in { from { opacity: 0; } to { opacity: 1; } }

@keyframes hs-ai-dot {
  0%, 60%, 100% { opacity: 0.34; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 640px) {
  .hs-ai-launcher {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    min-height: 56px;
    padding: 7px 15px 7px 7px;
  }

  .hs-ai-launcher__spark {
    width: 42px;
    height: 42px;
  }

  .hs-ai-panel {
    inset: 0;
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .hs-ai-header {
    min-height: calc(67px + env(safe-area-inset-top));
    padding-top: calc(11px + env(safe-area-inset-top));
  }

  .hs-ai-body { padding: 18px 15px calc(18px + env(safe-area-inset-bottom)); }
  .hs-ai-intro h2 { font-size: 29px; }
  .hs-ai-projects button { min-height: 56px; font-size: 10px; line-height: 1.2; text-align: center; }
  .hs-ai-projects svg { display: none; }

  .hs-ai-order-backdrop {
    display: block;
    padding: 0;
  }

  .hs-ai-order {
    width: 100%;
    height: 100dvh;
    max-height: none;
    padding: calc(25px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
  }

  .hs-ai-order__close { top: calc(11px + env(safe-area-inset-top)); right: 12px; }
  .hs-ai-order form { grid-template-columns: 1fr; }
  .hs-ai-order__wide { grid-column: auto; }
  .hs-ai-composer__actions:has(.hs-ai-order-trigger:not([hidden])) { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .hs-ai-launcher__copy small { display: none; }
  .hs-ai-launcher { padding-right: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .hs-ai-launcher,
  .hs-ai-panel,
  .hs-ai-order,
  .hs-ai-order-backdrop,
  .hs-ai-result,
  .hs-ai-message--loading i {
    animation: none !important;
    transition: none !important;
  }
}
