/* =====================================================================
   Trailhead — shared mockup styles  (v0.3 — synced with style_guide.html)
   ===================================================================== */

/* ===== Tokens ===== */
:root {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 0px);
  --nav-h: 64px;
  --header-h: 52px;

  /* Type */
  --font-sans: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, "SF Mono", Menlo, monospace;

  /* Color */
  --ink:       #111714;
  --ink-2:     #3a3f3c;
  --muted:     #6e7470;
  --line:      #e8e6e0;
  --line-2:    #f1efe9;
  --paper:     #ffffff;
  --paper-2:   #fafaf6;
  --paper-3:   #f4f3ee;
  --accent:    #2c5234;
  --accent-d:  #1f3a25;
  --accent-s:  #eaf0ec;
  --trail:     #7a4f29;
  --trail-s:   #f5ecda;
  --sig-yes:   #2c5234;
  --sig-no:    #9b3a3a;
  --sig-int:   #7a4f29;
  --sig-go:    #1f3a25;
  --warn:      #93680e;
  --warn-s:    #fbf1d4;
  --ok:        #1e7e34;
  --ok-s:      #e6f4ea;

  /* Channel accents — flat taxonomy (all / parents / scouts / leaders / asms /
     patrol:X). A communication channel is shown *visually* — an icon + this
     hue + a soft background — never as a text label. `patrol:X` reuses the
     scout/patrol hue, tinted per-patrol in code. */
  --ch-all:        var(--accent);   --ch-all-s:     var(--accent-s);
  --ch-parents:    #2f5f7a;         --ch-parents-s: #e6eef3;
  --ch-scouts:     #7a4f29;         --ch-scouts-s:  #f5ecda;
  --ch-leaders:    #5b4a82;         --ch-leaders-s: #ece8f4;
  --ch-asms:       #2a6d63;         --ch-asms-s:    #e2efed;
  --ch-patrol:     #a8543c;         --ch-patrol-s:  #f3dcd2;

  /* Motion */
  --ease-soft:   cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 120ms;
  --t-med:  220ms;
  --t-slow: 320ms;

  /* Hold-to-confirm gesture (slice 5.3) — JS timer in hold-confirm.js
     mirrors this duration. Keep them in lockstep. */
  --hold-duration: 700ms;

  /* Spacing scale — one scale, every viewport. Card padding / gap / section
     gap / type sizes do NOT tier up at desktop; only the frame width does.
     Search-replace literal 4/8/12/14/16/20/24/32 → these tokens as pages get
     rewritten. */
  --space-1: 4px;    /* icon ↔ text inside a chip; pill gap */
  --space-2: 8px;    /* tight gaps; row gap inside a small card */
  --space-3: 12px;   /* default section gap (.pad { gap }) */
  --space-4: 14px;   /* card padding inner (.card { padding }) */
  --space-5: 16px;   /* larger card padding; group gap */
  --space-6: 20px;   /* takeover-section vertical spacing */
  --space-7: 24px;   /* hero / brand block padding */
  --space-8: 32px;   /* hero spacing; top-of-page breathing */
}

/* ===== Global base ===== */
* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  accent-color: var(--accent);
}
html, body { margin: 0; padding: 0; }
html, body { overflow-x: hidden; max-width: 100%; }

