/*
 * Blog styles: the post index and post pages. Loaded only by those pages, after
 * marketing.css, in the same components layer.
 */

@layer components {
.mkt-blog-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.mkt-blog-card {
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--border);
}

.mkt-blog-card:last-child {
    border-bottom: none;
}

.mkt-blog-card__meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--fg-muted);
    margin-bottom: var(--space-1);
}

.mkt-blog-card__status {
    padding: 0 var(--space-2);
    border-radius: var(--radius-pill);
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-weight: var(--weight-semi);
}

.mkt-blog-card__title {
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    margin-bottom: var(--space-2);
}

.mkt-blog-card__title a {
    color: var(--fg);
    text-decoration: none;
}

.mkt-blog-card__title a:hover {
    color: var(--brand);
}

.mkt-blog-card__description {
    color: var(--fg-secondary);
    line-height: var(--leading-relaxed);
}

.mkt-blog-empty {
    text-align: center;
    color: var(--fg-muted);
}

.mkt-post-banner {
    margin-bottom: var(--space-5);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-2);
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-weight: var(--weight-medium);
}

.mkt-post__back {
    display: inline-block;
    margin-bottom: var(--space-5);
    font-size: var(--text-sm);
    color: var(--fg-muted);
    text-decoration: none;
}

.mkt-post__back:hover {
    color: var(--brand);
}

.mkt-post__header {
    margin-bottom: var(--space-6);
}

.mkt-post__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-3);
}

.mkt-post__byline {
    color: var(--fg-muted);
    font-size: var(--text-sm);
}

/* Post body: rendered markdown, so its elements carry no classes. */
.mkt-post {
    --post-dark-bg: #0d1117;
    --post-dark-panel: #161b22;
    --post-dark-border: #30363d;
    --post-dark-fg: #e6edf3;
    --post-dark-muted: #8b949e;
    --post-dark-pass: #3fb950;
    --post-dark-fail: #f85149;
    --post-dark-untested: #6e7681;
    --post-dark-agent: #d2a8ff;

    max-width: 70ch;
    line-height: 1.7;
    color: var(--fg-secondary);
    overflow-wrap: break-word;
}

.mkt-post > * + * {
    margin-top: var(--space-4);
}

.mkt-post h2,
.mkt-post h3,
.mkt-post h4 {
    color: var(--fg);
    font-weight: var(--weight-bold);
    line-height: var(--leading-snug);
    margin-top: var(--space-7);
}

.mkt-post h2 {
    font-size: var(--text-2xl);
}

.mkt-post h3 {
    font-size: var(--text-xl);
}

.mkt-post h4 {
    font-size: var(--text-lg);
}

.mkt-post a {
    color: var(--brand);
}

.mkt-post ul,
.mkt-post ol {
    padding-left: var(--space-6);
}

.mkt-post ul {
    list-style: disc;
}

.mkt-post ol {
    list-style: decimal;
}

.mkt-post li + li {
    margin-top: var(--space-2);
}

.mkt-post blockquote {
    border-left: 3px solid var(--brand);
    padding-left: var(--space-4);
    color: var(--fg-muted);
}

.mkt-post img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-2);
}

/* A large quote from someone else's post, with a small link to the source. */
.mkt-post-quote {
    margin: var(--space-7) 0;
    padding: var(--space-5) 0 var(--space-5) var(--space-5);
    border-left: 4px solid var(--brand);
}

.mkt-post .mkt-post-quote blockquote {
    border: 0;
    padding: 0;
    color: var(--fg);
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: var(--weight-bold);
    line-height: var(--leading-snug);
    letter-spacing: -0.01em;
}

.mkt-post-quote figcaption {
    margin-top: var(--space-3);
    font-size: var(--text-sm);
    color: var(--fg-muted);
}

.mkt-post-quote figcaption a {
    color: var(--fg-muted);
}

.mkt-post iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: var(--radius-2);
}

/* Tables and code blocks scroll sideways inside the column on narrow screens. */
.mkt-post table {
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
}

.mkt-post th,
.mkt-post td {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    text-align: left;
}

.mkt-post th {
    color: var(--fg);
    background: var(--surface-sunken);
}

.mkt-post :not(pre) > code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 0.1em 0.3em;
    border-radius: var(--radius-1);
    background: var(--surface-sunken);
    overflow-wrap: anywhere;
}

