/* ============ Batch 8: bulk set-attribute, frozen header, arrival blocks, name fit ============ */

/* ---- Item 1: Actions dropdown + bulk select column ---- */
.actions-dropdown { position: relative; display: inline-block; }
.actions-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  z-index: 200;
  min-width: 180px;
  overflow: hidden;
}
.actions-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: none;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
  min-height: auto;
  border-radius: 0;
}
.actions-menu button:hover { background: var(--bg); }

/* No width here: the colgroup owns every column width (players.html), and a
   px width in a table-layout:fixed table that already sums to 100% only
   re-introduces the overflow this column used to suffer from. Trim the
   horizontal padding instead so the 18px checkbox has room at narrow desktop
   widths.

   Qualified with .players-table td/th on purpose. A bare .col-select is
   (0,1,0) and loses to style.css's `.players-table td, .events-table td`
   (0,1,1), so both the padding trim and the centering were silently dropped —
   file order does not help, specificity decides. That left the 4% column
   needing 18px + 24px of padding, i.e. ~42px, which it does not have until
   the table is about 1050px wide: below that the checkbox spilled into First,
   which is the overlap this rule exists to prevent. */
.players-table td.col-select,
.players-table th.col-select {
  text-align: center;
  padding-left: 2px;
  padding-right: 2px;
}
.col-select input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

/* ---- Item 2: frozen header bar ---- */
/* Scope fixed layout to the Players page tables ONLY (players-editable and the
   standalone players-colheader). Never use the generic .players-table selector
   here — it leaks into other tables. */
.players-editable { table-layout: fixed; width: 100%; }
.players-colheader { table-layout: fixed; width: 100%; margin: 0; border: none; }
.players-editable td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.players-editable td[data-label="Address"] { white-space: normal; }

