:root {
  --ufai-ink: #171512;
  --ufai-muted: #706a62;
  --ufai-beige: #e8d8bf;
  --ufai-sand: #f6f1e8;
  --ufai-line: #ddd4c7;
  --ufai-white: #fff;
  --ufai-shadow: 0 24px 80px rgba(31, 25, 18, .18), 0 6px 18px rgba(31, 25, 18, .1);
}

.ufai,
.ufai * {
  box-sizing: border-box;
}

.ufai [hidden] {
  display: none !important;
}

.ufai button,
.ufai input,
.ufai textarea {
  font: inherit;
}

.ufai button,
.ufai a {
  -webkit-tap-highlight-color: transparent;
}

.ufai .screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ufai__launcher {
  position: fixed;
  z-index: 99998;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  margin: 0;
  padding: 8px 18px 8px 8px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: var(--ufai-ink);
  color: var(--ufai-white);
  box-shadow: 0 16px 42px rgba(23, 21, 18, .24);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.ufai__launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 48px rgba(23, 21, 18, .3);
}

.ufai__launcher-mark,
.ufai__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ufai-beige);
  color: var(--ufai-ink);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: -.045em;
}

.ufai__launcher-mark span,
.ufai__avatar span {
  margin-left: 2px;
  color: #7b5b34;
  font-size: 9px;
  letter-spacing: -.02em;
}

.ufai__launcher-copy {
  display: grid;
  gap: 1px;
  text-align: left;
  line-height: 1.2;
}

.ufai__launcher-copy strong {
  color: inherit;
  font-size: 14px;
  font-weight: 750;
}

.ufai__launcher-copy small {
  color: rgba(255, 255, 255, .64);
  font-size: 11px;
}

.ufai.is-open .ufai__launcher {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.ufai__panel {
  position: fixed;
  z-index: 99999;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100vw - 32px));
  height: min(720px, calc(100dvh - 44px));
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(23, 21, 18, .12);
  border-radius: 24px;
  background: var(--ufai-white);
  color: var(--ufai-ink);
  box-shadow: var(--ufai-shadow);
  isolation: isolate;
  animation: ufai-enter .24s ease-out both;
}

.ufai__panel::before {
  position: absolute;
  z-index: -1;
  top: -80px;
  right: -72px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(232, 216, 191, .16);
  content: '';
}

@keyframes ufai-enter {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ufai__header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  min-height: 76px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  background: var(--ufai-ink);
  color: var(--ufai-white);
}

.ufai__avatar {
  width: 46px;
  height: 46px;
}

.ufai__header-copy {
  display: grid;
  flex: 1 1 auto;
  gap: 3px;
  min-width: 0;
  line-height: 1.2;
}

.ufai__header-copy strong {
  overflow: hidden;
  color: inherit;
  font-size: 15px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ufai__header-copy small {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, .68);
  font-size: 11px;
}

.ufai__header-copy i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8fbd7b;
  box-shadow: 0 0 0 3px rgba(143, 189, 123, .14);
}

.ufai__icon-button,
.ufai__drawer-head button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .09);
  color: var(--ufai-white);
  cursor: pointer;
}

.ufai__icon-button:hover {
  background: rgba(255, 255, 255, .16);
}

.ufai__icon-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.ufai__messages {
  flex: 1 1 auto;
  min-height: 120px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 16px 10px;
  background:
    linear-gradient(180deg, rgba(246, 241, 232, .62), rgba(255, 255, 255, 0) 108px),
    var(--ufai-white);
  overscroll-behavior: contain;
  scrollbar-color: #c9bcaa transparent;
  scrollbar-width: thin;
}

.ufai__message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0 0 13px;
}

.ufai__message--user {
  flex-direction: row-reverse;
}

.ufai__message-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  border: 1px solid var(--ufai-line);
  border-radius: 50%;
  background: var(--ufai-sand);
  color: #765c3e;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .03em;
}

.ufai__message--user .ufai__message-avatar {
  border-color: var(--ufai-ink);
  background: var(--ufai-ink);
  color: var(--ufai-white);
  font-size: 8px;
}

.ufai__bubble {
  max-width: calc(100% - 45px);
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--ufai-line);
  border-radius: 15px 15px 15px 4px;
  background: var(--ufai-white);
  color: #35312c;
  font-size: 13px;
  font-weight: 450;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ufai__message--user .ufai__bubble {
  border-color: var(--ufai-ink);
  border-radius: 15px 15px 4px 15px;
  background: var(--ufai-ink);
  color: var(--ufai-white);
}

.ufai__typing {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 6px 18px;
  color: var(--ufai-muted);
  font-size: 10px;
}

