/*
 * Centricity MF Screener Dashboard — Screener page CSS
 * Loads after centricity.css. Layout pieces specific to screener.html:
 * title band, 2-col layout, filter rail (tiles + range sliders),
 * action toolbar, fund table, modal-overlay weight drawer.
 *
 * Cowork 2026-05-06 (Fix-List 1) — Asset Class tiles, range-slider rail,
 * modal weight drawer, black ALL-CAPS header table.
 *
 * Cowork 2026-05-06 (Fix-List 2) layered on top —
 *   • Section-number eyebrow removed from title band
 *   • 12th utility column (checkbox) at left edge
 *   • Sticky columns on the left: checkbox + Rank + Fund Name
 *   • Horizontal scroll on the table-wrap so wide column counts
 *     scroll left-to-right rather than break the layout
 *   • Header cells centred + multi-line (white-space: normal) with max-width
 *   • Category body cells centred (was left)
 *   • Fund Name renders as a Warm Gold link with hover underline; clicks
 *     are isolated to the link itself (row-click navigation removed)
 *   • Range sliders unified to full filter-rail width (was inconsistent
 *     padding between AUM and the section sliders)
 *   • "Coming after web design lock-in" caption styling for deferred buttons
 *   • Compare button cap-warn flash for the 5-fund limit
 *   • "Add columns" picker styling above the table
 */

/* ============ TITLE BAND ============ */
.titleband {
  background: #fff;
  border-bottom: 1px solid var(--rule);
  padding: 28px 56px 22px;
}
.titleband-inner {
  max-width: 1740px; margin: 0 auto;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 32px; flex-wrap: wrap;
}
.titleband h1 {
  margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1;
}
.titleband h1 em { font-style: italic; font-weight: 400; color: var(--gold-deep); }
.titleband .sub { font-size: 13.5px; color: var(--text-mid); margin-top: 6px; max-width: 80ch; }
.titleband .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ============ BUTTONS ============ */
.btn {
  font-family: inherit; font-size: 12.5px; letter-spacing: .14em;
  text-transform: uppercase;
  padding: 11px 16px; border-radius: 3px;
  border: 1px solid var(--gold); background: #fff; color: var(--gold);
  font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--tan-soft); }
.btn.primary { background: var(--gold); color: #fff; }
.btn.primary:hover { background: var(--gold-deep); border-color: var(--gold-deep); }
.btn.ghost { border-color: var(--grey-light); color: var(--black); }
.btn.ghost:hover { background: var(--tan-soft); border-color: var(--gold); }
.btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn .pip {
  background: var(--gold); color: #fff;
  font-size: 10px; letter-spacing: .05em; font-weight: 700;
  padding: 1px 6px; border-radius: 2px; min-width: 18px; text-align: center;
}
/* Deferred-button caption — Fix-List 2 §I (PDF/PPT exports) */
.btn.deferred {
  position: relative;
  opacity: .45;
}
.btn.deferred::after {
  content: "Coming after web design lock-in";
  position: absolute;
  top: calc(100% + 4px);
  left: 50%; transform: translateX(-50%);
  font-size: 9.5px; letter-spacing: .08em; text-transform: none;
  color: var(--text-mid);
  font-weight: 400;
  white-space: nowrap;
  pointer-events: none;
}

/* ============ LAYOUT (2-col fixed; drawer is now a modal overlay) ============ */
.layout {
  max-width: 1740px; margin: 0 auto;
  padding: 24px 56px 64px;
  display: grid; grid-template-columns: 296px minmax(0, 1fr); gap: 28px;
  position: relative;
}
.center { min-width: 0; }   /* allows table-wrap to shrink and scroll */

/* ============ FILTER RAIL ============ */
aside.rail {
  background: #fff; border: 1px solid var(--rule); border-radius: 4px;
  padding: 18px;
  align-self: flex-start;
  position: sticky; top: 104px;
  max-height: calc(100vh - 130px); overflow-y: auto;
}
.rail h3 {
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-mid); font-weight: 700; margin: 0 0 8px;
}
.rail .filter-group { margin-bottom: 18px; }
.rail .filter-group .multi-select { width: 100%; }
.rail .filter-group .multi-select .ms-button { width: 100%; min-width: 0; }

