:root {
    --text: #2d2d2d;
    --bg: #fafafa;
    --accent: #1a4a6e;
    --accent-dark: #102f47;
    --accent-soft: #eef3f7;
    --border: #ddd;
    --code-bg: #f0f0f0;
    --muted: #555;
    --subtle: #777;
    --surface: #fff;
    --surface-soft: #f5f7f8;
    --input-bg: #fff;
    --input-border: #c9c9c9;
    --selected: #eef3f7;
    --chart-empty: #eef3f7;
    --chart-hole: #fafafa;
    --overlay-bg: rgba(16, 22, 27, 0.5);
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
    --max-width: 760px;
}

[data-theme="dark"] {
    --text: #e7edf2;
    --bg: #111517;
    --accent: #8db8d8;
    --accent-dark: #cce4f5;
    --accent-soft: #1d2a32;
    --border: #33424d;
    --code-bg: #202930;
    --muted: #bac4cc;
    --subtle: #9ba8b2;
    --surface: #171d21;
    --surface-soft: #1b252b;
    --input-bg: #11181c;
    --input-border: #43525e;
    --selected: #203343;
    --chart-empty: #202b33;
    --chart-hole: #111517;
    --overlay-bg: rgba(2, 5, 8, 0.74);
    --shadow: 0 18px 70px rgba(0, 0, 0, 0.58);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 17px;
}

a {
    color: var(--accent);
    text-underline-offset: 2px;
    text-decoration-color: rgba(26, 74, 110, 0.4);
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
    color: var(--accent-dark);
    text-decoration-color: currentColor;
}

header {
    position: relative;
    border-bottom: 2px solid var(--accent);
    padding: 3rem 1.5rem 1.75rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

header h1 {
    font-size: 2rem;
    line-height: 1.25;
    letter-spacing: -0.015em;
    color: var(--accent);
    margin-bottom: 0.55rem;
}

header p {
    font-size: 1rem;
    color: var(--muted);
}

header p.eyebrow {
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

header p.eyebrow a {
    text-decoration: none;
}

.docs-home-page {
    --text: #24313a;
    --bg: #f7f9fb;
    --surface: #ffffff;
    --surface-soft: #eef4f8;
    --accent: #1f6288;
    --accent-dark: #154961;
    --accent-soft: #dcebf4;
    --border: #d8e1e7;
    --muted: #5f6f7b;
    --max-width: 1120px;
}

.docs-home-page[data-theme="dark"],
[data-theme="dark"] .docs-home-page {
    --text: #e7edf2;
    --bg: #111517;
    --surface: #171d21;
    --surface-soft: #1b252b;
    --accent: #8db8d8;
    --accent-dark: #cce4f5;
    --accent-soft: #1d2a32;
    --border: #33424d;
    --muted: #bac4cc;
}

.docs-layout {
    display: grid;
    grid-template-columns: 17rem minmax(0, 1fr);
    min-height: 100vh;
}

.docs-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 2rem 1.25rem;
    background: var(--surface);
    border-right: 1px solid var(--border);
}

.docs-brand {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--muted);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
}

.docs-sidebar h2 {
    margin: 0.55rem 0 0.3rem;
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.docs-sidebar ul {
    list-style: none;
}

.docs-sidebar nav {
    max-width: none;
    margin: 0;
    padding: 0;
}

.docs-sidebar nav + nav {
    margin-top: 0.7rem;
}

.docs-sidebar li + li {
    margin-top: 0.28rem;
}

.docs-sidebar a {
    display: block;
    padding: 0.22rem 0;
    text-decoration: none;
}

.docs-sidebar a[aria-current="page"] {
    color: var(--text);
    font-weight: 700;
}

.sidebar-toggle {
    position: fixed;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.sidebar-menu-button,
.sidebar-backdrop {
    display: none;
}

.tracker-page .theme-toggle {
    position: absolute;
    z-index: 40;
}

.tracker-page .sidebar-menu-button {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    z-index: 40;
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.22rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.12);
    cursor: pointer;
}

.tracker-page .sidebar-menu-button span {
    display: block;
    width: 1.15rem;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.tracker-page .docs-layout {
    grid-template-columns: 1fr;
}

.tracker-page .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 35;
    width: min(17rem, 85vw);
    height: 100vh;
    padding: 3.8rem 1.25rem 2rem;
    border-right: 1px solid var(--border);
    border-bottom: 0;
    box-shadow: var(--shadow);
    transform: translateX(-100%);
    transition: transform 0.18s ease;
}

.tracker-page .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: var(--overlay-bg);
}

