/* PerkNextDoor: the one stylesheet.
   Mobile first (360-390 px), then wider screens. Light theme only. No web fonts, no gradients.
   Page groups may add assets/pages/<group>.css for things only they need; anything shared lives here.

   Contents
    1. Tokens             9. Chips, pills, segmented   17. Steps bar, stats, lists
    2. Base               10. Forms                    18. Tables (stack on phones)
    3. Layout             11. Cards and panels         19. Home: hero, how it works, features
    4. Header             12. Perk card                20. Pass page
    5. Mobile menu        13. Business header          21. Prose, FAQ
    6. Account menu       14. Notices and flashes      22. Error and holding pages
    7. Footer             15. Empty states             23. Utilities
    8. Buttons            16. Tabs, toast, spinner     24. Print
*/

/* ===================================================================== 1. Tokens */
:root {
  color-scheme: light;

  /* Brand palette (S/spec/BRAND.md) */
  --ink: #2A211C;          /* Espresso: text, headings, focus rings */
  --muted: #6B5A4D;        /* Cocoa: secondary text, hints */
  --brand: #B8432F;        /* Brick: the one action colour */
  --brand-dark: #973423;   /* Deep brick: hover / pressed */
  --accent: #2F6B4F;       /* Shop green: success, Live, Example (small doses) */
  --sun: #F2B134;          /* Sun: perk tags, chip highlights, always with ink text */
  --butter: #FCEBC6;       /* Butter: notices, info, example wash */
  --paper: #FBF5EA;        /* Page background */
  --card: #FFFFFF;         /* Cards, inputs */
  --line: #E8DCC8;         /* Decorative dividers and card borders */
  --field: #9A8670;        /* Form field borders: UI edges that must be seen (3:1) */
  --error: #A3261F;
  --error-tint: #FBE6E1;
  --ok-tint: #E3EFE7;

  /* Derived shades */
  --paper-deep: #F3E8D6;   /* Bands, track backgrounds */
  --line-strong: #D6C3A5;  /* Secondary button and chip borders */
  --sun-deep: #D99A1E;     /* Edge of sun fills */
  --butter-line: #F0D69B;
  --ok-line: #B9D3C3;
  --error-line: #EFBDB2;
  --brand-tint: #F8E3DC;
  --placeholder: #857263;  /* 4.6:1 on white */
  --on-dark: #FBF5EA;
  --on-dark-muted: #D9CCBA;

  /* Category badges: one colour per category, white glyph on top (all at least 4.5:1) */
  --cat-food: #B8432F;
  --cat-cafe: #74472B;
  --cat-bakery: #B04F6B;
  --cat-bar: #7A2E4A;
  --cat-grocery: #2F6B4F;
  --cat-shop: #8A5A12;
  --cat-beauty: #8B4A8A;
  --cat-fitness: #B9531A;
  --cat-health: #2A7A6F;
  --cat-service: #4B5963;
  --cat-fun: #5E4FA2;
  --cat-other: #6B5A4D;

  /* Type: the system stack, headings 800 */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-xs: 0.8125rem;   /* 13 */
  --fs-sm: 0.875rem;    /* 14 */
  --fs-base: 1rem;      /* 16 */
  --fs-md: 1.125rem;    /* 18 */
  --fs-lg: 1.25rem;     /* 20 */
  --fs-xl: 1.5rem;      /* 24 */
  --fs-2xl: 1.875rem;   /* 30 */
  --fs-3xl: 2.375rem;   /* 38 */
  --fs-hero: clamp(2.375rem, 1.35rem + 4.6vw, 4.25rem);
  --lh: 1.5;
  --lh-tight: 1.12;
  --lh-snug: 1.3;

  /* Spacing scale */
  --s-1: 0.25rem;  --s-2: 0.5rem;  --s-3: 0.75rem;  --s-4: 1rem;   --s-5: 1.25rem;
  --s-6: 1.5rem;   --s-7: 2rem;    --s-8: 2.5rem;   --s-9: 3rem;   --s-10: 4rem;  --s-11: 5.5rem;
  --gutter: 1rem;

  /* Shape */
  --radius-card: 16px;
  --radius-btn: 12px;
  --radius-field: 10px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  /* Shadows: warm, tinted with espresso */
  --shadow-1: 0 1px 2px rgba(42, 33, 28, 0.06);
  --shadow-2: 0 1px 2px rgba(42, 33, 28, 0.05), 0 4px 14px rgba(42, 33, 28, 0.06);
  --shadow-3: 0 2px 6px rgba(42, 33, 28, 0.08), 0 16px 40px rgba(42, 33, 28, 0.14);

  /* Widths */
  --w-page: 68rem;
  --w-wide: 76rem;
  --w-narrow: 34rem;
  --w-text: 42rem;
  --header-h: 4rem;

  --focus: var(--ink);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --tap: 44px;
}
@media (min-width: 600px) { :root { --gutter: 1.5rem; } }
@media (min-width: 1024px) { :root { --gutter: 2rem; } }

/* Category hooks: any element with .cat-<key> gets --cat (badges, chips' dots, radar dots). */
.cat-food { --cat: var(--cat-food); }
.cat-cafe { --cat: var(--cat-cafe); }
.cat-bakery { --cat: var(--cat-bakery); }
.cat-bar { --cat: var(--cat-bar); }
.cat-grocery { --cat: var(--cat-grocery); }
.cat-shop { --cat: var(--cat-shop); }
.cat-beauty { --cat: var(--cat-beauty); }
.cat-fitness { --cat: var(--cat-fitness); }
.cat-health { --cat: var(--cat-health); }
.cat-service { --cat: var(--cat-service); }
.cat-fun { --cat: var(--cat-fun); }
.cat-other { --cat: var(--cat-other); }

/* ===================================================================== 2. Base */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-tap-highlight-color: rgba(42, 33, 28, 0.08);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip; /* safety net: a stray long word never makes the page scroll sideways */
}

h1, h2, h3, h4, h5 {
  margin: 0 0 0.5em;
  color: var(--ink);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-2xl); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
h5 { font-size: var(--fs-base); }
@media (min-width: 768px) {
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }
}

p, ul, ol, dl, figure, blockquote, pre, table, fieldset { margin: 0 0 var(--s-4); }
:where(p, ul, ol, dl, h1, h2, h3, h4, h5, figure, blockquote, fieldset):last-child { margin-bottom: 0; }
ul, ol { padding-left: 1.4em; }
li + li { margin-top: 0.25em; }
p, li, dd, td, th, label, legend, h1, h2, h3, h4 { overflow-wrap: break-word; }
strong, b { font-weight: 700; }
small { font-size: var(--fs-sm); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-7) 0; }

a {
  color: var(--brand);
  text-decoration-line: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--brand-dark); text-decoration-thickness: 0.13em; }

img, svg, video { max-width: 100%; }
img { height: auto; border-style: none; }

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

::selection { background: var(--butter); color: var(--ink); }

:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::marker { content: ""; }

/* Icons from the sprite: icon('pin') */
.icon {
  display: inline-block;
  flex: none;
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.27em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}
.icon-sm { width: 1em; height: 1em; vertical-align: -0.15em; }
.icon-lg { width: 1.5em; height: 1.5em; vertical-align: -0.35em; }
.icon-xl { width: 2rem; height: 2rem; }

/* Category badge: cat_icon('cafe'), sizes sm / (default) / lg / xl */
.cat-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--cat, var(--cat-other));
  color: #fff;
  vertical-align: middle;
}
.cat-icon .icon { width: 58%; height: 58%; vertical-align: 0; stroke-width: 2.1; }
.cat-icon-sm { width: 1.75rem; height: 1.75rem; }
.cat-icon-lg { width: 3.5rem; height: 3.5rem; }
.cat-icon-lg .icon { stroke-width: 1.9; }
.cat-icon-xl { width: 4.5rem; height: 4.5rem; }
.cat-icon-xl .icon { stroke-width: 1.8; }

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--s-3);
  top: -6rem;
  z-index: 200;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-btn);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: var(--s-3); color: #fff; }

/* ===================================================================== 3. Layout */
.site-main {
  flex: 1 0 auto;
  width: min(100% - 2 * var(--gutter), var(--w-page));
  margin-inline: auto;
  padding-block: var(--s-6) var(--s-10);
}
.site-main:focus { outline: none; }
.site-main-wide { width: min(100% - 2 * var(--gutter), var(--w-wide)); }
.site-main-bare { width: 100%; padding: 0; }
@media (min-width: 768px) { .site-main { padding-top: var(--s-8); } .site-main-bare { padding: 0; } }

