.dns-ai-chat {
  --dns-ai-chat-orange: #ff8a00;
  --dns-ai-chat-orange-soft: #ffc15f;
  --dns-ai-chat-blue: #35a7ff;
  --dns-ai-chat-line: rgba(67, 158, 232, 0.42);
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2140;
  font-family: inherit;
}

body.dns-ai-chat-active .dns-scroll-to-top {
  bottom: 100px;
}

body.dns-ai-chat-active .dns-products-main {
  padding-bottom: max(104px, env(safe-area-inset-bottom)) !important;
}

.dns-ai-chat-launcher {
  position: relative;
  display: grid;
  width: 60px;
  height: 60px;
  padding: 0;
  place-items: center;
  color: #dff3ff;
  cursor: pointer;
  background:
    radial-gradient(circle at 50% 32%, rgba(52, 164, 245, 0.28), transparent 52%),
    linear-gradient(145deg, rgba(11, 38, 60, 0.98), rgba(3, 15, 27, 0.98));
  border: 1px solid rgba(255, 138, 0, 0.72);
  border-radius: 19px;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.46),
    0 0 24px rgba(255, 138, 0, 0.13),
    inset 0 1px rgba(255, 255, 255, 0.08);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.dns-ai-chat-launcher:hover,
.dns-ai-chat-launcher:focus-visible,
.dns-ai-chat.is-open .dns-ai-chat-launcher {
  border-color: var(--dns-ai-chat-orange);
  outline: none;
  box-shadow:
    0 20px 46px rgba(0, 0, 0, 0.5),
    0 0 0 3px rgba(255, 138, 0, 0.11),
    0 0 28px rgba(255, 138, 0, 0.2),
    inset 0 1px rgba(255, 255, 255, 0.1);
}

.dns-ai-chat-launcher svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.dns-ai-chat-launcher-badge {
  position: absolute;
  right: -5px;
  bottom: -4px;
  min-width: 24px;
  padding: 3px 5px;
  color: #07111d;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.05em;
  background: linear-gradient(180deg, #ffc36b, #ff8500);
  border: 2px solid #071421;
  border-radius: 8px;
}

.dns-ai-chat-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  display: grid;
  width: min(390px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 128px));
  min-height: 430px;
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  color: rgba(238, 247, 255, 0.96);
  background: linear-gradient(180deg, rgba(10, 30, 47, 0.96), rgba(3, 14, 25, 0.98)), rgba(3, 14, 25, 0.98);
  border: 1px solid var(--dns-ai-chat-line);
  border-radius: 22px;
  box-shadow:
    0 30px 76px rgba(0, 0, 0, 0.58),
    0 0 34px rgba(38, 151, 232, 0.11),
    inset 0 1px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  transform-origin: right bottom;
}

.dns-ai-chat-panel[hidden] {
  display: none;
}

.dns-ai-chat-head {
  display: grid;
  grid-template-columns: 42px 1fr auto auto;
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 10px 12px;
  background: linear-gradient(90deg, rgba(24, 83, 119, 0.18), transparent 72%), rgba(4, 17, 29, 0.74);
  border-bottom: 1px solid rgba(60, 155, 224, 0.25);
}

.dns-ai-chat-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--dns-ai-chat-orange-soft);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: radial-gradient(circle at 50% 35%, rgba(255, 170, 55, 0.2), transparent 55%), rgba(5, 19, 32, 0.9);
  border: 1px solid rgba(255, 138, 0, 0.6);
  border-radius: 13px;
  box-shadow: inset 0 0 15px rgba(255, 138, 0, 0.08);
}

.dns-ai-chat-title {
  min-width: 0;
}

.dns-ai-chat-title strong,
.dns-ai-chat-title small {
  display: block;
}

.dns-ai-chat-title strong {
  font-size: 16px;
  font-weight: 750;
}

.dns-ai-chat-title small {
  margin-top: 2px;
  overflow: hidden;
  color: rgba(166, 191, 211, 0.82);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dns-ai-chat.is-thinking .dns-ai-chat-title small {
  color: rgba(255, 193, 95, 0.92);
  animation: dns-ai-chat-thinking 1.25s ease-in-out infinite;
}

.dns-ai-chat-icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  color: rgba(205, 226, 241, 0.82);
  font: inherit;
  font-size: 20px;
  cursor: pointer;
  background: rgba(7, 25, 40, 0.74);
  border: 1px solid rgba(61, 150, 214, 0.32);
  border-radius: 11px;
}

