:root {
  --paper: #f3efe6;
  --paper-2: #fffcf6;
  --ink: #1b2430;
  --muted: #5c6572;
  --line: #e2d8c8;
  --line-strong: #cfc3b0;
  --navy: #1a2c45;
  --navy-2: #243654;
  --copper: #8a4630;
  --copper-deep: #6d3524;
  --cream: #f6f1e7;
  --good: #1c6842;
  --good-bg: #e5f2ea;
  --mid: #8a5a10;
  --mid-bg: #f8efd8;
  --poor: #8d3030;
  --poor-bg: #f8e6e4;
  --neutral-bg: #ece7de;
  --shadow: 0 1px 0 rgba(26, 44, 69, 0.04);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
}
img { max-width: 100%; }
a { color: var(--copper-deep); }
a:hover { color: var(--navy); }
:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: white;
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus { top: 12px; }

.site-header {
  background: var(--navy);
  color: var(--cream);
}
.as-of {
  margin: 0;
  padding: 10px 16px;
  background: #efe2d4;
  color: var(--navy);
  text-align: center;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.site-header a { color: inherit; text-decoration: none; }
.header-inner, .footer-inner, .wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}
.brand img { width: 34px; height: 34px; display: block; }
.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--cream);
}
.brand-text > span {
  display: block;
  color: #d9cfc0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.cell.ticker {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--paper-2);
}
.row:hover .cell.ticker,
.row.selected .cell.ticker { background: #f7f1e6; }
.colhead button[data-sort="ticker"] {
  position: sticky;
  left: 0;
  z-index: 4;
  background: #efe6d8;
}
.nav { display: flex; gap: 18px; align-items: center; }
.nav a { font-size: 0.95rem; }
.nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.support, .button, button.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  background: var(--copper);
  color: white;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.site-header .support {
  background: var(--cream);
  color: var(--navy);
}
.site-header .support:hover { background: white; color: var(--navy); }
.button:hover, button.primary:hover { background: var(--copper-deep); color: white; }
button.quiet, .quiet {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--line-strong);
}
button.quiet:hover { background: white; }

.wrap { padding: 28px 0 64px; }
.narrow { width: min(760px, 100%); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 4vw, 3.3rem); margin: 0 0 12px; }
h2 { font-size: 1.7rem; margin: 0 0 8px; }
h3 { font-size: 1.15rem; margin: 0 0 6px; }
.lead { font-size: 1.15rem; margin-top: 0; }
.muted { color: var(--muted); }
.eyebrow {
  margin: 0 0 8px;
  color: var(--copper-deep);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.callout {
  background: #fff8ef;
  border: 1px solid #ead7bf;
  border-left: 4px solid var(--copper);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 22px 0;
}
.callout h2 { font-size: 1.2rem; }
.callout p:last-child { margin-bottom: 0; }

.home-search { margin: 22px 0 8px; }
.home-search label { display: block; font-weight: 650; margin-bottom: 8px; }
.search-row, .filter-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.home-search input { flex: 1 1 220px; }
input, select {
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  min-height: 44px;
  padding: 8px 12px;
}
.library-count { margin-top: 8px; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin: 36px 0;
}
.spec { margin: 0; }
.spec div { padding: 10px 0; border-top: 1px solid var(--line); }
.spec dt { font-weight: 650; }
.spec dd { margin: 2px 0 0; color: var(--muted); }

.support-band {
  background: #efe2d4;
  border-radius: 16px;
  padding: 22px 22px 18px;
  margin: 12px 0 36px;
}
.support-band p { max-width: 62ch; }

.disclaimer { font-size: 0.92rem; color: #3c4654; }
.disclaimer h2 { font-size: 1.45rem; color: var(--ink); }
.disclaimer h3 { font-size: 1.02rem; margin-top: 18px; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px 0 36px;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--navy); }

.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.banner {
  background: #fff4e8;
  border: 1px solid #e7d0b0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.filters {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  margin-bottom: 8px;
}
.field { min-width: 0; }
.field label, .sort-mobile label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.field-wide { grid-column: span 1; }
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0;
}
.clear-all { margin-left: auto; }
.clear-all[hidden] { display: none !important; }
.toolbar p { margin: 0; }
#count { font-variant-numeric: tabular-nums; font-weight: 650; }

