/* =================================================================
   S-REIT BENCHMARK — visual system v2
   Aesthetic: trading terminal × FT/NYT markets section.
   Editorial serif headers, monospace numbers, cool teal accent.
   ================================================================= */

:root {
  /* Ink palette */
  --ink-0:  #0A0B0E;
  --ink-1:  #0F1014;
  --ink-2:  #15161D;
  --ink-3:  #1B1D26;
  --ink-4:  #232532;
  --line:   #2A2D38;
  --line-2: #3A3E4C;

  /* Type — WCAG AA on ink-1 */
  --text-0: #F2F3F0;
  --text-1: #C9CCC6;
  --text-2: #969A92;
  --text-3: #777B72;
  --text-4: #5A5D55;

  /* Accent — cool teal, terminal-phosphor without the cliché green */
  --acc:        #4FD3B8;
  --acc-bright: #6FE5CB;
  --acc-soft:   #2A8674;
  --acc-deeper: #133328;

  /* Quality bands */
  --q-strong:  #6EC09E;
  --q-healthy: #9DC76B;
  --q-caution: #D4A05A;
  --q-stress:  #D4736A;

  /* Sector palette */
  --sec-industrial:  #7DA89F;
  --sec-office:      #B49BC8;
  --sec-retail:      #D5A26B;
  --sec-hospitality: #D4828A;
  --sec-healthcare:  #B0C76B;
  --sec-datacentre:  #7BAFD4;
  --sec-diversified: #B0A580;

  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Menlo', monospace;

  --shadow-drawer: -24px 0 64px rgba(0,0,0,0.65);
  --shadow-modal: 0 24px 80px rgba(0,0,0,0.7);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--ink-1);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top right, rgba(79,211,184,0.04), transparent 60%),
    radial-gradient(ellipse at bottom left, rgba(79,211,184,0.025), transparent 65%),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(255,255,255,0.012) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(255,255,255,0.012) 31px 32px),
    var(--ink-1);
}

a { color: var(--acc); text-decoration: none; border-bottom: 1px dotted var(--acc-soft); }
a:hover { color: var(--acc-bright); border-bottom-color: var(--acc-bright); }

em { font-style: italic; font-family: var(--font-display); }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: -9999px;
  background: var(--acc); color: var(--ink-0);
  padding: 8px 14px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  border-bottom: none; z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

fieldset { border: none; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; display: block; width: 100%; }

:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

/* =====================  MASTHEAD  ===================== */
.masthead {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;            /* right-hand column starts level with the logo */
  gap: 14px 32px;
  padding: 28px 32px 22px;            /* horizontal gutter unified with controls/table/footer */
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(0,0,0,0.4), transparent);
}
/* Brand spans both rows on the left so the action buttons + freshness meta stack on the
   right, both starting at the same distance from the top as the logo. */
.masthead__brand { grid-row: 1 / span 2; }
.masthead__brand { display: flex; gap: 18px; align-items: center; }
.masthead__mark {
  display: flex; flex-direction: column; gap: 4px;
  padding-top: 4px;
}
.masthead__mark .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 8px rgba(79,211,184,0.35);
}
.masthead__mark .dot:nth-child(2) { background: var(--text-3); box-shadow: none; }
.masthead__mark .dot:nth-child(3) { background: var(--text-4); box-shadow: none; }

.masthead__name h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-variation-settings: 'opsz' 144;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--text-0);
}
.masthead__name h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--acc);
  margin-left: 8px;
  letter-spacing: -0.01em;
}
.hyphen {
  font-weight: 300;
  color: var(--text-3);
  margin: 0 1px;
}

.masthead__sub {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}

