.site-chat[hidden],
.site-chat [hidden] {
  display: none !important;
}
body.chat-enabled .footer {
  padding-bottom: 104px;
}
.site-chat {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1100;
  font: 400 14px/1.5 var(--font);
  color: var(--ink);
}
.chat-launcher {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 12px;
  width: 312px;
  max-width: calc(100vw - 32px);
  min-height: 64px;
  padding: 12px 20px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--accent);
  color: var(--ink);
  box-shadow: 0 6px 24px #23252626;
  font-weight: 600;
}
.chat-launcher-copy {
  display: grid;
  gap: 2px;
  text-align: left;
}
.chat-launcher-copy strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.chat-launcher-copy small {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}
.chat-launcher:hover,
.chat-send:hover {
  background: var(--accent-hover);
}
.chat-unread {
  min-width: 22px;
  height: 22px;
  text-align: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 12px;
  line-height: 22px;
}
.chat-panel {
  width: min(380px, calc(100vw - 32px));
  height: min(660px, calc(100dvh - 48px));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 64px #23252633;
  overflow: hidden;
}
.chat-header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 12px 16px 20px;
  background: var(--ink);
  color: white;
  gap: 12px;
}
.chat-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-brand h2 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 600;
}
.chat-brand p {
  font-size: 12px;
  color: #dadbd4;
}
.chat-brand {
  min-width: 0;
}
.chat-brand p {
  line-height: 1.4;
}
.chat-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 312px;
  max-width: calc(100vw - 32px);
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  box-shadow: 0 6px 24px #2325261a;
}
.chat-hint p {
  font-size: 13px;
}
.chat-hint-close {
  background: transparent;
}
.chat-greeting .chat-intro-title {
  font-size: 18px;
}
.chat-greeting .chat-intro-copy {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 8px;
}
.chat-greeting .chat-first-message {
  font-size: 14px;
  font-weight: 400;
  margin-top: 16px;
}
.chat-greeting .chat-intro-note {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 12px;
}
.chat-quick-actions {
  display: grid;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}
