/* RuralPoint: the one stylesheet. Brand as printed on the collection-point set (Coordination #42),
   carried to the web by Coordination #43 (Shaun, 12 Oct: "the website should follow this branding").
   The skill that owns these rules: ~/.claude/skills/ruralpoint-frontend.

   ONE file, linked once from base.html. No inline CSS anywhere (the CSP refuses it and
   tests/test_no_inline_css.py fails on it). A colour is written in exactly one place: the
   :root token block below. Every rule after it reads var(--…).

   Contrast, measured (WCAG): ink/stone 15.0, muted/stone 5.1, muted/white 5.7, pine2/stone 5.8,
   white/pine 10.6, mint/pine 8.1, amber/pine 4.9, pine/amber 4.9, red/white 5.4.
   Amber is NEVER text or a focus ring on a light ground (1.96:1). Light mode only. */

/* ================= fonts: vendored, never linked (self-only CSP). SIL Open Font Licence, files in ../fonts ================= */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/archivo-latin.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/public-sans-latin.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/public-sans-italic-latin.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/space-mono-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/space-mono-700-latin.woff2") format("woff2"); }

/* ================= tokens: the only place a colour is written ================= */
:root {
  color-scheme: light;

  /* brand (11 Brand and first product design; the #42 print set) */
  --pine: #1E4635;          /* trust, the countryside: headers, bands, the label head */
  --pine-2: #2F6A4F;        /* "Point" in the wordmark, links, small labels on light grounds */
  --pine-3: #29573F;        /* the contour lines drawn on pine */
  --amber: #E0A63C;         /* the campo amber: the pin, the button, labels ON PINE only */
  --amber-hi: #EBB95A;      /* button hover */
  --stone: #F2F4EF;         /* the ground: cool, not cream */
  --white: #FFFFFF;         /* cards, fields, the label body */
  --ink: #15211B;
  --muted: #586B60;
  --mint: #CFE6D8;          /* body text on pine */
  --red: #B8432F;           /* placeholders and errors */
  --rule: #D9DFD6;          /* hairlines on light grounds */
  --rule-strong: #B7C2BA;
  --rule-on-pine: #3C6A54;
  /* #51: the pine veil over the hero photo. 0.86 keeps white 7.0:1 and mint 5.3:1 even over a pure-white patch */
  --pine-veil: rgba(30, 70, 53, 0.86);
  --pine-veil-soft: rgba(30, 70, 53, 0.55);
  --pine-veil-clear: rgba(30, 70, 53, 0.12);
  /* #76: the one flat veil of the sign-in photo; white text on it stays >= 4.5:1 over any pixel (4.98 over pure white) */
  --pine-veil-flat: rgba(30, 70, 53, 0.74);
  /* #51: app cards rise in; a touch shrinks what is tapped */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* type */
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --size-display: clamp(2.4rem, 9vw, 4.4rem);

  /* shape and space */
  --r-card: 12px; --r-chip: 6px; --r-tick: 4px; --r-dot: 50%;
  --s1: 0.5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2rem; --s5: 3rem;
  --sec-y: 3.5rem; --sec-y-lg: 6rem;
  --wrap: 72rem; --gutter: 20px; --tap: 44px;
  --shadow-card: 0 1px 0 var(--rule), 0 14px 30px -18px rgba(21, 33, 27, 0.35);
  --shadow-btn: inset 0 -2px 0 rgba(21, 33, 27, 0.18);

  /* the wave: soft contour lines over pine, drawn as a vector (no image file, CSP allows data:) */
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='240' viewBox='0 0 600 240'%3E%3Cg fill='none' stroke='%2329573F' stroke-width='1.6'%3E%3Cpath d='M0 40 C120 20 220 62 340 44 S520 18 600 38'/%3E%3Cpath d='M0 88 C140 66 240 112 360 92 S520 70 600 90'/%3E%3Cpath d='M0 136 C110 118 250 160 380 140 S540 116 600 134'/%3E%3Cpath d='M0 184 C150 162 260 206 390 186 S530 166 600 182'/%3E%3Cpath d='M0 228 C130 210 240 248 370 232 S540 210 600 226'/%3E%3C/g%3E%3C/svg%3E");
}

/* ================= base ================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; color: var(--ink); background: var(--stone); font: 400 1rem/1.6 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--pine-2); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pine); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--pine); outline-offset: 3px; border-radius: var(--r-tick); }
h1, h2, h3 { margin: 0; color: var(--ink); font-family: var(--display); font-weight: 800; letter-spacing: -0.025em; text-wrap: balance; }
h1, .display { font-size: var(--size-display); line-height: 1.02; font-weight: 900; letter-spacing: -0.03em; }
h2 { font-size: 1.5rem; line-height: 1.12; }
h3 { font-size: 1.1rem; line-height: 1.2; }
p { margin: 0 0 1rem; max-width: 36rem; }
b, strong { font-weight: 700; }
.lede { font-size: 1.15rem; line-height: 1.5; max-width: 32rem; }
.small { font-size: 0.9375rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
/* the label above a headline: small caps mono, as on the flyer. Pine-2 on light, amber on pine. */
.eyebrow { margin: 0 0 var(--s2); font-family: var(--mono); font-weight: 700; font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pine-2); }
.skip-link { position: absolute; left: -999px; top: var(--s1); z-index: 100; display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s2); background: var(--pine); color: var(--white); border-radius: var(--r-card); }
.skip-link:focus { left: var(--s1); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ================= frame ================= */
:root { --pad-x: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter))); }
.page { max-width: none; margin: 0; padding: 0; }
.hero, .band, .topbar, .footer { padding-left: var(--pad-x); padding-right: var(--pad-x); }
.dot { display: inline-block; flex: none; width: 10px; height: 10px; border: 2px solid var(--amber); border-radius: var(--r-dot); }
.dot-ok { background: var(--amber); }
.dot-prep { background: transparent; }

/* ================= the mark: a dropped pin, amber, with a ring (11 Brand .pin) ================= */
.pin { display: inline-block; flex: none; width: 18px; height: 18px; margin-right: 10px; border-radius: 50% 50% 50% 2px; transform: rotate(-45deg);
       background: radial-gradient(circle, var(--amber) 0 2.6px, var(--pine) 3px 5.6px, var(--amber) 6px); }
.pin-on-primary { background: radial-gradient(circle, var(--amber) 0 2.6px, var(--white) 3px 5.6px, var(--amber) 6px); }

/* ================= header ================= */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding-top: 10px; padding-bottom: 10px; background: var(--stone); border-bottom: 1px solid var(--rule); }
.brand { display: inline-flex; align-items: center; min-height: var(--tap); font-family: var(--display); font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-r { color: var(--ink); }
.brand-p { color: var(--pine-2); }
.brand.small { font-size: 1.1rem; }
/* #58 (Shaun, 13 Oct: "No way to login on desktop either. Use top menu"): the desktop header carries the menu:
   Puntos, Alta de punto, Iniciar sesión (the amber button) and the language; signed in: the role's home and Salir.
   Phones keep the #56 menu sheet instead (the .topnav is hidden below 720 px). */
.topnav { display: flex; align-items: center; gap: var(--s2); margin: 0; }
.topnav-link { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 4px; font-family: var(--body); font-size: 0.9375rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.topnav-link:hover { color: var(--pine-2); text-decoration: underline; text-underline-offset: 4px; }
.topnav-link[aria-current="page"] { color: var(--pine-2); }
.topnav .btn { min-height: var(--tap); padding: 0 18px; font-size: 0.9375rem; }
.topnav form { margin: 0; }
.topnav .btn-ghost { border: 1px solid var(--rule-strong); background: var(--white); color: var(--pine); }
/* #63: the language toggle is one small flag (the language you switch to). No pill, no border, no background; the tap
   area stays 44 px. The pill is banned (ruralpoint-frontend skill). */
.lang-flag { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: var(--tap); min-height: var(--tap); border-radius: var(--r-chip); }
.lang-flag img { display: block; width: 24px; height: 16px; border-radius: 2px; object-fit: cover; }
.lang-flag:hover img { opacity: 0.8; }

/* #56: the phone menu (Shaun, 13 Oct: "It's not possible to find a login. Add a mobile hamburger"; "It can be where the
   language switcher is"). Phones only: on desktop the button and the sheet do not exist and the header is as before. */
.menu-toggle, .menu-sheet { display: none; }
@media (max-width: 719px) {
  .topnav { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--tap); height: var(--tap); padding: 0; border: 0; border-radius: var(--r-card); background: none; color: var(--pine); cursor: pointer; }
  .menu-toggle:hover .menu-bars, .menu-toggle:hover .menu-bars::before, .menu-toggle:hover .menu-bars::after { background: var(--ink); }  /* #58: no border, no background */
  .menu-bars, .menu-bars::before, .menu-bars::after { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--pine); }
  .menu-bars { position: relative; }
  .menu-bars::before, .menu-bars::after { content: ""; position: absolute; left: 0; }
  .menu-bars::before { top: -6px; }
  .menu-bars::after { top: 6px; }
  .menu-sheet:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 60; }
  .menu-scrim { position: absolute; inset: 0; background: var(--pine-veil-soft); }
  .menu-panel { position: relative; max-height: 100vh; max-height: 100dvh; overflow-y: auto; padding: 10px var(--gutter) var(--s3); border-radius: 0 0 16px 16px; background: var(--stone); box-shadow: var(--shadow-card); }
  .menu-head { display: flex; align-items: center; justify-content: space-between; min-height: var(--tap); margin-bottom: var(--s1); }
  .menu-close { display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); padding: 0; border: 1px solid var(--rule-strong); border-radius: var(--r-card); background: var(--white); color: var(--pine); font-size: 1.75rem; line-height: 1; cursor: pointer; }
  .menu-links { margin: 0; padding: 0; list-style: none; border-radius: var(--r-card); background: var(--white); box-shadow: var(--shadow-card); }
  .menu-links li + li { border-top: 1px solid var(--rule); }
  .menu-links a { display: flex; align-items: center; min-height: 52px; padding: 0 var(--s2); font-family: var(--display); font-size: 1.2rem; font-weight: 800; letter-spacing: -0.01em; color: var(--pine); text-decoration: none; }
  .menu-links a:focus-visible { outline-offset: -3px; }
  .menu-action { margin: var(--s2) 0 0; }
  .menu-action .btn { width: 100%; min-height: 52px; }
  .menu-action .btn-ghost { border: 1px solid var(--rule-strong); background: var(--white); }
  .menu-lang { display: flex; justify-content: center; margin: var(--s2) 0 0; }
  html.menu-open, html.menu-open body { overflow: hidden; }
}
@keyframes rp-drop { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes rp-fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 719px) and (prefers-reduced-motion: no-preference) {
  .menu-sheet:not([hidden]) .menu-panel { animation: rp-drop 0.22s var(--ease-out) both; }
  .menu-sheet:not([hidden]) .menu-scrim { animation: rp-fade 0.2s ease both; }
}

