/* National debt (national-debt.php). Mobile first. Paper ledger: ink rules, serif numerals, numbered sections, tables that
   become stacked records on phones. Colors come from the site tokens only. Loads after css/archive-charts.css. */
.nd-main { padding-bottom: 96px; font-variant-numeric: tabular-nums; }
.nd-lead { max-width: 46rem; margin: 0 0 18px; color: var(--vf-ink); font: 600 1.35rem/1.35 var(--vf-font-head); }

/* The latest figures: three columns divided by hairlines, large serif numerals, no boxes. */
.nd-readout { display: grid; margin: 0 0 8px; border-bottom: 1px solid var(--vf-rule-strong); }
.nd-readout > div { padding: 12px 0; border-top: 1px solid var(--vf-rule); }
.nd-readout > div:first-child { border-top: 0; }
.nd-readout dt { margin: 0 0 2px; color: var(--vf-mute); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nd-readout dd { margin: 0; color: var(--vf-ink); font: 700 1.35rem/1.15 var(--vf-font-head); overflow-wrap: anywhere; }
.nd-readout > div:first-child dd { font-size: 1.6rem; }
.nd-readout-note { margin: 0 0 18px; color: var(--vf-ink-2); font-size: .9rem; }

.nd-jump { display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 14px 0 0; padding: 8px 0; border-top: 1px solid var(--vf-rule-strong); border-bottom: 1px solid var(--vf-rule-strong); }
.nd-jump a { display: inline-block; padding: 8px 0; color: var(--vf-ink); font-size: .9rem; font-weight: 700; text-decoration: none; border-bottom: 2px solid transparent; }
.nd-jump a:hover, .nd-jump a:focus-visible { border-bottom-color: var(--vf-ink); }

/* Numbered section heads */
.nd-sec { scroll-margin-top: 70px; }
.nd-h { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 12px; padding-top: 10px; border-top: 2px solid var(--vf-ink); color: var(--vf-ink); font: 700 1.25rem/1.25 var(--vf-font-head); }
.nd-n { flex: 0 0 auto; color: var(--vf-gold-text); font: 800 .8rem var(--vf-font-body); letter-spacing: .1em; }
.nd-explain { margin-bottom: 14px; }
.nd-help { margin: 6px 0 14px; color: var(--vf-ink-2); font-size: .9rem; max-width: 46rem; }

/* Scale choice: two links that work without JavaScript. */
.nd-scale { display: flex; align-items: center; margin: 0 0 12px; border: 1px solid var(--vf-ink); width: max-content; max-width: 100%; }
.nd-scale-l { padding: 0 12px; color: var(--vf-mute); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nd-scale a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-left: 1px solid var(--vf-ink); color: var(--vf-ink); font-weight: 700; text-decoration: none; }
.nd-scale a[aria-current="true"] { background: var(--vf-ink); color: var(--vf-surface); }

/* Forms */
.nd-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 8px; }
.nd-form label { flex: 0 0 auto; color: var(--vf-ink); font-weight: 700; }
.nd-form input, .nd-form select { min-width: 0; max-width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--vf-rule-strong); border-radius: var(--vf-radius); background: var(--vf-surface); color: var(--vf-ink); font: inherit; }
.nd-form select { flex: 1 1 220px; }
.nd-form-2 { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--vf-rule-strong); }

