/* Shared govdocs tokens, masthead and footer rules. */
:root {
  --paper: #fcfcfa;
  --paper-alt: #f6f4ee;
  --surface: #ffffff;
  --slate-deep: #0f1b33;
  --slate: #1b2a4a;
  --slate-mid: #273c66;
  --brass: #7d5f24;
  --brass-soft: #f9f5eb;
  --ink: #151d2c;
  --body: #253041;
  --muted: #4f5c70;
  --rule: #dcd9cf;
  --rule-strong: #948e7e;

  --font-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --container-max: 1184px;
  --gutter: clamp(20px, 4vw, 44px);
}


.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--slate-deep);
  color: #ffffff;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 999;
  text-decoration: none;
}
.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}


a {
  color: var(--slate);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--brass); }

.container {
  width: 100%;
  max-width: calc(var(--container-max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Masthead */
.site-header {
  background: var(--paper);
  border-top: 3px solid var(--slate-deep);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  flex-wrap: wrap;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-emblem {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.brand-wordmark {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--slate-deep);
  letter-spacing: -0.01em;
}

.brand-tagline {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.015em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.nav-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}


/* Footer */
.site-footer {
  background: var(--paper-alt);
  border-top: 1px solid var(--rule);
  padding: 1.35rem 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-links {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.footer-coop {
  margin: 0.45rem 0 0;
  font-size: 0.77rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.footer-coop a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 2px;
}

.footer-coop a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.gov-disclosure {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--rule);
  font-size: 0.74rem;
  color: var(--muted);
}

.gov-disclosure summary {
  cursor: pointer;
  font-weight: 500;
}

.gov-disclosure-body {
  margin: 0.45rem 0 0;
  line-height: 1.55;
  max-width: 96ch;
}

:root { --ink-soft: var(--muted); --accent: var(--brass); }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--slate-mid); outline-offset: 3px; }
html { font-size: 16px; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--body); font: 1rem/1.55 var(--font-sans); }
main { flex: 1; min-width: 0; display: block; }
h1, h2, h3 { font-family: var(--font-serif); color: var(--slate-deep); line-height: 1.16; margin: 0; }
h1 { font-size: clamp(2.15rem, 5vw, 3.25rem); letter-spacing: -.033em; }
h2 { font-size: clamp(1.32rem, 2.3vw, 1.65rem); }
h3 { font-size: 1.13rem; }
code, pre, .number, .badge, table { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.brand-emblem { display: grid; place-items: center; background: var(--slate-deep); color: var(--brass-soft); border-radius: 2px; }
.brand-emblem svg { width: 36px; height: 36px; }
.header-inner { min-height: 4.6rem; }
.nav-list { gap: 1.6rem; margin-inline: auto; padding-inline: var(--gutter); }
.nav-list a { padding: .55rem 0 .65rem; border-bottom: 2px solid transparent; text-decoration: none; font-size: .91rem; }
.nav-list a[aria-current=page] { border-color: var(--brass); color: var(--slate-deep); font-weight: 700; }
.lang-switch { display: flex; align-items: center; gap: .3rem; font-size: .82rem; padding-left: .5rem; border-left: 1px solid var(--rule); font-family: var(--font-mono); }
.lang-switch a { text-decoration: none; padding: .23rem .35rem; }
.lang-switch a[aria-current] { background: var(--paper-alt); color: var(--brass); font-weight: 700; }
.console { font-size: .84rem; padding: .24rem .58rem; border: 1px solid var(--rule); text-decoration: none; }
.site-main { padding-bottom: clamp(2rem, 5vw, 4rem); }
.page-heading { padding: clamp(1.6rem, 4vw, 2.85rem) 0 1.25rem; }
.page-heading p { margin: .6rem 0 0; color: var(--muted); }
.back { display: inline-block; margin-bottom: .65rem; font-size: .85rem; }
.metrics { margin: 0 0 1.5rem; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); background: var(--paper-alt); border: 1px solid var(--rule); }
.metric { padding: .76rem 1rem; min-width: 0; border-inline-end: 1px solid var(--rule); }
.metric:last-child { border-inline-end: 0; }
.metric dt { color: var(--muted); font-size: .84rem; }
.metric dd { margin: .2rem 0 0; color: var(--slate-deep); font-size: clamp(.98rem, 2.2vw, 1.55rem); font-weight: 600; overflow-wrap: anywhere; }
.explorer { display: grid; grid-template-columns: minmax(170px, 232px) minmax(0,1fr); gap: clamp(1rem, 3vw, 2rem); }
.facets { min-width: 0; background: var(--paper-alt); border: 1px solid var(--rule); padding: .85rem; align-self: start; }
.facets > summary, .detail-summary { color: var(--slate-deep); font-size: .92rem; font-weight: 700; cursor: pointer; }
.facets fieldset { border: 0; border-bottom: 1px solid var(--rule); padding: .34rem 0 .66rem; margin: .85rem 0 0; }
.facets fieldset:last-child { border-bottom: 0; }
.facets legend, .control > span { color: var(--slate-deep); font-weight: 650; font-size: .88rem; }
.facets label, .check { display: flex; gap: .42rem; align-items: baseline; font-size: .86rem; margin-block: .27rem; }
.facets input, .check input { accent-color: var(--slate-mid); align-self: center; }
.tree-children { border-inline-start: 1px solid var(--rule-strong); padding-inline-start: .65rem; margin-inline-start: .2rem; }
.search-box { display: flex; flex-direction: column; gap: .35rem; color: var(--slate-deep); font-weight: 650; }
input:not([type=checkbox]), select, textarea { min-width: 0; width: 100%; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 2px; padding: .5rem .6rem; font: inherit; color: var(--ink); }
input[type=search] { min-height: 44px; border-color: var(--slate-mid); }
button, .button { display: inline-flex; justify-content: center; align-items: center; min-height: 36px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--slate-deep); border-radius: 2px; padding: .33rem .62rem; font: 600 .84rem/1.35 var(--font-sans); cursor: pointer; text-decoration: none; text-align: center; }
button:hover, .button:hover { background: var(--paper-alt); color: var(--slate-deep); }
.primary { background: var(--slate); border-color: var(--slate); color: var(--surface); }
.primary:hover { background: var(--slate-mid); color: var(--surface); }
button:disabled, .disabled { opacity: .62; cursor: default; }
.result-line, .list-head, .control-top, .toolbar, .legend { display: flex; align-items: center; justify-content: space-between; gap: .45rem .8rem; flex-wrap: wrap; }
.result-line { margin: .75rem 0 .35rem; color: var(--muted); font-size: .87rem; }
.toolbar, .legend { justify-content: flex-start; }
.catalog-list { list-style: none; margin: 0 0 .75rem; padding: 0; border-top: 1px solid var(--rule-strong); }
.catalog-list > li { padding: .8rem 0; border-bottom: 1px solid var(--rule); }
.list-head { align-items: baseline; justify-content: flex-start; }
.list-head h2 { font-size: 1.25rem; }
.list-head h2 a { text-decoration: none; }
.list-head h2 a:hover { text-decoration: underline; }
.series-meta { display: flex; gap: .3rem .7rem; flex-wrap: wrap; margin: .4rem 0 .59rem; color: var(--muted); font-size: .85rem; align-items: center; }
.tags { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.badge { display: inline-block; color: var(--slate); background: var(--paper-alt); border: 1px solid var(--rule); padding: .08rem .31rem; font-size: .77rem; border-radius: 2px; overflow-wrap: anywhere; }
.badge.warning { color: #624917; background: var(--brass-soft); border-color: #c7b78f; }
.small { font-size: .86rem; color: var(--muted); }
.message { border-left: 3px solid var(--brass); padding: .55rem .75rem; background: var(--brass-soft); color: var(--body); }
.control-panel { border: 1px solid var(--rule); background: var(--paper-alt); padding: .9rem; margin-bottom: 1rem; }
.controls { display: grid; grid-template-columns: repeat(auto-fit,minmax(132px,1fr)); gap: .65rem .9rem; align-items: end; }
.control { min-width: 0; display: flex; flex-direction: column; gap: .28rem; font-size: .9rem; }
.control select[multiple] { min-height: 3.6rem; }
.control-top { justify-content: flex-start; margin-top: .7rem; }
.data-tabs { display: flex; gap: .35rem; flex-wrap: wrap; border-bottom: 1px solid var(--rule); margin: 1rem 0 .7rem; }
.data-tabs button { border: 0; border-radius: 0; background: transparent; border-bottom: 2px solid transparent; }
.data-tabs button[aria-selected=true] { border-color: var(--brass); color: var(--brass); }
.scroll { overflow: auto; max-width: 100%; border: 1px solid var(--rule); background: var(--surface); }
.pivot { max-height: min(570px, 70vh); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .83rem; line-height: 1.38; }
th, td { padding: .52rem .65rem; background: var(--surface); border-bottom: 1px solid var(--rule); text-align: left; }
table tr:last-child td, table tbody tr:last-child th { border-bottom: 0; }
thead th { background: var(--paper-alt); color: var(--slate-deep); }
.pivot table tbody th { position: sticky; left: 0; z-index: 1; min-width: 132px; max-width: 340px; background: var(--paper); box-shadow: 1px 0 var(--rule); }
.pivot table thead th { position: sticky; top: 0; z-index: 2; }
.pivot table thead th:first-child { left: 0; z-index: 3; box-shadow: 1px 0 var(--rule); }
.pivot td, .pivot thead th:not(:first-child) { text-align: right; white-space: nowrap; min-width: 85px; }
.pivot .track-caption { display: block; color: var(--muted); font-size: .73rem; font-weight: 400; margin-top: .16rem; overflow-wrap: anywhere; }
.cell-note { display: inline-block; margin-left: .25rem; min-height: 20px; font-size: .72rem; padding: .02rem .25rem; color: var(--brass); background: var(--brass-soft); border-color: var(--rule); vertical-align: middle; }
.chart-box { border: 1px solid var(--rule); background: var(--surface); padding: .65rem; margin: .8rem 0; }
.chart-box svg { width: 100%; min-width: 540px; display: block; }
.chart-box .legend-key { width: 15px; min-width: 15px; display: inline-block; }
.chart-box .chart-area { overflow-x: auto; }
.chart-box text { font: 13px var(--font-mono); fill: var(--ink); }
.chart-box .guide { stroke: var(--rule); }
.chart-box .breakline { stroke: var(--brass); stroke-dasharray: 5 5; }
.chart-tip { margin: .3rem 0; min-height: 1.6em; }
.chart-box svg circle:focus, .chart-box svg rect:focus { outline: none; stroke: var(--ink); stroke-width: 3px; }
.chart-mode { max-width: 205px; }
.metadata > section, .reading > section, .source-item { border-top: 1px solid var(--rule); padding: .95rem 0; }
.metadata p, .source-item p { margin: .34rem 0; overflow-wrap: anywhere; }
.metadata dl { display: grid; grid-template-columns: minmax(105px, 155px) minmax(0, 1fr); gap: .2rem .62rem; margin: .45rem 0; font-size: .9rem; }
.metadata dt { color: var(--muted); }
.metadata dd { margin: 0; overflow-wrap: anywhere; }
.metadata .control { margin: .65rem 0; }
textarea { min-height: 5.1rem; resize: vertical; }
.reading { max-width: 950px; }
.reading p { margin: .55rem 0 .9rem; }
.reading pre { font-size: .84rem; overflow: auto; border: 1px solid var(--rule); background: var(--paper-alt); padding: .72rem; }
.reading section { margin-top: 1rem; }
.sources-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 1.4rem; }
.break-list { margin-top: 1.6rem; }
.break-list > h2 { margin-bottom: .55rem; }
.break-list details { padding: .55rem 0; border-bottom: 1px solid var(--rule); }
.coverage { margin-top: .8rem; }
.chosen { list-style: none; padding: 0; margin: .7rem 0; }
.chosen li { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .4rem 0; border-bottom: 1px solid var(--rule); }
.builder-add { display: flex; gap: .4rem; max-width: 36rem; }
.divider { border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 1rem; }
.footer-inner { font-size: .84rem; }
.note-dialog { width: min(100% - 2rem, 620px); max-height: 85vh; background: var(--paper); color: var(--body); border: 1px solid var(--rule-strong); padding: 1.25rem; }
.note-dialog::backdrop { background: #0f1b3390; }
@media (max-width: 700px) {
  .nav-list { gap: .15rem 1.1rem; }
  .explorer, .sources-list { grid-template-columns: minmax(0,1fr); }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric:nth-child(2) { border-inline-end: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .header-inner { gap: .55rem; }
  .pivot table tbody th { min-width: 105px; max-width: 170px; }
}

