.reader {
  --reader-rule: #d9d6cf;
  --reader-paper: #f6f5f1;
}
.reader [data-read-target], .reader [id] { scroll-margin-block-start: 1.35rem; }
.reader :is(h1,h2,h3,p,figcaption,li,th,td,a) { overflow-wrap: break-word; }
.reader .story-title { max-width:none; }
.reader :is(.story-title,.ac-case-header) h1 {
  margin: .15em 0 .25em;
  max-width: 25ch;
  font-size: clamp(2.15rem,3.75vw,3.9rem);
  letter-spacing: -.047em;
  line-height: 1.055;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.reader :is(.story-title .lead,.ac-case-header>div>p) {
  max-width: 62ch;
  margin-top: .85rem;
  font-size: clamp(1rem,1.18vw,1.18rem);
  line-height: 1.56;
}
.reader :is(.reader-mast,.ac-case-header) {
  display:grid;
  grid-template-columns:minmax(0,1.14fr) minmax(0,.86fr);
  align-items:center;
  gap:clamp(1.5rem,5vw,5rem);
  padding:0;
  border:0;
}
.reader .reader-mast figure,.reader .ac-case-header figure {width:100%;max-width:none;margin:0;grid-area:auto}
.reader .reader-mast figure img,.reader .ac-case-header figure img {
  width:100%;
  max-height: clamp(225px,23vw,345px);
  aspect-ratio: 16 / 9;
  object-fit:contain;
  background:#efeeeb;
}
.reader .reader-mast .story-photo img { object-fit:cover; }
.reader :is(.reader-mast,.ac-case-header) figcaption { font-size:.78rem;line-height:1.45;margin:.5rem 0 0;color:#55534e;padding:0; }
.reader .reader-jumps {
  display:flex;
  gap:.25rem clamp(1rem,2.8vw,3rem);
  flex-wrap:wrap;
  align-items:stretch;
  margin-block:clamp(1.4rem,2.8vw,2.5rem) 0;
  padding:.25rem 0;
  border-block:1px solid var(--reader-rule);
}
.reader-jumps a {
  display:inline-flex;
  align-items:center;
  gap:.55rem;
  min-height:44px;
  color:var(--ink);
  font-size:.89rem;
  line-height:1.3;
  font-weight:650;
  text-decoration:none;
}
.reader-jumps a::after {content:"↓";color:var(--accent-dark);font-weight:500}
.reader-jumps a:hover {color:var(--accent-dark);text-decoration:underline;text-underline-offset:4px}
.reader :is(.story-content,.ac-detail) {
  grid-template-columns:minmax(0,1.6fr) minmax(220px,.76fr);
  gap:clamp(1.75rem,5vw,5.25rem);
}
.reader.part-story .story-content {grid-template-areas:"body related";grid-template-rows:auto}
.reader :is(.story-content,.ac-detail)>* {min-width:0}
.reader :is(.prose,.ac-analysis)>section>p,.reader .prose>p {max-width:74ch;line-height:1.68}
.reader .prose>section+section:not(.worked-example),
.reader .ac-analysis>section+section:not(.ac-example):not(.ir-record) {border-top:1px solid var(--reader-rule);padding-top:1.3rem}
.reader .prose>section>h2,.reader .prose>h2,.reader .ac-analysis>section>h2 {
  margin-block:0 .5rem;
  font-size:clamp(1.4rem,2.15vw,2.1rem);line-height:1.16;
}
.reader .prose>p+h2 {border-top:1px solid var(--reader-rule);margin-top:1.7rem;padding-top:1.3rem}
.reader :is(.ac-analysis .ac-example,.worked-example) {background:var(--reader-paper);border:0;border-inline-start:3px solid var(--accent);padding:clamp(1rem,2vw,1.7rem)}
.reader .story-content>aside :is(.article-related,.list-panel,.references):first-child {margin-top:0}
.reader .ac-detail>aside>section:first-child,.reader .story-content>aside>.article-related:first-child {
  border-top:3px solid var(--accent);padding-top:1rem;
}
.reader .story-content>aside>h2,.reader .article-related h2,.reader .list-panel h2,.reader .references h2 {
  font-size:clamp(1.16rem,1.65vw,1.55rem);line-height:1.23;
}
.reader .references ul {font-size:.92rem;line-height:1.55}
.reader .reader-table {max-width:100%;overflow:auto}
.reader .reader-table:focus-visible{outline:2px solid var(--accent-dark);outline-offset:3px}
.reader-cell-label{display:none}
@media screen and (max-width:760px) {
  .reader :is(.reader-mast,.ac-case-header,.story-content,.ac-detail) {grid-template-columns:minmax(0,1fr);gap:1.25rem}
  .reader.part-story .story-content {grid-template-areas:"body" "related"}
  .reader .reader-mast img,.reader .ac-case-header figure img {max-height:260px}
  .reader .reader-mast .part-figure {max-width:none}
  .reader .story-content aside {max-width:none}
}
@media screen and (max-width:540px) {
  .reader :is(.story-title,.ac-case-header) h1 {font-size:clamp(1.9rem,7.4vw,2.56rem);line-height:1.075}
  .reader .crumbs {margin-bottom:1.1rem}
  .reader .reader-jumps {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 .8rem;margin-top:1.2rem}
  .reader-jumps a {justify-content:space-between;font-size:.83rem}
  .reader .reader-mast figure img,.reader .ac-case-header figure img {max-height:220px}
  .reader .story-content,.reader .ac-detail {margin-top:1.4rem;padding-top:0}
  .reader .manual-drawing img {max-height:none}
  /* Each result stays in its original semantic row. Repeat column labels beside values. */
  .reader .reader-table {overflow:visible}
  .reader .reader-table table {display:block}
  .reader .reader-table caption {display:block;margin:0 0 .5rem;padding:0;font-size:1.15rem;background:transparent;color:var(--ink)}
  .reader .reader-table thead {position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .reader .reader-table tbody,.reader .reader-table tbody tr {display:block}
  .reader .reader-table tbody tr {margin-bottom:.75rem;border:1px solid var(--reader-rule)}
  .reader .reader-table tbody th,.reader .reader-table tbody td {width:100%;border:0;display:block;font-size:.92rem;line-height:1.48;padding:.55rem .72rem}
  .reader .reader-table tbody th {background:var(--reader-paper);color:var(--ink)}
  .reader .reader-table tbody td+td {border-top:1px solid var(--reader-rule)}
  .reader-cell-label {display:block;font-size:.76rem;font-weight:700;color:#635345;margin:0 0 .15rem}
}
@media print {
  .reader-jumps {display:none!important}
  .reader .reader-mast {display:block}
  .reader .reader-mast figure {max-width:90mm;margin-top:4mm}
  .reader .reader-mast .sheet-figure {display:none}
  .reader :is(.story-title,.ac-case-header) h1 {max-width:none;font-size:22pt}
}
