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

/* Final guide cascade: keeps the contribution page independent from task-page rules. */
body.guide-page .guide-main { max-width: 1160px; padding: 7.5rem 3rem 7rem; }
body.guide-page .guide-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr); gap: 4rem; max-width: none; padding: 0 0 4.2rem; border-bottom: 0; }
body.guide-page .guide-hero-copy { align-self: center; }
body.guide-page .guide-hero h1 { max-width: 720px; margin-bottom: 1.25rem; font-size: clamp(2.8rem, 6vw, 5rem); line-height: 0.99; }
body.guide-page .guide-hero > .guide-hero-copy > p { max-width: 620px; font-size: 1rem; line-height: 1.75; }
body.guide-page .guide-hero-card { align-self: center; padding: 1.4rem 1.5rem 0.6rem; border-radius: 16px; background: #1d1d1b; color: #f4f4f0; box-shadow: 0 18px 38px rgba(20,20,18,0.1); }
body.guide-page .guide-hero-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 0.65rem; align-items: baseline; padding: 0.9rem 0; border-top: 1px solid rgba(255,255,255,0.14); }
body.guide-page .guide-hero-row > span, body.guide-page .guide-hero-row em { color: #9b9b95; font-family: 'SFMono-Regular', Consolas, monospace; font-size: 0.65rem; font-style: normal; }
body.guide-page .guide-hero-row strong { font-size: 0.83rem; font-weight: 600; }
body.guide-page .guide-section { margin-top: 7rem; }
body.guide-page .guide-section-heading { max-width: 700px; margin-bottom: 2rem; }
body.guide-page .guide-section-heading h2 { margin-bottom: 0.65rem; font-size: clamp(1.6rem,3vw,2.2rem); letter-spacing: -0.045em; }
body.guide-page .guide-section-heading p { max-width: 660px; font-size: 0.86rem; line-height: 1.7; }
body.guide-page .guide-package-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(240px,0.5fr); gap: 1rem; align-items: stretch; }
body.guide-page .guide-tree { min-height: 100%; padding: 1.55rem 1.7rem; border: 1px solid #2d2d2a; border-radius: 16px; background: #1d1d1b; color: #ecece7; font-family: 'SFMono-Regular',Consolas,monospace; font-size: 0.73rem; line-height: 1.72; white-space: pre; }
body.guide-page .guide-package-notes { display: grid; align-content: center; gap: 1.2rem; padding: 1.4rem 1.35rem; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,0.58); }
body.guide-page .guide-package-notes > div { display: grid; grid-template-columns: 10px 1fr; column-gap: 0.65rem; }
body.guide-page .guide-package-notes p { grid-column: 2; margin-top: 0.25rem; color: var(--text-secondary); font-size: 0.74rem; line-height: 1.55; }
body.guide-page .guide-evaluation-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; }
body.guide-page .guide-evaluation-card { min-height: 390px; padding: 1.55rem 1.6rem 1.2rem; border: 1px solid var(--border-strong); border-radius: 16px; background: rgba(255,255,255,0.72); box-shadow: 0 12px 28px rgba(20,20,18,0.045); }
body.guide-page .guide-evaluation-card.is-dark { border-color: #292927; background: #1d1d1b; color: #f4f4f0; }
body.guide-page .guide-card-top { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 3.4rem; }
body.guide-page .guide-evaluation-card > p { min-height: 105px; font-size: 0.81rem; line-height: 1.7; }
body.guide-page .guide-file-rows { margin-top: 1.4rem; border-top: 1px solid var(--border); }
body.guide-page .guide-evaluation-card.is-dark .guide-file-rows { border-color: rgba(255,255,255,0.16); }
body.guide-page .guide-file-rows div { display: grid; grid-template-columns: 145px 1fr; gap: 0.7rem; padding: 0.72rem 0; border-bottom: 1px solid var(--border); }
body.guide-page .guide-evaluation-card.is-dark .guide-file-rows div { border-color: rgba(255,255,255,0.16); }
body.guide-page .guide-file-rows span { color: var(--text-secondary); font-size: 0.71rem; }
body.guide-page .guide-evaluation-card.is-dark .guide-file-rows span { color: #b5b5af; }
body.guide-page .guide-metadata-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(230px,0.65fr); gap: 1rem; align-items: start; }
body.guide-page .guide-code { padding: 1.5rem 1.65rem; border: 1px solid var(--border); border-radius: 16px; background: #f8f8f5; color: var(--text); font-family: 'SFMono-Regular',Consolas,monospace; font-size: 0.72rem; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
body.guide-page .guide-field-list div { display: grid; grid-template-columns: 130px 1fr; gap: 0.8rem; padding: 0.82rem 0; border-bottom: 1px solid var(--border); }
body.guide-page .guide-check-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
body.guide-page .guide-check { min-height: 180px; padding: 1.35rem; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,0.58); }
body.guide-page .guide-check > span { margin-bottom: 2.8rem; }
body.guide-page .guide-check p { color: var(--text-secondary); font-size: 0.76rem; line-height: 1.6; }
body.guide-page .guide-publish-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: start; }
body.guide-page .guide-publish-steps { display: grid; border-top: 1px solid var(--border); list-style: none; }
body.guide-page .guide-publish-steps li { display: grid; grid-template-columns: 42px 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
body.guide-page .guide-publish-steps p { color: var(--text-secondary); font-size: 0.75rem; line-height: 1.55; }
body.guide-page .guide-command-box { padding: 1.25rem; border: 1px solid var(--border-strong); border-radius: 16px; background: #f8f8f5; }
body.guide-page .guide-command-box pre { margin: 0; padding: 0.9rem; border-radius: 9px; background: #1d1d1b; color: #f3f3f1; font-family: 'SFMono-Regular',Consolas,monospace; font-size: 0.7rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 768px) {
    body.guide-page .guide-main { padding: 6rem 1.5rem 5rem; }
    body.guide-page .guide-hero, body.guide-page .guide-package-layout, body.guide-page .guide-evaluation-grid, body.guide-page .guide-metadata-layout, body.guide-page .guide-check-grid, body.guide-page .guide-publish-layout { grid-template-columns: 1fr; }
    body.guide-page .guide-hero { gap: 2rem; padding-bottom: 3rem; }
    body.guide-page .guide-hero h1 { font-size: clamp(2.4rem,10vw,3.8rem); }
    body.guide-page .guide-section { margin-top: 5rem; }
    body.guide-page .guide-evaluation-card { min-height: 0; }
    body.guide-page .guide-evaluation-card > p { min-height: 0; }
}

@media (max-width: 520px) {
    body.guide-page .guide-main { padding-right: 1rem; padding-left: 1rem; }
    body.guide-page .guide-hero-row { grid-template-columns: 28px 1fr; }
    body.guide-page .guide-hero-row em { grid-column: 2; }
    body.guide-page .guide-tree, body.guide-page .guide-code { padding: 1.1rem; font-size: 0.66rem; }
    body.guide-page .guide-card-top { display: block; }
    body.guide-page .guide-card-top code { display: block; margin-top: 0.45rem; }
    body.guide-page .guide-file-rows div, body.guide-page .guide-field-list div { grid-template-columns: 1fr; gap: 0.25rem; }
    body.guide-page .guide-check { min-height: 0; }
}

.contribute-guide-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.8rem;
    padding-bottom: 0.18rem;
    border-bottom: 1px solid var(--text);
    font-size: 0.8rem;
    font-weight: 650;
}

.contribute-guide-link span {
    transition: transform 0.2s ease;
}

.contribute-guide-link:hover {
    opacity: 1;
}

.contribute-guide-link:hover span {
    transform: translateX(4px);
}

/* Homepage contribution callout */
.contribute-section {
    padding-top: 3.5rem;
    padding-bottom: 8rem;
}

.contribute-cta {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 3rem;
    align-items: end;
    padding: 2.4rem 2.5rem;
    border: 1px solid #2b2b28;
    border-radius: 18px;
    background: #1d1d1b;
    color: #f5f5f2;
    box-shadow: 0 18px 38px rgba(20, 20, 18, 0.08);
}

.contribute-kicker {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--amber);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.contribute-cta h2 {
    max-width: 560px;
    margin-bottom: 0.7rem;
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    letter-spacing: -0.04em;
    line-height: 1.08;
}

.contribute-cta-copy p {
    max-width: 620px;
    color: #b8b8b2;
    font-size: 0.9rem;
    line-height: 1.65;
}

.contribute-cta-action {
    display: grid;
    justify-items: start;
    gap: 1.25rem;
}

.contribute-cta-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.contribute-cta-meta span {
    padding: 0.35rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: #b8b8b2;
    font-size: 0.67rem;
}

.contribute-cta .btn-primary {
    background: #f5f5f2;
    color: #1d1d1b;
}

.contribute-cta .btn-primary:hover {
    color: #1d1d1b;
    opacity: 0.86;
}

.contribute-cta .btn-primary span {
    display: inline-block;
    margin-left: 0.35rem;
    transition: transform 0.2s ease;
}

.contribute-cta .btn-primary:hover span {
    transform: translateX(4px);
}

.nav-links a.is-current {
    color: var(--text);
}

/* Contribution guide — editorial layout */
.guide-page {
    background: #ececea;
}

.guide-main {
    max-width: 1160px;
    padding: 7.5rem 3rem 7rem;
}

.guide-breadcrumb {
    margin-bottom: 3.2rem;
}

.guide-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    gap: 4rem;
    max-width: none;
    padding: 0 0 4.2rem;
    border-bottom: 0;
}

.guide-hero-copy {
    align-self: center;
}

.guide-hero h1 {
    max-width: 720px;
    margin-bottom: 1.25rem;
    font-size: clamp(2.8rem, 6vw, 5rem);
    line-height: 0.99;
}

.guide-hero > .guide-hero-copy > p {
    max-width: 620px;
    font-size: 1rem;
    line-height: 1.75;
}

.guide-hero-link {
    display: inline-flex;
    gap: 0.55rem;
    align-items: center;
    margin-top: 1.6rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid var(--text);
    font-size: 0.8rem;
    font-weight: 650;
}

.guide-hero-link span {
    transition: transform 0.2s ease;
}

.guide-hero-link:hover {
    opacity: 1;
}

.guide-hero-link:hover span {
    transform: translateY(3px);
}

.guide-hero-card {
    align-self: center;
    padding: 1.4rem 1.5rem 0.6rem;
    border-radius: 16px;
    background: #1d1d1b;
    color: #f4f4f0;
    box-shadow: 0 18px 38px rgba(20, 20, 18, 0.1);
}

.guide-card-label {
    margin-bottom: 1rem;
    color: #a8a8a2;
    font-size: 0.63rem;
    letter-spacing: 0.12em;
}

.guide-hero-row {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: 0.65rem;
    align-items: baseline;
    padding: 0.9rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.guide-hero-row > span,
.guide-hero-row em {
    color: #9b9b95;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.65rem;
    font-style: normal;
}

.guide-hero-row strong {
    font-size: 0.83rem;
    font-weight: 600;
}

.guide-package-notes code,
.guide-file-rows code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.7rem;
}

.guide-section {
    margin-top: 7rem;
}

.guide-section-heading {
    max-width: 700px;
    margin-bottom: 2rem;
}

.guide-section-heading h2 {
    margin-bottom: 0.65rem;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    letter-spacing: -0.045em;
}

.guide-section-heading p {
    max-width: 660px;
    font-size: 0.86rem;
    line-height: 1.7;
}

.guide-package-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.5fr);
    gap: 1rem;
    align-items: stretch;
}

.guide-tree {
    min-height: 100%;
    padding: 1.55rem 1.7rem;
    border: 1px solid #2d2d2a;
    border-radius: 16px;
    background: #1d1d1b;
    color: #ecece7;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.73rem;
    line-height: 1.72;
    white-space: pre;
}

.guide-package-notes {
    display: grid;
    align-content: center;
    gap: 1.2rem;
    padding: 1.4rem 1.35rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.58);
}

.guide-package-notes > div {
    display: grid;
    grid-template-columns: 10px 1fr;
    column-gap: 0.65rem;
}

.guide-package-notes p {
    grid-column: 2;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.74rem;
    line-height: 1.55;
}

.guide-note-dot {
    width: 8px;
    height: 8px;
    margin-top: 0.32rem;
    border: 1px solid var(--text-secondary);
    border-radius: 50%;
}

