/* The counter sign page (sign.html): controls on screen, then the sheet exactly as it
   prints. Always an upright A4 page (iPhones ignore "print sideways"):
   Counter signs: two upright A5 signs turned on their side, one above the other, with a
   cut line across the middle. Poster: one sign filling the page. Table signs: four A6
   signs, two by two, with cut lines between them.
   Always black on white, whatever the phone's mode. */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px;
  background: #e8e8ec;
  color: #111111;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.controls {
  max-width: 640px;
  margin: 0 auto 20px;
}

.controls-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.controls button {
  font: inherit;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid #c7c7d1;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
}

.controls button.is-on {
  border-color: #1e3a8a;
  background: #e7ecfd;
}

.controls button.main {
  background: #1e3a8a;
  border-color: #1e3a8a;
  color: #ffffff;
}

.controls button:disabled {
  opacity: 0.5;
}

.controls-step {
  font-size: 15px;
  font-weight: 700;
  margin: 4px 0 8px;
}

.controls-note {
  font-size: 14px;
  color: #555560;
  margin: 4px 0 0;
}

.controls-problem {
  color: #b42318;
  font-weight: 600;
}

[hidden] {
  display: none !important;
}

/* The sheet, at its real size (scaled down on small screens). */
.sheet {
  display: flex;
  margin: 0 auto;
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.sheet {
  flex-direction: column;
  width: 210mm;
  height: 297mm;
}

/* While the PDF is drawn: no shadow round the sheet. */
.making-pdf .sheet {
  box-shadow: none;
}

@media screen and (max-width: 820px) {
  .sheet {
    zoom: 0.45;
  }
}

/* Counter signs: each half of the page holds one A5 sign turned on its side. */
.half {
  position: relative;
  width: 210mm;
  height: 148.5mm;
  overflow: hidden;
}

.half + .half {
  border-top: 0.4mm dashed #b8b8c4;
}

.half .sign {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 148.5mm;
  height: 210mm;
  transform: translate(-50%, -50%) rotate(-90deg);
}

/* The sign, redesigned with Jack on 27 Nov 2026. Every size is in --u, so the A4 poster
   (and the A5 and A6 signs) are the same design, just bigger or smaller: nothing is
   squashed, rearranged or wrapped. --u is 1/340 of the sign's width (the design was drawn
   340 wide). */
.sign {
  --u: calc(148.5mm / 340);
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #f5efe6;
  padding: calc(24 * var(--u)) calc(16 * var(--u)) calc(14 * var(--u));
  font-family: "Inter Tight", -apple-system, Helvetica, Arial, sans-serif;
  color: #111111;
}

body[data-size="poster"] .sign {
  --u: calc(210mm / 340);
}

.sign-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(10 * var(--u));
  margin-bottom: calc(16 * var(--u));
}

.sign-logo {
  width: calc(46 * var(--u));
  height: calc(46 * var(--u));
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.sign-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: calc(18 * var(--u));
}

.sign-shop {
  margin: 0;
  font-weight: 900;
  font-size: calc(21 * var(--u));
  letter-spacing: -0.024em;
  line-height: 1.1;
  text-align: left;
  /* A very long shop name goes onto two lines (the same at every size). */
  max-width: calc(240 * var(--u));
}

.sign-title {
  margin: 0;
  font-family: "Lilita One", "Inter Tight", sans-serif;
  font-weight: 400;
  font-size: calc(58 * var(--u));
  line-height: 0.92;
  white-space: nowrap;
  color: #111111;
}

.sign-lead {
  margin: calc(12 * var(--u)) 0 0;
  font-weight: 800;
  font-size: calc(14 * var(--u));
  letter-spacing: -0.021em;
  white-space: nowrap;
  color: #1f45c8;
}

.sign-qr {
  width: calc(136 * var(--u));
  height: calc(136 * var(--u));
  margin-top: calc(16 * var(--u));
  padding: calc(10 * var(--u));
  border-radius: calc(4 * var(--u));
  background: #ffffff;
}

.sign-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sign-scan {
  margin: calc(12 * var(--u)) 0 0;
  font-weight: 800;
  font-size: calc(20 * var(--u));
  letter-spacing: -0.015em;
  white-space: nowrap;
  color: #1f45c8;
}

/* "Then tap at the counter": the same blue, lighter, with the contactless symbol after. */
.sign-tap {
  display: inline-flex;
  align-items: center;
  gap: calc(5 * var(--u));
  margin: calc(1 * var(--u)) 0 0;
  font-weight: 500;
  font-size: calc(14 * var(--u));
  white-space: nowrap;
  color: #1f45c8;
}

.sign-contactless {
  width: calc(14 * var(--u));
  height: calc(14 * var(--u));
}

.sign-space {
  flex: 1;
}

.sign-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sign-powered {
  margin: 0;
  font-weight: 800;
  font-size: calc(10 * var(--u));
  line-height: 1;
}

.sign-brand-name {
  display: flex;
  align-items: center;
  gap: calc(6 * var(--u));
  margin: calc(1 * var(--u)) 0 0;
  font-weight: 900;
  font-size: calc(18 * var(--u));
  letter-spacing: -0.022em;
}

/* The OneLoyal ring-and-dot. */
.sign-mark {
  display: block;
  width: calc(20 * var(--u));
  height: calc(20 * var(--u));
}

/* A6 signs, four to a sheet (two by two, upright), or one with three blank quarters.
   Each is the same sign as the A5 and A4, just smaller (Jack, 29 Nov 2026). */
body[data-size="table"] .sheet,
body[data-size="a6"] .sheet {
  flex-direction: row;
  flex-wrap: wrap;
}

.quarter {
  position: relative;
  display: flex;
  width: 50%;
  height: 50%;
  overflow: hidden;
}

.quarter:nth-child(odd) {
  border-right: 0.3mm dashed #b8b8c4;
}

.quarter:nth-child(-n + 2) {
  border-bottom: 0.3mm dashed #b8b8c4;
}

.quarter .sign {
  --u: calc(105mm / 340);
}

/* Printing: only the sheet, at a fixed size that fits inside A4 even after the printer's
   own margins and a phone's header and footer (iPhones add these, ignore "shrink to fit"
   and misreport the page height), and never spilling onto a second page. Each counter-sign half takes exactly
   half; its sign turns to fit that half. */
@media print {
  html,
  body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: #ffffff;
  }
  .controls {
    display: none;
  }
  .sheet {
    box-shadow: none;
    zoom: 1 !important;
    width: 100%;
    height: 255mm;
    margin: 0;
    overflow: hidden;
    break-after: avoid;
  }
  .half {
    width: 100%;
    height: 50%;
    container-type: size;
  }
  .half .sign {
    width: 100cqh;
    height: 100cqw;
  }
}
