.ab-launch {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 10px;
  border: 0;
  border-radius: 999px;
  background: #0047bb;
  box-shadow: 0 8px 24px rgba(10, 26, 60, 0.28);
  color: #fff;
  cursor: pointer;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.ab-launch:hover {
  background: #0039a0;
}

.ab-launch:focus-visible,
.ab-opt:focus-visible,
.ab-send:focus-visible,
.ab-x:focus-visible,
.ab-input:focus-visible,
.mobile-action-chat:focus-visible {
  outline: 3px solid #2db84c;
  outline-offset: 2px;
}

.ab-mascot {
  display: flex;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: #2db84c;
}

.ab-mascot img {
  display: block;
  width: 38px;
  height: auto;
}

.ab-backdrop {
  position: fixed;
  inset: 0;
  z-index: 998;
  display: none;
  background: rgba(10, 26, 60, 0.46);
}

.ab-backdrop.open {
  display: block;
}

.ab-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 1000;
  display: none;
  width: min(360px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 120px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e3e8ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(10, 26, 60, 0.25);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.ab-panel.open {
  display: flex;
}

.ab-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #0a1a3c;
  color: #fff;
}

.ab-head .ab-t {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.ab-head .ab-s {
  color: #aebcd8;
  font-size: 12px;
}

.ab-x {
  margin-left: auto;
  padding: 4px;
  border: 0;
  background: none;
  color: #aebcd8;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.ab-x:hover {
  color: #fff;
}

.ab-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 16px;
  background: #f5f7fa;
}

.ab-msg,
.ab-user {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
}

.ab-msg {
  border: 1px solid #e3e8ef;
  border-radius: 12px 12px 12px 4px;
  background: #fff;
  color: #11151c;
}

.ab-user {
  align-self: flex-end;
  border-radius: 12px 12px 4px 12px;
  background: #0047bb;
  color: #fff;
}

.ab-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ab-opt {
  padding: 8px 14px;
  border: 1.5px solid #0047bb;
  border-radius: 999px;
  background: #fff;
  color: #0047bb;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
}

.ab-opt:hover {
  background: #0047bb;
  color: #fff;
}

.ab-opt .ab-price {
  font-weight: 800;
}

.ab-form {
  display: flex;
  gap: 8px;
}

.ab-input {
  min-width: 0;
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #e3e8ef;
  border-radius: 9px;
  color: #11151c;
  font-family: inherit;
  font-size: 16px;
}

.ab-send {
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: #2db84c;
  color: #0a1a3c;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
}

.ab-send:hover {
  filter: brightness(0.95);
}

.ab-ticket {
  padding: 12px 14px;
  border: 1.5px solid #0a1a3c;
  border-radius: 12px;
  background: #fff;
  font-size: 13.5px;
}

.ab-ticket .ab-tk-h {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: #0a1a3c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ab-ticket .ab-tk-h::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2db84c;
  content: "";
}

.ab-ticket .ab-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px dashed #e3e8ef;
}

.ab-ticket .ab-row:last-child {
  border-bottom: 0;
}

.ab-ticket .ab-k {
  color: #5b6470;
}

.ab-ticket .ab-v {
  color: #0a1a3c;
  font-weight: 700;
  text-align: right;
}

.ab-err {
  color: #b00020;
  font-size: 12.5px;
}

@media (prefers-reduced-motion: no-preference) {
  .ab-panel.open {
    animation: abUp 0.18s ease-out;
  }

  @keyframes abUp {
    from {
      transform: translateY(8px);
      opacity: 0;
    }
    to {
      transform: none;
      opacity: 1;
    }
  }
}

@media (max-width: 640px) {
  .ab-launch {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: 54px;
    height: 54px;
    padding: 8px;
    justify-content: center;
  }

  .ab-launch-text {
    display: none;
  }

  .ab-panel {
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 104px - env(safe-area-inset-bottom));
  }

  .service-page .ab-panel {
    bottom: calc(82px + env(safe-area-inset-bottom));
    max-height: calc(100dvh - 106px - env(safe-area-inset-bottom));
  }
}