.masthead__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-row: 1;
  grid-column: 2;
}
.action-btn {
  background: var(--ink-3);
  border: 1px solid var(--line);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 7px 12px;
  cursor: pointer;
  transition: color 80ms ease, border-color 80ms ease, background 80ms ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.action-btn:hover { color: var(--text-0); border-color: var(--line-2); }
.action-btn--accent { background: var(--acc-deeper); border-color: var(--acc); color: var(--acc-bright); }
.action-btn--accent:hover { background: rgba(79,211,184,0.18); color: var(--text-0); }
.action-badge {
  background: var(--line);
  color: var(--text-1);
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 2px;
}

.masthead__meta {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 14px;
  row-gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  margin: 0;
  grid-row: 2;
  grid-column: 2;
}
.meta-row { display: contents; }
.meta-label { color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.meta-label.has-tip { cursor: help; border-bottom: 1px dotted var(--text-4); }
.meta-label.has-tip:hover, .meta-label.has-tip:focus-visible { color: var(--text-1); border-bottom-color: var(--acc); }
.meta-val { color: var(--text-1); text-align: right; margin: 0; font-variant-numeric: tabular-nums; }

/* =====================  LAYOUT  ===================== */
/* Single-column now — filters live in the top bar + per-column header popovers (no side rail).
   The fold-fill min-height lives on .table-wrap so its panel background extends naturally. */
.grid { display: block; }

/* ===================== TOP CONTROLS BAR ===================== */
.controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 32px 10px;
  border-bottom: 1px solid var(--line);
}
.controls__field { display: flex; align-items: center; gap: 8px; }
.controls__field input[type=search] {
  background: var(--ink-3);
  border: 1px solid var(--line);
  color: var(--text-0);
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  width: 320px; max-width: 46vw;
  outline: none;
}
.controls__field input[type=search]:focus { border-color: var(--acc); }
.controls__field input::placeholder { color: var(--text-3); }
.controls__label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-3);
}
.controls__reset {
  margin-left: auto;
  background: transparent; border: 1px solid var(--line); color: var(--text-2);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 6px 12px; cursor: pointer;
  transition: color 80ms, border-color 80ms;
}
.controls__reset:hover { color: var(--text-0); border-color: var(--acc); }
.controls__reset--hard { margin-left: 0; border-style: dashed; }
.controls__reset--hard:hover { color: var(--q-stress); border-color: var(--q-stress); }

.chip-list { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  transition: background 80ms, color 80ms, border-color 80ms;
}
.chip:hover { color: var(--text-0); border-color: var(--line-2); }
.chip.is-on { background: var(--acc-deeper); border-color: var(--acc); color: var(--acc-bright); }

/* ---- Dual-thumb range slider (one track, min + max cursors) ---- */
.dual {
  position: relative;
  height: 20px;
  margin-top: 2px;
}
.dual__track {
  position: absolute;
  left: 7px; right: 7px;            /* inset by half a thumb so fill aligns with thumb centres */
  top: 50%; transform: translateY(-50%);
  height: 3px;
  background: var(--line-2);
  border-radius: 2px;
}
.dual__fill {
  position: absolute;
  top: 0; bottom: 0;
  background: var(--acc);
  border-radius: 2px;
}
/* Two range inputs overlaid on the same track. Only the thumbs are interactive. */
.dual__in {
  position: absolute;
  left: 0; right: 0; top: 0;
  width: 100%;
  height: 20px;
  margin: 0;
  -webkit-appearance: none; appearance: none;
  background: transparent;
  pointer-events: none;             /* track ignores clicks … */
}
.dual__in::-webkit-slider-runnable-track { background: transparent; height: 20px; }
.dual__in::-moz-range-track { background: transparent; height: 20px; }
.dual__in::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  pointer-events: auto;             /* … but thumbs are grabbable */
  width: 14px; height: 14px; margin-top: 3px;
  border-radius: 50%;
  background: var(--acc);
  border: 2px solid var(--ink-1);
  box-shadow: 0 0 0 1px var(--acc-soft);
  cursor: ew-resize;
}
.dual__in::-moz-range-thumb {
  pointer-events: auto;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--acc);
  border: 2px solid var(--ink-1);
  box-shadow: 0 0 0 1px var(--acc-soft);
  cursor: ew-resize;
}
.dual__in:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--acc-bright); }
.dual__in:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--acc-bright); }
/* Min thumb sits above so it stays grabbable when the two thumbs are close together. */
.dual__in--min { z-index: 3; }
.dual__in--max { z-index: 2; }

/* =====================  TABLE  ===================== */
.table-wrap {
  background: var(--ink-1);
  position: relative;
  min-width: 0; /* allow shrink for horizontal scroll */
  /* Fill the fold even when a heavy filter leaves only a few rows, so the panel background
     extends to a natural stopping point instead of leaving a dark void above the footer. */
  min-height: calc(100vh - 150px);
}
.table-meta {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 32px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap; gap: 8px 16px;
}
.table-meta__left { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }

/* Active-filter pills */
.pills { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.pill {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--acc-soft); border-radius: 3px; overflow: hidden;
  background: var(--acc-deeper);
}
.pill__body {
  background: transparent; border: none; cursor: pointer;
  color: var(--acc-bright); font-family: var(--font-mono); font-size: 10.5px;
  padding: 3px 8px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pill__body:hover { color: var(--text-0); }
.pill__x {
  background: transparent; border: none; border-left: 1px solid var(--acc-soft); cursor: pointer;
  color: var(--acc-bright); font-size: 13px; line-height: 1; padding: 0 7px;
}
.pill__x:hover { background: rgba(79,211,184,0.2); color: var(--text-0); }
.table-meta .count {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.table-meta .count-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin-left: 6px;
}
.filter-note {
  margin-left: 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--q-caution);
  font-style: italic;
}
.table-meta .hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

