/* Broomstack design system.
 *
 * Ported from the Claude Design project "Broomstack league platform design"
 * (Broomstack.html — nine high-fidelity screen mockups plus a component
 * inventory). Tokens, chrome, and components are taken from that file
 * verbatim so the built screens and the mockups stay the same design.
 *
 * The mockup expresses per-screen layout as inline styles on a fixed
 * 1440px frame. Those repeated patterns are lifted into real classes here
 * (.page, .weekgrid, .iceblock, .banner, …) so templates stay readable and
 * the layout is responsive rather than frame-width.
 *
 * Colors, per the design's own legend:
 *   Slate #2D3042 — chrome and headings
 *   Gold  #C9A54A — the single primary action per view, used sparingly
 *   Blue  #5B7B9A — secondary actions, info, the home club
 *   Paper #F7F7F2 — page background
 * Stone red and yellow are team colors only, never chrome.
 */

:root {
  --slate: #2d3042;
  --slate-70: rgba(45, 48, 66, 0.7);
  --slate-45: rgba(45, 48, 66, 0.45);
  --slate-surface: #363a4f;
  --gold: #c9a54a;
  --gold-dk: #b08f36;
  --gold-tint: #f6efdc;
  --paper: #f7f7f2;
  --blue: #5b7b9a;
  --blue-dk: #4a677f;
  --blue-tint: #eaf0f5;
  --ink: #2d3042;
  --muted: #6f7280;
  --faint: #9a9ca6;
  --line: #e4e4de;
  --line-2: #d6d6cf;
  --white: #fff;
  --red: #c0392b;
  --red-tint: #fbe9e6;
  --yellow: #e5b028;
  --yellow-tint: #fbf1d6;
  --green: #4b8a5a;
  --green-tint: #e7f1e9;
  --r: 5px;
  --r-lg: 8px;
  --sh: 0 1px 2px rgba(45, 48, 66, 0.06), 0 1px 3px rgba(45, 48, 66, 0.05);
  --sh-md: 0 4px 14px rgba(45, 48, 66, 0.09);
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; line-height: 1.2; }
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dk); text-decoration: underline; }

/* A team name linking to its roster (#1163). Keeps the colour of whatever
   it sits in: these appear in standings rows, draw cells and bracket
   tables, and the generic blue above turns a standings table into a wall
   of links. The hover underline is the affordance instead. */
a.team-link { color: inherit; }

/* A league name in a screen's header, back to its landing page (#1416).
   Keeps the colour of the heading or subtitle it sits in, like a team
   link, with the hover underline as the affordance. */
a.league-link { color: inherit; }
a.league-link:hover { color: inherit; text-decoration: underline; }

/* The "previewing as a member" bar (#1206). Gold and full width at the
   top of every affected page, never dismissible: the whole point is
   that you cannot leave it on without noticing, because the honest 403s
   it produces are otherwise indistinguishable from a bug. */
.previewbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; padding: 10px 14px;
  border: 1px solid var(--gold); border-left-width: 4px;
  border-radius: 8px; background: #fdf7e6; color: var(--slate);
  font-size: 13px;
}
.previewbar svg { color: var(--gold-dk); flex: none; }
.previewbar-body { flex: 1; }
@media (max-width: 34rem) {
  .previewbar { flex-wrap: wrap; }
}
a.team-link:hover { color: inherit; text-decoration: underline; }

svg.i {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}

/* Every icon in the sprite is drawn as an outline — strokes, no areas — so
   `stroke: currentColor; fill: none` is not decoration, it is the
   difference between the icon existing and not.
 *
 * That treatment used to require `class="i"`, and 137 of the 141 call
 * sites did not carry it. Those icons fell back to the SVG default of
 * `fill: black; stroke: none`, which renders a path with no enclosed area
 * as *nothing at all* — the icon still occupied its box, so buttons like
 * "Add season" showed a 16px gap where the plus should be. Symbols that do
 * enclose an area (#ic-stone) came out as a black blob instead, which is
 * what the SEASON card kick was.
 *
 * Keyed on the icon being a sprite reference rather than on a class, so a
 * new `<svg><use href="#ic-…">` is correct by default and cannot
 * reintroduce this by forgetting something. The context rules further down
 * still own size and colour; this only sets paint.
 *
 * `.mark` is excluded deliberately. The brand mark is now an `<img>` of
 * the roundel so this rule cannot reach it either way, but any future
 * inline `.mark` would carry its own `fill`/`stroke` presentation
 * attributes, and CSS outranks those — without the exclusion this would
 * repaint the logo in currentColor. */
svg:has(use):not(.mark) {
  stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.i-14 { width: 14px; height: 14px; }
.i-16 { width: 16px; height: 16px; }
.i-20 { width: 20px; height: 20px; }
.i-24 { width: 24px; height: 24px; }

/* ---------- app chrome ---------- */

/* A minimum height, not a fixed one (#1529). The bar wraps, and with a
   fixed 58px a wrapped row (a club admin's tools, below about 1440px)
   was drawn underneath it, as white text over the page heading. */
.appnav {
  display: flex; align-items: center; column-gap: 26px;
  background: var(--slate); color: #eceef4;
  padding: 0 24px; min-height: 58px;
  flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; letter-spacing: -0.01em; color: #fff;
}
.brand:hover { color: #fff; text-decoration: none; }
.brand .mark {
  width: 28px; height: 28px; flex: none;
  background: var(--paper); border-radius: 50%;
}
.navlinks { display: flex; gap: 4px; height: 58px; }
.navlinks a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center;
  padding: 0 13px; height: 100%;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.navlinks a:hover { color: #fff; text-decoration: none; }
.navlinks a.on { color: #fff; border-bottom-color: var(--gold); }
.navspacer { flex: 1; }
.navschedule { white-space: nowrap; }
/* The current page: a ring, since the gold is already the button's own. */
.navschedule.on { box-shadow: 0 0 0 2px var(--slate), 0 0 0 4px #fff; }
.navtools {
  display: flex; align-items: center; gap: 10px; min-height: 58px;
  /* Right-aligned when it wraps onto its own row (a club admin's pill,
     below about 1440px), so the avatar and its menu stay on the right. */
  margin-left: auto;
}
.navbtn {
  width: 36px; height: 36px; border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.75); background: transparent;
  border: 0; cursor: pointer;
}
.navbtn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.navlink-quiet { color: rgba(255, 255, 255, 0.72); font-size: 13.5px; }
.navlink-quiet:hover { color: #fff; text-decoration: none; }
/* The account menu behind the avatar (#1575). A <details>: the summary
   is the avatar plus a chevron, the chevron being the cue that it opens.
   Items are selected as `.acctmenu .acctmenu-item` (0,2,0) so Sign out,
   a submit button, beats the bare `button[type='submit']` gold rule
   (0,1,1) further down; its :hover (0,2,1) is outranked the same way. */
.acctmenu { position: relative; }
.acctmenu-toggle {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  padding: 3px 6px 3px 3px; border-radius: 22px;
  color: rgba(255, 255, 255, 0.72);
}
.acctmenu-toggle::-webkit-details-marker { display: none; }
.acctmenu-toggle:hover, .acctmenu[open] > .acctmenu-toggle {
  background: rgba(255, 255, 255, 0.1); color: #fff;
}
.acctmenu-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.acctmenu-chev { transition: transform 0.15s; }
.acctmenu[open] .acctmenu-chev { transform: rotate(180deg); }
.acctmenu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 14rem; max-width: calc(100vw - 32px);
  background: var(--white); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--sh-md); padding: 4px;
  display: flex; flex-direction: column;
}
.acctmenu-who {
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 10px 9px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.acctmenu-who span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.acctmenu-form { display: flex; margin: 0; }
.acctmenu .acctmenu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  font: inherit; font-size: 14px; font-weight: 400; text-align: left;
  padding: 8px 10px; border: 0; border-radius: var(--r);
  background: none; color: var(--ink); cursor: pointer;
}
.acctmenu .acctmenu-item svg { color: var(--muted); }
.acctmenu .acctmenu-item:hover, .acctmenu .acctmenu-item:focus-visible {
  background: var(--paper); color: var(--ink); text-decoration: none; outline: none;
}
@media (prefers-reduced-motion: reduce) { .acctmenu-chev { transition: none; } }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; flex: none;
}
.avatar-gold { background: var(--gold); color: var(--slate); }
.adminpill {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--slate);
  background: var(--gold); padding: 3px 9px; border-radius: 20px;
}

/* page title bar */
.pagebar {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 32px; background: var(--white);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.pagebar h3 { font-size: 20px; color: var(--slate); }
.pagebar .sub { color: var(--muted); font-size: 13px; }
.pagebar .spacer { flex: 1; }

/* ---------- page shell ---------- */

.page { padding: 28px 32px 64px; flex: 1; }
.page-narrow { max-width: 720px; margin-left: auto; margin-right: auto; }
.page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-head h1 { font-size: 24px; color: var(--slate); }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.section-title {
  font-size: 16px; color: var(--slate);
  margin: 28px 0 12px;
}

.sitefoot {
  color: var(--faint); font-size: 12.5px;
  padding: 20px 32px 32px; text-align: center;
}

/* ---------- buttons ---------- */

.btn {
  font-family: inherit; font-size: 14px; font-weight: 600;
  border-radius: var(--r); padding: 9px 16px;
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; border: 1px solid transparent;
  line-height: 1; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
/* Icon and plain buttons the same height. A .btn's line is 1em tall
 * (line-height: 1), so a 16px icon made every button that carried one
 * taller than its neighbour without: 2px at 14px, 3.5px in a .btn-sm
 * (#1531). The margin trims the icon's box to exactly 1em, at any size,
 * without changing how big it draws. */
.btn svg { margin-block: calc((1em - 16px) / 2); }
.btn-gold { background: var(--gold); color: var(--slate); border-color: var(--gold-dk); }
.btn-gold:hover { background: var(--gold-dk); color: #fff; }
.btn-slate { background: var(--slate); color: #fff; }
.btn-slate:hover { background: #3c4058; color: #fff; }
.btn-ghost { background: transparent; color: var(--slate); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--white); border-color: var(--slate-45); color: var(--slate); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-dk); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-lg { padding: 14px 22px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled, .btn.disabled { opacity: 0.45; cursor: not-allowed; }
.btnrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- tags ---------- */

.tag {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  padding: 3px 9px; border-radius: 20px;
  display: inline-flex; align-items: center; gap: 5px; line-height: 1.3;
}
.tag-gold { background: var(--gold-tint); color: var(--gold-dk); }
.tag-blue { background: var(--blue-tint); color: var(--blue-dk); }
.tag-slate { background: #e7e8ec; color: var(--slate); }
.tag-green { background: var(--green-tint); color: var(--green); }
.tag-red { background: var(--red-tint); color: var(--red); }
.tag-draft {
  background: repeating-linear-gradient(45deg, #f0ede3, #f0ede3 5px, #e8e4d4 5px, #e8e4d4 10px);
  color: #8a7a45; border: 1px dashed #cbbf94;
}
.tag-out { background: transparent; border: 1px solid var(--line-2); color: var(--muted); }

/* stone dots — team color only, never chrome */
.stone {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55), inset 0 -2px 3px rgba(0, 0, 0, 0.18);
}
.stone-red { background: var(--red); }
.stone-yel { background: var(--yellow); }
.stone.sm { width: 11px; height: 11px; }
.stone.lg { width: 18px; height: 18px; }

/* ---------- cards ---------- */

.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh);
}
.card-pad { padding: 20px; }
.card-kick {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 10px;
  display: flex; align-items: center; gap: 7px;
}
.card-kick svg { width: 14px; height: 14px; color: var(--blue); }
.card-head {
  display: flex; align-items: center; gap: 8px;
  background: var(--slate); color: #fff; padding: 11px 20px;
  font-weight: 600; font-size: 13px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.card-head svg { color: var(--gold); }
.card h2 { font-size: 16px; color: var(--slate); }
/* A linked card heading keeps the heading's colour (#1204). Without this
   the generic `a { color: var(--blue) }` wins: inheritance loses to any
   matching rule, however unspecific, so `.card h2`'s --slate never
   reaches the anchor inside it. `league_list.html` and
   `bonspiel_list.html` had been rendering their headings in the lighter
   blue since they were first linked, and nobody had placed why.

   This also holds on hover: (0,1,2) beats `a:hover` at (0,1,1), so the
   colour stays put while `a:hover`'s underline still lands. That
   underline is the whole affordance. */
.card h2 a { color: inherit; }
.cards {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
}

/* ---------- banners and messages ---------- */

.banner {
  display: flex; align-items: center; gap: 14px;
  background: var(--gold-tint); border: 1px solid #e6d6a3;
  border-radius: var(--r-lg); padding: 14px 18px; margin-bottom: 24px;
  font-size: 13.5px; color: var(--slate); flex-wrap: wrap;
}
.banner svg { color: var(--gold-dk); flex: none; }
.banner .banner-body { flex: 1; min-width: 14rem; }
.banner-blue { background: var(--blue-tint); border-color: #c9d8e5; }
.banner-blue svg { color: var(--blue-dk); }
.banner-green { background: var(--green-tint); border-color: #c3ddca; }
.banner-green svg { color: var(--green); }
.banner-red { background: var(--red-tint); border-color: #f0cbc5; }
.banner-red svg { color: var(--red); }

.messages { list-style: none; margin: 0 0 20px; padding: 0; }
.messages li {
  border-radius: var(--r-lg); padding: 11px 16px; margin-bottom: 8px;
  font-size: 13.5px; border: 1px solid var(--line);
  background: var(--white); color: var(--slate);
}
.messages li.success { background: var(--green-tint); border-color: #c3ddca; }
.messages li.warning { background: var(--gold-tint); border-color: #e6d6a3; }
.messages li.error { background: var(--red-tint); border-color: #f0cbc5; }
.messages li.info { background: var(--blue-tint); border-color: #c9d8e5; }

.note {
  background: var(--white); border: 1px solid var(--line);
  border-left: 3px solid var(--blue); border-radius: var(--r);
  padding: 10px 14px; font-size: 13px; color: var(--slate);
  margin-bottom: 16px;
}
.note b { color: var(--blue-dk); }
.note.flag { border-left-color: var(--gold); }
.note.flag b { color: var(--gold-dk); }

/* ---------- forms ---------- */

.field { margin-bottom: 18px; }
.field label, .field .field-heading {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--slate); margin-bottom: 6px;
}
.field .hint, .field .help {
  font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 5px;
}
.input, .select, .textarea,
.field input[type='text'], .field input[type='email'], .field input[type='password'],
.field input[type='date'], .field input[type='time'], .field input[type='number'],
/* `tel` too: the phone field became one for the number pad, and this
   list is keyed on the input type — so it silently dropped out of the
   form's styling and rendered as a bare narrow box beside eight fields
   that looked right. */
.field input[type='tel'],
/* `url` too (#1616): the QR slide's web address was a bare box. */
.field input[type='url'],
/* And `datetime-local` (#1600): "Show a program now" until when. */
.field input[type='datetime-local'],
.field select, .field textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--white); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 10px 12px;
}
.input:focus, .select:focus, .textarea:focus,
/* Not a checkbox or radio: those have their own focus ring below, and a
   click would otherwise turn the box's border blue (#1565). */
.field input:not([type='checkbox'], [type='radio']):focus,
.field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-tint);
}
/* A select that sits in a table row rather than a form column. `.select`
   above is full-width by design; in a cell that stretches it across the
   column and it stops reading as a control. This is the same skin at the
   width of its content. */
.select-inline {
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--white); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 6px 10px;
}
.select-inline:hover { border-color: var(--slate-45); }
.select-inline:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-tint);
}

.input::placeholder { color: var(--faint); }

/* Show/Hide on a password box — the button is injected by password.js,
   so none of this renders without it. `padding-right` on the input makes
   room for the button; without it a long password runs underneath. The
   type flips to `text` when revealed, which the type-keyed input styling
   above already covers. */
.pw { position: relative; display: block; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-family: inherit; font-size: 12px; font-weight: 600;
  color: var(--slate); background: transparent;
  border: 0; border-radius: var(--r);
  padding: 5px 8px; cursor: pointer;
}
.pw-toggle:hover { color: var(--ink); background: var(--paper); }
.pw-toggle:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--blue-tint);
}
.pw > input { padding-right: 4rem; }
.textarea, .field textarea { resize: vertical; min-height: 76px; }

/* Multiple-choice widgets as a column of option cards.

   Django used to render CheckboxSelectMultiple and RadioSelect as a
   <ul>, and Django 5 renders nested <div>s: `<div id=…><div><label>
   <input> Lead</label></div>…</div>`. Only the `ul` form was styled, so
   every option list on the site fell back to bare browser checkboxes
   (#1565). Both forms are matched now: the `ul` for any template that
   still writes one by hand. */
.field ul,
.field div[id]:has(> div > label > input:is([type='checkbox'], [type='radio'])) {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 6px;
}
.field ul li,
.field div[id] > div:has(> label > input:is([type='checkbox'], [type='radio'])) {
  font-size: 14px;
}
.field ul label,
.field div[id] > div > label:has(> input:is([type='checkbox'], [type='radio'])) {
  display: flex; align-items: center; gap: 10px;
  font-weight: 400; margin: 0; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--white); padding: 9px 12px;
  transition: border-color .12s ease, background .12s ease;
}
.field ul label:hover,
.field div[id] > div > label:has(> input):hover { border-color: var(--slate-45); }
/* The chosen options read as chosen at a glance, not only by the box. */
.field ul label:has(> input:checked),
.field div[id] > div > label:has(> input:checked) {
  border-color: var(--gold); background: var(--gold-tint);
}
.field input[type='checkbox'], .field input[type='radio'] { margin: 0; }

/* Checkboxes and radios, everywhere (#1565). Drawn rather than left to
   the browser, which gave a system-blue box on a slate and gold site.
   18px, a slate border, slate fill with a white tick when checked, and
   the same focus ring as the text inputs. */
input[type='checkbox'], input[type='radio'] {
  -webkit-appearance: none; appearance: none;
  flex: none; width: 18px; height: 18px; margin: 0;
  display: inline-grid; place-content: center; vertical-align: -3px;
  border: 1.5px solid var(--slate-45); border-radius: 4px;
  background: var(--white); cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
input[type='radio'] { border-radius: 50%; }
input[type='checkbox']:hover, input[type='radio']:hover { border-color: var(--slate); }
input[type='checkbox']:checked, input[type='checkbox']:indeterminate {
  background: var(--slate); border-color: var(--slate);
}
input[type='checkbox']::before {
  content: ''; width: 10px; height: 10px; background: var(--white);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
  transform: scale(0); transition: transform .12s ease;
}
input[type='checkbox']:checked::before { transform: scale(1); }
input[type='checkbox']:indeterminate::before {
  clip-path: none; height: 2px; transform: scale(1);
}
input[type='radio']:checked { border-color: var(--slate); }
input[type='radio']::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--slate); transform: scale(0); transition: transform .12s ease;
}
input[type='radio']:checked::before { transform: scale(1); }
input[type='checkbox']:focus-visible, input[type='radio']:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--blue-tint), 0 0 0 4px var(--slate-45);
}
input[type='checkbox']:disabled, input[type='radio']:disabled {
  opacity: .45; cursor: not-allowed;
}
@media (prefers-reduced-motion: reduce) {
  input[type='checkbox'], input[type='radio'],
  input[type='checkbox']::before, input[type='radio']::before { transition: none; }
}
.field-inline label { display: inline-flex; align-items: center; gap: 8px; }

