/* Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V5 · macrostructure: 13 index-first (chart-record index, ledger articles) · tone: hospital chart room, two-ink overprint · anchor hue: vermilion 30 + ultramarine 262 · nav: bespoke N17 trace-line · footer: bespoke Ft15 annotated trace · theme: custom Chart Paper and Two Spot Inks · fonts: Familjen Grotesk + Lora + Roboto Mono */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5.5rem; overflow-x: clip; }
body { margin: 0; overflow-x: clip; background-color: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 1.125rem; line-height: 1.65; min-height: 100vh; display: flex; flex-direction: column;
  background-image: linear-gradient(var(--grid-bold) 1px, transparent 1px), linear-gradient(90deg, var(--grid-bold) 1px, transparent 1px), linear-gradient(var(--grid-fine) 1px, transparent 1px), linear-gradient(90deg, var(--grid-fine) 1px, transparent 1px);
  background-size: 5rem 5rem, 5rem 5rem, 1rem 1rem, 1rem 1rem; }
main { flex: 1; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; font-style: normal; line-height: 1.12; margin: 0; overflow-wrap: anywhere; min-width: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
img, svg { max-width: 100%; }
a { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--ink); background: linear-gradient(transparent 55%, var(--red-tint) 55%); }
:focus-visible { outline: 3px dashed var(--blue); outline-offset: 3px; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; z-index: 50; }
.skip:focus { top: 0.5rem; }

/* ---------- nav: trace line ---------- */
.top { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 2px solid var(--ink); }
.top__in { max-width: 74rem; margin: 0 auto; padding: 0.5rem var(--gut); display: flex; align-items: center; gap: 1rem; justify-content: space-between; position: relative; }
.mark { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; white-space: nowrap; }
.mark:hover { background: none; color: var(--ink); }
.mark svg { width: 2.2rem; height: 2rem; flex: none; }
.mk-b { fill: var(--blue); } .mk-r { fill: none; stroke: var(--red); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.lead { display: none; flex: 1; padding: 0 1rem; }
.lead ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: stretch; gap: 1rem; }
.lead li { flex: 1 1 0; min-width: 0; }
.lead__a { display: grid; row-gap: 0.1rem; text-decoration: none; color: var(--ink); }
.lead__a:hover { background: none; }
.qrs { display: block; width: 100%; height: 1.15rem; fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: round; }
.qrs path { vector-effect: non-scaling-stroke; stroke-dasharray: 1; }
.lead__a:hover .qrs, .lead__a:focus-visible .qrs, .lead__a[aria-current] .qrs { stroke: var(--red); stroke-width: 2.2; }
.lead__t { font-family: var(--font-display); font-weight: 500; font-size: 0.86rem; white-space: nowrap; text-align: center; padding-top: 0.1rem; }
.lead__t b { font-family: var(--font-mono); font-size: 0.74rem; color: var(--red-text); margin-right: 0.15rem; }
.lead__a[aria-current] .lead__t { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.25em; text-decoration-color: var(--red); }
.cx { position: static; }
.cx__btn { list-style: none; cursor: pointer; font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.6rem 1.1rem 0.6rem 1rem; background: var(--ink); color: var(--paper); clip-path: polygon(0 0, calc(100% - 0.7rem) 0, 100% 0.7rem, 100% 100%, 0 100%); white-space: nowrap; user-select: none; }
.cx__btn::-webkit-details-marker { display: none; }
.cx[open] .cx__btn { background: var(--red-text); }
.cx__sheet { position: absolute; left: 0; right: 0; top: 100%; background: var(--sheet); border-bottom: 2px solid var(--ink); box-shadow: 0 0.6rem 0 var(--grid-bold); max-height: calc(100vh - 4.5rem); overflow-y: auto; }
.cx__in { max-width: 74rem; margin: 0 auto; padding: 1.2rem var(--gut) 1.6rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1.4rem; }
.cx__h { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--red-text); border-bottom: 1px solid var(--rule); padding-bottom: 0.35rem; margin-bottom: 0.5rem; }
.cx__col ul { list-style: none; margin: 0; padding: 0; }
.cx__col li { margin: 0; }
.cx__col a { display: block; padding: 0.3rem 0; font-size: 1rem; line-height: 1.3; color: var(--ink); text-decoration: none; }
.cx__col a:hover { color: var(--blue); background: none; text-decoration: underline; }
.cx__col b { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-faint); margin-right: 0.25rem; }
@media (min-width: 64rem) { .lead { display: block; } }

