/* "Ask anything" row — ImproveCortland styling of the infinite-FAQ drop-in.
   Palette matches the site (src/brand.ts tokensCss): primary #1F4E5F, ink #1A1F1C,
   muted #5B6B66, rule #DED9CC, paper #F8F7F2. Selectors are scoped under .faq-ask and written
   at two-class specificity so the page's global `input{…}` rule (src/site_chrome.tsx Styles)
   cannot restyle the box. */

.faq-ask {
  --faq-ink: #1a1f1c;
  --faq-muted: #5b6b66;
  --faq-line: #ded9cc;
  --faq-primary: #1f4e5f;
  --faq-primary-dark: #163a47;
  --faq-paper: #f8f7f2;
  --faq-error: #8c1d18;
  color: var(--faq-ink);
}

/* Homepage: a card the same height as the Take Photo / Use existing photo buttons (.btn-hero 4rem). */
.faq-ask--hero {
  margin: 0 0 var(--sp-xs);
}

.faq-ask--hero .faq-ask-form {
  min-height: 4rem;
  border: 2px solid var(--faq-primary);
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(26, 31, 28, 0.06);
}

.faq-ask--hero .faq-ask-form:focus-within {
  box-shadow: 0 0 0 3px rgba(31, 78, 95, 0.25);
}

/* Report page: sits inside the card, so a lighter border. */
.faq-ask--report {
  margin: var(--sp-md) 0 0;
}

.faq-ask--report .faq-ask-form {
  min-height: 3.25rem;
  border: 1px solid var(--faq-line);
  border-radius: 0.5rem;
  background: var(--faq-paper);
}

.faq-ask--report .faq-ask-form:focus-within {
  border-color: var(--faq-primary);
  box-shadow: 0 0 0 3px rgba(31, 78, 95, 0.2);
}

.faq-ask .faq-ask-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem 0 1rem;
  margin: 0;
}

.faq-ask .faq-ask-input,
.faq-ask .faq-ask-input:focus {
  flex: 1;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--faq-ink);
  font: inherit;
  font-size: 16px; /* ≥16px: no iOS auto-zoom on focus (same rule as the page) */
  font-weight: 600;
  outline: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  text-overflow: ellipsis; /* long placeholder on a 390px phone clips with an ellipsis */
}

.faq-ask .faq-ask-input::placeholder {
  color: var(--faq-muted);
  font-weight: 500;
  opacity: 1;
  text-overflow: ellipsis;
}

.faq-ask .faq-ask-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--faq-muted);
  cursor: pointer;
  touch-action: manipulation;
}

.faq-ask .faq-ask-btn:disabled {
  cursor: default;
}

.faq-ask .faq-ask-btn.is-ready,
.faq-ask .faq-ask-btn.is-stop {
  background: var(--faq-primary);
  color: #fff;
}

.faq-ask .faq-ask-btn.is-ready:hover,
.faq-ask .faq-ask-btn.is-stop:hover {
  background: var(--faq-primary-dark);
}

.faq-ask .faq-ask-btn:focus-visible {
  outline: 2px solid var(--faq-primary);
  outline-offset: 2px;
}

/* Answer typography: 15px, relaxed leading, underlined links. */
.faq-ask .faq-answer {
  padding: 0.875rem 0.25rem 0.25rem;
  color: var(--faq-ink);
  font-size: 15px;
  line-height: 1.625;
  text-align: left;
}

.faq-ask .faq-answer p {
  margin: 0.375rem 0;
}

.faq-ask .faq-answer ul,
.faq-ask .faq-answer ol {
  margin: 0.375rem 0;
  padding-left: 1.25rem;
}

.faq-ask .faq-answer ul {
  list-style: disc;
}

.faq-ask .faq-answer ol {
  list-style: decimal;
}

.faq-ask .faq-answer li {
  margin: 0.125rem 0;
}

.faq-ask .faq-answer a {
  color: var(--faq-primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.faq-ask .faq-answer strong {
  font-weight: 700;
}

.faq-ask .faq-answer code {
  font-size: 0.9em;
}

.faq-ask .faq-answer > :first-child {
  margin-top: 0;
}

.faq-ask .faq-answer > :last-child {
  margin-bottom: 0;
}

.faq-ask .faq-error {
  color: var(--faq-error);
  font-weight: 600;
}

/* "Reading this report" shimmer: a light sweep across muted text. */
.faq-ask .faq-shimmer {
  display: inline-block;
  color: transparent;
  background: linear-gradient(90deg, #8f9b98 0%, #1a1f1c 50%, #8f9b98 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: faq-shimmer 1.6s linear infinite;
}

@keyframes faq-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-ask .faq-shimmer {
    animation: none;
    color: var(--faq-muted);
    background: none;
  }
}

.faq-ask .faq-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;
}