.guide-note-dot.is-solid { background: var(--text); border-color: var(--text); }
.guide-note-dot.is-dark { background: #8b8b85; border-color: #8b8b85; }

.guide-package-notes strong {
    font-size: 0.76rem;
}

.guide-evaluation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.guide-evaluation-card {
    min-height: 390px;
    padding: 1.55rem 1.6rem 1.2rem;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 12px 28px rgba(20, 20, 18, 0.045);
}

.guide-evaluation-card.is-dark {
    border-color: #292927;
    background: #1d1d1b;
    color: #f4f4f0;
}

.guide-card-top {
    margin-bottom: 3.4rem;
}

.guide-evaluation-card h3 {
    margin-bottom: 0.6rem;
    font-size: 1.35rem;
    letter-spacing: -0.03em;
}

.guide-evaluation-card > p {
    min-height: 105px;
    font-size: 0.81rem;
    line-height: 1.7;
}

.guide-file-rows {
    margin-top: 1.4rem;
    border-top: 1px solid var(--border);
}

.guide-evaluation-card.is-dark .guide-file-rows {
    border-color: rgba(255, 255, 255, 0.16);
}

.guide-file-rows div {
    display: grid;
    grid-template-columns: 145px 1fr;
    gap: 0.7rem;
    padding: 0.72rem 0;
    border-bottom: 1px solid var(--border);
}

.guide-evaluation-card.is-dark .guide-file-rows div {
    border-color: rgba(255, 255, 255, 0.16);
}

.guide-file-rows span {
    color: var(--text-secondary);
    font-size: 0.71rem;
}

.guide-evaluation-card.is-dark .guide-file-rows span { color: #b5b5af; }

.guide-metadata-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(230px, 0.65fr);
    gap: 1rem;
    align-items: start;
}

.guide-code {
    padding: 1.5rem 1.65rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8f8f5;
    color: var(--text);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.72rem;
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.guide-field-list {
    display: grid;
    border-top: 1px solid var(--border);
}

.guide-field-list div {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 0.8rem;
    padding: 0.82rem 0;
    border-bottom: 1px solid var(--border);
}

.guide-field-list code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.7rem;
}

.guide-field-list span {
    color: var(--text-secondary);
    font-size: 0.74rem;
    line-height: 1.5;
}

.guide-check-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.guide-check {
    min-height: 180px;
    padding: 1.35rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.58);
}

.guide-check > span {
    display: block;
    margin-bottom: 2.8rem;
    color: var(--text-secondary);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.7rem;
}

.guide-check strong {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.88rem;
}

.guide-check p {
    color: var(--text-secondary);
    font-size: 0.76rem;
    line-height: 1.6;
}

.guide-publish-layout {
    display: grid;
    grid-template-columns: 1fr 0.95fr;
    gap: 2rem;
    align-items: start;
}

.guide-publish-steps {
    display: grid;
    border-top: 1px solid var(--border);
    list-style: none;
}

.guide-publish-steps li {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.guide-publish-steps li > span {
    color: var(--text-secondary);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.7rem;
}

.guide-publish-steps strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.82rem;
}

.guide-publish-steps p {
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.55;
}

.guide-publish-steps code,
.guide-command-box a,
.guide-section-heading a {
    color: var(--accent);
}

.guide-publish-steps code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.72rem;
}

