:root {
  color-scheme: dark;
  --bg: #071117;
  --surface: #0e1c24;
  --surface-2: #132730;
  --line: #2b414b;
  --text: #f4f8f9;
  --muted: #a9bac1;
  --green: #53c878;
  --cyan: #55bfd1;
  --gold: #e2bf62;
  --danger: #ff8f8f;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.55; }
body { margin: 0; min-width: 280px; }
a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: #8ed8e4; }
button, input, select { font: inherit; }
img { display: block; max-width: 100%; height: auto; }
code { overflow-wrap: anywhere; color: var(--gold); }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 20; padding: 8px 12px; background: var(--text); color: var(--bg); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.site-header { min-height: 68px; padding: 10px max(18px, calc((100vw - var(--max)) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); background: #09161c; }
.brand { flex: 0 0 auto; }
.brand img { width: 220px; }
.site-header nav, .site-footer nav { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.site-header nav > a, .site-footer nav > a { color: var(--text); text-decoration: none; }
.site-header nav > a:hover, .site-footer nav > a:hover { color: var(--cyan); }
.band { border-bottom: 1px solid var(--line); }
.band-muted { background: var(--surface); }
.content { width: min(var(--max), calc(100% - 36px)); margin: 0 auto; padding: 48px 0; }
.content.narrow { max-width: 760px; }
.hero .content { min-height: 420px; display: flex; flex-direction: column; justify-content: center; }
h1, h2, h3 { margin: 0 0 16px; line-height: 1.15; letter-spacing: 0; }
h1 { max-width: 900px; font-size: 4rem; }
h2 { font-size: 2rem; }
p { margin: 0 0 16px; }
.lede { max-width: 720px; color: var(--muted); font-size: 1.15rem; }
.eyebrow { margin-bottom: 12px; color: var(--green); font-weight: 800; text-transform: uppercase; font-size: .78rem; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin-top: 12px; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 9px 15px; border: 1px solid #69db8c; border-radius: 6px; background: #1d6b3a; color: #fff; font-weight: 750; text-decoration: none; cursor: pointer; }
.button:hover { background: #248249; color: #fff; }
.button:disabled { opacity: .55; cursor: wait; }
.button-compact { min-height: 36px; padding: 6px 11px; }
.button-secondary { border-color: #506872; background: #12262e; }
.button-secondary:hover { background: #18343d; }
.text-link { font-weight: 700; }
.link-grid { border-top: 1px solid var(--line); }
.link-row { display: grid; grid-template-columns: minmax(180px, .55fr) 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.link-row strong { color: var(--text); }
.link-row span { color: var(--muted); }
.tool-layout, .receipt-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); align-items: start; gap: 48px; }
.tool-copy { max-width: 700px; }
.tool-copy h1 { font-size: 3.2rem; }
.tool-panel { border-left: 3px solid var(--green); padding-left: 24px; }
.tool-panel .subtool { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
.tool-panel h2 { font-size: 1.15rem; }
.formula { padding: 14px 16px; border-left: 3px solid var(--cyan); background: var(--surface); color: var(--text); }
.calculator-form, .lookup-form { display: grid; gap: 15px; }
.calculator-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(96px, .35fr); gap: 10px; }
label { display: grid; gap: 6px; color: var(--muted); font-weight: 700; }
input, select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #506872; border-radius: 5px; background: #071117; color: var(--text); }
input:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.input-action { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.form-error { color: var(--danger); font-weight: 700; }
output, .lookup-result { display: block; min-height: 26px; font-weight: 800; color: var(--green); }
.lookup-result .button { margin-top: 6px; }
.identity-row { display: flex; align-items: center; gap: 14px; }
.profile-heading { margin-bottom: 28px; }
.avatar { width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.avatar-fallback { display: inline-block; }
.badge-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 6px 0 0; list-style: none; }
.badge-list li { padding: 3px 7px; border: 1px solid #866f35; border-radius: 4px; color: var(--gold); font-size: .78rem; }
.receipt-code { color: var(--gold); font: 700 1.05rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.detail-grid, .metric-grid, .method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); }
.detail-grid > div, .metric-grid > div, .method-grid > div { min-width: 0; padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: .78rem; font-weight: 750; text-transform: uppercase; }
dd { margin: 4px 0 0; overflow-wrap: anywhere; font-weight: 700; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 700px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
thead { background: var(--surface-2); }
.receipt-list { padding: 0; margin: 0; list-style: none; border-top: 1px solid var(--line); }
.receipt-list li { border-bottom: 1px solid var(--line); }
.receipt-list a { display: grid; grid-template-columns: minmax(180px, .5fr) 1fr; gap: 20px; padding: 14px 0; text-decoration: none; }
.receipt-list strong { color: var(--text); }
.receipt-list span, .disclaimer { color: var(--muted); }
.article { max-width: 860px; }
.article > h2 { margin-top: 34px; }
.article > h2:first-child { margin-top: 0; }
.article p, .article li { color: var(--muted); }
.article li + li { margin-top: 8px; }
.article-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 42px; }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { padding: 14px 0; border-bottom: 1px solid var(--line); }
.faq-list summary { color: var(--text); font-weight: 750; cursor: pointer; }
.faq-list details p { margin: 10px 0 0; }
.related-links { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.article-cta { margin-top: 36px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.article-cta h2 { margin-bottom: 10px; }
.publication-meta { max-width: 760px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.publication-meta strong { color: var(--text); }
.prose-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 48px; }
.prose-grid > section { min-width: 0; }
.prose-grid h2 { font-size: 1.45rem; }
.prose-grid p, .prose-grid li { color: var(--muted); }
.stat-note { margin-top: 22px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.timeline-list { padding: 0; margin: 0; list-style: none; border-top: 1px solid var(--line); }
.timeline-list li { display: grid; grid-template-columns: minmax(140px, .35fr) 1fr; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline-list strong { color: var(--text); }
.timeline-list span { color: var(--muted); }
.legal-links { display: grid; gap: 8px; margin: 20px 0; }
.site-footer { width: min(var(--max), calc(100% - 36px)); margin: 0 auto; padding: 32px 0; display: grid; gap: 18px; color: var(--muted); }
.site-footer > div:first-child { display: flex; flex-wrap: wrap; gap: 12px; }
.site-footer strong { color: var(--text); }
.analytics-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.analytics-controls button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--text); cursor: pointer; }

@media (max-width: 760px) {
  .site-header { align-items: flex-start; flex-direction: column; gap: 10px; }
  .brand img { width: 190px; }
  .site-header nav { width: 100%; gap: 10px 14px; }
  .content { padding: 34px 0; }
  h1, .tool-copy h1 { font-size: 2.2rem; }
  h2 { font-size: 1.45rem; }
  .hero .content { min-height: 340px; }
  .tool-layout, .receipt-layout { grid-template-columns: 1fr; gap: 28px; }
  .tool-panel { border-left: 0; border-top: 3px solid var(--green); padding: 22px 0 0; }
  .detail-grid, .metric-grid, .method-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-columns { grid-template-columns: 1fr; gap: 14px; }
  .prose-grid { grid-template-columns: 1fr; gap: 18px; }
  .link-row, .receipt-list a { grid-template-columns: 1fr; gap: 4px; }
  .timeline-list li { grid-template-columns: 1fr; gap: 3px; }
}

@media (max-width: 440px) {
  .content, .site-footer { width: min(100% - 28px, var(--max)); }
  .input-action { grid-template-columns: 1fr; }
  .calculator-actions { grid-template-columns: 1fr; }
  .detail-grid, .metric-grid, .method-grid { grid-template-columns: 1fr; }
  .button { width: 100%; }
  .site-header .button { width: auto; }
}
