/**
 * Ask First Analytics neutral component theme.
 *
 * Active themes can map their design system through the documented --afa-*
 * custom properties without changing component structure or behavior.
 */

@layer ask-first-analytics {

/* Zero-specificity defaults let theme tokens win regardless of whether the
   theme stylesheet loads before or after this plugin stylesheet. */
:where(:root) {
  --afa-font-body: inherit;
  --afa-font-heading: inherit;
  --afa-text: #1d2327;
  --afa-muted: #50575e;
  --afa-surface: #fffdf8;
  --afa-surface-elevated: #ffffff;
  --afa-border: #8c8f94;
  --afa-link: #135e96;
  --afa-primary-bg: #1d2327;
  --afa-primary-text: #ffffff;
  --afa-secondary-bg: #ffffff;
  --afa-secondary-text: #1d2327;
  --afa-focus: #2271b1;
  --afa-radius: 0.375rem;
  --afa-shadow: 0 0.75rem 2.5rem rgb(0 0 0 / 18%);
  --afa-prompt-shadow: 0 -0.5rem 1.5rem rgb(0 0 0 / 12%);
  --afa-panel-width: 46rem;
  --afa-panel-offset: 1rem;
  --afa-z-index: 999999;
  --afa-control-height: 2.75rem;
  --afa-control-padding: 0.75rem 1rem;
  --afa-control-font-size: 0.9375rem;
  --afa-launcher-height: var(--afa-control-height);
  --afa-launcher-padding: var(--afa-control-padding);
  --afa-launcher-font-size: var(--afa-control-font-size);
}

html.ask-first-analytics-prompt-visible body {
  padding-block-end: var(--afa-prompt-height, 0px);
}

.ask-first-analytics-root,
.ask-first-analytics-root *,
.ask-first-analytics-root *::before,
.ask-first-analytics-root *::after,
.ask-first-analytics-fallback,
.ask-first-analytics-fallback *,
.ask-first-analytics-launcher {
  box-sizing: border-box;
}

.ask-first-analytics-root [hidden],
.ask-first-analytics-fallback[hidden] {
  display: none !important;
}

.ask-first-analytics-panel {
  position: fixed !important;
  z-index: var(--afa-z-index) !important;
  inset-block-end: var(--afa-panel-offset);
  inset-inline-start: 50%;
  width: min(
    calc(100% - (2 * var(--afa-panel-offset))),
    var(--afa-panel-width)
  );
  max-height: calc(100dvh - (2 * var(--afa-panel-offset)));
  margin: 0;
  padding: 0;
  overflow: auto;
  transform: translateX(-50%);
  color: var(--afa-text);
  background: var(--afa-surface);
  border: 1px solid var(--afa-border);
  border-radius: var(--afa-radius);
  box-shadow: var(--afa-shadow);
  font-family: var(--afa-font-body);
  font-size: 1rem;
  line-height: 1.55;
  text-align: start;
  direction: inherit;
}

.ask-first-analytics-prompt {
  inset-block-end: 0;
  inset-inline-start: 0;
  width: 100%;
  max-width: none;
  max-height: 100dvh;
  transform: none;
  border: 0;
  border-top: 1px solid var(--afa-border);
  border-radius: 0;
  box-shadow: var(--afa-prompt-shadow);
}

.ask-first-analytics-prompt .ask-first-analytics-panel__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: clamp(1rem, 3vw, 2rem);
  row-gap: 0.35rem;
  padding: 0.85rem clamp(1rem, 4vw, 2rem);
}

.ask-first-analytics-prompt .ask-first-analytics-panel__title,
.ask-first-analytics-prompt .ask-first-analytics-panel__description,
.ask-first-analytics-prompt .ask-first-analytics-policy-link {
  grid-column: 1;
}

.ask-first-analytics-prompt .ask-first-analytics-panel__title {
  margin: 0;
  font-family: var(--afa-font-body);
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--afa-muted);
}

.ask-first-analytics-prompt .ask-first-analytics-panel__description {
  margin: 0;
  max-width: 56ch;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--afa-muted);
}