.chat-quick-actions button {
  min-height: 44px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  color: var(--ink);
  font-size: 13px;
}
.chat-quick-actions button:hover {
  color: #4e7600;
}
.chat-receipt {
  display: block;
  font-size: 10px;
  margin-top: 4px;
  color: #4b5142;
}
.chat-scroll {
  min-height: 0;
}
.chat-contact-offer {
  flex: 0 1 auto;
  max-height: 45%;
  overflow-y: auto;
  margin: 0 20px 16px;
  border-top: 1px solid var(--line);
}
.chat-contact-offer summary {
  min-height: 44px;
  padding: 12px 0;
  cursor: pointer;
  font-size: 12px;
}
.chat-contact-offer summary span {
  color: var(--muted);
}
.chat-contact-form {
  display: grid;
  gap: 10px;
  padding-bottom: 6px;
}
.chat-contact-form fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.chat-contact-form legend {
  font-size: 12px;
  margin-bottom: 6px;
}
.chat-contact-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
}
.chat-contact-methods label {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 6px;
  min-height: 44px;
  font-size: 12px;
}
.chat-contact-methods input {
  margin: 0;
  accent-color: #4e7600;
}
.chat-contact-form > label {
  display: grid;
  gap: 4px;
  font-size: 12px;
}
.chat-contact-form input[name="contact"] {
  min-height: 44px;
  width: 100%;
  border: 1px solid #a9ada1;
  border-radius: 4px;
  padding: 8px 10px;
  color: var(--ink);
  background: white;
}
.chat-contact-form p {
  font-size: 11px;
  color: var(--muted);
}
.chat-contact-form > div {
  display: flex;
  gap: 12px;
}
.chat-contact-save,
.chat-contact-skip {
  min-height: 44px;
  border: 0;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--ink);
}
.chat-contact-save {
  background: var(--accent);
}
.chat-contact-skip {
  background: transparent;
  text-decoration: underline;
}
.chat-icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
}
.chat-close {
  color: white;
  background: transparent;
}
.chat-close img {
  filter: invert(1);
}
.chat-close:hover {
  background: #ffffff1a;
}
.chat-scroll {
  flex: 1;
  min-height: 96px;
  overflow-y: auto;
  padding: 20px;
  background: #f2f3ef;
  overscroll-behavior: contain;
}
.chat-greeting {
  margin-bottom: 20px;
}
.chat-greeting p {
  font-size: 17px;
  line-height: 1.4;
  font-weight: 500;
}
.chat-greeting span {
  display: block;
  margin-top: 8px;
  color: #61655d;
  font-size: 12px;
}
.chat-messages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-message {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 6px;
  overflow-wrap: anywhere;
}
.chat-message-visitor {
  align-self: flex-end;
  background: #d2f65a;
}
.chat-message-operator {
  align-self: flex-start;
  background: white;
  border: 1px solid #d7d8d0;
}
.chat-author {
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
}
.chat-message p {
  white-space: pre-wrap;
  line-height: 1.5;
}
.chat-message time {
  display: block;
  text-align: right;
  font-size: 10px;
  margin-top: 6px;
  color: #4b5142;
}
.chat-form {
  display: flex;
  flex-direction: column;
  flex: none;
  padding: 16px 20px 6px;
  max-height: 65%;
  overflow: hidden;
}
.chat-identity {
  display: grid;
  flex: 1;
  min-height: 0;
  gap: 10px;
  margin: 0 -4px 14px;
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.chat-identity label:not(.chat-consent) {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
}
.chat-identity label > span {
  font-weight: 400;
}
.chat-identity input:not([type="checkbox"]) {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #a9ada1;
  border-radius: 4px;
  color: var(--ink);
  background: white;
  font-size: 14px;
}
.chat-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: #555a50;
}
.chat-consent input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: #4e7600;
}
.chat-consent a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.chat-composer {
  display: grid;
  flex: none;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: end;
  padding: 4px;
  margin: -4px;
}
.chat-message-label {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 500;
}
.chat-composer textarea {
  width: 100%;
  min-height: 64px;
  max-height: 120px;
  padding: 10px 12px;
  border: 1px solid #a9ada1;
  border-radius: 4px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.5;
  background: white;
  color: var(--ink);
}
.chat-send {
  background: var(--accent);
  margin-bottom: 0;
}
.chat-send:disabled {
  opacity: 0.45;
  cursor: default;
}
.chat-status {
  flex: none;
  padding: 10px 20px 14px;
  font-size: 11px;
  min-height: 36px;
  color: #555a50;
  overflow-wrap: anywhere;
}
.chat-status:empty {
  padding-bottom: 4px;
  min-height: 16px;
}
.chat-error {
  color: #ad2925;
}
.chat-new {
  margin: 0 20px 16px;
  min-height: 44px;
  background: var(--accent);
  border: 1px solid var(--ink);
  border-radius: 4px;
  color: var(--ink);
}
.chat-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.chat-header :focus-visible {
  outline-color: var(--accent);
}
.site-chat input:focus-visible,
.site-chat textarea:focus-visible {
  outline-offset: 2px;
}
body.menu-open .site-chat {
  visibility: hidden;
}
@media (max-width: 600px) {
  .site-chat {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
  }
  .chat-panel {
    position: fixed;
    top: var(--chat-top, 12px);
    left: 12px;
    right: 12px;
    bottom: auto;
    width: auto;
    height: var(--chat-height, calc(100dvh - 24px));
    max-height: var(--chat-height, calc(100dvh - 24px));
    padding-bottom: env(safe-area-inset-bottom);
  }
  .chat-form {
    max-height: 65%;
  }
  .chat-identity input:not([type="checkbox"]),
  .chat-composer textarea {
    font-size: 16px;
  }
  .chat-contact-form input[name="contact"] {
    font-size: 16px;
  }
  .chat-launcher {
    width: 224px;
    min-height: 48px;
    padding: 10px 12px;
  }
  .chat-launcher-copy strong {
    display: none;
  }
  .chat-launcher-copy small {
    font-size: 14px;
    font-weight: 600;
  }
  .chat-hint {
    display: none;
  }
  body.chat-open {
    overflow: hidden;
  }
}
@media (max-height: 600px) {
  .chat-header {
    padding-block: 8px;
  }
  .chat-scroll {
    padding: 12px 20px;
    min-height: 0;
  }
  .chat-form {
    padding-top: 8px;
  }
  .chat-greeting {
    margin-bottom: 8px;
  }
}
