/* OFF HOURS card renderer. One markup structure, six art-directed themes.
   Colours arrive as CSS custom properties already contrast-checked on the server. */

.ohc {
  --r: 22px;
  --pad: clamp(16px, 5.5%, 26px);
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
  box-sizing: border-box;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 24px 48px -18px rgba(20,14,8,.45), 0 2px 6px rgba(20,14,8,.12);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
.ohc *, .ohc *::before, .ohc *::after { box-sizing: border-box; }
.ohc > * { position: relative; z-index: 1; }
.ohc__bgimg { position: absolute !important; inset: 0; z-index: 0 !important; background-size: cover; background-position: center; opacity: .22; mix-blend-mode: multiply; }
.ohc__grain { position: absolute !important; inset: 0; z-index: 0 !important; pointer-events: none; }
.tex-grain .ohc__grain {
  opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ------------------------------------------------------------------ shared atoms */
.ohc__head { padding: var(--pad) var(--pad) 0; }
.ohc__name {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 800;
  line-height: .92;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.ohc__name.n-xl { font-size: 15cqi; }
.ohc__name.n-l  { font-size: 11.5cqi; }
.ohc__name.n-m  { font-size: 8.6cqi; }
.ohc__name.n-s  { font-size: 6.6cqi; }
.ohc__logo { display: block; max-width: 62%; max-height: 64px; width: auto; height: auto; object-fit: contain; }
.ohc__tag {
  display: block;
  font-size: max(10px, 2.9cqi);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sec);
}
.ohc__count { text-align: right; flex-shrink: 0; }
.ohc__count .lbl { display: block; font-size: max(10px, 2.7cqi); letter-spacing: .14em; text-transform: uppercase; color: var(--sec); font-weight: 600; }
.ohc__count b { display: block; font-size: 6.4cqi; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ohc__hero { display: block; width: calc(100% - var(--pad) * 2); margin: 14px var(--pad) 0; aspect-ratio: 16 / 7; object-fit: cover; border-radius: calc(var(--r) * .5); }

/* ------------------------------------------------------------------ stamps */
.ohc__band { padding: 18px var(--pad); margin-top: 16px; }
.stamps {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr));
  gap: 3.2cqi 2.6cqi;
  justify-items: center;
}
.lay-line .stamps { gap: 1.6cqi; }
.stamp { position: relative; width: 100%; max-width: 64px; aspect-ratio: 1; }
.lay-line .stamp { max-width: none; }
.stamp__face {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  transition: background-color .35s ease, color .35s ease, transform .45s cubic-bezier(.3,1.6,.5,1), box-shadow .35s ease, opacity .35s;
}
.stamp__icon { width: 52%; height: 52%; }
.stamp__num { position: absolute; font-size: max(9px, 2.6cqi); font-weight: 700; opacity: 0; font-variant-numeric: tabular-nums; }
.stamp.is-earned .stamp__face { background: var(--tok-bg); color: var(--tok-fg); box-shadow: 0 3px 8px -2px rgba(0,0,0,.28); }
.stamp.is-empty .stamp__face { color: var(--text); opacity: .34; border: 1.5px dashed currentColor; }
.stamp.is-empty .stamp__icon { opacity: .8; }
.stamp__goal {
  position: absolute; left: 50%; bottom: -2px; transform: translate(-50%, 50%);
  font-size: max(8px, 2.1cqi); font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  background: var(--acc); color: var(--bg); padding: 1px 6px; border-radius: 99px; white-space: nowrap; z-index: 2;
}
.stamp.is-goal.is-earned .stamp__goal { display: none; }
.shape-rounded .stamp__face { border-radius: 32%; }
.shape-ticket .stamp__face { border-radius: 4px; }
.shape-sticker .stamp__face { border-radius: 50%; }
.shape-sticker .stamp.is-earned .stamp__face { transform: rotate(calc((var(--i) * 37deg) - 18deg)); box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px var(--tok-bg), 0 6px 10px -4px rgba(0,0,0,.35); }

/* the stamp that just lit up */
.stamp.just-lit .stamp__face { animation: lit .9s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes lit {
  0% { transform: scale(.4) rotate(-30deg); opacity: .2; }
  55% { transform: scale(1.18) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
@media (prefers-reduced-motion: reduce) { .stamp.just-lit .stamp__face, .ohc__ready-dot { animation: none !important; } }

/* ------------------------------------------------------------------ points */
.pts { display: flex; align-items: baseline; gap: 2cqi; }
.pts__num { font-family: var(--f-display); font-size: 21cqi; font-weight: 800; line-height: .9; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pts__unit { font-size: max(11px, 3.4cqi); text-transform: uppercase; letter-spacing: .16em; color: var(--sec); font-weight: 600; }
.pts__rewards { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.pchip {
  position: relative; overflow: hidden;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 12px;
  border: 1.5px solid color-mix(in srgb, var(--text) 22%, transparent);
  font-size: max(12px, 3.4cqi); font-weight: 600;
}
.pchip__cost { font-variant-numeric: tabular-nums; opacity: .7; font-weight: 700; }
.pchip__cost::after { content: " pts"; font-weight: 500; }
.pchip__bar { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--pct); background: var(--acc); }
.pchip.is-on { background: var(--tok-bg); color: var(--tok-fg); border-color: var(--tok-bg); }
.pchip.is-on .pchip__cost { opacity: 1; }
.pchip.is-on .pchip__cost::before { content: "✓ "; }

/* ------------------------------------------------------------------ reward ready */
.ohc__ready {
  margin: 0 var(--pad) 4px; padding: 12px 14px; border-radius: 14px;
  background: var(--acc); color: var(--bg);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 10px;
  font-size: max(13px, 3.8cqi);
}
.ohc__ready b { font-weight: 800; }
.ohc__ready-hint { grid-column: 2 / -1; font-size: max(11px, 3cqi); opacity: .85; }
.ohc__ready-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; grid-row: span 2; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); } 50% { box-shadow: 0 0 0 7px transparent; } }

/* ------------------------------------------------------------------ meta, qr, footer */
.ohc__meta { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 14px var(--pad) 0; }
.ohc__meta div { min-width: 0; }
.ohc__meta .r { text-align: right; }
.ohc__meta dt { font-size: max(10px, 2.6cqi); letter-spacing: .15em; text-transform: uppercase; color: var(--sec); font-weight: 600; margin-bottom: 3px; }
.ohc__meta dd { margin: 0; font-size: max(13px, 4cqi); font-weight: 600; overflow-wrap: anywhere; }
.ohc__qr { display: grid; justify-items: center; gap: 8px; padding: 20px var(--pad) 4px; }
.ohc__qrbox { width: min(46cqi, 190px); aspect-ratio: 1; background: #fff; border-radius: 14px; padding: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.ohc__qrbox svg { display: block; width: 100%; height: 100%; }
.ohc__qrbox--ph { display: grid; place-items: center; }
.ohc__qrbox--ph span { width: 78%; height: 78%; background:
  conic-gradient(from 90deg at 1px 1px, #0000 90deg, #1a1a1a 0) 0 0 / 14% 14%; border-radius: 4px; opacity: .85;
  -webkit-mask: linear-gradient(#000 0 0); }
.ohc__code { font: 600 max(11px, 3cqi)/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .14em; color: var(--sec); }
.ohc__foot { margin: 0; padding: 14px var(--pad) var(--pad); font-size: max(11px, 3.1cqi); color: var(--sec); text-align: center; }
.ohc > :last-child:not(.ohc__foot) { margin-bottom: var(--pad); }

/* ================================================================== THEMES */

/* -- Bold editorial café: masthead, hairlines, numbered index stamps */
.ohc--editorial { --r: 6px; }
.ohc--editorial .ed-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.ohc--editorial .ed-no { font: 600 max(10px, 2.9cqi)/1 var(--f-body); letter-spacing: .12em; color: var(--sec); }
.ohc--editorial .ohc__name { font-weight: 800; font-variation-settings: "opsz" 144; letter-spacing: -.035em; }
.ohc--editorial .ohc__name.n-xl { font-size: 19cqi; }
.ohc--editorial .ohc__name.n-l { font-size: 14cqi; }
.ohc--editorial .ed-rule { height: 5px; margin-top: 14px; border-top: 1.5px solid var(--text); border-bottom: 1px solid var(--text); }
.ohc--editorial .ohc__band { margin-top: 6px; }
.ohc--editorial .stamp__face { border-radius: 50%; }
.ohc--editorial .stamp.is-empty .stamp__face { border-style: solid; border-width: 1px; opacity: .45; }
.ohc--editorial .stamp.is-empty .stamp__icon { display: none; }
.ohc--editorial .stamp.is-empty .stamp__num { opacity: 1; font-family: var(--f-display); font-size: max(12px, 4.4cqi); font-weight: 600; font-style: italic; }
.ohc--editorial .stamp.is-earned .stamp__face { background: var(--acc); color: var(--bg); box-shadow: none; }
.ohc--editorial .stamp__goal { background: var(--text); }
.ohc--editorial .ohc__meta { border-top: 1px solid color-mix(in srgb, var(--text) 30%, transparent); margin: 0 var(--pad); padding-inline: 0; }
.ohc--editorial .ohc__ready { border-radius: 2px; }

/* -- Warm bakery: arched window, italic serif, soft square buns, scalloped hem */
.ohc--bakery { --r: 28px; }
.ohc--bakery .ohc__head { padding-top: 14px; }
.ohc--bakery .bk-arch {
  text-align: center; display: grid; justify-items: center; gap: 6px;
  padding: 26px 18px 22px; border-radius: 999px 999px 18px 18px / 220px 220px 18px 18px;
  background: color-mix(in srgb, var(--pri) 12%, var(--bg));
  border: 1.5px solid color-mix(in srgb, var(--pri) 35%, transparent);
}
.ohc--bakery .bk-orn { color: var(--acc); font-size: 14px; }
.ohc--bakery .ohc__name { font-style: italic; font-weight: 700; letter-spacing: -.01em; }
.ohc--bakery .ohc__logo { margin-inline: auto; }
.ohc--bakery .ohc__tag { letter-spacing: .22em; font-size: max(9px, 2.5cqi); }
.ohc--bakery .ohc__band { margin: 14px var(--pad) 0; padding: 16px 14px; border-radius: 22px; background: color-mix(in srgb, var(--pri) 7%, var(--bg)); }
.ohc--bakery .stamp.is-earned .stamp__face { background: var(--acc); color: var(--bg); }
.ohc--bakery .stamp.is-empty .stamp__face { border-style: dotted; border-width: 2px; }
.ohc--bakery .ohc__meta { text-align: center; }
.ohc--bakery::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; z-index: 2;
  background: radial-gradient(circle at 10px 12px, color-mix(in srgb, var(--pri) 22%, var(--bg)) 6px, transparent 6.5px) 0 0 / 20px 12px repeat-x;
}
.ohc--bakery .ohc__foot { font-family: var(--f-display); font-style: italic; font-size: max(13px, 3.8cqi); padding-bottom: calc(var(--pad) + 8px); }

/* -- Minimal espresso bar: lots of black, tally bars, monospace */
.ohc--espresso { --r: 14px; letter-spacing: .01em; }
.ohc--espresso .es-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ohc--espresso .ohc__name { font-weight: 500; text-transform: uppercase; letter-spacing: .2em; line-height: 1.15; }
.ohc--espresso .ohc__name.n-xl, .ohc--espresso .ohc__name.n-l { font-size: 6cqi; }
.ohc--espresso .ohc__name.n-m, .ohc--espresso .ohc__name.n-s { font-size: 4.6cqi; }
.ohc--espresso .es-count { font: 500 14cqi/0.85 var(--f-body); letter-spacing: -.04em; color: var(--acc); font-variant-numeric: tabular-nums; }
.ohc--espresso .es-count i { font-style: normal; color: var(--sec); font-size: .38em; letter-spacing: 0; }
.ohc--espresso .ohc__tag { margin-top: 8px; font: 400 max(10px, 2.8cqi)/1.4 var(--f-body); letter-spacing: .04em; text-transform: none; }
.ohc--espresso .ohc__band { margin-top: 44px; }
.ohc--espresso .stamps { gap: 1.4cqi; }
.ohc--espresso .stamp { aspect-ratio: .32; max-width: none; }
.ohc--espresso .stamp__face { border-radius: 3px; }
.ohc--espresso .stamp__icon, .ohc--espresso .stamp__goal { display: none; }
.ohc--espresso .stamp.is-earned .stamp__face { background: var(--acc); box-shadow: none; }
.ohc--espresso .stamp.is-empty .stamp__face { border: 1px solid currentColor; opacity: .3; }
.ohc--espresso .stamp.is-goal.is-empty .stamp__face { border-color: var(--acc); color: var(--acc); opacity: .9; border-style: dashed; }
.ohc--espresso .ohc__meta dd, .ohc--espresso .ohc__meta dt { font-family: var(--f-body); }
.ohc--espresso .ohc__meta dd { font-weight: 500; }
.ohc--espresso .pts__num { font-family: var(--f-body); font-weight: 500; color: var(--acc); }
.ohc--espresso .pchip { border-radius: 4px; border-width: 1px; }
.ohc--espresso .ohc__ready { border-radius: 4px; }
.ohc--espresso .ohc__foot { font-family: var(--f-body); text-align: left; }

/* -- Playful taco shop: zig-zag crown, chunky type, tilted stickers, stripe band */
.ohc--taco { --r: 18px; }
.ohc--taco::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 14px; z-index: 2;
  background: linear-gradient(135deg, var(--pri) 25%, transparent 25%) -7px 0 / 14px 14px,
              linear-gradient(225deg, var(--pri) 25%, transparent 25%) -7px 0 / 14px 14px;
}
.ohc--taco .ohc__head { padding-top: calc(var(--pad) + 10px); }
.ohc--taco .tc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ohc--taco .ohc__name { font-weight: 800; letter-spacing: -.045em; line-height: .88; color: var(--pri); text-shadow: 2px 2px 0 var(--text); }
.ohc--taco .tc-badge {
  flex-shrink: 0; display: grid; place-items: center; width: 19cqi; aspect-ratio: 1; border-radius: 50%;
  background: var(--text); color: var(--bg); font: 800 6.4cqi/1 var(--f-display); transform: rotate(10deg);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text);
}
.ohc--taco .tc-badge small { display: block; font-size: .45em; opacity: .8; }
.ohc--taco .tc-tag {
  display: inline-block; margin-top: 12px; padding: 5px 10px; border-radius: 6px; transform: rotate(-2deg);
  background: var(--sec); color: var(--bg); letter-spacing: .06em; font-weight: 800;
}
.ohc--taco .ohc__band { margin: 18px var(--pad) 0; border-radius: 16px; padding: 18px 12px; background: var(--bg); border: 2.5px solid var(--text); }
.ohc--taco.tex-stripes .ohc__band { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--text) 7%, var(--bg)) 0 9px, var(--bg) 9px 18px); }
.ohc--taco .stamp.is-earned .stamp__face { background: var(--pri); color: var(--bg); }
.ohc--taco .stamp.is-empty .stamp__face { border-width: 2px; }
.ohc--taco .stamp { max-width: 72px; }
.ohc--taco .ohc__meta dd { font-family: var(--f-display); font-weight: 800; }
.ohc--taco .ohc__ready { background: var(--text); color: var(--bg); transform: rotate(-1deg); }

