:root {
  --bg-page: linear-gradient(135deg, #59927d6a, #66a6958a);
  --page-text: #111827;
  --shadow-main: 0 18px 50px rgba(15, 23, 42, 0.18);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --transition-fast: 0.2s ease;
}

.chat-widget {
  position: fixed;
  right: var(--widget-offset-x, 24px);
  bottom: var(--widget-offset-y, 24px);
  z-index: 1000;
  --widget-offset-x: 10px;
  --widget-offset-y: 5px;
  --toggle-size: 64px;
  --panel-width: 380px;
  --panel-height: 580px;
  --panel-gap: 14px;
  --accent-brand: #367245;
  --accent-brand-hover: #438353;
  --accent-button-text-hover: #4f9760;
  --accent-brand-soft: rgba(54, 114, 69, 0.12);
  --bg-panel: #fbfbfa;
  --bg-header: #2b2b2f;
  --bg-body: #f6f7f5;
  --bg-footer: #fbfbfa;
  --bg-bot-message: #eef0ec;
  --bg-user-message: #367245;
  --bg-input: #ffffff;
  --bg-option: #f1f2f3;
  --bg-option-hover: #e8e9eb;
  --text-main: #111827;
  --text-light: #ffffff;
  --text-muted: #5a616c;
  --text-header-muted: rgba(241, 242, 243, 0.82);
  --border-color: #ebedf1;
  --border-strong: #d7dbe2;
  --header-control-bg: #37373f;
  --header-control-hover: #404045;
  --theme-button-border: #4a4a50;
  --header-icon-filter: brightness(0) invert(1);
  --dropzone-border: #aeb9b0;
  --dropzone-bg: linear-gradient(180deg, rgba(241, 242, 243, 0.96), rgba(251, 251, 250, 0.98));
  --dropzone-bg-hover: linear-gradient(180deg, rgba(232, 233, 235, 0.98), rgba(241, 242, 243, 0.98));
  --dropzone-file: #367245;
  --dropzone-hint: #5a616c;
  --toggle-bg: #367245;
  --toggle-bg-hover: #438353;
  --scrollbar-thumb: rgba(90, 97, 108, 0.18);
  --scrollbar-thumb-hover: rgba(90, 97, 108, 0.3);
  --social-bg: #37373f;
  --social-bg-hover: #404045;
  --social-border: rgba(17, 24, 39, 0.14);
}

.chat-widget[data-theme="dark"] {
  --accent-brand: #367245;
  --accent-brand-hover: #438353;
  --accent-button-text-hover: #63aa73;
  --accent-brand-soft: rgba(67, 131, 83, 0.18);
  --bg-panel: #2b2b2f;
  --bg-header: #232326;
  --bg-body: #2b2b2f;
  --bg-footer: #232326;
  --bg-bot-message: #37373f;
  --bg-user-message: #367245;
  --bg-input: #313138;
  --bg-option: #37373f;
  --bg-option-hover: #404045;
  --text-main: #f1f2f3;
  --text-light: #f8fafc;
  --text-muted: #9299a5;
  --text-header-muted: rgba(241, 242, 243, 0.74);
  --border-color: #36363d;
  --border-strong: #404045;
  --header-control-bg: #37373f;
  --header-control-hover: #404045;
  --theme-button-border: #4a4a50;
  --header-icon-filter: brightness(0) invert(1);
  --dropzone-border: #4d7258;
  --dropzone-bg: linear-gradient(180deg, rgba(55, 55, 63, 0.96), rgba(43, 43, 47, 0.98));
  --dropzone-bg-hover: linear-gradient(180deg, rgba(64, 64, 69, 0.98), rgba(55, 55, 63, 0.98));
  --dropzone-file: #b5cfbc;
  --dropzone-hint: #9299a5;
  --toggle-bg: #367245;
  --toggle-bg-hover: #438353;
  --scrollbar-thumb: rgba(241, 242, 243, 0.14);
  --scrollbar-thumb-hover: rgba(241, 242, 243, 0.22);
  --social-bg: #37373f;
  --social-bg-hover: #404045;
  --social-border: rgba(241, 242, 243, 0.06);
}

.chat-widget__toggle {
  position: relative;
  width: var(--toggle-size);
  height: var(--toggle-size);
  border-radius: 50%;
  background: var(--toggle-bg);
  box-shadow: var(--shadow-main);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.chat-widget__toggle::after {
  content: "";
  position: absolute;
  top: -26%;
  left: -130%;
  width: 34%;
  height: 152%;
  background: linear-gradient(
    118deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.22),
    rgba(255, 250, 236, 0.62),
    rgba(255, 255, 255, 0.22),
    rgba(255, 255, 255, 0.08),
    transparent
  );
  transform: skewX(-22deg);
  filter: blur(1.5px);
  opacity: 0.88;
  mix-blend-mode: screen;
  animation: chat-toggle-shimmer 4.4s cubic-bezier(0.2, 0.7, 0.22, 1) infinite;
  pointer-events: none;
}

.chat-widget__toggle:hover {
  transform: scale(1.05);
  background: var(--toggle-bg-hover);
}

.chat-widget__toggle img {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
}

.chat-widget.is-chat-open .chat-widget__toggle {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
}

.chat-panel {
  width: var(--panel-width);
  height: var(--panel-height);
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-main);
  display: none;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: var(--panel-gap);
}

