/* ==========================================================================
   /assets/css/ma_shared.css
   MatchAid — Shared Styles (GoDaddy)

   SECTIONS
   ─────────────────────────────────────────────────────────────────────────
    1.  Design Tokens (:root)
    2.  Base / Reset
    3.  App Shell Layout
    4.  Chrome — Header
    5.  Chrome — Footer Shell & Status Line
    6.  Chrome — Bottom Nav (Desktop Icon Bar)
    7.  Chrome — Footer Action Bar (Save / Cancel)
    8.  Chrome — Mobile Nav Hub (Navigate Button + Tray)
    9.  Multi-Panel Layout
   10.  Overlay Family (Drawer + Modal)
   11.  Actions Menu (deprecated shell + active maModal variant)
   12.  Cards
   13.  Pills & Chips
   14.  Buttons
   15.  Form Fields
   16.  Date Badge & Calendar
   17.  List Rows (LEGACY — frozen; see 17A)
   17A. List Lines (ListLine construct — use for all new / reworked lists)
   18.  Admin Picker
   19.  Misc (Empty State, Tab Panels)
   20.  Source Module Shared Vocabulary
   22.  MA.ui — Busy / Confirm Footer / Modal Notice / Toast
   ========================================================================== */


/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {

  /* --- Typography --- */
  /* OLD — restore to revert: --fontFamilyBase: "Montserrat", Arial, sans-serif; */
  --fontFamilyBase: "Roboto", system-ui, -apple-system, Arial, sans-serif;

  /* Font weights — one name per original weight level, so the hierarchy
     stays intact and each level is tuned here, in one place. Use these
     instead of numbers. Values are softened one step from the original
     numbers (Extrabold was 800, Black was 900/950); set them back to
     800/900 to restore the original look. Montserrat loads 400–900
     (includes/shell/appHead.php). */
  --fwRegular:   400;
  --fwMedium:    500;
  --fwSemibold:  600;
  --fwBold:      700;
  --fwExtrabold: 700;
  --fwBlack:     800;

  --inputTextSize: 16px;
  --labelTextSize: var(--fsMeta);  /* 15px: form labels */

  /* --- Type scale (roles). px equivalents at the default 16px root; rem so
     a future text-size control can scale them all from the root. --- */
  --fsLabel:      0.8125rem;  /* 13px: deliberate tiny labels only (badge month, column headers); content is 15px+ */
  --fsMeta:       0.9375rem;  /* 15px: secondary text */
  --fsBody:       1rem;       /* 16px: reading text */
  --fsEmphasis:   1.125rem;   /* 18px: names, emphasis */
  --fsTitle:      1.25rem;    /* 20px: page and modal titles */
  --fsCardHeader: var(--fsMeta); /* 15px: every card header (title, number, admin) */

  /* --- Font width (Roboto wdth axis). Narrow only on phones (phone query in
     section 8). Use with font-stretch on text 15px or larger only; 13px
     text always stays at --fontWidthNormal. --- */
  --fontWidthNormal:  100%;
  --fontWidthTight:   100%;
  --fontWidthTighter: 100%;

  /* --- Brand colors --- */
  --brandPrimary: #07432A;
  --brandSecondary: #3F7652;
  --brandTertiary: #073B4C;       /* Event-context navy — card/panel/chrome headers */
  --brandTertiaryText: #ffffff;   /* White text on navy — same as brandSecondaryText */
  --brandQuaternary: #262339;     /* Player-context burgundy — chosen at 19.5deg hue,*/
  --brandQuaternaryText: #ffffff;
  
  --brandColor3: #0066CC;
  --brandAccent: #0b5fff; /* 24a0ed or #0b5fff or 0066CC */
  --brandPrimaryText: #ffffff;
  /* Solid white by decision (2026-11-03): dimmed header text was hard to
     read. Kept only because one page rule still references it
     (event_maintenance.css). */
  --brandPrimaryTextMuted: var(--brandPrimaryText);
  --brandSecondaryText: #ffffff;
  --danger: #c62828;
  --warn: #f6d365;
  --success: #0aa45c;
  /* Light success tint — one shared green for "good / counts / won"
     highlights: .maPill--success, leader rows, a match's winning side,
     counted-score cells. */
  --successTintBg: color-mix(in srgb, var(--success) 14%, var(--cardBg));
  --successTintBorder: color-mix(in srgb, var(--success) 35%, var(--border));
  /* Warn / danger tints — same structure as success, for .maPill--warn/--danger. */
  --warnTintBg:       color-mix(in srgb, var(--warn) 22%, var(--cardBg));
  --warnTintBorder:   color-mix(in srgb, var(--warn) 60%, var(--border));
  --dangerTintBg:     color-mix(in srgb, var(--danger) 8%, var(--cardBg));
  --dangerTintBorder: color-mix(in srgb, var(--danger) 28%, var(--border));

  /* --- Portal color layers (L0 chrome / L1 panel hdr / L2 outer card+modal /
     L3 inner card) — Games portal is the default ramp. Each level is a
     derived white-mix of the portal's own base color, not a hand-picked
     value, so levels can never collide or go undefined. See
     .is-event-context below for the Events-portal override of the same
     four tokens. Percentages are tunable; 75/35/15 is the current pick. */
  --layer0-bg: var(--brandPrimary);
  --layer1-bg: color-mix(in srgb, var(--brandPrimary) 75%, white);
  --layer2-bg: color-mix(in srgb, var(--brandPrimary) 35%, white);
  --layer3-bg: color-mix(in srgb, var(--brandPrimary) 15%, white);
  --layer0-text: var(--brandPrimaryText);
  --layer1-text: var(--brandPrimaryText);
  --layer2-text: var(--ink);
  --layer3-text: var(--ink);

  /* --- Surfaces --- */
  --brandPrimaryBg: rgba(7,67,42,.08);
  --brandSecondaryBg: #ffffff;
  --surfaceApp: #f7f7f7;
  --surfaceChrome: #ffffff;

  /* Common ink/surface aliases (so components don't hardcode colors) */
  --bg: var(--surfaceChrome);
  --surface: var(--surfaceChrome);
  --ink: #111111;
  --mutedText: #3a3a3a;
  --border: var(--borderSubtle);

  /* --- Borders & shadows --- */
  --borderSubtle: rgba(0,0,0,.12);
  --shadowSubtle: 0 1px 0 rgba(0,0,0,.06);

  /* --- Spacing --- */
  --spaceSm: 6px;
  --spaceMd: 10px;

  /* --- Interaction --- */
  --pressedBg: rgba(0,0,0,.06);

  /* --- Radii --- */
  --controlRadius: 14px;
  --radiusMd: 10px;
  --radiusSq: 6px;
  --radiusLg: 12px;

  /* --- Controls --- */
  --controlBorder: var(--borderSubtle);

  /* --- Chrome Header --- */
  --chromePad: 10px;
  --chromeGap: 10px;
  --chromeHdrBg: #18422F;
  --chromeHdrBtnBg: #FFFFFF;
  --chromeHdrBtnText: var(--brandPrimary);
  --chromeHdrBtnBorder: rgba(0,0,0,.22);
  --chromeBg: var(--surfaceChrome);
  --chromeBorder: var(--borderSubtle);
  --chromeShadow: var(--shadowSubtle);
  --chromeTitleText: #FFFFFF;
  --chromeSubtitleText: rgba(255,255,255,.82);
  --chromeTitleSize: 18px;
  --chromeSubtitleSize: 12px;
  --modalTitleSize: 16px;
  --modalSubTitleSize: 14px;
  /* --- ListLines, list group headings, Actions menu: one size system (17A) --- */
  --listGroupSize:     var(--fsMeta);  /* 15px: list group headings, menu categories */
  --listItemSize:      var(--fsBody);  /* 16px: ListLine text, menu items */
  --listFixedColWidth: 4.5rem;         /* 72px at default text size: fixed ListLine columns */

  /* --- Chrome Status Line --- */
  --chromeStatusHeight: 24px;
  --chromeStatusPadY: 2px;
  --chromeStatusFontSize: 13px;
  --statusInfoBg: #ffffff;
  --statusInfoText: #1f2a37;
  --statusSuccessBg: var(--success);
  --statusSuccessText: #ffffff;
  --statusWarnBg: var(--warn);
  --statusWarnText: #111111;
  --statusDangerBg: var(--danger);
  --statusDangerText: #ffffff;

  /* --- Bottom Nav (icon bar) --- */
  /* Desktop icon nav bar (.maNavBtn family) */
  --navBarHeight: 66px;
  --navBarBg: #ffffff;
  --navBarText: #4b5563;
  --navBarTextSelected: var(--ink);
  --navBarFontSize: 15px;
  --navBarIconBox: 34px;
  --navBarIconSize: 24px;

  /* Mobile hub tray rows (.maHubRow family) */
  --hubRowBg: #f5f5f0;
  --hubRowText: var(--ink);
  --hubRowSelectedBg: color-mix(in srgb, var(--brandPrimary) 14%, white);
  --hubRowRootBg: var(--brandPrimary);
  --hubRowRootText: var(--brandPrimaryText);
  --hubRowFontSize: 20px;
  --hubRowIconSize: 18px;
  --hubRowIndent: 20px;
  --hubHeaderBg: var(--brandAccent);   /* one-off blue — matches the Navigate button that opens this tray */
  --hubHeaderText: var(--brandPrimaryText);

  /* --- Buttons --- */
  --btnHeight: 34px;
  --btnPadX: 12px;
  --btnRadius: var(--controlRadius);
  --btnBorder: var(--controlBorder);
  --btnFontSize: var(--fsMeta);  /* 15px: every button label */
  --btnFontWeight: var(--fwExtrabold);
  --btnBg: var(--bg);
  --btnText: var(--ink);
  --btnPrimaryBg: var(--bg);
  --btnPrimaryText: var(--ink);
  --btnPrimaryBorder: var(--btnBorder);
  --btnSecondaryBg: var(--brandColor3);
  --btnSecondaryText: var(--brandPrimaryText);
  --btnSecondaryBorder: var(--btnSecondaryText);  /* white outline, matches the label; separates the blue from coloured headers */
  --btnLinkText: var(--brandAccent);
  --btnHoverBg: rgba(0,0,0,.04);
  --btnPressedBg: var(--pressedBg);

  /* --- Footer action bar (Save / Cancel) --- */
  --btnCancelBg: #e5e7eb;
  --btnCancelText: var(--ink);
  --btnCancelBorder: rgba(0, 0, 0, .18);
  --btnSaveBg: var(--brandAccent);
  --btnSaveText: #ffffff;
  --btnSaveBorder: color-mix(in srgb, var(--brandAccent) 70%, black);
  --ftrActionsPad: 10px;
  --ftrActionsGap: 10px;
  --ftrActionsBtnH: 44px;
  --ftrActionsBtnW: 200px;

  /* --- Pills / Chips --- */
  --pillRadius: 12px;
  --pillPadX: 10px;
  --pillPadY: 6px;
  --pillBg: rgba(0,0,0,.06);
  --pillText: var(--ink);
  --pillLabelText: var(--mutedText);
  /* Pill text is 14px — pill-only, off the type scale on purpose (owner
     2026-11-04): 15px+ for content, but 15px pills grow too wide for the
     rows they share (headline tiles, game card top line). */
  --pillLabelSize: 0.875rem;
  --pillValueSize: 0.875rem;
  --pillValueWeight: var(--fwBlack);
  --pillMinHeight: 34px;
  --pillTitleSize: 0.875rem;  /* 14px: choice chip text — the pill size (owner 2026-11-04) */

  /* Choice chips */
  --choiceChipRadius: 12px;
  --choiceChipBorder: var(--controlBorder);
  --choiceChipBg: var(--surface);
  --choiceChipText: var(--ink);
  --choiceChipSelectedBg: var(--segmentSelectedBg);
  --choiceChipSelectedText: var(--segmentSelectedText);
  --choiceChipSelectedBorder: color-mix(in srgb, var(--segmentSelectedBg) 55%, black);

  /* Segmented controls */
  --chipHeight: 34px;
  --chipLabelSize: 12px;
  --chipLabelWeight: var(--fwExtrabold);
  --segmentSelectedBg: #C9B99A; /* #F1D7B7; */
  --segmentSelectedText: var(--ink);
  --segRadius: var(--controlRadius);
  --segBorder: var(--controlBorder);
  --segBg: var(--surface);
  --segBtnHeight: var(--chipHeight);
  --segBtnFontSize: var(--fsMeta);  /* 15px */
  --segBtnWeight: var(--fwExtrabold);
  --segBtnText: var(--mutedText);
  --segActiveBg: var(--segmentSelectedBg);
  --segActiveText: var(--segmentSelectedText);

  /* --- Overlays & Modals --- */
  --overlayBg: rgba(0,0,0,.35);
  --overlayZ: 99990;
  --overlayBgDim: var(--overlayBg);
  --overlayBlur: 2px;
  --modalSurface: var(--surfaceChrome);
  --modalMaxW: 720px;        /* wide is the rule; .maModal--compact keeps 520px */
  --modalMaxH: 96dvh;
  --modalViewportGap: 16px;
  --modalRadius: 18px;
  --modalShadow: 0 14px 34px rgba(0,0,0,.18);
  --modalHeaderBg: var(--layer1-bg);
  --modalHeaderText: var(--layer1-text);
  --drawerRadius: var(--controlRadius);
  --drawerMaxW: 720px;
  --drawerTopRadius: 18px;
  --drawerMaxH: var(--modalMaxH);

  /* --- Panels --- */
  --panelGap: 8px;
  --panelPad: 8px;
  --panelBg: var(--bg);
  --panelBorder: var(--border);
  --panelRadius: 14px;
  --panelShadow: 0 1px 0 rgba(0,0,0,.02);
  --panelHdrBg: var(--panelBg);
  --panelHdrText: var(--ink);
  --panelHdrBorder: var(--panelBorder);
  --panelControlsBg: color-mix(in srgb, var(--panelBg) 96%, black);
  --panelControlsBorder: var(--panelBorder);
  --panelFtrBg: var(--panelBg);
  --panelFtrBorder: var(--panelBorder);

  /* --- Cards --- */
  --cardBg: var(--panelBg);
  --cardBorder: var(--panelBorder);
  --cardRadius: var(--panelRadius);
  --cardShadow: var(--panelShadow);
  --cardsGap: 6px;
  --cardPad: 8px;
  --cardHdrPadY: 8px;
  --cardHdrPadX: 10px;
  --cardHdrBg: var(--cardBg);
  --cardHdrText: var(--ink);
  --cardHdrBorder: var(--cardBorder);
  --cardTitleSize: 13px;
  --cardActionSize: 34px;
  --cardActionRadius: 10px;
  --cardActionBg: transparent;
  --cardActionHoverBg: rgba(0,0,0,.04);
  --cardActionPressedBg: var(--pressedBg);
  --cardActionText: var(--btnLinkText);
  --cardActionGap: 6px;

  /* --- Page control area --- */
  --ControlAreaBg: color-mix(in srgb, var(--panelBg) 88%, black);
  --ControlAreaBorder: rgba(0,0,0,0.18);

  /* --- Misc typography tokens --- */
  --fieldValueSize: 13px;
  --fieldValueSublineSize: 12px;

  /* --- Date badge --- */
  --datebadgeTopBg: #E6D39A;
  --datebadgeTopText: #111111;

  /* --- List Row States --- */
  --rowBgDefault:        #ffffff;
  /* Selected = blue (the action colour, matches the blue checkbox) —
     owner 2026-11-05. Built from --brandAccent so it stays clearly
     brighter than the event-context navy bands. Scorecard declared cells
     keep the old green on their own token. */
  --rowBgSelected:       color-mix(in srgb, var(--brandAccent) 12%, white);
  --cellBgDeclared:      rgba(7,67,42,.16);
  --rowBgEnrolled:       #ebebeb;
  --rowPinnedDivider:    rgba(0,0,0,.12);

  /* --- Avatar Colors --- */
  --avatarMaleBg:        #BDD7EE;
  --avatarFemaleBg:      #F4C6D0;
  --avatarUnknownBg:     #E0E0E0;
  --avatarText:          #111111;
  --avatarBorder:        #ffffff;
}


/* ==========================================================================
   2. BASE / RESET
   ========================================================================== */

html, body {
  font-family: var(--fontFamilyBase);
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--surfaceApp);
  overflow-x: hidden;
}

/* Buttons don't inherit the page font by default (browsers draw them in the
   system font). Family only — each button keeps its own size and weight. */
button {
  font-family: inherit;
}

/* Fix for iOS zoom on focus — inputs must be at least 16px */
input,
select,
textarea {
  font-size: var(--inputTextSize, 16px) !important;
}


/* ==========================================================================
   3. APP SHELL LAYOUT
   ========================================================================== */

.maPage {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--spaceMd);
  display: block;
  flex-direction: column;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.maPage--multi {
  padding: var(--spaceMd);
}

/* Control area — sits above <main class="maPage">, outside it. 10px above
   (from the header) and none below: the page's own 10px top padding is the
   gap underneath, so every page reads header → 10px → (control area →
   10px →) content, whether or not it has a control area. */
.maControlArea {
  flex: 0 0 auto;
  padding: var(--spaceMd);
  margin: var(--spaceMd) var(--spaceMd) 0 var(--spaceMd);
  background: var(--ControlAreaBg);
  border: 1px solid var(--ControlAreaBorder);
  border-radius: var(--radiusLg);
}

/* Bare modifier — same flex/positioning role as .maControlArea (pinned
   above .maPage) without the bordered "panel" look, for pages like
   score_gis where every pixel of vertical space matters and a single
   hole-nav row doesn't need its own boxed chrome the way score_entry's
   busier control area (with its Scores/Side Games tabs) does. */
.maControlArea--bare {
  padding: 6px 0 0 0;
  margin: 0 var(--spaceMd) 6px var(--spaceMd);
  background: transparent;
  border: none;
}

