:root {
  color-scheme: light;
  --paper: #fbfbf4;
  --receipt: #f8fff9;
  --receipt-bottom: #fff9fb;
  --check-green: #c4e8dc;
  --ink: #263f84;
  --muted: #49609b;
  --red: #d95858;
  --line: rgba(38, 63, 132, 0.78);
  --line-soft: rgba(38, 63, 132, 0.42);
  --error: #b1243a;
  --success: #1b6f54;
  font-family: "Courier New", Courier, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background: #ffffff;
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100dvh;
  padding: max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  display: grid;
  place-items: start center;
}

.guest-check {
  --check-padding-inline: 18px;
  --check-padding-top: 40px;
  width: 430px;
  max-width: 100%;
  min-height: 850px;
  padding: var(--check-padding-top) var(--check-padding-inline) 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 18%),
    linear-gradient(180deg, var(--paper), var(--receipt) 68%, var(--receipt-bottom));
  border: 1px solid rgba(38, 63, 132, 0.18);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}

.check-header {
  text-align: center;
}

[hidden] {
  display: none !important;
}

.guest-check--gate {
  min-height: 0;
  padding-bottom: 36px;
}

.gate-body {
  margin-top: 10px;
}

.gate-copy {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.94rem;
  text-align: center;
}

.restaurant-name {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.85rem, 15.5vw, 3.8rem);
  line-height: 0.86;
  color: var(--ink);
  white-space: nowrap;
}

.check-meta {
  display: grid;
  grid-template-columns: 0.75fr 0.75fr 0.8fr 1.35fr;
  border: 1px solid var(--line);
}

.check-meta div,
.check-meta strong {
  min-height: 48px;
  border-left: 1px solid var(--line);
}

.check-meta div {
  padding: 3px 6px;
}

.check-meta div:first-child {
  border-left: 0;
}

.check-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

.check-meta b {
  display: block;
  color: var(--ink);
  font-family: "Shadows Into Light", "Segoe Print", "Bradley Hand", cursive;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  text-shadow:
    0.4px 0 0 currentColor,
    -0.4px 0 0 currentColor;
}

.check-meta strong {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 6px 1px;
  color: var(--red);
  font-family: "Courier New", Courier, monospace;
  font-size: 1.98rem;
  font-weight: 400;
  line-height: 1;
  text-align: center;
}

.category-strip {
  padding: 5px 8px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: clamp(0.53rem, 2.5vw, 0.72rem);
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
}

.line-table {
  position: relative;
}

.line-table::before {
  content: "";
  position: absolute;
  top: -1px;
  bottom: 0;
  left: calc(-1 * var(--check-padding-inline));
  right: calc(-1 * var(--check-padding-inline));
  background: var(--check-green);
  clip-path: polygon(
    0 0,
    var(--check-padding-inline) 0,
    var(--check-padding-inline) 1px,
    calc(100% - var(--check-padding-inline)) 1px,
    calc(100% - var(--check-padding-inline)) 0,
    100% 0,
    100% 100%,
    0 100%
  );
  z-index: 0;
}

.line-table::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  pointer-events: none;
  z-index: 2;
}

.line-table > * {
  position: relative;
  z-index: 1;
}

.line-item,
.blank-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px 72px;
  border-bottom: 1px solid var(--line-soft);
}

.line-item > *,
.blank-line::before,
.blank-line::after {
  border-left: 1px solid var(--line);
}

.line-item > *:first-child {
  border-left: 0;
}

.line-item div {
  min-height: 74px;
  padding: 9px 10px 8px;
}

.line-item h2 {
  margin-bottom: 3px;
  font-size: 1rem;
  font-weight: 800;
}

.line-item p,
.promo-message {
  color: var(--muted);
  line-height: 1.35;
}

.line-item p {
  margin-bottom: 0;
  font-size: 0.82rem;
}

.line-item span,
.line-item strong {
  display: flex;
  align-items: center;
  justify-content: center;
}

.line-item span {
  min-height: 74px;
  padding: 10px 5px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
}

.line-item strong,
.totals dd {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
}

.line-item strong {
  min-height: 74px;
  padding: 10px 5px;
}

.blank-line {
  min-height: 40px;
}

.blank-line::before,
.blank-line::after {
  content: "";
  grid-column: 2;
}

.blank-line::after {
  grid-column: 3;
}

.totals {
  margin: 0;
}

.totals div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px 72px;
  min-height: 40px;
  border-bottom: 1px solid var(--line);
}

.totals dt,
.totals dd {
  margin: 0;
  padding: 0 8px;
  font-weight: 800;
  display: flex;
  align-items: center;
  align-self: stretch;
}