.chat-panel.is-open {
  display: flex;
}

.chat-panel__header {
  background: var(--bg-header);
  color: var(--text-light);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-panel__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-panel__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-panel__avatar img {
  width: 28px;
  height: 28px;
  filter: none;
}

.chat-panel__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.chat-panel__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-header-muted);
}

.chat-panel__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-panel__theme,
.chat-panel__close {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border-radius: 10px;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.chat-panel__theme {
  width: 36px;
  padding: 0;
  border: 1px solid var(--theme-button-border);
  background: var(--header-control-bg);
}

.chat-panel__theme img {
  width: 18px;
  height: 18px;
  display: block;
}

.chat-panel__close {
  width: 36px;
  background: transparent;
}

.chat-panel__theme:hover,
.chat-panel__close:hover {
  background: var(--header-control-hover);
}

.chat-panel__close img {
  width: 18px;
  height: 18px;
  filter: var(--header-icon-filter);
}

.chat-panel__body {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  background: var(--bg-body);
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

.chat-panel__body::-webkit-scrollbar {
  width: 6px;
}

.chat-panel__body::-webkit-scrollbar-track {
  background: transparent;
}

.chat-panel__body::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
}

.chat-panel__body::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.chat-message {
  display: flex;
}

.chat-message--enter {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(3px);
}

.chat-message--enter .chat-message__bubble {
  transform: translateY(8px) scale(0.982);
}

.chat-message--enter.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition: opacity 0.42s ease, transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), filter 0.42s ease;
}

.chat-message--enter.is-visible .chat-message__bubble {
  transform: translateY(0) scale(1);
  transition: transform 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-message--bot {
  justify-content: flex-start;
}

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

.chat-message__bubble {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
  will-change: transform, opacity;
}

.chat-message--bot .chat-message__bubble {
  background: var(--bg-bot-message);
  color: var(--text-main);
  border-bottom-left-radius: 6px;
}

.chat-message--contacts .chat-message__bubble {
  max-width: 100%;
  padding: 12px 14px;
}

.chat-message--payments .chat-message__bubble {
  max-width: 100%;
  padding: 8px 10px;
}

.chat-message--bot .chat-message__bubble a {
  color: var(--accent-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.chat-contact-card {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.chat-contact-card--compact {
  gap: 8px;
}

.chat-contact-card__line {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  align-items: center;
}

.chat-contact-card__icon {
  width: 18px;
  height: 18px;
  display: block;
}

.chat-contact-card__line .chat-contact-card__icon {
  width: 16px;
  height: 16px;
}

.chat-contact-card__value {
  color: var(--text-main);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
}

.chat-contact-card__schedule {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.chat-contact-card__schedule-title {
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chat-contact-card__schedule-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  align-items: baseline;
}

.chat-contact-card__schedule-day {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--text-main);
}

.chat-contact-card__schedule-time {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--text-main);
}

.chat-contact-card__socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 2px;
}

.chat-contact-card__social-link {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--social-bg);
  box-shadow: inset 0 0 0 1px var(--social-border);
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
  text-decoration: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  overflow: hidden;
}

.chat-message--bot .chat-message__bubble .chat-contact-card__social-link {
  text-decoration: none;
}

.chat-contact-card__social-link:hover {
  transform: translateY(-1px);
  background-color: var(--social-bg-hover);
  box-shadow: inset 0 0 0 1px rgba(54, 114, 69, 0.22);
}

.chat-inline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 6px;
  padding: 10px 14px;
  border: 1px solid var(--accent-brand);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-brand);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.chat-inline-action:hover {
  color: var(--accent-button-text-hover);
  background: var(--accent-brand-soft);
  box-shadow: 0 0 0 3px var(--accent-brand-soft);
  transform: translateY(-1px);
}