/* Code blocks use one dark surface in both colour schemes, so they carry Pygments' github-dark
   palette as hex rather than the theme-switching --syntax-* tokens. Diff lines are coloured
   text only; the palette's added and removed backgrounds are dropped. */
.mkt-post pre {
    overflow-x: auto;
    padding: var(--space-4);
    border-radius: var(--radius-2);
    background: var(--post-dark-bg);
    color: var(--post-dark-fg);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    border: 0;
}

.mkt-post pre .c {
    color: #8B949E;
    font-style: italic;
}

.mkt-post pre .err {
    color: #F85149;
}

.mkt-post pre .esc {
    color: #E6EDF3;
}

.mkt-post pre .g {
    color: #E6EDF3;
}

.mkt-post pre .k {
    color: #FF7B72;
}

.mkt-post pre .l {
    color: #A5D6FF;
}

.mkt-post pre .n {
    color: #E6EDF3;
}

.mkt-post pre .o {
    color: #FF7B72;
    font-weight: bold;
}

.mkt-post pre .x {
    color: #E6EDF3;
}

.mkt-post pre .p {
    color: #E6EDF3;
}

.mkt-post pre .ch {
    color: #8B949E;
    font-style: italic;
}

.mkt-post pre .cm {
    color: #8B949E;
    font-style: italic;
}

.mkt-post pre .cp {
    color: #8B949E;
    font-weight: bold;
    font-style: italic;
}

.mkt-post pre .cpf {
    color: #8B949E;
    font-style: italic;
}

.mkt-post pre .c1 {
    color: #8B949E;
    font-style: italic;
}

.mkt-post pre .cs {
    color: #8B949E;
    font-weight: bold;
    font-style: italic;
}

.mkt-post pre .gd {
    color: #FFA198;
}

.mkt-post pre .ge {
    color: #E6EDF3;
    font-style: italic;
}

.mkt-post pre .ges {
    color: #E6EDF3;
    font-weight: bold;
    font-style: italic;
}

.mkt-post pre .gr {
    color: #FFA198;
}

.mkt-post pre .gh {
    color: #79C0FF;
    font-weight: bold;
}

.mkt-post pre .gi {
    color: #56D364;
}

.mkt-post pre .go {
    color: #8B949E;
}

.mkt-post pre .gp {
    color: #8B949E;
}

.mkt-post pre .gs {
    color: #E6EDF3;
    font-weight: bold;
}

.mkt-post pre .gu {
    color: #79C0FF;
}

.mkt-post pre .gt {
    color: #FF7B72;
}

.mkt-post pre .g-Underline {
    color: #E6EDF3;
    text-decoration: underline;
}

.mkt-post pre .kc {
    color: #79C0FF;
}

.mkt-post pre .kd {
    color: #FF7B72;
}

.mkt-post pre .kn {
    color: #FF7B72;
}

.mkt-post pre .kp {
    color: #79C0FF;
}

.mkt-post pre .kr {
    color: #FF7B72;
}

.mkt-post pre .kt {
    color: #FF7B72;
}

.mkt-post pre .ld {
    color: #79C0FF;
}

.mkt-post pre .m {
    color: #A5D6FF;
}

.mkt-post pre .s {
    color: #A5D6FF;
}

.mkt-post pre .na {
    color: #E6EDF3;
}

.mkt-post pre .nb {
    color: #E6EDF3;
}

.mkt-post pre .nc {
    color: #F0883E;
    font-weight: bold;
}

.mkt-post pre .no {
    color: #79C0FF;
    font-weight: bold;
}

.mkt-post pre .nd {
    color: #D2A8FF;
    font-weight: bold;
}

.mkt-post pre .ni {
    color: #FFA657;
}

.mkt-post pre .ne {
    color: #F0883E;
    font-weight: bold;
}

.mkt-post pre .nf {
    color: #D2A8FF;
    font-weight: bold;
}

.mkt-post pre .nl {
    color: #79C0FF;
    font-weight: bold;
}

.mkt-post pre .nn {
    color: #FF7B72;
}

.mkt-post pre .nx {
    color: #E6EDF3;
}

.mkt-post pre .py {
    color: #79C0FF;
}

.mkt-post pre .nt {
    color: #7EE787;
}

.mkt-post pre .nv {
    color: #79C0FF;
}