.totals dt {
  grid-column: 1 / span 2;
  justify-content: flex-end;
}

.totals dd {
  grid-column: 3;
  border-left: 1px solid var(--line);
  justify-content: center;
  padding: 1px 8px 0;
}

.receipt-footer {
  padding-top: 10px;
}

.promo-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.94rem;
  font-weight: 800;
}

.promo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.promo-row input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.promo-row input:focus {
  outline: none;
}

.promo-row input:disabled {
  color: #b5b5b5;
  background: rgba(255, 255, 255, 0.72);
  border-color: #d8d8d8;
  cursor: not-allowed;
}

.promo-row button,
.checkout-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: #ffffff;
  background: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.promo-row button {
  width: auto;
  padding: 0 14px;
}

.promo-message {
  min-height: 20px;
  margin: 8px 0 0;
  font-size: 0.86rem;
}

.promo-message.error {
  color: var(--error);
}

.promo-message.success {
  color: var(--success);
}

.tear-line {
  margin: 14px calc(-1 * var(--check-padding-inline)) 12px;
  height: 1px;
  background-image: repeating-linear-gradient(
    to right,
    #c9ccc4 0,
    #c9ccc4 14px,
    transparent 14px,
    transparent 20px
  );
}

.promo-row button:disabled,
.checkout-button:disabled {
  color: #b5b5b5;
  background: #ececec;
  border-color: #d8d8d8;
  cursor: not-allowed;
  opacity: 1;
}

.checkout-button {
  width: 100%;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.call-confirmation {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(430px, 100%);
  flex: 1;
  min-height: 0;
  padding: 0 20px;
}

.page-shell--confirmation,
.page-shell--checkout {
  padding-top: max(20px, calc(env(safe-area-inset-top, 0px) + 12px));
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
}

.page-shell--confirmation {
  place-items: stretch center;
}

.page-shell--checkout {
  place-items: start center;
}

@media (max-width: 540px) {
  .page-shell--checkout {
    padding-left: max(8px, env(safe-area-inset-left, 0px));
    padding-right: max(8px, env(safe-area-inset-right, 0px));
  }

  .guest-check {
    --check-padding-inline: 14px;
    --check-padding-top: 36px;
    width: 100%;
  }

  .line-item h2 {
    font-size: 1.05rem;
  }

  .line-item p {
    font-size: 0.86rem;
  }

  .promo-form label {
    font-size: 1rem;
  }
}

@media (min-width: 541px) {
  .page-shell--checkout {
    place-items: center;
  }

  .wait-panel .service-note {
    max-width: 32ch;
    font-size: 1rem;
  }
}

.call-confirmation__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 32px;
  width: 100%;
  padding: 12px 0 20px;
}

.call-strip {
  width: 100%;
  padding: 0 18px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 18%),
    linear-gradient(180deg, var(--paper), var(--receipt) 68%, var(--receipt-bottom));
  border: 1px solid rgba(38, 63, 132, 0.18);
  border-top: none;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}

.call-strip__tear {
  margin: 0 -18px 12px;
}

.tear-rag {
  height: 9px;
  background: linear-gradient(180deg, var(--paper), var(--receipt));
  clip-path: polygon(
    0% 100%,
    2.5% 42%,
    5% 100%,
    7.5% 48%,
    10% 100%,
    12.5% 38%,
    15% 100%,
    17.5% 52%,
    20% 100%,
    22.5% 44%,
    25% 100%,
    27.5% 50%,
    30% 100%,
    32.5% 40%,
    35% 100%,
    37.5% 54%,
    40% 100%,
    42.5% 46%,
    45% 100%,
    47.5% 50%,
    50% 100%,
    52.5% 38%,
    55% 100%,
    57.5% 52%,
    60% 100%,
    62.5% 44%,
    65% 100%,
    67.5% 50%,
    70% 100%,
    72.5% 40%,
    75% 100%,
    77.5% 54%,
    80% 100%,
    82.5% 46%,
    85% 100%,
    87.5% 48%,
    90% 100%,
    92.5% 38%,
    95% 100%,
    97.5% 52%,
    100% 100%
  );
}

.tear-line--strip {
  margin: 0;
}

.call-strip .check-meta {
  grid-template-columns: 0.85fr 1.15fr 1.35fr;
}

.call-strip .check-meta div,
.call-strip .check-meta strong {
  min-height: 52px;
}

.call-strip .check-meta b {
  font-size: clamp(1.55rem, 7.5vw, 1.85rem);
  line-height: 1;
}

.wait-panel {
  width: 100%;
  text-align: center;
}

