/* 27Gems account — shared stylesheet for the static account page
   (index.html/app.js) and the server-rendered /authorize screens
   (src/index.js's pageShell). Kept as one file, deliberately: an
   external stylesheet (not the Tailwind Play CDN this replaced, and not
   an inline <style>) is what lets the Worker's CSP use a flat
   style-src 'self' with no exception, on every page it serves. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-raised: #ffffff;
  --fg: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --accent: #1F4E8C;
  --accent-hover: #173d6e;
  --accent-bg: #eef3fb;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --success: #15803d;
  --success-bg: #f0fdf4;
  --skeleton: #e5e7eb;
  --focus-ring: rgba(59, 160, 220, 0.45);
  /* Plan Management's Pay button (2026-09-10) — deliberately its own
     colour, shared with nothing else on the page (not --accent, which
     every btn-primary/selected toggle already uses), so the one button
     that actually spends money is never visually confusable with a
     selection state. --pay-fg flips between white/dark text per mode: a
     colour dark enough for white text on a light page reads as muddy on
     a dark one, so light/dark use different tones, not just different
     text colours on the same background. */
  --pay: #b45309;
  --pay-hover: #92400e;
  --pay-fg: #fff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --bg-raised: #111a2e;
    --fg: #e5e7eb;
    --muted: #9ca3af;
    --border: #1f2937;
    --border-strong: #2b3852;
    --accent: #3BA0DC;
    --accent-hover: #63b6e6;
    --accent-bg: #0f1d33;
    --danger: #f87171;
    --danger-bg: #2a1414;
    --success: #4ade80;
    --success-bg: #0f2417;
    --skeleton: #1c2740;
    --focus-ring: rgba(59, 160, 220, 0.35);
    --pay: #fbbf24;
    --pay-hover: #f59e0b;
    --pay-fg: #1f2937;
  }
  /* Default .spinner is tuned for a white-text button (btn-primary,
     btn-pay in light mode) — in dark mode btn-pay's text flips dark
     (--pay-fg above), so its loading spinner needs the same flip or it
     reads as a near-invisible white ring on bright amber. */
  .btn-pay .spinner { border-color: rgba(31, 41, 55, 0.3); border-top-color: var(--pay-fg); }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
}

body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

[hidden] { display: none !important; }

header.site-header {
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-inner img { height: 24px; width: 24px; object-fit: contain; }
.header-inner span { font-weight: 600; letter-spacing: -0.01em; }

main.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

/* Standalone card layout, used by the server-rendered /authorize screens */
main.standalone-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 64px 20px;
  text-align: center;
}
main.standalone-card img.mark { height: 32px; width: 32px; margin-bottom: 24px; }

h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 8px; }
main.standalone-card h1 { font-size: 22px; }
p.lede { color: var(--muted); margin: 0 0 24px; }

label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }

input[type="email"], input[type="text"], input[type="number"], input[type="url"], input[type="tel"], select, textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  color: var(--fg);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px; /* prevents iOS auto-zoom on focus */
  min-height: 44px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
/* select's own OS-drawn dropdown arrow ignores every rule above unless
   the browser's native appearance is reset first — without this a
   <select> renders as a raw, unstyled system widget even with the border/
   background/padding rules already applied everywhere else (the "ugly
   dropdown" the operator flagged after admin27's action forms started
   using real <select> fields, 2026-09-08). A plain CSS arrow replaces the
   native one so it still reads as a dropdown, not a text field. */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'><path fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.148l3.71-3.918a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}
