/**
 * SC&MS worked examples (/examples/ and /examples/<slug>/), in the site system.
 * Loaded after stage-hues.css and before site.css (site.css loads last everywhere); every
 * rule is scoped to main.ex-container, so it outranks site.css where they meet. This sheet
 * replaces the pages' earlier inline <style>.
 * The case map's language from the homepage: a stage badge in its hue, the stage name,
 * technique names in ink with IDs in small tabular figures, a dashed underline only on
 * "Supported, with some uncertainty". State labels are text first; their borders (solid,
 * dashed, dotted) only reinforce it. Four type sizes (title, heading, body, small).
 * The scope also keeps the homepage's own .ex-* rules from ever meeting these.
 */

/* Screen-reader text (the uncertain band in a technique link's name); the live pages carried
   this rule inline */
main.ex-container .visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Breadcrumb: main.css styles bare <nav> as the fixed site header; undo that here */
main.ex-container .ex-breadcrumb {
    position: static;
    height: auto;
    width: auto;
    background: transparent;
    border-bottom: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    font-size: var(--site-small);
    line-height: 1.6;
    color: var(--site-gray);
    margin: 0 0 1.25rem;
}
main.ex-container .ex-breadcrumb a { color: var(--site-gray); text-decoration: underline; text-decoration-color: var(--hairline); text-underline-offset: 0.2em; }
main.ex-container .ex-breadcrumb a:hover { color: var(--site-ink); text-decoration-color: currentColor; }
main.ex-container .ex-breadcrumb a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
main.ex-container .ex-breadcrumb .sep { margin: 0 0.4rem; }

/* Header: site.css sets the title; the lede is body size, gray */
main.ex-container .ex-header .ex-lede,
main.ex-container .ex-header .ex-intro { font-size: var(--site-body); line-height: 1.6; color: var(--site-gray); margin: 1rem 0 0; max-width: var(--site-measure); }

/* Sections sit in the reading column; .post-content gives headings, body and links */
main.ex-container .ex-section > h2:first-child { margin-top: 3.5rem; }
main.ex-container .ex-kicker {
    font-family: var(--site-mono);
    font-size: var(--site-small);
    font-weight: 600;
    color: var(--site-gray);
    margin: 0 0 1rem;
}
main.ex-container .ex-kicker a { color: var(--link); }

/* The one-sentence scope note: a quote-style 1px rule (site.css's blockquote), not a stripe */
main.ex-container .post-content p.ex-note {
    border-left: 1px solid var(--primary);
    padding: 0 0 0 1.25rem;
    margin: 0 0 1.25rem;
    color: var(--site-ink);
}

/* State labels */
main.ex-container .ex-label {
    display: inline-block;
    font-family: var(--site-mono);
    font-size: var(--site-small);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
    padding: 0.0625rem 0.4375rem;
    border: 1px solid var(--primary);
    border-radius: 4px;
    color: var(--primary-dark);
    background: transparent;
    white-space: nowrap;
}
main.ex-container .ex-label.is-unsure { border-style: dashed; }
main.ex-container .ex-label.is-unsettled { border-style: dotted; border-color: var(--site-gray); color: var(--site-gray); }

/* Legend: one line per state, label then meaning */
main.ex-container .post-content ul.ex-legend { list-style: none; padding: 0; margin: 0 0 2rem; }
main.ex-container .post-content .ex-legend li { font-size: var(--site-small); line-height: 1.6; color: var(--site-gray); padding: 0.25rem 0; margin: 0; }
main.ex-container .ex-legend .ex-label { margin-right: 0.5rem; }

/* Stages: hairline rows, each headed by the homepage's stage badge */
main.ex-container .post-content ol.ex-stages { list-style: none; padding: 0; margin: 0; border-bottom: 1px solid var(--hairline); }
main.ex-container .post-content li.ex-stage { padding: 1.5rem 0; margin: 0; border-top: 1px solid var(--hairline); }
main.ex-container .post-content .ex-stage h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-family: var(--site-sans);
    font-size: var(--site-body);
    font-weight: 600;
    line-height: 1.4;
    color: var(--site-ink);
}
main.ex-container .ex-badge {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.375rem;
    color: #FFFFFF;
    font-family: var(--site-sans);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
}
main.ex-container .ex-badge.s-A { background: var(--stage-a); }
main.ex-container .ex-badge.s-B { background: var(--stage-b); }
main.ex-container .ex-badge.s-C { background: var(--stage-c); }
main.ex-container .ex-badge.s-D { background: var(--stage-d); }
main.ex-container .ex-badge.s-E { background: var(--stage-e); }
main.ex-container .ex-badge.s-F { background: var(--stage-f); }
main.ex-container .ex-stage-id {
    font-size: var(--site-small);
    font-weight: 600;
    font-variant-numeric: tabular-nums slashed-zero;
    color: var(--site-gray);
}

