@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 400; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 700; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Literata'; font-weight: 400; font-display: swap; src: url(/fonts/literata-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Literata'; font-weight: 600; font-display: swap; src: url(/fonts/literata-latin-600-normal.woff2) format('woff2'); }
:root {
  --ink: #1a3a5c;          /* Providence navy */
  --ink-deep: #11273e;
  --gold: #c8a96e;         /* Providence gold */
  --gold-soft: #efe4cd;
  --paper: #fbfaf7;
  --card: #ffffff;
  --text: #1f2b36;
  --muted: #5b6875;
  --rule: #e3dfd6;
  --in: #2d6a4c;
  --in-soft: #e3f0e8;
  --out: #8a5a1c;
  --out-soft: #f6ecd9;
  --late: #a8382a;
  --late-soft: #f8e3df;
  --focus: #2f6fb0;
  --radius-s: 6px;
  --radius-m: 12px;
  --title: 'Literata', Georgia, serif;
  --ui: 'Atkinson Hyperlegible', -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 18px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- top bar ---------- */
.top {
  background: var(--ink); color: #fff;
  padding: 14px max(16px, env(safe-area-inset-left)) 14px max(16px, env(safe-area-inset-right));
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.brand { font-family: var(--title); font-size: 22px; font-weight: 600; letter-spacing: .005em; text-decoration: none; color: #fff; line-height: 1.2; }
.brand small { display: block; font-family: var(--ui); font-weight: 400; font-size: 14px; color: #c9d4df; letter-spacing: 0; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: #dfe7ef; text-decoration: none; padding: 8px 14px; border-radius: 999px; font-size: 16px;
}
.nav a[aria-current="page"] { background: #fff; color: var(--ink); font-weight: 700; }
.subnav { display: flex; gap: 6px; padding: 12px 16px 0; max-width: 1180px; margin: 0 auto; flex-wrap: wrap; }
.subnav a { text-decoration: none; padding: 8px 14px; border-radius: var(--radius-s); color: var(--muted); font-size: 16px; }
.subnav a[aria-current="page"] { background: var(--gold-soft); color: var(--ink); font-weight: 700; }

main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 64px; }
h1, h2, h3 { font-family: var(--title); color: var(--ink); font-weight: 600; line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: 30px; }
h2 { font-size: 23px; }
h3 { font-size: 19px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }

/* ---------- the spine label: the one bold thing ---------- */
.spine {
  flex: none; width: 76px; white-space: nowrap; min-height: 58px; border-radius: 4px;
  background: #fff; border: 1.5px solid var(--ink);
  border-top: 8px solid var(--gold);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font: 700 15px/1.15 var(--ui); color: var(--ink); text-align: center; padding: 4px 2px;
  font-variant-numeric: tabular-nums;
}
.spine.long { font-size: 12.5px; }
.spine.big.long { font-size: 21px; }
.spine.huge.long { font-size: 30px; }
.spine.empty { border-style: dashed; border-top-style: solid; border-top-color: var(--rule); color: var(--muted); font-weight: 400; font-size: 13px; }
.spine.big { width: 132px; min-height: 108px; font-size: 26px; border-width: 2px; border-top-width: 14px; }
.spine.huge { width: 190px; min-height: 150px; font-size: 38px; border-width: 3px; border-top-width: 18px; }

/* ---------- search ---------- */
.search {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  border: 2px solid var(--ink); border-radius: var(--radius-m); padding: 4px 6px 4px 16px;
}
.search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 12px 0; font-size: 21px; background: transparent; }
.search svg { flex: none; color: var(--muted); }
.search button.clear { border: 0; background: none; padding: 10px; color: var(--muted); cursor: pointer; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; }
.chip {
  border: 1.5px solid var(--rule); background: var(--card); border-radius: 999px; padding: 6px 14px; font-size: 16px; cursor: pointer;
}
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }

/* ---------- results ---------- */
.results { list-style: none; margin: 8px 0 0; padding: 0; }
.row {
  display: flex; gap: 16px; align-items: center; padding: 14px 6px; border-bottom: 1px solid var(--rule);
  text-decoration: none; color: inherit; cursor: pointer; background: none; width: 100%; border-left: 0; border-right: 0; border-top: 0; text-align: left;
}
.row:hover { background: #f4f2ec; }
.row .main { flex: 1; min-width: 0; }
.row .title { font-family: var(--title); font-size: 20px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.row .title .sub { font-weight: 400; color: var(--muted); font-size: 17px; }
.row .by { color: var(--muted); font-size: 16px; }
.row .where { font-size: 15px; color: var(--text); margin-top: 2px; }
.row .side { flex: none; text-align: right; font-size: 15px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.in { color: var(--in); background: var(--in-soft); }
.status.out { color: var(--out); background: var(--out-soft); }
.status.late { color: var(--late); background: var(--late-soft); }
.count { color: var(--muted); font-size: 15px; margin: 10px 0 0; }

/* browse shelves */
.sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0 28px; margin-top: 8px; }
.section-link {
  display: flex; align-items: baseline; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--rule);
  text-decoration: none; color: var(--text); background: none; border-left: 0; border-right: 0; border-top: 0; cursor: pointer; text-align: left; width: 100%;
}
.section-link b { font-variant-numeric: tabular-nums; color: var(--ink); width: 2.6em; flex: none; }
.section-link span { flex: 1; }
.section-link em { font-style: normal; color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------- book detail ---------- */
.detail { display: grid; grid-template-columns: 200px 1fr; gap: 32px; align-items: start; }
.cover { width: 200px; aspect-ratio: 2/3; border-radius: 4px; object-fit: cover; background: var(--ink); box-shadow: 0 1px 0 var(--rule), 0 10px 24px -14px rgba(17, 39, 62, .55); }
.cover.made { display: flex; flex-direction: column; justify-content: space-between; padding: 18px 16px; color: #fff; font-family: var(--title); }
.cover.made .t { font-size: 19px; line-height: 1.25; font-weight: 600; }
.cover.made .a { font-family: var(--ui); font-size: 14px; color: var(--gold); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 18px 0; font-size: 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.findit { display: flex; gap: 20px; align-items: center; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 18px; margin: 16px 0; }
.findit .where { font-size: 20px; color: var(--ink); font-weight: 700; }
@media (max-width: 640px) {
  .detail { grid-template-columns: 1fr; gap: 18px; }
  .cover { width: 120px; }
  .cover.made { display: none; }
  .top { flex-wrap: nowrap; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .brand { font-size: 18px; }
  .brand small { font-size: 13px; }
  .nav a { font-size: 14px; padding: 6px 10px; }
  .row .title { font-size: 18px; }
  .row { gap: 12px; }
}

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid var(--ink); background: var(--ink); color: #fff; border-radius: var(--radius-s);
  padding: 10px 18px; font-weight: 700; font-size: 17px; cursor: pointer; text-decoration: none; min-height: 48px;
}
.btn.secondary { background: var(--card); color: var(--ink); }
.btn.quiet { background: none; border-color: transparent; color: var(--ink); padding: 10px 12px; }
.btn.danger { background: var(--card); color: var(--late); border-color: var(--late); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--ink-deep); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: 15px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 15px; color: var(--muted); margin-bottom: 4px; }
input.text, select.text, textarea.text {
  width: 100%; border: 1.5px solid #c9c4b8; border-radius: var(--radius-s); background: var(--card); padding: 10px 12px; font-size: 17px;
}
textarea.text { min-height: 80px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 14px; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.note { background: var(--gold-soft); border-radius: var(--radius-s); padding: 12px 14px; font-size: 16px; margin: 12px 0; }
.error { background: var(--late-soft); color: var(--late); border-radius: var(--radius-s); padding: 12px 14px; font-size: 16px; margin: 12px 0; }
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 20px; margin-bottom: 20px; }

/* ---------- tables (admin) ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 16px; }
.table th { text-align: left; font-weight: 700; color: var(--muted); font-size: 14px; padding: 8px 10px; border-bottom: 2px solid var(--rule); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tr.late td { background: #fdf3f1; }
.table .t { font-family: var(--title); font-weight: 600; color: var(--ink); }
.table a.t { text-decoration: none; }
.summary { display: flex; gap: 28px; flex-wrap: wrap; margin: 4px 0 18px; font-size: 17px; }
.summary b { font-size: 28px; color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 6px; }
.summary .late b { color: var(--late); }
@media (max-width: 760px) {
  .table.stack thead { display: none; }
  .table.stack tr { display: block; border-bottom: 1px solid var(--rule); padding: 10px 0; }
  .table.stack td { display: block; border: 0; padding: 2px 4px; }
}
.badge { display: inline-block; font-size: 13px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--rule); color: var(--muted); white-space: nowrap; }
.badge.verified { color: var(--in); border-color: #b7d6c4; }
.badge.check { color: var(--out); border-color: #e3caa0; }

/* ---------- station ---------- */
body.station { background: #f3f1ec; }
.station-home { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 12px; }
.bigbtn {
  border: 0; border-radius: 18px; padding: 34px 28px; text-align: left; cursor: pointer; min-height: 210px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; color: #fff; background: var(--ink);
}
.bigbtn.ret { background: var(--card); color: var(--ink); border: 3px solid var(--ink); }
.bigbtn strong { font-family: var(--title); font-size: 40px; font-weight: 600; line-height: 1.1; }
.bigbtn span { font-size: 19px; opacity: .85; }
.scanbar { margin-top: 24px; }
.scanbar .hint { font-size: 16px; color: var(--muted); margin-top: 8px; }
.flow { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .flow, .station-home { grid-template-columns: 1fr; } }
.step { background: var(--card); border-radius: var(--radius-m); border: 1px solid var(--rule); padding: 20px; }
.step h2 { display: flex; gap: 10px; align-items: baseline; }
.step h2 .n { font-family: var(--ui); font-size: 15px; color: #fff; background: var(--ink); border-radius: 50%; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; flex: none; position: relative; top: -3px; }
.picked { list-style: none; padding: 0; margin: 12px 0 0; }
.picked li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.picked li .main { flex: 1; min-width: 0; }
.names { max-height: 380px; overflow-y: auto; margin-top: 10px; border-top: 1px solid var(--rule); -webkit-overflow-scrolling: touch; }
.name {
  display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 15px 12px; border: 0; border-bottom: 1px solid var(--rule);
  background: none; font-size: 19px; text-align: left; cursor: pointer;
}
.name[aria-pressed="true"] { background: var(--ink); color: #fff; }
.name small { color: var(--muted); font-size: 14px; }
.name[aria-pressed="true"] small { color: #c9d4df; }
.confirmbar { position: sticky; bottom: 0; background: #f3f1ec; padding: 16px 0 calc(16px + env(safe-area-inset-bottom)); margin-top: 20px; display: flex; gap: 12px; }
.confirmbar .btn { flex: 1; min-height: 64px; font-size: 21px; }
.done { text-align: center; padding: 40px 16px; }
.done .big { font-family: var(--title); font-size: 44px; color: var(--ink); margin: 10px 0; line-height: 1.15; }
.done .due { font-size: 24px; }
.done .shelve { display: inline-flex; gap: 24px; align-items: center; text-align: left; margin: 24px auto; background: var(--card); border-radius: var(--radius-m); padding: 24px 28px; border: 1px solid var(--rule); }
.done .shelve .where { font-size: 26px; font-weight: 700; color: var(--ink); }
.timer { height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; max-width: 320px; margin: 24px auto 0; }
.timer i { display: block; height: 100%; background: var(--gold); transform-origin: left; animation: drain linear forwards; }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .timer i { animation: none; } }

/* ---------- login ---------- */
.gate { max-width: 440px; margin: 8vh auto 0; text-align: center; }
.gate .spine.huge { margin: 0 auto 24px; }
.gate input { text-align: center; font-size: 24px; letter-spacing: .08em; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink-deep); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 17px; z-index: 50; max-width: calc(100% - 32px);
}

/* ---------- labels (screen preview + print) ---------- */
.sheet { background: #fff; box-shadow: 0 2px 14px rgba(0,0,0,.12); width: 8.5in; height: 11in; position: relative; margin: 20px auto; transform-origin: top left; }
.sheet-wrap { overflow-x: auto; }
.lbl { position: absolute; overflow: hidden; display: flex; align-items: center; color: #000; font-family: var(--ui); }
.lbl.spine5167 { width: 1.75in; height: .5in; justify-content: center; gap: .12in; }
.lbl.spine5167 .cn { font: 700 12.5pt/1.02 var(--ui); text-align: center; white-space: nowrap; }
.lbl.spine5167 .cn.long { font-size: 10.5pt; }
.lbl.spine5167 .bc { font-size: 6pt; color: #444; writing-mode: vertical-rl; transform: rotate(180deg); }
.lbl.bar5160 { width: 2.625in; height: 1in; padding: .06in .12in; gap: .1in; }
.lbl.bar5160 .info { flex: 1; min-width: 0; font-size: 7.5pt; line-height: 1.2; }
.lbl.bar5160 .info .tt { font-weight: 700; font-size: 8pt; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lbl.bar5160 .info .lib { color: #444; font-size: 6.5pt; }
.lbl.bar5160 .info .cn { font-weight: 700; font-size: 9pt; margin-top: 2px; }
.lbl.bar5160 svg { width: 1.3in; height: .72in; flex: none; }
.sheet.guides .lbl { outline: 1px dashed #c9c4b8; }
@media print {
  @page { size: letter; margin: 0; }
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; }
  .sheet { box-shadow: none; margin: 0; page-break-after: always; break-after: page; transform: none !important; }
  .sheet.guides .lbl { outline: 0; }
}