.container { width: min(100% - 2 * var(--gutter), var(--w-page)); margin-inline: auto; }
.container-wide { width: min(100% - 2 * var(--gutter), var(--w-wide)); margin-inline: auto; }
.narrow { max-width: var(--w-narrow); margin-inline: auto; }
.measure { max-width: var(--w-text); }

/* Page title block */
.page-head { margin-bottom: var(--s-7); }
.page-head h1 { margin-bottom: var(--s-2); }
.page-head .lede { margin-top: var(--s-2); }
.page-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-4); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin: 0 0 var(--s-2);
  color: var(--brand);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lede { font-size: var(--fs-md); color: var(--muted); line-height: 1.45; max-width: var(--w-text); }
@media (min-width: 768px) { .lede { font-size: var(--fs-lg); } }
.back-link {
  display: flex;   /* its own line, also when an eyebrow follows it */
  width: fit-content;
  align-items: center;
  gap: 0.35rem;
  min-height: var(--tap);
  margin: calc(-1 * var(--s-3)) 0 var(--s-2);
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover { color: var(--ink); }

.section { margin-block: var(--s-9); }
.section:first-child { margin-top: 0; }
.section:last-child { margin-bottom: 0; }
@media (min-width: 768px) { .section { margin-block: var(--s-10); } }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2) var(--s-4);
  margin-bottom: var(--s-5);
}
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); }
.section-head > a { display: inline-flex; align-items: center; min-height: var(--tap); }

/* Full-width colour band inside the page container (no horizontal scroll):
   <section class="band"> ... </section> */
.band {
  --band: var(--paper-deep);
  background: var(--band);
  box-shadow: 0 0 0 100vmax var(--band);
  clip-path: inset(0 -100vmax);
  padding-block: var(--s-9);
}
.band-butter { --band: var(--butter); }
.band-white { --band: var(--card); }
/* Brick text links on the band colours are just under 4.5:1; plain links there use deep brick (6.1:1) */
.band :where(a:not([class])) { color: var(--brand-dark); }
.band-ink { --band: var(--ink); color: var(--on-dark); }
.band-ink h2, .band-ink h3 { color: #fff; }
.band-ink .eyebrow, .panel-ink .eyebrow, .notice-ink .eyebrow { color: var(--sun); } /* brick on espresso is too faint */
.band-ink a:not(.btn) { color: #fff; }
.band-ink :focus-visible, .panel-ink :focus-visible { outline-color: var(--sun); }
@media (min-width: 768px) { .band { padding-block: var(--s-10); } }

/* Layout helpers */
.stack > * { margin-block: 0; }
.stack > :not(:first-child) { margin-block-start: var(--stack-gap, var(--s-4)); }
.stack-xs { --stack-gap: var(--s-1); }
.stack-sm { --stack-gap: var(--s-2); }
.stack-lg { --stack-gap: var(--s-7); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--s-3)); }
.cluster-sm { --cluster-gap: var(--s-2); }
.cluster-end { justify-content: flex-end; }
.cluster-between { justify-content: space-between; }
.grid {
  display: grid;
  gap: var(--grid-gap, var(--s-4));
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--grid-min, 19rem)), 1fr));
}
.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--grid-gap, var(--s-4)); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { --grid-gap: var(--s-5); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.split { display: grid; gap: var(--s-7); }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; } }

/* ===================================================================== 4. Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
}
/* The background and blur sit on a layer behind the header so the header itself stays a normal box
   (a backdrop-filter on it would trap the menu's full-screen dimmer inside it). */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(251, 245, 234, 0.94);
  -webkit-backdrop-filter: saturate(1.5) blur(12px);
  backdrop-filter: saturate(1.5) blur(12px);
}
/* The header and footer use the same width as the page content (68rem, or 76rem on 'wide' pages:
   body.is-wide), so the logo, the headings and the footer share one left edge. */
.header-inner {
  width: min(100% - 2 * var(--gutter), var(--w-page));
  height: var(--header-h);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: var(--s-4);
}
.logo {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding-block: 4px;
  margin-right: auto;
  border-radius: 6px;
}
.logo img { display: block; width: auto; height: 36px; }
@media (max-width: 374px) { .logo img { height: 32px; } }
/* Under 360 px (small phones, large display settings, 400% zoom) the Menu button shows its icon only, so the
   header fits in 320 px; the words stay for screen readers. */
@media (max-width: 359px) {
  .header-inner { gap: var(--s-2); }
  .menu-button { justify-content: center; min-width: var(--tap); padding-inline: 0.55rem; }
  .menu-button .label-open, .menu-button .label-close {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

.nav-desktop { display: none; }
@media (min-width: 900px) {
  .nav-desktop { display: flex; align-items: center; gap: var(--s-1); }
  .nav-mobile { display: none; }
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0 0.8rem;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover { background: rgba(42, 33, 28, 0.06); color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--butter); color: var(--ink); }
.nav-desktop .btn { margin-left: var(--s-2); }

/* ===================================================================== 5. Mobile menu (<details>, works without JS) */
.nav-mobile { position: static; }
.menu-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: var(--tap);
  padding: 0 0.85rem 0 0.7rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-btn);
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  user-select: none;
}
.menu-button:hover { border-color: var(--field); }
.menu-button .icon-close, .nav-mobile[open] .menu-button .icon-menu,
.menu-button .label-close, .nav-mobile[open] .menu-button .label-open { display: none; }
.nav-mobile[open] .menu-button .label-close { display: inline; }
.nav-mobile[open] .menu-button .icon-close { display: inline-block; }
.nav-mobile[open] .menu-button { background: var(--ink); border-color: var(--ink); color: #fff; }
.nav-mobile[open]::before {
  content: "";
  position: fixed;
  inset: var(--header-h) 0 0;
  background: rgba(42, 33, 28, 0.32);
}
.nav-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  max-height: calc(100vh - var(--header-h));
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  padding: var(--s-3) var(--gutter) var(--s-6);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-3);
}
.nav-mobile[open] .nav-panel { animation: drop-in 0.18s var(--ease); }
@keyframes drop-in { from { transform: translateY(-6px); } to { transform: none; } }
.nav-panel .inline-form { display: block; }
.nav-panel .inline-form .btn { width: 100%; }
.nav-list { list-style: none; margin: 0 0 var(--s-4); padding: 0; }
.nav-list li { margin: 0; border-bottom: 1px solid var(--line); }
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 3.5rem;
  padding: 0 var(--s-1);
  color: var(--ink);
  font-size: var(--fs-md);
  font-weight: 700;
  text-decoration: none;
}
.nav-item .icon { color: var(--muted); }
.nav-item .icon:last-child { margin-left: auto; color: var(--line-strong); }
.nav-item:hover, .nav-item[aria-current="page"] { color: var(--brand); }
.nav-item[aria-current="page"] .icon:first-child { color: var(--brand); }
.nav-who { margin: var(--s-4) 0 0; color: var(--muted); font-size: var(--fs-sm); text-align: center; overflow-wrap: anywhere; }

