/* World Data Sources. A research report page: white paper, navy ink, thin rules, square corners,
   one blue for links and selection. No gradients, no shadows, no glows. */

:root {
  --page: #FFFFFF;
  --paper: #FFFFFF;
  --ink: #0B1F33;
  --muted: #4A5565;
  --faint: #6F7B8A;
  --rule: #D0D7DE;
  --line: #B8C0CC;
  --grid: #E7EBF0;
  --shade: #F3F5F8;
  --blue: #1A4E9A;
  --fill: #E2E9F2;
  --c0: #E4EAF2;
  --c1: #BCCBDF;
  --c2: #8AA4C6;
  --c3: #4F73A1;
  --c4: #1D3D68;
  --cnone: #F4F5F7;
  --land: #ECEEF1;
  --scrim: rgba(11, 31, 51, .42);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 1240px;
  --gutter: 32px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0A111A; --paper: #0D1520; --ink: #E7ECF2; --muted: #A9B4C2; --faint: #8592A3;
    --rule: #233041; --line: #3A4A5E; --grid: #192433; --shade: #142030; --blue: #7FAAE6; --fill: #172A40;
    --c0: #172435; --c1: #1F3A5C; --c2: #2C5585; --c3: #4A79B4; --c4: #8DB3E8; --cnone: #111A25; --land: #131C27;
    --scrim: rgba(0, 0, 0, .6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0A111A; --paper: #0D1520; --ink: #E7ECF2; --muted: #A9B4C2; --faint: #8592A3;
  --rule: #233041; --line: #3A4A5E; --grid: #192433; --shade: #142030; --blue: #7FAAE6; --fill: #172A40;
  --c0: #172435; --c1: #1F3A5C; --c2: #2C5585; --c3: #4A79B4; --c4: #8DB3E8; --cnone: #111A25; --land: #131C27;
  --scrim: rgba(0, 0, 0, .6); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--page); }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.5 var(--sans); overflow-x: hidden; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
button { font: inherit; color: inherit; }
.num, .r { font-variant-numeric: tabular-nums; }
.code { font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--faint); letter-spacing: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.noscript { padding: 24px; }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 1px solid var(--rule); }
.bar-in { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); height: 56px; display: flex; align-items: center; gap: 30px; }
.mark { font-weight: 700; font-size: 15px; color: var(--ink); white-space: nowrap; letter-spacing: -.005em; }
.mark:hover { text-decoration: none; }
.nav { display: flex; gap: 24px; align-self: stretch; }
.nav a, .mnav a { color: var(--muted); display: flex; align-items: center; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav a:hover, .mnav a:hover { color: var(--ink); text-decoration: none; }
.nav a.on, .mnav a.on { color: var(--ink); border-bottom-color: var(--ink); }
.bar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; min-width: 0; }
.searchbtn { display: flex; align-items: center; gap: 8px; width: 300px; height: 34px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 3px; background: var(--paper); color: var(--faint); font-size: 13.5px; cursor: text; text-align: left; min-width: 0; }
.searchbtn .t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.searchbtn:hover { border-color: var(--line); }
kbd { font: 11px var(--mono); border: 1px solid var(--rule); border-radius: 3px; padding: 1px 5px; color: var(--faint); }
.iconbtn { width: 34px; height: 34px; flex: none; border: 1px solid var(--rule); border-radius: 3px; background: var(--paper); color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0; }
.iconbtn:hover { background: var(--shade); }
.mnav { display: none; gap: 22px; padding: 0 var(--gutter); height: 40px; border-top: 1px solid var(--rule); }