/* ================= hero ================= */
/* Default: the LIGHT ground every component was written for (forms, lists, the member app, admin, legal),
   with a pine strip along its top edge. #43 review: putting these pages on pine left light-ground text on
   pine (1.66 to 1.86:1). */
.hero { position: relative; padding-block: var(--sec-y); color: var(--ink); background-color: var(--stone);
        background-image: linear-gradient(var(--pine), var(--pine)); background-size: 100% 6px; background-repeat: no-repeat; }
/* .hero-band: the pine panel with the wave, as on the flyer front. ONLY on short marketing heroes whose
   direct children are text (eyebrow, headline, lede, status line) or white cards: index, page, towns, town,
   the point directory, the application-sent page, offline, errors. Anything else stays on the light hero. */
.hero-band { color: var(--white); background-color: var(--pine); background-image: var(--wave); background-size: 600px 240px; background-repeat: repeat; }
.hero-band h1, .hero-band > h2, .hero-band .display { color: var(--white); }
.hero-band > .eyebrow, .hero-band > .eyebrow a { color: var(--amber); }
.hero-band > .lede, .hero-band > p:not(.alert), .hero-band > .muted:not(.alert), .hero-band > .small:not(.alert), .hero-band .grid > .muted { color: var(--mint); }
.hero-band > p:not(.alert) a, .hero-band > .lede a, .hero-band > .eyebrow a { color: var(--white); }
.hero-band > p:not(.alert) .addr-id { background: var(--amber); color: var(--pine); }
.hero-band > :focus-visible, .hero-band > * > a:focus-visible { outline-color: var(--amber); }
:where(.hero.narrow) > * { max-width: 44rem; }
.display { max-width: 14ch; }
.hero-home .display { max-width: 13ch; }
.eyebrow a { display: inline-flex; align-items: center; min-height: var(--tap); }
.hero .lede { margin: var(--s3) 0 0; max-width: 32rem; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.5rem; margin-top: var(--s4); }
.status-line { display: flex; align-items: center; gap: 12px; max-width: 34rem; margin: var(--s4) 0 0; padding: 1rem 0 0; border-top: 1px solid var(--rule-strong); font-size: 0.9375rem; color: var(--muted); }
.hero-band > .status-line { border-top-color: var(--rule-on-pine); color: var(--mint); }
.hero > h2 { margin: var(--s5) 0 var(--s2); }
.hero .grid, .band .grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); margin: var(--s4) 0 0; }

