/* Fox Transparency Ledger — the reading room.
 *
 * Editorial ledger book, not a data grid. Cream paper, ink type,
 * copper accents; the row is the unit of interest and reads like
 * an entry in a bound record.
 *
 * BEM under .fxl (fox-ledger).
 */

.pf--ledger {
  max-width: 1120px;
  padding: 2.5rem 1.25rem 4rem;
}

/* ── Hero ─────────────────────────────────────────────────────── */
.fxl__hero {
  text-align: center;
  border-bottom: 1px solid #d8d3c8;
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
}

.fxl__eyebrow {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #8b5a2b;
  margin: 0 0 0.65rem;
}

.fxl__title {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 700;
  color: #17171a;
  margin: 0 0 0.5rem;
  letter-spacing: -0.015em;
  line-height: 1.05;
}

.fxl__lede {
  font-family: "Source Serif Pro", Georgia, serif;
  font-size: 15px;
  color: #4a413a;
  max-width: 60ch;
  margin: 0 auto;
  line-height: 1.5;
  font-style: italic;
}

/* ── Window pills ─────────────────────────────────────────────── */
.fxl__windows {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 8px 12px;
  background: #fbf8f0;
  border: 1px solid #d8d3c8;
  border-radius: 4px;
}

.fxl__window {
  padding: 6px 14px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #4a413a;
  text-decoration: none;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}

.fxl__window:hover {
  background: rgba(139, 90, 43, 0.09);
  color: #17171a;
}

.fxl__window--active {
  background: #8b5a2b;
  color: #fbf8f0;
}

.fxl__window--active:hover {
  background: #6f4520;
  color: #fbf8f0;
}

.fxl__windows-range {
  margin-left: auto;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a6a70;
  padding-right: 6px;
}

/* ── Filter row (PR3) ────────────────────────────────────────
 *
 * Product · Result · Search. Sits between the window pills and
 * the stats bar so the reader's mental flow is:
 *   1. Pick the time window
 *   2. Narrow by product / result / horse-course search (optional)
 *   3. Read the stats summary of what the filter selected
 *   4. Scan the rows
 *
 * Filter state persists in the URL — shareable link = shareable
 * view. Clearing goes back to "everything in this window".
 */
.fxl__filters {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: #fbf8f0;
  border: 1px solid #d8d3c8;
  border-radius: 4px;
}