/* ---------- sheet ---------- */
.sheet { width: 100%; max-width: 74rem; margin: 0 auto; background: var(--sheet); border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); padding: 0 var(--gut) 3rem; }
@media (min-width: 76rem) { .sheet { margin-top: 1.5rem; margin-bottom: 1.5rem; border: 1px solid var(--rule); box-shadow: 0.5rem 0.5rem 0 var(--grid-bold); } }
.trail { padding: 0.9rem 0; font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.trail ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 0.5rem; }
.trail li + li::before { content: "/"; margin-right: 0.5rem; color: var(--ink-faint); }
.trail a { color: var(--ink-dim); }
.kicker { font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--red-text); margin-bottom: 0.8rem; font-weight: 500; }

/* ---------- home: cover and index ---------- */
.cover { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding: 2rem 0 1.5rem; border-bottom: 3px double var(--ink); }
.cover h1 { font-size: clamp(2.1rem, 7.2vw, 3.9rem); font-weight: 700; max-width: 14ch; }
.cover__lede { font-size: 1.3rem; line-height: 1.5; max-width: 34rem; margin: 1.1rem 0 0.8rem; }
.cover__note { font-size: 1rem; color: var(--ink-dim); max-width: 34rem; margin: 0; padding-left: 0.9rem; border-left: 3px solid var(--red); }
@media (min-width: 52rem) { .cover { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: end; gap: 2.5rem; padding-top: 2.6rem; } }
.filter { display: none; flex-wrap: wrap; gap: 0.5rem; padding: 1rem 0 0.4rem; }
.js .filter { display: flex; }
.chip { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.02em; padding: 0.55rem 0.95rem 0.55rem 0.8rem; min-height: 2.75rem; border: 1px solid var(--ink); background: var(--sheet); color: var(--ink); cursor: pointer; clip-path: polygon(0 0, calc(100% - 0.6rem) 0, 100% 0.6rem, 100% 100%, 0 100%); white-space: nowrap; }
.chip b { color: var(--red-text); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); } .chip[aria-pressed="true"] b { color: var(--band-red); }
.idx__sec { padding-top: 1.6rem; }
.idx__part { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 0.2rem 1rem; padding-bottom: 0.6rem; border-bottom: 2px solid var(--ink); }
.idx__part h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.ptrace { grid-column: 1; grid-row: 1 / span 2; width: 5.5rem; height: 1.6rem; fill: none; stroke: var(--red); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.idx__pl { grid-column: 3; grid-row: 1; font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; margin: 0; text-align: right; color: var(--red-text); }
.idx__pc { grid-column: 3; grid-row: 2; font-family: var(--font-mono); font-size: 0.74rem; margin: 0; text-align: right; color: var(--ink-faint); }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto; grid-template-areas: "no t m" ". c c"; gap: 0.1rem 0.8rem; padding: 0.95rem 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.row__no { grid-area: no; font-family: var(--font-mono); font-size: 0.95rem; font-weight: 600; color: var(--red-text); }
.row__t { grid-area: t; font-size: 1.28rem; font-weight: 600; }
.row__t a { color: var(--ink); text-decoration: none; display: inline-block; }
.row__t a::after { content: " \2192"; color: var(--red-text); font-family: var(--font-mono); font-size: 0.9em; }
.row__t a:hover { color: var(--blue); background: linear-gradient(transparent 62%, var(--red-tint) 62%); }
.row__c { grid-area: c; margin: 0; color: var(--ink-dim); font-size: 1.05rem; line-height: 1.45; }
.row__m { grid-area: m; font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-faint); white-space: nowrap; }
.row:hover { background: linear-gradient(90deg, var(--red-tint) 0, var(--red-tint) 0.35rem, transparent 0.35rem); }
@media (min-width: 52rem) {
  .row { grid-template-columns: 3rem minmax(0, 1.05fr) minmax(0, 1.25fr) 4rem; grid-template-areas: "no t c m"; gap: 1.2rem; padding: 1rem 0 1rem 0.4rem; }
  .row__m { text-align: right; }
}
.howto { margin-top: 2.4rem; padding: 1.2rem 1.4rem; border: 1px solid var(--ink); border-top: 4px solid var(--blue); max-width: 40rem; }
.howto h2 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.howto p { margin: 0; font-size: 1.05rem; }

