/* ==========================================================================
   Braidwood Sports, Stage 1 shared components. Import after tokens.css.
   Mobile first: base rules are the phone; @media (min-width: 768px) adds the
   side navigation and wider layouts. No hex values here, tokens only.
   Owner: shell lane (design system changes go through the shell lane).
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--text);
  font: var(--fw-regular) var(--fs-md)/var(--lh-body) var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); text-underline-offset: 3px; }
img, svg { display: block; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
.num { font-variant-numeric: tabular-nums; }

/* ---- Focus: one visible ring everywhere, keyboard only ---- */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
a:not([class]):focus-visible { border-radius: var(--r-xs); }
.btn:focus-visible, .chip:focus-visible, .nav-item:focus-visible { border-radius: inherit; }
/* a container focused by a script (main, a sheet) never draws a ring */
[tabindex="-1"]:focus { outline: none; }

/* ============================ APP SHELL ================================ */
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.app__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top-bar {
  position: sticky; top: 0; z-index: var(--z-nav);
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: calc(var(--top-bar-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--gutter) 0;
  background: var(--page); border-bottom: 1px solid var(--line);
}
.top-bar__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-bar__club { font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--text-2); }
.top-bar__action { flex: none; }
.main {
  flex: 1; width: 100%; max-width: var(--content-max); margin: 0 auto;
  padding: var(--sp-4) var(--gutter) calc(var(--bottom-nav-h) + var(--sp-6) + env(safe-area-inset-bottom));
}
/* no navigation on screen (sign-in, public pages): nothing to clear at the foot */
.app--bare .main { padding-bottom: var(--sp-7); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3);
  margin-bottom: var(--sp-4); }
.page-title { font-size: var(--fs-xl); line-height: var(--lh-tight); font-weight: var(--fw-bold); }
/* A heading inside a page: the shared sub-heading's look (green, the display face; design review, 15 Oct 2026). Newer screens use subsection(). */
.section-title { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: var(--fw-bold); line-height: var(--lh-tight); color: var(--accent-text); margin: var(--sp-6) 0 var(--sp-3); }
.eyebrow { font-size: var(--fs-sm); color: var(--text-2); }

/* Phone: bottom navigation, 3 to 5 labelled items */
.bottom-nav {
  position: fixed; inset: auto 0 0 0; z-index: var(--z-nav);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--panel); border-top: 1px solid var(--line);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--tap); padding: var(--sp-1) var(--sp-1);
  color: var(--text-2); text-decoration: none; font-size: var(--fs-xs); font-weight: var(--fw-medium);
  position: relative; border: 0; background: none; cursor: pointer; font-family: inherit; text-align: center;
}
.nav-item svg { width: 24px; height: 24px; }
.nav-item__icon { display: grid; place-items: center; width: 56px; height: 30px; border-radius: var(--r-pill); }
.nav-item__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Six items (Braidwood staff) at 360px wide leave 60px each: the labels get a hair smaller and the sides of each item no padding, so none is cut off. */
.bottom-nav:has(> :nth-child(6)) .nav-item { padding-inline: 0; }
.bottom-nav:has(> :nth-child(6)) .nav-item__label { font-size: 11px; letter-spacing: 0; }
.nav-item[aria-current="page"] { color: var(--text); font-weight: var(--fw-bold); }
/* The number of active games on the phone's LOS tab: the badge's shape in green (it counts, it does not warn), unlike the red attention number. */
.nav-count {
  position: absolute; top: 4px; left: calc(50% + 8px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill);
  background: var(--accent-text); color: var(--page); font-size: 11px; font-weight: var(--fw-bold);
  line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}
.nav-item[aria-current="page"] .nav-item__icon { background: var(--selected-bg); color: var(--accent-text); }
.nav-badge {
  position: absolute; top: 4px; left: calc(50% + 8px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill);
  background: var(--bad-fg); color: var(--page); font-size: 11px; font-weight: var(--fw-bold);
  line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}