.ask-first-analytics-prompt .ask-first-analytics-policy-link {
  font-size: 0.75rem;
}

.ask-first-analytics-prompt .ask-first-analytics-panel__actions {
  grid-column: 2;
  grid-row: 1 / -1;
  display: flex;
  width: auto;
  margin: 0;
  gap: 0.5rem;
  align-items: center;
}

.ask-first-analytics-prompt .ask-first-analytics-button {
  min-height: 2.25rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  white-space: nowrap;
  flex: 1 1 0;
}

@media (max-width: 40rem) {
  .ask-first-analytics-prompt .ask-first-analytics-panel__content {
    grid-template-columns: 1fr;
    row-gap: 0.75rem;
    padding: 1rem;
  }

  .ask-first-analytics-prompt .ask-first-analytics-panel__title,
  .ask-first-analytics-prompt .ask-first-analytics-panel__description,
  .ask-first-analytics-prompt .ask-first-analytics-policy-link,
  .ask-first-analytics-prompt .ask-first-analytics-panel__actions {
    grid-column: 1;
    grid-row: auto;
  }

  .ask-first-analytics-prompt .ask-first-analytics-panel__actions {
    width: 100%;
  }

  .ask-first-analytics-prompt .ask-first-analytics-button {
    flex: 1 1 0;
  }
}

.ask-first-analytics-preferences {
  --afa-panel-width: 31rem;
}

.ask-first-analytics-panel__content {
  display: block;
  width: 100%;
  margin: 0;
  padding: clamp(1rem, 3.5vw, 1.5rem);
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
}

.ask-first-analytics-panel__title {
  margin: 0 0 0.5rem;
  padding: 0;
  color: var(--afa-text);
  background: transparent;
  font-family: var(--afa-font-heading);
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-style: normal;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: normal;
  text-transform: none;
}

.ask-first-analytics-panel__description,
.ask-first-analytics-unavailable {
  max-width: 62ch;
  margin: 0 0 1rem;
  padding: 0;
  color: var(--afa-muted);
  background: transparent;
  font: inherit;
}

.ask-first-analytics-panel__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: stretch;
  width: 100%;
  margin: 1rem 0;
  padding: 0;
}

.ask-first-analytics-button,
.ask-first-analytics-launcher {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: var(--afa-control-height);
  margin: 0;
  padding: var(--afa-control-padding);
  color: var(--afa-primary-text);
  background: var(--afa-primary-bg);
  border: 1px solid var(--afa-primary-bg);
  border-radius: var(--afa-radius);
  box-shadow: none;
  font-family: var(--afa-font-body);
  font-size: var(--afa-control-font-size);
  font-style: normal;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: normal;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: normal;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    border-color 150ms ease;
}

.ask-first-analytics-launcher {
  min-height: var(--afa-launcher-height);
  padding: var(--afa-launcher-padding);
  font-size: var(--afa-launcher-font-size);
}

.ask-first-analytics-button--secondary,
.ask-first-analytics-button[data-afa-action="deny"],
.ask-first-analytics-launcher {
  color: var(--afa-secondary-text);
  background: var(--afa-secondary-bg);
  border-color: var(--afa-border);
}

.ask-first-analytics-button:hover,
.ask-first-analytics-button:active,
.ask-first-analytics-launcher:hover,
.ask-first-analytics-launcher:active {
  filter: brightness(0.94);
}

.ask-first-analytics-button:focus-visible,
.ask-first-analytics-launcher:focus-visible,
.ask-first-analytics-choice input:focus-visible,
.ask-first-analytics-policy-link:focus-visible {
  outline: 0.1875rem solid var(--afa-focus);
  outline-offset: 0.1875rem;
  box-shadow: none;
}

.ask-first-analytics-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.ask-first-analytics-policy-link {
  display: inline-block;
  margin: 0;
  padding: 0.125rem 0;
  color: var(--afa-link);
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.ask-first-analytics-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  min-width: 0;
  margin: 1rem 0;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
}

.ask-first-analytics-choice legend {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0 0 0.5rem;
  padding: 0;
  color: var(--afa-text);
  font: inherit;
  font-weight: 650;
}