.mkt-post pre .ow {
    color: #FF7B72;
    font-weight: bold;
}

.mkt-post pre .pm {
    color: #E6EDF3;
}

.mkt-post pre .w {
    color: #6E7681;
}

.mkt-post pre .mb {
    color: #A5D6FF;
}

.mkt-post pre .mf {
    color: #A5D6FF;
}

.mkt-post pre .mh {
    color: #A5D6FF;
}

.mkt-post pre .mi {
    color: #A5D6FF;
}

.mkt-post pre .mo {
    color: #A5D6FF;
}

.mkt-post pre .sa {
    color: #79C0FF;
}

.mkt-post pre .sb {
    color: #A5D6FF;
}

.mkt-post pre .sc {
    color: #A5D6FF;
}

.mkt-post pre .dl {
    color: #79C0FF;
}

.mkt-post pre .sd {
    color: #A5D6FF;
}

.mkt-post pre .s2 {
    color: #A5D6FF;
}

.mkt-post pre .se {
    color: #79C0FF;
}

.mkt-post pre .sh {
    color: #79C0FF;
}

.mkt-post pre .si {
    color: #A5D6FF;
}

.mkt-post pre .sx {
    color: #A5D6FF;
}

.mkt-post pre .sr {
    color: #79C0FF;
}

.mkt-post pre .s1 {
    color: #A5D6FF;
}

.mkt-post pre .ss {
    color: #A5D6FF;
}

.mkt-post pre .bp {
    color: #E6EDF3;
}

.mkt-post pre .fm {
    color: #D2A8FF;
    font-weight: bold;
}

.mkt-post pre .vc {
    color: #79C0FF;
}

.mkt-post pre .vg {
    color: #79C0FF;
}

.mkt-post pre .vi {
    color: #79C0FF;
}

.mkt-post pre .vm {
    color: #79C0FF;
}

.mkt-post pre .il {
    color: #A5D6FF;
}

/* Figures a post builds from HTML: dark cards like the code blocks, the same in both colour
   schemes. Each component adds its own layout to these shared surfaces. */
.mkt-post-stats,
.mkt-post-steps,
.mkt-post-map,
.mkt-post-bars {
    margin: var(--space-6) 0;
    border-radius: var(--radius-3);
    background: var(--post-dark-bg);
}

.mkt-post-stat,
.mkt-post-step,
.mkt-post-map__grid {
    border: 1px solid var(--post-dark-border);
    border-radius: var(--radius-2);
    background: var(--post-dark-panel);
}

.mkt-post .mkt-post-stat p,
.mkt-post .mkt-post-step p,
.mkt-post .mkt-post-map p,
.mkt-post .mkt-post-bars p {
    margin: 0;
    color: var(--post-dark-muted);
}

.mkt-post-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: var(--space-3);
    padding: var(--space-3);
}

.mkt-post-stat {
    padding: var(--space-5);
}

.mkt-post .mkt-post-stat p {
    line-height: var(--leading-normal);
}

.mkt-post .mkt-post-stat .mkt-post-stat__label {
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mkt-post .mkt-post-stat .mkt-post-stat__value {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-3) 0;
    color: var(--post-dark-fg);
    font-size: clamp(2rem, 6vw, 2.75rem);
    font-weight: var(--weight-bold);
    line-height: 1.1;
}

.mkt-post .mkt-post-stat .mkt-post-stat__lead {
    color: var(--post-dark-fg);
}

.mkt-post-stat__icon {
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border: 2px solid currentcolor;
    border-radius: var(--radius-full);
    font-size: 1.25rem;
}

.mkt-post-stat__tag {
    display: inline-block;
    margin-top: var(--space-4);
    padding: var(--space-1) var(--space-3);
    border: 1px solid currentcolor;
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
}

.mkt-post-stat--pass .mkt-post-stat__icon,
.mkt-post-stat--pass .mkt-post-stat__tag {
    color: var(--post-dark-pass);
}

.mkt-post-stat--fail .mkt-post-stat__icon,
.mkt-post-stat--fail .mkt-post-stat__tag {
    color: var(--post-dark-fail);
}

/* A fact rather than a pass or a fail. */
.mkt-post-stat--neutral .mkt-post-stat__icon,
.mkt-post-stat--neutral .mkt-post-stat__tag {
    color: var(--post-dark-fg);
}

