/* Structured publication reader and editorial review. */
.edition-shell { max-width: 88rem; padding-left: 20px; padding-right: 20px; }
.edition-layout { display: grid; grid-template-columns: minmax(14rem, 20rem) minmax(0, 48rem); gap: clamp(28px, 5vw, 72px); align-items: start; justify-content: center; }
.edition-toc { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow: auto; font-size: 14px; color: var(--muted); border-right: 1px solid var(--rule-fine); padding-right: 18px; }
.edition-toc summary { cursor: pointer; font-family: var(--display); font-variant: small-caps; letter-spacing: .08em; color: var(--ink); }
.edition-toc ol { list-style: none; padding-left: .8rem; margin: .5rem 0; }
.edition-toc > details > ol { padding-left: 0; }
.edition-toc li { margin: .38rem 0; }
.edition-toc a { border: 0; }
.edition-reader { min-width: 0; font-size: 18px; line-height: 1.68; }
.edition-titlepage { text-align: center; border-bottom: 1px solid var(--rule); margin-bottom: 3rem; padding-bottom: 1.5rem; }
.edition-titlepage h1 { max-width: 42rem; margin-left: auto; margin-right: auto; }
.edition-actions { font-size: 14px; }
.edition-section p { text-align: justify; hyphens: auto; hanging-punctuation: first last; }
.edition-section h1, .edition-section h2, .edition-section h3, .edition-section h4 { scroll-margin-top: 1rem; }
.edition-section blockquote { margin: 1.6rem 2.2rem; font-size: .96em; }
.edition-section figure { margin: 2rem auto; text-align: center; }
.edition-section figure img { display: block; max-width: 100%; max-height: 75vh; width: auto; height: auto; margin: auto; }
.edition-section figcaption { color: var(--muted); font-size: .84em; font-style: italic; margin-top: .6rem; }
.edition-section .ornament img { max-height: 8rem; }
.small-caps { font-variant: small-caps; letter-spacing: .035em; }
.printed-page { float: right; clear: right; margin-right: -3.5rem; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.printed-page a { color: inherit; border: 0; }
.marginalia { float: right; clear: right; width: 12rem; margin-right: -15rem; padding-left: 1rem; color: var(--muted); font-size: .72em; line-height: 1.35; }
.note-ref { line-height: 0; margin-left: .1em; }
.note-ref a { border: 0; }
.note-popover { display: none; position: absolute; z-index: 4; width: min(24rem, 80vw); margin: 1.2rem 0 0 -2rem; padding: .8rem 1rem; background: var(--paper-pale); border: 1px solid var(--rule); box-shadow: 0 5px 20px rgba(0,0,0,.14); color: var(--ink); font: 14px/1.4 var(--body); text-align: left; }
.note-ref:hover .note-popover,
.note-ref:focus-within .note-popover { display: block; }
.endnotes { margin-top: 3rem; border-top: 1px solid var(--rule); font-size: .86em; }
.endnotes li:target { background: var(--paper-deep); }
.table-wrap { max-width: 100%; overflow-x: auto; margin: 1.8rem 0; }
.table-wrap table { min-width: 70%; }
.edition-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; border-top: 1px solid var(--rule); margin-top: 3rem; padding-top: 1rem; font-size: 14px; }
.edition-pager a:last-child { text-align: right; }
.edition-colophon { border-top: 1px solid var(--rule-fine); margin-top: 3rem; padding-top: 1rem; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: left; font-variant: normal; letter-spacing: 0; }
.edition-colophon p { margin: .2rem 0; text-align: left; }
.edition-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.edition-stats p { background: var(--paper-pale); border: 1px solid var(--rule-fine); padding: 1rem; text-align: center; }
.edition-stats strong, .edition-stats span { display: block; }
.edition-stats strong { font: 2rem var(--display); }
.edition-stats span { color: var(--muted); font-variant: small-caps; }
.edition-page-list { columns: 4 10rem; }
.edition-review-shell { width: min(100% - 2rem, 112rem); max-width: none; }
.review-page-header { margin-bottom: 1rem; }
.comparison-toolbar { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 8rem 1fr 8rem; align-items: center; gap: 1rem; margin: 0 0 1rem; padding: .65rem .8rem; background: var(--paper-pale); border: 1px solid var(--rule-fine); box-shadow: 0 3px 12px rgba(0,0,0,.08); font-size: 14px; }
.comparison-toolbar .next { text-align: right; }
.comparison-zoom { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; }
.comparison-zoom label { margin: 0; }
.comparison-zoom input[type="range"] { width: min(16rem, 28vw); margin: 0; }
.comparison-zoom button { width: auto; margin: 0; padding: .3rem .65rem; }
.sync-scroll { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.sync-scroll input { width: auto; margin: 0; }
.page-comparison { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; min-height: 70vh; }
.comparison-pane { min-width: 0; }
.comparison-pane > h2 { margin: 0; padding: .55rem .75rem; color: var(--paper); background: var(--ink); font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
.comparison-scroll { height: 76vh; overflow: auto; background: #d8d2c7; border: 1px solid var(--rule); border-top: 0; }
.scan-scroll { text-align: center; }
.scan-scroll img { display: block; width: 100%; max-width: none; height: auto; margin: 0 auto; }
.edition-scroll { padding: clamp(1.2rem, 3vw, 3rem); background: var(--paper); }
.page-reconstruction { max-width: 44rem; margin: auto; font-size: 18px; line-height: 1.68; }
.page-reconstruction .printed-page { margin-right: 0; }
.review-detail-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(18rem, 2fr); gap: 2rem; margin-top: 2.5rem; }
.review-block { border-top: 1px solid var(--rule-fine); padding: .8rem 0; }
.review-block h3 { font-size: 15px; }
.review-detail-grid figure img { max-width: 100%; max-height: 24rem; }
@media (max-width: 1050px) {
  .marginalia { float: none; width: auto; margin: .8rem 0 .8rem 1.5rem; border-left: 2px solid var(--rule-fine); }
  .printed-page { float: none; margin: 0 .5rem 0 -2.5rem; }
}
@media (max-width: 800px) {
  .edition-layout { display: block; }
  .edition-toc { position: static; max-height: none; border: 1px solid var(--rule-fine); padding: .7rem 1rem; margin-bottom: 2rem; }
  .edition-reader { font-size: 16px; }
  .edition-section p { text-align: left; }
  .printed-page { display: block; margin: .4rem 0; }
  .page-comparison, .review-detail-grid { grid-template-columns: 1fr; }
  .comparison-scroll { height: 65vh; }
  .comparison-toolbar { grid-template-columns: 1fr 1fr; }
  .comparison-zoom { grid-column: 1 / -1; grid-row: 2; }
  .edition-stats { grid-template-columns: 1fr 1fr; }
}

.continuous-review-shell { width: min(100% - 2rem, 104rem); }
.continuous-toolbar { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: center; gap: clamp(.6rem, 2vw, 1.5rem); flex-wrap: wrap; padding: .7rem 1rem; margin-bottom: 1.5rem; background: var(--paper-pale); border: 1px solid var(--rule); box-shadow: 0 4px 18px rgba(0,0,0,.12); font-size: 14px; }
.continuous-toolbar label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.continuous-toolbar select { width: auto; min-width: 6rem; margin: 0; padding: .25rem .4rem; }
.continuous-page { content-visibility: auto; contain-intrinsic-size: auto 78rem; margin: 0 0 4rem; scroll-margin-top: 5rem; border-top: 3px double var(--rule); padding-top: 1rem; }
.continuous-page > header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.continuous-page > header h2 { margin: 0; }
.continuous-page-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1rem, 3vw, 3rem); align-items: start; }
.continuous-scan { margin: 0; min-width: 0; text-align: center; background: #d8d2c7; border: 1px solid var(--rule); }
.continuous-scan img { display: block; width: 100%; height: auto; }
.continuous-scan figcaption { padding: .35rem; color: var(--muted); background: var(--paper-pale); font-size: 12px; }
.continuous-edition { min-width: 0; padding: clamp(1rem, 3vw, 2.5rem); background: var(--paper); border: 1px solid var(--rule-fine); box-shadow: 0 .25rem 1rem rgba(0,0,0,.08); font-size: 18px; line-height: 1.68; }
.continuous-detail-link { border-top: 1px solid var(--rule-fine); margin-top: 2rem; padding-top: .7rem; font-size: 13px; text-align: right !important; }
.continuous-comparison.hide-scans .continuous-page-grid { grid-template-columns: minmax(0, 48rem); justify-content: center; }
.continuous-comparison.hide-scans [data-continuous-scan] { display: none; }
.continuous-comparison.hide-editions .continuous-page-grid { grid-template-columns: minmax(0, 60rem); justify-content: center; }
.continuous-comparison.hide-editions [data-continuous-edition] { display: none; }
@media (max-width: 800px) {
  .continuous-page-grid { grid-template-columns: 1fr; }
  .continuous-page > header { display: block; }
}

/* Gold-set adjudication. */
.gold-shell { width: min(100% - 2rem, 112rem); }
.gold-stats { grid-template-columns: repeat(5, 1fr); }
.gold-queue-nav { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.5rem 0; }
.gold-queue-nav a { padding: .45rem .7rem; border: 1px solid var(--rule-fine); background: var(--paper-pale); }
.gold-queue-nav a[aria-current="page"] { color: var(--paper); background: var(--ink); }
.gold-queue-table { width: 100%; font-size: 14px; }
.gold-queue-table td { vertical-align: top; }
.gold-queue-table code { font-size: 11px; }
.gold-risk { display: inline-block; margin: .12rem .2rem .12rem 0; padding: .1rem .25rem; background: var(--paper-deep); border: 1px solid var(--rule-fine); font-size: 11px; }
.gold-confidence, .gold-status { display: inline-block; padding: .12rem .38rem; border-radius: 1rem; font: 11px var(--mono); text-transform: uppercase; }
.gold-confidence-high, .gold-status-adjudicated { background: #dce8d8; color: #274322; }
.gold-confidence-medium, .gold-status-in_progress { background: #eee3bd; color: #5c4810; }
.gold-confidence-low, .gold-status-needs_specialist { background: #ecd0cb; color: #66271f; }
.gold-status-not_started { background: #e5e1da; color: var(--muted); }
.gold-suggestion { margin: 0; white-space: pre-wrap; font: 18px/1.6 var(--body); }
.gold-form { max-width: 100rem; margin: 2.5rem auto; }
.gold-form label > span { display: block; font-family: var(--display); font-size: 1.2rem; }
.gold-form label > small { display: block; min-height: 2.5em; color: var(--muted); }
.gold-form textarea { width: 100%; font: 15px/1.5 var(--mono); tab-size: 2; }
.gold-text-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.gold-metadata-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; margin: 1.2rem 0; }
.gold-structure { margin: 1.5rem 0; padding: 1rem; border: 1px solid var(--rule-fine); }
.gold-structure summary { cursor: pointer; font-family: var(--display); font-size: 1.2rem; }
.gold-checks { display: grid; gap: .45rem; margin: 1.2rem 0; padding: 1rem; border: 1px solid var(--rule); }
.gold-checks label { display: flex; align-items: flex-start; gap: .5rem; margin: 0; }
.gold-checks input { width: auto; margin: .2rem 0 0; }
.gold-history { border-top: 1px solid var(--rule); margin-top: 2rem; font-size: 13px; }
@media (max-width: 800px) {
  .gold-stats { grid-template-columns: 1fr 1fr; }
  .gold-text-grid, .gold-metadata-grid { grid-template-columns: 1fr; }
}
