/* Governance Leaderboard — warm paper theme consistent with gsl-site */
:root {
  --paper: #faf8f3;
  --card: #fdfcf8;
  --ink: #1d1a15;
  --ink-soft: #5c5344;
  --ink-faint: #8a8071;
  --line: #e4dcc9;
  --line-strong: #d8cdb2;
  --gold: #8a6a16;
  --gold-soft: #efe6cc;
  --s9: #1a7f37;
  --s7: #3f8f3a;
  --s5: #9a7b1f;
  --s3: #c05621;
  --s1: #b3261e;
  --s-miss: #a9a193;
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-family: 'Newsreader', Georgia, serif;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-head { padding: 56px 0 8px; }
.eyebrow {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
h1 {
  font-weight: 600;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 12px 0 0;
}
.deck {
  font-style: italic;
  font-size: clamp(16px, 2.4vw, 20px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 620px;
  margin: 14px 0 0;
}

/* ---------- toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 34px 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}
.toolbar .meta {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  flex: 1;
  min-width: 180px;
}
.toolbar .meta b { color: var(--ink-soft); font-weight: 600; }
.btn {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid transparent;
  border-radius: 99px;
  padding: 6px 14px;
  cursor: pointer;
}
.btn:hover { border-color: var(--line-strong); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.sort-strip { display: none; } /* mobile only */

/* ---------- table ---------- */
.table-scroll { overflow-x: auto; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.lb-table { border-collapse: collapse; width: 100%; min-width: 1500px; font-size: 15px; }
.lb-table th, .lb-table td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: center; }
.lb-table thead th { background: var(--card); position: sticky; top: 0; z-index: 2; }
.lb-table thead tr.cat-row th {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid var(--line-strong);
  padding: 7px 10px 5px;
}
.lb-table thead tr.metric-row th {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  padding: 6px 6px 8px;
  border-bottom: 1px solid var(--line-strong);
}
.lb-table thead tr.metric-row th.sortable { cursor: pointer; user-select: none; }
.lb-table thead tr.metric-row th.sortable:hover { background: var(--gold-soft); color: var(--gold); }
.lb-table thead tr.metric-row th.active { background: var(--gold-soft); color: var(--gold); }
.lb-table thead tr.metric-row th .arrow { font-size: 9px; margin-left: 2px; }

.lb-table td.company { text-align: left; min-width: 150px; }
.lb-table td.company a { display: block; font-weight: 600; font-size: 15.5px; color: var(--ink); }
.lb-table td.company a:hover { color: var(--gold); text-decoration: none; }
.lb-table td.company .ticker { font-family: ui-monospace, Menlo, monospace; font-size: 11px; letter-spacing: 0.12em; color: var(--ink-faint); }
.lb-table td.company .read { font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; color: var(--gold); }
.lb-table tr:hover td { background: #f6f2e7; }
.lb-table tr:hover td.company { background: #f6f2e7; }

/* ---------- score chips ---------- */
.score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13.5px;
  font-weight: 700;
  cursor: default;
  background: #eeeae0;
  color: var(--ink-soft);
}
button.score { cursor: pointer; }
button.score:hover, button.score:focus-visible { outline: 2px solid var(--ink-soft); outline-offset: 1px; }
.score.s9  { background: #e3f2e6; color: var(--s9); }
.score.s8  { background: #e3f2e6; color: var(--s9); }
.score.s7  { background: #e8f3e0; color: var(--s7); }
.score.s6  { background: #f6eed2; color: var(--s5); }
.score.s5  { background: #f6eed2; color: var(--s5); }
.score.s4  { background: #fbe7d9; color: var(--s3); }
.score.s3  { background: #fbe7d9; color: var(--s3); }
.score.s2  { background: #f9dedb; color: var(--s1); }
.score.s1  { background: #f9dedb; color: var(--s1); }
.score.missing { background: transparent; color: var(--s-miss); border: 1px dashed var(--line-strong); cursor: default; }
.score.overall { min-width: 36px; height: 34px; font-size: 15px; }

/* ---------- mobile cards ---------- */
.m-list { display: none; margin-top: 14px; }

@media (max-width: 760px) {
  .table-scroll { display: none; }
  .m-list { display: block; }
  .sort-strip {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 24px 0 12px; padding: 12px 14px;
    border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  }
  .sort-strip label {
    font-family: ui-monospace, Menlo, monospace; font-size: 11px;
    letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint);
  }
  .sort-strip select {
    flex: 1; min-width: 0; font: 600 13px/1.3 ui-monospace, Menlo, monospace;
    color: var(--ink); background: #fff; border: 1px solid var(--line-strong);
    border-radius: 6px; padding: 7px 8px;
  }
}

.m-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  margin-bottom: 12px;
  overflow: hidden;
}
.m-card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer;
}
.m-card-head:active { background: #f6f2e7; }
.m-rank {
  font-family: ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 700;
  color: var(--gold); background: var(--gold-soft);
  border-radius: 6px; padding: 3px 7px; flex-shrink: 0;
}
.m-title { flex: 1; min-width: 0; }
.m-name { display: block; font-weight: 600; font-size: 17.5px; line-height: 1.2; }
.m-ticker { font-family: ui-monospace, Menlo, monospace; font-size: 11px; letter-spacing: 0.14em; color: var(--ink-faint); }
.m-arrow { color: var(--gold); font-size: 16px; flex-shrink: 0; }

.m-sortline {
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px 12px;
  font-family: ui-monospace, Menlo, monospace; font-size: 11px;
  color: var(--ink-faint); letter-spacing: 0.04em;
}
.m-sortline .score { min-width: 26px; height: 26px; font-size: 12px; }

.m-expand {
  width: 100%; text-align: left; font: inherit;
  background: #f4efe2; border: 0; border-top: 1px solid var(--line);
  padding: 10px 16px; cursor: pointer;
  font-family: ui-monospace, Menlo, monospace; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold);
  display: flex; justify-content: space-between; align-items: center;
}
.m-expand:hover { background: var(--gold-soft); }

.m-scores { padding: 4px 16px 14px; border-top: 1px solid var(--line); display: none; }
.m-card.open .m-scores { display: block; }
.m-cat {
  font-family: ui-monospace, Menlo, monospace; font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold);
  margin: 14px 0 6px;
}
.m-cat:first-child { margin-top: 12px; }
.m-metric {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 8px 2px; font: 400 15.5px/1.25 'Newsreader', Georgia, serif; color: var(--ink);
  cursor: pointer;
}
.m-metric:active { background: #f6f2e7; }
.m-metric .score { min-width: 26px; height: 26px; font-size: 12px; flex-shrink: 0; }

/* ---------- audio player ---------- */
.audio-box {
  max-width: 780px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px 14px;
  margin: 6px 0 0;
}
.audio-eyebrow {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.player-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.player-play {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.player-play:hover { background: #e7d9ae; }
.player-play:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.player-seek { flex: 1; min-width: 200px; }
.player-bar {
  position: relative;
  height: 16px;
  background: #ece5d2;
  border-radius: 8px;
  cursor: pointer;
  touch-action: none;
}
.player-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: var(--gold);
  border-radius: 8px;
  pointer-events: none;
}
.player-thumb {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--gold);
  pointer-events: none;
}
.player-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--gold);
  padding: 0;
  cursor: pointer;
  z-index: 2;
}
.player-marker:hover { background: var(--gold); }
.player-times {
  display: flex;
  gap: 5px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 5px;
}
.player-times .player-cur { color: var(--ink-soft); }

.player-speeds { display: flex; gap: 4px; flex-shrink: 0; }
.player-speeds button {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
}
.player-speeds button:hover { background: var(--gold-soft); color: var(--gold); }
.player-speeds button.on {
  background: var(--gold);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}

.player-now {
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink-soft);
  margin-top: 12px;
  min-height: 1.2em;
}
.player-now b { color: var(--ink); font-style: normal; font-weight: 600; }

.player-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}
.player-chip {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  min-width: 27px;
  height: 25px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
}
.player-chip:hover { background: var(--gold-soft); color: var(--gold); }
.player-chip.active {
  background: var(--gold);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}

.audio-meta {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  margin-top: 10px;
}

/* ---------- article view ---------- */
.article-head { padding: 40px 0 18px; }
.article-head .back {
  font-family: ui-monospace, Menlo, monospace; font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold);
}
.article-head h2 { font-size: clamp(26px, 4.4vw, 38px); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin: 12px 0 4px; }
.article-head .sub { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; letter-spacing: 0.1em; color: var(--ink-faint); }

.audit-article {
  max-width: 780px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(22px, 5vw, 48px);
  margin-top: 6px;
}
.audit-article h1 { font-size: clamp(26px, 4.4vw, 36px); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 8px; }
.audit-article h2 {
  font-size: clamp(20px, 3.4vw, 26px); font-weight: 600; line-height: 1.2;
  margin: 34px 0 10px; padding-top: 18px; border-top: 1px solid var(--line);
}
.audit-article h3 { font-size: 19px; font-weight: 600; margin: 26px 0 8px; }
.audit-article h4 { font-family: ui-monospace, Menlo, monospace; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin: 30px 0 8px; }
.audit-article p { font-size: 17px; line-height: 1.62; color: #2b261e; margin: 0 0 14px; }
.audit-article strong { font-weight: 700; color: var(--ink); }
.audit-article table {
  border-collapse: collapse; width: 100%; margin: 16px 0 22px;
  font-size: 14.5px; line-height: 1.45;
}
.audit-article th, .audit-article td { border: 1px solid var(--line-strong); padding: 8px 10px; text-align: left; vertical-align: top; }
.audit-article th { background: #f4efe2; font-family: ui-monospace, Menlo, monospace; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.audit-article td { background: #fffdf9; }

/* ---------- tooltip ---------- */
#tooltip {
  position: fixed; z-index: 100;
  max-width: min(340px, 82vw);
  background: #26221a; color: #f4efe2;
  font: 400 14px/1.5 'Newsreader', Georgia, serif;
  padding: 10px 13px; border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  pointer-events: none;
  opacity: 0; transition: opacity 0.12s ease;
}
#tooltip.show { opacity: 1; }
#tooltip .tt-metric { display: block; font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: #d9c48a; margin-bottom: 4px; }

/* ---------- states ---------- */
.state-msg { padding: 60px 20px; text-align: center; color: var(--ink-faint); font-style: italic; font-size: 18px; }

footer { max-width: 1280px; margin: 0 auto; padding: 8px 20px 56px; }
footer p { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--ink-faint); letter-spacing: 0.04em; line-height: 1.7; max-width: 720px; }
