/* All Booked Up — card catalog aesthetic
   paper #FBFAF6 · ink #23251F · spine green #2E4A3D · stamp red #B33A2B · pencil #8B867A */

:root {
  --paper: #FBFAF6;
  --card: #FFFFFF;
  --ink: #23251F;
  --spine: #2E4A3D;
  --spine-dark: #223A30;
  --stamp: #B33A2B;
  --pencil: #8B867A;
  --rule: #E4E0D4;
  /* Height of one ruled row on a catalog card. Every line of text on a card
     is exactly this tall, so the words sit ON the rules instead of across
     them — change it here and the whole card re-aligns. */
  --rule-h: 28px;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --display: "Libre Caslon Display", Georgia, serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}

.hidden { display: none !important; }

.wordmark {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  color: var(--spine);
}

/* ---------- login ---------- */
.login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
}
.login .wordmark { font-size: 2.4rem; }
.login-sub { color: var(--pencil); }
.login-input {
  font-family: var(--mono);
  font-size: 1.4rem;
  text-align: center;
  letter-spacing: 0.3em;
  padding: 0.6em;
  border: 1px solid var(--rule);
  border-radius: 8px;
  width: min(280px, 80vw);
  background: var(--card);
}
.login-error { color: var(--stamp); font-size: 0.9rem; }

/* ---------- chrome ---------- */
.topbar {
  padding: calc(env(safe-area-inset-top) + 0.9rem) 1rem 0.6rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.statbar {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--pencil);
  text-align: right;
  line-height: 1.5;
  white-space: nowrap;
}
.statbar b { color: var(--spine); font-weight: 500; }

.tabs {
  display: flex;
  gap: 1.25rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--rule);
}
.tab {
  appearance: none;
  background: none;
  border: none;
  font-family: var(--body);
  font-size: 0.95rem;
  color: var(--pencil);
  padding: 0.6rem 0.1rem;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.tab.active { color: var(--spine); border-bottom-color: var(--spine); font-weight: 600; }
/* Share sits at the far end of the tab row without being a tab itself.
   The .btn-small sizing lives with the other button rules below — defined
   here it would lose to .btn on source order. */
.tabs .btn-small { margin-left: auto; align-self: center; }

.searchrow { padding: 0.75rem 1rem 0.25rem; }
.searchrow input {
  width: 100%;
  padding: 0.6em 0.9em;
  font-size: 1rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--card);
  font-family: var(--body);
}

/* ---------- genre filter ---------- */
.genrebar {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 1rem 0.1rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.genrebar::-webkit-scrollbar { display: none; }
.gchip {
  appearance: none;
  flex: 0 0 auto;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--pencil);
  font-family: var(--body);
  font-size: 0.82rem;
  padding: 0.35em 0.85em;
  cursor: pointer;
  white-space: nowrap;
}
.gchip.active {
  background: var(--spine);
  border-color: var(--spine);
  color: #fff;
  font-weight: 600;
}
.gcount {
  font-family: var(--mono);
  font-size: 0.72rem;
  opacity: 0.65;
  margin-left: 0.4em;
}

/* ---------- catalog cards ---------- */
.list { padding: 0.75rem 1rem 7.5rem; display: grid; gap: 0.75rem; }

.capped {
  font-size: 0.82rem;
  color: var(--pencil);
  background: var(--card);
  border: 1px dashed var(--rule);
  border-radius: 8px;
  padding: 0.6em 0.8em;
  text-align: center;
}

