/* "Ask anything" row — ImproveBayArea styling of the infinite-FAQ drop-in.
   Palette matches the site (src/ui.ts): green #007749, ink #1A1F1C, muted #4B5D54,
   border #DEE2DB, paper #F8F7F2. Selectors are scoped under .faq-ask and written at
   two-class specificity so the page's forms plugin (cdn.tailwindcss.com?plugins=forms,
   which styles every input[type=text] globally) cannot restyle the box. */

.faq-ask {
  --faq-ink: #1a1f1c;
  --faq-muted: #4b5d54;
  --faq-line: #dee2db;
  --faq-green: #007749;
  --faq-green-dark: #005c38;
  --faq-paper: #f8f7f2;
  --faq-error: #8c1d18;
  color: var(--faq-ink);
}

/* Homepage: a card the same height as the Take Photo / Use existing photo buttons. */
.faq-ask--hero .faq-ask-form {
  min-height: 4rem;
  border: 2px solid var(--faq-green);
  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(0, 119, 73, 0.25);
}

/* Case page: sits inside the card, so a lighter border. */
.faq-ask--ticket .faq-ask-form {
  min-height: 3.25rem;
  border: 1px solid var(--faq-line);
  border-radius: 0.5rem;
  background: var(--faq-paper);
}

.faq-ask--ticket .faq-ask-form:focus-within {
  border-color: var(--faq-green);
  box-shadow: 0 0 0 3px rgba(0, 119, 73, 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-green);
  color: #fff;
}

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

.faq-ask .faq-ask-btn:focus-visible {
  outline: 2px solid var(--faq-green);
  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-green);
  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 ticket" shimmer: a light sweep across muted text. */
.faq-ask .faq-shimmer {
  display: inline-block;
  color: transparent;
  background: linear-gradient(90deg, #8a9a90 0%, #1a1f1c 50%, #8a9a90 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;
}