/* Hole nav (pinned in .maControlArea) — shared by score_entry and score_gis. */
.scoreHoleNavInner{
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(72px, 1fr) minmax(72px, 96px) minmax(72px, 1fr);
  justify-content: center;
  gap: 8px;
  align-items: center;
  min-width: 0;
  box-sizing: border-box;
}

.scoreHoleNavInner > .btn{
  width: 100%;
  min-width: 0;
  min-height: 46px;
  height: 46px;
  padding-left: 8px;
  padding-right: 8px;
  box-sizing: border-box;
}

.scoreHoleSelect{
  width: 100%;
  min-width: 0;
  max-width: 96px;
  min-height: 46px;
  height: 46px;
  padding-left: 8px;
  padding-right: 24px;
  text-align: center;
  text-align-last: center;
  justify-self: center;
  font-size: clamp(22px, 7vw, 32px) !important;
  font-weight: var(--fwBlack);
  box-sizing: border-box;
}

@media (max-width: 768px){
  .scoreHoleNavInner{
    max-width: 100%;
    grid-template-columns: minmax(58px, 1fr) minmax(64px, 106px) minmax(58px, 1fr);
    gap: 8px;
  }

  .scoreHoleSelect{
    max-width: 106px;
    min-height: 48px;
    height: 48px;
    padding-left: 8px;
    padding-right: 22px;
    font-size: clamp(22px, 7vw, 32px) !important;
  }

  .scoreHoleNavInner > .btn{
    min-height: 48px;
    height: 48px;
  }
}

/* Prevent underlying page scroll when an overlay is open */
.maOverlayOpen .maPage {
  overflow: hidden;
}

.maOverlayOpen body {
  width: 100vw;
  overflow-x: hidden;
  position: relative;
}


/* ==========================================================================
   4. CHROME — HEADER
   ========================================================================== */

.maChrome__hdr {
  background: var(--chromeHdrBg);
  border-bottom: 1px solid var(--chromeBorder);
  box-shadow: var(--chromeShadow);
  padding: var(--chromePad);
}

/* ── Event context — navy chrome + panel/card headers ────────────────────
   Applied on <html> (document.documentElement) by chromeHeader.php's
   inline script — a real DOM ancestor of everything, including modals
   appended straight to <body> — not just on <header>, so CSS variable
   inheritance actually reaches every descendant. (The class also still
   gets stamped on <header> itself below, for its own direct styling.)
   Cascades to any element referencing the --layerN-* tokens: panels,
   cards, and modals alike, with no per-page CSS needed. Same white-mix
   formula as the Games default ramp, just anchored to brandTertiary. */
.is-event-context {
  --layer0-bg: var(--brandTertiary);
  --layer1-bg: color-mix(in srgb, var(--brandTertiary) 75%, white);
  --layer2-bg: color-mix(in srgb, var(--brandTertiary) 35%, white);
  --layer3-bg: color-mix(in srgb, var(--brandTertiary) 15%, white);
  --layer0-text: var(--brandTertiaryText);
  --layer1-text: var(--brandTertiaryText);
  --layer2-text: var(--ink);
  --layer3-text: var(--ink);
}

.maChrome__hdr.is-event-context {
  background: var(--brandTertiary);
}

/* Player context — burgundy chrome + panel/card headers. Applied on
   <html> by chromeHeader.php, driven by $_SESSION['SessionPortal'] ===
   'PLAYER PORTAL' (set unconditionally by playerhome.php), mirroring the
   is-event-context mechanism above exactly.

   Uses html.is-player-context / header.maChrome__hdr.is-player-context
   (element + class, not just class) rather than matching is-event-context's
   bare-class specificity — deliberately, so Player always wins if a page
   ever carries both classes at once (a player viewing a game that belongs
   to an event). This mirrors the priority already established in
   game_players.js / game_summary.js's setBottomNav logic, where isPlayer
   is checked before isEvent. Determinism here doesn't depend on which
   block happens to be declared later in this file. */
html.is-player-context {
  --layer0-bg: var(--brandQuaternary);
  --layer1-bg: color-mix(in srgb, var(--brandQuaternary) 75%, white);
  --layer2-bg: color-mix(in srgb, var(--brandQuaternary) 35%, white);
  --layer3-bg: color-mix(in srgb, var(--brandQuaternary) 15%, white);
  --layer0-text: var(--brandQuaternaryText);
  --layer1-text: var(--brandQuaternaryText);
  --layer2-text: var(--ink);
  --layer3-text: var(--ink);
}

header.maChrome__hdr.is-player-context {
  background: var(--brandQuaternary);
}

/* NOTE: the old ".is-event-context ~ main .maPanel__hdr, .maCard__hdr"
   sibling-combinator rule that lived here has been removed. It predated
   the base .maPanel__hdr / .maCard__hdr rules becoming token-aware
   (they now reference --layer1-bg / --layer2-bg directly and inherit
   correctly from either .is-event-context or .is-player-context on
   <html> with no extra rule needed) — and it had crept out of sync with
   that fix: at (0,2,1) specificity it was beating the base .maCard__hdr
   rule's (0,1,0) and forcing card headers to the L1 value even where L2
   was correct, on any real event-context page. Found and removed while
   adding Player context, not something the Player work itself caused. */

.maChrome__hdrRow {
  display: flex;
  align-items: center;
  gap: var(--chromeGap);
}

.maChrome__hdrLeft,
.maChrome__hdrRight {
  display: flex;
  align-items: center;
  justify-content: center;
}

.maChrome__hdrBtn {
  height: 34px;
  min-width: 72px;
  padding: 0 10px;
  border-radius: var(--radiusMd);
  background: var(--chromeHdrBtnBg);
  color: var(--chromeHdrBtnText);
  border: 1px solid var(--chromeHdrBtnBorder);
  font-family: var(--fontFamilyBase);
  font-weight: var(--fwBold);
  font-size: var(--btnFontSize);
  cursor: pointer;
  user-select: none;
}

.maChrome__hdrBtn:active {
  transform: scale(.98);
}

