/* Coupon cards for a local shop (item 1334, src/coupons.js; picture docs/design/sketches/1334.css). Page parts take app.css tokens;
   the card is a paper object, so its palette (Paper Hearth, docs/stores/cards-style.md) is its own and does not follow dark mode. */
.face { --paper: #f4ecdc; --pine: #24483a; --sage: #7f9c83; --berry: #a8323a; --brass: #b8913f; --coffee: #6b4a35; --ink: #2b2622; --mute: #5e564e; --white: #fff;
  container-type: inline-size; position: relative; width: 100%; aspect-ratio: 7 / 4; box-sizing: border-box; background: var(--paper); color: var(--ink);
  border: .4cqw solid var(--brass); display: flex; align-items: center; gap: 4cqw; padding: 4cqw 5cqw; overflow: hidden; font-family: var(--body, system-ui, sans-serif); }
.face::before { content: ""; position: absolute; inset: 2.2cqw; border: .3cqw dashed var(--brass); pointer-events: none; }
.face .cup { flex: none; width: 17cqw; height: auto; }
.face .cup .st { fill: none; stroke: var(--sage); stroke-width: 7; stroke-linecap: round; }
.face .cup .c1 { fill: var(--pine); } .face .cup .c2 { fill: var(--brass); } .face .cup .c3 { fill: var(--coffee); }
.face .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1.2cqw; }
.face .ftag { font-size: 3.4cqw; color: var(--mute); }
.face .fbig { font-size: 8.4cqw; line-height: 1.1; color: var(--pine); font-family: Gloock, Georgia, "Ma Shan Zheng", serif; font-weight: 400; overflow-wrap: anywhere; }
.face:lang(zh) .fbig { font-family: "Ma Shan Zheng", "Kaiti SC", KaiTi, serif; font-size: 10cqw; }
.face .fbig.m { font-size: 7cqw; } .face .fbig.s { font-size: 5.8cqw; } .face .fbig.xs { font-size: 4.8cqw; line-height: 1.15; }
.face:lang(zh) .fbig.m { font-size: 8cqw; } .face:lang(zh) .fbig.s { font-size: 6.4cqw; } .face:lang(zh) .fbig.xs { font-size: 5cqw; }
.face .tx { gap: .8cqw; }
.face .shop, .face .foffer { font-size: 4.6cqw; line-height: 1.2; overflow-wrap: anywhere; }
.face.free.f .shop { font-size: 4.6cqw; color: var(--mute); }
.face .un { font-size: 3.8cqw; color: var(--berry); }
.face .code { font-size: 4.4cqw; color: var(--mute); letter-spacing: .08em; }
.face .qr { flex: none; width: 21cqw; height: auto; border: 1cqw solid var(--white); background: var(--white); }
.face.free.b .tx { justify-content: center; }