/* Rows: indented to the stage name */
main.ex-container .post-content ul.ex-rows { list-style: none; padding: 0; margin: 1rem 0 0 2.5rem; }
main.ex-container .post-content li.ex-row { margin: 0; }
main.ex-container .post-content li.ex-row + li.ex-row { margin-top: 2.5rem; }
main.ex-container .ex-row-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.375rem 0.75rem; }

/* Technique links: the homepage's cm-tech (ink, 500, no underline at rest; dashed when uncertain) */
main.ex-container .post-content a.ex-tech {
    color: var(--site-ink);
    font-size: var(--site-body);
    font-weight: 500;
    text-decoration: none;
}
main.ex-container .post-content a.ex-tech.is-unsure {
    text-decoration: underline dashed;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    text-decoration-color: var(--site-gray);
}
main.ex-container .post-content a.ex-tech:not(.is-unsure):hover,
main.ex-container .post-content a.ex-tech:not(.is-unsure):focus-visible { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
main.ex-container .post-content a.ex-tech:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
main.ex-container .ex-id {
    font-size: var(--site-small);
    font-weight: 600;
    font-variant-numeric: tabular-nums slashed-zero;
    color: var(--site-gray);
    white-space: nowrap;
}

/* Requirement, evidence, limit */
main.ex-container .ex-fields { margin: 0.5rem 0 0; }
main.ex-container .ex-fields dt { font-size: var(--site-small); font-weight: 600; color: var(--site-gray); margin: 0.75rem 0 0.125rem; }
main.ex-container .ex-fields dd { font-size: var(--site-body); line-height: 1.6; color: var(--site-ink); margin: 0; }
main.ex-container .ex-fields q { quotes: '"' '"'; }
main.ex-container .post-content p.ex-step { color: var(--site-gray); line-height: 1.6; margin: 0.5rem 0 0; }

main.ex-container .post-content p.ex-after { margin-top: 1.75rem; }
main.ex-container .post-content p.ex-method { margin-top: 1rem; }

/* Jump links under the header: Story, Case map, Evidence, Definitions, Sources.
   A small gray line, like the breadcrumb; nav reset as above. */
main.ex-container .ex-jumps {
    position: static;
    height: auto;
    width: auto;
    background: transparent;
    border-bottom: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    font-size: var(--site-small);
    line-height: 1.8;
    color: var(--site-gray);
    margin: -1.25rem 0 0;
}
main.ex-container .ex-jumps a { color: var(--link); text-decoration: underline; text-decoration-color: var(--hairline); text-underline-offset: 0.2em; }
main.ex-container .ex-jumps a:hover { color: var(--site-ink); text-decoration-color: currentColor; }
main.ex-container .ex-jumps a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
main.ex-container .ex-jumps .sep { margin: 0 0.5rem; }
main.ex-container [id] { scroll-margin-top: calc(var(--nav-height) + 1.5rem); }

/* This case at a glance: the reported sequence, numbered, inside the reading column on the
   homepage case map's warm tint. Each step carries the
   homepage's stage badges, small, each linking to its row; the letter is decorative and the
   link's name is the stage and technique, so the colour never carries meaning alone. */
main.ex-container .ex-glance-card { background: var(--site-tint); border-radius: 8px; padding: 1.5rem 1.75rem 1.25rem; }
main.ex-container .post-content .ex-glance-card p.ex-kicker { margin: 0 0 0.5rem; }
main.ex-container .post-content ol.ex-steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
main.ex-container .post-content li.ex-step-item {
    counter-increment: step;
    position: relative;
    margin: 0;
    padding: 0.875rem 0 0.875rem 2.5rem;
    border-top: 1px solid var(--hairline);
}
main.ex-container .post-content li.ex-step-item:first-child { border-top: 0; }
main.ex-container .post-content li.ex-step-item::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0.875rem;
    width: 1.5rem;
    font-family: var(--site-mono);
    font-size: var(--site-small);
    font-weight: 600;
    line-height: 1.6rem;
    color: var(--site-gray);
}
main.ex-container .ex-step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; }
main.ex-container .ex-step-title { font-size: var(--site-body); font-weight: 600; line-height: 1.6rem; color: var(--site-ink); }
main.ex-container .ex-step-stages { display: inline-flex; gap: 0.3125rem; }
main.ex-container a.ex-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 0.3125rem;
    color: #FFFFFF;
    font-family: var(--site-sans);
    font-size: var(--site-small);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}
