/* The Guest Check — Debt Lists.
   A diner ticket rail and carbonless guest-check pad.
   Not a typographic ledger, not a cutting table, not a survey plat,
   not a clipboard, and not a savings passbook. */

:root {
  --counter: #1c1f27;
  --counter-edge: #14161c;
  --fleck: rgba(243, 237, 196, 0.06);
  --check: #e8f2ea;
  --check-shadow: #cfdcd1;
  --canary: #f3edc4;
  --peach: #f6d5c4;
  --policy: #f7efe4;
  --ink: #141820;
  --mute: #3d4553;
  --faintline: #5a6473;
  --rule: #3a6ea5;
  --rule-deep: #1f4f80;
  --vermilion: #b32616;
  --vermilion-deep: #8c1c10;
  --brass: #c9a227;
  --steel: #8b93a1;
  --steel-dark: #5c6573;
  --totalbox: #142033;
  --focus: #1f4f80;
  --display: "Big Shoulders Display", "Arial Narrow", "Impact", sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", "Helvetica Neue", sans-serif;
  --figures: "Red Hat Mono", "ui-monospace", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body.countertop {
  background:
    radial-gradient(ellipse at 80% -10%, rgba(201, 162, 39, 0.08), transparent 42%),
    radial-gradient(circle at 12% 88%, rgba(58, 110, 165, 0.09), transparent 36%),
    repeating-linear-gradient(90deg, transparent 0 11px, var(--fleck) 11px 12px),
    repeating-linear-gradient(0deg, transparent 0 13px, rgba(255,255,255,0.02) 13px 14px),
    var(--counter);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rule-deep); text-underline-offset: 0.16em; text-decoration-thickness: 1px; }
a:hover { color: var(--vermilion-deep); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.hop {
  position: absolute;
  left: 1rem;
  top: -3.6rem;
  background: var(--canary);
  color: var(--ink);
  padding: 0.45rem 0.75rem;
  z-index: 40;
  font-family: var(--figures);
  font-size: 0.85rem;
  text-decoration: none;
  border: 2px solid var(--ink);
}
.hop:focus { top: 0.6rem; }

/* Chrome ticket rail across the top, tickets hanging down — not a header bar, not a spine, not a tray */
.cliprail {
  position: sticky;
  top: 0;
  z-index: 25;
  background:
    linear-gradient(180deg, #d5dae2 0%, var(--steel) 38%, #6f7784 52%, var(--steel) 100%);
  border-bottom: 3px solid var(--counter-edge);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  padding: 0.35rem 0.6rem 0 0.6rem;
  min-height: 4.6rem;
}
.cliprail-inner {
  width: min(74rem, 100%);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  position: relative;
}
.cliprail-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0.55rem;
  height: 0.28rem;
  background: linear-gradient(180deg, #e8ecf1, #6a7380);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.5), 0 2px 0 #3a4048;
  pointer-events: none;
}
.imprint {
  text-decoration: none;
  color: var(--ink);
  background: var(--check);
  border: 2px solid var(--ink);
  padding: 1.15rem 0.7rem 0.45rem;
  min-width: 8.2rem;
  margin-top: 0.9rem;
  position: relative;
  box-shadow: 2px 3px 0 rgba(0,0,0,0.25);
  transform: rotate(-1.2deg);
}
.imprint::before,
.stub::before {
  content: "";
  position: absolute;
  top: 0.42rem;
  left: 50%;
  width: 0.7rem;
  height: 0.7rem;
  margin-left: -0.35rem;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 0.16rem, var(--ink) 0.16rem 0.22rem, transparent 0.23rem),
    var(--steel-dark);
  border-radius: 50%;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.4);
  z-index: 2;
}
.imprint-name {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  line-height: 0.85;
  text-transform: uppercase;
}
.imprint-sub {
  display: block;
  font-family: var(--figures);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--vermilion);
  margin-top: 0.2rem;
}
.stub {
  text-decoration: none;
  color: var(--ink);
  background: var(--check);
  border: 2px solid var(--ink);
  border-top-width: 2px;
  padding: 1.15rem 0.55rem 0.4rem;
  min-width: 6.2rem;
  margin-top: 0.9rem;
  position: relative;
  box-shadow: 2px 3px 0 rgba(0,0,0,0.2);
  flex: 1 1 6rem;
  text-align: left;
}
.stub:nth-of-type(2) { transform: rotate(0.8deg); background: var(--canary); }
.stub:nth-of-type(3) { transform: rotate(-0.6deg); }
.stub:nth-of-type(4) { transform: rotate(1deg); background: #eef6f0; }
.stub:nth-of-type(5) { transform: rotate(-0.4deg); background: var(--policy); }
.stubno {
  display: block;
  font-family: var(--figures);
  color: var(--vermilion);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}
.stublabel {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 0.15rem;
}
.stub:hover,
.imprint:hover {
  transform: translateY(-3px) rotate(0deg);
  z-index: 2;
}
.stub[aria-current="page"] {
  outline: 3px solid var(--brass);
  outline-offset: -1px;
  z-index: 2;
}

.shift {
  width: min(74rem, calc(100% - 1.6rem));
  margin: 1.25rem auto 2.5rem;
}

/* The guest-check surface */
.checkpad {
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 1.7rem,
      rgba(58, 110, 165, 0.22) 1.7rem,
      rgba(58, 110, 165, 0.22) calc(1.7rem + 1px)
    ),
    var(--check);
  border: 2px solid var(--ink);
  box-shadow:
    8px 10px 0 rgba(0, 0, 0, 0.28),
    0 0 0 1px var(--check-shadow) inset;
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  position: relative;
}
.checkpad.is-canary {
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 1.7rem,
      rgba(58, 110, 165, 0.2) 1.7rem,
      rgba(58, 110, 165, 0.2) calc(1.7rem + 1px)
    ),
    var(--canary);
}
.checkpad.is-policy {
  background: var(--policy);
  grid-template-columns: 1fr;
}
.checkpad.is-voided {
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 1.7rem,
      rgba(179, 38, 22, 0.18) 1.7rem,
      rgba(179, 38, 22, 0.18) calc(1.7rem + 1px)
    ),
    #f6e8e4;
}

