/* ==========================================================================
   Dupuytren's evidence resource - page styles (uses tokens from /assets/base.css)
   ========================================================================== */

/* ---------- top bar & section nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px); -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar .inner { display: flex; align-items: center; gap: 1rem; height: 56px; }
.brand { font-family: var(--serif); font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; font-size: 1.02rem; }
.brand span { color: var(--ink-3); font-weight: 400; }
.secnav { flex: 1; overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 92%, transparent); }
.secnav::-webkit-scrollbar { display: none; }
.secnav ol { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0 1.5rem 0 0; }
.secnav a {
  display: block; padding: .4rem .65rem; border-radius: 999px; font-size: .85rem; font-weight: 500;
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
}
.secnav a:hover { background: var(--paper-2); color: var(--ink); }
.secnav a[aria-current="true"] { background: var(--ink); color: var(--paper); }

/* ---------- hero ---------- */
.hero { padding: clamp(3rem, 9vw, 6.5rem) 0 2.5rem; }
.hero h1 { max-width: 19ch; }
.hero .lede { max-width: 52ch; margin-bottom: 2rem; }
.asof { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; color: var(--ink-2); margin-bottom: 1.4rem; }
.asof::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--pos); }

.keynums { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 1rem; margin: 2.2rem 0 2rem; }
.keynum { border-top: 2px solid var(--ink); padding-top: .9rem; }
.keynum .n { font-family: var(--serif); font-size: clamp(2.6rem, 6vw, 3.6rem); line-height: 1; font-weight: 600; letter-spacing: -.02em; }
.keynum .n small { font-size: .45em; color: var(--ink-3); font-weight: 500; letter-spacing: 0; }
.keynum p { margin: .55rem 0 0; color: var(--ink-2); font-size: .95rem; max-width: 30ch; }