.guide-command-box a,
.guide-section-heading a {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.guide-command-box {
    padding: 1.25rem;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: #f8f8f5;
}

.guide-command-box > span {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.guide-command-box pre {
    overflow-x: auto;
    margin: 0;
    padding: 0.9rem;
    border-radius: 9px;
    background: #1d1d1b;
    color: #f3f3f1;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.7rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.guide-command-box p {
    margin-top: 0.8rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    line-height: 1.55;
}

@media (max-width: 768px) {
    .contribute-section { padding-top: 2rem; padding-bottom: 5rem; }
    .contribute-cta { grid-template-columns: 1fr; gap: 1.8rem; padding: 1.7rem; }
    .contribute-cta-action { justify-items: start; }
    .guide-main { padding: 6rem 1.5rem 5rem; }
    .guide-hero { grid-template-columns: 1fr; gap: 2rem; padding-bottom: 3rem; }
    .guide-hero h1 { font-size: clamp(2.4rem, 10vw, 3.8rem); }
    .guide-package-layout, .guide-evaluation-grid, .guide-metadata-layout, .guide-check-grid, .guide-publish-layout { grid-template-columns: 1fr; }
    .guide-section { margin-top: 5rem; }
    .guide-evaluation-card { min-height: 0; }
    .guide-evaluation-card > p { min-height: 0; }
}

@media (max-width: 520px) {
    .contribute-cta-meta { display: grid; }
    .contribute-cta-meta span { width: fit-content; }
    .guide-main { padding-right: 1rem; padding-left: 1rem; }
    .guide-breadcrumb { margin-bottom: 2.2rem; }
    .guide-hero-row { grid-template-columns: 28px 1fr; }
    .guide-hero-row em { grid-column: 2; }
    .guide-tree, .guide-code { padding: 1.1rem; font-size: 0.66rem; }
    .guide-package-notes { padding: 1.2rem; }
    .guide-card-top { display: block; }
    .guide-card-top code { display: block; margin-top: 0.45rem; }
    .guide-file-rows div, .guide-field-list div { grid-template-columns: 1fr; gap: 0.25rem; }
    .guide-check { min-height: 0; }
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 76px;
}

html,
body {
    overflow-x: hidden;
}

:root {
    --bg: #f4f2ef;
    --surface: #fbfaf8;
    --surface-soft: #ece8e3;
    --border: rgba(36, 52, 71, 0.12);
    --border-strong: rgba(36, 52, 71, 0.22);
    --text: #141414;
    --text-secondary: #5c5c5c;
    --accent: #2c415c;
    --accent-soft: #e4e9f0;
    --ink: #111111;
    --brick: #9a4038;
    --brick-soft: #f6e4e1;
    --brick-ink: #7a332c;
    --amber: var(--brick);
    --amber-soft: var(--brick-soft);
    --amber-ink: var(--brick-ink);
}

html {
    background: var(--bg); /* fallback behind the canvas on home-page */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Let the canvas show through on the home page */
body.home-page,
body.guide-page,
body.task-page {
    background: transparent;
}

/* Lift all content above the canvas (z-index: 0 fixed sits above
   non-positioned elements by stacking-context rules). */
body.home-page > *:not(#globe-canvas):not(nav):not(.site-toast),
body.guide-page > *:not(#globe-canvas):not(nav):not(.site-toast),
body.task-page > *:not(#globe-canvas):not(nav):not(.site-toast) {
    position: relative;
    z-index: 1;
}

a {
    color: var(--text);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.7;
}

/* Nav */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 1.2rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(242, 241, 236, 0.84);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.nav-links a:hover {
    color: var(--text);
    opacity: 1;
}

.nav-github {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 0.35rem;
    height: 30px;
    margin-left: 0.25rem;
    padding: 0 0 0 1.5rem;
    border: 0;
    border-left: 1px solid var(--border-strong);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font: inherit;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
}

.nav-github:hover {
    color: var(--text);
}

.nav-github svg {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.nav-github span {
    display: inline-block;
    white-space: nowrap;
}

.site-toast {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 200;
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    background: var(--text);
    color: var(--surface);
    box-shadow: 0 12px 32px rgba(24, 24, 22, 0.18);
    font-size: 0.78rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.site-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero */
.hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    /* nav is ~60px; padding-top positions the logo in the upper portion of the viewport */
    padding: 10rem 0 0;
    max-width: none;
    width: 100%;
}

/* Hero children centre themselves with their own max-width */
.hero > *:not(.hero-push):not(.category-strip-wrap) {
    padding-left: 2rem;
    padding-right: 2rem;
    max-width: 760px;
    width: 100%;
    align-self: center;
}

/* Push gives a modest gap between the buttons and the strip */
.hero-push {
    flex: 0 0 5rem;
}

/* Strip overrides: flush to viewport edges with a left/right gradient fade */
.hero .category-strip-wrap {
    align-self: stretch;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    padding: 0;
    /* Fade cards in from left, fade out to right — same bg colour as hero */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 3rem;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    margin-bottom: 3rem;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--accent);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.3rem;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    opacity: 0.9;
    color: #fff;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    opacity: 1;
}

/* Sections */
section {
    padding: 6rem 3rem;
    max-width: 1100px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 3rem;
    max-width: 600px;
}

/* Tasks overview */
.task-overview-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: -1.25rem 0 2.25rem;
}

.task-overview-stat {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.55rem 0.7rem;
}

.task-overview-stat strong {
    color: var(--accent);
    font-size: clamp(2.2rem, 3.5vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.task-overview-stat span {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
}

.task-overview-stat-divider {
    width: 1px;
    height: 2.2rem;
    background: var(--border-strong);
    opacity: 0.7;
}

.collecting-note {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0 0.35rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid #bfdcc9;
    border-radius: 999px;
    background: #e3f2e8;
    color: #1f6b3a;
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.2;
    text-transform: uppercase;
}

.collecting-note::before {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #2f9e5b;
}

/* Category strip — infinite scroll marquee ─────────────── */
.category-strip-wrap {
    overflow: hidden;
    margin: 2.5rem -3rem 0;   /* bleed to section edge */
    padding: 0.25rem 0;
}

.category-strip {
    display: flex;
    gap: 2.5rem;
    width: max-content;
    will-change: transform;
}

.cat-card {
    flex: 0 0 300px;
    height: 240px;
    perspective: 900px;
    cursor: default;
}

.cat-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.22, 0.8, 0.2, 1);
}

.cat-card:hover .cat-card-inner {
    transform: rotateY(180deg);
}

@media (prefers-reduced-motion: reduce) {
    .cat-card-inner { transition-duration: 0.01s; }
}

.cat-card-face {
    position: absolute;
    inset: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    box-shadow: 0 2px 6px rgba(24,22,18,0.06), 0 8px 28px rgba(24,22,18,0.1);
}

.cat-card-front {
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.cat-card-front img {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    padding: 0.9rem 1rem 0.4rem;
    object-fit: contain;
}

.cat-card-label {
    padding: 0 1rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.cat-card-back {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 1.3rem 1.4rem;
    background: var(--surface);
    transform: rotateY(180deg);
}

.cat-card-back .cat-card-label {
    padding: 0 0 0.7rem;
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-transform: none;
}

.cat-card-back .cat-card-blurb {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    text-align: left;
}

@media (max-width: 768px) {
    .category-strip-wrap { margin-left: -1.5rem; margin-right: -1.5rem; }
}
@media (max-width: 480px) {
    .category-strip-wrap { margin-left: -1rem; margin-right: -1rem; }
    .cat-card { flex: 0 0 260px; height: 220px; }
}

.domain-card-index {
    position: absolute;
    top: 1.05rem;
    left: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.08em;
}

.domain-card-name {
    margin: 0;
    padding-right: 0.4rem;
    color: var(--text);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.domain-card-blurb {
    max-width: 16rem;
    margin-top: 0.35rem;
    padding-right: 2.6rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.4;
}

.domain-card-count {
    position: absolute;
    right: 1.2rem;
    top: 1.05rem;
    color: var(--amber);
    font-size: 1.8rem;
    font-weight: 650;
    letter-spacing: -0.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.domain-card.is-active {
    border-color: var(--accent);
    background: linear-gradient(180deg, #ffffff 0%, #f3f6fa 100%);
    box-shadow: inset 0 1px 0 #ffffff, 0 12px 28px rgba(47, 63, 86, 0.12);
}

.domain-card.is-active .domain-card-name {
    color: var(--accent);
}

@media (max-width: 960px) {
    .domain-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Tasks */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    align-items: stretch;
}

.task-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.task-card::after {
    content: '\2192';
    position: absolute;
    bottom: 0.9rem;
    right: 1.1rem;
    font-size: 1rem;
    opacity: 0;
    transform: translateX(-6px);
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.task-card:hover {
    border-color: var(--text);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
    opacity: 1;
}

.task-card:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.task-card.is-empty {
    cursor: default;
}

.task-card.is-empty::after {
    content: none;
}

.task-card.is-empty:hover {
    border-color: var(--border);
    transform: none;
    box-shadow: none;
}

.task-tag {
    display: inline-block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    width: fit-content;
    font-weight: 500;
}

.task-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.task-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Task card thumbnail — full bleed, no padding or background */
.task-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 11px 11px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0.75rem 1rem;
    background: #ffffff; /* solid, same as the task detail image box, so the jpeg's white blends in */
}

.task-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease;
}

.task-card:hover .task-card-image img {
    transform: scale(1.03);
}

/* Family tag: plain gray text under the title */
.task-card-body .task-tag {
    padding: 0;
    background: none;
    border-radius: 0;
    color: var(--text-secondary);
    font-size: 0.62rem;
}

/* Card body: title + brief description */
.task-card-body {
    padding: 1.2rem 1.3rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.task-card-body h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

.task-card-body p {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0;
}

/* Leaderboard */
.leaderboard-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.leaderboard-controls label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.filter-selects {
    display: flex;
    gap: 0.6rem;
    margin-left: auto;
}

.filter-select {
    padding: 0.45rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    transition: all 0.2s;
}

.filter-select:hover {
    border-color: var(--text);
}

.filter-select:focus {
    outline: none;
    border-color: var(--text);
}

.lb-kicker {
    margin: -1.2rem 0 1.8rem;
    color: var(--text-secondary);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lb-table-wrap {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    overflow-x: auto;
    box-shadow: inset 0 1px 0 #ffffff, 0 1px 2px rgba(24, 22, 18, 0.03);
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
}

.lb-table th {
    padding: 1rem 1.2rem 0.8rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    text-align: left;
    white-space: nowrap;
}

.lb-table td {
    padding: 1.05rem 1.2rem;
    vertical-align: middle;
}

.lb-tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.lb-tr:last-child {
    border-bottom: none;
}

.lb-tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.lb-tr.hidden {
    display: none;
}

.lb-col-rank,
.lb-cell-rank {
    width: 52px;
    text-align: center;
}

/* th centering needs the extra specificity to beat `.lb-table th`'s left. */
.lb-table th.lb-col-rank,
.lb-table th.lb-col-agent,
.lb-table th.lb-col-effort,
.lb-table th.lb-col-score {
    text-align: center;
}

.lb-col-score,
.lb-cell-score {
    text-align: center;
}

.lb-rank {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
}

.lb-model-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.55rem;
}

.lb-model-logo {
    flex: none;
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.lb-model-name,
.lb-agent-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.lb-agent-name {
    color: var(--text-secondary);
    font-weight: 500;
}

.lb-col-agent,
.lb-col-effort,
.lb-cell-agent,
.lb-cell-effort {
    text-align: center;
}

.lb-cell-effort {
    white-space: nowrap;
}

.lb-max-tag {
    display: inline-block;
    padding: 0.08rem 0.35rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: rgba(42,42,40,0.05);
    color: var(--text-secondary);
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    vertical-align: middle;
    line-height: 1.4;
}

.lb-soon {
    color: var(--text-secondary);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.lb-cell-soon {
    text-align: center;
    white-space: nowrap;
}

/* How to Contribute */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.step {
    text-align: center;
    padding: 2rem 1.5rem;
}

.step-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.step h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.step p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 4rem 3rem;
    max-width: 1100px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 3rem;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    max-width: 280px;
}

.footer-col h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.footer-col a {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.footer-col a:hover {
    color: var(--text);
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.cases-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.case-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.case-card-header {
    padding: 1.2rem 1.8rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.case-card-header h4 {
    font-size: 0.85rem;
    font-weight: 600;
}

.case-card-header span {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.case-card-body {
    padding: 1.8rem;
}

.case-field {
    margin-bottom: 1.5rem;
}

.case-field:last-child {
    margin-bottom: 0;
}

.case-field-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.case-field-content {
    font-size: 0.9rem;
    line-height: 1.7;
    padding: 1rem 1.2rem;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.case-field-content code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
}

.case-field-content pre {
    white-space: pre-wrap;
    word-break: break-word;
}

.schema-section {
    margin-top: 3rem;
}

.schema-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.8rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
    line-height: 1.8;
    overflow-x: auto;
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        padding: 1rem 1.5rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.8rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    section {
        padding: 4rem 1.5rem;
    }

    .tasks-grid {
        grid-template-columns: 1fr;
    }

    .domain-cards {
        grid-template-columns: 1fr;
    }

    .task-overview-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
    }

    .task-overview-stat-divider {
        width: 2.5rem;
        height: 1px;
    }

    .lb-table th,
    .lb-table td {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .leaderboard-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-selects {
        margin-left: 0;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

/* Motion only: preserves the original layout and visual system. */
.motion-ready .hero > * {
    opacity: 0;
    transform: translateY(22px);
    animation: hero-slide-in 0.7s cubic-bezier(0.22, 0.8, 0.2, 1) forwards;
}

.motion-ready .hero > :nth-child(2) {
    animation-delay: 0.08s;
}

.motion-ready .hero > :nth-child(3) {
    animation-delay: 0.16s;
}

.motion-ready .hero > :nth-child(4) {
    animation-delay: 0.24s;
}

.motion-ready .scroll-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 0.8, 0.2, 1);
}

.motion-ready .scroll-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes hero-slide-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Evaluation snapshot */
.evaluation-section {
    padding-top: 3rem;
}

.eval-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.eval-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1.25rem 1.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.eval-stat strong {
    font-size: 1.7rem;
    line-height: 1;
    letter-spacing: -0.03em;
}

.eval-stat span {
    font-size: 0.78rem;
    font-weight: 600;
}

.eval-stat small,
.chart-heading span,
.chart-value small {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.eval-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
}

.chart-card {
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.chart-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.chart-heading h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.chart-row {
    display: grid;
    grid-template-columns: 92px 1fr 62px;
    align-items: center;
    gap: 0.7rem;
}

.chart-label {
    overflow: hidden;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-track {
    display: block;
    height: 7px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.07);
    border-radius: 4px;
}

.chart-track i {
    display: block;
    height: 100%;
    background: var(--text);
    border-radius: inherit;
    transform-origin: left center;
    animation: chart-grow 0.8s cubic-bezier(0.22, 0.8, 0.2, 1) both;
}

.chart-value {
    font-size: 0.75rem;
    text-align: right;
    white-space: nowrap;
}

.chart-value small {
    margin-left: 0.2rem;
}

@keyframes chart-grow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@media (max-width: 768px) {
    .eval-summary-grid,
    .eval-chart-grid {
        grid-template-columns: 1fr 1fr;
    }

    .chart-heading {
        display: block;
    }

    .chart-heading span {
        display: block;
        margin-top: 0.3rem;
    }
}

@media (max-width: 520px) {
    .eval-summary-grid,
    .eval-chart-grid {
        grid-template-columns: 1fr;
    }
}

/* Task-level evaluation analysis */
.task-analysis-section {
    max-width: none;
    padding: 0;
    margin-bottom: 4rem;
}

.task-analysis-section .section-subtitle {
    margin-bottom: 1.5rem;
}

.analysis-summary {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    margin-bottom: 1.2rem;
    background: var(--border);
    border: 1px solid var(--border);
}

.analysis-summary > div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--surface);
}

.analysis-summary strong {
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.analysis-summary span,
.analysis-card-heading span,
.analysis-axis {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.analysis-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.2rem;
    margin-bottom: 1.2rem;
}

.analysis-card,
.analysis-findings {
    padding: 1.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.analysis-card-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.analysis-card-heading h3,
.analysis-findings h3 {
    font-size: 0.9rem;
    font-weight: 600;
}

.analysis-sparkline svg {
    display: block;
    width: 100%;
    height: 130px;
    overflow: visible;
}

.analysis-sparkline polyline {
    fill: none;
    stroke: var(--text);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.analysis-sparkline circle {
    fill: var(--surface);
    stroke: var(--text);
    stroke-width: 2;
}

.analysis-gridline {
    stroke: var(--border);
    stroke-width: 1;
}

.analysis-axis {
    display: flex;
    justify-content: space-between;
    padding-top: 0.35rem;
}

.analysis-bars {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding-top: 0.6rem;
}

.analysis-bar-row {
    display: grid;
    grid-template-columns: 58px 1fr 42px;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.75rem;
}

.analysis-bar-row > i {
    display: block;
    height: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.07);
    border-radius: 4px;
}

.analysis-bar-row b {
    display: block;
    height: 100%;
    background: var(--text);
    border-radius: inherit;
}

.analysis-bar-row strong {
    font-size: 0.75rem;
    text-align: right;
}

.analysis-findings {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1.5rem;
}

.analysis-findings ul {
    display: grid;
    gap: 0.55rem;
    padding-left: 1rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .analysis-summary {
        grid-template-columns: repeat(3, 1fr);
    }

    .analysis-grid,
    .analysis-findings {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .analysis-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Grouped public task catalog */
.task-sample-note {
    margin: 1.75rem 0 0.35rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.task-groups {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
}

.task-group {
    border-bottom: 1px solid var(--border);
    scroll-margin-top: 6rem;
}

.task-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 0;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.task-group summary::-webkit-details-marker {
    display: none;
}

.task-group summary::after {
    content: '+';
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1;
}

.task-group[open] summary::after {
    content: '−';
}

.task-group-count {
    margin-left: auto;
    margin-right: 1rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 400;
}

.task-group .tasks-grid {
    padding: 0.2rem 0 2.5rem;
}

.task-group-empty {
    padding: 0.2rem 0 2rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Published AutoRLBench task detail: header module on top, tabbed content
   module (tabs + panels read live from tasks/) below. */
.task-detail {
    padding: 7rem 2rem 5rem;
}

.task-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.task-breadcrumb span {
    overflow-wrap: anywhere;
}

.task-breadcrumb a {
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.task-breadcrumb a:hover {
    border-color: var(--text);
}

.task-page-header {
    margin-bottom: 3rem;
}

.task-header-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.8rem;
}

.task-header-tags span {
    padding: 0.32rem 0.62rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    color: var(--text-secondary);
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.task-page-header h1 {
    max-width: 100%;
    margin-bottom: 0.9rem;
    font-size: clamp(1.6rem, 4.5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.task-issue-text {
    margin: 0;
    max-width: 100%;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
}

/* Meta strip — one row per setting, hairline-separated */
.task-settings {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.68);
    overflow: hidden;
}

.task-settings > div {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem 1.25rem;
    padding: 0.62rem 1rem;
    border-bottom: 1px solid var(--border);
}

.task-settings > div:last-child {
    border-bottom: none;
}

.task-settings span {
    color: var(--text-secondary);
    font-size: 0.64rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.task-settings strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.76rem;
    font-weight: 600;
    text-align: right;
}

/* Settings table (left) and reward figure (right) split the row below the
   title into equal columns of equal height; the table spans the full row
   when a task has no figure. Figures are generated per task by
   scripts/generate_reward_charts.py. */
.task-header-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.task-reward-fig {
    display: flex;
    align-items: center;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.68);
    box-shadow: inset 0 1px 0 #ffffff, 0 1px 2px rgba(20, 20, 18, 0.04),
        0 10px 28px rgba(20, 20, 18, 0.08);
    overflow: hidden;
}

.task-reward-fig img {
    display: block;
    width: 100%;
    height: auto;
}

.task-reward-fig figcaption {
    padding: 0.62rem 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.74rem;
    line-height: 1.5;
}

.task-not-found {
    padding: 5rem 0;
}

.task-not-found h1 {
    margin-bottom: 0.8rem;
    font-size: 2rem;
}

.task-not-found p {
    color: var(--text-secondary);
}

/* Task detail header: tags + GitHub link, then metadata and tabbed content
   read live from tasks/. */
.task-header-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.4rem 1.2rem;
}

.task-header-tags .task-chip-domain {
    border-color: rgba(154, 64, 56, 0.35);
    background: rgba(154, 64, 56, 0.07);
    color: var(--brick);
}

.task-github-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.05rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: var(--ink);
    color: #f5f3ef;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.task-github-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(20, 20, 18, 0.22);
}

.task-github-btn svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Tabs — plain div, not <nav>: the global nav rule is position: fixed. */
.task-tabs {
    display: flex;
    gap: 1.6rem;
    /* inset hairline instead of a border, so the active underline covers it
       without a negative margin being clipped by overflow-x */
    box-shadow: inset 0 -1px 0 var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}

.task-tabs::-webkit-scrollbar { display: none; }

.task-tab {
    padding: 0.8rem 0.05rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.task-tab:hover { color: var(--text); opacity: 1; }

.task-tab.is-active {
    color: var(--text);
    border-bottom-color: var(--text);
}

.task-tab-panel { padding-top: 1.6rem; }

.task-panel-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    margin-bottom: 1rem;
}

.task-file-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.task-file-chip {
    padding: 0.32rem 0.78rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    color: var(--text-secondary);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.71rem;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.task-file-chip:hover { color: var(--text); opacity: 1; border-color: var(--border-strong); }

.task-file-chip.is-active {
    border-color: var(--text);
    background: var(--text);
    color: var(--surface);
}

.task-file-github-link {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.task-file-github-link:hover {
    color: var(--text);
    opacity: 1;
}

.task-doc-head {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.85rem;
}

.task-doc-head a { font-size: 0.72rem; color: var(--text-secondary); white-space: nowrap; }
.task-doc-head a:hover { color: var(--text); opacity: 1; }

/* Rendered task documents (markdown) */
.task-md {
    max-width: 800px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.72;
}

.task-md > *:first-child { margin-top: 0; }
.task-md > *:last-child { margin-bottom: 0; }

.task-md h2 { margin: 1.6rem 0 0.6rem; font-size: 1.05rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.task-md h3 { margin: 1.4rem 0 0.5rem; font-size: 0.78rem; font-weight: 600; color: var(--text); text-transform: uppercase; letter-spacing: 0.06em; }
.task-md h4 { margin: 1rem 0 0.4rem; font-size: 0.83rem; font-weight: 600; color: var(--text); }
.task-md p { margin: 0.55rem 0; }
.task-md ul,
.task-md ol { margin: 0.55rem 0; padding-left: 1.4rem; }
.task-md li { margin: 0.3rem 0; }
.task-md blockquote { margin: 0.9rem 0; padding: 0.1rem 0 0.1rem 1.1rem; border-left: 3px solid var(--border-strong); }
.task-md blockquote > *:first-child { margin-top: 0; }
.task-md blockquote > *:last-child { margin-bottom: 0; }
.task-md hr { margin: 1.5rem 0; border: 0; border-top: 1px solid var(--border); }
.task-md a { color: var(--text); border-bottom: 1px solid var(--border); }
.task-md a:hover { border-color: var(--text); opacity: 1; }
.task-md code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.82rem;
    padding: 0.12rem 0.38rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    color: var(--text);
}

.task-code {
    margin: 0.85rem 0;
    padding: 0.85rem 1rem;
    background: #f8f8f6;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.8rem;
    line-height: 1.55;
}

.task-code code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.8rem;
}

.task-md .task-code code { padding: 0; background: none; }

.task-code--file { margin: 0; }

/* Loading / empty / error states */
.task-loading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 2.4rem 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.task-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--text);
    border-radius: 50%;
    animation: task-spin 0.8s linear infinite;
}

@keyframes task-spin { to { transform: rotate(360deg); } }

.task-panel-note {
    padding: 2rem 1.2rem;
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

.task-panel-note a { font-style: normal; }

@media (prefers-reduced-motion: reduce) {
    .task-spinner { animation: none; }
}

/* Responsive */
@media (max-width: 768px) {
    .task-detail { padding: 7rem 1.5rem 4rem; }
    .task-header-grid { grid-auto-flow: row; }
    .task-md { font-size: 0.85rem; }
    .task-tabs { gap: 1.15rem; }
}

@media (max-width: 640px) {
    .task-detail { padding: 7rem 1.25rem 3.5rem; }
    .task-header-top { flex-direction: column; align-items: flex-start; }
    .task-github-btn { width: fit-content; }
    .task-settings > div {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }
    .task-settings strong { text-align: left; }
    .task-panel-toolbar { gap: 0.6rem; }
}

/* Contribution guide */
.guide-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 7.5rem 3rem 6rem;
}

.guide-breadcrumb {
    display: flex;
    gap: 0.55rem;
    margin-bottom: 2.5rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.guide-breadcrumb a {
    border-bottom: 1px solid var(--border);
}

.guide-hero {
    max-width: 850px;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}

.guide-eyebrow {
    display: block;
    margin-bottom: 0.7rem;
    color: var(--text-secondary);
    font-size: 0.66rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.guide-hero h1 {
    max-width: 800px;
    margin-bottom: 1.1rem;
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 1.02;
}

.guide-hero > p {
    max-width: 680px;
    color: var(--text-secondary);
    font-size: 1.03rem;
    line-height: 1.75;
}

.guide-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.8rem;
}

.guide-hero-meta span {
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.56);
    color: var(--text-secondary);
    font-size: 0.68rem;
}

.guide-section {
    margin-top: 6rem;
}

.guide-section-heading {
    max-width: 720px;
    margin-bottom: 1.8rem;
}

.guide-section-heading h2 {
    margin-bottom: 0.75rem;
    font-size: 1.7rem;
    font-weight: 750;
    letter-spacing: -0.03em;
}

.guide-section-heading p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.7;
}

.guide-contract-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.guide-contract-item {
    min-height: 170px;
    padding: 1.4rem 1.5rem 1.5rem 0;
}

.guide-contract-item + .guide-contract-item {
    padding-left: 1.5rem;
    border-left: 1px solid var(--border);
}

.guide-contract-index {
    display: block;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.75rem;
}

.guide-contract-item h3 {
    margin-bottom: 0.35rem;
    font-size: 0.92rem;
}

.guide-contract-item p,
.guide-tree-note span,
.guide-check p,
.guide-workflow-list p {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.6;
}

.guide-tree-wrap {
    display: grid;
    grid-template-columns: 1.35fr 0.65fr;
    gap: 1rem;
    align-items: stretch;
}

.guide-tree,
.guide-code,
.guide-command-box {
    overflow-x: auto;
    margin: 0;
    padding: 1.5rem;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: #1d1d1b;
    color: #f3f3f1;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.75;
    white-space: pre;
}

.guide-tree-note {
    display: grid;
    align-content: center;
    gap: 1rem;
    padding: 1.4rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.56);
}

.guide-tree-note div {
    display: grid;
    gap: 0.3rem;
}

.guide-tree-note strong {
    font-size: 0.72rem;
}

.guide-metadata-layout {
    display: grid;
    grid-template-columns: 1.35fr 0.65fr;
    gap: 1rem;
}

.guide-code {
    background: #f9f9f7;
    color: var(--text);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.guide-field-list {
    display: grid;
    align-content: start;
    border-top: 1px solid var(--border);
}

.guide-field-list div {
    display: grid;
    grid-template-columns: 135px 1fr;
    gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

.guide-field-list code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.72rem;
}

.guide-field-list span {
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.45;
}

.guide-evaluation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.guide-evaluation-card {
    padding: 1.6rem;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 10px 24px rgba(20, 20, 18, 0.035);
}

.guide-evaluation-card.is-dark {
    border-color: #292927;
    background: #1d1d1b;
    color: #f5f5f3;
}

.guide-card-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2.5rem;
    color: var(--text-secondary);
    font-size: 0.65rem;
    letter-spacing: 0.08em;
}

.guide-evaluation-card.is-dark .guide-card-top {
    color: #a9a9a4;
}

.guide-card-top code,
.guide-evaluation-card code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.68rem;
}

.guide-evaluation-card h3 {
    margin-bottom: 0.6rem;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.guide-evaluation-card > p {
    min-height: 82px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.65;
}

.guide-evaluation-card.is-dark > p {
    color: #b7b7b2;
}

.guide-evaluation-card dl {
    margin-top: 1.4rem;
    border-top: 1px solid var(--border);
}

.guide-evaluation-card.is-dark dl {
    border-color: rgba(255, 255, 255, 0.16);
}

.guide-evaluation-card dl div {
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: 0.8rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
}

.guide-evaluation-card.is-dark dl div {
    border-color: rgba(255, 255, 255, 0.16);
}

.guide-evaluation-card dt {
    color: var(--text-secondary);
    font-size: 0.66rem;
    text-transform: uppercase;
}

.guide-evaluation-card.is-dark dt {
    color: #a9a9a4;
}

.guide-evaluation-card dd {
    color: var(--text-secondary);
    font-size: 0.73rem;
    line-height: 1.45;
}

.guide-evaluation-card.is-dark dd {
    color: #d0d0ca;
}

.guide-check-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.guide-check {
    padding: 1.4rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.52);
}

.guide-check > span {
    display: block;
    margin-bottom: 2.5rem;
    color: var(--text-secondary);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.72rem;
}

.guide-check strong {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
}

.guide-workflow-list {
    display: grid;
    border-top: 1px solid var(--border);
}

.guide-workflow-list li {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 1.2rem;
    padding: 1.15rem 0;
    border-bottom: 1px solid var(--border);
    list-style: none;
}

.guide-workflow-list li > span {
    color: var(--text-secondary);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.72rem;
}

.guide-workflow-list strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.88rem;
}

.guide-checklist {
    padding-bottom: 1rem;
}

.guide-final-grid {
    display: grid;
    grid-template-columns: 1fr 0.8fr;
    gap: 1rem;
    align-items: start;
}

.guide-checklist-list {
    display: grid;
    gap: 0.7rem;
    padding-left: 1.2rem;
}

.guide-checklist-list li {
    padding-left: 0.3rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.5;
}

.guide-command-box {
    padding: 1.25rem;
    background: var(--surface);
    color: var(--text);
}

.guide-command-box > span {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.67rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.guide-command-box pre {
    overflow-x: auto;
    margin: 0;
    padding: 0.8rem;
    border-radius: 8px;
    background: #1d1d1b;
    color: #f3f3f1;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.7rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.guide-command-box p {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    line-height: 1.5;
}

@media (max-width: 520px) {
    nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .nav-links {
        justify-content: flex-start;
        width: 100%;
        gap: 0.2rem;
        font-size: 0.62rem;
        overflow-x: auto;
        scrollbar-width: none;
        white-space: nowrap;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-github {
        height: 26px;
        margin-left: 0.35rem;
        padding-left: 0.75rem;
    }

    .nav-github svg {
        width: 16px;
        height: 16px;
    }

    .site-toast {
        right: 1rem;
        bottom: 1rem;
    }
}

/* Keep the guide layout last in the cascade. */
body.guide-page .guide-main { max-width: 1160px; padding: 7.5rem 3rem 7rem; }
body.guide-page .guide-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr); gap: 4rem; max-width: none; padding: 0 0 4.2rem; border-bottom: 0; }
body.guide-page .guide-hero h1 { max-width: 720px; margin-bottom: 1.25rem; font-size: clamp(2.8rem, 6vw, 5rem); line-height: 0.99; }
body.guide-page .guide-hero-card { align-self: center; padding: 1.4rem 1.5rem 0.6rem; border-radius: 16px; background: #1d1d1b; color: #f4f4f0; box-shadow: 0 18px 38px rgba(20,20,18,0.1); }
body.guide-page .guide-hero-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 0.65rem; align-items: baseline; padding: 0.9rem 0; border-top: 1px solid rgba(255,255,255,0.14); }
body.guide-page .guide-section { margin-top: 7rem; }
body.guide-page .guide-section-heading { max-width: 700px; margin-bottom: 2rem; }
body.guide-page .guide-section-heading h2 { margin-bottom: 0.65rem; font-size: clamp(1.6rem,3vw,2.2rem); letter-spacing: -0.045em; }
body.guide-page .guide-package-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(240px,0.5fr); gap: 1rem; align-items: stretch; }
body.guide-page .guide-tree { min-height: 100%; padding: 1.55rem 1.7rem; border: 1px solid #2d2d2a; border-radius: 16px; background: #1d1d1b; color: #ecece7; font-family: 'SFMono-Regular',Consolas,monospace; font-size: 0.73rem; line-height: 1.72; white-space: pre; }
body.guide-page .guide-package-notes { display: grid; align-content: center; gap: 1.2rem; padding: 1.4rem 1.35rem; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,0.58); }
body.guide-page .guide-evaluation-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; }
body.guide-page .guide-evaluation-card { min-height: 390px; padding: 1.55rem 1.6rem 1.2rem; border: 1px solid var(--border-strong); border-radius: 16px; background: rgba(255,255,255,0.72); box-shadow: 0 12px 28px rgba(20,20,18,0.045); }
body.guide-page .guide-evaluation-card.is-dark { border-color: #292927; background: #1d1d1b; color: #f4f4f0; }
body.guide-page .guide-card-top { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 3.4rem; }
body.guide-page .guide-evaluation-card > p { min-height: 105px; font-size: 0.81rem; line-height: 1.7; }
body.guide-page .guide-file-rows { margin-top: 1.4rem; border-top: 1px solid var(--border); }
body.guide-page .guide-file-rows div { display: grid; grid-template-columns: 145px 1fr; gap: 0.7rem; padding: 0.72rem 0; border-bottom: 1px solid var(--border); }
body.guide-page .guide-metadata-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(230px,0.65fr); gap: 1rem; align-items: start; }
body.guide-page .guide-code { padding: 1.5rem 1.65rem; border: 1px solid var(--border); border-radius: 16px; background: #f8f8f5; color: var(--text); font-family: 'SFMono-Regular',Consolas,monospace; font-size: 0.72rem; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
body.guide-page .guide-field-list div { display: grid; grid-template-columns: 130px 1fr; gap: 0.8rem; padding: 0.82rem 0; border-bottom: 1px solid var(--border); }
body.guide-page .guide-check-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
body.guide-page .guide-check { min-height: 180px; padding: 1.35rem; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,0.58); }
body.guide-page .guide-check > span { margin-bottom: 2.8rem; }
body.guide-page .guide-publish-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: start; }
body.guide-page .guide-command-box { padding: 0; border: 0; border-radius: 0; background: transparent; }
body.guide-page .guide-command-box > span { display: block; margin-bottom: 0.7rem; color: var(--text); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
body.guide-page .guide-command-box p { margin-top: 0.9rem; color: var(--text); font-size: 0.95rem; font-weight: 500; line-height: 1.6; }
body.guide-page .guide-command-box pre { margin: 0; padding: 1.15rem 1.25rem; border-radius: 14px; background: #1d1d1b; color: #f3f3f1; font-family: 'SFMono-Regular',Consolas,monospace; font-size: 0.78rem; line-height: 1.7; white-space: pre; overflow-x: auto; overflow-wrap: normal; }

@media (max-width: 768px) {
    body.guide-page .guide-main { padding: 6rem 1.5rem 5rem; }
    body.guide-page .guide-hero, body.guide-page .guide-package-layout, body.guide-page .guide-evaluation-grid, body.guide-page .guide-metadata-layout, body.guide-page .guide-check-grid, body.guide-page .guide-publish-layout { grid-template-columns: 1fr; }
    body.guide-page .guide-hero { gap: 2rem; padding-bottom: 3rem; }
    body.guide-page .guide-hero h1 { font-size: clamp(2.4rem,10vw,3.8rem); }
    body.guide-page .guide-section { margin-top: 5rem; }
    body.guide-page .guide-evaluation-card { min-height: 0; }
    body.guide-page .guide-evaluation-card > p { min-height: 0; }
}

@media (max-width: 520px) {
    body.guide-page .guide-main { padding-right: 1rem; padding-left: 1rem; }
    body.guide-page .guide-hero-row { grid-template-columns: 28px 1fr; }
    body.guide-page .guide-hero-row em { grid-column: 2; }
    body.guide-page .guide-tree, body.guide-page .guide-code { padding: 1.1rem; font-size: 0.66rem; }
    body.guide-page .guide-card-top { display: block; }
    body.guide-page .guide-card-top code { display: block; margin-top: 0.45rem; }
    body.guide-page .guide-file-rows div, body.guide-page .guide-field-list div { grid-template-columns: 1fr; gap: 0.25rem; }
    body.guide-page .guide-check { min-height: 0; }
}

/* ============================================================
   Refinement layer — texture, depth, focus.
   Appended last on purpose: the guide/task layers above are
   kept untouched and this block wins by source order. Keep it
   at the end of the file.
   ============================================================ */

/* Unified warm-shadow scale (replaces the ad-hoc shadows above). */
:root {
    --shadow-xs: 0 1px 2px rgba(42, 48, 58, 0.05);
    --shadow-sm: 0 1px 2px rgba(42, 48, 58, 0.05), 0 4px 14px rgba(47, 63, 86, 0.07);
    --shadow-md: 0 1px 2px rgba(42, 48, 58, 0.06), 0 10px 30px rgba(47, 63, 86, 0.1);
    --shadow-lg: 0 2px 4px rgba(42, 48, 58, 0.07), 0 22px 48px rgba(47, 63, 86, 0.14);
}

/* Paper feel: soft top light + faint film grain over everything. */
body {
    background-image:
        radial-gradient(900px 420px at 8% -8%, rgba(154, 64, 56, 0.12), transparent 62%),
        radial-gradient(980px 520px at 96% -4%, rgba(44, 65, 92, 0.11), transparent 64%),
        radial-gradient(1100px 480px at 50% -140px, rgba(251, 250, 248, 0.95), rgba(255, 255, 255, 0) 70%);
}

body.guide-page {
    background-image:
        radial-gradient(900px 420px at 8% -8%, rgba(154, 64, 56, 0.1), transparent 62%),
        radial-gradient(980px 520px at 96% -4%, rgba(44, 65, 92, 0.1), transparent 64%),
        radial-gradient(1100px 480px at 50% -140px, rgba(251, 250, 248, 0.8), rgba(255, 255, 255, 0) 70%);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23grain)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
    opacity: 0.028;
    mix-blend-mode: multiply;
}

/* Typography: aligned numerals, balanced headings, ink-black hero title. */
.stat-number,
.eval-stat strong,
.chart-value,
.analysis-summary strong,
.agent-score-value,
.result-summary-line strong,
.task-group-count,
.task-settings strong {
    font-variant-numeric: tabular-nums;
}

h1,
h2,
h3,
.section-title {
    text-wrap: balance;
}

.section-subtitle,
.task-card p {
    text-wrap: pretty;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .hero h1,
    body.guide-page .guide-hero h1 {
        background-image: linear-gradient(180deg, #141414 20%, #3a3a3a 120%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

/* Editorial hairline above section titles. */
.section-title {
    position: relative;
    padding-top: 0.9rem;
}

.section-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 28px;
    height: 2px;
    background: linear-gradient(90deg, var(--amber), var(--accent));
}

/* Nav: stronger glass, brand mark, sliding link underline. */
nav {
    background: rgba(244, 242, 239, 0.84);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    backdrop-filter: blur(16px) saturate(1.5);
    box-shadow: 0 1px 0 rgba(42, 48, 58, 0.03), 0 8px 24px rgba(47, 63, 86, 0.04);
}

.nav-logo {
    display: inline-flex;
    align-items: center;
}

.nav-logo::after {
    content: '';
    width: 7px;
    height: 7px;
    margin-left: 0.45rem;
    border-radius: 2px;
    background: linear-gradient(135deg, var(--amber), var(--accent));
}

.nav-links a {
    position: relative;
    padding-bottom: 0.15rem;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--text);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.28s cubic-bezier(0.22, 0.8, 0.2, 1);
}

.nav-links a:hover::after,
.nav-links a.is-current::after {
    transform: scaleX(1);
}

/* Hero stats: hairline dividers instead of bare flex gap. */
.hero-stats {
    gap: 0;
}

.hero .stat {
    padding: 0 2.6rem;
}

.hero .stat + .stat {
    border-left: 1px solid var(--border-strong);
}

@media (max-width: 768px) {
    .hero-stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.2rem 1.6rem;
    }

    .hero .stat {
        padding: 0 1.6rem;
    }

    .hero .stat + .stat {
        border-left: 0;
    }
}

/* Buttons: crisp press instead of opacity dip. */
.btn {
    transition: transform 0.15s ease, box-shadow 0.25s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.btn-primary {
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: #243447;
    color: #fff;
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: var(--shadow-xs);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.55);
}

.btn-secondary:hover {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    opacity: 1;
}

/* The inverted button inside the dark CTA keeps its own scheme. */
.contribute-cta .btn-primary {
    box-shadow: 0 1px 2px rgba(20, 20, 18, 0.2), 0 8px 20px rgba(20, 20, 18, 0.18);
}

.contribute-cta .btn-primary:hover {
    background: #f5f5f2;
    color: #1d1d1b;
    opacity: 0.92;
}

/* Cards: tokenized resting + hover depth with a top light edge. */
.task-card,
.eval-stat,
.chart-card {
    transition: border-color 0.25s ease, box-shadow 0.3s cubic-bezier(0.22, 0.8, 0.2, 1), transform 0.3s cubic-bezier(0.22, 0.8, 0.2, 1);
}

.task-card {
    box-shadow: inset 0 1px 0 #ffffff, var(--shadow-xs);
}

.task-card:hover {
    box-shadow: inset 0 1px 0 #ffffff, var(--shadow-lg);
}

.eval-stat,
.chart-card {
    box-shadow: inset 0 1px 0 #ffffff, var(--shadow-xs);
}

/* Leaderboard: medal-style rank chips and active filter depth. */
.lb-rank {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin: 0 auto;
    border: 1px solid transparent;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
}

/* Ranks 1-3 (ties share a rank) show a medal instead of the number. */
.lb-rank.is-medal {
    font-size: 1.15rem;
    line-height: 1;
}


/* Meter tracks get a hairline inner ring. */
.chart-track,
.agent-score-visual i {
    box-shadow: inset 0 0 0 1px rgba(24, 24, 22, 0.045);
}

/* Dark panels read as matte objects: inner light edge + deeper drop. */
.contribute-cta {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow-lg);
}

body.guide-page .guide-hero-card,
body.guide-page .guide-evaluation-card.is-dark {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow-md);
}

body.guide-page .guide-tree,
body.guide-page .guide-command-box pre {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-sm);
}

body.guide-page .guide-evaluation-card {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), var(--shadow-sm);
}

.coming-soon-block {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 2rem;
    align-items: center;
    padding: 2.2rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.coming-soon-block > span {
    color: var(--text-secondary);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

.coming-soon-block h2 {
    margin-bottom: 0.35rem;
    font-size: 1.45rem;
}

.coming-soon-block p,
.issue-summary-panel p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.6;
}

.issue-summary-panel {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.issue-summary-panel strong {
    display: block;
    margin-bottom: 0.55rem;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .coming-soon-block {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
}

body.guide-page .guide-check,
body.guide-page .guide-package-notes {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), var(--shadow-xs);
}

/* Catalog group: the count ticks darker on hover for feedback. */
.task-group summary {
    transition: opacity 0.2s ease;
}

.task-group summary:hover .task-group-count {
    color: var(--text);
}

/* Focus, selection, scrollbar. */
:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 3px;
}

::selection {
    background: var(--text);
    color: var(--bg);
}

html {
    scrollbar-color: rgba(24, 24, 22, 0.25) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(24, 24, 22, 0.18) content-box;
    border: 3px solid transparent;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(36, 52, 71, 0.32) content-box;
}

/* Code and ink panels stay black. Navy and brick are accents only. */
.contribute-cta,
.guide-hero-card,
.guide-tree,
.guide-evaluation-card.is-dark,
.guide-command-box pre,
body.guide-page .guide-hero-card,
body.guide-page .guide-tree,
body.guide-page .guide-evaluation-card.is-dark,
body.guide-page .guide-command-box pre {
    background: #111111;
    border-color: #2a2a2a;
    color: #f4f4f2;
}

.contribute-kicker {
    color: #f4f4f2;
}

.contribute-cta .btn-primary,
.contribute-cta .btn-primary:hover {
    background: #e4e4e1;
    color: #1a1a1a;
    opacity: 1;
}

.contribute-cta .btn-primary:hover {
    background: #f3f3f1;
    color: #111111;
}

::selection {
    background: var(--accent);
    color: #fbfaf8;
}

body.guide-page .guide-evaluation-card,
body.guide-page .guide-check {
    min-height: 0;
}

body.guide-page .guide-evaluation-card > p,
body.guide-page .guide-card-top {
    min-height: 0;
    margin-bottom: 1.1rem;
}

body.guide-page .guide-file-rows strong {
    color: inherit;
    font-size: 0.78rem;
    font-weight: 550;
    line-height: 1.45;
}

.guide-example {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.4rem;
}

.guide-example h3 {
    margin-bottom: 0.45rem;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.guide-example p {
    max-width: 36rem;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.6;
}

/* The tree-root path line is a file name, not body copy: keep it in the
   file tree's own small mono format. */
p.guide-file-tree-root {
    max-width: none;
    margin: 0 0 1.1rem;
    color: #f4f4f2;
    font-size: inherit;
    line-height: 1.5;
}

.guide-example p + p {
    margin-top: 0.45rem;
}

.guide-example a {
    display: inline-flex;
    margin-top: 0.8rem;
    color: var(--accent);
    font-size: 0.84rem;
    font-weight: 650;
}

.guide-example pre {
    margin: 0;
    padding: 1.1rem 1.2rem;
    border-radius: 14px;
    background: #111111;
    color: #f4f4f2;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.7;
    white-space: pre;
    overflow-x: auto;
}

/* Sample-task file browser */
.guide-file-browser {
    display: grid;
    grid-template-columns: 14.5rem minmax(0, 1fr);
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #111111;
    color: #f4f4f2;
    overflow: hidden;
}

.guide-file-tree {
    padding: 1rem 0.7rem 1.2rem;
    border-right: 1px solid rgba(244, 244, 242, 0.09);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.72rem;
    line-height: 1.5;
    overflow-y: auto;
    overflow-wrap: anywhere;
}

.guide-file-tree-root {
    margin: 0 0 1.1rem;
    padding: 0 0.55rem;
    color: #f4f4f2;
    font-size: inherit;
    letter-spacing: 0.02em;
    overflow-wrap: anywhere;
}

.guide-file-tree ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.guide-file-tree ul ul {
    padding-left: 0.85rem;
}

.guide-file-tree li {
    margin: 0;
}

.guide-file-tree button {
    display: block;
    width: 100%;
    padding: 0.24rem 0.55rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #b6b6b0;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.guide-file-tree button:hover {
    background: rgba(244, 244, 242, 0.07);
    color: #f4f4f2;
}

.guide-file-tree button.is-active {
    background: rgba(154, 64, 56, 0.34);
    color: #ffffff;
}

.guide-file-tree button.is-defect {
    color: #d08d82;
}

.guide-file-tree button.is-defect:hover {
    color: #f2b3ab;
}

.guide-file-tree button.is-defect.is-active {
    color: #ffffff;
}

.guide-folder {
    display: block;
    margin-top: 0.6rem;
    padding: 0.2rem 0.55rem 0.12rem;
    color: #909089;
    font-weight: 650;
}

.guide-folder em {
    margin-left: 0.45rem;
    color: #6a6a64;
    font-style: normal;
    font-weight: 400;
}

.guide-locked {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.24rem 0.55rem;
    color: #61615c;
}

.guide-locked svg {
    width: 0.68rem;
    height: 0.68rem;
    flex: none;
    fill: currentColor;
}

.guide-muted {
    display: block;
    padding: 0.24rem 0.55rem;
    color: #5c5c57;
}

.guide-file-view {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.guide-file-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.guide-file-panel[hidden] {
    display: none;
}

.guide-file-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 1rem 0.6rem 1.15rem;
    border-bottom: 1px solid rgba(244, 244, 242, 0.09);
}

.guide-file-panel-path {
    min-width: 0;
    color: #b6b6b0;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.68rem;
    overflow-wrap: anywhere;
}

.guide-file-panel-note {
    flex: none;
    color: #d08d82;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.6rem;
    font-weight: 650;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.guide-file-view pre {
    margin: 0;
    padding: 1rem 1.15rem 1.15rem;
    border-radius: 0;
    font-size: 0.72rem;
    line-height: 1.66;
    tab-size: 4;
    white-space: pre-wrap;
    color: #e8e8e3;
    flex: 1;
}

/* the guide-page pre override targets .guide-example pre; keep file bodies dense */
body.guide-page .guide-example .guide-file-view pre {
    font-size: 0.72rem;
    line-height: 1.66;
}

.guide-file-view mark {
    padding: 0.06em 0.32em;
    margin: 0 -0.32em;
    border-radius: 4px;
    background: rgba(154, 64, 56, 0.38);
    color: #ffffff;
}

.guide-file-view .guide-file-caption {
    max-width: none;
    margin: 0;
    padding: 0.7rem 1.15rem 0.95rem;
    border-top: 1px solid rgba(244, 244, 242, 0.09);
    color: #9a9a94;
    font-size: 0.8rem;
    line-height: 1.55;
}

/* guide-page text sizes run large; keep the browser dense */
body.guide-page .guide-file-view .guide-file-caption {
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .guide-file-browser {
        grid-template-columns: 1fr;
    }

    .guide-file-tree {
        max-height: 16rem;
        border-right: 0;
        border-bottom: 1px solid rgba(244, 244, 242, 0.09);
    }
}

.submit-ways {
    display: grid;
    gap: 4.5rem;
    min-width: 0;
}

.submit-way {
    min-width: 0;
    max-width: 100%;
    padding: 2.4rem 0 0.2rem;
    border: 0;
    border-top: 1px solid var(--border-strong);
    border-radius: 0;
    background: transparent;
}

.submit-way.is-agent {
    color: var(--text);
}

.submit-way-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1.25rem;
    align-items: start;
    margin-bottom: 1.35rem;
}

.submit-way-head > span {
    color: var(--brick);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
}

.submit-way h3 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    line-height: 1;
    letter-spacing: -0.03em;
}

.submit-way-head p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.55;
}

.submit-way.is-agent .submit-way-head p {
    color: var(--text-secondary);
}

.submit-way-head a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.submit-way-head button {
    padding: 0.55rem 1rem;
    border: 0;
    border-radius: 999px;
    background: var(--brick);
    color: #fffaf8;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.submit-way-head button:hover {
    background: #7d342e;
}

.submit-way.is-agent pre,
.submit-git {
    margin: 1rem 0 0;
    max-width: 100%;
    padding: 1.15rem 1.25rem;
    border-radius: 12px;
    background: #1c1c1c;
    color: #f7f7f4;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.submit-way.is-agent pre {
    background: #111111;
    font-size: 0.9rem;
}

.submit-way .guide-publish-steps {
    margin-top: 0.4rem;
}

.submit-way code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.92em;
}

body.guide-page .guide-hero > .guide-hero-copy > p,
body.guide-page .guide-section-heading p {
    font-size: 1.05rem;
}

body.guide-page .guide-section-heading h2 {
    font-size: clamp(2rem, 3.2vw, 2.6rem);
}

body.guide-page .guide-publish-steps p,
body.guide-page .guide-evaluation-card > p,
body.guide-page .guide-example p:not(.guide-file-tree-root) {
    font-size: 0.98rem;
}

body.guide-page .guide-hero-row strong,
body.guide-page .guide-publish-steps strong,
body.guide-page .guide-file-rows strong,
body.guide-page .guide-evaluation-card h3 {
    font-size: 1.05rem;
}

body.guide-page .guide-file-rows span,
body.guide-page .guide-hero-row em,
body.guide-page .guide-hero-row > span {
    font-size: 0.84rem;
}

body.guide-page .guide-example pre {
    font-size: 0.92rem;
}

@media (max-width: 768px) {
    .submit-ways {
        gap: 3rem;
    }

    .submit-way-head {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .submit-way-head button {
        grid-column: 2;
    }
}

#submit .guide-command-box {
    margin-top: 1.75rem;
}

.guide-example-link a {
    color: var(--accent);
    font-size: 0.92rem;
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

.guide-prompt-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.guide-prompt-bar span {
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.guide-prompt-bar button {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 650;
    cursor: pointer;
}

.guide-prompt-bar button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-primary {
    background: var(--brick);
    color: #fffaf8;
}

.btn-primary:hover {
    background: #7d342e;
    color: #fffaf8;
    opacity: 1;
}

.contribute-cta .btn-primary,
.contribute-cta .btn-primary:hover {
    background: #e4e4e1;
    color: #1a1a1a;
}

.contribute-cta .btn-primary:hover {
    background: #f3f3f1;
    color: #111111;
}

body.home-page {
    --accent: var(--brick);
    --accent-soft: var(--brick-soft);
    /* Static white top-glow only; animated color blobs live on ::before. */
    background-image:
        radial-gradient(1100px 480px at 50% -140px, rgba(251, 250, 248, 0.95), rgba(255, 255, 255, 0) 70%);
}

/* Aurora orb canvas — fixed, full-viewport, behind page content.
   z-index: 0 keeps it above the html root background (z-index: -1 would hide
   behind it); canvas is first in DOM so later nav/section elements stack on top. */
#globe-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: block;
}

body.home-page .domain-card.is-active {
    background: linear-gradient(180deg, #ffffff 0%, #f8eeec 100%);
    box-shadow: inset 0 1px 0 #ffffff, 0 12px 28px rgba(154, 64, 56, 0.12);
}

body.home-page .stat-number,
body.home-page .task-overview-stat strong {
    color: var(--text);
}

.lb-issue-score {
    min-width: 3rem;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.lb-pending {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
}

.lb-pending-label {
    color: var(--text-secondary);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lb-pending-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(20, 20, 20, 0.08);
    filter: blur(1.6px);
    opacity: 0.45;
    overflow: hidden;
}

.lb-pending-bar span {
    display: block;
    width: 58%;
    height: 100%;
    border-radius: inherit;
    background: var(--brick);
}

/* Image wordmark */
.nav-logo img {
    display: block;
    height: 24px;
    width: auto;
}

.nav-logo:has(img)::after {
    content: none;
}

.footer-brand .nav-logo img {
    height: 22px;
}

/* Hero logo */
.hero-logo {
    display: block;
    margin: 0 auto 2rem;
    max-width: 500px;
    width: 100%;
    height: auto;
}

/* Contributors page */
body.team-page .guide-main { max-width: 1160px; padding: 7.5rem 3rem 7rem; }
.team-header { max-width: 760px; margin-bottom: 3rem; }
.team-header h1 {
    margin-bottom: 1rem;
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 1.02;
}
.team-header p { color: var(--text-secondary); font-size: 1rem; line-height: 1.75; }

.team-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    list-style: none;
}
.team-card {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 1.2rem 1.3rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: inset 0 1px 0 #ffffff, var(--shadow-xs);
    transition: border-color 0.25s ease, transform 0.3s cubic-bezier(0.22, 0.8, 0.2, 1), box-shadow 0.3s ease;
}
.team-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
/* Initials sit under the photo; they show when there is no handle or the image fails to load. */
.team-avatar::before { content: attr(data-initials); }
.team-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--surface-soft);
}
.team-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 #ffffff, var(--shadow-lg);
}
.team-info h3 { font-size: 1rem; font-weight: 650; letter-spacing: -0.02em; }
.team-info p { margin-top: 0.25rem; color: var(--text-secondary); font-size: 0.78rem; line-height: 1.5; }

.team-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding: 1.3rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    font-size: 0.88rem;
}
.team-cta > span { color: var(--text-secondary); }
.team-cta a { font-weight: 600; }

@media (max-width: 960px) {
    .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    body.team-page .guide-main { padding: 6rem 1.5rem 5rem; }
}
@media (max-width: 560px) {
    body.team-page .guide-main { padding-right: 1rem; padding-left: 1rem; }
    .team-grid { grid-template-columns: 1fr; }
    .team-cta { flex-direction: column; align-items: flex-start; }
}

/* ==================================================================
   Homepage: the gap, pipeline, why-contribute. Appended after the
   refinement layer; reuses its tokens (paper, hairlines, mono marks).
   ================================================================== */

/* Hero — tighten the rhythm above the buttons. */
.home-page .hero > p { margin-bottom: 2.4rem; }

/* The gap lede — the background paragraph opening "Why this benchmark". */
.gap-lede {
    max-width: 760px;
    margin: -0.6rem 0 0;
    font-size: 1.26rem;
    line-height: 1.62;
    letter-spacing: -0.01em;
}
.gap-lede strong { color: var(--text); font-weight: 700; }
.gap-lede + .gap-lede { margin-top: 0.7rem; }

/* How a task runs — prepare → agent → verify. */
.pipeline-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.9rem;
    align-items: stretch;
}
.pipeline-stage {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem 1.4rem 1.7rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: inset 0 1px 0 #ffffff, var(--shadow-xs);
}
.pipeline-stage-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.pipeline-stage-label span { color: var(--text-secondary); }
.pipeline-stage-label b { color: var(--accent); font-weight: 650; }
.pipeline-stage h3 { font-size: 1.02rem; font-weight: 650; letter-spacing: -0.02em; }
.pipeline-stage p { color: var(--text-secondary); font-size: 0.82rem; line-height: 1.6; }
.pipeline-stage.is-agent {
    border-color: var(--border-strong);
}
.pipeline-arrow {
    align-self: center;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.pipeline-note {
    margin-top: 1.6rem;
    color: var(--text-secondary);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

/* Benchmark scale — numbers split by hairline vertical dividers. */
.why-stats {
    display: flex;
    justify-content: center;
    align-items: stretch;
    margin: 1.8rem 0 2rem;
}
.why-stat {
    padding: 0 2.1rem;
    text-align: center;
}
.why-stat + .why-stat { border-left: 1px solid var(--border); }
.why-stat-num {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.why-stat-label {
    display: block;
    margin-top: 0.3rem;
    color: var(--text-secondary);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    line-height: 1.5;
}
.why-stat-note {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.55rem;
    padding: 0.3rem 0.78rem;
    border: 1px solid rgba(47, 158, 91, 0.45);
    border-radius: 999px;
    background: #e6f2ea;
    color: var(--text-secondary);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.why-stat-note::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2f9e5b;
    box-shadow: 0 0 0 2px rgba(47, 158, 91, 0.16);
    animation: why-note-pulse 2.4s ease-in-out infinite;
}
@keyframes why-note-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(47, 158, 91, 0.16); }
    50% { box-shadow: 0 0 0 4px rgba(47, 158, 91, 0.26); }
}

/* Closing note — the AutoRLBench-isolates paragraph as one centered paper card. */
.why-invite {
    max-width: 780px;
    margin: 2.2rem auto 0;
    padding: 1.6rem 1.8rem 1.7rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: inset 0 1px 0 #ffffff, var(--shadow-md);
}
.why-invite p { font-size: 1.05rem; line-height: 1.68; letter-spacing: -0.01em; }
.why-invite strong { color: var(--text); font-weight: 700; }

/* Why contribute — title, help-us lede, three declaration cards. */
.contribute-why-lede {
    margin: -0.4rem auto 0;
    max-width: 640px;
    font-size: 1.18rem;
    line-height: 1.6;
    letter-spacing: -0.01em;
}
.contribute-why-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
    margin-top: 2.2rem;
    text-align: left;
}
.contribute-why-card {
    padding: 1.5rem 1.5rem 1.6rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: inset 0 1px 0 #ffffff, var(--shadow-xs);
}
.contribute-why-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 1rem;
    border-radius: 10px;
    background: rgba(164, 44, 42, 0.08);
}
.contribute-why-icon svg { width: 22px; height: 22px; fill: var(--brick); }
.contribute-why-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.contribute-why-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.93rem;
    line-height: 1.6;
}
.contribute-why-card strong { color: var(--brick); font-weight: 700; }
.cta-actions { display: flex; justify-content: center; gap: 1.2rem; margin-top: 2rem; }