/* ---------- plates (riso overprint) ---------- */
.plate { margin: 1.4rem 0 0; }
.plate svg { display: block; width: 100%; height: auto; max-width: 30rem; overflow: visible; }
.plate figcaption { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); margin-top: 0.5rem; max-width: 30rem; line-height: 1.4; }
.plate--sig svg { max-width: 24rem; margin-inline: auto; }
.cover .plate { margin: 0; }
.ov { mix-blend-mode: multiply; }
.ri { fill: var(--red); } .bl { fill: var(--blue); } .ri-tint { fill: var(--red-tint); } .bl-tint { fill: var(--blue-tint); }
.hatch { stroke: var(--blue); stroke-width: 0.9; fill: none; }
.line { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.line.thick { stroke-width: 2.6; } .line.heavy { stroke-width: 3.2; }
.line.dash, .trace { stroke-dasharray: 5 4; }
.trace { fill: none; stroke: var(--red-text); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.trace.solid { stroke-dasharray: none; } .trace.blue { stroke: var(--blue); }
.node { fill: var(--ink); } .line-fill { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.paper-fill { fill: var(--sheet); } .clot { fill: var(--red); stroke: var(--ink); stroke-width: 1.8; } .print { fill: var(--ink); opacity: 0.85; }
.lab { font-family: var(--font-mono); font-size: 10.5px; fill: var(--ink-dim); } .big { font-family: var(--font-display); font-size: 28px; font-weight: 700; fill: var(--ink); }

/* ---------- article record ---------- */
.rec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.4rem 2rem; padding: 0.6rem 0 1.6rem; border-bottom: 3px double var(--ink); }
.rec__side { display: flex; align-items: baseline; gap: 0.8rem; }
.rec__no { font-family: var(--font-display); font-weight: 700; font-size: 3.6rem; line-height: 0.9; margin: 0; color: var(--red-text); letter-spacing: -0.03em; }
.rec__part { font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-dim); margin: 0; }
.rec h1 { font-size: clamp(1.9rem, 5.6vw, 3.1rem); font-weight: 700; max-width: 20ch; margin-top: 0.5rem; }
.rec__dek { font-size: 1.32rem; line-height: 1.45; margin: 0.9rem 0 0.8rem; max-width: var(--measure); }
.rec__meta { display: flex; flex-wrap: wrap; gap: 0.2rem 1.1rem; font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.04em; margin: 0; }
@media (min-width: 40rem) { .rec__meta span + span::before { content: "|"; margin-right: 1.1rem; color: var(--ink-faint); } }
.entries { list-style: none; margin: 1.3rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 0.4rem; counter-reset: ent; }
.entries li { counter-increment: ent; }
.entries a { display: inline-block; font-family: var(--font-mono); font-size: 0.74rem; text-decoration: none; color: var(--ink); border: 1px solid var(--rule); padding: 0.35rem 0.65rem 0.35rem 0.5rem; background: var(--sheet); }
.entries a::before { content: counter(ent, decimal-leading-zero) " "; color: var(--red-text); font-weight: 600; }
.entries a:hover { background: var(--red-tint); }
.rec--info .rec__no { font-size: 2.4rem; }
@media (min-width: 52rem) {
  .rec { grid-template-columns: 11rem minmax(0, 1fr); padding-top: 1rem; }
  .rec__side { flex-direction: column; align-items: flex-start; gap: 0.4rem; padding-top: 0.4rem; }
  .rec__no { font-size: 5.6rem; }
}

/* ---------- ledger sections ---------- */
.ledger { padding-top: 0.4rem; }
.led { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem 2rem; padding: 1.7rem 0 0.4rem; border-top: 1px solid var(--rule); }
.led:first-child { border-top: 0; }
.led__h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.7rem; align-content: flex-start; }
.led__m { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600; color: var(--red-text); letter-spacing: 0.04em; }
.led__h h2 { font-size: 1.3rem; font-weight: 600; width: 100%; }
.led__t { font-family: var(--font-display); font-weight: 600; margin: 0; font-size: 1.1rem; }
.led__b { min-width: 0; max-width: var(--measure); }
@media (min-width: 52rem) {
  .led { grid-template-columns: 11rem minmax(0, 1fr); padding-top: 1.9rem; }
  .led__h { position: sticky; top: 5.5rem; align-self: start; flex-direction: column; gap: 0.3rem; }
  .led__h h2 { font-size: 1.15rem; line-height: 1.2; }
}
.prose > *:last-child { margin-bottom: 1.2rem; }
.prose h3 { font-size: 1.12rem; margin: 1.4rem 0 0.4rem; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding: 0; list-style: none; }
.prose li { position: relative; padding-left: 1.5rem; margin-bottom: 0.45em; }
.prose ul li::before { content: ""; position: absolute; left: 0; top: 0.78em; width: 0.9rem; height: 0.16rem; background: var(--red); }
.prose ol { counter-reset: n; } .prose ol li { counter-increment: n; }
.prose ol li::before { content: counter(n); position: absolute; left: 0; top: 0.12em; font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600; color: var(--red-text); }
.prose strong { font-weight: 700; } .prose em { font-style: italic; }
.prose blockquote { margin: 1.4rem 0; padding: 0.9rem 0; border-top: 3px double var(--blue); border-bottom: 3px double var(--blue); }
.prose blockquote p { margin: 0; font-size: 1.2rem; }
.prose abbr { text-decoration: underline dotted; }
.tbl { overflow-x: auto; margin: 1.3rem 0; -webkit-overflow-scrolling: touch; }
table.data { border-collapse: collapse; width: 100%; min-width: 22rem; font-size: 1rem; }
table.data caption { text-align: left; font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; padding-bottom: 0.5rem; color: var(--ink-dim); }
table.data th { font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; text-align: left; border-top: 3px solid var(--red); border-bottom: 1px solid var(--ink); padding: 0.5rem 0.7rem 0.5rem 0; }
table.data td { padding: 0.55rem 0.7rem 0.55rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }

