/* 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: system-ui, sans-serif; background: #f5f5f5; }

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

.rf-page h1 { margin: 0 0 1.5rem; font-size: 1.75rem; color: #111827; }

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

.rf-filters {
  background: #fff;
  border-radius: 0.5rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  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: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rf-filter-group input,
.rf-filter-group select {
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.875rem;
  color: #111827;
  background: #fff;
  width: 100%;
}

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

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

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

.rf-page .btn-primary {
  padding: 0.375rem 1rem;
  background: #465A64;
  color: #fff;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.rf-page .btn-primary:hover { background: #1d4ed8; }

.rf-page .btn-secondary {
  padding: 0.375rem 1rem;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.rf-page .btn-secondary:hover { background: #e5e7eb; }

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

.rf-result-count {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.rf-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: #6b7280;
  font-size: 1.125rem;
  background: #fff;
  border-radius: 0.5rem;
}

.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: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.rf-page .fact-row:first-child { border-radius: 0.5rem 0.5rem 0 0; }
.rf-page .fact-row:last-child  { border-radius: 0 0 0.5rem 0.5rem; border-bottom: none; }
.rf-page .fact-row:only-child  { border-radius: 0.5rem; border-bottom: none; }

.rf-page .fact-cell {
  padding: 0.875rem 1rem;
  border-right: 1px solid #e5e7eb;
  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: 0.25rem;
}

.rf-page .fact-img-placeholder {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 0.25rem;
  color: #9ca3af;
  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: #111827;
}

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

.rf-page .badge--analysis  { background: #e5eced; color: #2d4350; }
.rf-page .badge--alt-text  { background: #d1fae5; color: #065f46; }
.rf-page .badge--dataset   { background: #ede9fe; color: #5b21b6; }

.rf-page .fact-source-ident {
  font-size: 0.75rem;
  color: #6b7280;
  font-family: monospace;
  word-break: break-all;
}

.rf-page .fact-timestamp { font-size: 0.75rem; color: #9ca3af; }

.rf-page .fact-cell--output { font-size: 0.8125rem; color: #374151; 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: #111827; 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: #f3f4f6;
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  text-align: center;
  flex-shrink: 0;
}

.rf-page .alt-text-value { color: #374151; }
