/* Raw dataset view (/labs/data).
   Part of the /labs stylesheet, split out of one 3,400-line labs.css.

   THE NUMBER IN THE FILENAME IS LOAD-BEARING. stylesheet_link_tag :app
   collects every stylesheet under app/assets and serves them sorted by
   path, so the ordinal prefix is the only thing holding the cascade order
   these rules were written in — and several classes are shared across labs
   (.lp-head, .lab-entry, .lab-block, .dt-table). Renaming a file without
   renumbering it, or inserting one out of sequence, reorders the cascade
   silently.

   Nothing in this comment may contain the two characters that close a CSS
   comment. The first version of it wrote a shell glob here, which closed
   the comment early; the leaked text then parsed as a selector and ate the
   first real rule in all nine files. There is a test for that now.
   ============================================================ */

/* ============================================================
   Raw dataset view (Labs · /labs/data)
   A spreadsheet-like grid rendered in the house type system —
   monospace, hairline rules, no colour. It should read, at a
   glance, as data.
   ============================================================ */

.dt-stats {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  margin-top: 22px;
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.dt-stat b { color: var(--ink); font-weight: 500; }
.dt-stat-sep { color: var(--ink-faint); }

.dt-block { margin-top: 56px; }
.dt-block:first-of-type { margin-top: 40px; }

/* caption row above each table */
.dt-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-bottom: 10px;
}
.dt-caption-name { color: var(--ink); }

/* scroll frame — clips the grid and gives it a bounded, viewport-like feel */
.dt-scroll {
  border: 1px solid var(--line);
  overflow: auto;
  max-height: 72vh;
}

.dt-table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
}
.dt-table th,
.dt-table td {
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 14px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

/* sticky column headers */
.dt-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

/* row-number gutter, pinned left */
.dt-gutter {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg);
  color: var(--ink-faint);
  text-align: right;
  width: 1%;
  font-size: 11px;
  user-select: none;
  border-right: 1px solid var(--line);
}
.dt-table thead .dt-gutter { z-index: 3; }

/* zebra + hover for scanability (kept strictly monochrome) */
.dt-table tbody tr:nth-child(even) td { background: rgba(0,0,0,0.018); }
.dt-table tbody tr:nth-child(even) .dt-gutter { background: #FAFAFA; }
.dt-table tbody tr:hover td { background: rgba(0,0,0,0.045); }
.dt-table tbody tr:hover .dt-gutter { background: #F2F2F2; }

.dt-mono { color: var(--ink-muted); }
.dt-nowrap { white-space: nowrap; }
.dt-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.dt-neg { font-weight: 500; }

/* segment pill */
.dt-tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  padding: 2px 7px;
}

/* sentiment — signalled by a monochrome glyph, not colour */
.dt-sent {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  color: var(--ink-faint);
  white-space: nowrap;
}
.dt-sent::before {
  content: "\25CF"; /* ● */
  font-size: 8px;
  margin-right: 7px;
  vertical-align: 1px;
  color: var(--ink-faint);
}
.dt-sent--negative { color: var(--ink); }
.dt-sent--negative::before { color: var(--ink); }
.dt-sent--positive::before { content: "\25CB"; } /* ○ */
.dt-sent--neutral::before  { content: "\2013"; } /* – */

/* body verbatim — the human voice; readable sans, allowed to wrap.
   Table auto-layout ignores max-width on the <td>, so the width is
   pinned on an inner <div> to force wrapping instead of column bleed. */
.dt-body-col { white-space: normal; }
.dt-body {
  width: 480px;
  white-space: normal;
  overflow-wrap: break-word;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-muted);
}
@media (max-width: 680px) {
  .dt-body { width: 260px; }
}

.dt-link { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.dt-link:hover { color: var(--ink-faint); }

@media (max-width: 680px) {
  .dt-scroll { max-height: 68vh; }
  .dt-body-col { min-width: 240px; }
}

/* ---- meta footer ---- */
.lp-meta-footer {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