/* A code listing that marks which lines have tests. The code element is as wide as its longest
   line, so a line's marker and tint run the full width when the listing scrolls. */
.mkt-post-coverage code {
    display: block;
    min-width: max-content;
}

.mkt-post-coverage figcaption {
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--fg-muted);
}

.mkt-post-coverage .line {
    display: block;
    padding-left: var(--space-3);
    border-left: 4px solid transparent;
}

.mkt-post-coverage .line--tested {
    border-left-color: var(--post-dark-pass);
}

.mkt-post-coverage .line--lost {
    border-left-color: var(--post-dark-fail);
    background: oklch(from var(--post-dark-fail) l c h / 0.12);
}

.mkt-post-coverage .line__number {
    display: inline-block;
    width: 2.5ch;
    margin-right: var(--space-3);
    color: var(--post-dark-muted);
    text-align: right;
    user-select: none;
}

/* A yes/no mark in a table cell: green for the right result, red for the wrong one. */
.mkt-post-verdict {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0 var(--space-2);
    border-radius: var(--radius-pill);
    font-weight: var(--weight-semi);
    white-space: nowrap;
}

.mkt-post-verdict--pass {
    color: var(--success-strong);
    background: var(--success-soft);
}

.mkt-post-verdict--fail {
    color: var(--danger-strong);
    background: var(--danger-soft);
}

/* Small text under a table row's name, in place of an extra column. */
.mkt-post-note {
    color: var(--fg-muted);
    font-size: var(--text-sm);
}

@media (width <= 40rem) {
    .mkt-post th,
    .mkt-post td {
        padding: var(--space-2);
    }

    .mkt-post-verdict {
        white-space: normal;
    }
}

/* Steps in a row with arrows between them, stacked on a phone. */
.mkt-post-steps {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: stretch;
    gap: var(--space-2);
    padding: var(--space-3);
}

.mkt-post-step {
    padding: var(--space-4);
}

.mkt-post .mkt-post-step p {
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}

.mkt-post .mkt-post-step .mkt-post-step__label {
    margin-bottom: var(--space-3);
    color: var(--post-dark-fg);
    font-weight: var(--weight-semi);
}

.mkt-post .mkt-post-step .mkt-post-step__lines {
    forced-color-adjust: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-bottom: var(--space-3);
}

.mkt-post-step__line {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-1);
    color: var(--post-dark-bg);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
}

.mkt-post-step__line--tested {
    background: var(--post-dark-pass);
}

.mkt-post-step__line--lost {
    background: var(--post-dark-fail);
}

.mkt-post .mkt-post-step .mkt-post-step__result {
    margin-bottom: var(--space-3);
    color: var(--post-dark-fail);
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
}

.mkt-post-steps__arrow {
    display: grid;
    place-items: center;
    color: var(--post-dark-muted);
    font-size: var(--text-xl);
}

@media (width <= 40rem) {
    .mkt-post-steps {
        grid-template-columns: 1fr;
    }

    .mkt-post-steps__arrow {
        transform: rotate(90deg);
    }
}

/* Reference material a reader can open if they want it. */
.mkt-post-details {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-2);
}

.mkt-post-details summary {
    color: var(--fg);
    font-weight: var(--weight-semi);
    cursor: pointer;
}

.mkt-post-details[open] summary {
    margin-bottom: var(--space-3);
}

/* A map of a codebase: one square per line, with a dashed box around the lines a pull request
   changed. The box's place is set in grid cells (--x, --y, --w, --h) on a --cols by --rows grid. */
.mkt-post-map {
    padding: var(--space-5);
}

.mkt-post .mkt-post-map p {
    font-size: var(--text-sm);
}

.mkt-post .mkt-post-map .mkt-post-map__title {
    margin-bottom: var(--space-4);
    color: var(--post-dark-fg);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
}

.mkt-post-map__grid {
    --gap: 4px;

    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--cols), 1fr);
    gap: var(--gap);
    padding: var(--space-3);
    forced-color-adjust: none;
}

.mkt-post-map__cell {
    aspect-ratio: 1;
    border-radius: 3px;
    background: var(--post-dark-pass);
}

.mkt-post-map__cell--untested {
    background: var(--post-dark-untested);
}