/* -- Modern burger: condensed caps, checkerboard band, white tokens */
.ohc--burger { --r: 22px; }
.ohc--burger .bg-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ohc--burger .ohc__name { font-weight: 400; text-transform: uppercase; letter-spacing: .01em; line-height: .9; }
.ohc--burger .ohc__name.n-xl { font-size: 14cqi; }
.ohc--burger .ohc__tag { margin-top: 6px; }
.ohc--burger .ohc__count b { font-family: var(--f-display); font-weight: 400; font-size: 8cqi; }
.ohc--burger .ohc__band { margin-top: 18px; padding: 22px var(--pad); }
.tex-checker .ohc__band {
  background-image:
    linear-gradient(45deg, color-mix(in srgb, var(--text) 10%, transparent) 25%, transparent 25%, transparent 75%, color-mix(in srgb, var(--text) 10%, transparent) 75%),
    linear-gradient(45deg, color-mix(in srgb, var(--text) 10%, transparent) 25%, transparent 25%, transparent 75%, color-mix(in srgb, var(--text) 10%, transparent) 75%);
  background-size: 15.2cqi 15.2cqi; background-position: 0 0, 7.6cqi 7.6cqi;
}
.ohc--burger .stamps { gap: 3.4cqi 2.6cqi; }
.ohc--burger .stamp.is-earned .stamp__face { background: var(--text); color: var(--bg); box-shadow: 0 4px 10px -3px rgba(0,0,0,.4); }
.ohc--burger .stamp.is-empty .stamp__face { border-style: dotted; border-width: 2px; opacity: .5; }
.ohc--burger .stamp__goal { background: var(--acc); color: #1a1a1a; }
.ohc--burger .pts__num { font-weight: 400; }
.ohc--burger .ohc__ready { color: #1a1a1a; }

/* -- Calm tea house: seal, mincho serif, wave band */
.ohc--tea { --r: 20px; }
.ohc--tea .te-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.ohc--tea .te-seal {
  display: grid; place-items: center; width: 11cqi; aspect-ratio: 1; border-radius: 50%;
  background: var(--pri); color: var(--bg); font: 800 5.6cqi/1 var(--f-display);
}
.ohc--tea .ohc__name { font-weight: 800; letter-spacing: .02em; line-height: 1; }
.ohc--tea .ohc__name.n-xl { font-size: 9.5cqi; }
.ohc--tea .ohc__name.n-l { font-size: 8cqi; }
.ohc--tea .ohc__name.n-m, .ohc--tea .ohc__name.n-s { font-size: 6.2cqi; }
.ohc--tea .ohc__tag { margin-top: 4px; letter-spacing: .2em; font-size: max(9px, 2.4cqi); }
.ohc--tea .ohc__band { margin-top: 18px; border-block: 1px solid color-mix(in srgb, var(--text) 14%, transparent); }
.tex-waves .ohc__band {
  background-image: radial-gradient(circle at 50% 100%, transparent 0 7px, color-mix(in srgb, var(--text) 11%, transparent) 7px 8.5px, transparent 8.5px 12px, color-mix(in srgb, var(--text) 11%, transparent) 12px 13.5px, transparent 13.5px);
  background-size: 30px 15px;
}
.ohc--tea .stamp.is-earned .stamp__face { background: color-mix(in srgb, var(--bg) 25%, #fffdf6); color: var(--pri); box-shadow: 0 3px 8px -2px rgba(0,0,0,.22), inset 0 0 0 1px color-mix(in srgb, var(--pri) 10%, transparent); }
.ohc--tea .stamp.is-goal.is-empty .stamp__face { border: 2px solid var(--pri); opacity: .75; }
.ohc--tea .stamp__goal { background: var(--bg); color: var(--pri); border: 1px solid var(--pri); }
.ohc--tea .ohc__meta dd { font-family: var(--f-display); font-weight: 700; }

/* generic texture options (any theme) */
.tex-dots .ohc__band { background-image: radial-gradient(color-mix(in srgb, var(--text) 13%, transparent) 1.2px, transparent 1.4px); background-size: 12px 12px; }
.tex-stripes:not(.ohc--taco) .ohc__band { background-image: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--text) 7%, transparent) 0 8px, transparent 8px 16px); }
.tex-grid .ohc__band { background-image: linear-gradient(color-mix(in srgb, var(--text) 8%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--text) 8%, transparent) 1px, transparent 1px); background-size: 16px 16px; }
.tex-checker:not(.ohc--burger) .ohc__band { background-size: 10cqi 10cqi; background-position: 0 0, 5cqi 5cqi; }
.tex-waves:not(.ohc--tea) .ohc__band { border-radius: 0; }

