.pkaty-widget {
  --pkaty-red: #e60023;
  --pkaty-red-dark: #b8001b;
  --pkaty-orange: #ff8200;
  --pkaty-ink: #050506;
  --pkaty-graphite: #101116;
  --pkaty-navy: #1c244b;
  --pkaty-line: rgba(255, 255, 255, .12);
  --pkaty-text: #ffffff;
  --pkaty-muted: rgba(255, 255, 255, .68);
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99999;
  color: var(--pkaty-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.pkaty-widget *,
.pkaty-widget *::before,
.pkaty-widget *::after {
  box-sizing: border-box;
}

.pkaty-fab {
  all: unset;
  box-sizing: border-box;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  overflow: visible;
  appearance: none;
  -webkit-appearance: none;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, 0) 38%),
    linear-gradient(135deg, #050506 0%, #17181d 56%, #2a0b12 100%);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .36), 0 0 0 5px rgba(230, 0, 35, .09);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.pkaty-fab:hover {
  transform: translateY(-2px);
  border-color: rgba(230, 0, 35, .52);
  box-shadow: 0 22px 52px rgba(0, 0, 0, .42), 0 0 0 7px rgba(230, 0, 35, .12);
}

.pkaty-fab:focus-visible,
.pkaty-close:focus-visible,
.pkaty-send:focus-visible,
.pkaty-extra a:focus-visible,
.pkaty-input:focus-visible {
  outline: 2px solid rgba(255, 130, 0, .9);
  outline-offset: 3px;
}

.pkaty-fab-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, .45));
}

.pkaty-fab-fallback {
  display: none;
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0;
}

.pkaty-fab::before {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: inherit;
  border: 1px solid rgba(230, 0, 35, .34);
  opacity: .8;
  animation: pkatyPulse 2.3s ease-out infinite;
  pointer-events: none;
}

.pkaty-fab::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 7px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #20d66b;
  border: 2px solid var(--pkaty-ink);
  box-shadow: 0 0 14px rgba(32, 214, 107, .8);
}

@keyframes pkatyPulse {
  0% { transform: scale(.9); opacity: .48; }
  70% { transform: scale(1.28); opacity: .12; }
  100% { transform: scale(1.42); opacity: 0; }
}

.pkaty-widget.pkaty-open .pkaty-fab {
  display: none;
}

.pkaty-panel {
  width: 360px;
  max-width: calc(100vw - 28px);
  height: 540px;
  max-height: calc(100svh - 38px);
  display: none;
  overflow: hidden;
  margin-bottom: 12px;
  border-radius: 10px;
  background:
    linear-gradient(150deg, rgba(230, 0, 35, .18) 0%, rgba(255, 130, 0, .08) 26%, rgba(5, 5, 6, 0) 48%),
    linear-gradient(180deg, rgba(19, 20, 25, .94) 0%, rgba(5, 5, 6, .96) 100%);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 30px 95px rgba(0, 0, 0, .46), 0 0 0 1px rgba(230, 0, 35, .10) inset;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform-origin: bottom right;
}

.pkaty-panel.is-open {
  display: flex;
  flex-direction: column;
  animation: pkatyPanelIn .18s ease-out both;
}

@keyframes pkatyPanelIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.pkaty-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 16px 14px;
  color: #fff;
  background: linear-gradient(135deg, rgba(5, 5, 6, .72), rgba(28, 36, 75, .34));
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.pkaty-brand {
  min-width: 0;
  display: flex;
  gap: 12px;
  align-items: center;
}

.pkaty-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  padding: 6px;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .14);
}

.pkaty-title {
  font-weight: 850;
  line-height: 1;
  font-size: 16px;
  letter-spacing: 0;
}

.pkaty-subtitle {
  margin-top: 5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--pkaty-muted);
  font-size: 12px;
  line-height: 1.2;
}

.pkaty-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #20d66b;
  box-shadow: 0 0 10px rgba(32, 214, 107, .7);
}

.pkaty-close {
  all: unset;
  box-sizing: border-box;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  cursor: pointer;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  transition: background .2s ease, transform .2s ease, border-color .2s ease;
  font-size: 0;
}

.pkaty-close::before {
  content: "×";
  font-size: 22px;
  line-height: 1;
}

.pkaty-close:hover {
  transform: translateY(-1px);
  background: rgba(230, 0, 35, .22);
  border-color: rgba(230, 0, 35, .5);
}

.pkaty-messages {
  flex: 1;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  background:
    radial-gradient(circle at top left, rgba(230, 0, 35, .08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, 0));
}

.pkaty-msg {
  max-width: 86%;
  padding: 11px 13px;
  border-radius: 8px;
  margin-bottom: 10px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.42;
  border: 1px solid rgba(255, 255, 255, .08);
}

.pkaty-msg-user {
  margin-left: auto;
  color: #fff;
  background: linear-gradient(135deg, var(--pkaty-red) 0%, var(--pkaty-red-dark) 100%);
  border-color: rgba(255, 255, 255, .18);
  box-shadow: 0 10px 24px rgba(230, 0, 35, .20);
}

.pkaty-msg-bot {
  margin-right: auto;
  color: rgba(255, 255, 255, .93);
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .10);
}

.pkaty-footer {
  display: flex;
  gap: 9px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, .10);
  background: rgba(5, 5, 6, .74);
}

.pkaty-input {
  all: unset;
  box-sizing: border-box;
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .94);
  font-size: 14px;
}

.pkaty-input::placeholder {
  color: rgba(255, 255, 255, .52);
}

.pkaty-input:focus {
  border-color: rgba(230, 0, 35, .58);
  background: rgba(255, 255, 255, .09);
}

.pkaty-send {
  all: unset;
  box-sizing: border-box;
  height: 42px;
  min-width: 74px;
  padding: 0 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, var(--pkaty-red), var(--pkaty-red-dark));
  box-shadow: 0 12px 24px rgba(230, 0, 35, .24);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.pkaty-send:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 15px 30px rgba(230, 0, 35, .30);
}

.pkaty-send:disabled,
.pkaty-input:disabled {
  opacity: .62;
  cursor: wait;
}

.pkaty-extra {
  padding: 0 12px 12px;
  background: rgba(5, 5, 6, .74);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pkaty-extra a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .065);
  color: rgba(255, 255, 255, .9);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.pkaty-extra a:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .22);
}

.pkaty-extra .pkaty-wa {
  background: rgba(37, 211, 102, .14);
  border-color: rgba(37, 211, 102, .28);
}

.pkaty-extra .pkaty-contact {
  background: rgba(255, 130, 0, .13);
  border-color: rgba(255, 130, 0, .30);
}

.pkaty-extra .pkaty-crm {
  grid-column: 1 / -1;
}

.pkaty-messages::-webkit-scrollbar {
  width: 7px;
}

.pkaty-messages::-webkit-scrollbar-thumb {
  background: rgba(230, 0, 35, .62);
  border-radius: 999px;
}

@media (max-width: 430px) {
  .pkaty-widget {
    right: 12px;
    bottom: 12px;
  }

  .pkaty-panel {
    width: calc(100vw - 24px);
    height: min(540px, calc(100svh - 24px));
    margin-bottom: 0;
  }

  .pkaty-extra {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pkaty-fab::before,
  .pkaty-panel.is-open {
    animation: none;
  }

  .pkaty-fab,
  .pkaty-close,
  .pkaty-send,
  .pkaty-extra a {
    transition: none;
  }
}