.ask-first-analytics-choice__option {
  display: flex;
  gap: 0.625rem;
  align-items: center;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.75rem;
  color: var(--afa-text);
  background: var(--afa-surface-elevated);
  border: 1px solid var(--afa-border);
  border-radius: var(--afa-radius);
  font: inherit;
  cursor: pointer;
}

.ask-first-analytics-choice__option:has(input:checked) {
  border-color: var(--afa-primary-bg);
  box-shadow: inset 0 0 0 1px var(--afa-primary-bg);
}

.ask-first-analytics-choice input {
  appearance: auto;
  flex: 0 0 auto;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  padding: 0;
  accent-color: var(--afa-primary-bg);
}

.ask-first-analytics-fallback {
  position: fixed !important;
  z-index: var(--afa-z-index) !important;
  inset-block-end: var(--afa-panel-offset);
  right: var(--afa-panel-offset);
  margin: 0;
  padding: 0;
}

.ask-first-analytics-fallback--bottom-left {
  right: auto;
  left: var(--afa-panel-offset);
}

.ask-first-analytics-fallback .ask-first-analytics-launcher {
  min-height: var(--afa-launcher-height);
  box-shadow: var(--afa-shadow);
}

.ask-first-analytics-status {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 30rem) {
  :where(:root) {
    --afa-panel-offset: 0.5rem;
  }

  .ask-first-analytics-panel__actions,
  .ask-first-analytics-choice {
    grid-template-columns: 1fr;
  }

  .ask-first-analytics-panel {
    font-size: 0.9375rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .ask-first-analytics-root *,
  .ask-first-analytics-launcher {
    scroll-behavior: auto;
    transition-duration: 0.001ms;
    animation-duration: 0.001ms;
    animation-iteration-count: 1;
  }
}

@media (forced-colors: active) {
  .ask-first-analytics-panel,
  .ask-first-analytics-button,
  .ask-first-analytics-launcher,
  .ask-first-analytics-choice__option {
    color: CanvasText;
    background: Canvas;
    border-color: CanvasText;
    forced-color-adjust: auto;
  }

  .ask-first-analytics-button:focus-visible,
  .ask-first-analytics-launcher:focus-visible,
  .ask-first-analytics-choice input:focus-visible,
  .ask-first-analytics-policy-link:focus-visible {
    outline-color: Highlight;
  }

  .ask-first-analytics-policy-link {
    color: LinkText;
  }
}

[dir="rtl"] .ask-first-analytics-panel {
  transform: translateX(50%);
}

.ask-first-analytics-root--prompt-corner .ask-first-analytics-prompt,
.ask-first-analytics-root--prompt-card .ask-first-analytics-prompt,
.ask-first-analytics-root--prompt-card-left .ask-first-analytics-prompt,
.ask-first-analytics-root--prompt-card-center .ask-first-analytics-prompt,
.ask-first-analytics-root--prompt-card-right .ask-first-analytics-prompt {
  inset-block-end: var(--afa-panel-offset);
  width: min(calc(100% - (2 * var(--afa-panel-offset))), 26rem);
  max-height: calc(100dvh - (2 * var(--afa-panel-offset)));
  border: 1px solid var(--afa-border);
  border-radius: var(--afa-radius);
  box-shadow: var(--afa-shadow);
}

.ask-first-analytics-root--prompt-corner .ask-first-analytics-prompt .ask-first-analytics-panel__content,
.ask-first-analytics-root--prompt-card .ask-first-analytics-prompt .ask-first-analytics-panel__content,
.ask-first-analytics-root--prompt-card-left .ask-first-analytics-prompt .ask-first-analytics-panel__content,
.ask-first-analytics-root--prompt-card-center .ask-first-analytics-prompt .ask-first-analytics-panel__content,
.ask-first-analytics-root--prompt-card-right .ask-first-analytics-prompt .ask-first-analytics-panel__content {
  display: block;
  padding: clamp(1rem, 3.5vw, 1.5rem);
}

.ask-first-analytics-root--prompt-corner .ask-first-analytics-prompt .ask-first-analytics-panel__title,
.ask-first-analytics-root--prompt-card .ask-first-analytics-prompt .ask-first-analytics-panel__title,
.ask-first-analytics-root--prompt-card-left .ask-first-analytics-prompt .ask-first-analytics-panel__title,
.ask-first-analytics-root--prompt-card-center .ask-first-analytics-prompt .ask-first-analytics-panel__title,
.ask-first-analytics-root--prompt-card-right .ask-first-analytics-prompt .ask-first-analytics-panel__title {
  margin: 0 0 0.5rem;
  font-family: var(--afa-font-heading);
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-style: normal;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: normal;
  text-transform: none;
  color: var(--afa-text);
}

.ask-first-analytics-root--prompt-corner .ask-first-analytics-prompt .ask-first-analytics-panel__description,
.ask-first-analytics-root--prompt-card .ask-first-analytics-prompt .ask-first-analytics-panel__description,
.ask-first-analytics-root--prompt-card-left .ask-first-analytics-prompt .ask-first-analytics-panel__description,
.ask-first-analytics-root--prompt-card-center .ask-first-analytics-prompt .ask-first-analytics-panel__description,
.ask-first-analytics-root--prompt-card-right .ask-first-analytics-prompt .ask-first-analytics-panel__description {
  max-width: 62ch;
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--afa-muted);
}