.maChrome__brand {
  width: 48px;
  height: 48px;
  border-radius: var(--radiusMd);
  background: var(--brandPrimaryBg);
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.maChrome__brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.maChrome__titles {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}

.maChrome__title {
  font-family: var(--fontFamilyBase);
  font-weight: var(--fwBold);
  color: var(--chromeTitleText);
  font-size: var(--chromeTitleSize);
  line-height: 1.2;
}

.maChrome__subtitle {
  font-family: var(--fontFamilyBase);
  color: var(--chromeSubtitleText);
  font-size: var(--chromeSubtitleSize);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3rd header line (matches subtitle feel) */
.maChrome__subtitle2 {
  font-family: var(--fontFamilyBase);
  color: var(--chromeSubtitleText);
  font-size: var(--chromeSubtitleSize);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: .9;
}


/* ==========================================================================
   5. CHROME — FOOTER SHELL & STATUS LINE
   ========================================================================== */

.maChrome__ftr {
  background: var(--chromeBg);
  border-top: 1px solid var(--chromeBorder);
  padding-bottom: 8px;
}

.maChrome__status {
  font-family: var(--fontFamilyBase);
  min-height: var(--chromeStatusHeight, 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--chromeStatusPadY, 2px) var(--spaceMd);
  font-size: var(--chromeStatusFontSize);
  line-height: 1.15;
  text-align: center;
  border-bottom: 1px solid var(--chromeBorder);
  user-select: none;
}

/* No message → no space. Collapses to zero height instead of display:none
   so the aria-live region stays in the accessibility tree and screen
   readers still announce the next message. */
.maChrome__status:empty {
  min-height: 0;
  padding-block: 0;
  border-bottom: 0;
}

/* Status variants (driven by MA.setStatus → status-* classes) */
.maChrome__status.status-info {
  background: var(--statusInfoBg, #e9eef5);
  color: var(--statusInfoText, #1f2a37);
}

.maChrome__status.status-success {
  background: var(--statusSuccessBg, #e7f7ee);
  color: var(--statusSuccessText, #0f5132);
}

.maChrome__status.status-warn {
  background: var(--statusWarnBg, #fff7db);
  color: var(--statusWarnText, #664d03);
}

.maChrome__status.status-danger {
  background: var(--statusDangerBg, #fde7ea);
  color: var(--statusDangerText, #842029);
}


/* ==========================================================================
   6. CHROME — BOTTOM NAV (DESKTOP ICON BAR)
   ========================================================================== */

.maChrome__bottomNav {
  height: var(--navBarHeight);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--navBarBg);
}

/* Each nav button: icon stacked over label.
   Normal/Selected both carry a 1px border so neither state shifts the
   button's box size relative to the other — see .is-selected below,
   which uses outline (not border) for the same reason. */
.maNavBtn {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  margin: 0;
  border: 1px solid #c4c4c0;
  background: #f0f0ee;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  color: var(--navBarText);
}

.maNavIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--navBarIconBox);
  height: var(--navBarIconBox);
  font-size: var(--navBarIconSize);
  line-height: 1;
}

/* img/svg icons hardcode their own width/height attributes in markup —
   this overrides them so every icon type obeys one token regardless of
   how it's marked up. */
.maNavIcon img,
.maNavIcon svg {
  width: var(--navBarIconSize);
  height: var(--navBarIconSize);
}

.maNavLabel {
  font-size: var(--navBarFontSize);
  line-height: 1.1;
  letter-spacing: .2px;
  white-space: nowrap;
}

.maNavBtn:active {
  transform: scale(.98);
  background: rgba(0,0,0,.06);
}

.maNavBtn:disabled {
  transform: none;
  cursor: default;
}

/* The current page's button is always disabled too (you can't navigate to
   where you already are), but it must NOT dim like a genuinely-unavailable
   button — that would wash out the is-selected tint/outline meant to make
   it stand out. Opacity only applies to disabled buttons that aren't also
   the selected one. */
.maNavBtn:disabled:not(.is-selected) {
  opacity: .55;
}

/* Selected: current page. Outline (not border) so the box size never
   changes between Normal and Selected. Text/icon stay ink, not green —
   green is reserved for the outline + chevron accent, keeping text at
   full contrast for daylight readability (matches the mobile treatment). */
.maNavBtn.is-selected {
  background: color-mix(in srgb, var(--brandPrimary) 12%, white);
  color: var(--navBarTextSelected);
  border-color: transparent;
  outline: 1.5px solid var(--brandPrimary);
  outline-offset: -1.5px;
}

/* Inset chevron — a second, shape-based "you are here" signal alongside
   the tint/outline, sitting just inside the outline rather than breaking
   through it (buttons sit edge-to-edge with no gap, so a chevron poking
   past the edge would land on the neighboring button). */
.maNavBtn.is-selected::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 10px;
  bottom: 10px;
  width: 11px;
  background: var(--brandPrimary);
  clip-path: polygon(0 0, 45% 0, 100% 50%, 45% 100%, 0 100%);
}

/* Root: this button exits the current object/page entirely (set per-page
   via MA.chrome.setBottomNav({ root: [...] }) — see ma_shared.js).
   Solid fill is the strongest step in the same brandPrimary ramp Selected
   uses, so Normal -> Selected -> Root reads as one continuous signal.
   Light border (not brandPrimary) so adjacent roots — e.g. Player Home +
   Score Home — show a seam instead of merging into one dark block. */
.maNavBtn--root {
  background: var(--brandPrimary);
  border-color: rgba(255,255,255,.5);
  color: var(--brandPrimaryText);
}

.maNavBtn--root .maNavLabel {
  color: var(--brandPrimaryText);
}

/* Root + Selected (rare — e.g. standing on the page a root button points
   to). Restates fill/border because .maNavBtn.is-selected out-specifies
   .maNavBtn--root. The light border already sits on the edge, so the
   outline is inset further to read as a distinct ring, and the chevron
   flips to white so it shows against the dark fill. */
.maNavBtn--root.is-selected {
  background: var(--brandPrimary);
  border-color: rgba(255,255,255,.5);
  outline: 1.5px solid rgba(255,255,255,.85);
  outline-offset: -4px;
}

.maNavBtn--root.is-selected::before {
  background: var(--brandPrimaryText);
}

/* Divider marking a scope change among the currently-visible buttons —
   toggled in JS based on the page-supplied root set, not a fixed markup
   attribute (root is page-relative, see ma_shared.js setBottomNav). */
.maNavBtn--scope-start {
  border-left: 2px solid var(--borderSubtle);
  margin-left: 4px;
}

/* Compact mode: 1–2 visible items centered */
.maChrome__bottomNav.is-compact {
  justify-content: center;
  gap: 18px;
}

.maChrome__bottomNav.is-compact .maNavBtn {
  flex: 0 0 auto;
  min-width: 140px;
}


/* ==========================================================================
   7. CHROME — FOOTER ACTION BAR (SAVE / CANCEL)
   ========================================================================== */

/* Optional page action slot — hidden by default, shown by MA.chrome.setActions */
.maChrome__pageAction {
  padding: 8px 10px;
  border-bottom: 1px solid var(--chromeBorder);
  display: flex;
  justify-content: center;
  background: var(--chromeBg);
}

.maChrome__pageActionBtn {
  width: 100%;
  padding: 11px 14px;
  background: transparent;
  border: 1.5px dashed var(--brandPrimary);
  border-radius: var(--controlRadius);
  color: var(--mutedText);
  font-family: var(--fontFamilyBase);
  font-size: 13px;
  font-weight: var(--fwExtrabold);
  cursor: pointer;
  text-align: center;
  letter-spacing: .2px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.maChrome__pageActionBtn:active {
  background: var(--pressedBg);
  transform: scale(.99);
}

@media (min-width: 600px) {
  .maChrome__pageActionBtn {
    width: 280px;
  }
}

/* Footer action bar shell */
.maChrome__ftrActions {
  display: none;              /* hidden until footer--actions mode active */
  align-items: center;
  padding: var(--ftrActionsPad, 10px);
  gap: var(--ftrActionsGap, 10px);
  background: var(--chromeBg);
  flex-direction: row;
  justify-content: stretch;
}

/* Footer in actions mode: show bar, hide nav */
.maChrome__ftr--actions .maChrome__ftrActions {
  display: flex;
}

.maChrome__ftr--actions .maChrome__bottomNav {
  display: none;
}

/* Shared footer button base */
.maFtrBtn {
  flex: 1 1 0;
  min-height: var(--ftrActionsBtnH, 44px);
  border-radius: var(--controlRadius);
  font-family: var(--fontFamilyBase);
  font-size: 15px;
  font-weight: var(--fwExtrabold);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: filter .15s ease, transform .1s ease;
  white-space: nowrap;
}

.maFtrBtn:active {
  transform: scale(.98);
  filter: brightness(.96);
}

.maFtrBtn:disabled,
.maFtrBtn.is-disabled {
  opacity: .50;
  cursor: default;
  transform: none;
  filter: none;
}

.maFtrBtn--save {
  background: var(--btnSaveBg, var(--brandAccent));
  color: var(--btnSaveText, #ffffff);
  border-color: var(--btnSaveBorder, color-mix(in srgb, var(--brandAccent) 70%, black));
}

.maFtrBtn--cancel {
  background: var(--btnCancelBg, #e5e7eb);
  color: var(--btnCancelText, var(--ink));
  border-color: var(--btnCancelBorder, rgba(0, 0, 0, .18));
}

/* Tablet + desktop (≥600px): right-justified, fixed width */
@media (min-width: 600px) {
  .maChrome__ftrActions {
    justify-content: flex-end;
  }

  .maFtrBtn {
    flex: 0 0 var(--ftrActionsBtnW, 200px);
  }
}


/* ==========================================================================
   8. CHROME — MOBILE NAV HUB (NAVIGATE BUTTON + TRAY)
   Controls:
     - Navigate button  (.maChrome__navHub)
     - Hub tray overlay (.maChrome__hubTray)
   On mobile (≤600px) the icon bar is hidden and the Navigate button takes
   its place in the footer. Tapping it slides up the hub tray, which is
   populated by MA.chrome.setBottomNav() at page boot.
   The Save/Cancel overlay hides both the icon bar and Navigate button via
   the existing .maChrome__ftr--actions class toggle.
   ========================================================================== */

/* Navigate button container — hidden by default (desktop).
   Sits inside .maChrome__bottomNav as a flex child, so it stretches
   to fill the full nav width and height on mobile. */
.maChrome__navHub {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 12px;
  flex: 1 1 auto;      /* fill the nav's full width */
  align-self: stretch; /* fill the nav's full height */
}

/* Navigate sits between the A− / A+ page-size buttons: a fixed 160px in
   the middle (it was 75% of the footer on its own), so the three buttons
   form a centred group with clear space to the screen edges. */
.maChrome__navHubBtn {
  display: flex;
  align-items: center;
  flex: 0 0 160px;
  justify-content: center;
  gap: 8px;
  background: var(--brandAccent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  min-height: 44px;
  padding: 0 16px;
  font-weight: var(--fwMedium);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}

.maChrome__navHubBtn:active {
  opacity: 0.85;
}

.maChrome__navHubIcon {
  font-size: 16px;
  line-height: 1;
}

.maChrome__navHubLabel {
  font-size: 16px;
  line-height: 1;
}

/* Page size A− / A+ — either side of Navigate (phones only: they live in
   .maChrome__navHub). 44px tap target; white with the standard button
   border so the blue Navigate stays the main action. A− is drawn smaller
   than A+. Disabled at the smallest / largest size. */
.maChrome__zoomBtn {
  flex: 0 0 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--btnBorder);
  border-radius: 10px;
  background: var(--btnBg);
  color: var(--ink);
  font-family: var(--fontFamilyBase);
  font-weight: var(--fwBlack);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.maChrome__navHub > .maChrome__zoomBtn:last-child { font-size: 20px; }
.maChrome__zoomBtn:active { background: var(--btnPressedBg); }
.maChrome__zoomBtn:disabled { opacity: .4; cursor: default; }

/* Hub tray overlay — always in DOM, toggled via [hidden] + .is-open */
.maChrome__hubTray {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
}

/* [hidden] keeps it out of the accessibility tree.
   JS removes [hidden] before animating open so transitions fire. */
.maChrome__hubTray[hidden] {
  display: none;
}

.maChrome__hubTray.is-open {
  pointer-events: all;
}

/* Backdrop */
.maChrome__hubBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.25s ease;
  cursor: pointer;
}

.maChrome__hubTray.is-open .maChrome__hubBackdrop {
  background: rgba(0, 0, 0, 0.50);
}

/* Sheet */
.maChrome__hubSheet {
  position: relative;
  background: #fff;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.maChrome__hubTray.is-open .maChrome__hubSheet {
  transform: translateY(0);
}

/* Drag handle */
.maChrome__hubHandle {
  width: 36px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 10px auto 6px;
  flex-shrink: 0;
}

/* Header row */
.maChrome__hubHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--hubHeaderBg);
  border-radius: 16px 16px 0 0;
  flex-shrink: 0;
}

/* Same type as a popup title (.maModal__title). */
.maChrome__hubTitle {
  font-size: var(--modalTitleSize);
  font-weight: var(--fwBlack);
  letter-spacing: .2px;
  color: var(--hubHeaderText);
}

/* Scrollable row area */
.maChrome__hubScroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 10px 16px;
  flex: 1;
}

.maChrome__hubScroll::after {
  content: "";
  display: block;
  height: 8px;
}

/* Hub tray nav rows (injected by setBottomNav / _buildHubRows).
   Text and icon color stay black/high-contrast in every state — this app
   is used outdoors in daylight, so state is communicated through
   background tint, a left accent bar, and indentation, never through
   muted or light-colored text. */
.maHubRow {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: var(--hubRowBg);
  border: none;
  border-left: 3px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}

.maHubRow:active {
  background: #e8e8e0;
}

/* Indented child rows — only applied when this tray actually has a root
   row (guarded in JS so pages without a `root:` config render flush-left
   exactly as before, with no stray margin). */
.maHubRow--indented {
  width: calc(100% - var(--hubRowIndent));
  margin-left: var(--hubRowIndent);
}

.maHubRow__icon {
  font-size: var(--hubRowIconSize);
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  color: var(--hubRowText);
}

.maHubRow__label {
  font-size: var(--hubRowFontSize);
  font-weight: var(--fwMedium);
  color: var(--hubRowText);
  flex: 1;
}

.maHubRow__arrow {
  font-size: var(--hubRowIconSize);
  color: var(--hubRowText);
  flex-shrink: 0;
}

/* Selected: current page. Background tint + left accent bar carry the
   signal, since text/icon color can't (daylight constraint above). */
.maHubRow.is-selected {
  background: var(--hubRowSelectedBg);
  border-left-color: var(--brandPrimary);
}

/* Root: this row exits the current object entirely (page-supplied via
   root:, same as desktop — see ma_shared.js). Full-contrast white on a
   solid fill, so the daylight constraint doesn't require any change here. */
.maHubRow--root {
  background: var(--hubRowRootBg);
  border-left-color: transparent;
}

.maHubRow--root .maHubRow__icon,
.maHubRow--root .maHubRow__label,
.maHubRow--root .maHubRow__arrow {
  color: var(--hubRowRootText);
}

/* Root + Selected (rare) — light outline distinguishes it from plain
   Root, since a dark accent bar would vanish against the dark fill. */
.maHubRow--root.is-selected {
  outline: 1px solid rgba(255,255,255,.6);
  outline-offset: -1px;
}

/* Section divider between root and object-scoped rows */
.maHubDivider {
  border: none;
  border-top: 0.5px solid #eee;
  margin: 4px 0;
}

/* --- Media queries: visibility swap --- */

/* Mobile (≤600px): hide icon nav buttons, show Navigate button.
   The nav element itself stays as display:flex — only its icon button
   children are hidden. The navHub div fills the remaining space. */
@media (max-width: 600px) {
  .maChrome__bottomNav .maNavBtn {
    display: none !important;
  }

  .maChrome__navHub {
    display: flex;
  }
}

/* Desktop (≥601px): hide Navigate button; belt-and-suspenders hide tray */
@media (min-width: 601px) {
  .maChrome__navHub {
    display: none;
  }

  .maChrome__hubTray {
    display: none !important;
  }
}

/* Save/Cancel overlay hides the entire nav (including Navigate button
   inside it) via the rule in section 7 above. No extra rule needed here. */

/* Landscape-short phones ("peek" mode) -------------------------------------
   A landscape phone is WIDE but SHORT, so the width-only breakpoints above
   don't catch it — e.g. an iPhone in landscape comfortably exceeds 600px/
   820px width while still being only ~380-430px tall, so it falls into the
   "desktop" bucket above: full icon row instead of the compact Navigate
   button, and the hub tray force-hidden by that same desktop rule.

   Landscape on a phone is treated as a brief "peek" at content, not a place
   to take action — so this also hides the chrome header outright (including
   any page action buttons sitting in chromeBtnLeft/chromeBtnRight), on the
   theory that a user who wants to act just rotates back to portrait, where
   both the header and the normal nav re-appear automatically (pure media
   query, no JS/class involved, so it's reactive to live rotation).

   Unconditional and app-wide — no per-page opt-in/opt-out. If a page ever
   needs an exception (e.g. it can't afford to lose a header action while
   rotated), that's a deliberate follow-up, not a default to design around
   now. Placed after the width-based rules above so it wins the cascade
   whenever it matches, regardless of actual width. */
@media (orientation: landscape) and (max-height: 500px) {
  .maChrome__hdr {
    display: none;
  }

  .maChrome__bottomNav .maNavBtn {
    display: none !important;
  }

  .maChrome__navHub {
    display: flex !important;
  }

  /* Restates the hub tray's own two rules (base flex / [hidden]->none) so
     it works normally again here, overriding the desktop rule's blanket
     "display:none !important" above rather than forcing it always-open. */
  .maChrome__hubTray {
    display: flex !important;
  }

  .maChrome__hubTray[hidden] {
    display: none !important;
  }
}

/* Phone footer trim (portrait or landscape phone — same two conditions as
   above). The 66px bar is sized for the desktop icon+label buttons; on a
   phone it only holds the 44px Navigate button, so tighten the bar to 4px
   above/below the button and halve the footer's bottom padding. The
   button itself keeps its 44px tap height; safe-area padding untouched. */
@media (max-width: 600px), (orientation: landscape) and (max-height: 500px) {
  :root {
    --navBarHeight: 52px;
    /* Condensed Roboto on phones only (see --fontWidth* in :root). */
    --fontWidthTight:   85%;
    --fontWidthTighter: 78%;
  }

  /* L1 top border sets the footer apart from the page on a phone; follows
     the context ramp (games / events / player) like the headers. */
  .maChrome__ftr {
    padding-bottom: 4px;
    border-top-color: var(--layer1-bg);
  }
}

/* Phone / desktop visibility utilities — the same phone definition as the
   rules above: (max-width: 600px) OR a landscape phone (max-height: 500px).
   "Desktop" is its exact complement, written without the `not` keyword for
   older iOS: wider than 600px AND (portrait OR taller than 500px).
   Hide-only, so each element keeps its own display (block/grid/flex) where
   it shows. First use: Leaderboard rows (score_summary.js). */
@media (min-width: 601px) and (orientation: portrait),
       (min-width: 601px) and (min-height: 501px) {
  .maPhoneOnly { display: none !important; }
}
@media (max-width: 600px), (orientation: landscape) and (max-height: 500px) {
  .maDesktopOnly { display: none !important; }
}


/* ==========================================================================
   9. MULTI-PANEL LAYOUT
   
   CONTRACT: .maPanel__body is the ONLY scrollable region, at every
   breakpoint. hdr/controls/ftr are fixed. Every panel's scrollable
   content MUST be wrapped in .maPanel__body — do not apply overflow
   directly to .maPanel or any custom panel variant.

   Expected markup:
     <main class="maPage maPage--multi">
       <div class="maPanels maPanels--2"> (or --3 / --4)
         <section class="maPanel maPanel--primary">...</section>
         <section class="maPanel maPanel--secondary">...</section>
       </div>
     </main>
   ========================================================================== */

.maPanels {
  height: 100%;
  min-height: 0;
  display: grid;
  gap: var(--panelGap);
  grid-template-columns: 1fr; /* mobile default — stacked */
}

@media (min-width: 900px) {
  .maPanels--2 { grid-template-columns: 1fr 1fr; }
  .maPanels--3 { grid-template-columns: 1fr 1fr 1fr; }
  .maPanels--4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

/* Panel shell */
.maPanel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panelBg);
  border: 1px solid var(--panelBorder);
  border-radius: var(--panelRadius);
  box-shadow: var(--panelShadow);
  overflow: hidden;
}

/* Panel regions */
.maPanel__hdr {
  flex: 0 0 auto;
  background: var(--layer1-bg);
  color: var(--layer1-text);
  padding: var(--panelPad);
  border-bottom: 1px solid var(--panelHdrBorder);
}

.maPanel__controls {
  flex: 0 0 auto;
  background: var(--panelControlsBg);
  padding: 6px 8px; /*it was var(--panelPad); */
  border-bottom: 1px solid var(--panelControlsBorder);
}

.maPanel__controls .maFieldRow {
  margin-top: 4px;
  gap: 6px;
}

.maPanel__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: var(--panelPad);
  overscroll-behavior: contain;
}

.maPanel__ftr {
  flex: 0 0 auto;
  background: var(--panelFtrBg);
  padding: var(--panelPad);
  border-top: 1px solid var(--panelFtrBorder);
}

/* ---------- Phone side spacing (app standard, 2026-11-06) ---------------
   Phones claim width back: 4px page margin and 4px inside panels and the
   control area — LEFT/RIGHT ONLY. Top/bottom stay as above, so the
   header → 10px → control area → 10px → content rhythm is unchanged.
   Same phone conditions as the condensed-font block in :root's phone
   media query. Placed after the panel rules so it wins on order.
   Exceptions keep their own spacing: score_gis (.maPage.gisPage padding 0,
   .maControlArea--bare) and page-specific inner paddings. */
@media (max-width: 600px), (orientation: landscape) and (max-height: 500px) {
  .maPage {
    padding-left: 4px;
    padding-right: 4px;
  }
  .maControlArea:not(.maControlArea--bare) {
    padding-left: 4px;
    padding-right: 4px;
    margin-left: 4px;
    margin-right: 4px;
  }
  .maPanel__hdr,
  .maPanel__controls,
  .maPanel__body,
  .maPanel__ftr {
    padding-left: 4px;
    padding-right: 4px;
  }
}

/* ---------- Tray / canvas mobile swap ------------------------------------
   Consolidates a pattern that existed as four independent, near-identical
   copies (game_players.css, event_roster.css, game_pairings.css,
   game_slotting.css) before this. Below 900px, .maPanels--2 has already
   collapsed to one column (see .maPanels above) — this decides which of
   the two panels occupies it. .maPanel--secondary (the tray: unassigned
   players, add-player sources, etc.) starts hidden; .maPanel--primary
   (the canvas) is the default view.

   Not an overlay — no backdrop, no fixed positioning, no animation. Plain
   display swap. This is a deliberately different mechanism from
   .maChrome__hubTray (the mobile nav drawer, below) despite the shared
   "tray" name — that one slides up over a backdrop; this one just swaps
   which panel is visible in place. Don't conflate the two.

   .is-tray-open is a plain descendant selector with no required ancestor
   — it can be toggled on the page wrapper (as game_players/event_roster
   do), a tab wrapper (as game_pairings/game_slotting do, for independent
   per-tab tray state), or a modal (.maModal--panels), unmodified.

   Expected trigger markup:
     Inside .maPanel--primary's own .maPanel__ftr:
       <button class="maTrayOpenBtn" type="button">+ Add Players</button>
     Inside .maPanel--secondary's own .maPanel__hdr:
       <button class="maTrayCloseBtn iconBtn btnSecondary" type="button"
               aria-label="Close">×</button>
   JS toggles .is-tray-open on the shared ancestor; nothing else required.
   ------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .maPanels--2 .maPanel--secondary {
    display: none;
  }

  .is-tray-open .maPanels--2 .maPanel--secondary {
    display: flex;
    flex-direction: column;
  }

  .is-tray-open .maPanels--2 .maPanel--primary {
    display: none;
  }

  /* Controls belong to the canvas, not the tray — hide the modal-level
     controls strip (e.g. cascade mode toggle, Auto-Pair) while the tray
     is showing instead of the canvas. Retained on desktop regardless of
     .is-tray-open, since panels never swap there. */
  .is-tray-open .maModal__controls {
    display: none;
  }
}

.maTrayOpenBtn {
  display: none !important;
  width: 100%;
  min-height: var(--btnHeight);
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--brandPrimary);
  border-radius: var(--radiusMd);
  background: transparent;
  color: var(--brandPrimary);
  font-family: var(--fontFamilyBase);
  font-size: 14px;
  font-weight: var(--fwBlack);
  cursor: pointer;
}

.maTrayOpenBtn:active {
  transform: translateY(1px);
}

.maTrayCloseBtn {
  display: none !important;
}

@media (max-width: 900px) {
  .maTrayOpenBtn {
    display: inline-flex !important;
  }

  .maTrayCloseBtn {
    display: flex !important;
  }
}


/* ==========================================================================
   10. OVERLAY FAMILY — DRAWER + MODAL
   ========================================================================== */

/* ---------- Drawer (secondary panel on mobile) --------------------------- */
/*
   Expected markup:
     <div class="maDrawerOverlay is-open">
       <section class="maDrawer">
         <header class="maPanel__hdr">...</header>
         <div class="maPanel__controls">...</div>  (optional)
         <div class="maPanel__body">...</div>
         <footer class="maPanel__ftr">...</footer>
       </section>
     </div>
*/
.maDrawerOverlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
  background: var(--overlayBgDim);
  z-index: var(--overlayZ);
  backdrop-filter: blur(var(--overlayBlur));
}

.maDrawerOverlay.is-open { display: flex; }

.maDrawer {
  width: min(var(--drawerMaxW), 100%);
  max-height: var(--drawerMaxH);
  background: var(--panelBg);
  border: 1px solid var(--panelBorder);
  border-radius: var(--drawerTopRadius) var(--drawerTopRadius) 0 0;
  box-shadow: var(--modalShadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ---------- Modal (capture / edit / filters / settings) ------------------ */
/*
   Expected markup:
     <div class="maModalOverlay is-open">
       <section class="maModal" role="dialog" aria-modal="true">
         <header class="maModal__hdr">...</header>
         <div class="maModal__controls">...</div>  (optional)
         <div class="maModal__body">...</div>
         <footer class="maModal__ftr">...</footer>
       </section>
     </div>
*/
.maModalOverlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  overscroll-behavior: none;
  display: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;  /* NEW */
  padding:
    calc(20px + env(safe-area-inset-top))
    8px
    calc(20px + env(safe-area-inset-bottom))
    8px;
  background: var(--overlayBgDim);
  z-index: var(--overlayZ);
  backdrop-filter: blur(var(--overlayBlur));
  touch-action: none;
}

.maModalOverlay.is-open { display: flex; }

.maModal {
  width: 100%;
  max-width: min(var(--modalMaxW), calc(100vw - 16px));  /* NEW */
  max-height: 88vh; /* legacy fallback */
  max-height: min(var(--modalMaxH), calc(100dvh - (var(--modalViewportGap) + env(safe-area-inset-top) + env(safe-area-inset-bottom))));
  background: var(--modalSurface);
  border: 1px solid var(--border);
  border-radius: var(--modalRadius);
  box-shadow: var(--modalShadow);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.maModal__hdr {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--modalHeaderBg);
  color: var(--modalHeaderText);
  border-bottom: 1px solid rgba(255,255,255,.18);
}

.maModal__controls {
  flex: 0 0 auto;
  padding: 12px 14px;
  background: var(--panelControlsBg);
  border-bottom: 1px solid var(--panelControlsBorder);
  overflow: hidden;
}

.maModal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.maModal__body--flush {
  padding: 0;
}

.maModal__ftr {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 96%, black);
}

.maModal__ftrActions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
}

.maModal__title {
  font-size: var(--modalTitleSize);
  font-weight: var(--fwBlack);
  letter-spacing: .2px;
}

