/* Academic Paper — antjanus.com redesign 091
   Every page is typeset as a preprint: title block, abstract, numbered
   sections, booktabs tables, captioned figures, hyperref-boxed citations. */

:root {
  /* primitives */
  --stone-200: #dcdad4;
  --stone-300: #c9c6be;
  --paper-50: #fffefa;
  --paper-100: #f4f2eb;
  --ink-900: #171614;
  --ink-600: #57544d;
  --slate-600: #364f6a;
  --green-700: #1d6b3c;
  --red-700: #a3281f;
  --night-950: #0f1012;
  --night-900: #1b1c1f;
  --night-850: #232428;
  --night-700: #3a3b40;
  --bone-100: #e9e6de;
  --bone-400: #aaa69c;
  --slate-300: #93b4d9;
  --green-300: #74d19c;
  --red-300: #f19187;

  /* semantic */
  --desk: var(--stone-200);
  --paper: var(--paper-50);
  --tint: var(--paper-100);
  --ink: var(--ink-900);
  --muted: var(--ink-600);
  --hair: var(--stone-300);
  --link: var(--slate-600);
  --cite: var(--green-700);
  --xref: var(--red-700);
  --focus: var(--slate-600);
  --shadow: 0 1px 2px rgba(0,0,0,.12), 0 12px 40px rgba(0,0,0,.14);

  --serif: "Libertinus Serif", "Latin Modern Roman", "STIX Two Text", Georgia, serif;
  --mono: "Inconsolata", "Latin Modern Mono", ui-monospace, Menlo, monospace;
  --col: 42rem;
  --marg: 15rem;
  --gutter: 3rem;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --desk: var(--night-950);
  --paper: var(--night-900);
  --tint: var(--night-850);
  --ink: var(--bone-100);
  --muted: var(--bone-400);
  --hair: var(--night-700);
  --link: var(--slate-300);
  --cite: var(--green-300);
  --xref: var(--red-300);
  --focus: var(--slate-300);
  --shadow: 0 0 0 1px #2a2b30, 0 12px 40px rgba(0,0,0,.5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --desk: var(--night-950);
    --paper: var(--night-900);
    --tint: var(--night-850);
    --ink: var(--bone-100);
    --muted: var(--bone-400);
    --hair: var(--night-700);
    --link: var(--slate-300);
    --cite: var(--green-300);
    --xref: var(--red-300);
    --focus: var(--slate-300);
    --shadow: 0 0 0 1px #2a2b30, 0 12px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.55;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 1px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: .5rem; }

/* ---------- the sheet ---------- */
.sheet {
  position: relative;
  max-width: 70rem;
  margin: 2.5rem auto 3rem;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 0 clamp(1rem, 5vw, 5rem) 2rem;
}
.stamp {
  display: none;
  position: absolute;
  left: 1.4rem;
  top: 13rem;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 1.3rem;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- running head / nav ---------- */
.runhead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  margin: 0 calc(-1 * clamp(1rem, 5vw, 5rem));
  padding: .75rem clamp(1rem, 5vw, 5rem) .6rem;
  border-bottom: 1px solid var(--ink);
}
.runhead-inner {
  display: flex;
  align-items: center;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  max-width: calc(var(--col) + var(--gutter) + var(--marg));
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-variant: small-caps; letter-spacing: .06em; font-size: 1.125rem; min-height: 44px; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand .v { font-style: italic; font-variant: normal; letter-spacing: 0; color: var(--muted); }
.nav { display: flex; flex-wrap: wrap; gap: 0 .25rem; margin: 0; padding: 0; list-style: none; flex: 1; justify-content: center; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .55rem;
  color: var(--ink); text-decoration: none; font-variant: small-caps; letter-spacing: .05em; font-size: 1.125rem;
}
.nav a .s { color: var(--muted); font-variant: normal; margin-right: .2em; font-size: 1rem; }
.nav a:hover { text-decoration: underline; text-underline-offset: .25em; }
.nav a[aria-current="page"] { text-decoration: underline double; text-underline-offset: .3em; }
.toggle {
  font: inherit; font-size: 1rem; font-variant: small-caps; letter-spacing: .05em;
  color: var(--ink); background: transparent; border: 1px solid var(--ink);
  min-height: 44px; padding: 0 .9rem; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem;
}
.toggle:hover { background: var(--ink); color: var(--paper); }
.toggle svg { width: 18px; height: 18px; }
.curhead { display: none; font-style: italic; color: var(--muted); font-size: 1rem; width: 100%; text-align: center; }
.curhead.on { display: block; }
.progress { position: absolute; left: 0; bottom: -1px; height: 3px; width: 0; background: var(--link); }

/* ---------- column + margin ---------- */
.col { max-width: var(--col); margin: 0 auto; position: relative; }
@media (min-width: 75rem) {
  .stamp { display: block; }
  .col { margin-left: calc(50% - (var(--col) + var(--gutter) + var(--marg)) / 2); }
}

/* ---------- \maketitle ---------- */
.maketitle { text-align: center; padding: 3.5rem 0 1rem; }
.col .maketitle p { text-align: center; text-indent: 0; }
.col .folio, .col .copyline { text-align: center; text-indent: 0; }
.venue { font-variant: small-caps; letter-spacing: .08em; color: var(--muted); font-size: 1rem; margin: 0 0 1.5rem; }
.maketitle h1 { font-weight: 400; font-size: clamp(2rem, 1.3rem + 3vw, 2.75rem); line-height: 1.15; margin: 0 auto 1.4rem; max-width: 22ch; text-wrap: balance; }
.authors { font-size: 1.25rem; margin: 0; }
.authors sup, .affil sup { font-size: .7em; }
.affil { font-style: italic; color: var(--muted); margin: .25rem 0 0; font-size: 1.0625rem; }
.date { margin: .9rem 0 0; font-size: 1.0625rem; }

.abstract { max-width: 35rem; margin: 2.25rem auto 1.5rem; font-size: 1.0625rem; }
.abstract h2 { text-align: center; font-size: 1.0625rem; font-weight: 700; margin: 0 0 .5rem; letter-spacing: .02em; }
.abstract p { text-align: justify; hyphens: auto; margin: 0; }
.abstract p + p { text-indent: 1.5em; }
.keywords { max-width: 35rem; margin: 0 auto 2rem; font-size: 1.0625rem; }
.keywords b { font-style: italic; font-weight: 700; }

/* ---------- sections + prose ---------- */
.col h2 { font-size: 1.5rem; line-height: 1.25; margin: 2.75rem 0 .9rem; font-weight: 700; }
.col h3 { font-size: 1.25rem; line-height: 1.3; margin: 2rem 0 .6rem; font-weight: 700; }
.col h4 { font-size: 1.1875rem; margin: 1.5rem 0 .3rem; font-weight: 700; font-style: italic; }
.secnum { display: inline-block; min-width: 2.1em; }
h3 .secnum { min-width: 2.6em; }
.col p, .col li { hyphens: auto; }
.col p { margin: 0 0 .45rem; text-align: justify; }
.col p + p { text-indent: 1.5em; }
.col p.noindent { text-indent: 0; }
.col ul, .col ol { padding-left: 1.6em; margin: .5rem 0 1rem; }
.col li { margin: .3rem 0; }
.col li::marker { color: var(--ink); }
.col ul { list-style: none; }
.col ul > li { position: relative; }
.col ul > li::before { content: "•"; position: absolute; left: -1.05em; }
code, kbd, samp { font-family: var(--mono); font-size: .95em; }
.col :not(pre) > code { background: var(--tint); padding: .05em .3em; }
.muted { color: var(--muted); }
.sc { font-variant: small-caps; letter-spacing: .05em; }
.qed { float: right; margin-left: 1rem; }

@media (max-width: 40rem) {
  .col p, .abstract p { text-align: left; }
  .col h2 { font-size: 1.375rem; }
}

/* ---------- hyperref-style references ---------- */
.cite, .ref {
  text-decoration: none;
  padding: 0 .12em;
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 55%, transparent);
  white-space: nowrap;
}
.cite { color: var(--cite); }
.ref { color: var(--xref); }
.cite:hover, .ref:hover { background: color-mix(in srgb, currentColor 12%, transparent); }

/* ---------- margin notes ---------- */
.sn {
  display: block;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--muted);
  margin: .75rem 0 1rem;
  padding-left: .9rem;
  border-left: 2px solid var(--hair);
  text-align: left;
  text-indent: 0;
}
.sn b { color: var(--ink); }
@media (min-width: 75rem) {
  .sn {
    float: right; clear: right;
    width: var(--marg);
    margin: .3rem calc(-1 * (var(--marg) + var(--gutter))) 1rem 0;
    padding-left: 0; border-left: 0;
  }
}

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin: 1.5rem 0; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 44px; padding: .45rem 1.1rem;
  font: inherit; font-size: 1.0625rem; font-variant: small-caps; letter-spacing: .06em;
  border: 1px solid var(--ink); color: var(--ink); background: transparent; text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.btn:hover { background: var(--tint); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--link); border-color: var(--link); color: var(--paper); }