/* ================= buttons: amber with pine text, the flyer's call to action ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 14px 26px; border: 0; border-radius: var(--r-card); cursor: pointer; font: inherit; font-family: var(--display); font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.01em; text-decoration: none; transition: background-color 0.15s ease, transform 0.15s ease; }
/* #77: the push panel's button is shown by static/js/push.js only when it can act (.btn would override [hidden]) */
.push-panel [data-push-toggle][hidden] { display: none; }
body.app .app-card.push-panel[hidden] { display: none; } /* #88: no key and not in the app: no panel */
.btn:hover { text-decoration: none; }
.btn-solid, .btn.btn-solid, a.btn.btn-solid { color: var(--pine); background: var(--amber); box-shadow: var(--shadow-btn); }
.btn-solid:hover, a.btn.btn-solid:hover { color: var(--pine); background: var(--amber-hi); transform: translateY(-1px); }
.btn-solid:active { transform: translateY(0); }
.btn-solid:focus-visible { outline: 3px solid var(--pine); outline-offset: 3px; }
.hero-band .btn-solid:focus-visible, .band.split .btn-solid:focus-visible, .footer .btn-solid:focus-visible { outline-color: var(--white); }
.btn-ghost { padding: 0 2px; font-family: var(--body); font-weight: 600; color: var(--pine-2); background: none; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.btn-ghost:hover { color: var(--pine); text-decoration-thickness: 2px; }
.hero-band .btn-ghost, .band.split .btn-ghost { color: var(--white); }
.hero-band .btn-ghost:hover, .band.split .btn-ghost:hover { color: var(--amber); }
.btn[aria-disabled="true"], .btn[disabled] { cursor: default; opacity: 0.65; transform: none; }
.btn-sm { min-height: var(--tap); padding: 8px 16px; font-size: 0.9375rem; }
@media (prefers-reduced-motion: reduce) { .btn-solid:hover { transform: none; } }

/* ================= bands ================= */
.band { margin: 0; padding-block: var(--sec-y); border: 0; }
.section-title { margin: 0 0 var(--s3); font-size: 1.6rem; line-height: 1.1; }
.band > p { max-width: 36rem; }
.band .lede { margin-top: 0; }

/* how it works: white band, numbered pine discs with amber numbers (the flyer back) */
.band[aria-labelledby="how"] { background: var(--white); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.steps { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s3); }
.steps > li { display: grid; grid-template-columns: 2.75rem 1fr; column-gap: var(--s2); align-items: start; }
.step-n { display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: var(--r-dot); background: var(--pine); color: var(--amber); font-family: var(--mono); font-weight: 700; font-size: 1.1rem; }
.steps b { display: block; margin: 0.3rem 0 0.25rem; font-family: var(--display); font-size: 1.15rem; line-height: 1.2; font-weight: 800; letter-spacing: -0.015em; }
.steps p { margin: 0; max-width: 24rem; color: var(--muted); }
.band[aria-labelledby="how"] > p { margin-top: var(--s4); }

/* where we open: towns as an index, an amber point each */
.town-grid { list-style: none; margin: var(--s4) 0 var(--s3); padding: 0; border-bottom: 1px solid var(--rule-strong); }
.town-grid a { position: relative; display: flex; flex-direction: column; gap: 2px; min-height: var(--tap); padding: 1rem 0 1rem 2rem; border-top: 1px solid var(--rule-strong); color: var(--ink); text-decoration: none; }
.town-grid a::before { content: ""; position: absolute; left: 2px; top: 1.35rem; width: 14px; height: 14px; border-radius: 50% 50% 50% 2px; transform: rotate(-45deg); background: radial-gradient(circle, var(--amber) 0 2px, var(--pine) 2.4px 4.4px, var(--amber) 4.8px); }
.town-grid b { font-family: var(--display); font-size: 1.35rem; line-height: 1.16; font-weight: 800; letter-spacing: -0.02em; }
.town-grid a:hover b { color: var(--pine-2); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.town-grid span { font-size: 0.9375rem; color: var(--muted); }
.town-grid a:focus-visible { outline-offset: -3px; }

/* the ask: a pine band with the wave, two articles, one action each */
.band.split { display: grid; gap: var(--s5); color: var(--mint); background-color: var(--pine); background-image: var(--wave); background-size: 600px 240px; }
.split article + article { padding-top: var(--s4); border-top: 1px solid var(--rule-on-pine); }
.split .eyebrow { color: var(--amber); }
.split .section-title { max-width: 16ch; margin-bottom: var(--s2); font-size: 1.9rem; line-height: 1.04; color: var(--white); }
.split article p { max-width: 26rem; color: var(--mint); }
.split .btn { margin-top: var(--s1); }
.split :focus-visible { outline-color: var(--amber); }

/* questions */
.faq { margin-top: var(--s2); border-bottom: 1px solid var(--rule-strong); }
.faq details { border-top: 1px solid var(--rule-strong); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 56px; padding: 0.9rem 0; cursor: pointer; list-style: none; font-family: var(--display); font-size: 1.1rem; font-weight: 800; letter-spacing: -0.015em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 14px; height: 14px; background: linear-gradient(var(--pine), var(--pine)) center / 100% 2px no-repeat, linear-gradient(var(--pine), var(--pine)) center / 2px 100% no-repeat; }
.faq details[open] summary::after { background: linear-gradient(var(--pine), var(--pine)) center / 100% 2px no-repeat; }
.faq p { margin: 0 0 var(--s2); max-width: 36rem; }

/* prose pages */
.band.prose { padding-top: var(--s4); }
.prose > .section-title { margin: 0; padding: var(--s3) 0 var(--s1); border-top: 1px solid var(--rule-strong); font-size: 1.35rem; }
.prose > p { margin: 0; padding: 0 0 var(--s3); max-width: none; }
.prose > .cta-row { margin-top: var(--s4); }

/* other towns */
.band.town-nav { padding-top: var(--s4); padding-bottom: var(--s4); border-top: 1px solid var(--rule); }
.town-nav p { max-width: none; margin: 0; }
.town-nav p a { display: inline-block; padding: 12px 2px; }

/* ================= cards: the points, each a real place ================= */
.card { display: block; padding: var(--s3); border: 1px solid var(--rule); border-radius: var(--r-card); background: var(--white); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-card); }
a.card:hover { border-color: var(--pine-2); text-decoration: none; }
.card b { display: block; margin: 0 0 var(--s1); font-family: var(--display); font-size: 1.2rem; line-height: 1.2; font-weight: 800; letter-spacing: -0.015em; }
.card p { margin: 0 0 var(--s1); color: var(--ink); }
.card p.small { margin: var(--s2) 0 0; color: var(--muted); }
/* a point's code, as on the poster and the address label */
.addr-id { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: var(--r-tick); background: var(--pine); color: var(--amber); font-family: var(--mono); font-size: 0.875em; font-weight: 700; letter-spacing: 0.04em; }
.tag { display: inline-block; padding: 1px 9px; border: 1px solid var(--rule-strong); border-radius: var(--r-chip); background: var(--white); color: var(--ink); font-family: var(--mono); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; line-height: 1.7; text-transform: uppercase; white-space: nowrap; }
/* OPEN/CLOSED RIGHT NOW is a clock answer (core/hours.is_open_at) on the public pages. */
.tag.st-open-now { background: var(--pine); border-color: var(--pine); color: var(--white); }
.tag.st-closed-now { color: var(--muted); }
/* LIFECYCLE: built as st-{{ p.status }} on the admin screens; every POINT_STATUSES value has a rule. */
.tag.st-pending, .tag.st-verified { color: var(--muted); }
.tag.st-active, .tag.st-at_capacity { background: var(--pine); border-color: var(--pine); color: var(--white); }
.tag.st-suspended, .tag.st-closed { border-style: dashed; color: var(--muted); }
.tag.tag-warn { border-width: 2px; border-color: var(--red); color: var(--red); background: var(--white); }

/* ================= footer: pine, the mark in reverse ================= */
.footer { display: grid; gap: var(--s1); padding-top: var(--s4); padding-bottom: var(--s4); font-size: 0.9375rem; color: var(--mint); background: var(--pine); }
.footer .brand { margin-bottom: var(--s1); color: var(--white); }
.footer .muted { max-width: 30rem; color: var(--mint); }
.footer a { color: var(--white); }
.footer a:hover { color: var(--amber); }
.footer :focus-visible { outline-color: var(--amber); }
.footer-nav, .footer-links { display: block; margin: 0; }
.footer-nav a, .footer-links a { display: inline-block; padding: 12px 2px; }
.footer-credit { display: block; font-size: 0.75rem; color: var(--mint); }
.footer-credit:empty { display: none; }
.footer-credit a { display: inline-block; padding: 6px 0; }

/* ================= forms: the sign-up sheet on screen ================= */
.form-card { display: grid; gap: var(--s1); max-width: 40rem; margin-top: var(--s4); padding: var(--s3); border-radius: var(--r-card); background: var(--white); color: var(--ink); box-shadow: var(--shadow-card); }
.form-card p { max-width: none; margin: 0; }
.form-card .muted { color: var(--muted); }
.form-card a { color: var(--pine-2); }
.form-card label { display: block; margin-top: var(--s1); font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
.form-card input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"]), .form-card select, .form-card textarea, .parcel-search input, .parcel-search select {
  display: block; width: 100%; min-height: 3rem; padding: 0.75rem 0.9rem; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--white); border: 2px solid var(--rule-strong); border-radius: var(--r-card); -webkit-appearance: none; appearance: none;
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus, .parcel-search input:focus, .parcel-search select:focus { border-color: var(--pine); outline: 3px solid var(--pine); outline-offset: 2px; }
.form-card ::placeholder { color: var(--muted); opacity: 1; }
.form-card .btn { justify-self: start; margin-top: var(--s2); }
.form-card.intake h2 { display: flex; align-items: center; gap: 0.6rem; margin-top: var(--s3); padding-top: var(--s2); border-top: 1px solid var(--rule); font-size: 1.15rem; color: var(--pine); }
.form-card.intake h2::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: var(--r-dot); background: var(--amber); }
.form-card.intake h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.form-card .row { display: grid; gap: var(--s2); grid-template-columns: 1fr; }
.form-card .row > div { display: grid; gap: 0.4rem; }
.form-card .check, .check { display: flex; align-items: center; gap: 0.75rem; min-height: var(--tap); font-weight: 400; cursor: pointer; }
.check input[type="checkbox"] { flex: none; display: grid; place-content: center; width: 24px; height: 24px; margin: 0; border: 2px solid var(--pine); border-radius: var(--r-tick); background: var(--white); -webkit-appearance: none; appearance: none; cursor: pointer; }
.check input[type="checkbox"]:checked { background: var(--pine); }
.check input[type="checkbox"]::after { content: ""; width: 6px; height: 11px; margin-top: -2px; border: solid var(--amber); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); }
.check input[type="checkbox"]:checked::after { transform: rotate(45deg) scale(1); }
.check input[type="checkbox"]:focus-visible { outline: 3px solid var(--pine); outline-offset: 2px; }
.point-picker { display: grid; gap: var(--s1); }
.point-option { flex-wrap: wrap; padding: var(--s1) var(--s2); border: 1px solid var(--rule-strong); border-radius: var(--r-card); background: var(--stone); }
.point-option:has(input:checked) { border-color: var(--pine); box-shadow: inset 0 0 0 1px var(--pine); background: var(--white); }
details.legal { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 0 0 var(--s1); }
details.legal summary { display: block; min-height: var(--tap); padding: 0.7rem 0; font-weight: 600; cursor: pointer; }
details.legal summary .mono { font-weight: 400; }
details.legal p { margin: var(--s1) 0 0; }
.code-input { font-family: var(--mono); font-size: 1.5rem; letter-spacing: 0.3em; text-align: center; }
.short { width: 5ch; }
.alert { max-width: 40rem; margin: var(--s3) 0 0; padding: var(--s2); border: 2px solid var(--pine-2); border-radius: var(--r-card); background: var(--white); color: var(--ink); }
.alert a { color: var(--pine-2); }
.alert-error { border-color: var(--red); color: var(--red); font-weight: 600; }
.alert-error a { color: var(--red); }
ul.alert { padding-left: var(--s4); }
.draft-banner { margin: 0 0 var(--s3); font-weight: 700; display: inline-block; padding: 2px 10px; border: 2px solid var(--red); border-radius: var(--r-chip); color: var(--red); background: var(--white); font-family: var(--mono); font-size: 0.875rem; letter-spacing: 0.06em; text-transform: uppercase; }
.logout-form { margin-top: var(--s5); }
.inline-form { display: inline; }
.inline-form .mini { min-height: var(--tap); padding: 0 var(--s2); font: inherit; font-size: 0.9375rem; font-weight: 600; color: var(--pine); background: var(--white); border: 1px solid var(--rule-strong); border-radius: var(--r-chip); cursor: pointer; }
.inline-form .mini:hover { border-color: var(--pine); }

/* ================= the address label: a real shipping label ================= */
.label { max-width: 28rem; margin-top: var(--s4); overflow: hidden; border-radius: var(--r-card); background: var(--white); color: var(--ink); box-shadow: var(--shadow-card); }
.label-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: 14px 20px; color: var(--white); background-color: var(--pine); background-image: var(--wave); background-size: 600px 240px; }
.label-head b { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; letter-spacing: -0.015em; }
.label-head small { font-family: var(--mono); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); }
.label-body { padding: var(--s3); }
.addr { margin: 0 0 var(--s2); font-size: 1.05rem; line-height: 1.7; }
pre.addr { white-space: pre-wrap; font-family: var(--mono); font-size: 0.98rem; }
.label-body p { margin: 0; }

/* ================= facts, hours, inbox: the plain data pages ================= */
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0 var(--s3); margin: var(--s2) 0 var(--s3); max-width: 30rem; }
dl.facts dt, dl.facts dd { margin: 0; padding: 0.7rem 0; border-top: 1px solid var(--rule); }
dl.facts dt { font-weight: 600; color: var(--muted); }
dl.facts dd { font-variant-numeric: tabular-nums; }
.form-card > * { min-width: 0; }
table.hours { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 0.9375rem; }
table.hours th { padding: 6px var(--s1); text-align: left; font-weight: 600; color: var(--muted); }
table.hours td { padding: 2px; }
table.hours input { min-width: 6.2rem; min-height: var(--tap); padding: 4px 8px; }
table.inbox { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--r-card); }
table.inbox th { padding: var(--s1) var(--s2); text-align: left; font-family: var(--mono); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--rule-strong); }
table.inbox td { padding: var(--s1) var(--s2); vertical-align: top; border-bottom: 1px solid var(--rule); color: var(--ink); }
.decisions { display: grid; gap: var(--s3); margin-top: var(--s4); }
.decisions .form-card { margin-top: 0; }
.empty { padding: var(--s2) 0; }
.empty-state { max-width: 34rem; padding: var(--s3); border: 1px dashed var(--rule-strong); border-radius: var(--r-card); background: var(--white); color: var(--ink); }
.empty-state p { margin: 0 0 var(--s1); }

/* ================= member pages ================= */
.point-card { margin: var(--s2) 0; overflow: hidden; border: 1px solid var(--rule); border-radius: var(--r-card); background: var(--white); color: var(--ink); box-shadow: var(--shadow-card); }
.point-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--s3); border-bottom: 1px solid var(--rule); }
.pill { padding: 3px 10px; border-radius: 999px; font-family: var(--mono); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.pill-on { color: var(--pine); background: var(--amber); }
.pill-off { color: var(--muted); border: 1px solid var(--rule-strong); }
.parcel-list { list-style: none; margin: 0; padding: 0; }
.parcel-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--s3); }
.parcel-row + .parcel-row { border-top: 1px solid var(--rule); }
.parcel-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.parcel-actions { display: flex; flex-wrap: wrap; gap: var(--s1); }
.due { font-family: var(--display); font-size: 1.1rem; font-weight: 800; }
.due-today, .due-overdue { color: var(--red); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.label-grid { display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr)); max-width: 60rem; }
.code-big { margin: var(--s4) 0; padding: var(--s3) var(--s2); border-radius: var(--r-card); background: var(--white); color: var(--pine); font-family: var(--mono); font-size: clamp(2.4rem, 12vw, 4.4rem); line-height: 1; font-weight: 700; letter-spacing: 0.16em; text-align: center; }
ol.trail { padding: 0; list-style: none; counter-reset: step; }
ol.trail li { padding: 0.35rem 0; }
ol.trail li::before { counter-increment: step; content: counter(step); display: inline-block; min-width: 1.8em; color: var(--pine-2); font-family: var(--mono); font-weight: 700; }