.empty {
  text-align: center;
  color: var(--pencil);
  padding: 3rem 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.card {
  position: relative;
  background:
    repeating-linear-gradient(
      to bottom,
      var(--card) 0px,
      var(--card) calc(var(--rule-h) - 1px),
      var(--rule) calc(var(--rule-h) - 1px),
      var(--rule) var(--rule-h)
    );
  border: 1px solid var(--rule);
  border-top: 3px solid var(--spine);
  border-radius: 6px;
  /* No vertical padding at all: the first line has to start at the top of the
     first ruled row or every rule below lands mid-sentence, and any leftover
     padding at the bottom leaves a stray half-ruled row under the last line. */
  padding: 0 0.9rem;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 0.8rem;
  align-items: start;
  cursor: pointer;
  overflow: hidden;
}
.card img, .card .no-cover {
  width: 52px;
  /* Three ruled rows tall, so the cover ends on a rule too. */
  height: calc(var(--rule-h) * 3);
  margin-top: 1px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.card .no-cover {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); color: var(--pencil); font-size: 1.4rem;
}
/* Every text row on a card is exactly one ruled row tall. Vertical margins
   would push the text off the rules, so there are none. */
.card h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: var(--rule-h);
}
.card .author { color: var(--pencil); font-size: 0.85rem; line-height: var(--rule-h); }
.card .genre-tag {
  display: inline-block;
  box-sizing: border-box;
  height: var(--rule-h);
  line-height: calc(var(--rule-h) - 10px);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--spine);
  background: rgba(46, 74, 61, 0.08);
  border: 1px solid rgba(46, 74, 61, 0.18);
  border-radius: 3px;
  padding: 4px 0.5em;
}
/* Genre and location sit on one ruled row so the card keeps its rhythm. */
.card .tag-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  height: var(--rule-h);
  flex-wrap: nowrap;
  overflow: hidden;
}
.card .loc-tag {
  display: inline-block;
  box-sizing: border-box;
  height: var(--rule-h);
  line-height: calc(var(--rule-h) - 10px);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: 3px;
  padding: 4px 0.5em;
  white-space: nowrap;
}
.card .loc-home {
  color: var(--pencil);
  background: rgba(139, 134, 122, 0.1);
  border: 1px solid rgba(139, 134, 122, 0.28);
}
.card .loc-booth {
  color: var(--stamp);
  background: rgba(179, 58, 43, 0.08);
  border: 1px solid rgba(179, 58, 43, 0.28);
}

.card .meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--pencil);
  line-height: var(--rule-h);
}
.card .prices {
  font-family: var(--mono);
  font-size: 0.8rem;
  text-align: right;
  line-height: var(--rule-h);
  white-space: nowrap;
}
.card .prices .paid { color: var(--pencil); }
.card .prices .est { color: var(--spine); font-weight: 500; }
.card .prices .sale { color: var(--stamp); font-weight: 500; }

.stamp {
  position: absolute;
  right: 8px;
  bottom: 10px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--stamp);
  border: 2px solid var(--stamp);
  border-radius: 4px;
  padding: 0.15em 0.5em;
  transform: rotate(-8deg);
  opacity: 0.85;
  pointer-events: none;
}

/* ---------- public library view ---------- */
/* The public page is a link she hands out, so it gets opened on laptops as
   well as phones — keep the column readable instead of full-window wide. */
.lib .topbar, .lib .searchrow, .lib .genrebar, .lib .locbar, .lib #locbar, .lib .letterbar,
.lib .lib-count, .lib .list, .lib .libfoot {
  max-width: 44rem;
  margin-inline: auto;
}

/* A–Z shelving row — the second way into a large shelf. */
.letterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.5rem 1rem 0.1rem;
}
.lchip {
  appearance: none;
  min-width: 2rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--spine);
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 0.3em 0.55em;
  cursor: pointer;
  /* Don't grow: with two letters on the shelf they'd stretch across the row. */
  flex: 0 0 auto;
  text-align: center;
}
.lchip.active { background: var(--spine); border-color: var(--spine); color: #fff; font-weight: 500; }

.lib-count {
  padding: 0.7rem 1rem 0.1rem;
  color: var(--pencil);
  font-size: 0.85rem;
  line-height: 1.5;
}
.lib-count b { color: var(--spine); font-weight: 600; }
.lib-top { flex-direction: column; align-items: flex-start; gap: 0.1rem; }
.lib-sub {
  font-family: var(--body);
  font-size: 0.9rem;
  color: var(--pencil);
}
.lib-list { padding-bottom: 1.5rem; }
/* Public cards carry cover + title + author only; details open on tap. Two
   columns and two ruled rows makes them roughly half the height of the
   catalog cards, so far more of the shelf fits on a phone screen. */
.card.lib-card { grid-template-columns: 52px 1fr; cursor: pointer; }
.card.lib-card:focus-visible { outline: 3px solid var(--spine); outline-offset: 2px; }
.card.lib-card img, .card.lib-card .no-cover { height: calc(var(--rule-h) * 2); }

/* ---------- detail bubble ---------- */
.detail-inner { max-width: 34rem; margin-inline: auto; border-radius: 16px 16px 0 0; }
.detail-head { display: flex; gap: 0.9rem; align-items: flex-start; margin-bottom: 0.9rem; }
.detail-cover {
  width: 84px;
  height: 124px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--rule);
  background: var(--paper);
  flex: 0 0 auto;
}
.detail-head h2 { font-family: var(--display); font-weight: 400; font-size: 1.3rem; line-height: 1.25; }
.detail-author { color: var(--pencil); font-size: 0.95rem; margin-top: 0.2rem; }
.detail-loading { color: var(--pencil); font-size: 0.9rem; padding: 1.5rem 0; text-align: center; }