body.screen {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "ss01" 1, "cv11" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Mobile / iframe: lock the body so the .frame's internal scroll is the
     only scroll. Nav + action area stay pinned no matter how long the
     content is. (Desktop overrides this in the @media block below.) */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

::selection {
  background: #d6dfd8;
  color: var(--accent-d);
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

/* Inline links underline by default (WCAG 1.4.1 — must be distinguishable
   without relying on color alone). Link-shaped components like .btn,
   .nav-tab, .next-card, etc. explicitly set `text-decoration: none`. */
a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }

ul, ol { padding-left: 20px; margin: 0; }

/* Tabular numerals */
.tnum, .modal-step {
  font-variant-numeric: tabular-nums;
}

.balance { text-wrap: balance; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* Focus-visible only for keyboard users */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}
button:focus-visible, .signal:focus-visible, .nav-tab:focus-visible {
  border-radius: 12px;
}

/* =====================================================================
   FRAME — responsive (production)
   - Mobile (any width): full-bleed; the page IS the app
   - Wide viewports: same shape, capped width so a 1920px monitor doesn't
     stretch a single column of cards. NEVER a fake "phone-in-the-middle".
   - Always full viewport height; internal scroll lives in .frame-content.
   ===================================================================== */
.frame {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  width: 100%;
  max-width: 640px;       /* sensible cap; lets it feel mobile on big screens */
  margin: 0 auto;
  height: 100vh;          /* fallback */
  height: 100dvh;         /* exact viewport */
  isolation: isolate;
  overflow: hidden;
}

@media (min-width: 768px) {
  body.screen {
    /* Soft tint behind the centered frame on wide screens; differentiates
       the app surface from the page background without faking a phone. */
    background: #f4f2ee;
  }
  .frame {
    box-shadow: 0 8px 32px -16px rgba(17, 23, 20, 0.18);
  }
}

/* No fake OS status bar — this is a responsive web app, not a native app;
   the device draws the real bar. (Was `.phone-statusbar` — removed.) */

/* =====================================================================
   APP HEADER — sticky, scroll-aware
   ===================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  flex: 0 0 auto;
  min-height: var(--header-h);
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
  transition: border-color var(--t-med) var(--ease-soft),
              background var(--t-med) var(--ease-soft);
}
.app-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, 0.92);
}
/* Mobile: header pushes down for safe-area top inset */
.app-header { padding-top: max(8px, var(--safe-top)); }
@media (min-width: 768px) { .app-header { padding-top: 8px; } }

.header-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-soft);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.header-btn:hover { background: var(--paper-3); }
.header-btn .badge {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 4px;
  min-width: 14px;
  text-align: center;
  line-height: 1.4;
}
.header-btn-text {
  width: auto;
  padding: 0 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
}
.header-title { text-align: center; min-width: 0; }
.header-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1px;
  font-variant-numeric: tabular-nums;
}
.header-h {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =====================================================================
   FRAME CONTENT
   ===================================================================== */
.frame-content {
  flex: 1 1 auto;
  /* Without min-height: 0, flex children default to min-height: auto, can't
     shrink below their content, and push the nav off-screen. */
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* Subtle scroll indicator on the right — appears only when scrollable.
     Firefox + Edge. */
  scrollbar-width: thin;
  scrollbar-color: rgba(110, 116, 112, 0.35) transparent;
}
/* Webkit (Chrome, Safari) — matched style */
.frame-content::-webkit-scrollbar {
  width: 4px;
}
.frame-content::-webkit-scrollbar-track {
  background: transparent;
}
.frame-content::-webkit-scrollbar-thumb {
  background: rgba(110, 116, 112, 0.35);
  border-radius: 999px;
  transition: background var(--t-fast) var(--ease-soft);
}
.frame-content::-webkit-scrollbar-thumb:hover {
  background: rgba(110, 116, 112, 0.55);
}
.frame-content > .pad {
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* =====================================================================
   NAV BAR — fixed-bottom navigation, M3 pill highlight
   ===================================================================== */
.nav-bar {
  flex: 0 0 auto;
  height: var(--nav-h);
  padding: 6px 4px calc(6px + var(--safe-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: stretch;
}
.nav-tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease-soft);
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}
.nav-tab:hover { color: var(--ink); text-decoration: none; }
.nav-tab.is-active { color: var(--accent-d); font-weight: 600; }
.nav-tab .nav-ico-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 28px;
  border-radius: 14px;
  transition: background var(--t-med) var(--ease-soft);
}
.nav-tab.is-active .nav-ico-wrap {
  background: #d6dfd8;
}
.nav-tab svg { width: 22px; height: 22px; stroke-width: 2; }
.nav-tab.is-active svg { stroke-width: 2.4; }

/* =====================================================================
   ACTION AREA
   ===================================================================== */
.action-area {
  flex: 0 0 auto;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.action-area-only {
  /* When no nav follows, action area gets safe-area inset */
  padding-bottom: calc(10px + var(--safe-bottom));
}

/* =====================================================================
   BUTTON
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 18px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-soft),
              transform var(--t-fast) var(--ease-soft),
              border-color var(--t-fast) var(--ease-soft);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: -0.005em;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 0 rgba(31, 58, 37, 0.4) inset;
}
.btn-primary:hover { background: var(--accent-d); color: #fff; }
.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { background: var(--paper-2); border-color: #d8d6d0; }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  min-height: 36px;
  padding: 8px 14px;
}
.btn-ghost:hover { background: var(--accent-s); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 14px; min-height: 48px; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; min-height: 32px; }
.btn .btn-ico { width: 18px; height: 18px; }

/* =====================================================================
   SIGNAL PILL
   ===================================================================== */
.signal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 14px;
  min-height: 36px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-soft),
              background var(--t-fast) var(--ease-soft),
              color var(--t-fast) var(--ease-soft),
              transform var(--t-fast) var(--ease-soft);
  -webkit-tap-highlight-color: transparent;
}
.signal:hover { border-color: #b8b6b0; }
.signal:active { transform: scale(0.97); }
.signal.is-active.yes { border-color: var(--sig-yes); color: var(--sig-yes); background: var(--accent-s); font-weight: 600; }
.signal.is-active.no  { border-color: var(--sig-no);  color: var(--sig-no);  background: #f7e9e9;       font-weight: 600; }
.signal.is-active.int { border-color: var(--sig-int); color: var(--sig-int); background: var(--trail-s); font-weight: 600; }
.signal.is-active.go  { border-color: var(--sig-go);  color: var(--sig-go);  background: #d6dfd8;       font-weight: 600; }

/* Compact variant — for vote controls on poll cards / detail rows where the
   full-size pill is too heavy. Also: when a choice is already made, render
   only the picked pill (`.is-active`) rather than the whole group. */
.signal-sm { padding: 6px 11px; min-height: 30px; font-size: 13px; gap: 4px; }
.signal-sm svg { width: 13px; height: 13px; }

/* M1 / M2 — "saved" feedback after RSVP / vote: the pill scale-pulses and a
   small "Saved ✓" pip rises beside it. */
@keyframes signal-pulse {
  0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); }
}
.signal.just-saved { animation: signal-pulse 320ms var(--ease-spring); }
.saved-pip {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--accent);
  opacity: 0; transform: translateY(2px);
}
.saved-pip svg { width: 12px; height: 12px; }
.saved-pip.show { animation: rise-fade 1.8s var(--ease-soft) forwards; }
@keyframes rise-fade {
  0% { opacity: 0; transform: translateY(2px); }
  18% { opacity: 1; transform: translateY(0); }
  78% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-2px); }
}

/* =====================================================================
   CARD
   ===================================================================== */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.card-tinted { background: var(--paper-2); }
.card-dashed { border-style: dashed; }
.card-button {
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-soft),
              background var(--t-fast) var(--ease-soft),
              transform var(--t-fast) var(--ease-soft),
              box-shadow var(--t-fast) var(--ease-soft);
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card-button:hover {
  border-color: #c8c4ba;
  box-shadow: 0 1px 2px rgba(17, 23, 20, 0.05);
  text-decoration: none;
}
.card-button:active { background: var(--paper-2); transform: scale(0.99); }

