/* ==========================================================================
   components.css — H&CK component canon
   --------------------------------------------------------------------------
   The shared UI vocabulary used across index / admin / trainer.
   Load order: tokens.css -> base.css -> components.css
   Everything here reads from the design tokens — no raw hex values.
   ========================================================================== */

/* ==========================================================================
   App shell: shared header + footer
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--green);
  color: #fff;
}

.app-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

/* Wordmark: the real H&CK arched lockup + a section sub-label.
   The logo already reads "HEROES and COOL KIDS", so the header no longer
   repeats that as text — the name lives in the img's alt for screen readers. */
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
/* The real arched wordmark (assets/hck-logo-white.svg, ~1.8:1). Height-driven
   with width:auto so the lockup never squashes — the old square tile + card
   shadow were right for an app icon, wrong for a wordmark. */
.brand__logo {
  flex: none;
  height: 40px;
  width: auto;
  border-radius: 0;
  box-shadow: none;
}
.brand__sub {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.app-nav {
  margin-left: auto;
  display: flex;
  gap: var(--space-2);
}
.app-nav a {
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.app-nav a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.app-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.app-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-8);
}

.app-footer {
  border-top: 1px solid var(--border);
  margin-top: var(--space-10);
  padding: var(--space-6) var(--space-5);
  color: var(--muted);
  font-size: var(--text-sm);
}
.app-footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--off);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: var(--green);
  color: #fff;
}
.btn--primary:hover { background: var(--green-deep); }

.btn--secondary {
  background: var(--surface);
  color: var(--green);
  border-color: var(--green);
}
.btn--secondary:hover { background: var(--green-light); }

.btn--ghost {
  background: transparent;
  color: var(--text);
}
.btn--ghost:hover { background: var(--off); }

.btn--danger {
  background: var(--danger);
  color: #fff;
}
.btn--danger:hover { background: #97150c; }

.btn--sm { padding: var(--space-2) var(--space-3); font-size: var(--text-xs); }
.btn--lg { padding: var(--space-4) var(--space-6); font-size: var(--text-base); }

/* Text-only button (e.g. "+ Add a review") — unobtrusive, doesn't shout */
.btn--link {
  background: none;
  border: none;
  padding: var(--space-1) 0;
  color: var(--navy);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: underline;
  cursor: pointer;
}
.btn--link:hover { color: #12305e; }

/* ==========================================================================
   Cards / panels
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}
.card--pad-lg { padding: var(--space-5); }

.card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-2);
}
.card__meta { color: var(--muted); font-size: var(--text-sm); }

/* Left accent stripe keyed to a visit color (set --accent inline or via class) */
.card--accent { border-left: 4px solid var(--accent, var(--green)); }

/* ==========================================================================
   Forms
   ========================================================================== */
.field { margin-bottom: var(--space-4); }

.label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--text);
}
.label .req { color: var(--danger); }

.input,
.select,
.textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-3);
  font-size: var(--text-base);
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input::placeholder,
.textarea::placeholder { color: var(--faint); }

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: var(--focus-ring);
}
.textarea { min-height: 96px; resize: vertical; }

.help { margin-top: var(--space-2); font-size: var(--text-xs); color: var(--muted); }
.field--error .input,
.field--error .select,
.field--error .textarea { border-color: var(--danger); }
.field--error .help { color: var(--danger); }