.details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.9rem;
  font-size: 0.88rem;
  border-top: 1px solid var(--rule);
  padding-top: 0.8rem;
  margin-bottom: 0.9rem;
}
.details dt {
  color: var(--pencil);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  align-self: center;
}
.details dd { font-family: var(--mono); font-size: 0.82rem; }

.blurb {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink);
  border-top: 1px solid var(--rule);
  padding-top: 0.8rem;
  margin-bottom: 1rem;
}
.detail-close { width: 100%; }
.libfoot {
  border-top: 1px solid var(--rule);
  margin: 0.5rem 1rem calc(env(safe-area-inset-bottom) + 2rem);
  padding-top: 1rem;
  color: var(--pencil);
  font-size: 0.88rem;
  line-height: 1.6;
  text-align: center;
}

/* ---------- booth products ---------- */
.card.product-card { grid-template-columns: 52px 1fr; cursor: default; }
.card.product-card img, .card.product-card .no-cover { height: calc(var(--rule-h) * 3); }
.card .qty-on { color: var(--spine); font-weight: 600; }
.card .qty-out { color: var(--stamp); font-weight: 600; }
.prod-actions { display: flex; gap: 0.4rem; margin-top: 0.15rem; flex-wrap: wrap; }
.prod-actions .btn { padding: 0.3em 0.7em; }
.prod-actions .btn[disabled] { opacity: 0.45; pointer-events: none; }

.stepper { display: flex; align-items: stretch; gap: 0.5rem; }
.stepper input {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 1.1rem;
  padding: 0.5em;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--card);
}
.stepper .step {
  appearance: none;
  width: 3rem;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--spine);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  cursor: pointer;
}
.stepper .step:active { background: var(--paper); }

.photo-status { font-size: 0.8rem; color: var(--pencil); margin-top: 0.3rem; }

