/* _starter-extensions.css—home-page (Findings) styles layered on styles.css.
 * Lens filter pills, today-grades KPI summary + per-pub grid, cube rails. */

/* ── 1. Lens filter ─────────────────────────────────────────────────────── */

.lens-filter {
  margin-bottom: 24px;
}

.lens-pills {
  display: flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
  padding: 4px;
  width: fit-content;
}

.lens-pill {
  background: transparent;
  border: 1px solid transparent;
  color: var(--t-3);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.lens-pill:hover {
  color: var(--t-1);
  background: var(--bg-2);
}

.lens-pill .meta {
  font-size: 10px;
  color: var(--t-4);
  text-transform: none;
  letter-spacing: 0.02em;
}

.lens-pill.active {
  background: var(--bg-3);
  color: var(--t-1);
  border-color: var(--line-bright);
}

.lens-pill.active.ct-news    { border-color: var(--news-accent); color: var(--news-accent); }
.lens-pill.active.ct-news .meta { color: var(--news-accent); opacity: 0.7; }
.lens-pill.active.ct-ent     { border-color: var(--ent-accent);  color: var(--ent-accent); }
.lens-pill.active.ct-ent  .meta { color: var(--ent-accent);  opacity: 0.7; }

/* Lens-driven hide/show: tiles match active lens via body[data-lens] */
body[data-lens="news"] .tile.ct-ent,
body[data-lens="ent"]  .tile.ct-news {
  opacity: 0.35;
}
body[data-lens="news"] .tile.ct-ent .t1,
body[data-lens="ent"]  .tile.ct-news .t1 {
  pointer-events: none;
}

/* Per-row filter inside tile tables */
body[data-lens="news"] .tbl tbody tr.ct-ent  { display: none; }
body[data-lens="ent"]  .tbl tbody tr.ct-news { display: none; }

/* ── 3. Today's grades summary ──────────────────────────────────────────── */

.today-grades {
  margin-bottom: 40px;
}

.grade-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.grade-pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.grade-pub-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--t-4);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.grade-pub-card.ct-news { border-left-color: var(--news-accent); }
.grade-pub-card.ct-ent  { border-left-color: var(--ent-accent); }

.grade-pub-card .pub-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--t-1);
  margin-bottom: 8px;
}

.grade-pub-card .grade-mix {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.grade-pub-card .meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--t-3);
}

.grade-pub-stats {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.grade-pub-stats .kpi-val { font-size: 20px; }
.grade-pub-card.v-go   .kpi-val { color: var(--go); }
.grade-pub-card.v-test .kpi-val { color: var(--test); }
.grade-pub-card.v-skip .kpi-val { color: var(--skip); }

/* ── 4. Findings extensions ─────────────────────────────────────────────── */

.findings-section { margin-bottom: 48px; }

.example-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.example-list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.example-list li:last-child { border-bottom: none; }

.example-list .ex-h {
  font-size: 13px;
  color: var(--t-1);
  margin-bottom: 4px;
  line-height: 1.45;
}

.example-list .ex-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--t-3);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.example-list.small li { padding: 8px 0; font-size: 12px; }

.bridge-slot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.bridge-slot .small {
  font-size: 11px;
  color: var(--t-3);
  font-family: var(--font-mono);
  margin: 0 0 6px;
}

.bridge-slot select {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--t-3);
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  border-radius: var(--radius);
}

/* Cube rails (for per-vertical formula × site tile) */

.cube-rails {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 1100px) {
  .cube-rails { grid-template-columns: 1fr; }
}

.cube-rail {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-top: 3px solid var(--t-4);
  padding: 12px 14px;
}

.cube-rail.vert-mb { border-top-color: var(--vert-mb); }
.cube-rail.vert-el { border-top-color: var(--vert-el); }
.cube-rail.vert-ex { border-top-color: var(--vert-ex); }

.cube-rail .rail-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.cube-rail .rail-head .meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--t-3);
}

.rail-tile {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--t-4);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin-bottom: 8px;
}

.rail-tile.v-go   { border-left-color: var(--go); }
.rail-tile.v-test { border-left-color: var(--test); }
.rail-tile.v-skip { border-left-color: var(--skip); }

.rail-tile .combo {
  font-size: 12px;
  color: var(--t-1);
  margin-bottom: 4px;
}

.rail-tile .combo-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--t-3);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.findings-list {
  margin: 0;
  padding-left: 22px;
}

.findings-list li {
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--t-1);
  line-height: 1.55;
}

.sparkline-placeholder {
  background: var(--bg-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--t-4);
  margin: 8px 0;
}