main.ex-container a.ex-mini.s-A { background: var(--stage-a); }
main.ex-container a.ex-mini.s-B { background: var(--stage-b); }
main.ex-container a.ex-mini.s-C { background: var(--stage-c); }
main.ex-container a.ex-mini.s-D { background: var(--stage-d); }
main.ex-container a.ex-mini.s-E { background: var(--stage-e); }
main.ex-container a.ex-mini.s-F { background: var(--stage-f); }
/* A badge for a stage not yet settled is the "Not yet settled" pill's look: dotted border, no fill,
   stage hue as text and border only. It never reads as a settled mapping. */
main.ex-container a.ex-mini.is-unsettled { background: transparent; border: 1px dotted currentColor; }
main.ex-container a.ex-mini.is-unsettled.s-A { color: var(--stage-a); }
main.ex-container a.ex-mini.is-unsettled.s-B { color: var(--stage-b); }
main.ex-container a.ex-mini.is-unsettled.s-C { color: var(--stage-c); }
main.ex-container a.ex-mini.is-unsettled.s-D { color: var(--stage-d); }
main.ex-container a.ex-mini.is-unsettled.s-E { color: var(--stage-e); }
main.ex-container a.ex-mini.is-unsettled.s-F { color: var(--stage-f); }
main.ex-container a.ex-mini:hover { outline: 1px solid var(--site-ink); outline-offset: 1px; }
main.ex-container a.ex-mini:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
main.ex-container .post-content .ex-step-item p { font-size: var(--site-body); line-height: 1.5; color: var(--site-ink); margin: 0.25rem 0 0; }
main.ex-container .post-content .ex-glance-card p.ex-glance-note { margin: 0.75rem 0 0; padding-top: 0.75rem; border-top: 1px solid var(--hairline); }
@media (max-width: 640px) {
    main.ex-container .ex-glance-card { padding: 1.25rem 1.125rem 1rem; }
    main.ex-container .post-content li.ex-step-item { padding-left: 2rem; }
}

/* What this breakdown helps us distinguish: three hairline rows, the pair in bold, the reason below */
main.ex-container .post-content dl.ex-distinctions { margin: 0 0 2.5rem; border-bottom: 1px solid var(--hairline); }
main.ex-container .ex-distinctions > div { padding: 1rem 0; border-top: 1px solid var(--hairline); }
main.ex-container .ex-distinctions dt { font-size: var(--site-body); font-weight: 600; line-height: 1.5; color: var(--site-ink); }
main.ex-container .ex-distinctions dt a { color: var(--link); }
main.ex-container .ex-distinctions dd { font-size: var(--site-body); line-height: 1.6; color: var(--site-ink); margin: 0.25rem 0 0; }

/* The fork: one root, two branches drawn with hairlines; "This case" is the state pill */
main.ex-container figure.ex-fork { margin: 0; }
main.ex-container .post-content ul.ex-fork-tree, main.ex-container .post-content .ex-fork-tree ul { list-style: none; padding: 0; margin: 0; }
main.ex-container .post-content .ex-fork-tree li { margin: 0; }
main.ex-container .ex-fork-root { font-size: var(--site-body); font-weight: 600; color: var(--site-ink); }
main.ex-container .post-content .ex-fork-tree ul { margin: 0.5rem 0 0 0.5rem; border-left: 1px solid var(--hairline); }
main.ex-container .post-content .ex-fork-tree ul li { position: relative; padding: 0.5rem 0 0.5rem 1.5rem; }
main.ex-container .post-content .ex-fork-tree ul li::before { content: ""; position: absolute; left: 0; top: 1.3rem; width: 1rem; border-top: 1px solid var(--hairline); }
main.ex-container .ex-fork-branch { font-size: var(--site-body); color: var(--site-ink); }
main.ex-container .ex-fork-mark { margin-left: 0.5rem; }
main.ex-container .ex-fork figcaption { font-size: var(--site-small); line-height: 1.55; color: var(--site-gray); margin: 0.75rem 0 0; }