/* alignment option */
.align-center .ohc__head, .align-center .ohc__meta { text-align: center; }
.align-center .ohc__head .ohc__logo { margin-inline: auto; }
.align-center .ed-top, .align-center .es-top, .align-center .tc-top, .align-center .bg-top { justify-content: center; flex-wrap: wrap; }
.align-center .ohc__meta { justify-content: space-around; }
.align-center .ohc__meta .r { text-align: center; }
.lay-line .stamp__goal { display: none; }

/* Simple designs (simple_*): logo and name on the left, stamp count on the right. */
.ohc[class*="ohc--simple_"] .sp-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ohc[class*="ohc--simple_"] .sp-brand { min-width: 0; }
.ohc[class*="ohc--simple_"] .ohc__name { font-family: var(--f-display); font-weight: 800; letter-spacing: -.02em; line-height: 1.02; font-size: max(18px, 6.6cqi); margin: 0; overflow-wrap: anywhere; }
.ohc[class*="ohc--simple_"] .ohc__count { text-align: right; }

/* Emoji stamps: earned is full colour, empty is faded and grey. */
.stamp__emoji { width: 1.6em; height: 1.6em; object-fit: contain; display: block; margin: auto; }
.stamp.is-empty .stamp__emoji { opacity: .3; filter: grayscale(1); }