.notice {
  display: flex; gap: .9rem; align-items: flex-start; background: var(--accent-wash);
  border: 1px solid #e5c6b1; border-radius: var(--radius); padding: .95rem 1.1rem; font-size: .95rem; color: #4a2a1a;
}
.notice svg { flex: none; margin-top: .15rem; }
.notice p { margin: 0; }
.notice a { color: #7d3415; font-weight: 600; }
.notice.sticky-note { position: sticky; top: 64px; z-index: 5; margin-bottom: 2rem; box-shadow: var(--shadow); }

/* ---------- sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0 1rem; border-top: 1px solid var(--rule); scroll-margin-top: 60px; }
.section-head { display: grid; grid-template-columns: auto 1fr; gap: 0 1.1rem; align-items: baseline; margin-bottom: 1.6rem; }
.section-num { font-family: var(--serif); font-size: 1.05rem; color: var(--accent); font-weight: 600; }
.section-head h2 { margin: 0; }
.section-head .lede { grid-column: 2; margin: .7rem 0 0; max-width: 60ch; }
@media (max-width: 640px) {
  .section-head { grid-template-columns: 1fr; }
  .section-head .lede { grid-column: 1; }
}
.sub { margin-top: 3.2rem; scroll-margin-top: 70px; }
.sub > h3 { display: flex; gap: .6rem; align-items: baseline; }
.sub > h3 .tag { font-family: var(--sans); font-size: .75rem; font-weight: 600; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }

.grid-2 { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }

.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.2rem 1.25rem; }
.card h4 { margin-bottom: .35rem; }
.card p:last-child { margin-bottom: 0; }
.card.quiet { background: transparent; }
.card.accent { border-left: 4px solid var(--accent); }
.card .kicker { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 .35rem; }

.callout {
  border-left: 3px solid var(--accent); padding: .3rem 0 .3rem 1.1rem; margin: 1.5rem 0;
  font-family: var(--serif); font-size: 1.12rem; line-height: 1.5; max-width: 62ch;
}
.callout strong { color: var(--accent); }

.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 1rem; margin: 1.6rem 0 2.2rem; }
.stat-strip .s { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.1rem; }
.stat-strip .v { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; line-height: 1.05; }
.stat-strip .l { font-size: .88rem; color: var(--ink-2); margin-top: .35rem; }

/* ---------- citations ---------- */
a.cite {
  font-size: .72em; font-weight: 600; letter-spacing: .01em; text-decoration: none; white-space: nowrap;
  color: var(--accent); background: var(--accent-wash); border-radius: 4px; padding: .08em .38em; vertical-align: .12em;
}
a.cite:hover { background: #ebcdb8; }
.cites { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.cite-tip {
  position: absolute; z-index: 80; max-width: 340px; background: var(--ink); color: var(--paper);
  font-size: .82rem; line-height: 1.4; padding: .6rem .75rem; border-radius: 8px; pointer-events: none;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
}
.cite-tip em { color: #e8d9c8; font-style: normal; }

/* ---------- badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .35em; font-size: .78rem; font-weight: 600; line-height: 1;
  border-radius: 999px; padding: .32em .65em; border: 1px solid transparent; white-space: nowrap;
}
.badge .dot { width: .55em; height: .55em; border-radius: 50%; background: currentColor; }
.b-pos { color: var(--pos); background: #e1efec; }
.b-mix { color: var(--mix); background: #f5ebd3; }
.b-neg { color: var(--neg); background: #efe4ef; }
.b-na  { color: #5d574f; background: var(--paper-2); }
.b-flag { color: #7d3415; background: var(--accent-wash); }
.b-outline { border-color: var(--rule-2); color: var(--ink-2); background: transparent; }
.b-low { color: var(--pos); background: #e1efec; }
.b-moderate { color: var(--mix); background: #f5ebd3; }
.b-high { color: #8a2f1c; background: #f6ddd3; }
.b-realised { color: #fff; background: #5d574f; }

.ladder { display: inline-flex; gap: 2px; vertical-align: middle; margin-right: .4em; }
.ladder i { width: 7px; height: 14px; border-radius: 2px; background: var(--rule); }
.ladder i.on { background: var(--accent); }
.ladder.fib i.on { background: var(--pos); }

.chip {
  font: 500 .85rem/1 var(--sans); padding: .5em .85em; border-radius: 999px; border: 1px solid var(--rule-2);
  background: var(--card); color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s;
}
.chip:hover { background: var(--paper-2); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- filters & tables ---------- */
.filters { display: flex; flex-wrap: wrap; min-width: 0; gap: .6rem 1rem; align-items: end; margin: 1.2rem 0 1rem; }
.filters label { display: grid; gap: .3rem; font-size: .78rem; font-weight: 600; color: var(--ink-3); letter-spacing: .03em; }
.filters select, .filters input[type="search"] {
  font: 400 .95rem var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--rule-2);
  border-radius: 8px; padding: .5rem .6rem; min-width: 10rem; max-width: 100%;
}
.filters input[type="search"] { min-width: 15rem; }
.filters .check { display: flex; align-items: center; gap: .45rem; font-size: .9rem; color: var(--ink); font-weight: 500; letter-spacing: 0; padding-bottom: .5rem; }
.result-count { font-size: .88rem; color: var(--ink-2); margin: 0 0 .6rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data thead th {
  position: sticky; top: 0; background: var(--paper-2); font-size: .76rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-2); font-weight: 650; white-space: nowrap; z-index: 1;
}
table.data th button { all: unset; cursor: pointer; display: inline-flex; gap: .3em; align-items: center; }
table.data th button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
table.data th[aria-sort="ascending"] button::after { content: "↑"; }
table.data th[aria-sort="descending"] button::after { content: "↓"; }
table.data tbody tr:hover { background: #fdfbf7; }
table.data tr.detail td { background: var(--paper); padding: 1rem 1.1rem 1.3rem; }
table.data tr.detail dl { display: grid; grid-template-columns: minmax(8rem, 13rem) 1fr; gap: .45rem 1rem; margin: 0; }
table.data tr.detail dt { font-size: .78rem; font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding-top: .15rem; }
table.data tr.detail dd { margin: 0; }
@media (max-width: 640px) { table.data tr.detail dl { grid-template-columns: 1fr; } table.data tr.detail dt { padding-top: .5rem; } }
.expander {
  all: unset; cursor: pointer; width: 1.7rem; height: 1.7rem; display: inline-grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--rule-2); color: var(--ink-2); font-size: .8rem; transition: transform .2s;
}
.expander[aria-expanded="true"] { transform: rotate(90deg); background: var(--ink); color: var(--paper); border-color: var(--ink); }
.expander:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.t-title { font-weight: 600; color: var(--ink); }
.t-sub { color: var(--ink-3); font-size: .82rem; }
.more-rows { display: flex; justify-content: center; padding: 1rem; }

/* ---------- figures ---------- */
figure { margin: 0; }
figcaption { font-size: .88rem; color: var(--ink-2); margin-top: .7rem; line-height: 1.5; }
.fig-frame { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem; }
.fig-frame img { display: block; width: 100%; height: auto; border-radius: 4px; }
.caveat {
  display: flex; gap: .7rem; background: #fff8e8; border: 1px solid #ecd9a8; border-radius: var(--radius-sm);
  padding: .75rem .9rem; font-size: .9rem; color: #4d3a0e; margin-top: .9rem;
}
.caveat strong { color: #4d3a0e; }

/* ---------- step explainer (hand + cell) ---------- */
.explainer { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; }
@media (max-width: 820px) { .explainer { grid-template-columns: 1fr; } }
.explainer .stage { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: .5rem; }
.explainer svg { display: block; width: 100%; height: auto; }
.steps { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.steps button { counter-increment: none; }
.step-text h4 { font-size: 1.3rem; margin-bottom: .4rem; }
.step-text p { color: var(--ink-2); }
.step-nav { display: flex; gap: .5rem; align-items: center; margin-top: 1rem; }
.step-nav .count { font-size: .85rem; color: var(--ink-3); margin-left: auto; }

/* ---------- gap bars ---------- */
.gapbars { display: grid; gap: .7rem; }
.gapbar { display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr; gap: .8rem; align-items: center; }
.gapbar .lab { font-size: .9rem; }
.gapbar .lab small { display: block; color: var(--ink-3); font-size: .78rem; }
.gapbar .track { display: flex; gap: 4px; flex-wrap: wrap; }
.gapbar .pip {
  min-width: 2.2rem; height: 2.2rem; border-radius: 8px; display: grid; place-items: center; padding: 0 .5rem;
  font-size: .75rem; font-weight: 600; color: #fff; white-space: nowrap;
}
@media (max-width: 640px) { .gapbar { grid-template-columns: 1fr; } }

.stack { display: flex; height: 2.4rem; border-radius: 8px; overflow: hidden; border: 1px solid var(--rule); }
.stack > div { display: grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 600; min-width: 0; overflow: hidden; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .82rem; color: var(--ink-2); margin-top: .6rem; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: .8rem; height: .8rem; border-radius: 3px; display: inline-block; }

/* ---------- timeline ---------- */
.timeline-wrap { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: .75rem .5rem .5rem; }
.timeline-wrap svg { display: block; width: 100%; height: auto; }
.timeline-wrap .tl-dot { cursor: pointer; transition: r .15s; }
.timeline-wrap .tl-dot:hover, .timeline-wrap .tl-dot:focus { stroke: var(--ink); stroke-width: 2; outline: none; }

/* ---------- scatter ---------- */
.scatter-wrap { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: .5rem; }
.scatter-wrap svg { display: block; width: 100%; height: auto; }
.scatter-wrap .pt { cursor: pointer; }
.scatter-wrap .pt:focus { outline: none; }
.scatter-wrap .pt:focus circle, .scatter-wrap .pt:hover circle { stroke: var(--ink); stroke-width: 2.5; }

/* ---------- precedents ---------- */
.precedent { position: relative; padding-top: 2.4rem; }
.precedent .pn { position: absolute; top: 1rem; left: 1.25rem; font-family: var(--serif); color: var(--accent); font-weight: 600; font-size: .95rem; }

/* ---------- structure viewer ---------- */
.mol-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .mol-grid { grid-template-columns: 1fr; } }
.mol-box {
  position: relative; aspect-ratio: 4/3; width: 100%; border-radius: 14px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #fffdf9 0%, #f1ebe0 100%); border: 1px solid var(--rule);
}
.mol-box .mol-canvas { position: absolute; inset: 0; }
.mol-load {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 1.5rem; z-index: 2;
}
.mol-load p { color: var(--ink-2); font-size: .9rem; margin: .7rem 0 0; }
.mol-controls { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.mol-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .85rem; margin-top: .7rem; color: var(--ink-2); }
.mol-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.mol-legend i { width: .85rem; height: .85rem; border-radius: 50%; display: inline-block; }
.label-pill {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: .3em .7em; border-radius: 4px; margin-bottom: .6rem;
}
.label-pill.exp { background: #e1efec; color: var(--pos); }
.label-pill.ctx { background: #f5ebd3; color: var(--mix); }
.label-pill.pred { background: #efe4ef; color: var(--neg); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem .9rem; font-size: .9rem; margin: 0 0 1rem; }
.kv dt { color: var(--ink-3); font-weight: 600; }
.kv dd { margin: 0; }

/* ---------- methods ---------- */
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.check-list li { display: grid; grid-template-columns: 1.6rem 1fr; gap: .4rem; font-size: .93rem; }
.check-list .ok { color: var(--pos); font-weight: 700; }
.check-list .no { color: #8a2f1c; font-weight: 700; }
.bigscore { font-family: var(--serif); font-size: 3.4rem; line-height: 1; font-weight: 600; }
.bigscore small { font-size: .4em; color: var(--ink-3); }
.todo { border: 2px dashed var(--accent-bright); border-radius: var(--radius); padding: .9rem 1rem; background: #fff7f1; font-size: .92rem; }
.todo::before { content: "Will to complete: "; font-weight: 700; color: var(--accent); }

/* ---------- reveal motion ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- footer ---------- */
.foot-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.foot-grid h4 { font-family: var(--sans); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.built { font-family: var(--serif); font-size: 1.1rem; color: var(--ink); margin-bottom: .4rem; }

@media print {
  .topbar, .notice.sticky-note, .mol-box, .btn { display: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- small screens: fewer table columns, scrollable timeline ---------- */
.show-sm { display: none; }
@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  .show-sm { display: block; }
  .timeline-wrap { overflow-x: auto; }
  .timeline-wrap svg { min-width: 720px; }
  table.data th, table.data td { padding: .55rem .5rem; }
  .filters label, .filters select, .filters input[type="search"] { width: 100%; min-width: 0; }
}

/* ---------- project tabs (sticky) ---------- */
.projnav {
  position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 93%, transparent);
  backdrop-filter: saturate(140%) blur(8px); -webkit-backdrop-filter: saturate(140%) blur(8px);
}
.projnav .inner { display: flex; align-items: center; gap: .9rem; height: 50px; }
.projname { font-family: var(--serif); font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.projnav ol {
  display: flex; gap: .1rem; list-style: none; margin: 0; padding: 0 1.5rem 0 0; overflow-x: auto; scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 90%, transparent);
}
.projnav ol::-webkit-scrollbar { display: none; }
.projnav a:not(.projname) {
  display: block; padding: .38rem .62rem; border-radius: 999px; font-size: .85rem; font-weight: 500;
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
}
.projnav a:not(.projname):hover { background: var(--paper-2); color: var(--ink); }
.projnav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
@media (max-width: 640px) { .projname { display: none; } }

/* ---------- page head & pager ---------- */
.page-head { padding: clamp(2.5rem, 7vw, 4.5rem) 0 1.5rem; }
.page-head h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); max-width: 22ch; }
.page-head .lede { max-width: 60ch; margin: 0; }
.page-body { padding-bottom: 2rem; }
.page-body > .sub:first-child { margin-top: 1.5rem; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; }
.pager a {
  display: block; padding: 1rem 1.2rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card);
  text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 600; font-size: 1.1rem;
}
.pager a:hover { border-color: var(--rule-2); box-shadow: var(--shadow); }
.pager small { display: block; font-family: var(--sans); font-weight: 500; font-size: .78rem; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; margin-bottom: .2rem; }
.pager .next { text-align: right; }

/* ---------- overview cards ---------- */
.toc-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.toc-card {
  display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--rule);
  border-radius: 12px; padding: 1.15rem 1.25rem 1.25rem; transition: transform .2s var(--ease), box-shadow .2s;
}
.toc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.toc-card .num { font-family: var(--serif); color: var(--accent); font-weight: 600; font-size: .95rem; }
.toc-card h3 { margin: .3rem 0 .35rem; font-size: 1.2rem; }
.toc-card p { margin: 0; color: var(--ink-2); font-size: .94rem; }
.findings { counter-reset: f; list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.findings li { counter-increment: f; display: grid; grid-template-columns: 2.4rem 1fr; gap: .4rem; }
.findings li::before { content: counter(f, decimal-leading-zero); font-family: var(--serif); color: var(--accent); font-weight: 600; font-size: 1.1rem; }

/* ---------- dossiers ---------- */
h2.h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
h2.h3 .tag { font-family: var(--sans); font-size: .75rem; font-weight: 600; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }
.durability-banner { background: var(--ink); color: var(--paper); border-radius: 14px; padding: 1.2rem 1.4rem; margin: 1.4rem 0 1.6rem; }
.durability-banner .kicker { color: #e8c7b2; }
.durability-banner p { margin: 0; max-width: 75ch; }
.durability-banner p + p { margin-top: .3rem; }
.durability-banner a.cite { background: rgba(255,255,255,.14); color: #f3d9c8; }
.dossier-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.dossier-tabs button {
  font: 600 1rem var(--serif); padding: .65rem 1rem; border-radius: 12px; border: 1px solid var(--rule-2);
  background: var(--card); color: var(--ink); cursor: pointer; text-align: left;
}
.dossier-tabs button span { display: block; font: 600 .7rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.dossier-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.dossier-tabs button[aria-selected="true"] span { color: #d9cbb8; }
.dossier { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: clamp(1.1rem, 3vw, 1.8rem); }
.dossier-oneline { font-family: var(--serif); font-size: 1.15rem; line-height: 1.5; margin-bottom: 1.4rem; max-width: 70ch; }
.dossier-grid { display: grid; gap: 1.6rem 2.4rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.dossier h3 { font-size: 1.05rem; margin: 1.2rem 0 .35rem; }
.dossier h3:first-child { margin-top: 0; }
.dossier .lvl { font-family: var(--sans); font-size: .85rem; font-weight: 600; color: var(--accent); }
.dossier ul { padding-left: 1.1rem; margin: 0 0 1rem; }
.durability { border: 1.5px solid var(--accent); background: #fff8f3; border-radius: 10px; padding: .9rem 1rem; margin-top: 1.2rem; }
.durability .kicker { color: var(--accent); }
.durability p:last-child { margin: 0; }
.trial-outline { margin-top: 1.3rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
.trial-outline summary { cursor: pointer; font-weight: 600; }
.trial-outline ol, .trial-outline p { margin-top: .7rem; }
table.compare th[scope="row"] { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.plddt-key { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; font-size: .85rem; color: var(--ink-2); margin: 1rem 0 1.5rem; }
.plddt-key i { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.struct-list { display: grid; gap: 2.5rem; }
.struct-card { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; padding-top: 2rem; border-top: 1px solid var(--rule); }
@media (max-width: 860px) { .struct-card { grid-template-columns: 1fr; } }
.struct-card .mol-box { aspect-ratio: 1 / 1; max-height: 440px; }
.struct-card h3 { font-size: 1.25rem; }

/* ---------- pathway stepper ---------- */
.pathway { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: clamp(1rem, 3vw, 1.6rem); }
.path-steps { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; margin: 0 0 1.4rem; padding: 0; position: relative; }
.path-steps button {
  width: 100%; display: grid; justify-items: center; gap: .4rem; background: none; border: 0; cursor: pointer;
  font: 600 .85rem var(--sans); color: var(--ink-2); padding: .3rem; border-radius: 8px; text-align: center;
}
.path-steps .pn { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--rule-2); background: var(--paper); font-family: var(--serif); font-size: 1rem; color: var(--ink-2); transition: all .2s; }
.path-steps li.done .pn { background: var(--accent-wash); border-color: var(--accent); color: var(--accent); }
.path-steps button[aria-selected="true"] { color: var(--ink); }
.path-steps button[aria-selected="true"] .pn { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 640px) { .path-steps button { font-size: .7rem; } }
.path-panel h3 { font-size: 1.3rem; }
.path-panel { min-height: 9rem; max-width: 75ch; }
.region-tabs { display: flex; gap: .3rem; margin: .4rem 0 .8rem; }
.region-tabs button { font: 600 .9rem var(--sans); padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--rule-2); background: var(--paper); cursor: pointer; color: var(--ink-2); }
.region-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.region { background: var(--paper); border-radius: 10px; padding: .9rem 1rem; }
.region p { margin: 0; }
.twin { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.twin .big { font-family: var(--serif); font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 600; color: #8a2f1c; line-height: 1.1; }
.twin .big.pos { color: var(--pos); }
.twin p { font-size: .88rem; color: var(--ink-2); margin: .3rem 0 0; }

/* ---------- calculator ---------- */
.calc { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: clamp(1rem, 3vw, 1.6rem); margin-top: 1rem; }
.calc-endpoint { border: 0; padding: 0; margin: 0 0 1.3rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.calc-endpoint legend { font-size: .78rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .5rem; }
.calc-endpoint label { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--rule-2); border-radius: 12px; padding: .55rem .85rem; cursor: pointer; background: var(--paper); font-weight: 600; font-size: .95rem; }
.calc-endpoint label small { display: block; font-weight: 400; color: var(--ink-3); font-size: .78rem; }
.calc-endpoint label:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.calc-endpoint label:has(input:checked) small { color: #d9cbb8; }
.calc-endpoint input { accent-color: var(--accent); }
.calc-grid { display: grid; gap: 1.8rem; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
@media (max-width: 820px) { .calc-grid { grid-template-columns: 1fr; } }
.ci { margin-bottom: 1.2rem; }
.ci-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.ci label { font-weight: 600; font-size: .93rem; }
.ci select { font: inherit; padding: .45rem .6rem; border-radius: 8px; border: 1px solid var(--rule-2); background: var(--paper); display: block; margin-top: .3rem; }
.ci-val { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.ci input[type="range"] { width: 100%; accent-color: var(--accent); margin: .4rem 0 .2rem; }
.ci .flag { display: inline-block; margin-left: .5rem; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: #8a2f1c; color: #fff; padding: .2em .55em; border-radius: 4px; vertical-align: .1em; }
.ci.assumption { border: 1.5px dashed #b8705a; border-radius: 10px; padding: .8rem .9rem; background: #fff8f3; }
.ci-presets { display: flex; flex-wrap: wrap; gap: .35rem; margin: .35rem 0; }
.ci-presets .chip { font-size: .78rem; padding: .35em .7em; }
.ci-note { font-size: .84rem; color: #6d2a14; margin: .4rem 0 0; }
.ci-src { font-size: .82rem; color: var(--ink-3); margin: .2rem 0 0; }
.calc-out { background: var(--paper); border-radius: 12px; padding: 1.2rem; align-self: start; position: sticky; top: 64px; }
.calc-total { font-family: var(--serif); font-size: clamp(3rem, 8vw, 4.4rem); font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.calc-detail { color: var(--ink-2); font-size: .9rem; margin: .6rem 0 1rem; }
.cb { display: grid; grid-template-columns: 8.5rem 1fr 3.2rem; gap: .5rem; align-items: center; font-size: .85rem; margin-bottom: .4rem; }
.cb-t { background: var(--paper-3); border-radius: 4px; height: .9rem; overflow: hidden; }
.cb-t i { display: block; height: 100%; border-radius: 4px; transition: width .35s var(--ease); }
.cb-n { text-align: right; font-weight: 600; }
.calc-flags p { font-size: .86rem; background: #fff8f3; border-left: 3px solid var(--accent); padding: .5rem .7rem; margin: .8rem 0 0; }

/* ---------- mechanism map ---------- */
.net-controls { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: end; margin-bottom: 1rem; }
.net-controls label { display: grid; gap: .3rem; font-size: .78rem; font-weight: 600; color: var(--ink-3); }
.net-controls select { font: 400 .95rem var(--sans); padding: .5rem .6rem; border-radius: 8px; border: 1px solid var(--rule-2); background: var(--card); min-width: 14rem; }
.net-layout { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
@media (max-width: 960px) { .net-layout { grid-template-columns: 1fr; } }
.net-stage { position: relative; background: radial-gradient(circle at 50% 50%, #fffdf9 0%, #f3ede3 70%); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; aspect-ratio: 1 / 1; max-height: 820px; }
.net-stage svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.net-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); margin: 0; }
.net-panel { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 1.1rem 1.2rem; font-size: .92rem; position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow: auto; }
.net-panel h3 { font-size: 1.2rem; margin-bottom: .3rem; }
.net-panel ul { padding-left: 1.1rem; margin: .4rem 0 .8rem; }
.net-legend-row { display: flex; align-items: center; gap: .5rem; margin: .25rem 0; font-size: .84rem; color: var(--ink-2); }
.net-legend-row svg { flex: none; }
.node text { font-family: system-ui, sans-serif; pointer-events: none; paint-order: stroke; stroke: #faf6ef; stroke-width: 3px; stroke-linejoin: round; }
.node { cursor: pointer; }
.node:focus { outline: none; }
.node:focus .shape { stroke: var(--ink); stroke-width: 3; }
.dim { opacity: .12; }
.gap-ring { fill: none; stroke: #8a2f1c; stroke-width: 2.5; stroke-dasharray: 4 3; }
.gap-list { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.gap-card { background: var(--card); border: 1px solid var(--rule); border-left: 4px solid #8a2f1c; border-radius: var(--radius); padding: .9rem 1rem; font-size: .92rem; scroll-margin-top: 70px; }
.gap-card .gid { font-weight: 700; color: #8a2f1c; font-size: .8rem; letter-spacing: .05em; }
.gap-card p { margin: .3rem 0 .5rem; }
.gap-card .why { color: var(--ink-2); font-size: .86rem; }
.gap-card:target { box-shadow: 0 0 0 3px var(--accent); }

/* ---------- open problems ---------- */
.op-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.op-card { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 1.15rem 1.25rem; scroll-margin-top: 70px; display: flex; flex-direction: column; }
.op-card.flash, .op-card:target { box-shadow: 0 0 0 3px var(--accent); }
.op-top { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.op-id { font-weight: 700; font-size: .8rem; color: var(--accent); letter-spacing: .05em; margin-right: .2rem; }
.op-eff.small { background: #e1efec; color: var(--pos); }
.op-eff.medium { background: #f5ebd3; color: var(--mix); }
.op-eff.large { background: #f6ddd3; color: #8a2f1c; }
.op-title { font-size: 1.18rem; margin-bottom: .5rem; }
.op-card p { font-size: .93rem; }
.op-card details summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.op-card details p { color: var(--ink-2); margin-top: .5rem; }
.skill-tag { all: unset; cursor: pointer; }
.skill-tag:hover { text-decoration: underline; }
.skill-tag:focus-visible { outline: 2px solid var(--accent); }
.op-card .kv { margin-top: auto; font-size: .85rem; }

/* ---------- measuring / patients / data ---------- */
.blockers { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); counter-reset: b; }
.blocker { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 1.2rem 1.3rem; position: relative; }
.blocker .bn { font-family: var(--serif); font-size: 2.4rem; font-weight: 600; color: var(--accent-wash); position: absolute; right: 1rem; top: .3rem; -webkit-text-stroke: 1px var(--accent); }
.blocker h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.blocker p { color: var(--ink-2); font-size: .94rem; }
.patient-grid { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .patient-grid { grid-template-columns: 1fr; } }
.patient-grid .prose { font-size: 1.05rem; }
.link-list { padding-left: 1.1rem; }
.link-list li { margin-bottom: .35rem; }
.cite-box { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: .9rem 1rem; font-size: .92rem; white-space: pre-wrap; font-family: var(--sans); }
pre.cite-box { font-family: var(--mono); font-size: .82rem; overflow-x: auto; }
.hc-dots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; max-width: 320px; }
.hc-dots i { aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--rule-2); }
.hc-dots i.ok { background: var(--pos); border-color: var(--pos); }
.hc-dots i.no { background: #8a2f1c; border-color: #8a2f1c; }

#op-effort { flex-wrap: wrap; }
.filters > div { min-width: 0; max-width: 100%; }

/* ---------- glossary terms ---------- */
abbr.term { text-decoration: underline dotted var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: .2em; cursor: help; border-radius: 2px; }
abbr.term:hover, abbr.term:focus { background: var(--accent-wash); outline: none; }
.term-tip {
  position: absolute; z-index: 90; background: var(--card); color: var(--ink); border: 1px solid var(--rule-2);
  box-shadow: 0 10px 30px rgba(34,32,28,.16); border-radius: 10px; padding: .7rem .85rem; font-size: .88rem; line-height: 1.45;
}
.term-tip strong { color: var(--accent); }
.page-why { margin: 1.1rem 0 0; max-width: 62ch; font-size: 1rem; color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: 8px; padding: .75rem 1rem; }
.page-why span { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: .2rem; }
.hero .lede + .lede { margin-top: -1rem; }
.cite-demo { font-size: .72em; font-weight: 600; color: var(--accent); background: var(--accent-wash); border-radius: 4px; padding: .08em .38em; }
.wins { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); margin-top: 1.2rem; }
.win { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 1.15rem 1.25rem; }
.win h3 { font-size: 1.12rem; margin-bottom: .4rem; }
.win p { font-size: .94rem; }
.win p:last-child { margin-bottom: 0; }
.win-limit { color: var(--ink-2); border-top: 1px dashed var(--rule-2); padding-top: .6rem; }
.hs-fig { text-align: center; }
.hs-toggle { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; margin-bottom: .6rem; }
#hs-svg { width: 100%; max-width: 320px; height: auto; display: block; margin: 0 auto; }
.gap-plain { font-weight: 500; }
.gap-detail summary { cursor: pointer; font-size: .85rem; color: var(--ink-2); }
.gap-detail p { font-size: .88rem; }
.glossary { display: grid; grid-template-columns: minmax(9rem, 13rem) 1fr; gap: .55rem 1.2rem; margin: 1rem 0 0; max-width: 900px; font-size: .95rem; }
.glossary dt { font-weight: 650; color: var(--accent); }
.glossary dd { margin: 0; color: var(--ink-2); }
@media (max-width: 640px) { .glossary { grid-template-columns: 1fr; } .glossary dd { margin-bottom: .5rem; } }
.kicker { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 .35rem; }
