/* Sitewide support launcher — the floating "?" button and the slide-up panel
   that houses the shared feedback form. Only the shell lives here; the form
   inside is styled entirely by feedback.css (same fonts, inputs, links, rose
   CTA). Accent is the site rose, matching feedback.css. */

.support-launcher {
  --support-rose: #e106a4;
  --support-rose-dark: #8f397f;

  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147483000;
  font-family: inherit;
}

/* Floating toggle button */
.support-launcher__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--support-rose);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(29, 25, 41, 0.28);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.support-launcher__toggle:hover {
  background: var(--support-rose-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(29, 25, 41, 0.32);
}

.support-launcher__toggle:focus-visible {
  outline: 3px solid rgba(225, 6, 164, 0.4);
  outline-offset: 2px;
}

.support-launcher__icon {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-launcher__icon--close {
  display: none;
}

.support-launcher.is-open .support-launcher__icon--open {
  display: none;
}

.support-launcher.is-open .support-launcher__icon--close {
  display: block;
}

/* Panel — 1.5x the previous 360px width. A flex column with its own viewport
   cap: capping only the body with 100vh let head + body overrun the visible
   viewport on mobile (100vh includes the browser-chrome strip), pushing the
   rose title bar off the top of the screen. dvh is the actually-visible
   height (the vh line is the older-browser fallback); 110px clears the
   panel's bottom offset (24px launcher inset + 74px lift, 86px at ≤480px)
   plus a top margin, so the head always stays on screen and only the form
   scrolls. */
.support-launcher__panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  display: flex;
  flex-direction: column;
  width: 540px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(29, 25, 41, 0.26);
  overflow: hidden;
  animation: support-launcher-pop 0.16s ease-out;
}

/* The display:flex above beats the UA stylesheet's [hidden] { display: none }
   (author display always wins over the attribute), which would leave the
   closed panel visible on every page — restate hidden explicitly. */
.support-launcher__panel[hidden] {
  display: none;
}

@keyframes support-launcher-pop {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.support-launcher__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: 16px 20px;
  background: var(--support-rose);
  color: #fff;
}

.support-launcher__title {
  margin: 0;
  /* Explicit white — the head is rose with white text, but the global
     h1..h6 { color: #131313 } rule matches this <h2> directly and would
     otherwise beat the inherited colour, rendering the title dark. */
  color: #fff;
  font-size: 1.375rem;
  font-weight: 700;
}

.support-launcher__close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  opacity: 0.85;
}

.support-launcher__close:hover {
  opacity: 1;
}

/* The form scrolls inside the panel on short viewports: the body is the
   flex column's yielding row (min-height:0 lets it shrink below its content),
   so the capped panel squeezes the body, never the head. */
.support-launcher__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px;
  overflow-y: auto;
}

/* The shared feedback form is page-centred with a wide max-width; inside the
   panel it should simply fill the available width. */
.support-launcher__body .feedback__form {
  max-width: none;
  margin: 0;
  gap: 14px;
}

/* A launcher screenshot preview is portrait-heavy (full page); cap it so the
   panel stays compact. */
.support-launcher__body .feedback__dropzone {
  min-height: 96px;
}

.support-launcher__body .feedback__dropzone-preview {
  max-height: 160px;
}

.support-launcher__body .feedback__button {
  align-self: stretch;
  text-align: center;
}

/* Screenshot caption row with the retake (camera) control on the right. */
.support-launcher__shot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.support-launcher__recapture {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--support-rose);
  border-radius: 8px;
  background: #fff;
  color: var(--support-rose);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.support-launcher__recapture:hover {
  background: var(--support-rose);
  color: #fff;
}

.support-launcher__recapture:disabled,
.support-launcher__recapture.is-busy {
  opacity: 0.5;
  cursor: default;
}

.support-launcher__recapture.is-busy {
  animation: support-launcher-pulse 0.9s ease-in-out infinite;
}

@keyframes support-launcher-pulse {
  50% { opacity: 0.25; }
}

.support-launcher__recapture-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The floating "?" is retired for everyone — support is reached from the footer
   "Technical support" button (all users) plus the header "?" / side-menu pill for
   signed-in users. The panel still renders (the toggle stays in the DOM, hidden,
   so support-launcher.js can bind and the [data-support-open] triggers open it). */
.support-launcher__toggle {
  display: none;
}

@media (max-width: 480px) {
  .support-launcher {
    right: 16px;
    bottom: 16px;
  }

  .support-launcher__panel {
    width: calc(100vw - 24px);
    bottom: 70px;
  }
}