/* ==========================================================================
   Badges / pills
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--off);
  color: var(--text);
  white-space: nowrap;
}
.badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* Visit / program chips — keyed to the brand accents */
.badge--visit1   { background: var(--green-light); color: var(--green); }
.badge--visit2   { background: var(--info-bg);     color: var(--navy); }
.badge--visit3   { background: color-mix(in srgb, var(--purple) 14%, #fff); color: var(--purple); }
.badge--sidekick { background: color-mix(in srgb, var(--lime) 16%, #fff);   color: #3f6100; }
/* Heroes needs its own chip so the two programs are distinguishable at a glance
   in a 47-row list — the green pairs with the Sidekicks lime. */
.badge--heroes   { background: var(--green-light); color: var(--green-deep); }
.badge--both     { background: var(--gold-light);  color: var(--gold-ink); }

/* Status pills */
.badge--pending   { background: var(--warn-bg);    color: var(--amber); }
.badge--confirmed { background: var(--success-bg); color: #166534; }
.badge--cancelled { background: var(--danger-bg);  color: var(--danger); }

/* ==========================================================================
   Notices / inline banners
   ========================================================================== */
.notice {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text);
  background: var(--off);
}
.notice--info    { background: var(--info-bg);    border-color: #c3d4fb; color: #1e3a8a; }
.notice--warn    { background: var(--warn-bg);    border-color: #fcd34d; color: var(--amber); }
.notice--success { background: var(--success-bg); border-color: #86efac; color: #166534; }
.notice--error   { background: var(--danger-bg);  border-color: #fca5a5; color: var(--danger); }

/* Dismissible banner with a close affordance on the right */
.notice--dismissible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.notice__close {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  padding: 0;
}
.notice__close:hover { opacity: 1; }

/* ==========================================================================
   Segmented control (e.g. "single visit" vs "full year")
   ========================================================================== */
.segmented {
  display: inline-flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.segmented .seg {
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.segmented .seg[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.segmented .seg:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Soft panel used to group a sub-section inside a card */
.subpanel {
  background: var(--off);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
}
.subpanel__label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: var(--space-3);
}

/* One schedulable event inside a Visit cycle (Training / Review / School Visit) */
.event-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.event-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: 0;
}
/* Skipped state: hide the fields, reveal the muted "not scheduling" note */
.event-body, .event-skipped-note { transition: none; }
.event--skipped .event-body { display: none; }
.event--skipped .event-skip { display: none; }
.event-skipped-note { display: none; font-size: var(--text-sm); color: var(--muted); }
.event--skipped .event-skipped-note { display: block; }

/* Review flows into the School Visit — group them with no divider between */
.event[data-event="review"] + .event[data-event="visit"] {
  border-top: none;
  padding-top: 0;
  margin-top: var(--space-2);
}
/* Expanded review reads as a nested, optional sub-block of the cycle */
.review-fields {
  background: var(--off);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
}

/* Multiple-school visit rows */
.visit-rows { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-3); }
.visit-row {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
}
.visit-row__remove {
  position: absolute;
  top: var(--space-2); right: var(--space-2);
  background: none; border: none;
  color: var(--faint); font-size: 18px; line-height: 1; cursor: pointer;
}
.visit-row__remove:hover { color: var(--danger); }
.event-label::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--accent, var(--green));
  flex-shrink: 0;
}
.event + .event {
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
  margin-top: var(--space-4);
}
/* Date / Start / End demoted to micro-labels so the event title clearly leads */
.dt-grid .label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}
/* 3-up date / start / end grid */
.dt-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-3);
}
/* Radio option row */
.radio-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  padding: var(--space-2) 0;
  cursor: pointer;
}
.radio-row input { width: 16px; height: 16px; accent-color: var(--green); }

/* Section header bar tinted to a visit color (set --accent) */
.visit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--accent, var(--green));
  color: #fff;
  font-weight: 700;
  font-size: var(--text-sm);
  border-radius: var(--radius) var(--radius) 0 0;
}
.visit-head .target { font-weight: 500; font-size: var(--text-xs); color: rgba(255,255,255,0.82); }

/* ==========================================================================
   Calendar (admin)
   ========================================================================== */
