/*
 * Inline Quotey audit-explainer styles. Fully scoped to .qc-qae* so page CSS
 * can't displace the control and the control can't leak into the page. Served
 * as an external stylesheet (allowed by style-src 'self') so it needs no nonce.
 *
 * Accent: --accent is set per audit vertical (cyan contractor/default, red auto,
 * amber solar, green medical); --qct-rgb is the same accent as an "r, g, b"
 * triple published by qc-tour.js (loaded on every audit surface) for translucent
 * fills. Both carry safe fallbacks so the control still reads if either is
 * absent. Motion lives in JS (Web Animations); CSS only cross-fades opacity, and
 * never animates the button's own box.
 */

.qc-qae {
  display: block;
  margin: 0.6rem 0 0.2rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.qc-qae-summary {
  margin-top: 0.8rem;
}

/* The interactive control is a real <button>; reset page button rules hard and
   restate everything we rely on so no generic `button {}` can displace it. */
.qc-qae .qc-qae-toggle {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  margin: 0;
  padding: 0.32rem 0.7rem 0.32rem 0.4rem;
  border: 1px solid rgba(var(--qct-rgb, 47, 233, 255), 0.5);
  border-radius: 999px;
  background: rgba(var(--qct-rgb, 47, 233, 255), 0.08);
  color: var(--accent, #2fe9ff);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.qc-qae .qc-qae-toggle:hover {
  background: rgba(var(--qct-rgb, 47, 233, 255), 0.16);
  border-color: rgba(var(--qct-rgb, 47, 233, 255), 0.7);
}

.qc-qae .qc-qae-toggle:focus-visible {
  outline: 2px solid var(--accent, #2fe9ff);
  outline-offset: 2px;
}

.qc-qae .qc-qae-toggle[disabled] {
  cursor: progress;
  opacity: 0.85;
}

.qc-qae-quotey {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: center top;
  border-radius: 50%;
  background: rgba(var(--qct-rgb, 47, 233, 255), 0.1);
}

.qc-qae-summary .qc-qae-quotey {
  width: 36px;
  height: 36px;
}

.qc-qae-invite {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Speech-bubble treatment for Quotey's answer. */
.qc-qae-bubble {
  position: relative;
  margin: 0.55rem 0 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(var(--qct-rgb, 47, 233, 255), 0.32);
  border-left: 3px solid var(--accent, #2fe9ff);
  border-radius: 12px;
  background: rgba(var(--qct-rgb, 47, 233, 255), 0.07);
  color: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Little pointer up toward the Quotey button. */
.qc-qae-bubble::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 18px;
  width: 12px;
  height: 12px;
  background: inherit;
  border-left: 1px solid rgba(var(--qct-rgb, 47, 233, 255), 0.32);
  border-top: 1px solid rgba(var(--qct-rgb, 47, 233, 255), 0.32);
  transform: rotate(45deg);
}

.qc-qae-bubble[hidden] {
  display: none;
}

.qc-qae-status {
  margin: 0;
  font-size: 0.82rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.7);
}

.qc-qae-status:empty {
  display: none;
}

.qc-qae-text {
  margin: 0;
  white-space: pre-wrap;
  color: rgba(255, 255, 255, 0.92);
}

.qc-qae-text:empty {
  display: none;
}

.qc-qae .qc-qae-retry {
  -webkit-appearance: none;
  appearance: none;
  display: inline-block;
  margin-top: 0.55rem;
  padding: 0.28rem 0.7rem;
  border: 1px solid rgba(var(--qct-rgb, 47, 233, 255), 0.6);
  border-radius: 999px;
  background: transparent;
  color: var(--accent, #2fe9ff);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.qc-qae .qc-qae-retry:focus-visible {
  outline: 2px solid var(--accent, #2fe9ff);
  outline-offset: 2px;
}

.qc-qae .qc-qae-retry[hidden] {
  display: none;
}

/* When the art fails to load, keep the labeled control tidy. */
.qc-qae[data-qc-noimg] .qc-qae-quotey {
  display: none;
}

@media (max-width: 520px) {
  .qc-qae .qc-qae-toggle {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qc-qae .qc-qae-toggle {
    transition: none;
  }
}