@media (max-width: 900px) {
    .pipeline-flow { grid-template-columns: minmax(0, 1fr); }
    .pipeline-arrow { width: 30px; height: 30px; justify-self: center; transform: rotate(90deg); }
}
@media (max-width: 768px) {
    .gap-lede { font-size: 1.08rem; }
    .why-stats { margin: 1.6rem 0 1.8rem; }
    .why-stat { padding: 0 1.6rem; }
    .why-stat-num { font-size: 2rem; }
    .why-invite { padding: 1.4rem 1.4rem 1.5rem; }
    .why-invite p { font-size: 0.98rem; }
    .contribute-why-lede { font-size: 1.04rem; }
    .contribute-why-grid { grid-template-columns: 1fr; gap: 1rem; margin-top: 1.8rem; }
    .contribute-why-card { padding: 1.3rem 1.3rem 1.4rem; }
}

/* ==================================================================
   Homepage layout — agents-last-exam rhythm: each module's title
   and copy centered, tighter spacing between modules.
   ================================================================== */
body.home-page > section:not(.hero) {
    padding: 3.6rem 3rem 3.4rem;
    text-align: center;
}
body.home-page > section#why { padding-top: 8rem; }
body.home-page .section-title { margin-left: auto; margin-right: auto; }
body.home-page .section-title::before { left: 50%; transform: translateX(-50%); }
body.home-page .gap-lede { margin: -0.6rem auto 0; }
body.home-page .gap-lede + .gap-lede { margin-top: 0.9rem; }
body.home-page .lb-kicker { margin-left: auto; margin-right: auto; }