.perf {
  background:
    linear-gradient(90deg, #d7e5da, #c5d4c9);
  border-right: 2px dashed rgba(20, 24, 32, 0.55);
  position: relative;
  min-height: 100%;
}
.perf::before {
  content: "";
  position: absolute;
  inset: 0.4rem 0;
  background-image: radial-gradient(circle, var(--counter) 0 0.22rem, transparent 0.23rem);
  background-size: 100% 1.15rem;
  background-repeat: repeat-y;
  background-position: 50% 0;
  opacity: 0.9;
}
.is-policy .perf { display: none; }

.orderbody {
  padding: 1.15rem 1.35rem 2rem;
  min-width: 0;
}

.guesthead {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem 1.2rem;
  align-items: end;
  border-bottom: 3px double var(--ink);
  padding-bottom: 0.85rem;
  margin-bottom: 1.1rem;
}
.guesthead h1,
.kicker-display {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 0.85;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
}
.ticketmeta {
  font-family: var(--figures);
  font-size: 0.78rem;
  color: var(--vermilion);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: right;
}
.ticketmeta strong { display: block; color: var(--ink); font-size: 1.05rem; letter-spacing: 0; text-transform: none; }
.standline {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 1.15rem;
  max-width: 44rem;
}

.crumbtrail {
  font-family: var(--figures);
  font-size: 0.78rem;
  margin: 0 0 0.8rem;
  color: var(--mute);
}
.crumbtrail ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.4rem; }
.crumbtrail li:not(:last-child)::after { content: " /"; color: var(--faintline); }

.leadgraf { font-size: 1.15rem; margin: 0 0 1rem; max-width: 46rem; }
.orderbody h2 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 1.85rem;
  line-height: 1;
  margin: 1.6rem 0 0.6rem;
}
.orderbody h3 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1.25rem;
  margin: 1.25rem 0 0.4rem;
}
.orderbody p { margin: 0 0 0.95rem; max-width: 46rem; }
.orderbody ul, .orderbody ol { margin: 0 0 1rem; padding-left: 1.2rem; max-width: 46rem; }
.orderbody li { margin: 0 0 0.4rem; }