.wait-lead {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}

.wait-panel .service-note {
  margin: 0 auto;
  max-width: 28ch;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.wait-panel .got-order-prompt {
  margin: 22px 0 0;
}

.got-order-prompt {
  margin: 0;
  text-align: center;
}

.got-order-link {
  display: inline-block;
  padding: 6px 2px;
  border: none;
  background: none;
  color: var(--line-soft);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-decoration: underline;
  text-decoration-color: rgba(38, 63, 132, 0.22);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

.got-order-link:hover,
.got-order-link:focus-visible {
  color: var(--muted);
  text-decoration-color: rgba(73, 96, 155, 0.45);
  outline: none;
}

.settle-panel {
  width: 100%;
  margin-top: 4px;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.settle-panel[hidden] {
  display: none;
}

.settle-form {
  width: min(100%, 248px);
  margin-top: 0;
}

.settle-form .promo-message {
  text-align: center;
}

.brand-footer {
  flex-shrink: 0;
  padding-bottom: max(4px, env(safe-area-inset-bottom, 0px));
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.thermal-receipt-body {
  margin: 0;
  padding: 8px 0;
  color: #2a2a2a;
  background: #ffffff;
  font-family: "Roboto Condensed", "Arial Narrow", "Franklin Gothic Medium", Arial, sans-serif;
  font-size: 12px;
  font-stretch: condensed;
  line-height: 1.35;
}

.thermal-receipt {
  width: 72mm;
  max-width: 100%;
  margin: 0 auto;
  padding: 5mm 4mm 4mm;
  font-variant-numeric: tabular-nums;
}

.thermal-receipt p {
  margin: 0;
}

.thermal-receipt__header {
  margin-bottom: 14px;
  text-align: center;
  line-height: 1.3;
}

.thermal-receipt__name {
  margin-bottom: 0;
  padding-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.thermal-receipt__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.thermal-receipt__meta-col {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.thermal-receipt__meta-col--right {
  text-align: right;
}

.thermal-receipt__ledger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px;
  row-gap: 8px;
  margin-bottom: 14px;
}

.thermal-receipt__ledger-gap {
  grid-column: 1 / -1;
  height: 6px;
}

.thermal-receipt__lines,
.thermal-receipt__totals {
  display: contents;
}

.thermal-receipt__line,
.thermal-receipt__total-row {
  display: contents;
}

.thermal-receipt__line-desc {
  grid-column: 1;
  word-break: break-word;
  font-size: 12px;
}

.thermal-receipt__line-amt {
  grid-column: 2;
  text-align: right;
  white-space: nowrap;
  justify-self: end;
}

.thermal-receipt__total-label {
  grid-column: 1;
  text-align: left;
  justify-self: start;
}

.thermal-receipt__total-row--paired .thermal-receipt__total-label,
.thermal-receipt__total-row--paired .thermal-receipt__line-amt {
  margin-top: -7px;
}

.thermal-receipt__total-row--grand .thermal-receipt__total-label,
.thermal-receipt__total-row--grand .thermal-receipt__line-amt {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
}

.thermal-receipt__mark {
  text-decoration: underline;
  text-underline-offset: 1px;
}

.thermal-receipt__tips {
  margin-bottom: 14px;
  text-align: center;
}

.thermal-receipt__tips-heading {
  margin-bottom: 0;
}

.thermal-receipt__tip-box {
  margin-top: 10px;
  border: 1px solid #2a2a2a;
}

.thermal-receipt__tip {
  margin: 0;
  padding: 8px 6px;
  border-bottom: 1px solid #2a2a2a;
  line-height: 1.3;
}

.thermal-receipt__tip:last-child {
  border-bottom: none;
}

.thermal-receipt__footer {
  margin-top: 4px;
  text-align: center;
}

.thermal-receipt__blanks {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  padding-bottom: 4mm;
}

.thermal-receipt__blanks span {
  position: relative;
  display: block;
  flex: 0 0 14px;
  width: 14px;
  height: 1.5em;
}

.thermal-receipt__blanks span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 6px;
  border-bottom: 1px solid #2a2a2a;
  transform: translateX(-50%);
}

@media print {
  @page {
    margin: 0;
    size: 72mm auto;
  }

  .thermal-receipt-body {
    padding: 0;
    color: #000000;
  }

  .thermal-receipt {
    width: 72mm;
    padding: 4mm 3mm 3mm;
  }

  .thermal-receipt__tip-box,
  .thermal-receipt__tip {
    border-color: #000000;
  }

  .thermal-receipt__blanks span::after {
    border-color: #000000;
  }
}