/* The sticky action bar clears the main nav via --nav-h (set by JS in base). */
.players-header-sticky {
  position: sticky;
  top: var(--nav-h, 56px);
  z-index: 130;
  background: var(--bg);
  padding-top: 8px;
  padding-bottom: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

/* The column-header bar sticks just below the action bar. Both offsets are
   measured live by JS so the total is always correct. */
.players-colheader-wrap {
  position: sticky;
  top: calc(var(--nav-h, 56px) + var(--players-header-h, 60px));
  z-index: 115;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  overflow: hidden;
  margin-bottom: -1px;
}
/* Headers wrap rather than ellipsize. "Primary Connection" and "Response
   Score" are both wider than their columns at every realistic desktop width,
   and an ellipsized header ("PRIMARY C…") names nothing — two short lines in a
   slightly taller bar is the better trade. The bar is auto-height and its
   offset is measured live by JS, so a two-line header still lands correctly. */
.players-colheader thead th {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  padding: 8px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #6b5d50);
  font-weight: 600;
  white-space: normal;
  overflow-wrap: break-word;
  vertical-align: bottom;
  line-height: 1.25;
}

/* Hide each group's own header row — the standalone bar is the only one. */
.group-thead-hidden { display: none; }

@media (max-width: 768px) {
  .players-header-sticky { position: static; top: auto; }
  .players-colheader-wrap { display: none; }
  .players-editable { table-layout: auto; }
  /* The five-button header bar stays static on mobile (sticky would eat too
     much of a phone viewport). Instead the unsaved-changes banner — which
     appears exactly when Save matters — becomes a fixed bottom bar, the same
     idea as roster's .sticky-submit. JS toggles its inline display between
     'none' and '' (stylesheet value), so flex here still applies when shown. */
  .unsaved-banner {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 300;
    margin-bottom: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .unsaved-banner .btn-save-inline { min-height: 44px; flex: 0 0 auto; }
  .actions-menu button { min-height: 44px; }
  /* Bulk actions are desktop-only by design (the row checkboxes they operate
     on are hidden at these widths). Leaving the launcher visible made "Set
     Attribute…" a dead end that could only ever alert "select at least one
     player" — there was no way to select one. The launcher is a bare button
     now rather than a dropdown, so both selectors are listed: .actions-dropdown
     no longer exists in any template, and dropping it silently un-hid the
     controls this rule was written to hide. */
  .actions-dropdown, #set-attribute-btn, #players-group-text-btn { display: none; }
  .players-selection-status { display: none; }
  /* The project's 44px tap-target convention, applied to the standalone
     controls that were still landing at 32-36px on a phone. Deliberately NOT
     a blanket .btn-mini rule: the Edit/History pair inside a player card is
     sized against the competing requirement that many players fit on one
     screen, and is handled separately below. */
  .remove-chip, .time-select, .location-input, .btn-sms, .btn-mini {
    min-height: var(--tap);
  }
  /* The fixed banner is out of flow, so reserve room for it while it's up —
     otherwise it permanently covers the last roster rows. players.html
     toggles the body class together with the banner itself. */
  body.has-unsaved-banner main { padding-bottom: 110px; }
}

/* ---- Item 5: arrival-time breakdown table ---- */
.arrival-blocks { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.arrival-blocks h3 { margin: 0 0 8px; font-size: 16px; }
.arrival-table { width: auto; border-collapse: collapse; font-size: 14px; }
.arrival-table th, .arrival-table td {
  padding: 6px 14px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.arrival-table th {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

/* ---- Item 8: keep name + RSVP time on one line in the Coming/Maybe lists ---- */
/* width:100% is load-bearing. .item-main is a column flex container, so
   .name-line's `flex: 1` sizes its HEIGHT, not its width, and align-items
   (center/flex-start/flex-end per column) leaves it sized to its content.
   Without this it renders wider than its parent and spills over the move
   arrows on both sides -- and the name never truncates, because its container
   was never actually constrained. */
.rsvp-item .name-line { flex-wrap: nowrap; min-width: 0; width: 100%; }
/* Both forms, because the name became a link to the player profile and this
   was a direct-child rule: wrapping the <strong> in an <a> stopped it matching
   at all, the anchor kept its intrinsic width, and long names went back to
   overflowing the column and sitting under the arrival/remove controls. The
   bare <strong> selector stays for the lists that never gained a link. */
.rsvp-item .name-line > strong,
.rsvp-item .name-line > a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 0;
}
/* The <strong> inside that anchor must not reintroduce the intrinsic width the
   anchor just gave up — the ellipsis belongs on whatever actually holds text. */
.rsvp-item .name-line > a > strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rsvp-item .name-line .time-form-inline { flex: 0 0 auto; }
.rsvp-item .name-line .time-select { max-width: 88px; }
/* The remove button must never be the thing that gets squeezed out: the row is
   nowrap, so without an explicit no-shrink it overflowed the column and ended
   up underneath the move arrow, unclickable. */
.rsvp-item .name-line .remove-inline-form { flex: 0 0 auto; }

/* Tier + attendance moved off the name line onto their own quieter row, so the
   name, arrival time and remove control get the horizontal space instead. */
.rsvp-item .meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  width: 100%;   /* same reason as .name-line above — makes justify-content work */
}
.rsvp-item .meta-line .tier-tag,
.rsvp-item .meta-line .metric {
  flex: 0 0 auto;
  font-size: 10px;
  opacity: 0.75;
}
.rsvp-item .meta-line .tier-tag { padding: 1px 6px; }
/* No per-column justification: the meta line inherits flex-start like the rest
   of the row content, so tier/% always sits directly beneath the name. */

/* ---------- Responsiveness (players table + edit modal) ---------- */

/* A '—' is the absence of a score, not a low one — it should read as quiet
   rather than as a value worth comparing against the numbers beside it. */
.metric-strong.metric-muted {
  color: var(--muted);
  font-weight: 500;
}

/* Read-only metrics block inside the player edit modal. */
.modal-metrics {
  margin: 12px 0 4px;
  font-size: 13px;
  line-height: 1.6;
}
.modal-metrics .metric-detail {
  display: inline;   /* keeps the count on the same line as the score */
}

/* ---------- SMS opt-in status badge (players table) ---------- */
.consent-cell { text-align: center; }
.consent-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}
.consent-confirmed { color: #1a7f37; background: #e6f4ea; }
.consent-pending   { color: #9a6700; background: #fdf6e3; }
.consent-declined  { color: #b42318; background: #fdeaea; }
.consent-none      { color: var(--muted); background: transparent; cursor: default; }

/* ============ Mobile UX enhancements (4 items) ============ */

/* ---- Item 1: Completed event view (mobile portrait) — fit on one screen ---- */
/* Scoped to event_detail.html only (event-summary-* classes), so the active-
   event dashboard (which reuses .event-header/.columns for a different,
   arrow-driven layout) is untouched. */
@media (max-width: 640px) and (orientation: portrait) {
  .event-summary-header { margin-bottom: 8px; gap: 6px; }
  .event-summary-header .summary-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
  }
  .event-summary-header h2 { font-size: 17px; margin: 0; }
  .event-summary-header .status-badge { margin-left: 0; padding: 2px 8px; font-size: 10px; }
  .event-summary-header .event-header-actions { gap: 6px; }
  .event-summary-header .event-header-actions .btn-secondary,
  .event-summary-header .event-header-actions .btn-primary {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 36px;
  }

  .event-summary-stats { gap: 6px; margin-bottom: 10px; }
  .event-summary-stats .stat { padding: 6px 8px; font-size: 11px; min-width: 0; }
  .event-summary-stats .stat-num { font-size: 15px; }

  .event-summary-columns { gap: 8px; margin-bottom: 10px; }
  .event-summary-columns .rsvp-col { padding: 8px 10px; }
  .event-summary-columns .rsvp-col h3 { margin: 0 0 6px; font-size: 13px; }

  /* Inline wrapped "chips" instead of one full-width row per attendee — this
     is what lets 13 names fit in a few rows instead of 13 stacked rows. */
  .event-summary-columns .rsvp-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .event-summary-columns .rsvp-list li {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg);
    max-width: 100%;
  }
  .event-summary-columns .rsvp-list .name-line { gap: 4px; flex-wrap: nowrap; min-width: 0; }
  .event-summary-columns .rsvp-list .name-line strong {
    font-size: 12px;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .event-summary-columns .tier-tag { font-size: 8px; padding: 1px 5px; }
  .event-summary-columns .arrival { font-size: 11px; margin-left: 2px; }
}

/* ---- Item 2: Player edit modal — fill screen, no scrolling ---- */

/* Collapsible SMS Consent section (native <details>, no JS needed — same
   disclosure pattern as .year-group/.freq-group elsewhere in this file).
   Collapsed by default so a portrait phone doesn't have to render three
   always-visible consent fields it usually doesn't need to touch. */
.consent-details {
  border: 1px solid #ccc;
  border-radius: 6px;
  margin: 12px 0 4px;
  overflow: hidden;
}
.consent-summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--tap);
}
.consent-summary::-webkit-details-marker { display: none; }
.consent-summary::after {
  content: '▸';
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.15s;
  margin-left: 8px;
}
.consent-details[open] .consent-summary::after { transform: rotate(90deg); }
.consent-details .consent-body { padding: 2px 12px 12px; }
.consent-details .consent-body label:first-child { margin-top: 0; }

/* Compact spacing so the whole form fits without scrolling once Consent
   starts collapsed — needed on a narrow portrait phone AND on a short
   landscape phone (which is plenty wide, but starved for height instead). */
@media (max-width: 640px), (orientation: landscape) and (max-height: 500px) {
  .player-modal { max-height: 92vh; overflow-y: auto; padding: 16px; }
  .player-modal h3 { margin: 0 0 10px; font-size: 17px; }
  .player-modal label { margin-bottom: 8px; }
  .player-modal input[type="text"],
  .player-modal input[type="tel"],
  .player-modal input[type="email"],
  .player-modal input[type="date"],
  .player-modal input[type="url"],
  .player-modal input[type="time"],
  .player-modal select {
    padding: 8px 10px; /* min-height stays at --tap (44px) from the base rule */
    font-size: 16px; /* iOS Safari auto-zooms the page on focus below 16px */
  }
  .player-modal textarea {
    padding: 8px 10px;
    font-size: 16px; /* same iOS zoom-on-focus guard as above */
    min-height: 30px;
    max-height: 50px;
  }
  /* The 50px cap above is right for the one-line note fields it was written
     for and wrong for the food order template, which is a multi-paragraph
     message the organizer edits in place. Capped at 50px it shows barely two
     lines and the blank lines that matter most are off-screen. */
  .player-modal textarea.food-template {
    min-height: 140px;
    max-height: 40vh;
  }
  .player-modal .modal-metrics { margin: 6px 0 2px; line-height: 1.4; }
  .player-modal .modal-actions { margin-top: 8px; }
  .consent-summary { padding: 8px 10px; }
}
@media (max-width: 640px) {
  .player-modal { width: 94vw; max-width: 94vw; }
}

/* Landscape: two-column field layout so total height fits the shorter
   viewport. Grid auto-flow alone gives the requested pairing (Frequency+
   Phone, Email+Primary Connection, Address+Notes) because those six <label>
   elements are consecutive direct children of the form in that order; every
   other direct child (name row, checkbox, consent, metrics, actions) is
   explicitly spanned to full width below so it doesn't get pulled into that
   two-up flow. */
@media (orientation: landscape) and (max-height: 500px) {
  .player-modal { width: 96vw; max-width: 640px; max-height: 94vh; overflow-y: auto; }
  .player-modal form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
  }
  .player-modal .name-row,
  .player-modal form > label.checkbox-label,
  .player-modal .consent-details,
  .player-modal fieldset,
  .player-modal .modal-metrics,
  .player-modal .modal-actions {
    grid-column: 1 / -1;
  }
}

/* ---- Item 3: Player list, mobile portrait — many players per screen ---- */
/* Per-player compact card: name+status+actions on line 1, attendance +
   responsiveness on line 2, notes (if any) on line 3. Uses the existing
   data-label attributes for placement, so visual order is independent of
   DOM/column order and no server-side change is needed. Fields hidden here
   keep their <input name="..."> so /players/save-all still receives them —
   and since that route now treats an absent field as unchanged rather than
   cleared, a field dropped from the table entirely is safe either way. */
@media (max-width: 768px) and (orientation: portrait) {
  .players-editable td[data-label="Select"],
  .players-editable td[data-label="Address"],
  .players-editable td[data-label="Primary Connection"] {
    display: none;
  }

  /* A grid <tr> needs its ancestor chain out of table-layout mode too, or the
     browser can't size it (it collapses to a sliver instead of full width) —
     the generic stacking rule above only reset display on tr/td, not on
     table/tbody, which was fine for block rows but not for a grid one. */
  .players-editable, .players-editable > tbody, .players-editable .players-tbody {
    display: block;
  }
  .players-editable tr.player-row {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto auto;
    column-gap: 8px;
    row-gap: 2px;
    align-items: center;
    padding: 8px 10px;
  }
  .players-editable td { padding: 2px 0; }
  .players-editable td::before { content: none; } /* no data-label prefixes in card mode */

  .players-editable td[data-label="First"] {
    grid-row: 1; grid-column: 1;
    font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .players-editable td[data-label="Last"] {
    grid-row: 1; grid-column: 2;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .players-editable td[data-label="SMS"] {
    grid-row: 1; grid-column: 3;
    justify-self: center;
  }
  .players-editable td[data-label="Status"] {
    grid-row: 1; grid-column: 4;
    font-size: 12px; white-space: nowrap;
  }
  .players-editable td[data-label="Actions"] {
    grid-row: 1; grid-column: 5;
    justify-self: end;
  }
  .players-editable td[data-label="Attendance"] { grid-row: 2; grid-column: 1 / 3; }
  .players-editable td[data-label="Response Score"] { grid-row: 2; grid-column: 3 / 6; }
  /* Line 3 was Notes; Notes is no longer a table column (edit modal only), so
     the card is two lines. */

  .players-editable .status-active::before,
  .players-editable .status-archived::before {
    content: '●';
    margin-right: 3px;
    font-size: 9px;
  }
  .players-editable .status-active::before { color: var(--good); }
  .players-editable .status-archived::before { color: var(--muted); }

  /* Explicit exception to the 44px rule above. Two 44px buttons per row would
     add ~40% to every card's height and cut roughly two players off each
     screen, against the "see many players at a glance" requirement these
     cards exist to satisfy. 36px is the compromise: comfortably tappable,
     still dense. The full-size controls are one tap away in the edit modal. */
  .players-editable td[data-label="Actions"] .action-row .btn-mini {
    padding: 4px 10px;
    font-size: 11px;
    min-height: 36px;
  }
}

/* ---- Item 4: Player list, mobile landscape — no horizontal scrolling ---- */
/* Show only First, Last, Attendance, Status, Actions. Column hiding is keyed
   by nth-child so it applies identically to .players-colheader (the frozen
   standalone header) and .players-editable (each group's body table) — both
   render from the same players_colgroup() macro, so column N is the same
   field in both. This also resets the generic <=768px card-stacking rules
   (style.css) and the frozen-header-hides-under-768px rule (above in this
   file) back to a real table, so a landscape phone narrower than 768px
   (e.g. iPhone SE) still gets a compact table rather than stacked cards. */
@media (orientation: landscape) and (max-width: 932px) {
  .players-header-sticky { position: sticky; top: var(--nav-h, 56px); }
  .players-colheader-wrap { display: block; }
  /* Same reason as the portrait block: this breakpoint hides the row
     checkboxes too, so the bulk-action launchers have nothing to act on. */
  .actions-dropdown, #set-attribute-btn, #players-group-text-btn { display: none; }
  .players-selection-status { display: none; }
  .players-editable, .players-colheader { table-layout: fixed; }
  /* style.css's generic <=768px rule hides .players-table thead outright
     (needed for the card-stacking layout it drives elsewhere) — undo that
     for the standalone frozen header specifically; each group's own
     .group-thead-hidden thead must stay hidden regardless. */
  .players-colheader thead { display: table-header-group; }

  .players-editable tr.player-row,
  .players-colheader thead tr {
    display: table-row;
    background: none;
    border: none;
    margin: 0;
    padding: 0;
  }
  .players-editable td, .players-colheader th {
    display: table-cell;
  }
  .players-editable td::before, .players-colheader th::before { content: none; }

  /* Column order (10): Select 1, First 2, Last 3, SMS 4, Address 5,
     Primary Connection 6, Attendance 7, Response Score 8, Status 9,
     Actions 10.
     Hidden here: Select(1), Address(5), Primary Connection(6),
     Response Score(8).
     KEEP THIS MAP IN SYNC with players.html's col_widths and both header
     rows — these rules are index-based, so inserting or reordering a column
     silently misaligns the frozen header against the body table. */
  .players-colheader col:nth-child(1), .players-editable col:nth-child(1),
  .players-colheader col:nth-child(5), .players-editable col:nth-child(5),
  .players-colheader col:nth-child(6), .players-editable col:nth-child(6),
  .players-colheader col:nth-child(8), .players-editable col:nth-child(8) {
    display: none;
  }
  .players-colheader th:nth-child(1), .players-editable td:nth-child(1),
  .players-colheader th:nth-child(5), .players-editable td:nth-child(5),
  .players-colheader th:nth-child(6), .players-editable td:nth-child(6),
  .players-colheader th:nth-child(8), .players-editable td:nth-child(8) {
    display: none;
  }

  /* Redefine widths across just the 6 remaining visible columns (First, Last,
     SMS, Attendance, Status, Actions) so they sum back to 100%. !important
     is required here: players_colgroup() renders each <col> with an inline
     style="width:...", which otherwise beats any external rule regardless
     of selector specificity. */
  .players-colheader col:nth-child(2), .players-editable col:nth-child(2) { width: 20% !important; }  /* First */
  .players-colheader col:nth-child(3), .players-editable col:nth-child(3) { width: 18% !important; }  /* Last */
  .players-colheader col:nth-child(4), .players-editable col:nth-child(4) { width: 8% !important; }   /* SMS */
  .players-colheader col:nth-child(7), .players-editable col:nth-child(7) { width: 24% !important; }  /* Attendance */
  .players-colheader col:nth-child(9), .players-editable col:nth-child(9) { width: 12% !important; }  /* Status */
  .players-colheader col:nth-child(10), .players-editable col:nth-child(10) { width: 18% !important; } /* Actions */

  /* One line per header at this width — the columns that needed wrapping on
     the desktop layout are exactly the ones hidden here. */
  .players-colheader thead th { white-space: nowrap; }

  .players-editable td[data-label="Address"] { white-space: nowrap; }
}


/* ============ Batch 9: UX audit — safety, labels, insight ============ */

/* ---- Shared: the one-line "what is this page" note ---- */
.page-role {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--core);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.page-role a { color: var(--accent); }

/* ---- Events list: next-event card, status chips, compact rows ---- */
.next-event-card {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 2px solid var(--core);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.next-event-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: white;
  background: var(--core);
  border-radius: 10px;
  padding: 2px 10px;
}
.next-event-main h3 { margin: 6px 0 2px; font-size: 20px; }
.next-event-meta { margin: 0; color: var(--muted); font-size: 13px; }
.next-event-counts { margin: 6px 0 0; font-size: 14px; }
.next-event-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.status-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.filter-chip:hover { background: var(--bg); }
.filter-chip-on { background: var(--core); border-color: var(--core); color: white; }
/* Scoped to the requests board rather than raising .filter-chip's own
   36px min-height, which events_archive.html and me_history.html also
   consume -- this keeps the fix to the one surface it was found on
   (Gate 2 round 3, P2) rather than re-auditing every other consumer in
   the same round. */
.request-status-filter .filter-chip { min-height: 44px; }
/* me_history.html's own instance of the same gap (Gate 1 round 1, full-range
   item 10, UX lens) -- scoped the same way, to this one page's filter chips
   only. events_archive.html (admin, out of this build's item 3-9 range) is
   deliberately left as its own still-open instance rather than folded in. */
.me-history-filter .filter-chip { min-height: 44px; }

.events-table-compact td[data-label="Event"] a { text-decoration: none; }
.next-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--core);
  border: 1px solid var(--core);
  border-radius: 8px;
  padding: 0 6px;
}
/* The one row that matters should not need to be hunted for. Qualified past
   style.css's own alternate-row banding, which is (0,2,0) and would otherwise
   paint straight over this. */
.events-table tbody tr.row-next-event td { background: #f4f0fa; }
.btn-mini-primary { background: var(--core); color: white; }

/* ---- Event detail: danger zone ---- */
.danger-zone {
  margin-top: 28px;
  border: 1px solid #e5b8b8;
  border-radius: 10px;
  background: #fdf6f6;
  padding: 16px 20px;
}
.danger-zone h3 { margin: 0 0 8px; font-size: 15px; color: var(--bad); }
.danger-note { margin: 0 0 12px; font-size: 13px; line-height: 1.6; color: var(--ink); }
.danger-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 0; }
.danger-label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.danger-label input {
  border: 1px solid #d6a8a8;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 14px;
  min-width: 160px;
  font-variant-numeric: tabular-nums;
}
.danger-hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); font-style: italic; }