.maModal__subtitle {
  margin-top: 2px;
  font-size: var(--modalSubTitleSize);
  color: rgba(255,255,255,.92);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Subtitle that wraps instead of truncating; pair with .maModal__subtitleContext
   to append "· context" (e.g. course name) that breaks as one unit. */
.maModal__subtitle--wrap {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.25;
}

.maModal__subtitleContext {
  display: inline-block;
  max-width: 100%;
}

/* ---------- Modal variant: hosts a .maPanels tray/canvas layout ---------
   Opt-in modifiers for a modal whose body is a two-panel tray/canvas
   layout (see section 9) rather than ordinary form fields.

   .maModal--panels  — the panels need a real, definite height to fill
     (not just the default max-height cap) so .maPanel__body's own
     overflow:auto has something concrete to scroll within. Same
     viewport-safe expression the existing max-height rule already uses.

   .maModal__body--panels — strips the default 14px body padding (the
     panels supply their own internal spacing) and locks outer scroll —
     only .maPanel__body should scroll, never this wrapper. Mirrors the
     "lock outer, scroll inner" rule every standalone tray/canvas page
     already applies to its own <main class="maPage--X">.
   ------------------------------------------------------------------------- */
.maModal--panels {
  height: min(var(--modalMaxH), calc(100dvh - (var(--modalViewportGap) + env(safe-area-inset-top) + env(safe-area-inset-bottom))));
}

/* Compact popups — short messages, menus and one- or two-field forms
   (confirm, busy, Actions / row-tap menus, the Game and Event Settings
   menus, Select Tee, the contact editor). Everything else uses the wide
   --modalMaxW above. Phones are unaffected either way (100vw - 16px wins). */
.maModal--compact,
.maModal--busy {
  --modalMaxW: 520px;
}

/* Fixed height — for tabbed popups, so switching tabs doesn't resize the
   window (e.g. the messaging Contacts picker). Fills the available height on
   a phone, capped at 680px on larger screens; the body scrolls. */
.maModal--fixedHeight {
  height: min(680px, calc(100dvh - (var(--modalViewportGap) + env(safe-area-inset-top) + env(safe-area-inset-bottom))));
}

.maModal__body--panels {
  padding: 0;
  overflow: hidden;
}

/* Mobile overrides for modal fields */
@media (max-width: 600px) {
  .maModal {
    max-width: 100%;
    box-sizing: border-box;
  }

  .maModal .maField {
    flex: 1 1 auto;
  }

  .maModal .maFieldRow {
    flex-direction: column;
  }

  /* --nowrap keeps its one line in a modal too (group + name filters). */
  .maModal .maFieldRow--nowrap {
    flex-direction: row;
  }
}


/* ==========================================================================
   11. ACTIONS MENU
   ========================================================================== */

/* ---------- DEPRECATED: actionMenuOverlay -------------------------------- */
/* DO NOT USE — use maModalOverlay + maModal instead.
   Kept for any legacy pages not yet migrated. */

.actionMenuOverlay {
  position: fixed;
  inset: 0;
  background: var(--overlayBg);
  display: none;
  z-index: 99999;
  backdrop-filter: blur(2px);
  touch-action: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.actionMenuOverlay.open { display: flex; }

.actionMenu {
  position: relative;
  min-width: 260px;
  width: min(360px, 100%);
  max-width: 360px;
  background: var(--modalSurface);
  border: 1px solid var(--controlBorder);
  border-radius: var(--drawerRadius);
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
  padding: 0;
}

.actionMenu_header {
  position: sticky;
  top: 0;
  background: var(--modalHeaderBg);
  color: var(--modalHeaderText);
  padding: 12px 14px;
  z-index: 2;
}

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

.actionMenu_title {
  font-weight: var(--fwBlack);
  font-size: var(--chromeTitleSize);
  line-height: 1.15;
}

.actionMenu_subtitle {
  margin-top: 2px;
  font-weight: var(--fwExtrabold);
  font-size: var(--chromeSubtitleSize);
  opacity: .9;
}

.actionMenu_closeBtn {
  border: 0;
  background: rgba(255,255,255,.20);
  color: var(--bg);
  border-radius: var(--radiusLg);
  width: 30px;
  height: 28px;
  font-size: var(--btnFontSize);
  line-height: 1;
  font-weight: var(--fwBlack);
  cursor: pointer;
}

.actionMenu_closeBtn:hover {
  background: rgba(255,255,255,.28);
}

.actionMenu_item {
  width: 100%;
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 14px 16px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  font-weight: var(--fwBlack);
  font-size: var(--listItemSize);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid rgba(0,0,0,.10);
}

.actionMenu_item:hover { background: var(--pressedBg); }

.actionMenu_item.disabled {
  opacity: .50;
  cursor: default;
  color: var(--mutedText);
}

.actionMenu_item.danger { color: var(--danger); }

.actionMenu_divider {
  height: 8px;
  background: #f0f0f0;
  margin: 0;
}

@media (max-width: 520px) {
  .actionMenu {
    width: 100%;
    max-width: none;
  }
}

/* ---------- Active: maModal variant of actions menu --------------------- */

.maModal .actionMenu_subtitle {
  margin: 0 0 8px 0;
  font-weight: var(--fwExtrabold);
  font-size: var(--chromeSubtitleSize);
  color: var(--mutedText);
}

.maModal .actionMenu_item {
  width: 100%;
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 14px 16px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  font-weight: var(--fwBlack);
  font-size: var(--listItemSize);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid rgba(0,0,0,.10);
}

.maModal .actionMenu_item:hover { background: var(--pressedBg); }

.maModal .actionMenu_item.disabled {
  opacity: .50;
  cursor: default;
  color: var(--mutedText);
}

.maModal .actionMenu_item.danger { color: var(--danger); }

.actionMenu_item.indent,
.maModal .actionMenu_item.indent {
  padding-left: 28px;
}

.maModal .actionMenu_divider {
  height: 8px;
  background: #f0f0f0;
  margin: 0;
}

/* Category break — section header with tinted background */
.actionMenu_category {
  background: var(--brandPrimaryBg);
  border-top: 1px solid var(--borderSubtle);
  border-bottom: 1px solid var(--borderSubtle);
  padding: 8px 16px 5px;
  font-weight: var(--fwBlack);
  font-size: var(--listGroupSize);
  color: var(--ink);
  pointer-events: none;
  user-select: none;
}

.actionMenu_categoryDesc {
  background: var(--brandPrimaryBg);
  border-bottom: 1px solid var(--borderSubtle);
  padding: 0 16px 7px;
  font-weight: var(--fwExtrabold);
  font-size: var(--fieldValueSize);
  color: var(--ink);
  pointer-events: none;
  user-select: none;
}

.maModal .actionMenu_category {
  background: var(--brandPrimaryBg);
  border-top: 1px solid var(--borderSubtle);
  border-bottom: 1px solid var(--borderSubtle);
  padding: 8px 16px 5px;
  font-weight: var(--fwBlack);
  font-size: var(--listGroupSize);
  color: var(--ink);
  pointer-events: none;
  user-select: none;
}

.maModal .actionMenu_categoryDesc {
  background: var(--brandPrimaryBg);
  border-bottom: 1px solid var(--borderSubtle);
  padding: 0 16px 7px;
  font-weight: var(--fwExtrabold);
  font-size: var(--fieldValueSize);
  color: var(--ink);
  pointer-events: none;
  user-select: none;
}


/* ==========================================================================
   12. CARDS
   Use for repeatable surfaces inside a page/panel.
   Regions: .maCard__hdr (optional), .maCard__body (required)

   ── CARD LAYOUT CONTRACT (owner, 2026-11-04) ─────────────────────────────
   Spec: MatchAid_ideation/spec-list-row-label-value.md. Remediation
   tracking: MatchAid_ideation/plan-listline-remediation.md.

   A card body has 1, 2 or 3 COLUMNS:

     [ .maCard__lead ] [ .maCard__main ] [ .maCard__trail ]
       optional          required          optional

     1-column card  : main only — a stack of ListLines (section 17A)
     2-column card  : one slot (left OR right) + main
     3-column card  : left slot + main + right slot

   - .maCard__main stretches and stacks ListLines (one line each).
   - Slots (__lead / __trail) span EVERY line beside them; their content
     is centred vertically; several items in a slot sit side by side.
   - Slots size to their content (date badge 62px, avatar 32px, checkbox,
     ♡ ✕ buttons). Cards line up because slot content is a consistent size;
     a list number uses .maListNum (17A) so "9" and "10" take equal space.
     Do NOT give slots fixed widths.
   - .maCard--flat : entries in a long list (rosters, favorites) — no
     border, radius, shadow or gap; a divider line under each card.
   - .maCard__detail : optional area BELOW the columns, full card width,
     light grey, content indented to start under the main column; shown
     when the card has .is-open (chevron in the right slot turns down).
   - States on the card (today's looks): is-static, is-selected,
     is-disabled, is-pinned, is-leading, is-open — see 17A.

   Examples:
     Game card         lead = date badge · main = 3 ListLines
     Roster entry      flat · lead = .maListNum · main = 2 ListLines
                       · trail = [♡ ✕] (buttons in the trail, not in
                       line 1 — a 34px button stretches its line)
     Favorites entry   flat · lead = avatar / checkbox · main = 2 ListLines
                       · trail = ✓ / +
     Leaderboard row   lead = rank · main = 2 ListLines · trail = score ›
                       · __detail when open

   Not a card body: one line of 4+ columns → the simple grid (.maGridLine,
   17A); rows of values that must line up under headings → the grid
   (.maGrid, 17A).
   ========================================================================== */

.maCards {
  display: flex;
  flex-direction: column;
  gap: var(--cardsGap);
  min-width: 0;
}

.maCards--scroll {
  overflow: visible;
  max-height: none;
}

/* Grid of cards: as many columns of at least 360px as fit, one column on
   phones. min(360px, 100%) keeps phones narrower than 360px from scrolling
   sideways; align-items:start lets each card keep its own height instead of
   stretching to its row. Used by Player Portal and Admin Reporting. */
.maCards--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
  gap: 8px;
  align-items: start;
}

@media (max-width: 640px) {
  .maCards--grid { grid-template-columns: 1fr; }
}

.maCard {
  background: var(--cardBg);
  border: 1px solid var(--cardBorder);
  border-radius: var(--cardRadius);
  box-shadow: var(--cardShadow);
  overflow: hidden;
  min-width: 0;
}

/* Header: left title, right actions (0–3) */
.maCard__hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: var(--cardHdrPadY) var(--cardHdrPadX);
  background: var(--layer2-bg);
  color: var(--layer2-text);
  border-bottom: 1px solid var(--cardHdrBorder);
  /* One size for everything in a header (title, number, admin);
     condensed on phones. */
  font-size: var(--fsCardHeader);
  font-stretch: var(--fontWidthTighter);
}

/* Alternate card header tier — L1 instead of the default L2. For one-off
   cases where a card needs panel-level visual weight rather than content-
   card weight (first use: Admin Home's Games/Events list cards; expected
   for Player and Score portal list cards too). Apply this class directly
   on .maCard__hdr in the module that builds the markup — don't reach for
   it via page-CSS overrides targeting another file's output, which is
   what caused the original inconsistency this class replaces. */
.maCard__hdr--l1 {
  background: var(--layer1-bg);
  color: var(--layer1-text);
}
.maCard__hdr--l1 .maCard__title {
  color: var(--layer1-text);
}

/* Lighter card header tier — L3 (dark text on a pale tint), the same shade
   Pairings' group cards use. Chosen where a header must stay readable in
   direct sunlight (Score Entry's Side Bets player cards). Written as a
   compound selector so it also wins on pages that restyle plain
   .maCard__hdr (score_entry.css does), without needing !important. */
.maCard__hdr.maCard__hdr--l3 {
  background: var(--layer3-bg);
  color: var(--layer3-text);
}
.maCard__hdr--l3 .maCard__title {
  color: var(--layer3-text);
}

/* Highlight header tier: gold (the date badge's gold, on purpose), the warm
   contrast to blue buttons. First use: Player Home "Up Next". */
.maCard__hdr.maCard__hdr--highlight { background: var(--datebadgeTopBg); color: var(--ink); }
.maCard__hdr--highlight .maCard__title { color: var(--ink); }

/* Highlight card: dark-gold frame and a deeper shadow so the card stands
   apart from the list around it. Pairs with .maCard__hdr--highlight.
   First use: Player Home "Up Next". */
.maCard--highlight {
  border: 2px solid color-mix(in srgb, var(--datebadgeTopBg) 65%, black);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

/* Section rule: a full-width dark-gold line under a block, separating it
   from what follows (same gold as .maCard--highlight's frame).
   First use: Player Home "Up Next", above the week list. */
.maSectionRule {
  padding-bottom: 12px;
  margin-bottom: 2px;
  border-bottom: 2px solid color-mix(in srgb, var(--datebadgeTopBg) 65%, black);
}

/* Game / event number after a card title. No colour: it inherits the
   header text colour. */
.maCard__titleGgid { margin-left: 6px; }

/* Buttons, pills and text links never condense. Headers and card lines pass
   font-stretch down to their children; these opt out (pills and links are
   13px or smaller, and 13px text is never condensed). */
.btn, .iconBtn, .pillBtn, .maCard__actionBtn, .maFtrBtn, .maSegBtn,
.maPill, .btnLink {
  font-stretch: var(--fontWidthNormal);
}

.maCard__title {
  min-width: 0;
  flex: 1 1 auto;
  font-family: var(--fontFamilyBase);
  font-size: var(--fsCardHeader);
  font-weight: var(--fwExtrabold);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.maCard__actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--cardActionGap);
}