/* Desktop and tablet: side navigation, same names, same order */
.side-nav { display: none; }
@media (min-width: 768px) {
  .app { flex-direction: row; }
  .bottom-nav { display: none; }
  .side-nav {
    display: flex; flex-direction: column; gap: var(--sp-1);
    position: sticky; top: 0; height: 100vh; height: 100dvh; width: var(--side-nav-w); flex: none; overflow-y: auto;
    scrollbar-width: none; /* never a scroll bar beside the menu (Grant, 22 Oct 2026); a very short window still scrolls it */
    padding: var(--sp-4) var(--sp-3); background: var(--panel); border-right: 1px solid var(--line);
  }
  .side-nav[hidden] { display: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  /* Last One Standing and the arrow that shows or hides its games (shell.js) */
  .nav-row { position: relative; }
  .nav-row > .nav-item { padding-right: 64px; }
  .nav-sub-toggle {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 4px;
    min-width: 44px; min-height: 44px; padding: 0 var(--sp-2); justify-content: center; border: 0; border-radius: var(--r-md);
    background: none; color: var(--text-2); cursor: pointer; font: inherit; font-size: 12px; font-weight: var(--fw-bold);
  }
  .nav-sub-toggle:hover { background: var(--card); color: var(--text); }
  .nav-sub-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
  .nav-sub-toggle svg { width: 16px; height: 16px; transition: transform var(--dur-2) var(--ease); }
  .nav-sub-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .nav-sub-toggle[aria-expanded="true"] .nav-sub__flag { display: none; }
  .side-nav__brand { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3) var(--sp-1);
    font-weight: var(--fw-bold); color: var(--brand-text); }
  .side-nav__club { padding: 0 var(--sp-3) var(--sp-4); font-size: var(--fs-sm); color: var(--text-2);
    overflow-wrap: break-word; }
  .side-nav__label { padding: var(--sp-4) var(--sp-3) var(--sp-1); font-size: var(--fs-xs); font-weight: var(--fw-semibold);
    color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
  .side-nav .nav-item {
    flex-direction: row; justify-content: flex-start; gap: var(--sp-3);
    min-height: var(--tap); padding: 0 var(--sp-3); border-radius: var(--r-md); font-size: var(--fs-md);
    width: 100%; text-align: left;
  }
  .side-nav .nav-item__icon { width: auto; height: auto; background: none !important; }
  .side-nav .nav-item__label { overflow: visible; white-space: normal; }
  .side-nav .nav-item:hover { background: var(--card); color: var(--text); }
  .side-nav .nav-item[aria-current="page"] { background: var(--selected-bg); }
  .side-nav .nav-badge { position: static; margin-left: auto; }
  .side-nav__foot { margin-top: auto; padding-top: var(--sp-4); display: grid; gap: var(--sp-1);
    border-top: 1px solid var(--line); }
  .side-nav .nav-item--account { align-items: center; }
  .side-nav .nav-item--account .nav-item__text { display: grid; gap: 0; line-height: 1.25; min-width: 0; }
  .side-nav .nav-item--account small { font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--text-2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* a wide screen shows the club in the side navigation and the page title in the page itself */
  .top-bar--phone { display: none; }
  .main { padding: var(--sp-6) var(--gutter-lg) var(--sp-9); }
  .app--bare .main { padding-bottom: var(--sp-9); }
  .page-title { font-size: var(--fs-2xl); }
}

/* ============================== BUTTONS ================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--ctl-h); min-width: var(--tap); padding: 0 var(--sp-5);
  background: transparent; border: 1px solid transparent; border-radius: var(--r-md);
  font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--secondary { background: var(--secondary-bg); color: var(--text); }
.btn--secondary:hover { background: var(--secondary-hover); }
.btn--ghost { background: transparent; color: var(--accent-text); }
.btn--ghost:hover { background: var(--secondary-bg); }
.btn--outline { background: transparent; color: var(--text); border-color: var(--control-line); }
/* A secondary action that should stand out without being the one solid green button: green edge, green words (Grant, 15 Oct 2026). */
.btn--accent { background: transparent; color: var(--accent-text); border-color: var(--primary); }
.btn--accent:hover { background: var(--selected-bg); }
.btn--sm svg { width: 18px; height: 18px; }
/* Warning style: ONLY on the final named button of a serious action */
.btn--danger { background: var(--danger-fill); color: var(--on-danger); }
.btn--danger-quiet { background: transparent; color: var(--bad-fg); border-color: var(--bad-line); }
.btn--sm { min-height: var(--ctl-h-sm); padding: 0 var(--sp-4); font-size: var(--fs-sm); }
.btn--lg { min-height: var(--ctl-h-lg); font-size: var(--fs-md); }
.btn--block { display: flex; width: 100%; }
.btn--icon { padding: 0; width: var(--tap); min-height: var(--tap); border-radius: var(--r-pill); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.btn-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.btn-row--stack { flex-direction: column-reverse; }  /* phone: primary ends up nearest the thumb */
@media (min-width: 768px) { .btn-row--stack { flex-direction: row; justify-content: flex-end; } }

/* =============================== INPUTS ================================ */
.field { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text); }
.hint { font-size: var(--fs-sm); color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; min-height: var(--ctl-h); padding: 0 var(--sp-4);
  background: var(--card); color: var(--text); font-size: var(--fs-md); /* 16px: no iOS zoom */
  border: 1px solid var(--control-line); border-radius: var(--r-sm);
}
.textarea { padding: var(--sp-3) var(--sp-4); min-height: 96px; resize: vertical; }
.input::placeholder { color: var(--text-3); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline-offset: 0; border-color: var(--focus); }
.field--error .input, .field--error .select, .field--error .textarea, .input[aria-invalid="true"] { border-color: var(--bad-line); }
.error-text { font-size: var(--fs-sm); color: var(--bad-fg); font-weight: var(--fw-medium); }
.field__msg:empty { display: none; }
.input--code { font-size: var(--fs-xl); font-weight: var(--fw-semibold); letter-spacing: .35em; text-align: center;
  font-variant-numeric: tabular-nums; padding-left: calc(var(--sp-4) + .35em); }
.input--code::placeholder { letter-spacing: .35em; }

/* =============================== SEARCH ================================ */
.search { position: relative; display: flex; gap: var(--sp-2); }
.search__input {
  flex: 1; min-width: 0; min-height: var(--ctl-h); padding: 0 var(--sp-4) 0 44px;
  background: var(--card); border: 1px solid var(--control-line); border-radius: var(--r-md);
  font-size: var(--fs-md); color: var(--text);
}
.search__input::placeholder { color: var(--text-3); }
.search__icon { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--text-2); pointer-events: none; }
/* Search and Filter stay pinned while the list scrolls. Its background (none at rest, glass once pinned) is in effects.css. */
.list-tools { position: sticky; top: calc(var(--top-bar-h) + env(safe-area-inset-top)); z-index: 5;
  padding: var(--sp-2) 0 var(--sp-3); display: grid; gap: var(--sp-3); }
@media (min-width: 768px) { .list-tools { top: 0; } } /* no top bar on a wide screen: pin to the very top (after the rule above, so it wins) */

/* ========================= FILTER CONTROLS ============================= */
.chip-row { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter);
  mask-image: linear-gradient(90deg, black 85%, transparent); } /* fade = scroll cue */
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: var(--tap); padding: 0 var(--sp-4); border-radius: var(--r-pill);
  background: transparent; color: var(--text); border: 1px solid var(--control-line);
  font-size: var(--fs-sm); font-weight: var(--fw-medium); cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--selected-bg); border-color: var(--accent-text); color: var(--text); }
.chip[aria-pressed="true"]::before { content: ""; width: 14px; height: 8px; margin-top: -3px;
  border: solid var(--accent-text); border-width: 0 0 2px 2px; rotate: -45deg; } /* tick, not colour alone */
.chip__count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--primary); color: var(--on-primary); font-size: var(--fs-xs); font-weight: var(--fw-bold);
  display: inline-grid; place-items: center; }
/* A group of chips that wraps (core/chip-fit.js sets --chip-cols): even columns, and every row fills the width, so there is never a ragged
   gap or a chip on a line of its own (Grant, 22 Oct 2026). */
.chip-fit { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip-fit > * { flex: 1 0 calc((100% - (var(--chip-cols, 1) - 1) * var(--sp-2)) / var(--chip-cols, 1) - 0.5px); min-width: 0; justify-content: center; }
/* applied filter: removable, the whole chip is the remove button */
.chip--applied { background: var(--secondary-bg); border-color: transparent; }
.chip--applied::after { content: "\00D7"; font-size: 18px; line-height: 1; color: var(--text-2); }
.filter-summary { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-2); }

/* ============================= LIST ROWS =============================== */
.list { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--r-md);
  box-shadow: var(--shadow-1); overflow: hidden; }