.btn.quiet { border-color: transparent; text-decoration: underline; text-underline-offset: .25em; padding-inline: .3rem; }
.btn.tertiary { border-color: transparent; color: var(--muted); padding-inline: .3rem; }
.btn.tertiary:hover, .btn.quiet:hover { background: transparent; color: var(--link); }

/* ---------- figures ---------- */
figure { margin: 2rem 0; }
figure img { width: 100%; border: 1px solid var(--hair); background: var(--tint); }
figcaption { font-size: 1.0625rem; line-height: 1.45; margin-top: .6rem; text-align: left; }
figcaption .lab, caption .lab { font-weight: 700; }
.wide { position: relative; }
@media (min-width: 75rem) {
  .wide { width: calc(var(--col) + var(--gutter) + var(--marg)); max-width: none; }
}
.subfigs { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.subfigs figure { margin: 0; }
.subfigs figcaption { text-align: center; font-size: 1rem; }
.subfigs a { color: inherit; text-decoration: none; display: block; }
.subfigs a:hover figcaption span { text-decoration: underline; }
.subfigs img { aspect-ratio: 16/10; object-fit: cover; }
.img-fallback { background: repeating-linear-gradient(45deg, var(--tint) 0 8px, transparent 8px 16px); }

/* ---------- booktabs tables ---------- */
.tablewrap { overflow-x: auto; margin: 2rem 0; }
table.booktabs { border-collapse: collapse; width: 100%; font-size: 1.0625rem; font-variant-numeric: lining-nums tabular-nums; }
.booktabs caption { caption-side: top; text-align: left; margin-bottom: .6rem; line-height: 1.45; }
.booktabs thead tr:first-child th { border-top: 2px solid var(--ink); }
.booktabs thead th { border-bottom: 1px solid var(--ink); font-weight: 700; text-align: left; padding: .5rem .8rem .4rem; vertical-align: bottom; }
.booktabs td { padding: .45rem .8rem; vertical-align: top; text-align: left; }
.booktabs tbody tr:first-child td { padding-top: .6rem; }
.booktabs tbody tr:last-child td { padding-bottom: .6rem; border-bottom: 2px solid var(--ink); }
.booktabs th:first-child, .booktabs td:first-child { padding-left: 0; }
.booktabs th:last-child, .booktabs td:last-child { padding-right: 0; }
.booktabs .num { text-align: right; }
.booktabs tr.midrule td { border-top: 1px solid var(--ink); }
.booktabs .cmid { border-bottom: 1px solid var(--ink); text-align: center; }
.tabnotes { font-size: 1rem; color: var(--muted); margin-top: .4rem; }
.stat { font-size: 2rem; line-height: 1.1; display: block; }

/* ---------- environments ---------- */
.env { margin: 1.25rem 0; }
.env > p { text-indent: 0 !important; }
.env .envlab { font-weight: 700; font-style: normal; }
.theorem > p { font-style: italic; }
.theorem .envlab, .theorem .envname { font-style: normal; }
.envname { font-weight: 400; }
.remark .envlab { font-style: italic; font-weight: 400; }
.question { border-left: 3px double var(--ink); padding-left: 1rem; }
.fbox { border: 1px solid var(--ink); padding: 1rem 1.2rem; }
.fbox > p { text-indent: 0 !important; margin: 0; }
.fbox.shadow { box-shadow: 4px 4px 0 var(--ink); }
.proof .envlab { font-style: italic; font-weight: 400; }

/* display equation */
.eq { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; }
.eq .math { flex: 1; text-align: center; font-style: italic; font-size: 1.25rem; }
.eq .math .rm { font-style: normal; }
.eq .eqno { flex: none; }

/* ---------- contents ---------- */
.toc { margin: 2rem 0 1rem; }
.toc h2 { margin-top: 0; }
.toc ol { list-style: none; padding: 0 !important; margin: 0; }
.toc li { margin: 0; }
.toc li::before { content: none !important; }
.toc a { display: flex; align-items: baseline; gap: .5rem; padding: .3rem 0; color: var(--ink); text-decoration: none; min-height: 44px; align-items: center; }
.toc a:hover .t { text-decoration: underline; }
.toc .n { min-width: 2.2rem; }
.toc > ol > li > a { font-weight: 700; }
.toc ol ol a { padding-left: 2.2rem; }
.toc .dots { flex: 1; border-bottom: 2px dotted var(--hair); transform: translateY(-.25em); min-width: 1rem; }
.toc .pg { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 400; }
.toc a[aria-current="true"] .t { text-decoration: underline; }

/* ---------- bibliography ---------- */
.bib { list-style: none; padding: 0 !important; margin: 1rem 0; }
.bib > li { position: relative; padding-left: 3.1rem; margin: 0 0 1rem !important; line-height: 1.5; text-align: left; scroll-margin-top: 6rem; }
.bib > li::before { content: none !important; }
.bib .bn { position: absolute; left: 0; top: 0; font-variant-numeric: tabular-nums; }
.bib > li:target { background: color-mix(in srgb, var(--cite) 10%, transparent); }
.bib .t { font-style: normal; }
.bib .j { font-style: italic; }
.bib .abs { display: block; color: var(--muted); font-size: 1.0625rem; margin-top: .15rem; }
.bib .thumbed { display: grid; grid-template-columns: 1fr 9rem; gap: 1.25rem; align-items: start; }
.bib .thumbed img { aspect-ratio: 16/10; object-fit: cover; border: 1px solid var(--hair); }
@media (max-width: 34rem) { .bib .thumbed { grid-template-columns: 1fr; } .bib .thumbed img { max-width: 14rem; order: -1; } }
.tagchip { font-family: var(--mono); font-size: 1rem; color: var(--muted); }
.yearhead { font-variant: small-caps; letter-spacing: .08em; font-size: 1.0625rem; border-bottom: 1px solid var(--hair); margin: 1.75rem 0 .75rem; padding-bottom: .2rem; }

/* ---------- two-column (conference) body ---------- */
@media (min-width: 64rem) {
  .twocol { columns: 2; column-gap: 2.5rem; column-rule: 1px solid var(--hair); }
  .twocol > * { break-inside: avoid; }
  .twocol h3:first-child { margin-top: 0; }
}

/* ---------- code listings ---------- */
.listing { margin: 1.75rem 0; }
.listing .lhead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: 1.0625rem; margin-bottom: .35rem; }
.listing .lhead .lab { font-weight: 700; }
.copy {
  font: inherit; font-size: 1rem; font-variant: small-caps; letter-spacing: .05em;
  background: transparent; color: var(--ink); border: 1px solid var(--hair); min-height: 44px; padding: 0 .8rem; cursor: pointer;
}
.copy:hover { border-color: var(--ink); }
pre {
  margin: 0; overflow-x: auto;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  padding: .7rem 0; background: transparent;
  font-family: var(--mono); font-size: 1rem; line-height: 1.5; tab-size: 2;
}
pre code { display: block; counter-reset: ln; }
pre .ln { display: block; padding-left: 3.2rem; position: relative; white-space: pre; min-height: 1.5em; }
pre .ln::before { counter-increment: ln; content: counter(ln); position: absolute; left: 0; width: 2.2rem; text-align: right; color: var(--muted); font-size: .9375rem; }
.tok-k { font-weight: 600; }
.tok-c { color: var(--muted); font-style: italic; }
.tok-s { color: var(--cite); }
.tok-t { color: var(--link); }