/* ================= legal ================= */
.legal-page h2 { margin-top: var(--s4); font-size: 1.3rem; }
.legal-page p { max-width: 40rem; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 0 var(--s3); margin-top: var(--s4); }
.legal-nav a { display: inline-flex; align-items: center; min-height: var(--tap); }

/* ================= 720px and up ================= */
@media (min-width: 720px) {
  :root { --gutter: 40px; }
  h2 { font-size: 2rem; }
  .lede { font-size: 1.3rem; }
  .hero, .band, .band.split { padding-block: var(--sec-y-lg); }
  .hero.narrow { padding-bottom: var(--sec-y); }
  .cta-row { margin-top: var(--s5); }
  .section-title { font-size: 2rem; }

  .band[aria-labelledby]:not([aria-labelledby="how"]) { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
  .band[aria-labelledby]:not([aria-labelledby="how"]) > .section-title { grid-column: 1 / span 4; position: sticky; top: 5rem; margin: 0; }
  .band[aria-labelledby]:not([aria-labelledby="how"]) > :not(.section-title) { grid-column: 5 / span 8; }
  .band[aria-labelledby] .grid { margin-top: 0; }
  .band[aria-labelledby] > .lede + .town-grid, .band[aria-labelledby] > p + .grid { margin-top: var(--s3); }

  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--s4); margin-top: var(--s4); }
  .town-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s5); }

  .band.split { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
  .split article { grid-column: 1 / span 5; }
  .split article + article { grid-column: 8 / span 5; padding-top: 0; border-top: 0; }
  .split .section-title { font-size: 2.4rem; }

  .prose { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .prose > .section-title { grid-column: 1 / span 4; padding: var(--s3) 24px var(--s3) 0; }
  .prose > p { grid-column: 5 / span 8; padding: var(--s3) 20% var(--s3) 0; border-top: 1px solid var(--rule-strong); }
  .prose > .cta-row { grid-column: 5 / span 8; }

  .footer { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; padding-top: 3.5rem; padding-bottom: 3.5rem; }
  .footer .brand, .footer > .muted { grid-column: 1 / span 4; }
  .footer-nav, .footer-links { grid-column: 6 / span 7; }
  .footer .brand { grid-row: 1; }
  .footer > .muted { grid-row: 2 / span 2; }
  .footer-nav { grid-row: 1; }
  .footer-links { grid-row: 2; }
  .footer-credit { grid-column: 6 / span 7; grid-row: 3; }

  .form-card .row { grid-template-columns: 1fr 1fr; }
  .form-card { padding: var(--s4); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* #47: where a shop's application stands (light ground; the colour is a border, never amber text on light) */
.state-card { max-width: 40rem; margin: var(--s3) 0 0; padding: var(--s3); border: 1px solid var(--rule); border-left: 6px solid var(--amber); border-radius: var(--r-card); background: var(--white); color: var(--ink); box-shadow: var(--shadow-card); }
.state-card h2 { font-size: 1.35rem; margin: 0 0 var(--s1); }
.state-card p { margin: 0 0 var(--s1); }
.state-card p:last-child { margin-bottom: 0; }
.state-label { font-family: var(--mono); font-weight: 700; font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pine-2); }
.state-closed { border-left-color: var(--red); }
.state-closed .state-label { color: var(--red); }
.state-suspended { border-left-color: var(--muted); }
.state-suspended .state-label { color: var(--muted); }

/* #48: the admin parcels page (desktop: admin needs no phone layout, Shaun 2026-10-12) */
.admin-wide > * { max-width: 78rem; }
.admin-wide .display { max-width: none; }
.parcel-search { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s2); margin: var(--s3) 0 var(--s1); }
.parcel-search label { display: block; margin-bottom: 4px; font-weight: 600; }
.parcel-search .field-q { flex: 1 1 24rem; }
.parcel-search select { min-width: 13rem; padding-right: 2.4rem; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--pine) 50%), linear-gradient(135deg, var(--pine) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
.nowrap { white-space: nowrap; }
table.inbox.parcels td a.mono { color: var(--pine-2); font-weight: 700; }

/* ================= #51: the home hero photo (Unsplash License, credit in the hero) ================= */
/* Frigiliana (Axarquía, Málaga) by Christian Hergesell. 1000 px on phones, 2000 px from 720 px up. The wave stays
   on top, then the veil, then the photo. Every line of text sits on the 0.86 veil or on solid pine: the eyebrow
   (mint here, as on every pine band) is on a pine chip, 8.1:1. On phones the photo shows clear in a strip above
   the chip; the veil is full strength before the headline starts. */
/* #58 (Shaun, 13 Oct: "Remove the lines in the homepage hero"): the home hero has NO contour-line wave, only the
   veil over the photo. Every other pine band keeps the wave (ruralpoint-frontend skill, hero recipe). */
.hero-home { background-image: linear-gradient(var(--pine-veil), var(--pine-veil)), url("../img/hero-frigiliana-1000.jpg");
             background-size: cover, cover; background-repeat: no-repeat, no-repeat; background-position: center, 40% 35%; }
.hero-home > .eyebrow { display: inline-block; padding: 4px 10px; border-radius: var(--r-chip); background: var(--pine); }
@media (max-width: 719px) {
  .hero-home { padding-top: 11rem; background-image: linear-gradient(180deg, var(--pine-veil-clear) 0, var(--pine-veil-clear) 6.5rem, var(--pine-veil) 10.5rem), url("../img/hero-frigiliana-1000.jpg");
               background-size: cover, auto 160%; background-position: center, 40% 90%; }
}
@media (min-width: 720px) {
  .hero-home { background-image: linear-gradient(90deg, var(--pine-veil) 0%, var(--pine-veil) 52%, var(--pine-veil-soft) 100%), url("../img/hero-frigiliana-2000.jpg"); }
}

/* ================= #51: premium mobile for the logged-in resident and shop screens ================= */
/* Shaun, 13 Oct: "in a premium app interfaces dont scroll. we fit with cards and small text and fonts. the mobile
   styles should not spill over to the desktop version." So: everything below 720 px AND on body.app only.
   The wrappers (.app-head, .app-card, .app-scroll, .app-actions) vanish on desktop (display: contents) and the
   few direct-child rules they would break are repeated for them, so desktop renders pixel for pixel as before. */
:where(.app-head, .app-card, .app-scroll, .app-actions) { display: contents; }
.hero > .app-card > h2 { margin: var(--s5) 0 var(--s2); }
:where(.hero.narrow) :where(.app-head, .app-card, .app-scroll) > * { max-width: 44rem; }

@media (max-width: 719px) {
  html:has(body.app) { overflow-x: hidden; }  /* #55: nothing on an app page may widen the viewport */
  body.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; font-size: 0.9375rem; line-height: 1.45; }
  body.app .topbar { position: static; padding-top: 4px; padding-bottom: 4px; }
  body.app .brand { font-size: 1.15rem; }
  /* the footer shrinks to one line with the two legal links (Vega, #51 review: never hide them); taps stay 44 px */
  body.app .footer { display: flex; flex: none; flex-wrap: wrap; justify-content: center; padding: 0 var(--gutter); font-size: 0.8125rem; }
  body.app .footer > :not(.footer-links):not(.footer-credit) { display: none; }
  body.app .footer-credit { flex-basis: 100%; margin-top: -10px; padding-bottom: 4px; text-align: center; font-size: 0.6875rem; }
  body.app .footer-credit a { padding: 0; }
  body.app .footer-links a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 6px; }
  body.app .page { display: flex; flex: 1; min-height: 0; }
  body.app .hero { display: flex; flex: 1; flex-direction: column; gap: 10px; min-height: 0; padding: 12px var(--gutter) 10px; background-size: 100% 3px; overflow: hidden; }
  body.app .hero > * { flex: none; margin: 0; max-width: none; }
  body.app p { max-width: none; }

  /* type: a smaller scale, the same families */
  body.app h1, body.app .display { max-width: none; font-size: 1.5rem; line-height: 1.08; letter-spacing: -0.02em; }
  body.app .eyebrow { margin: 0; font-size: 0.6875rem; letter-spacing: 0.12em; }
  body.app .eyebrow a { min-height: 32px; padding: 0 10px; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--white); text-decoration: none; }
  body.app .lede, body.app .hero .lede { margin: 0; font-size: 0.875rem; line-height: 1.4; }
  body.app .small, body.app .muted.small { font-size: 0.8125rem; }

  /* the header card: who and where, in one block */
  body.app .app-head { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r-card); background: var(--white); box-shadow: var(--shadow-card); }
  body.app .app-head > * { margin: 0; }

  /* a card per section: the title row lives inside the card, the count is a chip */
  body.app .app-card { display: flex; flex-direction: column; min-height: 0; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r-card); background: var(--white); box-shadow: var(--shadow-card); }
  body.app .app-card > h2 { display: flex; align-items: center; justify-content: space-between; gap: var(--s1); margin: 0 0 6px; font-size: 0.9375rem; line-height: 1.2; letter-spacing: -0.01em; }
  body.app .app-card > h2 small { min-width: 1.6rem; padding: 1px 8px; border-radius: 999px; background: var(--pine); color: var(--white); font-family: var(--mono); font-size: 0.75rem; text-align: center; }
  body.app .app-card > p { margin: 0 0 6px; }
  body.app .app-grow { flex: 1 1 0; }
  /* card 115: while the passkey offer shows, the parcels card keeps room for its first parcel; history and points give way */
  body.app .hero:has(> .passkey-nudge:not([hidden])) .app-grow { min-height: 9rem; }
  body.app .app-history { flex: 0 1 auto; max-height: 20%; }
  body.app .app-points { flex: 0 1 auto; max-height: 25%; }
  body.app .app-scroll { display: block; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

  /* lists inside cards: compact rows, hairlines between */
  body.app .events { margin: 0; padding: 0; list-style: none; }
  body.app .events > li { padding: 7px 0; border-top: 1px solid var(--rule); font-size: 0.8125rem; line-height: 1.4; }
  body.app .events > li:first-child { border-top: 0; padding-top: 2px; }
  body.app ol.trail li::before { min-width: 1.6em; }

  /* resident: the point and its parcels, flattened into the card */
  body.app .app-scroll > .point-card { margin: 0 0 8px; box-shadow: none; }
  body.app .point-card-head { padding: 8px 10px; gap: 6px; }
  body.app .pill { padding: 2px 8px; font-size: 0.6875rem; }
  body.app .parcel-row { gap: 6px; padding: 8px 10px; }
  body.app .due { font-size: 0.9375rem; }
  body.app .parcel-actions { width: 100%; align-items: center; justify-content: space-between; }
  body.app .btn { padding: 10px 18px; font-size: 0.9375rem; }
  body.app .btn-sm { min-height: 40px; padding: 6px 14px; font-size: 0.875rem; }
  body.app .btn-ghost { padding: 0 2px; }
  /* the address labels: a row you swipe sideways inside the card */
  body.app .app-points .label-grid { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; }
  body.app .app-points .label { flex: 0 0 86%; margin: 0; scroll-snap-align: start; box-shadow: none; border: 1px solid var(--rule); }
  body.app .label-head { padding: 8px 12px; }
  body.app .label-body { padding: 10px 12px; }
  body.app .addr { margin: 0; font-size: 0.8125rem; line-height: 1.5; }
  body.app .app-points .label-grid + .muted { margin: 6px 0 0; }

  /* the bottom row: account and log out, side by side */
  body.app .app-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
  body.app .app-actions > * { margin: 0; }
  body.app .logout-form { margin: 0; }

  /* shop: the two jobs as big tiles */
  body.app .app-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  body.app .app-tiles .btn { min-height: 64px; padding: 10px; border-radius: var(--r-card); text-align: center; line-height: 1.2; }
  body.app .app-tiles .btn-ghost { border: 1px solid var(--rule); background: var(--white); box-shadow: var(--shadow-card); font-family: var(--display); font-weight: 800; color: var(--pine); text-decoration: none; }
  body.app .state-card { margin: 0; padding: 10px 12px; }
  body.app .state-card h2 { font-size: 1rem; }

  /* forms: one card, compact labels; inputs stay 16 px so iPhone does not zoom */
  body.app .form-card { flex: 0 1 auto; gap: 4px; min-height: 0; margin: 0; padding: 12px 14px; overflow-y: auto; }
  body.app .form-card label { margin-top: 4px; font-size: 0.8125rem; }
  body.app .form-card input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"]), body.app .form-card select { min-height: 44px; padding: 0.5rem 0.75rem; font-size: 1rem; }
  body.app .form-card .btn { margin-top: 8px; }
  body.app .app-card .form-card { padding: 0; border: 0; box-shadow: none; overflow: visible; }
  body.app details.legal summary { min-height: 40px; padding: 0.5rem 0; }
  body.app .hero > details.legal { padding: 0 12px; border: 1px solid var(--rule); border-radius: var(--r-card); background: var(--white); box-shadow: var(--shadow-card); }
  body.app .hero > details.legal[open] { max-height: 45%; overflow-y: auto; }
  body.app .hero > details.legal .form-card { padding: 0 0 10px; box-shadow: none; overflow: visible; }
  body.app .alert { margin: 0; padding: 10px 12px; font-size: 0.875rem; }
  body.app .code-big { margin: 0; padding: 20px 10px; box-shadow: var(--shadow-card); font-size: 2.6rem; }
  body.app .code-input { font-size: 1.4rem; }
  body.app .app-summary .muted { margin: 0; }
}

