:root {
  color-scheme: light;
  --paper: #f8f9fc;
  --ink: #171b35;
  --muted: #50576c;
  --accent: #4434ab;
  --tint: #edeafd;
  --line: #cbd0dc;
  font: 100%/1.55 Inter, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
main, .mast { width: min(72rem, calc(100% - 3rem)); margin: auto; }
main { padding: 2rem 0 5rem; }
header { background: var(--ink); color: white; }
.mast { min-height: 4.5rem; display: flex; gap: 2rem; align-items: center; justify-content: space-between; }
.brand { font: bold 2rem/1 Georgia, serif; letter-spacing: -.07em; display: inline-flex; align-items: center; gap: .7rem; }
.brand i { width: 1.4rem; height: 1.4rem; background: repeating-linear-gradient(90deg,#b6acff 0 3px,transparent 3px 5px); border-radius: 50%; transform: rotate(28deg); }
.privacy { font-size: .875rem; color: #d8daea; }
h1,h2,h3,p,dl,ol { margin-top: 0; }
h1,h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; line-height: 1.08; }
h1 { font-size: clamp(2.7rem,6vw,4.9rem); margin-bottom: .6rem; letter-spacing: -.052em; }
h2 { font-size: clamp(1.65rem,3vw,2.25rem); letter-spacing: -.035em; margin-bottom: .85rem; }
h3 { margin: 1.4rem 0 .4rem; }
p { max-width: 76ch; }
a { color: var(--accent); text-underline-offset: .2em; overflow-wrap: anywhere; }
button, select, input { font: inherit; color: inherit; }
button, select, input[type=search] { border: 1px solid var(--line); background: white; border-radius: .4rem; padding: .5rem .8rem; }
button, select, summary, input[type=file] { cursor: pointer; }
button { font-weight: 600; }
button:hover:enabled, button[aria-pressed=true] { background: var(--tint); border-color: var(--accent); color: var(--accent); }
button:disabled { color: #64687a; background: #f2f3f6; }
:focus-visible { outline: 3px solid #c05a15; outline-offset: 3px; }
select { appearance: none; max-width: 100%; padding-right: 2.3rem; background-image: linear-gradient(45deg,transparent 50%,var(--ink) 50%),linear-gradient(135deg,var(--ink) 50%,transparent 50%); background-position: calc(100% - 16px) 53%,calc(100% - 11px) 53%; background-size: 5px 5px; background-repeat: no-repeat; }
label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 650; min-width: 0; }
input, select { font-weight: 400; }
nav,.controls,.pager,.section-head,.import-bar,.explore-head { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
nav { margin-bottom: 1.2rem; }
nav button[aria-current=page] { background: #e3ddff; color: var(--ink); }
.welcome { background: #e5e5fa; display: grid; grid-template-columns: 1.1fr 1fr; overflow: hidden; border-radius: .75rem; }
.intro { padding: clamp(2rem,5vw,4.2rem); align-self: center; }
.intro h1 { font-size: clamp(3.8rem,8vw,7rem); }
.intro h1 em { color: var(--accent); font-weight: 400; }
.intro > p:last-child { font-size: 1.15rem; max-width: 35ch; margin: 1.2rem 0 0; }
.kicker { text-transform: uppercase; letter-spacing: .13em; font-size: .8rem; font-weight: 700; color: var(--accent); }
.sleeve { position: relative; min-height: 17rem; overflow: hidden; background: #c7c9f4; }
.record { position: absolute; width: 87%; aspect-ratio: 1; top: 10%; left: 21%; border-radius: 50%; background: radial-gradient(circle,#171b35 0 1%,#bcb4fe 1.2% 17%,transparent 17.3%), conic-gradient(from 50deg,transparent,#ffffff30,transparent 24%,transparent 53%,#ffffff29,transparent 74%),repeating-radial-gradient(#252640 0 2px,#383951 3px,#191a2b 4px); box-shadow: 3px 8px 16px #25264642; }
.jacket { position: absolute; inset: 27% 38% -31% -8%; background: #5c4ac0; transform: rotate(-11deg); border: .5rem solid #7061cc; box-shadow: 3px -3px 15px #23234035; overflow: hidden; }
.jacket i { position: absolute; inset: 18% -13% -12%; border: 2rem double #d6d1fa; border-radius: 50%; transform: scaleX(.7) rotate(25deg); }
.import-bar { justify-content: space-between; background: #fff; padding: 1.2rem 1.5rem; border: 1px solid var(--line); border-radius: .65rem; margin-top: 1rem; }
.file-field { min-width: 0; }
.file-field label { font-size: 1.15rem; margin-bottom: .3rem; }
input[type=file] { max-width: 100%; }
input::file-selector-button { border: none; background: var(--accent); color: white; font: inherit; font-weight: 600; border-radius: .35rem; padding: .65rem 1.15rem; margin-right: .65rem; cursor: pointer; }
#file-help,.context,small,.score,.sheet > p,.pager span { color: var(--muted); }
#file-help { font-size: .875rem; margin: .4rem 0 0; }
#status { color: var(--accent); margin: .45rem 0 1.15rem; font-size: .9rem; }
.export-guide { margin: 2.3rem 0; max-width: 54rem; }
.export-guide li { margin: .5rem 0; }
.ready .welcome,.ready .export-guide { display: none; }
.ready .import-bar { margin-top: 0; }
#view { overflow-wrap: anywhere; }
#view[aria-busy=true] { visibility: hidden; }
.stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(10rem,100%),1fr)); border: 1px solid var(--line); border-radius: .65rem; background: #e9e8f8; margin: 1.2rem 0; gap: 1rem; padding: 1.4rem; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; }
.stats strong,.statement { display: block; font-family: Georgia, serif; font-weight: 500; font-size: clamp(1.75rem,3.4vw,2.9rem); line-height: 1.2; }
.sheet { background: #fff; border: 1px solid var(--line); border-radius: .65rem; padding: clamp(1rem,2.6vw,1.8rem); margin: 1.2rem 0; min-width: 0; }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.columns > .sheet { margin: 1rem 0 0; }
.section-head,.explore-head { justify-content: space-between; margin-bottom: 1rem; align-items: end; }
.controls { align-items: end; }
.chart { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(12rem,100%),1fr)); gap: .55rem; max-height: 28rem; overflow: auto; padding: .3rem; }
.bucket { display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; text-align: left; min-height: 5.1rem; padding: .65rem .8rem; border-radius: .35rem; }
.bucket small,.names small { font-size: .85rem; font-weight: 400; }
.meter { display: block; height: .32rem; background: #edecf5; margin: .4rem 0; }
.meter i { display: block; height: 100%; background: #6552c5; }
.outside { background: repeating-linear-gradient(135deg,#f5f5f8 0 5px,#ececf1 6px); border: 1px dashed var(--line); }
.results { padding-left: 1.8rem; }
.results li { border-bottom: 1px solid #e3e4ec; padding: .8rem 0 .8rem .3rem; }
.results li::marker { font: .85rem monospace; color: var(--muted); }
.result { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; }
.names { display: grid; }
.score { font-size: .9rem; }
.empty { padding: .8rem; background: var(--paper); }
.pager { margin-top: 1rem; }
.chapter { border-top: .45rem solid var(--accent); }
.chapter .controls,.citation .statement { margin-top: 1.4rem; }
.citation { background: #f1effb; }
summary { font-weight: 650; }
summary + p { margin-top: .8rem; }
@media (max-width: 44rem) {
  main,.mast { width: calc(100% - 2rem); }
  main { padding-top: 1rem; }
  .mast { flex-wrap: wrap; padding: .85rem 0; gap: .6rem; }
  .ready .privacy { display: none; }
  .welcome { grid-template-columns: 1fr; }
  .intro { padding: 1.5rem; }
  .sleeve { min-height: 6.5rem; }
  .record { width: 64%; top: -18%; }
  .jacket { inset: -5% 51% -80% -6%; }
  .columns { grid-template-columns: 1fr; gap: 0; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .chart { grid-template-columns: repeat(2,minmax(0,1fr)); }
  nav { gap: .3rem; }
  nav button { padding: .4rem .55rem; font-size: .9rem; }
}