/* ===================================================================== 6. Account menu (desktop dropdown) */
.menu { position: relative; }
.menu > summary { gap: 0.5rem; padding-left: 0.4rem; }
.menu > summary .icon { color: var(--muted); transition: transform 0.15s; }
.menu[open] > summary { background: rgba(42, 33, 28, 0.06); }
.menu[open] > summary .icon { transform: rotate(180deg); }
.menu-name { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 800;
  text-transform: uppercase;
}
.menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  width: 16rem;
  padding: var(--s-2);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-3);
  animation: drop-in 0.15s var(--ease);
}
.menu-who {
  margin: 0 0 var(--s-2);
  padding: var(--s-2) var(--s-3) var(--s-3);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.menu-who strong { display: block; color: var(--ink); }
.menu-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 2.75rem;
  padding: 0 var(--s-3);
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  text-decoration: none;
}
.menu-item:hover { background: var(--paper); color: var(--ink); }
.menu-item .icon { color: var(--muted); }
.menu-pop .inline-form { display: block; margin-top: var(--s-1); padding-top: var(--s-1); border-top: 1px solid var(--line); }
/* button_post() prints text only, so the log-out icon is drawn here (a data: image, allowed by the CSP) */
.menu-pop .inline-form .menu-item::before {
  content: "";
  flex: none;
  width: 1.25em;
  height: 1.25em;
  background-color: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 20.5H6A2.5 2.5 0 0 1 3.5 18V6A2.5 2.5 0 0 1 6 3.5h3.5M15.5 7.5L20 12l-4.5 4.5M20 12H9'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 20.5H6A2.5 2.5 0 0 1 3.5 18V6A2.5 2.5 0 0 1 6 3.5h3.5M15.5 7.5L20 12l-4.5 4.5M20 12H9'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ===================================================================== 7. Footer */
.site-footer {
  margin-top: auto;
  background: var(--ink);
  color: var(--on-dark-muted);
  font-size: var(--fs-sm);
}
.footer-inner {
  width: min(100% - 2 * var(--gutter), var(--w-page));
  margin-inline: auto;
  padding: var(--s-9) 0 var(--s-7);
  display: grid;
  gap: var(--s-7);
}
@media (min-width: 768px) { .footer-inner { grid-template-columns: minmax(0, 1fr) auto; align-items: start; } }
.footer-brand { display: flex; gap: var(--s-4); align-items: flex-start; }
.footer-brand img { display: block; width: auto; height: 40px; flex: none; }
.footer-tag { margin: 0 0 var(--s-1); color: #fff; font-size: var(--fs-md); font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; }
.footer-text { margin: 0; max-width: 24rem; }
.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: var(--s-1) var(--s-7);
}
@media (min-width: 768px) { .footer-nav ul { grid-template-columns: repeat(3, max-content); } }
.footer-nav li { margin: 0; }
.site-footer a { color: var(--on-dark); font-weight: 600; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-nav a { display: inline-flex; align-items: center; min-height: var(--tap); }
.site-footer :focus-visible { outline-color: var(--sun); }
.footer-bottom {
  width: min(100% - 2 * var(--gutter), var(--w-page));
  margin-inline: auto;
  padding: var(--s-3) 0 var(--s-6);
  border-top: 1px solid rgba(251, 245, 234, 0.14);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 var(--s-5);
}
.footer-bottom p { margin: 0; }
/* Standalone links are full-size tap targets (the text keeps its place; the box grows around it) */
.footer-bottom a { display: inline-flex; align-items: center; min-height: var(--tap); }
.footer-logo { display: block; flex: none; padding: 2px 3.5px; margin: -2px -3.5px; border-radius: 8px; }
.is-wide .header-inner, .is-wide .footer-inner, .is-wide .footer-bottom { width: min(100% - 2 * var(--gutter), var(--w-wide)); }

/* ===================================================================== 8. Buttons */
.btn {
  --btn-bg: var(--card);
  --btn-fg: var(--ink);
  --btn-border: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.5rem 1.15rem;
  border: 1.5px solid var(--btn-border);
  border-radius: var(--radius-btn);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  -webkit-user-select: none;
  user-select: none;
}
.btn:hover { --btn-border: var(--field); color: var(--btn-fg); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 1.2em; height: 1.2em; vertical-align: 0; }
.btn-secondary { /* same as .btn: white with a visible edge */ }
.btn-primary {
  --btn-bg: var(--brand);
  --btn-fg: #fff;
  --btn-border: var(--brand);
  box-shadow: 0 1px 2px rgba(42, 33, 28, 0.12), inset 0 -2px 0 rgba(42, 33, 28, 0.16);
}
.btn-primary:hover { --btn-bg: var(--brand-dark); --btn-border: var(--brand-dark); }
.btn-dark { --btn-bg: var(--ink); --btn-fg: #fff; --btn-border: var(--ink); }
.btn-dark:hover { --btn-bg: #43362E; --btn-border: #43362E; }
.btn-sun { --btn-bg: var(--sun); --btn-fg: var(--ink); --btn-border: var(--sun-deep); }
.btn-sun:hover { --btn-bg: #F5BE52; --btn-border: var(--sun-deep); }
.btn-light { --btn-bg: #fff; --btn-fg: var(--brand-dark); --btn-border: #fff; }
.btn-light:hover { --btn-bg: var(--paper); --btn-border: var(--paper); --btn-fg: var(--brand-dark); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--brand); --btn-border: transparent; box-shadow: none; }
.btn-ghost:hover { --btn-bg: var(--brand-tint); --btn-border: transparent; --btn-fg: var(--brand-dark); }
.btn-ghost-light { --btn-bg: transparent; --btn-fg: #fff; --btn-border: rgba(255, 255, 255, 0.55); box-shadow: none; }
.btn-ghost-light:hover { --btn-bg: rgba(255, 255, 255, 0.12); --btn-border: #fff; --btn-fg: #fff; }
.btn-danger { --btn-bg: var(--card); --btn-fg: var(--error); --btn-border: var(--error-line); }
.btn-danger:hover { --btn-bg: var(--error-tint); --btn-border: var(--error); --btn-fg: var(--error); }
.btn-danger-solid { --btn-bg: var(--error); --btn-fg: #fff; --btn-border: var(--error); }
.btn-danger-solid:hover { --btn-bg: #861C16; --btn-border: #861C16; }
.btn-lg { min-height: 3.5rem; padding-inline: 1.5rem; font-size: var(--fs-md); border-radius: 14px; }
.btn-sm { min-height: 2.25rem; padding: 0.3rem 0.8rem; font-size: var(--fs-sm); border-radius: 10px; gap: 0.35rem; }
@media (pointer: coarse) { .btn-sm { min-height: var(--tap); } }
.btn-block { display: flex; width: 100%; }
.btn-icon { width: 3rem; padding: 0; }
.btn-icon.btn-sm { width: 2.25rem; }
@media (pointer: coarse) { .btn-icon.btn-sm { width: var(--tap); } }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.is-static { cursor: default; pointer-events: none; }
.btn-group { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }

/* A <button> that looks like a link (e.g. "Resend" inside text) */
.link-btn {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.link-btn:hover { color: var(--brand-dark); }
.link-quiet { color: var(--ink); text-decoration: none; font-weight: 600; }
.link-quiet:hover { color: var(--brand); text-decoration: underline; }

/* button_post() form: sits inline with other buttons */
.inline-form { display: inline-flex; margin: 0; }
.inline-form > button:not([class]) { /* plain button_post() with no class */
  min-height: 2.5rem; padding: 0 0.9rem; border: 1.5px solid var(--line-strong); border-radius: 10px;
  background: var(--card); font-weight: 700;
}

/* ===================================================================== 9. Chips, pills, segmented control */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0 0.95rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
@media (pointer: coarse) { .chip { min-height: var(--tap); } }
.chip:hover { border-color: var(--field); color: var(--ink); }
/* Selected: sun fill plus an espresso edge (the fill alone is under 3:1 against white chips and the page) */
.chip[aria-pressed="true"], .chip[aria-current="true"], .chip[aria-current="page"], .chip.is-on {
  background: var(--sun);
  border-color: var(--ink);
  color: var(--ink);
}
.chip .dot { width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--cat, var(--muted)); flex: none; }
.chip .count { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .count, .chip[aria-current="true"] .count, .chip[aria-current="page"] .count, .chip.is-on .count { color: var(--ink); }
.chip-row {
  display: flex;
  gap: var(--s-2);
  margin: 0 calc(-1 * var(--gutter));
  padding: 2px var(--gutter) var(--s-2);
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.chip-row::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .chip-row { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; } }
.chip-list { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; margin: 0; padding: 0; }
.chip-list li { margin: 0; }

/* Small information chips (not buttons): distance, walk time, end date */
.chip-info {
  min-height: 1.875rem;
  padding: 0.2rem 0.65rem;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: normal;
  cursor: default;
  border-radius: 8px;
}
.chip-info:hover { border-color: transparent; }
.chip-info .icon { width: 1.05rem; height: 1.05rem; color: var(--muted); }
.chip-info.chip-strong { background: var(--ink); color: #fff; }
.chip-info.chip-strong .icon { color: var(--sun); }
.chip-info.chip-warn { background: var(--butter); }
.chip-info.chip-warn .icon { color: var(--ink); }

/* Status pills: biz_status_pill(), perk status */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.625rem;
  padding: 0.1rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--paper-deep);
  color: var(--ink);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  vertical-align: middle;
}
.pill::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; flex: none; }
.pill-plain::before { display: none; }
.pill-live { background: var(--ok-tint); color: var(--accent); }
.pill-paused { background: var(--paper-deep); color: var(--muted); }
.pill-off { background: var(--paper-deep); color: var(--muted); }
.pill-hidden { background: var(--error-tint); color: var(--error); }
.pill-warn { background: var(--sun); color: var(--ink); }
.pill-info { background: var(--butter); color: var(--ink); }
.pill-ink { background: var(--ink); color: #fff; }
.count-badge {
  display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 0.4rem;
  border-radius: var(--radius-pill); background: var(--ink); color: #fff; font-size: var(--fs-xs); font-weight: 800;
}

/* Segmented control: links, buttons or radio labels.
   <div class="segmented" role="group" aria-label="Range"><a href aria-current="true">1 mi</a>...</div> */
.segmented {
  display: inline-flex;
  max-width: 100%;
  padding: 4px;
  gap: 2px;
  border-radius: 13px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
}
.segmented > a, .segmented > button, .segmented > label > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4rem;
  min-height: 2.5rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
@media (pointer: coarse) { .segmented > a, .segmented > button, .segmented > label > span { min-height: 2.75rem; } }
.segmented > label { display: flex; margin: 0; position: relative; }
.segmented > label > input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented > a:hover, .segmented > button:hover, .segmented > label > span:hover { color: var(--ink); }
.segmented > [aria-current="true"], .segmented > [aria-current="page"], .segmented > [aria-pressed="true"],
.segmented > label > input:checked + span {
  background: var(--card);
  color: var(--ink);
  /* the espresso edge marks the choice (white on the track alone is 1.2:1) */
  box-shadow: inset 0 0 0 2px var(--ink), 0 1px 2px rgba(42, 33, 28, 0.12);
}
.segmented > label > input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.segmented-block { display: flex; }
.segmented-block > * { flex: 1; }

/* ===================================================================== 10. Forms */
.form { max-width: var(--w-narrow); }
.form-wide { max-width: var(--w-text); }
.field { margin: 0 0 var(--s-5); }
.field > label:where(:not(.check, .switch-row)), .label, legend {
  display: block;
  margin: 0 0 0.375rem;
  padding: 0;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.35;
}
.optional { margin-left: 0.35rem; color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }
.hint { margin: -0.125rem 0 0.5rem; color: var(--muted); font-size: var(--fs-sm); line-height: 1.4; }
.field-error {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0 0 0.5rem;
  color: var(--error);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.4;
}
.field-error .icon { width: 1.1rem; height: 1.1rem; margin-top: 0.05rem; }
.field.has-error { padding-left: var(--s-3); border-left: 3px solid var(--error); }

.input,
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"],
input[type="number"], input[type="date"], input[type="search"], input:not([type]), select, textarea {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--field);
  border-radius: var(--radius-field);
  background-color: var(--card);
  color: var(--ink);
  font-size: 1rem; /* 16 px: stops iOS zooming in */
  line-height: 1.35;
  box-shadow: inset 0 1px 2px rgba(42, 33, 28, 0.05);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
input[type="date"] { min-height: 3rem; }
input:hover, select:hover, textarea:hover { border-color: #85735E; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--placeholder); opacity: 1; }
input[readonly] { background: var(--paper); }
input:disabled, select:disabled, textarea:disabled { background: var(--paper-deep); color: var(--muted); cursor: not-allowed; }
textarea { min-height: 7rem; resize: vertical; }
select {
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232A211C' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 1.15rem;
  cursor: pointer;
}
[aria-invalid="true"], .has-error .input { border-color: var(--error); background-color: #FFFCFB; }
input[type="number"] { font-variant-numeric: tabular-nums; }

/* Password with show/hide (field('password', ...)) */
.input-wrap { position: relative; }
.input-wrap.has-reveal .input { padding-right: 5.5rem; }
.reveal {
  position: absolute;
  top: 50%;
  right: 0.3rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 2.75rem;
  padding: 0 0.6rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.reveal:hover { background: var(--paper); color: var(--ink); }
/* The "12 / 60" counter under a field (field() with 'count'); <span class="count"> in chips is styled with the chip */
p.count { margin: 0.35rem 0 0; color: var(--muted); font-size: var(--fs-xs); text-align: right; font-variant-numeric: tabular-nums; }
p.count.is-near { color: var(--error); font-weight: 700; }

/* Input + button on one line (town / ZIP search, copy link) */
.input-group { display: flex; gap: var(--s-2); }
.input-group > .input, .input-group > input { flex: 1 1 auto; min-width: 0; }
.input-group > .btn { flex: none; }
.copy-field { display: flex; gap: var(--s-2); }
.copy-field input { flex: 1 1 auto; min-width: 0; font-weight: 600; text-overflow: ellipsis; }

/* Checkboxes and radios */
input[type="checkbox"], input[type="radio"] {
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-height: var(--tap);
  padding: 0.6rem 0;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}
.check input { margin-top: 0.05rem; }
.check .hint { display: block; margin: 0.15rem 0 0; font-weight: 400; }
.field > .check { margin: 0; }

/* A list of checkboxes (e.g. neighbours) in a white box */
.choice-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
}
.choice-list li { margin: 0; border-top: 1px solid var(--line); }
.choice-list li:first-child { border-top: 0; }
.choice-list .check { padding: 0.75rem 1rem; align-items: center; }
.choice-list .check:hover { background: var(--paper); }
.choice-meta { display: block; color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }

/* Switch: <input type="checkbox" class="switch" role="switch"> */
input.switch {
  position: relative;
  width: 3.25rem;
  height: 2rem;
  border-radius: var(--radius-pill);
  background: var(--field); /* off: 3.5:1 against white, so the switch and its knob are seen */
  border: 0;
  box-shadow: inset 0 0 0 1.5px rgba(42, 33, 28, 0.18);
  transition: background-color 0.18s;
  -webkit-appearance: none;
  appearance: none;
  accent-color: auto;
}
input.switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(42, 33, 28, 0.3);
  transition: transform 0.18s var(--ease);
}
input.switch:checked { background: var(--accent); }
input.switch:checked::before { transform: translateX(1.25rem); }
input.switch:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-4);
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  cursor: pointer;
}
.switch-row .switch-text { display: block; font-weight: 700; line-height: 1.35; }
.switch-row .hint { display: block; margin: 0.2rem 0 0; font-weight: 400; }

/* Toggle that is a real submit button (works without JS): perk on/off on the dashboard */
.switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: var(--tap);
  padding: 0 0.25rem;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.switch-track {
  position: relative;
  width: 2.75rem;
  height: 1.625rem;
  border-radius: var(--radius-pill);
  background: var(--field);
  box-shadow: inset 0 0 0 1.5px rgba(42, 33, 28, 0.18);
  transition: background-color 0.18s;
}
.switch-track::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(42, 33, 28, 0.3);
  transition: transform 0.18s var(--ease);
}
.switch-btn[aria-pressed="true"] .switch-track { background: var(--accent); }
.switch-btn[aria-pressed="true"] .switch-track::before { transform: translateX(1.125rem); }

/* Windows high contrast (forced colours): backgrounds become one system colour, so switches, selected chips and
   segments get system-colour edges and fills that keep their state visible. */
@media (forced-colors: active) {
  input.switch, .switch-track { forced-color-adjust: none; background: Canvas; box-shadow: none; outline: 2px solid CanvasText; outline-offset: 0; }
  input.switch::before, .switch-track::before { background: CanvasText; box-shadow: none; }
  input.switch:checked, .switch-btn[aria-pressed="true"] .switch-track { background: Highlight; outline-color: Highlight; }
  input.switch:checked::before, .switch-btn[aria-pressed="true"] .switch-track::before { background: HighlightText; }
  input.switch:focus-visible { outline: 3px solid CanvasText; outline-offset: 2px; }
  .chip[aria-pressed="true"], .chip[aria-current="true"], .chip[aria-current="page"], .chip.is-on,
  .segmented > [aria-current="true"], .segmented > [aria-current="page"], .segmented > [aria-pressed="true"],
  .segmented > label > input:checked + span { outline: 3px solid Highlight; outline-offset: 1px; }
}

/* Radio cards: big tappable choices
   <div class="radio-cards"><div class="radio-card"><label class="radio-card-main"><input type="radio">
   <span class="radio-card-body"><strong class="radio-card-title">..</strong><span class="hint">..</span></span>
   </label><div class="radio-card-extra">optional controls</div></div></div> */
.radio-cards { display: grid; gap: var(--s-3); }
.radio-card {
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.radio-card:hover { border-color: var(--field); }
.radio-card:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: #FFFCF7; }
.radio-card-main { display: flex; align-items: flex-start; gap: 0.8rem; padding: var(--s-4); cursor: pointer; }
.radio-card-main input { margin-top: 0.1rem; }
.radio-card-body { display: block; min-width: 0; }
.radio-card-title { display: block; font-weight: 700; line-height: 1.35; }
.radio-card-body .hint { display: block; margin: 0.2rem 0 0; }
.radio-card-extra { padding: 0 var(--s-4) var(--s-4) calc(var(--s-4) + 2.175rem); }
.radio-card:not(:has(input:checked)) .radio-card-extra { display: none; }
.radio-card-extra .field { margin-bottom: 0; }

fieldset { border: 0; padding: 0; min-width: 0; }
legend { margin-bottom: 0.6rem; font-size: var(--fs-base); }
.legend-lg { font-size: var(--fs-md); }

.form-row { display: grid; gap: 0 var(--s-4); }
@media (min-width: 600px) {
  .form-row { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
  .form-row-address { grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1fr); }
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-7);
}
.form-actions .btn-primary { min-width: 10rem; }
@media (max-width: 599px) { .form-actions > .btn { flex: 1 1 100%; } }
.form-note { color: var(--muted); font-size: var(--fs-sm); }
.or {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: var(--s-5) 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.hp { display: none !important; }

/* ===================================================================== 11. Cards and panels */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-1);
  padding: var(--s-5);
}
@media (min-width: 600px) { .card { padding: var(--s-6); } }
.card-sm { padding: var(--s-4); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); margin-bottom: var(--s-4); }
.card-head h2, .card-head h3 { margin: 0; }
.card-title { font-size: var(--fs-lg); margin-bottom: var(--s-2); }
.card-foot { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.card-link { color: inherit; text-decoration: none; display: block; transition: box-shadow 0.15s, border-color 0.15s; }
.card-link:hover { color: inherit; border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: var(--s-5); }
.panel-paper { background: var(--paper-deep); border-color: transparent; }
.panel-butter { background: var(--butter); border-color: var(--butter-line); }
.panel-ink { background: var(--ink); border-color: var(--ink); color: var(--on-dark-muted); }
.panel-ink h2, .panel-ink h3, .panel-ink strong { color: #fff; }
.panel-ink a:not(.btn) { color: var(--sun); }
@media (min-width: 600px) { .panel { padding: var(--s-7); } }
.danger-zone { border: 1.5px solid var(--error-line); background: #FFFBFA; }
.danger-zone h2, .danger-zone h3 { color: var(--error); }

/* A business card on the dashboard */
.biz-card-head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); }
.biz-card-head h2, .biz-card-head h3 { margin: 0; font-size: var(--fs-lg); }
.biz-card-head .pill { margin-left: auto; }
.link-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.link-row > .btn { padding-inline: 0.6rem; }
/* Small phones: "QR code & signs" and "Invite neighbors" need a little more room inside their buttons */
@media (max-width: 379px) { .link-row > .btn { padding-inline: 0.35rem; gap: 0.25rem; font-size: 0.8125rem; } }
@media (min-width: 600px) { .link-row { display: flex; flex-wrap: wrap; } .link-row > .btn { padding-inline: 0.8rem; } }

/* QR code frame (signs, invite) */
.qr-frame {
  display: inline-block;
  padding: var(--s-4);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-2);
}
.qr-frame img { display: block; width: min(15rem, 62vw); height: auto; image-rendering: pixelated; }

/* ===================================================================== 12. Perk card */
.perk-list { display: grid; gap: var(--s-4); list-style: none; margin: 0; padding: 0; }
@media (min-width: 768px) {
  .perk-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); }
  .perk-list-1 { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1180px) { .perk-list-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.perk-list > li { margin: 0; }

.perk-card {
  --notch-bg: var(--paper);
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.perk-card:target { border-color: var(--sun-deep); box-shadow: 0 0 0 3px var(--sun), var(--shadow-2); }
@media (min-width: 400px) { .perk-card { --pad: var(--s-5); } }
.perk-card-body { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--pad, var(--s-4)) var(--pad, var(--s-4)) var(--s-4); flex: 1 0 auto; }

/* The business name links to its page; the link covers the whole row (badge, name, category), a 44 px target */
.perk-card-top { position: relative; display: flex; align-items: center; gap: var(--s-3); min-width: 0; min-height: var(--tap); }
.perk-biz { display: flex; flex-direction: column; min-width: 0; margin: 0; line-height: 1.25; }
.perk-biz-name {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}
a.perk-biz-name::after { content: ""; position: absolute; inset: 0; border-radius: 8px; }
a.perk-biz-name:hover { color: var(--brand); text-decoration: underline; }
a.perk-biz-name:focus-visible { outline: none; }
a.perk-biz-name:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }
.perk-biz-name .icon { width: 1rem; height: 1rem; color: var(--muted); vertical-align: -0.15em; }
.perk-biz-cat { color: var(--muted); font-size: var(--fs-sm); }

.perk-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.perk-title-text {
  /* a soft sun highlighter behind the lower half of the deal (lighter than a link underline, so a title
     that wraps onto two or three lines does not look like a row of links) */
  text-decoration-line: underline;
  text-decoration-color: #F8D27E;
  text-decoration-thickness: 0.42em;
  text-underline-offset: -0.3em;
  text-decoration-skip-ink: none;
}
@media (min-width: 768px) { .perk-title { font-size: 1.625rem; } }
.perk-details { margin: 0; color: var(--ink); line-height: 1.45; }

.perk-accepts {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.4;
}
.perk-accepts .icon { width: 1.25rem; height: 1.25rem; margin-top: 0.05rem; color: var(--muted); }
.perk-accepts.is-match { background: var(--ok-tint); }
.perk-accepts.is-match .icon { color: var(--accent); }

.perk-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.perk-meta li { margin: 0; }

/* the perforated tear line between the deal and the buttons */
.perk-perf { position: relative; height: 0; margin: 0 var(--pad, var(--s-4)); border-top: 2px dashed var(--line); }
.perk-perf::before, .perk-perf::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--notch-bg);
  box-shadow: inset 0 0 0 1px var(--line);
}
.perk-perf::before { left: calc(-1 * var(--pad, var(--s-4)) - 10px); }
.perk-perf::after { right: calc(-1 * var(--pad, var(--s-4)) - 10px); }

/* "Show to staff" + "Directions" side by side from 360 px up; they wrap (each full width) only below that */
.perk-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); padding: var(--s-4) var(--pad, var(--s-4)) var(--pad, var(--s-4)); }
.perk-actions > .btn { flex: 1 1 auto; padding-inline: 0.75rem; font-size: 0.9375rem; gap: 0.4rem; }
.perk-actions > .btn-primary { flex-grow: 3; }
@media (min-width: 400px) { .perk-actions > .btn { padding-inline: 0.95rem; } }

