/* The inserts share the paper, rules and headline hierarchy of an issue. */
.reader-panel {
  --sheet-pad: clamp(16px, 3.5vw, 32px);
  --sheet-rule: #c7c7c7;
  --sheet-red: #ae1b32;
  width: min(590px, calc(100% - 24px));
  max-width: calc(100% - 12px);
  max-height: min(86dvh, 800px);
  padding: 0; border: 1px solid var(--ink); border-top: 5px solid var(--sheet-red);
  background: white; overflow: hidden; margin: auto;
  box-shadow: 6px 6px 0 #131313;
}
.reader-panel[open] { display: flex; flex-direction: column; }
.reader-panel::backdrop { background: rgb(16 16 20 / 62%); }
.panel-head {
  flex: none; display: flex; justify-content: space-between; gap: 1em; align-items: flex-start;
  padding: 15px var(--sheet-pad) 14px; border-bottom: 3px solid var(--ink);
}
.panel-head p, .panel-head h2 { margin: 0; }
.panel-kicker, .row-category {
  color: var(--sheet-red); font-weight: 800; font-size: .75rem; line-height: 1.25;
}
.panel-kicker { font-variant-numeric: tabular-nums; }
.panel-head h2 {
  margin-top: 3px; color: var(--ink); font-size: clamp(1.8rem, 5.5vw, 2.5rem);
  font-weight: 900; line-height: 1.08; letter-spacing: -.045em;
}
.panel-close {
  flex: none; display: grid; place-items: center; height: 44px; width: 44px; padding: 0;
  border: 1px solid var(--sheet-rule); font: 500 1.65rem/1 system-ui,sans-serif; background: white;
}
.panel-close:is(:hover,:focus-visible) { border-color: var(--ink); }
.panel-body {
  min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-gutter: stable; padding: 16px var(--sheet-pad) 20px;
}
.reader-panel :is(form, .filters) { margin: 0; }
.reader-panel :where(ol,ul) { margin: 0; padding: 0; list-style: none; }
.reader-panel :is(#scene-index, #era) { border: none; padding: 0; margin: 19px 0 0; }
.reader-panel .panel-form { display: grid; gap: 12px; }
.filter-pair { display: grid; grid-template-columns: minmax(90px,.72fr) minmax(0,1.65fr); gap: 12px; align-items: end; }
.reader-panel label { gap: 5px; font-weight: 800; font-size: .78rem; }
.filter-pair select {
  display: block; width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--ink);
  border-bottom-width: 2px; background-color: white; padding: 4px 6px;
  color: var(--ink); font-weight: 750; font-size: 1rem; text-overflow: ellipsis;
}
.reader-panel .primary-action {
  width: 100%; min-height: 44px; display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; font-weight: 850; color: white; border: 0; background: var(--sheet-red);
}
.primary-action span { font-size: 1.2em; line-height: 1; }
.section-band {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 5px 8px; background: var(--ink); color: white;
}
.section-band h3 { margin: 0; font-size: 1rem; font-weight: 850; line-height: 1.25; }
.section-band > span { font-size: .76rem; font-weight: 750; font-variant-numeric: tabular-nums; color: #ffe453; }
.reader-panel :is(#events,#scenes) { display: block; padding: 0; margin: 0; }
.reader-panel :is(#events,#context-related,#scenes,#toc,#issue-scene-list) li {
  display: block; padding: 0; margin: 0; border: 0; border-bottom: 1px solid var(--sheet-rule);
}
.reader-panel :is(.scene-row,.toc-entry) {
  display: grid; align-items: center; width: 100%; min-width: 0; min-height: 44px;
  border: 0; padding: 9px 4px; gap: 12px; background: white; color: var(--ink); text-align: start;
}
.scene-row { grid-template-columns: minmax(2.7em,auto) minmax(0,1fr) auto; }
#issue-scene-list .scene-row { grid-template-columns: minmax(0,1fr) auto; }
.scene-folio, .event-stamp {
  display: grid; justify-items: start; align-content: center; gap: 2px;
  font-variant-numeric: tabular-nums; line-height: 1.05;
}
.scene-folio b { font-size: 1.32rem; font-weight: 900; }
.scene-folio small, .event-stamp small { font-size: .71rem; font-weight: 750; }
.reader-panel :is(.toc-copy,.scene-copy,.timeline-copy) { display: grid; gap: 3px; min-width: 0; }
.reader-panel .story-title, .reader-panel #events .story-title {
  display: block; color: var(--ink); font-size: 1rem; font-weight: 850; line-height: 1.33;
  overflow-wrap: anywhere; letter-spacing: -.017em;
}
.row-arrow { color: var(--sheet-red); font-weight: 900; }
.toc-entry { grid-template-columns: minmax(0,1fr) max-content; }
.toc-copy .subline { color: #4c4b4c; font-size: .83rem; line-height: 1.35; font-weight: 550; overflow-wrap: anywhere; }
.toc-tail { display: grid; justify-items: end; gap: 2px; min-width: 0; }
.folio-page { font: 730 .81rem/1.2 system-ui,sans-serif; font-variant-numeric: tabular-nums; }
.pin-label { background: var(--ink); color: #ffe453; padding: 3px 5px; font-size: .7rem; line-height: 1.1; }
.toc-entry[aria-pressed=true] { border-inline-start: 3px solid var(--sheet-red); padding-inline-start: 8px; }
.reader-panel :is(.toc-entry,.scene-row):is(:hover,:focus-visible), .toc-entry[aria-pressed=true] { background: #f4f3f3; }
#contents-scenes { margin-bottom: 16px; }
.panel-note, #contents-basis { color: #454447; font-size: .77rem; line-height: 1.4; margin: 7px 0; }
#contents-basis { font-weight: 750; }
#contents :is(#other-details,#extra-evidence) { margin: 10px 0 0; border-block-start: 1px solid var(--ink); }
#contents details summary { cursor: pointer; padding: 12px 1px; font-size: .83rem; font-weight: 800; }
#contents details li { padding: 5px 1px; font-size: .84rem; border-top: 1px solid var(--sheet-rule); }
.reader-panel :is(#events,#context-related) .timeline-row {
  display: grid; grid-template-columns: 4.25rem minmax(0,1fr); align-items: start; gap: 12px;
  padding: 12px 2px;
}
.event-stamp { padding-block: 1px; gap: 4px; }
.reader-panel :is(#events,#context-related) .event-stamp strong { font: 850 1.2rem/1 system-ui,sans-serif; font-variant-numeric: tabular-nums; }
.near-link {
  width: fit-content; min-height: 32px; padding: 5px 0; border: 0; color: var(--sheet-red); background: transparent;
  font-size: .76rem; font-weight: 750; text-align: start; text-decoration: underline; text-underline-offset: .22em;
}
.reader-panel :is(#events,#scenes,#toc) .list-empty { padding: 14px 4px; color: #555; line-height: 1.55; font-size: .88rem; }
@media (max-width: 680px) {
  .reader-panel { width: calc(100% - 20px); max-height: calc(100dvh - 22px); box-shadow: 3px 3px 0 #131313; }
  .panel-body { scrollbar-gutter: auto; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .reader-panel { max-height: calc(100dvh - 12px); }
  .panel-head { padding-block: 5px; align-items: center; }
  .panel-head h2 { font-size: 1.55rem; }
  .panel-head .panel-kicker { font-size: .7rem; }
  .panel-body { padding-block-start: 10px; }
}
.panel-head h2:focus { outline: none; }

.archive-filters { grid-template-columns: minmax(103px, 1fr) minmax(0, 1.5fr); margin-bottom: 14px; }
.archive-filters select, .archive-filters input { font-size: .86rem; }
.archive-filters input { width: 100%; min-width: 0; padding-inline: 6px; }
#feature-archive .panel-head > div { min-width: 0; }
#archive-results > li { border-bottom: 1px solid var(--sheet-rule); }
#archive-results .list-empty { padding: 12px 4px; }