/* Card interiors keep their own alignment; only module copy centers. */
body.home-page .pipeline-flow { text-align: left; }
body.home-page .tasks-grid { text-align: left; }

@media (max-width: 560px) {
    body.home-page > section:not(.hero) { padding: 2.6rem 1.4rem 2.5rem; }
}

/* Leaderboard analysis charts — card shell mirrors .task-card */
.lb-analysis {
    margin-top: 3rem;
}
.lb-subtitle {
    margin-bottom: 1.2rem;
    color: var(--text-secondary);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.lb-chart-row {
    display: flex;
    gap: 1.2rem;
}
/* flex-grow = image aspect ratio and flex-basis = image padding,
   so both chart images render at the same height */
.lb-chart-row .lb-chart {
    flex-basis: 2rem;
    min-width: 0;
}
.lb-chart {
    display: flex;
    flex-direction: column;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: inset 0 1px 0 #ffffff, var(--shadow-xs);
    text-align: left;
}
.lb-chart-image {
    box-sizing: border-box;
    padding: 0.75rem 1rem;
    background: #fcfcfb; /* matches the chart PNG background */
}
.lb-chart-wide .lb-chart-image {
    padding-top: 1.75rem;
}
.lb-chart-image img {
    display: block;
    width: 100%;
    height: auto;
}
.lb-chart figcaption {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.2rem 1.3rem;
    border-top: 1px solid var(--border);
}
.lb-chart figcaption h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}
.lb-chart figcaption p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.45;
}
@media (max-width: 768px) {
    .lb-chart-row { flex-direction: column; }
    .lb-chart-row .lb-chart { flex: none !important; }
}