.cal-toolbar {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.cal-nav { display: flex; align-items: center; gap: var(--space-2); }
.cal-range { font-weight: 700; font-size: var(--text-lg); min-width: 180px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: var(--space-3); font-size: var(--text-xs); margin-left: auto; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.cal-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cal-legend i.striped { background: repeating-linear-gradient(45deg,#f0f1f4,#f0f1f4 3px,#e1e4e9 3px,#e1e4e9 6px); }

.cal-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-2); }
.cal-week-label { grid-column: 1 / -1; font-size: var(--text-xs); font-weight: 700; color: var(--faint);
  text-transform: uppercase; letter-spacing: 0.04em; margin-top: var(--space-2); }
.cal-day {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: var(--space-2); min-height: 96px;
}
.cal-day--month { min-height: 76px; }
.cal-day__head { font-size: var(--text-xs); font-weight: 700; color: var(--muted); margin-bottom: var(--space-2); }
.cal-day--empty { background: var(--bg); }

.cal-chip {
  display: block; width: 100%; text-align: left; cursor: pointer;
  font-size: var(--text-xs); line-height: 1.3;
  padding: 5px 7px; border-radius: 5px; margin-bottom: 5px;
  border: 1px solid var(--border); border-left: 3px solid var(--c, var(--faint));
  background: var(--surface); color: var(--text);
}
/* two-line "sorted by time" chip */
.cal-chip__head { display: block; font-weight: 700; }
.cal-chip__time { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-chip__type { color: var(--muted); font-weight: 600; }
.cal-chip__warn { color: var(--amber); }
.cal-chip__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px;
  margin-top: 3px; font-weight: 600;
}
.cal-chip__tr { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.cal-chip__tr--none { color: var(--amber); }
.cal-tr-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.cal-tr-dot--none { background: var(--amber); }
.cal-chip__mark { font-weight: 700; }
.cal-chip__mark.is-ok { color: var(--green); }
.cal-chip__mark.is-wait { color: var(--amber); }
.cal-chip__loc { margin-left: auto; color: var(--faint); font-weight: 600; padding-left: 6px; }
.cal-chip--needs { border-left-color: var(--amber); background: color-mix(in srgb, var(--amber) 6%, #fff); }
.cal-chip--selected { box-shadow: var(--focus-ring); border-color: var(--green); }
.tr-swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; vertical-align: -1px; margin-right: 5px; }

/* ==========================================================================
   Stat cards (admin triage)
   ========================================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
}
.stat__num { font-size: var(--text-2xl); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.stat__label { font-size: var(--text-sm); color: var(--muted); margin-top: 2px; }
.stat--alert .stat__num { color: var(--amber); }
.stat--ok .stat__num { color: var(--faint); }
/* Selectable filter cards (triage) */
button.stat { cursor: pointer; text-align: left; font-family: inherit; transition: border-color 120ms ease, box-shadow 120ms ease; }
button.stat:hover { border-color: var(--green); }
.stat--selected { border-color: var(--green); box-shadow: var(--focus-ring); }

/* Admin list item (a request / event needing action) */
.item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}
.item__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.item__school { font-weight: 700; }
.item__meta { font-size: var(--text-sm); color: var(--muted); margin-top: 2px; }
.item__actions { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; margin-top: var(--space-3); }
.item__actions .select { width: auto; min-width: 150px; }
.section-empty { color: var(--muted); font-size: var(--text-sm); font-style: italic; padding: var(--space-3) 0; }
/* Triage accordion — each category folds; count lives on the header */
.acc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: var(--space-3);
  overflow: hidden;
}
.acc__head {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; padding: var(--space-4);
  background: none; border: none; cursor: pointer; text-align: left;
  font-family: inherit;
}
.acc__head:hover { background: var(--bg); }
.acc__count { font-size: var(--text-xl); font-weight: 800; letter-spacing: -0.02em; min-width: 1.4ch; text-align: center; }
.acc--alert .acc__count { color: var(--amber); }
.acc--ok .acc__count { color: var(--faint); }
.acc__label { flex: 1; font-weight: 700; font-size: var(--text-base); }
.acc--ok .acc__label { color: var(--muted); font-weight: 600; }
.acc__chev { color: var(--muted); transition: transform 120ms ease; }
.acc--open .acc__chev { transform: rotate(90deg); }
.acc__body { display: none; padding: 0 var(--space-4) var(--space-4); }
.acc--open .acc__body { display: block; }

/* Events stacked inside one school's triage card */
.tri-event + .tri-event { border-top: 1px solid var(--border); padding-top: var(--space-4); margin-top: var(--space-4); }
.section-head { display: flex; align-items: baseline; gap: var(--space-2); margin: var(--space-6) 0 var(--space-3); }
.section-head .count { font-size: var(--text-sm); color: var(--muted); }

/* School chart — wide master grid (mirror of Susan's spreadsheet) */
.chart-table { font-size: var(--text-xs); min-width: 640px; }
.chart-table th, .chart-table td { padding: var(--space-2) var(--space-3); white-space: nowrap; text-align: center; }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
.chart-table thead th { position: static; } /* group-header row stays put */
.chart-table .cell-set { background: var(--success-bg); color: #166534; font-weight: 600; }
.chart-table .cell-empty { color: var(--faint); }

/* Compact filter chips (schools pipeline filter) */
.filter-chip {
  font-size: var(--text-sm); font-weight: 600;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--surface); color: var(--muted); cursor: pointer;
  font-family: inherit;
}
.filter-chip:hover { border-color: var(--green); }
.filter-chip.is-on { background: var(--green); border-color: var(--green); color: #fff; }

/* ==========================================================================
   Pipeline step dots (admin)
   ========================================================================== */
.pl-steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-2); }
.pl-dot {
  width: 26px; height: 26px; border-radius: 50%; margin: 0 auto 3px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  background: var(--off); color: var(--faint); border: 1px solid var(--border);
}
.pl-dot--done { background: var(--success-bg); color: #166534; border-color: #86efac; }
.pl-dot-label { font-size: 10px; color: var(--muted); font-weight: 600; text-align: center; }

/* ==========================================================================
   Toggle switch (trainer availability)
   ========================================================================== */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider { position: absolute; inset: 0; background: var(--border); border-radius: var(--radius-full); cursor: pointer; transition: background 140ms ease; }
.switch__slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm); transition: transform 140ms ease; }
.switch input:checked + .switch__slider { background: var(--green); }
.switch input:checked + .switch__slider::before { transform: translateX(20px); }

