.kfs-widget,
.kfs-widget * {
  box-sizing: border-box;
}

.kfs-widget {
  position: fixed;
  bottom: var(--kfs-bottom, 24px);
  z-index: 999999;
  font-family: inherit;
}

.kfs-widget.kfs-right {
  right: var(--kfs-side, 24px);
}

.kfs-widget.kfs-left {
  left: var(--kfs-side, 24px);
}

.kfs-widget .kfs-toggle {
  appearance: none !important;
  -webkit-appearance: none !important;
  position: relative !important;
  isolation: isolate !important;
  border: 4px solid rgba(255, 255, 255, 0.96) !important;
  outline: 0 !important;
  cursor: pointer !important;
  width: 76px !important;
  min-width: 76px !important;
  max-width: 76px !important;
  height: 76px !important;
  min-height: 76px !important;
  max-height: 76px !important;
  aspect-ratio: 1 / 1 !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  color: #fff !important;
  background-color: var(--kfs-main-color, #18a999) !important;
  background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.34), rgba(255,255,255,0) 36%), linear-gradient(135deg, var(--kfs-main-color, #18a999), #0b766b) !important;
  box-shadow: 0 0 0 7px rgba(24, 169, 153, 0.16), 0 18px 42px rgba(0, 0, 0, 0.32) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  text-align: center !important;
  text-decoration: none !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease !important;
}

.kfs-widget .kfs-toggle:hover,
.kfs-widget .kfs-toggle:focus-visible {
  transform: translateY(-3px) scale(1.04) !important;
  filter: brightness(1.04) !important;
  box-shadow: 0 0 0 8px rgba(24, 169, 153, 0.2), 0 22px 48px rgba(0, 0, 0, 0.38) !important;
}

.kfs-main-icon,
.kfs-item-icon,
.kfs-head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.kfs-main-icon {
  width: 28px !important;
  height: 28px !important;
  font-size: 24px !important;
  color: inherit !important;
}

.kfs-main-icon svg,
.kfs-head-icon svg,
.kfs-item-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.kfs-main-icon img,
.kfs-item-icon img,
.kfs-head-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.kfs-main-label {
  display: block !important;
  max-width: 62px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: inherit !important;
}

.kfs-modal {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.kfs-widget.kfs-open .kfs-modal {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.kfs-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 23, 34, 0.68);
  backdrop-filter: blur(8px);
}

.kfs-modal-card {
  position: relative;
  width: min(520px, calc(100vw - 28px));
  max-height: min(720px, calc(100dvh - 28px));
  overflow: auto;
  border-radius: 28px;
  padding: 28px;
  background: #fff;
  color: #1f2933;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.22s ease;
}

.kfs-widget.kfs-open .kfs-modal-card {
  transform: translateY(0) scale(1);
}

.kfs-close {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #f2f4f7;
  color: #111827;
  font-size: 30px;
  line-height: 40px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.kfs-close:hover,
.kfs-close:focus-visible {
  background: #e6e9ee;
  transform: rotate(6deg);
}

.kfs-modal-head {
  text-align: center;
  padding: 16px 10px 20px;
}

.kfs-head-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 22px;
  color: #fff;
  background: var(--kfs-main-color, #18a999);
  box-shadow: 0 16px 32px rgba(24, 169, 153, 0.24);
}

.kfs-head-icon svg {
  width: 36px;
  height: 36px;
}

.kfs-panel-title {
  margin: 0;
  color: #111827;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.6;
}

.kfs-panel-subtitle {
  margin: 6px auto 0;
  max-width: 360px;
  color: #667085;
  font-size: 14px;
  line-height: 1.9;
}

.kfs-items {
  display: grid;
  gap: 12px;
}

.kfs-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 13px 14px;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px solid #edf1f5;
  color: #1f2933;
  text-decoration: none !important;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.kfs-item:hover,
.kfs-item:focus-visible {
  background: #f1f5f9;
  border-color: #dbe3ec;
  color: #111827;
  transform: translateY(-2px);
}

.kfs-item-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  color: #fff;
  font-size: 22px;
}

.kfs-item-whatsapp .kfs-item-icon {
  background: #25d366;
}

.kfs-item-telegram .kfs-item-icon,
.kfs-item-telegram_channel .kfs-item-icon {
  background: #229ed9;
}

.kfs-item-bale .kfs-item-icon,
.kfs-item-bale_channel .kfs-item-icon {
  background: #6842ff;
}

.kfs-item-instagram .kfs-item-icon {
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af, #515bd4);
}

.kfs-item-phone .kfs-item-icon {
  background: var(--kfs-main-color, #18a999);
}

.kfs-item-icon svg {
  width: 26px;
  height: 26px;
}

.kfs-item-text {
  display: grid;
  gap: 3px;
  flex: 1 1 auto;
  min-width: 0;
}

.kfs-item-label {
  color: #111827;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kfs-item-hint {
  color: #667085;
  font-size: 12px;
  line-height: 1.5;
}

.kfs-item-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #fff;
  color: #667085;
  font-size: 24px;
  line-height: 1;
}

body.kfs-modal-is-open {
  overflow: hidden;
}

@media (max-width: 480px) {
  .kfs-widget {
    bottom: max(14px, var(--kfs-bottom, 24px));
  }

  .kfs-widget.kfs-right {
    right: 14px;
  }

  .kfs-widget.kfs-left {
    left: 14px;
  }

  .kfs-widget .kfs-toggle {
    width: 68px !important;
    min-width: 68px !important;
    max-width: 68px !important;
    height: 68px !important;
    min-height: 68px !important;
    max-height: 68px !important;
    font-size: 10px !important;
  }

  .kfs-main-icon {
    width: 25px;
    height: 25px;
  }

  .kfs-modal {
    padding: 14px;
    align-items: stretch;
  }

  .kfs-modal-card {
    width: 100%;
    max-height: none;
    border-radius: 24px;
    padding: 22px 16px 18px;
    align-self: center;
  }

  .kfs-panel-title {
    font-size: 20px;
  }

  .kfs-item {
    min-height: 68px;
    border-radius: 18px;
  }
}
