:root { font-family: Arial, sans-serif; color: #222; background: #fff; font-size: 12px; }
* { box-sizing: border-box; }
body { margin: 0; }
main { width: min(100% - 32px, 920px); margin: 24px auto; }
header, form, label, nav { display: flex; align-items: center; }
header { gap: 16px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid #eee; }
.name { font-weight: 600; font-size: 14px; color: inherit; text-decoration: none; margin-right: auto; }
form { gap: 10px; }
label { gap: 5px; color: #777; white-space: nowrap; }
input, button, select { font: inherit; color: inherit; background: #fff; border: 1px solid #ddd; border-radius: 0; height: 28px; padding: 4px 6px; }
input { width: 44px; appearance: textfield; -moz-appearance: textfield; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { appearance: none; margin: 0; }
input[name="sheets"] { width: 46px; }
input[name="start"] { width: 58px; }
#find { gap: 4px; }
#card { width: 75px; }
button, select { cursor: pointer; }
button:hover:not(:disabled) { background: #f5f5f5; }
button:disabled { opacity: .25; cursor: default; }
:focus-visible { outline: 2px solid #777; outline-offset: 2px; }
#location { display: block; color: #777; font-size: 11px; min-height: 40px; padding-top: 13px; }
#location.error { color: #a33; }
#binder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; position: relative; --rows: 4; --columns: 4; }
#binder::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid #eee; }
.page { min-width: 0; }
.page-heading { display: flex; justify-content: space-between; color: #888; font-size: 11px; margin-bottom: 10px; height: 14px; }
.range { color: #aaa; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); gap: 6px; aspect-ratio: calc(var(--columns) * .735 / var(--rows)); }
.slot { border: 1px solid #ddd; height: auto; min-height: 24px; min-width: 0; padding: 3px; font: 13px ui-monospace, monospace; color: #666; overflow: hidden; container-type: inline-size; }
.slot span { font-size: min(14px, calc(145cqw / var(--digits))); }
.slot.selected { color: #fff; background: #222; border-color: #222; }
.slot.selected:hover { background: #333; }
.cover { color: #ccc; display: grid; place-items: center; font-size: 11px; }
.cover .grid { width: 100%; display: grid; place-items: center; }
.cover .page-heading { visibility: hidden; }
nav { justify-content: center; gap: 12px; margin-top: 20px; }
nav button { border-color: transparent; font-size: 18px; width: 32px; }
nav select { border-color: transparent; color: #777; font-size: 11px; text-align: center; max-width: 240px; }
#binder.single { grid-template-columns: minmax(0, 1fr); max-width: 440px; margin: auto; }
#binder.single #left, #binder.single::after { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 700px) {
  main { width: calc(100% - 24px); margin: 16px auto; }
  header { gap: 10px; }
  .name { flex-basis: calc(100% - 220px); }
  #layout { order: 1; width: 100%; gap: 12px; }
  label { font-size: 11px; gap: 4px; }
  #binder { gap: 18px; }
  .grid { gap: 4px; }
  .page-heading { font-size: 10px; }
  .range { font-size: 9px; }
  .slot { min-height: 18px; padding: 1px; }
  #binder.single .slot { min-height: 26px; }
}
@media (max-width: 360px) {
  #layout { gap: 7px; }
  #layout input { width: 35px; }
  #layout input[name="start"] { width: 48px; }
  .range { display: none; }
}