/* ================= #52: the parcel QR (resident shows it) and the scanner (shop reads it) ================= */
/* The QR is dark ink on white with its quiet zone drawn in the SVG: scanners need the contrast, not the brand. */
.qr-card { max-width: 22rem; margin: var(--s4) 0 0; padding: var(--s3); border-radius: var(--r-card); background: var(--white); box-shadow: var(--shadow-card); text-align: center; }
.qr { display: block; width: 100%; height: auto; }
.qr-ground { fill: var(--white); }
.qr-ink { fill: var(--ink); }
.qr-card figcaption { margin-top: var(--s1); font-size: 0.9375rem; color: var(--ink); }
.qr-fallback { display: block; max-width: 22rem; margin-top: var(--s2); }
.qr-fallback p { margin: 0 0 var(--s1); }
.scan-card, .scan-parcel { display: block; max-width: 40rem; margin-top: var(--s3); padding: var(--s3); border-radius: var(--r-card); background: var(--white); box-shadow: var(--shadow-card); }
.scan-view { position: relative; overflow: hidden; aspect-ratio: 1 / 1; max-width: 20rem; margin-bottom: var(--s2); border-radius: var(--r-card); background: var(--pine); }
.scan-video { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.scan-view.is-live .scan-video { opacity: 1; }
.scan-frame { position: absolute; inset: 14%; border: 3px solid var(--amber); border-radius: var(--r-card); box-shadow: 0 0 0 999px var(--pine-veil-soft); pointer-events: none; }
.scan-buttons { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s2); }
.scan-photo { position: relative; border: 1px solid var(--rule-strong); }
.scan-photo:focus-within { outline: 3px solid var(--pine); outline-offset: 2px; }
/* #90: reading the carrier's label on the intake form */
.label-scan { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.label-scan[hidden], .label-scan [hidden] { display: none; }
.label-scan [data-label-status], .label-choices { flex-basis: 100%; margin: 0; }
.label-choices { display: flex; flex-wrap: wrap; gap: 6px; }
/* #90: the app's live camera sits behind the page; while it runs only this bar shows */
html.rp-scanning, html.rp-scanning body { background: transparent; }
html.rp-scanning body > *:not(.rp-scan-overlay) { visibility: hidden; }
.rp-scan-overlay { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; display: grid; gap: var(--s2); padding: var(--s3) 16px; background: var(--pine); color: var(--white); text-align: center; }
.rp-scan-overlay p { margin: 0; }
.scan-facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin: 0 0 var(--s2); }
.scan-facts div { min-width: 0; }
.scan-facts dt { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.scan-facts dd { margin: 2px 0 0; font-family: var(--display); font-size: 1.35rem; font-weight: 800; color: var(--pine); overflow-wrap: anywhere; }
.scan-release { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s2); }
@media (max-width: 719px) {
  body.app .qr-card { display: flex; flex: 1 1 auto; flex-direction: column; align-items: center; justify-content: center; min-height: 0; max-width: none; margin: 0; padding: 12px; }
  body.app .qr { width: auto; height: 100%; max-width: 100%; max-height: 22rem; min-height: 0; flex: 1 1 auto; }
  body.app .qr-card figcaption { flex: none; margin-top: 6px; font-size: 0.875rem; }
  body.app .qr-fallback { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; max-width: none; margin: 0; }
  body.app .qr-fallback p { margin: 0; }
  body.app .scan-card, body.app .scan-parcel { display: flex; flex-direction: column; gap: 8px; max-width: none; margin: 0; padding: 12px; }
  /* #55 ('Camera is too big'): the live video used to size its box, so a 1080x1920 camera frame pushed the
     page wider and taller than the phone. Now the viewfinder is a bounded square that the video only fills. */
  body.app .scan-card { flex: 0 1 auto; min-width: 0; min-height: 0; }
  body.app .scan-view { flex: 0 1 auto; width: 100%; min-width: 0; min-height: 72px; max-width: none; max-height: 55vh; margin: 0; aspect-ratio: 1 / 1; }
  body.app .scan-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  body.app .scan-card > p { margin: 0; }
  body.app .scan-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
  body.app .scan-buttons .btn { min-height: 56px; padding: 8px; }
  body.app .scan-photo { border: 1px solid var(--rule); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
  body.app .scan-code { display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 10px; }
  body.app .scan-code label { grid-column: 1 / -1; }
  body.app .scan-code .btn { margin-top: 0; min-height: 44px; padding: 0 16px; border: 1px solid var(--rule-strong); }
  body.app .scan-facts { gap: 10px; margin: 0; }
  body.app .scan-facts dd { font-size: 1.15rem; }
  body.app .scan-release { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin: 0; }
  body.app .scan-release .btn-solid { min-height: 56px; font-size: 1.0625rem; }
  body.app .app-tiles .app-tile-wide { grid-column: 1 / -1; min-height: 48px; }
}

/* ================= #57 + #76: the sign-in screens. #57 (Shaun, 13 Oct: "a premium login page, a background image from
   unsplash. sign title is way too big"): Zahara de la Sierra (Sierra de Cádiz) by Mariana Brás, Unsplash License; 1000 px
   portrait for phones, 2000 x 1250 for desktop. #76 (Shaun, 13 Oct: "The card is not needed. Centralise everything on the
   background image very clean and polished and flat"): no card, no shadow, no gradient, no blur. One flat veil
   (--pine-veil-flat) covers the photo, and every text line on it is white: over the lightest pixel the photo could have
   (pure white) white on the veiled ground is 4.98:1 (tests/test_login_page.py computes it from the token).
   Fields are white with ink (16.6:1), their edge white on that ground (4.98:1); the button is flat amber, pine text 4.89:1. === */
.auth-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; isolation: isolate; min-height: calc(100vh - 66px);
              color: var(--white); background: var(--pine) url("../img/login-zahara-2000.jpg") center 45% / cover no-repeat; }