.dns-ai-chat-icon-button:hover,
.dns-ai-chat-icon-button:focus-visible {
  color: #fff;
  border-color: rgba(255, 138, 0, 0.68);
  outline: none;
  box-shadow: 0 0 14px rgba(255, 138, 0, 0.12);
}

.dns-ai-chat-clear {
  font-size: 15px;
}

.dns-ai-chat-messages {
  display: flex;
  gap: 10px;
  flex-direction: column;
  min-height: 0;
  padding: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(55, 158, 230, 0.55) transparent;
  scrollbar-width: thin;
}

.dns-ai-chat-message {
  align-self: flex-start;
  max-width: 88%;
  padding: 11px 13px;
  color: rgba(227, 240, 250, 0.94);
  font-size: 13px;
  line-height: 1.48;
  overflow-wrap: anywhere;
  background: rgba(11, 36, 54, 0.76);
  border: 1px solid rgba(62, 153, 216, 0.28);
  border-radius: 15px 15px 15px 5px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.dns-ai-chat-message.is-user {
  align-self: flex-end;
  color: #fff2dc;
  background: linear-gradient(145deg, rgba(112, 55, 7, 0.9), rgba(73, 34, 3, 0.92));
  border-color: rgba(255, 139, 19, 0.55);
  border-radius: 15px 15px 5px;
}

.dns-ai-chat-message-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.dns-ai-chat-message-action,
.dns-ai-chat-quick-action {
  display: inline-flex;
  min-height: 32px;
  padding: 6px 10px;
  align-items: center;
  justify-content: center;
  color: #ffd49a;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  background: rgba(5, 22, 37, 0.82);
  border: 1px solid rgba(255, 138, 0, 0.48);
  border-radius: 10px;
}

.dns-ai-chat-message-action:hover,
.dns-ai-chat-message-action:focus-visible,
.dns-ai-chat-quick-action:hover,
.dns-ai-chat-quick-action:focus-visible {
  color: #fff;
  background: rgba(58, 35, 13, 0.82);
  border-color: rgba(255, 157, 50, 0.78);
  outline: none;
}

.dns-ai-chat-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 10px 12px;
  overflow: hidden;
  background: rgba(3, 13, 23, 0.7);
  border-top: 1px solid rgba(55, 145, 208, 0.18);
}

.dns-ai-chat-quick-action {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.dns-ai-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  padding: 12px;
  background: rgba(2, 11, 19, 0.94);
  border-top: 1px solid rgba(55, 145, 208, 0.2);
}

.dns-ai-chat-input {
  min-width: 0;
  height: 44px;
  padding: 0 13px;
  color: rgba(241, 248, 253, 0.96);
  font: inherit;
  font-size: 13px;
  background: rgba(3, 18, 31, 0.9);
  border: 1px solid rgba(59, 150, 214, 0.42);
  border-radius: 12px;
  outline: none;
}

.dns-ai-chat-input::placeholder {
  color: rgba(147, 176, 198, 0.58);
}

.dns-ai-chat-input:focus {
  border-color: rgba(67, 158, 232, 0.76);
  outline: none;
  box-shadow: inset 0 0 14px rgba(53, 167, 255, 0.05);
}

.dns-ai-chat-send {
  min-width: 90px;
  height: 44px;
  padding: 0 14px;
  color: #ffd49a;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(80, 45, 14, 0.64), rgba(34, 23, 11, 0.88)), rgba(9, 25, 38, 0.92);
  border: 1px solid rgba(255, 138, 0, 0.68);
  border-radius: 12px;
  box-shadow: inset 0 1px rgba(255, 202, 125, 0.12);
}

.dns-ai-chat-send:hover,
.dns-ai-chat-send:focus-visible {
  color: #fff;
  border-color: #ff9f36;
  outline: none;
  box-shadow:
    0 0 16px rgba(255, 138, 0, 0.14),
    inset 0 1px rgba(255, 215, 158, 0.15);
}

.dns-ai-chat-send:disabled,
.dns-ai-chat-input:disabled {
  cursor: wait;
  opacity: 0.66;
}

.dns-ai-chat-recommendation {
  width: 100%;
  max-width: 100%;
}

.dns-ai-chat-subscription-card {
  width: 100%;
  max-width: 100%;
}

.dns-ai-chat-recommendation-hint {
  display: block;
  margin-top: 7px;
  color: rgba(166, 191, 211, 0.84);
  font-size: 10px;
  line-height: 1.45;
}

.dns-ai-chat-comparison-wrap {
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid rgba(62, 153, 216, 0.24);
  border-radius: 10px;
}