/* ---------- forms ---------- */
.field { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; }
input[type="email"], input[type="search"], select {
  font: inherit; font-size: 1.0625rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--ink); min-height: 44px; padding: .35rem .7rem; flex: 1; min-width: 12rem; border-radius: 0;
}
input::placeholder { color: var(--muted); opacity: 1; }
.formmsg { font-size: 1.0625rem; margin: .5rem 0 0; min-height: 1.5em; }
.formmsg.err { color: var(--xref); }
.formmsg.ok { color: var(--cite); }

/* ---------- footer (footnote block) ---------- */
.foot { margin-top: 4rem; }
.foot .fnrule { width: 12rem; border: 0; border-top: 1px solid var(--ink); margin: 0 0 1rem; }
.foot-grid { display: grid; gap: 1.5rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); font-size: 1.0625rem; }
.foot-grid h2 { font-size: 1.0625rem; font-variant: small-caps; letter-spacing: .08em; margin: 0 0 .4rem; font-weight: 700; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid ul li::before { content: none; }
.foot-grid li a { display: inline-flex; min-height: 36px; align-items: center; }
.foot-grid p { margin: 0 0 .5rem; text-align: left; }
.fn { font-size: 1.0625rem; margin: 0 0 1.25rem; }
.folio { text-align: center; margin: 2.5rem 0 0; font-variant-numeric: lining-nums; }
.copyline { text-align: center; color: var(--muted); font-size: 1rem; margin: .4rem 0 0; }

/* ---------- misc page components ---------- */
.hero-fig img { aspect-ratio: 16/9; object-fit: cover; object-position: 30% 30%; }
.portrait { max-width: 20rem; }
.center { text-align: center !important; }
.pillrow { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.pill {
  font: inherit; font-size: 1.0625rem; font-variant: small-caps; letter-spacing: .05em;
  min-height: 44px; padding: 0 .9rem; border: 1px solid var(--hair); background: transparent; color: var(--ink); cursor: pointer;
}
.pill:hover { border-color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; justify-content: space-between; margin: 1rem 0; }
.toolbar label { font-size: 1.0625rem; }
.count { font-style: italic; }
.linkbtn { font: inherit; background: none; border: 0; color: var(--link); text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0 .3rem; }
.empty { display: none; border: 1px solid var(--ink); padding: 1.25rem; margin: 1rem 0; }
.empty.on { display: block; }
.empty p { text-indent: 0 !important; }
.mark { font-weight: 700; }
.catalogue td .d { display: block; color: var(--muted); font-size: 1rem; margin-top: .1rem; }
.catalogue td .cat-inline { display: none; }
@media (max-width: 44rem) {
  .booktabs .h-sm { display: none; }
  .catalogue td .cat-inline { display: inline; font-variant: small-caps; color: var(--muted); }
}
.gantt { margin: 1rem 0 .25rem; }
.gantt .row { display: grid; grid-template-columns: 10.5rem 1fr; gap: .75rem; align-items: center; font-size: 1rem; min-height: 1.9rem; }
.gantt .track { position: relative; height: 1rem; border-left: 1px solid var(--hair); border-right: 1px solid var(--hair); background: linear-gradient(90deg, var(--hair) 1px, transparent 1px) 0 0 / calc(100% / 16) 100%; }
.gantt .bar { position: absolute; top: 2px; bottom: 2px; background: var(--ink); }
.gantt .bar.now { background: var(--link); }
.gantt .axis { display: grid; grid-template-columns: 10.5rem 1fr; gap: .75rem; font-size: 1rem; color: var(--muted); }
.gantt .axis div:last-child { display: flex; justify-content: space-between; }
@media (max-width: 34rem) { .gantt .row, .gantt .axis { grid-template-columns: 7rem 1fr; } }
details.work { margin: 1rem 0; }
details.work > summary { cursor: pointer; display: inline-flex; min-height: 44px; align-items: center; border: 1px solid var(--ink); padding: 0 1rem; font-variant: small-caps; letter-spacing: .06em; list-style: none; }
details.work > summary::-webkit-details-marker { display: none; }
details.work > summary::before { content: "▸"; margin-right: .5rem; }
details.work[open] > summary::before { content: "▾"; }
.chapter { display: grid; grid-template-columns: 11rem 1fr; gap: 1.25rem; margin: 1.5rem 0; align-items: start; }
.chapter img { aspect-ratio: 1; object-fit: cover; border: 1px solid var(--hair); }
.chapter p { text-indent: 0 !important; }
@media (max-width: 34rem) { .chapter { grid-template-columns: 1fr; } .chapter img { max-width: 12rem; } }

/* pattern detail panes */
.panes { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); margin: 1rem 0 0; }
.panebar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; border-bottom: 1px solid var(--ink); padding: .3rem 0; }
.tabs { display: flex; flex-wrap: wrap; gap: .1rem; }
.tabs [role="tab"] {
  font: inherit; font-size: 1.0625rem; font-variant: small-caps; letter-spacing: .05em; color: var(--ink);
  background: none; border: 0; border-bottom: 3px solid transparent; min-height: 44px; padding: 0 .75rem; cursor: pointer;
}
.tabs [role="tab"][aria-selected="true"] { border-bottom-color: var(--ink); font-weight: 700; }
.tabs [role="tab"]:hover { color: var(--link); }
.paneacts { display: flex; gap: .5rem; flex-wrap: wrap; }
[role="tabpanel"] { padding: 1.25rem 0; }
[role="tabpanel"] pre { border: 0; padding: 0; }
.prompt p { text-indent: 0 !important; margin-bottom: .9rem; }