textarea { min-height: 80px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 120ms ease, opacity 120ms ease;
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-secondary { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn-secondary:hover { background: var(--accent-bg); }
.btn-pay { background: var(--pay); color: var(--pay-fg); }
.btn-pay:hover { background: var(--pay-hover); }
.btn-pay:disabled { opacity: 0.6; cursor: default; }
.btn-block { width: 100%; }
.btn-text {
  background: none; border: none; color: var(--accent); font-size: 14px; font-weight: 500;
  cursor: pointer; padding: 4px 0;
}
.btn-text:disabled { color: var(--muted); cursor: default; }

.link { color: var(--accent); text-decoration: none; font-size: 14px; }
main.standalone-card a.link { display: block; margin-top: 16px; }

.error-text {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
}

.success-text {
  color: var(--success);
}

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.btn-secondary .spinner { border-color: var(--accent-bg); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1400ms; } }

/* OTP six-box input */
.otp-boxes { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.otp-boxes input {
  width: 44px; height: 52px; text-align: center; font-size: 20px; padding: 0;
}

.field-group { margin-bottom: 16px; }

/* Visually-hidden but still reachable by a screen reader (2026-09-15) —
   for a form control whose purpose is already clear from visible context
   (a Subscribe panel's own tier/cadence picker sitting right under a
   product name), but which still needs a real <label for="..."> rather
   than none at all. Standard clip-based technique, not display:none
   (which screen readers skip entirely). */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.section-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 12px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 12px;
}

.card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-1 { flex: 1; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500;
}
.badge-active { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
/* An uncoloured badge (2026-09-24). Deliberately carries no colour: it marks
   a product known only through a business record, with no sign-in behind it
   — a gap in what we know, not a state to celebrate or warn about. Adding a
   colour here is what the .admin-overview-state note above warns against. */
.badge-neutral { color: var(--muted); border: 1px solid var(--border); }

.muted { color: var(--muted); }
.text-sm { font-size: 13px; }

.empty-state { color: var(--muted); font-size: 14px; padding: 8px 0; }

/* Skeleton, shown while /api/me resolves — replaces the old flash of the
   sign-in form on every visit for an already-signed-in user. */
.skeleton-block {
  background: var(--skeleton);
  border-radius: 10px;
  animation: pulse 1400ms ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .skeleton-block { animation: none; opacity: 0.7; } }

/* Toasts */
#toast-region {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  width: calc(100% - 40px);
  max-width: 420px;
}
.toast {
  background: var(--fg);
  color: var(--bg);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* Generic confirmation modal (2026-09-10) — app.js's showConfirmModal().
   Plain fixed-position overlay + centered box, no animation library
   needed for a one-off dialog. */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}
.modal-box {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}
.modal-box h2 { font-size: 18px; margin: 0; }

footer.legal { text-align: center; }

/* Utility classes — CSP's style-src is a flat 'self' with no
   'unsafe-inline' exception, so every one-off layout tweak that would
   otherwise be a `style="..."` attribute (a real inline style, blocked
   the same as an inline <style> block) lives here instead. */
.m-0 { margin: 0; }
.fw-500 { font-weight: 500; }
.w-auto { width: auto; }
.align-start { align-items: flex-start; }
.row { display: flex; gap: 12px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-4 { margin-bottom: 4px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-32 { margin-bottom: 32px; }
.mb-36 { margin-bottom: 36px; }

.skeleton-title { height: 28px; width: 60%; margin-bottom: 12px; }
.skeleton-subtitle { height: 16px; width: 40%; margin-bottom: 32px; }
.skeleton-card { height: 84px; width: 100%; margin-bottom: 12px; border-radius: 16px; }
.skeleton-card-last { height: 84px; width: 100%; border-radius: 16px; }

@media (max-width: 420px) {
  main.page { padding-left: 16px; padding-right: 16px; }
}

/* Collapsible product-family sections (2026-09-10) — src/products.js's
   PRODUCT_FAMILIES, rendered by public/app.js's renderProductFamilies.
   Plain <details>/<summary> rather than a JS-driven accordion: no extra
   script needed for open/close state, and it degrades to "just open" if
   JS is ever slow to attach anything else. */
.family-section {
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 12px;
  overflow: hidden;
}
.family-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.family-summary::-webkit-details-marker { display: none; }
.family-summary::before {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 150ms ease;
  margin-right: 4px;
}
.family-section[open] > .family-summary::before { transform: rotate(45deg); }
.family-name { margin-right: auto; }
.family-body {
  padding: 0 20px 20px;
}
.family-body .card:last-child { margin-bottom: 0; }

/* Boxed disclosure panel (2026-09-10) — the picker/checkout controls
   revealed by a card's "Switch plan"/"Subscribe" button, packaged into
   its own raised box (same background token as an admin-stat-card, the
   existing "content sits on a slightly raised surface" convention) with
   a × in the top-right corner to close it, replacing the opener button
   relabeling itself to "Cancel" in place. public/app.js's
   [data-toggle-panel] handler shows/hides this together with the
   opener's own row_wrap[data-panel-trigger]. */
.panel-box {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-raised);
  padding: 40px 16px 16px;
}
.panel-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: 50%;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.panel-close:hover { background: var(--accent-bg); color: var(--fg); }

/* Centralized admin dashboard (admin27.27gems.com, Module 1, 2026-09-08) —
   src/adminDashboard.js. Wider than the 480px account page since it's a
   grid of product cards and data tables, not a single form.

   Shell rebuilt 2026-09-23 (audit item 5): the brand row is now a fixed
   band above a two-column layout — persistent nav on the left, page on
   the right — instead of each page re-rendering its own header and a
   single "back to all products" link. src/adminShell.js owns the markup;
   all three admin renderers (adminDashboard/adminClients/adminDeposits)
   import it rather than keeping their own copy. */
main.admin-page { max-width: 1100px; overflow-wrap: break-word; }
/* break-word, not anywhere: it only breaks a run that would otherwise
   overflow, and unlike `anywhere` it doesn't shrink min-content — so
   table columns size exactly as before. `nowrap` table cells are
   untouched either way. */
/* Admin rows wrap rather than overflow (2026-09-24, measured: Deposit
   Refunds rows 60px wider than their card at 375px; a client entity's
   64-char Jade business id pushed /clients/:id 95px past the screen).
   A flex child's default min-width is its longest unbreakable run, so
   one that is wider than the whole line also needs min-width: 0 to let
   break-word wrap it. Scoped to admin27: on the account page the same
   classes hold a title beside a plan badge, and the badge must never
   be the thing that gives way. */
.admin-page .card-row { flex-wrap: wrap; }
.admin-page .card-row > *, .admin-page .row-wrap > * { min-width: 0; max-width: 100%; }
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
}
.admin-header .mark { height: 28px; width: 28px; margin-right: 12px; }
.admin-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.admin-brand-name { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }

/* Two-column shell. The nav is a real column on a desktop and a
   horizontally-scrollable strip on a phone — no script either way, since
   this Worker serves a strict CSP with no inline JS. */
.admin-layout {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
}
.admin-layout > main.admin-page { flex: 1; min-width: 0; padding-left: 0; padding-right: 0; }
.admin-nav {
  flex: 0 0 200px;
  position: sticky;
  top: 24px;
  padding: 24px 0;
}
.admin-nav-group { margin-bottom: 20px; }
.admin-nav-heading {
  margin: 0 0 6px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-nav-link {
  display: block;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--fg);
  text-decoration: none;
}
.admin-nav-link:hover { background: var(--accent-bg); }
.admin-nav-link-current {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
}
.admin-page-title { font-size: 22px; margin: 0 0 16px; letter-spacing: -0.01em; }

/* The attention band — the one thing the overview exists to answer. */
.admin-attention {
  border: 1px solid var(--danger);
  background: var(--danger-bg);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 28px;
}
.admin-attention-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--danger);
}
.admin-attention-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.admin-attention-item {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-raised);
  text-decoration: none;
  color: inherit;
}
.admin-attention-item:hover { border-color: var(--danger); }
.admin-attention-count {
  display: block;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--danger);
}
.admin-attention-label { display: block; font-size: 14px; margin-top: 2px; }
.admin-attention-where { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
/* Nothing waiting: same box, calm colours — the answer is still stated. */
.admin-attention-clear { border-color: var(--border); background: var(--bg-raised); }
.admin-attention-clear .admin-attention-title { color: var(--success); margin-bottom: 4px; }
.admin-attention-sub { margin: 0; font-size: 14px; color: var(--muted); }

.admin-overview-section { margin-bottom: 28px; }
.admin-overview-section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.admin-overview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
}
.admin-overview-row-main { display: block; min-width: 0; }
.admin-overview-row-desc {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
/* Deliberately not a badge. These rows have no state worth colouring —
   saying so in plain muted text is what stops badge colour from meaning
   four different things again. */
.admin-overview-state { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* Pagination (2026-09-23, audit item 6) — src/adminPaging.js. Shown above
   every admin list; the summary line renders even on a single page,
   because "12 clients" is information and its absence is what made the
   old hard-capped lists ambiguous about whether more existed. */
.admin-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.admin-pager-summary { margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.admin-pager .admin-pager-summary { margin-bottom: 0; }
.admin-pager-controls { display: flex; gap: 8px; }
.admin-pager-btn { min-height: 36px; padding: 6px 16px; font-size: 14px; }
/* A disabled end-stop is a <span>, not a <button> — it is never focusable
   and never looks clickable, rather than a link that silently does
   nothing at the first or last page. */
.admin-pager-btn-off { opacity: 0.45; cursor: default; border-color: var(--border); color: var(--muted); }

@media (max-width: 860px) {
  .admin-layout { display: block; padding: 0 16px; }
  .admin-nav {
    position: static;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }
  .admin-nav-group { display: flex; gap: 6px; margin-bottom: 0; }
  .admin-nav-heading { display: none; }
  .admin-nav-link { white-space: nowrap; border: 1px solid var(--border); }
}
/* Top-line stats (2026-09-08, replacing a flat label/value list once
   itemized tables got their own section below) — a KPI-style card grid,
   scannable at a glance rather than read line by line. */
.admin-stat-grid {
  display: grid;
  /* 180px, not 160: a five-figure RM amount at 22px ("RM34,200.00",
     ~134px) overflowed a 160px card's 128px content box. */
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
/* min-width: 0 lets a grid/flex card be narrower than its longest word,
   so main.admin-page's break-word can wrap the value inside its own
   card instead of the value painting over the card next to it. */
.admin-stat-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: var(--bg-raised);
}
.admin-stat-value { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.admin-stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Label/value facts (2026-09-24) — for names, emails, ids and dates,
   which don't belong in a stat card: a stat card is a big number to
   scan, and a 22px email overlapped the card beside it on
   /clients/:id. */
.admin-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 24px;
  margin: 12px 0 16px;
}
.admin-facts > div { min-width: 0; }
.admin-facts dt { font-size: 12px; color: var(--muted); }
.admin-facts dd { margin: 2px 0 0; font-size: 15px; }

/* One section per itemized table (firms, runs, support messages, ...),
   with that table's own related actions rendered directly beneath it —
   added 2026-09-08 after the operator said data + disconnected action
   forms "wasn't built for a human to read and act upon." */
.admin-table-section { margin-bottom: 16px; }
.admin-table-section h3 { font-size: 15px; margin: 0 0 12px; }

.admin-nested-table-wrap { overflow-x: auto; width: 100%; }
.admin-nested-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-nested-table th, .admin-nested-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-nested-table th { color: var(--muted); font-weight: 500; }
.admin-nested-table tbody tr:hover { background: var(--accent-bg); }
/* Id-like columns (2026-09-08, "show me the business name, not the firm
   ID") — reordered to the end and visually de-emphasized rather than
   hidden: still there if genuinely needed, never the first thing read. */
.admin-nested-table .admin-id-col { color: var(--muted); font-size: 12px; }
/* A per-row action form (2026-09-10, event registrations' attended-toggle
   and grant-hours buttons) sits inside a <td> — a bare <form> defaults to
   block and would force it onto its own line under the cell's other
   content. */
.admin-inline-form { display: inline; margin-left: 8px; }
/* Contact Inquiries' message column (2026-09-13) — free-text, often a
   full sentence or two; the table's default nowrap would force a
   horizontal-scroll read for exactly the column most worth reading. */
/* Must out-specify `.admin-nested-table th, .admin-nested-table td`'s own
   `white-space: nowrap` above (0,2,1 beats a bare 0,1,0 class regardless
   of source order) — without the element-qualified selector this rule has
   never actually applied, and long Contact/CSP values rendered as one
   nowrap line spilling visibly across the columns to its right. Found
   2026-09-23 by measuring a rendered page, not by reading the CSS. */
.admin-nested-table td.admin-wrap-cell { white-space: normal; max-width: 420px; }

.admin-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 16px; }
.admin-action-form {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.admin-action-destructive { border-color: var(--danger); }
.admin-action-form input[type="checkbox"] { width: auto; min-height: 0; margin-top: 2px; }

.admin-badge-error { color: var(--danger); border: 1px solid var(--danger); }

/* Editable matrix (2026-09-08) — rows are fields, columns are instances
   (years, periods, ...), cells are real inputs pre-filled with the
   current value. src/adminDashboard.js's renderMatrixAction. */
.admin-matrix-block { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 16px; }
.admin-matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-matrix th, .admin-matrix td { padding: 6px 8px; text-align: left; }
.admin-matrix th { color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border); }
.admin-matrix-row-label { color: var(--muted); white-space: nowrap; padding-right: 16px; }
.admin-matrix td input {
  min-height: 36px;
  padding: 6px 8px;
  font-size: 14px;
  width: 100%;
  min-width: 100px;
}


/* Copyable identifier row (2026-09-24) — admin27's Jade Hours cards show
   the business ID so an operator can hand one to a partner service without
   opening DevTools. `user-select: all` makes a single click select the whole
   ID, so Ctrl+C works even if public/admin.js's Copy button never loads. */
.admin-id-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.admin-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  user-select: all;
  word-break: break-all;
}
.admin-copy { font-size: 13px; }

/* Generic pill button (2026-09-27) — the server-rendered device/admin-
   approval screens (src/index.js's deviceEntryBody, the /authorize
   approve/decline pair) and every 27Gems' Solopreneur Club page
   (src/clubPages.js) share this one class for a plain <a>/<button> that
   isn't wired into public/app.js's own .btn-primary JS state (a spinner,
   a disabled-while-pending flag). Same visual weight as .btn-primary —
   full-width, accent-filled — since a page with no JS still needs its one
   primary action to read as the obvious next step. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 12px 24px;
  margin-top: 4px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--accent-hover); }

/* 27Gems' Solopreneur Club (gem: Garnet, club.27gems.com, 2026-09-27) —
   src/clubPages.js. Every club page shares .standalone-card's centered,
   420px-max layout (index.js's pageShell) via the .club-page marker;
   rules below are additions/overrides specific to the Club's own markup,
   never a replacement for that shared shell. Mobile-first: every rule
   here holds at 375px with no horizontal scroll (checked against the
   actual widest content — the enquiry form and the namecard's contact
   row) before any wider-viewport adjustment. */
main.club-page { text-align: left; }
main.club-page h1 { text-align: center; }
main.club-page form { margin-bottom: 20px; }
main.club-page .field-group,
main.club-page label { margin-bottom: 14px; }

/* Flash — the outcome of the last save/enquiry attempt, rendered inline
   (no separate toast system on these no-JS pages). */
.club-flash {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}
.club-flash--ok { background: var(--success-bg); color: var(--success); }
.club-flash--error { background: var(--danger-bg); color: var(--danger); }

/* A short explanatory line under a field or section — the same job
   p.lede does on the standalone-card auth screens, just smaller and
   inline rather than a single lede under the h1. */
.club-help { font-size: 13px; color: var(--muted); margin: -6px 0 14px; }

/* The "Show phone/email on my public card" / "Let search engines find my
   card" checkboxes — a normal checkbox plus its label text on one line,
   not the block-per-label stacking every text input above it uses. */
.club-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 14px;
}
.club-toggle input[type="checkbox"] { width: auto; min-height: 0; margin: 0; }