/* ---- Dashboard: labelled move controls (replacing the bare arrows) ---- */
.move-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  min-height: 36px;
  min-width: 36px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  gap: 1px;
}
.move-btn:hover, .move-btn:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.move-glyph { font-size: 15px; font-weight: 700; }
.move-label { font-size: 10px; letter-spacing: 0.2px; white-space: nowrap; }
@media (max-width: 768px) {
  /* The 44px tap convention the bare arrow buttons already followed. */
  .move-btn { min-height: 44px; min-width: 52px; }
}

/* ---- Tier glossing ---- */
.tier-gloss {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 2px;
  max-width: 70ch;
}
/* .year-summary is not a flex container, but .tier-section summary is — the
   gloss has to drop to its own line there rather than sit beside the heading. */
.tier-section summary { flex-wrap: wrap; }
.tier-section summary .tier-gloss { flex-basis: 100%; margin-left: 18px; }
@media (max-width: 768px) {
  /* Too little width for a second line of prose per group header; the title
     attribute still carries it for anyone who long-presses. */
  .tier-gloss { display: none; }
}

/* ---- Players: view bar, sortable headers, connection combobox ---- */
.players-view-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  font-size: 13px;
}
.sort-state { font-style: italic; }

.th-sort {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 0;
  border-radius: 3px;
}
.th-sort:hover { color: var(--accent); }
.th-sort:focus-visible { outline: 2px solid var(--core); outline-offset: 2px; }
/* The direction indicator is a pseudo-element rather than text on purpose: the
   header's text content has to stay exactly the column name, which is what
   tests/test_players_table_columns.py checks all three column definitions
   against. */
.players-colheader th[data-sort-key].sorted-asc::after  { content: ' \25B2'; font-size: 9px; color: var(--accent); }
.players-colheader th[data-sort-key].sorted-desc::after { content: ' \25BC'; font-size: 9px; color: var(--accent); }

/* Underlined at rest, not only on hover. This is now the ONLY route to a
   player's profile from the table — the "Profile" button that used to sit in
   the Actions cell was removed as redundant with it — and an underline-on-
   hover link reads as plain bold text until you are already pointing at it.
   On a touch screen there is no hover at all, so the affordance was invisible
   there entirely. The border-coloured underline keeps it quiet. */
.player-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}
.player-link:hover { color: var(--accent); text-decoration-color: currentColor; }

/* Flat view: every row hosted by the first group, the rest emptied out. */
.freq-group.flat-hidden { display: none !important; }
.freq-group.flat-host > .year-summary { display: none; }

.combo-hidden { display: none !important; }
.connection-combo {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 13px;
  background: white;
  color: var(--ink);
}
.connection-combo:focus { outline: 2px solid var(--core); outline-offset: -1px; }
.connection-combo.dirty { background: #fff8e0; border-color: var(--warn); }
.connection-combo.combo-unmatched { border-color: var(--bad); background: #fdeaea; }

.modal-hint-quiet {
  background: var(--bg);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 12px 0 0;
  line-height: 1.5;
}

/* ---- Player profile ---- */
.profile-header .summary-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.profile-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profile-stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  cursor: help;
}
.profile-stat-num { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.profile-stat-num.muted { color: var(--muted); }
.profile-stat-sub { font-size: 12px; color: var(--muted); line-height: 1.4; }
.trend-up { color: var(--good); font-weight: 700; }
.trend-down { color: var(--bad); font-weight: 700; }

.profile-flag {
  background: #fff8e8;
  border: 1px solid #e8d8a8;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin: 0 0 16px;
}
.profile-details, .profile-history, .profile-changes, .profile-trend {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.profile-details h3, .profile-history h3, .profile-changes h3, .profile-trend h3 { margin: 0 0 12px; font-size: 15px; }

/* ---- Collapsible profile panels ----
   The sections became <details>/<summary>. The requirement was that the look
   does not change, so everything here either restores a default the element
   swap took away or adds the one new mark: a small triangle in the margin.

   The h3's own 0 0 12px margin (rule above) is neutralised inside the summary
   and re-applied to the summary only while open — so an OPEN panel is
   pixel-identical to the <section> it replaced, and a COLLAPSED one closes up
   tight instead of carrying 12px of empty card under its heading. */
.profile-panel > summary {
  list-style: none;                 /* the default disclosure triangle... */
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  /* The triangle hangs into the card's padding rather than pushing the
     heading right. Without this the flex row indented every h3 by 16.63px
     while the <dl>/<table> below it still started at the 20px padding edge,
     so each panel's heading fell out of alignment with its own content —
     a visible change, against the "aesthetic completely unchanged" brief.

     Absolutely positioned rather than given a negative margin: as a flex item
     the glyph's own width (8.63px, and font-dependent) joins the 8px gap in
     setting the indent, so any margin that cancels it is a magic number tuned
     to one font. Out of flow, the h3 simply starts at the summary's content
     edge, which is the card's — exactly where the old <h3> started.

     NOT given min-height: var(--tap). The 44px floor is the app's convention
     for controls and a reviewer asked for it here, but it makes every panel
     13.5px taller, and "keep the aesthetic completely unchanged" is the
     owner's explicit requirement for this change. The summary is a
     full-width row, so the practical hit area is ~1000x22px — the tap-target
     rule exists for small targets, which this is not. */
  position: relative;
}
.profile-panel > summary::-webkit-details-marker { display: none; }   /* ...and its Safari spelling */
.profile-panel[open] > summary { margin-bottom: 12px; }
.profile-panel > summary > h3 { margin: 0; }

/* Subtle by request: muted, 10px, and in the margin rather than in the
   heading's own colour — it reads as an affordance, not as part of the title.
   Same glyph and rotation as the tier sections, so the gesture is already
   learned by the time anyone reaches a profile. */
.profile-panel > summary::before {
  content: '▶';
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.2s;
  /* Out of flow (see the summary rule above), so the heading is not pushed
     right by this glyph's own width plus the flex gap. */
  position: absolute;
  left: -18px;
}
.profile-panel[open] > summary::before { transform: rotate(90deg); }

/* Keyboard users get the same focus ring the rest of the app uses; removing
   the marker must not also remove the ability to see where you are. */
.profile-panel > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .profile-panel > summary::before { transition: none; }
}
.profile-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
.profile-dl dt { font-weight: 700; color: var(--muted); }
.profile-dl dd { margin: 0; }
@media (max-width: 560px) {
  .profile-dl { grid-template-columns: 1fr; gap: 2px; }
  .profile-dl dd { margin-bottom: 8px; }
}

/* Wide content scrolls inside its own box; the page body never does. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.profile-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.profile-table th, .profile-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.profile-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); white-space: nowrap; }
.profile-table tbody tr:last-child td { border-bottom: none; }

.rsvp-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-radius: 10px;
  padding: 2px 8px;
  color: white;
}
.rsvp-yes { background: var(--good); }
.rsvp-no { background: var(--bad); }
.rsvp-maybe { background: #9b6116; }
.rsvp-pending { background: var(--muted); }
.outcome-yes { color: var(--good); font-weight: 600; }
.outcome-no { color: var(--bad); font-weight: 600; }

/* ---- Insights ---- */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.insight-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
}
.insight-card-wide { margin-bottom: 16px; border-left: 3px solid var(--warn); }
.insight-card h3 { margin: 0 0 4px; font-size: 15px; }
.insight-sub { margin: 0 0 12px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.insight-list { margin: 0; padding-left: 22px; }
.insight-list li {
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.insight-list li:last-child { border-bottom: none; }
.insight-list a { color: var(--ink); text-decoration: none; font-weight: 600; }
.insight-list a:hover { color: var(--accent); text-decoration: underline; }
.insight-figure { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- Host include/exclude toggle ---- */
.insight-controls {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0 0 16px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.insight-controls .metric-detail { flex: 1 1 260px; line-height: 1.5; }

/* ---- "No host marked" notice ----
   Styled as page furniture, NOT as a control: no card background, no border
   box that reads as a clickable panel, no accent colour that invites a tap.
   It borrows .page-role's muted voice on purpose -- that element is the other
   thing on this page that explains rather than offers. Legible with no CSS at
   all, which is the fallback that matters given the service worker. */
.insight-host-note {
  margin: 0 0 16px;
  padding: 0 2px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---- Natural tier bands ----
   "Soft and subtle" was the brief, and it is also the only thing that works:
   these bands sit inside a ranked list whose real content is the names and the
   figures, so anything strong enough to read as a category would compete with
   the ranking it is annotating.

   Two marks, deliberately redundant, because either one alone fails somewhere:

   - a very faint warm tint on alternate bands — invisible when printed, and
     invisible to anyone who has turned colours off;
   - a slightly stronger rule above the first row of each new band, which is
     the part that survives both.

   The tint alternates on band % 2 rather than getting one colour per band. It
   marks WHERE the boundaries fall, not which band is "better" — a four-step
   ramp would imply an ordering the bands do not carry, on top of the ordering
   the list already has. */
.insight-list li.band-1 {
  background: rgba(122, 104, 85, 0.045);   /* --muted, barely there */
  box-shadow: -6px 0 0 rgba(122, 104, 85, 0.045),
               6px 0 0 rgba(122, 104, 85, 0.045);  /* bleed past the li's box */
}
/* Deliberately NOT `1px solid var(--border)` — that is byte-identical to the
   border-bottom every row already carries, so a band boundary rendered as two
   hairlines 3px apart rather than as a stronger line. This is the mark that
   has to survive print and colour-off, where the tint contributes nothing. */
.insight-list li.band-start {
  border-top: 1px solid var(--muted);
  margin-top: 6px;
  padding-top: 8px;
}

/* Forced-colors (Windows high contrast) drops backgrounds entirely, so the
   rule has to carry the whole signal there. */
@media (forced-colors: active) {
  .insight-list li.band-start { border-top: 2px solid CanvasText; }
}

.insight-legend { margin: 16px 0 0; line-height: 1.6; }

/* ---- Collapsible Lapsed card ----
   Same treatment as the profile panels: restore what <summary> takes away,
   then add one small triangle. The h3 keeps its own `margin: 0 0 4px` from the
   rule above while open, so an open card is unchanged. */
.insight-panel > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;               /* see .profile-panel > summary */
}
.insight-panel > summary::-webkit-details-marker { display: none; }
.insight-panel > summary > h3 { margin: 0; }
.insight-panel > summary::before {
  content: '▶';
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.2s;
  position: absolute;               /* see .profile-panel > summary::before */
  left: -18px;
}
.insight-panel[open] > summary::before { transform: rotate(90deg); }
.insight-panel[open] > summary { margin-bottom: 4px; }
.insight-panel > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .insight-panel > summary::before { transition: none; }
}

/* ---- Help ---- */
.help-toc { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.help-toc a {
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
}
.help-toc a:hover { background: var(--bg); color: var(--accent); }
.help-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 16px;
  scroll-margin-top: calc(var(--nav-h, 60px) + 12px);
}
.help-section h3 { margin: 0 0 12px; font-size: 18px; }
.help-section h4 { margin: 20px 0 6px; font-size: 14px; }
.help-section p { line-height: 1.65; font-size: 14px; }
.help-steps { margin: 0; padding-left: 22px; }
.help-steps li { margin-bottom: 10px; line-height: 1.6; font-size: 14px; }
.help-bullets { margin: 6px 0 0; padding-left: 22px; }
.help-bullets li { margin-bottom: 8px; line-height: 1.6; font-size: 14px; }
.help-note {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 16px;
}
/* Sectioned variant of .help-note: real headings and paragraphs instead of
   <br><br>, so the box has boundaries in the accessibility tree and heading
   navigation can reach its lead-ins. Scoped to its own class deliberately —
   `.help-note p` would reach every other page's help boxes, and this change is
   about one box on /text-path. (Round 8, UX8-5.) */
.help-note-sections .tp-note-sub {
  margin: 16px 0 5px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  /* Every contents link above targets one of these headings, and the site
     header is position:sticky, so without this the heading scrolls to the very
     top of the viewport and the header sits on top of it — the jump lands on
     the thing it was meant to reveal. Same expression as `.tp-stage` and
     `.help-section`, which are the page's other two anchor targets; --nav-h is
     set from the live header height by base.html, and the 60px fallback is
     theirs too. (Round 10, UX10-2.) */
  scroll-margin-top: calc(var(--nav-h, 60px) + 12px);
}
.help-note-sections .tp-note-sub:first-of-type { margin-top: 0; }
.help-note-sections p { margin: 0 0 10px; line-height: 1.6; }
.help-note-sections p:last-child { margin-bottom: 0; }
/* The day-of food skip reasons, rendered from app.FOOD_SKIP_REASONS. Scoped to
   .help-note-sections like the rules above it, so other pages' help boxes are
   untouched. (Round 11-E.) */
.help-note-sections .tp-note-reasons { margin: 0 0 10px; padding-left: 20px; }
.help-note-sections .tp-note-reasons li { margin-bottom: 6px; line-height: 1.6; }
.help-note-sections .tp-note-reasons li:last-child { margin-bottom: 0; }
.tp-note-toc { margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.tp-note-toc-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}
.tp-note-toc ul { margin: 6px 0 0; padding-left: 20px; }
.tp-note-toc li { line-height: 1.5; }
.tp-note-toc a {
  color: var(--ink);
  /* min-height is --tap for the same reason `.tp-toc a` below carries it, and
     this control had skipped it in exactly the same way: seven interactive
     links on a phone-first page sitting at 17px against the 44px rule.
     display:flex makes the whole row the target rather than the text alone,
     and the li's margin-bottom went with it — 44px already spaces them, and
     keeping both would have doubled the gap. (Round 10, UX10-1.) */
  min-height: var(--tap);
  display: flex;
  align-items: center;
}

.help-dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 0; align-items: baseline; }
.help-dl dd { margin: 0; font-size: 13px; line-height: 1.6; }
.help-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.help-table th, .help-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.55; }
.help-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); }
@media (max-width: 560px) {
  .help-dl { grid-template-columns: 1fr; gap: 2px; }
  .help-dl dd { margin-bottom: 12px; }
}