.errorlist {
  list-style: none; margin: 6px 0 0; padding: 0;
  color: var(--red); font-size: 12.5px; display: grid; gap: 3px;
}
.errorlist li { border: 0; background: none; padding: 0; }

/* A field that failed validation, marked on the control and not only in
   the message underneath it.

   Keyed off `aria-invalid`, which Django renders on an errored widget by
   itself, rather than a class the templates have to remember to add: one
   rule then covers every form in the app and cannot fall out of step with
   what the server actually rejected.

   Before this the message was the only signal, and on the account form it
   was not even red — `_account_fields.html` asked for `.help.is-error`,
   which was never defined here, so "that does not look like a phone
   number" rendered in exactly the same grey as the hint above it. A
   tester filled the form in, was refused, and could not see why. */
.field input[aria-invalid='true'],
.field select[aria-invalid='true'],
.field textarea[aria-invalid='true'],
.input[aria-invalid='true'],
.select[aria-invalid='true'],
.textarea[aria-invalid='true'] {
  border-color: var(--red);
  background: var(--red-tint);
}
.field input[aria-invalid='true']:focus,
.field select[aria-invalid='true']:focus,
.field textarea[aria-invalid='true']:focus,
.input[aria-invalid='true']:focus,
.select[aria-invalid='true']:focus,
.textarea[aria-invalid='true']:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .16);
}

/* Help text is a block, not a paragraph, because the password field's is
   Django's own `<ul>` of the rules its validators enforce — and a `<ul>`
   inside a `<p>` closes the paragraph early and indents nothing.

   The reset of `list-style` and `display` is undoing `.field ul` above,
   which strips markers and lays out as a grid for the checkbox widgets.
   That is right for a column of tickable options and wrong for four
   sentences about what a password may not be. */
.field .help ul {
  display: block; list-style: disc;
  margin: 4px 0 0; padding-left: 1.15em;
}
.field .help li { font-size: inherit; margin: 0; }

/* A readable column, centred in the page. The max-width was here
   from the start; the centring was not, so every screen built from
   these sat hard against the left edge with a third of the viewport
   empty beside it.

   Spacing is between adjacent cards only, so a page with one card
   gains no stray margin, and the `.stacked` rows used inside a card
   (the per-division ice pickers) keep their own. */
.stacked { max-width: 40rem; margin-left: auto; margin-right: auto; }
.card.stacked + .card.stacked { margin-top: 18px; }
/* The profile form fills its centred column (#1575), level with the
   heading and note above it rather than inset from them. */
.stacked.stacked-full { max-width: none; }
.stacked .btn, .stacked button[type='submit'] { margin-right: 8px; }
button[type='submit'] {
  font-family: inherit; font-size: 14px; font-weight: 600;
  border-radius: var(--r); padding: 9px 16px; cursor: pointer;
  border: 1px solid var(--gold-dk); background: var(--gold); color: var(--slate);
}
button[type='submit']:hover { background: var(--gold-dk); color: #fff; }

/* A submit button that names a variant has to get it. The bare
   `button[type='submit']` rule above is an element+attribute selector
   (0,1,1), which outranks a plain `.btn-ghost` class (0,1,0) — so every
   submit button asking to be quiet came out gold instead. That put
   "Decline" on rink invitations and the pending banner in the same loud
   gold as the "Accept" next to it, which is the opposite of what the
   markup asked for. Re-stated here at (0,2,1) so the variant wins. */
button[type='submit'].btn-ghost {
  background: transparent; color: var(--slate); border-color: var(--line-2);
}
button[type='submit'].btn-ghost:hover {
  background: var(--white); border-color: var(--slate-45); color: var(--slate);
}
button[type='submit'].btn-blue { background: var(--blue); border-color: var(--blue-dk); color: #fff; }
button[type='submit'].btn-blue:hover { background: var(--blue-dk); color: #fff; }
button[type='submit'].btn-slate { background: var(--slate); border-color: var(--slate); color: #fff; }

/* Size is the same trap as colour, and was missed when colour was fixed.
   `button[type='submit']` sets font-size and padding at (0,1,1), which
   outranks `.btn-sm` at (0,1,0) — so a small submit button came out
   full-sized, next to an `<a class="btn btn-sm">` that obeyed. That is
   why Archive and Remove on the league list were visibly different
   sizes; 29 buttons across 16 templates were asking for a size they
   never got. */

button[type='submit'].btn-sm { padding: 6px 11px; font-size: 12.5px; }
button[type='submit'].btn-lg { padding: 14px 22px; font-size: 16px; }
.link-button {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--blue); font: inherit; font-size: 12.5px;
}
.link-button:hover { color: var(--blue-dk); text-decoration: underline; }
/* A submit button asking to look like a link has to get it. The bare
   `button[type='submit']` rule is an element+attribute selector (0,1,1)
   and outranks `.link-button` (0,1,0), so all four of its properties —
   background, border, padding, colour — were being overridden and every
   one of these rendered as a full gold primary button. Eighteen of them,
   across eight templates. Re-stated at (0,2,1) so the class wins. */
button[type='submit'].link-button {
  background: none; border: 0; padding: 0;
  color: var(--blue); font: inherit; font-size: 12.5px;
}
button[type='submit'].link-button:hover {
  background: none; color: var(--blue-dk); text-decoration: underline;
}
.cancel { font-size: 13.5px; color: var(--muted); }

/* Wraps rather than overflowing: the calendar's segmented control grows
   as facility-admin screens are added (Displays, Webhooks), and a phone
   is 390px wide. */
.seg {
  display: inline-flex; flex-wrap: wrap; max-width: 100%;
  background: #edece6; border-radius: var(--r); padding: 3px; gap: 2px;
}
.seg a, .seg button {
  font-family: inherit; font-size: 13px; font-weight: 600;
  border: 0; background: transparent; color: var(--muted);
  padding: 7px 14px; border-radius: 4px; cursor: pointer;
}
.seg a:hover { text-decoration: none; color: var(--slate); }
.seg a.on, .seg button.on { background: var(--white); color: var(--slate); box-shadow: var(--sh); }

/* ---------- tables ---------- */

.tablewrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--white); }
.table th {
  text-align: left; font-size: 11.5px; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
  padding: 11px 14px; border-bottom: 2px solid var(--line-2); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.table tbody tr:hover { background: #faf9f4; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; font-family: 'IBM Plex Mono', monospace; }
.table .rk { font-family: 'IBM Plex Mono', monospace; color: var(--faint); font-weight: 600; }
/* A checkbox column: only as wide as the box, and centred on the row
   rather than sitting on the text baseline beside two lines of name. */
.table .selcell { width: 1%; white-space: nowrap; vertical-align: middle; }
.table .selcell input { width: 16px; height: 16px; }

/* definition lists — league format, request detail */
.detail { display: grid; grid-template-columns: 11rem 1fr; gap: 0; margin: 0; }
.detail dt {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.detail dd {
  margin: 0; padding: 11px 0; font-size: 14px;
  border-bottom: 1px solid var(--line); color: var(--slate);
}
@media (max-width: 40rem) {
  .detail { grid-template-columns: 1fr; }
  .detail dt { padding-bottom: 0; border-bottom: 0; }
}

/* ---------- ice calendar ---------- */

.weeknav {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 14px; font-size: 13.5px;
}
.weeknav strong { color: var(--slate); }

.weekgrid {
  display: grid; grid-template-columns: repeat(7, minmax(9rem, 1fr));
  background: var(--white); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); overflow: hidden;
}
.weekgrid .day { border-left: 1px solid var(--line); min-height: 9rem; padding: 0 0 8px; }
.weekgrid .day:first-child { border-left: 0; }
.weekgrid .day.today { background: var(--gold-tint); }
.dayhead { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line-2); }
.dayhead .dow {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  color: var(--muted); text-transform: uppercase;
}
.dayhead .dom { font-weight: 700; color: var(--slate); }
.day-add {
  display: block; text-align: center; font-size: 12px;
  color: var(--faint); padding: 6px;
}
.day-add:hover { color: var(--blue-dk); }

.blocks { list-style: none; margin: 0; padding: 6px; display: grid; gap: 6px; }

/* An ice block. Blue is the club you are looking as; gold is the other
   club. Matches the mockup's two-club legend. */
.iceblock {
  background: #efe7d6; border: 1px solid var(--gold-dk);
  border-left: 3px solid var(--gold-dk);
  border-radius: var(--r); padding: 7px 8px; font-size: 11.5px;
}
.iceblock .who { font-weight: 700; color: var(--gold-dk); }
.iceblock.own { background: var(--blue-tint); border-color: var(--blue); border-left-color: var(--blue); }
.iceblock.own .who { color: var(--blue-dk); }
.iceblock .when { color: var(--slate); }
.iceblock .meta { color: var(--muted); }
.iceblock .block-actions {
  display: flex; gap: 8px; align-items: center; margin-top: 5px;
  font-size: 11.5px;
}
.iceblock .block-actions form { display: inline; }
.iceblock.pending {
  background: repeating-linear-gradient(45deg, #fff, #fff 5px, #f6efdc 5px, #f6efdc 10px);
  border: 1.5px dashed var(--gold-dk);
}

.seasonday { margin-bottom: 20px; }
.seasonday h2 {
  font-size: 14px; color: var(--slate);
  padding-bottom: 6px; border-bottom: 1px solid var(--line-2); margin-bottom: 8px;
}
.seasonday .blocks { padding: 0; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }

/* ---------- lists ---------- */

.requests { list-style: none; margin: 0 0 20px; padding: 0; }
.requests li {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 14px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--r);
  margin-bottom: 6px; font-size: 13.5px;
}
.requests .req-club { color: var(--muted); font-size: 12.5px; }
.requests .req-sheets { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--muted); }

.roster { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.roster li {
  display: flex; justify-content: space-between; gap: 10px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r); padding: 8px 11px; font-size: 13px;
}
.roster .pos { color: var(--muted); font-size: 11px; text-transform: uppercase; }

.status { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.status-pending { background: var(--gold-tint); color: var(--gold-dk); }
.status-approved { background: var(--green-tint); color: var(--green); }
.status-declined { background: var(--red-tint); color: var(--red); }
.status-withdrawn { background: #e7e8ec; color: var(--slate); }

/* ---------- utilities ---------- */

.muted { color: var(--muted); }
.mono { font-family: 'IBM Plex Mono', monospace; }
.empty { color: var(--faint); font-size: 13px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 16px 0; }
.iconpair { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.iconpair svg { width: 15px; height: 15px; color: var(--faint); }

/* ---------- auth ---------- */

.authwrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 48px 24px;
}
.authcard { width: 100%; max-width: 25rem; }
.authcard .card-pad { padding: 28px; }
.authcard h1 { font-size: 22px; color: var(--slate); margin-bottom: 4px; }

/* ---------- responsive ---------- */

@media (max-width: 60rem) {
  .weekgrid { grid-template-columns: repeat(2, 1fr); }
  .weekgrid .day { border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
}
/* The narrow nav from 68rem, not 40rem (#1529). Brand, links and the
   My Schedule button need about 1070px on one row. Below that the links
   squeezed, each label broke onto two lines and the page scrolled
   sideways; now they wrap onto a row of their own, and the button
   moves up beside the brand. */
@media (max-width: 68rem) {
  .appnav { padding: 10px 16px; gap: 12px; }
  .navlinks { flex-wrap: wrap; height: auto; flex-basis: 100%; }
  .navlinks a { padding: 6px 10px; border-bottom: 0; }
  .navlinks a.on { color: var(--gold); }
  .navtools { min-height: 0; flex-wrap: wrap; row-gap: 6px; }
  .navtools > * { white-space: nowrap; }
  /* My Schedule stays on the top row, beside the brand, whatever wraps
     below it (#1529). */
  .appnav > * { order: 1; }
  .appnav > .brand, .appnav > .navschedule { order: 0; }
  .navschedule { margin-left: auto; }
}
@media (max-width: 40rem) {
  .page, .pagebar { padding-left: 16px; padding-right: 16px; }
  .weekgrid { grid-template-columns: 1fr; }
}

/* ---------- team formation board (#638) ---------- */

/* Dense by design — the registrar is comparing preferences across a
   pool of forty-odd names, so this screen trades whitespace for how
   much fits on one laptop screen. */

.page-formation { padding: 0; }
.page-formation .messages, .page-formation > .note { margin: 16px 24px 0; }

.formation {
  display: grid;
  grid-template-columns: 22rem 1fr;
  align-items: start;
  min-height: 40rem;
  margin-top: 16px;
  border-top: 1px solid var(--line-2);
}
.formation.is-saving { opacity: 0.6; pointer-events: none; }

.tray {
  border-right: 1px solid var(--line-2);
  background: var(--white);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  max-height: 100vh;
}
.tray-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tray-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; font-size: 14px; color: var(--slate);
}
.tray-search input { font-size: 13px; }
.tray-list { list-style: none; margin: 0; padding: 10px 12px; overflow: auto; flex: 1; }

.tray-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  padding: 9px 11px;
  margin-bottom: 8px;
  background: var(--white);
  cursor: grab;
}
.tray-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.tray-card.dragging {
  border: 2px solid var(--gold);
  background: var(--gold-tint);
  cursor: grabbing;
  box-shadow: var(--sh-md);
}
.tray-card .grip { color: var(--faint); }
.tray-name { font-weight: 600; font-size: 13.5px; }
.tray-meta { color: var(--muted); font-size: 11.5px; }
.tray-move { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; }
.tray-move select {
  flex: 1; font-family: inherit; font-size: 12px;
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 4px 6px;
  background: var(--white); color: var(--ink);
}
.tray-empty { padding: 16px 4px; }
[data-drop-tray].drop-target { background: var(--blue-tint); }

.teams { padding: 16px 20px; background: var(--paper); }
.teamgrid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
}

.teamcard.complete { border-color: var(--green); border-width: 1.5px; }
.teamcard-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 15px; border-bottom: 1px solid var(--line);
}
.teamcard.complete .teamcard-head {
  background: var(--green-tint);
  border-bottom-color: #cfe3d3;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.teamname { flex: 1; min-width: 0; }
.teamname-input {
  width: 100%; border: 0; padding: 2px 0; background: transparent;
  font-family: inherit; font-weight: 700; font-size: 14px; color: var(--slate);
}
.teamname-input:focus {
  outline: none; border-bottom: 1px solid var(--blue); background: var(--white);
}
.teamcard-remove { color: var(--muted); font-size: 12px; }
.teamcard-remove:hover { color: var(--red); }

.seats { list-style: none; margin: 0; padding: 10px 12px; display: grid; gap: 6px; }
.seat {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; border-radius: var(--r); padding: 6px 8px;
}
.seat-pos { width: 3.5rem; justify-content: center; }
.seat-name { font-weight: 600; flex: 1; }
.seat.open {
  border: 1px dashed var(--line-2);
  color: var(--faint); font-size: 12.5px;
}
.seat.open .seat-empty { flex: 1; }
.seat.drop-target {
  border: 2px dashed var(--blue);
  background: var(--blue-tint);
  color: var(--blue-dk);
  font-weight: 600;
}
/* Removing somebody is a real action, so the control has to be legible.
   --faint on white was already thin; on the gold background it was
   getting from the rule above, it was almost invisible. */
.seat-clear button, .seat-clear button[type='submit'] {
  color: var(--muted); font-size: 17px; line-height: 1; font-weight: 600;
}
.seat-clear button:hover, .seat-clear button[type='submit']:hover {
  color: var(--red); text-decoration: none;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The design flags this screen as desktop-only: dragging across two
   dense panels does not work on a phone. The panels stack and the
   "Move to…" select carries the interaction instead. */
@media (max-width: 60rem) {
  .formation { grid-template-columns: 1fr; }
  .tray { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line-2); }
  .tray-card { cursor: default; }
  .tray-card .grip { display: none; }
}

/* ---------- draw grid (#639) ---------- */

/* Publishing no longer mails the league on its own (#1317); the
   checkbox sits beside the button so the choice is made at the moment
   of pressing it, not on a settings screen somewhere else. */
.publishform { display: inline-flex; align-items: center; gap: 10px; }
.publishtell {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--muted); white-space: nowrap; cursor: pointer;
}