/* ---------- page ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter) 24px; outline: none; min-height: 60vh; }
.hero { padding: 44px 0 0; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
h1 { font-size: 34px; line-height: 1.12; font-weight: 650; letter-spacing: -.016em; margin: 8px 0 12px; }
h1 .code { font-size: 14px; margin-left: 10px; vertical-align: 6px; }
.lede { max-width: 72ch; color: var(--muted); font-size: 16px; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 30px; border-top: 1px solid var(--ink); }
.stat { padding: 14px 16px 0 0; min-width: 0; }
.stat b { display: block; font-size: 25px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat span { font-size: 12.5px; color: var(--muted); }

.section { padding: 44px 0 0; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.sec-head h2 { font-size: 21px; line-height: 1.2; font-weight: 650; margin: 4px 0 0; letter-spacing: -.01em; }
.sec-head .note { font-size: 13px; color: var(--muted); }
h3 { font-size: 15px; font-weight: 650; margin: 0; }
.source-line { font-size: 11.5px; color: var(--faint); margin-top: 10px; }
.empty { color: var(--muted); font-size: 14px; padding: 18px 0; }

/* underline tabs */
.tabs { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; min-width: 0; max-width: 100%; }
.sec-head > div, .toolrow > * { min-width: 0; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { font-size: 13.5px; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 7px 0 6px; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--blue); }
.toolrow { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; border-bottom: 1px solid var(--rule); }

/* controls */
.input { height: 34px; border: 1px solid var(--rule); border-radius: 3px; padding: 0 10px; font: inherit; font-size: 14px; background: var(--paper); color: var(--ink); width: 260px; max-width: 100%; }
.input:focus { border-color: var(--blue); outline: none; }
select.input { width: auto; padding-right: 26px; }
.btn { height: 32px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 3px; background: var(--paper); color: var(--ink); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: var(--shade); text-decoration: none; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 14px 0 6px; }
.filters .count { font-size: 13px; color: var(--muted); margin-left: auto; }