/* Photo upload — its own small <form> (POST /me/photo), not a field in
   the main card form. */
.club-photo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.club-photo img { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.club-photo input[type="file"] { flex: 1 1 100%; min-width: 0; font-size: 13px; }
.club-photo .button { width: auto; flex-shrink: 0; }

/* The public card itself (GET /:handle) — a namecard, not a stacked form:
   photo, name, tagline, contact, socials, businesses, then the enquiry
   form (club-contract.md's own order). */
.club-namecard { display: flex; flex-direction: column; align-items: center; text-align: center; }
.club-avatar {
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
}
/* No photo uploaded — a plain placeholder disc holds the same layout
   space a real photo would, so the name/tagline below don't jump when a
   member later adds one. */
.club-avatar--placeholder {
  width: 120px;
  height: 120px;
  background: var(--skeleton);
}
.club-tagline { color: var(--muted); margin: 0 0 12px; }
.club-contact { margin: 0 0 8px; }
.club-contact p { margin: 4px 0; }
.club-socials { font-size: 14px; margin: 0 0 20px; }
/* The card's own sections (Businesses, Get in touch) are full-width
   within the 420px shell, not centered like the photo/name block above. */
.club-namecard section,
.club-enquiry-form {
  width: 100%;
  text-align: left;
  margin-top: 8px;
}
.club-namecard h2 { font-size: 17px; margin: 0 0 12px; }

/* Jade businesses list — each item is the business name (linked to its
   Jade listing when one is published) plus its evidence line. */
.club-businesses { list-style: none; margin: 0 0 8px; padding: 0; }
.club-businesses li {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.club-businesses li .club-help { margin: 4px 0 0; }

/* Inbox (GET /inbox) — one card per enquiry, newest first. */
.club-enquiry {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.club-enquiry p { margin: 0 0 6px; }
.club-enquiry p:last-of-type { margin-bottom: 10px; }

@media (max-width: 420px) {
  main.standalone-card.club-page { padding: 40px 16px; }
}