.drawlegend {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted); margin-bottom: 14px;
}
.swatch-draft {
  width: 12px; height: 12px; border-radius: 3px;
  background: repeating-linear-gradient(45deg, #f0ede3, #f0ede3 4px, #e8e4d4 4px, #e8e4d4 8px);
  border: 1px dashed #cbbf94;
}

.drawgrid { width: 100%; border-collapse: separate; border-spacing: 8px; table-layout: fixed; }
.drawgrid th {
  font-size: 12px; background: var(--slate); color: #fff;
  padding: 7px; border-radius: var(--r); font-weight: 600;
}
.drawgrid th.draw-when, .drawgrid td.draw-when {
  background: transparent; color: var(--muted);
  text-align: left; width: 7rem; font-size: 11.5px;
}
.drawgrid td.draw-when { color: var(--slate); font-weight: 600; vertical-align: middle; }
.drawgrid td { vertical-align: top; }

.drawcell {
  background: var(--white); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 9px 10px;
  font-size: 12.5px; position: relative; min-height: 3.2rem;
}
.drawcell.draft {
  background: repeating-linear-gradient(45deg, #f7f5ec, #f7f5ec 5px, #f0ecdd 5px, #f0ecdd 10px);
  border: 1px dashed #cbbf94;
}
.drawcell.pinned { border-color: var(--gold-dk); }
.drawcell.placeholder { background: var(--blue-tint); border: 1px dashed var(--blue); }
.drawcell.empty {
  border: 1px dashed var(--line-2); color: var(--faint);
  text-align: center; background: transparent;
}
/* An empty slot the chair can fill (#1286). A link, so it reads as
   somewhere to go rather than decoration, and it fills the cell so the
   target is the whole box rather than a plus sign to aim at. */
a.drawcell-add {
  display: flex; align-items: center; justify-content: center;
  color: var(--faint); text-decoration: none; font-size: 16px;
  min-height: 3.2rem;
}
a.drawcell-add:hover,
a.drawcell-add:focus-visible {
  border-style: solid; border-color: var(--gold-dk);
  color: var(--gold-dk); background: var(--white); text-decoration: none;
}
/* A cell you type two names into (#1286). The inputs fill the cell so
   the click target is the whole box, and they carry no border of their
   own — the cell's dashed outline is the affordance, and a hundred
   bordered inputs on one page reads as a form rather than a grid. */
.drawcell-fill {
  display: flex; flex-direction: column; gap: 2px; justify-content: center;
}
.drawcell-fill .cellname {
  border: 0; background: transparent; padding: 1px 2px;
  font: inherit; color: var(--slate); width: 100%; min-width: 0;
}
.drawcell-fill .cellname::placeholder { color: var(--faint); }
.drawcell-fill .cellname:focus {
  outline: 2px solid var(--gold-dk); outline-offset: 1px; background: var(--white);
}
.drawcell-fill.is-filled {
  border-style: solid; border-color: var(--gold-dk); background: var(--white);
}
.drawcell-fill.is-filled .cellname:first-child { font-weight: 600; }
/* Enter jumps a row, so the landing cell must not sit under the
   sticky header. */
.drawcell-fill .cellname { scroll-margin-block: 5rem; }
.drawgrid.is-typable .drawcell-add { display: none; }

/* Ice this row's block does not cover. The column has to stay aligned
   with the sheet it is headed by, so the cell stays and goes quiet
   rather than vanishing. */
.drawcell-noice {
  border-style: dotted; color: var(--line-2); background: transparent;
  display: flex; align-items: center; justify-content: center;
}

/* The team list beside the grid. */
.drawlayout { display: flex; gap: 18px; align-items: flex-start; }
.drawlayout-grid { flex: 1; min-width: 0; }
.drawteams {
  flex: none; width: 13rem; position: sticky; top: 12px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--white); padding: 10px 12px;
}
.drawteams-head { font-size: 13px; margin-bottom: 6px; }
.drawteams-list { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.drawteams-list li {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 3px 0; border-bottom: 1px solid var(--line-1);
}
.drawteams-list li:last-child { border-bottom: 0; }
.drawteams-list .is-short .mono { color: var(--gold-dk); }
.drawteams-list .linkish {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--slate); cursor: pointer; text-align: left;
}
.drawteams-list .linkish:hover { text-decoration: underline; }
@media (max-width: 60rem) {
  .drawlayout { flex-direction: column; }
  .drawteams { width: 100%; position: static; }
}

.drawcell-home { font-weight: 600; }
.drawcell-tbd { font-weight: 600; color: var(--blue-dk); }
.drawcell-result {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px;
  margin-top: 4px; font-weight: 700; color: var(--slate);
}
.drawcell-pin { position: absolute; top: 5px; right: 5px; }
.drawcell-pin button { color: var(--line-2); }
.drawcell.pinned .drawcell-pin button { color: var(--gold-dk); }
.drawcell-pin button:hover { color: var(--gold-dk); }

/* The filter control over a list of registrations (#1118).
   Collapsed by default: a secondary control should not be the loudest
   band on the screen. Opens itself whenever a filter is on, and names
   the active values in the summary, so a narrowed table is never
   explained only by a shut box. */
.filterbar {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--white); margin: 0 0 12px;
}
.filterbar[open] { background: var(--paper); }
.filterbar-summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 8px 12px; cursor: pointer; list-style: none;
  font-size: 13px; color: var(--muted);
}
/* The default triangle sits oddly against a row of tags, and the chevron
   below carries the same meaning in this design's own language. */
.filterbar-summary::-webkit-details-marker { display: none; }
.filterbar-summary::after {
  content: ''; margin-left: auto;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 5px solid var(--faint);
}
.filterbar[open] .filterbar-summary::after { transform: rotate(180deg); }
.filterbar-summary:hover { color: var(--ink); }
.filterbar-summary svg { color: var(--faint); flex: none; }
.filterbar-title { font-weight: 600; color: var(--ink); }
.filterbar-hint { color: var(--faint); }
.filterbar-body { padding: 2px 12px 10px; }
/* Inside the control the label no longer needs to fight for attention —
   the summary above it already says what this band is. */
.filterbar-body .chiprow { margin-bottom: 6px; }
.filterbar-body .chiprow:last-child { margin-bottom: 0; }

/* Filter chips over the placement table. Each carries its count, so the
   row answers "how many for each night" as well as narrowing to one. */
.chiprow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 0 0 10px;
}
.chiprow-label {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint); margin-right: 2px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--line-2); background: var(--white);
  color: var(--slate); text-decoration: none; font-size: 12.5px;
}
.chip:hover, .chip:focus-visible { border-color: var(--slate-45); text-decoration: none; }
.chip.on { background: var(--gold-tint); border-color: var(--gold-dk); color: var(--gold-dk); font-weight: 600; }
.chip-count { font-variant-numeric: tabular-nums; color: var(--faint); font-size: 11.5px; }
.chip.on .chip-count { color: var(--gold-dk); }
.chip-clear { font-size: 12.5px; color: var(--muted); margin-left: 2px; }

/* "Already have an account?" and its one button, on one line. */
.signin-inline {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  margin: 26px 0 10px;
}

/* Required / optional markers beside a field label. Quiet: the label is
   what you read, this is what you check. */
.req, .opt {
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; margin-left: 7px; vertical-align: 1px;
}
.req { color: var(--gold-dk); }
.opt { color: var(--faint); font-weight: 500; }

/* The photo control. The native file input is an unlabelled grey button
   in a column of bordered fields; this gives it the same skin as its
   neighbours. The input is moved off-screen rather than hidden, so it
   keeps its place in the tab order. */
.filedrop {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border: 1px dashed var(--line-2);
  border-radius: var(--r); background: var(--surface-2);
  color: var(--muted); cursor: pointer; font-size: 13.5px;
}
/* Inside a .field, `.field label` (display: block, bold, a bottom margin)
   outranks the class above and stacked the drop zone's parts. */