/* Slim synced horizontal scrollbar. Pinned (sticky) to the top of the viewport so horizontal
   scroll stays reachable no matter how far down the page you've scrolled — without needing a
   secondary vertical scrollbar on the table itself. Driven by JS (app.js) which mirrors
   scrollLeft with .table-scroll and sets the inner spacer to the table's full width. */
.hbar {
  position: sticky;
  top: 0;
  z-index: 30;
  overflow-x: auto;
  overflow-y: hidden;
  height: 12px;
  background: var(--ink-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) var(--ink-2);
}
.hbar__inner { height: 1px; }
.hbar::-webkit-scrollbar { height: 9px; }
.hbar::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; }
.hbar::-webkit-scrollbar-track { background: var(--ink-2); }
.hbar.is-hidden { display: none; }   /* hidden when the table fits without horizontal overflow */

.table-scroll {
  /* Horizontal-only scroll region. The WHOLE PAGE scrolls vertically (no inner vertical
     scrollbar, no max-height) so the table flows naturally and the footnote sits after it.
     Native scrollbars are hidden — horizontal scrolling is driven by the synced .hbar above. */
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.table-scroll::-webkit-scrollbar { display: none; }

/* Floating header clone — fixed bar shown once the real header scrolls off-screen. */
.float-head {
  position: fixed;
  overflow: hidden;
  z-index: 26;
  background: var(--ink-2);
  border-bottom: 1px solid var(--line-2);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  pointer-events: auto;
}
.float-head[hidden] { display: none; }
.float-head table { border-collapse: separate; border-spacing: 0; margin: 0; will-change: transform; }
.float-head thead th { position: static; }           /* not sticky inside the clone */
.float-head thead th.is-sticky { z-index: 2; position: relative; background: var(--ink-2); box-shadow: 1px 0 0 var(--line); }

.reit-table {
  /* Fixed layout: column widths come from the <th> width styles (set by app.js), so columns
     resize cleanly and cells truncate instead of forcing the column wider than its header.
     The total table width is set explicitly in JS (= sum of column widths) so the browser
     honours each width exactly rather than redistributing slack. */
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.reit-table thead th {
  position: sticky; top: 0;
  background: var(--ink-2);
  color: var(--text-2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 10.5px;
  padding: 10px 8px;     /* tight horizontal padding so more columns fit; stays legible */
  border-bottom: 1px solid var(--line-2);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  z-index: 10;
  overflow: hidden;   /* the .th-label handles the ellipsis (avoids a double "… …") */
}
.reit-table thead th.num { text-align: right; }
.th-label { display: inline-block; max-width: calc(100% - 4px); overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
/* Column resize grip on the right edge of each header. */
.col-resize {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 8px;
  cursor: col-resize;
  z-index: 2;
  touch-action: none;
}
.col-resize::after {
  content: ""; position: absolute; top: 25%; bottom: 25%; right: 2px; width: 2px;
  background: transparent;
}
.reit-table thead th:hover .col-resize::after { background: var(--line-2); }
.col-resize:hover::after { background: var(--acc); }
body.is-col-resizing { cursor: col-resize; user-select: none; }
body.is-col-resizing * { cursor: col-resize !important; }
.reit-table thead th:hover { color: var(--text-0); }
.reit-table thead th.is-sorted { color: var(--acc); }
.reit-table thead th.is-sorted::after {
  content: "";
  display: inline-block;
  width: 0; height: 0;
  margin-left: 4px;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid var(--acc);
  vertical-align: 2px;
}
.reit-table thead th.is-sorted.asc::after {
  border-top: none;
  border-bottom: 4px solid var(--acc);
  vertical-align: 1px;
}

/* Sticky Name column — stays visible during horizontal scroll.
   z-index layering (critical): the Name HEADER is the top-left corner and must sit above
   BOTH the other headers (z-index 10) and the scrolling body sticky-cells, otherwise body
   Name cells (same z-index) paint over the header as you scroll down and it looks like the
   header isn't pinned. So: corner header = 12, other headers = 10, body sticky cells = 4. */
.reit-table thead th.is-sticky,
.reit-table tbody td.is-sticky {
  position: sticky;
  left: 0;
  box-shadow: 1px 0 0 var(--line);
}
.reit-table thead th.is-sticky {
  background: var(--ink-2);
  z-index: 12;            /* above other sticky headers (10) and all body cells */
}
.reit-table tbody td.is-sticky {
  background: var(--ink-1);
  z-index: 4;             /* above normal body cells (0), below the header row */
}
.reit-table tbody tr:hover td.is-sticky { background: var(--ink-3); }
.reit-table tbody tr.is-active td.is-sticky { background: var(--ink-4); }

.reit-table tbody tr {
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 70ms;
}
.reit-table tbody tr:hover { background: var(--ink-3); }
.reit-table tbody tr.is-active { background: var(--ink-4); }
.reit-table tbody tr:focus-visible { background: var(--ink-3); outline: 2px solid var(--acc); outline-offset: -2px; }

.reit-table tbody td {
  padding: 9px 8px;      /* matches the header's tight horizontal padding */
  vertical-align: middle;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  /* Fixed layout: truncate any overflow with an ellipsis rather than overflowing the cell. */
  overflow: hidden;
  text-overflow: ellipsis;
}
.reit-table tbody td.num {
  text-align: right;
  color: var(--text-0);
}
.reit-table tbody td.name {
  font-family: var(--font-sans);
  color: var(--text-0);
  font-size: 12.5px;
}
.reit-table tbody td.tick {
  font-weight: 700;
  color: var(--text-0);
}
.reit-table tbody td.geo {
  color: var(--text-2);
  font-size: 10.5px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Flexible filler column: an empty trailing column that soaks up leftover horizontal space so
   the header underline and row backgrounds run edge-to-edge when the real columns don't fill the
   viewport. It carries no inline width, so table-layout:fixed hands it all the slack; once the
   real columns overflow the viewport it collapses to zero. It inherits the header/body cell
   background + bottom border, so the head bar and row stripes simply extend into it. */
.reit-table thead th.th-filler { cursor: default; padding: 0; }
.reit-table thead th.th-filler:hover { color: var(--text-2); }
.reit-table tbody td.td-filler { padding: 0; }

.muted { color: var(--text-3); }
.miss { color: var(--text-4); font-style: italic; }

/* Currency badge */
.ccy {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  color: var(--text-2);
  padding: 0 4px;
  margin-left: 4px;
  border: 1px solid var(--line);
  border-radius: 2px;
  vertical-align: 1px;
  background: transparent;
}
.ccy--USD { color: #9BC6E0; border-color: #2F4D62; }
.ccy--GBP { color: #C99BD8; border-color: #4E2E58; }
.ccy--EUR { color: #A6CF96; border-color: #2F4F2F; }
.ccy--SGD { color: var(--text-3); border-color: var(--line); }

/* Sector chip */
.sector-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 1px;
  font-weight: 500;
  background: rgba(255,255,255,0.025);
  border: 1px solid;
}
.sector-chip[data-sector="Industrial"]  { color: var(--sec-industrial);  border-color: rgba(125, 168, 159, 0.35); }
.sector-chip[data-sector="Office"]      { color: var(--sec-office);      border-color: rgba(180, 155, 200, 0.35); }
.sector-chip[data-sector="Retail"]      { color: var(--sec-retail);      border-color: rgba(213, 162, 107, 0.35); }
.sector-chip[data-sector="Hospitality"] { color: var(--sec-hospitality); border-color: rgba(212, 130, 138, 0.35); }
.sector-chip[data-sector="Healthcare"]  { color: var(--sec-healthcare);  border-color: rgba(176, 199, 107, 0.35); }
.sector-chip[data-sector="Data Centre"] { color: var(--sec-datacentre);  border-color: rgba(123, 175, 212, 0.35); }
.sector-chip[data-sector="Diversified"] { color: var(--sec-diversified); border-color: rgba(176, 165, 128, 0.35); }

.qual {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px;
}
.qual__bar {
  display: inline-block;
  width: 52px; height: 6px;
  background: var(--ink-3);
  box-shadow: inset 0 0 0 1px var(--line);
  position: relative;
}
.qual__fill { position: absolute; left: 0; top: 0; bottom: 0; }
.qual--strong  .qual__fill { background: var(--q-strong); }
.qual--healthy .qual__fill { background: var(--q-healthy); }
.qual--caution .qual__fill { background: var(--q-caution); }
.qual--stress  .qual__fill { background: var(--q-stress); }
.qual--null .qual__fill { background: var(--text-4); }
.qual--strong  .qual__val { color: var(--q-strong); }
.qual--healthy .qual__val { color: var(--q-healthy); }
.qual--caution .qual__val { color: var(--q-caution); }
.qual--stress  .qual__val { color: var(--q-stress); }
.qual--null    .qual__val { color: var(--text-4); }
.qual__val { min-width: 22px; text-align: right; display: inline-block; }

.screen-mark {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
}
.screen-mark--pass { background: var(--q-strong); box-shadow: 0 0 6px rgba(110,192,158,0.6); }
.screen-mark--fail { background: transparent; border: 1px solid var(--text-4); }

.footnote {
  padding: 18px 32px 32px;
  border-top: 1px solid var(--line);   /* frame the notes so the 78ch reading measure reads as deliberate, not a void */
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-2);
  max-width: 78ch;
  line-height: 1.55;
}
.footnote p { margin: 0 0 8px; }
.footnote em { color: var(--text-1); }
.footnote strong { color: var(--text-0); font-weight: 600; }

/* =====================  DRAWER & MODAL  ===================== */
.drawer, .modal { position: fixed; inset: 0; z-index: 80; }
.drawer__scrim, .modal__scrim {
  position: absolute; inset: 0;
  background: rgba(8, 8, 12, 0.65);
  backdrop-filter: blur(2px);
  animation: fade-in 160ms ease both;
}
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(680px, 96vw);
  background: var(--ink-1);
  border-left: 1px solid var(--line-2);
  box-shadow: var(--shadow-drawer);
  overflow-y: auto;
  animation: slide-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.drawer__panel:focus { outline: none; }
.drawer__close, .modal__close {
  position: sticky; top: 12px; left: 100%; transform: translateX(-44px);
  width: 32px; height: 32px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  color: var(--text-0);
  font-size: 20px; line-height: 1;
  cursor: pointer;
  font-family: var(--font-mono);
  z-index: 20;
}
.drawer__close:hover, .modal__close:hover { background: var(--ink-4); border-color: var(--acc); }
.drawer__content { padding: 8px 36px 60px; }

.modal__panel {
  position: absolute;
  top: 6vh; left: 50%; transform: translateX(-50%);
  width: min(820px, 94vw);
  max-height: 88vh;
  background: var(--ink-1);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-modal);
  overflow-y: auto;
  animation: modal-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.modal__panel:focus { outline: none; }
.modal__content { padding: 28px 36px 40px; }
.modal__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: 'opsz' 144;
  font-size: 32px;
  letter-spacing: -0.02em;
  color: var(--text-0);
  margin: 0 0 14px;
}
.modal__lead {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-1);
  line-height: 1.6;
  margin: 0 0 16px;
}
.modal__intro {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0 0 12px;
  padding: 12px 14px;
  background: rgba(79,211,184,0.05);
  border-left: 2px solid var(--acc);
}
.modal__intro strong, .modal__intro em { color: var(--text-1); }
.modal__actions { margin-top: 16px; display: flex; gap: 8px; }
.modal__actions button {
  background: var(--ink-3);
  border: 1px solid var(--line);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 14px;
  cursor: pointer;
}
.modal__actions button:hover { border-color: var(--acc); color: var(--text-0); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes modal-in { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .drawer__scrim, .drawer__panel, .modal__scrim, .modal__panel, .colpop { animation: none; }
}

.dh {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 144;
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.02em;
  color: var(--text-0);
  line-height: 1.05;
}
.dh small {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
  font-weight: 400;
}
.dh small .ccy { margin-left: 8px; vertical-align: 1px; }
.d-sub {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-2);
  margin-bottom: 18px;
  letter-spacing: 0.02em;
  line-height: 1.45;
}
.d-sub strong { color: var(--text-1); font-weight: 600; }

.d-section {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--acc);
  margin: 26px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
}
.metric {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.metric:nth-child(2n) { border-right: none; }
.metric--wide { grid-column: span 2; border-right: none; }
.metric__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
  font-weight: 500;
}
.metric__label.has-tip { border-bottom: 1px dotted var(--text-4); cursor: help; }
.metric__val {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--text-0);
  font-weight: 500;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.metric__val small { font-size: 11px; color: var(--text-3); font-weight: 400; margin-left: 4px; }
.metric__val.miss { color: var(--text-4); font-style: italic; font-size: 13px; }
.metric__val--prose { font-family: var(--font-sans); font-size: 12.5px; line-height: 1.5; font-weight: 400; }
.metric__src {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-3);
  border-bottom: none;
}
.metric__src:hover { color: var(--acc); }
.metric__src--warn { color: var(--q-caution); }
.metric__src--warn:hover { color: var(--q-stress); }
.metric__note {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--q-caution);
  font-style: italic;
  line-height: 1.3;
}
.metric__threshold {
  display: inline-block;
  margin-left: 8px;
  font-size: 9.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  padding: 1px 6px;
  text-transform: uppercase;
  color: var(--ink-0);
  font-weight: 600;
}
.metric__threshold--strong  { background: var(--q-strong); }
.metric__threshold--healthy { background: var(--q-healthy); }
.metric__threshold--caution { background: var(--q-caution); }
.metric__threshold--stress  { background: var(--q-stress); }

/* Sparkline */
.spark {
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: 14px 16px 10px;
}
.spark__title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.spark svg { display: block; width: 100%; height: 140px; }
.spark__path { fill: none; stroke: var(--acc); stroke-width: 1.75; stroke-linejoin: round; }
.spark__area { fill: rgba(79,211,184,0.13); stroke: none; }
.spark__hi, .spark__lo { fill: var(--text-2); font-family: var(--font-mono); font-size: 10px; }
.spark__base { stroke: var(--line-2); stroke-width: 0.75; stroke-dasharray: 1 3; }

/* Score block */
.score-block {
  display: grid;
  grid-template-columns: 120px 1fr 50px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.score-block .l {
  color: var(--text-2);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  display: flex; gap: 6px; align-items: baseline;
}
.score-block .conf { font-size: 9px; color: var(--text-4); letter-spacing: 0.03em; }
.score-block .bar { background: var(--ink-3); height: 6px; position: relative; box-shadow: inset 0 0 0 1px var(--line); }
.score-block .bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--text-2); }
.score-block .v { text-align: right; color: var(--text-0); }
.score-block .v.miss { color: var(--text-4); font-style: italic; }
.score-block--composite {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.score-block--composite .l { color: var(--acc); font-weight: 700; }
.score-block--composite .v { color: var(--acc); font-weight: 700; font-size: 15px; }
.score-block--composite .bar > i { background: var(--acc); }

.score-caveat {
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.55;
  padding: 12px 14px;
  margin-top: 12px;
  border: 1px dashed var(--line);
  background: rgba(255,255,255,0.015);
}

.src-list {
  font-family: var(--font-mono);
  font-size: 11.5px;
  list-style: none;
  padding: 0; margin: 8px 0 0;
  border: 1px solid var(--line);
  background: var(--ink-2);
}
.src-list li {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: space-between; align-items: baseline;
  word-break: break-all;
}
.src-list li:last-child { border-bottom: none; }
.src-list .key { color: var(--text-3); text-transform: uppercase; font-size: 9.5px; letter-spacing: 0.06em; white-space: nowrap; }

.d-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.pill {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 3px 8px;
  background: var(--ink-3); color: var(--text-1); border: 1px solid var(--line);
}
.pill--pass { background: rgba(110,192,158,0.15); color: var(--q-strong); border-color: rgba(110,192,158,0.4); }
.pill--fail { background: var(--ink-3); color: var(--text-3); }
.pill--btn { cursor: pointer; background: transparent; border-color: var(--text-4); color: var(--text-2); margin-left: auto; }
.pill--btn:hover { color: var(--text-0); border-color: var(--acc); }

.geo-bar {
  display: flex; height: 14px; width: 100%; overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-3);
  margin-top: 8px;
}
.geo-seg { height: 100%; position: relative; }
.geo-seg + .geo-seg { border-left: 1px solid var(--ink-1); }
.geo-legend {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-1);
  margin-top: 8px;
  display: grid; grid-template-columns: 1fr auto;
  row-gap: 3px; column-gap: 12px;
  font-variant-numeric: tabular-nums;
}
.geo-legend .lk { color: var(--text-2); }
.geo-legend .lv { color: var(--text-0); }