/* ---------- segmented toggle ---------- */
.seg { display: flex; gap: 0; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.seg-btn {
  appearance: none;
  flex: 1;
  padding: 0.6em 0.5em;
  font-family: var(--body);
  font-size: 0.95rem;
  color: var(--pencil);
  background: var(--card);
  border: none;
  border-right: 1px solid var(--rule);
  cursor: pointer;
}
.seg-btn:last-child { border-right: none; }
.seg-btn.active { background: var(--spine); color: #fff; font-weight: 600; }

/* Rotate mode's exit has to be unmissable with a stack of books in hand. */
#scan-done { flex: 1; font-size: 1.05rem; }
.field input[type="file"] { padding: 0.5em; font-size: 0.9rem; }

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.85em 1.2em;
  cursor: pointer;
}
.btn:focus-visible { outline: 3px solid var(--spine); outline-offset: 2px; }
.btn-primary { background: var(--spine); color: #fff; }
.btn-primary:active { background: var(--spine-dark); }
.btn-ghost { background: transparent; color: var(--spine); border: 1px solid var(--rule); background: var(--card); }
.btn-danger { background: transparent; color: var(--stamp); border: 1px solid var(--rule); }
.btn-stamp { background: var(--stamp); color: #fff; }
/* Must come after .btn — same specificity, so source order decides. */
.btn-small {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35em 0.85em;
  border-radius: 8px;
}

.fab-row {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 0.6rem;
  padding: 0.75rem 1rem calc(env(safe-area-inset-bottom) + 0.75rem);
  background: linear-gradient(to top, var(--paper) 70%, transparent);
}
.fab-row .btn-scan { flex: 1.6; font-size: 1.05rem; }
.fab-row .btn-ghost { flex: 1; }

/* ---------- scanner ---------- */
.scanner {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 40;
  display: flex;
  flex-direction: column;
}
.scanner video { flex: 1; width: 100%; object-fit: cover; }
.scan-frame {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  width: min(78vw, 340px);
  height: 120px;
  border: 3px solid #fff;
  border-radius: 10px;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,0.45);
  pointer-events: none;
}
.scan-hint {
  position: absolute;
  top: calc(30% + 135px);
  width: 100%;
  text-align: center;
  color: #fff;
  font-size: 0.9rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.scan-status {
  position: absolute;
  top: calc(30% + 165px);
  width: 100%;
  text-align: center;
  color: #fff;
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0 1rem;
  opacity: 0.9;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.scan-actions {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem calc(env(safe-area-inset-bottom) + 0.75rem);
  background: rgba(0,0,0,0.55);
}
.scan-actions input {
  flex: 1;
  min-width: 0;
  padding: 0.6em 0.8em;
  border-radius: 8px;
  border: none;
  font-family: var(--mono);
  font-size: 1rem;
}

/* ---------- sheet ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(35, 37, 31, 0.45);
  display: flex;
  align-items: flex-end;
}
.sheet-inner {
  background: var(--paper);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 0.5rem 1.1rem calc(env(safe-area-inset-bottom) + 1.1rem);
}
.sheet-grab {
  width: 44px; height: 4px;
  background: var(--rule);
  border-radius: 2px;
  margin: 0.5rem auto 0.9rem;
}
.sheet h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.35rem;
  margin-bottom: 0.2rem;
}
.sheet .sub { color: var(--pencil); font-size: 0.88rem; margin-bottom: 0.9rem; }
.sheet .est-line {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--spine);
  background: var(--card);
  border: 1px dashed var(--spine);
  border-radius: 8px;
  padding: 0.55em 0.8em;
  margin-bottom: 0.9rem;
}
.sheet-cover { display: flex; gap: 0.9rem; margin-bottom: 0.9rem; align-items: flex-start; }
.sheet-cover img { width: 68px; border-radius: 4px; border: 1px solid var(--rule); }

/* ---------- duplicate warning ---------- */
/* Full-bleed against the sheet's 1.1rem padding, so it spans edge to edge.
   The slight rotation is the rubber-stamp cue; the scale keeps the rotated
   corners covered instead of showing paper through them. */
.dupe-banner {
  margin: 0 -1.1rem 1rem;
  padding: 0.8em 1.2rem;
  background: var(--stamp);
  color: #fff;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.4;
  transform: rotate(-1.2deg) scale(1.03);
  border-top: 2px solid rgba(255, 255, 255, 0.45);
  border-bottom: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 2px 10px rgba(179, 58, 43, 0.35);
}

.dupe-copies {
  list-style: none;
  margin: 0 0 1rem;
  border: 1px dashed var(--stamp);
  border-radius: 8px;
  background: rgba(179, 58, 43, 0.05);
  padding: 0.5rem 0.7rem;
}
.dupe-copies li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink);
  padding: 0.25rem 0;
}
.dupe-copies li + li { border-top: 1px solid rgba(179, 58, 43, 0.18); }
/* The location pill is styled for catalog cards; inside the list it needs to
   sit on the text baseline rather than a 28px ruled row. */
.dupe-copies .loc-tag {
  display: inline-block;
  height: auto;
  line-height: 1.4;
  padding: 2px 0.45em;
  font-size: 0.65rem;
  border-radius: 3px;
  flex: 0 0 auto;
}
.dupe-copies .loc-home {
  color: var(--pencil);
  background: rgba(139, 134, 122, 0.12);
  border: 1px solid rgba(139, 134, 122, 0.3);
}
.dupe-copies .loc-booth {
  color: var(--stamp);
  background: rgba(179, 58, 43, 0.1);
  border: 1px solid rgba(179, 58, 43, 0.35);
}

.field { margin-bottom: 0.85rem; }
.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--pencil);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.65em 0.8em;
  font-size: 1rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--card);
  font-family: var(--body);
}
.field input[inputmode="decimal"], .field input[inputmode="numeric"] { font-family: var(--mono); }
.field-row { display: flex; gap: 0.7rem; }
.field-row .field { flex: 1; }