/* ---- Nav: who is signed in ---- */
.nav-whoami {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  white-space: nowrap;
  cursor: help;
}
.login-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 2px 0 4px;
  text-align: left;
}


/* ---- Card-layout sort control ---- */
/* The column headers ARE the sort control wherever .players-colheader-wrap is
   visible, so this picker is hidden by default and appears only at the widths
   that hide the header. It drives the same applySort(), and render() writes
   the current sort back into it, so the two can never disagree. */
.mobile-sort-label { display: none; }
.mobile-sort-dir { display: none !important; }

@media (max-width: 768px) and (orientation: portrait) {
  /* .players-colheader-wrap is hidden here (the table becomes cards), which
     took every sort except "last seen" with it — on the device this roster is
     most often read from. */
  .mobile-sort-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
  }
  .mobile-sort { min-height: var(--tap); }
  .mobile-sort-dir {
    display: inline-block !important;
    min-height: var(--tap);
    min-width: var(--tap);
  }
  /* The JS toggles this one's display to 'none' while nothing is sorted; the
     rule above must not fight that. */
  .mobile-sort-dir[style*="display: none"] { display: none !important; }
}

/* ---------- Day-of food ordering ---------- */

/* Wider than the 460px default: this modal holds a multi-paragraph template
   and a preview of the message, and at 460px the preview wraps so aggressively
   that it stops resembling what arrives on a phone. */
.food-modal { max-width: 620px; }

.food-section { margin-bottom: 18px; }
.food-section + .food-section { border-top: 1px solid var(--border); padding-top: 14px; }
.food-section h4 { margin: 0 0 10px; font-size: 14px; }

/* The checkbox is the one control here that must NOT stretch to width:100%,
   which is what the base .player-modal label rule would do to it. */
.food-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.food-check input[type="checkbox"] {
  width: auto;
  min-height: 0;
  margin: 0;
}

/* THE point of the preview. pre-wrap keeps the blank lines between paragraphs
   visible while still wrapping long DoorDash URLs; `white-space: pre` would
   push them off the side and `normal` would collapse exactly the blank lines
   this block exists to prove are there. */