.day-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.day-row:last-of-type { border-bottom: none; }
.day-row__name { flex: 1; font-weight: 600; }
.day-row--off .day-row__name { color: var(--faint); }
.day-row .select { width: auto; min-width: 150px; }

/* ==========================================================================
   Modal (e.g. the email composer)
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(17, 17, 17, 0.5);
  z-index: 100;
  padding: var(--space-6) var(--space-4);
  overflow: auto;
}
.modal--open { display: flex; align-items: flex-start; justify-content: center; }
/* Sign-in gate: a clean frosted screen so stale/old-build content never shows
   through behind the login card. */
.modal.gate--auth {
  background: rgba(250, 250, 247, 0.72);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  align-items: center;
}
.modal__card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5);
  width: 100%;
  max-width: 560px;
}

/* ==========================================================================
   Progress bars + event rows (return view)
   ========================================================================== */
.progress {
  display: flex;
  height: 10px;
  background: var(--off);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress__seg { height: 100%; }
.progress__seg--done    { background: var(--green); }
.progress__seg--pending { background: color-mix(in srgb, var(--green) 32%, #fff); }

.progress-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.progress-label .pct { font-size: var(--text-2xl); font-weight: 800; letter-spacing: -0.02em; }
.progress-label .count { font-size: var(--text-sm); color: var(--muted); }

/* One event line in a return-view cycle card */
.evrow {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.evrow:last-child { border-bottom: none; }
.evrow__mark {
  width: 20px; height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  margin-top: 1px;
}
.evrow__mark--done    { background: var(--success-bg); color: #166534; }
.evrow__mark--pending { background: var(--warn-bg);    color: var(--amber); }
.evrow__mark--todo    { background: var(--off); color: var(--faint); border: 1px solid var(--border); }
.evrow__main { flex: 1; min-width: 0; }
.evrow__name { font-weight: 600; font-size: var(--text-sm); }
.evrow__detail { font-size: var(--text-sm); color: var(--muted); margin-top: 2px; }
.evrow__gap { color: var(--faint); font-style: italic; }
.evrow__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }

/* FAQ accordion */
.faq details {
  background: var(--off);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
}
.faq summary { font-weight: 600; font-size: var(--text-sm); cursor: pointer; }
.faq .faq-body { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--muted); line-height: 1.55; }

/* ==========================================================================
   Tables (admin schedule, trainer assignments)
   ========================================================================== */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;            /* wide tables (the chart) swipe sideways… */
  overflow-y: hidden;          /* …instead of bleeding off-screen */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain; /* swiping the table won't trigger page back-nav */
  background: var(--surface);
}
/* Mobile-only hint so the wide chart reads as swipeable (not pinch-to-zoom). */
.scroll-hint { display: none; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table thead th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--off);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}
.table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg); }

/* ==========================================================================
   Small utilities
   ========================================================================== */