.cautionband {
  border-left: 4px solid var(--vermilion);
  padding: 0.55rem 0.8rem;
  background: rgba(179, 38, 22, 0.08);
  max-width: 46rem;
  margin: 0 0 1.1rem;
  font-size: 0.95rem;
}
.notebox {
  border: 2px solid var(--ink);
  padding: 0.7rem 0.85rem;
  background: rgba(255,255,255,0.45);
  max-width: 46rem;
  margin: 0 0 1.1rem;
}
.notebox strong { font-family: var(--display); letter-spacing: 0.04em; text-transform: uppercase; }

.pairgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
  gap: 0.85rem;
  margin: 0 0 1.3rem;
}
.hangticket {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: rgba(255,255,255,0.55);
  border: 2px solid var(--ink);
  padding: 0.85rem 0.9rem 1rem;
  box-shadow: 3px 4px 0 rgba(20, 24, 32, 0.12);
  min-height: 9rem;
}
.hangticket:hover { transform: translate(-2px, -2px); box-shadow: 5px 6px 0 rgba(20, 24, 32, 0.14); }
.hangticket .stubno { margin-bottom: 0.3rem; }
.hangticket h2, .hangticket h3 {
  font-family: var(--display);
  font-size: 1.55rem;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 0.95;
}
.hangticket p { margin: 0; font-size: 0.95rem; }
.hangticket.is-canary { background: var(--canary); }
.hangticket.is-peach { background: var(--peach); }