body.cpn { background: var(--bg); color: var(--ink); margin: 0; font-family: var(--ui, system-ui, sans-serif); }
.cpn :where(button) { font: inherit; border: 0; background: none; color: inherit; cursor: pointer; touch-action: manipulation; }
.cpn-app { max-width: 390px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 10px) 18px 24px; box-sizing: border-box; }
.cpn-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; color: var(--muted); font-size: 16px; }
.cpn-back { min-height: 44px; min-width: 44px; padding: 0 6px; color: var(--sel) !important; font-size: 17px; text-align: start; }
.cpn-pin { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 14px; font-size: 17px; line-height: 1.35; }
.cpn-pin::before { content: "P"; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; }
.cpn-pin > span { background: var(--surface); border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow); }
.cpn h1 { font-size: 26px; line-height: 1.2; margin: 6px 0 10px; font-weight: 700; }
.cpn-lead { font-size: 17px; line-height: 1.4; color: var(--muted); margin: 0 0 14px; }
.cpn-hero { --hero-wood: #6b5a48; border-radius: 14px; background: var(--hero-wood); padding: 22px 16px; margin-bottom: 14px; }
.cpn-hero .face { transform: rotate(-3deg); box-shadow: 0 8px 18px var(--shadow-2); }
.cpn-lbl { display: block; font-size: 16px; font-weight: 600; margin: 12px 0 6px; }
.cpn-in { width: 100%; box-sizing: border-box; min-height: 52px; font-size: 18px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
.cpn-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.cpn-chip { min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1.5px solid var(--line) !important; background: var(--surface) !important; font-size: 16px; }
.cpn-chip[aria-pressed=true]::before { content: "✓ "; }
.cpn-chip[aria-pressed=true] { background: var(--seg-on) !important; color: var(--seg-on-ink) !important; border-color: var(--seg-ring) !important; font-weight: 600; }
.cpn-cards { display: grid; gap: 10px; margin: 4px 0 6px; }
.cpn-card { background: var(--surface); border-radius: 14px; padding: 10px; box-shadow: var(--shadow-2); }
.cpn-card .t { display: flex; justify-content: space-between; align-items: center; font-size: 15px; margin-top: 8px; color: var(--muted); }
.cpn-flip { min-height: 44px; padding: 0 12px; color: var(--sel) !important; font-size: 16px; }
.cpn-sp { flex: 1; min-height: 8px; }
.cpn-go { display: flex; align-items: center; justify-content: center; width: 100%; box-sizing: border-box; min-height: 56px; border-radius: 14px; background: var(--accent) !important; color: var(--accent-ink) !important; font-size: 19px !important; font-weight: 700; margin-top: 12px; text-decoration: none; }
.cpn-2 { display: flex; align-items: center; justify-content: center; width: 100%; box-sizing: border-box; min-height: 50px; border-radius: 14px; border: 1.5px solid var(--line) !important; background: var(--surface) !important; font-size: 17px; margin-top: 10px; text-decoration: none; color: var(--ink); }
.cpn-sheetbox { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: flex-end; z-index: 30; }
.cpn-sheetbox > div { width: 100%; max-width: 390px; margin: 0 auto; background: var(--surface); border-radius: 18px 18px 0 0; padding: 16px 18px calc(env(safe-area-inset-bottom) + 20px); box-sizing: border-box; }
.cpn-sheetbox b { display: block; font-size: 19px; margin-bottom: 6px; }
.cpn-count { list-style: none; display: grid; gap: 10px; margin: 6px 0; padding: 0; }
.cpn-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 14px; padding: 12px 14px; min-height: 64px; }
.cpn-row .n { font-size: 30px; font-weight: 700; min-width: 2ch; text-align: end; }
.cpn-row .w { flex: 1; font-size: 16px; line-height: 1.3; }
.cpn-row .w small { display: block; color: var(--muted); font-size: 15px; }
.cpn-err { background: var(--note); color: var(--note-ink); border-radius: 12px; padding: 12px 14px; font-size: 17px; margin: 10px 0 0; }
.cpn-bar { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0 calc(env(safe-area-inset-bottom) + 8px); margin-top: auto; }
.cpn-bar .cpn-go { margin-top: 0; }
.cpn-bar .cpn-2 { margin-top: 8px; }
.cpn-empty { color: var(--muted); padding: 12px 0; }
.cpn-done { background: var(--note); color: var(--note-ink); border-radius: 12px; padding: 12px 14px; font-size: 17px; margin: 6px 0 10px; }
[data-theme=large] .cpn h1 { font-size: 30px; }
[data-theme=large] .cpn-pin, [data-theme=large] .cpn-lead { font-size: 20px; }
[data-theme=large] .cpn-in { min-height: 60px; font-size: 21px; border-width: 2px; }
[data-theme=large] .cpn-go { min-height: 64px; font-size: 22px !important; }
[data-theme=large] .cpn-2, [data-theme=large] .cpn-chip, [data-theme=large] .cpn-flip, [data-theme=large] .cpn-back { min-height: 56px; font-size: 19px; border-width: 2px !important; }

/* the print sheet: 7 x 10 in block of 10 cards, cut marks in the margin, backs mirrored by column (long-edge flip) */
body.sheet { --white: #fff; --black: #000; background: var(--white); }
.sheet .np { display: flex; gap: 12px; align-items: center; padding: 12px 16px; background: var(--surface); }
.sheet .np p { flex: 1; margin: 0; }
.sheet .np .cpn-go, .sheet .np .cpn-2 { width: auto; margin: 0; padding: 0 18px; }
.sheet .pg { position: relative; width: 7in; height: 10in; margin: 24px auto; display: grid; grid-template-columns: 3.5in 3.5in; grid-template-rows: repeat(5, 2in); background: var(--white); }
.sheet .pg.back { direction: rtl; }
.sheet .cell { width: 3.5in; height: 2in; }
.sheet .cell .face { width: 3.5in; height: 2in; aspect-ratio: auto; direction: ltr; }
.sheet .marks { position: absolute; inset: 0; width: 7in; height: 10in; overflow: visible; pointer-events: none; }
.sheet .marks path { stroke: var(--black); stroke-width: .01; fill: none; }
@media print {
  .np, .site-hd, .site-band { display: none !important; }
  .sheet .pg { margin: .5in auto 0; break-after: page; page-break-after: always; }
  .sheet .face, .sheet .face * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