/* Owner variant (dashboard) */
.perk-owner-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 0.25rem var(--s-3) 0.25rem var(--pad, var(--s-4));
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.perk-owner-bar .inline-form { margin-left: auto; }
.perk-card-owner .perk-actions > .btn { flex: 0 1 auto; font-size: var(--fs-sm); padding-inline: 0.8rem; }
.perk-card-owner.is-off .perk-title, .perk-card-owner.is-off .perk-details { color: var(--muted); }
.perk-card-owner.is-off .perk-title-text { text-decoration-color: var(--line); }
.perk-card-owner.is-off .perk-accepts { background: var(--paper); }
/* Owner preview (store page) of a switched-on perk customers can't see yet: pill on top, the reason in butter */
.perk-preview-bar { padding-block: 0.6rem; }
.perk-not-showing {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: var(--butter);
  color: var(--ink);
  font-size: var(--fs-sm);
  line-height: 1.4;
}
.perk-not-showing .icon { width: 1.25rem; height: 1.25rem; margin-top: 0.05rem; }

/* Example variant (home page, perk form preview) */
.example-label {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  z-index: 1;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--ok-tint);
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.perk-card-example .perk-card-top { padding-right: 5.5rem; }

/* Cards sitting on white (inside a white panel) need white notches */
.on-white .perk-card, .band-white .perk-card { --notch-bg: var(--card); }
.band .perk-card { --notch-bg: var(--band); }