.chat-message--bot .chat-message__bubble .chat-inline-action {
  text-decoration: none;
}

.chat-payment-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.chat-payment-card__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
}

.chat-payment-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.chat-payment-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid var(--border-color);
  border-radius: 13px;
  background: color-mix(in srgb, var(--bg-bot-message) 82%, transparent);
}

.chat-payment-item__icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg-panel) 82%, transparent);
}

.chat-payment-item__icon {
  width: 20px;
  height: 20px;
  display: block;
}

.chat-payment-item__name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.16;
  color: var(--text-main);
}

.chat-payment-item__text {
  font-size: 13px;
  line-height: 1.28;
  color: var(--text-muted);
}

.vk-link {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.9825 19C5.46592 19 1.17864 14.1201 1 6H4.76513C4.8888 11.96 7.66451 14.4845 9.86314 15.005V6H13.4085V11.1401C15.5797 10.9189 17.8605 8.57658 18.63 6H22.1754C21.5845 9.17518 19.111 11.5175 17.3521 12.4805C19.111 13.2612 21.9282 15.3043 23 19H19.0973C18.2591 16.5275 16.1705 14.6146 13.4085 14.3543V19H12.9825Z' fill='white'/%3E%3C/svg%3E%0A");
}

.tg-link {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.3749 10.3185C8.74359 7.91938 12.3236 6.33777 14.1148 5.57361C19.2292 3.39178 20.2919 3.01277 20.9846 3.00012C21.1369 2.9975 21.4776 3.03623 21.6982 3.21986C21.8845 3.37492 21.9358 3.58438 21.9603 3.73139C21.9848 3.8784 22.0154 4.2133 21.9911 4.47498C21.714 7.46174 20.5147 14.7098 19.9046 18.055C19.6465 19.4705 19.1382 19.9451 18.6461 19.9916C17.5766 20.0925 16.7645 19.2667 15.7287 18.5702C14.1078 17.4805 13.1921 16.8021 11.6188 15.7387C9.80053 14.5097 10.9792 13.8343 12.0154 12.7304C12.2866 12.4415 16.9987 8.04555 17.0899 7.64677C17.1013 7.59689 17.1119 7.41098 17.0042 7.31282C16.8965 7.21465 16.7376 7.24822 16.6229 7.27492C16.4604 7.31276 13.871 9.06814 8.85486 12.5411C8.11988 13.0587 7.45416 13.3109 6.8577 13.2977C6.20015 13.2831 4.93528 12.9164 3.99498 12.6029C2.84166 12.2184 1.92503 12.0151 2.00485 11.362C2.04642 11.0219 2.5031 10.674 3.3749 10.3185Z' fill='white'/%3E%3C/svg%3E%0A");
}

