/* Site Receipt UI: the mat, the paper, the till print. Receipt look itself lives in receipt.css.
   Paper stays paper in both modes; the mat and text around it adapt. */
:root {
  color-scheme: light dark;
  --bg: #d3e5db;
  --bg-line: rgba(31, 84, 66, 0.1);
  --bg-line-major: rgba(31, 84, 66, 0.2);
  --fg: #11261d;
  --fg-soft: #2f4c40;
  --link: #124a37;
  --focus: #0a3d91;
  --head: #0e3a2b;
  --chip-bd: rgba(17, 38, 29, 0.55);
  --paper: #f7f7f3;
  --ink: #26262b;
  --ink-soft: #55555d;
  --ink-line: #8a8a90;
  --err: #a3261b;
  --stamp: #b3261e;
  --paper-shadow: drop-shadow(0 1px 1px rgba(8, 24, 18, 0.3)) drop-shadow(0 0.6rem 1rem rgba(8, 24, 18, 0.2));
  --frame-shadow: 0 0.15rem 0 rgba(0, 0, 0, 0.12), 0 0.8rem 1.6rem rgba(8, 24, 18, 0.2);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12302a;
    --bg-line: rgba(214, 236, 226, 0.07);
    --bg-line-major: rgba(214, 236, 226, 0.15);
    --fg: #e4f0ea;
    --fg-soft: #b5cdc2;
    --link: #bfe6d3;
    --focus: #f2c94c;
    --head: #ffffff;
    --chip-bd: rgba(216, 232, 224, 0.55);
    --paper-shadow: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)) drop-shadow(0 0.6rem 1.1rem rgba(0, 0, 0, 0.4));
    --frame-shadow: 0 0.15rem 0 rgba(0, 0, 0, 0.3), 0 0.8rem 1.6rem rgba(0, 0, 0, 0.4);
  }
}
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--fg); font-family: "Ticket", system-ui, sans-serif; font-size: 1rem; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, var(--bg-line-major) 0 2px, transparent 2px),
    linear-gradient(to bottom, var(--bg-line-major) 0 2px, transparent 2px),
    linear-gradient(to right, var(--bg-line) 0 1px, transparent 1px),
    linear-gradient(to bottom, var(--bg-line) 0 1px, transparent 1px);
  background-size: 11.25rem 11.25rem, 11.25rem 11.25rem, 2.25rem 2.25rem, 2.25rem 2.25rem;
}
a { color: var(--link); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.paper :focus-visible { outline-color: #0a3d91; }
.skip { position: absolute; left: 0.75rem; top: -4rem; background: var(--paper); color: var(--ink); padding: 0.6rem 1rem; z-index: 10; font-family: "Thermal", monospace; text-transform: uppercase; }
.skip:focus { top: 0.75rem; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* top bar and footer */
.top { max-width: 52rem; margin: 0 auto; padding: 1rem 1.25rem 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; font-family: "Thermal", monospace; text-transform: uppercase; letter-spacing: 0.08em; font-size: 1rem; color: var(--head); text-decoration: none; }
.brand img { width: 1.75rem; height: 1.75rem; display: block; }
.top nav { display: flex; gap: 0.25rem; }
.top nav a { font-family: "Thermal", monospace; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.95rem; color: var(--fg); text-decoration: none; padding: 0 0.75rem; min-height: 2.75rem; display: inline-flex; align-items: center; }
.top nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.top nav a[aria-current="page"] { text-decoration: underline; text-decoration-style: dashed; }
.page { max-width: 52rem; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.narrow { max-width: 38rem; margin-left: auto; margin-right: auto; }
.foot { max-width: 52rem; margin: 0 auto; padding: 0 1.25rem 3rem; font-size: 0.9rem; color: var(--fg-soft); }
.foot .printed { font-family: "Thermal", monospace; text-transform: uppercase; letter-spacing: 0.06em; text-align: center; margin: 0 0 0.75rem; color: var(--fg); }
.foot p { margin: 0 0 0.6rem; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.25rem; margin-bottom: 0.5rem; }
.foot nav a { min-height: 2.75rem; display: inline-flex; align-items: center; }
.small { max-width: 38rem; margin: 3rem auto 0; font-size: 0.9rem; color: var(--fg-soft); }
.small p { margin: 0 0 0.6rem; }

/* headings */
.head { text-align: center; margin-bottom: 2rem; }
h1 { font-weight: 800; font-stretch: 80%; font-size: clamp(2.25rem, 7vw, 3.75rem); line-height: 1; letter-spacing: -0.015em; color: var(--head); margin: 0 auto 1rem; max-width: 14ch; text-wrap: balance; }
.head.wide h1 { max-width: 20ch; }
.lede { margin: 0 auto; font-weight: 500; font-size: 1.125rem; max-width: 34rem; color: var(--fg); text-wrap: balance; }
h2 { font-weight: 800; font-stretch: 80%; font-size: 1.75rem; line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 0.75rem; color: var(--head); }

/* paper: the one surface for form, sign-up, board, text. Shadow on the wrapper, torn edge on the paper. */
.paper-wrap { filter: var(--paper-shadow); }
.paper {
  --edge: 0.6rem;
  background: var(--paper); color: var(--ink); font-family: "Thermal", monospace; text-transform: uppercase; font-size: 1.0625rem;
  padding: 1.5rem 1.5rem calc(1.4rem + var(--edge));
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--edge)), 95% 100%, 90% calc(100% - var(--edge)), 85% 100%, 80% calc(100% - var(--edge)), 75% 100%, 70% calc(100% - var(--edge)), 65% 100%, 60% calc(100% - var(--edge)), 55% 100%, 50% calc(100% - var(--edge)), 45% 100%, 40% calc(100% - var(--edge)), 35% 100%, 30% calc(100% - var(--edge)), 25% 100%, 20% calc(100% - var(--edge)), 15% 100%, 10% calc(100% - var(--edge)), 5% 100%, 0 calc(100% - var(--edge)));
}
.paper-wrap.slim { max-width: 28.75rem; margin: 0 auto; }
.paper h2 { color: var(--ink); font-family: "Ticket", system-ui, sans-serif; text-transform: none; }
.paper p { margin: 0; }
.paper .soft, .soft { color: var(--ink-soft); }
.paper .plain { text-transform: none; font-family: "Ticket", system-ui, sans-serif; font-size: 0.95rem; line-height: 1.45; color: var(--ink-soft); }
.paper a { color: var(--ink); }
.rule { border: 0; border-top: 2px dashed var(--ink-line); margin: 1rem 0; }

/* fields */
.lbl { display: block; color: var(--ink-soft); margin-bottom: 0.6rem; }
.paper input[type="text"], .paper input[type="email"] {
  display: block; width: 100%; font: inherit; text-transform: none; font-size: 1.25rem; color: var(--ink);
  background: transparent; border: 0; border-bottom: 2px dashed var(--ink-soft); padding: 0.6rem 0; border-radius: 0; min-height: 2.75rem;
}
.paper input[type="text"]:focus, .paper input[type="email"]:focus { outline: none; border-bottom-style: solid; border-bottom-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.paper input[aria-invalid="true"]:focus { border-bottom-color: var(--err); box-shadow: 0 2px 0 var(--err); }
.paper input::placeholder { color: #686870; }
.paper input[aria-invalid="true"] { border-bottom-color: var(--err); }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; margin-top: 1.1rem; padding: 0.8rem 1rem; font: inherit; text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--ink); color: var(--paper); border: 2px solid var(--ink); cursor: pointer; min-height: 3rem; text-decoration: none; transition: transform 0.12s ease, background-color 0.12s ease;
}
.btn:hover { background: #000; border-color: #000; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--ink-soft); border-color: var(--ink-soft); cursor: progress; }
.btn.alt { background: transparent; color: var(--ink); }
.btn.alt:hover { background: rgba(38, 38, 43, 0.08); }
.btn.auto { width: auto; display: inline-flex; padding-left: 1.5rem; padding-right: 1.5rem; }
.status { min-height: 1.4rem; margin: 0.9rem 0 0; color: var(--ink-soft); font-size: 0.95rem; }
.status.err, .err { color: var(--err); text-transform: none; font-family: "Ticket", system-ui, sans-serif; font-weight: 600; font-size: 1rem; }
.err::before { content: "! "; font-family: "Thermal", monospace; }

/* checkbox, receipt style */
.check { display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.75rem; align-items: start; padding: 0.5rem 0; min-height: 2.75rem; cursor: pointer; position: relative; }
.check input { position: absolute; opacity: 0; width: 1.5rem; height: 1.5rem; margin: 0.4rem 0 0; cursor: pointer; }
.check .box { width: 1.4rem; height: 1.4rem; border: 2px solid var(--ink); margin-top: 0.15rem; display: grid; place-items: center; background: transparent; }
.check .box::after { content: ""; width: 0.75rem; height: 0.4rem; border: solid var(--ink); border-width: 0 0 3px 3px; transform: rotate(-45deg) scale(0); margin-top: -0.2rem; transition: transform 0.12s ease; }
.check input:checked + .box::after { transform: rotate(-45deg) scale(1); }
.check input:focus-visible + .box { outline: 3px solid #0a3d91; outline-offset: 2px; }
.check:hover .box { background: rgba(38, 38, 43, 0.08); }
.check .txt { line-height: 1.3; }
.check .txt small { display: block; margin-top: 0.2rem; text-transform: none; font-family: "Ticket", system-ui, sans-serif; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.35; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* result */
.result { margin-top: 2.5rem; }
.tabs { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab { font-family: "Thermal", monospace; text-transform: uppercase; font-size: 0.95rem; padding: 0.5rem 1rem; min-height: 2.75rem; background: transparent; color: var(--fg); border: 1px solid var(--chip-bd); cursor: pointer; letter-spacing: 0.04em; }
.tab:hover { background: rgba(127, 127, 127, 0.15); }
.tab[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.frame { position: relative; margin: 0 auto; overflow: hidden; box-shadow: var(--frame-shadow); max-width: 100%; }
.frame .stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.frame.printing { animation: feed 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes feed { from { clip-path: inset(0 0 100% 0); transform: translateY(-1.5rem); } to { clip-path: inset(0 0 0 0); transform: none; } }
.meta { text-align: center; font-size: 0.9rem; margin: 0.75rem 0 0; color: var(--fg-soft); }
.notes { max-width: 38rem; margin: 1rem auto 0; font-size: 0.9rem; }
.notes summary { cursor: pointer; text-align: center; min-height: 2.75rem; display: flex; align-items: center; justify-content: center; font-family: "Thermal", monospace; text-transform: uppercase; letter-spacing: 0.04em; text-decoration: underline dashed; text-underline-offset: 0.3em; }
.notes summary::before { content: "+ "; white-space: pre; }
.notes[open] summary::before { content: "- "; }
.notes ul { padding-left: 1.25rem; }

/* share row */
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin: 1.25rem auto 0; max-width: 38rem; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 2.75rem; padding: 0 1rem; font-family: "Thermal", monospace; text-transform: uppercase; font-size: 0.95rem; letter-spacing: 0.04em;
  color: var(--fg); background: transparent; border: 1px solid var(--chip-bd); cursor: pointer; text-decoration: none;
}
.chip:hover { background: rgba(127, 127, 127, 0.16); }
.chip:active { transform: translateY(1px); }
.chip[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.chip.solid { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.chip.solid:hover { background: #fff; }
.share-note { text-align: center; font-size: 0.9rem; color: var(--fg-soft); margin: 0.6rem auto 0; max-width: 34rem; min-height: 1.4rem; }

/* sign-up card */
.signup { margin: 2.5rem auto 0; max-width: 28.75rem; }
.signup .paper { border-top: 0; padding-top: 1.75rem; position: relative; }
.signup .paper::before { content: ""; position: absolute; left: 1rem; right: 1rem; top: 0.7rem; border-top: 2px dashed var(--ink-line); }
.signup h2 { font-size: 1.6rem; margin: 0.25rem 0 0.25rem; }
.signup .sub { margin-bottom: 0.6rem; }
.signup .consent { margin-top: 0.9rem; }
.signup .field { margin-top: 0.5rem; }
.signup .pending { text-align: center; padding: 0.5rem 0 0.25rem; }
.stamp {
  display: inline-block; font-family: "Thermal", monospace; text-transform: uppercase; letter-spacing: 0.1em; font-size: 1.15rem; color: var(--stamp);
  border: 3px solid var(--stamp); padding: 0.35rem 0.8rem; transform: rotate(-5deg); margin: 0.5rem 0 1rem; line-height: 1.2; opacity: 0.92;
}
.stamp.big { font-size: 1.6rem; padding: 0.5rem 1.1rem; }
.signup .pending .plain { text-align: center; }

/* board */
.board-paper { max-width: 40rem; margin: 0 auto; }
.bhead { text-align: center; padding-bottom: 0.5rem; }
.bhead .t { font-size: 1.6rem; letter-spacing: 0.04em; line-height: 1.1; margin: 0; }
.bhead .s { margin: 0.4rem 0 0; color: var(--ink-soft); font-size: 0.95rem; }
.seg { display: flex; gap: 0.5rem; margin: 0.9rem 0; }
.seg button { flex: 1; font: inherit; font-size: 0.95rem; letter-spacing: 0.04em; text-transform: uppercase; min-height: 2.75rem; padding: 0 0.5rem; background: transparent; color: var(--ink); border: 2px solid var(--ink); cursor: pointer; }
.seg button:hover { background: rgba(38, 38, 43, 0.08); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.rows { list-style: none; margin: 0; padding: 0; }
.row-a { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto; gap: 0 0.75rem; align-items: baseline; padding: 0.7rem 0; color: var(--ink); text-decoration: none; border-top: 1px dashed var(--ink-line); min-height: 2.75rem; }
.rows li:first-child .row-a { border-top: 0; }
.row-a:hover { background: rgba(38, 38, 43, 0.06); }
.row-a .rk { color: var(--ink-soft); }
.row-a .dm { font-size: 1.125rem; overflow-wrap: break-word; min-width: 0; line-height: 1.2; }
.row-a .sz { text-transform: none; font-size: 1.25rem; white-space: nowrap; font-weight: 700; -webkit-text-stroke: 0.04em currentColor; }
.row-a .st { grid-column: 2 / 4; color: var(--ink-soft); font-family: "Ticket", system-ui, sans-serif; text-transform: none; font-size: 0.9rem; margin-top: 0.2rem; line-height: 1.35; display: flex; flex-wrap: wrap; gap: 0 1rem; }
.row-a .st span { white-space: nowrap; }
.sk .row-a { pointer-events: none; }
.bar { display: block; height: 0.9rem; background: #d9d9d3; animation: pulse 1.2s ease-in-out infinite alternate; }
.row-a .bar.s { height: 0.7rem; }
@keyframes pulse { from { opacity: 0.45; } to { opacity: 1; } }
.empty { text-align: center; padding: 1.5rem 0.5rem 0.5rem; }
.empty .plain { margin: 0.5rem auto 0; max-width: 24rem; }
.empty .btn { margin-top: 1rem; }
.bfoot { text-align: center; margin-top: 1rem; }
.teaser { margin: 3.5rem auto 0; max-width: 28.75rem; }
.teaser .bhead .t { font-size: 1.3rem; }
.teaser .btn { margin-top: 0.75rem; }
.cta-line { text-align: center; margin: 2rem auto 0; }

/* r page */
.printown { max-width: 28.75rem; margin: 2.5rem auto 0; }
.printown form { margin: 0; }
.fallback { max-width: 28.75rem; margin: 0 auto; }
.ghost { margin: 0 auto; max-width: 28.75rem; aspect-ratio: 350 / 907; background: rgba(247, 247, 243, 0.55); animation: pulse 1.2s ease-in-out infinite alternate; }

/* doc pages */
.doc h1 { max-width: none; text-align: left; font-size: clamp(2rem, 6vw, 3rem); margin-bottom: 0.5rem; }
.doc .paper { text-transform: none; font-family: "Ticket", system-ui, sans-serif; font-size: 1.0625rem; line-height: 1.55; padding: 2rem 1.75rem calc(2rem + var(--edge)); color: var(--ink); }
.doc .paper h2 { font-size: 1.4rem; margin: 2rem 0 0.5rem; }
.doc .paper h2:first-of-type { margin-top: 0; }
.doc .paper p, .doc .paper ul { margin: 0 0 0.9rem; }
.doc .paper ul { padding-left: 1.25rem; }
.doc .paper li { margin-bottom: 0.35rem; }
.doc .paper a { color: #0f3d2e; }
.doc .updated { font-family: "Thermal", monospace; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); font-size: 0.95rem; margin: 0 0 1.5rem; }
.doc .paper .note { background: #efeee6; padding: 0.75rem 1rem; margin: 0 0 1rem; }
.center { text-align: center; }
.center .paper { text-align: center; }

@media (max-width: 30rem) {
  .page { padding-top: 1.5rem; }
  .paper { padding: 1.25rem 1.1rem calc(1.2rem + var(--edge)); }
  .doc .paper { padding: 1.5rem 1.1rem calc(1.5rem + var(--edge)); }
  .top { padding-left: 0.5rem; padding-right: 0.5rem; }
  .top nav a { padding: 0 0.6rem; }
  .actions .chip { flex: 1 1 calc(50% - 0.5rem); padding: 0 0.5rem; }
  .row-a { grid-template-columns: 1.75rem minmax(0, 1fr) auto; gap: 0 0.5rem; }
  .row-a .dm { font-size: 1rem; }
  .row-a .sz { font-size: 1.125rem; }
}
@media (prefers-reduced-motion: reduce) {
  .frame.printing, .bar, .ghost { animation: none; }
  .btn, .check .box::after { transition: none; }
}
.who { overflow-wrap: anywhere; max-width: 100%; font-size: clamp(2rem, 8vw, 3.75rem); }
.foot p { text-wrap: balance; }
.paper a.btn { color: var(--paper); }
.paper a.btn.alt { color: var(--ink); }
[hidden] { display: none !important; }
.doc .updated { color: var(--fg-soft); }
.paper h1 { text-transform: none; }
.paper h1, .paper h2 { text-wrap: balance; }
@media (min-width: 30.0625rem) { .actions { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 28.75rem; } .actions .chip { padding: 0 0.5rem; } }
.status.busy { font-size: 1rem; color: var(--ink); }
.status.busy::after { content: "_"; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .status.busy::after { animation: none; } }
@media (max-width: 23.75rem) { .row-a .dm { font-size: 0.9375rem; } }