/* ===================================================================== 13. Business header (store page) */
.biz-header {
  position: relative;
  display: grid;
  gap: var(--s-4);
  padding: var(--s-5);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-1);
}
@media (min-width: 768px) { .biz-header { padding: var(--s-7); grid-template-columns: minmax(0, 1fr) minmax(0, 18rem); column-gap: var(--s-8); } }
.biz-header-top { display: flex; align-items: center; gap: var(--s-4); min-width: 0; }
@media (min-width: 768px) { .biz-header-top, .biz-blurb { grid-column: 1; } .biz-facts { grid-column: 2; grid-row: 1 / span 2; } }
.biz-header h1 { margin: 0; font-size: var(--fs-2xl); overflow-wrap: anywhere; }
@media (min-width: 768px) { .biz-header h1 { font-size: var(--fs-3xl); } }
.biz-cat { margin: 0.25rem 0 0; color: var(--muted); font-weight: 600; }
.biz-blurb { margin: 0; font-size: var(--fs-md); line-height: 1.5; }
/* Each fact is a 44 px row, so the phone number and the website are full-size tap targets */
.biz-facts { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; align-content: start;
  margin-block: calc((1.4em - var(--tap)) / 2); /* first and last lines of text stay where the card padding puts them */ }
.biz-facts li { display: flex; align-items: center; gap: 0.65rem; min-height: var(--tap); margin: 0; line-height: 1.4; overflow-wrap: anywhere; }
.biz-facts .icon { width: 1.25rem; height: 1.25rem; color: var(--muted); }
.biz-facts a { display: inline-flex; align-items: center; min-height: var(--tap); min-width: 0; font-weight: 600; }