.mkt-post-map__cell--lost {
    background: var(--post-dark-fail);
    box-shadow: 0 0 0 2px var(--post-dark-panel), 0 0 0 4px var(--post-dark-fail);
}

.mkt-post-map__changed {
    position: absolute;
    inset: var(--space-3);
    pointer-events: none;
}

.mkt-post-map__changed::before {
    position: absolute;
    left: calc(var(--x) * (100% + var(--gap)) / var(--cols) - var(--gap));
    top: calc(var(--y) * (100% + var(--gap)) / var(--rows) - var(--gap));
    width: calc(var(--w) * (100% + var(--gap)) / var(--cols) + var(--gap));
    height: calc(var(--h) * (100% + var(--gap)) / var(--rows) + var(--gap));
    border: 2px dashed var(--post-dark-fg);
    border-radius: var(--radius-1);
    content: "";
}

.mkt-post-map__labels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.mkt-post .mkt-post-map .mkt-post-map__label {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
}

.mkt-post .mkt-post-map .mkt-post-map__label strong {
    display: block;
    color: var(--post-dark-fg);
    font-size: var(--text-md);
}

.mkt-post .mkt-post-map .mkt-post-map__label--lost strong {
    color: var(--post-dark-fail);
}

.mkt-post-map__swatch {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
    border-radius: 3px;
}

.mkt-post-map__swatch--lost {
    background: var(--post-dark-fail);
}

.mkt-post-map__swatch--changed {
    border: 2px dashed var(--post-dark-fg);
}

.mkt-post .mkt-post-map .mkt-post-map__legend {
    forced-color-adjust: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--post-dark-border);
}

.mkt-post-map__legend span {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.mkt-post-map__legend span::before {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 2px;
    background: var(--post-dark-pass);
    content: "";
}

.mkt-post-map__legend .mkt-post-map__key--untested::before {
    background: var(--post-dark-untested);
}

.mkt-post-map__legend .mkt-post-map__key--lost::before {
    background: var(--post-dark-fail);
}

/* A short timeline: a marker per step on a vertical line, each step with a console. */
.mkt-post .mkt-post-flow {
    margin: var(--space-6) 0;
    padding: 0;
    list-style: none;
}

.mkt-post .mkt-post-flow__step {
    position: relative;
    margin: 0;
    padding-left: 3rem;
}

.mkt-post .mkt-post-flow__step + .mkt-post-flow__step {
    margin-top: var(--space-6);
}

.mkt-post-flow__step:not(:last-child)::before {
    position: absolute;
    top: 2.5rem;
    bottom: calc(0.5rem - var(--space-6));
    left: calc(1rem - 1px);
    border-left: 2px solid var(--border);
    content: "";
}

.mkt-post-flow__marker {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-full);
    font-weight: var(--weight-bold);
}

.mkt-post-flow__step--fail .mkt-post-flow__marker {
    color: var(--danger-strong);
    background: var(--danger-soft);
}

.mkt-post-flow__step--agent .mkt-post-flow__marker {
    color: var(--brand-strong);
    background: var(--brand-soft);
}

.mkt-post-flow__step--pass .mkt-post-flow__marker {
    color: var(--success-strong);
    background: var(--success-soft);
}

.mkt-post .mkt-post-flow__label {
    margin: 0.2rem 0 var(--space-3);
    color: var(--fg);
    font-weight: var(--weight-semi);
}

.mkt-post-flow__label span {
    color: var(--fg-muted);
    font-weight: var(--weight-regular);
}

.mkt-post-flow .t-muted {
    color: var(--post-dark-muted);
}

.mkt-post-flow .t-fail {
    color: var(--post-dark-fail);
}

.mkt-post-flow .t-pass {
    color: var(--post-dark-pass);
}

.mkt-post-flow .t-agent {
    color: var(--post-dark-agent);
}

/* A bar chart: one row per item with a label, a bar and its value. A row draws one value (--b)
   or two (--a faint behind --b solid), each a percentage from 0 to 100. */
.mkt-post-bars {
    padding: var(--space-5);
}

.mkt-post .mkt-post-bars .mkt-post-bars__title {
    margin-bottom: var(--space-3);
    color: var(--post-dark-fg);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
}

.mkt-post .mkt-post-bars .mkt-post-bars__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
    forced-color-adjust: none;
}