/* Colophon */
.colophon {
  padding: 24px 32px 32px;            /* horizontal gutter unified with masthead/controls/table */
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--text-3);
  display: flex; justify-content: space-between; gap: 20px;
  flex-wrap: wrap;
}
.colophon em { color: var(--acc); font-style: italic; font-family: var(--font-display); }
.colophon a { color: var(--text-2); border-bottom-style: dotted; }
.colophon a:hover { color: var(--acc); }

.empty {
  padding: 60px 40px;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--text-3);
}

/* =====================  RENDERED MARKDOWN (Methodology / Playbook)  ===================== */
.md-body { font-family: var(--font-sans); font-size: 13px; color: var(--text-1); line-height: 1.6; }
.md-loading { color: var(--text-3); font-style: italic; }
.md-h { font-family: var(--font-display); color: var(--text-0); letter-spacing: -0.01em; line-height: 1.15; }
.md-h1 { font-size: 26px; margin: 8px 0 12px; }
.md-h2 { font-size: 21px; color: var(--acc); margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.md-h3 { font-size: 16px; margin: 18px 0 8px; }
.md-h4 { font-size: 14px; margin: 14px 0 6px; color: var(--text-1); }
.md-body p { margin: 8px 0; }
.md-body strong { color: var(--text-0); font-weight: 600; }
.md-body a { color: var(--acc); }
.md-body code { font-family: var(--font-mono); font-size: 11.5px; background: var(--ink-3); border: 1px solid var(--line); padding: 1px 5px; border-radius: 2px; color: var(--text-0); }
.md-pre { background: var(--ink-2); border: 1px solid var(--line); padding: 12px 14px; overflow-x: auto; border-radius: 3px; }
.md-pre code { background: none; border: none; padding: 0; font-size: 11.5px; line-height: 1.5; color: var(--text-1); }
.md-list { margin: 8px 0 8px 4px; padding-left: 20px; }
.md-list li { margin: 4px 0; }
.md-quote { border-left: 2px solid var(--acc); background: rgba(79,211,184,0.05); margin: 10px 0; padding: 8px 14px; color: var(--text-2); }
.md-hr { border: none; border-top: 1px dashed var(--line); margin: 20px 0; }
.md-table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 12px; font-variant-numeric: tabular-nums; display: block; overflow-x: auto; }
.md-table th, .md-table td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.md-table th { background: var(--ink-2); color: var(--text-1); font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.md-table td { color: var(--text-1); }
.md-table tr:nth-child(even) td { background: rgba(255,255,255,0.015); }

/* =====================  HELP MODAL CONTENT  ===================== */
.help-section {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--acc);
  margin: 28px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.help-entry {
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.help-entry h3 {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-0);
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}
.help-abbr { color: var(--text-3); font-weight: 400; }
.help-entry p {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.55;
  margin: 4px 0;
}
.help-entry strong { color: var(--text-1); font-weight: 600; }
.help-entry code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  padding: 1px 5px;
  color: var(--text-0);
}