.detail {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  border-radius: 12px;
  padding: 14px 16px 8px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.detail { position: relative; }
.detail-close {
  position: absolute; top: 10px; right: 12px;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; font: inherit; font-size: 0.85rem; color: var(--navy); cursor: pointer;
}
.detail-close:hover { background: var(--navy); color: white; }
.detail h2 { font-size: 1.45rem; padding-right: 90px; }
.detail-rating { display: flex; gap: 8px; align-items: center; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px 16px;
  margin: 12px 0;
}
.metric-grid div { margin: 0; }
.metric-grid dt { color: var(--muted); font-size: 0.82rem; }
.metric-grid dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 650; }
.pdf-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--navy);
  color: white;
  text-decoration: none;
}
.pdf-button:hover { background: var(--navy-2); color: white; }
.warn { color: var(--poor); }

.scroller {
  overflow: auto;
  max-height: min(70vh, 820px);
  min-height: 420px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
}
.colhead, .row {
  display: grid;
  grid-template-columns: 72px minmax(160px, 1.8fr) 112px 120px 96px 104px 88px 80px 80px 48px;
  column-gap: 8px;
  align-items: center;
  min-width: 1000px;
  padding: 0 8px;
}
.colhead {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 44px;
  background: #efe6d8;
  border-bottom: 1px solid var(--line);
}
.colhead button {
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  min-height: 44px;
}
.colhead button.num, .cell.num { text-align: right; }
.colhead button[aria-sort="ascending"]::after { content: " \2191"; color: var(--ink); }
.colhead button[aria-sort="descending"]::after { content: " \2193"; color: var(--ink); }
.colhead button:hover { color: var(--ink); }
.row {
  height: 48px;
  border-bottom: 1px solid #f0e9de;
  cursor: pointer;
  background: var(--paper-2);
}
.row:hover, .row.selected { background: #f7f1e6; }
.cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell.ticker { font-weight: 750; letter-spacing: 0.02em; }
.cell.num, .rating-num { font-variant-numeric: tabular-nums; }
.rating { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bar {
  display: block;
  height: 4px;
  background: #e6dfd3;
  border-radius: 99px;
  overflow: hidden;
}
.bar span { display: block; height: 100%; background: var(--mid); }
.bar.good span { background: var(--good); }
.bar.poor span { background: var(--poor); }
.bar.neutral span { background: #8d93a0; }
.chip {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--neutral-bg);
  font-size: 0.82rem;
  white-space: nowrap;
}
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.mid { background: var(--mid-bg); color: var(--mid); }
.chip.poor { background: var(--poor-bg); color: var(--poor); }
.flag {
  display: inline-block;
  margin-left: 4px;
  color: var(--poor);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0;
}
a.pdf {
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}
.empty, .status {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}
.sort-mobile { display: none; }

@media (max-width: 860px) {
  .toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .clear-all { width: 100%; margin-left: 0; }
  .split { grid-template-columns: 1fr; gap: 8px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .sort-mobile { display: block; margin-bottom: 10px; }
  .colhead { display: none; }
  .scroller { min-height: 68vh; }
  .card-row {
    box-sizing: border-box;
    height: 156px;
  }
  .card-row.selected { background: #f7f1e6; }
  .card-row {
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--line);
    background: var(--paper-2);
  }
  .card-top, .card-bottom, .card-metrics {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
  }
  .card-top strong { font-size: 1.05rem; letter-spacing: 0.03em; }
  .card-company {
    margin: 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .card-metrics { color: var(--muted); font-size: 0.86rem; flex-wrap: wrap; justify-content: flex-start; }
  .card-bottom { margin-top: 6px; font-size: 0.9rem; }
}
@media (max-width: 640px) {
  .header-inner { padding: 12px 0; }
  .nav { order: 3; width: 100%; gap: 16px; }
  .brand { margin-right: 0; }
  .support { margin-left: auto; }
  .filters { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
  .wrap { width: min(1120px, calc(100% - 24px)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Data quality note */
.data-note {
  border-left: 4px solid #c98a1a;
  background: #fdf7ec;
  padding: 0.9rem 1.1rem;
  border-radius: 6px;
  margin: 1.2rem 0;
}
.data-note h2 { font-size: 1.1rem; margin: 0 0 0.4rem; }
.data-note p { margin: 0; }
.data-note.compact { font-size: 0.95rem; }
.footer-note { font-size: 0.85rem; opacity: 0.85; }

/* Top-of-page data banner */
.data-banner {
  background: #fff4d6;
  border-bottom: 3px solid #c98a1a;
  border-top: 3px solid #c98a1a;
  color: #3a2a00;
}
.data-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  line-height: 1.5;
}
.data-banner-title {
  font-weight: 800;
  font-size: 1.3rem;
  margin: 0 0 0.35rem;
}
.data-banner-inner p:last-child { margin: 0; }
@media (max-width: 600px) {
  .data-banner-inner { font-size: 1rem; }
  .data-banner-title { font-size: 1.15rem; }
}

