/* Article and source styles extend the shared field-guide palette. */
.article-header {
  padding-block: 18px 32px;
  border-bottom: 1px solid var(--color-rule);
}
.crumb, .byline, .related nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; }
.crumb, .byline { color: var(--color-muted); font-size: 14px; }
.crumb a, .byline a { display: inline-flex; align-items: center; min-height: 44px; }
.crumb a:hover, .byline a:hover { color: var(--color-accent); text-decoration: underline; }
.byline a { color: var(--color-text); font-weight: 650; }
.article-heading { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-top: 12px; }
.article-heading > div:first-child { min-width: 0; }
.article-heading h1, .missing h1 {
  max-width: 24ch;
  margin-block: 10px;
  color: var(--color-heading);
  font-size: clamp(38px, 4.6vw, 70px);
  line-height: 1.04;
  letter-spacing: -.055em;
}
.article-diagram {
  flex: none;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border-radius: var(--radius-medium);
}
.article-diagram .icon { width: 65px; height: 65px; }
.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 50rem) minmax(12rem, 18rem);
  justify-content: space-between;
  gap: clamp(32px, 7vw, 112px);
  padding-block: 36px 64px;
}
.toc { position: sticky; top: 16px; padding-left: 20px; border-left: 1px solid var(--color-rule); }
.toc a { display: flex; align-items: center; min-height: 44px; color: var(--color-muted); font-size: 14px; }
.toc a:hover { color: var(--color-accent); text-decoration: underline; }
.mobile-toc { display: none; }
.prose { min-width: 0; font-size: 17px; line-height: 1.65; }
.prose h2, .prose h3 {
  margin-block: 1.5em .45em;
  color: var(--color-heading);
  line-height: 1.13;
  letter-spacing: -.045em;
}
.prose h2 { font-size: clamp(26px, 2.5vw, 36px); }
.prose h3 { font-size: clamp(21px, 1.75vw, 26px); }
.prose p + p { margin-top: .85em; }
.prose .intro { font-size: 1.12em; }
.prose ul, .prose ol { padding-left: 1.4em; margin-block: .75em; }
.prose ul { list-style: disc; }
.prose li + li { margin-top: .4em; }
.prose a, .about-guide p a, .no-js-note a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: .18em;
}
.prose code { font: .88em var(--font-label); overflow-wrap: anywhere; }
.path { padding: 12px 16px; background: var(--color-surface); border: 1px solid var(--color-rule); border-radius: var(--radius-small); }
.short-answer, .briefing { padding: 18px 22px; background: var(--color-accent-soft); border-left: 3px solid var(--color-accent); }
.prose :is(.short-answer, .briefing) h2 { margin: 0 0 8px; font: 700 14px/1.4 var(--font-label); text-transform: uppercase; letter-spacing: 0; }
.prose .checklist { padding: 0; list-style: none; }
.checklist li { padding: 8px 0; border-bottom: 1px solid var(--color-rule); }
.checklist li::before { content: "✓"; color: var(--color-accent); margin-right: 8px; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  text-align: left;
  font-size: 15px;
  line-height: 1.5;
  background: var(--color-surface);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}
