:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f5;
  --ink: #111111;
  --ink-2: #333333;
  --muted: #6b6b6b;
  --rule: #e2e2e2;
  --rule-strong: #111111;
  --accent: #1f4bd8;
  --accent-soft: #e8eefc;
  --give: #0f7a4a;
  --give-soft: #e5f4ec;
  --head: #000000;
  --head-ink: #ffffff;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212; --bg-alt: #1b1b1b; --ink: #f2f2f2; --ink-2: #d4d4d4; --muted: #9a9a9a;
    --rule: #2c2c2c; --rule-strong: #f2f2f2; --accent: #7d9cff; --accent-soft: #1c2440;
    --give: #4fd093; --give-soft: #132a1f; --head: #000000; --head-ink: #ffffff;
  }
}
:root[data-theme="dark"] {
  --bg: #121212; --bg-alt: #1b1b1b; --ink: #f2f2f2; --ink-2: #d4d4d4; --muted: #9a9a9a;
  --rule: #2c2c2c; --rule-strong: #f2f2f2; --accent: #7d9cff; --accent-soft: #1c2440;
  --give: #4fd093; --give-soft: #132a1f;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

/* Masthead */
.masthead { background: var(--head); color: var(--head-ink); position: sticky; top: 0; z-index: 20; }
.masthead-inner { max-width: var(--max); margin: 0 auto; height: 64px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 16px; }
.wordmark { font-family: var(--serif); font-weight: 900; font-size: 38px; letter-spacing: -0.5px; text-decoration: none; color: var(--head-ink); line-height: 1; }
.wordmark-sm { font-size: 30px; color: var(--ink); margin-bottom: 12px; }
.menu-btn { justify-self: start; background: none; border: 0; padding: 8px; cursor: pointer; display: grid; gap: 5px; }
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--head-ink); }
.sub-btn { justify-self: end; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; border: 1px solid #fff; padding: 7px 14px; border-radius: 2px; }
.sub-btn:hover { background: #fff; color: #000; }
.channels { border-top: 1px solid #262626; display: flex; justify-content: center; gap: 26px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.channels::-webkit-scrollbar { display: none; }
.channels a { font-size: 13px; font-weight: 500; text-decoration: none; padding: 11px 0; white-space: nowrap; color: #cfcfcf; border-bottom: 2px solid transparent; }
.channels a:hover, .channels a.on { color: #fff; border-bottom-color: #fff; }

/* Layout */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.list-hero { padding: 40px 0 24px; border-bottom: 1px solid var(--rule); text-align: center; }
.list-hero h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(34px, 6vw, 64px); line-height: 1.05; margin: 10px 0 14px; letter-spacing: -0.5px; }
.list-hero .dek { font-family: var(--serif); font-size: clamp(17px, 2.2vw, 21px); color: var(--ink-2); max-width: 760px; margin: 0 auto; }
.byline { margin-top: 16px; font-size: 13px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--rule); }
.stat { padding: 20px 16px; border-right: 1px solid var(--rule); text-align: center; }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* Filters */
.filters { position: sticky; top: 108px; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--rule); padding: 12px 0; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-row input[type=search] { flex: 1 1 220px; min-width: 0; padding: 9px 12px; border: 1px solid var(--rule); border-radius: 2px; background: var(--bg); }
.filter-row select { padding: 9px 28px 9px 10px; border: 1px solid var(--rule); border-radius: 2px; background: var(--bg); appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat; font-size: 13px; max-width: 100%; }
.toggle { font-size: 13px; display: inline-flex; gap: 6px; align-items: center; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 2px; cursor: pointer; user-select: none; }
.reset { background: none; border: 0; font-size: 13px; color: var(--accent); cursor: pointer; padding: 8px 4px; }
.result-meta { font-size: 13px; color: var(--muted); padding: 14px 0 6px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 8px; border-bottom: 2px solid var(--rule-strong); white-space: nowrap; cursor: pointer; user-select: none; }
.table th.num, .table td.num { text-align: right; }
.table th.sorted { color: var(--ink); }
.table th.sorted::after { content: " \2193"; }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--bg-alt); }
.rank { font-family: var(--serif); font-size: 20px; font-weight: 700; width: 48px; }
.person { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.avatar { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 16px; color: #fff; }
.avatar.lg { width: 120px; height: 120px; font-size: 44px; }
.pname { font-weight: 600; font-size: 15px; }
.psub { font-size: 12px; color: var(--muted); }
.money { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.money.give { color: var(--give); }
.est { color: var(--muted); font-weight: 400; }
.score { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); font-weight: 700; font-size: 13px; }
.score.hi { background: var(--ink); color: var(--bg); }
.tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 2px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: middle; }
.hide-sm { }
.more { display: block; margin: 24px auto 48px; padding: 12px 28px; background: var(--ink); color: var(--bg); border: 0; border-radius: 2px; font-weight: 600; cursor: pointer; }
.bar { height: 4px; background: var(--rule); margin-top: 6px; border-radius: 2px; overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--accent); }

/* Profile */
.crumbs { font-size: 13px; padding: 18px 0; color: var(--muted); }
.crumbs a { color: var(--accent); text-decoration: none; }
.profile { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 48px; padding-bottom: 64px; }
.profile-side { border-top: 4px solid var(--rule-strong); padding-top: 24px; }
.profile-side .big { font-family: var(--serif); font-weight: 700; font-size: 44px; line-height: 1; margin: 16px 0 4px; }
.profile-side .big-sub { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kv { margin: 24px 0 0; padding: 0; }
.kv div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.scroll-x { overflow-x: auto; }
.profile-main h1 { font-family: var(--serif); font-size: clamp(36px, 5vw, 56px); line-height: 1.05; margin: 0 0 8px; }
.profile-main .lede { font-family: var(--serif); font-size: 20px; color: var(--ink-2); margin: 0 0 28px; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 32px; }
.trio div { padding: 18px 12px; border-right: 1px solid var(--rule); }
.trio div:last-child { border-right: 0; }
.trio b { display: block; font-family: var(--serif); font-size: 28px; }
.trio span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.section h2 { font-family: var(--serif); font-size: 26px; margin: 32px 0 10px; padding-top: 18px; border-top: 1px solid var(--rule); }
.section p { font-size: 17px; line-height: 1.65; color: var(--ink-2); margin: 0 0 12px; }
.callout { background: var(--give-soft); border-left: 3px solid var(--give); padding: 14px 16px; margin: 10px 0; font-size: 15px; }
.callout.blue { background: var(--accent-soft); border-left-color: var(--accent); }
.mini { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini th, .mini td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--rule); }
.mini th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mini .num { text-align: right; font-variant-numeric: tabular-nums; }
.split { display: flex; height: 26px; border-radius: 2px; overflow: hidden; margin: 10px 0 6px; background: var(--rule); }
.split i { display: block; height: 100%; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend b { display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; }
.scorebox { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.scorebox div { border: 1px solid var(--rule); padding: 10px; font-size: 12px; color: var(--muted); }
.scorebox b { display: block; color: var(--ink); font-size: 18px; }

/* Lists hub */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 32px 0 64px; }
.card { border-top: 4px solid var(--rule-strong); padding-top: 14px; text-decoration: none; display: block; }
.card h3 { font-family: var(--serif); font-size: 24px; margin: 6px 0 8px; line-height: 1.15; }
.card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.card:hover h3 { text-decoration: underline; }
.group h2 { font-family: var(--serif); font-size: 30px; margin: 40px 0 6px; }
.group .gmeta { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 20px 0; }
.chip { font-size: 13px; padding: 7px 12px; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; background: var(--bg); cursor: pointer; }
.chip.on, .chip:hover { border-color: var(--ink); }

/* Article */
.article { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; }
.article h1 { font-family: var(--serif); font-size: clamp(34px, 5vw, 52px); line-height: 1.08; margin: 12px 0 16px; }
.article h2 { font-family: var(--serif); font-size: 26px; margin: 36px 0 8px; }
.article p, .article li { font-size: 17px; line-height: 1.7; color: var(--ink-2); }
.article code { font-size: 14px; background: var(--bg-alt); padding: 2px 5px; }
.article blockquote { margin: 20px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--ink); font-family: var(--serif); font-size: 21px; font-style: italic; }

.footer { border-top: 4px solid var(--rule-strong); margin-top: 32px; }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 32px 16px 48px; font-size: 13px; color: var(--muted); }
.footer p { max-width: 820px; }
.fine { font-size: 12px; }