.dns-ai-chat-comparison {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 10px;
  line-height: 1.35;
}

.dns-ai-chat-comparison th,
.dns-ai-chat-comparison td {
  padding: 7px 6px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(62, 153, 216, 0.16);
  overflow-wrap: anywhere;
}

.dns-ai-chat-comparison th {
  color: rgba(255, 212, 154, 0.9);
  font-weight: 700;
  background: rgba(3, 15, 26, 0.72);
}

.dns-ai-chat-comparison th:nth-child(1) {
  width: 47%;
}

.dns-ai-chat-comparison th:nth-child(2) {
  width: 20%;
}

.dns-ai-chat-comparison th:nth-child(3) {
  width: 33%;
}

.dns-ai-chat-comparison tr:last-child td {
  border-bottom: 0;
}

.dns-ai-chat-comparison a {
  color: rgba(223, 243, 255, 0.96);
  text-decoration-color: rgba(53, 167, 255, 0.42);
  text-underline-offset: 2px;
}

.dns-ai-chat-comparison td:nth-child(2) {
  color: #ffbd62;
  white-space: nowrap;
}

.dns-ai-chat-subscription-table {
  min-width: 100%;
  font-size: 9px;
  line-height: 1.25;
}

.dns-ai-chat-subscription-table th:first-child,
.dns-ai-chat-subscription-table td:first-child {
  width: 43%;
}

.dns-ai-chat-subscription-table th:not(:first-child),
.dns-ai-chat-subscription-table td:not(:first-child) {
  width: 19%;
  padding-right: 3px;
  padding-left: 3px;
  text-align: center;
}

.dns-ai-chat-subscription-table td:nth-child(2) {
  color: rgba(211, 226, 238, 0.78);
  white-space: normal;
}

.dns-ai-chat-subscription-table .is-available {
  color: #78efae;
}

.dns-ai-chat-subscription-table .is-limited {
  color: #ffbd62;
}

.dns-ai-chat-subscription-table .is-basic {
  color: rgba(203, 222, 237, 0.88);
}

.dns-ai-chat-subscription-table .is-unavailable {
  color: rgba(139, 159, 175, 0.66);
}

.dns-ai-chat-subscription-table .is-current {
  background: rgba(47, 144, 211, 0.09);
}

html.dns-products-theme-light .dns-ai-chat-launcher {
  color: #174b67;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.98), transparent 49%),
    linear-gradient(145deg, rgba(248, 252, 254, 0.99), rgba(207, 225, 235, 0.98));
  border-color: rgba(221, 111, 6, 0.78);
  box-shadow:
    0 14px 30px rgba(40, 73, 91, 0.2),
    0 0 18px rgba(221, 111, 6, 0.11),
    inset 0 1px rgba(255, 255, 255, 0.94);
}

html.dns-products-theme-light .dns-ai-chat-launcher:hover,
html.dns-products-theme-light .dns-ai-chat-launcher:focus-visible,
html.dns-products-theme-light .dns-ai-chat.is-open .dns-ai-chat-launcher {
  color: #0c3f5e;
  border-color: #db7008;
  box-shadow:
    0 16px 34px rgba(40, 73, 91, 0.22),
    0 0 0 3px rgba(221, 111, 6, 0.1),
    0 0 21px rgba(221, 111, 6, 0.14),
    inset 0 1px rgba(255, 255, 255, 0.96);
}

html.dns-products-theme-light .dns-ai-chat-launcher-badge {
  color: #7b3800;
  background: linear-gradient(180deg, #fff2d6, #ffc15d);
  border-color: #e7f1f6;
  box-shadow: 0 2px 7px rgba(57, 82, 96, 0.18);
}

@keyframes dns-ai-chat-thinking {
  0%,
  100% {
    opacity: 0.58;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .dns-ai-chat {
    right: 14px;
    bottom: 14px;
  }

  .dns-ai-chat-launcher {
    width: 54px;
    height: 54px;
    border-radius: 17px;
  }

  .dns-ai-chat-panel {
    position: fixed;
    inset: 12px;
    width: auto;
    height: auto;
    min-height: 0;
    border-radius: 20px;
  }

  .dns-ai-chat.is-open .dns-ai-chat-launcher {
    visibility: hidden;
  }

  .dns-ai-chat-message {
    max-width: 92%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dns-ai-chat-launcher,
  .dns-ai-chat.is-thinking .dns-ai-chat-title small {
    transition: none;
    animation: none;
  }
}