.row {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; column-gap: var(--sp-3);
  min-height: 72px; padding: var(--sp-3) var(--sp-4);
  color: var(--text); text-decoration: none; position: relative;
}
.list > li + li > .row { border-top: 1px solid var(--line); }
a.row:hover, button.row:hover { background: var(--raised); }
button.row { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; }
.avatar { width: 40px; height: 40px; border-radius: var(--r-pill); display: grid; place-items: center;
  background: var(--secondary-bg); color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.row__main { min-width: 0; display: grid; gap: 2px; }
.row__name { font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__meta { font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__membership { margin-top: 4px; display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.row__side { display: grid; justify-items: end; gap: 6px; text-align: right; }
.row__amount { font-size: var(--fs-sm); color: var(--text-2); font-variant-numeric: tabular-nums; }
.row__sub { font-size: var(--fs-sm); color: var(--text-2); }

/* A plain navigation list (the Club list on a phone): one label per row, a chevron, 56 px tall */
.nav-list__link {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  width: 100%; min-height: 56px; padding: 0 var(--sp-4); background: none; border: 0; text-align: left;
  color: var(--text); text-decoration: none; font-size: var(--fs-md); font-weight: var(--fw-semibold); cursor: pointer;
}
.nav-list__link::after { content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px;
  border: solid var(--text-2); border-width: 2px 2px 0 0; rotate: 45deg; }
.nav-list__link:hover { background: var(--raised); }
.nav-list__link:focus-visible { outline-offset: -3px; }
.nav-list__note { font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--text-2); margin-left: auto; }
.list > li + li > .nav-list__link { border-top: 1px solid var(--line); }

/* A small "Paid for by Grainne Coyle" note under a name (plain words, no icon). */
.paid-by, .managed-by { font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================== STATUS SYSTEM ============================= */
/* ONE colour system for every status on the whole site (Grant, 7 October 2026: "colour coding like this quickly catches the eye").
   It replaces the earlier rule that normal states stay uncoloured and only exceptions get a tint.
     GREEN  --ok-*    Paid, Paid (cash); a membership that is Active; a card or Direct Debit in place
     RED    --bad-*   Failed, Arrears; a card or mandate that failed or expired
     AMBER  --warn-*  waiting, or needs a nudge: Due, Partial, Setup needed, Card expiring, Awaiting approval, Paused, Ending
     BLUE   --info-*  neutral or informational: None due, Cancelled or Ended, a change waiting to happen, a join request's details
     GREY   --neu-*   an untinted label that is not a status at all (a role, "Auto", "Not a member")
   Two families, never mixed, in the data, the API and every screen (AGENTS.md rule 5):
     STATUS   .m-tag  : small SQUARE-cornered caps tag, no glyph.        "Is this person in the club?"
     PAYMENT  .p-pill : ROUND bordered pill with its own SHAPE glyph.    "Is the money OK?"
   Colour is never the only signal: every label keeps its words and every pill has its own glyph shape (circle, square,
   ring, half circle, hollow square, triangle, diamond, dash). Every foreground/background pair is at least 4.5 to 1 and every
   edge and glyph at least 3 to 1, light and dark (test/unit/status-colours.test.js reads this file and the tokens).
   The tone is one set of three custom properties (--t-bg, --t-fg, --t-line); .tone-ok/-warn/-bad/-info/-neu set them, so any
   other chip, dot or banner on the site can use the same colours. Each carries a hidden prefix ("Status:" / "Payment:") for screen readers. */
.tone-ok,   .m-tag--active, .m-tag--ok,       .p-pill--paid,    .p-pill--manual  { --t-bg: var(--ok-bg);   --t-fg: var(--ok-fg);   --t-line: var(--ok-line); }
.tone-warn, .m-tag--pending, .m-tag--paused, .m-tag--ending, .m-tag--warn,
.p-pill--due, .p-pill--partial, .p-pill--setup, .p-pill--expiring                { --t-bg: var(--warn-bg); --t-fg: var(--warn-fg); --t-line: var(--warn-line); }
.tone-bad,  .m-tag--bad,                      .p-pill--failed,  .p-pill--arrears { --t-bg: var(--bad-bg);  --t-fg: var(--bad-fg);  --t-line: var(--bad-line); }
.tone-info, .m-tag--ended, .m-tag--info, .m-tag--admin,      .p-pill--none                      { --t-bg: var(--info-bg); --t-fg: var(--info-fg); --t-line: var(--info-line); }
.tone-neu                                                                        { --t-bg: var(--neu-bg);  --t-fg: var(--neu-fg);  --t-line: var(--neu-line); }

.m-tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px; border-radius: var(--r-xs);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .03em; text-transform: uppercase;
  background: var(--t-bg, var(--neu-bg)); color: var(--t-fg, var(--neu-fg)); white-space: nowrap;
}
.m-tag__note { font-weight: var(--fw-medium); letter-spacing: 0; text-transform: none; font-size: var(--fs-sm); }

.p-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px 0 8px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); white-space: nowrap;
  background: var(--t-bg, var(--neu-bg)); color: var(--t-fg, var(--neu-fg)); border: 1.5px solid var(--t-line, var(--neu-line));
  --glyph: var(--t-line, var(--neu-line));
}
.p-pill::before { content: ""; width: 10px; height: 10px; flex: none; background: var(--glyph); }
/* one glyph shape per state, so each reads without colour */
.p-pill--paid::before    { border-radius: 50%; }                                                    /* filled circle */
.p-pill--manual::before  { border-radius: 2px; }                                                    /* filled square (Paid, cash) */
.p-pill--due::before     { background: none; border: 2px solid var(--glyph); border-radius: 50%; }  /* ring */
.p-pill--partial::before { border-radius: 50%; background: linear-gradient(90deg, var(--glyph) 50%, transparent 50%);
  box-shadow: inset 0 0 0 2px var(--glyph); }                                                       /* half circle */
.p-pill--setup::before   { background: none; border: 2px solid var(--glyph); border-radius: 2px; }  /* hollow square */
/* The payment pills that need doing are filled (Grant, 19 Oct 2026, option B): solid amber or red with dark or white words and glyph, so
   they stand out in a long list. Paid and Paid (cash) stay a calm green outline, and None due its dashed one. */
.p-pill--due, .p-pill--partial, .p-pill--setup, .p-pill--expiring { background: var(--warn-fill); color: var(--on-warn-fill); border-color: var(--warn-fill); --glyph: var(--on-warn-fill); }
.p-pill--failed, .p-pill--arrears { background: var(--bad-fill); color: var(--on-bad-fill); border-color: var(--bad-fill); --glyph: var(--on-bad-fill); }
.p-pill--failed::before  { width: 12px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }            /* triangle */
.p-pill--arrears::before { rotate: 45deg; width: 9px; height: 9px; }                                /* diamond */
.p-pill--none            { border-style: dashed; }
.p-pill--none::before    { width: 10px; height: 2px; }                                              /* dash */

/* Profile / detail: the two families sit in two labelled blocks */
.status-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.status-block { background: var(--card); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); display: grid; gap: var(--sp-2); }
.status-block__label { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-2);
  text-transform: uppercase; letter-spacing: .04em; }

/* =========================== SUMMARY TILES ============================= */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
@media (min-width: 768px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  display: grid; gap: var(--sp-1); align-content: start; min-height: 96px;
  padding: var(--sp-4); background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow-1);
  color: var(--text); text-decoration: none; position: relative; border: 1px solid transparent;
}
a.tile:hover { background: var(--raised); }
.tile__label { font-size: var(--fs-sm); color: var(--text-2); font-weight: var(--fw-medium); }
.tile__value { font-size: var(--fs-2xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); font-variant-numeric: tabular-nums; }
.tile__note { font-size: var(--fs-sm); color: var(--text-2); }
/* an attention tile gets a left edge, not a full colour flood */
.tile--attention { border-left: 4px solid var(--warn-line); }
.tile--alert { border-left: 4px solid var(--bad-line); }
.tile--alert .tile__note { color: var(--bad-fg); }

/* Attention list: the dashboard's main job */
.attention { display: grid; gap: var(--sp-2); }
.attention-item { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-3); align-items: center;
  min-height: 64px; padding: var(--sp-3) var(--sp-4); background: var(--card); border-radius: var(--r-md);
  color: var(--text); text-decoration: none; box-shadow: var(--shadow-1); }