/* The next step, before Sources: body text in the column */
main.ex-container p.ex-next { max-width: var(--site-measure); font-size: var(--site-body); line-height: 1.65; color: var(--site-ink); margin: 3rem 0 0; }

/* A row: the observed behavior, then Technique · ID · Status, then the evidence (always
   visible); the quoted requirement folds into a <details> */
main.ex-container .post-content p.ex-behavior { font-size: var(--site-body); line-height: 1.5; color: var(--site-ink); margin: 0 0 0.375rem; }
main.ex-container .ex-row-head .sep { color: var(--site-gray); }
/* No dot between the ID and the label; on phones and tablets no row-line dots at all. */
main.ex-container .ex-row-head .ex-id + .sep { display: none; }
@media (max-width: 48rem) { main.ex-container .ex-row-head .sep { display: none; } }
main.ex-container .ex-req { margin: 0.625rem 0 0; }
main.ex-container .ex-req summary { cursor: pointer; font-size: var(--site-small); font-weight: 600; color: var(--site-gray); width: max-content; }
main.ex-container .ex-req summary:hover { color: var(--site-ink); }
main.ex-container .ex-req summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
main.ex-container .post-content .ex-req p { font-size: var(--site-body); line-height: 1.6; margin: 0.375rem 0 0; }
main.ex-container .ex-req q { quotes: '"' '"'; }

/* The agencies side by side: two columns of label and value, hairline above each, stacking on phones */
main.ex-container .ex-compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; margin: 0 0 1.5rem; }
main.ex-container .post-content .ex-agency h3 { margin: 0 0 0.25rem; }
main.ex-container .ex-agency dl { margin: 0; border-bottom: 1px solid var(--hairline); }
main.ex-container .ex-agency dt { font-size: var(--site-small); font-weight: 600; color: var(--site-gray); margin: 0; padding: 0.75rem 0 0.125rem; border-top: 1px solid var(--hairline); }
main.ex-container .ex-agency dd { font-size: var(--site-body); line-height: 1.6; color: var(--site-ink); margin: 0; padding: 0 0 0.75rem; }
@media (max-width: 48rem) {
    main.ex-container .ex-compare-grid { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
}

/* End of page: one link back to the index, the blog's "All posts" treatment. It sits after
   <main>, so it carries its own column and undoes main.css's fixed <nav> */
nav.ex-pagenav {
    position: static;
    height: auto;
    width: auto;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 0;
    max-width: var(--site-measure);
    margin: 3rem auto 0;
    padding: 2rem 0 0;
    border-top: 1px solid var(--hairline);
    font-size: var(--site-small);
}
nav.ex-pagenav a { color: var(--link); text-decoration: none; }
nav.ex-pagenav a:hover { color: var(--site-ink); text-decoration: underline; text-underline-offset: 0.2em; }
nav.ex-pagenav a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
@media (max-width: 768px) { nav.ex-pagenav { margin-left: 1.25rem; margin-right: 1.25rem; } }

/* Index: the shipped pages as a hairline list (site.css's site-list) */
main.ex-container ul.ex-list a {
    font-size: var(--site-body);
    font-weight: 600;
    color: var(--link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}
main.ex-container ul.ex-list a:hover { color: var(--site-ink); }
main.ex-container ul.ex-list a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
main.ex-container ul.ex-list .ex-desc { display: block; font-size: var(--site-body); line-height: 1.6; color: var(--site-gray); margin-top: 0.25rem; }

@media (max-width: 640px) {
    main.ex-container .post-content ul.ex-rows { margin-left: 0; }
    main.ex-container .ex-badge { width: 1.5rem; height: 1.5rem; font-size: 0.875rem; }
}

/* Keep the worked-example title on one line on desktop */
@media (min-width: 64rem) { main.ex-container .ex-header h1 { font-size: 2.3rem; } }