/* Columns modal — single column so drag-reordering reads top-to-bottom like the table. */
.col-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.col-toggle {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-1);
}
.col-toggle:hover { border-color: var(--acc); color: var(--text-0); }
.col-toggle input { margin: 0; cursor: pointer; }
.col-toggle__name { font-weight: 600; cursor: pointer; }
.col-grip { cursor: grab; color: var(--text-3); letter-spacing: -2px; user-select: none; }
.col-grip:active { cursor: grabbing; }
.col-toggle.is-dragging { opacity: 0.45; border-color: var(--acc); }
.col-toggle.is-dragover { box-shadow: inset 0 2px 0 var(--acc); }
.col-move { display: inline-flex; gap: 2px; }
.col-move__btn {
  background: var(--ink-2); border: 1px solid var(--line); color: var(--text-2);
  width: 20px; height: 20px; line-height: 1; cursor: pointer; font-size: 11px; padding: 0;
}
.col-move__btn:hover:not(:disabled) { color: var(--text-0); border-color: var(--acc); }
.col-move__btn:disabled { opacity: 0.3; cursor: default; }
.col-toggle__hint {
  grid-column: 1 / -1;
  font-family: var(--font-sans);
  font-size: 10.5px;
  color: var(--text-3);
  line-height: 1.3;
  /* Clamp to 2 lines so cards stay uniform; full text is in the hover tooltip / Help page. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Inline text-button used in modal lead copy (e.g. "open the Help page"). */
.link-btn {
  background: none; border: none; padding: 0;
  color: var(--acc); cursor: pointer;
  font: inherit; text-decoration: none; border-bottom: 1px dotted var(--acc-soft);
}
.link-btn:hover { color: var(--acc-bright); border-bottom-color: var(--acc-bright); }

/* Hidden REITs modal */
.hidden-list { list-style: none; padding: 0; margin: 0; }
.hidden-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-1);
  align-items: center;
}
.hidden-item strong { color: var(--text-0); }
.hidden-item span { color: var(--text-2); font-family: var(--font-sans); }
.hidden-item button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 3px 8px;
  cursor: pointer;
}
.hidden-item button:hover { border-color: var(--acc); color: var(--text-0); }