.tracker-page .sidebar-toggle:checked ~ .sidebar-backdrop {
    display: block;
}

.tracker-page .sidebar-toggle:checked ~ .docs-layout .docs-sidebar {
    transform: translateX(0);
}

.docs-content {
    width: min(46rem, calc(100vw - 21rem));
    margin: 0 auto;
    padding: 3.2rem 0 4rem;
}

.docs-content .eyebrow {
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.docs-content h1 {
    color: var(--accent);
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.12;
    margin-bottom: 0.8rem;
}

.docs-content .lede {
    max-width: 40rem;
    color: var(--muted);
    font-size: 1.08rem;
}

.docs-content section {
    margin-top: 2.2rem;
    padding-top: 0;
}

.docs-content h2 {
    color: var(--accent);
    font-size: 1.35rem;
    line-height: 1.25;
    margin-bottom: 0.45rem;
}

.docs-link-list {
    margin-top: 0.5rem;
    list-style: disc;
    padding-left: 1.2rem;
}

.docs-link-list li {
    padding: 0.35rem 0;
}

.contributors-list {
    margin-top: 0.5rem;
    list-style: disc;
    padding-left: 1.2rem;
}

.contributors-list li {
    padding: 0.35rem 0;
}

.contributor-name {
    font-weight: 600;
}

.contributor-affiliation {
    color: var(--subtle);
    font-size: 0.9rem;
}


.docs-category-list {
    counter-reset: category;
    margin-top: 0.7rem;
    list-style: none;
}

.docs-category-list li {
    counter-increment: category;
    display: grid;
    grid-template-columns: 1.8rem minmax(0, 1fr);
    gap: 0.45rem;
    break-inside: avoid;
    margin-bottom: 0.45rem;
}

.docs-category-list li::before {
    content: counter(category) ".";
    color: var(--muted);
}

.category-intro {
    margin-top: 1rem;
}

/* Clickable list of pitfalls that open in the overlay (overlay variant). */
.pitfall-list {
    margin-top: 0.9rem;
    padding: 0;
    list-style: none;
}

.pitfall-list li {
    border-top: 1px solid var(--border);
}

.pitfall-list li:last-child {
    border-bottom: 1px solid var(--border);
}

.pitfall-list-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 0.7rem;
    gap: 0.55rem;
    align-items: center;
    width: 100%;
    padding: 0.8rem 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.pitfall-list-item::after {
    content: "";
    justify-self: end;
    width: 0;
    height: 0;
    border-top: 0.28rem solid transparent;
    border-bottom: 0.28rem solid transparent;
    border-left: 0.42rem solid currentColor;
}

.pitfall-list-item:hover {
    color: var(--accent-dark);
}

.pitfall-overlay-title {
    margin: 0 0 0.9rem;
    color: var(--accent);
    font-size: 1.4rem;
    line-height: 1.3;
}

/* Real-world bug examples shown beneath a pitfall's explanation. */
.pitfall-examples {
    margin-top: 1.5rem;
}

.pitfall-example {
    margin-bottom: 1rem;
    padding: 0.9rem 1.1rem;
    background: var(--surface-soft);
    border-left: 3px solid var(--accent);
    border-radius: 0 5px 5px 0;
}

.pitfall-example:last-child {
    margin-bottom: 0;
}

.pitfall-example-title {
    margin: 0 0 0.6rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.pitfall-example-kicker {
    display: inline-block;
    margin-right: 0.5em;
    padding: 1px 7px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--surface);
    background: var(--accent);
    border-radius: 3px;
    vertical-align: 0.12em;
}

.pitfall-example-title a {
    color: var(--accent);
    text-decoration: none;
}

.pitfall-example-title a:hover {
    text-decoration: underline;
}

.pitfall-example-refs {
    font-size: 0.82rem;
    font-weight: normal;
    color: var(--subtle);
}

.pitfall-example-refs a {
    color: var(--muted);
}

.pitfall-example-body > :first-child {
    margin-top: 0;
}

.pitfall-example-body > :last-child {
    margin-bottom: 0;
}

.theme-toggle {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.72;
}

.theme-toggle svg {
    display: block;
    width: 1.05rem;
    height: 1.05rem;
}

.theme-toggle:hover {
    color: var(--accent);
    background: var(--accent-soft);
    opacity: 1;
}

nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem 1.5rem;
}