/* Common card patterns */
.card-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-row .body { flex: 1 1 auto; min-width: 0; }
.card-row .body .name { font-weight: 600; font-size: 14px; color: var(--ink); }
.card-row .body .sub  { font-size: 12px; color: var(--muted); }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.card .meta {
  font-size: 12px;
  color: var(--muted);
}

/* =====================================================================
   CHIP
   ===================================================================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--paper-3);
  color: var(--ink-2);
  line-height: 1.4;
}
.chip-accent { background: var(--accent-s); color: var(--accent-d); }
.chip-trail  { background: var(--trail-s);  color: var(--trail); }
.chip-warn   { background: var(--warn-s);   color: var(--warn); }
.chip-tap {
  padding: 7px 12px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-soft);
}
.chip-tap:hover { background: var(--line); }
.chip svg { width: 11px; height: 11px; }

/* =====================================================================
   ROLE CHIP — minimal closed set of tappable letter-chips next to a name.
   Adults: P (parent), PL / APL / SPL / QM (youth positions), ASM / SM (adult
   leaders). A plain Scout shows NO chip — just their rank badge — *except* a
   brand-new Scout with no rank yet, who shows the `S` placeholder until a
   parent picks a rank. Stack with .role-chip-stack when a person holds several.
   Tap → expands to the full title. Never render the app-admin bit as a chip.
   ===================================================================== */
.role-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--paper-3);
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease-soft);
  -webkit-tap-highlight-color: transparent;
  flex: 0 0 auto;
}
.role-chip:hover { background: var(--line); text-decoration: none; }
.role-chip.is-parent  { background: var(--ch-parents-s); color: var(--ch-parents); }   /* P */
.role-chip.is-youth   { background: var(--ch-scouts-s);  color: var(--ch-scouts); }     /* PL APL SPL QM, and the S placeholder */
.role-chip.is-leader  { background: var(--ch-leaders-s); color: var(--ch-leaders); }    /* ASM SM */
.role-chip-stack { display: inline-flex; align-items: center; gap: 3px; }