.field label.filedrop {
  display: flex; margin-bottom: 0;
  font-size: 13.5px; font-weight: 400; color: var(--muted);
}
.filedrop:hover, .field label.filedrop:hover { border-color: var(--gold-dk); color: var(--slate); }
.filedrop:focus-within {
  border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint);
}
.filedrop-text { font-weight: 600; color: var(--slate); }
.filedrop-hint { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.filedrop input[type='file'] {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* A label/value list — a pending member's profile, read before deciding
   on them. Two columns on anything but a phone. */
.factlist {
  display: grid; grid-template-columns: 10rem 1fr;
  gap: 4px 14px; margin: 0; font-size: 14px;
}
.factlist dt { color: var(--muted); font-size: 12.5px; padding-top: 2px; }
.factlist dd { margin: 0; }
@media (max-width: 560px) {
  .factlist { grid-template-columns: 1fr; }
  .factlist dd { margin-bottom: 8px; }
}

/* Sortable column headings. A link, so a sorted view has a URL the
   chair can send to the other chair, and so it works without JS. */
.sorthead {
  display: inline-flex; align-items: center; gap: 3px;
  color: inherit; text-decoration: none; white-space: nowrap;
}
.sorthead:hover, .sorthead:focus-visible { color: var(--slate); text-decoration: underline; }
.sorthead svg { color: var(--gold-dk); }
/* A question heading is a sentence with the question mark taken off, so
   it needs to wrap rather than stretch the column to fit one line. */
.table th.qcol { white-space: normal; min-width: 7rem; max-width: 11rem; }

/* Hand-edit controls (#844). Shown, not revealed on hover: a control
   nobody can see is a control nobody uses, and there is no hover on the
   tablet these grids get read on at the rink. The hover-reveal this
   replaced is why the buttons were reported missing. */
.drawcell-actions { display: flex; gap: 4px; margin-top: 8px; }
.cellbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: var(--r);
  color: var(--muted); border: 1px solid var(--line);
  background: var(--white); text-decoration: none;
}
.cellbtn:hover, .cellbtn:focus-visible {
  color: var(--slate); border-color: var(--slate-45); text-decoration: none;
}
.cellbtn-danger:hover, .cellbtn-danger:focus-visible {
  color: var(--red); border-color: var(--red);
}

/* Dragging a game from one cell to another. Only offered where the
   browser can actually do it — draw-grid.js adds the class. */
.is-draggable .drawcell[data-game] { cursor: grab; }
.is-draggable .drawcell.is-dragging {
  opacity: .5; border-style: dashed; border-color: var(--gold-dk); cursor: grabbing;
}
.drawgrid td.is-drop-target { outline: 2px dashed var(--gold); outline-offset: -2px; }
.cellstatus {
  display: block; margin-top: 4px; font-size: 11.5px;
  color: var(--green); font-weight: 600;
}
.cellstatus.is-error { color: var(--red); }

.byerow td { font-size: 12px; color: var(--muted); padding-top: 0; }

/* ---------- score entry (#640) — mobile-first ---------- */

/* This screen is used standing on the ice with a phone, so targets are
   large and typing is kept to a minimum. */
.scoreform .scoremode { width: 100%; margin-bottom: 18px; }
.scoreform .scoremode button { flex: 1; }
.scorerow {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.scorerow label { flex: 1; font-weight: 600; font-size: 15px; margin: 0; }
.scorebox {
  width: 5.5rem; flex: none;
  font-size: 22px; font-weight: 700; text-align: center;
  padding: 12px 8px; font-variant-numeric: tabular-nums;
}
/* The last stone boxes sit in a `.field`, whose `input[type='number']` rule
   would otherwise win and push them out past the edge of the form. */
.field .scorerow .scorebox { width: 5.5rem; padding: 12px 8px; }
.endstable input { padding: 6px 8px; text-align: center; }
.endstable td { padding: 6px 8px; }

/* ---------- live draft board (#642) ---------- */

.draftbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 16px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.draftbar-turn { display: flex; align-items: center; gap: 12px; }
.draftbar-round {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.draftbar-onclock { font-size: 17px; color: var(--slate); }

/* The draft board, laid out like the chair's paper sheet (#1381): the
   pool across the top in columns by requested position, the teams
   beneath as columns with Vice / 2nd / Lead down the side.

   Its own `.draft*` and `.pool*` classes. This screen used to borrow
   `.teamgrid`, `.teamcard`, `.seats`, `.seat*` and `.tray-*` from the
   formation board, so neither could be restyled without the other
   moving. `.draftgrid` (a 22rem sticky sidebar beside a card grid) and
   the `.draftpool .tray-*` overrides are gone with it — check
   `.bigboard` below if you reintroduce a name. */
.draftpool {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 20px;
}
.draftpool-head {
  display: flex; gap: 8px; align-items: center; margin-bottom: 12px;
}
.draftpool-title { font-size: 15px; margin: 0; }
.draftpool-empty { padding: 8px 0; }

/* Auto-fit, so the same fragment sizes itself from its container: it
   renders inside the member page and bare inside `.bigboard`, and no
   fixed column count suits both. 11rem fits a display name without
   wrapping at four or five columns on a laptop. */
.poolcols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 12px;
  align-items: start;
}
.poolcol { min-width: 0; }
.poolcol-head {
  display: flex; gap: 6px; align-items: center;
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 6px;
  padding-bottom: 4px; border-bottom: 1px solid var(--line);
}
.poolcol-count { color: var(--faint); }
.poollist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.poolcard {
  position: relative;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--paper);
}
.poolcard:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.poolcard-name { font-weight: 600; font-size: 13.5px; }
.poolcard-also { color: var(--muted); font-size: 11.5px; }
.poolcard-link { color: inherit; text-decoration: none; }
.poolcard-link:hover { text-decoration: underline; }
/* The whole card opens the details. The name is the link because the card
   holds the Pick form, and a form cannot sit inside a link. */
.poolcard-link::after { content: ''; position: absolute; inset: 0; }
.poolcard-link:focus-visible { outline: none; }
/* Above the stretched link, and only as wide as the button, so Pick picks
   and the space beside it still opens the details. */
.poolcard form { position: relative; z-index: 1; width: fit-content; margin-top: 6px; }
.poolcard-empty { color: var(--faint); font-size: 13px; padding: 2px 0; }

/* Sideways inside its own wrapper, never the page: eight skips do not
   fit a phone, and a horizontally scrolling page loses the pool above
   it as well. */
.draftsheet-wrap { overflow-x: auto; }
.draftsheet { border-collapse: collapse; width: auto; min-width: 100%; }
.draftsheet th, .draftsheet td {
  border: 1px solid var(--line); padding: 7px 10px; text-align: left;
  vertical-align: top;
}
.draftsheet-corner, .draftsheet-seat {
  background: var(--paper); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.draftsheet-team { background: var(--paper); min-width: 9rem; }
.draftsheet-team.onclock { background: var(--gold-tint); border-color: var(--gold); }
.draftsheet-order { color: var(--faint); font-size: 11px; margin-right: 4px; }
.draftsheet-name { font-weight: 600; font-size: 13.5px; display: block; }
.draftsheet-skip { display: block; color: var(--muted); font-size: 11.5px; }
.draftsheet-clock { display: block; margin-top: 4px; }
.draftsheet-cell { font-size: 13.5px; }
.draftsheet-blank { color: var(--faint); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.draftorder { padding-left: 1.4rem; }
.draftorder li { margin-bottom: 6px; }

/* A row on the skips screen: who, and the controls that move or remove
   them (#1381). The two forms sit side by side because a button carries
   one name/value pair and a move needs both which row and which way, so
   each row posts from its own form. Without the flex each <form> takes a
   line of its own and the row falls apart — the same reason
   `.questionrow-actions` exists beside the other reorder screen. */
.skiprow { display: flex; gap: 10px; align-items: baseline; }
.skiprow-order { color: var(--faint); font-size: 12px; min-width: 1.2rem; }
.skiprow-body { flex: 1; min-width: 0; }
.skiprow-actions {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap; flex: none;
}
.skiprow-actions form { display: flex; gap: 6px; }
/* Hidden until draft-skips.js has run, as on the other reorder screens. */
.skiprow .grip { display: none; color: var(--faint); cursor: grab; align-self: center; }
.is-draggable .skiprow .grip { display: inline-flex; }
.skiprow.is-dragging { opacity: 0.55; }

/* A team's name on that row, edited in place (#1425). */
.team-name { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.team-name-edit {
  display: inline-flex; padding: 2px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer;
}
.team-name-edit[hidden] { display: none; }
.team-name-edit:hover { color: var(--blue); }
.team-name-input { width: auto; flex: 1 1 12rem; }
.team-name-tip { color: var(--muted); font-size: 12px; }
.team-name-tip.is-error { color: var(--red); }
.team-name-noscript { display: flex; gap: 6px; margin-top: 4px; }

@media (max-width: 640px) {
  .skiprow { flex-wrap: wrap; }
  .skiprow-actions { width: 100%; }
}

/* The projected board: legible from across a room.
   These selectors must track the class names above. They used to name
   `.teamcard`, `.seat`, `.tray-name` and a sticky `.draftpool`, all of
   which the #1381 rename removed — and a `.bigboard` rule that matches
   nothing fails silently, leaving 13.5px names on a TV. */
.bigboard .draftbar-onclock { font-size: 28px; }
.bigboard .draftsheet-name { font-size: 20px; }
.bigboard .draftsheet-skip { font-size: 15px; }
.bigboard .draftsheet-cell { font-size: 19px; }
.bigboard .draftsheet-corner,
.bigboard .draftsheet-seat { font-size: 14px; }
.bigboard .draftpool-title { font-size: 20px; }
.bigboard .poolcard-name { font-size: 19px; }
.bigboard .poolcard-also { font-size: 14px; }
.bigboard .poolcol-head { font-size: 15px; }
/* Wider columns at projector type sizes, so a name is not wrapped
   across three lines on the one screen the whole room reads. */
.bigboard .poolcols { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }

/* The combined projector: one column per division, read from across a
   room (#1347). Auto-fit rather than a fixed count, so two divisions
   fill a TV and three still fit before wrapping. */
.allboards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 18px;
  align-items: start;
}
.allboard-name { font-size: 20px; margin: 0 0 10px; }
.allboard-label {
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.allboard-clock { font-size: 34px; font-weight: 600; margin: 2px 0 6px; }
.allboard-meta { font-size: 15px; color: var(--muted); margin: 0; }
.allboard-last { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.allboard-idle { font-size: 22px; color: var(--muted); margin: 0; }

@media (max-width: 60rem) {
  /* `.poolcols` is auto-fit, so it collapses on its own and needs no
     breakpoint. `.draftgrid` and the sticky `.draftpool` rules that
     were here went with the #1381 rename. */
  .allboards { grid-template-columns: 1fr; }
}

/* ---------- display screens (#643) ---------- */

/* A wall screen is read from across a room, so everything is larger and
   nothing is interactive. */
body.display { background: var(--slate); color: #eceef4; }

.displayhead {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 32px; background: var(--slate-surface);
  border-bottom: 3px solid var(--gold);
}
.displayhead .mark {
  width: 36px; height: 36px; flex: none;
  background: var(--paper); border-radius: 50%;
}
.displayhead-title { font-size: 24px; font-weight: 700; color: #fff; }
.displayhead-sub { font-size: 15px; color: rgba(255, 255, 255, 0.7); }
.displayclock { font-size: 26px; font-weight: 600; color: var(--gold); }

.display .empty { color: rgba(255, 255, 255, 0.5); font-size: 18px; }
.display .iceblock { background: var(--slate-surface); border-color: rgba(255,255,255,.2); }
.display .iceblock .who { color: var(--gold); }
.display .iceblock .when { color: #eceef4; }
.display .iceblock .meta { color: rgba(255, 255, 255, 0.55); }

/* ---------- reorderable rows (the league layout editor) ---------- */

.panelrota li { gap: 10px; }
.panelrota form { display: flex; align-items: center; gap: 4px; margin: 0; }
.input-sm { padding: 4px 7px; font-size: 12.5px; }
.panelrota .link-button[disabled] { opacity: .3; cursor: default; }

/* Visible to a screen reader, not on screen: the per-panel seconds box
   is labelled by its row, which a sighted person reads and a screen
   reader would otherwise meet as a bare number field. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- ice-entrance kiosk (#644) ---------- */

/* Sized for a tablet at the door, tapped by someone in gloves on their
   way onto the ice. Nothing here is smaller than a thumb, and the whole
   board is legible from arm's length. */

.kiosk { padding: 20px 22px 40px; }
.kiosk-board {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
}
.kiosk-sheet {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px; padding: 14px 16px 18px;
}
.kiosk-sheetname {
  font-size: 15px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 12px;
}
.kiosk-game {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 12px; padding: 14px; margin-bottom: 12px;
}
.kiosk-game.is-live { border-color: rgba(201, 165, 74, .55); }
.kiosk-game.is-over { opacity: .55; }
.kiosk-when {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 14px; color: rgba(255, 255, 255, .62);
}
.kiosk-league { font-size: 13px; }
.kiosk-teams {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  font-size: 21px; font-weight: 600; margin: 8px 0 12px; color: #fff;
}
.kiosk-vs { font-size: 13px; color: rgba(255, 255, 255, .45); }
.kiosk-state { font-size: 14px; color: rgba(255, 255, 255, .6); margin: 6px 0; }
.kiosk-free { color: rgba(255, 255, 255, .45); font-size: 14px; }

.kiosk-actions { display: grid; gap: 10px; }
.kiosk-btn {
  width: 100%; min-height: 60px; padding: 0 18px;
  font-size: 17px; font-weight: 600; cursor: pointer;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .09); color: #fff;
}
.kiosk-btn:active { transform: translateY(1px); }
.kiosk-btn-go { background: var(--gold); border-color: var(--gold); color: #14202b; }
.kiosk-btn-stop { background: rgba(190, 70, 60, .85); border-color: rgba(190, 70, 60, .9); }
.kiosk-finish { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kiosk-finish .kiosk-btn { grid-column: 1 / -1; }
.kiosk-score {
  /* A grid item defaults to min-width:auto, and an <input>'s intrinsic
     min-content width is its `size` attribute — about 20 characters. So
     on a four-sheet board the two score boxes refuse to shrink into
     their 1fr columns and burst out of the card, over the next sheet.
     Only shows up once the columns are narrow enough to matter, which
     is exactly the wall-mounted four-sheet case this screen is for. */
  min-width: 0;
  min-height: 60px; font-size: 22px; text-align: center;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(0, 0, 0, .25); color: #fff;
}

.kiosk-offline, .kiosk-toast {
  border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; font-size: 15px;
}
.kiosk-offline { background: rgba(190, 140, 40, .2); border: 1px solid rgba(201, 165, 74, .5); color: #f2e2bb; }
.kiosk-toast { background: rgba(255, 255, 255, .1); color: #fff; }
.kiosk-toast.is-error { background: rgba(190, 70, 60, .3); }

.codeblock {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; overflow-x: auto; font-size: 12.5px;
  font-family: 'IBM Plex Mono', monospace;
}

/* ---------- bonspiels (#645) ---------- */

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

/* The bracket scrolls sideways in its own box — a 16-rink double
   elimination is simply wider than a laptop, and the page itself must
   never scroll horizontally. */
.bracketwrap { overflow-x: auto; padding-bottom: 8px; }
.bracket { display: flex; gap: 26px; align-items: flex-start; min-width: min-content; }
.bracket-round { min-width: 15rem; }
.bracket-round h3 {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px;
}
.bracket-match {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r); padding: 9px 11px; margin-bottom: 10px; font-size: 13px;
}
.bracket-match.is-done { border-left: 3px solid var(--green); }
.bracket-match.is-bye { opacity: .55; font-style: italic; }
.bracket-side { display: flex; justify-content: space-between; gap: 10px; }
.bracket-side.won { font-weight: 700; }
.bracket-side .muted { font-weight: 400; }
.bracket-round-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin: 0 0 8px;
}

/* League playoff seeding (#845) — read far more often than edited. */
.seedlist { margin: 0 0 12px; padding-left: 1.4em; }
.seedlist li { padding: 2px 0; }
.seedlist .tag { margin-left: 6px; }
.bracket-meta { color: var(--muted); font-size: 11.5px; margin-top: 5px; }

.entryrow .tag { margin-left: 4px; }
.pooltable { margin-bottom: 20px; }
.bracket-score { display: flex; align-items: center; gap: 4px; margin: -4px 0 12px; }
.bracket-score .input-sm { width: 3.5rem; }

/* ---------- bonspiel draw number, edited in place ---------- */

.draw-number-input { display: inline-block; width: 4.5rem; }
.draw-number-input[hidden] { display: none; }
.draw-number-edit {
  background: none; border: 0; padding: 2px; cursor: pointer;
  color: var(--muted); vertical-align: -2px; line-height: 0;
}
.draw-number-edit:hover { color: var(--blue-dk); }
.draw-number-edit[hidden] { display: none; }
.draw-number-edit svg {
  width: 14px; height: 14px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.draw-number-tip {
  display: inline-block; margin: 0 4px; padding: 2px 8px;
  background: var(--slate); color: #fff; font-size: 12px; font-weight: 500;
  border-radius: var(--r);
}
.draw-number-tip.is-error { background: var(--red); }
.draw-number-tip[hidden] { display: none; }

/* ---------- copy-to-clipboard toast (#691) ---------- */

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 12px);
  background: var(--slate); color: #fff; font-size: 13.5px; font-weight: 500;
  padding: 11px 18px; border-radius: var(--r); box-shadow: var(--sh-lg);
  z-index: 60; opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--red); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

.signuplink { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.signuplink-url {
  font-size: 12.5px; margin-top: 8px; word-break: break-all; color: var(--slate);
}

/* ---- Modal ---------------------------------------------------------------
 * A page shown in place rather than navigated to (see js/modal.js). Native
 * <dialog>, so the browser handles focus trapping, Escape, and the top
 * layer; this only has to dress it.
 */
/* Fixed, as the browser's own style for an open dialog has it (#1557).
   This was `relative`, for the corner dismiss, and that beat the browser:
   a top-layer element that is not fixed is placed as absolute, against
   the top of the document. The dialog opened there, and focusing its
   close button scrolled the page up to it, so somebody far down the
   standings lost their place. Fixed is a containing block for
   `.modal-x` too.

   `dvh` after `vh`: on iOS Safari `100vh` is the height with the toolbar
   hidden, so a tall dialog ran under it. */
.modal {
  position: fixed; inset: 0; margin: auto;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 0; background: var(--paper); color: var(--ink);
  width: min(720px, calc(100vw - 32px));
  height: fit-content;
  max-height: calc(100vh - 64px);
  max-height: calc(100dvh - 64px);
  box-shadow: 0 18px 50px rgba(45, 48, 66, 0.28);
  overflow: hidden;
}
.modal::backdrop { background: rgba(45, 48, 66, 0.45); }
.modal-body {
  padding: 24px; overflow-y: auto;
  max-height: calc(100vh - 64px);
  max-height: calc(100dvh - 64px);
}
/* The modal already frames its content, so a page's own outer chrome would
   read as a box inside a box. */
.modal-body .page-narrow { max-width: none; }
.modal-body .page-head { margin-top: 0; }
.modal-body .page-head .btnrow { display: none; }
.modal-body h1 { font-size: 22px; }
/* A page's card is its own frame. Inside a dialog that frame is already
   there, so keeping it draws a box inside a box — which is what the
   `.page-narrow` and `.page-head` rules above are already about. */
.modal-body .card {
  background: none; border: 0; box-shadow: none; border-radius: 0;
}
.modal-body .card-pad { padding: 0; }
.modal-body .stacked { max-width: none; }
/* Room for the dismiss in the corner, so a long title does not run under it. */
.modal-body h1 { padding-right: 36px; }

.modal-x { position: absolute; top: 12px; right: 12px; margin: 0; z-index: 1; }
.modal-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 999px;
  border: 1px solid transparent; background: transparent;
  color: var(--muted); cursor: pointer;
}
.modal-close:hover, .modal-close:focus-visible {
  background: var(--white); border-color: var(--line-2); color: var(--slate);
}

/* An icon-only action in a card's top-right corner (#1473): archive a
 * bonspiel from its card on the Bonspiels page. */
.card-has-action { position: relative; }
.card-action {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 999px;
  border: 1px solid transparent; background: transparent;
  color: var(--muted); cursor: pointer;
}
.card-action svg { width: 16px; height: 16px; }
.card-action:hover, .card-action:focus-visible {
  background: var(--white); border-color: var(--line-2); color: var(--slate);
}

/* ---- Sheet ordering list -------------------------------------------------
 * Rows are the order: top to bottom is left to right in the building.
 * Dragging is an enhancement (js/sheet-order.js); the arrows in each row
 * are the control it sits on top of.
 */
.sheetlist { list-style: none; margin: 0; padding: 0; }
.sheetrow {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--white); margin-bottom: 8px;
}
/* Wide enough for the longest thing a facility actually calls a sheet
   ("Championship"), rather than the input's default ~20 characters. */
.sheetrow .sheetlabel { width: 16rem; flex: none; }
.sheetrow .grip {
  display: none; color: var(--faint); cursor: grab;
}
/* Only offered where dragging actually works — the class is added by the
   script, so a browser it does not run in never shows a handle it cannot
   use. */
.is-draggable .grip { display: inline-flex; }
.is-draggable .sheetrow:hover { border-color: var(--slate-45); }
.rowstatus {
  font-size: 12px; color: var(--green); font-weight: 600;
  white-space: nowrap; min-width: 4.5rem;
}
.rowstatus.is-error { color: var(--red); white-space: normal; }
.sheetrow.is-dragging {
  opacity: 0.55; border-style: dashed; border-color: var(--gold-dk);
  cursor: grabbing;
}

/* ---------- league registration questions (#841) ---------- */

/* Same shape as the sheet list, which is the other drag-to-order screen —
   a grip that only appears where dragging works, and a per-row status
   that is the only confirmation there is once saving happens on its own. */
.questionlist { margin: 0 0 18px; }
.questionrow {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--white); margin-bottom: 8px;
}
.questionrow .grip { display: none; color: var(--faint); cursor: grab; padding-top: 2px; }
.is-draggable .questionrow .grip { display: inline-flex; }
.is-draggable .questionrow:hover { border-color: var(--slate-45); }
.questionrow.is-dragging {
  opacity: 0.55; border-style: dashed; border-color: var(--gold-dk);
  cursor: grabbing;
}
.questionrow-body { flex: 1; min-width: 0; }
.questionrow-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.questionrow-actions {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap; flex: none;
}

/* A field that does not apply to the question type currently chosen.
   Dimmed rather than hidden: it stays where it was so the form does not
   jump under the cursor every time the type changes. */
.field.is-disabled { opacity: .5; }
.field.is-disabled textarea,
.field.is-disabled input { cursor: not-allowed; background: var(--paper); }

@media (max-width: 640px) {
  .questionrow { flex-wrap: wrap; }
  .questionrow-actions { width: 100%; }
}

/* Small forms that sit inline in a list row — the role select, and the
   single-button actions beside it. Without this each <form> takes a line
   of its own and the row falls apart. */
.inline-form {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 8px;
}
.inline-form .input { font-size: 13px; padding: 6px 10px; }

/* ---------- error pages ---------- */
/* Shared by the 404 and the 403. The 500 cannot use this file: it renders
   with no request and no database, so it carries its own copy of what it
   needs inline. See `sites/broomstack/errors.py` for why. */

.errpage { max-width: 34rem; margin: 6vh auto 0; text-align: center; }

/* The house is the zero in the numeral. Four rings, the real colours:
   12-foot blue, 8-foot white, 4-foot red, button white. */
.errmark {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 26px;
}
.errmark span {
  font-size: 92px; font-weight: 700; line-height: 1;
  color: var(--slate); letter-spacing: -.02em;
}
.errmark svg { width: 92px; height: 92px; display: block; }

/* A stone on a sheet. On the 404 it comes down and stops short of the far
   hog line, which is what "hogged" means and therefore what the picture
   has to show — an earlier version slid it clean off the right-hand edge,
   which is a stone through the house, the opposite mistake. */
.errsheet {
  position: relative; height: 66px; max-width: 24rem; margin: 0 auto 26px;
}
.errsheet::before {
  content: ''; position: absolute; left: 0; right: 0; top: 40px;
  border-top: 2px solid var(--line);
}
.errhog {
  position: absolute; left: 80%; top: 4px; height: 42px;
  border-left: 2px dashed var(--slate-45);
}
.errhog span {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  padding-top: 5px; white-space: nowrap;
  font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--faint);
}
/* `top` seats the stone *on* the sheet line rather than letting the line
   cut through it: the drawing's base is at 89 of a 100-unit viewBox,
   which at this width lands 37px down. */
.errstone {
  position: absolute; left: -50px; top: 3px; width: 50px;
  animation: errslide 4.6s cubic-bezier(.1,.72,.28,1) infinite;
}
@keyframes errslide {
  0%, 4%    { left: -50px; }
  55%, 100% { left: 44%; }
}
@media (prefers-reduced-motion: reduce) {
  /* Parked where the animation ends, so the picture still reads. */
  .errstone { animation: none; left: 44%; }
}

/* The 403 shows the same stone standing still — no sheet line, no hog
   line, no travel. Nothing about "that is not your rock" is about
   distance, and a lone stone on a stub of line read as a smudge. Bigger
   too, because here it is the whole picture rather than one end of it. */
.errsolo { margin: 0 auto 26px; }
.errsolo .errstone {
  position: static; display: block; width: 76px; margin: 0 auto;
  animation: none;
}

.errpage h1 { font-size: 34px; margin: 0 0 12px; letter-spacing: -.01em; }
.errpage p { color: var(--muted); font-size: 15px; margin: 0 auto 14px; }
.errbtns {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 26px;
}
.errpath {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12.5px; color: var(--faint);
  word-break: break-all; margin-top: 26px;
}

/* Role guide on the access screen (#1131). A definition list rather than
   a paragraph: a chair is comparing four options against each other, and
   four things compare better stacked than in prose. Two columns once
   there is room, one below that so the wording never gets squeezed into
   a gutter. */
.rolelist { margin: 10px 0 0; display: grid; gap: 2px 14px; }
.rolelist dt { font-weight: 600; font-size: 13px; color: var(--slate); }
.rolelist dd { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
@media (min-width: 560px) {
  .rolelist { grid-template-columns: max-content 1fr; }
  .rolelist dt { grid-column: 1; }
  .rolelist dd { grid-column: 2; margin-bottom: 2px; }
}

/* The club access screen without its full member list (#1524): a search
   box with results under it, a pill that says a role saved, and the
   letter index on "View all members". */
.member-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.member-search input[type=search] { flex: 1 1 240px; min-width: 0; }
.member-results:empty { display: none; }
.member-results { margin-bottom: 18px; }
/* The pill floats beside the select rather than taking a place in the
   row: in the flow it pushed the select and the trash button aside, and
   in a full row knocked the button onto a second line. */
.role-form { position: relative; }
.role-form .saved-pill {
  position: absolute; right: calc(100% + 8px); top: 50%;
  transform: translateY(-50%); white-space: nowrap; z-index: 1;
}
/* On a phone the row wraps and the form starts at its left edge, so the
   pill sits over the select's own right end instead. */
@media (max-width: 40rem) {
  .role-form .saved-pill { right: 28px; }
}
.icon-btn, button[type='submit'].icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border-radius: 999px;
  border: 1px solid transparent; background: transparent;
  color: var(--muted); cursor: pointer;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover, .icon-btn:focus-visible,
button[type='submit'].icon-btn:hover, button[type='submit'].icon-btn:focus-visible {
  background: var(--paper); border-color: var(--line-2); color: var(--red);
}
/* Remove's question takes the place of the row's controls. */
.inline-form[hidden] { display: none; }
.remove-confirm {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-left: 8px; font-size: 13px;
}
.saved-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green-tint);
  color: var(--green);
  transition: opacity .4s ease;
}
/* Its own display would otherwise beat the hidden attribute. */
.saved-pill[hidden] { display: none; }
.saved-pill.is-error { background: var(--red-tint); color: var(--red); }
.saved-pill.is-fading { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .saved-pill { transition: none; } }
.letter-index {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 14px;
  font-weight: 600;
  font-size: 14px;
}
.letter-index a, .letter-index span {
  min-width: 26px;
  padding: 3px 0;
  text-align: center;
  border-radius: 4px;
}
.letter-index a { text-decoration: none; background: var(--line); color: var(--slate); }
.letter-index a:hover, .letter-index a:focus-visible { background: var(--line-2); }
.letter-index span { color: var(--line-2); }
.members-letter { font-size: 15px; margin: 18px 0 6px; color: var(--muted); scroll-margin-top: 12px; }
.earlier-invitations { margin: 0 0 18px; }
.earlier-invitations summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }

/* A spare email as it will go out (#1426). */
.email-preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  padding: 12px;
  background: var(--paper);
  border-radius: 6px;
}

/* ---------- a league's page and its layout editor (#1420) ---------- */

.league-layout {
  display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr));
}
.league-layout > section { min-width: 0; }
.league-layout > .w-full { grid-column: 1 / -1; }
.league-layout > .w-half > .card { height: 100%; }
.league-layout .section-title { margin-top: 0; }
@media (max-width: 60rem) {
  .league-layout { grid-template-columns: minmax(0, 1fr); }
}
.widget-links { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }

.layoutrow .grip { display: none; color: var(--faint); cursor: grab; }
.is-draggable .layoutrow .grip { display: inline-flex; }
.layoutrow.is-dragging { opacity: 0.55; border-style: dashed; border-color: var(--gold-dk); }
.layoutrow .select { width: auto; }
.panelrota .layoutrow-text { flex: 1 1 100%; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.layoutrow-text .field { flex: 1 1 14rem; margin-bottom: 0; }

/* Bracket builder (#1429): a visual editor (js/bracket-builder.js). Each
   event is its own sideways-scrolling board of round columns; cards carry
   W and L handles that drag onto another card's slot. */
.builder-start { margin-bottom: 22px; }
.builder-starters {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
.builder-starter {
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--white); box-shadow: var(--sh); cursor: pointer;
  font: inherit; color: var(--ink);
}
.builder-starter:hover:not(:disabled) { border-color: var(--gold-dk); box-shadow: var(--sh-md); }
.builder-starter:disabled { opacity: 0.5; cursor: not-allowed; }
.builder-starter-name { font-weight: 700; color: var(--slate); font-size: 15px; }
.builder-starter-about { color: var(--muted); font-size: 13px; }
.builder-starter-count { margin-top: auto; font-size: 12px; color: var(--gold-dk); font-weight: 600; }

.builder-bar { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.builder-checks {
  background: var(--gold-tint); border: 1px solid #ecdcb0; border-radius: var(--r);
  padding: 8px 12px; font-size: 13px; max-width: 46rem;
}
.builder-checks summary { cursor: pointer; font-weight: 600; color: var(--gold-dk); display: flex; align-items: center; gap: 6px; }
.builder-checks ul { margin: 8px 0 2px; padding-left: 1.2em; }
.builder-checks a { color: var(--ink); }
.builder-ready { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 13px; font-weight: 600; margin: 0; }

.builder-event { margin-bottom: 18px; }
.builder-event-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.builder-event-name {
  font: inherit; font-weight: 700; font-size: 16px; color: var(--slate);
  border: 1px solid transparent; border-radius: var(--r); background: transparent;
  padding: 3px 6px; min-width: 0; width: 16rem; max-width: 100%;
}
.builder-event-name:hover { border-color: var(--line-2); }
.builder-event-name:focus { outline: none; border-color: var(--blue); background: var(--white); }

.builder-board {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--paper);
  /* Holds absolutely placed lines, handles and labels inside the scroll
     box: positioned against the page, they widened it on a phone. */
  position: relative;
}
.builder-columns {
  display: flex; gap: 44px; padding: 14px 28px 14px 14px;
  position: relative; min-width: max-content; align-items: flex-start;
}
.builder-lines { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.builder-lines path, .builder-wire path { fill: none; stroke-width: 2; }
.builder-lines .is-win, .builder-wire.is-win path { stroke: var(--green); }
.builder-lines .is-loss, .builder-wire.is-loss path { stroke: var(--red); stroke-dasharray: 5 4; }
.builder-wire {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  pointer-events: none; z-index: 50; overflow: visible;
}
.builder-column { width: 13.5rem; flex: none; display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 1; }
.builder-column h3 {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 0;
}
.builder-cards { display: flex; flex-direction: column; gap: 12px; min-height: 8px; }
.builder-column.is-ghost h3 { color: var(--faint); }
.builder-add {
  border: 1px dashed var(--line-2); border-radius: var(--r); background: transparent;
  color: var(--muted); font: inherit; font-size: 12.5px; padding: 8px; cursor: pointer;
}
.builder-add:hover { border-color: var(--gold-dk); color: var(--slate); background: var(--white); }
.builder-column.is-ghost .builder-add { padding: 18px 8px; }
.builder-add-event { margin-top: 4px; }

.builder-card {
  position: relative; background: var(--white); border: 1px solid var(--line-2);
  border-radius: var(--r); box-shadow: var(--sh); font-size: 13px;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.builder-card.is-locked { border-left: 3px solid var(--green); }
.builder-card.is-bye { border-style: dashed; }
.builder-card.is-flagged { border-color: #e2c26b; }
.builder-card.is-saved { border-color: var(--gold-dk); box-shadow: 0 0 0 3px var(--gold-tint); }
.builder-card.is-error { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
.builder-card.is-dragging { opacity: 0.35; }
.builder-card.is-source { box-shadow: 0 0 0 3px var(--blue-tint); }
.builder-ghost {
  position: fixed; z-index: 60; pointer-events: none; opacity: 0.9;
  box-shadow: var(--sh-md); transform: rotate(1.5deg);
}
.builder-drop-marker { height: 3px; border-radius: 2px; background: var(--gold-dk); margin: -7px 0; }

.builder-card-head {
  display: flex; align-items: center; gap: 4px; padding: 5px 6px 4px 4px;
  border-bottom: 1px solid var(--line);
}
.builder-grip { color: var(--faint); cursor: grab; display: inline-flex; touch-action: none; padding: 2px; }
.builder-grip:hover { color: var(--slate); }
.builder-card-name {
  flex: 1; min-width: 0; font: inherit; font-weight: 700; color: var(--slate);
  border: 1px solid transparent; border-radius: 3px; background: transparent; padding: 1px 4px;
}
.builder-card-name:hover { border-color: var(--line-2); }
.builder-card-name:focus { outline: none; border-color: var(--blue); }
.builder-lock { color: var(--green); display: inline-flex; }
.builder-flag { width: 8px; height: 8px; border-radius: 50%; background: #e2a23b; flex: none; }
.builder-menuwrap { position: relative; }
.builder-menu-button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: var(--r);
}
.builder-menu-button:hover, .builder-menu-button[aria-expanded="true"] { background: var(--paper); color: var(--slate); }
.builder-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 12rem;
  background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: var(--sh-md); padding: 4px; display: flex; flex-direction: column;
}
.builder-menu[hidden] { display: none; }
.builder-menu button {
  border: 0; background: none; text-align: left; font: inherit; font-size: 13px;
  padding: 7px 10px; border-radius: 3px; cursor: pointer; color: var(--ink);
}
.builder-menu button:hover, .builder-menu button:focus { background: var(--paper); outline: none; }
.builder-menu button.is-confirming, [data-action].is-confirming { color: var(--red); font-weight: 600; }
.builder-menu-note { font-size: 12px; color: var(--faint); padding: 6px 10px; }

.builder-slot {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%;
  border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit;
  text-align: left; padding: 7px 10px; cursor: pointer; color: var(--ink);
}
.builder-slot:last-of-type { border-bottom: 0; }
.builder-slot:hover:not(:disabled) { background: var(--blue-tint); }
.builder-slot:disabled { cursor: default; }
.builder-slot.is-empty .builder-slot-source { color: var(--blue); }
.builder-slot-source { font-weight: 600; font-size: 12.5px; }
.builder-slot-team { color: var(--muted); font-size: 12px; }
.is-wiring .builder-slot:not(:disabled) { background: #fbfbf8; }
.builder-slot.is-target { background: var(--gold-tint) !important; box-shadow: inset 0 0 0 2px var(--gold-dk); }
.builder-bye { font-size: 10.5px; padding: 1px 6px; }

.builder-handle {
  position: absolute; right: -11px; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 800; color: #fff; cursor: crosshair;
  touch-action: none; user-select: none; box-shadow: 0 0 0 2px var(--paper); z-index: 2;
  margin-top: -10px;
}
.builder-handle.is-win { background: var(--green); top: 34%; }
.builder-handle.is-loss { background: var(--red); top: 66%; }
.builder-handle.is-solo { top: 50%; }
.builder-handle:hover { transform: scale(1.15); }
.builder-routes { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 8px 7px; }

.builder-picker {
  position: absolute; z-index: 40; width: 17rem; max-height: 22rem;
  display: flex; flex-direction: column; background: var(--white);
  border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--sh-md);
}
.builder-picker-search { margin: 8px; width: auto; }
.builder-picker-list { overflow-y: auto; padding: 0 4px 6px; }
.builder-picker-group h4 {
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); margin: 8px 8px 2px;
}
.builder-picker-option {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 3px; cursor: pointer; color: var(--ink);
}
.builder-picker-option:hover, .builder-picker-option:focus { background: var(--blue-tint); outline: none; }
.builder-picker-option.is-current { font-weight: 700; color: var(--blue-dk); }
.builder-picker-option.is-current::after { content: ' ✓'; }
.builder-picker-option.is-clear { color: var(--red); }
@media (max-width: 34rem) {
  .builder-picker {
    position: fixed; left: 0 !important; right: 0; top: auto !important; bottom: 0;
    width: auto; max-height: 60vh; border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
}

.builder-toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 70;
  background: var(--slate); color: #fff; padding: 9px 16px; border-radius: 999px;
  font-size: 13px; box-shadow: var(--sh-md); max-width: calc(100vw - 32px);
}
.builder-toast.is-error { background: var(--red); }
.bracket-routes { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }

/* Bonspiel field page: where the spiel stands and the one next step,
   then the field as one table that seeds by dragging (js/bonspiel-seeds.js;
   the arrows in each row are what it sits on top of). */
.spiel-status {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px 16px; padding: 12px 16px; margin-bottom: 14px;
}
.spiel-status-text { margin: 0; font-size: 14px; color: var(--muted); }
.spiel-status-text b { color: var(--slate); }
.spiel-status .inline-form { margin: 0; }
.spiel-help { margin: 0 0 10px; }
.fieldtable-seed { width: 1%; white-space: nowrap; }
.fieldtable-seed .mono { display: inline-block; min-width: 1.6em; color: var(--slate); font-weight: 600; }
.fieldtable .grip { display: none; color: var(--faint); cursor: grab; vertical-align: middle; margin-right: 4px; }
.fieldtable .is-draggable .grip { display: inline-flex; }
.fieldtable .is-draggable tr:hover { cursor: grab; }
.fieldtable tr.is-dragging { opacity: 0.55; background: var(--gold-tint); }
.fieldtable-rink { white-space: nowrap; }
.fieldtable-players { color: var(--muted); min-width: 12rem; }
.fieldtable-actions { width: 1%; white-space: nowrap; text-align: right; }
/* Holds the header's visually hidden label inside the scroll box: positioned
   against the page, it widened the page on a phone (as .builder-game). */
.fieldtable th { position: relative; }
.fieldtable-actions .rowstatus { margin-right: 10px; }
.fieldtable-heading th {
  background: var(--paper); border-top: 2px solid var(--line-2);
  text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--slate);
  white-space: normal;
}

/* Add a rink: one box per seat, four abreast where there is room. */
.seatgrid {
  display: grid; gap: 0 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
}
.enter-more { margin: 0 0 16px; }
.enter-more summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.settingsform { max-width: 44rem; }

/* A yes/no question in a dialog (#1531): narrower than a page in a modal,
 * since it holds a few lines and two buttons. */
.modal-confirm { width: min(30rem, calc(100vw - 32px)); }
.modal-confirm h2 { font-size: 20px; padding-right: 36px; }

/* ---- A league's Spares page, in tabs (#1563) -----------------------------
 * The tabs are the .seg control. Without the script every section shows
 * with its heading; with it, one section at a time, and the tab says
 * what the heading did. */
.spare-tabs { margin: 4px 0 20px; }
.tabs-on > .tabpanel > .section-title:first-child { display: none; }
.autosave-status:empty { display: none; }
.autosave-status.is-error { color: var(--red); font-weight: 600; }
/* `hidden` has to win over a `.btnrow`'s flex, or the fallback buttons and
   the hidden panels still show. */
[data-autosave-fallback][hidden], [data-add-current][hidden], .tabpanel[hidden] { display: none; }

/* Who may sub for whom: a card per seat, the positions as chips (#1563).
   Two across where there is room, one on a phone. Specific enough to win
   over the site's full-width option cards. */
.rule-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
}
.rule-card { padding: 16px 18px; }
.rule-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rule-card-head h3 { margin: 0; font-size: 16px; }
.rule-card > .help { margin: 2px 0 10px; }
.rule-card .field { margin: 0; }
.rule-card .field div[id] { display: flex; flex-wrap: wrap; gap: 8px; }
.rule-card .field div[id] > div { display: contents; }
.rule-card .field div[id] > div > label {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--white); font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.rule-card .field div[id] > div > label:hover { border-color: var(--slate-45); }
.rule-card .field div[id] > div > label:has(> input:checked) {
  border-color: var(--gold); background: var(--gold-tint);
}
.rule-card:has([aria-invalid='true'], .errorlist) { border-color: var(--red); }

/* The wording tab: one email at a time, its editor beside its preview
   (#1563). Side by side from 60rem, stacked below. The preview sticks as
   the editor scrolls. */
.wording-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin: 14px 0;
}
.wording-bar [hidden], .wording-pane[hidden] { display: none; }
.wording-form.is-switched .wording-pane-title { display: none; }
.wording-grid { display: grid; gap: 16px; align-items: start; margin-bottom: 16px; }
@media (min-width: 60rem) {
  .wording-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .wording-preview { position: sticky; top: 16px; }
}
.wording-preview-subject { margin: 8px 0; font-weight: 600; font-size: 14px; }
.wording-preview .email-preview { max-height: 32rem; overflow: auto; }
[data-variables] .detail { margin-bottom: 14px; }
.rule-card > .help, .wording-preview > .help, [data-variables] .help {
  font-size: 12.5px; color: var(--muted);
}
/* Variables are written in lower case, so they are shown that way. */
[data-variables] .detail dt { text-transform: none; letter-spacing: 0; font-size: 13px; }
.wording-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.wording-actions [hidden] { display: none; }