/* sources */
.refs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem 2rem; padding: 1.8rem 0 0; border-top: 3px double var(--ink); margin-top: 1.6rem; }
.refs .led__h h2 { font-size: 1.15rem; }
.refs__list { list-style: none; counter-reset: ref; margin: 0; padding: 0; max-width: var(--measure); font-size: 1rem; line-height: 1.45; }
.refs__list li { counter-increment: ref; position: relative; padding-left: 2.1rem; margin-bottom: 0.7rem; overflow-wrap: anywhere; }
.refs__list li::before { content: "[" counter(ref) "]"; position: absolute; left: 0; font-family: var(--font-mono); font-size: 0.74rem; color: var(--red-text); top: 0.2em; }
@media (min-width: 52rem) { .refs { grid-template-columns: 11rem minmax(0, 1fr); } }
.rl__t { font-size: 1.15rem; margin: 0 0 0.5rem; }
.rl { list-style: none; margin: 0; padding: 0; font-size: 1rem; line-height: 1.45; }
.rl li { padding-left: 1rem; margin-bottom: 0.5rem; overflow-wrap: anywhere; } .rl li::before { width: 0.5rem; }

/* keep reading */
.also { margin-top: 2.2rem; padding-top: 1.1rem; border-top: 2px solid var(--ink); }
.also__h { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--red-text); margin-bottom: 0.7rem; }
.also ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 0.8rem; }
.also a { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: 0.1rem 0.4rem; padding: 0.8rem 0.9rem; border: 1px solid var(--ink); text-decoration: none; color: var(--ink); height: 100%; background: var(--sheet); }
.also a:hover { background: var(--red-tint); color: var(--ink); }
.also__n { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600; color: var(--red-text); grid-row: 1 / span 2; }
.also b { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; line-height: 1.2; }
.also__c { font-size: 0.95rem; color: var(--ink-dim); line-height: 1.35; }