.auth-stage::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--pine-veil-flat); }
.auth-center { display: flex; flex-direction: column; align-items: stretch; width: 100%; max-width: 22.5rem; text-align: center; }
.auth-mark { display: grid; place-items: center; align-self: center; width: 56px; height: 56px; margin: 0 0 var(--s2); border-radius: var(--r-dot); background: var(--white); }
.auth-mark .pin { width: 24px; height: 24px; margin: 0 0 4px; }
.auth-stage .eyebrow { margin: 0 0 6px; font-size: 0.75rem; color: var(--white); }
.auth-title { max-width: none; margin: 0 0 var(--s3); font-size: 1.75rem; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; color: var(--white); }
.auth-stage .alert { max-width: none; margin: 0 0 var(--s2); padding: 10px 0; border: 0; border-block: 1px solid var(--white); border-radius: 0; background: none; color: var(--white); font-weight: 600; }
.auth-stage a, .auth-stage .alert a { color: var(--white); }
.auth-stage a:hover { color: var(--white); }
.auth-form { display: grid; gap: 10px; margin: 0; }
.auth-form p { max-width: none; margin: 0; }
.auth-form label { display: block; font-size: 0.9375rem; font-weight: 600; color: var(--white); }
.auth-form input:not([type="hidden"]) { display: block; width: 100%; min-height: 3rem; padding: 0.75rem 0.9rem; border: 1px solid var(--rule-strong); border-radius: var(--r-card);
              background: var(--white); color: var(--ink); font: inherit; font-size: 1rem; text-align: center; -webkit-appearance: none; appearance: none; }
.auth-form input.code-input { font-family: var(--mono); font-size: 1.5rem; letter-spacing: 0.3em; }
.auth-form ::placeholder { color: var(--muted); opacity: 1; }
.auth-form input:focus { outline: 3px solid var(--white); outline-offset: 2px; }
.auth-stage .muted { color: var(--white); }
.auth-form .btn-solid, .auth-form .btn-solid:hover { width: 100%; margin-top: 6px; box-shadow: none; transform: none; }
.auth-stage .btn-solid:focus-visible { outline-color: var(--white); }
/* #89: 'Entrar con huella o cara' under the code form, readable on the photo */
.auth-passkey { display: grid; gap: 8px; margin: var(--s2) 0 0; }
.auth-passkey[hidden] { display: none; }
/* card 115: the passkey offer on a resident's or shop's home page */
body.app .app-card.passkey-nudge[hidden] { display: none; } /* beats the phone .app-card { display: flex } (Vega, card 115 review) */
.passkey-nudge__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.auth-passkey .btn-ghost, .auth-passkey .btn-ghost:hover { width: 100%; min-height: 3rem; color: var(--white); border: 1px solid var(--white); background: none; box-shadow: none; transform: none; }
.auth-passkey .btn-ghost:focus-visible { outline: 3px solid var(--white); outline-offset: 2px; }
.auth-foot { margin: var(--s2) 0 0; }
@media (max-width: 719px) {
  .auth-stage { background-image: url("../img/login-zahara-1000.jpg"); background-position: center 35%; }
  body.app.auth .hero.auth-stage { justify-content: flex-start; padding-top: 16px; overflow-y: auto; background-size: cover; background-repeat: no-repeat; }
  body.app.auth .auth-center { align-self: center; max-width: 22.5rem; margin: auto 0; }
  body.app.auth .auth-mark { width: 44px; height: 44px; margin: 0 0 10px; }
  body.app.auth .auth-mark .pin { width: 20px; height: 20px; }
  body.app.auth .eyebrow { margin: 0 0 4px; }
  body.app.auth .auth-title { margin: 0 0 14px; font-size: 1.375rem; }
  body.app.auth .auth-form { gap: 8px; }
  body.app.auth .auth-form .btn { min-height: 48px; }
}

/* short phones (under 700 px tall): the parcels to collect keep the room, history and points shrink to a peek */
@media (max-width: 719px) and (max-height: 700px) {
  body.app .hero { gap: 8px; padding-top: 8px; }
  body.app .app-head { padding: 8px 12px; }
  body.app h1, body.app .display { font-size: 1.3rem; }
  body.app .app-history { max-height: 11%; }
  body.app .app-points { max-height: 14%; }
}

/* motion: short and only when wanted. Cards rise in with a small stagger, taps press in, alerts pop. */
@keyframes rp-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rp-pop { 0% { opacity: 0; transform: scale(0.96); } 100% { opacity: 1; transform: none; } }
@media (max-width: 719px) and (prefers-reduced-motion: no-preference) {
  body.app .hero > * { animation: rp-rise 0.32s var(--ease-out) both; }
  body.app .hero > :nth-child(2) { animation-delay: 0.04s; }
  body.app .hero > :nth-child(3) { animation-delay: 0.08s; }
  body.app .hero > :nth-child(4) { animation-delay: 0.12s; }
  body.app .hero > :nth-child(5) { animation-delay: 0.16s; }
  body.app .hero > :nth-child(n+6) { animation-delay: 0.2s; }
  body.app .alert, body.app .code-big { animation: rp-pop 0.24s var(--ease-out) both; }
  body.app .btn, body.app .app-tiles .btn, body.app .events a, body.app .eyebrow a { transition: transform 0.12s var(--ease-out), background-color 0.15s ease; }
  body.app .btn:active, body.app .eyebrow a:active { transform: scale(0.97); }
  body.app .app-scroll { scroll-behavior: smooth; }
}

/* #64 (Shaun, 13 Oct: "use a dashboard design, not the same site design, but same colours"): the admin dashboard.
   Own frame (templates/app/admin_base.html): pine sidebar, slim white top bar, panels on stone, dense tables.
   Same tokens and fonts as the site; desktop 1280+ only (the admin needs no phone view). Scoped to body.admin-shell. */
body.admin-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-width: 1280px; min-height: 100vh; background: var(--stone); font-size: 0.9375rem; line-height: 1.5; }
.admin-side { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 18px 0 14px; background: var(--pine); color: var(--mint); }
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 0 22px 20px; color: var(--white); font-family: var(--display); font-size: 1.3rem; font-weight: 800; letter-spacing: -0.03em; text-decoration: none; }
.admin-brand b { color: var(--amber); font-weight: 800; }
.admin-brand small { margin-left: auto; font-family: var(--mono); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); }
.admin-brand:hover { color: var(--white); text-decoration: none; }
.admin-nav ul { margin: 0; padding: 0; list-style: none; }
.admin-nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--tap); padding: 0 18px 0 22px; border-left: 4px solid transparent; font-family: var(--body); font-size: 0.9375rem; font-weight: 600; color: var(--mint); text-decoration: none; }
.admin-nav a:hover { background: var(--pine-3); color: var(--white); text-decoration: none; }
.admin-nav a[aria-current="page"] { border-left-color: var(--amber); background: var(--pine-2); color: var(--white); }
.admin-nav a:focus-visible { outline: 3px solid var(--amber); outline-offset: -3px; }
.admin-nav-count { min-width: 1.6rem; padding: 0 7px; border-radius: 999px; background: var(--amber); color: var(--pine); font-family: var(--mono); font-size: 0.75rem; font-weight: 700; line-height: 1.7; text-align: center; }
.admin-side-foot { margin-top: auto; padding: 10px 22px 0; border-top: 1px solid var(--rule-on-pine); color: var(--mint); font-size: 0.875rem; }
.admin-side-foot:hover { color: var(--white); }
.admin-main { display: flex; flex-direction: column; min-width: 0; }
.admin-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: var(--s2); height: 56px; padding: 0 28px; background: var(--white); border-bottom: 1px solid var(--rule); }
.admin-top-title { margin: 0; max-width: none; font-family: var(--display); font-size: 1.1rem; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.admin-top-user { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.admin-top-user form { margin: 0; }
.admin-top .btn { min-height: 36px; padding: 0 14px; border: 1px solid var(--rule-strong); background: var(--white); color: var(--pine); font-size: 0.875rem; }
.admin-content { padding: 24px 28px 40px; }
/* #86: the installed admin with no connection (templates/app/admin_offline.html) */
body.admin-offline { display: grid; place-items: center; min-height: 100vh; margin: 0; padding: var(--s3); background: var(--stone); }
.admin-offline-box { max-width: 32rem; padding: var(--s4); background: var(--white); border: 1px solid var(--rule); border-radius: 12px; }
.admin-offline-box h1 { margin: var(--s2) 0 var(--s1); font-family: var(--display); color: var(--pine); }
.admin-offline-box p { color: var(--ink); }
.admin-offline-box .small { color: var(--muted); }
/* the admin pages were written for the public frame: inside the dashboard they lose the hero treatment */
body.admin-shell .hero { padding: 0; background: none; border: 0; box-shadow: none; }
body.admin-shell .hero > *, body.admin-shell p { max-width: none; }
body.admin-shell .display { max-width: none; font-size: 1.6rem; line-height: 1.15; }
body.admin-shell .lede { margin-top: 4px; font-size: 1rem; }
body.admin-shell .eyebrow { font-size: 0.75rem; }
body.admin-shell h2 { margin: 22px 0 8px; font-size: 1.15rem; }
body.admin-shell table.inbox { font-size: 0.875rem; border: 1px solid var(--rule); box-shadow: var(--shadow-card); }
body.admin-shell table.inbox th, body.admin-shell table.inbox td { padding: 7px 12px; }
body.admin-shell table.inbox tbody tr:hover td { background: var(--stone); }
.admin-panel { margin-top: 20px; padding: 16px 20px; border: 1px solid var(--rule); border-radius: var(--r-card); background: var(--white); box-shadow: var(--shadow-card); }
.admin-panel > h2:first-child { margin-top: 0; }
.admin-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.admin-kpi { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--rule); border-top: 4px solid var(--pine); border-radius: var(--r-card); background: var(--white); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-card); }
a.admin-kpi:hover { border-color: var(--pine-2); color: var(--ink); text-decoration: none; }
.admin-kpi-n { font-family: var(--display); font-size: 2.3rem; font-weight: 900; line-height: 1; color: var(--pine); font-variant-numeric: tabular-nums; }
.admin-kpi-label { font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.admin-kpi.is-alert { border-top-color: var(--red); }
.admin-kpi.is-alert .admin-kpi-n { color: var(--red); }
/* #66: the admin log's filters and pager (inside the dashboard) */
.admin-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 0 0 10px; }
.admin-filters label { display: block; margin-bottom: 4px; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.admin-filters select, .admin-filters input { min-height: 40px; padding: 6px 10px; border: 2px solid var(--rule-strong); border-radius: var(--r-card); background: var(--white); color: var(--ink); font: inherit; font-size: 0.9375rem; }
.admin-filters .btn { min-height: 40px; padding: 0 16px; font-size: 0.9375rem; }
.admin-log td { vertical-align: top; }
.admin-pager { display: flex; justify-content: space-between; margin: 10px 0 0; }
.admin-log td .mono { white-space: nowrap; }

/* #70: reports. Bars are SVG rects sized by attributes; only their colour lives here. */
.reports-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 20px; }
.rep-days { display: block; width: 100%; height: 160px; border-bottom: 1px solid var(--rule-strong); }
.rep-bar { fill: var(--pine-2); }
.rep-days .rep-bar:hover { fill: var(--pine); }
.rep-axis { display: flex; justify-content: space-between; margin: 6px 0 0; font-family: var(--mono); }
.rep-share { display: block; width: 140px; height: 8px; border-radius: 4px; background: var(--stone); }
.reports-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.reports-table td.is-alert { color: var(--red); font-weight: 700; }
.reports-table .nowrap { white-space: nowrap; }
.rep-note { margin: 12px 0 0; }