.tbl.small { font-size: 11px; }
.tbl.small th, .tbl.small td { padding: 6px 8px; }

.caption {
  font-size: 12px;
  color: var(--t-2);
  line-height: 1.55;
  margin: 10px 0 0;
}

/* ── Sub-page subnav already exists in styles.css; just patch hover here ── */

.subnav a:hover { color: var(--t-1); }

/* ── CI bracket on lift cells (Item 1) ─────────────────────────────────── */
.ci-bracket {
  color: var(--t-4);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  margin-left: 4px;
  letter-spacing: 0;
}

/* ── Anomaly badges on cube combos (Item 5b) ───────────────────────────── */
.anom {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  margin-right: 4px;
  letter-spacing: 0;
}
.anom-high { color: var(--go); }
.anom-low  { color: var(--skip); }

/* ── Freshness chip on trends rows (Item 6b) ───────────────────────────── */
.freshness-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  background: var(--test-bg);
  color: var(--test);
  border: 1px solid var(--test-line);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* ── Sparklines (Items 6b, 7b) ─────────────────────────────────────────── */
.spark {
  vertical-align: middle;
}
.spark-empty {
  color: var(--t-4);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ── Team perf CI subscript (Item 7b) ──────────────────────────────────── */
.pctile-ci {
  color: var(--t-4);
  font-family: var(--font-mono);
  font-size: 10px;
  margin-left: 2px;
}

/* ── Bottom performers offender row (Item 8b) ─────────────────────────── */
.offender-row td {
  background: var(--bg-1);
  font-size: 11px;
  color: var(--t-2);
  padding-top: 4px !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid var(--line) !important;
}
.offender-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--t-3);
  margin-right: 6px;
}

/* ── Tile controls: CSV + recency toggle (Items 10b, 12) ────────────────── */
.tile-controls {
  display: inline-flex;
  gap: 4px;
  margin-right: 8px;
  vertical-align: middle;
}
.tile-ctl {
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--t-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}
.tile-ctl:hover {
  color: var(--t-1);
  background: var(--bg-2);
  border-color: var(--line-bright);
}
.recency-toggle[data-recency="1"] {
  color: var(--conf-mod);
  border-color: var(--conf-mod);
  background: rgba(192,132,252,.08);
}

/* ── Drill-down filter chips (Item 11) ─────────────────────────────────── */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 14px;
  padding: 8px 10px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.chips-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t-3);
  margin-right: 4px;
}
.chip {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--t-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}
.chip:hover { color: var(--t-1); background: var(--bg-2); border-color: var(--line-bright); }
.chip.active {
  background: var(--bg-3);
  color: var(--t-1);
  border-color: var(--line-bright);
}

/* ── Calibration plot block (Items 2, 3) ───────────────────────────────── */
.calibration-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.calibration-block svg {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: block;
  margin: 4px 0 0;
}

/* ── Decile badge on outcome surface (Item 21b) ────────────────────────── */
.decile-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.decile-badge.v-go   { color: var(--go);   background: var(--go-bg);   border: 1px solid var(--go-line); }
.decile-badge.v-test { color: var(--test); background: var(--test-bg); border: 1px solid var(--test-line); }
.decile-badge.v-skip { color: var(--skip); background: var(--skip-bg); border: 1px solid var(--skip-line); }

/* ── Per-pub deep-link drawer (Item 26) ────────────────────────────────── */
.pub-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 13, 0.55);
  backdrop-filter: blur(2px);
  z-index: 200;
  opacity: 0;
  transition: opacity 200ms ease;
}
.pub-drawer-backdrop.open { opacity: 1; }
.pub-drawer-backdrop[hidden] { display: none; }

.pub-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 460px;
  max-width: 90vw;
  background: var(--bg-1);
  border-left: 1px solid var(--line-bright);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.45);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 200ms ease;
}
.pub-drawer.open { transform: translateX(0); }
.pub-drawer[hidden] { display: none; }

.pub-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.pub-drawer-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--t-1);
}
.pub-drawer-close {
  background: transparent;
  border: 0;
  color: var(--t-3);
  font-size: 22px;
  line-height: 1;
  padding: 0 6px;
  cursor: pointer;
}
.pub-drawer-close:hover { color: var(--t-1); }
.pub-drawer-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
}
.pub-drawer-body h3 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t-3);
  margin: 14px 0 8px;
  font-weight: 600;
}

/* Pub-link styling: subtle underline-on-hover, inherit color */
.pub-link {
  color: inherit;
  border-bottom: 1px dashed transparent;
  transition: border-color 120ms ease, color 120ms ease;
}
.pub-link:hover {
  color: var(--conf-high);
  border-bottom-color: var(--conf-high);
}