/* Batch-14 S4 — Active/Passive toggle pair (equity/hybrid only) */
.ap-toggles { display: flex; gap: 8px; }
.ap-tog {
  flex: 1; display: flex; align-items: center; gap: 7px;
  padding: 7px 10px; border: 1px solid var(--rule); border-radius: 4px;
  font-size: 12.5px; color: var(--ink); cursor: pointer; user-select: none;
  background: #fff; transition: background .15s ease, border-color .15s ease;
}
.ap-tog:hover { border-color: var(--gold); }
.ap-tog input { accent-color: var(--gold); width: 14px; height: 14px; cursor: pointer; margin: 0; }
.ap-tog:has(input:checked) { background: var(--tan-light, #F3ECE1); border-color: var(--gold); }

/* Renamed from `.filter-group.section` to `.filter-group.filter-section` to
 * avoid colliding with the global `.section` utility class in centricity.css
 * (which sets padding: 56px 56px 8px on page-level sections, including a
 * 1380px responsive override that adds 32px horizontal padding). The old
 * collision was eating 64px off every section-grouped slider's width.
 * Fix-List 2 §F. */
.rail .filter-group.filter-section {
  border-top: 1px solid var(--rule);
  padding-top: 14px; margin-top: 6px;
}
.rail .section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 6px;
}
.rail .section-title {
  margin: 0; color: var(--gold); font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; font-size: 11px;
}
.rail .reset-mini {
  background: transparent; border: 0;
  color: var(--text-mid); font-family: inherit;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  cursor: pointer; padding: 0;
}
.rail .reset-mini:hover { color: var(--gold); }

.rail .reset-row {
  display: flex; gap: 8px; margin-top: 14px;
  border-top: 1px solid var(--rule); padding-top: 14px;
}
.rail .reset-row .btn { padding: 8px 12px; font-size: 11px; flex: 1; justify-content: center; }

/* ============ TILE SELECT (Asset Class) ============ */
.tile-select {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
}
.tile-select .tile {
  background: #fff;
  border: 1px solid var(--grey-light);
  border-radius: 3px;
  padding: 12px 8px 10px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-mid);
  cursor: pointer;
  letter-spacing: .04em;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-align: center;
  transition: background .15s, border-color .15s, color .15s;
}
.tile-select .tile:hover {
  border-color: var(--gold);
  background: var(--tan-softer);
  color: var(--black);
}
.tile-select .tile.on {
  border-color: var(--gold);
  background: var(--tan-soft);
  color: var(--black);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.tile-select .tile.on .lbl { color: var(--gold-deep); }
.tile-select .tile.disabled {
  cursor: not-allowed; opacity: .55; font-style: italic;
  background: rgba(217, 217, 217, .25);
}
.tile-select .tile .lbl { font-size: 12.5px; font-weight: 700; }
.tile-select .tile .sub {
  font-size: 10.5px; font-weight: 400; color: var(--text-mid); letter-spacing: 0;
}

/* ============ RANGE SLIDERS (two-handle) ============
 * Fix-List 2 §F — every .rng inside the rail is full-width of its
 * parent's content box. AUM and section sliders share the exact
 * same horizontal frame; no extra padding on the group sliders.
 */
.rail .rng {
  margin-bottom: 14px;
  font-family: inherit;
  width: 100%;            /* explicit so .filter-group.section sliders match AUM */
  box-sizing: border-box;
}
.rng-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 6px;
}
.rng-label {
  font-size: 11px; font-weight: 700; color: var(--text-mid);
  letter-spacing: .12em; text-transform: uppercase;
}
.rng-value {
  font-size: 12px; font-weight: 700; color: var(--black);
  font-variant-numeric: tabular-nums;
}
.rng-value .rng-min, .rng-value .rng-max { color: var(--black); }
.rng-value .rng-neg { color: var(--red); }
/* Batch-7 2.3 — editable min/max fields, two-way bound to the slider */
.rng-edit { display: inline-flex; align-items: center; gap: 3px; }
.rng-num {
  width: 58px; font-family: inherit; font-size: 11.5px; padding: 2px 4px;
  border: 1px solid var(--rule); border-radius: 3px; background: #fff;
  text-align: right; font-variant-numeric: tabular-nums; color: var(--black);
  -moz-appearance: textfield;
}
.rng-num::-webkit-outer-spin-button, .rng-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rng-num:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(189, 149, 104, .18); }
.rng-dash { font-size: 11px; color: var(--text-mid); }
.rng-unit { font-size: 10px; color: var(--text-mid); margin-left: 1px; white-space: nowrap; }