/* ===================================================================== 14. Notices and flash messages */
.flashes { display: grid; gap: var(--s-2); margin-bottom: var(--s-6); }
.flash, .notice {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--butter-line);
  border-radius: 14px;
  background: var(--butter);
  color: var(--ink);
  line-height: 1.45;
}
.flash { font-weight: 600; }
.flash > .icon, .notice > .icon { width: 1.35rem; height: 1.35rem; margin-top: 0.02rem; }
.flash > p, .notice > p, .notice-body { margin: 0; flex: 1; min-width: 0; }
.notice-body > * { margin: 0; }
.notice-body > * + * { margin-top: var(--s-1); }
.notice .btn { flex: none; align-self: center; }
.flash-ok, .notice-ok { background: var(--ok-tint); border-color: var(--ok-line); }
.flash-ok > .icon, .notice-ok > .icon { color: var(--accent); }
.flash-error, .notice-error { background: var(--error-tint); border-color: var(--error-line); }
.flash-error > .icon, .notice-error > .icon { color: var(--error); }
.flash-info > .icon, .notice > .icon { color: var(--ink); }
.notice-sun { background: var(--sun); border-color: var(--sun-deep); }
.notice-ink { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }
.notice-ink > .icon { color: var(--sun); }
.notice-ink a:not(.btn) { color: #fff; }
.notice-plain { background: var(--card); border-color: var(--line); }
/* Error summary after a failed form post (error_summary()): app.js moves focus here when the page loads */
.error-list { margin: var(--s-2) 0 0; padding-left: 1.2em; }
.error-list li + li { margin-top: 0.15em; }
.error-list a { color: var(--error); font-weight: 700; }
[data-error-summary]:focus { outline: 3px solid var(--error); outline-offset: 2px; }
/* Phones: the words take the whole row beside the icon, and a button drops under them (never squeezes them). */
@media (max-width: 599px) {
  .notice { flex-wrap: wrap; }
  .notice > p, .notice > .notice-body { flex: 1 1 calc(100% - 2.05rem); }
  .notice .btn { margin-left: 2.05rem; }
}

/* Owner bar on a business page: "This is your page · Edit · QR sign" */
.owner-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
  margin-bottom: var(--s-5);
  padding: 0.6rem 0.6rem 0.6rem 1rem;
  border-radius: 14px;
  background: var(--ink);
  color: var(--on-dark);
  font-weight: 600;
}
.owner-bar .owner-bar-text { display: inline-flex; align-items: center; gap: 0.5rem; margin-right: auto; min-height: 2.25rem; }
@media (max-width: 599px) {
  .owner-bar { padding: 0.75rem; }
  .owner-bar .owner-bar-text { flex: 1 0 100%; padding-left: 0.25rem; }
  .owner-bar .btn { flex: 1 1 auto; }
}
.owner-bar .owner-bar-text .icon { color: var(--sun); }
.owner-bar .btn { --btn-bg: rgba(255, 255, 255, 0.1); --btn-fg: #fff; --btn-border: rgba(255, 255, 255, 0.28); box-shadow: none; }
.owner-bar .btn:hover { --btn-bg: rgba(255, 255, 255, 0.18); --btn-border: #fff; }
.owner-bar :focus-visible { outline-color: var(--sun); }

/* ===================================================================== 15. Empty states */
.empty-state {
  padding: var(--s-8) var(--s-5);
  background: var(--card);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-card);
  text-align: center;
}
.empty-art {
  display: grid;
  place-items: end center;
  width: 5.5rem;
  height: 6.25rem;
  margin: 0 auto var(--s-5);
  padding-bottom: 1.1rem;
  border-radius: 2.75rem 2.75rem 0.75rem 0.75rem;
  background: var(--butter);
}
.empty-art img { display: block; width: 2.9rem; height: auto; }
.empty-art .icon { width: 2.25rem; height: 2.25rem; margin-bottom: 0.4rem; color: var(--brand); }
.empty-state h2, .empty-state h3, .empty-title { margin: 0 0 var(--s-2); font-size: var(--fs-xl); }
.empty-state p { max-width: 30rem; margin-inline: auto; color: var(--muted); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3); margin-top: var(--s-5); }
@media (max-width: 599px) { .empty-actions > .btn { flex: 1 1 100%; } }

/* ===================================================================== 16. Tabs, toast, spinner */
.tabs {
  display: flex;
  gap: var(--s-1);
  margin: 0 calc(-1 * var(--gutter)) var(--s-6);
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .tabs { margin-inline: 0; padding: 0; } }
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: var(--tap);
  padding: 0 0.9rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"], .tabs a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--brand); }

.toast {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: calc(100% - 2rem);
  padding: 0.75rem 1.1rem;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-3);
  transform: translate(-50%, 0);
  transition: opacity 0.2s, transform 0.2s var(--ease);
}
.toast .icon { color: var(--sun); }
.toast.is-hidden { opacity: 0; transform: translate(-50%, 0.75rem); pointer-events: none; }

.spinner {
  display: inline-block;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}
.spinner-lg { width: 2.75rem; height: 2.75rem; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-9) var(--s-4);
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}

/* ===================================================================== 17. Steps bar, stats, lists */
.steps-bar { max-width: 34rem; margin: 0 0 var(--s-7); }
.steps-bar ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; counter-reset: none; }
.step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
}
.step + .step { margin: 0; }
.step::before {
  /* connector to the previous step */
  content: "";
  position: absolute;
  top: 1rem;
  right: calc(50% + 1.35rem);
  width: calc(100% - 2.7rem);
  height: 2px;
  background: var(--line-strong);
}
.step:first-child::before { display: none; }
.step.is-done::before, .step.is-current::before { background: var(--accent); }
.step-num {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--line-strong);
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 800;
}
.step-num .icon { width: 1rem; height: 1rem; stroke-width: 3; }
.step.is-done .step-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.is-done { color: var(--ink); }
.step.is-current { color: var(--ink); }
.step.is-current .step-num { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-tint); }
@media (min-width: 600px) { .step { font-size: var(--fs-sm); } }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); } }
/* Tiles in one row share their number / label / hint rows, so a label that wraps onto two lines
   ("Passes shown here") does not push its hint below the others. */