.tabtotal {
  margin: 1.4rem 0 0;
  background: var(--totalbox);
  color: #f3edc4;
  padding: 0.9rem 1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  font-family: var(--figures);
}
.tabtotal h2, .tabtotal .tablabel {
  font-family: var(--display);
  color: #fff;
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tabtotal p { margin: 0; max-width: none; color: #dce3ea; }
.tabfigure {
  font-size: 1.6rem;
  color: #fff;
  text-align: right;
}
.tabrows { grid-column: 1 / -1; display: grid; gap: 0.25rem; }
.tabrows div { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px dashed rgba(243,237,196,0.35); padding-top: 0.3rem; }

/* Worksheets */
.guestform {
  display: grid;
  gap: 0.85rem;
  margin: 0 0 1rem;
  max-width: 46rem;
}
.fieldrow {
  display: grid;
  gap: 0.25rem;
}
.fieldrow label, .choicepack legend {
  font-family: var(--figures);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.fieldrow input[type="text"],
.fieldrow input[type="number"],
.fieldrow input[type="email"],
.fieldrow input[type="month"],
.fieldrow select,
.fieldrow textarea {
  font: inherit;
  font-size: 1.05rem;
  padding: 0.5rem 0.6rem;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  width: 100%;
  max-width: 24rem;
}
.fieldrow textarea { max-width: 46rem; min-height: 6.5rem; }
.fieldhint { margin: 0; font-size: 0.9rem; color: var(--mute); max-width: 36rem; }
.choicepack {
  border: 2px solid var(--ink);
  padding: 0.7rem 0.8rem;
  background: rgba(255,255,255,0.4);
  display: grid;
  gap: 0.35rem;
  max-width: 46rem;
}
.choicepack label { display: flex; gap: 0.5rem; align-items: flex-start; }
.addline,
.ghostline {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  font-size: 1.05rem;
}
.addline {
  background: var(--totalbox);
  color: #fff;
}
.addline:hover { background: var(--vermilion-deep); }
.ghostline {
  background: transparent;
  color: var(--ink);
}
.ghostline:hover { background: rgba(20,24,32,0.08); }
.actionrow { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tallybox {
  border: 3px solid var(--ink);
  background: var(--totalbox);
  color: #eef2f6;
  padding: 1rem 1.05rem;
  margin: 0 0 1.2rem;
  max-width: 46rem;
}
.tallybox[tabindex="-1"]:focus { outline-color: var(--brass); }
.tallybox h2, .tallybox h3 {
  color: #fff;
  margin-top: 0;
}
.tallybox p, .tallybox li { color: #dce3ea; }
.tallybox .tabfigure { font-family: var(--figures); }
.tallygrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.7rem;
  margin: 0.4rem 0 0.8rem;
}
.tallycell strong {
  display: block;
  font-family: var(--figures);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 500;
}
.tallycell span {
  font-family: var(--figures);
  font-size: 1.25rem;
  color: #fff;
}
.notebox .tallycell strong { color: var(--vermilion-deep); }
.notebox .tallycell span { color: var(--ink); }

.linetable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
  margin: 0 0 1rem;
  background: rgba(255,255,255,0.4);
}
.linetable th, .linetable td {
  border: 1px solid rgba(20,24,32,0.35);
  padding: 0.4rem 0.5rem;
  text-align: left;
  vertical-align: top;
}
.linetable th {
  font-family: var(--figures);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(20,24,32,0.06);
}
.linetable input, .linetable select {
  font: inherit;
  width: 100%;
  min-width: 4.5rem;
  border: 1px solid var(--ink);
  padding: 0.3rem 0.35rem;
  background: #fff;
}
.linetable .numcol, .rightfig { text-align: right; font-family: var(--figures); }
.rowkill {
  font-family: var(--figures);
  font-size: 0.8rem;
  background: transparent;
  border: 1px solid var(--vermilion-deep);
  color: var(--vermilion-deep);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.tickpack { list-style: none; padding: 0; margin: 0 0 1rem; max-width: 46rem; }
.tickpack li {
  margin: 0 0 0.45rem;
  background: rgba(255,255,255,0.45);
  border: 1px solid rgba(20,24,32,0.25);
  padding: 0.45rem 0.6rem;
}
.tickpack label { display: flex; gap: 0.55rem; align-items: flex-start; }

.faqblock { max-width: 46rem; }
.faqblock details {
  border-bottom: 1px solid rgba(20,24,32,0.25);
  padding: 0.55rem 0;
}
.faqblock summary {
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}
.termlist { max-width: 46rem; }
.termlist dt {
  font-family: var(--display);
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 1rem;
}
.termlist dd { margin: 0.25rem 0 0.7rem; }

.voidband {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(4rem, 18vw, 9rem);
  line-height: 0.8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(179, 38, 22, 0.22);
  text-align: center;
  margin: 0.4rem 0 0.8rem;
  pointer-events: none;
}

.colophonline {
  width: min(74rem, calc(100% - 1.6rem));
  margin: 0 auto 2.2rem;
  color: #d7dbe3;
  font-family: var(--figures);
  font-size: 0.82rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  align-items: baseline;
}
.colophonline a { color: var(--canary); }
.colophonline a:hover { color: #fff; }
.soldsign { letter-spacing: 0.04em; }

.sitefine {
  width: min(74rem, calc(100% - 1.6rem));
  margin: -1.4rem auto 2.4rem;
  color: #c9d0d8;
  font-size: 0.88rem;
  max-width: 52rem;
}

@media (max-width: 720px) {
  .cliprail { position: relative; min-height: 0; padding-bottom: 0.35rem; }
  .cliprail-inner { flex-wrap: wrap; align-items: stretch; }
  .imprint, .stub {
    margin-top: 1rem;
    min-width: calc(50% - 0.6rem);
    flex: 1 1 calc(50% - 0.6rem);
    padding-top: 1.05rem;
    transform: none;
  }
  .checkpad { grid-template-columns: 1.5rem 1fr; }
  .orderbody { padding: 1rem 0.85rem 1.4rem; }
  .guesthead { grid-template-columns: 1fr; }
  .ticketmeta { text-align: left; }
  .guesthead h1, .kicker-display { font-size: clamp(2rem, 12vw, 3.2rem); }
  .fieldrow input, .fieldrow select { max-width: none; }
  .linetable { display: block; overflow-x: auto; }
}
@media (max-width: 420px) {
  .shift, .colophonline, .sitefine { width: calc(100% - 1rem); }
  .imprint, .stub { min-width: calc(50% - 0.5rem); flex: 1 1 calc(50% - 0.5rem); }
  .stublabel { font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stub, .imprint, .hangticket { transition: none; }
  .stub:hover, .imprint:hover, .hangticket:hover { transform: none; }
}

@media print {
  body.countertop { background: #fff; }
  .cliprail, .colophonline, .sitefine, .hop, .addline, .ghostline, .rowkill { display: none !important; }
  .checkpad { box-shadow: none; }
  .shift { width: auto; margin: 0; }
  a { color: #000; text-decoration: none; }
}