nav h2 {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

nav ol {
    padding-left: 1.5rem;
}

nav ol li {
    margin-bottom: 0.3rem;
    font-size: 0.93rem;
}

nav ol li a {
    color: var(--accent);
    text-decoration: none;
}

nav ol li a:hover {
    text-decoration: underline;
}

main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

.pitfall {
    /* .pitfall is now just a grouping container for one file's content —
       no title, no card border; visual separation lives at the pitfall (h3) level. */
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.pitfall h3, .pitfall h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

/* Pitfall: a direct-child h3 inside a pitfall acts as its own sub-pitfall,
   visually separated from the next one by a dashed rule. */
.pitfall > h3 {
    margin-top: 2.25rem;
    padding-top: 1.25rem;
    border-top: 1px dashed var(--border);
    font-size: 1.1rem;
    font-weight: 600;
}

.pitfall > h3:first-of-type {
    margin-top: 1.25rem;
    padding-top: 0;
    border-top: none;
}

/* Status flags rendered just under a pitfall heading */
.pitfall-flags {
    margin-top: -0.25rem;
    margin-bottom: 0.9rem;
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.pitfall-flags .flag {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 800 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 3px;
    border: 2px solid;
    line-height: 1.5;
}

.pitfall-flags .flag::before {
    content: "\01F6A9"; /* 🚩 red flag */
    font-size: 0.95em;
    font-weight: normal;
    line-height: 1;
}

.pitfall-flags .flag-tbd {
    color: #d00000 !important;
    background: #ffe0e0;
    border-color: #d00000;
    border-style: solid;
}

.pitfall-flags .flag-shared {
    color: #d00000 !important;
    background: #ffe0e0;
    border-color: #d00000;
    border-style: dashed;
}

.pitfall-flags .flag-related {
    color: #d00000 !important;
    background: #ffe0e0;
    border-color: #d00000;
    border-style: dotted;
}

.pitfall-flags .flag a {
    color: #d00000 !important;
    text-decoration: underline;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 800;
}

.pitfall-flags .flag a:hover {
    color: #ff0000 !important;
}

.pitfall p {
    margin-bottom: 0.75rem;
}

.pitfall ul, .pitfall ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

.pitfall li {
    margin-bottom: 0.5rem;
}

.pitfall a {
    color: var(--accent);
}

.pitfall code {
    background: var(--code-bg);
    padding: 0.15em 0.35em;
    border-radius: 3px;
    font-size: 0.9em;
}

.pitfall .highlight {
    margin-bottom: 0.75rem;
    border-radius: 4px;
    overflow-x: auto;
}

.pitfall .highlight pre {
    padding: 0.75rem 1rem;
    margin: 0;
    font-size: 0.85em;
    line-height: 1.5;
    min-width: max-content;
}

.pitfall .highlight pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

/* Chroma syntax highlighting (monokailight) */
.chroma { color:#272822; background-color:#fafafa; }
.chroma .ln { white-space:pre; -webkit-user-select:none; user-select:none; margin-right:0.4em; padding:0 0.4em 0 0.4em; color:#7f7f7f }
.chroma .line { display:flex; }
.chroma .hl { background-color:#e1e1e1 }
.chroma .k { color:#00a8c8 }
.chroma .kc { color:#00a8c8 }
.chroma .kd { color:#00a8c8 }
.chroma .kn { color:#f92672 }
.chroma .kp { color:#00a8c8 }
.chroma .kr { color:#00a8c8 }
.chroma .kt { color:#00a8c8 }
.chroma .na { color:#75af00 }
.chroma .nc { color:#75af00 }
.chroma .no { color:#00a8c8 }
.chroma .nd { color:#75af00 }
.chroma .ne { color:#75af00 }
.chroma .nx { color:#75af00 }
.chroma .nf { color:#75af00 }
.chroma .fm { color:#75af00 }
.chroma .s { color:#d88200 }
.chroma .sa { color:#d88200 }
.chroma .sb { color:#d88200 }
.chroma .sc { color:#d88200 }
.chroma .dl { color:#d88200 }
.chroma .sd { color:#d88200 }
.chroma .s2 { color:#d88200 }
.chroma .se { color:#8045ff }
.chroma .sh { color:#d88200 }
.chroma .si { color:#d88200 }
.chroma .sx { color:#d88200 }
.chroma .sr { color:#d88200 }
.chroma .s1 { color:#d88200 }
.chroma .ss { color:#d88200 }
.chroma .m { color:#ae81ff }
.chroma .mb { color:#ae81ff }
.chroma .mf { color:#ae81ff }
.chroma .mh { color:#ae81ff }
.chroma .mi { color:#ae81ff }
.chroma .il { color:#ae81ff }
.chroma .mo { color:#ae81ff }
.chroma .o { color:#f92672 }
.chroma .ow { color:#f92672 }
.chroma .c { color:#75715e }
.chroma .ch { color:#75715e }
.chroma .cm { color:#75715e }
.chroma .c1 { color:#75715e }
.chroma .cs { color:#75715e }
.chroma .cp { color:#75715e }
.chroma .cpf { color:#75715e }
.chroma .ge { font-style:italic }
.chroma .gs { font-weight:bold }
.chroma .l { color:#ae81ff }
.chroma .err { color:#960050 }

[data-theme="dark"] .chroma {
    color: #e7edf2;
    background-color: #151b1f;
}

[data-theme="dark"] .chroma .ln,
[data-theme="dark"] .chroma .c,
[data-theme="dark"] .chroma .ch,
[data-theme="dark"] .chroma .cm,
[data-theme="dark"] .chroma .c1,
[data-theme="dark"] .chroma .cs,
[data-theme="dark"] .chroma .cp,
[data-theme="dark"] .chroma .cpf {
    color: #91a0aa;
}

[data-theme="dark"] .chroma .hl {
    background-color: #22313a;
}

footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem;
    border-top: 2px solid var(--accent);
    text-align: center;
    font-size: 0.85rem;
    color: var(--subtle);
}

footer a {
    color: var(--accent);
}

.page-back-arrow,
.pitfall-overlay-close,
.pitfall-overlay-top,
.tracker-page-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    opacity: 0.72;
    appearance: none;
}

.page-back-arrow {
    position: fixed;
    top: 0.85rem;
    left: 0.85rem;
    z-index: 10;
}

.page-back-arrow:hover,
.pitfall-overlay-close:hover,
.pitfall-overlay-top:hover,
.tracker-page-top:hover {
    color: var(--accent);
    background: var(--accent-soft);
    opacity: 1;
}

.page-back-arrow:focus-visible,
.pitfall-overlay-close:focus-visible,
.pitfall-overlay-top:focus-visible,
.tracker-page-top:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 2px;
    background: transparent;
    opacity: 1;
}

footer .contributors {
    margin: 0.75rem 0 0;
}

footer .contributors p {
    margin: 0.15rem 0;
}

strong {
    font-weight: 600;
}

.tracker-page {
    --max-width: 1120px;
}

.tracker-page .tracker-content {
    width: min(70rem, calc(100vw - 3rem));
    max-width: none;
    padding: 3.2rem 0 4rem;
}

.tracker-page .tracker-header {
    max-width: none;
    margin: 0 0 1.5rem;
    padding: 0 0 1.75rem;
}

.tracker-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tracker-summary div {
    border-top: 2px solid var(--accent);
    background: var(--accent-soft);
    padding: 0.8rem 0.95rem;
}

.tracker-summary strong {
    display: block;
    color: var(--accent);
    font-size: 1.55rem;
    line-height: 1.15;
}

.tracker-summary span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tracker-visuals {
    margin-bottom: 1.25rem;
}

.category-chart-card {
    display: grid;
    grid-template-columns: minmax(14rem, 0.85fr) minmax(18rem, 1.15fr);
    gap: 1.25rem;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.category-chart-card h2 {
    color: var(--accent);
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.category-chart-card p {
    color: var(--muted);
    font-size: 0.9rem;
}

.category-chart-layout {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}

.category-chart {
    width: 180px;
    height: 180px;
}

.category-chart-legend {
    display: grid;
    gap: 0.45rem;
    list-style: none;
}

.category-chart-legend li {
    display: grid;
    grid-template-columns: 0.8rem minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: center;
    font-size: 0.82rem;
}

.category-chart-legend span {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
}

.category-chart-legend button {
    padding: 0;
    border: 0;
    color: var(--text);
    background: transparent;
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.category-chart-legend button:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.category-chart-legend em {
    color: var(--muted);
    font-style: normal;
}

.tracker-controls {
    display: grid;
    grid-template-columns: minmax(16rem, 1.7fr) minmax(10rem, 1fr) minmax(10rem, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.tracker-controls label,
.tracker-controls label span {
    display: block;
}

.tracker-controls label span {
    margin-bottom: 0.25rem;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tracker-controls input,
.tracker-controls select,
.tracker-controls button {
    width: 100%;
    min-height: 2.45rem;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
}

.tracker-controls input,
.tracker-controls select {
    padding: 0.45rem 0.6rem;
}

.tracker-controls button {
    padding: 0.45rem 0.85rem;
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    cursor: pointer;
}

.tracker-controls button:hover {
    background: var(--accent-dark);
}

.tracker-workspace {
    display: block;
}

.tracker-table-wrap {
    overflow-x: auto;
    border-top: 2px solid var(--accent);
}

.tracker-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    font-size: 0.9rem;
    line-height: 1.45;
}

.tracker-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.65rem 0.75rem;
    color: var(--accent);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
}

.tracker-table td {
    vertical-align: top;
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.tracker-table tr:hover td {
    background: var(--surface-soft);
}

.tracker-table tr.is-selected td {
    background: var(--selected);
}

.tracker-table th:nth-child(1),
.tracker-table td:nth-child(1) {
    width: 30%;
}

.tracker-table th:nth-child(2),
.tracker-table td:nth-child(2) {
    width: 19%;
}

.tracker-table th:nth-child(3),
.tracker-table td:nth-child(3) {
    width: 13%;
}

.tracker-table th:nth-child(4),
.tracker-table td:nth-child(4) {
    width: 10%;
    white-space: nowrap;
}

.bug-title-cell h2 {
    margin-bottom: 0.2rem;
    font-size: 1rem;
    line-height: 1.3;
}

.bug-title-button {
    display: inline;
    padding: 0;
    border: 0;
    color: var(--text);
    background: transparent;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.bug-title-button:hover {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.bug-preview {
    display: -webkit-box;
    margin-top: 0.45rem;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.86rem;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.repo-link {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 0.82rem;
}

.pitfall-link {
    display: inline-block;
    font-weight: 600;
}

.category-tag {
    display: block;
    padding: 0;
    border: 0;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: 0.78rem;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.category-tag:hover,
.category-inline-link:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.category-inline-link {
    padding: 0;
    border: 0;
    color: var(--text);
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.tracker-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.tracker-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 1.35rem;
    padding: 0.1rem 0.4rem;
    border: 1px solid #cbd7df;
    border-radius: 3px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    font-size: 0.76rem;
    line-height: 1.2;
}

.reference-list {
    overflow-wrap: anywhere;
}

.reference-list code {
    background: var(--code-bg);
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

.muted,
.tracker-empty {
    color: var(--subtle);
}

.tracker-empty {
    margin-top: 1rem;
    font-style: italic;
}

.tracker-page-top {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 10;
    color: var(--accent);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    opacity: 0.95;
    font-size: 1.15rem;
}

.tracker-page-top[hidden] {
    display: none;
}

.detail-eyebrow {
    margin-bottom: 0.4rem;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.bug-detail-placeholder {
    color: var(--muted);
    font-size: 0.92rem;
}

.bug-detail h2 {
    color: var(--accent);
    font-size: 1.25rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.bug-detail-meta {
    display: grid;
    gap: 0.55rem;
    margin-bottom: 0.8rem;
}

.bug-detail-meta div {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 0.6rem;
}

.bug-detail-meta dt {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.bug-detail-meta dd {
    overflow-wrap: anywhere;
    font-size: 0.88rem;
}

.bug-detail-body {
    margin-top: 1rem;
    font-size: 0.92rem;
}

.bug-detail-body p,
.bug-detail-body ul,
.bug-detail-body ol {
    margin-bottom: 0.8rem;
}

.bug-detail-body ul,
.bug-detail-body ol {
    padding-left: 1.25rem;
}

.bug-detail-body li {
    margin-bottom: 0.35rem;
}

.bug-detail-body code {
    background: var(--code-bg);
    padding: 0.15em 0.35em;
    border-radius: 3px;
    font-size: 0.9em;
}

.bug-detail-body .highlight {
    margin: 0.9rem 0;
    overflow-x: auto;
}

.bug-detail-body .highlight pre {
    min-width: max-content;
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    line-height: 1.5;
}

.bug-detail-body .highlight code {
    padding: 0;
    background: none;
}

.has-modal {
    overflow: hidden;
}

.pitfall-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.pitfall-overlay[hidden] {
    display: none;
}

.pitfall-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay-bg);
}

.pitfall-overlay-panel {
    position: relative;
    width: min(46rem, 100%);
    max-height: min(86vh, 58rem);
    overflow-y: auto;
    padding: 1.4rem 1.5rem;
    border-top: 2px solid var(--accent);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.bug-overlay .pitfall-overlay-panel {
    width: min(58rem, 100%);
}

.pitfall-overlay-panel > .detail-eyebrow {
    margin-left: 2.4rem;
}

.pitfall-overlay-close {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    font: inherit;
    cursor: pointer;
}

/* Pitfall overlay: a sticky toolbar keeps the back and scroll-to-top buttons
   in view while the (often long) pitfall content scrolls underneath. */
.pitfall-overlay-panel--pitfall {
    padding-top: 0;
}

.pitfall-overlay-toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 -1.5rem 0.6rem;
    padding: 0.7rem 0.85rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.pitfall-overlay-toolbar .pitfall-overlay-close {
    position: static;
}

.pitfall-overlay-panel--pitfall > .detail-eyebrow {
    margin-left: 0;
}

/* Scroll-to-top button: floats over the pitfall content, sticky to the bottom
   of the panel (not the viewport) and centered. */
.pitfall-overlay-top {
    position: sticky;
    bottom: 1rem;
    z-index: 5;
    display: flex;
    margin: 0.5rem auto 0.25rem;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--accent);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    opacity: 0.95;
    font-size: 1.15rem;
}

.pitfall-overlay-top:hover {
    opacity: 1;
}

.category-overlay-content h2 {
    margin-left: 2.4rem;
    margin-bottom: 0.75rem;
    color: var(--accent);
    font-size: 1.45rem;
    line-height: 1.25;
}

.category-overlay-content p {
    margin-bottom: 0.8rem;
}

.pitfall-overlay-main-link {
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
    font-weight: 600;
}

@media (max-width: 900px) {
    .sidebar-menu-button {
        position: absolute;
        top: 0.85rem;
        left: 0.85rem;
        z-index: 40;
        display: inline-flex;
        width: 2.25rem;
        height: 2.25rem;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 0.22rem;
        border: 1px solid var(--border);
        border-radius: 4px;
        color: var(--text);
        background: var(--surface);
        box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.12);
        cursor: pointer;
    }

    .sidebar-menu-button span {
        display: block;
        width: 1.15rem;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 30;
        background: var(--overlay-bg);
    }

    .sidebar-toggle:checked ~ .sidebar-backdrop {
        display: block;
    }

    .docs-layout {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 35;
        width: min(17rem, 85vw);
        height: 100vh;
        padding: 3.8rem 1.25rem 2rem;
        border-right: 1px solid var(--border);
        border-bottom: 0;
        box-shadow: var(--shadow);
        transform: translateX(-100%);
        transition: transform 0.18s ease;
    }

    .sidebar-toggle:checked ~ .docs-layout .docs-sidebar {
        transform: translateX(0);
    }

    .docs-sidebar ul {
        display: block;
    }

    .docs-sidebar li + li {
        margin-top: 0.28rem;
    }

    .docs-sidebar h2 {
        margin-top: 0.55rem;
    }

    .docs-content {
        width: auto;
        padding: 4.25rem 1rem 3rem;
    }

    .tracker-page .tracker-content {
        width: auto;
        padding: 4.25rem 1rem 3rem;
    }

    .docs-category-list {
        columns: 1;
    }

    .category-chart-card,
    .tracker-controls,
    .tracker-workspace {
        grid-template-columns: 1fr;
    }

    .tracker-table {
        min-width: 820px;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 15px;
    }

    header, nav, main, footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .tracker-summary,
    .tracker-controls {
        grid-template-columns: 1fr;
    }

    .category-chart-layout,
    .tracker-summary {
        grid-template-columns: 1fr;
    }

    .category-chart {
        justify-self: center;
    }
}
