.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;
}

.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147483000;
  display: grid;
  justify-items: end;
  gap: 14px;
  pointer-events: none;
}

.chat-toggle,
.chat-panel {
  pointer-events: auto;
}

.chat-toggle {
  min-height: 56px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  background: var(--red);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 18px 42px rgba(229, 36, 42, 0.28), 0 10px 26px rgba(17, 18, 20, 0.16);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 850;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.chat-toggle:hover,
.chat-toggle:focus-visible {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(229, 36, 42, 0.32), 0 12px 30px rgba(17, 18, 20, 0.18);
}

.chat-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.chat-panel {
  width: min(430px, calc(100vw - 32px));
  overflow: hidden;
  color: var(--ink);
  background: var(--white);
  border: 1px solid rgba(228, 229, 231, 0.95);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(17, 18, 20, 0.24);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.chat-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chat-panel-header {
  padding: 20px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  color: var(--white);
  background: linear-gradient(135deg, var(--ink), #2a2b2e);
}

.chat-panel-header p {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chat-panel-header h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.chat-close {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.chat-close:hover,
.chat-close:focus-visible {
  background: rgba(255, 255, 255, 0.2);
}

.chat-body {
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f7f6 100%);
}

.chat-thread {
  display: grid;
  gap: 10px;
  max-height: min(360px, calc(100svh - 330px));
  overflow-y: auto;
  padding: 2px 4px 2px 0;
  scroll-behavior: smooth;
}

.chat-message {
  display: flex;
  align-items: flex-end;
}

.chat-message.bot {
  justify-content: flex-start;
}

.chat-message.customer {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: 86%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-line;
  box-shadow: 0 10px 24px rgba(17, 18, 20, 0.08);
}

.chat-message.bot .chat-bubble {
  color: #2d3035;
  background: var(--white);
  border: 1px solid rgba(228, 229, 231, 0.95);
  border-top-left-radius: 6px;
}

.chat-message.customer .chat-bubble {
  color: var(--white);
  background: var(--red);
  border-top-right-radius: 6px;
  box-shadow: 0 12px 26px rgba(229, 36, 42, 0.18);
}

.chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
  max-height: min(220px, calc(100svh - 490px));
  overflow-y: auto;
  padding-right: 3px;
}

.chat-options.form-mode {
  display: block;
  max-height: min(430px, calc(100svh - 350px));
}

.chat-options button,
.chat-action-link {
  min-height: 40px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #34363a;
  background: var(--white);
  border: 1px solid #d8dade;
  border-radius: 999px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 820;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.chat-options button:hover,
.chat-options button:focus-visible,
.chat-action-link:hover,
.chat-action-link:focus-visible {
  color: var(--red-dark);
  background: #fff5f5;
  border-color: rgba(229, 36, 42, 0.42);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(229, 36, 42, 0.1);
}

.chat-action-link[href^='http'],
.chat-action-link[href^='mailto'],
.chat-action-link[href^='tel'] {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
}

.chat-action-link[href^='http']:hover,
.chat-action-link[href^='http']:focus-visible,
.chat-action-link[href^='mailto']:hover,
.chat-action-link[href^='mailto']:focus-visible,
.chat-action-link[href^='tel']:hover,
.chat-action-link[href^='tel']:focus-visible {
  color: var(--white);
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.chat-inquiry-form {
  display: grid;
  gap: 11px;
  padding: 15px;
  background: var(--white);
  border: 1px solid rgba(228, 229, 231, 0.95);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(17, 18, 20, 0.1);
}

.chat-inquiry-form h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.chat-form-field {
  display: grid;
  gap: 6px;
  color: #34363a;
  font-size: 0.78rem;
  font-weight: 820;
}

.chat-form-field input,
.chat-form-field select,
.chat-form-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  color: var(--ink);
  background: #f8f8f7;
  border: 1px solid #d8dade;
  border-radius: 12px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.chat-form-field textarea {
  min-height: 92px;
  resize: vertical;
}

.chat-form-field input:focus,
.chat-form-field select:focus,
.chat-form-field textarea:focus {
  background: var(--white);
  border-color: rgba(229, 36, 42, 0.55);
  box-shadow: 0 0 0 3px rgba(229, 36, 42, 0.12);
}

.chat-form-error {
  margin: 0;
  padding: 10px 12px;
  color: #8b1116;
  background: #fff1f1;
  border: 1px solid rgba(229, 36, 42, 0.28);
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.35;
}

.chat-honeypot {
  display: none;
}

.chat-submit-button,
.chat-secondary-button {
  width: 100%;
}

.chat-submit-button {
  color: var(--white) !important;
  background: var(--red) !important;
  border-color: var(--red) !important;
}

.chat-submit-button:hover,
.chat-submit-button:focus-visible {
  background: var(--red-dark) !important;
  border-color: var(--red-dark) !important;
}

.chat-submit-button:disabled {
  cursor: wait;
  opacity: 0.75;
  transform: none;
}

.chat-secondary-button {
  color: var(--ink) !important;
  background: var(--white) !important;
  border-color: #d8dade !important;
}

@media (max-width: 560px) {
  .chat-widget {
    right: 14px;
    bottom: 84px;
  }

  .chat-panel {
    width: calc(100vw - 28px);
    max-height: min(640px, calc(100svh - 104px));
    overflow: hidden;
    border-radius: 18px;
  }

  .chat-toggle {
    min-height: 52px;
    padding: 0 16px;
    font-size: 0.88rem;
  }

  .chat-toggle svg {
    width: 20px;
    height: 20px;
  }

  .chat-panel-header,
  .chat-body {
    padding: 18px;
  }

  .chat-thread {
    max-height: min(300px, calc(100svh - 420px));
  }

  .chat-bubble {
    max-width: 92%;
    font-size: 0.9rem;
  }

  .chat-options {
    display: grid;
    max-height: min(210px, calc(100svh - 500px));
  }

  .chat-options.form-mode {
    max-height: min(390px, calc(100svh - 350px));
  }

  .chat-options button,
  .chat-action-link {
    width: 100%;
  }
}