/* =====================================================================
   RANK BADGE — a Scout's rank as a glyph in a colour-coded shield. No BSA
   artwork. The glyph is the element's text content: S Scout · T Tenderfoot ·
   2 Second Class · 1 First Class · ★ Star · ♥ Life — Eagle's bird is drawn
   into the shield (white), so .rank-eagle's text content stays empty. Each
   rank has its own hue (the shield fill). Adults never have one. The shield
   is a background SVG so it scales cleanly. Fold onto an avatar with
   .avatar-rank. Shield path (24×24): M4 3h16a1 1 0 0 1 1 1v6.5c0 4.6-3.6
   8.4-9 11.5-5.4-3.1-9-6.9-9-11.5V4a1 1 0 0 1 1-1z
   ===================================================================== */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  padding-bottom: 3px;        /* sit the glyph in the shield's body, off the point */
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  background: center / contain no-repeat;
  /* fallback = the Scout / neutral look (a .rank-* class normally overrides) */
  color: #56524a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 3h16a1 1 0 0 1 1 1v6.5c0 4.6-3.6 8.4-9 11.5-5.4-3.1-9-6.9-9-11.5V4a1 1 0 0 1 1-1z' fill='%23ddd9cf' stroke='%23bdb8aa' stroke-width='1'/%3E%3C/svg%3E");
}
.rank-badge.rank-scout { color: #56524a; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 3h16a1 1 0 0 1 1 1v6.5c0 4.6-3.6 8.4-9 11.5-5.4-3.1-9-6.9-9-11.5V4a1 1 0 0 1 1-1z' fill='%23ddd9cf' stroke='%23bdb8aa' stroke-width='1'/%3E%3C/svg%3E"); }
.rank-badge.rank-tf    { color: #6e5320; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 3h16a1 1 0 0 1 1 1v6.5c0 4.6-3.6 8.4-9 11.5-5.4-3.1-9-6.9-9-11.5V4a1 1 0 0 1 1-1z' fill='%23e6cf9c' stroke='%23cab474' stroke-width='1'/%3E%3C/svg%3E"); }
.rank-badge.rank-2c    { color: #41592f; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 3h16a1 1 0 0 1 1 1v6.5c0 4.6-3.6 8.4-9 11.5-5.4-3.1-9-6.9-9-11.5V4a1 1 0 0 1 1-1z' fill='%23cfdec5' stroke='%23a6bf96' stroke-width='1'/%3E%3C/svg%3E"); }
.rank-badge.rank-1c    { color: #27554f; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 3h16a1 1 0 0 1 1 1v6.5c0 4.6-3.6 8.4-9 11.5-5.4-3.1-9-6.9-9-11.5V4a1 1 0 0 1 1-1z' fill='%23c1dedb' stroke='%2393bfba' stroke-width='1'/%3E%3C/svg%3E"); }
.rank-badge.rank-star  { color: #7a5810; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 3h16a1 1 0 0 1 1 1v6.5c0 4.6-3.6 8.4-9 11.5-5.4-3.1-9-6.9-9-11.5V4a1 1 0 0 1 1-1z' fill='%23f3cf6e' stroke='%23d4ab38' stroke-width='1'/%3E%3C/svg%3E"); }
.rank-badge.rank-life  { color: #8a2c2c; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 3h16a1 1 0 0 1 1 1v6.5c0 4.6-3.6 8.4-9 11.5-5.4-3.1-9-6.9-9-11.5V4a1 1 0 0 1 1-1z' fill='%23edc6c6' stroke='%23d49a9a' stroke-width='1'/%3E%3C/svg%3E"); }
.rank-badge.rank-eagle { color: #fff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 3h16a1 1 0 0 1 1 1v6.5c0 4.6-3.6 8.4-9 11.5-5.4-3.1-9-6.9-9-11.5V4a1 1 0 0 1 1-1z' fill='%2339568c' stroke='%232a4470' stroke-width='1'/%3E%3Cpath d='M12 6.6c-.8 0-1.45.6-1.45 1.35 0 .28.09.53.25.74-1.85-1.25-4.15-1.6-6.3-1 1.65.73 2.75 1.4 3.5 2.55-1.3-.28-2.65-.17-3.8.48 1.75.12 3.05.65 4.2 1.75h7.3c1.15-1.1 2.45-1.63 4.2-1.75-1.15-.65-2.5-.76-3.8-.48.75-1.15 1.85-1.82 3.5-2.55-2.15-.6-4.45-.25-6.3 1 .16-.21.25-.46.25-.74 0-.75-.65-1.35-1.45-1.35z' fill='%23fff'/%3E%3Cpath d='M11.15 5.75c0-.47.38-.85.85-.85s.85.38.85.85l-.38 1.05h-.94z' fill='%23fff'/%3E%3C/svg%3E"); }
/* ★ and ♥ glyphs are a hair smaller than the letters so they don't crowd the shield */
.rank-badge.rank-star, .rank-badge.rank-life { font-size: 9.5px; }
.rank-badge-sm { width: 18px; height: 18px; padding-bottom: 2px; font-size: 8.5px; }
.rank-badge-sm.rank-star, .rank-badge-sm.rank-life { font-size: 8px; }
.rank-badge-lg { width: 32px; height: 32px; padding-bottom: 4px; font-size: 15px; }
.rank-badge-lg.rank-star, .rank-badge-lg.rank-life { font-size: 13.5px; }
.rank-badge-xl { width: 44px; height: 44px; padding-bottom: 6px; font-size: 21px; }  /* the rank picker */
.rank-badge-xl.rank-star, .rank-badge-xl.rank-life { font-size: 19px; }
.avatar-rank { position: relative; overflow: visible; }
.avatar-rank .rank-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 16px;
  height: 16px;
  padding-bottom: 2px;
  font-size: 7.5px;
  filter: drop-shadow(0 0 1.5px var(--paper)) drop-shadow(0 0 1px var(--paper));
}
.avatar-rank .rank-badge.rank-star, .avatar-rank .rank-badge.rank-life { font-size: 7px; }

/* =====================================================================
   CHANNEL CHIP — the visual stand-in for a communication channel (all /
   parents / scouts / leaders / asms / patrol:X). Icon + hue + soft bg.
   Never a text label. Optional: a card "posted on" a channel can carry the
   hue as an inset left bar (.card.on-channel).
   ===================================================================== */
.channel-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--ch-all-s);
  color: var(--ch-all);
  white-space: nowrap;
}
.channel-chip svg { width: 15px; height: 15px; flex: 0 0 auto; stroke-width: 2.25; }
/* Icon-only — on cards / list rows where the channel name isn't spelled out:
   a slightly bigger glyph in a snug round dot of the channel hue. */
.channel-chip.ico-only { padding: 4px; gap: 0; }
.channel-chip.ico-only svg { width: 16px; height: 16px; }
.channel-chip.ch-parents { background: var(--ch-parents-s); color: var(--ch-parents); }
.channel-chip.ch-scouts  { background: var(--ch-scouts-s);  color: var(--ch-scouts); }
.channel-chip.ch-leaders { background: var(--ch-leaders-s); color: var(--ch-leaders); }
.channel-chip.ch-asms    { background: var(--ch-asms-s);    color: var(--ch-asms); }
.channel-chip.ch-patrol  { background: var(--ch-patrol-s);  color: var(--ch-patrol); }
/* the "this one's picked" state in a channel picker (compose) */
.channel-chip.is-selected { box-shadow: 0 0 0 2px currentColor; }

.card.on-channel { box-shadow: inset 3px 0 0 var(--ch-all); }
.card.on-channel.ch-parents { box-shadow: inset 3px 0 0 var(--ch-parents); }
.card.on-channel.ch-scouts  { box-shadow: inset 3px 0 0 var(--ch-scouts); }
.card.on-channel.ch-leaders { box-shadow: inset 3px 0 0 var(--ch-leaders); }
.card.on-channel.ch-asms    { box-shadow: inset 3px 0 0 var(--ch-asms); }
.card.on-channel.ch-patrol  { box-shadow: inset 3px 0 0 var(--ch-patrol); }

/* =====================================================================
   CE-PILL — channel-and-entity stacked pill (§03d, Approach A).
   - One tinted pill carrying TWO icons: the entity icon (event-type:
     tent/bus/presentation/…  or poll-glyph: megaphone) + the channel
     icon (flag/users/shield/…). Background hue is the channel color.
   - This replaces the older "separate .event-type + .channel-chip"
     arrangement. Color is the fast-scan cue; the channel icon SHAPE is
     the WCAG 1.4.1 non-color cue. Both signals are always present.
   - When a card sits on a channel, also drop the .on-channel band — the
     pill carries the color now. Patrol NAME stays in the meta line.
   ===================================================================== */
.ce-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--ink-2);
  white-space: nowrap;
  flex: 0 0 auto;
}
.ce-pill svg,
.ce-pill i { width: 14px; height: 14px; flex: 0 0 auto; }
.ce-pill .sep {
  width: 1px;
  height: 12px;
  background: currentColor;
  opacity: 0.25;
  margin: 0 1px;
}
.ce-pill.ch-all     { background: var(--ch-all-s);     color: var(--ch-all); }
.ce-pill.ch-parents { background: var(--ch-parents-s); color: var(--ch-parents); }
.ce-pill.ch-scouts  { background: var(--ch-scouts-s);  color: var(--ch-scouts); }
.ce-pill.ch-leaders { background: var(--ch-leaders-s); color: var(--ch-leaders); }
.ce-pill.ch-asms    { background: var(--ch-asms-s);    color: var(--ch-asms); }
.ce-pill.ch-patrol  { background: var(--ch-patrol-s);  color: var(--ch-patrol); }

/* =====================================================================
   EVENT TYPE — every event has one; a small icon leads the card title so the
   agenda reads at a glance. ~7 types, each also adapting the compose form:
     meeting       presentation   start time only (minimal)
     outing        bus            single day · drop-off + pickup + headcount
     campout       tent           multi-day range · packing list · drop-off/pickup
     service       heart-handshake project details · sign-up slots
     ceremony      award          Court of Honor / Blue & Gold · program order
     social        party-popper   potluck / social · who-brings-what (help-out)
     fundraiser    hand-coins     goal · shifts/slots
   (Distinct from the *channel* — who it's posted to — and the *state* chip.)
   ===================================================================== */
.event-type {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--paper-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.event-type svg { width: 15px; height: 15px; color: var(--ink-2); }
.event-type-sm { width: 20px; height: 20px; border-radius: 6px; }
.event-type-sm svg { width: 13px; height: 13px; }

/* =====================================================================
   AVATAR
   ===================================================================== */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--accent-s);
  color: var(--accent-d);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex: 0 0 auto;
  letter-spacing: -0.01em;
}
.avatar-trail { background: var(--trail-s); color: var(--trail); }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }

/* =====================================================================
   FORM
   ===================================================================== */
.field { display: flex; flex-direction: column; }
.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
}
.field-input,
.field-textarea {
  font-family: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  transition: border-color var(--t-fast) var(--ease-soft),
              box-shadow var(--t-fast) var(--ease-soft);
}
.field-input:focus,
.field-textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44, 82, 52, 0.12);
}

/* =====================================================================
   SEG — segmented control (responsive: wraps when out of room)
   ===================================================================== */
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--paper-2, #ecebe7);
  border-radius: 12px;
}
.seg button {
  /* Size to content so wrap kicks in cleanly when container is full,
     instead of squishing each button below its text width. */
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--ink-2, #444);
  font-size: 13px;
  font-weight: 500;
  border-radius: 9px;
  white-space: nowrap;
  transition: background var(--t-fast, 120ms) var(--ease-soft, ease), color var(--t-fast, 120ms) var(--ease-soft, ease);
}
.seg button:hover { background: rgba(0, 0, 0, 0.04); }
.seg button.is-active {
  background: var(--paper, #fff);
  color: var(--ink, #111);
  box-shadow: 0 1px 2px rgba(17, 23, 20, 0.08);
}

/* =====================================================================
   SEG-RANK — the rank picker: a 4+3 grid of small cards, one per rank
   (Scout → Eagle), each a ~24px rank badge + a short label. Used wherever a
   parent sets/changes a Scout's rank — onboard-add-scout, the Edit-Scout
   dialog, scout-detail's "Change rank" sheet, rank-home's "Change rank".
   7 items in a 4-col grid → 4 on the first row, 3 on the second (left-aligned).
   ===================================================================== */
.seg-rank {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.seg-rank button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--t-fast) var(--ease-soft),
              background var(--t-fast) var(--ease-soft);
}
.seg-rank button:hover { border-color: #c8c4ba; background: var(--paper-2); }
.seg-rank button.is-active,
.seg-rank button.is-selected { border-color: var(--accent); background: var(--accent-s); }
.seg-rank button .rank-badge { width: 24px; height: 24px; padding-bottom: 3px; font-size: 11px; }
.seg-rank button .rank-badge.rank-star,
.seg-rank button .rank-badge.rank-life { font-size: 10px; }
.seg-rank button .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: center;
  line-height: 1.2;
}

/* =====================================================================
   BANNER
   ===================================================================== */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  background: var(--accent-s);
  color: var(--accent-d);
  border-left: 3px solid var(--accent);
}
.banner.warn { background: var(--warn-s); color: var(--warn); border-left-color: var(--warn); }
.banner svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

/* Honor the HTML [hidden] attribute even on components that set display:
   above (e.g. .banner is display:flex, which silently clobbers [hidden]'s
   built-in display:none). Page-level toggles use `el.hidden = true/false`
   and expect this to win. */
[hidden] { display: none !important; }

/* =====================================================================
   EYEBROW / SECTION HEADER
   ===================================================================== */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}
.eyebrow .meta {
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  float: right;
}

/* =====================================================================
   LIST
   ===================================================================== */
.list { display: flex; flex-direction: column; }
.list .item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.list .item:first-child { padding-top: 0; }
.list .item:last-child  { padding-bottom: 0; border-bottom: 0; }
.list .item .body { flex: 1 1 auto; min-width: 0; }
.list .item .body .name { font-weight: 500; font-size: 14px; color: var(--ink); }
.list .item .body .sub  { font-size: 12px; color: var(--muted); }
.list .item .right { color: var(--muted); font-size: 12px; }

/* §07g Activity-row unread cue. The .ce-pill carries the channel color
   already; we can't tint a single corner of the pill to mean "unread"
   without breaking the channel signal. So we mark unread on the name —
   bold weight is the same pattern bell-feed lists use everywhere else,
   and a colorblind viewer still reads "unread" via the weight contrast. */
.list .item.is-unread .body .name { font-weight: 700; }

/* =====================================================================
   SCOUT SUMMARY CARD (§07h) — compact card per Scout, laid out in an
   auto-fit grid. Used on shell-home Rank Up + rank.html multi-Scout
   picker. Each card surfaces rank + what they're working on + last
   completed. Click → /rank.html?scout_id=… (Scout's full requirements
   view). Replaces the one-line nav rows that wasted horizontal space.
   ===================================================================== */