.mkt-post-bars__legend span {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.mkt-post-bars__legend span::before {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 2px;
    content: "";
}

.mkt-post-bars__key--a::before {
    background: oklch(from var(--post-dark-pass) l c h / 0.35);
}

.mkt-post-bars__key--b::before {
    background: var(--post-dark-pass);
}

.mkt-post-bars__row {
    display: grid;
    grid-template-areas:
        "label value"
        "track track";
    grid-template-columns: 1fr auto;
    gap: var(--space-1) var(--space-3);
    padding: var(--space-2) 0;
}

.mkt-post-bars__label {
    grid-area: label;
    color: var(--post-dark-fg);
}

.mkt-post-bars__track {
    position: relative;
    grid-area: track;
    height: 0.75rem;
    overflow: hidden;
    border-radius: var(--radius-1);
    background: var(--post-dark-panel);
    forced-color-adjust: none;
}

.mkt-post-bars__fill--a,
.mkt-post-bars__fill--b {
    position: absolute;
    inset-block: 0;
    left: 0;
    border-radius: var(--radius-1);
}

.mkt-post-bars__fill--a {
    width: calc(var(--a) * 1%);
    background: oklch(from var(--post-dark-pass) l c h / 0.35);
}

.mkt-post-bars__fill--b {
    width: calc(var(--b) * 1%);
    background: var(--post-dark-pass);
}

.mkt-post-bars__value {
    grid-area: value;
    color: var(--post-dark-fg);
    font-family: var(--font-mono);
    text-align: right;
    white-space: nowrap;
}

.mkt-post .mkt-post-bars .mkt-post-bars__note {
    margin-top: var(--space-4);
    font-size: var(--text-sm);
}

/* Test history grid: tests as rows, commits as columns, one mark per run. */
.mkt-post-grid {
    margin: var(--space-6) 0;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-3);
    background: var(--surface-raised);
    overflow-x: auto;
}

.mkt-post-grid__title {
    margin: 0 0 var(--space-3);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--fg);
}

.mkt-post-grid table {
    width: auto;
    margin: 0;
    border-collapse: separate;
    border-spacing: 3px;
    font-size: var(--text-xs);
}

.mkt-post-grid th,
.mkt-post-grid td {
    padding: 0;
    border: none;
    background: none;
}

.mkt-post-grid thead th {
    padding-bottom: var(--space-1);
    color: var(--fg-muted);
    font-weight: var(--weight-semi);
    text-align: center;
    white-space: nowrap;
}

.mkt-post-grid tbody th {
    padding-right: var(--space-3);
    font-family: var(--font-mono);
    font-weight: normal;
    text-align: left;
    white-space: nowrap;
    color: var(--fg-secondary);
}

.mkt-post-grid__cell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 var(--space-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-1);
    font-weight: var(--weight-bold);
    white-space: nowrap;
}

.mkt-post-grid__cell--pass {
    color: var(--success-strong);
}

.mkt-post-grid__cell--fail {
    color: var(--danger-strong);
    background: var(--danger-soft);
    border-color: var(--danger);
}

.mkt-post-grid__cell--flaky {
    color: var(--caution-strong);
    background: var(--caution-soft);
    letter-spacing: -0.05em;
}

/* Two classes, so it outranks the cell reset above. */
.mkt-post-grid .mkt-post-grid__pr {
    border-left: 2px solid var(--border);
    padding-left: var(--space-2);
}

.mkt-post-grid__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-4);
    margin: var(--space-3) 0 0;
    font-size: var(--text-xs);
    color: var(--fg-muted);
}

.mkt-post-grid__key--pass {
    color: var(--success-strong);
}

.mkt-post-grid__key--flaky {
    color: var(--caution-strong);
}

.mkt-post-grid__key--fail {
    color: var(--danger-strong);
}

@media (width <= 40rem) {
    .mkt-post-grid {
        padding: var(--space-3);
    }

    .mkt-post-grid table {
        border-spacing: 1px;
        font-size: 0.625rem;
    }

    .mkt-post-grid tbody th {
        padding-right: var(--space-2);
    }

    .mkt-post-grid__cell {
        min-width: 1.25rem;
        height: 1.25rem;
        padding: 0 2px;
    }

    .mkt-post-grid .mkt-post-grid__pr {
        padding-left: var(--space-1);
    }
}

} /* end @layer components */