/* Contribute page: dated timeline, merged into the hero grid — it sits on its
   own full-width row directly under the "How to submit" link / required card.
   The track spans the outer content column: the first dot sits on the left
   edge, the last dot on the right edge with its label right-aligned under
   it. Narrow screens stack vertically. */
body.guide-page .guide-hero > .guide-timeline-track {
    grid-column: 1 / -1;
}

body.guide-page .guide-timeline-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 961px) {
    /* Inside the hero grid the track already spans the full content column,
       so no negative margins — the dots land on the column edges. */
    body.guide-page .guide-timeline-track li:last-child {
        text-align: right;
    }

    body.guide-page .guide-timeline-track li:last-child::before {
        left: auto;
        right: 0;
    }

    body.guide-page .guide-timeline-track li:last-child .guide-timeline-date {
        left: auto;
        right: 0;
    }

    body.guide-page .guide-timeline-track li:last-child p {
        margin-left: auto;
    }

    /* The connector into the last dot spans the entire last column. */
    body.guide-page .guide-timeline-track li:nth-child(3)::after {
        right: calc(-100% - 1.75rem + 6px);
    }
}

body.guide-page .guide-timeline-track li {
    position: relative;
    padding-top: 1.9rem;
}

body.guide-page .guide-timeline-track li::before {
    content: "";
    position: absolute;
    top: -5.5px;
    left: 0;
    z-index: 1;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border-strong);
}