/* #71: the admin edits a point */
.pedit-form { display: grid; gap: 18px; }
.pedit-group { margin: 0; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--r-card); }
.pedit-group legend { padding: 0 6px; font-family: var(--display); font-weight: 800; color: var(--pine); }
.pedit-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 10px; }
.pedit-row label, .pedit-remove { display: block; margin-bottom: 4px; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.pedit-row input, .point-edit .hours input { min-height: 40px; padding: 6px 10px; border: 2px solid var(--rule-strong); border-radius: var(--r-card); background: var(--white); color: var(--ink); font: inherit; font-size: 1rem; }
.pedit-closures { margin: 0; padding: 0; list-style: none; }
.pedit-closures li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.pedit-remove { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.pedit-actions { display: flex; gap: 12px; align-items: center; margin: 0; }

/* #65: the admin messages list */
.admin-msgs .inline-form { display: inline; margin: 0; }
.admin-msgs .mini { min-height: 28px; padding: 0 8px; border: 1px solid var(--rule-strong); border-radius: var(--r-chip); background: var(--white); color: var(--pine); font: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.admin-msgs .btn { min-height: 34px; padding: 0 12px; border: 1px solid var(--rule-strong); font-size: 0.8125rem; }
.admin-msgs tr.is-failed td:first-child { box-shadow: inset 4px 0 0 var(--red); }
.tag.st-msg-failed { border-width: 2px; border-color: var(--red); color: var(--red); }
.tag.st-msg-sent { background: var(--pine); border-color: var(--pine); color: var(--white); }
.tag.st-msg-suppressed, .tag.st-msg-queued { color: var(--muted); }
/* #67: actions on a parcel (admin parcel page) */
.parcel-actions h2 { margin-top: 0; }
.pact-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin-bottom: 14px; }
.pact-row form, .pact-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.pact-row .btn, .pact-note .btn { min-height: 38px; padding: 0 14px; border: 1px solid var(--rule-strong); font-size: 0.875rem; }
.pact-row select, .pact-note input { min-height: 38px; padding: 4px 10px; border: 2px solid var(--rule-strong); border-radius: var(--r-card); background: var(--white); font: inherit; font-size: 0.875rem; }
.pact-note { padding-top: 12px; border-top: 1px solid var(--rule); }
.pact-note label { flex-basis: 100%; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.pact-note input { flex: 1 1 24rem; }
.pact-danger { color: var(--red); }
/* #72: admin accounts and sessions */
.admin-filters .field-grow { flex: 1 1 22rem; }
.admin-filters .field-grow input { width: 100%; }
.acc-session { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 4px 0; }
.acc-session + .acc-session { border-top: 1px solid var(--rule); }
.acc-session form, .acc-actions form { margin: 0; }
.acc-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.acc-actions .btn { min-height: 34px; padding: 0 12px; border: 1px solid var(--rule-strong); font-size: 0.8125rem; }
.admin-accounts .mini { min-height: 28px; padding: 0 8px; border: 1px solid var(--rule-strong); border-radius: var(--r-chip); background: var(--white); color: var(--pine); font: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.tag.st-acc-active { background: var(--pine); border-color: var(--pine); color: var(--white); }
.tag.st-acc-disabled { color: var(--muted); border-style: dashed; }

/* ================= #60: customers (residents and shops) inside the #64 admin shell; desktop only ================= */
.admin-tabs { display: flex; gap: 4px; margin: 14px 0 4px; border-bottom: 1px solid var(--rule-strong); }
.admin-tabs a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 700; color: var(--muted); text-decoration: none; }
.admin-tabs a:hover { color: var(--pine); }
.admin-tabs a[aria-current="page"] { border-bottom-color: var(--amber); color: var(--pine); }
.cust-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
/* Vega (#60): at 1280 the main column is about 650 px; its tables wrap instead of pushing the page sideways */
.cust-main table.inbox { table-layout: fixed; }
.cust-main table.inbox th, .cust-main table.inbox td { overflow-wrap: anywhere; }
.cust-main table.inbox th { letter-spacing: 0.04em; }
.cust-grid .admin-panel { margin-top: 20px; }
.cust-side dl.facts { grid-template-columns: 7.5rem minmax(0, 1fr); margin: 0; max-width: none; }
.cust-side dl.facts dd { min-width: 0; overflow-wrap: anywhere; }
.cust-actions form { display: grid; gap: 8px; }
.cust-actions .btn { justify-content: center; width: 100%; min-height: 40px; padding: 0 14px; font-size: 0.9375rem; }
.cust-actions .btn-ghost { border: 1px solid var(--rule-strong); background: var(--white); color: var(--pine); }
.cust-actions form p { margin: -2px 0 6px; }
.cust-danger { color: var(--red); font-weight: 700; }
.cust-danger-btn, .cust-danger-btn:hover { background: var(--red); color: var(--white); }
.cust-notes { margin: 0 0 10px; padding: 0; list-style: none; }
.cust-notes li { padding: 6px 0; border-top: 1px solid var(--rule); font-size: 0.875rem; }
.cust-notes li:first-child { border-top: 0; }
.cust-note-form { display: flex; gap: 8px; }
.cust-note-form input { flex: 1; min-width: 0; min-height: 40px; padding: 0 10px; border: 1px solid var(--rule-strong); border-radius: var(--r-chip); font: inherit; }
.cust-note-form .btn { min-height: 40px; padding: 0 14px; border: 1px solid var(--rule-strong); background: var(--white); color: var(--pine); }
.cust-body { margin: 8px 0 0; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--r-chip); background: var(--stone); font-family: var(--body); font-size: 0.9375rem; line-height: 1.55; white-space: pre-wrap; }
.tag.st-paused, .tag.st-cancelled, .tag.st-erased { border-style: dashed; color: var(--muted); }

/* #61: disputes */
.tag.dsp-open { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.tag.dsp-in_progress { background: var(--pine); border-color: var(--pine); color: var(--white); }
.tag.dsp-resolved { color: var(--muted); }
.dispute-card { margin: 0 0 var(--s1); border-left: 4px solid var(--amber); }
.dispute-card.dsp-in_progress { border-left-color: var(--pine); }
.dispute-card.dsp-resolved { border-left-color: var(--rule-strong); }
.dispute-card h2 .mono { font-size: 0.8125rem; }
.dispute-card p { overflow-wrap: anywhere; }
.form-card select, .form-card textarea, .form-card input[type="file"] { width: 100%; max-width: 100%; }
.dispute-actions form { margin: 0 0 var(--s1); }
.dispute-resolve fieldset { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 6px; padding: 0; border: 0; }
.dispute-resolve legend { margin-bottom: 4px; font-weight: 600; }
.dispute-resolve .radio { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); }

/* #68: a shop's logins on its customer page (admin, desktop) */
.shl-list { margin: 0 0 12px; padding: 0; list-style: none; }
.shl-list > li { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--rule); }
.shl-list > li:first-child { border-top: 0; }
.shl-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; min-width: 0; }
.shl-who .mono { min-width: 0; overflow-wrap: anywhere; }
/* the side column is ~260 px inside: the change-email form is a grid so the field shrinks and the button stays in */
.shl-list .cust-note-form, .shl-add .cust-note-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.shl-list .cust-note-form input, .shl-add .cust-note-form input { width: 100%; min-width: 0; }
.shl-list .cust-note-form .btn, .shl-add .cust-note-form .btn { padding: 0 10px; }
.shl-toggle { margin: 0; }
.shl-toggle .btn { min-height: 34px; padding: 0 12px; border: 1px solid var(--rule-strong); background: var(--white); color: var(--pine); font-size: 0.8125rem; }
.shl-add { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--rule); }
.shl-add label { font-size: 0.875rem; font-weight: 600; }
/* #69: the CSV export page (admin, desktop) */
.exports .admin-filters .btn-solid { min-width: 7.5rem; }
.exports-notes { margin: 8px 0; padding-left: 1.1rem; }
.exports-notes li { margin: 2px 0; }