/* tables */
.tblwrap { width: 100%; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; padding: 9px 12px 8px; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.tbl th.sort { cursor: pointer; user-select: none; }
.tbl th.sort:hover { color: var(--ink); }
.tbl th .dir { font-size: 10px; margin-left: 3px; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl tr.row { cursor: pointer; }
.tbl tr.row:hover td { background: var(--shade); }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl td:first-child, .tbl th:first-child { padding-left: 0; }
.tbl td:last-child, .tbl th:last-child { padding-right: 0; }
.tbl tr.row:hover td:first-child { box-shadow: -8px 0 0 var(--shade); }
.tbl .grp td { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding-top: 20px; border-bottom: 1px solid var(--rule); }
.tbl a.pl { color: var(--ink); font-weight: 600; }
.tbl .sub { display: block; font-size: 12px; color: var(--faint); margin-top: 1px; overflow-wrap: anywhere; }
.tbl .lead a { display: block; overflow-wrap: anywhere; }
.tag { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tbl .sub.show-m { display: none; }
.acc { font: 11.5px var(--mono); color: var(--muted); }
.acc.api { color: var(--blue); }
.more { margin: 16px 0 0; }

/* map */
.mapbox { position: relative; margin-top: 16px; }
.map svg { display: block; width: 100%; height: auto; }
.map path { stroke: var(--paper); stroke-width: .5; cursor: pointer; }
.map path.bg { fill: var(--land); cursor: default; }
.map path:hover, .map rect.mk:hover { stroke: var(--ink); stroke-width: 1.2; }
.map .out { opacity: .16; }
.map rect.mk { stroke: var(--ink); stroke-width: .6; cursor: pointer; }
.map .b0 { fill: var(--c0); } .map .b1 { fill: var(--c1); } .map .b2 { fill: var(--c2); } .map .b3 { fill: var(--c3); } .map .b4 { fill: var(--c4); } .map .bnone { fill: var(--cnone); }
.legend { display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); margin-top: 12px; }
.legend i { display: inline-block; width: 14px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.legend .ttl { color: var(--ink); font-weight: 600; margin-right: 4px; }

.tip { position: fixed; z-index: 80; pointer-events: none; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); padding: 8px 10px; font-size: 12.5px; line-height: 1.45; min-width: 150px; max-width: 260px; display: none; }
.tip b { display: block; font-size: 13px; margin-bottom: 2px; }
.tip .k { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--paper); font-size: 13px; padding: 8px 14px; border-radius: 3px; display: none; }

/* place page */
.crumbs { font-size: 13px; color: var(--faint); padding-top: 28px; }
.crumbs a { color: var(--muted); }
.ph { display: flex; justify-content: space-between; gap: 16px 24px; align-items: flex-end; flex-wrap: wrap; }
.ph h1 { margin-bottom: 6px; }
.meta { font-size: 13.5px; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.summary { max-width: 76ch; font-size: 15.5px; line-height: 1.62; margin: 18px 0 0; }
.kf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-top: 26px; }
.kf > div { background: var(--paper); padding: 12px 14px; min-width: 0; }
.kf .l { font-size: 12.5px; color: var(--muted); }
.kf .v { font-size: 21px; font-weight: 650; font-variant-numeric: tabular-nums; margin: 2px 0 1px; overflow-wrap: anywhere; line-height: 1.25; }
.kf .m { font-size: 12px; color: var(--faint); }
.kf .s { font-size: 11.5px; color: var(--faint); display: block; margin-top: 5px; overflow-wrap: anywhere; }
.kf .s a { color: var(--faint); text-decoration: underline; text-decoration-color: var(--rule); }

.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; margin-top: 34px; align-items: start; }
.side { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow: auto; padding: 0 6px 24px 0; scrollbar-width: thin; }
.side a { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0 4px 10px; color: var(--muted); font-size: 13.5px; border-left: 2px solid var(--rule); line-height: 1.35; }
.side a:hover { color: var(--ink); text-decoration: none; }
.side a.on { color: var(--ink); border-left-color: var(--blue); font-weight: 600; }
.side .c { font-variant-numeric: tabular-nums; color: var(--faint); font-size: 12.5px; font-weight: 400; }
.side .grp { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 18px 0 5px 12px; }
.side .grp:first-child { margin-top: 0; }
.sideselect { display: none; width: 100%; margin-bottom: 18px; }
.pane { min-width: 0; }
.pane-head { padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.pane-head h2 { font-size: 21px; line-height: 1.2; font-weight: 650; margin: 4px 0 2px; letter-spacing: -.01em; }
.block { margin-top: 28px; }
.block > h3 { padding-bottom: 8px; border-bottom: 1px solid var(--rule); }

/* charts */
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-top: 12px; }
.chart { background: var(--paper); padding: 14px 16px 12px; cursor: pointer; min-width: 0; text-align: left; border: 0; display: block; width: 100%; }
.chart:hover { background: var(--shade); }
.chart h4 { font-size: 14px; font-weight: 600; margin: 0; line-height: 1.3; }
.chart .u { font-size: 12px; color: var(--muted); }
.chart .plot { margin-top: 8px; height: 180px; }
.chart .src { font-size: 11.5px; color: var(--faint); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plot svg { display: block; overflow: visible; }
.plot .g { stroke: var(--grid); stroke-width: 1; }
.plot .base { stroke: var(--line); stroke-width: 1; }
.plot text { fill: var(--faint); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
.plot text.last { fill: var(--ink); font-weight: 600; }
.plot .ln { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.plot .ar { stroke: none; fill: var(--fill); }
.plot .br { fill: var(--ink); }
.plot .hv { stroke: var(--ink); stroke-width: 1; }

.bars { display: grid; grid-template-columns: minmax(120px, 260px) minmax(0, 1fr) 70px; gap: 0 14px; align-items: center; font-size: 13.5px; margin-top: 8px; }
.bars a, .bars span { padding: 5px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.bars a { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars .b { display: flex; align-items: center; height: 100%; }
.bars .b i { display: block; height: 9px; background: var(--ink); }
.bars .r { text-align: right; color: var(--muted); }

/* modal + search */
.modal, .pal { position: fixed; inset: 0; z-index: 70; background: var(--scrim); display: none; }
.modal.on { display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-box { position: relative; background: var(--paper); border: 1px solid var(--ink); width: min(1000px, 100%); max-height: calc(100vh - 48px); overflow: auto; padding: 22px 24px 20px; }
.modal-x { position: absolute; top: 14px; right: 14px; }
.modal-box h2 { font-size: 20px; margin: 4px 48px 2px 0; font-weight: 650; }
.modal-box .plot { height: 340px; margin-top: 14px; }
.modal-box .tblwrap { max-height: 260px; overflow: auto; margin-top: 16px; }
.modal-box .tbl td, .modal-box .tbl th { padding-top: 5px; padding-bottom: 5px; }
.pal.on { display: flex; align-items: flex-start; justify-content: center; padding-top: 11vh; }
.pal-box { width: min(660px, calc(100% - 32px)); background: var(--paper); border: 1px solid var(--ink); }
.pal input { width: 100%; height: 50px; border: 0; border-bottom: 1px solid var(--rule); padding: 0 16px; font: inherit; font-size: 16px; background: transparent; color: var(--ink); outline: none; }
.pal-res { max-height: 62vh; overflow: auto; padding-bottom: 6px; }
.pal-res .h { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 12px 16px 4px; }
.pal-res a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 16px; color: var(--ink); font-size: 14px; }
.pal-res a span:last-child { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.pal-res a.on, .pal-res a:hover { background: var(--shade); text-decoration: none; }
.pal-res .none { padding: 16px; color: var(--muted); font-size: 14px; }

/* agents */
pre.code-block { background: var(--shade); border: 1px solid var(--rule); border-radius: 3px; padding: 12px 14px; font: 12.5px/1.6 var(--mono); overflow-x: auto; margin: 10px 0 0; color: var(--ink); white-space: pre; max-width: 100%; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 16px; }
.cols3 p { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.prose { max-width: 76ch; }
.prose p { margin: 10px 0 0; }
.prose code, .tbl code { font: 12.5px var(--mono); background: var(--shade); padding: 1px 4px; border-radius: 3px; }

.skeleton { height: 14px; background: var(--shade); margin: 10px 0; width: 60%; }

footer { border-top: 1px solid var(--rule); margin-top: 56px; }
.foot-in { max-width: var(--maxw); margin: 0 auto; padding: 18px var(--gutter) 40px; font-size: 12.5px; color: var(--faint); }
.foot-in p { margin: 4px 0; }
.foot-in a { color: var(--muted); }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
  .searchbtn { width: 220px; }
  .layout { grid-template-columns: 210px minmax(0, 1fr); gap: 28px; }
  .kf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats .stat:nth-child(n+4) { padding-top: 16px; }
}
@media (max-width: 820px) {
  .charts { grid-template-columns: 1fr; }
  .cols3 { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .hide-t { display: none; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .bar-in { height: 52px; gap: 12px; }
  .nav { display: none; }
  .mnav { display: flex; }
  .searchbtn { width: 38px; padding: 0; justify-content: center; }
  .searchbtn .t, .searchbtn kbd { display: none; }
  .hero { padding-top: 28px; }
  h1 { font-size: 27px; }
  h1 .code { display: block; margin: 6px 0 0; vertical-align: 0; }
  .lede { font-size: 15px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .stat:nth-child(n+3) { padding-top: 14px; }
  .stat b { font-size: 21px; }
  .section { padding-top: 34px; }
  .kf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kf .v { font-size: 18px; }
  .layout { display: block; margin-top: 26px; }
  .side { display: none; }
  .sideselect { display: block; }
  .hide-m { display: none; }
  .tbl .sub.show-m { display: block; }
  .input { width: 100%; }
  .filters .count { margin-left: 0; width: 100%; }
  .bars { grid-template-columns: minmax(0, 46%) minmax(0, 1fr) 54px; gap: 0 10px; }
  .modal.on { padding: 10px; }
  .modal-box { padding: 18px 16px; max-height: calc(100vh - 20px); }
  .modal-box .plot { height: 240px; }
  .tbl { font-size: 13.5px; }
  .tbl td, .tbl th { padding-left: 8px; padding-right: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media print { .bar, .mnav, footer, .actions, .side, .sideselect, .filters { display: none !important; } .layout { display: block; } }