/* forms and misc */
.notice { border: 1px solid var(--ink); border-left: 5px solid var(--red); padding: 0.9rem 1.1rem 0.2rem; margin: 0 0 1.4rem; background: var(--sheet); }
.form { display: grid; gap: 1rem; margin: 1rem 0 1.4rem; }
.form label { display: grid; gap: 0.3rem; font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.form input, .form textarea { font: inherit; font-family: var(--font-body); font-size: 1.1rem; text-transform: none; letter-spacing: 0; padding: 0.7rem 0.8rem; border: 1px solid var(--ink); background: var(--sheet); color: var(--ink); border-radius: 0; width: 100%; min-height: 2.9rem; }
.form textarea { min-height: 9rem; }
.btn { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.85rem 1.6rem 0.85rem 1.2rem; min-height: 2.9rem; border: 0; background: var(--ink); color: var(--paper); cursor: pointer; clip-path: polygon(0 0, calc(100% - 0.8rem) 0, 100% 0.8rem, 100% 100%, 0 100%); justify-self: start; }
.btn:hover { background: var(--red-text); }
.nf { padding: 3rem 0; max-width: 34rem; } .nf h1 { font-size: 2.4rem; margin-bottom: 1rem; }

/* ---------- footer: annotated trace ---------- */
.foot { background: var(--band); color: var(--band-ink); margin-top: 2rem; padding: 2rem 0 2.2rem; }
.foot__in { max-width: 74rem; margin: 0 auto; padding: 0 var(--gut); }
.foot__trace { height: 4.5rem; }
.strip { display: block; width: 100%; height: 100%; fill: none; stroke: var(--band-red); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.strip path { vector-effect: non-scaling-stroke; }
.beats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--band-dim); }
.beats li { border-left: 1px solid var(--band-dim); padding: 0.7rem 0.5rem 0.2rem 0.6rem; }
.beats li:first-child { border-left: 0; padding-left: 0; }
.beats a { color: var(--band-ink); text-decoration: none; display: grid; gap: 0.1rem; }
.beats a:hover { background: none; color: var(--band-red); }
.beats b { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 600; color: var(--band-red); line-height: 1; }
.beats span { font-family: var(--font-display); font-size: 0.95rem; font-weight: 500; }
.foot :focus-visible { outline-color: var(--band-ink); }
.foot__box { margin-top: 1.6rem; border: 1px solid var(--band-dim); padding: 1rem 1.2rem 0.3rem; max-width: 46rem; font-size: 0.98rem; line-height: 1.5; color: var(--band-dim); }
.foot__name { font-family: var(--font-display); font-weight: 700; color: var(--band-ink); margin-bottom: 0.3rem; }
@media (max-width: 40rem) {
  .beats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .beats li { border-left: 0; border-top: 1px solid var(--band-dim); padding-left: 0; }
  .beats li:first-child { border-top: 0; }
  .foot__trace { height: 3.4rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