.attention-item__count { min-width: 36px; height: 36px; border-radius: var(--r-pill); display: grid; place-items: center;
  font-weight: var(--fw-bold); background: var(--secondary-bg); }

/* ============================ BOTTOM SHEET ============================= */
/* One sheet on screen at a time. Bottom sheet on a phone, centred dialog from 768 px. The finishing
   action is pinned in the foot and the body scrolls. Built by openSheet() in js/core/ui.js. */
html.has-sheet { overflow: hidden; }
.scrim { position: fixed; inset: 0; background: var(--overlay); z-index: var(--z-sheet);
  animation: bw-fade var(--dur-3) var(--ease); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: calc(var(--z-sheet) + 1);
  max-height: 85vh; max-height: 85dvh; display: flex; flex-direction: column;
  background: var(--raised); color: var(--text); box-shadow: var(--shadow-3);
  border-radius: var(--r-xl) var(--r-xl) 0 0; padding-bottom: env(safe-area-inset-bottom);
  animation: bw-sheet-in var(--dur-3) var(--ease);
}
.sheet__grip { width: 36px; height: 4px; border-radius: 2px; background: var(--control-line); margin: var(--sp-2) auto 0; flex: none; }
.sheet__head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-5); flex: none; }
.sheet__title { flex: 1; font-size: var(--fs-lg); font-weight: var(--fw-semibold); min-width: 0; overflow-wrap: anywhere; }
.sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--sp-5) var(--sp-4); flex: 1 1 auto; min-height: 0; }
.sheet__desc { color: var(--text-2); margin-bottom: var(--sp-4); }
.sheet__error { margin: 0 var(--sp-5) var(--sp-3); padding: var(--sp-3) var(--sp-4); flex: none;
  border-radius: var(--r-sm); background: var(--bad-bg); color: var(--bad-fg); border: 1px solid var(--bad-line);
  font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.sheet__foot { padding: var(--sp-3) var(--sp-5) var(--sp-4); border-top: 1px solid var(--line); display: flex; gap: var(--sp-3); flex: none; } /* pinned action */
.sheet__foot .btn { flex: 1; }
.sheet-group { margin-top: var(--sp-3); }
.sheet-group__label { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; padding: var(--sp-2) 0; }
.sheet-action { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 52px; padding: 0 var(--sp-2);
  background: none; border: 0; border-radius: var(--r-sm); color: var(--text); text-align: left; cursor: pointer; font-size: var(--fs-md);
  text-decoration: none; }
.sheet-action:hover { background: var(--secondary-bg); }
.sheet-action--danger { color: var(--bad-fg); margin-top: var(--sp-3); border-top: 1px solid var(--line); border-radius: 0; }
@media (min-width: 768px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; translate: -50% -50%; width: min(480px, 92vw);
    border-radius: var(--r-lg); padding-bottom: 0; }
  .sheet__grip { display: none; }
  .sheet__head { padding-top: var(--sp-4); }
}
@keyframes bw-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bw-fade { from { opacity: 0; } to { opacity: 1; } }

/* =============================== DIALOG ================================ */
.dialog {
  position: fixed; left: 50%; top: 50%; translate: -50% -50%; z-index: var(--z-dialog);
  width: min(440px, calc(100vw - 2 * var(--gutter))); max-height: 85dvh; overflow-y: auto;
  background: var(--raised); color: var(--text); border: 0; border-radius: var(--r-lg);
  box-shadow: var(--shadow-3); padding: var(--sp-6);
}
.dialog::backdrop { background: var(--overlay); }
.dialog__title { font-size: var(--fs-lg); font-weight: var(--fw-bold); margin-bottom: var(--sp-3); }
.dialog__body { color: var(--text-2); display: grid; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.consequences { margin: 0; padding-left: var(--sp-5); display: grid; gap: var(--sp-1); color: var(--text); }

/* ================================ TOAST ================================ */
/* One line, one Undo. Above the bottom bar on a phone, bottom right from 768 px. Up to three stack. */
#toast-host {
  position: fixed; z-index: var(--z-toast); left: var(--gutter); right: var(--gutter);
  bottom: calc(var(--sp-4) + env(safe-area-inset-bottom));
  display: grid; gap: var(--sp-2); pointer-events: none;
}
html.has-bottom-nav #toast-host { bottom: calc(var(--bottom-nav-h) + var(--sp-3) + env(safe-area-inset-bottom)); }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
  position: relative; overflow: hidden;
  background: var(--toast-bg); color: var(--toast-fg); border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--toast-line), var(--shadow-2);
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
  animation: bw-sheet-in var(--dur-3) var(--ease);
}
.toast__msg { flex: 1; overflow-wrap: anywhere; }
.toast .btn { color: var(--toast-fg); min-height: var(--tap); font-weight: var(--fw-bold); text-decoration: underline; }
.toast .btn:hover { background: transparent; }
.toast .btn:focus-visible { outline-color: var(--toast-fg); }
/* The bar along the foot runs down over the message's own time, and stops while the pointer or the keyboard is on it (ui.js). */
.toast__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--toast-bar); transform-origin: left center; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .toast__bar { display: none; } }
@media (min-width: 768px) {
  #toast-host, html.has-bottom-nav #toast-host { left: auto; right: var(--sp-6); bottom: var(--sp-6); width: 400px; }
}

/* ============================= EMPTY STATE ============================= */
.empty { display: grid; justify-items: center; text-align: center; gap: var(--sp-3);
  padding: var(--sp-9) var(--sp-5); background: var(--card); border-radius: var(--r-md); }
.empty__icon { width: 48px; height: 48px; border-radius: var(--r-pill); display: grid; place-items: center;
  background: var(--secondary-bg); color: var(--text-2); }
.empty__icon svg { width: 24px; height: 24px; }
.empty__icon--ok { background: var(--ok-bg); color: var(--ok-fg); }   /* "all clear": the one success tick */
.empty__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.empty__text { color: var(--text-2); max-width: 34ch; }

/* ============================== SKELETON =============================== */
/* Loading state: row-shaped blocks in the quiet tone. No shimmer, nothing moves (core decision 1). */
.skeleton { display: grid; gap: var(--sp-3); }
.skeleton__rows { display: grid; gap: var(--sp-2); }
.skeleton__row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: var(--sp-3); align-items: center;
  min-height: 72px; padding: var(--sp-3) var(--sp-4); background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.skeleton__dot { width: 40px; height: 40px; border-radius: var(--r-pill); background: var(--secondary-bg); }
.skeleton__lines { display: grid; gap: var(--sp-2); min-width: 0; }
.skeleton__line { height: 12px; width: 70%; border-radius: var(--r-sm); background: var(--secondary-bg); }
.skeleton__line--short { width: 42%; }
.skeleton__pill { width: 64px; height: 26px; border-radius: var(--r-pill); background: var(--secondary-bg); }

