:root {
  --ink: #1f2933;
  --muted: #5f6b7a;
  --line: #d9dee5;
  --card: #ffffff;
  --page: #f4f6f9;
  --brand: #0066cc;
  --ok: #1a7f37;
  --bad: #b3261e;
  --note-bg: #fff8e1;
  --note-ink: #6b4e00;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6e9ee;
    --muted: #9aa5b4;
    --line: #333c48;
    --card: #1b222c;
    --page: #11161d;
    --brand: #4c9bff;
    --ok: #4ac26b;
    --bad: #ff8a80;
    --note-bg: #2a2410;
    --note-ink: #f2d88a;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.slip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 16px;
}

.brand {
  display: block;
  margin: 0 auto 12px auto;
  width: 140px;
  height: auto;
}

.store {
  text-align: center;
  margin: 0 0 16px 0;
}

.store h1 {
  margin: 0;
  font-size: 20px;
}

.store p {
  margin: 2px 0;
  color: var(--muted);
}

.title {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px 0;
}

.meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  margin: 0 0 8px 0;
}

.meta dt {
  color: var(--muted);
}

.meta dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

section h2 {
  margin: 18px 0 6px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  text-align: center;
}

section h3 {
  margin: 10px 0 2px 0;
  font-size: 14px;
}

.rows {
  width: 100%;
  border-collapse: collapse;
}

.rows th,
.rows td {
  padding: 3px 0;
  font-weight: normal;
  text-align: left;
}

.rows td {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rows tr.total th,
.rows tr.total td {
  border-top: 1px solid var(--line);
  font-weight: 700;
  padding-top: 6px;
}

.fine {
  color: var(--muted);
  font-size: 13px;
  margin: 2px 0 0 0;
}

.drawer-result th,
.drawer-result td {
  font-size: 17px;
  font-weight: 700;
}

.drawer-result.short td {
  color: var(--bad);
}

.drawer-result.over td {
  color: var(--ok);
}

.note {
  margin: 18px 0 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--note-bg);
  color: var(--note-ink);
  font-size: 13px;
}

.note ul {
  margin: 4px 0 0 0;
  padding-left: 18px;
}

.status {
  text-align: center;
  color: var(--muted);
  padding: 32px 0;
}

.status.error {
  color: var(--bad);
}

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 12px 0 24px 0;
}

.rows.grid td {
  width: 4.5em;
}

.rows tr.off th,
.rows tr.off td,
.off-note {
  color: var(--bad);
  font-weight: 600;
}

@media print {
  body {
    background: #fff;
  }

  .slip {
    border: none;
  }
}

/* Hold receipt: held-until banner, countdown, the hold's QR code, and the expired state. */
.hold-state {
  margin: 16px 0;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
}

.hold-state.expired {
  border-color: var(--bad);
}

.hold-headline {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.hold-state.expired .hold-headline {
  color: var(--bad);
}

.countdown {
  margin: 4px 0 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.qr {
  display: inline-block;
  margin-bottom: 16px;
  padding: 0;
  background: #ffffff;
  border-radius: 6px;
}

.qr svg {
  display: block;
  width: min(240px, 70vw);
  height: auto;
}

.qr-label {
  margin: 6px 0 8px;
  color: #1f2933;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

/* The DBA's logo on its own background, at the top of a staff slip when the DBA has branding set up. */
.dba-band {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: -20px -16px 16px -16px;
  padding: 16px;
  border-radius: 10px 10px 0 0;
  background: var(--page);
}

.dba-logo {
  display: block;
  max-width: 200px;
  max-height: 96px;
  width: auto;
  height: auto;
}

/* A QR code of the page's own address, at the bottom of a staff slip. */
.page-qr {
  margin: 20px 0 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.page-qr .qr {
  margin-bottom: 8px;
}

.page-qr .qr svg {
  width: min(200px, 60vw);
}

/* The slip number as the barcode the printed slip carries, so a page open on a phone can be scanned at the register. */
.register-code {
  margin: 20px 0 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.register-code-label {
  margin: 0 0 8px 0;
  font-weight: 700;
}

.barcode {
  display: inline-block;
  width: 100%;
  max-width: 420px;
  padding: 12px 0 8px 0;
  background: #ffffff;
  border-radius: 6px;
}

.barcode svg {
  display: block;
  width: 100%;
  height: 96px;
}

.barcode-number {
  margin: 6px 0 0 0;
  color: #1f2933;
  font-size: 15px;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