/* card 101: Contenido (admin, desktop) and the post article (shared with the public page) */
.posts-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.posts-empty { display: grid; justify-items: start; gap: 10px; padding: 18px 0; }
.tag.post-published { background: var(--pine); border-color: var(--pine); color: var(--white); }
.tag.post-draft { color: var(--muted); border-style: dashed; }
.post-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.post-fields { display: grid; gap: 6px; }
.post-fields label { margin-top: 8px; font-size: 0.875rem; font-weight: 600; }
.post-fields input:not([type="file"]), .post-fields select, .post-fields textarea { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--rule-strong); border-radius: var(--r-card); background: var(--white); color: var(--ink); font: inherit; font-size: 0.9375rem; }
.post-fields textarea.post-md { min-height: 22rem; font-size: 0.875rem; line-height: 1.5; }
.post-row { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 12px; }
.post-actions { margin-top: 12px; }
.post-hero-thumb { display: block; width: 100%; max-width: 360px; border-radius: var(--r-card); border: 1px solid var(--rule); }
.post-preview-panel { position: sticky; top: 72px; max-height: calc(100vh - 96px); overflow-y: auto; }
.post-publish { display: flex; align-items: center; gap: 14px; }
.post-publish p { margin: 0; flex: 1; }
.post-publish form { margin: 0; }
.post-view-frame { max-width: 860px; padding: 24px; border: 1px solid var(--rule); border-radius: var(--r-card); background: var(--white); }
.post-article { max-width: 720px; margin: 0 auto; }
.post-hero { margin: 0 0 var(--s3); }
.post-hero img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-card); }
.post-title { margin: 0 0 6px; font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.1; }
.post-meta { margin: 0 0 var(--s3); }
.post-body { font-size: 1.0625rem; line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; }
.post-body h2, .post-body h3, .post-body h4 { margin: var(--s3) 0 var(--s1); }
.post-body p, .post-body ul, .post-body ol, .post-body blockquote { margin: 0 0 var(--s2); max-width: none; }
.post-body blockquote { padding-left: var(--s2); border-left: 4px solid var(--amber); color: var(--muted); }
.post-body a { color: var(--pine-2); }
.post-body code { font-family: var(--mono); font-size: 0.875em; }
.post-sources { margin-top: var(--s4); padding-top: var(--s2); border-top: 1px solid var(--rule); font-size: 0.875rem; color: var(--muted); }
.post-sources h2 { margin: 0 0 var(--s1); font-size: 1rem; }
.post-sources ol { margin: 0; padding-left: 1.2rem; }
.post-sources li { margin: 4px 0; overflow-wrap: anywhere; }
.post-sources a { color: var(--pine-2); }

/* card 101: the public blog (listing, cards, the post page) and its homepage grid */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: var(--s3); margin: var(--s3) 0; padding: 0; list-style: none; }
.post-card a { display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 1px solid var(--rule); border-radius: var(--r-card); background: var(--white); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-card); }
.post-card a:hover { border-color: var(--pine-2); }
.post-card a:hover .post-card-title { text-decoration: underline; }
.post-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--stone); }
.post-card-body { display: grid; gap: 6px; padding: 14px 16px 18px; }
.post-card-date { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); }
.post-card-title { font-family: var(--display); font-size: 1.2rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); }
.post-card-excerpt { font-size: 0.9375rem; line-height: 1.5; color: var(--muted); }
.post-page > .eyebrow, .post-page > .post-share { max-width: 720px; margin-left: auto; margin-right: auto; }
@media (min-width: 720px) {
  /* the homepage's news band: full width, three cards across (not the 4/8 split of the other bands) */
  .band.news-band[aria-labelledby="news"] > .section-title, .band.news-band[aria-labelledby="news"] > :not(.section-title) { grid-column: 1 / -1; position: static; }
  .band.news-band .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: var(--s2); }
}
.post-share { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--rule); }

/* ================= Coordination 116: the desktop client area for signed-in residents and shops ================= */
/* Shaun, 14 Oct: "The desktop layout for logged in Users is really bad. Needs a polish more premium no loud titles",
   then "give rural point desktop users a premium desktop client area": a quiet left menu (templates/app/
   _client_nav.html), the page beside it, a slim header and footer, calm titles, the content leads. body.client is
   set by base.html on the resident's and the shop's app pages only (never admin, never public pages).
   Below 900 px the two wrappers vanish and the menu is not shown, so the #51 phone app and the 720-899 px layout are
   untouched (proved by a pixel diff of every page at 390x844, 360x780 and 800 px, before and after). */
@media (max-width: 899px) {
  .client-shell, .client-pane { display: contents; }
  .client-nav { display: none; }
}
@media (min-width: 900px) {
  body.client { --client-x: max(var(--gutter), calc((100% - 80rem) / 2)); display: flex; flex-direction: column; min-height: 100vh; }
  body.client .page { flex: 1; }

  /* a slim header: the mark, where you are, Salir and the language; the public links live on the public pages */
  body.client .topbar { padding: 6px var(--client-x); }
  body.client .brand { font-size: 1.2rem; }
  body.client .topnav-public { display: none; }
  body.client .topnav { gap: var(--s1); }
  body.client .topnav-link { font-size: 0.875rem; color: var(--muted); }
  body.client .topnav .btn { min-height: var(--tap); padding: 0 14px; font-size: 0.875rem; }

  body.client .client-shell { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); gap: var(--s5); align-items: start; padding: var(--s4) var(--client-x) var(--s5); }
  body.client .client-pane { display: block; min-width: 0; }

  /* the menu: plain words on the stone ground; the page you are on is a white tab with an amber edge */
  .client-nav { display: block; position: sticky; top: 5rem; }
  .client-nav ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
  .client-nav a { display: flex; align-items: center; min-height: var(--tap); padding: 0 12px; border-radius: var(--r-chip); font-size: 0.9375rem; font-weight: 600; color: var(--ink); text-decoration: none; }
  .client-nav a:hover { background: var(--white); color: var(--pine-2); }
  .client-nav a[aria-current="page"] { background: var(--white); color: var(--pine); box-shadow: inset 3px 0 0 var(--amber), 0 1px 0 var(--rule); }
  .client-nav a:focus-visible { outline: 3px solid var(--pine); outline-offset: 2px; }

  /* the page: no band and no strip; quiet titles */
  body.client .hero { padding: 0; background: none; }
  body.client .hero.narrow { max-width: 46rem; }
  body.client .hero > * { max-width: none; }
  body.client .eyebrow { margin: 0 0 6px; font-size: 0.6875rem; color: var(--muted); }
  body.client .hero h1, body.client .hero .display { max-width: none; margin: 0; font-size: 1.75rem; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
  body.client .hero .lede { margin: 6px 0 0; max-width: none; font-size: 1rem; color: var(--muted); }
  body.client .app-head { display: block; margin: 0 0 var(--s3); }
  body.client .hero > h2, body.client .app-card > h2 { margin: 0 0 12px; font-family: var(--body); font-size: 0.9375rem; font-weight: 700; letter-spacing: 0; color: var(--ink); }
  body.client .hero > h2 small, body.client .app-card > h2 small { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--stone); font-family: var(--mono); font-size: 0.75rem; font-weight: 700; color: var(--muted); }

  /* cards: one white surface per section; a card inside a card loses its own shadow */
  body.client .app-card { display: block; margin: 0 0 var(--s3); padding: 20px 24px; border: 1px solid var(--rule); border-radius: var(--r-card); background: var(--white); box-shadow: var(--shadow-card); }
  body.client .app-scroll { display: block; }
  body.client .app-card .point-card { margin: 0 0 12px; box-shadow: none; }
  body.client .app-card .point-card:last-child { margin-bottom: 0; }
  body.client .app-actions { display: none; } /* the menu and the header carry these links */
  body.client .app-tiles { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 var(--s3); }
  body.client .app-tiles .btn { min-height: var(--tap); padding: 0 18px; font-size: 0.9375rem; }
  body.client .form-card { margin-top: 0; }
  body.client .app-card .form-card { padding: 0; border: 0; background: none; box-shadow: none; }

  /* a parcel to collect: what and when, then its three actions in one quiet row */
  body.client .parcel-row { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px var(--s3); }
  body.client .due { font-size: 1rem; }
  body.client .parcel-actions { align-items: center; gap: 4px 12px; }
  body.client .parcel-actions .btn-sm { min-height: var(--tap); padding: 0 14px; font-size: 0.875rem; }

  /* lists read as rows, not bullets; the reference sits on the right */
  body.client .events { margin: 0; padding: 0; list-style: none; }
  body.client .events > li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--rule); font-size: 0.9375rem; }
  body.client .events > li:first-child { border-top: 0; padding-top: 0; }
  body.client .events > li > b:first-child { flex: 0 0 7rem; font-weight: 600; }
  body.client .events > li > .mono { margin-left: auto; font-size: 0.8125rem; color: var(--muted); }

  /* the QR and the scanner: centred and sized for a screen, not a phone */
  body.client .qr-card { margin: 0 auto var(--s3); max-width: 20rem; }
  body.client .scan-view { max-width: 22rem; margin-inline: auto; }
  body.client .code-big { max-width: 26rem; margin: var(--s3) 0; font-size: 3rem; }

  /* a slim footer: the mark and the two legal links */
  body.client .footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px var(--s3); padding: 10px var(--client-x); font-size: 0.8125rem; }
  body.client .footer > :not(.brand):not(.footer-links):not(.footer-credit) { display: none; }
  body.client .footer .brand { margin: 0; font-size: 1rem; }
  body.client .footer-links a { padding: 8px 2px; }
}
/* wide screens: the resident's home puts the points, the notices and the history beside the parcels to collect */
@media (min-width: 1200px) {
  body.client .hero.dash { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; grid-template-rows: auto auto auto 1fr; column-gap: var(--s3); align-items: start; }
  body.client .dash > .app-head { grid-column: 1 / -1; }
  body.client .dash > .app-grow { grid-column: 1; grid-row: 2 / span 3; }
  body.client .dash > .app-points { grid-column: 2; grid-row: 2; }
  body.client .dash > .push-panel { grid-column: 2; grid-row: 3; }
  body.client .dash > .app-history { grid-column: 2; grid-row: 4; }
  body.client .dash > .app-history .app-scroll { max-height: 28rem; overflow-y: auto; }
}