/* ============================ ERROR PANEL ============================== */
/* Error state: one plain sentence and Retry, in place. The rest of the page keeps working. */
.error-panel { display: grid; gap: var(--sp-3); justify-items: start; padding: var(--sp-5); border-radius: var(--r-md);
  background: var(--card); box-shadow: var(--shadow-1); border-left: 4px solid var(--warn-line); }
.error-panel__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.error-panel__text { color: var(--text-2); }

/* ============================== INFO TIP =============================== */
/* Label plus "i" as one 44 px button. Opens below the label; stays until dismissed (Esc, second tap, outside tap). */
.tip { display: grid; gap: var(--sp-2); justify-items: start; }
.tip__btn { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); padding: 0 var(--sp-2) 0 0;
  background: none; border: 0; border-radius: var(--r-sm); color: var(--text); font-size: var(--fs-md); font-weight: var(--fw-semibold); cursor: pointer; }
.tip__i { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%;
  border: 1.5px solid var(--control-line); color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-bold); font-style: normal; line-height: 1; }
.tip__btn[aria-expanded="true"] .tip__i { background: var(--selected-bg); border-color: var(--accent-text); color: var(--accent-text); }
.tip__body { max-width: 44ch; padding: var(--sp-3) var(--sp-4); background: var(--raised); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); font-size: var(--fs-sm); }

/* ============================ SEGMENTED CHOICE ========================= */
/* A short either/or choice (theme: Match device, Light, Dark). Whole option taps; the choice shows tint, weight and a tick. */
.seg { border: 0; margin: 0; padding: 0; min-width: 0; }
.seg > legend { padding: 0; margin-bottom: var(--sp-2); }
.seg__group { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2px; padding: 2px; background: var(--card);
  border: 1px solid var(--control-line); border-radius: var(--r-md); }
.seg__opt { position: relative; display: block; min-width: 0; cursor: pointer; }
/* Club colours On / Off (core/club-mark.js): two options, so two equal halves */
.club-colours-switch .seg__group { grid-template-columns: 1fr 1fr; }
.club-colours-switch .hint { margin: var(--sp-2) 0 0; }
.seg__opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg__opt span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 0 var(--sp-2);
  border-radius: calc(var(--r-md) - 2px); font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text); text-align: center; }
.seg__opt input:checked + span { background: var(--selected-bg); font-weight: var(--fw-bold); box-shadow: inset 0 0 0 2px var(--accent-text); }
.seg__opt input:checked + span::before { content: ""; width: 12px; height: 7px; margin-top: -3px; flex: none;
  border: solid var(--accent-text); border-width: 0 0 2px 2px; rotate: -45deg; }
.seg__opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.seg__opt:hover input:not(:checked) + span { background: var(--secondary-bg); }

/* ======================= LAST ONE STANDING TICKER ====================== */
/* Only inside LOS screens. The games travel across the strip. The label stays put. */
.los-ticker { display: flex; gap: var(--sp-3); overflow: hidden; align-items: center; min-width: 0;
  margin: 0 calc(-1 * var(--gutter)) var(--sp-4); padding: var(--sp-2) var(--gutter);
  background: var(--panel); border-block: 1px solid var(--line); }
.los-ticker__row { display: flex; flex: 1; min-width: 0; overflow: hidden; }
.los-ticker__track { display: flex; flex: none; align-items: stretch; gap: var(--sp-2); min-width: 100%;
  padding-right: var(--sp-2); animation: los-tick var(--los-tick, 32s) linear infinite; }
.los-ticker:hover .los-ticker__track, .los-ticker:focus-within .los-ticker__track { animation-play-state: paused; }
@keyframes los-tick { to { translate: -100% 0; } }
.los-ticker__label { flex: none; align-self: center; font-size: var(--fs-xs); font-weight: var(--fw-bold);
  color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; padding-right: var(--sp-2); white-space: nowrap; }
.fixture { flex: none; display: grid; grid-template-columns: 1fr auto; column-gap: var(--sp-3); row-gap: 2px;
  min-width: 148px; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); background: var(--card);
  font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.fixture__team { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fixture__score { font-weight: var(--fw-bold); text-align: right; }
.fixture__state { grid-column: 1 / -1; font-size: var(--fs-xs); color: var(--text-2); }
.fixture__state--live { color: var(--accent-text); font-weight: var(--fw-bold); }
.fixture__state--live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; margin-right: 5px; translate: 0 -1px; }
@media (min-width: 768px) { .los-ticker { margin: 0 0 var(--sp-5); border-radius: var(--r-md); border: 1px solid var(--line); } }

/* =============================== MISC ================================== */
.card { background: var(--card); border-radius: var(--r-md); padding: var(--sp-4); box-shadow: var(--shadow-1); }
.panel { background: var(--panel); border-radius: var(--r-lg); padding: var(--sp-4); }
.stack { display: grid; gap: var(--sp-4); }
.theme-toggle { min-height: var(--tap); }

/* Switch club: in the top bar for anyone in more than one club */
.top-bar__switch { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; white-space: nowrap; }
.top-bar__switch svg { width: 18px; height: 18px; }
.club-pick__btn { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; width: 100%; }
.club-pick__name { font-weight: 600; }