@media (max-width: 900px) {
  .profile { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .channels { justify-content: flex-start; }
  .cards { grid-template-columns: 1fr 1fr; }
  .hide-md { display: none; }
}
@media (max-width: 640px) {
  .masthead-inner { height: 56px; }
  .wordmark { font-size: 30px; }
  .sub-btn { padding: 6px 8px; font-size: 10px; }
  .filters { top: 100px; position: static; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .stat b { font-size: 24px; }
  .hide-sm { display: none; }
  .table td, .table th { padding: 10px 4px; }
  .person { min-width: 0; }
  .avatar { width: 36px; height: 36px; font-size: 13px; }
  .cards { grid-template-columns: 1fr; }
  .trio { grid-template-columns: 1fr; }
  .trio div { border-right: 0; border-bottom: 1px solid var(--rule); }
  .scorebox { grid-template-columns: 1fr 1fr; }
}

/* Forbes-style list rows with inline panel */
.ftable th { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); border-bottom: 1px solid var(--rule); padding: 14px 12px; }
.ftable th.sorted::after { content: " \25BE"; }
.ftable td { padding: 22px 12px; font-size: 16px; border-bottom: 1px solid var(--rule); }
.ftable td.rk { font-weight: 600; width: 64px; }
.ftable td.pname { font-weight: 600; font-size: 16px; }
.ftable tr.row.open td { background: #f7f7f7; border-bottom-color: transparent; }
.ftable tr.detail td { background: #f7f7f7; padding: 8px 12px 32px; cursor: default; }
.ftable tr.detail:hover { background: none; }
.panel { display: grid; grid-template-columns: 200px minmax(0, 1fr) 300px; gap: 32px; align-items: center; padding-left: 52px; }
.tile { width: 200px; height: 200px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-family: var(--serif); font-weight: 700; font-size: 64px; }
.panel-copy p { font-size: 17px; line-height: 1.5; margin: 0 0 12px; color: var(--ink); }
.panel-facts { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.panel-facts b { color: var(--ink); }
.panel-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.pbtn { background: #111; color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; padding: 12px 22px; border-radius: 8px; }
.pbtn:hover { background: #333; }
.panel-chart { border-left: 1px solid var(--rule); padding-left: 32px; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.chart-title { font-weight: 600; font-size: 16px; text-align: center; margin-bottom: 14px; }
.vstack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; }
.vstack i { display: block; height: 100%; }
.vlegend { margin: 14px 0 0; font-size: 13px; }
.vlegend div { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--rule); }
.vlegend dt { color: var(--muted); }
.vlegend dt b { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.vlegend dd { margin: 0; font-weight: 600; }
.chart-foot { margin-top: 10px; font-size: 13px; text-align: center; font-weight: 600; }
@media (max-width: 900px) {
  .panel { grid-template-columns: 120px minmax(0, 1fr); padding-left: 0; gap: 20px; }
  .tile { width: 120px; height: 120px; font-size: 40px; }
  .panel-chart { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 16px; }
}
@media (max-width: 640px) {
  .ftable td { padding: 16px 6px; font-size: 15px; }
  .ftable td.rk { width: 36px; }
  .panel { grid-template-columns: 1fr; }
  .tile { width: 96px; height: 96px; font-size: 32px; }
}

/* Simplified filters */
.filter-row input[type=search] { flex: 1 1 320px; }
.more-btn { padding: 9px 14px; border: 1px solid var(--rule); background: var(--bg); border-radius: 2px; font-size: 13px; font-weight: 600; cursor: pointer; }
.more-btn.on { border-color: var(--ink); }
.adv { flex-basis: 100%; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.adv[hidden] { display: none; }
.fchips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 10px; }
.fchip { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); cursor: pointer; }
.filters { position: static; }

/* Photos */
.tile-wrap { display: flex; flex-direction: column; gap: 6px; }
img.tile { object-fit: cover; object-position: 50% 20%; background: #ddd; }
img.avatar.photo { object-fit: cover; object-position: 50% 20%; display: block; }
.credit { font-size: 10px; line-height: 1.3; color: var(--muted); max-width: 200px; overflow-wrap: anywhere; }
.credit a { color: inherit; }
.profile-side .credit { margin-top: 6px; max-width: 280px; }
.pbtn.alt { background: var(--bg); color: var(--ink); border: 1px solid var(--ink); }
.pbtn.alt:hover { background: var(--bg-alt); }

/* Put it in perspective: button and pop-up */
.ftable td.pname .nm { margin-right: 10px; }
.pp-btn { font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--ink); background: var(--bg); color: var(--ink); cursor: pointer; white-space: nowrap; vertical-align: 2px; }
.pp-btn:hover { background: var(--ink); color: var(--bg); }
.pp-profile { margin: 4px 0 20px; cursor: pointer; font: inherit; font-weight: 600; font-size: 15px; }
.pbtn.alt { cursor: pointer; font: inherit; font-weight: 600; font-size: 15px; }
body.pp-lock { overflow: hidden; }
.pp-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; }
.pp-overlay[hidden] { display: none; }
.pp-card { position: relative; background: var(--bg); width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-top: 6px solid var(--ink); padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.pp-x { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; color: var(--muted); }
.pp-who { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.pp-who img, .pp-ini { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; flex: 0 0 auto; }
.pp-ini { display: grid; place-items: center; background: #444; color: #fff; font-family: var(--serif); font-weight: 700; }
.pp-who b { font-size: 18px; }
.pp-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.pp-tabs button { font: inherit; font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--rule); background: var(--bg); cursor: pointer; }
.pp-tabs button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pp-line { font-family: var(--serif); font-size: clamp(22px, 3.6vw, 30px); line-height: 1.25; margin: 0 0 12px; min-height: 3.75em; }
.pp-math { font-size: 12px; color: var(--muted); }
.pp-foot { display: flex; align-items: center; gap: 16px; margin-top: 22px; }
.pp-foot .pbtn { border: 0; cursor: pointer; font: inherit; font-weight: 600; }
@media (max-width: 640px) { .pp-btn { display: block; margin-top: 6px; } .pp-card { padding: 22px 18px; } }
.ftable td { white-space: nowrap; }
.ftable td.pname { white-space: normal; }

.ftable tr.detail td { white-space: normal; }
.ftable td.pname { min-width: 150px; }
@media (max-width: 1400px) { .hide-lg { display: none; } }

/* Smartphone pass */
@media (max-width: 640px) {
  .sub-btn { display: none; }                       /* Methodology stays in the nav row */
  .masthead-inner { grid-template-columns: 44px 1fr 44px; }
  .wordmark { font-size: 30px; text-align: center; }
  .channels { gap: 20px; }
  .list-hero { padding: 28px 0 20px; }
  .list-hero h1 { font-size: 34px; }
  .list-hero .dek { font-size: 17px; }
  .ftable th { white-space: normal; padding: 10px 6px; font-size: 12px; }
  .ftable th.rk, .ftable td.rk { width: 34px; }
  .ftable td.num { white-space: nowrap; }
  .ftable td.pname { min-width: 0; font-size: 15px; white-space: normal; }
  .ftable td { padding: 14px 6px; }
  .pp-btn { margin-top: 6px; }
  .panel-btns .pbtn { flex: 1 1 auto; text-align: center; padding: 12px 14px; }
  .profile .profile-main { order: 1; }
  .profile .profile-side { order: 2; border-top-width: 2px; }
  .profile-main h1 { font-size: 36px; }
  .profile-main .lede { font-size: 17px; }
  .trio b { font-size: 24px; }
  .section h2 { font-size: 22px; }
  .section p { font-size: 16px; }
  .crumbs { padding: 14px 0 6px; }
  .article { padding-top: 16px; }
  .article h1 { font-size: 32px; }
  .filters .filter-row select, .more-btn { flex: 1 1 140px; }
  .pp-overlay { align-items: end; padding: 0; }
  .pp-card { width: 100%; max-height: 90vh; border-radius: 12px 12px 0 0; }
  .pp-line { font-size: 23px; min-height: 0; }
  .pp-foot .pbtn { width: 100%; text-align: center; }
}
