/* Raider Facts — extracted from the inline <style> block in index.html.haml,
   following the tools/prompt_rules.css pattern. Scoped to .rf-page; the
   fact-row block below styles the shared analyze_product_images/_fact_row
   partial only on this page (that tool still carries its own inline copy). */

body:has(.rf-page) { margin: 0; font-family: var(--font-base); background: var(--grey-100); }

.rf-page { max-width: 1600px; margin: 0 auto; padding: 2rem 1rem; }

.rf-page h1 { margin: 0 0 1.5rem; font-size: 1.75rem; color: var(--fill-primary); }

/* ── Filters ───────────────────────────────────────────────────────────── */

.rf-filters {
  background: var(--white);
  border-radius: var(--radius-none);
  padding: 1.25rem;
  box-shadow: none;
  margin-bottom: 1.5rem;
}

.rf-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.rf-filter-row:last-child { margin-bottom: 0; }

.rf-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 140px;
  flex: 1;
}

.rf-filter-group label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--grey-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rf-filter-group input,
.rf-filter-group select {
  border: 1px solid var(--rule);
  border-radius: var(--radius-none);
  padding: 0.375rem 0.625rem;
  font-size: 0.875rem;
  color: var(--fill-primary);
  background: var(--white);
  width: 100%;
}

.rf-filter-group select { cursor: pointer; }

.rf-filter-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--fill-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0.5rem 0 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule);
  width: 100%;
}

.rf-form-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
  margin-top: 0.75rem;
}

.rf-page .btn-primary {
  padding: 0.375rem 1rem;
  background: var(--bm-main);
  color: var(--white);
  border: none;
  border-radius: var(--radius-none);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.rf-page .btn-primary:hover { background: var(--bm-main); }

.rf-page .btn-secondary {
  padding: 0.375rem 1rem;
  background: var(--grey-100);
  color: var(--fill-primary);
  border: 1px solid var(--rule);
  border-radius: var(--radius-none);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.rf-page .btn-secondary:hover { background: var(--rule); }

/* ── Results ───────────────────────────────────────────────────────────── */

.rf-result-count {
  font-size: 0.875rem;
  color: var(--grey-600);
  margin-bottom: 0.75rem;
}

.rf-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--grey-600);
  font-size: 1.125rem;
  background: var(--white);
  border-radius: var(--radius-none);
}

.rf-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── fact-row (shared with analyze-product-images) ─────────────────────── */

.rf-page .fact-row {
  display: grid;
  grid-template-columns: 20% 35% 45%;
  background: var(--white);
  border-bottom: 1px solid var(--rule);
}

.rf-page .fact-row:first-child { border-radius: var(--radius-none); }
.rf-page .fact-row:last-child  { border-radius: var(--radius-none); border-bottom: none; }
.rf-page .fact-row:only-child  { border-radius: var(--radius-none); border-bottom: none; }

.rf-page .fact-cell {
  padding: 0.875rem 1rem;
  border-right: 1px solid var(--rule);
  overflow: hidden;
}

.rf-page .fact-cell:last-child { border-right: none; }

.rf-page .fact-cell--image {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.rf-page .fact-img {
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
  border-radius: var(--radius-none);
}

.rf-page .fact-img-placeholder {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grey-100);
  border-radius: var(--radius-none);
  color: var(--grey-400);
  font-size: 0.8125rem;
}

.rf-page .fact-cell--meta {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.rf-page .fact-article-number {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--fill-primary);
}

.rf-page .badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-none);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: fit-content;
}

.rf-page .badge--analysis  { background: color-mix(in srgb, var(--bm-main) 12%, var(--white)); color: var(--bm-main); }
.rf-page .badge--alt-text  { background: color-mix(in srgb, var(--status-ok) 12%, var(--white)); color: var(--status-ok); }
.rf-page .badge--dataset   { background: color-mix(in srgb, var(--brand-duotone) 18%, var(--white)); color: var(--brand-duotone-gray); }

.rf-page .fact-source-ident {
  font-size: 0.75rem;
  color: var(--grey-600);
  font-family: monospace;
  word-break: break-all;
}

.rf-page .fact-timestamp { font-size: 0.75rem; color: var(--grey-400); }

.rf-page .fact-cell--output { font-size: 0.8125rem; color: var(--fill-primary); line-height: 1.5; overflow: hidden; }

.rf-page .fact-cell--output [data-controller="json-viewer"] { max-height: none; }
.rf-page .fact-cell--output .json-viewer-raw { max-width: 100%; overflow-x: auto; white-space: pre-wrap; word-break: break-word; font-size: 0.75rem; margin: 0; }

.rf-page .fact-output-text { font-size: 0.8125rem; color: var(--fill-primary); margin-bottom: 0.5rem; line-height: 1.5; }

.rf-page .fact-alt-texts  { display: flex; flex-direction: column; gap: 0.25rem; }
.rf-page .alt-text-row    { display: flex; gap: 0.5rem; align-items: flex-start; }

.rf-page .alt-text-locale {
  display: inline-block;
  min-width: 1.75rem;
  padding: 0.0625rem 0.25rem;
  background: var(--grey-100);
  border-radius: var(--radius-none);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--grey-600);
  text-transform: uppercase;
  text-align: center;
  flex-shrink: 0;
}

.rf-page .alt-text-value { color: var(--fill-primary); }