.stack > * + * { margin-top: var(--space-4); }   /* vertical rhythm          */
.row { display: flex; gap: var(--space-3); align-items: center; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.text-sm { font-size: var(--text-sm); }

/* ==========================================================================
   Google Places autocomplete dropdown — match the app, hide Google's broken
   icon sprites, keep it above everything.
   ========================================================================== */
.pac-container {
  z-index: 10000;
  font-family: var(--font-sans);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  margin-top: 4px;
  background: #fff;
}
.pac-item {
  padding: 8px 12px;
  font-size: var(--text-sm);
  cursor: pointer;
  border-top: 1px solid var(--border);
  color: var(--ink);
}
.pac-item:first-child { border-top: 0; }
.pac-item:hover,
.pac-item-selected { background: var(--off); }
.pac-icon { display: none; }              /* hide Google's broken icon sprite */
.pac-item-query { font-size: var(--text-sm); color: var(--ink); }
.hdpi.pac-logo::after { margin: 4px 8px; }

/* Aggressively hide Google's broken icon images in the autocomplete widget */
.pac-container img,
.pac-icon,
.pac-item > img { display: none !important; }
.pac-item { display: block !important; }
.gm-err-autocomplete { background-image: none !important; }

/* ==========================================================================
   Mobile / responsive (≤640px). The app was desktop-first; these make it
   usable on a phone — Susan's primary device via the homescreen PWA.
   ========================================================================== */
@media (max-width: 640px) {
  /* header: brand on row 1, nav wraps to its own full-width row below —
     stops Admin/Trainer from spilling off the right edge on narrow phones */
  .app-header__inner { padding: var(--space-3); gap: var(--space-2); flex-wrap: wrap; }
  .brand { font-size: var(--text-base); gap: var(--space-2); }
  .brand__logo { height: 32px; width: auto; }
  .brand__sub { display: none; }
  .app-nav {
    margin-left: 0;
    width: 100%;
    gap: var(--space-2);
    justify-content: flex-start;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    padding-top: var(--space-2);
  }
  .app-nav a { padding: var(--space-2) var(--space-3); font-size: var(--text-sm); }

  .app-main { padding: var(--space-4) var(--space-3) var(--space-6); }
  h1 { font-size: var(--text-2xl); }

  /* admin sub-nav (6 tabs): tidy 2×3 grid so every tab is visible at a glance —
     no swiping, no overflow */
  #admin-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); overflow: visible; }
  #admin-nav .seg { width: 100%; text-align: center; padding: var(--space-2) 4px; }

  /* any toolbar / button row wraps cleanly instead of overflowing */
  .cal-toolbar, .segmented, .row { flex-wrap: wrap; }

  /* calendar: stack the week vertically so the WHOLE week is visible by
     scrolling down — empty days collapse to a thin header, busy days grow */
  .cal-grid { grid-template-columns: 1fr; gap: var(--space-3); }
  .cal-day { min-height: auto; }
  .cal-day--month { min-height: auto; }
  .cal-range { min-width: 0; font-size: var(--text-base); }
  .cal-legend { margin-left: 0; width: 100%; }

  /* tighter cards, modal hugs the screen with breathing room */
  .card, .card--pad-lg { padding: var(--space-4); }
  .modal { padding: var(--space-4) var(--space-3); }
  .modal__card { padding: var(--space-4); }

  /* stat grids: keep at least 2 across */
  .stats { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--space-2); }

  /* action rows wrap instead of overflowing */
  .item__top, .item__actions { flex-wrap: wrap; }

  /* the wide schedule chart: show the swipe hint, keep it from clipping the page */
  .scroll-hint { display: block; margin-bottom: var(--space-2); }
  .table-wrap { max-width: 100%; }
}

/* ===== Share codes (QR) — staff only ===================================
   Moved off the public landing page 2026-07-28: a publicly posted student
   sign-up code is a link anyone can mint. These now live behind the auth
   gate on admin.html and coordinator.html. */
.qr-panel { margin-top: var(--space-8); }
.qr-panel__note {
  color: var(--muted); font-size: var(--text-sm);
  max-width: 60ch; margin: 0 0 var(--space-5);
}
.qr-cards {
  display: grid; gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.qr-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--space-5);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.qr-card__frame {
  background: #fff; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: var(--space-3);
  width: 10rem; margin-bottom: var(--space-3);
}
.qr-card__frame img { width: 100%; height: auto; display: block; }
.qr-card__title { font-weight: 700; margin-bottom: 2px; }
.qr-card__url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--text-xs); color: var(--green); margin-bottom: var(--space-3);
}
.qr-card__who { font-size: var(--text-sm); color: var(--muted); margin-bottom: var(--space-4); }
.qr-card .btn { margin-top: auto; }

@media print {
  .app-header, .app-nav, .qr-panel__note, .qr-card .btn { display: none !important; }
  .qr-card { border-color: #999; break-inside: avoid; }
}

/* ===== Merch block — students, school contacts, trainers ==================
   Shareable, not just clickable: the Heroes are the ones selling, so a
   student texting the link to family is the point. See js/merch.js. */
.merch {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
}
.merch__title { font-weight: 750; margin-bottom: var(--space-1); }
.merch__blurb { color: var(--muted); font-size: var(--text-sm); margin: 0 0 var(--space-3); }
.merch__url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--text-xs);
  background: var(--off);
  color: var(--muted);
  margin-bottom: var(--space-3);
}
.merch__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.merch__msg { margin: var(--space-3) 0 0; font-size: var(--text-sm); color: var(--green); font-weight: 600; }