/* ---------- My Schedule (#1568) ---------- */

/* A list grouped by month, not a wall of cards: a season crosses New
   Year, and the month heading is where the year is read. */
.sched-leagues { margin: -8px 0 20px; }
.sched-month { margin-bottom: 22px; }
.sched-month-h {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 8px;
}
.sched-list {
  list-style: none; margin: 0; padding: 0;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh); overflow: hidden;
}
.sched-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-top: 1px solid var(--line);
}
.sched-row:first-child { border-top: 0; }
.sched-row.is-past { background: #fbfbf8; }
.sched-row.is-past .sched-date { background: #edece6; color: var(--muted); }
.sched-date {
  flex: none; width: 46px; padding: 5px 0; text-align: center;
  border-radius: var(--r); background: var(--slate); color: var(--white);
  line-height: 1.1;
}
.sched-dow {
  display: block; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8;
}
.sched-day { display: block; font-size: 18px; font-weight: 700; }
.sched-main { flex: 1; min-width: 0; }
.sched-title { font-weight: 700; font-size: 14.5px; color: var(--slate); }
.sched-title .tag { margin-left: 6px; vertical-align: 1px; }
.sched-meta {
  display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px;
  font-size: 13px; color: var(--muted);
}
.sched-league { color: var(--blue-dk); font-weight: 600; }
.sched-act { flex: none; display: flex; align-items: center; gap: 8px; }
.sched-spare {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--slate);
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 6px 12px; background: var(--white); white-space: nowrap;
}
.sched-spare:hover, .sched-spare:focus-visible {
  text-decoration: none; border-color: var(--gold); background: var(--gold-tint);
}
.sched-spare svg { color: var(--gold-dk); }
/* On a phone the label goes and the button is the icon alone; the link
   keeps its aria-label either way. */
@media (max-width: 40rem) {
  .sched-row { padding: 10px 12px; gap: 10px; }
  .sched-spare { padding: 0; width: 34px; height: 34px; justify-content: center; }
  .sched-spare-label { display: none; }
}
.banner-dismiss { margin: 0 0 0 -6px; }
.banner-dismiss .icon-btn:hover, .banner-dismiss .icon-btn:focus-visible {
  color: var(--slate);
}

/* ---------- switches and email preferences (#1575) ---------- */

/* A checkbox drawn as an on/off switch. Qualified as
   `input[type='checkbox'].switch` (0,2,1) to outrank the site-wide
   checkbox rules above (0,1,1), knob included. Gold when on, the site's
   accent, so on and off read apart at a glance. */
input[type='checkbox'].switch {
  width: 40px; height: 24px; border-radius: 12px;
  border: 0; background: var(--line-2);
  display: inline-block; position: relative; vertical-align: middle;
}
input[type='checkbox'].switch::before {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--white); clip-path: none; transform: none;
  box-shadow: 0 1px 2px rgba(45, 48, 66, 0.25);
  transition: left .15s ease;
}
input[type='checkbox'].switch:hover { background: var(--faint); }
input[type='checkbox'].switch:checked { background: var(--gold); }
input[type='checkbox'].switch:checked:hover { background: var(--gold-dk); }
input[type='checkbox'].switch:checked::before { left: 19px; transform: none; }
@media (prefers-reduced-motion: reduce) {
  input[type='checkbox'].switch::before { transition: none; }
}