.rng-track-wrap {
  position: relative;
  height: 22px;
  width: 100%;
  padding: 8px 0;
  box-sizing: border-box;
}
.rng-track {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 3px;
  background: var(--grey-light);
  border-radius: 1px;
  transform: translateY(-50%);
}
.rng-fill {
  position: absolute;
  top: 50%;
  height: 3px;
  background: var(--gold);
  border-radius: 1px;
  transform: translateY(-50%);
}
.rng-input {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  background: transparent;
  pointer-events: none;
  margin: 0;
  height: 22px;
}
.rng-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--gold);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
  position: relative;
  z-index: 2;
}
.rng-input::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--gold);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
.rng-input:focus { outline: none; }
.rng-input:focus::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(189, 149, 104, .25); }
.rng-input:focus::-moz-range-thumb     { box-shadow: 0 0 0 3px rgba(189, 149, 104, .25); }

/* ============ TOOLBAR (above table) ============ */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.toolbar .left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar .right { display: flex; align-items: center; gap: 8px; }
.toolbar .count { font-size: 12.5px; color: var(--text-mid); }
.toolbar .count b { color: var(--black); font-weight: 700; }

.search-box {
  display: flex; align-items: center;
  border: 1px solid var(--rule); border-radius: 3px;
  padding: 7px 12px; gap: 8px;
  width: 320px;
}
.search-box:focus-within { border-color: var(--gold); }
.search-box input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 13px; color: var(--black);
}

/* "Add columns" picker — Fix-List 2 §D */
.addcol-wrap {
  display: inline-flex; align-items: center; gap: 8px;
}
.addcol-label {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-mid); font-weight: 700;
}

/* Compare-cap inline note — Fix-List 2 §A */
.cap-warn {
  font-size: 11.5px; color: var(--red);
  letter-spacing: .04em;
  margin: 0 0 12px;
  padding: 6px 12px;
  background: rgba(147, 22, 33, .06);
  border-left: 3px solid var(--red);
  border-radius: 0 3px 3px 0;
  display: inline-block;
  animation: cap-warn-pulse .9s ease-out;
}
.cap-warn[hidden] { display: none; }
@keyframes cap-warn-pulse {
  0%   { background: rgba(147, 22, 33, .22); }
  40%  { background: rgba(147, 22, 33, .12); }
  100% { background: rgba(147, 22, 33, .06); }
}

/* ============ FUND TABLE — Fix-List 2 §B layout polish ============ */
.fund-table-wrap {
  background: #fff; border: 1px solid var(--rule); border-radius: 4px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.scroll-tbody {
  /* Batch-7 2.2 — height set by JS to exactly header + 20 rows (fixTableViewport);
     scroll (not auto) keeps the bottom + right bars ALWAYS visible at the
     20-row boundary regardless of result count. */
  overflow-x: scroll;
  overflow-y: scroll;
  flex: none;      /* explicit JS-set height must win inside the column flex */
  min-width: 0;
}
/* Batch-7 2.2 — four-side scrollbars: flex shell + two scrollbar-only mirrors
   (top horizontal, left vertical) synced to the real container by JS. */
