/* Research Desk support widget — ported verbatim from the Astro source
   (src/styles/global.css). Loaded site-wide; the widget markup lives in
   template-parts/support-chat.php and behaviour in nzm-main.js. */
.support-chat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  font-family: "Hanken Grotesk Variable", "Hanken Grotesk", sans-serif;
  transition: bottom 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
/* On PDPs the sticky add-bar shares the bottom-right corner. Lift the launcher
   above it whenever the bar is present (desktop bar is taller, so 110px; the
   mobile override is in the media query below). */
body:has(.stickycta) .support-chat { bottom: 110px; }
.support-chat__launcher {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 174px;
  padding: 12px 15px 12px 12px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 5px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.14);
  cursor: pointer;
}
.support-chat__icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
  color: var(--white);
  display: grid;
  place-items: center;
}
.support-chat__launcher-text {
  display: grid;
  gap: 1px;
  text-align: left;
}
.support-chat__launcher-text span {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
}
.support-chat__launcher-text small {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.support-chat__panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  width: min(390px, calc(100vw - 28px));
  height: min(590px, calc(100vh - 112px));
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.support-chat__panel[hidden] {
  display: none;
}
.support-chat__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.support-chat__eyebrow {
  margin-bottom: 5px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-muted);
}
.support-chat__head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.support-chat__close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}
.support-chat__notice {
  padding: 10px 18px;
  background: var(--paper-cool);
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-muted);
}
.support-chat__log {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.support-chat__message {
  max-width: 86%;
  border-radius: 5px;
  padding: 11px 13px;
  font-size: 14px;
  line-height: 1.45;
}
.support-chat__message p {
  margin: 0;
}
.support-chat__message--assistant {
  align-self: flex-start;
  background: var(--paper-cool);
  color: var(--ink);
}
.support-chat__message--user {
  align-self: flex-end;
  background: var(--ink);
  color: var(--white);
}
.support-chat__prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 18px 14px;
}
.support-chat__prompts button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  padding: 7px 10px;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}
.support-chat__prompts button:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.support-chat__form {
  display: grid;
  grid-template-columns: 1fr 42px;
  align-items: stretch;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--line-soft);
}
.support-chat__field {
  display: flex;
  min-width: 0;
}
.support-chat__field textarea {
  width: 100%;
  min-height: 42px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
}
.support-chat__field textarea:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}
.support-chat__send {
  width: 42px;
  min-height: 42px;
  height: auto;
  align-self: stretch;
  border: 0;
  border-radius: 5px;
  background: var(--accent);
  color: var(--white);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.support-chat__send:disabled {
  opacity: 0.55;
  cursor: wait;
}
.support-chat__form.is-busy textarea {
  color: var(--ink-muted);
}
.support-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;
}

@media (max-width: 640px) {
  .support-chat {
    right: 14px;
    bottom: 14px;
  }
  .support-chat__launcher {
    min-width: 0;
  }
  .support-chat__launcher-text {
    display: none;
  }
  .support-chat__panel {
    bottom: 58px;
    height: min(560px, calc(100vh - 92px));
  }
  /* On PDPs the sticky add-to-cart bar shares the bottom-right corner — lift the
     chat launcher above it so they don't overlap. */
  body:has(.stickycta) .support-chat {
    bottom: 92px;
  }
}

/* Logged-in admin bar: keep the launcher clear of the WP toolbar is unnecessary
   (bottom-anchored), but on very short viewports cap the panel height. */
@media (max-height: 620px) {
  .support-chat__panel {
    height: calc(100vh - 96px);
  }
}