/* the live pattern (scoped tokens from the pattern library) */
.hss-stage {
  --ground: #eef0f3; --surface: #ffffff; --border: #d2d8e0; --pat-ink: #161b22; --dim: #56606e; --accent: #364f6a;
  --ok: #1c6e52; --warn: #7e610f; --bad: #a03227; --radius: 10px;
  background: var(--ground); color: var(--pat-ink); padding: 1.25rem; font-family: var(--serif);
}
:root[data-theme="dark"] .hss-stage { --ground: #10141a; --surface: #191f27; --border: #2c3743; --pat-ink: #e6ecf3; --dim: #97a4b4; --accent: #6f92bd; --ok: #4fbe93; --warn: #ddb44a; --bad: #ee8579; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hss-stage { --ground: #10141a; --surface: #191f27; --border: #2c3743; --pat-ink: #e6ecf3; --dim: #97a4b4; --accent: #6f92bd; --ok: #4fbe93; --warn: #ddb44a; --bad: #ee8579; } }
.hss-cap { font-size: 1rem; color: var(--dim); margin: 0 0 .6rem; font-style: italic; }
.hss-stage { container-type: inline-size; }
.hss-strip { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; grid-template-columns: 1fr; margin-bottom: 1.5rem; }
@container (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 32rem) { .hss-strip.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 42rem) { .hss-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (min-width: 50rem) { .hss-strip.five { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.hss-tile { background: var(--surface); padding: .8rem 1rem; min-width: 0; display: flex; flex-direction: column; gap: .15rem; text-align: left; color: var(--pat-ink); font: inherit; border: 0; }
button.hss-tile { cursor: pointer; min-height: 44px; }
button.hss-tile:hover { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
button.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); box-shadow: inset 0 -3px 0 var(--accent); }
.hss-label { font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; font-size: .8125rem; color: var(--dim); overflow-wrap: anywhere; }
.hss-fig { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.hss-fig.none { color: var(--dim); font-weight: 400; }
.hss-sub { font-size: .9375rem; color: var(--dim); }
.hss-list { list-style: none; padding: 0 !important; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.hss-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 1rem; border-top: 1px solid var(--border); margin: 0 !important; font-size: 1.0625rem; }
.hss-list li:first-child { border-top: 0; }
.hss-list li::before { content: none !important; }
.hss-list li[hidden] { display: none; }
.hss-st { font-family: var(--mono); font-size: .9375rem; white-space: nowrap; }
.hss-st::before { content: "● "; }
.hss-st.Done { color: var(--ok); } .hss-st.Downloading { color: var(--accent); } .hss-st.Queued { color: var(--warn); } .hss-st.Failed { color: var(--bad); }
.hss-status { font-size: 1rem; color: var(--dim); margin: .6rem 0 0; }

@media (max-width: 40rem) {
  .sheet { margin: 0; box-shadow: none; }
  .runhead-inner { gap: .25rem .75rem; }
  .brand .v { display: none; }
  .runhead { position: static; }
  .runhead nav { order: 3; width: 100%; }
  .nav { justify-content: flex-start; margin-left: -.45rem; }
  .nav a { padding: 0 .45rem; font-size: 1.0625rem; }
  .toggle { margin-left: auto; }
  .maketitle { padding-top: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  body { background: #fff; } .sheet { box-shadow: none; margin: 0; } .runhead, .toggle { display: none; }
}
.col ul.plain > li::before { content: none; }
.col ul.plain > li { break-inside: avoid; }

/* gallery article */
.col code { overflow-wrap: anywhere; }