/* Import members: four steps (Add, Check, Type, Confirm), one layout that opens out on a desktop (Grant, 20 Oct 2026). */
.imp { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4, 16px); max-width: 1040px; }
.imp > *, .imp .card > * { min-width: 0; }
.imp .card { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4, 16px); padding: var(--sp-5, 20px); align-content: start; }
.imp__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.imp .btn { min-height: 44px; }
.imp__file { min-height: 44px; width: 100%; max-width: 100%; min-width: 0; }
.imp__title { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); margin: 0; color: var(--text); }
.imp__title:focus { outline: none; }
.imp__sub { margin: calc(var(--sp-2, 8px) * -1) 0 0; }
.imp .hint { margin: 0; }
/* The steps: a bar for each, filled when done or current. A finished step is a button that goes back to it. */
.imp__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.imp__step-btn { display: grid; gap: 6px; width: 100%; min-height: 44px; align-content: center; padding: 0; border: 0; background: none; color: var(--text-2); font: inherit; text-align: left; }
button.imp__step-btn { cursor: pointer; }
.imp__step-bar { height: 6px; border-radius: 3px; background: var(--line); }
.imp__step.is-done .imp__step-bar, .imp__step.is-here .imp__step-bar { background: var(--accent-text); }
.imp__step-label { font-size: var(--fs-sm); display: flex; align-items: baseline; gap: 4px; }
.imp__step.is-here .imp__step-label { color: var(--text); font-weight: var(--fw-bold); }
.imp__step-n { display: inline-grid; place-items: center; min-width: 1.4em; height: 1.4em; border-radius: 50%; border: 1px solid currentColor; font-size: var(--fs-xs); }
.imp__step.is-done .imp__step-n { background: var(--accent-text); border-color: var(--accent-text); color: var(--card); }
/* Step 1 */
.imp__cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4, 16px); }
.imp__col { display: grid; gap: var(--sp-2, 8px); align-content: start; }
@media (min-width: 900px) { .imp__cols { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--sp-6, 24px); } }
.imp__waiting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
/* Step 2 */
.imp__tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.imp__tile { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); text-align: center; font-size: var(--fs-sm); }
.imp__tile .num { font-size: var(--fs-xl); line-height: 1.1; }
.imp__tile--ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-fg); }
.imp__tile--warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-fg); }
.imp__group { display: grid; gap: var(--sp-3, 12px); padding: var(--sp-4, 16px); border: 1px solid var(--line); border-radius: var(--r-md); }
.imp__group--warn { border-color: var(--warn-line); background: var(--warn-bg); }
.imp__group--ok { border-color: var(--ok-line); }
.imp__group-head { display: flex; align-items: flex-start; gap: 12px; }
.imp__grow { flex: 1 1 auto; min-width: 0; }
.imp__group-head .btn { flex: none; }
.imp__group-title { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.imp__price { font-weight: var(--fw-regular); font-size: var(--fs-sm); color: var(--text-2); }
.imp__count { flex: none; display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px; background: var(--text-2); color: var(--card); font-weight: var(--fw-bold); font-size: var(--fs-sm); }
.imp__group--warn .imp__count { background: var(--warn-fill); color: var(--on-warn-fill); }
.imp__group--ok .imp__count { background: var(--ok-fill); color: var(--on-ok-fill); }
.imp__group--warn .hint, .imp__group--warn .imp__meta { color: var(--warn-fg); }
.imp__list, .imp__plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.imp__plain li { padding: 2px 0; }
.imp__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.imp__row--bad { border-color: var(--warn-line); }
.imp__row .imp__who { flex: 1 1 14rem; }
.imp__who { display: grid; gap: 2px; min-width: 0; }
.imp__meta { color: var(--text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.imp__why { color: var(--warn-fg); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.imp__row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.imp__row-actions .btn { min-height: 44px; }
.imp__ai { justify-self: start; padding: 2px 8px; border-radius: 999px; font-size: var(--fs-sm); border: 1px solid var(--line); color: var(--text-2); }
.imp__edit { display: grid; gap: 8px; width: 100%; }
.imp__field { display: grid; gap: 4px; }
@media (min-width: 900px) { .imp__edit { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; } .imp__edit .imp__actions, .imp__edit .error-text { grid-column: 1 / -1; } }
.imp__left summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: var(--fw-semibold); color: var(--accent-text); }
/* Step 3: a group for each membership; side by side where there is room */
.imp__defaults { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; min-width: 0; }
.imp__radios { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.imp__radio { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--card); }
.imp__radio span { display: grid; }
.imp__radio.is-on { border: 2px solid var(--accent-text); background: var(--selected-bg); padding: 9px 13px; }
.imp__radio input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--accent-text); }
.imp__find { display: grid; gap: 4px; max-width: 28rem; }
.imp__bar { position: sticky; top: calc(var(--top-bar-h) + env(safe-area-inset-top)); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border: 2px solid var(--accent-text); border-radius: 12px; background: var(--selected-bg); color: var(--text); }
.imp__bar-set { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
.imp__bar .btn { min-height: 44px; }
/* Payment days (a club moving over from another platform): when each person is first charged, and the day menu in the bar */
.imp__first { color: var(--text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.imp__first--soon { color: var(--warn-fg); font-weight: var(--fw-semibold); }
.imp__cashtag { color: var(--ok-fg); font-size: var(--fs-sm); font-weight: var(--fw-medium); overflow-wrap: anywhere; }
.imp__emailrule { margin: 0; }
.imp__bar-day { align-items: center; }
.imp__bar-day .select { flex: 1 1 11rem; min-width: 0; min-height: 44px; }
.imp__days { display: grid; gap: var(--sp-3, 12px); }
.imp__days > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: var(--fw-semibold); color: var(--accent-text); }
.imp__days[open] > summary { margin-bottom: var(--sp-2, 8px); }
.imp__daysum { margin: 0; }
.imp__groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3, 12px); align-items: start; }
@media (min-width: 900px) { .imp__groups { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } }
.imp__picks { list-style: none; margin: 0; padding: 0; display: grid; }
.imp__pick { display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 4px 0; border-top: 1px solid var(--line); cursor: pointer; }
.imp__tick { width: 22px; height: 22px; margin: 11px; flex: none; accent-color: var(--accent-text); cursor: pointer; }
/* Step 4 */
.imp__sum { display: grid; gap: var(--sp-4, 16px); }
@media (min-width: 900px) { .imp__sum { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; gap: var(--sp-6, 24px); } }
.imp__sum-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); }
.imp__sum-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; }
.imp__sum-list li + li { border-top: 1px solid var(--line); }
.imp__sum-n { font-size: var(--fs-xl); }
.imp__ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.imp__tick-line { position: relative; padding-left: 28px; line-height: var(--lh-body); }
.imp__tick-line::before { content: ""; position: absolute; left: 4px; top: .45em; width: 9px; height: 9px; border-radius: 50%; background: var(--ok-line); }
.imp__tick-line--warn { color: var(--warn-fg); }
.imp__tick-line--warn::before { background: var(--warn-line); }
.imp__nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.imp__nav .btn { min-height: 48px; flex: 1 1 10rem; }
@media (min-width: 600px) { .imp__nav .btn { flex: 0 1 auto; min-width: 11rem; } .imp__nav > :last-child { margin-left: auto; } }
/* The import screen's notices (also styled in settings.css, which is not loaded when this screen is opened first). */
.imp .notice { margin: 0; padding: var(--sp-3, 12px) var(--sp-4, 16px); border-radius: var(--r-md); font-size: var(--fs-sm); background: var(--info-bg); color: var(--info-fg); }
.imp .notice--warn { background: var(--warn-bg); color: var(--warn-fg); }
.imp .imp__outcome { display: grid; gap: var(--sp-2); }
.imp .imp__outcome p { margin: 0; }
.imp__noemail ul { margin: var(--sp-1) 0 0; padding-left: 1.2em; }
.imp__noemail li { padding: 2px 0; }
@media (max-width: 599px) { .imp .card { padding: var(--sp-4, 16px); } .imp__step-label { font-size: var(--fs-xs); } }

.los-pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.los-pick-list .btn { min-height: 44px; width: 100%; justify-content: flex-start; }

