:root {
  color-scheme: dark;
  --canvas: #17181c;
  --raised: #1d1f25;
  --header: #24262d;
  --line: #34363e;
  --text: #f2f2f4;
  --muted: #b8bac2;
  --accent: #becaff;
  --accent-soft: #303951;
  --header-height: 64px;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  font: 16px/1.6 system-ui, sans-serif;
  color: var(--text);
  background: var(--canvas);
  scroll-padding-top: calc(var(--header-height) + 1rem);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden], .budgethub:not([href]) { display: none !important; }
body { margin: 0; overflow-wrap: anywhere; }
h1, h2, h3, h4, p, dl { margin: 0; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: #e2e7ff; }
button, input, select { font: inherit; }
button, summary, select { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 4; top: .5rem; left: .5rem; background: var(--header); padding: .5rem .8rem; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.site-header { position: sticky; top: 0; z-index: 3; background: var(--header); border-bottom: 1px solid var(--line); }
.header-inner { min-height: var(--header-height); padding-inline: clamp(16px, 2vw, 30px); display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-size: 1.3rem; font-weight: 650; text-decoration: none; }
.brand-mark { width: 18px; height: 18px; border: 1.5px solid currentColor; border-radius: 4px; transform: rotate(-9deg); }
.header-link { font-size: .84rem; color: var(--muted); text-decoration: none; }
.header-link:hover { text-decoration: underline; }

.docs-layout { display: grid; grid-template-columns: 238px minmax(0, 1fr) 222px; max-width: 1600px; margin-inline: auto; }
.docs-sidebar, .docs-toc { position: sticky; top: var(--header-height); align-self: start; max-height: calc(100vh - var(--header-height)); overflow-y: auto; padding: 1.4rem .9rem; }
.docs-sidebar { border-right: 1px solid var(--line); min-height: calc(100vh - var(--header-height)); }
.docs-toc { border-left: 1px solid var(--line); padding-inline: 1.1rem; }
.docs-layout nav { display: grid; gap: .15rem; }
.docs-layout nav p { color: var(--text); font-size: .88rem; font-weight: 700; padding-inline: .5rem; margin-bottom: .2rem; }
.docs-layout nav p:not(:first-child) { margin-top: .85rem; }
.docs-layout nav a { display: flex; align-items: center; min-height: 37px; padding: .24rem .5rem; color: var(--muted); text-decoration: none; border-radius: .25rem; font-size: .83rem; line-height: 1.35; }
.docs-layout nav a:hover { background: var(--header); color: var(--text); }
.docs-layout nav .current-page { background: var(--accent); color: #182344; font-weight: 680; }
.docs-layout nav .current-page:hover { background: #d8dfff; color: #182344; }
.docs-toc nav a { padding-left: .75rem; border-left: 1px solid var(--line); border-radius: 0; }
.docs-toc nav a:hover { border-color: var(--accent); }
.docs-content { min-width: 0; width: min(100%, 1010px); margin-inline: auto; padding: 1.9rem clamp(18px, 3.3vw, 54px) 0; }
.mobile-toc { display: none; }

.hero { padding: 0 0 1.5rem; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--accent); font-size: .82rem; font-weight: 600; }
h1 { font-size: clamp(2.05rem, 4.1vw, 3.25rem); line-height: 1.1; letter-spacing: -.04em; font-weight: 750; margin: .42rem 0 .65rem; text-wrap: balance; }
h1 em { font-style: normal; }
.intro { color: var(--muted); max-width: 55ch; }
.hero-budgethub { margin-top: .65rem; }
.hero-budgethub a {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  max-width: 100%;
  min-height: 44px;
  padding: .4rem .7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  font-size: .85rem;
  font-weight: 600;
}
.tool-section { margin-top: 1.7rem; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .25rem .75rem; margin-bottom: .65rem; }
h2 { font-size: clamp(1.25rem, 2.7vw, 1.65rem); line-height: 1.25; letter-spacing: -.025em; }
.section-heading p { color: var(--muted); font-size: .77rem; }

.checker-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem .75rem; padding: .82rem; background: var(--raised); border: 1px solid var(--line); border-radius: 5px; }
.field { min-width: 0; }
.field label, #manual-link-label { display: block; margin-bottom: .2rem; font-size: .81rem; font-weight: 650; }
select, input { min-height: 44px; width: 100%; min-width: 0; padding: .38rem .5rem; background: var(--canvas); color: var(--text); border: 1px solid #555864; border-radius: .35rem; font-size: .85rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.checker-controls > :not(.field) { grid-column: 1 / -1; }
.copy-button, .budgethub { display: inline-flex; justify-content: center; align-items: center; gap: .35rem; min-height: 44px; padding: .35rem .75rem; border: 1px solid #565966; border-radius: 5px; background: var(--header); color: var(--text); text-decoration: none; text-align: center; font-size: .8rem; font-weight: 650; line-height: 1.3; }
.copy-button:hover:not(:disabled) { background: #30333c; border-color: var(--accent); }
.budgethub { background: var(--accent); border-color: var(--accent); color: #172343; }
.budgethub:hover { background: #dce3ff; color: #172343; }
.budgethub-hint { flex-basis: 100%; width: 0; color: var(--muted); font-size: .8rem; }
#budgethub:not([href]) + .budgethub-hint { display: none; }
.copy-status, .small { color: var(--muted); font-size: .8rem; }
.copy-status:empty, .notice:empty { display: none; }

.result-summary { border: 1px solid #465574; border-inline-start: 4px solid #96a9fa; background: #222941; padding: .85rem .95rem; margin-top: .95rem; }
.result-summary:has(.verdict--caveats, .verdict--unconfirmed) { background: #2b251c; border-color: #6c542e; border-inline-start-color: #e0aa56; }
.result-summary:has(.verdict--unsupported) { background: #2e2027; border-color: #71465a; border-inline-start-color: #e2859e; }
.result-context { font-size: .75rem; color: var(--muted); }
.verdict { font-size: 1.12rem; margin: .15rem 0 .22rem; }
.verdict--supported { color: #c5d4ff; }
.verdict--caveats, .verdict--unconfirmed { color: #ffd088; }
.verdict--unsupported { color: #ffc0d0; }
#result-reason { font-size: .91rem; }
.notice { color: #ffd088; font-size: .83rem; margin-top: .25rem; }
.result-steps { padding: .95rem 0; }
.result-steps h4 { font-size: .96rem; }
#result-steps { padding-left: 1.25rem; margin: .35rem 0 0; color: var(--muted); font-size: .89rem; }
#result-steps li + li { margin-top: .2rem; }
details > summary { padding: .55rem 0; font-size: .88rem; font-weight: 650; }
.result-evidence { border-block: 1px solid var(--line); padding-bottom: .1rem; }
.evidence-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; list-style: none; padding: 0; margin: 0 0 .65rem; }
.evidence-list li { border: 1px solid #465574; border-inline-start: 3px solid #96a9fa; padding: .55rem .65rem; background: #222941; font-size: .79rem; }
.evidence-list [data-status="unverified"] { border-color: #6c542e; border-inline-start-color: #e0aa56; background: #2b251c; }
.evidence-status { display: block; margin-bottom: .12rem; color: #c5d4ff; font-size: .73rem; font-weight: 720; }
[data-status="unverified"] .evidence-status, .unconfirmed { color: #ffd088; }
.source-list { margin: .45rem 0 .65rem; padding-left: 1.1rem; font-size: .81rem; }
.source-list li + li { margin-top: .15rem; }

.planner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: .85rem; }
.planner-input { padding: .8rem; background: var(--raised); border: 1px solid var(--line); border-radius: 5px; font-size: .87rem; color: var(--muted); }
.planner-label { font-weight: 700; color: var(--text); }
.planner-input .field, .planner-note, .planner-explanation p + p { margin-top: .55rem; }
.planner-explanation summary { color: var(--text); }
.planner-note { font-size: .85rem; color: var(--muted); }
.planner-result { min-width: 0; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem; margin: 0 0 .55rem; }
.metrics div { padding: .45rem .5rem; border: 1px solid var(--line); border-radius: 4px; }
.metrics dt { color: var(--muted); font-size: .71rem; line-height: 1.3; }
.metrics dd { margin: .1rem 0 0; font-family: var(--mono); }
.metrics small { color: var(--muted); font-size: .65rem; }
.code-card { border: 1px solid #3d4151; border-radius: .35rem; background: #101116; }
.code-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem; padding: .35rem .55rem; background: var(--header); border-bottom: 1px solid #3d4151; color: #d3d6e3; font: .79rem var(--mono); }
pre { margin: 0; padding: .75rem; overflow: auto; font: .86rem/1.6 var(--mono); color: #b7e2b8; }
pre code { font: inherit; }

.table-frame { max-width: 100%; overflow-x: auto; border-bottom: 1px solid var(--line); }
table { width: 100%; min-width: 440px; border-collapse: collapse; font-size: .86rem; text-align: left; }
th, td { border-bottom: 1px solid var(--line); padding: .55rem .62rem; }
thead { background: var(--header); }
tbody tr:nth-child(even) { background: var(--raised); }
tbody tr:last-child > * { border-bottom: 0; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details p { color: var(--muted); font-size: .91rem; }
.source-index, .related-links { columns: 2; column-gap: 1.4rem; }
.source-index li, .related-links li { break-inside: avoid; }
.site-footer { margin-top: 1.8rem; padding: 1rem 0 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.site-footer h2 { color: var(--text); font-size: 1.02rem; }
.related-links { padding-left: 1rem; margin-block: .6rem; }

@media (max-width: 1200px) {
  .docs-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .docs-toc { display: none; }
  .mobile-toc { display: block; border: 1px solid var(--line); border-radius: 4px; margin-bottom: 1.1rem; padding-inline: .7rem; background: var(--raised); }
  .mobile-toc nav { padding-bottom: .45rem; }
}
@media (max-width: 820px) {
  .docs-layout { display: block; }
  .docs-sidebar { display: none; }
  .docs-content { padding-top: .8rem; }
}
@media (max-width: 610px) {
  .desktop-break { display: none; }
  .checker-controls, .planner, .evidence-list { grid-template-columns: minmax(0, 1fr); }
  .source-index, .related-links { columns: 1; }
}