.wa-link {
  background-image: url("data:image/svg+xml,%3Csvg width='26' height='26' viewBox='0 0 26 26' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20.8608 5.17007C18.9539 3.223 16.3179 2.16602 13.6258 2.16602C7.90509 2.16602 3.30609 6.78336 3.36217 12.4021C3.36217 14.1822 3.86694 15.9068 4.70822 17.4644L3.25 22.7493L8.69028 21.3586C10.2046 22.193 11.8871 22.5825 13.5697 22.5825C19.2343 22.5825 23.8333 17.9651 23.8333 12.3464C23.8333 9.62052 22.7677 7.06151 20.8608 5.17007ZM13.6258 20.8579C12.1115 20.8579 10.5972 20.4685 9.30722 19.6897L8.97071 19.5228L5.71776 20.3572L6.55904 17.1863L6.3347 16.8525C3.86694 12.9027 5.04473 7.67345 9.08288 5.2257C13.121 2.77795 18.337 3.9462 20.8047 7.9516C23.2725 11.957 22.0947 17.1307 18.0565 19.5784C16.7666 20.4129 15.1962 20.8579 13.6258 20.8579ZM18.5613 14.6829L17.9444 14.4048C17.9444 14.4048 17.047 14.0153 16.4861 13.7372C16.4301 13.7372 16.374 13.6816 16.3179 13.6816C16.1496 13.6816 16.0375 13.7372 15.9253 13.7928C15.9253 13.7928 15.8692 13.8484 15.084 14.7385C15.0279 14.8498 14.9158 14.9054 14.8036 14.9054H14.7475C14.6914 14.9054 14.5792 14.8498 14.5232 14.7942L14.2427 14.6829C13.6258 14.4048 13.0649 14.071 12.6163 13.6259C12.5041 13.5147 12.3358 13.4034 12.2237 13.2921C11.8311 12.9027 11.4385 12.4577 11.158 11.957L11.102 11.8457C11.0459 11.7901 11.0459 11.7345 10.9898 11.6232C10.9898 11.512 10.9898 11.4007 11.0459 11.3451C11.0459 11.3451 11.2702 11.0669 11.4385 10.9C11.5506 10.7888 11.6067 10.6219 11.7189 10.5106C11.8311 10.3437 11.8871 10.1212 11.8311 9.9543C11.775 9.67615 11.102 8.17412 10.9337 7.84034C10.8215 7.67345 10.7094 7.61782 10.5411 7.56219H10.3728C10.2607 7.56219 10.0924 7.56219 9.92416 7.56219C9.81199 7.56219 9.69982 7.61782 9.58765 7.61782L9.53156 7.67345C9.41939 7.72908 9.30722 7.84034 9.19505 7.89597C9.08288 8.00723 9.02679 8.11849 8.91462 8.22975C8.52203 8.73043 8.29768 9.34237 8.29768 9.9543C8.29768 10.3993 8.40985 10.8444 8.57811 11.2338L8.6342 11.4007C9.13896 12.4577 9.81199 13.4034 10.7094 14.2379L10.9337 14.4604C11.102 14.6273 11.2702 14.7385 11.3824 14.9054C12.5602 15.9068 13.9062 16.63 15.4205 17.0194C15.5888 17.075 15.8131 17.075 15.9814 17.1307C16.1496 17.1307 16.374 17.1307 16.5422 17.1307C16.8227 17.1307 17.1592 17.0194 17.3835 16.9081C17.5518 16.7969 17.6639 16.7969 17.7761 16.6856L17.8883 16.5743C18.0005 16.4631 18.1126 16.4075 18.2248 16.2962C18.337 16.1849 18.4491 16.0737 18.5052 15.9624C18.6174 15.7399 18.6735 15.4617 18.7296 15.1836C18.7296 15.0723 18.7296 14.9054 18.7296 14.7942C18.7296 14.7942 18.6735 14.7385 18.5613 14.6829Z' fill='white'/%3E%3C/svg%3E%0A");
}

.youtube-link {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4C12.0165 4 19.1553 4.00042 20.9414 4.48926C21.9201 4.75286 22.6916 5.52519 22.9551 6.50391C23.4424 8.28513 23.4259 11.989 23.4258 12.0186C23.4258 12.0186 23.4257 15.7274 22.9551 17.5156C22.6915 18.4941 21.9199 19.2657 20.9414 19.5293C19.1553 19.9993 12.0165 20 12 20C12 20 4.86563 20.0001 3.05859 19.5107C2.07988 19.2472 1.30843 18.4748 1.04492 17.4961C0.57573 15.7317 0.574223 12.0212 0.574219 12C0.574219 12 0.574431 8.29225 1.04492 6.50391C1.30842 5.5252 2.09875 4.73432 3.05859 4.4707C4.84681 4.00012 12 4 12 4ZM9.72266 15.4258L15.6709 12L9.72266 8.57422V15.4258Z' fill='white'/%3E%3C/svg%3E%0A");
}

.rutube-link {
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='14' viewBox='0 0 18 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.2428 6.36365H4.10397V3.10283H12.2428C12.7182 3.10283 13.0487 3.18673 13.2146 3.33324C13.3805 3.47975 13.4833 3.75149 13.4833 4.14845V5.31928C13.4833 5.73753 13.3805 6.00926 13.2146 6.15578C13.0487 6.30229 12.7182 6.3649 12.2428 6.3649V6.36365ZM12.8011 0.0285963H0.652344V13.9735H4.10397V9.43663H10.465L13.4833 13.9735H17.3484L14.0206 9.41534C15.2475 9.23126 15.7984 8.85058 16.2528 8.22322C16.7071 7.59585 16.9349 6.59281 16.9349 5.25417V4.20855C16.9349 3.41464 16.852 2.78727 16.7071 2.30641C16.5623 1.82555 16.3147 1.40731 15.9631 1.03164C15.5916 0.676001 15.1781 0.425554 14.6817 0.257755C14.1852 0.111243 13.565 0.0273438 12.8011 0.0273438V0.0285963Z' fill='white'/%3E%3C/svg%3E%0A");
  background-size: 18px 14px;
}