.ufai__typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #967957;
  animation: ufai-dot 1s infinite ease-in-out;
}

.ufai__typing span:nth-child(2) { animation-delay: .14s; }
.ufai__typing span:nth-child(3) { animation-delay: .28s; }
.ufai__typing em { margin-left: 4px; font-style: normal; }

@keyframes ufai-dot {
  0%, 60%, 100% { opacity: .35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.ufai__suggestions {
  display: flex;
  gap: 7px;
  flex: 0 0 auto;
  overflow-x: auto;
  padding: 6px 16px 10px;
  background: var(--ufai-white);
  scrollbar-width: none;
}

.ufai__suggestions::-webkit-scrollbar { display: none; }

.ufai__suggestions button {
  flex: 0 0 auto;
  min-height: 34px;
  margin: 0;
  padding: 7px 11px;
  border: 1px solid #d2c4b1;
  border-radius: 999px;
  background: #fbf8f3;
  color: #54483a;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.ufai__suggestions button:hover {
  border-color: #a88e6d;
  background: var(--ufai-sand);
}

.ufai__products {
  display: grid;
  gap: 8px;
  margin: 4px 0 16px 35px;
}

.ufai__product {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  overflow: hidden;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--ufai-line);
  border-radius: 12px;
  background: var(--ufai-white);
  color: var(--ufai-ink);
  text-decoration: none !important;
  transition: border-color .18s ease, transform .18s ease;
}

.ufai__product:hover {
  border-color: #ab9477;
  color: var(--ufai-ink);
  transform: translateY(-1px);
}

.ufai__product-image {
  display: block;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--ufai-sand);
}

.ufai__product-image img {
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
}

.ufai__product-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  line-height: 1.2;
}

.ufai__product-copy strong {
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ufai__product-copy small {
  color: var(--ufai-muted);
  font-size: 10px;
}

.ufai__product-arrow {
  color: #8b6f4e;
  font-size: 17px;
}

.ufai__calculation {
  margin: 4px 0 16px 35px;
  padding: 13px;
  border: 1px solid #d4c5b1;
  border-radius: 14px;
  background: var(--ufai-sand);
}

.ufai__calculation-title {
  display: block;
  margin-bottom: 7px;
  color: var(--ufai-ink);
  font-size: 12px;
}

.ufai__calculation dl { margin: 0; }

.ufai__calculation dl > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(126, 101, 72, .15);
}

.ufai__calculation dt,
.ufai__calculation dd {
  margin: 0;
  color: #655b50;
  font-size: 10px;
}

.ufai__calculation dd { font-weight: 750; text-align: right; }
.ufai__calculation .is-total { margin-top: 3px; border: 0; }
.ufai__calculation .is-total dt,
.ufai__calculation .is-total dd { color: var(--ufai-ink); font-size: 12px; }
.ufai__calculation > small { display: block; margin-top: 7px; color: #776b5d; font-size: 9px; }

.ufai__tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 0 0 auto;
  border-top: 1px solid var(--ufai-line);
  background: #fcfaf7;
}

.ufai__tools button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  margin: 0;
  padding: 7px 8px;
  border: 0;
  border-right: 1px solid var(--ufai-line);
  background: transparent;
  color: #4e463d;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.ufai__tools button:last-child { border-right: 0; }
.ufai__tools button:hover,
.ufai__tools button[aria-expanded="true"] { background: var(--ufai-sand); color: var(--ufai-ink); }
.ufai__tools svg { width: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }

.ufai__calculator,
.ufai__lead {
  position: absolute;
  z-index: 3;
  inset: 76px 0 0;
  overflow-y: auto;
  padding: 18px;
  background: var(--ufai-white);
  box-shadow: 0 -18px 44px rgba(30, 24, 18, .08);
}

.ufai__drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.ufai__drawer-head strong {
  color: var(--ufai-ink);
  font-size: 17px;
  font-weight: 780;
}

.ufai__drawer-head button {
  width: 36px;
  height: 36px;
  background: var(--ufai-sand);
  color: var(--ufai-ink);
  font-size: 22px;
  font-weight: 400;
}

.ufai__calculator > label,
.ufai__lead > label,
.ufai__lead-grid label {
  display: grid;
  gap: 6px;
  margin: 0 0 13px;
  color: #4d463e;
  font-size: 11px;
  font-weight: 700;
}

.ufai__calculator input[type="number"],
.ufai__lead input[type="text"],
.ufai__lead input[type="email"],
.ufai__lead input[type="tel"],
.ufai__lead textarea {
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid #cfc5b8;
  border-radius: 9px;
  outline: none;
  background: var(--ufai-white);
  color: var(--ufai-ink);
  font-size: 13px;
  font-weight: 450;
  box-shadow: none;
}