.prose caption { text-align: left; padding: 0 0 10px; font-weight: 650; }
.table-date { display: block; color: var(--color-muted); margin-top: 3px; font: 12px/1.45 var(--font-label); }
.table-term { white-space: nowrap; }
.prose :is(th, td) { padding: 10px 12px; border-bottom: 1px solid var(--color-rule); vertical-align: top; }
.prose thead th { background: var(--color-accent-soft); font: 650 13px/1.4 var(--font-label); }
.prose th[scope="row"] { font-weight: 650; }
.prose table ul { margin: 0; padding-left: 1.1em; }
:not(.wide-table) > table th:first-child { width: 35%; }
.wide-table { max-width: 100%; overflow-x: auto; margin-block: 18px; }
.wide-table table { min-width: 38rem; margin: 0; }
.wide-table th[scope="row"] { min-width: 8rem; }
.wide-table caption { position: sticky; left: 0; width: min(100%, 82vw); }
.cited-tail { display: inline-block; white-space: nowrap; }
.citations { font: 500 11px/1 var(--font-label); }
.citations :is(a, button) {
  display: inline-block;
  text-align: center;
  width: max(44px, 8ch);
  min-height: 44px;
  vertical-align: middle;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-accent);
  font: inherit;
  line-height: 44px;
  text-decoration: underline;
  text-underline-offset: .2em;
}
.citation-panel {
  padding: 16px;
  max-width: min(29rem, 90vw);
  max-height: 85vh;
  overflow: auto;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
}
.citation-panel::backdrop { background: rgb(17 24 39 / 45%); }
.citation-panel a, .sources a { display: flex; align-items: center; min-height: 44px; }
.citation-panel button { padding: 0 16px; min-height: 44px; background: var(--color-page); border: 1px solid var(--color-border); border-radius: var(--radius-small); }
.sources ol, .citation-panel { font-size: 15px; }
.sources li:target { background: var(--color-accent-soft); outline: 1px solid var(--color-accent); }
.prose .related a {
  display: flex; align-items: center; gap: 12px; min-height: 44px;
  padding: 8px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-small);
  color: var(--color-text); font-weight: 600; text-decoration: none;
}
.related a:hover { background: var(--color-accent-soft); }
.related .icon { width: 18px; height: 18px; color: var(--color-accent); }
.home-content { max-width: 52rem; margin-bottom: 56px; }
.hero + .prose .briefing { margin-top: 16px; }
.hero + .prose .briefing p { max-width: 80ch; }
.about-guide .byline { margin-top: 12px; }
.missing { padding-block: 64px; min-height: 55vh; }
.missing .button { margin-top: 20px; }

@media (max-width: 959px) {
  .article-grid { grid-template-columns: minmax(0, 1fr); }
  .article-grid aside { display: none; }
  .mobile-toc { display: block; margin-top: 16px; border-block: 1px solid var(--color-rule); }
  .mobile-toc summary, .prose details:has(> .wide-table) > summary { min-height: 44px; padding-block: 10px; cursor: pointer; }
  .mobile-toc nav a { display: flex; align-items: center; min-height: 44px; }
}

@media (max-width: 720px) {
  .article-diagram { display: none; }
  .article-header { padding-block: 8px 20px; }
  .article-grid { padding-block: 24px 42px; }
  .prose { font-size: 16px; }
  :not(.wide-table) > table { table-layout: fixed; }
  .prose :is(th, td) { padding: 8px 6px; }
  .wide-table caption::after { content: "Scroll for all columns →"; display: block; color: var(--color-muted); font-size: 12px; }
  .wide-table th[scope="row"] { position: sticky; left: 0; background: var(--color-surface); }
}

@media (max-width: 600px) {
  .wide-table { overflow: visible; }
  .prose table, .prose caption, .prose tbody, .prose tbody tr, .prose tbody :is(th, td) { display: block; }
  .prose table { min-width: 0; background: transparent; }
  .prose caption { position: static; width: 100%; }
  .wide-table caption::after { content: none; }
  .prose thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .prose tbody tr {
    margin-bottom: 12px;
    border: 1px solid var(--color-rule);
    border-radius: var(--radius-small);
    background: var(--color-surface);
  }
  .prose table tbody th[scope="row"] {
    position: static;
    width: auto;
    min-width: 0;
    background: var(--color-accent-soft);
  }
  .prose tbody :is(th, td) { padding: 8px 12px; overflow-wrap: anywhere; }
  .prose tbody :last-child:is(th, td) { border-bottom: 0; }
  .prose tbody [data-label]::before {
    content: attr(data-label);
    content: attr(data-label) / "";
    display: block;
    color: var(--color-muted);
    font: 600 12px/1.5 var(--font-label);
  }
}