@supports (grid-template-rows: subgrid) {
  .stats > .stat-tile { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
}
.stat-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--s-4);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
/* The number comes first visually so numbers line up even when a label wraps */
.stat-label { order: 2; margin: var(--s-2) 0 0; color: var(--ink); font-size: var(--fs-sm); font-weight: 700; line-height: 1.3; }
.stat-value {
  order: 1;
  margin: 0;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-hint { order: 3; margin: var(--s-1) 0 0; color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
.stat-tile.is-highlight { background: var(--butter); border-color: var(--butter-line); }

/* Simple rows in a white box: top senders, joined businesses, neighbours */
.list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.list > li { margin: 0; }
.list > li + li { border-top: 1px solid var(--line); }
.list-row { display: flex; align-items: center; gap: var(--s-3); min-height: 3.5rem; padding: 0.6rem 1rem; color: inherit; text-decoration: none; }
a.list-row:hover { background: var(--paper); color: inherit; }
.list-row-main { flex: 1; min-width: 0; line-height: 1.3; }
.list-row-main strong { display: block; overflow-wrap: anywhere; }
.list-row-meta { color: var(--muted); font-size: var(--fs-sm); }
.list-row-end { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; }
.list-row > .icon:last-child { color: var(--line-strong); }

/* Key / value list (admin setup check) */
.kv { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; }
.kv > div { display: grid; gap: 0.15rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 600px) { .kv > div { grid-template-columns: 13rem minmax(0, 1fr); gap: var(--s-4); } }
.status-ok, .status-bad, .status-warn { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 700; }
.status-ok { color: var(--accent); }
.status-bad { color: var(--error); }
.status-warn { color: var(--muted); }

/* ===================================================================== 18. Tables (stack into rows on phones) */
/* A table that is still too wide scrolls inside its box; nothing is ever cut off */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); overflow-x: auto; overflow-y: hidden; }
.table { width: 100%; margin: 0; border-collapse: collapse; font-size: 0.9375rem; }
.table th {
  padding: 0.7rem 1rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.table td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FFFCF6; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .cell-main { font-weight: 700; }
.table .cell-main a { color: var(--ink); text-decoration: none; }
.table .cell-main a:hover { color: var(--brand); text-decoration: underline; }
.table .cell-sub { display: block; color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }
.table-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: flex-end; }
/* Tablets and narrow laptop windows: tighter cells, and the row's buttons stack in one column of equal width */
@media (min-width: 768px) and (max-width: 1099px) {
  .table th, .table td { padding-inline: 0.6rem; }
  .table th:first-child, .table td:first-child { padding-left: 1rem; }
  .table td .pill { white-space: normal; padding-block: 0.2rem; }
  .table-actions { flex-direction: column; align-items: stretch; }
  .table-actions > .inline-form > .btn { flex: 1 1 auto; }
}
@media (min-width: 1100px) { .table-actions { flex-wrap: nowrap; } }
.table .is-muted td { color: var(--muted); }
@media (max-width: 767px) {
  .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); }
  .table-stack tbody tr:last-child { border-bottom: 0; }
  .table-stack tbody tr:hover td { background: none; }
  .table-stack td { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--s-3); padding: 0.2rem 0; border: 0; text-align: left; overflow-wrap: anywhere; }
  .table-stack td::before { content: attr(data-label); color: var(--muted); font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; padding-top: 0.15rem; }
  .table-stack td:not([data-label])::before, .table-stack td[data-label=""]::before { display: none; }
  .table-stack td:not([data-label]), .table-stack td[data-label=""] { display: block; }
  .table-stack td.cell-main { padding-bottom: 0.35rem; font-size: var(--fs-base); }
  .table-stack td.num { text-align: left; }
  .table-stack td > .pill, .table-stack td > .btn, .table-stack td > .inline-form { justify-self: start; }
  .table-stack .table-actions { justify-content: flex-start; padding-top: 0.6rem; }
}
.table-foot { padding: 0.75rem 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); background: var(--paper); }

/* ===================================================================== 19. Home: hero, how it works, features */
.hero { display: grid; gap: var(--s-8); align-items: center; padding-block: var(--s-4) var(--s-8); }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: var(--s-10); padding-block: var(--s-7) var(--s-10); } }
.hero-title { margin: 0 0 var(--s-4); font-size: var(--fs-hero); line-height: 1.02; letter-spacing: -0.035em; }
.hero-title .hl { color: var(--brand); }
.hero-lede { margin: 0 0 var(--s-6); max-width: 33rem; color: var(--muted); font-size: var(--fs-md); line-height: 1.5; }
@media (min-width: 768px) { .hero-lede { font-size: var(--fs-lg); } }
.hero-actions { display: grid; gap: var(--s-4); max-width: 28rem; }
.hero-alt { margin: 0; }
.hero-alt label { display: block; margin-bottom: 0.4rem; color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.hero-art { position: relative; max-width: 26rem; width: 100%; margin-inline: auto; padding: 0 var(--s-4); }
.hero-arch {
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 5.6;
  border-radius: 999px 999px 28px 28px;
  background: var(--butter);
  border: 1px solid var(--butter-line);
}
.hero-arch img { width: 46%; height: auto; }
.hero-float {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 80%;
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.3;
}
.hero-float .icon { width: 1.5rem; height: 1.5rem; flex: none; }
.hero-float small { display: block; color: var(--muted); font-weight: 600; font-size: var(--fs-xs); }
.hero-float-1 { left: 0; top: 14%; }
.hero-float-1 .icon { color: var(--muted); }
.hero-float-2 { right: 0; bottom: 12%; background: var(--sun); border-color: var(--sun-deep); }
@media (max-width: 899px) { .hero-art { max-width: 18rem; } .hero-float { font-size: var(--fs-xs); padding: 0.55rem 0.75rem; } }

.how-steps { display: grid; gap: var(--s-4); list-style: none; margin: 0; padding: 0; }
@media (min-width: 768px) { .how-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); } }
.how-step {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s-4);
  align-items: start;
  align-content: start;
  margin: 0;
  padding: var(--s-5);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
@media (min-width: 768px) { .how-step { grid-template-columns: minmax(0, 1fr); padding: var(--s-6); } }
.how-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 4rem;
  border-radius: 1.75rem 1.75rem 0.6rem 0.6rem;
  background: var(--butter);
  color: var(--brand);
}
.how-art .icon { width: 1.75rem; height: 1.75rem; margin-top: 0.35rem; }
.how-num {
  position: absolute;
  top: -0.4rem;
  right: -0.55rem;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 800;
  border: 2px solid var(--card);
}
.how-step h3 { margin: 0 0 0.3rem; font-size: var(--fs-lg); }
.how-step p { margin: 0; color: var(--muted); }

.feature-list { display: grid; gap: var(--s-5); list-style: none; margin: 0; padding: 0; }
@media (min-width: 600px) { .feature-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); } }
.feature { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-3) var(--s-4); margin: 0; }
.feature-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 12px; background: var(--sun); color: var(--ink); }
.feature-icon .icon { width: 1.4rem; height: 1.4rem; }
.feature h3 { margin: 0.2rem 0 0.2rem; font-size: var(--fs-md); }
.feature p { margin: 0; color: var(--muted); }
.band-ink .feature p { color: var(--on-dark-muted); }

.sign-spot { display: grid; gap: var(--s-5); align-items: center; }
@media (min-width: 768px) { .sign-spot { grid-template-columns: auto minmax(0, 1fr); gap: var(--s-8); } }