.max-link {
  background-image: url("data:image/svg+xml,%3Csvg width='17' height='17' viewBox='0 0 17 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.68264 16.9515C7.01431 16.9515 6.239 16.7069 4.89134 15.7284C4.03891 16.8292 1.33954 17.6894 1.22182 16.2177C1.22182 15.1128 0.978268 14.1792 0.702242 13.16C0.373447 11.9044 0 10.506 0 8.47982C0 3.64062 3.95366 0 8.63799 0C13.3264 0 17 3.82 17 8.52467C17.0157 13.1566 13.2945 16.9268 8.68264 16.9515ZM8.75165 4.18284C6.47037 4.06461 4.69244 5.6505 4.2987 8.13737C3.97396 10.1962 4.55037 12.7034 5.04153 12.8339C5.27697 12.891 5.86961 12.4099 6.239 12.0389C6.8498 12.4627 7.56107 12.7172 8.30107 12.7768C10.6648 12.891 12.6846 11.0836 12.8433 8.7122C12.9357 6.33575 11.1157 4.32291 8.75164 4.18691L8.75165 4.18284Z' fill='%23fff'/%3E%3C/svg%3E%0A");
  background-size: 17px 17px;
}

.chat-message--user .chat-message__bubble {
  background: var(--bg-user-message);
  color: var(--text-light);
  border-bottom-right-radius: 6px;
}

.chat-panel__footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-footer);
}

.chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chat-options__button {
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-option);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.3;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.chat-options__button:hover {
  border-color: var(--accent-brand);
  color: var(--accent-button-text-hover);
  background: var(--bg-option-hover);
  box-shadow: 0 0 0 3px var(--accent-brand-soft);
}

.chat-options__button:disabled {
  opacity: 0.55;
  cursor: default;
}
.chat-form {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.chat-form--enter {
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  filter: blur(5px);
}

.chat-form--enter.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition: opacity 0.56s ease, transform 0.62s cubic-bezier(0.22, 1, 0.36, 1), filter 0.56s ease;
}

.chat-form--stacked {
  flex-direction: column;
}

.chat-form__input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  width: 100%;
  background: var(--bg-input);
  color: var(--text-main);
}

.chat-form__input:focus {
  border-color: var(--accent-brand);
  box-shadow: 0 0 0 3px var(--accent-brand-soft);
}

.chat-form__textarea {
  resize: vertical;
  min-height: 96px;
}

.chat-form__textarea--rag {
  min-height: 120px;
}

.chat-form__hint {
  margin: -2px 2px 2px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-muted);
}

.chat-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 128px;
  padding: 16px;
  border: 1px dashed var(--dropzone-border);
  border-radius: 16px;
  background: var(--dropzone-bg);
  color: var(--text-main);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.chat-dropzone:hover,
.chat-dropzone:focus-visible,
.chat-dropzone.is-dragover {
  border-color: var(--accent-brand);
  background: var(--dropzone-bg-hover);
  transform: translateY(-1px);
}

.chat-dropzone.is-disabled {
  opacity: 0.7;
  cursor: default;
  transform: none;
}

.chat-dropzone.is-filled {
  border-style: solid;
  border-color: var(--accent-brand);
}

.chat-dropzone__title {
  font-size: 15px;
  font-weight: 600;
}

.chat-dropzone__hint {
  font-size: 13px;
  line-height: 1.4;
  color: var(--dropzone-hint);
}

.chat-dropzone__file {
  max-width: 100%;
  font-size: 13px;
  color: var(--dropzone-file);
  word-break: break-word;
}

.chat-form__file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-form__button {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--accent-brand);
  color: #ffffff;
  font-size: 14px;
  transition: background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.chat-form__button:hover {
  background: var(--accent-brand-hover);
  box-shadow: 0 0 0 3px var(--accent-brand-soft);
  transform: translateY(-1px);
}

