/* Colors and type from the app (No8/Theme.swift, No8/ReceiptChecklist.swift). */
:root {
  --paper: #fdfcf8;
  --ink: #211f1c;
  --pen: #1a1c33;
  --tomato: #d92a28;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { background: #f5f2ea; }
body { margin: 0; color: var(--ink); font: 500 14px/1.45 var(--mono); -webkit-font-smoothing: antialiased; }
a { color: inherit; }

.map { position: fixed; inset: 0; z-index: -1; }

main { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 40px 14px; }

.receipt { position: relative; width: min(380px, 100%); padding: 30px 24px 34px; animation: print 1.1s cubic-bezier(.2, .7, .2, 1) both; }
.receipt > * { position: relative; }
.paper { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 4px #00000026) drop-shadow(0 18px 28px #3a2f1a2e); }
@keyframes print { from { opacity: 0; transform: translateY(40px); } }

header { text-align: center; }
.brand { margin: 0; font-size: 19px; font-weight: 800; line-height: 1.25; }
.kind { margin: 2px 0 0; font-size: 12px; }
h1 { margin: 22px 0 0; font-size: 25px; font-weight: 800; line-height: 1.2; text-align: center; text-wrap: balance; }

/* A row of the font's own dashes, spaced to end flush at both sides. */
.rule { margin: 14px 0; white-space: pre; overflow: hidden; color: #211f1c80; line-height: 1; height: 1em; }

.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 6px; align-items: flex-start; padding: 6px 0; cursor: pointer; -webkit-tap-highlight-color: transparent; outline: none; user-select: none; -webkit-user-select: none; }
.steps li:focus-visible .brackets { outline: 2px solid var(--tomato); outline-offset: 2px; border-radius: 3px; }
.box { position: relative; flex: none; }
.box svg, .title svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.title { position: relative; display: block; width: fit-content; z-index: 0; }
.title b { font-weight: 700; text-transform: uppercase; }
.steps small { display: block; margin-top: 1px; font-size: 12px; color: #211f1c99; }
.brackets, .title b, .steps small { transition: opacity .12s; }
.ticked .brackets, .ticked .title b, .ticked small { opacity: .55; }

/* A highlighter swipe behind the step that matters most. */
.highlight .title::before { content: ""; position: absolute; z-index: -1; left: -4px; right: -4px; top: 1px; bottom: -1px; border-radius: 3px 6px 4px 5px; background: #f7d34a; transform: scaleX(0) rotate(-.6deg); transform-origin: left; transition: transform .45s cubic-bezier(.4, 0, .2, 1); }
.highlight.swiped .title::before { transform: scaleX(1) rotate(-.6deg); }

/* Rubber stamps, as inked on a receipt line. */
.stamps { display: flex; align-items: center; gap: 8px; height: 24px; margin-top: 3px; }
.stamp { position: relative; display: inline-grid; place-items: center; flex: none; color: var(--c); opacity: .85; mix-blend-mode: multiply; transform: rotate(var(--tilt)); }
.stamp.word { padding: 2.4px 6px; font: 900 12px/1.2 var(--mono); letter-spacing: 1px; }
.stamp.word svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.stamp.symbol svg { display: block; width: 18px; height: 18px; }

.total { display: flex; justify-content: space-between; margin: 0; font-weight: 700; }
.fine { margin: 2px 0 0; font-size: 12px; color: #211f1c99; }

/* The App Store button in the middle of the barcode, its bars on either side at the button's height. */
.checkout { position: relative; display: grid; place-items: center; margin-top: 26px; }
.barcode { position: absolute; inset: 0; width: 100%; height: 100%; }
.store { position: relative; transition: transform .15s; }
.store:hover { transform: translateY(-1px); }
.store img { display: block; width: 150px; height: auto; }

.links { display: flex; justify-content: center; gap: 12px; margin-top: 26px; font-size: 11px; letter-spacing: 4px; }
/* The same highlighter swipe on hover: it goes on from the left and comes off to the right. */
.links a { position: relative; isolation: isolate; text-decoration: none; outline: none; }
.links a::before { content: ""; position: absolute; z-index: -1; left: -5px; right: -1px; top: -1px; bottom: -2px; border-radius: 3px 6px 4px 5px; background: #f7d34a; transform: scaleX(0) rotate(-.8deg); transform-origin: right; transition: transform .3s cubic-bezier(.4, 0, .2, 1); }
.links a:hover::before, .links a:focus-visible::before { transform: scaleX(1) rotate(-.8deg); transform-origin: left; }


/* Pins, as on the app's map (RestaurantPin, ProgressPie): a white disc with a gray ring and a red pie
   that fills as dishes get ticked, then a red disc with a heavy check. They pop in where they are. */
@property --tried { syntax: "<percentage>"; inherits: true; initial-value: 0%; }
.place { pointer-events: none; }
.place .mark { display: flex; flex-direction: column; align-items: center; gap: 3px; transform-origin: 50% 12px; scale: 0; }
.place.shown .mark { scale: 1; transition: scale .22s cubic-bezier(.3, 1.4, .5, 1); }
.place .pin { position: relative; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1.5px #8e8e9373, 0 1px 6px #00000040; transition: --tried .22s ease-out; }
.place .pin::before { content: ""; position: absolute; inset: 14%; border-radius: 50%; background: conic-gradient(var(--tomato) var(--tried), #0000 0); }
.place .pin::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--tomato) no-repeat center / 12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.2 8.6 6.4 11.8 12.8 4.4' fill='none' stroke='%23fff' stroke-width='3.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  scale: 0; transition: scale .12s ease-in;
}
.place.done .pin::after { scale: 1; transition: scale .3s cubic-bezier(.3, 1.8, .5, 1); }
/* Names as Apple Maps writes them under a pin: the system font, dark with a white halo. */
.place .name { font: 600 12px/1.25 -apple-system, BlinkMacSystemFont, system-ui, "Helvetica Neue", sans-serif; letter-spacing: -.01em; white-space: nowrap; color: #1d1d1f; text-shadow: 0 0 1px #fff, 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff, 0 0 4px #fff, 0 0 6px #fff; }

@media (prefers-reduced-motion: reduce) {
  .receipt { animation: none; }
}