.tbl-flex { display: flex; align-items: flex-start; }
.tbl-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hscroll-top { overflow-x: scroll; overflow-y: hidden; }
.hscroll-top-inner { height: 1px; }
.vscroll-left { overflow-y: scroll; overflow-x: hidden; flex: none; }
.vscroll-left-inner { width: 1px; }
.hscroll-top::-webkit-scrollbar, .vscroll-left::-webkit-scrollbar,
.scroll-tbody::-webkit-scrollbar { width: 12px; height: 12px; }
.hscroll-top::-webkit-scrollbar-thumb, .vscroll-left::-webkit-scrollbar-thumb,
.scroll-tbody::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 6px; border: 3px solid #fff; }
.hscroll-top::-webkit-scrollbar-track, .vscroll-left::-webkit-scrollbar-track,
.scroll-tbody::-webkit-scrollbar-track { background: rgba(217, 217, 217, .35); }
table.screener-tbl {
  width: max-content;        /* let the table grow with column count */
  min-width: 100%;
  border-collapse: separate; /* required for sticky-column borders to render */
  border-spacing: 0;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
table.screener-tbl thead th {
  position: sticky; top: 0;
  background: var(--black);
  color: #fff;
  text-align: center;        /* every header centred — Fix-List 2 §B */
  font-weight: 700;
  font-size: 13.5px;          /* one step bigger than 12.5px body cells */
  letter-spacing: .14em; text-transform: uppercase;
  padding: 13px 10px;
  border-right: 1px solid rgba(255, 255, 255, .08);
  cursor: pointer; user-select: none;
  white-space: normal;        /* allow header to wrap to two lines */
  line-height: 1.18;
  vertical-align: middle;
  z-index: 5;
  max-width: 140px;
  min-width: 78px;
}
table.screener-tbl thead th .arr {
  display: inline-block; margin-left: 6px; color: var(--gold);
  opacity: 0; transition: opacity .15s;
}
/* Batch-9 B1 — direct-remove ✕ on user-added column headers */
table.screener-tbl thead th .col-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 6px; padding: 0;
  font-family: inherit; font-size: 12px; line-height: 1;
  color: rgba(255, 255, 255, .55); background: transparent;
  border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%;
  cursor: pointer; vertical-align: middle;
}
table.screener-tbl thead th .col-x:hover { color: #fff; border-color: var(--gold); background: rgba(189, 149, 104, .35); }
table.screener-tbl thead th.sorted { background: #1a1a1a; }
table.screener-tbl thead th.sorted .arr { opacity: 1; }
table.screener-tbl thead th.no-sort { cursor: default; }
table.screener-tbl thead th.no-sort .arr { display: none; }
table.screener-tbl tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(217, 217, 217, .45);
  vertical-align: middle;
  text-align: center;
  white-space: nowrap;
  font-size: 12.5px;
  background: #fff;            /* opaque so sticky cols don't bleed */
}
table.screener-tbl tbody tr:nth-child(even) td { background: rgba(247, 246, 244, 1); }
table.screener-tbl tbody tr:hover td { background: rgba(219, 200, 178, .22); }

/* B4 (§7.56) — fixed 20-row table height: empty filler rows (single colspan cell) sized to
   a normal data row (15px content + 11px×2 padding ≈ 38px) so a narrowed result set never
   collapses the table footprint or reflows the surrounding layout. */
table.screener-tbl tbody tr.pad-row td { height: var(--pad-h, 44px); padding-top: 0; padding-bottom: 0; background: #fff; border-bottom-color: rgba(217, 217, 217, .25); }
table.screener-tbl tbody tr.pad-row:nth-child(even) td,
table.screener-tbl tbody tr.pad-row:hover td { background: #fff; }

table.screener-tbl tbody td.neg { color: var(--red); }
table.screener-tbl tbody td.left { text-align: left; }

/* Sticky left columns — checkbox · Rank · Fund Name (Fix-List 2 §B)
 * Fixed widths so `left:` offsets are deterministic. The 3 sticky cols
 * are columns 1, 2, 3 of the rendered <tr>; the checkbox column is
 * 36px, Rank 60px, Fund Name 220px → cumulative 36, 96, 156px.
 *
 * Position only — alignment is split below so the Fund Name HEADER
 * stays centred (Fix-List 2.1 §1) while the body cells stay left-aligned. */
table.screener-tbl thead th.col-check,
table.screener-tbl tbody td.col-check {
  position: sticky; left: 0;
  z-index: 6;
  width: 36px; min-width: 36px; max-width: 36px;
  padding: 6px;
}
table.screener-tbl thead th.col-rank,
table.screener-tbl tbody td.col-rank {
  position: sticky; left: 36px;
  z-index: 6;
  width: 60px; min-width: 60px; max-width: 60px;
}
table.screener-tbl thead th.col-name,
table.screener-tbl tbody td.col-name {
  position: sticky; left: 96px;
  z-index: 6;
  width: 220px; min-width: 220px; max-width: 220px;
  /* hairline rule separates the sticky frame from scrolling area */
  border-right: 1px solid var(--rule);
}
/* Fund Name body cells are left-aligned (the only real text in the row);
 * but the HEADER must stay centred per the universal centring rule —
 * Fix-List 2.1 §1. */
table.screener-tbl tbody td.col-name { text-align: left; }
table.screener-tbl thead th.col-check { z-index: 7; }
table.screener-tbl thead th.col-rank  { z-index: 7; }
table.screener-tbl thead th.col-name  { z-index: 7; }

/* Universal header centring (Fix-List 2.1 §1) — every <th> in the
 * Screener table, default OR dynamically appended via the "Add columns"
 * picker, must centre both axes. The base `thead th` rule already sets
 * text-align:center + vertical-align:middle; this !important guard
 * defends against any future per-column override that might sneak in. */
table.screener-tbl thead th {
  text-align: center !important;
  vertical-align: middle !important;
}

/* Sticky-cell OPAQUE backgrounds at every row state (Fix-List 2.1 §2)
 * — sticky <td> cells must form a solid wall so non-sticky columns
 * scrolling underneath are completely invisible during horizontal
 * scroll. Each row state has its own opaque colour; alpha-blending
 * with white is precomputed where the spec colour was rgba.
 *
 *   default       #FFFFFF                white
 *   even stripe   rgb(247, 246, 244)     existing opaque cream
 *   hover         rgb(247, 243, 238)     == rgba(219,200,178,.22) over white
 *   selected      rgb(242, 236, 228)     == rgba(219,200,178,.35) over white
 *
 * Class-on-td selectors below are MORE specific than the generic
 * `tr:hover td` / `tr:nth-child(even) td` rules above, so they win
 * the cascade without !important. */
table.screener-tbl tbody td.col-check,
table.screener-tbl tbody td.col-rank,
table.screener-tbl tbody td.col-name {
  background-color: #ffffff;
}
table.screener-tbl tbody tr:nth-child(even) td.col-check,
table.screener-tbl tbody tr:nth-child(even) td.col-rank,
table.screener-tbl tbody tr:nth-child(even) td.col-name {
  background-color: rgb(247, 246, 244);
}
table.screener-tbl tbody tr:hover td.col-check,
table.screener-tbl tbody tr:hover td.col-rank,
table.screener-tbl tbody tr:hover td.col-name {
  background-color: rgb(247, 243, 238);
}
table.screener-tbl tbody tr.selected td.col-check,
table.screener-tbl tbody tr.selected td.col-rank,
table.screener-tbl tbody tr.selected td.col-name,
table.screener-tbl tbody tr.selected:nth-child(even) td.col-check,
table.screener-tbl tbody tr.selected:nth-child(even) td.col-rank,
table.screener-tbl tbody tr.selected:nth-child(even) td.col-name {
  background-color: rgb(242, 236, 228);
}

/* Body cells inside sticky columns inherit row backgrounds correctly */
table.screener-tbl tbody tr.non-ranked td { color: var(--text-mid); }
table.screener-tbl tbody tr.non-ranked td.col-name a { color: var(--gold-deep); }

/* Fund-name link — only the text is the click target (Fix-List 2 §B) */
table.screener-tbl .fund-name-link {
  color: var(--gold);
  text-decoration: none;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  white-space: normal;
  display: inline-block;
  line-height: 1.25;
}
table.screener-tbl .fund-name-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
table.screener-tbl .fund-name-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Row-level hover highlight uses the gold accent on the FUND NAME column,
 * not a left-border on the entire row, since the row is no longer click-
 * targeted; the fund-name link is the only interactive element. */
table.screener-tbl tbody tr.selected td { background: rgba(219, 200, 178, .35); }
table.screener-tbl tbody tr.selected:nth-child(even) td { background: rgba(219, 200, 178, .35); }

/* Checkbox column — leave the click well-behaved */
table.screener-tbl .row-check {
  cursor: pointer;
  width: 16px; height: 16px;
  margin: 0;
  accent-color: var(--gold);
}
table.screener-tbl .header-check {
  cursor: pointer;
  width: 14px; height: 14px;
  accent-color: var(--gold);
}
/* Header checkbox cell — flex centring so the input sits in the middle
 * of the cell on both axes regardless of multi-line headers in adjacent
 * columns. Replaces the prior `font-size: 0; line-height: 0` hack which
 * suppressed text rendering but left the input baseline-aligned (and
 * conflicted with the universal vertical-align:middle rule). */
table.screener-tbl thead th.col-check {
  display: table-cell;
}
table.screener-tbl thead th.col-check input {
  display: block;
  margin: 0 auto;
}

table.screener-tbl .badge {
  font-size: 9.5px; padding: 2px 8px; letter-spacing: .12em;
}

.legend {
  font-size: 11.5px; color: var(--text-mid); margin-top: 10px;
  line-height: 1.55;
}

/* ============ SCORE CELL ============ */
table.screener-tbl .score-cell {
  display: inline-flex; align-items: center; gap: 8px;
}
table.screener-tbl .score-bar {
  display: inline-block; width: 56px; height: 5px;
  background: var(--grey-light); border-radius: 1px; overflow: hidden;
}
table.screener-tbl .score-bar > i { display: block; height: 100%; background: var(--gold); }

/* ============ DEBT MODE — sticky-column overrides ============
 * Phase 1 (MF_Debt family). The debt screener has no Rank column, so the
 * Fund Name slot moves left to abut the checkbox column. CSS-only — the
 * table renderer omits the Rank cell when _family === 'debt'. Sticky
 * stack: 36px checkbox · 220px Fund Name (no Rank gap).
 */
.fund-table-wrap.debt-mode table.screener-tbl thead th.col-name,
.fund-table-wrap.debt-mode table.screener-tbl tbody td.col-name {
  left: 36px;          /* abuts the checkbox column directly */
}

/* ============ EMPTY STATE ============ */
.fund-table-wrap > .empty-state {
  border: 0; border-radius: 0; box-shadow: none;
  padding: 64px 24px;
}

/* ============ WEIGHT DRAWER (modal overlay) ============ */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .42);
  z-index: 90;
  animation: fade-in .18s ease-out;
}
.drawer-backdrop[hidden] { display: none; }

aside.drawer {
  position: fixed;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 64px));
  max-height: calc(100vh - 96px);
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--gold);
  border-radius: 4px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .24);
  z-index: 100;
  animation: pop-in .22s ease-out;
}
aside.drawer[hidden] { display: none; }
@keyframes pop-in {
  from { transform: translate(-50%, -50%) scale(.96); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
}
@keyframes fade-in {
  from { opacity: 0; } to { opacity: 1; }
}

.drawer-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.drawer-head h3 {
  margin: 0;
  font-size: 13px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold); font-weight: 700;
}
.drawer-sub {
  margin: 6px 0 0; max-width: 46ch;
  font-size: 11.5px; color: var(--text-mid); line-height: 1.55;
}
.drawer-sum {
  font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold); letter-spacing: .04em;
  white-space: nowrap;
  padding: 4px 8px; border: 1px solid currentColor; border-radius: 3px;
}
.drawer-sum.warn { color: var(--red); }
.drawer-sum.ok   { color: var(--gold); }