.cli {
  background: var(--ink-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-1);
  padding: 12px;
  overflow-x: auto;
}

/* ===================== COLUMN FILTER + SORT POPOVER ===================== */
.colpop {
  position: fixed;
  z-index: 190;
  width: 280px; max-width: 92vw;
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  box-shadow: 0 12px 40px rgba(0,0,0,0.55);
  border-radius: 4px;
  padding: 0 0 12px;
  font-family: var(--font-mono);
  animation: pop-in 120ms ease both;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.colpop__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.colpop__title { font-size: 12px; font-weight: 600; color: var(--text-0); text-transform: uppercase; letter-spacing: 0.06em; }
.colpop__x { background: none; border: none; color: var(--text-2); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.colpop__x:hover { color: var(--text-0); }
.colpop__what { padding: 8px 12px 0; font-family: var(--font-sans); font-size: 11px; color: var(--text-3); line-height: 1.4; }
.colpop__sec { padding: 10px 12px 0; }
.colpop__sublabel {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 7px;
}
.colpop__rangeval { color: var(--acc); text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.colpop__sort { display: flex; gap: 6px; }
.colpop__sortbtn {
  flex: 1; background: var(--ink-3); border: 1px solid var(--line); color: var(--text-1);
  font-family: var(--font-mono); font-size: 11px; padding: 6px 8px; cursor: pointer;
  transition: color 80ms, border-color 80ms, background 80ms;
}
.colpop__sortbtn:hover { color: var(--text-0); border-color: var(--line-2); }
.colpop__sortbtn.is-active { background: var(--acc-deeper); border-color: var(--acc); color: var(--acc-bright); }
.colpop__clear {
  background: none; border: none; color: var(--text-2); cursor: pointer;
  font-family: var(--font-mono); font-size: 10.5px; text-decoration: underline; padding: 0;
}
.colpop__clear:hover { color: var(--q-stress); }
.colpop__hint { font-family: var(--font-sans); font-size: 11px; color: var(--text-3); line-height: 1.4; }
.colpop .dual { margin-top: 4px; }

/* Multi-level sort rank badge on a header */
.sort-rank {
  display: inline-block; margin-left: 2px;
  font-size: 7.5px; vertical-align: super; color: var(--acc); font-weight: 700;
}
/* Faint default-sort arrow (Market cap on first load, before the user sorts anything). */
.reit-table thead th.is-default-sort::after { border-top-color: var(--text-3); }

/* =====================  CONTEXT MENU  ===================== */
.ctx-menu {
  position: fixed;
  list-style: none;
  margin: 0; padding: 4px 0;
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 200;
  min-width: 200px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.ctx-item, .ctx-item a {
  display: block;
  padding: 6px 12px;
  color: var(--text-1);
  text-decoration: none;
  border-bottom: none;
  cursor: pointer;
}
.ctx-item:hover, .ctx-item:hover a,
.ctx-item:focus, .ctx-item:focus a { background: var(--acc-deeper); color: var(--text-0); outline: none; }
.ctx-item:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
.ctx-item a:hover { color: var(--acc-bright); }
.ctx-item.is-disabled { color: var(--text-4); font-style: italic; cursor: default; }
.ctx-item.is-disabled:hover { background: transparent; }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 0; }

/* =====================  TOOLTIP  ===================== */
.tooltip {
  position: fixed;
  z-index: 220;
  max-width: 360px;
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-1);
  line-height: 1.5;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  pointer-events: none;
}
.tooltip__title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--acc);
  margin-bottom: 6px;
}
.tooltip__title small { color: var(--text-3); }
.tooltip__what { margin-bottom: 6px; }
.tooltip__why { margin-bottom: 6px; color: var(--text-2); }
.tooltip__healthy { margin-bottom: 6px; color: var(--text-2); font-size: 11px; }
.tooltip__why strong, .tooltip__healthy strong { color: var(--text-1); }
.tooltip__more {
  font-size: 10px; font-family: var(--font-mono);
  color: var(--text-4); margin-top: 6px;
  border-top: 1px solid var(--line); padding-top: 6px;
}