.ufai__lead textarea { min-height: 84px; resize: vertical; }

.ufai__input-unit {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid #cfc5b8;
  border-radius: 9px;
  background: var(--ufai-white);
}

.ufai__input-unit input[type="number"] { border: 0; }
.ufai__input-unit b { padding: 0 12px; color: var(--ufai-muted); font-size: 12px; }

.ufai__calculator fieldset {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.ufai__calculator legend {
  width: 100%;
  margin-bottom: 7px;
  color: #4d463e;
  font-size: 11px;
  font-weight: 700;
}

.ufai__calculator fieldset label {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--ufai-line);
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
}

.ufai__checks {
  display: grid;
  gap: 7px;
  margin: 0 0 16px;
}

.ufai__checks label,
.ufai__consent {
  display: flex !important;
  align-items: flex-start;
  gap: 9px !important;
  margin: 0 !important;
  padding: 10px;
  border: 1px solid var(--ufai-line);
  border-radius: 10px;
  background: #fcfaf7;
  color: #4e463d;
  font-size: 10px !important;
  font-weight: 600 !important;
  line-height: 1.4;
  cursor: pointer;
}

.ufai input[type="checkbox"],
.ufai input[type="radio"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ufai-ink);
}

.ufai__primary {
  width: 100%;
  min-height: 46px;
  margin: 14px 0 0;
  padding: 10px 16px;
  border: 1px solid var(--ufai-ink);
  border-radius: 10px;
  background: var(--ufai-ink);
  color: var(--ufai-white);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.ufai__primary:hover { background: #302a24; }
.ufai__primary:disabled { opacity: .55; cursor: wait; }
.ufai__hint { display: block; margin-top: 9px; color: var(--ufai-muted); font-size: 10px; line-height: 1.4; }

.ufai__lead-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
}

.ufai__consent { margin-top: 5px !important; }
.ufai__honeypot { position: absolute !important; left: -9999px !important; }
.ufai__form-status { min-height: 18px; margin: 10px 0 0; color: #9a3d32; font-size: 10px; line-height: 1.4; }
.ufai__form-status.is-success { color: #45693c; }

.ufai__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: end;
  gap: 8px;
  flex: 0 0 auto;
  padding: 10px 12px;
  border-top: 1px solid var(--ufai-line);
  background: var(--ufai-white);
}

.ufai__composer textarea {
  width: 100%;
  min-height: 44px;
  max-height: 92px;
  margin: 0;
  padding: 11px 12px;
  overflow-y: auto;
  border: 1px solid #cec4b7;
  border-radius: 12px;
  outline: none;
  background: #fcfaf7;
  color: var(--ufai-ink);
  font-size: 12px;
  line-height: 1.45;
  resize: none;
  box-shadow: none;
}

.ufai__composer textarea::placeholder { color: #958b80; opacity: 1; }

.ufai__composer button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ufai-ink);
  border-radius: 12px;
  background: var(--ufai-ink);
  color: var(--ufai-white);
  cursor: pointer;
}

.ufai__composer button:disabled { opacity: .48; cursor: wait; }
.ufai__composer svg { width: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }

.ufai__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 14px 9px;
  background: var(--ufai-white);
  color: #958b80;
  font-size: 8px;
  line-height: 1.25;
}

.ufai__footer span { flex: 1 1 auto; }
.ufai__footer a { flex: 0 0 auto; color: #5e5143; text-decoration: underline; text-underline-offset: 2px; }

.ufai :focus-visible {
  outline: 3px solid rgba(161, 124, 78, .38) !important;
  outline-offset: 2px !important;
}

@media (max-width: 560px) {
  body.ufai-is-open { overflow: hidden; }

  .ufai__launcher {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    min-height: 58px;
  }

  .ufai__panel {
    inset: 0;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
  }

  .ufai__header {
    min-height: 72px;
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .ufai__calculator,
  .ufai__lead {
    inset: max(72px, calc(58px + env(safe-area-inset-top))) 0 0;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .ufai__footer { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .ufai__lead-grid { grid-template-columns: 1fr; }
}

@media (max-width: 370px) {
  .ufai__launcher-copy { display: none; }
  .ufai__launcher { padding-right: 8px; }
  .ufai__products,
  .ufai__calculation { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ufai__panel,
  .ufai__launcher,
  .ufai__typing span,
  .ufai__product {
    animation: none !important;
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .ufai__panel,
  .ufai__launcher,
  .ufai__product,
  .ufai__bubble,
  .ufai__composer textarea {
    border: 1px solid CanvasText;
  }
}