/* ===================================================================== 20. Pass page (bare layout, full screen) */
.page-pass { background: var(--brand); color: #fff; }
.page-pass :focus-visible { outline-color: #fff; }
.page-pass a:not(.btn) { color: #fff; }
.pass {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  width: min(100% - 2rem, 34rem);
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  padding: max(0.75rem, env(safe-area-inset-top)) 0 max(1.5rem, env(safe-area-inset-bottom));
  text-align: center;
}
.pass-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 3.5rem; }
.pass-top img { display: block; width: auto; height: 26px; }
.pass-main { display: flex; flex-direction: column; align-items: center; gap: var(--s-4); flex: 1 0 auto; justify-content: center; }
.pass-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--sun);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pass-title {
  margin: 0;
  color: #fff;
  font-size: clamp(2.6rem, 11.5vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.pass-title.is-long { font-size: clamp(2rem, 8.5vw, 3.5rem); }
.pass-biz { margin: 0; font-size: var(--fs-lg); font-weight: 700; line-height: 1.3; }
.pass-biz span { font-weight: 600; }
.pass-ticket {
  width: 100%;
  margin: 0;
  padding: var(--s-4) var(--s-5);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 30px rgba(42, 33, 28, 0.25);
}
.pass-ticket p { margin: 0; }
.pass-ticket p + p { margin-top: var(--s-2); }
/* Staff read the ticket across the counter: the rule and the fine print are larger than body text */
/* (The "<Name> receipts count here" line, .pass-from, and .pass-takes are in pages/store.css.) */
.pass-rule { display: flex; gap: 0.6rem; align-items: flex-start; font-size: var(--fs-md); line-height: 1.4; }
.pass-rule .icon { width: 1.4rem; height: 1.4rem; margin-top: 0.05rem; color: var(--muted); flex: none; }
.pass-details { color: var(--muted); font-size: var(--fs-base); line-height: 1.4; }
.pass-live { display: flex; align-items: center; justify-content: center; gap: var(--s-4); margin: var(--s-2) 0 0; }
.pass-clock {
  margin: 0;
  color: #fff;
  font-size: clamp(2.75rem, 13vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.pass-clock small { font-size: 0.4em; font-weight: 700; letter-spacing: 0; margin-left: 0.15em; }
.pass-date { margin: var(--s-1) 0 0; font-size: var(--fs-md); font-weight: 600; opacity: 0.92; }
.pass-ring { position: relative; flex: none; width: 3.5rem; height: 3.5rem; }
.pass-ring::before, .pass-ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.pass-ring::before { border: 4px solid rgba(255, 255, 255, 0.28); border-top-color: var(--sun); border-right-color: var(--sun); animation: spin 2.4s linear infinite; }
.pass-ring::after { inset: 1rem; background: #fff; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(0.75); opacity: 0.75; } 50% { transform: scale(1); opacity: 1; } }
.pass-staff {
  margin: 0;
  padding: var(--s-3) var(--s-4);
  border-radius: 14px;
  background: rgba(42, 33, 28, 0.22);
  font-weight: 600;
  line-height: 1.4;
}
.pass-foot { display: grid; gap: var(--s-3); }

/* ===================================================================== 21. Prose, FAQ */
.prose { max-width: var(--w-text); font-size: 1.0625rem; line-height: 1.65; }
.prose h2 { margin: var(--s-8) 0 var(--s-3); font-size: var(--fs-xl); }
.prose h3 { margin: var(--s-6) 0 var(--s-2); font-size: var(--fs-lg); }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose li + li { margin-top: 0.4em; }
.prose .summary { padding: var(--s-4) var(--s-5); background: var(--butter); border-radius: 14px; border: 1px solid var(--butter-line); font-size: var(--fs-base); }

.faq { display: grid; gap: var(--s-2); max-width: var(--w-text); }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.faq details[open] { border-color: var(--line-strong); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  min-height: 3.5rem;
  padding: 0.75rem 1rem 0.75rem 1.15rem;
  font-weight: 700;
  line-height: 1.35;
}
.faq summary .icon { color: var(--muted); transition: transform 0.15s; }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq summary:hover { color: var(--brand); }
.faq .faq-a { padding: 0 1.15rem 1rem; color: var(--ink); }
.faq .faq-a > :last-child { margin-bottom: 0; }

/* ===================================================================== 22. Error and holding pages */
.error-page { max-width: 34rem; margin: 0 auto; padding: var(--s-7) 0 var(--s-4); text-align: center; }
.error-page::before {
  content: "";
  display: block;
  width: 6rem;
  height: 7rem;
  margin: 0 auto var(--s-6);
  border-radius: 3rem 3rem 0.75rem 0.75rem;
  background: var(--butter) url("mark.svg") center 62% / 3.1rem auto no-repeat;
}
.error-page h1 { margin-bottom: var(--s-3); }
.error-page p { color: var(--muted); font-size: var(--fs-md); }
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3); margin-top: var(--s-6) !important; }
@media (max-width: 599px) { .error-actions > .btn { flex: 1 1 100%; } }
.error-page .error-actions { color: inherit; }
.error-search { max-width: 26rem; margin: var(--s-8) auto 0; text-align: left; }
.error-search .label { color: var(--muted); font-size: var(--fs-sm); }

.page-holding { justify-content: center; }
.holding {
  width: min(100% - 2rem, 32rem);
  margin: auto;
  padding: var(--s-9) 0;
  text-align: center;
}
.holding-logo { display: block; width: auto; height: 44px; margin: 0 auto var(--s-8); }
.holding-arch {
  display: grid;
  place-items: center;
  width: 7.5rem;
  height: 8.5rem;
  margin: 0 auto var(--s-6);
  border-radius: 3.75rem 3.75rem 1rem 1rem;
  background: var(--butter);
  border: 1px solid var(--butter-line);
}
.holding-arch .icon { width: 2.5rem; height: 2.5rem; color: var(--brand); margin-top: 0.75rem; }
.holding h1 { margin-bottom: var(--s-3); }
.holding p { color: var(--muted); font-size: var(--fs-md); }
.holding-small { margin-top: var(--s-6); font-size: var(--fs-sm) !important; }

/* ===================================================================== 23. Utilities */
.visually-hidden, .sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.text-muted { color: var(--muted); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-lg { font-size: var(--fs-md); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-ok { color: var(--accent); }
.text-error { color: var(--error); }
.text-brand { color: var(--brand); }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.tabular { font-variant-numeric: tabular-nums; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-2 { margin-top: var(--s-2) !important; }
.mt-4 { margin-top: var(--s-4) !important; }
.mt-6 { margin-top: var(--s-6) !important; }
.mt-8 { margin-top: var(--s-8) !important; }
.mb-4 { margin-bottom: var(--s-4) !important; }
.mb-6 { margin-bottom: var(--s-6) !important; }
.w-full { width: 100%; }
.center-x { margin-inline: auto; }
/* Without JS these stay hidden (share, copy, show password); .nojs-only disappears once JS runs.
   The "js" class is set by assets/js-flag.js, a tiny script in <head> that runs before the first paint. */
html:not(.js) .js-only { display: none !important; }
.js .nojs-only { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .pass-ring::before { animation: none; border-color: rgba(255, 255, 255, 0.6); border-top-color: var(--sun); border-right-color: var(--sun); }
  .pass-ring::after { animation: none; transform: scale(0.85); }
  .spinner { animation: none; border-color: var(--brand); border-right-color: var(--line); }
}

/* ===================================================================== 24. Print */
@page { size: letter; margin: 0.5in; }

/* Printable sheets (print.php): .print-page = one Letter page. On screen it looks like a sheet of paper. */
.page-print { background: #E7DFD2; }
.print-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--gutter);
  background: var(--ink);
  color: var(--on-dark);
}
.print-toolbar p { margin: 0; font-weight: 600; }
.print-toolbar a:not(.btn) { color: #fff; }
.print-toolbar :focus-visible { outline-color: var(--sun); } /* an espresso ring would vanish on the espresso bar */
.print-sheets { padding: var(--s-6) 0 var(--s-10); }
.print-page {
  position: relative;
  width: 8.5in;
  height: 11in;
  margin: 0 auto var(--s-6);
  padding: 0.5in;
  overflow: hidden;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-3);
}
@media screen and (max-width: 879px) { .print-page { zoom: 0.8; } }
@media screen and (max-width: 699px) { .print-page { zoom: 0.55; } }
@media screen and (max-width: 499px) { .print-page { zoom: 0.42; } }
@media screen and (max-width: 374px) { .print-page { zoom: 0.39; } }

@media print {
  html, body { background: #fff !important; color: #000; }
  body { display: block; min-height: 0; font-size: 11pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .site-header, .site-footer, .skip-link, .flashes, .no-print, .print-toolbar, .nav-mobile, .toast,
  .perk-actions, .perk-perf, .owner-bar, .btn, .js-only { display: none !important; }
  .site-main { width: auto; margin: 0; padding: 0; }
  a { color: inherit; text-decoration: none; }
  .card, .panel, .perk-card, .stat-tile, .biz-header { box-shadow: none !important; break-inside: avoid; }
  .page-print { background: #fff; }
  .print-sheets { padding: 0; }
  .print-page {
    width: auto;
    height: 9.95in;
    margin: 0;
    padding: 0;
    box-shadow: none;
    zoom: 1 !important;
    break-after: page;
    page-break-after: always;
  }
  .print-page:last-child { break-after: auto; page-break-after: auto; }
}