body.guide-page .guide-timeline-track li.is-deadline::before {
    background: var(--brick);
    border-color: var(--brick);
}

body.guide-page .guide-timeline-track li::after {
    content: "";
    position: absolute;
    top: 0;
    left: 6px;
    right: calc(-1.75rem - 6px);
    height: 1px;
    background: var(--border-strong);
}

body.guide-page .guide-timeline-track li:last-child::after {
    display: none;
}

body.guide-page .guide-timeline-date {
    position: absolute;
    top: 0.5rem;
    left: 0;
    color: var(--text-secondary);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.72rem;
}

body.guide-page .guide-timeline-track li.is-deadline .guide-timeline-date {
    color: var(--brick);
    font-weight: 700;
}

body.guide-page .guide-timeline-track h3 {
    margin: 0 0 0.3rem;
    font-size: 1.02rem;
    letter-spacing: -0.02em;
}

body.guide-page .guide-timeline-track p {
    margin: 0;
    max-width: 17rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
}

body.guide-page .guide-deadline {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 2.2rem;
    align-items: center;
    margin-top: 2.1rem;
    padding: 1.6rem 1.8rem;
    border-radius: 16px;
    background: #1d1d1b;
    color: #f4f4f0;
    box-shadow: 0 18px 38px rgba(20,20,18,0.1);
}

