.electrician-chat {
  --chat-navy: #0b2340;
  --chat-blue: #185a9d;
  --chat-light: #eef6ff;
  --chat-border: #c9dced;
  --chat-orange: #f28c28;
  --chat-orange-dark: #d76f0d;
  --chat-text: #172b3a;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 320;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.electrician-chat *,
.electrician-chat *::before,
.electrician-chat *::after {
  box-sizing: border-box;
}

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

.electrician-chat__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--chat-navy), #123d68);
  color: #fff;
  box-shadow: 0 12px 34px rgba(4, 18, 33, .34);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.electrician-chat__toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 38px rgba(4, 18, 33, .42);
}

.electrician-chat__toggle-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--chat-orange);
  color: #1d1207;
}

.electrician-chat__panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
  width: min(390px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 100px));
  max-height: min(660px, calc(100vh - 100px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 20px;
  background: #fff;
  color: var(--chat-text);
  box-shadow: 0 24px 70px rgba(4, 18, 33, .42);
}

.electrician-chat__panel[hidden] {
  display: none;
}

.electrician-chat__messages[hidden],
.electrician-chat__actions[hidden],
.electrician-chat__form[hidden],
.electrician-chat__appointment[hidden] {
  display: none !important;
}

.electrician-chat__panel--appointment {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.electrician-chat__header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 16px;
  background: linear-gradient(135deg, var(--chat-navy), var(--chat-blue));
  color: #fff;
}

.electrician-chat__avatar {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--chat-orange);
  font-size: 21px;
}

.electrician-chat__header strong,
.electrician-chat__header span {
  display: block;
}

.electrician-chat__header strong {
  font-size: 15px;
}

.electrician-chat__header span {
  margin-top: 2px;
  color: #d8e9f8;
  font-size: 12px;
}

.electrician-chat__close {
  width: 34px;
  height: 34px;
  margin-left: auto;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-family: inherit;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.electrician-chat__messages {
  min-height: 0;
  overflow-y: auto;
  padding: 17px 15px 8px;
  background: linear-gradient(180deg, #f7fbff, #edf5fc);
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.electrician-chat__message {
  width: fit-content;
  max-width: 88%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--chat-border);
  border-radius: 14px 14px 14px 4px;
  background: #fff;
  color: var(--chat-text);
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 3px 10px rgba(17, 55, 88, .07);
  white-space: pre-line;
}

.electrician-chat__message--user {
  margin-left: auto;
  border-color: #b4cfe7;
  border-radius: 14px 14px 4px 14px;
  background: #dceeff;
}

.electrician-chat__message--alert {
  border-color: #f0bd84;
  background: #fff5e8;
}

.electrician-chat__message--source {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.electrician-chat__message--source a {
  display: inline-flex;
  padding: 7px 10px;
  border: 1px solid #9fc3e0;
  border-radius: 999px;
  background: #fff;
  color: #17598d;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.electrician-chat__message--history {
  max-width: 78%;
  padding: 7px 10px;
  opacity: .72;
  font-size: 12px;
  box-shadow: none;
}

.electrician-chat__message--archived {
  display: none;
}

.electrician-chat__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 126px;
  overflow-y: auto;
  padding: 10px 14px;
  border-top: 1px solid #dbe8f2;
  background: #fff;
}

.electrician-chat__choice {
  padding: 8px 11px;
  border: 1px solid #a9c8e2;
  border-radius: 999px;
  background: #f4f9fe;
  color: #174c78;
  font: inherit;
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
}

.electrician-chat__choice:hover {
  border-color: var(--chat-blue);
  background: #e4f1fc;
}

.electrician-chat__form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #dbe8f2;
  background: #fff;
}

.electrician-chat__form input {
  min-width: 0;
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #b8ccdc;
  border-radius: 10px;
  background: #fff;
  color: var(--chat-text);
  font: inherit;
  font-size: 14px;
}

.electrician-chat__form button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--chat-orange);
  color: #241304;
  font-family: inherit;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.electrician-chat__form button:hover,
.electrician-chat__whatsapp:hover {
  background: var(--chat-orange-dark);
  color: #fff;
}

.electrician-chat__whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 11px;
  background: var(--chat-orange);
  color: #241304;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
}

.electrician-chat__call-now {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 11px;
  background: #d9362b;
  color: #fff;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
}

.electrician-chat__call-now:hover {
  background: #b72820;
}

.electrician-chat__restart {
  width: 100%;
  padding: 7px;
  border: 0;
  background: transparent;
  color: #42627c;
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

.electrician-chat__appointment {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  padding: 14px;
  background: #fff;
  overscroll-behavior: contain;
}

.electrician-chat__appointment > strong {
  display: block;
  color: var(--chat-navy);
  font-size: 16px;
}

.electrician-chat__appointment > p {
  margin: 4px 0 12px;
  color: #5d7284;
  font-size: 12px;
}

.electrician-chat__appointment label {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
  color: #304b61;
  font-size: 12px;
  font-weight: 750;
}

.electrician-chat__field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.electrician-chat__appointment input[type="text"],
.electrician-chat__appointment input[type="tel"],
.electrician-chat__appointment input[type="email"],
.electrician-chat__appointment input[type="file"] {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #b8ccdc;
  border-radius: 9px;
  background: #fff;
  color: var(--chat-text);
  font: inherit;
  font-size: 13px;
}

.electrician-chat__appointment small {
  color: #6a7f91;
  font-size: 10.5px;
  font-weight: 500;
}

.electrician-chat__consent {
  display: flex !important;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 8px !important;
}

.electrician-chat__consent input {
  margin-top: 2px;
}

.electrician-chat__appointment-submit,
.electrician-chat__appointment-cancel,
.electrician-chat__appointment-open {
  min-height: 43px;
  border-radius: 10px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.electrician-chat__appointment-submit,
.electrician-chat__appointment-open {
  width: 100%;
  border: 0;
  background: var(--chat-orange);
  color: #241304;
}

.electrician-chat__appointment-cancel {
  width: 100%;
  margin-top: 7px;
  border: 1px solid #b8ccdc;
  background: #f4f8fb;
  color: #34536b;
}

.electrician-chat__appointment-status {
  margin-top: 9px;
  color: #315a78;
  font-size: 12px;
}

.electrician-chat__appointment-status--error {
  color: #a4382f;
}

.electrician-chat__honeypot {
  position: absolute !important;
  left: -9999px !important;
}

.electrician-chat__safety {
  margin: 0;
  padding: 7px 12px 9px;
  background: #fff;
  color: #61798d;
  font-size: 10.5px;
  text-align: center;
}

.electrician-chat :focus-visible {
  outline: 3px solid rgba(242, 140, 40, .48);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .electrician-chat {
    right: 12px;
    bottom: 82px;
  }

  .electrician-chat__toggle {
    min-height: 50px;
    padding: 9px 14px;
    font-size: 13px;
  }

  .electrician-chat__panel {
    position: fixed;
    right: 10px;
    bottom: 140px;
    width: calc(100vw - 20px);
    height: calc(100dvh - 155px);
    max-height: calc(100dvh - 155px);
  }

  .electrician-chat__field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .electrician-chat__toggle {
    transition: none;
  }
}