/* One answer, set large */
.nd-result { margin: 12px 0 8px; padding: 12px 14px; background: var(--vf-surface); }
.nd-result-k { margin: 0; color: var(--vf-mute); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nd-result-v { margin: 2px 0 4px; color: var(--vf-ink); font: 700 1.5rem/1.15 var(--vf-font-head); overflow-wrap: anywhere; }
.nd-result-w { margin: 0 0 4px; color: var(--vf-ink-2); font-size: .95rem; }
.nd-result-c { margin: 6px 0 0; font-size: .9rem; }
.nd-err { margin: 8px 0; padding: 8px 12px; background: var(--vf-surface); color: var(--vf-ink); }
.nd-note { margin: 6px 0 0; color: var(--vf-ink-2); font-size: .88rem; font-style: italic; }
.nd-gap { color: var(--vf-ink-2); font-style: italic; }
.nd-cite { color: var(--vf-blue-text); font-weight: 700; }
.nd-csv { margin: 8px 0; font-size: .92rem; }

/* Two columns with the difference between them in a gutter. On phones the three stack. */
.nd-split-sheet { display: grid; margin: 14px 0 8px; border-bottom: 1px solid var(--vf-rule-strong); }
.nd-split-sheet p { margin: 0 0 3px; }
.nd-col, .nd-gutter { padding: 12px 0; border-top: 1px solid var(--vf-rule); overflow-wrap: anywhere; }
.nd-col:first-child { border-top: 0; }
.nd-col-k { color: var(--vf-mute); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nd-col-d { color: var(--vf-ink); font: 700 1.05rem var(--vf-font-head); }
.nd-col-v, .nd-gut-v { color: var(--vf-ink); font: 700 1.3rem/1.2 var(--vf-font-head); }
.nd-col-v.nd-small { font-size: 1.05rem; }
.nd-gutter { background: var(--vf-surface); padding-left: 12px; padding-right: 12px; }
.nd-sub { display: block; color: var(--vf-ink-2); font-size: .82rem; font-weight: 400; font-family: var(--vf-font-body); }
.nd-amt { display: block; color: var(--vf-ink); font-weight: 700; }

/* Tables: stacked records on phones, a ruled table from 760px. */
.nd-table { width: 100%; margin: 0 0 12px; border-collapse: collapse; }
.nd-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nd-table tr { display: block; margin: 0 0 8px; padding: 10px 12px; border: 1px solid var(--vf-rule-strong); background: var(--vf-surface); }
.nd-table th[scope="row"] { display: block; margin: 0 0 4px; color: var(--vf-ink); font: 700 1rem var(--vf-font-head); text-align: left; }
.nd-table td { display: block; padding: 3px 0; color: var(--vf-ink); font-size: .95rem; overflow-wrap: anywhere; }
.nd-table td::before { content: attr(data-label); display: block; color: var(--vf-mute); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.nd-sources { margin: 0 0 14px; padding-left: 1.1em; max-width: 48rem; }
.nd-sources li { margin: 0 0 8px; overflow-wrap: anywhere; }

@media (min-width: 760px) {
  .nd-readout { grid-template-columns: 1.3fr 1fr 1fr; }
  .nd-readout > div { padding: 14px 18px; border-top: 0; border-left: 1px solid var(--vf-rule); }
  .nd-readout > div:first-child { padding-left: 0; border-left: 0; }
  .nd-split-sheet { grid-template-columns: 1fr 14rem 1fr; }
  .nd-col, .nd-gutter { padding: 14px 18px; border-top: 0; border-left: 1px solid var(--vf-rule); }
  .nd-col:first-child { padding-left: 0; border-left: 0; }
  .nd-gutter { border-left: 1px solid var(--vf-rule-strong); border-right: 1px solid var(--vf-rule-strong); }
  .nd-table thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .nd-table tr { display: table-row; margin: 0; padding: 0; border: 0; background: transparent; }
  .nd-table th, .nd-table td { padding: 9px 10px; border-bottom: 1px solid var(--vf-rule); text-align: left; vertical-align: top; }
  .nd-table thead th { border-bottom: 2px solid var(--vf-ink); color: var(--vf-mute); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  .nd-table th[scope="row"] { display: table-cell; margin: 0; }
  .nd-table td { display: table-cell; font-size: .86rem; overflow-wrap: normal; }
  .nd-table .nd-amt { white-space: nowrap; }
  .nd-table th[scope="row"] { font-size: .95rem; }
  .nd-table td::before { content: none; }
}

/* Notes that follow a figure and the method paragraph at the foot of the page. */
.nd-after { margin: 4px 0 14px; color: var(--vf-ink-2); font-size: .95rem; }
.nd-method { margin-bottom: 12px; }
.nd-jump { margin: 12px 0 0; }
.nd-jump a { min-height: 40px; }

@media (max-width: 719px) {
  .nd-sec > .shell { display: flex; flex-direction: column; }
  .nd-sec > .shell > .nd-form { order: 20; }
}
@media (max-width: 719px) {
  .nd-jump { flex-wrap: nowrap; overflow-x: auto; gap: 0 20px; padding: 0; }
  .nd-jump a { white-space: nowrap; display: inline-flex; align-items: center; }
}