.maCard__actionBtn {
  width: var(--cardActionSize);
  height: var(--cardActionSize);
  border-radius: var(--cardActionRadius);
  border: 0;
  background: var(--cardActionBg);
  color: var(--cardActionText);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.maCard__actionBtn:active {
  background: var(--cardActionPressedBg);
  transform: scale(.98);
}

.maCard__actionBtn:disabled {
  opacity: .55;
  cursor: default;
  transform: none;
}

/* Text action in a card header (e.g. "Go to Scoring" + chevron): a label
   instead of an icon, same tap height as the icon action. Takes the
   header's own text color, so it reads on any card header tint.
   First use: Game Summary phone cards (game_summary.js). */
.maCard__actionBtn--text {
  width: auto;
  padding: 0 8px;
  gap: 4px;
  color: inherit;
  font-family: var(--fontFamilyBase);
  font-size: var(--fieldValueSublineSize);
  font-weight: var(--fwBold);
  letter-spacing: .3px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- Card header — mobile-stacked variant -------------------------
   Opt-in modifier: add alongside .maCard__hdr (e.g.
   class="maCard__hdr maCard__hdr--wrap") to stack the title above the
   actions slot on narrow viewports, instead of the default single-row
   layout. Deliberately NOT a change to .maCard__hdr itself — that class is
   shared by cards elsewhere (e.g. module_runAutoPair.js's compact pairing
   preview cards, score_home.js's scoring cards) that are single-row by
   design and shouldn't restack. Breakpoint matches the 820px mobile
   threshold already used in game_summary.css / game_scorecards.css.

   Markup pattern:
     <header class="maCard__hdr maCard__hdr--wrap">
       <div class="maCard__title">...</div>
       <div class="maCard__actions">
         <span class="maHintText">...</span>
       </div>
     </header>
   ------------------------------------------------------------------------- */
@media (max-width: 820px) {
  .maCard__hdr--wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .maCard__hdr--wrap .maCard__title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .maCard__hdr--wrap .maCard__actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.maCard__body {
  padding: var(--cardPad);
  min-width: 0;
}

/* Flush body: no padding, for a card that holds an inner card edge to edge
   (same idea as .maModal__body--flush). */
.maCard__body--flush { padding: 0; }
.maCard__body--flush > .maCard { border: 0; border-radius: 0; box-shadow: none; }

/* ---------- Card column contract (see the CARD LAYOUT CONTRACT above) ---
   A body holding __lead / __main / __trail lays them out side by side.
   Slots size to their content and span every line; main stretches. */
.maCard__body:has(> .maCard__main) {
  display: flex;
  align-items: center;
  gap: 10px;
}
.maCard__lead,
.maCard__trail {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.maCard__body[role="button"] { cursor: pointer; }
.maCard__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* Flat card: an entry in a long list — divider only. */
.maCard.maCard--flat {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--borderSubtle);
}
.maCards:has(> .maCard--flat) { gap: 0; }
.maCard--flat > .maCard__body { padding: 6px 8px; }   /* compact list spacing */
/* Detail area: below the columns, full width; shown when the card is open. */
.maCard__detail {
  background: var(--surfaceApp);
  padding: 10px var(--cardPad) 12px;
  border-top: 1px solid var(--borderSubtle);
}
.maCard:not(.is-open) > .maCard__detail { display: none; }
/* Card states (today's looks). */
.maCard.is-selected {
  border-color: color-mix(in srgb, var(--brandAccent) 55%, white);
  background: color-mix(in srgb, var(--brandAccent) 6%, white);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brandAccent) 35%, transparent) inset;
}
/* Target — "the action goes here" (edit target, chosen slot) or, fading,
   "this just moved". Selected = tint; target = outline (owner 2026-11-05).
   The outline sits just inside the edge, so nothing shifts, and paints
   over header bands. Works on a card or a single row. */
.is-target { outline: 2px solid var(--brandAccent); outline-offset: -2px; }
.is-target-flash { animation: maTargetFlash 2200ms ease-out; outline-offset: -2px; }
/* Rows inside the flashing card let its shade show through. */
.is-target-flash .maCard { background: transparent; }
@keyframes maTargetFlash {
  0%, 60% { outline: 2px solid var(--brandAccent); background-color: var(--rowBgSelected); }
  100%    { outline: 2px solid transparent;       background-color: var(--cardBg); }
}
.maCard.is-disabled { background: var(--rowBgEnrolled); pointer-events: none; }
.maCard.is-pinned   { border-bottom: 2px solid var(--rowPinnedDivider); }
.maCard.is-leading  { background: var(--successTintBg); }
/* A flat card is a list entry: selected keeps the list's tint, no border ring. */
.maCard.maCard--flat.is-selected { border-color: var(--borderSubtle); box-shadow: none; background: var(--rowBgSelected); }

/* ---------- Collapsible modifier — a .maCard that can expand/collapse.
   First real consumer: Scorecard group cards. Also independently built
   once before as .gpGroupCard (game_pairings.css, page-scoped) — same
   structure, same mechanism, different prefix. This is the canonical
   version both should eventually share; no new class family, only
   modifiers on the classes that already exist.

   Markup: two .maCard__hdr siblings (one --expanded, one --collapsed),
   toggled by .is-collapsed on the card itself. Title sits as a direct
   flex child of .maCard__hdr alongside its buttons — .maCard__hdr is
   already display:flex + justify-content:space-between, and
   .maCard__title already has flex:1 1 auto, so the title naturally
   fills the middle and pushes a trailing button to the far right with
   no extra wrapper needed. */

.maCard--collapsible.is-collapsed .maCard__hdr--expanded,
.maCard--collapsible.is-collapsed .maCard__body {
  display: none;
}

.maCard--collapsible:not(.is-collapsed) .maCard__hdr--collapsed {
  display: none;
}

/* Stable header color, expanded or collapsed alike — decided
   explicitly, not swapped on toggle. Scoped to the modifier, not the
   base .maCard__hdr, so it never affects any other card in the app. */
.maCard--collapsible .maCard__hdr {
  background: color-mix(in srgb, var(--brandColor3) 6%, white);
}

/* Phone scorecard card header (.maCard__hdrBtn) — L2 like other section
   cards, not the collapsible tint above; the player names under the title
   15px, condensed on phones. */
.maCard--collapsible .maCard__hdr.maCard__hdrBtn {
  background: var(--layer2-bg);
  color: var(--layer2-text);
}
.maCard__hdrBtn .maCard__subtitle {
  font-size: var(--fsMeta);
  font-stretch: var(--fontWidthTighter);
}

/* Opt-in L3 tier for collapsible cards — the rule above otherwise beats
   .maCard__hdr--l3 (same specificity, declared later). Pale portal tint,
   same as Pairings' group cards, and follows event/player context via the
   layer tokens. First use: Admin Reporting game cards. Consumers without
   the modifier (scorecards, side bets) keep the tint above. */
.maCard--collapsible .maCard__hdr.maCard__hdr--l3 {
  background: var(--layer3-bg);
  color: var(--layer3-text);
}

/* ---------- Header toggle beside action icons — the chevron + title part
   of a collapsible card header that also holds action buttons (which can't
   sit inside a button). Holds a chevron svg and a .maCard__main of
   ListLines. First use: Pairings / Slotting inner cards (owner 2026-11-05). */
.maCard__hdrToggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* ---------- Text action on a dark L1 panel header (e.g. "Collapse all") —
   shared link text is blue, unreadable on L1, so this uses the header text
   colour. First use: Pairings / Slotting right panels (owner 2026-11-05). */
.maPanel__hdrLink {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--layer1-text);
  font-family: inherit;
  font-size: var(--btnFontSize);
  font-weight: var(--fwBold);
  text-decoration: underline;
  white-space: nowrap;
  cursor: pointer;
}

/* ---------- Header as a button — the whole header toggles the card.
   Used with .maCard__hdr, so it keeps the header's padding, flex layout,
   background and text color; this only resets the button chrome. First
   use: phone scorecards (module_renderScoreCards.js). */
.maCard__hdrBtn {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--cardHdrBorder);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.maCard__hdrBtn > svg { flex: 0 0 auto; }
.maCard__hdrBtn:active { box-shadow: inset 0 0 0 999px var(--pressedBg); }

/* Stacks .maCard__title over .maCard__subtitle inside a .maCard__hdr row,
   between leading icon/buttons and trailing pill/buttons. */
.maCard__hdrText {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Card header second line (e.g. player last names). Same size as the
   title, lighter weight, full-strength header color — no muted text, the
   app is used outdoors. Wraps. */
.maCard__subtitle {
  margin-top: 2px;
  font-family: var(--fontFamilyBase);
  font-size: var(--cardTitleSize);
  font-weight: var(--fwSemibold);
  line-height: 1.25;
  color: inherit;
  white-space: normal;
}

/* One line with "…"; whoever owns the markup adds .is-expanded to show
   all of it (phone scorecards: when the card opens). */
.maCard__subtitle--clamp {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.maCard__subtitle--clamp.is-expanded { white-space: normal; }

/* Card body region that scrolls both ways inside the card. Height cap comes
   from --maCardBodyMax, set by the owning module (measured: the space left
   under the card header in the panel body). Sticky table headers/columns
   inside pin against this box. */
.maCard__bodyScroll {
  overflow: auto;
  max-height: var(--maCardBodyMax, none);
  -webkit-overflow-scrolling: touch;
}

/* ---------- Game card layout (.maGameCard): date badge on the left, a stack
   of lines on the right. One definition for Player Home, Admin Home and the
   game picker (moved from player_home.css / admin_home.css). Lines 2/3 are
   condensed on phones (--fontWidthTighter). */
.maGameCard__hdrAdmin {            /* sits in the header; size/colour inherit it */
  font-weight: var(--fwExtrabold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: right;
  margin-right: 8px;
}

.maGameCard__body { display: flex; flex-direction: column; gap: 8px; }
.maGameCard__top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.maGameCard__meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.maGameCard__line1,
.maGameCard__line2,
.maGameCard__line3 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.maGameCard__courseWrap,
.maGameCard__facts {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.maGameCard__courseWrap { flex: 1 1 auto; font-weight: var(--fwBlack); color: var(--ink); }
.maGameCard__facilityName { color: var(--mutedText); font-weight: var(--fwBlack); }
.maGameCard__facts {
  flex: 1 1 auto;
  color: var(--mutedText);
  font-size: var(--fsBody);
  font-stretch: var(--fontWidthTighter);
  font-weight: var(--fwExtrabold);
}

/* GAME ACTIONS / MANAGE — blue text button, desktop only (hidden on phones
   by the rule in section 19). */
.maGameCard__manageBtn.maCard__actionBtn {
  width: auto; height: auto; padding: 0; border: 0; background: transparent;
  color: var(--brandAccent); font-size: var(--fsLabel); font-weight: var(--fwBlack);
  letter-spacing: .3px; text-transform: uppercase;
}

/* "Subject to change" notice. 13px is the largest size that fits one line
   on a 360px phone. */
.maGameCard__provisional {
  font-size: var(--fsLabel); font-weight: var(--fwExtrabold); color: #7A5A10;
  background: #FFF3CD; border: 1px solid #E8C87A;
  border-radius: var(--radiusSq, 6px); padding: 3px 8px; display: inline-block;
}

@media (max-width: 520px) {
  .maGameCard__line2,
  .maGameCard__line3 { flex-wrap: wrap; }
}

/* ---------- Event card layout (.maEventCard): no badge; header (title +
   event ID + admin) and three full rows. One definition for Admin Home
   (module_sourceEvents.js) and Events Home (events_home.js). */
.maEventCard__hdrAdmin {            /* sits directly in .maCard__hdr; size/colour inherit the header */
  font-weight: var(--fwExtrabold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 45%; text-align: right; margin-right: 8px;
}
.maEventCard__body { display: flex; flex-direction: column; gap: 6px; }
.maEventCard__meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.maEventCard__line {                /* meta rows */
  font-size: var(--fsBody); font-stretch: var(--fontWidthTighter);
  color: var(--mutedText); font-weight: var(--fwBold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.maEventCard__line1 { color: var(--ink); font-weight: var(--fwBlack); }   /* primary row */


/* ==========================================================================
   13. PILLS & CHIPS
   ========================================================================== */

/* ---------- Pills (informational) --------------------------------------- */
.maPills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.maPill {
  background: var(--pillBg);
  color: var(--pillText);
  border-radius: var(--pillRadius);
  padding: var(--pillPadY) var(--pillPadX);
  font-size: var(--pillValueSize);
  font-weight: var(--fwExtrabold);
  line-height: 1.1;
  white-space: nowrap;
  flex: 0 0 auto;
  min-height: var(--pillMinHeight);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* 2-line label/value pill */
.maPillKV {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--pillMinHeight);
}

.maPillLabel {
  font-size: var(--pillLabelSize);
  font-weight: var(--fwExtrabold);
  color: var(--pillLabelText);
  line-height: 1;
}

.maPillValue {
  font-size: var(--pillValueSize);
  font-weight: var(--pillValueWeight);
  line-height: 1.1;
  color: var(--pillText);
}

/* Status variants */
.maPill--success {
  color: var(--success);
  background: var(--successTintBg);
  border: 1px solid var(--successTintBorder);
}

.maPill--warn   { color: var(--ink);    background: var(--warnTintBg);   border: 1px solid var(--warnTintBorder); }
.maPill--danger { color: var(--danger); background: var(--dangerTintBg); border: 1px solid var(--dangerTintBorder); }

/* Compact pill — same look, tight to its text (no min-height). For pills
   inside dense rows such as card headers (first use: scorecard "Thru N"). */
.maPill--compact {
  min-height: 0;
  padding: 2px 8px;
}

/* Stat pills — a .maPillKV (label over value) sized as a stat box: 14px
   ink label over an 18px value. Colour: default grey, .maPill--success
   (counted / total) or .maPill--plain (white). .maPills--fill lays them out
   as one row of equal tiles. First use: Leaderboard counted / not counted
   scores; one-player scorecard Thru / Out / In / Tot. */
.maPill--plain {
  background: #fff;
  border: 1px solid var(--borderSubtle);
}
.maPill--stat {
  --pillValueSize: var(--fsEmphasis);
  --pillLabelText: var(--ink);
  padding: 6px 4px;
  border-radius: 12px;
}
.maPills--fill { flex-wrap: nowrap; }
.maPills--fill > .maPill { flex: 1 1 0; min-width: 0; }
@media (max-width: 420px) {
  .maPills--fill { gap: 4px; }
  .maPills--fill > .maPill--stat { padding: 6px 2px; --pillValueSize: var(--fsBody); }
}

/* Headline pills — one row of equal tiles with a large value (first use:
   My Stats). Children are .maPill.maPillKV: label / value / label. */
.maPills--headline {
  flex-wrap: nowrap;
  padding: var(--spaceMd) var(--spaceMd) 0;
  --pillValueSize: 22px;
}
.maPills--headline > .maPill { flex: 1 1 0; min-width: 0; padding: 8px 4px; }
.maPills--headline .maPillValue { line-height: 1; }

/* Miss pad — read-only 3x3 cross of counts (long / left / hit / right /
   short), hit circled. __wrap is the band holding the pads side by side;
   each pad sits under its .maPillLabel title in a .maPillKV column. */
.maMissPad__wrap {
  display: flex;
  justify-content: space-around;
  padding: var(--spaceMd);
  border-bottom: 1px solid var(--borderSubtle);
}
.maMissPad {
  display: grid;
  grid-template-columns: repeat(3, 36px);
  grid-template-rows: repeat(3, 36px);
  place-items: center;
  margin-top: 4px;
  font-size: 17px;
  font-weight: var(--fwBlack);
  color: var(--ink);
}
.maMissPad [data-dir="long"]  { grid-column: 2; grid-row: 1; }
.maMissPad [data-dir="left"]  { grid-column: 1; grid-row: 2; }
.maMissPad [data-dir="hit"]   { grid-column: 2; grid-row: 2; width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 50%; font-size: 17px; font-weight: var(--fwBlack); }
.maMissPad [data-dir="right"] { grid-column: 3; grid-row: 2; }
.maMissPad [data-dir="short"] { grid-column: 2; grid-row: 3; }

/* ---------- Choice chips (enum selection / toggle) ---------------------- */
.maChoiceChips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.maChoiceChip {
  border: 1px solid var(--choiceChipBorder);
  background: var(--choiceChipBg);
  color: var(--choiceChipText);
  border-radius: var(--choiceChipRadius);
  padding: 8px 12px;
  font-family: var(--fontFamilyBase); /* buttons don't inherit font — without this chips fall back to the browser default */
  font-weight: var(--fwExtrabold);
  font-size: var(--pillTitleSize);
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.maChoiceChip.is-selected {
  background: var(--choiceChipSelectedBg);
  color: var(--choiceChipSelectedText);
  border-color: var(--choiceChipSelectedBorder);
}

/* Second selected state — brandSecondary green instead of the default tan.
   For cases where a choice chip sits near another tan-selected control
   (e.g. Define Flights' by-player/by-flight view toggle) and the shared
   tan would make two unrelated "selected" meanings look identical. */
.maChoiceChip.is-selected-accent {
  background: var(--brandSecondary);
  color: var(--brandSecondaryText);
  border-color: color-mix(in srgb, var(--brandSecondary) 70%, black);
}

/* Define Flights — flight name row: input, remove button, player count all
   sit on one line on desktop; wraps to its own line on mobile only, using
   the app's existing 600px breakpoint (see .maFtrBtn above). */
.dfFlightRow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.dfFlightRow .dfFlightCount {
  white-space: nowrap;
}

@media (max-width: 600px) {
  .dfFlightRow {
    flex-wrap: wrap;
  }
}

/* Generic config-row layout — swatch/input + trailing count, one line on
   desktop, wraps on mobile only (same 600px breakpoint as .dfFlightRow
   above). Used by Manage Teams' team-name rows. */
.maConfigRow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

@media (max-width: 600px) {
  .maConfigRow {
    flex-wrap: wrap;
  }
}

/* Hide-on-mobile wrapper for action-button rows on pages that rely solely
   on the chrome-header Actions button for mobile access (no in-canvas
   replacement trigger needed — e.g. Game Players). Deliberately no base
   styling here, so it can't clobber whatever the page's own CSS already
   sets on desktop; only takes effect at the 600px breakpoint. Compound
   selector keeps specificity high enough to win over an equal-specificity
   page-level rule regardless of stylesheet load order. */
@media (max-width: 600px) {
  .maDesktopActions,
  .maCanvasControls__right.maDesktopActions {
    display: none;
  }
}

.maChoiceChip.is-disabled {
  opacity: .55;
  cursor: default;
}

/* Touch-size chip — THE canonical large selectable row (Auto-Pair Pairing
   Strategy, Score Entry side bets). Full-width, 44px+ for one-handed use
   outdoors. Same colours as a normal chip: tan when .is-selected, white
   otherwise. The 2px --ink unselected border is deliberate — contrast in
   bright sunlight — don't soften it. Selection shows three ways: filled
   dot, tan background, selected border. The dot is drawn by ::before, so
   every consumer renders it identically and it's never its own tap
   target — the whole row is the button. Sits inside .maChoiceChips (a
   wrapping flex row); flex-basis 100% makes each chip its own line.

   Semantics are the consumer's job, since the look is the same either way:
   single-select → role="radio" + aria-checked inside role="radiogroup";
   multi-select  → aria-pressed.

   Markup:
     <button class="maChoiceChip maChoiceChip--touch is-selected" type="button">
       <span class="maChoiceChip__label">Sandy</span>
       <span class="maChoiceChip__detail">Held by Bishop</span>   (optional)
     </button> */
.maChoiceChip--touch {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  flex: 1 1 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  font-size: var(--labelTextSize);
  line-height: 1.2;
  text-align: left;
  border-width: 2px;
  border-color: var(--ink);
}

/* Two radio cards per row (e.g. Scoring System's four options as 2x2);
   labels condensed on phones so they fit the half width; 10px below the
   last row before the next element. */
.maChoiceChips--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 10px;
}
.maChoiceChips--2col .maChoiceChip__label { font-stretch: var(--fontWidthTighter); }

.maChoiceChip--touch::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.maChoiceChip--touch.is-selected::before {
  background: currentColor;
}

.maChoiceChip__label {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.maChoiceChip__detail {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  font-size: 0.875rem;  /* 14px (owner 2026-11-04) */
  font-weight: var(--fwSemibold);
  color: var(--mutedText);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* ---------- Segmented control (single-select tab switching) ------------- */
.maSeg {
  display: flex;
  width: 100%;
  border: 1px solid var(--segBorder);
  border-radius: var(--segRadius);
  overflow: hidden;
  background: var(--segBg);
}

.maSegBtn {
  flex: 1;
  min-height: var(--segBtnHeight);
  border: 0;
  border-right: 1px solid var(--segBorder);
  background: transparent;
  font-size: var(--segBtnFontSize);
  font-weight: var(--segBtnWeight);
  cursor: pointer;
  color: var(--segBtnText);
  padding: var(--spaceSm) calc(var(--spaceMd) + 2px);
  user-select: none;
}

.maSegBtn:last-child { border-right: 0; }

.maSegBtn.is-active {
  background: var(--segActiveBg);
  color: var(--segActiveText);
}

/* Blue selected state — for segmented yes/no decisions where the default
   tan is-active reads as too neutral, e.g. Define Flights' "Apply to all
   rounds?" toggle. Same brandColor3 already used for filled action buttons
   elsewhere (Manage Teams, Refresh Handicaps, Multi-Add). */
.maSegBtn.is-active-accent {
  background: var(--brandColor3);
  color: var(--brandPrimaryText);
}

.maSegBtn:disabled {
  opacity: .55;
  cursor: default;
}

/* ---------- Toggle (on/off switch) --------------------------------------
   A compact Yes/No switch that sits beside its label — distinct from .maSeg,
   which is a full-width view swap. Same border/radius/color tokens as .maSeg
   so it reads as part of the same family.

   Markup:
     <div class="maToggleRow">
       <span class="maLabel">Activate</span>
       <div class="maToggle" role="group" aria-label="...">
         <button type="button" class="maToggle__btn is-active" aria-pressed="true">Yes</button>
         <button type="button" class="maToggle__btn" aria-pressed="false">No</button>
       </div>
     </div>
     <div class="maHintText">What the current selection means.</div>
   ------------------------------------------------------------------------- */
.maToggleRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.maToggle {
  display: flex;
  flex: 0 0 auto;
  border: 1px solid var(--segBorder);
  border-radius: var(--segRadius);
  overflow: hidden;
  background: var(--segBg);
}

.maToggle__btn {
  min-height: var(--segBtnHeight);
  border: 0;
  border-right: 1px solid var(--segBorder);
  background: transparent;
  font-size: var(--segBtnFontSize);
  font-weight: var(--segBtnWeight);
  cursor: pointer;
  color: var(--segBtnText);
  padding: var(--spaceSm) calc(var(--spaceMd) + 2px);
  user-select: none;
}

.maToggle__btn:last-child { border-right: 0; }

.maToggle__btn.is-active {
  background: var(--brandColor3);
  color: var(--brandPrimaryText);
}

.maToggle__btn:disabled {
  opacity: .55;
  cursor: default;
}


/* ==========================================================================
   14. BUTTONS
   ========================================================================== */

/* Base button */
.btn {
  border: 1px solid var(--btnBorder);
  background: var(--btnBg);
  color: var(--btnText);
  border-radius: var(--btnRadius);
  min-height: var(--btnHeight);
  padding: 0 var(--btnPadX);
  font-family: var(--fontFamilyBase);
  font-size: var(--btnFontSize);
  font-weight: var(--btnFontWeight);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  background: var(--btnPressedBg);
  transform: scale(.98);
}

.btn:disabled,
.btn.disabled {
  opacity: .55;
  cursor: default;
  transform: none;
}

/* Primary = default (ink on light surface, semantic marker) */
.btnPrimary {
  background: var(--btnPrimaryBg);
  color: var(--btnPrimaryText);
  border-color: var(--btnPrimaryBorder);
}

/* Secondary = filled brand button (white on brandSecondary) */
.btnSecondary {
  background: var(--btnSecondaryBg);
  color: var(--btnSecondaryText);
  border-color: var(--btnSecondaryBorder);
}

.btnSecondary:active { filter: brightness(.96); }

/* Link button = text-only action */
.btnLink,
.btn.btnLink {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 0;
  height: auto;
  min-width: 0;
  justify-content: flex-start;
  color: var(--btnLinkText);
  font-size: var(--btnFontSize);   /* a bare <button class="btnLink"> would get the browser's 13px */
  font-weight: var(--btnFontWeight);
}

.btnLink:hover,
.btn.btnLink:hover {
  text-decoration: underline;
}

/* Square icon button (calendar, etc.) */
.iconBtn {
  width: var(--btnHeight);
  height: var(--btnHeight);
  flex: 0 0 var(--btnHeight);
  padding: 0;
  border-radius: var(--radiusSq);
  border: 1px solid var(--btnBorder);
  background: var(--btnBg);
  color: var(--btnText);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.iconBtn:active {
  background: var(--btnPressedBg);
  transform: scale(.98);
}

/* Indicator usage — non-interactive, fully visible when disabled */
.iconBtn:disabled {
  opacity: 1;
  cursor: default;
  pointer-events: none;
}

/* Close button (used in modals) */
.closeBtn {
  border: 1px solid var(--btnBorder);
  background: var(--btnBg);
  color: var(--btnText);
  border-radius: var(--radiusMd);
  padding: 7px 10px;
  cursor: pointer;
  font-weight: var(--fwBold);
  font-family: var(--fontFamilyBase);
}

/* Pill button (rounded action chip) */
.pillBtn {
  border: 1px solid var(--btnBorder);
  background: var(--btnBg);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: var(--fwBold);
  cursor: pointer;
  font-family: var(--fontFamilyBase);
  font-size: var(--btnFontSize);
  display: inline-flex;
  gap: 8px;
  align-items: center;
  user-select: none;
}

.pillBtn:active {
  background: var(--btnPressedBg);
  transform: scale(.98);
}


/* ==========================================================================
   15. FORM FIELDS
   ========================================================================== */

.maFieldRow {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

/* One-line filter row — fields share the line equally and never wrap,
   phones included (e.g. the favorites group + name filters). */
.maFieldRow--nowrap {
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}
.maFieldRow--nowrap > .maField {
  flex: 1 1 0;
}

.maField {
  flex: 1 1 240px;
  min-width: 0;
}

/* Form label — ink, told apart from values by weight (grey is for hints,
   empty values and disabled items only; owner 2026-11-04). */
.maLabel {
  display: block;
  margin: 0 0 6px 2px;
  font-size: var(--labelTextSize);
  font-weight: var(--fwBlack);
  color: var(--ink);
}

.maLabelLg {
  display: block;
  margin: 0 0 6px 2px;
  font-size: 18px;
  font-weight: var(--fwBlack);
  color: var(--ink);
  line-height: 1.1;
}

/* Section heading over a card group (Player Portal week breaks): room above
   it and, on phones, a line in the L1 header color from the end of the text
   to the right edge. Desktop shows the heading alone. */
.maLabelLg--rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .maLabelLg--rule::after {
    content: "";
    flex: 1 1 auto;
    border-top: 2px solid var(--layer1-bg);
  }
}

.maValueLg {
  display: block;
  font-size: 20px;
  font-weight: var(--fwBlack);
  color: var(--ink);
  line-height: 1;
}

.maInputWrap {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

/* Input wrap with inner action button (chevron, clear, search icon, etc.)
   Usage: add .maInputWrap--inner to the wrap div, place .maInputInnerBtn
   as the last child after .maTextInput.                                   */
.maInputWrap--inner {
  position: relative;
}

.maInputWrap--inner .maTextInput {
  padding-right: 40px;
}

.maInputInnerBtn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.maInputInnerBtn:active {
  opacity: 0.7;
  transform: translateY(-50%) scale(.93);
}

/* Clear variant — unicode × rendered as text */
.maInputInnerBtn--clear {
  font-size: 18px;
  font-weight: var(--fwBold);
  color: var(--textMuted);
  line-height: 1;
}

.maTextInput {
  width: 100%;
  min-height: var(--btnHeight);
  padding: 0 12px;
  border-radius: var(--controlRadius);
  border: 1px solid var(--controlBorder);
  background: #fff;
  color: var(--ink);
  font-family: var(--fontFamilyBase);
  font-size: var(--inputTextSize);
  font-weight: var(--fwExtrabold);
  outline: none;
  min-width: 0;
  box-sizing: border-box;
}

.maTextInput:focus {
  border-color: var(--brandSecondary);
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}

/* Regular weight for a .maTextInput that holds prose rather than a value
   (e.g. the message composer's Subject). */
.maTextInput--regular {
  font-weight: var(--fwRegular);
}

/* Multi-line text box — same look as .maTextInput, with room for lines
   (vertical padding, a taller start, drag to resize). Pages may set their
   own height (e.g. game_import.css). */
.maTextArea {
  display: block;
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border-radius: var(--controlRadius);
  border: 1px solid var(--controlBorder);
  background: #fff;
  color: var(--ink);
  font-family: var(--fontFamilyBase);
  font-size: var(--inputTextSize);
  font-weight: var(--fwExtrabold);
  line-height: 1.4;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
}

.maTextArea:focus {
  border-color: var(--brandSecondary);
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}

.maHelpText {
  font-size: var(--fsMeta);
  font-weight: var(--fwSemibold);
  color: var(--mutedText);
  line-height: 1.4;
  margin-top: 4px;
}


/* ==========================================================================
   16. DATE BADGE & CALENDAR
   ========================================================================== */

.maDateBadge {
  width: 62px;
  flex: 0 0 auto;
  border: 1px solid var(--borderSubtle);
  border-radius: var(--radiusLg);
  overflow: hidden;
  background: var(--cardBg);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.maDateBadge__top {
  background: var(--datebadgeTopBg);
  color: var(--datebadgeTopText);
  font-size: var(--fsLabel);
  font-weight: var(--fwBlack);
  letter-spacing: .3px;
  text-align: center;
  padding: 6px 0 5px;
}

.maDateBadge__mid {
  color: var(--ink);
  font-size: 22px;
  font-weight: var(--fwBlack);
  text-align: center;
  padding: 8px 0 2px;
}

.maDateBadge__bot {
  color: var(--ink);
  font-size: var(--fsMeta);
  font-weight: var(--fwBlack);
  text-align: center;
  padding: 0 0 8px;
}

/* Calendar */
.maCalWrap {
  display: none; /* opened by JS via .open */
  margin-top: 12px;
  border: 1px solid var(--borderSubtle);
  border-radius: var(--radiusLg);
  overflow: hidden;
  background: #fff;
}

.maCalWrap.open { display: block; }

.maCalHeader {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--panelHdrBg);
  color: var(--panelHdrText);
  border-bottom: 1px solid var(--borderSubtle);
}

.maCalHint {
  font-size: 12px;
  font-weight: var(--fwBlack);
  opacity: .95;
}

.maCalLeft {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.maCalMonthLabel {
  font-size: 14px;
  font-weight: var(--fwBlack);
  letter-spacing: .2px;
  padding: 0 6px;
}

.maCalNavBtn { min-width: 40px; }

.maCalMiniBtn { padding: 0 10px; }

.maCalRight { display: none; } /* legacy pills kept in DOM */

.maCalDow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 10px 10px 0 10px;
  color: var(--mutedText);
  font-weight: var(--fwBlack);
  font-size: 11px;
}

.maCalGrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 10px;
}

.maCalDay {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--borderSubtle);
  background: var(--cardBg);
  color: var(--ink);
  font-weight: var(--fwBlack);
  cursor: pointer;
}

.maCalDay:hover { background: var(--pressedBg); }
.maCalDay.muted { opacity: .45; }
.maCalDay.today { border-color: var(--brandSecondary); }

.maCalDay.selected {
  background: var(--brandSecondary);
  border-color: var(--brandSecondary);
  color: #fff;
}

.maCalDay.inRange {
  background: rgba(48, 110, 230, .10);
  border-color: rgba(48, 110, 230, .10);
}

.maCalDay.from,
.maCalDay.to {
  background: var(--brandSecondary);
  border-color: var(--brandSecondary);
  color: #fff;
}


/* ==========================================================================
   17. GROUP HEADINGS
   The list-row family (.maListRow, .maListRows, __col, __subline and their
   variants) was retired 2026-11-05 — every list moved to the ListLine +
   card construct (section 17A / section 12); lines of 4+ columns use the
   simple grid (.maGridLine, 17A). What stays here: the group headings
   (.maListRow__group and its --toggle / --collapsible / --l2 / team-colour
   variants) and .maListSticky. (__avatar and __genderTag live in 17A.)
   Tracking: MatchAid_ideation/plan-listline-remediation.md.
   ========================================================================== */

/* Sticky block for a grouped list: wrap each group in its own element and
   put its header row(s) in .maListSticky — it pins to the top of the
   scrolling panel only while that group's rows scroll, then hands over to
   the next group's. Needs a scrolling ancestor such as .maPanel__body.
   First use: Leaderboard flight sections. */
.maListSticky {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--cardBg);
}

/* Group divider label — section sub-heading within a scrollable list.
   Use to separate named buckets of rows (e.g. team groups on the roster,
   flight groups in pairings, status groups in any list view).

   Base style (no modifier): neutral tint, darkened ink for legibility in
   daylight. Pair with a --color modifier to add a team/status swatch dot.

   Usage:
     <div class="maListRow__group">All Players</div>
     <div class="maListRow__group maListRow__group--red">Team A</div>
     <div class="maListRow__group maListRow__group--blue">Team B</div>
     <div class="maListRow__group maListRow__group--none">No Team</div>

   Pages currently using this pattern:
     - game_players.js  → roster team groups (sort by team)
*/
.maListRow__group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--listGroupSize);
  font-weight: var(--fwExtrabold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  /* Use --ink rather than --mutedText: grey on the tinted band is hard to
     read in bright daylight; --ink (#111) gives sufficient contrast at this
     small font size. Background is the L3 layer tint, so headings follow
     the game / event / player context like card headers do (2026-11-05). */
  color: var(--ink);
  padding: 7px 12px 3px;
  background: var(--layer3-bg);
  border-top: 0.5px solid var(--borderSubtle);
  border-bottom: 0.5px solid var(--borderSubtle);
  user-select: none;
}

/* L2 group header — a section heading one step below an outer card's L1
   header, in the layer ramp (L1 card header → L2 section → L3 column
   labels → white rows). First use: Leaderboard flight headers. */
.maListRow__group--l2 {
  background: var(--layer2-bg);
  color: var(--layer2-text);
}

/* Group header that toggles (collapses) its group — rendered as a <button>
   with a .maListRow__chevron; keeps .maListRow__group's look.
   First use: Leaderboard flight headers. */
.maListRow__group--toggle {
  width: 100%;
  border-left: 0;
  border-right: 0;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

/* Color-dot swatch — indicates team or category identity.
   Dot is suppressed on the base class (no modifier).
   Parallels .maSwatch but auto-inserted via ::before so no extra markup
   is needed. */
.maListRow__group--red::before,
.maListRow__group--blue::before,
.maListRow__group--none::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.maListRow__group--red::before  { background: var(--danger); }
.maListRow__group--blue::before { background: var(--brandColor3); }
.maListRow__group--none::before { background: var(--mutedText); opacity: .45; }

/* Collapsible group divider — the whole divider toggles its rows; a compact
   +/- button (.iconBtn.iconBtn--sm.btnSecondary) sits where the swatch dot
   would be. Promoted from game_pairings.js's inline-styled tray group
   header (renderTrayGroupHeader). First use: Admin Reporting status groups.

   Usage:
     <div class="maListRow__group maListRow__group--collapsible" data-...>
       <button class="iconBtn iconBtn--sm btnSecondary" type="button">…14px svg…</button>
       <span>Unregistered (12)</span>
     </div>
*/
.maListRow__group--collapsible {
  cursor: pointer;
  padding-top: 5px;
  padding-bottom: 5px;
}


/* Wrapping helper/hint text — explains what a control's current selection
   means (e.g. Define Flights' apply-to-all-rounds hint). Wraps, since it's
   a full sentence, not a label. */
.maHintText {
  font-size: var(--fsMeta);
  font-weight: var(--fwSemibold);
  color: var(--mutedText);
  line-height: 1.4;
  margin-top: 6px;
}

/* Larger variant — now the same 15px as the base (hints were raised to
   15px, 2026-11-04); kept so existing markup needs no change. Was: for
   hints that stand alone as the primary guidance in
   a controls band (e.g. "Use the Actions Menu to print"), rather than a
   secondary annotation sitting next to a control. Same weight/color/
   line-height as the base, just sized up. */
.maHintText--lg {
  font-size: 15px;
}

/* Right-aligned variant, margin reset — for hint text sitting as a
   horizontal flex sibling (e.g. a card header's right-side note next to
   the title) rather than stacked below something, where the base
   margin-top would be wrong. First use: Hole Champions' card-header note. */
.maHintText--right {
  text-align: right;
  margin-top: 0;
}



/* ==========================================================================
   SHARED CHECKBOX — .maCheckbox / .maCheckbox.is-checked
   Reusable row-level checkbox using brand tokens.
   Used by: Buddy Groups modal, game pairings, admin picker, and any future
   multi-select list. Replaces page-local variants (gpRowCheck, gmTagCheck,
   maAdminRow__check).

   Markup pattern:
     <div class="maCheckbox"></div>                  — unchecked
     <div class="maCheckbox is-checked"></div>       — checked
   The checkmark is rendered via ::after pseudo-element (no inner text needed).
   Checked = blue (--brandAccent), the action colour — owner 2026-11-05;
   was --brandSecondary green. The selected-row tint (--rowBgSelected)
   stays green.
   ========================================================================== */

.maCheckbox {
  width: 20px;
  height: 20px;
  border-radius: var(--radiusSq);
  border: 1px solid var(--borderSubtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--bg);
  box-sizing: border-box;
  transition: background 0.1s, border-color 0.1s;
}

.maCheckbox.is-checked {
  background: var(--brandAccent);
  border-color: var(--brandAccent);
}

.maCheckbox.is-checked::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}

/* ---------- .maCheckbox--accent — blue variant ---------------------------
   Now the same as the base checked colour (base turned blue 2026-11-05);
   kept so existing markup is harmless. Remove in a later clean-up.
   Same component, --brandAccent instead of the default brandSecondary
   green — matches the blue already used for selection state everywhere
   else it appears (.gpRowCheck.is-selected, .gpMasterCheck.has-selection
   in game_pairings.css; .maCard.is-selected here). Not --brandColor3
   ("button blue" / .btnSecondary) — that's a different semantic role.
   Additive modifier, same convention as .btn--confirm / .btn--danger
   (section 21e). The base .maCheckbox.is-checked default is untouched
   for existing consumers (Buddy Groups modal, game pairings, admin
   picker).
   ------------------------------------------------------------------------- */
.maCheckbox--accent.is-checked {
  background: var(--brandAccent);
  border-color: var(--brandAccent);
}


/* ==========================================================================
   17A. LIST LINES — the ListLine construct (owner, 2026-11-04)
   Spec: MatchAid_ideation/spec-list-row-label-value.md (rev 3).
   The rules follow this block. This block is the CONTRACT — read it
   before building or changing any list.

   A LISTLINE (.maListLine) IS ONE LINE with 1–3 COLUMNS (.maListLine__col).
   It stands alone (a list of lines, each with its own divider) or sits in
   a card's main column (section 12), where the card provides the dividers.

   COLUMN WIDTHS — decided by the stylesheet from the column COUNT:
     1 column   [ stretches ……………………………………………………… ]
     2 columns  [ stretches ………………………………… ][ content, right ]
     3 columns  [ stretches ……………………… ][ FIXED ][ FIXED ]
                  fixed = --listFixedColWidth (4.5rem, scales with text);
                  values right-aligned, Black — so columns 2 and 3 line up
                  down the list whatever the data.
     __col--stretch  this column stretches instead (column 1 then takes its
                     content width). E.g. rank · NAME · score, ☐ · NAME.
     __col--fixed    a FORM LABEL column at --listFixedColWidth ("To /
                     From / Subject"); a button in it fills it. Data
                     columns never need it.
   - A group of buttons / icons is ONE column (items side by side).
   - In a 3-column line an empty column keeps its place (alignment holds).
   - Text wider than its column wraps inside it; it never moves the others.
   - More than 3 columns → .maGridLine (one line) or .maGrid (rows).

   LINE STYLES (free choice per line; sizes from --listItemSize / --fsMeta):
     (default)   16px Medium          --prominent  16px Black
     --condensed 15px, condensed on phones (--fontWidthTighter)
     Lines WRAP by default (nothing hidden); --truncate = one line with "…".

   TEXT: ink. Columns differ by weight and alignment, not colour. Grey only
   for hints (.maHintText), empty values (.is-empty: "Not recorded") and
   disabled items. .maListNum = a list number (sequence, rank): 2 digits
   wide, tabular figures, so the text after it lines up.

   STATES (on a stand-alone line or a card; today's looks, new names):
     (default) tappable — pointer, hover, press      is-static   no hover
     is-selected  card: green border + tint; line: selected tint
     is-disabled  shaded, not tappable (e.g. already enrolled)
     is-pinned    heavier divider below ("You")      is-leading  green tint
     is-open      card detail shown (section 12)

   SIZES are shared with the Actions menu (section 11): --listItemSize
   (16px) for lines and menu items, --listGroupSize (15px) for group
   headings and menu categories — so menus and lists never drift apart.
   ========================================================================== */


.maListLine {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: #fff;
  border-bottom: 1px solid var(--borderSubtle);
  font-size: var(--listItemSize);
  font-weight: var(--fwMedium);
  color: var(--ink);
  cursor: pointer;
}
.maListLine:hover  { background: rgba(0,0,0,.02); }
.maListLine:active { background: rgba(0,0,0,.04); }

/* Inside a card the card provides the padding and dividers. */
.maCard__main > .maListLine {
  padding: 0;
  border-bottom: 0;
  background: transparent;
  cursor: inherit;
}

/* Columns — widths by column count (see the contract above). The
   modifiers below beat these positional rules on purpose. */
.maListLine__col { flex: 0 0 auto; min-width: 0; overflow-wrap: anywhere; }
.maListLine__col:first-child { flex: 1 1 auto; }
.maListLine__col:nth-child(2):last-child { text-align: right; font-weight: var(--fwBlack); }
.maListLine__col:nth-child(2):nth-last-child(2),
.maListLine__col:nth-child(3):last-child {
  flex: 0 0 var(--listFixedColWidth);
  text-align: right;
  font-weight: var(--fwBlack);
}
.maListLine .maListLine__col.maListLine__col--stretch {
  flex: 1 1 auto;
  text-align: left;
  font-weight: inherit;
}
.maListLine:has(> .maListLine__col--stretch) > .maListLine__col:first-child:not(.maListLine__col--stretch):not(.maListLine__col--fixed) {
  flex: 0 0 auto;
}
.maListLine .maListLine__col.maListLine__col--fixed {
  flex: 0 0 var(--listFixedColWidth);
  text-align: left;
  font-weight: inherit;
}
.maListLine__col--fixed > .btn { width: 100%; }
/* A column holding buttons / icons / badges: one group, side by side. */
.maListLine__col:has(> .iconBtn, > .btn:not(:only-child)) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
/* A segmented control in a column sizes to its buttons (it is full width
   everywhere else), so "Yes" / "No" never wrap. */
.maListLine__col > .maSeg { width: auto; }
.maListLine__col > .maSeg > .maSegBtn { white-space: nowrap; }

/* Line styles */
.maListLine--prominent { font-weight: var(--fwBlack); }
.maListLine--condensed { font-size: var(--fsMeta); font-stretch: var(--fontWidthTighter); }
.maListLine--truncate .maListLine__col { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }

/* Contents */
.maListLine .maListLine__col.is-empty { color: var(--mutedText); font-weight: var(--fwSemibold); }
.maListNum {
  display: inline-block;
  min-width: 2ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* States (today's looks) */
.maListLine.is-static { cursor: default; }
.maListLine.is-static:hover,
.maListLine.is-static:active { background: #fff; }
.maListLine.is-selected { background: var(--rowBgSelected); }
.maListLine.is-disabled { background: var(--rowBgEnrolled); cursor: default; pointer-events: none; }
.maListLine.is-pinned   { border-bottom: 2px solid var(--rowPinnedDivider); }
.maListLine.is-leading  { background: var(--successTintBg); }

/* ---------- Simple grid — ONE line of 4+ columns (owner 2026-11-05). The
   ListLine's sibling for lines too wide for 1–3 columns: inside a card's
   main area (the card is the row and the tap target) or standing alone.
   Columns are declared once per layout in the page CSS
   (grid-template-columns), so a label line and the card lines share them
   and line up. Multi-row, data-driven tables are the separate "complex
   grid". First use: Leaderboard desktop rows. */
.maGridLine {
  display: grid;
  align-items: center;
  column-gap: 10px;
  padding: 4px 2px;              /* inside a flat card: 10px rows */
  font-size: var(--fsMeta);
  font-weight: var(--fwSemibold);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.maGridLine__col { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.maGridLine__col--num { text-align: right; }
/* L3 tint: a line of column labels sitting above the cards. */
.maGridLine--l3 {
  background: var(--layer3-bg);
  color: var(--layer3-text);
  font-weight: var(--fwExtrabold);
  padding: 12px 10px;
  border-bottom: 1px solid var(--borderSubtle);
}

/* ---------- Grid — MULTI-ROW, with column headings (owner 2026-11-05).
   A real <table>: rows of the same shape under a heading row. Columns are
   declared (table-layout: fixed), so every grid in a set lines up — widths
   come from <col> classes, the rest share the space equally. Read-only by
   default: row lines only, no vertical lines, no hover. Text left.
     <table class="maGrid">
       <colgroup><col class="maGridCol maGridCol--narrow"><col class="maGridCol"><col class="maGridCol"></colgroup>
       <thead><tr class="maGridRow maGridRow--head"><th class="maGridCell">…</th>…</tr></thead>
       <tbody><tr class="maGridRow"><td class="maGridCell maGridCell--nowrap">…</td>…</tr></tbody>
     </table>
   Entry grids (cells holding inputs) and the transposed phone layout use
   the additions below. First uses: Hole Champions, Batch Score Entry. */
.maGrid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: var(--fsMeta);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.maGridCell {
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
  font-weight: var(--fwRegular);
  border-bottom: 1px solid var(--borderSubtle);
  overflow-wrap: anywhere;
}
.maGrid > tbody > .maGridRow:last-child > .maGridCell { border-bottom: 0; }
/* Heading row — the L3 band (under an L2 card header). */
.maGridRow--head > .maGridCell {
  background: var(--layer3-bg);
  color: var(--layer3-text);
  font-weight: var(--fwExtrabold);
}
.maGridCol--narrow     { width: 104px; }               /* a short label column (e.g. "18 · Par 5") */
.maGridCol--wide       { width: 180px; }               /* a name / description column beside many short ones */
/* One line; runs out of room → ends in "…" (the cell and its text parts). */
.maGridCell--nowrap,
.maGridCell--nowrap > .maGridCell__main,
.maGridCell--nowrap > .maGridCell__sub {
  white-space: nowrap;
  overflow-wrap: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}
.maGridCell--strong    { font-weight: var(--fwBlack); }
.maGridCell--center    { text-align: center; }
/* Shaded with the band tint (L3) — totals, or any cell set apart. */
.maGridCell--shaded    { background: var(--layer3-bg); }
/* Heading tint on a single cell (a --flow grid has no heading row). */
.maGridCell--head      { background: var(--layer3-bg); color: var(--layer3-text); font-weight: var(--fwExtrabold); }
/* Two-part text: main line over a smaller ink sub-line ("1" / "Par 4",
   "Michael Axelrod" / "PH 12"). */
.maGridCell__main      { display: block; }
.maGridCell__sub       { display: block; font-size: var(--fsLabel); font-weight: var(--fwBold); }
/* A cell holding a form box (score, points): the box compact, digits centred. */
.maGridCell--input     { padding: 2px 3px; text-align: center; }
.maGridCell--input > .maTextInput {
  min-height: 30px;
  padding: 0 2px;
  text-align: center;
  border-radius: var(--radiusSq);
}
/* A dropdown in a grid cell: condensed on phones (form controls don't
   inherit the page's font width), so its choices fit the cell. First use:
   Placement Points' Tie rule. */
.maGridCell--input > select.maTextInput { font-stretch: var(--fontWidthTighter); }
/* Stays put while the grid scrolls sideways (the first column). */
.maGridCell--frozen {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--cardBg);
  border-right: 1px solid var(--borderSubtle);
}
.maGridCell--frozen.maGridCell--head,
.maGridCell--frozen.maGridCell--shaded { background: var(--layer3-bg); }
/* Flow grid — a <div> grid that fills COLUMN BY COLUMN in page order, so
   cells written one player at a time keep "same player, next hole" as the
   keyboard's next-field order (transposed layout: holes down, players
   across). Rows: heading + 9 holes + total. First column narrow, the rest
   share the width; scrolls sideways (first column --frozen). */
.maGrid--flow {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(11, auto);
  grid-template-columns: 48px;              /* 48 + 4 × 60 fits a phone modal: 4 players without scrolling */
  grid-auto-columns: minmax(60px, 1fr);
  overflow-x: auto;
}
.maGrid--flow > .maGridCell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 4px;
}
/* Heading row stays visible while the grid scrolls (frozen heading cell
   sits above both). */
.maGridRow--head > .maGridCell { position: sticky; top: 0; z-index: 2; }
.maGridRow--head > .maGridCell--frozen { z-index: 3; }
/* A shaded cell in the heading row is one step darker (L2) — e.g. a
   pairing-total column heading among player names. */
.maGridRow--head > .maGridCell--shaded { background: var(--layer2-bg); color: var(--layer2-text); }
/* A cell you can tap (folds a segment, closes a card, …). */
.maGridCell--tap { cursor: pointer; }
.maGridCell--tap:active { background: var(--pressedBg); }
/* Score-grid options (scorecards). --lines boxes every cell at score-grid
   density; --condensed narrows the letters at every width so 15px fits
   18 holes; --fit sizes columns to their content (at least full width)
   and scrolls sideways when wider. */
.maGrid--lines .maGridCell { border: 1px solid var(--borderSubtle); padding: 4px 2px; }
.maGrid--lines > tbody > .maGridRow:last-child > .maGridCell { border-bottom: 1px solid var(--borderSubtle); }
.maGrid--condensed { font-stretch: var(--fontWidthTighter); }
.maGrid--fit { width: auto; min-width: 100%; table-layout: auto; }
.maGrid--fit .maGridCell { padding: 6px; white-space: nowrap; }
/* Score cells (.maCell, 21o) in content-sized grids: shape boxes a little
   larger, stroke marks beside the score (never on it). */
.maGrid--fit .maCell { min-width: 24px; min-height: 24px; gap: 1px; }
.maGrid--fit .maCell--birdie .maCellVal,
.maGrid--fit .maCell--eagle .maCellVal,
.maGrid--fit .maCell--bogey .maCellVal,
.maGrid--fit .maCell--bogeyplus .maCellVal { min-width: 20px; height: 20px; }
.maGrid--fit .maCellSuperscripts { position: static; align-self: flex-start; font-size: 12px; line-height: 1; margin-top: 1px; }
@media (max-width: 600px), (orientation: landscape) and (max-height: 500px) {
  .maGridCell { padding: 7px 8px; }
  .maGridCol--narrow { width: 84px; }
  .maGridCol--wide   { width: 140px; }
  /* Cells that may wrap use the condensed width, so they wrap less;
     headings are condensed too, so long names keep more letters. */
  .maGridCell:not(.maGridCell--nowrap),
  .maGridRow--head > .maGridCell,
  .maGridCell--head { font-stretch: var(--fontWidthTighter); }
  .maGrid--flow > .maGridCell { padding: 4px; }
  .maGrid--flow > .maGridCell--input { padding: 2px 3px; }
}

/* Regular-weight text inside a ListLine — gender after a name "(M)", or a
   value toned down from a Black column. Ink (grey only for hints, empty
   values and disabled items). */
.maListRow__genderTag {
  font-weight: var(--fwRegular);
  color: var(--ink);
}

/* Avatar circle — circular initials badge used in a card's lead slot (Favorites, Game Settings menu) */
.maListRow__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: var(--fwExtrabold);
  flex-shrink: 0;
  background: rgba(0,0,0,.07);
  color: var(--mutedText);
}


/* Gender-coded avatar color modifiers (must follow base .maListRow__avatar rule) */
.maListRow__avatar--m { background: var(--avatarMaleBg); color: var(--avatarText); }
.maListRow__avatar--f { background: var(--avatarFemaleBg); color: var(--avatarText); }
.maListRow__avatar--u { background: var(--avatarUnknownBg); color: var(--avatarText); }

/* Avatar border — applied via modifier so it only affects gender-coded avatars */
.maListRow__avatar--m,
.maListRow__avatar--f,
.maListRow__avatar--u {
  border: 2px solid var(--avatarBorder);
}


/* ==========================================================================
   18. ADMIN PICKER
   ========================================================================== */

.maAdminPick__top { margin-top: 12px; }

.maAdminPick {
  margin-top: 10px;
  border: 1px solid var(--borderSubtle);
  border-radius: var(--radiusLg);
  overflow: hidden;
  background: #fff;
}

.maAdminPick__hdr {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  background: var(--panelHdrBg);
  color: var(--panelHdrText);
  border-bottom: 1px solid var(--borderSubtle);
}

.maAdminPick__hdrName {
  font-weight: var(--fwBlack);
  letter-spacing: .2px;
}

.maAdminPick__rows {
  max-height: 360px;
  overflow: auto;
}

.maAdminRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--borderSubtle);
  cursor: pointer;
  user-select: none;
}

.maAdminRow:hover { background: var(--pressedBg); }

.maAdminRow__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.maAdminRow__check {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid var(--borderSubtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: var(--fwBlack);
  color: var(--mutedText);
  flex: 0 0 auto;
}

.maAdminRow__check.on {
  background: var(--brandSecondary);
  border-color: var(--brandSecondary);
  color: #fff;
}

.maAdminRow__name {
  font-weight: var(--fwBlack);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.maAdminRow__right {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}


/* ==========================================================================
   19. MISC — EMPTY STATE, TAB PANELS, GAME CARD OVERRIDES
   ========================================================================== */

.maEmptyState {
  margin: 10px 0;
  padding: 16px 14px;
  text-align: center;
  color: var(--mutedText);
  font-weight: var(--fwExtrabold);
  border: 1px dashed var(--borderSubtle);
  border-radius: var(--radiusLg);
  background: var(--cardBg);
}

.maTabPanel { display: none; }
.maTabPanel.is-active { display: block; }

/* Hide game card manage button on mobile */
@media (max-width: 600px) {
  .maGameCard__manageBtn {
    display: none !important;
  }
}

/* ==========================================================================
   20. PAGE HELP — Modal + Header Button
   ========================================================================== */
 
/* --- Help button in chrome header --- */
/* 44px tap target (phone guideline) around the 26px icon below. */
.maHelpBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
 
.maHelpBtn:active {
  transform: scale(.93);
}
 
.maHelpBtn img {
  width: 26px;
  height: 26px;
  display: block;
  border-radius: 50%;
}
 
/* Hidden on mobile — help is a desktop affordance — except the app
   header's ? (left side), which opens the Help menu (Page Help, Tips). */
@media (max-width: 600px) {
  .maHelpBtn {
    display: none;
  }
  .maChrome__hdrLeft .maHelpBtn {
    display: inline-flex;
  }
}
 
/* Right slot gap and alignment (the ? button now sits in the left slot) */
.maChrome__hdrRight {
  gap: calc(var(--chromeGap) * 3);
  justify-content: flex-end;
}
 
/* --- Help modal sizing --- */
.maHelpModal {
  max-width: 620px;
  width: min(620px, calc(100vw - 32px));
}
 
/* --- Help modal body layout --- */
.maHelpBody {
  display: flex;
  flex-direction: column;
}
 
/* --- Individual help section --- */
.maHelpSection {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: var(--spaceMd);
  padding: var(--spaceMd) 0;
  border-top: 1px solid var(--borderSubtle);
}
 
.maHelpSection:first-child {
  border-top: 0;
  padding-top: 0;
}
 
/* --- Icon circle --- */
.maHelpIcon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--brandPrimary) 10%, transparent);
  color: var(--brandPrimary);
  flex-shrink: 0;
}
 
/* --- Section text --- */
.maHelpSection__content {
  display: flex;
  flex-direction: column;
  gap: var(--spaceSm);
}
 
.maHelpSection__title {
  margin: 0;
  font-size: var(--labelTextSize);
  font-weight: var(--fwBlack);
  color: var(--brandPrimary);
}
 
.maHelpSection__body {
  margin: 0;
  font-size: var(--fieldValueSize);
  color: var(--ink);
  line-height: 1.45;
}
 
.maHelpList {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink);
  font-size: var(--fieldValueSize);
}
 
.maHelpList li {
  margin-bottom: var(--spaceSm);
  line-height: 1.4;
}
 
.maHelpList li:last-child {
  margin-bottom: 0;
}
 
.maHelpSubList {
  margin: var(--spaceSm) 0 0 0;
  padding-left: 1rem;
  list-style-type: circle;
  color: var(--mutedText);
  font-size: var(--fieldValueSize);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
 
.maHelpSubList li {
  line-height: 1.35;
}
 
/* --- Tab panels — hidden by default, shown when is-active --- */
.maHelpTabPanel {
  display: none;
}
 
.maHelpTabPanel.is-active {
  display: block;
}
 
/* --- Segmented control inside help modal controls area --- */
.maHelpSeg {
  width: 100%;
}
 
/* --- Mobile adjustments (modal still usable if somehow reached) --- */
@media (max-width: 640px) {
  .maHelpModal {
    width: calc(100vw - 20px);
  }
 
  .maHelpSection {
    grid-template-columns: 36px 1fr;
  }
 
  .maHelpIcon {
    width: 34px;
    height: 34px;
  }
}

/* ==========================================================================
   ADDITIONS TO ma_shared.css
   Add .maSwatch to Section 1 (Design Tokens / utility classes).
   Add .maTeamBadge to Section 13 (Pills & Chips), after .maChoiceChip block.
   ========================================================================== */


/* ---------- Section 1 addition — after the :root block -------------------
   .maSwatch — generic color dot used beside labelled inputs.
   Color modifier classes follow the same --red / --blue pattern as other
   semantic utilities in the system.
   ------------------------------------------------------------------------- */

.maSwatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.maSwatch--red  { background: var(--danger); }
.maSwatch--blue { background: var(--brandColor3); }


/* ---------- Section 13 addition — after .maChoiceChip block --------------
   .maTeamBadge — interactive team assignment button.
   Visually similar to maPill but is a <button>, not a display element.
   Used in the Manage Teams module roster to assign players to T1 / T2.
   ------------------------------------------------------------------------- */

.maTeamBadge {
  font-size: var(--pillValueSize);
  font-weight: var(--fwExtrabold);
  padding: 3px 9px;
  border-radius: var(--pillRadius);
  border: 1px solid;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--fontFamilyBase);
  line-height: 1.4;
  background: transparent;
}

.maTeamBadge:active {
  transform: scale(.96);
}

.maTeamBadge:disabled {
  opacity: .55;
  cursor: default;
  transform: none;
}

/* Color variants — inactive (outline) state */
.maTeamBadge--red {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  background: color-mix(in srgb, var(--danger) 6%, white);
}

.maTeamBadge--blue {
  color: var(--brandColor3);
  border-color: color-mix(in srgb, var(--brandColor3) 35%, transparent);
  background: color-mix(in srgb, var(--brandColor3) 6%, white);
}

.maTeamBadge--none {
  color: var(--mutedText);
  border-color: var(--borderSubtle);
  background: transparent;
}

/* Active (filled) state — player is assigned to this team */
.maTeamBadge--red.is-active {
  background: var(--danger);
  color: #ffffff;
  border-color: color-mix(in srgb, var(--danger) 80%, black);
}

.maTeamBadge--blue.is-active {
  background: var(--brandColor3);
  color: #ffffff;
  border-color: color-mix(in srgb, var(--brandColor3) 80%, black);
}

.maTeamBadge--none.is-active {
  background: var(--mutedText);
  color: #ffffff;
  border-color: var(--mutedText);
}


/* ==========================================================================
   21. SOURCE MODULE SHARED VOCABULARY
   Phase 1 — CSS Foundation
   Promoted from game_players.css gp* classes.
   All source modules (MA.ghinSearch, MA.favoritesSource, MA.nonRatedSource,
   MA.eventRosterSource) and their host pages (game_players, event_roster)
   reference only these shared names — no gp* class names.

   Sub-sections:
     21a. (retired 2026-11-05 — list row grid variants)
     21b. Icon button variants (enrollment indicators)
     21c. Clearable input wrapper
     21d. Multi-add toggle strip
     21e. Button modifier variants
     21f. Inline status / feedback band
     21g. Utility
   ========================================================================== */


/* ---------- 21b. Icon button variants — enrollment indicators ------------
   Applied to .iconBtn elements that serve as enroll / already-enrolled
   indicators in source module rows. .iconBtn:disabled { opacity: 1 } in
   Section 14 ensures these remain fully visible when non-interactive.
   ------------------------------------------------------------------------- */

/* Blue + — player not yet enrolled; tapping initiates enrollment */
.iconBtn--add {
  border-color: var(--brandAccent);
  color: var(--brandAccent);
}

/* Green checkmark — player already enrolled; non-interactive */
.iconBtn--check {
  border-color: var(--brandPrimary);
  color: var(--brandPrimary);
}

/* Compact 20px size — for toggles inside small dividers (see
   .maListRow__group--collapsible). Pair with a 14px icon. */
.iconBtn--sm {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}


/* ---------- 21c. Clearable input wrapper ---------------------------------
   Wraps a .maTextInput with an absolutely-positioned × clear button.
   Replaces gpInputClearWrap / clearBtn.

   Markup pattern:
     <div class="maInputWrap--clearable">
       <input class="maTextInput" …>
       <button class="maClearBtn isHidden" type="button">×</button>
     </div>
   ------------------------------------------------------------------------- */

.maInputWrap--clearable {
  position: relative;
}

/* Push right padding so text doesn't slide under the × button */
.maInputWrap--clearable .maTextInput {
  padding-right: 30px;
}

/* Position the × button inside the right edge of the input */
.maInputWrap--clearable .maClearBtn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}

/* The × button itself */
.maClearBtn {
  border: 0;
  background: transparent;
  color: var(--mutedText);
  width: 24px;
  height: 24px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.maClearBtn:hover {
  background: rgba(0, 0, 0, .06);
}


/* ---------- 21d. Multi-add toggle strip ----------------------------------
   Thin band above the list body showing "Select All / Clear All" actions.
   Replaces gpMultiSelectToggle / gpMultiSelectToggle__text.

   Markup pattern:
     <div class="maMultiToggle">
       <span class="maMultiToggle__action" data-act="select-all">Select All</span>
       &nbsp;·&nbsp;
       <span class="maMultiToggle__action" data-act="clear-all">Clear All</span>
     </div>
   ------------------------------------------------------------------------- */

.maMultiToggle {
  padding: 5px 12px;
  border-bottom: 0.5px solid var(--borderSubtle);
  background: var(--rowBgDefault);
}

.maMultiToggle__action {
  font-size: 0.875rem;  /* 14px (owner 2026-11-04) */
  font-weight: var(--fwMedium);
  color: var(--brandAccent);
  cursor: pointer;
  user-select: none;
}

.maMultiToggle__action:hover {
  text-decoration: underline;
}


/* ---------- 21e. Button modifier variants --------------------------------
   Applied alongside the base .btn class.
   Replaces inline styles previously used for Update Player / Cancel buttons.
   ------------------------------------------------------------------------- */

/* Green confirm — primary action (Update Player, Confirm) */
.btn--confirm {
  background: var(--brandPrimary);
  color: #fff;
  border-color: var(--brandPrimary);
}

.btn--confirm:active {
  filter: brightness(.93);
}

/* Red danger — destructive / cancel action */
.btn--danger {
  color: var(--danger);
  border-color: rgba(198, 40, 40, .3);
}

.btn--danger:active {
  background: color-mix(in srgb, var(--danger) 8%, white);
}


/* ---------- 21f. Inline status / feedback band ---------------------------
   Narrow tinted band rendered below the controls area inside a source
   module to show result counts, truncation warnings, or search hints.
   Replaces gpInlineStatus / maInlineAlert--warn.
   ------------------------------------------------------------------------- */

.maInlineStatus {
  padding: var(--spaceMd) 8px;
  font-size: var(--fsMeta);
  font-weight: var(--fwSemibold);
  color: var(--mutedText);
  border-bottom: 1px solid var(--borderSubtle);
}


/* ---------- 21g. Utility ------------------------------------------------- */

/* Global display:none — replaces the scoped .clearBtn.isHidden pattern.
   Applied by JS on any element that should be hidden without layout impact.
   The !important mirrors the intent of the original scoped rule and prevents
   specificity fights with layout classes. */
.isHidden {
  display: none !important;
}


/* ---------- 21h. Canvas controls row — sort strip + action group ---------
   Generic "controls row, space-between, right-aligned action cluster"
   layout. Used above the main roster/canvas list on both Game Players
   and Event Roster (sort buttons left, Manage Teams / other actions
   right). Promoted from page-scoped gpCanvasControls — purely
   structural, no page-specific values, so it belongs here rather than
   duplicated per page.
   ------------------------------------------------------------------------- */

.maCanvasControls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.maCanvasControls__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* A sort bar (.maSeg) in the row fills it on phones and stops at 360px on
   wider screens, so the right-hand actions stay on the same row. */
.maCanvasControls > .maSeg {
  width: auto;
  flex: 1 1 260px;
  max-width: 360px;
}

/* ---------- .maSplit — two columns side by side at EVERY screen size,
   inside a card or popup (not a page layout — that is .maPanels--2, which
   stacks on phones). __main keeps its natural width; __side takes the
   rest and stacks its items. Use only when the main column is narrow by
   nature (e.g. a compact table); otherwise stack. __side--pinned keeps the
   side column in view while the main column scrolls.
   Either may come first: the one-player scorecard puts the totals first so
   the table (the part that scrolls) sits against the scrollbar.
   First use: the one-player scorecard (Out / In / Tot + a .maGrid--fit
   table, which takes its content width here). ------------------------- */
.maSplit {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.maSplit__main {
  flex: 0 0 auto;
  min-width: 0;
}
.maSplit__side {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.maSplit__side--pinned {
  position: sticky;
  top: 0;
}

/* ---------- 21o. Score cell + shape indicators — an individual
   scorecard cell carrying a status/shape indicator (birdie/eagle/bogey).
   Confirmed genuinely novel — nothing else in the app needs "circle/box
   around a number to indicate performance relative to par." Shape
   borders stay hardcoded #000 on purpose — universal scorecard
   convention, shouldn't move with brand color. ------------------------- */

.maCell {
  position: relative;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.maCellVal {
  font-weight: var(--fwExtrabold);
}

.maCell--declared {
  background: var(--cellBgDeclared);
}

.maCell--birdie .maCellVal {
  border-radius: 999px;
  border: 1.8px solid #000;
  display: inline-flex;
  min-width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.maCell--eagle .maCellVal {
  border-radius: 999px;
  border: 1.8px double #000;
  display: inline-flex;
  min-width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.maCell--bogey .maCellVal {
  border: 1.8px solid #000;
  display: inline-flex;
  min-width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.maCell--bogeyplus .maCellVal {
  border: 2px solid #000;
  display: inline-flex;
  min-width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: inset 0 0 0 1px #000;
}

.maCellSuperscripts {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 7px;
  font-weight: var(--fwBold);
  color: var(--mutedText);
}

/* ==========================================================================
   22. MA.ui — BUSY / CONFIRM FOOTER / MODAL NOTICE / TOAST
   Additive support for MA.ui.* (ma_shared.js). Reuses existing tokens only —
   no new colors introduced.
   ========================================================================== */

/* ---------- Busy overlay body (MA.ui.showBusy) --------------------------- */
.maModal--busy .maModal__body,
.maModalBusy__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 20px;
  text-align: center;
}

.maModalBusy__spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--borderSubtle);
  border-top-color: var(--brandAccent);
  animation: maSpin 0.8s linear infinite;
}

.maModalBusy__title {
  font-family: var(--fontFamilyBase);
  font-size: var(--modalTitleSize);
  font-weight: var(--fwBlack);
  color: var(--ink);
}

.maModalBusy__message {
  font-family: var(--fontFamilyBase);
  font-size: var(--fieldValueSize);
  color: var(--mutedText);
  line-height: 1.5;
}

@keyframes maSpin {
  to { transform: rotate(360deg); }
}

/* ---------- Confirm/info footer buttons (MA.ui.confirm) ------------------ */
.maModalFtr--right {
  justify-content: flex-end;
}

.maModalFtr__btn {
  height: 38px;
  padding: 0 var(--btnPadX);
  border-radius: var(--controlRadius);
  border: 1px solid transparent;
  font-family: var(--fontFamilyBase);
  font-size: 13px;
  font-weight: var(--fwExtrabold);
  cursor: pointer;
}

.maModalFtr__btn:active {
  transform: scale(.98);
}

.maModalFtr__btn--cancel {
  background: var(--btnCancelBg);
  color: var(--btnCancelText);
  border-color: var(--btnCancelBorder);
}

.maModalFtr__btn--confirm {
  background: var(--btnSaveBg);
  color: #ffffff;
}

.maModalFtr__btn--danger {
  background: var(--danger);
  color: #ffffff;
}

/* ---------- Modal notice band tone (MA.ui.showModalNotice) --------------- */
/* .maInlineStatus already exists (Sec 21f) for neutral bands; these add tone. */
.maInlineStatus.status-info    { background: var(--statusInfoBg);    color: var(--statusInfoText); }
.maInlineStatus.status-success { background: var(--statusSuccessBg); color: var(--statusSuccessText); }
.maInlineStatus.status-warn    { background: var(--statusWarnBg);    color: var(--statusWarnText); }
.maInlineStatus.status-danger  { background: var(--statusDangerBg);  color: var(--statusDangerText); }

/* ---------- Toast (MA.ui.notify, shown only while a modal is open) ------- */
:root {
  --toastZ: 100000; /* above --overlayZ (99990) so it's never hidden behind a modal */
}

/* Sits just above the bottom nav bar (never over the Navigate button / icon
   bar): bar height + footer bottom padding + a small gap + safe area. */
.maToast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--navBarHeight) + 16px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px);
  z-index: var(--toastZ);
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: var(--radiusMd);
  box-shadow: var(--modalShadow);
  font-family: var(--fontFamilyBase);
  font-size: 13px;
  font-weight: var(--fwBold);
  text-align: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}

.maToast.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.maToast.status-info    { background: var(--statusInfoBg);    color: var(--statusInfoText); }
.maToast.status-success { background: var(--statusSuccessBg); color: var(--statusSuccessText); }
.maToast.status-warn    { background: var(--statusWarnBg);    color: var(--statusWarnText); }
.maToast.status-danger  { background: var(--statusDangerBg);  color: var(--statusDangerText); }

@media (max-width: 600px) {
  .maToast {
    left: 12px;
    right: 12px;
    bottom: calc(var(--navBarHeight) + 12px + env(safe-area-inset-bottom));
    max-width: none;
    transform: translateY(8px);
  }

  .maToast.is-open {
    transform: translateY(0);
  }
}

/* ---------- Callout (MA.ui.callout) --------------------------------------
   A floating note that points at one field: parchment card, dark outline,
   optional title, short text, a "Got it!" button. Positioned (fixed) by
   MA.ui.callout() beside its target; the arrow is the ::before (outline)
   and ::after (fill) triangles, slid along the edge by --maCalloutArrow.
   Above the page and its chrome; below the hub tray (1000) and every
   modal overlay, so a dialog always covers it.
   First use: My Scores, a score copied from the group scorer. */
.maCallout {
  position: fixed;
  z-index: 900;
  width: min(260px, calc(100vw - 24px));
  box-sizing: border-box;
  padding: 12px 14px;
  /* Parchment: the existing warm --warn gold, lightly mixed into white.
     Local to the callout (card + arrow fill share it). */
  --maCalloutBg: color-mix(in srgb, var(--warn) 16%, white);
  background: var(--maCalloutBg);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radiusMd);
  box-shadow: var(--modalShadow);
  font-family: var(--fontFamilyBase);
  --maCalloutArrow: 50%;
}

.maCallout__title {
  font-size: var(--modalTitleSize);
  font-weight: var(--fwExtrabold);
  margin-bottom: 4px;
}

.maCallout__body {
  font-size: var(--labelTextSize);
  font-weight: var(--fwSemibold);
  line-height: 1.35;
}

.maCallout__btn {
  margin-top: 10px;
  min-height: 36px;
  padding: 0 14px;
}

/* A tip's second button (Turn Tips Off), beside Got it! */
.maCallout__btn + .maCallout__btn {
  margin-left: 8px;
}

.maCallout::before,
.maCallout::after {
  content: "";
  position: absolute;
  border: 10px solid transparent;
}

/* Callout sits above its target: arrow on the bottom edge, pointing down. */
.maCallout--above::before { left: var(--maCalloutArrow); bottom: -21px; margin-left: -10px; border-top-color: var(--ink); }
.maCallout--above::after  { left: var(--maCalloutArrow); bottom: -17px; margin-left: -10px; border-top-color: var(--maCalloutBg); }
/* Below its target: arrow on the top edge, pointing up. */
.maCallout--below::before { left: var(--maCalloutArrow); top: -21px; margin-left: -10px; border-bottom-color: var(--ink); }
.maCallout--below::after  { left: var(--maCalloutArrow); top: -17px; margin-left: -10px; border-bottom-color: var(--maCalloutBg); }
/* Left of its target: arrow on the right edge, pointing right. */
.maCallout--left::before  { top: var(--maCalloutArrow); right: -21px; margin-top: -10px; border-left-color: var(--ink); }
.maCallout--left::after   { top: var(--maCalloutArrow); right: -17px; margin-top: -10px; border-left-color: var(--maCalloutBg); }
/* Right of its target: arrow on the left edge, pointing left. */
.maCallout--right::before { top: var(--maCalloutArrow); left: -21px; margin-top: -10px; border-right-color: var(--ink); }
.maCallout--right::after  { top: var(--maCalloutArrow); left: -17px; margin-top: -10px; border-right-color: var(--maCalloutBg); }
/* No pointer (arrow: false): a tip about an area, not one control. */
.maCallout--noArrow::before,
.maCallout--noArrow::after { display: none; }

/* Event-context modal header — explicit escape hatch for modules that
   self-determine portal from fetched data rather than ambient page
   state (e.g. module_menuGameSettings.js keys off a specific game's own
   dbGames_EID). In the common case this is now redundant with plain
   .maModal__hdr inheriting --layer1-bg from an ancestor .is-event-context,
   but it stays correct for the case where a module's own data disagrees
   with the page's ambient context. Derives from the same layer1 formula
   rather than hardcoding brandTertiary a second time. Modals sit at L1,
   not L2 — a full-focus overlay reads closer to a panel header in
   visual weight than a content card. */
.maModal__hdr.is-event-context {
  background: color-mix(in srgb, var(--brandTertiary) 75%, white);
  color: #ffffff;
}


/* ==========================================================================
   Rich text editor (Quill 2, assets/vendor/quill/) — .maRichText wraps the
   editor element so Quill's toolbar (inserted as a sibling) and its
   container both pick up app tokens. Used by the message composer
   (assets/modules/composeEmail.js). quill.snow.css supplies the rest.
   ========================================================================== */
.maRichText .ql-toolbar.ql-snow,
.maRichText .ql-container.ql-snow {
  border-color: var(--borderSubtle);
  background: var(--bg);
}
.maRichText .ql-toolbar.ql-snow {
  border-radius: var(--controlRadius) var(--controlRadius) 0 0;
}
.maRichText .ql-container.ql-snow {
  border-radius: 0 0 var(--controlRadius) var(--controlRadius);
  font-family: var(--fontFamilyBase);
  font-size: var(--fieldValueSize);
}
.maRichText .ql-editor {
  min-height: 160px;
  max-height: 40vh;
  overflow-y: auto;
  color: var(--ink);
}
.maRichText .ql-editor.ql-blank::before {
  color: var(--mutedText);
  font-style: normal;
}