.ask-first-analytics-root--prompt-corner .ask-first-analytics-prompt .ask-first-analytics-panel__actions,
.ask-first-analytics-root--prompt-card .ask-first-analytics-prompt .ask-first-analytics-panel__actions,
.ask-first-analytics-root--prompt-card-left .ask-first-analytics-prompt .ask-first-analytics-panel__actions,
.ask-first-analytics-root--prompt-card-center .ask-first-analytics-prompt .ask-first-analytics-panel__actions,
.ask-first-analytics-root--prompt-card-right .ask-first-analytics-prompt .ask-first-analytics-panel__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
  margin: 1rem 0;
}

.ask-first-analytics-root--prompt-corner .ask-first-analytics-prompt .ask-first-analytics-button,
.ask-first-analytics-root--prompt-card .ask-first-analytics-prompt .ask-first-analytics-button,
.ask-first-analytics-root--prompt-card-left .ask-first-analytics-prompt .ask-first-analytics-button,
.ask-first-analytics-root--prompt-card-center .ask-first-analytics-prompt .ask-first-analytics-button,
.ask-first-analytics-root--prompt-card-right .ask-first-analytics-prompt .ask-first-analytics-button {
  min-height: var(--afa-control-height);
  padding: var(--afa-control-padding);
  font-size: var(--afa-control-font-size);
  white-space: normal;
}

.ask-first-analytics-root--prompt-corner .ask-first-analytics-prompt .ask-first-analytics-policy-link,
.ask-first-analytics-root--prompt-card .ask-first-analytics-prompt .ask-first-analytics-policy-link,
.ask-first-analytics-root--prompt-card-left .ask-first-analytics-prompt .ask-first-analytics-policy-link,
.ask-first-analytics-root--prompt-card-center .ask-first-analytics-prompt .ask-first-analytics-policy-link,
.ask-first-analytics-root--prompt-card-right .ask-first-analytics-prompt .ask-first-analytics-policy-link {
  font-size: 1rem;
}

.ask-first-analytics-root--prompt-card-left .ask-first-analytics-prompt {
  inset-inline-start: var(--afa-panel-offset);
  inset-inline-end: auto;
  transform: none;
}

.ask-first-analytics-root--prompt-card-center .ask-first-analytics-prompt {
  inset-inline-start: 50%;
  inset-inline-end: auto;
  transform: translateX(-50%);
}

.ask-first-analytics-root--prompt-corner .ask-first-analytics-prompt,
.ask-first-analytics-root--prompt-card .ask-first-analytics-prompt,
.ask-first-analytics-root--prompt-card-right .ask-first-analytics-prompt {
  inset-inline-start: auto;
  inset-inline-end: var(--afa-panel-offset);
  transform: none;
}

} /* End @layer ask-first-analytics. */