.sheet-actions { display: flex; gap: 0.6rem; margin-top: 0.4rem; }
.sheet-actions .btn { flex: 1; }

.profit-line {
  font-family: var(--mono);
  font-size: 0.85rem;
  margin: -0.2rem 0 0.8rem;
  color: var(--pencil);
}
.profit-line b { color: var(--spine); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + 6rem);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.6em 1.1em;
  border-radius: 14px;
  z-index: 60;
  /* Wraps: the UPC message is a full sentence and would otherwise run off
     the side of a phone screen. */
  max-width: min(88vw, 30rem);
  text-align: center;
  line-height: 1.45;
}

@media (prefers-reduced-motion: no-preference) {
  .sheet-inner { animation: slideup 0.22s ease-out; }
  @keyframes slideup { from { transform: translateY(30px); opacity: 0.6; } to { transform: none; opacity: 1; } }
}

/* ---------- report ---------- */
.rep-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: calc(env(safe-area-inset-top) + 1rem) 1rem 0.5rem;
  max-width: 52rem;
  margin-inline: auto;
}
.rep-sub { color: var(--pencil); font-size: 0.95rem; margin-top: 0.15rem; }
.rep-printed { color: var(--pencil); font-size: 0.78rem; font-family: var(--mono); text-align: right; }

.rep-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem 0.9rem;
  max-width: 52rem;
  margin-inline: auto;
  border-bottom: 1px solid var(--rule);
}
.rep-controls label { font-size: 0.8rem; color: var(--pencil); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.rep-controls select {
  font-family: var(--body);
  font-size: 1rem;
  padding: 0.45em 0.6em;
  margin-left: 0.35rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--card);
}
.rep-back { margin-left: auto; color: var(--spine); font-size: 0.88rem; text-decoration: none; }

.rep-body { max-width: 52rem; margin-inline: auto; padding: 1rem 1rem 4rem; }
.rep-table { width: 100%; border-collapse: collapse; margin-bottom: 1.8rem; }
.rep-table caption {
  text-align: left;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--spine);
  padding-bottom: 0.5rem;
}
.rep-table th, .rep-table td {
  text-align: left;
  padding: 0.5em 0.6em;
  border-bottom: 1px solid var(--rule);
  font-size: 0.92rem;
}
.rep-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pencil);
  border-bottom: 2px solid var(--rule);
}
.rep-table .num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.rep-table tbody th { font-weight: 600; }
.rep-total th, .rep-total td { border-top: 2px solid var(--spine); border-bottom: none; font-weight: 700; color: var(--spine); }
.rep-none { color: var(--pencil); text-align: center; padding: 1.5rem 0; font-size: 0.92rem; }
.rep-note { color: var(--pencil); font-size: 0.78rem; line-height: 1.5; border-top: 1px solid var(--rule); padding-top: 0.8rem; }
.statlink { color: var(--spine); text-decoration: underline; font-family: var(--body); }

/* One sheet of paper for the accountant: no chrome, no colour, tight type. */
@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; color: #000 !important; }
  .no-print, .toast, #login { display: none !important; }
  .rep-head, .rep-controls, .rep-body { max-width: none; padding: 0; margin: 0; border: none; }
  .rep-head { margin-bottom: 8pt; }
  .wordmark, .rep-table caption, .rep-total th, .rep-total td { color: #000 !important; }
  .wordmark { font-size: 16pt; }
  .rep-sub, .rep-printed, .rep-note, .rep-table thead th { color: #333 !important; }
  .rep-body { padding-top: 6pt; }
  .rep-table { margin-bottom: 12pt; page-break-inside: avoid; }
  .rep-table th, .rep-table td { padding: 2pt 4pt; font-size: 9pt; border-bottom: 0.5pt solid #999; }
  .rep-table caption { font-size: 11pt; padding-bottom: 2pt; }
  .rep-total th, .rep-total td { border-top: 1pt solid #000; }
  .rep-note { font-size: 7.5pt; padding-top: 4pt; }
}