/* Club colour swatches (Club settings and the start-a-club form) and the Club logo section. Here, not in a screen stylesheet, so they never flash unstyled. */
.logo-set { min-width: 0; }
.logo-set__top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; min-width: 0; }
.logo-set__actions { display: grid; gap: 6px; min-width: 0; flex: 1 1 12rem; }
.logo-set__upload { position: relative; max-width: 100%; }
.logo-set__file { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; opacity: 0; cursor: pointer; font-size: 0; } /* over the border too: the whole button is the target */
/* 30 colours in even rows (Grant, 19 Oct 2026): 15 a row where there is room, then 10, 6 or 5. The box, not the window, decides. */
.swatches-box { container-type: inline-size; }
.swatches { display: grid; grid-template-columns: repeat(5, 44px); gap: 6px; }
@container (min-width: 294px) { .swatches { grid-template-columns: repeat(6, 44px); } }
@container (min-width: 494px) { .swatches { grid-template-columns: repeat(10, 44px); } }
@container (min-width: 744px) { .swatches { grid-template-columns: repeat(15, 44px); } }
.swatches > .swatch--custom { grid-column: 1 / -1; justify-self: start; }
.swatch { --sw: var(--neu-line); position: relative; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; padding: 0; background: transparent; border: 0; display: grid; place-items: center; }
.swatch::before { content: ""; width: 30px; height: 30px; border-radius: 50%; background: var(--sw); border: 2px solid color-mix(in srgb, var(--text) 22%, transparent);
  box-shadow: 0 2px 6px rgb(0 0 0 / .25); transition: transform .15s, box-shadow .15s; }
.swatch:hover::before { transform: scale(1.1); }
.swatch[aria-pressed="true"]::before { transform: scale(1.12); border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sw) 40%, transparent), 0 0 14px color-mix(in srgb, var(--sw) 60%, transparent); }
.swatch:focus-visible { outline: 2px solid var(--focus, var(--primary)); outline-offset: 0; }
.swatch--custom { position: relative; width: auto; min-width: 44px; padding: 0 14px 0 8px; border-radius: 999px; gap: 8px; grid-auto-flow: column; border: 1px dashed var(--line); font-size: var(--fs-sm, .875rem); font-weight: 600; color: var(--text); }
.swatch--custom::before { content: none; }
.swatch--custom.is-on { border-style: solid; border-color: var(--sw); box-shadow: 0 0 0 2px color-mix(in srgb, var(--sw) 40%, transparent); }
.swatch__dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--text) 22%, transparent);
  background: conic-gradient(hsl(350 90% 60%), hsl(38 95% 55%), hsl(85 70% 48%), hsl(188 90% 42%), hsl(239 84% 67%), hsl(293 70% 55%), hsl(350 90% 60%)); }
.swatch--custom.is-on .swatch__dot { background: var(--sw); }
/* The real colour input sits invisibly over the whole pill, so a tap anywhere on it opens the picker. */
.swatch--custom input[type="color"] { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); padding: 0; border: 0; opacity: 0; cursor: pointer; }
.swatch--custom:focus-within { outline: 2px solid var(--focus, var(--primary)); outline-offset: 2px; }
button.swatch--custom[aria-pressed="true"] { border-style: solid; border-color: var(--text); }
@media (prefers-reduced-motion: reduce) { .swatch::before { transition: none; } }

/* Club settings: the logo tile, upload button and colour choices */
.logo-set__tile { flex: none; width: 88px; height: 88px; display: grid; place-items: center; }
.logo-set__tile .club-logo, .logo-set__tile .club-crest { --cs: 80px; width: 80px; height: 80px; border-radius: 18px; }
.logo-set__upload { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; cursor: pointer; width: max-content; }
.logo-set__upload:focus-within { outline: 2px solid var(--focus, var(--primary)); outline-offset: 2px; }
.logo-set__colours { display: grid; gap: 6px; margin-top: var(--sp-4, 16px); }
.logo-set__colours .label { margin: 0; }
.look-pv-wrap[hidden] { display: none; }
/* "How it looks": light and dark side by side (one above the other on a narrow phone). Each pane carries its own theme's surfaces and the
   club's shades as variables (club-logo-ui.js), so it looks the same whichever theme the admin is using. */
.look-pv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-3, 12px); max-width: 520px; }
.look-pv__pane { display: grid; gap: 8px; align-content: start; min-width: 0; padding: 10px; border-radius: var(--r-md, 12px); border: 1px solid var(--pv-line);
  background: linear-gradient(180deg, var(--pv-wash) 0%, var(--pv-page) 70%); color: var(--pv-text); font-size: var(--fs-sm, .875rem); }
.look-pv__label { margin: 0; font-weight: 700; }
.look-pv__band { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px 12px; border-radius: 10px;
  color: var(--club-on); background: linear-gradient(160deg, var(--club) 0%, var(--club-end) 100%);
  box-shadow: inset 0 0 0 1px var(--pv-edge); }
.look-pv__tile { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-size: 11px; font-weight: 800;
  color: var(--club); background: var(--club-on); }
.look-pv__mark { flex: none; display: grid; place-items: center; }
/* The crest on the preview band, with the same soft halo in the band's text colour as on the real top bar (effects.css .club-frame .top-bar). */
.look-pv__logo { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--club-on) 55%, transparent)); }
.look-pv__name { display: grid; min-width: 0; line-height: 1.2; }
.look-pv__name b { overflow-wrap: anywhere; }
.look-pv__name small { font-size: .75rem; font-weight: 600; }
/* Main colour / Second colour tabs over the swatches, with Swap and No second colour (Grant, 19 Oct 2026). */
.ctabs-wrap { display: grid; gap: var(--sp-3); }
.ctabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--secondary-bg); max-width: 460px; }
.ctab { --sw: transparent; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 12px; border: 0; border-radius: var(--r-sm); cursor: pointer;
  background: transparent; color: var(--text); font: inherit; font-weight: 700; text-align: left; }
.ctab[aria-selected="true"] { background: var(--card); box-shadow: 0 1px 4px rgb(0 0 0 / .18); }
.ctab:focus-visible { outline: 2px solid var(--focus, var(--primary)); outline-offset: 2px; }
.ctab__dot { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--sw); border: 2px solid color-mix(in srgb, var(--text) 22%, transparent); }
.ctab__text { display: grid; min-width: 0; line-height: 1.2; }
.ctab__name { font-size: var(--fs-xs); font-weight: 500; color: var(--text-2); }
.ctabs__acts { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.ctabs__acts .btn[hidden] { display: none; }
.look-pv__head { font-weight: 800; padding-bottom: 6px; background: linear-gradient(var(--pv-accent), var(--pv-accent)) no-repeat left bottom / 28px 3px; justify-self: start; }
.look-pv__nav { position: relative; padding: 8px 10px 8px 14px; border-radius: 8px; font-weight: 700;
  background: linear-gradient(90deg, var(--pv-hi), transparent 110%); }
.look-pv__nav::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--pv-mark); }
.look-pv__btn { display: grid; place-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; font-weight: 700; text-align: center;
  color: var(--pv-on); background: var(--pv-fill); }


/* Team crests (Last One Standing picker, ticker, tables and My membership). The crest is the picture on its own: transparent, with
   nothing behind it (no tile, no ring, no padding), drawn at its own proportions and never stretched. A team without one shows no
   picture at all, only its name. */
.crest { width: var(--s, 24px); height: var(--s, 24px); flex: none; object-fit: contain; object-position: center; }
img.crest { filter: drop-shadow(0 1px 2px rgb(0 0 0 / .25)); }
/* On the dark theme a dark crest (Newcastle, Brentford, Chelsea's navy, Fulham's black) would sink into the panel: a very thin light edge
   drawn round the crest's own outline (a filter on the picture, never a tile) keeps it readable. */