body.guide-page .guide-deadline-date {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: clamp(1.35rem, 2.4vw, 1.9rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

body.guide-page .guide-deadline-copy h3 {
    margin: 0 0 0.3rem;
    color: #9b9b95;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

body.guide-page .guide-deadline-copy p {
    margin: 0;
    color: #d7d7d1;
    font-size: 0.98rem;
    line-height: 1.6;
}

body.guide-page .guide-deadline-copy strong {
    color: #ffffff;
    font-weight: 650;
}

body.guide-page .guide-deadline-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.18rem;
    border-bottom: 1px solid rgba(255,255,255,0.45);
    color: #f4f4f0;
    font-size: 0.95rem;
    font-weight: 650;
    white-space: nowrap;
}

body.guide-page .guide-deadline-link span {
    transition: transform 0.2s ease;
}

body.guide-page .guide-deadline-link:hover {
    opacity: 1;
}

body.guide-page .guide-deadline-link:hover span {
    transform: translateX(4px);
}

@media (max-width: 960px) {
    body.guide-page .guide-timeline-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2.1rem 1.75rem;
    }

    body.guide-page .guide-timeline-track li:nth-child(2)::after {
        display: none;
    }
}

@media (max-width: 768px) {
    body.guide-page .guide-deadline {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    body.guide-page .guide-deadline-link {
        margin-top: 0.4rem;
    }
}

@media (max-width: 600px) {
    body.guide-page .guide-timeline-track {
        grid-template-columns: 1fr;
        gap: 1.8rem;
    }

    body.guide-page .guide-timeline-track li {
        padding-top: 0;
        padding-left: 2.2rem;
    }

    body.guide-page .guide-timeline-track li::before {
        top: 4px;
        left: 0;
    }

    body.guide-page .guide-timeline-date {
        position: static;
        display: block;
        margin-bottom: 0.25rem;
    }

    body.guide-page .guide-timeline-track li::after {
        top: 10px;
        bottom: calc(-1.8rem - 4px);
        left: 5.5px;
        right: auto;
        width: 1px;
        height: auto;
    }

    body.guide-page .guide-timeline-track li:nth-child(2)::after {
        display: block;
    }

    body.guide-page .guide-timeline-track li:last-child::after {
        display: none;
    }

    body.guide-page .guide-timeline-track p {
        max-width: none;
    }
}

/* Agent trace viewer (trace.html). Two-column console layout modeled on
   AutoRLBench's run view: a sticky left rail with the run summary, and a
   structured event timeline on the right — thread line, turn markers, and
   block cards (thought / text / tool call). */
body.trace-page {
    /* Console page: the document itself never scrolls — each trace column
       manages its own overflow (rail + main viewport). The footer stays
       visible below the console via the column flex layout. */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background-image:
        radial-gradient(900px 420px at 8% -8%, rgba(154, 64, 56, 0.1), transparent 62%),
        radial-gradient(980px 520px at 96% -4%, rgba(44, 65, 92, 0.1), transparent 64%),
        radial-gradient(1100px 480px at 50% -140px, rgba(251, 250, 248, 0.8), rgba(255, 255, 255, 0) 70%);
}

body.trace-page > *:not(#globe-canvas):not(nav):not(.site-toast) {
    position: relative;
    z-index: 1;
}

.trace-view {
    /* Overrides the global `section { max-width: 1100px }` cap: the
       two-column trace console needs the wider layout. Fills the viewport
       between the fixed nav and the footer so the columns control their
       own scrolling. */
    max-width: none;
    padding: 6.5rem 1.25rem 0.8rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Height must chain down to the scrollable viewport: view > root > layout. */
#trace-root {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* ---- Layout: summary rail + event main -------------------------------- */

.trace-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1.4rem;
    max-width: 1320px;
    margin: 0 auto;
    flex: 1;
    min-height: 0;
}

.trace-rail {
    /* Fixed in place: the rail never scrolls the page, and only spills
       into its own scrollbar when the card outgrows the column. */
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 2px 2px 6px;
    scrollbar-width: thin;
}

.trace-rail::-webkit-scrollbar { width: 4px; }


.trace-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.74rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    width: max-content;
}

.trace-back:hover { color: var(--text); }

.trace-back svg { transition: transform 0.15s ease; }

.trace-back:hover svg { transform: translateX(-2px); }

.trace-card {
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(42, 48, 58, 0.04);
    padding: 1.15rem 1.15rem 1.05rem;
}

.trace-summary-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.trace-summary-sub {
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    overflow-wrap: anywhere;
}

.trace-score {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
}

.trace-score-big {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.trace-score-sub {
    margin-top: 0.3rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

/* "Run details" disclosure — collapsed by default keeps the rail compact. */
.trace-details-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 1rem;
    padding: 0.55rem 0 0.5rem;
    border: 0;
    border-top: 1px solid var(--border);
    background: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.trace-details-toggle:hover { color: var(--text); }

.trace-details-caret { transition: transform 0.18s ease; font-size: 0.8rem; }

.trace-summary-stats {
    display: none;
    margin: 0.45rem 0 0;
    padding: 0 0 0.35rem;
}

.trace-summary-stats.open {
    display: grid;
    /* Labels keep their natural width and never wrap; long values (task
       title) wrap inside the value cell instead. */
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.32rem 0.8rem;
}

.trace-summary-stats dt {
    color: var(--text-secondary);
    font-size: 0.68rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.trace-summary-stats dd {
    margin: 0;
    color: var(--text);
    font-size: 0.74rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    overflow-wrap: anywhere;
}

.trace-summary-footer {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
}

.trace-btn {
    padding: 0.38rem 0.85rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.trace-btn:hover {
    color: var(--text);
    border-color: var(--text);
    opacity: 1;
}

.trace-btn--wide { text-align: center; }

/* ---- Main column: toolbar + event thread ------------------------------- */

.trace-main {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* The scrollable pane: the document does not scroll on the trace page —
   the event thread (and only it) scrolls inside this viewport. */
.trace-viewport {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 10px 2.5rem 0;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-gutter: stable;
}

.trace-viewport::-webkit-scrollbar { width: 6px; }

/* Footer inside the viewport: shows up after the last trace event when
   the thread is scrolled all the way down. */
.trace-viewport > footer {
    max-width: none;
    margin: 1.5rem 0 0;
    padding: 2.5rem 0 0;
}

.trace-toolbar {
    display: flex;
    align-items: center;
    gap: 0.6rem 1rem;
    margin-bottom: 1.1rem;
    padding: 0.45rem 0.8rem;
    background: rgba(244, 242, 239, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.trace-toolbar-count {
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
}

/* ---- Event timeline ------------------------------------------------------
   A continuous thread line with one node per event; the marker column
   carries the turn number (agent turns) or role (user), plus elapsed time. */

.trace-events {
    position: relative;
    display: flex;
    flex-direction: column;
}

.trace-events::before {
    content: '';
    position: absolute;
    left: 88px;
    top: 0.6rem;
    bottom: 0.6rem;
    width: 2px;
    background: var(--border);
    border-radius: 1px;
    z-index: 0;
}

.trace-event {
    position: relative;
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 1.4rem;
    padding: 0.95rem 0;
    z-index: 1;
}

/* The node — filled circle for agent turns, hollow for the user task. */
.trace-event::after {
    content: '';
    position: absolute;
    left: 82px;
    top: 1.15rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--brick);
    border: 3px solid var(--bg);
    box-shadow: 0 0 0 1px var(--border);
    box-sizing: border-box;
    z-index: 2;
}

.trace-event--user::after {
    background: var(--bg);
    border-color: var(--accent);
    width: 10px;
    height: 10px;
    top: 1.25rem;
    left: 84px;
}

.trace-marker {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 0.18rem;
    padding-top: 0.1rem;
    color: var(--text-secondary);
    font-size: 0.68rem;
    user-select: none;
}

.trace-turn-num {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.trace-turn-num::before {
    content: '#';
    font-size: 0.68rem;
    font-weight: 500;
    margin-right: 1px;
    opacity: 0.7;
}

.trace-marker-role {
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.trace-marker-time {
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    cursor: help;
}

.trace-event-body {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
    padding-left: 0.5rem;
}

/* ---- Blocks ------------------------------------------------------------ */

.trace-block {
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(42, 48, 58, 0.04);
    padding: 0.7rem 0.95rem;
}

.trace-block--text { max-width: 78ch; }

/* Thought: dashed card that shrinks to a chip when closed (default). */
.trace-thinking {
    width: 100%;
    max-width: 78ch;
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.025);
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.trace-thinking:not([open]) {
    width: max-content;
    max-width: 100%;
    padding: 0.32rem 0.65rem;
    background: transparent;
}

.trace-thinking > summary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.trace-thinking > summary::-webkit-details-marker { display: none; }

.trace-thinking > summary::after {
    content: '+';
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.trace-thinking[open] > summary::after { content: '−'; }

.trace-thinking[open] > summary { margin-bottom: 0.45rem; }

.trace-thinking:not([open]):hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--text-secondary);
}

.trace-thinking-meta {
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    opacity: 0.75;
}

.trace-thinking-body { font-style: italic; color: var(--text-secondary); }

/* ---- Tool call card: input + output in one connected panel ------------- */

.trace-tool {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.62);
    box-shadow: 0 1px 2px rgba(42, 48, 58, 0.04);
    overflow: hidden;
}

.trace-tool > summary {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.8rem;
    background: rgba(236, 232, 227, 0.4);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.trace-tool > summary::-webkit-details-marker { display: none; }

.trace-tool > summary::before {
    content: '▸';
    flex: 0 0 auto;
    color: var(--text-secondary);
    font-size: 0.68rem;
    transition: transform 0.18s ease;
}

.trace-tool[open] > summary::before { transform: rotate(90deg); }

.trace-tool > summary:hover { background: rgba(236, 232, 227, 0.6); }

.trace-tool-kicker {
    flex: 0 0 auto;
    color: var(--text-secondary);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.trace-tool-name {
    flex: 0 0 auto;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.76rem;
    letter-spacing: 0.01em;
}

.trace-tool-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.7rem;
}

.trace-tool-id {
    margin-left: auto;
    flex: 0 0 auto;
    color: var(--text-secondary);
    opacity: 0.65;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.62rem;
}

.trace-tool-args,
.trace-tool-out {
    padding: 0.55rem 0.85rem 0.7rem;
    background: #faf9f7;
}

.trace-tool-out { border-top: 1px solid var(--border); }

.trace-tool-sec {
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

/* Per-tool input structures */
.trace-bash-cmd {
    padding: 0.5rem 0.7rem;
    background: #f1efec;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    overflow-wrap: anywhere;
}

.trace-bash-cmd::before {
    content: '$ ';
    color: var(--text-secondary);
}

.trace-bash-cmd code {
    font-family: inherit;
    font-size: 0.74rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--text);
}

.trace-file-path {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.74rem;
    color: var(--text);
    overflow-wrap: anywhere;
}

.trace-arg-desc {
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-style: italic;
}

.trace-diff-del,
.trace-diff-add {
    margin: 0.15rem 0;
    border: 1px solid transparent;
    border-radius: 5px;
    background: rgba(154, 64, 56, 0.06);
    color: var(--brick-ink);
}

.trace-diff-add {
    background: rgba(47, 107, 67, 0.07);
    color: #2f6b43;
}

.trace-diff-del code,
.trace-diff-add code { white-space: pre-wrap; }

.trace-content-details > summary {
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.66rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.trace-content-details > summary::-webkit-details-marker { display: none; }

.trace-content-details > summary::before { content: '▸ '; }

.trace-content-details[open] > summary::before { content: '▾ '; }

/* Outputs */
.trace-tool-args .trace-pre,
.trace-tool-out .trace-pre { margin: 0; }

.trace-note {
    padding: 0.2rem 0;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-style: italic;
}

.trace-expand-btn {
    margin-top: 0.4rem;
    padding: 0.22rem 0.7rem;
    border: 1px dashed var(--border-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.66rem;
    cursor: pointer;
}

.trace-expand-btn:hover { color: var(--text); border-color: var(--text); }

/* Per-step token metrics */
.trace-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    padding-top: 0.15rem;
    color: var(--text-secondary);
    font-size: 0.64rem;
}

.trace-metric span {
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-right: 0.28rem;
}

.trace-metric strong {
    color: var(--text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ---- Markdown inside blocks -------------------------------------------- */

.trace-md {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.72;
}

.trace-md > *:first-child { margin-top: 0; }
.trace-md > *:last-child { margin-bottom: 0; }
.trace-md h2 { margin: 1.6rem 0 0.6rem; font-size: 1.05rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.trace-md h3 { margin: 1.4rem 0 0.5rem; font-size: 0.78rem; font-weight: 600; color: var(--text); text-transform: uppercase; letter-spacing: 0.06em; }
.trace-md h4 { margin: 1rem 0 0.4rem; font-size: 0.83rem; font-weight: 600; color: var(--text); }
.trace-md p { margin: 0.55rem 0; }
.trace-md ul,
.trace-md ol { margin: 0.55rem 0; padding-left: 1.4rem; }
.trace-md li { margin: 0.3rem 0; }
.trace-md blockquote { margin: 0.9rem 0; padding: 0.1rem 0 0.1rem 1.1rem; border-left: 3px solid var(--border-strong); }
.trace-md blockquote > *:first-child { margin-top: 0; }
.trace-md blockquote > *:last-child { margin-bottom: 0; }
.trace-md hr { margin: 1.5rem 0; border: 0; border-top: 1px solid var(--border); }
.trace-md a { color: var(--text); border-bottom: 1px solid var(--border); }
.trace-md a:hover { border-color: var(--text); opacity: 1; }
.trace-md code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.82rem;
    padding: 0.12rem 0.38rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    color: var(--text);
}

.trace-pre {
    margin: 0.4rem 0 0.6rem;
    padding: 0.75rem 0.9rem;
    background: #f8f8f6;
    border: 1px solid var(--border);
    border-radius: 7px;
    overflow-x: auto;
    font-size: 0.76rem;
    line-height: 1.55;
}

.trace-pre code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.76rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.trace-md .trace-code code { padding: 0; background: none; white-space: pre; }

/* ---- Responsive ---------------------------------------------------------- */

@media (max-width: 1020px) {
    body.trace-page { overflow: auto; display: block; }
    .trace-view { height: auto; padding: 6.5rem 1.25rem 4rem; }
    .trace-layout { grid-template-columns: minmax(0, 1fr); }
    .trace-rail {
        overflow: visible;
    }
    .trace-viewport { overflow: visible; padding: 0; }
}

@media (max-width: 640px) {
    .trace-view { padding: 6rem 0.9rem 3rem; }
    .trace-events::before { left: 54px; }
    .trace-event {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 0.9rem;
        padding: 0.8rem 0;
    }
    .trace-event::after { left: 47px; top: 1rem; }
    .trace-event--user::after { left: 49px; top: 1.1rem; }
    .trace-event-body { padding-left: 0; }
    .trace-marker { font-size: 0.62rem; }
    .trace-turn-num { font-size: 0.9rem; }
    .trace-toolbar { padding: 0.4rem 0.6rem; }
    .trace-block { padding: 0.6rem 0.8rem; }
    .trace-tool-args,
    .trace-tool-out { padding: 0.5rem 0.7rem 0.6rem; }
}

/* Traces index (traces.html). Task groups that expand into a run table —
   the catalog layout of AutoRLBench's traces browser, in this site's
   card / pill idiom. */
body.traces-page {
    background-image:
        radial-gradient(900px 420px at 8% -8%, rgba(154, 64, 56, 0.1), transparent 62%),
        radial-gradient(980px 520px at 96% -4%, rgba(44, 65, 92, 0.1), transparent 64%),
        radial-gradient(1100px 480px at 50% -140px, rgba(251, 250, 248, 0.8), rgba(255, 255, 255, 0) 70%);
}

body.traces-page > *:not(#globe-canvas):not(nav):not(.site-toast) {
    position: relative;
    z-index: 1;
}

.traces-view {
    /* Overrides the global `section { max-width: 1100px }` cap. */
    max-width: none;
    padding: 6.5rem 1.25rem 5rem;
}

.traces-header {
    max-width: 980px;
    margin: 0 auto 2.4rem;
}

.traces-header h1 {
    margin-bottom: 0.7rem;
    font-size: clamp(1.6rem, 4vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.1;
}

.traces-intro {
    max-width: 62ch;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.7;
}

/* ---- Task groups -------------------------------------------------------- */

.traces-list {
    /* Match the header width so the cards align with the page title. */
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.traces-group {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.62);
    box-shadow: 0 1px 2px rgba(42, 48, 58, 0.04);
    overflow: hidden;
}

.traces-group > summary {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 1.1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.traces-group > summary::-webkit-details-marker { display: none; }

.traces-group > summary:hover { background: rgba(236, 232, 227, 0.4); }

.traces-group-caret {
    flex: 0 0 auto;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: transform 0.18s ease;
}

.traces-group[open] > summary .traces-group-caret { transform: rotate(90deg); }

.traces-group-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    min-width: 0;
    overflow-wrap: anywhere;
}

.traces-group-tag {
    flex: 0 0 auto;
    padding: 0.1rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.traces-group-meta {
    margin-left: auto;
    flex: 0 0 auto;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.traces-group-body {
    border-top: 1px solid var(--border);
    padding: 0.2rem 0.9rem 0.9rem;
}

.traces-empty {
    padding: 1.4rem 0.6rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-style: italic;
}

.traces-empty--page {
    max-width: 1160px;
    margin: 0 auto;
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    text-align: center;
}

/* ---- Run table ----------------------------------------------------------- */

.traces-table-scroll { overflow-x: auto; }

.traces-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.traces-table th {
    padding: 0.6rem 0.7rem 0.45rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
}

.traces-table td {
    padding: 0.65rem 0.7rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    text-align: center;
    color: var(--text);
}

.traces-table tbody tr:last-child td { border-bottom: 0; }

.traces-table th.traces-col-num,
.traces-table td.traces-col-num {
    text-align: center;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

tr.traces-row-link { cursor: pointer; }

tr.traces-row-link:hover td { background: rgba(236, 232, 227, 0.4); }

.traces-dash {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Agent cell: name (+ solution-run tag) */
.traces-agent-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.12rem;
}

.traces-agent-name {
    font-weight: 600;
}

.traces-col-effort {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.74rem;
    white-space: nowrap;
    color: var(--text-secondary);
}

.traces-col-level {
    color: var(--text-secondary);
    font-size: 0.74rem;
    white-space: nowrap;
    text-transform: capitalize;
}

.traces-effort-tag {
    color: var(--text-secondary);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.62rem;
    letter-spacing: 0.03em;
}

/* Result cell: pass/fail mark. */
.traces-result {
    display: inline-block;
    font-size: 1rem;
    line-height: 1;
}

.traces-open {
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    font-size: 0.74rem;
    white-space: nowrap;
}

.traces-open:hover { border-color: var(--accent); }

/* ---- Responsive ------------------------------------------------------------ */

@media (max-width: 768px) {
    .traces-view { padding: 6.5rem 1rem 4rem; }
    .traces-group > summary { flex-wrap: wrap; padding: 0.75rem 0.9rem; }
    .traces-group-meta { margin-left: 0; width: 100%; order: 5; flex-basis: 100%; }
    .traces-group-body { padding: 0.2rem 0.6rem 0.7rem; }
    .traces-table th, .traces-table td { padding: 0.55rem 0.5rem; }
}