.drawer-body {
  padding: 14px 22px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
}
.weight-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
}
.weight-row .name {
  font-size: 12px; font-weight: 700; color: var(--black);
  letter-spacing: 0;
  flex: 1; min-width: 0;
}
.weight-row .name .dir {
  display: inline-block; font-size: 9.5px; color: var(--gold);
  margin-left: 4px;
}
.weight-row input[type="number"] {
  font-family: inherit;
  font-size: 12.5px;
  width: 76px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 6px 8px;
  background: #fff;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.weight-row input[type="number"]:focus { border-color: var(--gold); outline: none; }
.weight-row input[type="number"].invalid { border-color: var(--red); background: rgba(147, 22, 33, .04); }
.weight-row .pct-suffix {
  font-size: 11px; color: var(--text-mid); margin-left: 4px;
}

.drawer-actions {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--rule);
  display: flex; gap: 10px; justify-content: flex-end;
}
.drawer-actions .btn { padding: 9px 18px; font-size: 11.5px; }

/* ============ RESPONSIVE NUDGES ============ */
@media (max-width: 1380px) {
  .layout { grid-template-columns: 264px minmax(0, 1fr); padding: 18px 32px 48px; gap: 20px; }
  .titleband { padding: 22px 32px 18px; }
}
@media (max-width: 1100px) {
  .drawer-body { grid-template-columns: 1fr; }
}