.chat-form__button:disabled,
.chat-form__input:disabled,
.chat-form__textarea:disabled,
.chat-form__file-input:disabled {
  opacity: 0.7;
  cursor: default;
}

.chat-message--pending .chat-message__bubble {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  opacity: 0.92;
  animation: chat-pending-pulse 1.8s ease-in-out infinite;
}

.chat-message--pending .chat-message__bubble::after {
  content: "...";
  display: inline-block;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: baseline;
  animation: chat-pending-dots 1.2s steps(4, end) infinite;
}

@keyframes chat-pending-dots {
  0% {
    width: 0;
  }

  100% {
    width: 1.2em;
  }
}

@keyframes chat-pending-pulse {
  0%,
  100% {
    opacity: 0.88;
    box-shadow: 0 0 0 0 rgba(54, 114, 69, 0);
  }

  50% {
    opacity: 1;
    box-shadow: 0 10px 18px -14px rgba(54, 114, 69, 0.45);
  }
}

@keyframes chat-toggle-shimmer {
  0% {
    left: -130%;
    opacity: 0;
  }

  10% {
    opacity: 0.72;
  }

  54% {
    left: 138%;
    opacity: 0.9;
  }

  100% {
    left: 138%;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-widget__toggle::after,
  .chat-message--enter,
  .chat-message--enter .chat-message__bubble,
  .chat-form--enter,
  .chat-message--pending .chat-message__bubble,
  .chat-message--pending .chat-message__bubble::after {
    animation: none;
    transition: none;
    transform: none;
    filter: none;
  }
}

@media (min-width: 1280px) {
  .chat-widget {
    --panel-width: 400px;
    --panel-height: 640px;
  }
}

@media (min-width: 1920px) {
  .chat-widget {
    --widget-offset-x: 14px;
    --widget-offset-y: 14px;
    --toggle-size: 68px;
    --panel-width: 436px;
    --panel-height: 700px;
  }

  .chat-widget__toggle img {
    width: 30px;
    height: 30px;
  }

  .chat-panel__body {
    padding: 20px;
  }
}

@media (min-width: 2560px) {
  .chat-widget {
    --widget-offset-x: 16px;
    --widget-offset-y: 16px;
    --toggle-size: 68px;
    --panel-width: 430px;
    --panel-height: 680px;
    --panel-gap: 16px;
  }

  .chat-panel__body {
    padding: 18px;
  }
}

@media (max-width: 639px) {
  .chat-widget {
    --widget-offset-x: 8px;
    --widget-offset-y: 8px;
    --toggle-size: 56px;
    --panel-width: min(calc(100vw - 24px), 420px);
    --panel-height: min(84dvh, 680px);
    --panel-gap: 12px;
  }

  .chat-panel {
    max-width: calc(100vw - 24px);
    border-radius: 18px;
  }

  .chat-panel__header {
    padding: 14px 16px;
  }

  .chat-panel__body {
    padding: 16px;
    gap: 12px;
  }

  .chat-panel__footer {
    padding: 14px;
  }

  .chat-message__bubble {
    max-width: 88%;
    font-size: 14px;
  }

  .chat-options {
    gap: 8px;
  }

  .chat-options__button,
  .chat-form__input,
  .chat-form__button {
    font-size: 13px;
  }

  .chat-dropzone {
    min-height: 112px;
    padding: 14px;
  }

  .chat-dropzone__title {
    font-size: 14px;
  }

  .chat-payment-item {
    padding: 11px;
    border-radius: 15px;
  }

  .chat-payment-item__icon-wrap {
    width: 44px;
    height: 44px;
  }

  .chat-payment-item__name {
    font-size: 14px;
  }

  .chat-payment-item__text {
    font-size: 13px;
  }
}

@media (min-width: 640px) and (max-width: 900px) and (min-height: 1000px) and (orientation: portrait) {
  .chat-widget {
    --widget-offset-x: 10px;
    --widget-offset-y: 10px;
    --toggle-size: 60px;
    --panel-width: min(calc(100vw - 36px), 440px);
    --panel-height: min(74dvh, 760px);
    --panel-gap: 12px;
  }

  .chat-panel {
    max-width: calc(100vw - 36px);
    border-radius: 20px;
  }

  .chat-panel__body {
    padding: 18px;
  }

  .chat-message__bubble {
    max-width: 86%;
  }
}