.fxl__filter {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.fxl__filter--search {
  flex: 1 1 220px;
}

.fxl__filter-label {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6a6a70;
}

.fxl__filter select,
.fxl__filter input {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  color: #17171a;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #d8d3c8;
  border-radius: 3px;
  min-width: 0;
  transition: border-color 0.15s;
}

.fxl__filter select { min-width: 170px; }

.fxl__filter select:focus,
.fxl__filter input:focus {
  outline: none;
  border-color: #8b5a2b;
  box-shadow: 0 0 0 2px rgba(139, 90, 43, 0.14);
}

.fxl__filter input[type="search"] {
  width: 100%;
}

.fxl__filter input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

.fxl__filter-btn {
  padding: 6px 16px;
  background: #8b5a2b;
  color: #fbf8f0;
  border: 1px solid #8b5a2b;
  border-radius: 3px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.fxl__filter-btn:hover {
  background: #6f4520;
  border-color: #6f4520;
}

.fxl__filter-clear {
  padding: 6px 12px;
  color: #6a6a70;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  align-self: center;
}

.fxl__filter-clear:hover {
  color: #a03040;
  border-bottom-color: rgba(160, 48, 64, 0.4);
}

@media (max-width: 640px) {
  .fxl__filters { padding: 8px; gap: 6px; }
  .fxl__filter { flex: 1 1 46%; }
  .fxl__filter--search { flex: 1 1 100%; }
  .fxl__filter select { min-width: 0; width: 100%; }
  .fxl__filter-btn { flex: 1 1 auto; }
}

/* ── Stats bar (PR2) ─────────────────────────────────────────
 *
 * Five cells above the table: picks sealed · won/placed · strike
 * rate · latest batch root · anchor status. The stats bar IS the
 * story-in-numbers row — even a reader who never scrolls learns
 * how many sealed picks the page carries, how many landed, and
 * whether they're anchored on-chain.
 */
.fxl__stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.fxl__stat {
  background: #fbf8f0;
  border: 1px solid #d8d3c8;
  border-radius: 4px;
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: box-shadow 0.15s;
}

.fxl__stat:hover {
  box-shadow: 0 1px 4px rgba(26, 22, 18, 0.05);
}

.fxl__stat-value {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 700;
  color: #17171a;
  line-height: 1.05;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.fxl__stat-unit {
  font-size: 18px;
  font-weight: 700;
  color: #6a6a70;
  margin-left: 1px;
}

.fxl__stat-label {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6a6a70;
  line-height: 1.2;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.fxl__stat-note {
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: none;
  color: rgba(23, 23, 26, 0.42);
  font-size: 10px;
}

/* W / P cell colouring */
.fxl__stat-w      { color: #8f6f18; }   /* gold — winners */
.fxl__stat-p      { color: #6f4520; }   /* copper — placed (top 3) */
.fxl__stat-slash  { color: rgba(23, 23, 26, 0.3); font-weight: 300; }

/* Strike-rate cell — sage accent when there's a real rate */
.fxl__stat--rate .fxl__stat-value       { color: #205931; }
.fxl__stat--rate.fxl__stat--muted .fxl__stat-value {
  color: rgba(23, 23, 26, 0.28);
}

/* Batch cell */
.fxl__stat-batch-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(139, 90, 43, 0.4);
  transition: border-color 0.15s;
}
.fxl__stat-batch-link:hover { border-bottom-color: #8b5a2b; }
.fxl__stat--batch .fxl__mono {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Menlo",
               "Consolas", monospace;
  font-size: 22px;
  font-weight: 800;
  color: #17171a;
  letter-spacing: 0.02em;
}

/* Anchor status — colour by state */
.fxl__stat--anchor .fxl__stat-anchor {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.25;
  padding: 6px 10px;
  border-radius: 3px;
  align-self: flex-start;
  margin-top: 2px;
}

.fxl__stat--anchored .fxl__stat-anchor  { background: rgba(26, 125, 74, 0.14);  color: #1a7d4a; }
.fxl__stat--off_chain .fxl__stat-anchor { background: rgba(139, 90, 43, 0.14);  color: #6f4520; }
.fxl__stat--forming .fxl__stat-anchor   { background: rgba(122, 107, 62, 0.16); color: #7a6b3e; }
.fxl__stat--none .fxl__stat-anchor      { background: rgba(23, 23, 26, 0.06);   color: rgba(23, 23, 26, 0.4); font-style: italic; }

/* Responsive collapse: two-row grid on tablets, single column on phones */
@media (max-width: 900px) {
  .fxl__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .fxl__stat--batch { grid-column: span 2; }
  .fxl__stat--anchor { grid-column: 1 / -1; }
  .fxl__stat-value { font-size: 26px; }
  .fxl__stat--batch .fxl__mono { font-size: 18px; }
}

@media (max-width: 560px) {
  .fxl__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fxl__stat--batch,
  .fxl__stat--anchor { grid-column: 1 / -1; }
  .fxl__stat-value { font-size: 22px; }
  .fxl__stat--batch .fxl__mono { font-size: 16px; }
  .fxl__stat--anchor .fxl__stat-anchor { font-size: 12px; padding: 5px 8px; }
}

.fxl__count {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  color: #6a6a70;
  margin: 0 4px 12px;
  letter-spacing: 0.02em;
}

/* ── Table ────────────────────────────────────────────────────── */
.fxl__table-wrap {
  background: #fbf8f0;
  border: 1px solid #d8d3c8;
  border-radius: 4px;
  overflow: hidden;
}

.fxl__table {
  width: 100%;
  border-collapse: collapse;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
}

.fxl__table thead th {
  text-align: left;
  padding: 10px 12px;
  background: #f1e9d0;
  color: #6a6a70;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 1px solid #d8d3c8;
  white-space: nowrap;
}

.fxl__table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(216, 211, 200, 0.55);
  vertical-align: middle;
  color: #17171a;
}

.fxl__table tbody tr:last-child td { border-bottom: none; }

.fxl__row:hover { background: rgba(139, 90, 43, 0.04); }

/* ── Cell shaping ─────────────────────────────────────────────── */
.fxl__col-time,
.fxl__col-odds,
.fxl__col-result,
.fxl__col-verify { width: 1%; white-space: nowrap; }

.fxl__col-product { width: 1%; }

.fxl__cell--time {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.fxl__time {
  display: block;
  font-weight: 800;
  color: #8b5a2b;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.fxl__date {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6a6a70;
  margin-top: 2px;
}

/* Product tag — small pill coloured by source */
.fxl__product-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 2px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #f1e9d0;
  color: #6f4520;
  white-space: nowrap;
}

.fxl__product-tag--pick_winner     { background: rgba(195, 158, 42, 0.18); color: #8f6f18; }
.fxl__product-tag--horses_to_watch { background: rgba(139, 90, 43, 0.16);  color: #6f4520; }
.fxl__product-tag--bod             { background: rgba(26, 125, 74, 0.14);  color: #1a7d4a; }
.fxl__product-tag--top_rated       { background: rgba(30, 64, 175, 0.14);  color: #1e40af; }

.fxl__product-lane {
  font-size: 11px;
  color: #6a6a70;
  margin-left: 4px;
}

.fxl__horse {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  color: #17171a;
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
a.fxl__horse:hover { border-bottom-color: #8b5a2b; }

.fxl__course {
  font-size: 12.5px;
  color: #4a413a;
  letter-spacing: 0.01em;
}

.fxl__odds {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: #17171a;
  padding: 1px 6px;
  background: #f1e9d0;
  border-radius: 2px;
}

/* Result pills — colour-coded by tint (matches PickOutcome grading) */
.fxl__result {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.fxl__result--gold    { background: rgba(195, 158, 42, 0.24); color: #8f6f18; }
.fxl__result--silver  { background: rgba(23, 23, 26, 0.10);   color: #4a413a; }
.fxl__result--bronze  { background: rgba(139, 90, 43, 0.18);  color: #6f4520; }
.fxl__result--out     { background: rgba(160, 48, 64, 0.10);  color: #a03040; }
.fxl__result--pending { background: rgba(122, 107, 62, 0.14); color: #7a6b3e; font-style: italic; }
.fxl__result--live    { background: rgba(26, 125, 74, 0.14);  color: #1a7d4a; }

/* Winner row — subtle gold tint on the whole row so scanners see hits */
.fxl__row--gold { background: rgba(195, 158, 42, 0.05); }
.fxl__row--gold:hover { background: rgba(195, 158, 42, 0.09); }

/* ── Verify chip — inline in the last column ──────────────────── */
.fxl__verify {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(32, 89, 49, 0.08);
  color: #205931;
  border: 1px solid rgba(32, 89, 49, 0.2);
  border-radius: 999px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.fxl__verify:hover {
  background: rgba(32, 89, 49, 0.16);
  border-color: rgba(32, 89, 49, 0.4);
  color: #17471f;
}

.fxl__verify-id {
  opacity: 0.65;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ── Pager ─────────────────────────────────────────────────────── */
.fxl__pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 1.25rem;
  padding: 8px;
}

.fxl__pager-btn {
  padding: 8px 16px;
  background: #fbf8f0;
  border: 1px solid #d8d3c8;
  border-radius: 3px;
  color: #4a413a;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.fxl__pager-btn:hover {
  background: #f1e9d0;
  border-color: #8b5a2b;
  color: #17171a;
}

.fxl__pager-btn--disabled {
  color: rgba(23, 23, 26, 0.25);
  cursor: not-allowed;
  pointer-events: none;
}

.fxl__pager-status {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #6a6a70;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Empty state ──────────────────────────────────────────────── */
.fxl__empty {
  padding: 3rem 1rem;
  text-align: center;
  background: #fbf8f0;
  border: 1px solid #d8d3c8;
  border-radius: 4px;
  color: #4a413a;
}

.fxl__empty h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 22px;
  margin: 0 0 0.75rem;
  color: #17171a;
}

.fxl__empty p {
  margin: 0.4rem auto;
  max-width: 48ch;
  font-size: 14px;
  line-height: 1.5;
}

.fxl__empty a {
  color: #8b5a2b;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(139, 90, 43, 0.4);
}

/* ── Footer ────────────────────────────────────────────────────── */
.fxl__foot {
  margin-top: 2rem;
  padding: 1.25rem 1rem;
  border-top: 1px solid #d8d3c8;
  text-align: center;
  color: #6a6a70;
  font-family: "Source Serif Pro", Georgia, serif;
  font-size: 13px;
  line-height: 1.55;
}

.fxl__foot p { margin: 0.4rem 0; max-width: 62ch; margin-left: auto; margin-right: auto; }
.fxl__foot a { color: #8b5a2b; text-decoration: none; font-weight: 700; }
.fxl__foot a:hover { text-decoration: underline; }
.fxl__foot em { font-style: italic; color: #4a413a; }

/* ── Mobile ────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .fxl__windows { padding: 6px; }
  .fxl__windows-range { display: none; }
  .fxl__window { padding: 6px 10px; font-size: 11.5px; }

  /* Table → stacked card rows */
  .fxl__table thead { display: none; }
  .fxl__table, .fxl__table tbody, .fxl__row { display: block; }
  .fxl__row {
    padding: 12px 14px;
    border-bottom: 1px solid #d8d3c8;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "time      result"
      "horse     odds"
      "product   product"
      "race      race"
      "verify    verify";
    gap: 4px 12px;
  }
  .fxl__table tbody tr:last-child { border-bottom: none; }
  .fxl__cell { padding: 0; border: none; }
  .fxl__cell--time    { grid-area: time; }
  .fxl__cell--horse   { grid-area: horse; }
  .fxl__cell--product { grid-area: product; margin-top: 2px; }
  .fxl__cell--race    { grid-area: race; font-size: 12px; color: #6a6a70; }
  .fxl__cell--odds    { grid-area: odds; justify-self: end; align-self: center; }
  .fxl__cell--result  { grid-area: result; justify-self: end; }
  .fxl__cell--verify  { grid-area: verify; margin-top: 6px; }
  .fxl__time  { font-size: 13px; }
  .fxl__date  { display: inline-block; margin-left: 8px; margin-top: 0; }
  .fxl__horse { font-size: 16px; }
}