:root[data-theme="dark"] img.crest { filter: drop-shadow(0 0 1px rgb(255 255 255 / .55)) drop-shadow(0 1px 2px rgb(0 0 0 / .35)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) img.crest { filter: drop-shadow(0 0 1px rgb(255 255 255 / .55)) drop-shadow(0 1px 2px rgb(0 0 0 / .35)); } }

/* ---- Games under "Last One Standing" in the side navigation (shell.js, core/games-menu.js) ------------------------------------
   Wide screens only: a phone keeps its four tabs. Each active game is one indented line with a quiet amber count when picks are needed,
   the open game is marked, and "+ New game" closes the list. Hidden when there is no active game. */
.nav-sub { display: none; }
@media (min-width: 768px) {
  .nav-sub { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; list-style: none; margin: 0 0 var(--sp-2) calc(var(--sp-3) + 11px); padding: 0 0 0 var(--sp-2); border-left: 1px solid var(--line); }
  .nav-sub[hidden] { display: none; }
  .nav-sub__link {
    position: relative; display: flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); padding: 0 var(--sp-2) 0 var(--sp-3);
    border-radius: var(--r-md); color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); line-height: 1.25; text-decoration: none;
  }
  .nav-sub__link:hover { background: var(--card); color: var(--text); }
  .nav-sub__link[aria-current="page"] { background: var(--selected-bg); color: var(--text); font-weight: var(--fw-bold); }
  .nav-sub__link[aria-current="page"]::before {
    content: ""; position: absolute; left: -9px; top: 24%; bottom: 24%; width: 3px; border-radius: 3px; background: var(--primary);
  }
  /* margin, not padding: a clamped box clips at its padding edge, so padding let the top of a third line show under the second */
  .nav-sub__name { flex: 1; min-width: 0; margin: var(--sp-2) 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
  .nav-sub__flag {
    flex: none; min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: var(--r-pill);
    background: var(--warn-bg); color: var(--warn-fg); box-shadow: inset 0 0 0 1px var(--warn-line); font-size: 12px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums;
  }
  .nav-sub__link--new, .nav-sub__link--more { color: var(--text-2); font-weight: var(--fw-semibold); }
  .nav-sub__link--new:hover, .nav-sub__link--more:hover { color: var(--accent-text); }
  /* with one of its games open, the section item itself is only quietly marked */
  .side-nav .nav-item[data-nav="los"][data-section="current"] { color: var(--text); font-weight: var(--fw-bold); }
}
@media (prefers-reduced-motion: no-preference) {
  .nav-sub__link { transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease); }
}

/* ============================== SECTIONS ================================ */
/* One heading style on every admin page (Grant, 15 Oct 2026, design review: docs/design/mockups/final-*.html).
   A section: a large light-green title with a green outlined icon and a solid green count, an optional one-line summary and one
   group action on the right, then a plain card. One colour for every section, never a colour per kind of thing.
   Built by section() in core/ui.js. A sub-heading (.subsec, subsection()) is the same look one size down, for a group inside a section
   or a card inside the member panel. */
.sec + .sec { margin-top: var(--sp-9); }
.sec__h { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.sec__txt { flex: 1; min-width: 0; }
.sec__t {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin: 0;
  font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 800; line-height: var(--lh-tight); color: var(--accent-text);
}
.sec__n, .subsec__n {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: var(--r-pill);
  font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: var(--fw-bold); background: var(--primary); color: var(--on-primary);
  font-variant-numeric: tabular-nums;
}
.sec__sub { margin: 2px 0 0; color: var(--text-2); font-size: var(--fs-sm); }
.sec__ico, .subsec__ico { flex: none; display: grid; place-items: center; border: 1.5px solid var(--accent-text); color: var(--accent-text); }
.sec__ico { width: 48px; height: 48px; border-radius: var(--r-md); background: var(--selected-bg); }
.sec__ico svg { width: 24px; height: 24px; }
.sec__act { flex: none; }
.sec__body { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.subsec { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin: var(--sp-6) 0 var(--sp-3); }
.subsec:first-child { margin-top: 0; }
.subsec__t {
  display: flex; align-items: center; gap: var(--sp-2); margin: 0;
  font-family: var(--font-display); font-size: var(--fs-lg); font-weight: var(--fw-bold); line-height: var(--lh-tight); color: var(--accent-text);
}
.subsec__n { min-width: 24px; height: 24px; font-size: var(--fs-xs); }
.subsec__ico { width: 32px; height: 32px; border-radius: var(--r-sm); }
.subsec__ico svg { width: 18px; height: 18px; }
.subsec__sub { margin: 0; color: var(--text-2); font-size: var(--fs-sm); }
.subsec__act { margin-left: auto; }
@media (max-width: 640px) {
  .sec + .sec { margin-top: var(--sp-8); }
  .sec__h { flex-wrap: wrap; }
  .sec__t { font-size: var(--fs-xl); }
  .sec__ico { width: 44px; height: 44px; }
  .sec__act { width: 100%; }
  .sec__act .btn { width: 100%; }
}

/* ============================================================== FIGURE TILES (design review, 15 Oct 2026)
   A row of figures (two across on a phone, four from 1024): a label, a big number and one line of context; the whole tile opens
   its list. Overview and Money use the same tiles. Red figure only for money gone wrong. */
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
@media (min-width: 1024px) { .stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); } }
.stat { display: grid; align-content: start; gap: 2px; min-width: 0; min-height: 112px; padding: var(--sp-3) var(--sp-4) var(--sp-4);
  border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
a.stat:hover { border-color: var(--control-line); }
.stat__l { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-2); }
.stat__go { display: grid; color: var(--text-3); }
.stat__go svg { width: 18px; height: 18px; }
.stat__n { margin-top: var(--sp-1); font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: var(--fw-bold); line-height: 1.1; letter-spacing: -.02em; }
.stat--bad .stat__n { color: var(--bad-fg); }
.stat--warn .stat__n { color: var(--warn-fg); }
.stat__c { font-size: var(--fs-xs); color: var(--text-3); overflow-wrap: anywhere; }
.stat--sk { gap: var(--sp-3); }
@media (min-width: 640px) { .stat__n { font-size: var(--fs-3xl); } .stat__c { font-size: var(--fs-sm); } }
/* the join link button (core/share.js joinLinkButton) */
.join-btn .share-icon { width: 18px; height: 18px; flex: none; }

/* Import a list: how these people pay (Grant, 20 Oct 2026). Two big radio rows, 44px high at least, no sideways scroll. */
.imp__pay { border: 0; margin: 12px 0; padding: 0; min-width: 0; display: grid; gap: 8px; }
.imp__pay .label { margin-bottom: 4px; }
.imp__paychoice { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border, rgba(127, 127, 127, .35)); border-radius: 10px; }
.imp__paychoice input { margin-top: 3px; flex: none; }
.imp__paychoice span { min-width: 0; overflow-wrap: anywhere; }