/* ============ ROUND G1 — SCREENER PPT EXPORT ============ */
/* Building-deck state — subtle dim while pptxgenjs runs (label flips to "Building deck…") */
.btn.is-generating { opacity: .7; cursor: progress; pointer-events: none; }

/* Gating notice under the titleband (e.g. >300 funds matched) */
.export-notice {
  margin: 12px 32px 0;
  padding: 9px 14px;
  border-left: 3px solid var(--gold);
  background: rgba(189, 149, 104, .10);
  color: var(--text-mid);
  font-size: 11.5px; line-height: 1.5;
  border-radius: 0 3px 3px 0;
}
.export-notice[hidden] { display: none; }

/* Reduce Columns modal — checkbox list (re-uses .drawer chrome) */
.reduce-cols-body { grid-template-columns: 1fr 1fr; }
.reduce-col-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--black);
  padding: 3px 0; cursor: pointer;
}
.reduce-col-item input[type="checkbox"] { accent-color: var(--gold); }
.reduce-col-item input[disabled] { cursor: not-allowed; }
.reduce-col-lock {
  font-style: normal; font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--gold); border-radius: 2px; padding: 0 4px;
}

/* ============ ROUND G1.2 — SCREENER PDF (print replica of the PPT) ============ */
#screenerPrintRoot { display: none; }

