@font-face { font-family: 'Crimson Pro'; src: url('../apps/fonts/crimson-pro-400.woff') format('woff'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Crimson Pro'; src: url('../apps/fonts/crimson-pro-400-italic.woff') format('woff'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Crimson Pro'; src: url('../apps/fonts/crimson-pro-700.woff') format('woff'); font-weight: 600 700; font-style: normal; font-display: swap; }

html:root {
  --bg: #d6d5c6 !important;
  --panel: #e2e0d1 !important;
  --ink: #22231f !important;
  --muted: #4b5049 !important;
  --rule: rgb(70 110 94 / 0.34) !important;
  --accent: #1f3463 !important;
  --ochre: #1f3463 !important;
  --hi: rgb(31 52 99 / 0.1) !important;
  color-scheme: light !important;
}
html:root[data-theme='slate'] {
  --bg: #1d2320 !important;
  --panel: #252c28 !important;
  --ink: #e4e6dd !important;
  --muted: #a9b0a6 !important;
  --rule: rgb(150 196 176 / 0.17) !important;
  --accent: #a9c6f2 !important;
  --ochre: #a9c6f2 !important;
  --hi: rgb(169 198 242 / 0.12) !important;
  color-scheme: dark !important;
}
html:root[data-theme='headlamp'] {
  --bg: #1a1312 !important;
  --panel: #221917 !important;
  --ink: #f0b2a2 !important;
  --muted: #bd8372 !important;
  --rule: rgb(240 130 110 / 0.16) !important;
  --accent: #ff8f72 !important;
  --ochre: #ff8f72 !important;
  --hi: rgb(255 143 114 / 0.12) !important;
  color-scheme: dark !important;
}

body { background: var(--bg) !important; color: var(--ink) !important; font-family: 'Crimson Pro', Georgia, serif !important; font-size: 18px !important; line-height: 1.6 !important; }
h1, h2, h3, h4, .kicker, .meta, nav.toc, nav#TOC, .note, figcaption, table, caption, p, li, td, th, .subtitle, .sub {
  font-family: 'Crimson Pro', Georgia, serif !important;
}
h1 { font-weight: 700 !important; letter-spacing: -0.012em; }
h2 { font-weight: 700 !important; font-size: 1.45rem !important; }
h3, .kicker { text-transform: none !important; letter-spacing: 0 !important; font-style: italic !important; font-weight: 400 !important; font-size: 1.05rem !important; color: var(--muted) !important; }
header, #title-block-header { border-bottom: 1.5px solid var(--rule) !important; }
a { color: var(--accent) !important; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
code, pre, kbd { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace !important; }
table { font-size: 0.95rem !important; }
th, td { border-color: var(--rule) !important; }
.plate, figure, .figure { background: transparent !important; border-color: var(--rule) !important; }
html:not([data-theme]) img, html:not([data-theme]) .plate svg { mix-blend-mode: multiply; }
html[data-theme='slate'] img, html[data-theme='slate'] .plate svg { background: #e2e0d1; border-radius: 3px; mix-blend-mode: normal; }
html[data-theme='slate'] .plate svg { padding: 10px 12px; box-sizing: border-box; }
html[data-theme='headlamp'] img, html[data-theme='headlamp'] .plate svg {
  filter: invert(0.9) grayscale(1) sepia(1) saturate(2.6) hue-rotate(-40deg) brightness(0.95);
}

.note { border-left: 0 !important; padding-left: 0 !important; font-style: italic; font-size: 1rem !important; }
th { letter-spacing: 0 !important; font-weight: 400 !important; font-style: italic; font-size: 0.95rem !important; }
code { border-radius: 0 !important; }
.meta { font-size: 1rem !important; font-style: italic; }
nav.toc, nav#TOC { font-size: 1rem !important; }
figcaption { text-transform: none !important; }

.tbl--stacked { overflow: visible !important; }
table.stacked { min-width: 0 !important; width: auto !important; max-width: 100%; margin: 0 auto; }
table.stacked th[scope='row'] { text-align: left; font-style: normal; white-space: normal; }
table.stacked td { text-align: right; padding-left: 2.5em; }

table { font-variant-numeric: tabular-nums lining-nums; }
thead th { border-bottom: 1.5px solid var(--ink) !important; vertical-align: bottom; }
tbody tr:last-child > * { border-bottom: 1.5px solid var(--ink) !important; }
tbody tr, tbody tr:nth-child(even), tbody tr:nth-child(odd) { background: none !important; }
.plate { border: 0 !important; padding: 4px 0 !important; }
figure .plate svg { max-width: 100%; height: auto; }
table.rules td { text-align: left !important; }

@media (max-width: 860px) {
  table.cards th, table.cards td { padding-left: 5px !important; padding-right: 5px !important; }
  table.cards { font-size: 0.88rem !important; }
}
@media (max-width: 420px) {
  th, td { padding-left: 6px !important; padding-right: 6px !important; }
}

@media (max-width: 640px) {
  .tbl:has(table.cards), div:has(> table.cards) { overflow: visible !important; }
  table.cards { width: 100% !important; min-width: 0 !important; }
  table.cards thead, table.cards colgroup { display: none !important; }
  table.cards, table.cards tbody, table.cards tr { display: block !important; width: 100% !important; }
  table.cards caption { display: block !important; }
  table.cards tr { border-bottom: 1px solid var(--rule) !important; padding: 8px 0 !important; }
  table.cards tbody tr:last-child { border-bottom: 1.5px solid var(--ink) !important; }
  table.cards [data-first], table.cards th[scope='row'] {
    display: block !important; border: 0 !important; padding: 0 0 4px !important; text-align: left !important;
    font-weight: 700 !important; font-style: normal !important; white-space: normal !important;
  }
  table.cards td[data-label] {
    display: flex !important; justify-content: space-between; align-items: baseline; gap: 16px;
    border: 0 !important; padding: 1px 0 !important; text-align: right !important; white-space: normal !important; width: 100% !important;
  }
  table.cards td[data-label]::before { content: attr(data-label); color: var(--muted); text-align: left; font-style: italic; }
  table.cards td[data-label=""]::before { content: none; }
}