.scout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-2);
}
.scout-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  transition: border-color var(--t-fast) var(--ease-soft),
              background var(--t-fast) var(--ease-soft),
              transform 80ms ease;
}
.scout-card:hover { border-color: var(--accent-s); background: var(--paper-2); }
.scout-card:active { transform: scale(0.99); }
.scout-card .sc-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.scout-card .sc-head .rank-badge { flex: 0 0 auto; }
.scout-card .sc-identity { min-width: 0; flex: 1; }
.scout-card .sc-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scout-card .sc-rank {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}
.scout-card .sc-working {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: var(--space-1);
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.scout-card .sc-working.is-quiet {
  color: var(--muted);
  font-style: italic;
}
.scout-card .sc-working.is-signoff {
  color: var(--accent);
  font-weight: 600;
}
.scout-card .sc-last {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}
/* Sign-off ready accent — left-edge stripe when a Scout has done_self
   marks awaiting parent Scoutbook attestation. */
.scout-card.is-signoff {
  border-left: 3px solid var(--accent);
  padding-left: calc(var(--space-3) - 2px);
}

/* =====================================================================
   TRAIL ILLUSTRATION (empty states)
   ===================================================================== */
.trail-illust {
  display: block;
  margin: 0 auto;
}

/* =====================================================================
   WEEK STRIP (Rank Up)
   ===================================================================== */
.week-strip {
  display: flex;
  gap: 6px;
  padding: 8px;
  background: var(--paper-2);
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.week-strip::-webkit-scrollbar { display: none; }
.week-strip .day {
  flex: 0 0 auto;
  min-width: 42px;
  padding: 6px 8px;
  text-align: center;
  border-radius: 8px;
  background: var(--paper);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line-2);
  font-weight: 500;
}
.week-strip .day .num {
  font-size: 16px;
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: block;
  line-height: 1.1;
}
.week-strip .day.today {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.week-strip .day.today .num { color: #fff; }
.week-strip .day.marked {
  background: var(--accent-s);
  border-color: var(--accent);
  color: var(--accent-d);
}
.week-strip .day.marked .num { color: var(--accent-d); }

/* =====================================================================
   REQ CHIP (Rank Up requirement state)
   ===================================================================== */
.req-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  background: var(--paper-3);
  color: var(--ink-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.req-chip.working  { background: var(--trail-s);  color: var(--trail); }
.req-chip.complete { background: var(--accent-s); color: var(--accent-d); }
.req-chip.signed   { background: var(--accent);   color: #fff; }

/* =====================================================================
   TALLY BAR / TALLY ROW — poll results. Leader-only on the open-poll list +
   detail; revealed to everyone on close (M10 — the lock morphs to this bar,
   segments grow from 0). Up to 4 option colors + a "silent / not yet voted"
   neutral segment.
   ===================================================================== */
.tally-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line-2);
}
.tally-bar > span { display: block; height: 100%; transition: width var(--t-slow) var(--ease-soft); }
.tally-bar .seg-yes, .tally-bar .seg-1 { background: var(--sig-yes); }
.tally-bar .seg-int, .tally-bar .seg-2 { background: var(--sig-int); }
.tally-bar .seg-no,  .tally-bar .seg-3 { background: var(--sig-no); }
.tally-bar .seg-go,  .tally-bar .seg-4 { background: #6e7470; }
.tally-bar .seg-silent { background: var(--line); }

.tally-rows { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.tally-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.tally-row .dot { width: 8px; height: 8px; border-radius: 999px; flex: 0 0 auto; }
.tally-row .dot.seg-yes, .tally-row .dot.seg-1 { background: var(--sig-yes); }
.tally-row .dot.seg-int, .tally-row .dot.seg-2 { background: var(--sig-int); }
.tally-row .dot.seg-no,  .tally-row .dot.seg-3 { background: var(--sig-no); }
.tally-row .dot.seg-go,  .tally-row .dot.seg-4 { background: #6e7470; }
.tally-row .dot.seg-silent { background: var(--line); }
.tally-row .lbl { flex: 1 1 auto; min-width: 0; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tally-row .pct { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.tally-row .cnt { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.tally-row.silent .lbl, .tally-row.silent .cnt { color: var(--muted); font-style: italic; }

/* Compact inline form — "● 7 camporee · ● 4 cohasset · ● 1 either" */
.tally-stats { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.tally-stats .tally-stat { display: inline-flex; align-items: center; gap: 5px; }
.tally-stats .tally-stat .dot { width: 7px; height: 7px; border-radius: 999px; flex: 0 0 auto; }
.tally-stats .tally-stat .dot.seg-yes, .tally-stats .tally-stat .dot.seg-1 { background: var(--sig-yes); }
.tally-stats .tally-stat .dot.seg-int, .tally-stats .tally-stat .dot.seg-2 { background: var(--sig-int); }
.tally-stats .tally-stat .dot.seg-no,  .tally-stats .tally-stat .dot.seg-3 { background: var(--sig-no); }
.tally-stats .tally-stat .dot.seg-go,  .tally-stats .tally-stat .dot.seg-4 { background: #6e7470; }

/* =====================================================================
   UTILITY classes
   ===================================================================== */
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stack-2 { display: flex; flex-direction: column; gap: 8px; }
.stack-3 { display: flex; flex-direction: column; gap: 12px; }
.stack-4 { display: flex; flex-direction: column; gap: 16px; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.fwm { font-weight: 500; }
.fwsb { font-weight: 600; }
.flex-1 { flex: 1 1 auto; min-width: 0; }

/* Truncate-with-ellipsis — the long-content rule. Card titles, list-item
   names, metas → .truncate (1 line + ellipsis). The card / row that wraps
   the text is the tap target; users learn ellipsis = "tap for more." No
   1-row vs 2-row markup branches. .truncate-2 is the 2-line clamp variant
   for descriptions where 1 line is too thin.
   `min-width: 0` lets the element actually shrink inside a flex parent. */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
          line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 0;
}

/* =====================================================================
   SHARE-LINK MINI-APP LAYOUT (responsive — phone or desktop)
   For events.trailhead.app, polls.trailhead.app, rankup.trailhead.app.
   No fixed nav. Centered content, max ~720px on desktop.
   ===================================================================== */

/* Page shell — applied to <body> on share-link pages.
   Independent of `body.screen` (which is mobile-iframe-locked); this body
   scrolls naturally and carries the typography defaults itself. */
.share-shell {
  background: var(--paper-2);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  font-feature-settings: "ss01" 1, "cv11" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Top header — slim brand bar, sticky */
.share-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.share-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
}
.share-brand .mark {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.share-signin {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

/* Main content area — centered, max 720px on desktop */
.share-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}
@media (min-width: 720px) {
  .share-main { padding: 48px 24px 96px; }
}

/* Hero block — title + meta + description */
.share-hero { margin-bottom: 24px; }
.share-hero .eyebrow { margin-bottom: 8px; }
.share-hero h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 12px;
  text-wrap: balance;
}
@media (min-width: 720px) {
  .share-hero h1 { font-size: 36px; }
}
.share-hero .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.share-hero .desc {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
}

/* Content card — same family as .card, larger desktop padding */
.share-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}
@media (min-width: 720px) {
  .share-card { padding: 24px; }
}
.share-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.share-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}
.share-card-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* Table → cards (responsive) */
.share-table {
  width: 100%;
  border-collapse: collapse;
}
.share-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.share-table tbody td {
  padding: 12px;
  font-size: 14px;
  color: var(--ink);
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.share-table tbody tr:last-child td { border-bottom: none; }
.share-table .col-action {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}

/* Phone collapse — at <720px, render the table as stacked cards */
@media (max-width: 719px) {
  .share-table thead { display: none; }
  .share-table,
  .share-table tbody,
  .share-table tr,
  .share-table td {
    display: block;
    width: 100%;
  }
  .share-table tbody tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 8px;
    padding: 12px;
  }
  .share-table tbody td {
    border: none;
    padding: 4px 0;
  }
  .share-table td.col-action {
    text-align: left;
    margin-top: 8px;
  }
  .share-table td[data-label]:before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 2px;
  }
}

/* Submit row — inline at form-end on desktop, full-width on phone */
.share-submit {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
@media (max-width: 719px) {
  .share-submit { justify-content: stretch; }
  .share-submit .btn { flex: 1; }
}

/* Footer — quiet credit */
.share-footer {
  border-top: 1px solid var(--line);
  padding: 24px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.share-footer a { color: var(--muted); text-decoration: underline; }

/* =====================================================================
   HOLD-TO-CONFIRM GESTURE (slice 5.3)
   - Press-and-hold a button for --hold-duration to fire a destructive /
     irreversible action (e.g. set Scout rank). Releasing early cancels.
   - The radial conic-gradient fills the button border-area while the
     pointer is held; once full, the JS handler runs.
   - Reduced-motion path bypasses the fill and uses a tap → modal flow
     instead — see .hold-confirm-overlay below.
   ===================================================================== */
.hold-progress {
  position: relative;
  isolation: isolate;
}
.hold-progress::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  pointer-events: none;
  background: conic-gradient(var(--accent) var(--hold-fill, 0%), transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 64%, #000 66%);
          mask: radial-gradient(circle, transparent 64%, #000 66%);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-soft);
  z-index: -1;
}
.hold-progress.is-holding::before {
  opacity: 1;
  animation: hold-fill var(--hold-duration) linear forwards;
}
.hold-progress.is-confirmed::before {
  opacity: 1;
  --hold-fill: 100%;
  background: conic-gradient(var(--accent) 100%, transparent 0);
}
@keyframes hold-fill {
  from { --hold-fill: 0%; }
  to   { --hold-fill: 100%; }
}
/* The custom property animation needs registration for older engines; the
   keyframe falls back to a width-based pseudo on those. */
@property --hold-fill {
  syntax: '<percentage>';
  initial-value: 0%;
  inherits: false;
}

@media (prefers-reduced-motion: reduce) {
  .hold-progress::before { display: none; }
  .hold-progress.is-holding::before { animation: none; }
}

/* Reduced-motion confirm modal injected by hold-confirm.js */
.hold-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 23, 20, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.hold-confirm-card {
  background: var(--paper);
  border-radius: 14px;
  padding: 20px;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 24px 48px -16px rgba(17, 23, 20, 0.35);
}
.hold-confirm-msg {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.45;
}
.hold-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Visually-hidden utility — content reachable to assistive tech but not
   painted. Used for per-page <h1> on surfaces whose visible heading is
   styled as <h2> or whose primary identity is the brand chrome (logo).
   Pattern lifted from WebAIM. */
.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;
}

/* C6 umbrella bottom nav lives in `.nav-bar` / `.nav-tab` / `.nav-ico-wrap`
   above (mockup-aligned). bottom-nav.js injects that markup; pages don't
   need a `.has-bottom-nav` body class — the nav participates in the
   frame's flex layout. */

/* =====================================================================
   META-ACTION — §09 Kind A "act on everything" affordance
   - Quiet inline button at the top of an affected list (Mark all read,
     Approve all proposals). NOT multi-select (that's §09 Kind B).
   - The verb states the count: "Mark 4 unread as read".
   ===================================================================== */
.meta-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin: 0 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-s);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-soft),
              border-color var(--t-fast) var(--ease-soft);
}
.meta-action:hover {
  background: var(--paper);
  border-color: var(--accent);
}
.meta-action svg,
.meta-action i { width: 14px; height: 14px; }

/* =====================================================================
   SECTION-INTRO — small explanatory line below a section eyebrow
   ===================================================================== */
.section-intro {
  font-size: 12px;
  color: var(--muted);
  margin: -2px 0 8px;
  line-height: 1.5;
}

/* =====================================================================
   NAV-CARD — compact list rows for the management nav (me.html)
   - Smaller than .card .item; built for "many small targets, lots of
     stacking" (Leadership / Administration / Patrol-leadership sections).
   - Variants tint the ico bg: is-admin (amber), is-troop (violet),
     is-patrol (green).
   ===================================================================== */
.nav-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.nav-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
}
.nav-row:last-child { border-bottom: 0; }
.nav-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-s);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.nav-ico i,
.nav-ico svg { width: 16px; height: 16px; }
.nav-body { flex: 1; min-width: 0; }
.nav-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.nav-sub  { font-size: 12px; color: var(--muted); margin-top: 1px; }
.nav-chev { color: var(--muted); font-size: 18px; }

.nav-card.is-admin             { background: var(--paper-2); border-color: var(--line); }
.nav-card.is-admin .nav-ico    { background: #fef3c7; color: #92400e; }
.nav-card.is-troop  .nav-ico   { background: #ede9fe; color: #5b21b6; }
.nav-card.is-patrol .nav-ico   { background: #dcfce7; color: #15803d; }

/* =====================================================================
   BADGE-FUTURE — "this section isn't built yet" inline marker
   ===================================================================== */
.badge-future {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: #fef3c7;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
  margin-left: 4px;
}

/* =====================================================================
   STAT-STRIP — at-a-glance count row at the top of a section
   - Default 4 cells (me-admin section); use --stat-cols to override
     (me-pl uses 3 cells; an SPL hub might use 5).
   - Cell shows num over uppercase label; is-flag tints amber when the
     value needs attention (e.g. "3 pending invites").
   ===================================================================== */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(var(--stat-cols, 4), 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.stat-cell {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
}
.stat-cell .stat-num {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
}
.stat-cell .stat-lbl {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 3px;
}
.stat-cell.is-flag             { background: #fef3c7; border-color: #fde68a; }
.stat-cell.is-flag .stat-num   { color: #92400e; }
.stat-cell.is-flag .stat-lbl   { color: #92400e; }

/* =====================================================================
   ATTN-CARD — "Needs attention" nudges (the tiny-hands list)
   - Amber border; rows are tappable links to whatever needs doing.
   ===================================================================== */
.attn-card {
  background: var(--paper);
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.attn-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.attn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line-2);
  text-decoration: none;
  color: inherit;
}
.attn-row:first-of-type { border-top: 0; }
.attn-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.attn-body strong { font-size: 13px; font-weight: 600; color: var(--ink); }
.attn-sub { font-size: 11px; color: var(--muted); line-height: 1.35; }
.attn-act {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 8px;
  flex: 0 0 auto;
}
.attn-row:hover .attn-act { background: var(--accent-s); }

/* =====================================================================
   ALL-CAUGHT-UP — §09d compressed-celebrate empty-state pill
   - Same spatial slot as an .attn-card (or a workflow card); shrinks
     to a single affirmative line when there's nothing to do.
   - Rule: --ok accent (not --accent), affirmative copy ("All Scouts
     accounted for", not "No unassigned Scouts"), checkmark icon.
   ===================================================================== */
.all-caught-up {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: var(--ok-s);
  border: 1px solid var(--ok);
  border-left: 3px solid var(--ok);
  border-radius: 10px;
  font-size: 13px;
  color: var(--ok);
  font-weight: 600;
}
.all-caught-up i,
.all-caught-up svg { width: 14px; height: 14px; flex: 0 0 auto; }

/* =====================================================================
   PATROL-CARD — the admin-patrols / admin-leadership patrol container
   - One --ch-patrol hue covers every patrol regardless of count (§03b
     channel-chip rule: the band marks scope, not identity). Identity
     comes from the patrol name in the head row.
   - is-unassigned amber-tints the card for the "Scouts not yet placed"
     workflow surface; pair with .unassigned-note for the explainer.
   ===================================================================== */
.patrol-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.patrol-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.patrol-flag {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--ch-patrol-s);
  color: var(--ch-patrol);
}
.patrol-flag i,
.patrol-flag svg { width: 18px; height: 18px; }
.patrol-name {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.patrol-count {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.patrol-edit {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 8px;
}
.patrol-edit:hover { background: var(--accent-s); }

.patrol-card.is-unassigned {
  border-left: 3px solid #d97706;
  background: #fffbeb;
}
.patrol-card.is-unassigned .patrol-count {
  color: #92400e;
  font-weight: 600;
}

/* The unassigned explainer that sits inside an is-unassigned patrol-card. */
.unassigned-note {
  font-size: 12px;
  color: #92400e;
  line-height: 1.45;
  margin: 0 0 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
}

/* =====================================================================
   BADGE-CLIP wrapper utility (§07c)
   - Absolute-positioned badges/affordances on top of an element that
     itself has overflow:hidden (typically .truncate / .truncate-2) get
     clipped. Wrap the truncating element in .badge-clip; the wrapper
     is the positioning context and lets badges escape; the inner
     element keeps its truncate behavior.
   ===================================================================== */
.badge-clip {
  position: relative;
  overflow: visible;
  min-width: 0;
  flex: 1;
}