.pref-list { padding: 0; }
.pref-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.pref-row:last-of-type { border-bottom: 0; }
.pref-text label { display: block; font-weight: 600; font-size: 14px; color: var(--slate); cursor: pointer; }
.pref-text .help { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pref-save { padding: 14px 18px; border-top: 1px solid var(--line); }
.pref-save[hidden] { display: none; }

/* ---------- managed TV displays (#1593) ---------- */

/* A fixed 1920x1080 canvas that tv.js scales to the TV. Positioned with
   absolute offsets rather than grid or `inset`: smart-TV browsers can be
   years old, and both arrived late in WebKit. */
/* Scoped to the TV page by the class on its own <html> (#1612). A bare
   `html` here would stop every Broomstack page from scrolling. */
html.tv-html, html.tv-html body.tv-body {
  margin: 0; height: 100%; overflow: hidden; background: #000;
}
body.tv-body { color: #eceef4; font-family: 'IBM Plex Sans', sans-serif; }
/* An old #643 screen address, retired (#1601): sized to the window, since
   there is no canvas to scale. */
.tv-moved-body {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; padding: 5vh 6vw;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-flex-direction: column; flex-direction: column;
  -webkit-justify-content: center; justify-content: center;
  -webkit-align-items: center; align-items: center;
  background: var(--slate); text-align: center;
}
.tv-moved-title { margin: 4vh 0 0; font-size: 7vw; font-weight: 700; color: #fff; }
.tv-moved-sub { margin: 3vh 0 0; max-width: 60vw; font-size: 2.6vw; color: var(--gold); }
.tv-canvas {
  position: absolute; left: 0; top: 0;
  width: 1920px; height: 1080px; overflow: hidden;
  background: var(--slate);
  -webkit-transform-origin: 0 0; transform-origin: 0 0;
}
.tv-safe { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.tv-stage { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }

/* Panes. Their positions come from the manifest (display_layouts.py), so
   nothing here knows a layout's geometry. A designed layout keeps a 24px
   gutter between panes and around the edge (12px on the stage, 12px
   inside each pane) and gives each pane a surface, so the screen reads as
   panes even before their slides load. Full screen uses the whole canvas. */
.tv-pane { position: absolute; overflow: hidden; }
.tv-stage { top: 12px; right: 12px; bottom: 12px; left: 12px; }
.tv-stage.tv-layout-full { top: 0; right: 0; bottom: 0; left: 0; }
.tv-pane:before {
  content: ''; position: absolute; top: 12px; right: 12px; bottom: 12px; left: 12px;
  background: var(--slate-surface); border-radius: var(--r-lg);
}
.tv-size-full:before { display: none; }

/* Two layers per pane, so a slide fades in over the last one. */
.tv-layer {
  position: absolute; top: 12px; right: 12px; bottom: 12px; left: 12px;
  opacity: 0; -webkit-transition: opacity 1s; transition: opacity 1s;
}
.tv-size-full .tv-layer { top: 0; right: 0; bottom: 0; left: 0; }
.tv-layer.is-shown { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .tv-layer { -webkit-transition: none; transition: none; }
}

.tv-slide {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  padding: 40px 48px; overflow: hidden;
}
/* Smaller panes get less padding. Slide templates branch on the same
   size classes for their compact variants. */
.tv-size-medium .tv-slide, .tv-size-narrow .tv-slide { padding: 28px 32px; }
.tv-size-band .tv-slide { padding: 12px 32px; }
.tv-slide-pending {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-flex-direction: column; flex-direction: column;
  -webkit-justify-content: center; justify-content: center;
  -webkit-align-items: center; align-items: center;
  text-align: center;
}
.tv-slide-pending-label { font-size: 56px; font-weight: 700; color: #fff; }
.tv-slide-pending-sub { margin-top: 16px; font-size: 28px; color: rgba(255, 255, 255, 0.6); }
.tv-size-medium .tv-slide-pending-label, .tv-size-narrow .tv-slide-pending-label { font-size: 40px; }
.tv-size-medium .tv-slide-pending-sub, .tv-size-narrow .tv-slide-pending-sub { font-size: 22px; }
.tv-size-band .tv-slide-pending-label { font-size: 34px; }
.tv-size-band .tv-slide-pending-sub { display: none; }

/* Nothing scheduled: a clock, never a blank or an error. */
.tv-idle {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-flex-direction: column; flex-direction: column;
  -webkit-justify-content: center; justify-content: center;
  -webkit-align-items: center; align-items: center;
}
.tv-idle[hidden] { display: none; }
.tv-idle-mark { background: var(--paper); border-radius: 50%; }
.tv-idle-name { margin-top: 36px; font-size: 48px; font-weight: 600; color: #fff; }
.tv-idle-clock { margin-top: 24px; font-size: 140px; font-weight: 600; color: var(--gold); }

/* Identify (#1600): the TV's name, huge, over whatever is showing. */
.tv-identify {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 10;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-flex-direction: column; flex-direction: column;
  -webkit-justify-content: center; justify-content: center;
  -webkit-align-items: center; align-items: center;
  background: rgba(11, 23, 38, 0.92); border: 16px solid var(--gold);
  text-align: center;
}
.tv-identify[hidden] { display: none; }
.tv-identify-name { padding: 0 80px; font-size: 160px; font-weight: 700; line-height: 1.1; color: #fff; }
.tv-identify-where { margin-top: 32px; font-size: 48px; color: var(--gold); }

/* ---------- display builder (#1595) ---------- */

.tvthumb {
  position: relative; display: block; flex: none;
  width: 96px; aspect-ratio: 16 / 9;
  background: var(--slate); border-radius: 4px; overflow: hidden;
}
.tvthumb-slot {
  position: absolute; box-sizing: border-box;
  border: 2px solid var(--slate); border-radius: 4px;
  background: #6b7190;
}
.tvthumb-slot.is-on { background: var(--gold); }

.tvlayouts { border: 0; padding: 0; margin: 0; }
.tvlayouts legend { font-weight: 600; margin-bottom: 6px; }
.tvlayouts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.tvlayout {
  display: flex; flex-direction: column; gap: 6px; padding: 6px;
  border: 1px solid var(--line); border-radius: var(--r); cursor: pointer;
  font-size: 12px; font-weight: 400;
}
.tvlayout input { position: absolute; opacity: 0; pointer-events: none; }
.tvlayout:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-tint); }
.tvlayout:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.tvlayout .tvthumb { width: 100%; }

.tvpreview {
  position: relative; width: 100%; max-width: 960px; aspect-ratio: 16 / 9;
  border-radius: var(--r-lg); overflow: hidden; background: #000; box-shadow: var(--sh-md);
}
.tvpreview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.tvslides { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tvslide {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--white);
}
.tvslide.is-off { opacity: 0.6; }
.tvslide.is-dragging { opacity: 0.4; }
.tvslide-grip { color: var(--faint); cursor: grab; display: flex; }
.tvslide-body { flex: 1; min-width: 0; }
.tvslide-meta { font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.tvslide-actions { display: flex; align-items: center; gap: 2px; }
.tvslide-actions form { margin: 0; display: flex; }
.tvslides-empty { font-size: 13px; padding: 6px 0; }
.tvadd { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.tvadd select { flex: 1; min-width: 0; }
.tvurl { word-break: break-all; margin: 0 6px; }
.tvchanges li { font-size: 13px; gap: 8px; }

/* ---------- TV slide content (#1596) ---------- */

/* Read from across a room: big type, high contrast, nothing small. Sizes
   step down by pane size (display_layouts.Size); a band is one line.
   Flexbox only, for old smart-TV browsers (#1593). */
.tv-content { color: #eceef4; font-size: 30px; line-height: 1.25; }
.tv-size-large .tv-content { font-size: 28px; }
.tv-size-medium .tv-content, .tv-size-narrow .tv-content { font-size: 24px; }
.tv-title { margin: 0 0 24px; font-size: 1.6em; font-weight: 700; color: #fff; line-height: 1.15; }
.tv-sub { font-size: 0.6em; font-weight: 500; color: var(--gold); margin-left: 10px; }
.tv-muted { color: rgba(255, 255, 255, 0.55); }
.tv-empty { color: rgba(255, 255, 255, 0.6); font-size: 1em; margin: 0; }
.tv-more { color: rgba(255, 255, 255, 0.6); font-size: 0.8em; margin: 14px 0 0; }
.tv-lede { margin: 0 0 18px; color: var(--gold); }

.tv-table { width: 100%; border-collapse: collapse; }
.tv-table th {
  text-align: left; font-size: 0.55em; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: rgba(255, 255, 255, 0.55);
  padding: 0 12px 8px; border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}
.tv-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); vertical-align: middle; }
.tv-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.tv-table tr.is-live td { background: rgba(201, 165, 74, 0.12); }
.tv-table tr.is-over td { opacity: 0.55; }
.tv-when { white-space: nowrap; color: rgba(255, 255, 255, 0.75); font-variant-numeric: tabular-nums; width: 1%; }
.tv-sheet { width: 1%; }
.tv-who { font-weight: 600; color: #fff; }
.tv-what { font-weight: 400; font-size: 0.65em; color: rgba(255, 255, 255, 0.55); margin-top: 2px; }
.tv-score { text-align: right; white-space: nowrap; font-weight: 700; color: var(--gold); width: 1%; }
.tv-rank { width: 1%; color: rgba(255, 255, 255, 0.45); }
.tv-chip {
  display: inline-block; min-width: 1.6em; padding: 2px 8px; border-radius: 6px;
  background: var(--gold); color: var(--slate); font-weight: 700; text-align: center;
}
.tv-chip-lg { font-size: 1.3em; padding: 6px 16px; }
.tv-live {
  display: inline-block; padding: 2px 10px; border-radius: 999px; margin-left: 8px;
  background: #c0392b; color: #fff; font-size: 0.6em; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; vertical-align: middle;
}

/* A band is one line, read at a glance. */
.tv-band {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  height: 100%; overflow: hidden; white-space: nowrap; font-size: 26px;
}
.tv-band-title { font-weight: 700; color: var(--gold); margin-right: 28px; }
.tv-band-item { margin-right: 36px; color: #fff; }
.tv-band-item b { color: var(--gold); margin-left: 6px; }

/* One sheet's game. */
.tv-sheetgame-head {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center; margin-bottom: 28px;
}
.tv-sheetgame-head > * { margin-right: 18px; }
.tv-teams { display: -webkit-box; display: -webkit-flex; display: flex; }
.tv-team { -webkit-flex: 1; flex: 1; min-width: 0; margin-right: 32px; }
.tv-team:last-child { margin-right: 0; }
.tv-team-name {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-justify-content: space-between; justify-content: space-between;
  font-size: 1.5em; font-weight: 700; color: #fff;
  border-bottom: 3px solid var(--gold); padding-bottom: 8px; margin-bottom: 12px;
}
.tv-team-score { color: var(--gold); margin-left: 16px; }
.tv-players { list-style: none; margin: 0; padding: 0; }
.tv-players li { padding: 4px 0; }
.tv-size-narrow .tv-teams { -webkit-flex-direction: column; flex-direction: column; }
.tv-size-narrow .tv-team { margin: 0 0 20px; }
.tv-linescore { margin-top: 28px; border-collapse: collapse; font-size: 0.85em; }
.tv-linescore th, .tv-linescore td {
  padding: 6px 12px; text-align: center; border: 1px solid rgba(255, 255, 255, 0.15);
}
.tv-linescore td:first-child { text-align: left; font-weight: 600; color: #fff; }
.tv-linescore th { color: rgba(255, 255, 255, 0.55); font-weight: 600; }

.tv-pools { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.tv-pool { -webkit-flex: 1 1 40%; flex: 1 1 40%; min-width: 0; margin: 0 32px 24px 0; }
.tv-pool-name { margin: 0 0 8px; font-size: 0.8em; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; }
.tv-bracket { overflow: hidden; }
.tv-champion { font-size: 1.4em; margin: 0 0 16px; color: #fff; }
.tv-champion b { color: var(--gold); }

/* ---------- TV announcements, QR codes, images (#1597) ---------- */

.tv-announce { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; }
.tv-announce-text { -webkit-flex: 1; flex: 1; min-width: 0; }
.tv-announce-heading { margin: 0 0 20px; font-size: 1.8em; line-height: 1.1; font-weight: 700; color: #fff; }
.tv-announce-body { color: #eceef4; }
.tv-announce-body p { margin: 0 0 14px; }
.tv-announce-body ul { margin: 0 0 14px; padding-left: 1.2em; }
.tv-announce-body strong { color: var(--gold); }
.tv-text-large { font-size: 40px; }
.tv-text-huge { font-size: 56px; }
.tv-size-medium .tv-text-large, .tv-size-narrow .tv-text-large { font-size: 30px; }
.tv-size-medium .tv-text-huge, .tv-size-narrow .tv-text-huge { font-size: 36px; }
.tv-announce-image { -webkit-flex: 0 0 42%; flex: 0 0 42%; margin-left: 40px; height: 100%; }
.tv-announce-image img { width: 100%; height: 100%; object-fit: contain; }
.tv-size-narrow .tv-announce { display: block; }
/* A quarter pane stacks the picture under the text, and the picture takes
   only the height the text leaves, so the two never overflow the pane. */
.tv-size-medium .tv-announce {
  -webkit-flex-direction: column; flex-direction: column;
  -webkit-align-items: stretch; align-items: stretch;
}
.tv-size-medium .tv-announce-text { -webkit-flex: 0 0 auto; flex: 0 0 auto; }
.tv-size-medium .tv-announce-image {
  -webkit-flex: 1 1 0; flex: 1 1 0; min-height: 0; height: auto; margin: 16px 0 0;
}

.tv-qr { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; }
.tv-qr-code { -webkit-flex: 0 0 auto; flex: 0 0 auto; height: 100%; max-height: 640px; margin-right: 48px; }
.tv-qr-code svg { height: 100%; width: auto; background: #fff; border-radius: 12px; display: block; }
.tv-qr-text { -webkit-flex: 1; flex: 1; min-width: 0; }
.tv-qr-url { margin: 0; font-size: 0.8em; color: rgba(255, 255, 255, 0.7); overflow-wrap: anywhere; }
/* In a small pane the code stacks above its caption and takes whatever
   height the caption leaves, so the two never spill out of the pane. */
.tv-size-narrow .tv-qr, .tv-size-medium .tv-qr {
  -webkit-flex-direction: column; flex-direction: column; text-align: center;
}
.tv-size-narrow .tv-qr-code, .tv-size-medium .tv-qr-code {
  -webkit-flex: 1 1 0; flex: 1 1 0; min-height: 0; width: 100%; height: auto; margin: 0 0 16px;
}
.tv-size-narrow .tv-qr-code svg, .tv-size-medium .tv-qr-code svg { width: 100%; height: 100%; }
.tv-size-narrow .tv-qr-text, .tv-size-medium .tv-qr-text { -webkit-flex: 0 0 auto; flex: 0 0 auto; }

.tv-image { padding: 0; background: #000; border-radius: var(--r-lg); overflow: hidden; }
.tv-size-full .tv-image { border-radius: 0; }
.tv-image-item {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: contain; opacity: 0; -webkit-transition: opacity 1s; transition: opacity 1s;
}
.tv-image-fill .tv-image-item { object-fit: cover; }
.tv-image-item.is-shown { opacity: 1; }
.tv-image-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 32px;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 28px; font-weight: 600;
}
@media (prefers-reduced-motion: reduce) { .tv-image-item { -webkit-transition: none; transition: none; } }

/* ---------- TV image library (#1597) ---------- */
.tvimages { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 16px; margin-top: 24px; }
/* Not overflow: hidden, which clipped the delete icon's tooltip: the
   picture rounds its own top corners instead. */
.tvimage img {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--slate);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.tvimage-uses { margin: 6px 0 0; padding-left: 1.1em; font-size: 12.5px; }
/* Name and details on the left, the delete icon top right. */
.tvimage-body { display: flex; align-items: flex-start; gap: 8px; }
.tvimage-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tvimage-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 12px; }

/* ---------- TV schedules (#1598) ---------- */
.tvshowing { margin-bottom: 8px; }
.tvrules li { gap: 10px; }
.tvrules li.is-off { opacity: 0.6; }
.tvrules form { margin: 0; }
/* The seven day checkboxes in one row rather than seven stacked boxes. */
#add-rule #id_days, .tvrule-form #id_days { display: flex; flex-wrap: wrap; gap: 8px; }
#add-rule #id_days > div, .tvrule-form #id_days > div { flex: 0 0 auto; }
.tvtimeline { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 12px; }
.tvtimeline-day { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 12px; }
.tvtimeline-date { font-weight: 600; margin-bottom: 6px; }
.tvtimeline ul { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.tvtimeline li { padding: 3px 0; border-top: 1px solid var(--line); }
.tvtimeline li:first-child { border-top: 0; }
.tvtimeline li .mono { color: var(--muted); margin-right: 6px; }
.tvtimeline li.is-ruled { color: var(--blue-dk); font-weight: 600; }

/* ---------- TV displays page: section heads and add modals (#1614) ---------- */
/* A .btn's own display would otherwise beat the hidden attribute, leaving a
   button that does nothing when the script that wires it up has not run. */
.btn[hidden] { display: none; }
.tvadd-dialog .field[hidden] { display: none; }
.tvsection-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tvsection-head .section-title { margin-bottom: 12px; }
.tvadd-dialog { width: min(36rem, calc(100vw - 32px)); }
.tvadd-dialog h2 { margin: 0 0 14px; }
.tvadd-dialog .stacked { max-width: none; }
.tvadd-inline { display: block; position: static; margin: 24px 0 0; max-height: none; }

/* ---------- TV displays page: TVs and programs as lists (#1614) ---------- */
.tvlist {
  list-style: none; margin: 0 0 8px; padding: 0;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.tvlist > li {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.tvlist > li:first-child { border-top: 0; }
.tvlist-icon { color: var(--muted); flex: none; }
.tvlist .tvthumb { width: 56px; }
.tvlist-main { flex: 1; min-width: 0; }
.tvlist-name { font-weight: 600; }
.tvlist-main .tag { margin-left: 6px; }
.tvlist-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.tvlist-actions { display: flex; gap: 4px; flex: none; }
.tvlist-empty { color: var(--muted); font-size: 13.5px; justify-content: space-between; flex-wrap: wrap; }
/* Edit and open are not destructive: a quiet hover, not the red one
   .icon-btn uses for Remove. */
.icon-btn.icon-btn-quiet:hover, .icon-btn.icon-btn-quiet:focus-visible { color: var(--blue-dk); }

/* ---------- program editor header and pane modals (#1616) ---------- */
.tvprogram-head { align-items: flex-start; gap: 16px; }
.tvprogram-title { flex: 1; min-width: 0; }
.tvname-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.tvname-show { display: flex; align-items: center; gap: 6px; margin: 0; }
.tvname-show [data-name-text] { cursor: text; }
.tvname-show[hidden], .tvname-input[hidden] { display: none; }
.tvname-input { font-size: 22px; font-weight: 700; padding: 4px 8px; max-width: 32rem; width: 100%; }
.tvlayout-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.tvlayout-form label { font-size: 13px; font-weight: 600; color: var(--muted); }
.tvlayout-form .tvselect { flex: 0 0 auto; min-width: 13rem; }
.tvlayout-form .tvthumb { width: 44px; }
.tvpane-dialog { width: min(40rem, calc(100vw - 32px)); }
.tvpane-dialog h2 { margin: 0 0 4px; }
.tvpane-dialog .help { margin: 0 0 14px; }
.tvadd { display: block; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.tvadd-label { display: block; font-weight: 600; margin-bottom: 6px; }
.tvadd-row { display: flex; gap: 8px; align-items: stretch; }
/* The builder's selects (#1616): the kind picker and the layout. A
   full-width select with its own chevron, groups set off, so it reads as a
   list of categories rather than the browser's bare default. */
.tvadd-select, .tvselect { flex: 1; min-width: 0; position: relative; }
.tvadd-select select, .tvselect select {
  width: 100%; appearance: none; -webkit-appearance: none;
  padding: 9px 36px 9px 12px; font-size: 14px; font-weight: 500;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--white); color: var(--ink);
  cursor: pointer;
}
.tvadd-select::after, .tvselect::after {
  content: ''; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.tvadd-select select:focus-visible, .tvselect select:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.tvadd-select optgroup { font-weight: 700; color: var(--muted); }
.tvadd-select option { font-weight: 400; color: var(--ink); }
.tvslide-actions .icon-btn { width: 28px; height: 28px; }
#layout-warning { width: min(30rem, calc(100vw - 32px)); }
#layout-warning h2 { margin: 0 0 10px; }
#layout-warning p { margin: 0 0 10px; }
#layout-warning .btnrow { margin-top: 16px; }

/* ---------- pane pencils on the preview (#1616) ---------- */
/* Each sits at its pane's top-left on the preview, gold on the dark TV, so
   the obvious thing to do with a pane is click it. */
.tvpreview-wrap { max-width: 960px; margin: 0 auto; }
.tvpane-edits { position: absolute; inset: 0; pointer-events: none; }
.tvpane-edit {
  position: absolute; pointer-events: auto;
  margin: 14px 14px 0 0;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 10px; border-radius: 999px;
  background: var(--gold); color: var(--slate); text-decoration: none;
  font-weight: 700; font-size: 14px; line-height: 1.1;
  border: 2px solid #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(201, 165, 74, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tvpane-edit svg { width: 16px; height: 16px; flex: none; }
.tvpane-edit small { display: block; font-weight: 500; font-size: 11px; opacity: 0.8; }
.tvpane-edit:hover, .tvpane-edit:focus-visible {
  transform: scale(1.06); color: var(--slate);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5), 0 0 0 6px rgba(201, 165, 74, 0.5);
  outline: none;
}
@media (prefers-reduced-motion: reduce) { .tvpane-edit { transition: none; } }
.tvpreview-help { margin: 8px 0 0; text-align: center; }
/* Without JavaScript a pane's editor is rendered open in place, below. */
.tvpane-dialogs dialog[open]:not(:modal) { position: static; margin: 16px 0 0; max-height: none; }

/* ---------- program editor header actions (#1616) ---------- */
.tvprogram-actions { display: flex; align-items: center; gap: 4px; }
.tvprogram-actions form { margin: 0; }
/* A program shown by hand, above the schedule it overrides (#1600). */
.tvoverride { margin-bottom: 16px; }
.btn-danger, button[type='submit'].btn-danger {
  background: var(--red); border-color: var(--red); color: #fff;
}
.btn-danger:hover, button[type='submit'].btn-danger:hover { background: #a93226; border-color: #a93226; color: #fff; }
/* Delete is red even at rest, and fills red on hover. */
.icon-btn.icon-btn-danger { color: var(--red); }
.icon-btn.icon-btn-danger:hover, .icon-btn.icon-btn-danger:focus-visible {
  background: var(--red-tint); border-color: var(--red); color: var(--red);
}
.icon-btn[aria-disabled='true'] { color: var(--faint); cursor: not-allowed; }
.icon-btn[aria-disabled='true']:hover, .icon-btn[aria-disabled='true']:focus-visible {
  background: transparent; border-color: var(--line-2); color: var(--faint);
}
/* A tooltip that shows on hover and on keyboard focus: a disabled control
   needs to say why, and a title attribute on it never appears. */
.tvtip-wrap { position: relative; display: inline-flex; }
.tvtip {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 20;
  width: 17rem; padding: 8px 10px; border-radius: var(--r);
  background: var(--slate); color: #fff; font-size: 12.5px; line-height: 1.35;
  box-shadow: var(--sh-md); visibility: hidden; opacity: 0; transition: opacity 0.12s;
}
.tvtip-wrap:hover .tvtip, .tvtip-wrap:focus-within .tvtip { visibility: visible; opacity: 1; }
.tvconfirm { width: min(28rem, calc(100vw - 32px)); }
/* A confirmation rendered open by the server (?delete=...) is a plain open
   dialog until the page's script turns it into a modal, and a plain one
   gets no ::backdrop. If the script never runs (no JavaScript, or a stale
   cached copy), it would sit unshaded on the page. This gives it the same
   centering and overlay as .modal::backdrop, so it looks the same either way. */
dialog.tvconfirm[open]:not(:modal) {
  position: fixed; inset: 0; margin: auto; height: fit-content; z-index: 100;
  box-shadow: 0 0 0 100vmax rgba(45, 48, 66, 0.45), var(--sh-md);
}
.tvconfirm h2 { margin: 0 0 8px; }
.tvconfirm p { margin: 0 0 14px; }
.tvconfirm .btnrow form { margin: 0; }
/* Back to the TV displays page, above the program's name (#1616). */
.tvback {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px;
  font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none;
}
.tvback svg { width: 16px; height: 16px; transform: scaleX(-1); }
.tvback:hover, .tvback:focus-visible { color: var(--ink); }
/* A slide's form, in the pane's modal or on its own page (#1616). */
.tvslide-form-head { margin-bottom: 14px; }
.tvslide-form-head h2 { margin: 2px 0 0; }
.tvslide-page .modal-body { padding: 0; max-height: none; overflow: visible; }
.tvslide-page .tvslide-form-head h2 { font-size: 24px; }
/* A slide always shows; "Only show from…" reveals its date range (#1616). */
.tvcheck { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.tvdates { display: none; grid-template-columns: 1fr 1fr; gap: 0 14px; }
form:has(input[name='limit_dates']:checked) .tvdates { display: grid; }
@supports not selector(:has(*)) { .tvdates { display: grid; } }
@media (max-width: 520px) { .tvdates { grid-template-columns: 1fr; } }
/* Recent changes: the latest few, then "View more…" in a modal (#1616). */
.tvchanges-more { margin-top: 10px; }
.tvchanges-dialog { width: min(44rem, calc(100vw - 32px)); }
.tvchanges-dialog h2, .tvchanges-page h2 { margin: 0 0 12px; padding-right: 36px; }
.tvpager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.tvchanges-page .modal-body { padding: 0; max-height: none; overflow: visible; }

/* ---------- the TV page's header (#1616) ---------- */
.tvurl-row { display: flex; align-items: center; gap: 4px; margin: 0 0 20px; }
.tvurl-row .tvurl { flex: 1; min-width: 0; margin: 0 4px 0 0; font-size: 13px; padding: 4px 8px; border-radius: var(--r); background: var(--white); border: 1px solid var(--line); overflow-wrap: anywhere; }
.tvurl-edit { position: relative; }
.tvurl-edit > summary { list-style: none; }
.tvurl-edit > summary::-webkit-details-marker { display: none; }
.tvurl-edit[open] > summary { background: var(--paper); }
.tvurl-form {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 20;
  width: min(34rem, calc(100vw - 32px)); margin: 0; padding: 14px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
}
.tvurl-form label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.tvurl-form-row { display: flex; align-items: center; gap: 8px; }
.tvurl-form-row .input { flex: 1; min-width: 0; }
.tvdisplay-controls { align-items: center; gap: 14px; flex-wrap: wrap; }
.tvswitch-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.tvswitch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.icon-btn[hidden] { display: none; }
.tvurl-form .help { font-size: 12px; color: var(--muted); margin-top: 6px; }
/* Notes and edge inset, under the TV page's header, saved as they change (#1616). */
.tvdisplay-settings { display: grid; grid-template-columns: minmax(0, 1fr) 14rem; gap: 16px; margin: 4px 0 24px; }
.tvsetting { margin: 0; }
.tvsetting label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.tvsetting .textarea { width: 100%; min-height: 0; resize: vertical; }
.tvsetting-inset-row { display: flex; align-items: center; gap: 6px; }
.tvsetting-inset-row .input { width: 5.5rem; }
.tvsetting .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tvsetting .btn { margin-top: 6px; }
@media (max-width: 640px) { .tvdisplay-settings { grid-template-columns: 1fr; } }
/* The TV page, centered like the program editor's preview (#1616). */
.tvdisplay-page { max-width: 960px; margin: 0 auto; }
.tvsection-title { display: flex; align-items: center; gap: 8px; margin: 28px 0 12px; }
.tvsection-title .section-title { margin: 0; }
/* "?" beside a heading: the explanation shows on click (#1616). */
.tvhelp { position: relative; }
.tvhelp-q {
  list-style: none; cursor: pointer; display: inline-grid; place-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line-2); color: var(--muted);
  font-weight: 700; font-size: 13px; line-height: 1;
}
.tvhelp-q::-webkit-details-marker { display: none; }
.tvhelp-q:hover, .tvhelp[open] .tvhelp-q, .tvhelp-q:focus-visible { border-color: var(--slate); color: var(--slate); }
.tvhelp .tvhelp-tip { left: 0; right: auto; width: min(22rem, calc(100vw - 48px)); visibility: visible; opacity: 1; font-size: 13px; }
.tvrules .icon-btn { flex: none; }
/* Notes and edge inset line up: the same label row, the same field height. */
.tvsetting-label { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; height: 20px; }
.tvsetting-label label { margin: 0; }
.tvsetting-label .tvhelp-q { width: 18px; height: 18px; font-size: 11px; }
.tvsetting .textarea, .tvsetting-inset-row .input { height: 58px; box-sizing: border-box; }
.tvsetting .textarea { min-height: 58px; }
.tvhelp-end .tvhelp-tip { left: auto; right: -8px; }
/* A disabled link can't be followed; its wrapper still shows the tooltip. */
a.icon-btn[aria-disabled='true'] { pointer-events: none; }
.tvtip[hidden] { display: none; }