.food-preview {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  background: var(--panel, #f7f7f8);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  max-height: 40vh;
  overflow-y: auto;
}

.food-stats { font-size: 13px; margin: 8px 0 0; }
.food-blockers { margin: 0 0 8px; padding-left: 18px; color: var(--danger, #b42318); font-size: 13px; }
.food-warning { color: var(--warn, #b54708); font-size: 13px; margin: 4px 0; }
.food-dirty-note { color: var(--warn, #b54708); font-weight: 600; }
.food-skipped { margin-top: 10px; font-size: 13px; }
.food-skipped summary { cursor: pointer; color: var(--muted); }
.food-skipped ul { margin: 8px 0 0; padding-left: 18px; }
.food-skipped li { margin-bottom: 4px; }

.food-send-form { margin-bottom: 14px; }
.food-send-form:last-child { margin-bottom: 0; }

/* A <button> that has to read as a link — it sits inline in a hint sentence,
   and making it an <a href="#"> would put a dead anchor in the history. */
.linklike {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent, #2563eb);
  text-decoration: underline;
  cursor: pointer;
}

/* ============ Invite picker: name filter + SMS status ============ */

/* Mirrors .player-filters on the Players tab rather than reusing it: that
   class is a <form>'s layout and carries a bottom margin sized for a row of
   selects. This holds one input and a count. */
.roster-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.roster-filter .search-input { flex: 1 1 220px; max-width: 420px; }

/* The badge sits after the name on one baseline. .player-name is not a flex
   container (it is a plain span inside the .player-info column), so the badge
   is aligned with vertical-align rather than align-items. */
.roster-consent { margin-left: 6px; }
.roster-consent .consent-badge { vertical-align: -4px; }

/* .consent-none renders as an em dash on a transparent ground, which against
   the card's white background is nearly invisible — fine as one cell in a
   table column headed "SMS", not fine as the only mark distinguishing "never
   asked" from "this player has no badge at all". A ring gives it a body
   without giving it a colour it has not earned. */
.roster-consent .consent-none {
  border: 1px solid var(--border);
  background: transparent;
}

.roster-consent-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
  line-height: 1.7;
}
/* The legend's badges are decoration beside their own explanation, so the
   help cursor the table's badges carry would promise a tooltip that adds
   nothing. */
.roster-consent-legend .consent-badge { cursor: default; }

/* Filtering hides cards with inline display:none. A grid gap is drawn between
   grid ITEMS, so a hidden card leaves no hole — nothing extra is needed here.
   What does need saying: the group keeps its own padding when empty, which is
   why applyFilter hides the whole <details> rather than just its cards. */

/* ============ Profile trend chart ============ */

/* Deliberately short. The brief was "not much taller than Details", and a
   90-unit-tall plot in a 150-unit viewBox at ~480px wide lands around 150px —
   about one Details block. max-width stops it stretching to a stripe on a
   wide monitor, where a 1200px-wide 150px-tall chart flattens every slope it
   exists to show. */
.trend-chart { display: block; max-width: 640px; margin: 0; overflow: visible; }

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);          /* text tokens, never the series colour */
}
.trend-key { display: inline-flex; align-items: center; gap: 6px; }
.trend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Recessive: the grid is scaffolding, the lines are the content. */
.trend-grid { stroke: var(--border); stroke-width: 1; }
.trend-axis { stroke: var(--border); stroke-width: 1; }
.trend-axis-label { font-size: 9px; fill: var(--muted); }

.trend-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* The one place a series colour is allowed on text: this IS the mark's label,
   sitting at the end of its own line with nothing else to tie them together.
   Every other figure on the page stays in ink. */
.trend-value {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Invisible, and bigger than the dot it covers, so a point is findable with a
   mouse without printing 40 circles along the line. `fill: transparent`
   rather than `fill: none` on purpose: `none` is not a hit target, so the
   <title> tooltip inside would never fire. */
.trend-hit { fill: transparent; }

.trend-note, .trend-legend { max-width: 640px; }
.trend-note { margin: 8px 0 0; }

/* ============ Players Group Text ============ */

/* This form carries only the checked player IDs and CSRF token. It has no
   visible controls; the action-bar button snapshots the IDs immediately
   before submitting it. */
.players-group-text-form { display: none; }
.players-selection-status {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.group-text-shell { max-width: 820px; margin: 0 auto; }
.group-text-lead { line-height: 1.6; max-width: 70ch; }
.group-text-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.group-text-stat {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}
.group-text-stat strong { display: block; font-size: 20px; }
.group-text-stat span { color: var(--muted); font-size: 12px; }
.group-text-panel {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  margin: 14px 0;
}
.group-text-panel h3, .group-text-panel h4 { margin-top: 0; }
.group-text-panel textarea { width: 100%; resize: vertical; }
.group-text-recipient-list { margin: 8px 0 0; padding-left: 22px; }
.group-text-recipient-list li { margin: 5px 0; line-height: 1.45; }
.group-text-excluded { border-left: 4px solid var(--warn); }
.group-text-notice {
  padding: 11px 14px;
  border-radius: 8px;
  background: var(--bg);
  line-height: 1.55;
}
.group-text-notice strong { color: var(--ink); }
.group-text-error { border-left: 4px solid var(--bad); }
.group-text-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.group-text-actions .btn-primary,
.group-text-actions .btn-secondary { min-height: var(--tap); }

.group-text-batch-id {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.group-text-batch-id code { overflow-wrap: anywhere; }
.group-text-batch-id button { min-height: var(--tap); }
.group-text-state {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
}
.group-text-state-accepted { color: var(--good); border-color: var(--good); }
.group-text-state-failed,
.group-text-state-unknown,
.group-text-state-delivery-unknown { color: var(--bad); border-color: var(--bad); }
.group-text-state-skipped,
.group-text-state-never-attempted,
.group-text-state-not-attempted { color: #8a5510; border-color: var(--warn); }
.group-text-results { width: 100%; border-collapse: collapse; }
.group-text-results th,
.group-text-results td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.group-text-results th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.group-text-result-note { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 3px; }

@media (max-width: 640px) {
  .group-text-summary { grid-template-columns: 1fr; }
  .group-text-results, .group-text-results tbody, .group-text-results tr,
  .group-text-results td { display: block; }
  .group-text-results thead { display: none; }
  .group-text-results tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .group-text-results td { padding: 3px 0; border: 0; }
  .group-text-results td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
  }
}

@media (max-width: 560px) {
  /* SVG font sizes are in USER UNITS, so they shrink with the viewBox. At a
     390px viewport the chart renders at ~0.62x, which put the axis labels at
     about 5.6 CSS px — unreadable. These are the compensating sizes, not a
     style preference. */
  .trend-value { font-size: 13px; }
  .trend-axis-label { font-size: 15px; }
}

/* ============ Text Path — the invite conversation, end to end ============ */
/*
   Read-only page. Two message directions to tell apart at a glance: what
   Clockkeeper SENDS (a bubble with the real body in it) and what the player
   can REPLY (a keyed option). Everything else is annotation.

   .tp-body uses pre-wrap because the blank lines inside these bodies are the
   message — the invite, the time prompt and the arrival confirmation all carry
   deliberate line breaks, and collapsing them would render a message the player
   never receives. That is the one rule in this block that is load-bearing.
*/

.tp-lead { font-size: 15px; line-height: 1.65; max-width: 70ch; margin: 0 0 12px; }
.tp-scope { max-width: 70ch; margin-top: 0; }
.tp-sample-note { font-size: 13px; color: var(--muted); margin: 16px 0 8px; }

.tp-toc { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 4px; }
.tp-toc a {
  font-size: 13px;
  /* min-height is --tap because this is the page's primary navigation and the
     first interactive thing a phone user reaches. .tp-opt already used the
     variable; this control had skipped it and sat around 32px. */
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
}
.tp-toc a:hover { background: var(--bg); color: var(--accent); }

.tp-stage {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 16px;
  scroll-margin-top: calc(var(--nav-h, 60px) + 12px);
}
.tp-stage-yes   { border-left-color: var(--good); }
.tp-stage-no    { border-left-color: var(--bad); }
.tp-stage-maybe { border-left-color: var(--warn); }
.tp-stage-stop  { border-left-color: var(--muted); }

.tp-stage h3 { margin: 0 0 14px; font-size: 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tp-sub { margin: 22px 0 8px; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.tp-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--nav-bg);
  color: #fff;
  font-size: 13px;
  flex: none;
}

.tp-inline-key, .tp-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.tp-inline-key { color: var(--accent); }

/* ---- What Clockkeeper sends ---- */
.tp-msg { margin: 12px 0; max-width: 60ch; }
/* Marks a message as one Clockkeeper SENDS, as opposed to a player reply. It
   currently adds no declarations of its own -- the bubble styling lives on
   .tp-body -- but it is the hook the outbound/inbound distinction would attach
   to, and it is what the markup reads by. Kept deliberately rather than left
   as an unexplained class the next reader has to guess about. */
.tp-msg-app { }
.tp-msg-who { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); margin-bottom: 5px; }
.tp-body {
  white-space: pre-wrap;   /* load-bearing: see note at the top of this block */
  /* pre-wrap wraps at spaces but will not break an unbroken run. The location
     is organizer-supplied and reaches build_invite, so a pasted URL would push
     the bubble past the viewport. Hardening, not a defect today. */
  overflow-wrap: anywhere;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 3px;
  padding: 11px 14px;
  font-size: 14px;
  line-height: 1.55;
}
.tp-body-inline { display: block; margin-top: 6px; border-radius: 8px; max-width: 60ch; }
.tp-msg-final .tp-body { border-color: var(--good); }
.tp-cost { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---- What the player can reply ---- */
.tp-replies { display: flex; flex-direction: column; gap: 7px; margin: 12px 0; }
.tp-replies-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); }
.tp-opt {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  min-height: var(--tap);
  max-width: 70ch;
}
a.tp-opt:hover { background: var(--bg); }
.tp-opt .tp-key { flex: none; min-width: 4.5em; }
.tp-meaning { color: var(--muted); font-size: 13px; line-height: 1.5; }
.tp-opt-yes   { border-left-color: var(--good); }
.tp-opt-yes .tp-key   { color: var(--good); }
.tp-opt-no    { border-left-color: var(--bad); }
.tp-opt-no .tp-key    { color: var(--bad); }
.tp-opt-maybe { border-left-color: var(--warn); }
/* Not var(--warn): #c47b1c on --card is ~3.5:1, and this is 14px bold, which is
   not WCAG "large text" (that needs 18.66px bold), so 4.5:1 applies. Darkened
   for TEXT only -- the border above keeps the palette token, where the 3:1
   non-text threshold applies and it passes. Changing --warn globally would
   repaint every warning surface in the app for one label's sake. */
.tp-opt-maybe .tp-key { color: #8a5510; }
/* Inert rows -- a list of what the player may send, not something to click.
   Given no card background and no border so they cannot be mistaken for the
   anchors above, which on touch give no hover feedback to tell them apart. */
.tp-opt-slot, .tp-opt-stop {
  min-height: 0;
  padding: 5px 0 5px 13px;
  background: none;
  border: none;
  border-left: 3px solid var(--border);
  border-radius: 0;
}
.tp-opt-stop { border-left-color: var(--muted); }
/* The link variants keep the card treatment and gain an affordance that does
   not depend on hover. */
/* A LITERAL arrow, deliberately, not a CSS backslash escape. The first
   version of this line went through a Python escape that collapsed to
   U+0083 followed by "A", so five links shipped a stray capital A on
   their right edge. The render check did not catch it: it asserted the
   pseudo-element DIFFERED from the inert rows, and a wrong glyph satisfies
   that exactly as well as a right one. Assert on the consequence meant. */
a.tp-opt::after { content: ' →'; color: var(--muted); margin-left: auto; }

/* ---- Annotations ---- */
.tp-fallback { margin: 14px 0; padding-left: 13px; border-left: 2px dashed var(--border); }
.tp-fallback-key { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); }
.tp-fallback-note { font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 6px; max-width: 70ch; }
.tp-outcome {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.6;
  margin: 12px 0;
  max-width: 70ch;
}
.tp-keywords { display: flex; flex-direction: column; gap: 10px; }
.tp-keyword {
  display: flex;
  gap: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 70ch;
}
.tp-keyword .tp-key { flex: none; min-width: 4.5em; color: var(--ink); }

@media (max-width: 560px) {
  .tp-stage { padding: 16px 14px; }
  .tp-opt { flex-direction: column; gap: 3px; }
  .tp-opt .tp-key { min-width: 0; }
  .tp-keyword { flex-direction: column; gap: 2px; }
  .tp-msg, .tp-body-inline, .tp-outcome { max-width: 100%; }
}

/* The substring-matched headcount phrasings. Wraps as a run of chips rather
   than a list, because there are eight of them and they are read as a set. */
.tp-phrases { display: block; margin-top: 6px; }
.tp-phrases code {
  display: inline-block;
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  margin: 2px 0;
}

/* ============ Scripts admin (3a/3b) ============ */

/* Notes is the one free-text column on this table, so it gets the same quiet
   treatment as every other secondary-text cell in the app (.address-cell,
   style.css). Own class rather than reusing .address-cell: that rule also
   caps max-width at 200px, which is a locations-page constraint (a street
   address wraps awkwardly wide) that a one-line script note doesn't need. */
.script-notes-cell { font-size: 13px; color: var(--muted); }

/* Even-row banding above 769px, matching .events-table's own banding
   (style.css) — .players-table itself carries none generically, since
   .players-editable's own row striping is driven by JS-assigned classes
   instead. Scoped to .scripts-table so it reaches only this page. */
@media (min-width: 769px) {
  .scripts-table tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.03); }
}

/* ============ Per-event script options, release, averages (3c) ============ */

/* Two columns above 900px, stacked below — the design's own breakpoint for
   this panel, narrower than .columns' 640px because these two cards run
   wider than an RSVP column and start crowding sooner. */
.script-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 20px 0;
}
@media (min-width: 900px) {
  .script-panel { grid-template-columns: 1fr 1fr; }
}

/* Both cards fold under one <details class="profile-panel script-group">
   (admin-UX handoff item 6). The profile-panel rules above supply the
   summary, the triangle and the 12px open gap; these three rules are what
   differs because this panel sits on the page rather than inside a card.

   The 20px block margin moves from the grid to the group, so a COLLAPSED
   panel keeps its distance from the headcount block above and the RSVP
   columns below, and an OPEN one is not left with the heading pressed
   against the block above and 32px of air (20 + the summary's 12) before its
   own cards. Heading-to-cards is 12px, the same as every profile panel.

   The 16px heading is the size the options card's own h3 had before it
   became the summary, and the size the Released card's h3 still has. */
.script-group { margin: 20px 0; }
.script-group > .script-panel { margin: 0; }
.script-group > summary > h3 { font-size: 16px; }
/* The triangle hangs 18px into the left margin (see .profile-panel > summary
   ::before). A profile panel has 20px of card padding there; here the only
   room is <main>'s padding, which is 16px on a phone — 2px short, so the
   glyph would clip at the viewport edge. Pull it in to fit. Both classes in
   the selector on purpose: `.script-group > summary::before` alone TIES the
   -18px rule on specificity and would win only on source order, so a later
   reordering of this file would silently put the glyph back at -18px. */
@media (max-width: 640px) {
  .profile-panel.script-group > summary::before { left: -14px; }
}
.script-options-card, .script-release-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
/* The options card's heading is the group's <summary> since item 6 (below), so
   only the Released card still carries an h3 of its own. */
.script-release-card h3 { margin: 0 0 8px; font-size: 16px; }
.script-release-card h4 { margin: 16px 0 6px; font-size: 14px; }

.script-checklist { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }

/* 44px minimum tap target (mid-layer UI checklist), matching every other
   checkbox row in the app rather than a bespoke size for this one. */
.script-option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.script-option-row input[type="checkbox"] { width: 18px; height: 18px; flex: none; }
.script-option-name { font-weight: 600; }
.script-option-notes { font-size: 12px; color: var(--muted); }
/* Selected rows get a green border and pale-green ground — the same pairing
   the design uses for the "Coming" RSVP state. */
.script-option-selected { border-color: var(--good); background: #f3fdf4; }

.script-avg-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.script-avg-row:last-of-type { border-bottom: none; }
.script-avg-name { font-weight: 600; }
.script-avg-value { font-size: 12px; color: var(--muted); }
.script-progress {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}
.script-progress-bar { height: 100%; background: var(--core); }

/* Open/closed pill for the live release. Its own class rather than reusing
   the former .food-chip (removed in item 19; it was a quieter, read-only
   status chip built for a summary line), because this pill follows the
   smaller, uppercase, tracked-letter-spacing badge convention this file
   already uses for .status-badge/.tier-tag. (Comment corrected, Gate 1
   Developer lens: this previously claimed the two shared a shape.) */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.pill-open { background: #d4ecd6; color: var(--good); }
/* Darker amber text on #f4e8d0 meets small-text AA contrast, never white
   on the raw --warn fill (README Design Tokens). Used
   by the "awaiting consent" proposal badge (tracker item 9, screen 2f). */
.pill-warn { background: #f4e8d0; color: #8a5510; }

/* ---- Player sign-in (tracker item 3, design screen 2a) ---- */

.me-footer-link {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
}

.me-signin-footer {
  margin-top: 20px;
  font-size: 13px;
}
.me-signin-footer a {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  color: #49392e;
}

/* Design tokens table: "font: 700 22px ui-monospace; letter-spacing: .18em"
   for the code field, centered. */
.code-input {
  font: 700 22px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .18em;
  text-align: center;
}
.code-input-error { border: 2px solid var(--bad); }
.code-error-hint { color: var(--bad); }

.login-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: left;
  min-height: var(--tap);
}

.me-verify-links {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0;
  font-size: 13px;
  min-height: var(--tap);
}
.me-inline-form { display: inline; }
.me-verify-links > span { display: none; }
.login-heading { margin: 0 0 4px; font-size: 18px; }
button.link-button, a.link-button {
  background: none;
  border: none;
  padding: 0;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 400;
  border-radius: 0;
}
button.link-button:disabled {
  color: var(--muted);
  text-decoration: none;
  cursor: default;
}
/* Distinguishes a discard-in-effect action from an ordinary link-button
   beside it (tracker item 7's "Cancel the change" vs. "Send a new code") --
   same accent as declined-state consent/RSVP no, so "this ends something"
   reads consistently across the app rather than looking identical to a
   low-stakes navigation link (crew-review round 1, UX lens). */
button.link-button-danger { color: var(--bad); }

/* The wrong-code screen's "codes only go to roster addresses" note. Quiet on
   purpose -- background instead of border, smaller and muted text -- so it
   reads as a footnote next to the error above it, never as a second
   competing message. Worded (in the template, not here) to never confirm
   whether the address the player typed is actually on the roster. */
.quiet-card {
  margin-top: 16px;
  background: var(--bg);
  border-radius: 10px;
  padding: 14px;
  text-align: left;
}
.quiet-card p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.pill-closed { background: var(--border); color: #695947; }

/* ---- Player hub + RSVP (tracker item 4, design screen 2b) ---- */

/* Outside the replaceable card; reserve a line so saving feedback stays put. */
.rsvp-save-status { color: var(--muted); font-size: 13px; min-height: 1.5em; margin: 8px 0; }

/* Player header name shares the title row; organizer headers have no name. */
.header-row:has(.header-playername) { gap: 10px; }
.header-row:has(.header-playername) h1,
.header-row:has(.header-playername) .nav-toggle { flex: none; }
.header-playername { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; opacity: .85; }

.hub-empty {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
}
.hub-empty-title { font-size: 15px; font-weight: 600; }
.hub-empty-sub { font-size: 13px; color: var(--muted); margin: 8px 0 0; line-height: 1.55; }

.rsvp-hero {
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-bottom: 12px;
}
.rsvp-hero-pending { border: 2px solid var(--warn); background: #fdf9f3; }
.rsvp-hero-yes     { border: 2px solid var(--good); background: #f3fdf4; }
.rsvp-hero-maybe   { border: 1px solid var(--warn); background: #fdf9f3; }
.rsvp-hero-no      { border: 1px solid var(--bad);  background: #fdf3f3; }

.rsvp-hero-date { font-size: 15px; color: var(--muted); }
.rsvp-hero-question { font-size: 30px; font-weight: 700; line-height: 1.15; margin-top: 4px; }
.rsvp-hero-title { font-size: 22px; font-weight: 700; }
.rsvp-hero-sub { font-size: 14px; color: var(--muted); margin-top: 6px; }
.rsvp-hero-note { font-size: 12px; color: var(--muted); margin: 12px 0 0; line-height: 1.5; }

.rsvp-hero-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  border: none;
  padding: 0;
}
.rsvp-hero-actions button {
  flex: 1;
  min-height: var(--tap);
  border: none;
  border-radius: 6px;
  font: 600 14px inherit;
  cursor: pointer;
}
/* The amber pairing is #8a5510 on #f4e8d0 -- never white text on the raw
   #c47b1c fill, which fails contrast at body size (README "Design Tokens"). */
.rsvp-btn-yes   { background: var(--good); color: #fff; }
.rsvp-btn-maybe { background: #f4e8d0; color: #8a5510; border: 1px solid var(--warn) !important; }
.rsvp-btn-no    { background: var(--bad); color: #fff; }

.rsvp-hero-actions-secondary { display: flex; gap: 8px; margin-top: 14px; }
.rsvp-hero-actions-secondary > a,
.rsvp-hero-actions-secondary > form { flex: 1; margin: 0; }
.rsvp-hero-actions-secondary > form > button { width: 100%; }

/* Pure-CSS bottom sheet: an :target overlay, not a JS-toggled one, so it
   opens and closes with JavaScript disabled (mid-layer render gate). JS only
   enhances the SAVE inside it (background fetch instead of a full reload). */
.rsvp-sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 300;
}
.rsvp-sheet-overlay:target {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.rsvp-sheet-panel {
  width: 100%;
  max-width: 640px;
  background: var(--card);
  border-radius: 14px 14px 0 0;
  padding: 20px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
  max-height: 85vh;
  overflow-y: auto;
}
.rsvp-sheet-panel h3 { margin: 0 0 4px; font-size: 17px; }
.rsvp-sheet-sub { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.rsvp-sheet-options { display: flex; flex-direction: column; gap: 8px; }
.rsvp-sheet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  min-height: var(--tap);
}
.rsvp-sheet-option input { width: 20px; height: 20px; }
.rsvp-sheet-option-yes   { border: 2px solid var(--good); background: #f3fdf4; }
.rsvp-sheet-option-maybe { border: 1px solid var(--warn); background: #fdf9f3; }
.rsvp-sheet-option-no    { border: 1px solid var(--bad);  background: #fdf3f3; }
.rsvp-sheet-option-yes span   { color: var(--good); font-weight: 600; }
.rsvp-sheet-option-maybe span { color: #8a6d2c; }
.rsvp-sheet-option-no span    { color: var(--bad); }
.rsvp-time-label { display: block; font: 600 13px inherit; color: var(--muted); margin-top: 16px; }
.rsvp-time-select {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 4px;
  min-height: var(--tap);
  font-size: 16px;
  max-width: none;
}
.rsvp-sheet-note { font-size: 12px; color: var(--muted); margin: 12px 0 0; line-height: 1.5; }
.rsvp-sheet-actions { display: flex; gap: 8px; margin-top: 16px; }
.rsvp-sheet-actions > a, .rsvp-sheet-actions > button { flex: 1; }
.rsvp-sheet-actions > button { flex: 2; }

/* Feature list (five 44px rows: emoji, label, subline, chevron). All five
   are real links as of tracker item 9 -- this comment previously said they
   stayed display-only divs "until items 5-9 land their own routes", which
   was true when written and stopped being true the moment item 9 (the last
   of the five) landed (Gate 1 round 1, UX lens: comment falsified by its
   own commit). */
.hub-feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.hub-feature-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  min-height: var(--tap);
}
.hub-feature-row:last-child { border-bottom: none; }
.hub-feature-icon { font-size: 18px; }
.hub-feature-body { flex: 1; min-width: 0; }
.hub-feature-label { font-weight: 500; font-size: 15px; }
.hub-feature-sub { font-size: 11px; color: var(--muted); }
/* A feature row that IS a live link (tracker item 5 turns "My numbers" into
   one): same layout as the display-only row above, plus the link resets. */
a.hub-feature-row { text-decoration: none; color: inherit; }
.hub-feature-chevron { color: var(--muted); }
.hub-signout { color: var(--ink); font-size: 13px; }
.hub-signout a { color: var(--ink); display: inline-flex; align-items: center; min-height: 44px; }

/* ---- Player numbers + history (tracker item 5, design screen 2c) ----
   The four stat tiles reuse .profile-stat/.profile-stat-label/etc. verbatim
   (README: "profile-stat-equivalent tiles") -- same tile, same computation,
   so a number here can never disagree with the admin profile's own tiles.
   The CONTAINER is not reused as-is: .profile-stats' auto-fit(minmax(190px))
   is right for the admin page (which can have room for four across) but
   collapses to ONE column at a typical ~390px phone viewport (390 - 2*16px
   main padding - 12px gap leaves no room for a second 190px track), where
   this build's own instruction is a fixed 2x2 grid regardless of width
   (Gate 2 round 2, P2). .me-stats-grid overrides just the column count. */
.me-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Only the split card and the history cards below are new. */
.me-split-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}
.me-split-half { flex: 1; min-width: 0; }
.me-split-half + .me-split-half { border-left: 1px solid var(--border); padding-left: 16px; }
.me-split-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.me-split-value { font-size: 18px; font-weight: 700; }
.me-split-sub { font-size: 12px; color: var(--muted); }
/* Cards stack on phones (app-wide convention; see .group-text-summary for the
   same pattern) -- a fixed two-column flex row is cramped well before 640px,
   the app's own breakpoint. Gate 1 round 1, UX lens. */
@media (max-width: 640px) {
  .me-split-card { flex-direction: column; gap: 12px; }
  .me-split-half + .me-split-half {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 12px;
  }
}

.me-history-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.me-history-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.me-history-date { font-weight: 600; font-size: 15px; }
.me-history-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.me-history-outcome { font-size: 13px; margin-top: 4px; }
.me-history-imported { font-size: 12px; color: var(--muted); margin-top: 6px; }
.me-footer-note { margin-top: 12px; }

/* ---- Script ranking (tracker item 6, design screen 2d) ---- */

/* The hub row's "open" pill (mirrors item 5's plain feature-row link, minus
   the pill) sits inline after the label text -- .pill's own inline-flex
   would otherwise butt up against it with no gap. */
.hub-feature-label .pill { margin-left: 6px; vertical-align: middle; }

/* The amber "September release" banner. Its own class rather than reusing
   .rsvp-hero-pending: that one is semantically an RSVP prompt (three action
   buttons, a question), where this is a status header with no action of its
   own -- the actions live in the form below it. Same amber pairing as
   .rsvp-hero-pending and .headcount-high (design tokens table: --warn
   border on #fdf9f3), because "there is something open that names a
   deadline" is the same visual idea in all three places. */
.script-banner {
  border: 2px solid var(--warn);
  background: #fdf9f3;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.script-banner-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.script-banner-title { font-weight: 700; }
.script-banner-sub { font-size: 13px; color: var(--muted); }

.rank-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.rank-badge {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.rank-body { flex: 1; min-width: 0; }
.rank-name { font-weight: 600; }
.rank-notes { font-size: 12px; color: var(--muted); }
.rank-arrows { flex: none; display: flex; flex-direction: column; gap: 4px; }

/* Visible by default (Gate 2 round 5, P2): with JS disabled this is the
   ONLY control that can set an order at all, so it must never start
   hidden. #rank-list.js-enhanced (added by this page's own <script>, once
   it confirms it is running) is what hides it back to the original
   arrow-only design for everyone else. */
.rank-order-label { flex: none; }
.rank-order-input {
  width: 44px;
  height: var(--tap);
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-variant-numeric: tabular-nums;
}
#rank-list.js-enhanced .rank-order-label { display: none; }

/* Same checkbox-row shape as .login-checkbox-row -- a 44px tap target,
   muted 13px label -- rather than a bespoke rule for one more checkbox. */
.rank-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  min-height: var(--tap);
  margin: 4px 0 16px;
}
.rank-check-row input { width: 18px; height: 18px; flex: none; }

.rank-privacy-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 12px; }

/* ---- Saved / no-release states ---- */

.saved-rank-list { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: saved-rank; }
.saved-rank-row {
  counter-increment: saved-rank;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.saved-rank-row:last-child { border-bottom: none; }
.saved-rank-row::before {
  content: counter(saved-rank) '.';
  font-weight: 700;
  color: var(--muted);
  flex: none;
  width: 20px;
}
.saved-rank-name { flex: 1; font-weight: 500; }
.rather-not-marker { font-size: 11px; color: #8a5510; text-transform: uppercase; letter-spacing: .5px; }

.past-releases-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 16px;
}
.past-releases-card h3 { margin: 0 0 8px; font-size: 15px; }
.past-release-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.past-release-row:last-child { border-bottom: none; }
.past-release-month { font-weight: 600; }
.past-release-detail { color: var(--muted); text-align: right; }

/* ---- Contact info + email change (tracker item 7, design screen 2f) ---- */

.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 12px;
}
/* Stacked, not side-by-side -- the design mockup's own two-up row broke this
   app's standing mobile-first rule ("cards stack on phones -- no side-by-side
   columns at phone widths", CLAUDE.md UI conventions) with no gate for it,
   unlike the admin player-edit modal's equivalent .name-row, which is
   stacked by default and only goes two-up inside a landscape media query
   (crew-review round 1, UX lens, P2: two fields at rest left roughly
   120-140px each on a 320-375px phone, enough to clip an ordinary name).
   Both fields are disabled/view-only and gain nothing from sharing a row. */
.contact-name-row { display: flex; flex-direction: column; gap: 10px; }
.contact-field {
  display: block;
  font: 600 13px inherit;
  color: var(--muted);
}
.contact-field input,
.contact-field textarea {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 16px; /* iOS Safari auto-zooms the page on focus below 16px */
  font-family: inherit;
  background: #fff;
  min-height: var(--tap);
  box-sizing: border-box;
  color: var(--ink);
}
.contact-field textarea { resize: vertical; min-height: auto; }
/* Disabled inputs get their own muted fill (design tokens table: --bg under
   --muted text) -- not a hover/focus state, the visual signal that these two
   fields are read-only ("Your name is set by the organizer"). */
.contact-field input:disabled { background: var(--bg); color: var(--muted); }
.contact-hint { font-size: 12px; color: var(--muted); margin: -6px 0 0; line-height: 1.5; }

/* Neutral by default (unreadable / never asked); a state class below adds
   the color pairing the design reserves for it. Same three-state palette as
   the RSVP hero (confirmed~yes/good, pending~maybe/warn, declined~no/bad) --
   this card is answering the same kind of question players already see
   colored that way elsewhere in this app. */
.consent-status-card {
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: var(--card);
}
.consent-status-title { font-weight: 600; font-size: 14px; }
.consent-status-body { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.consent-status-confirmed { border: 1px solid var(--good); background: #f3fdf4; }
.consent-status-confirmed .consent-status-title { color: var(--good); }
.consent-status-pending { border: 1px solid var(--warn); background: #fdf9f3; }
/* Amber text-on-fill pairing per the design tokens table: #8a6d2c, never
   white on the raw #c47b1c fill. */
.consent-status-pending .consent-status-title { color: #8a6d2c; }
.consent-status-declined { border: 1px solid var(--bad); background: #fdf3f3; }
.consent-status-declined .consent-status-title { color: var(--bad); }

.organizer-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.contact-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}
.organizer-tier-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  font-size: 14px;
}
.organizer-tier-row span:first-child { color: var(--muted); }

/* ---- Confirm new email ---- */

.email-change-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-top: 12px;
}
.email-change-row { display: flex; justify-content: space-between; padding-top: 10px; font-size: 14px; }
.email-change-row:first-of-type { padding-top: 8px; }
.email-change-row .to-value { font-weight: 600; }
.email-change-code-input { width: 100%; margin-top: 14px; padding: 12px; box-sizing: border-box; }
.email-change-submit { width: 100%; margin-top: 10px; }
.email-change-note { font-size: 12px; color: var(--muted); margin: 12px 0 0; line-height: 1.55; text-align: center; }

/* ---- Requests & ideas board (tracker item 8, screen 2e) ---- */

.request-new-btn { margin-bottom: 14px; }

.request-card {
  display: flex;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

/* 38x32, not --tap (44px) -- the design's own pixel values for this control
   (README screen 2e: "a 38x32 upvote button") are part of the same
   high-fidelity, final spec that names every other dimension in this build
   ("Fidelity": "final and were lifted from static/style.css"), so this is a
   stated exception rather than an oversight of the tap-target rule. */
.vote-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: none;
  margin: 0;
}
button.vote-btn {
  width: var(--tap);
  height: var(--tap);
  min-height: var(--tap);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  font: 700 14px inherit;
  cursor: pointer;
}
button.vote-btn-on { border-color: var(--good); background: var(--good); color: #fff; }
button.vote-btn:disabled { opacity: 0.6; cursor: default; }
.vote-count { font: 700 14px inherit; font-variant-numeric: tabular-nums; }

.request-body { flex: 1; min-width: 0; }
.request-title { font-weight: 600; font-size: 15px; line-height: 1.35; }
.request-byline { font-size: 12px; color: var(--muted); margin-top: 4px; }
.request-organizer-reply {
  font-size: 13px;
  color: var(--ink);
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  line-height: 1.5;
}
.request-footer-note { font-size: 12px; color: var(--muted); margin: 2px 0 0; line-height: 1.5; }

.request-status-under_review { background: #f4e8d0; color: #8a5510; }
.request-status-planned      { background: #d0e4f4; color: #2c5e8a; }
.request-status-shipped      { background: #e8d4f4; color: var(--core); }
.request-status-not_planned  { background: var(--border); color: #695947; }
.request-body .status-badge { margin-left: 0; margin-top: 8px; display: inline-block; }

/* ---- Requests & ideas -- organizer view ---- */

.request-admin-body { font-size: 13px; color: var(--muted); margin-top: 4px; }
.request-admin-status-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.request-admin-status-form select,
.request-admin-status-form textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
}
.request-admin-status-form textarea { resize: vertical; }

@media (max-width: 768px) {
  /* The generic card-table conversion leaves the table algorithm free to
     retain a desktop intrinsic width. These two organizer inboxes have wide
     status/action cells, so make every table layer an explicit phone-width
     block and let the value side of each label/value row shrink and wrap. */
  .organizer-inbox-table,
  .organizer-inbox-table tbody {
    display: block;
    width: 100%;
    max-width: 100%;
  }
  .organizer-inbox-table tr,
  .organizer-inbox-table td {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
  }
  .organizer-inbox-table td { white-space: normal; }
  .organizer-inbox-table td > * {
    min-width: 0;
    max-width: calc(100% - 92px);
    overflow-wrap: anywhere;
  }
  .organizer-inbox-table .actions-cell .btn-danger {
    min-height: var(--tap);
  }
}

/* ---- Propose a player (tracker item 9, screen 2f) ---- */

/* The screen's own intro paragraph (design mockup, id="2f" "Propose a
   player" panel) -- body-weight ink text, not a muted hint, so its own
   class rather than reusing .contact-hint (12px, --muted). */
.propose-intro { font-size: 14px; line-height: 1.6; color: var(--ink); margin: 0; }

/* "Your past proposals" list -- same row rhythm as .past-release-row
   (me_scripts.html) since both are a compact name/value list inside a
   .past-releases-card, just with a status pill on the right instead of a
   detail string. */
.proposal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.proposal-row:last-child { border-bottom: none; }
.proposal-name { font-weight: 600; }
/* When two proposals sit in the list there's no other way to tell which is
   older (Gate 1 round 1, UX lens) -- same relative-date convention
   me_requests.html's .request-byline already uses. */
.proposal-posted { display: block; font-weight: 400; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---- Item 18: attendance corrections on a completed night ---- */
/* The toggle sits between the stats row and the columns, in the same
   left-aligned button rhythm as the back bar. The hint only renders in edit
   mode, beside the Done button. */
.attendance-edit-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}
.attendance-edit-hint { font-size: 13px; color: var(--muted); }
/* Per-name actions: one row of small buttons under the name, wrapping on a
   phone. Each is its own form (one POST per row change), which .inline-form
   already lays out; the wrapper just spaces the forms and keeps them under
   the name rather than beside it in the 3-column layout. */
.attendance-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.attendance-edit-actions .inline-form { margin: 0; }
/* Remove is the one destructive control in the strip; colour alone was its
   only separation from the two neutral moves (Gate 1 round 1, UX lens), so
   it sits at the row's far edge. */
.attendance-edit-actions .attendance-remove { margin-left: auto; }
/* Where Remove would not stick (an RSVP answer would rebuild the row), the
   slot carries a muted note instead of a button, same position. */
.attendance-remove-na {
  font-size: 12px;
  color: var(--muted);
  align-self: center;
  text-align: right;
}
/* The list item is a flex row with the name-line at flex: 1, so three buttons
   beside it squeezed "Ada Example" to "Ada / Exam" at every width — seen in
   the render gate, not inferred. An editing row puts the name on its own line
   and the actions on the next. */
.rsvp-list li.editing .name-line { flex: 1 0 100%; }
.rsvp-list li.editing .attendance-edit-actions { flex-basis: 100%; }
/* On a portrait phone the summary list is inline chips (the block above at
   the same breakpoint); an editing chip becomes a full-width card instead. */
@media (max-width: 640px) and (orientation: portrait) {
  .event-summary-columns .rsvp-list li.editing {
    flex-wrap: wrap;
    flex-basis: 100%;
    border-radius: 8px;
    padding: 6px 8px;
  }
}

/* ---- Item 19: the event dashboard fits one screen ---- */

/* Action bar: every send control shares one geometry so the five of them sit
   on one row at laptop width (measured fit ~861px — do not add a control or a
   label without re-measuring). One rule here rather than a style per button.
   .btn-secondary and .btn-sms already carry most of this from style.css; the
   rule exists so the anchor, the buttons and the two send shapes cannot drift
   apart, and so the btn-sms pair rises from its 36px min-height to the 44px
   tap target the rest of the bar uses. The spec wrote the list as
   `.sms-bar > .btn-secondary, .sms-bar > .btn-sms, .sms-bar > a` against a
   mock whose send buttons were direct children; here they sit inside their
   forms, so `> .btn-sms` would match nothing and `> a` only repeats the first
   selector (the anchor is a .btn-secondary). Two selectors cover all five. */
.sms-bar > .btn-secondary,
.sms-bar > form > .btn-sms {
  padding: 10px 16px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  white-space: nowrap;
}

/* Headcount block: one row of four number+label figures on a shared baseline,
   coloured like the RSVP columns below (green/amber/red) and the existing
   --inconsistent blue for Pending. Replaces the single big number, "Good game
   size" and the confirmed→potential range (the range duplicated the min/max
   rows in Character Distribution). The 48px/800 size from style.css's
   .summary-left .headcount-number is overridden here, not there. */
.headcount-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: nowrap;
  margin-bottom: 2px;
}
.headcount-figure {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.headcount-figure + .headcount-figure {
  padding-left: 14px;
  border-left: 1px solid var(--border);
}
.summary-left .headcount-figure .headcount-number {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}
.headcount-word {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.headcount-figure.count-yes { color: var(--good); }
.headcount-figure.count-maybe { color: var(--warn); }
/* --warn (#c47b1c) is 3.4:1 on the panel's white — fine for the 34px number,
   under 4.5:1 for the 11px label. The darker amber this file already uses for
   small Maybe text (#8a5510, 6.2:1) carries the label (Gate 2 round 4). */
.headcount-figure.count-maybe .headcount-word { color: #8a5510; }
.headcount-figure.count-no { color: var(--bad); }
.headcount-figure.count-pending { color: var(--inconsistent); }

/* Arrival Times now sits under the counts in the left column; both tables
   fill their column. The qualifier ("· 5 of 6 confirmed", "· range for 8–11
   players") rides the h3 line at normal weight instead of a paragraph under
   it — .dist-sub's 13px/muted from style.css still applies, its paragraph
   margin does not matter inside an inline span. */
.summary-left .arrival-blocks { margin: 16px 0 0; overflow-x: auto; }
.summary-right h3 { margin: 0 0 8px; font-size: 16px; }
/* The arrival table can carry every one of the nine ARRIVAL_SLOTS plus "No
   time" — ten columns, 511px at the base 6px 14px cells — and the column it
   now lives in is 380-475px when paired (Gate 2 round 3, measured). Fixed
   layout with tight cells and wrapping headers fits all ten at 380px; the
   overflow-x above is the net for anything narrower still. */
.summary-left .arrival-table {
  width: 100%;
  table-layout: fixed;
  font-size: 13px;
}
.summary-left .arrival-table th,
.summary-left .arrival-table td {
  padding: 6px 3px;
}
/* Headers may wrap ("< 6:30", "NO TIME"); a count never does, so a two-digit
   count cannot read as two counts. style.css left-aligns every .dist-table's
   first column for the distribution's label column; the arrival table has no
   label column, so its first cell is centred like the rest. */
.summary-left .arrival-table th { white-space: normal; word-break: break-word; }
.summary-left .arrival-table td { white-space: nowrap; }
.summary-left .arrival-table th:first-child,
.summary-left .arrival-table td:first-child { text-align: center; }
.arrival-blocks h3 .dist-sub,
.summary-right h3 .dist-sub { font-weight: 400; margin: 0; }

/* The two summary columns sit side by side only when both fit at their
   intrinsic widths. style.css lets them pair from 240px + 260px, which is
   narrower than the nowrap four-count row (~350px at single digits) and the
   spelled-out distribution table (~385px): measured with the render probe,
   660-760px viewports overflowed the page and 820-900px spilled the Pending
   figure into the column gap (Gate 2 round 2). At these minimums the panel
   stacks below ~850px and pairs from there with room for two-digit counts. */
.summary-left { min-width: 380px; }
.summary-right { min-width: 385px; }
/* Stacked band above the phone block: the right column's left border and
   padding (style.css) belong to the side-by-side layout; style.css swaps them
   for a top border only at 640px, so the same swap is repeated for the band
   the minimums above stack in. The boundary is the panel content width the
   pair needs — 380 + 24 gap + 385 + the right column's 25px padding/border =
   814 — plus the panel's 40px padding and 2px border and main's 48px padding
   above 640px (style.css): 904. The columns pair from a 904px viewport
   (measured: stacked at 888, paired at 904). */
@media (max-width: 903px) {
  .summary-left, .summary-right { flex-basis: 100%; }
  .summary-right { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 16px; }
}
/* A distribution with travellers is six columns; spelled out they need 471px
   (measured), which the paired right column only has from a 990px viewport:
   471 + the column's 25px padding/border + 24 gap + the left column's 380 +
   the panel's 42 + main's 48 = 990. Below that the six-column table uses its
   abbreviations (each carrying its full word as a title) while the five-column
   one stays spelled out. */
@media (max-width: 989px) {
  .dist-wide .dist-full { display: none; }
  .dist-wide .dist-abbr { display: inline; }
}

/* Spelled-out distribution headers carry a phone abbreviation alongside; the
   base rule hides it, the 640px rule below flips them. This rule MUST precede
   that media query. */
.dist-abbr { display: none; }

/* Phone (spec item 10, max-width 640px, additive). The other phone rules in
   this file use several shapes — 640px plain (the .player-modal width rule),
   640px + portrait (the completed-event fit), 768px (.move-btn, .tier-gloss);
   the spec's 640px is followed for these. */
@media (max-width: 640px) {
  /* The pairing minimums above would overflow a phone; stacked columns need
     none. */
  .summary-left, .summary-right { min-width: 0; }
  /* 10.1: the four-count row wraps, dividers off, numbers to 30px. */
  .headcount-row { flex-wrap: wrap; gap: 8px 16px; }
  .headcount-figure + .headcount-figure { padding-left: 0; border-left: 0; }
  .summary-left .headcount-figure .headcount-number { font-size: 30px; }
  /* 10.2 and item 5: PENDING → PEND, Townsfolk → TF, etc. */
  .dist-full { display: none; }
  .dist-abbr { display: inline; }
  /* 10.3: five spelled-out columns do not fit 375px; let the headers wrap and
     tighten the cells instead of overflowing the panel. */
  .dist-table { font-size: 11px; table-layout: fixed; }
  .dist-table th, .dist-table td {
    padding: 4px 3px;
    white-space: normal;
    word-break: break-word;
  }
  /* 10.3 for the arrival table too: the paired-layout rule above (13px, 6px
     3px) out-specifies this block's .dist-table rules, so the spec's phone
     values are re-stated at the winning specificity. */
  .summary-left .arrival-table { font-size: 11px; }
  .summary-left .arrival-table th, .summary-left .arrival-table td { padding: 4px 3px; }
  /* 10.4: no gap under the Arrival Times table. */
  .summary-left .arrival-blocks,
  .summary-left .arrival-blocks table { margin-bottom: 0; }
  /* 10.5: pending-card actions stay on the header line and collapse to the
     glyph spans rendered by dashboard.html. These declarations deliberately
     neutralize style.css's max-width:768px unresolved-state layout: its
     width:100%, margin-left:0, wrapping and normal white-space are replaced
     by an auto-width, right-aligned, no-wrap tooltip control. The recovery
     guidance remains available in the button title while its desktop text is
     hidden by .dist-full above. */
  .pending-card-header,
  .pending-awaiting { flex-wrap: nowrap; }
  .pending-card-header .send-one { padding: 6px 9px; }
  .pending-card-header .delivery-unresolved {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 0;
    margin-left: auto;
    width: auto;
    white-space: nowrap;
  }
}
/* Player Hub attendee list. Keep the hub's new link inside the swapped RSVP card. */
.attendees-link { display: flex; width: 100%; justify-content: center; align-items: center; gap: 8px; margin-top: 12px; box-sizing: border-box; }
.attendees-columns .rsvp-item { align-items: center; gap: 8px; }
.attendees-columns .name-line { flex-wrap: wrap; }
.attendees-columns > .rsvp-col { min-width: 0; }
.attendees-columns .name-line strong { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.attendees-time { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.attendees-time-coming { color: var(--good); }
.attendees-time-maybe { color: #8a5510; }
.attendees-time-unset { color: var(--muted); }
.attendees-note { color: var(--muted); font-size: 12px; margin-top: 18px; }

/* Group-calendar Insights. Existing stylesheet URLs use _asset_version(). */
.insights-dashboard { display: grid; gap: 16px; min-width: 0; }
.insights-dashboard > .insight-card { margin: 0; min-width: 0; }
.insights-dashboard .insight-card p { overflow-wrap: anywhere; }
.insight-kpis { display: grid; gap: 14px; }
.insight-kpi { border-top: 1px solid var(--border); padding-top: 8px; min-width: 0; }
.insight-kpi h4 { margin: 0 0 4px; }
.insight-kpi strong { font-size: 28px; font-variant-numeric: tabular-nums; }
.insight-kpi p { font-size: 14px; }
.insight-chart, .insight-spark, .punch-dates, .punch-row svg {
  display: block; width: 100%; overflow: visible;
}
.insight-spark { height: 60px; }
.chart-marks { width: 100%; height: 100%; }
.insight-spark .chart-line { stroke: var(--core); }
.insight-spark .chart-dot { fill: var(--core); }
.insight-up { color: var(--good); }
.insight-down { color: var(--bad); }
.insights-dashboard svg text { fill: var(--ink); font: 12px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.chart-average { stroke: var(--good); stroke-dasharray: 6 4; }
.chart-target { fill: var(--good); opacity: .16; }
.chart-dot { fill: var(--accent); }
.chart-core { fill: var(--core); }
.chart-regular { fill: var(--good); }
.chart-occasional { fill: var(--warn); }
.key-core { background: var(--core); }
.key-regular { background: var(--good); }
.key-occasional { background: var(--warn); }
.chart-key { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; }
.chart-key > span { display: inline-flex; align-items: center; gap: 5px; }
.chart-key i { display: inline-block; width: 12px; height: 12px; flex: none; }
.insight-new { margin-left: 6px; padding: 1px 5px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; font-weight: 400; }
.chart-data summary { cursor: pointer; min-height: var(--tap); padding: 10px 0; }
.chart-data ul { padding-left: 20px; overflow-wrap: anywhere; }
.insights-dashboard .insight-list li { flex-wrap: wrap; min-width: 0; }
.insights-dashboard .insight-list a, .punch-row a {
  display: inline-flex; align-items: center; min-height: var(--tap); max-width: 100%;
  overflow-wrap: anywhere;
}
.insights-dashboard .insight-list .metric-detail { flex-basis: 100%; margin-left: 0; }
.insights-dashboard .insight-figure { white-space: normal; }
.punch-row { border-bottom: 1px solid var(--border); padding: 4px 0; }
.punch-row a { display: flex; flex-wrap: wrap; gap: 8px; }
.punch-row a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.punch-row a:hover { color: var(--accent); text-decoration: underline; }
.punch-row a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.punch-played { fill: var(--accent); stroke: var(--accent); }
.punch-invited { fill: none; stroke: var(--muted); stroke-width: 1.8; }
/* Labels stay in CSS pixels while the nested SVG marks use the card width. */
.chart-quarter, .chart-checkpoint { transform-box: fill-box; transform-origin: left top; }
.chart-quarter { transform: rotate(65deg); }
.chart-checkpoint { transform: rotate(60deg); }
.slope-chart { position: relative; }
.chart-axis { stroke: var(--muted); stroke-width: 1; }
.slope-up { color: var(--good); }
.slope-down { color: var(--bad); }
.slope-up .chart-line, .slope-down .chart-line, .slope-connector { stroke: currentColor; }
.slope-up circle, .slope-down circle { fill: currentColor; }
.slope-connector { stroke-width: 1; fill: none; }
.slope-label { position: absolute; left: 55%; right: 0; display: flex; gap: 5px; font-size: 12px; line-height: 16px; }
.slope-label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slope-label b { flex: none; }
@media (min-width: 769px) {
  .insight-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
