:root {
  color-scheme: dark;
  --desk: #171d20;
  --panel: #1d2528;
  --paper: #eee9d9;
  --ink: #e6e9e4;
  --muted: #b0bcb9;
  --line: #394547;
  --semantic: #b5d7b6;
  --structural: #a8ccdc;
  --gap: #edc893;
  --historic: #cbb8db;
  --select: #d6e4c9;
  font: 15px/1.45 "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  background: var(--desk);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, select, a { touch-action: manipulation; }
button, select {
  background: #243033;
  color: var(--ink);
  font: inherit;
  border: 1px solid #526260;
  border-radius: 4px;
}
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .42; }
button:not(:disabled):hover, select:hover { border-color: #a5b7a8; }
button:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible, [tabindex="-1"]:focus-visible {
  outline: 2px solid #e3cd94;
  outline-offset: 3px;
}
a, summary { color: #cedcc7; text-underline-offset: .2em; }
summary { cursor: pointer; }
.skip { position: absolute; z-index: 3; left: 1rem; top: -4rem; padding: .6rem 1rem; background: var(--desk); }
.skip:focus { top: .4rem; }
.mast { border-bottom: 1px solid var(--line); background: #1c2427; }
.mast-inner, .workspace { width: min(100%, 1420px); margin-inline: auto; padding-inline: clamp(14px, 3.3vw, 54px); }
.mast-inner { min-height: 61px; padding-block: .55rem; display: flex; align-items: baseline; justify-content: space-between; gap: 1.1rem; }
h1, h2, h3, p { margin: 0; }
h1, h2, .inspect-form { font-family: "STIX Two Text", Georgia, serif; }
h1 { font-size: clamp(1.55rem, 2.5vw, 2.18rem); font-weight: 500; line-height: 1.28; letter-spacing: -.025em; }
.manuscript-id { color: var(--muted); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem 1.25rem; font-size: .83rem; }
.navigation { display: flex; flex-wrap: wrap; gap: .7rem 1.2rem; align-items: end; padding-block: 1.05rem .95rem; border-bottom: 1px solid var(--line); }
.navigation label { display: block; font-size: .78rem; margin-bottom: .22rem; color: var(--muted); }
.wrapped-control { display: flex; align-items: stretch; }
.navigation select, .navigation button, .pagination button, .sheet-toolbar button, .retry {
  min-height: 37px;
  padding: .32rem .68rem;
  font-size: .91rem;
}
.wrapped-control .arrow { min-width: 32px; font-size: 1.38rem; line-height: 1; }
.wrapped-control select { border-radius: 0; margin-inline: -1px; max-width: 18rem; }
.wrapped-control .arrow:first-child { border-radius: 4px 0 0 4px; }
.wrapped-control .arrow:last-child { border-radius: 0 4px 4px 0; }
#line-select { width: min(16.5rem, 32vw); }
.quiet { margin-left: auto; color: var(--gap); background: transparent; }
.quiet span { padding-left: .25rem; }
#load-status:not(:empty) { padding: .6rem .2rem; color: var(--gap); }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(235px, 278px); gap: clamp(1rem, 2.45vw, 2.4rem); align-items: start; margin-bottom: 2rem; }
.reading { min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: 1.1rem 0 .38rem; }
h2 { font-weight: 500; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.04em; line-height: 1.14; color: var(--paper); }
.page-summary, .intro { font-size: .88rem; }
.page-summary { color: var(--muted); margin-top: .24rem; }
#cube-short, .research-witness { border: 0; background: transparent; padding: .09rem 0; color: #cedcc7; text-align: left; text-decoration: underline; text-underline-offset: .2em; overflow-wrap: anywhere; }
#cube-short { margin-top: .16rem; font-size: .8rem; }
.cube-record h4 { margin: 0; }
.cube-record dl { margin: .4rem 0; }
.cube-record dt { margin-top: .21rem; color: var(--muted); font-size: .75rem; }
.cube-record dd { margin: 0; }
.cube-record + .section-notes { margin-top: .9rem; }
.intro { color: #d2dad5; margin: .34rem 0 .56rem; }
.text-link { color: #d9e3cf; font-size: .84rem; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin: .2rem 0 1.1rem; font-size: .74rem; }
.legend-item { display: inline-flex; align-items: center; gap: .37rem; color: var(--muted); }
.legend-item i { display: inline-block; width: .78rem; height: .26rem; background: var(--semantic); border-radius: 2px; }
.legend-item.structural i { background: var(--structural); }
.legend-item.unknown i { height: .42rem; border: 1px dashed var(--gap); background: transparent; }
.legend-item.span-key i { height: .45rem; border-bottom: 2px solid var(--historic); background: transparent; border-radius: 0; }
.reading-options { display: flex; flex-wrap: wrap; gap: .32rem 1rem; align-items: baseline; margin: -.52rem 0 .84rem; font-size: .79rem; }
.scoped-choice { color: #c6d0cb; display: flex; gap: .35rem; align-items: center; cursor: pointer; }
.scoped-choice input { accent-color: #bacfae; margin: 0; }
#gap-index { min-width: 0; }
#gap-index[open] { flex-basis: 100%; }
#gap-index-body { margin: .45rem 0 .15rem; max-width: 48rem; }
#gap-index-body table { border-collapse: collapse; width: 100%; }
#gap-index-body th, #gap-index-body td { text-align: left; border-bottom: 1px solid var(--line); padding: .2rem .3rem; }
#gap-index-body th { color: var(--muted); font-size: .74rem; font-weight: 550; }
#gap-index-body .gap-jump { display: inline-block; padding-block: .15rem; }
.line { padding: .73rem 0 .86rem; border-top: 1px solid var(--line); scroll-margin-top: .7rem; }
.line-heading { display: flex; gap: .7rem; flex-wrap: wrap; align-items: baseline; margin-bottom: .55rem; }
.line-heading h3 { color: var(--paper); font-size: 1rem; font-weight: 600; }
.line-heading span, .empty-line { color: var(--muted); font-size: .79rem; }
.groups { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .58rem .7rem; min-width: 0; }
.group {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid #354144;
  border-top-color: #637074;
  border-radius: 3px;
  padding: .21rem .27rem .31rem;
}
.group-heading { padding: 0 .16rem; display: flex; align-items: baseline; gap: .5rem; color: #bec9c2; font: .75rem/1.4 "IBM Plex Mono", ui-monospace, monospace; overflow-wrap: anywhere; }
.group-heading .uncertain { color: var(--gap); font: .72rem system-ui, sans-serif; }
.components { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: stretch; gap: 2px; max-width: 100%; }
.chip {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  min-width: 2.25rem; max-width: 6.6rem; flex: 0 1 auto;
  padding: .14rem .23rem .28rem;
  border: 1px solid transparent; border-radius: 3px;
  background: transparent; line-height: 1.15; text-align: center; min-height: 51px;
}
.chip:hover { background: #293537; }
.chip[aria-pressed="true"] { background: #32403d; border-color: #b7c9a7; }
.chip-form, .inspect-shape {
  font-family: "EvaHand1", "EvaHand1Fallback";
  font-weight: 400; font-style: normal; font-synthesis: none; letter-spacing: 0;
  color: var(--paper);
}
.chip-form { display: flex; align-items: center; justify-content: center; min-height: 2.2rem; font-size: 1.99rem; line-height: 1.07; }
.chip-form.literal, .inspect-shape.literal { font: .79rem/1.4 "IBM Plex Mono", monospace; overflow-wrap: anywhere; }
.chip-label { margin-top: 1rem; font: .85rem/1.2 "Instrument Sans", "Segoe UI", system-ui, sans-serif; color: var(--semantic); overflow-wrap: anywhere; }
.scoped-reading { display: none; margin-top: .26rem; padding-top: .17rem; border-top: 1px dotted #796c86; color: var(--historic); font: .71rem/1.18 "Instrument Sans", system-ui, sans-serif; overflow-wrap: anywhere; }
.show-scoped .scoped-reading { display: block; }
.chip[data-kind="structural"] .chip-label { color: var(--structural); }
.chip[data-kind="unknown"] .chip-label, .chip[data-kind="unparsed"] .chip-label { color: var(--gap); text-decoration: underline dashed #a88756; text-underline-offset: 3px; }
.harvest { display: flex; flex-wrap: wrap; gap: .13rem .57rem; align-items: baseline; max-width: 31rem; border-top: 1px dotted #615867; margin: .18rem .12rem 0; padding-top: .17rem; }
.harvest-span { color: var(--historic); font-size: .73rem; line-height: 1.35; overflow-wrap: anywhere; }
.harvest-span .surface { color: #dfd3e7; font-family: "IBM Plex Mono", ui-monospace, monospace; margin-right: .24em; }
.harvest-span[data-kind="class"] { color: #c9c3d4; }
.harvest-span[data-kind="rejected"] { color: #d4aea4; }
.harvest-span[data-kind="gap"] { color: var(--gap); font-style: italic; }
.spelling-note, .research-witness { align-self: flex-start; font-size: .74rem; margin: .24rem .13rem 0; max-width: 26rem; }
.spelling-note { color: var(--muted); overflow-wrap: anywhere; }
.research-record { margin-top: .85rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.research-record h4 { margin: .2rem 0; font-size: .88rem; }
.research-record .sources { font-size: .79rem; }
.research-record p { font-size: .81rem; }
.pagination { border-top: 1px solid var(--line); padding-top: .8rem; display: flex; gap: .35rem; align-items: center; justify-content: space-between; }
#line-range { font-size: .8rem; text-align: center; color: var(--muted); }
.rail { min-width: 0; padding-top: 1.18rem; }
#inspector, #photo-section, #context-details { border: 1px solid var(--line); background: #20282b; border-radius: 5px; padding: .8rem .95rem; }
#photo-section, #context-details { margin-top: .7rem; }
#inspector h3, #photo-section h3, #context-details summary { font-size: .92rem; font-weight: 600; }
.inspect-ident { margin-top: .65rem; display: flex; align-items: center; gap: .7rem; }
.inspect-shape { min-width: 2.9rem; min-height: 3rem; display: inline-flex; align-items: center; justify-content: center; font-size: 2.65rem; background: #151c1e; border-radius: 4px; padding: .08rem .25rem; }
.inspect-form { font-size: 1.22rem; color: var(--paper); overflow-wrap: anywhere; line-height: 1.18; }
.qualifier, .inspect-location, .note, #photo-caption { color: var(--muted); font-size: .77rem; }
.inspect-location { margin: .42rem 0 .72rem; }
.inspect-value { font-size: 1.1rem; line-height: 1.36; color: var(--semantic); overflow-wrap: anywhere; }
.inspect-value[data-kind="structural"] { color: var(--structural); }
.inspect-value[data-kind="unknown"], .inspect-value[data-kind="unparsed"] { color: var(--gap); }
.field { margin-top: .73rem; font-size: .88rem; overflow-wrap: anywhere; }
.field h4 { margin: 0 0 .16rem; font-size: .77rem; color: var(--muted); font-weight: 550; }
.field ul, .field ol, .sources { margin: .18rem 0; padding-inline-start: 1.18rem; }
.field li { margin: .1rem 0; }
.detail { margin-top: .65rem; border-top: 1px solid var(--line); padding-top: .48rem; font-size: .84rem; }
summary { width: fit-content; max-width: 100%; overflow-wrap: anywhere; }
.detail pre, #context-details pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 18rem; overflow: auto; font: .76rem/1.47 ui-monospace, monospace; }
.source-locator { display: block; color: var(--muted); font: .71rem/1.4 ui-monospace, monospace; overflow-wrap: anywhere; }
#photo-source { display: block; margin: .55rem auto .3rem; text-align: center; background: #161e20; }
#manuscript-photo { display: block; margin: auto; max-width: 100%; width: auto; height: auto; max-height: 16.5rem; }
#context-body { margin-top: .45rem; font-size: .84rem; overflow-wrap: anywhere; }
.comparison-row { padding-block: .4rem; border-bottom: 1px solid var(--line); }
.comparison-row p { overflow-wrap: anywhere; }
.comparison-row small { color: var(--muted); }
.section-notes { margin: 0; padding-left: 1.2rem; }
.section-notes li + li { margin-top: .35rem; }
#mobile-evidence { color: var(--ink); background: var(--panel); border: 1px solid #6e7d73; border-radius: 10px 10px 0 0; padding: .6rem; width: min(100%, 40rem); max-width: 100%; max-height: 74dvh; margin: auto auto 0; }
#mobile-evidence::backdrop { background: rgb(8 13 15 / 56%); }
.sheet-toolbar { display: flex; justify-content: flex-end; padding-bottom: .36rem; }
#sheet-body #inspector { border: 0; padding: .55rem .4rem; }
@media (min-width: 1500px) { :root { font-size: 16px; } }
@media (max-width: 870px) {
  .columns { grid-template-columns: minmax(0,1fr); gap: .55rem; }
  .rail { padding-top: 0; }
  #inspector { margin-top: .4rem; }
  #photo-section { max-width: 33rem; }
}
@media (max-width: 570px) {
  .mast-inner { align-items: center; min-height: 53px; gap: .5rem; }
  .manuscript-id { justify-content: flex-end; display: grid; text-align: right; font-size: .7rem; gap: 0; }
  .navigation { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .45rem .55rem; padding: .65rem 0; }
  #line-select { width: 100%; }
  .wrapped-control select { max-width: 7rem; }
  .quiet { justify-self: start; margin: 0; }
  .navigation button, .navigation select, .pagination button { min-height: 36px; }
  .page-head { padding: .8rem 0 .25rem; }
  .legend { gap: .25rem .72rem; margin-bottom: .75rem; }
  .groups { gap: .45rem .42rem; }
  .components { gap: 0; }
  .chip { min-width: 2rem; max-width: 5.35rem; padding-inline: .18rem; }
  .chip-form { font-size: 1.8rem; }
  .chip-label { font-size: .82rem; }
  .pagination button { padding-inline: .4rem; }
}
