:root {
  color-scheme: light;
  --paper: #f6f3e9;
  --surface: #fffdf6;
  --ink: #162f2a;
  --subtle: #435950;
  --line: #b7b9a7;
  --orange: #ae3d23;
  --light: #ebe8d9;
  font: 16px/1.55 "DM Sans", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header, main, footer { max-width: 77rem; margin: auto; padding-inline: clamp(1rem, 5vw, 4rem); }
.masthead, footer, nav, .section-head, .pager, .group, .actions, .filters, .counts, #toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: .7rem 1rem;
}
.masthead { min-height: 5rem; justify-content: space-between; border-bottom: 2px solid var(--ink); }
.brand { display: inline-flex; align-items: center; gap: .6rem; font: bold 2.25rem Georgia, serif; letter-spacing: -.08em; }
.mark { width: 1em; height: 1em; border-radius: 50%; background: repeating-radial-gradient(circle, var(--ink) 0 3px, var(--paper) 3px 4px); }
.mast-note, .eyebrow, .chapter-count { font: 600 .76rem/1.4 "IBM Plex Mono", ui-monospace, monospace; text-transform: uppercase; letter-spacing: .12em; }
main { padding-block: clamp(1.2rem, 4vw, 3rem) 3rem; }
h1, h2, h3, p { margin: 0 0 .75rem; }
h1, h2, h3 { line-height: 1.09; text-wrap: balance; }
h1, h2 { font-family: "DM Serif Text", Georgia, serif; font-weight: 500; letter-spacing: -.045em; }
h1 { font-size: clamp(2.65rem, 6vw, 5.1rem); }
h2 { font-size: clamp(1.9rem, 3.5vw, 2.75rem); }
h3 { margin-top: 1.4rem; font-size: 1.22rem; }
p { max-width: 72ch; }
a { color: var(--ink); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--orange); }
:is(a, button, input, select, summary, [tabindex]):focus-visible { outline: 3px solid #1665a0; outline-offset: 3px; }
.skip { position: absolute; left: .75rem; top: -10rem; padding: .6rem; background: white; z-index: 5; }
.skip:focus { top: .5rem; }
.cover { display: grid; grid-template-columns: 1.3fr 1fr; border: 1px solid var(--ink); background: #eae6d1; overflow: hidden; }
.cover-copy { grid-row: 1; padding: clamp(1.6rem, 4.4vw, 4rem); align-self: center; }
.cover-copy h1 { font-size: clamp(3.3rem, 7vw, 6.8rem); line-height: .92; margin: 1.35rem 0; }
.cover-copy em { color: var(--orange); }
.cover-copy > p:last-child { max-width: 35ch; }
.sleeve { position: relative; grid-column: 2; grid-row: 1; overflow: hidden; min-height: 20rem; isolation: isolate; background: #cd593c; border-left: 1px solid var(--ink); }
.record { position: absolute; width: 115%; aspect-ratio: 1; top: 48%; left: 74%; transform: translate(-50%, -50%); border-radius: 50%;
  background: repeating-radial-gradient(circle at center, #192f29 0 2px, #35463a 2px 3px, #162d27 3px 6px); }
.record::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: conic-gradient(transparent 20deg, #f3e7cd26 48deg, transparent 85deg, transparent 195deg, #eee8ca33 220deg, transparent 258deg); }
.record i { position: absolute; inset: 34%; border-radius: 50%; background: linear-gradient(156deg, #e9d69c 50%, #d66444 50%); border: 3px solid #142a25; }
.record i::after { content: ""; position: absolute; inset: 45%; border-radius: inherit; background: var(--ink); }
#importer, #export, .panel { background: var(--surface); border: 1px solid var(--line); padding: clamp(1.1rem, 3vw, 2.3rem); margin-block: 1.2rem; }
#importer { border-top: 4px solid var(--orange); }
#export { background: transparent; }
#export ol { padding-left: 1.3rem; max-width: 75ch; }
#export li + li { margin-top: .45rem; }
button, select, input, summary { font: inherit; }
button, input::file-selector-button { cursor: pointer; border: 1px solid var(--ink); border-radius: .28rem; background: var(--paper); color: var(--ink); padding: .5rem .85rem; font-weight: 600; font-size: .9rem; line-height: 1.4; }
button:hover:enabled, button[aria-pressed="true"], nav button[aria-current], input::file-selector-button { background: var(--ink); color: var(--paper); }
button:disabled { opacity: .48; cursor: default; }
.picker, .select, .search { display: grid; gap: .25rem; font-size: .87rem; font-weight: 600; max-width: 100%; }
.picker input, select, input[type="search"] { min-height: 2.7rem; min-width: 0; max-width: 100%; }
.picker input { padding: .5rem; border: 1px dashed var(--subtle); background: var(--paper); width: min(100%, 34rem); }
input::file-selector-button { margin-right: .75rem; font-weight: 600; }
select, input[type="search"] { border: 1px solid var(--line); border-radius: .25rem; color: var(--ink); background: var(--surface); padding: .45rem .6rem; font-size: 1rem; }
nav { border-bottom: 1px solid var(--line); padding: .7rem 0; }
nav button, .quiet { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: .2em; }
#status:not(:empty) { color: var(--subtle); margin: .55rem 0; }
#toolbar { align-items: end; justify-content: space-between; padding-block: .5rem 1.4rem; }
#toolbar p { margin: 0; }
.archive-open main { padding-top: .75rem; }
.archive-open #importer { margin: .5rem 0; }
details, summary { margin-block: .4rem; }
summary { cursor: pointer; color: var(--subtle); }
#results { overflow-wrap: anywhere; }
.subtitle { color: var(--subtle); font-size: 1.1rem; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin: 1.25rem 0 .4rem; background: var(--ink); color: var(--paper); }
.metrics .measure { display: grid; align-content: start; gap: .35rem; padding: 1.3rem; border: 1px solid #69796b; }
.metrics strong { font: 500 clamp(1.8rem, 4vw, 3.1rem)/1 Georgia, serif; letter-spacing: -.04em; }
.section-head, .pager { justify-content: space-between; }
.section-head h2 { margin: 0; }
.section-head { margin-bottom: .8rem; }
.chart { display: flex; overflow-x: auto; padding: .5rem .2rem .85rem; gap: .25rem; }
.chart .bar { flex: 1 0 3.6rem; min-width: 0; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); border: 1px solid transparent; padding: .25rem; text-align: left; border-radius: 0; }
.chart button:hover:enabled { border-color: var(--ink); background: var(--light); color: var(--ink); }
.bar-space { width: 100%; height: 5.5rem; display: flex; align-items: end; border-bottom: 1px solid var(--subtle); }
.bar-space i { width: 100%; background: var(--orange); min-height: 2px; }
.outside .bar-space { background: repeating-linear-gradient(135deg, transparent 0 5px, var(--line) 5px 6px); }
.outside .bar-space i { display: none; }
.bar b { margin: .25rem 0; }
.bar small { font-size: .72rem; line-height: 1.3; }
.filters { align-items: end; margin-bottom: .8rem; }
.search { flex: 1 1 15rem; }
.results { padding-left: 2.25rem; margin: .75rem 0; }
.results li { border-top: 1px solid var(--line); padding: .8rem .25rem; }
.results li::marker { color: var(--orange); font: .85rem ui-monospace, monospace; }
.results li > div:first-child { font-weight: 650; }
.results small { display: block; color: var(--subtle); font-weight: normal; }
.results .counts, .results li > span { font-size: .9rem; margin: .15rem 0 .35rem; color: var(--subtle); }
.counts { gap: .7rem 1.25rem; }
.royalties .payment, .royalties aside, .subpanel { margin: 1.3rem 0; padding: 1rem 1.25rem; border-left: 4px solid var(--orange); background: var(--light); }
.royalties .payment { border-color: var(--ink); background: var(--paper); }
.royalties h3 { margin: .5rem 0; }
.royalties .counts { margin-bottom: .8rem; }
.chapter { border-top: 5px solid var(--orange); }
.actions, .tabs { margin-block: 1rem; }
.chapter-count { color: var(--orange); }
footer { padding-block: 1rem; border-top: 1px solid var(--line); justify-content: space-between; color: var(--subtle); font-size: .85rem; }
@media (max-width: 650px) {
  .cover { grid-template-columns: 1fr; }
  .cover-copy { grid-row: 2; }
  .sleeve { grid-column: 1; min-height: 8rem; border: 0; border-bottom: 1px solid var(--ink); }
  .record { width: 70%; }
  .mast-note { max-width: 10rem; text-align: right; font-size: .62rem; }
  .metrics { grid-template-columns: 1fr; }
  .metrics .measure { display: flex; align-items: center; flex-direction: row-reverse; justify-content: space-between; padding: .6rem .9rem; }
  .section-head, #toolbar { align-items: start; }
  nav { gap: .25rem; }
  nav button { padding-inline: .5rem; }
}