/* =====================  RESPONSIVE  ===================== */
@media (max-width: 900px) {
  .masthead {
    grid-template-columns: 1fr;
    padding: 20px 16px;
    gap: 16px;
  }
  .masthead__actions { grid-row: auto; grid-column: 1; flex-wrap: wrap; }
  .masthead__meta { grid-row: auto; grid-column: 1; }
  .masthead__name h1 { font-size: 28px; }
  .controls { padding: 12px 16px 10px; }
  .table-meta { padding: 12px 16px; }
  .footnote { padding: 16px; font-size: 11.5px; }
  .colophon { padding: 16px; flex-direction: column; gap: 8px; }
  .drawer__panel { width: 100vw; }
  .drawer__content { padding: 8px 18px 60px; }
  .drawer__close, .modal__close { left: auto; transform: none; right: 12px; }
  .modal__panel { width: 96vw; top: 4vh; max-height: 92vh; }
  .modal__content { padding: 18px; }
  .col-toggle-list { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .metric:nth-child(2n) { border-right: 1px solid var(--line); }
  .metric { border-right: 1px solid var(--line); }
}

/* Narrow phones: stack the top controls cleanly (search row · currency row · resets row)
   instead of letting the reset buttons wrap mid-line next to the currency chips. */
@media (max-width: 560px) {
  .controls { gap: 10px 12px; }
  .controls__field { width: 100%; }
  .controls__field input[type=search] { width: 100%; max-width: none; }
  .controls__reset { margin-left: 0; flex: 1 1 0; text-align: center; }
  /* Centre the column popover as a near-full-width band so it never sits awkwardly off to
     one side over a horizontally-scrolled table. Uses left/right (not translateX) so the
     pop-in transform animation isn't clobbered. */
  .colpop { left: 4vw !important; right: 4vw !important; width: auto !important; max-width: none; }
}

@media (max-width: 480px) {
  .masthead { padding: 16px 12px; }
  .masthead__name h1 { font-size: 24px; }
  .action-btn { font-size: 10px; padding: 6px 10px; }
}

/* Print */
@media print {
  .drawer, .modal, .masthead__actions, .masthead__meta, .controls, .table-meta .hint, .colophon, .ctx-menu, .tooltip, .colpop, .hbar, .float-head { display: none !important; }
  html, body, .reit-table { background: white; color: black; }
  .reit-table thead th { position: static; background: white; color: black; }
  .reit-table tbody td { color: black; }
  .table-wrap { background: white; }
}
