:root {
  color-scheme: light;
  --paper: #f7f5f0;
  --surface: #fffefb;
  --ink: #28241e;
  --muted: #625b51;
  --line: #ded6c9;
  --accent: #842f35;
  --gemini: #f8e2ab;
  --chandra: #d9eadf;
  --serif: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.5 system-ui, sans-serif; }
.shell { width: min(100% - 4rem, 104rem); margin-inline: auto; }
.masthead { padding-block: 1.5rem 1.6rem; border-top: .35rem solid var(--accent); border-bottom: 1px solid var(--line); }
.byline { margin: 0 0 .38rem; color: var(--accent); font-size: .875rem; font-weight: 650; letter-spacing: .075em; text-transform: uppercase; }
h1 { margin: 0; font: 700 clamp(2rem, 4vw, 3.45rem)/1.05 var(--serif); letter-spacing: -.035em; }
main { padding-block: 1.2rem 3rem; }
.controls, .picker, nav { display: flex; align-items: center; gap: .55rem; }
.controls { flex-wrap: wrap; gap: .75rem; }
.picker { min-width: 0; }
label { font-weight: 650; }
select, button {
  min-height: 2.5rem;
  padding: .42rem .72rem;
  border: 1px solid #bdb3a4;
  border-radius: .32rem;
  color: inherit;
  background-color: var(--surface);
  font: inherit;
}
select {
  appearance: none;
  width: clamp(13rem, 34vw, 29rem);
  padding-right: 1.9rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: right .98rem center, right .68rem center;
  background-size: .3rem .3rem;
  background-repeat: no-repeat;
}
button:not(:disabled) { cursor: pointer; }
button:not(:disabled):hover { border-color: var(--accent); background: #f5e9e4; }
button:disabled { color: var(--muted); opacity: .65; }
a { color: var(--accent); text-underline-offset: .18em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#status { margin: .75rem 0 1.05rem; color: var(--muted); font-size: .9rem; }
.comparison { display: grid; grid-template-columns: minmax(0, 2fr) minmax(19rem, 1fr); align-items: start; gap: 1rem; }
.transcripts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
.transcript, .scan { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: .36rem; }
.transcript header, .scan header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .25rem .6rem;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--line);
}
h2 { margin: 0; font-size: 1rem; }
.legend, .scan a { font-size: .875rem; }
.gemini { --highlight: var(--gemini); }
.chandra { --highlight: var(--chandra); }
.legend { background: var(--highlight); padding-inline: .35rem; border-radius: .15rem; }
.text { padding: .9rem clamp(.9rem, 1.5vw, 1.45rem) .5rem; font: 1.14rem/1.6 var(--serif); overflow-wrap: anywhere; }
.text h3 { margin: 0 0 .65rem; font-size: 1.6rem; line-height: 1.15; letter-spacing: -.02em; }
.text p { margin: 0 0 .95rem; white-space: pre-wrap; }
mark { color: inherit; background: var(--highlight); border-radius: .13rem; }
.scan { position: sticky; top: 1rem; }
#pdf-frame { display: block; width: 100%; height: clamp(25rem, 74vh, 60rem); border: 0; background: #e7e1d8; border-radius: 0 0 .3rem .3rem; }
@media (max-width: 64rem) {
  .shell { width: calc(100% - 2rem); }
  .comparison { grid-template-columns: 1fr; }
  .scan { position: static; }
}
@media (max-width: 37rem) {
  .picker { width: 100%; }
  select { width: 100%; }
  .transcripts { grid-template-columns: 1fr; }
}
