/* Shared styles for the /docs/ pages (state-tax engine documentation and the
 * API reference). Loaded after /css/tokens.css and /css/main.css, and built
 * only from their tokens so a theme flip (data-theme="dark") follows. */

body { background: var(--surface-page, #f7f8fa); color: var(--ink, #131a22); }

/* body is a flex column in main.css: without min-width:0 a wide table would
 * widen <main> past the viewport instead of scrolling inside .tbl. */
.docs-wrap { max-width: 920px; width: 100%; min-width: 0; box-sizing: border-box;
    margin: 0 auto; padding: 22px 16px 64px; font-size: 15.5px; }
.docs-wrap h1 { font-size: 1.7rem; line-height: 1.25; margin: 8px 0 12px; }
.docs-wrap h2 { font-size: 1.25rem; margin: 34px 0 10px; padding-top: 6px;
    border-top: 1px solid var(--border, #e3e7ec); }
.docs-wrap h3 { font-size: 1.05rem; margin: 22px 0 8px; }
.docs-wrap p, .docs-wrap li { line-height: 1.62; }
.docs-wrap a { color: var(--accent, #1e56c8); }
.docs-wrap a:hover { color: var(--accent-hover, #17439e); }

.lede { color: var(--ink-muted, #5b6674); font-size: 1.03rem; line-height: 1.65; }
.note { color: var(--ink-muted, #5b6674); font-size: 0.95rem; }

.crumbs { font-size: 0.88rem; color: var(--ink-faint, #6b7583); margin: 4px 0 2px; }
.crumbs a { color: inherit; }

.docs-nav { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.9rem;
    margin: 6px 0 16px; padding: 8px 0; border-bottom: 1px solid var(--border, #e3e7ec); }
.docs-nav a { text-decoration: none; }
.docs-nav a[aria-current="page"] { font-weight: 600; color: var(--ink, #131a22); }

/* Tables scroll inside their own box on narrow screens; the page never does. */
.tbl { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0 16px; }
.tbl table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
.tbl th, .tbl td { text-align: left; padding: 7px 9px; vertical-align: top;
    border-bottom: 1px solid var(--border, #e3e7ec); }
.tbl th { font-weight: 600; background: var(--surface-raised, #eef1f5); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

pre { background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 12px 14px;
    overflow-x: auto; font-size: 0.85rem; line-height: 1.5; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
p code, li code, td code { background: var(--surface-raised, #eef1f5); padding: 1px 5px;
    border-radius: 4px; font-size: 0.9em; overflow-wrap: anywhere; }

.rule { margin: 0 0 6px; }
.rule .engine { margin: 6px 0; }
.sources { font-size: 0.9rem; color: var(--ink-muted, #5b6674); margin: 6px 0 4px;
    padding-left: 1.1em; }
.sources li { margin: 3px 0; overflow-wrap: anywhere; }
.sources .checked { white-space: nowrap; color: var(--ink-faint, #6b7583); }
.flag { border-left: 3px solid var(--warn, #a05e03); background: var(--surface-raised, #eef1f5);
    padding: 8px 12px; margin: 8px 0; font-size: 0.93rem; border-radius: 0 6px 6px 0; }
.flag.unsourced { border-left-color: var(--danger, #b3261e); }

.badge { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 2px 8px;
    border-radius: 999px; border: 1px solid var(--border-strong, #c9d0d9);
    background: var(--surface-card, #fff); white-space: nowrap; }
.badge.a { border-color: var(--ok, #177245); color: var(--ok, #177245); }
.badge.b { border-color: var(--accent, #1e56c8); color: var(--accent, #1e56c8); }
.badge.c { border-color: var(--warn, #a05e03); color: var(--warn, #a05e03); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px; margin: 12px 0 8px; }
.card { background: var(--surface-card, #fff); border: 1px solid var(--border, #e3e7ec);
    border-radius: 8px; padding: 12px 14px; }
.card h3 { margin: 0 0 4px; font-size: 1rem; }
.card p { margin: 0; font-size: 0.93rem; color: var(--ink-muted, #5b6674); }

.statelist { columns: 3 190px; column-gap: 20px; padding-left: 1.1em; }

/* "How the tax is computed" walk-throughs and the calculation-order page. */
.calc-steps { padding-left: 1.4em; }
.calc-steps > li { margin: 0 0 10px; overflow-wrap: anywhere; }
.calc-steps .scope, .calc-step .scope { display: inline-block; font-size: 0.8rem; font-weight: 600;
    padding: 0 7px; border-radius: 999px; border: 1px solid var(--border-strong, #c9d0d9);
    color: var(--ink-muted, #5b6674); background: var(--surface-card, #fff); }
.calc-steps .step-src, .calc-step .step-meta { font-size: 0.88rem; color: var(--ink-muted, #5b6674); }
.calc-step { border-top: 1px solid var(--border, #e3e7ec); padding: 6px 0 4px; }
.calc-step h3 { margin: 10px 0 4px; }
.calc-step .step-meta { margin: 4px 0; overflow-wrap: anywhere; }
details.trace { margin: 6px 0; border: 1px solid var(--border, #e3e7ec); border-radius: 8px;
    background: var(--surface-card, #fff); padding: 4px 12px; }
details.trace summary { cursor: pointer; padding: 6px 0; font-weight: 600; overflow-wrap: anywhere; }
code.err { white-space: normal; }

.docs-foot { margin-top: 40px; padding-top: 12px; border-top: 1px solid var(--border, #e3e7ec);
    font-size: 0.88rem; color: var(--ink-faint, #6b7583); }

@media (max-width: 520px) {
    .docs-wrap h1 { font-size: 1.4rem; }
    .tbl table { font-size: 0.86rem; }
}