@media print {
  /* Hide the live dashboard; render only the print view */
  body > *:not(#screenerPrintRoot) { display: none !important; }
  #screenerPrintRoot {
    display: block !important;
    font-family: 'Cambria', Georgia, 'Times New Roman', serif;
    color: #0E0E0E; background: #fff;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; color-adjust: exact;
  }
  @page { size: A4 landscape; margin: 10mm; }

  .sp-cover, .sp-page { page-break-after: always; break-after: page; position: relative; }
  #screenerPrintRoot > *:last-child { page-break-after: auto; break-after: auto; }
  .sp-table { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* Cover */
  .sp-cover { min-height: 160mm; display: flex; flex-direction: column; justify-content: center; }
  .sp-rings {
    position: absolute; top: 6mm; right: 6mm; width: 64mm; height: 64mm; border-radius: 50%;
    border: 1.5pt solid #BFBFBF;
    box-shadow: 0 0 0 6mm #fff, 0 0 0 6.4mm #BD9568, 0 0 0 12mm #fff, 0 0 0 12.4mm #BFBFBF;
  }
  .sp-kicker { font-size: 11pt; letter-spacing: .22em; color: #BD9568; font-weight: 700; }
  .sp-cover-title { font-size: 30pt; font-weight: 700; margin: 4mm 0 0; color: #0E0E0E; }
  .sp-cover-sum { font-size: 14pt; color: #6B3F1A; margin-top: 3mm; }
  .sp-cover-meta { font-size: 12pt; color: #888; margin-top: 4mm; }
  .sp-cover-meta b { color: #BD9568; }
  .sp-cover-filters { margin-top: 5mm; }
  .sp-cover-fhead { color: #BD9568; font-weight: 700; font-size: 13pt; letter-spacing: .04em; }
  .sp-cover-flist { margin: 2mm 0 0; padding-left: 6mm; }
  .sp-cover-flist li { font-size: 11.5pt; margin: 1mm 0; color: #0E0E0E; }
  .sp-flabel { font-weight: 700; }

  /* Table pages */
  .sp-head { display: flex; justify-content: space-between; align-items: center;
    background: #0E0E0E; color: #fff; padding: 4mm 4mm; border-bottom: 1pt solid #BD9568; }
  .sp-brand { font-weight: 700; letter-spacing: .14em; font-size: 11pt; }
  .sp-asof { color: #BD9568; font-size: 10pt; }
  .sp-subhead { display: flex; justify-content: space-between; color: #888; font-size: 9pt; padding: 2mm 1mm; }
  .sp-table { width: 100%; border-collapse: collapse; font-size: 8.5pt; font-variant-numeric: tabular-nums; }
  .sp-table tr { page-break-inside: avoid; }       /* never split a fund row across pages (C2) */
  .sp-table th { background: #BD9568; color: #fff; font-weight: 700; padding: 1.4mm 2mm; border: .3pt solid #E6E1D8; }
  .sp-table td { padding: 1.1mm 2mm; line-height: 1.15; border: .3pt solid #E6E1D8; color: #0E0E0E; }
  .sp-table tr.sp-alt td { background: #F4EEE5; }
  .sp-table td.sp-neg { color: #931621; }
  .sp-table td.sp-bold { font-weight: 700; }
  .sp-table td.sp-rank { color: #A47B4C; }
  .sp-table th.sp-col-cat, .sp-table td.sp-col-cat { white-space: nowrap; }  /* Category fits one line (G1.6) */
  .sp-foot { display: flex; justify-content: space-between; color: #888; font-size: 8pt;
    border-top: .5pt solid #BD9568; padding-top: 2mm; margin-top: 3mm; }
}
