/* Drilldown — dense, keyboard-first UI for breaking down film. */

:root {
  --accent: #c8102e;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);

  /*
   * Soft grays rather than white on white: a light gray page, cards a few
   * shades off white on it, a gray band for table heads, and the lightest
   * step kept for what you press or type into (--raised). No pure white
   * anywhere, and each layer a step of its own.
   */
  --bg: #e8eaed;
  --surface: #fefefe;
  --surface-2: #e4e7eb;
  /* Table heads: darker than the page and the card, so the band reads as one. */
  --head-bg: #d5dae0;
  /* Calendar days outside the month: just off the days inside it. */
  --outside-bg: #f1f2f4;
  --raised: #ffffff;
  --line: #d3d7dc;
  --line-strong: #bcc2ca;

  --ink: #181c22;
  --ink-2: #4a5361;
  /* Darker than it was on white, so quiet text still reads on the grays. */
  --ink-3: #66707d;

  /*
   * The sidebar is a slate rather than a near-black: dark enough to sit clearly
   * behind the page (10.2x against the body), light enough not to read as a
   * black bar down the screen.
   *
   * It cannot go much lighter than this. The active nav item is the crimson
   * accent, and by #424d5e the pill only separates from the ground by 1.45x --
   * it stops looking like a selected item and starts looking like a smudge.
   * 1.89x here is the margin that buys.
   *
   * `raise` and `edge` are steps *up* from the ground, for anything that should
   * sit on top of it. They have to be lighter than --sidebar-bg; the values
   * they replaced were lighter than the old near-black and would have sunk.
   */
  --sidebar-bg: #333c4a;
  --sidebar-raise: #3e4959;
  --sidebar-edge: #4b5768;
  --sidebar-ink: #c9d1d9;
  --sidebar-ink-dim: #9aa5b4;

  --offense: #1f6feb;
  --defense: #d1631a;
  --special: #6f42c1;
  /* A play a coach marked as worth watching again: the star, and its tab. */
  --highlight: #b8860b;
  --good: #1a7f37;
  /* The statistics graphs: us, and them. See components/charts.js. */
  --chart-us: #3b6ea5;
  --chart-us-light: #a7bed6;
  --chart-them: #9aa5b1;
  --chart-them-dark: #76828f;
  --bad: #b42318;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 16px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.18);

  /* Tokens the two themes set differently; see the dark block below. */
  --accent-text: #c8102e;
  --on-ink: #ffffff;
  --warn: #d79a3a;
  --warn-ink: #8a5a00;
  --warn-bg: #fdf3e0;
  --penalty-bg: #fdf0b3;
  --penalty-ink: #7a5a00;
  --penalty-line: #e0b100;
  --home-ink: #0b6b74;
  color-scheme: light;

  /*
   * The Schedule's week cards (views/calendar.js): drilldownsports.com's
   * "This week", and the iPhone app's cards (components/dark-card.js there).
   * On the light theme they are the site's own white cards, a game's row
   * tinted with the brand red; the dark blocks below set the site's dark card.
   */
  --week-card: var(--surface);
  --week-border: var(--line);
  --week-hover: var(--surface-2);
  --week-fixture: color-mix(in srgb, var(--accent) 6%, var(--surface));
  --week-fixture-hover: color-mix(in srgb, var(--accent) 10%, var(--surface));
  --week-ink: var(--ink);
  --week-muted: var(--ink-2);
  --week-line: var(--line);
  --week-today: var(--accent-text);
  --week-won: var(--good);
  --week-lost: var(--bad);
  --week-pill: rgba(24, 28, 34, 0.07);
  --week-going-bg: rgba(26, 127, 55, 0.12);
  --week-going: #1a7f37;
  --week-maybe-bg: rgba(215, 154, 58, 0.18);
  --week-maybe: #8a5a00;
  --week-no-bg: rgba(180, 35, 24, 0.1);
  --week-no: #b42318;

  /* The brand's condensed display type, the wordmark's and the site's. */
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/*
 * The dark theme: the same tokens, set for a dark ground. It follows the
 * browser's setting; data-theme="light" or "dark" on <html> overrides it either
 * way, for an in-app choice. Components style through the tokens, so nothing
 * below this needs a dark rule of its own.
 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --accent-soft: color-mix(in srgb, var(--accent) 24%, transparent);
  /* Type in the brand red: lifted so it reads on a dark ground. Fills, buttons,
     the active nav and the wordmark keep #c8102e itself. */
  --accent-text: #ff6b7e;
  --on-ink: #0f1318;
  --fixture-ink: #e8ecf1;

  /* The Schedule's week cards on a dark ground: drilldownsports.com's own. */
  --week-card: #222a37;
  --week-border: transparent;
  --week-hover: #2b3443;
  --week-fixture: #392636;
  --week-fixture-hover: #45293d;
  --week-ink: #eef1f5;
  --week-muted: rgba(238, 241, 245, 0.62);
  --week-line: rgba(238, 241, 245, 0.12);
  --week-today: #ff8a9b;
  --week-won: #7ddf9e;
  --week-lost: #f6a197;
  --week-pill: rgba(238, 241, 245, 0.1);
  --week-going-bg: rgba(76, 193, 119, 0.18);
  --week-going: #7ddf9e;
  --week-maybe-bg: rgba(233, 184, 98, 0.18);
  --week-maybe: #f0c97e;
  --week-no-bg: rgba(242, 133, 122, 0.18);
  --week-no: #f6a197;

  --bg: #0f1318;
  --surface: #171c23;
  --surface-2: #1d232c;
  --line: #2a313c;
  --line-strong: #3b4450;
  --raised: #171c23;
  --head-bg: #232a34;
  --outside-bg: #12161b;

  --ink: #e8ecf1;
  --ink-2: #aeb7c3;
  --ink-3: #7f8a98;

  /* Darker than the page, as the slate is lighter than it in the light theme:
     the sidebar still reads as its own column. */
  --sidebar-bg: #0b0e12;
  --sidebar-raise: #1a2029;
  --sidebar-edge: #262d38;
  --sidebar-ink: #c9d1d9;
  --sidebar-ink-dim: #8d98a6;

  --offense: #5b9bff;
  --defense: #f0904f;
  --special: #ab85f5;
  --highlight: #e0b23a;
  --good: #4cc177;
  --chart-us: #6d9fdc;
  --chart-us-light: #34557a;
  --chart-them: #6b7684;
  --chart-them-dark: #97a2b0;
  --bad: #f2685d;

  --warn: #d79a3a;
  --warn-ink: #e9b862;
  --warn-bg: #2c2414;
  --penalty-bg: #3a3214;
  --penalty-ink: #f0cd5c;
  --penalty-line: #8a7410;
  --home-ink: #55c6ce;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent-soft: color-mix(in srgb, var(--accent) 24%, transparent);
  /* Type in the brand red: lifted so it reads on a dark ground. Fills, buttons,
     the active nav and the wordmark keep #c8102e itself. */
  --accent-text: #ff6b7e;
  --on-ink: #0f1318;
  --fixture-ink: #e8ecf1;

  /* The Schedule's week cards on a dark ground: drilldownsports.com's own. */
  --week-card: #222a37;
  --week-border: transparent;
  --week-hover: #2b3443;
  --week-fixture: #392636;
  --week-fixture-hover: #45293d;
  --week-ink: #eef1f5;
  --week-muted: rgba(238, 241, 245, 0.62);
  --week-line: rgba(238, 241, 245, 0.12);
  --week-today: #ff8a9b;
  --week-won: #7ddf9e;
  --week-lost: #f6a197;
  --week-pill: rgba(238, 241, 245, 0.1);
  --week-going-bg: rgba(76, 193, 119, 0.18);
  --week-going: #7ddf9e;
  --week-maybe-bg: rgba(233, 184, 98, 0.18);
  --week-maybe: #f0c97e;
  --week-no-bg: rgba(242, 133, 122, 0.18);
  --week-no: #f6a197;

  --bg: #0f1318;
  --surface: #171c23;
  --surface-2: #1d232c;
  --line: #2a313c;
  --line-strong: #3b4450;
  --raised: #171c23;
  --head-bg: #232a34;
  --outside-bg: #12161b;

  --ink: #e8ecf1;
  --ink-2: #aeb7c3;
  --ink-3: #7f8a98;

  /* Darker than the page, as the slate is lighter than it in the light theme:
     the sidebar still reads as its own column. */
  --sidebar-bg: #0b0e12;
  --sidebar-raise: #1a2029;
  --sidebar-edge: #262d38;
  --sidebar-ink: #c9d1d9;
  --sidebar-ink-dim: #8d98a6;

  --offense: #5b9bff;
  --defense: #f0904f;
  --special: #ab85f5;
  --highlight: #e0b23a;
  --good: #4cc177;
  --chart-us: #6d9fdc;
  --chart-us-light: #34557a;
  --chart-them: #6b7684;
  --chart-them-dark: #97a2b0;
  --bad: #f2685d;

  --warn: #d79a3a;
  --warn-ink: #e9b862;
  --warn-bg: #2c2414;
  --penalty-bg: #3a3214;
  --penalty-ink: #f0cd5c;
  --penalty-line: #8a7410;
  --home-ink: #55c6ce;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
/* A hidden element is hidden, whatever display its own class asks for. */
[hidden] { display: none !important; }
/* The page's scrollbar space is always kept, so switching between a long page
   and a short one (the two Statistics tabs, say) does not slide everything
   aligned to the right sideways by the width of a scrollbar. */
html { scrollbar-gutter: stable; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/*
 * The demo's strip across the top (app.js, showDemoBar) takes this much of the
 * window; everything sized to the window gives it back. Nothing outside a demo.
 */
:root { --demo-bar-h: 0px; }

.app { display: grid; grid-template-columns: 248px 1fr; min-height: calc(100vh - var(--demo-bar-h)); }

/* ---------- Sidebar ---------- */

.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--demo-bar-h);
  height: calc(100vh - var(--demo-bar-h));
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 18px 14px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: #fff;
}
.team-switch { padding: 4px 12px 6px; }
.team-switch label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-ink-dim);
  margin: 0 6px 6px;
}
.team-switch select {
  width: 100%;
  padding: 8px 10px;
  background: var(--sidebar-raise);
  color: #fff;
  border: 1px solid var(--sidebar-edge);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
}

.nav { padding: 2px 12px 6px; display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-ink-dim);
  padding: 14px 12px 6px;
}
.nav a {
  display: flex;
  align-items: center;
  /* Indented past the section heading above them, so the grouping is visible
     without a rule or a box: TEAM holds the left margin and the pages under it
     step in. The highlight on the active item still runs the full width -- it
     is the row that is selected, not the word. */
  padding: 8px 12px 8px 24px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-ink);
  text-decoration: none;
  font-size: 13.5px;
}
.nav a:hover { background: var(--sidebar-raise); color: #fff; }

/*
 * The Admin menu's groups, each a heading that opens and closes it, with
 * Expand all and Collapse all above them. The heading reads as .nav-label
 * does, with a chevron that turns down while the group is open.
 */
.nav-group {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  margin-top: 6px; padding: 8px 12px 6px; border: 0; border-radius: var(--radius-sm); background: none;
  font: inherit; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--sidebar-ink-dim); cursor: pointer; text-align: left;
}
.nav-group:hover { color: #fff; background: var(--sidebar-raise); }
.nav-chev { font-size: 14px; line-height: 1; transition: transform .15s; }
.nav-group[aria-expanded="true"] .nav-chev { transform: rotate(90deg); }
.nav-items { display: flex; flex-direction: column; gap: 2px; }
.nav-all { display: flex; gap: 6px; padding: 10px 24px 0; }
.nav-all button {
  flex: 1; padding: 5px 8px; border: 1px solid var(--sidebar-edge); border-radius: var(--radius-sm);
  background: none; color: var(--sidebar-ink-dim); font: inherit; font-size: 11.5px; cursor: pointer;
}
.nav-all button:hover { color: #fff; background: var(--sidebar-raise); }
@media (prefers-reduced-motion: reduce) { .nav-chev { transition: none; } }
.nav a.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav a .count {
  margin-left: auto;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
}

.sidebar-foot {
  margin-top: auto;
  padding: 14px 18px;
  font-size: 11px;
  color: var(--sidebar-ink-dim);
  border-top: 1px solid var(--sidebar-edge);
}

/*
 * The menu folded to a strip at the left edge (components/menu-collapse.js):
 * « at the top of the open menu, and the logo with » on the strip. Only
 * where the menu sits beside the page; a phone keeps the bar across the top.
 */
.menu-collapse, .menu-expand {
  flex: 0 0 auto; width: 30px; height: 30px; padding: 0; border: 1px solid var(--sidebar-edge);
  border-radius: var(--radius-sm); background: none; color: var(--sidebar-ink-dim);
  font: inherit; font-size: 16px; line-height: 1; cursor: pointer;
}
.menu-collapse { margin-left: auto; }
.menu-collapse:hover, .menu-expand:hover { color: #fff; background: var(--sidebar-raise); }
.menu-rail { display: none; }
@media (min-width: 861px) {
  html[data-menu="collapsed"] .app { grid-template-columns: 56px minmax(0, 1fr); }
  html[data-menu="collapsed"] .app.is-signed-out { grid-template-columns: minmax(0, 1fr); }
  html[data-menu="collapsed"] .sidebar > :not(.menu-rail) { display: none !important; }
  html[data-menu="collapsed"] .sidebar > .menu-rail {
    display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px 0;
  }
}
@media (max-width: 860px) {
  .menu-collapse, .menu-rail { display: none !important; }
}

/* ---------- Main ---------- */

.main { min-width: 0; display: flex; flex-direction: column; }

.page { padding: 24px 28px 64px; max-width: 1500px; width: 100%; }

/*
 * The cap above keeps a page of prose from running to a line nobody can track
 * back from. A page that is mostly a wide table has the opposite problem: the
 * breakdown carries fourteen columns and still scrolls sideways, so every
 * pixel the cap leaves grey on the right is a column the coach has to go and
 * find. Those pages opt out by name rather than the cap being lifted for all
 * of them.
 */
.page.is-wide { max-width: none; }

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-head .sub { color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.crumb {
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.crumb a { color: var(--ink-2); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

/* ---------- Buttons & controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--raised);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.08); background: var(--accent); border-color: var(--accent); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }
.btn-sm { padding: 5px 9px; font-size: 12px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(0, 0, 0, 0.05); border-color: transparent; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/*
 * Every input that holds typing, said as an exclusion rather than as a list.
 *
 * It was a list -- text, number, date, url, search -- and the list was wrong
 * twice, in the same way both times. An <input> with no type attribute is not
 * matched by input[type="text"], so several boxes carrying .input looked roughly
 * right and were in fact wearing the browser default; and a time field added
 * later was not on the list at all, so it turned up 12px shorter than the date
 * beside it, in monospace, with a 2px inset border.
 *
 * A list has to be remembered every time somebody adds a field. Naming the four
 * inputs that are not boxes of text does not.
 */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
select, textarea, .input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--raised);
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}

/*
 * A date and a time side by side are the same box.
 *
 * Their native pickers are different sizes, so left alone they sit at different
 * heights with their labels level -- which reads as one of them being broken.
 * Fixing the content box makes the two agree whatever each browser puts inside.
 */
input[type="date"], input[type="time"], input[type="datetime-local"] {
  height: 35px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 64px; }

/* Derived fields: readable, obviously not yours to type in. */
input[readonly], select:disabled {
  background: var(--surface-2);
  color: var(--ink-2);
  cursor: default;
}
input[readonly]:focus { border-color: var(--line-strong); box-shadow: none; }
label.field { display: block; margin-bottom: 12px; }
label.field > span, div.field.wb-style > span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  margin-bottom: 5px;
}
.field-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.hint { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

/*
 * Searching for a place.
 *
 * The results sit under the box rather than floating over it: the form is
 * inside a dialog that scrolls, and a floating list in a scrolling dialog ends
 * up beside the thing it belongs to. Pushing the fields down is honest about
 * the room it takes.
 */
.place-input { display: flex; gap: 8px; }
.place-input input { flex: 1 1 auto; min-width: 0; }
.place-input .btn { flex: 0 0 auto; }

.place-list {
  margin-top: 6px; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; max-height: 220px; overflow-y: auto;
}
.place-row {
  display: block; width: 100%; text-align: left; background: none;
  border: 0; border-bottom: 1px solid var(--line); padding: 7px 10px;
  font: inherit; color: inherit; cursor: pointer;
}
.place-row:last-child { border-bottom: 0; }
.place-row:hover { background: var(--surface-2); }
.place-row.is-note { color: var(--ink-3); font-size: 12px; cursor: default; }
.place-row.is-note:hover { background: none; }
.place-name { display: block; font-size: 13px; font-weight: 500; }
/* The address kept exactly as typed, first among the results (components/place-picker.js). */
.place-row.is-typed .place-name { color: var(--accent-text); font-weight: 600; }
.place-addr { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
/* In a table cell an address is a hint, not the column: one line, then stop. */
td .place-addr {
  max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* An address that goes somewhere looks like it does. */
a.place-addr { color: var(--accent-text); text-decoration: none; }
a.place-addr:hover { text-decoration: underline; }
.place-open { margin-top: 6px; font-size: 12px; }
.place-open a { color: var(--accent-text); text-decoration: none; }
.place-open a:hover { text-decoration: underline; }

/*
 * Which days a thing repeats on.
 *
 * Seven letters rather than seven checkboxes with names: a coach reading
 * "Tue Thu" reads it as a pattern, and the pattern is the thing being set.
 * Two of them say T and two say S, which is the price of the shape and is why
 * each one also says its full name to a screen reader.
 */
.rep-days { display: flex; gap: 4px; }
.rep-day {
  width: 30px; height: 30px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-2);
  cursor: pointer;
}
.rep-day:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-text); }
.rep-day[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.rep-day:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Roster contacts ---------- */

/*
 * The people to tell alongside somebody.
 *
 * A list rather than a table: it is two or three rows, and a table header over
 * three rows is more furniture than content.
 */
.contact-list {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.contact-row {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 7px 10px; border-bottom: 1px solid var(--line);
}
.contact-row:last-child { border-bottom: 0; }
.contact-who { min-width: 0; }
.contact-name { font-size: 13px; font-weight: 500; }
.contact-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.contact-acts { display: flex; gap: 4px; flex: 0 0 auto; }

.roster-check {
  display: flex; gap: 7px; align-items: center;
  margin-top: 8px; font-size: 13px; color: var(--ink-2);
}


/* ---------- The calendar ---------- */

/*
 * A month, on a wall.
 *
 * Six rows always. A grid that is five rows in one month and six in the next
 * makes everything below it jump as you page through a season, and an empty
 * row costs less than that.
 */
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 4px 0 10px;
}
.cal-month { font-size: 17px; font-weight: 650; color: var(--ink); }
.cal-nav { display: flex; gap: 6px; }
.cal-nav .btn { min-width: 34px; }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
/* The day names: the same band as a table's head, so the grid has one. */
.cal-weekday {
  background: var(--head-bg); padding: 6px 8px;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2); font-weight: 600;
}
.cal-day {
  background: var(--surface); min-height: 104px; padding: 5px 6px 7px;
  display: flex; flex-direction: column; gap: 3px; cursor: pointer;
}
.cal-day:hover { background: var(--surface-2); }
/*
 * A day either side of the month is context, not somewhere to look: a shade
 * off the month's own days, and not the page's gray or the head band's.
 */
.cal-day.is-outside { background: var(--outside-bg); }
.cal-day.is-outside .cal-date { color: var(--ink-3); opacity: 0.6; }
.cal-date { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cal-day.is-today .cal-date {
  align-self: flex-start; background: var(--accent); color: #fff;
  border-radius: 999px; min-width: 20px; padding: 1px 6px; text-align: center;
  font-weight: 650;
}

/*
 * An entry, small enough that five of them fit on a Friday.
 *
 * The time leads because that is what separates two things on the same day,
 * and the name is allowed to run out of room rather than wrap -- a square that
 * grows to fit its longest title drags the whole week's height with it.
 */
.cal-chip {
  display: flex; align-items: baseline; gap: 5px; width: 100%;
  text-align: left; border: 0; border-left: 3px solid currentColor;
  border-radius: 3px; padding: 2px 5px; font: inherit; font-size: 11.5px;
  cursor: pointer; overflow: hidden;
}
.cal-chip:hover { filter: brightness(0.96); }
.cal-time { font-size: 10.5px; opacity: 0.75; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cal-repeat { margin-left: auto; opacity: 0.6; font-size: 10px; }

/*
 * One colour per kind, and they have to be told apart at a glance on a busy
 * week. Games take the accent because they are the thing the season is made
 * of; the rest are the semantic hues already in the palette, which are as far
 * apart as anything here gets.
 */
.cal-chip.is-game       { color: var(--accent-text);  background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.cal-chip.is-scrimmage  { color: var(--special); background: color-mix(in srgb, var(--special) 10%, var(--surface)); }
.cal-chip.is-practice   { color: var(--offense); background: color-mix(in srgb, var(--offense) 10%, var(--surface)); }
.cal-chip.is-team_event { color: var(--good);    background: color-mix(in srgb, var(--good) 10%, var(--surface)); }

.cal-key { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 12px; }
.cal-key-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.cal-dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.cal-dot.is-game       { background: var(--accent); }
.cal-dot.is-scrimmage  { background: var(--special); }
.cal-dot.is-practice   { background: var(--offense); }
.cal-dot.is-team_event { background: var(--good); }

@media (max-width: 720px) {
  .cal-day { min-height: 72px; }
  .cal-what { display: none; }      /* a dot and a time still says there is something */
}

/*
 * A settings row: what it is, where its value came from, and the box.
 *
 * The source badge sits on the label line rather than under the box, because
 * "this is coming from the environment, not from what you typed" is something
 * to know before typing rather than after saving.
 */
.set-list { display: grid; gap: 18px; }
.set-row { display: grid; gap: 6px; }
.set-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.set-head label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.set-row .hint { margin-top: 0; }
.badge.is-none { background: transparent; color: var(--ink-3); border: 1px dashed var(--line-strong); }

/*
 * The game's own details, read back as densely as they can be read.
 *
 * A row of short facts on one grid and the long ones stacked under it. Putting
 * an address in the same grid as a start time makes every column as wide as the
 * address, which spreads six values across a screen with an acre of nothing
 * between them -- and this sits above the work, so every row it takes is a row
 * of film pushed down the page.
 */
.gd-card { margin-bottom: 14px; }
.gd-card .card-body { padding: 10px 14px; }
/* Edit in the corner of what it edits, without a heading row to hold it: the
   details grow, the button stays pinned to the top right. */
.gd-body { display: flex; align-items: flex-start; gap: 14px; }
.gd-main { flex: 1 1 auto; min-width: 0; }
.gd-body > .btn, .gd-acts { flex: 0 0 auto; }
.gd-acts { display: flex; gap: 8px; }
/* Folded: the first line of facts only. */
.gd-card.is-collapsed .gd-wide { display: none; }
.gd-toggle { min-width: 30px; font-size: 13px; line-height: 1; }

/* A column heading that sorts. The caret is the only thing that moves, so a
   heading does not jump a pixel when it becomes the sorted one. */
th.is-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.is-sortable:hover { color: var(--ink); }
th.is-sortable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
th.is-sorted { color: var(--ink); }
.th-caret { display: inline-block; min-width: 10px; font-weight: 400; }
.gd-grid {
  display: flex; flex-wrap: wrap; gap: 6px 26px;
}
.gd-wide {
  display: grid; gap: 4px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line);
}
.gd-item { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.gd-item.is-wide { gap: 9px; }
.gd-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-3); white-space: nowrap;
}
.gd-value { font-size: 13px; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.gd-item.is-wide .gd-label { min-width: 44px; }

/* The film link, and what its play links can do with it. */
.film-row-body { display: grid; gap: 4px; min-width: 0; }
.film-row-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.film-support {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line);
}
.film-support.is-good { color: var(--good); background: color-mix(in srgb, var(--good) 9%, var(--surface)); border-color: color-mix(in srgb, var(--good) 25%, var(--surface)); }
.film-support.is-warn { color: var(--warn-ink); background: color-mix(in srgb, #b7791f 12%, var(--surface)); border-color: color-mix(in srgb, #b7791f 30%, var(--surface)); }
.film-support.is-bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 25%, var(--surface)); }
/*
 * The same chip, as the button that re-tests the link.
 *
 * A button brings its own font, padding and alignment, so those are reset
 * back to the span the chip has always been -- the point is that it looks no
 * different, only behaves differently. The colour it is already wearing says
 * what the film does; borrowing a button look as well would say it twice.
 */
button.film-support.is-checkable {
  font: inherit; font-size: 11.5px; font-weight: 600; line-height: inherit;
  cursor: pointer;
}
button.film-support.is-checkable:hover:not(:disabled) { filter: brightness(0.96); }
button.film-support.is-checkable:disabled { cursor: progress; opacity: 0.7; }
button.film-support.is-checkable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/*
 * The title-card switch, under the film's own controls.
 *
 * A line of its own rather than another button on the row: it is a setting
 * this film carries, not an action, and the row above it is already four
 * controls wide.
 */
/*
 * A row on an archived shelf.
 *
 * Nothing to open behind it, so it does not offer a pointer or a hover lift --
 * the row is a record of something put away, and its buttons are the only
 * things on it that still do anything.
 */
tr.is-archived { cursor: default; }
tr.is-archived td { color: var(--ink-3); }
tr.is-archived td:first-child, tr.is-archived td:nth-child(2) { opacity: 0.85; }

/*
 * Confirming what a film's scoreboard reads.
 *
 * The picture carries the screen: it is the coach's own board with the boxes
 * drawn on it, and every question below refers to a number printed on it. So
 * it is shown as large as the dialog allows, on a dark ground because a lit
 * LED board against white is a glare rather than a photograph.
 */
.sb-intro { margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
.sb-shot {
  background: #14181f; border-radius: var(--radius-sm); padding: 10px;
  margin-bottom: 14px; text-align: center;
}
.sb-shot img { max-width: 100%; image-rendering: pixelated; }
/*
 * A rendered bar is thirty times wider than it is tall. Fitted to the
 * dialog's width like a board it is a line twenty pixels high, and the whole
 * point of the picture is to read numbers off it. Shown at its own height
 * instead and scrolled sideways; the picture says which it is on load.
 */
.sb-shot.is-wide { overflow-x: auto; text-align: left; }
.sb-shot.is-wide img { max-width: none; height: 160px; width: auto; }

.sb-fields { display: grid; gap: 8px; }
/* While the board is being read: a spinner, the stage and the time so far, nothing to act on yet. */
.sb-working { display: flex; align-items: flex-start; gap: 14px; padding: 18px 4px 6px; }
.sb-working .gr-spin { flex: none; width: 22px; height: 22px; margin-top: 1px; }
.sb-working-stage { font-size: 15px; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.sb-working-stage .muted { font-size: 13px; font-variant-numeric: tabular-nums; }
.sb-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; }
.sb-name { font-size: 13px; color: var(--ink); }
.sb-row select { width: 100%; }
/* What the film made of the field, beside the field. */
.sb-verdict { font-size: 11.5px; white-space: nowrap; }
.sb-verdict.is-good { color: var(--good); }
.sb-verdict.is-bad { color: var(--bad); }
.sb-verdict.is-plain { color: var(--ink-3); }

.film-intro {
  display: flex; gap: 7px; align-items: center;
  /*
   * A little clear of the facts it follows.
   *
   * The row it is on already puts 26px between its items; this adds to that
   * rather than replacing it, because the switch is a different kind of thing
   * from the values beside it and should not read as one more of them.
   */
  margin-left: 12px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer;
  /* The row aligns on the baseline; a control should sit with the text, not
     hang below it on the strength of its box. */
  align-self: center;
}
.film-intro input { width: auto; margin: 0; }
.film-intro-wait { color: var(--ink-3); }

.film-note { font-size: 12px; color: var(--ink-3); max-width: 70ch; line-height: 1.45; }

/* The title row over the details: no room for a subtitle that is not there. */
.page-head.is-tight { margin-bottom: 12px; align-items: center; }

/*
 * The fixture at the top of a game: two schools and the word between them.
 *
 * The names take the sidebar's own colour rather than the page's near-black.
 * It is the darkest thing on screen already, so the heading reads as part of
 * the same furniture as the menu beside it instead of competing with it.
 *
 * "vs" is not a name and should not be read as loudly as one. Smaller, and at
 * the weight of body text rather than the heading's, so the eye goes to the
 * two schools and takes the join on the way past. Sized in `em` so it stays in
 * proportion if the heading ever changes size.
 */
.gd-fixture { color: var(--fixture-ink, var(--sidebar-bg)); }
.gd-vs {
  font-size: 0.62em;
  font-weight: 500;
  letter-spacing: 0.04em;
  /* A little air on top of the real spaces either side of it in the markup. */
  margin: 0 0.1em;
  /* Lifted a touch: a smaller word on a shared baseline sits low beside caps. */
  vertical-align: 0.08em;
}


/* ---------- Printing ---------- */

/*
 * A report on paper is the page a coach is looking at, minus the application
 * around it. Everything here either removes furniture or stops the browser
 * making decisions that are right on a screen and wrong on paper.
 *
 * This is why the report is printed rather than drawn: charts are SVG, tables
 * are tables, and the browser already knows how to put both on a page at the
 * right size. Redrawing them somewhere else would be a second version of the
 * report that disagreed with this one the first time either changed.
 */
@media print {
  /*
   * Backgrounds and fills are the report.
   *
   * Browsers drop them by default, on the sound theory that most pages are
   * mostly decoration. Here a bar chart with no fill is a row of empty
   * rectangles and a red result badge is the word "L" on white.
   */
  *, *::before, *::after {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  @page { margin: 14mm 12mm; }

  html, body { background: #fff; }

  /* The application, as opposed to the report. */
  .sidebar,
  .page-head .actions,
  .toast-root,
  #modal-root,
  .crumb,
  .seg,
  .play-toolbar,
  input[type="search"],
  .chart-tip,
  .no-print { display: none !important; }

  /*
   * A chart's scroller is a way of reading a wide chart on a narrow screen.
   * Paper has neither a narrow screen nor a way to scroll, so the figure is
   * given its full width and the mechanism goes.
   */
  .chart-figure { overflow: visible !important; }
  .chart-figure svg { width: 100% !important; height: auto !important; }

  /* One column, no sticky anything, and no invented scrollbars. */
  .app { display: block; }
  .main { display: block; }
  .page { padding: 0; max-width: none; }
  .table-wrap, .dg-frame, .card { overflow: visible !important; }
  .pm-bar, .pm-side, thead th { position: static !important; }

  /*
   * A card is a unit of the report, so it is not split between two sheets
   * unless it is taller than one. `avoid` is a request rather than a rule --
   * the browser will break a card that cannot fit, which is the right answer.
   */
  .card, .tile, .chart-card { break-inside: avoid; page-break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
  tr { break-inside: avoid; page-break-inside: avoid; }
  thead { display: table-header-group; }   /* repeats over a long table */

  /* Paper is not a screen: hairlines and shadows read as smudges. */
  .card { box-shadow: none; border: 1px solid #d8dce2; }

  /* Ink, at a size that survives being printed. */
  body { font-size: 11px; }
  h1 { font-size: 19px; }
  h2 { font-size: 13px; }
  a { color: inherit; text-decoration: none; }

  /*
   * A title for the sheet, since the breadcrumb and the sidebar that said whose
   * report this is are both gone. Filled in by the page before it prints.
   */
  .print-head { display: block !important; margin: 0 0 14px; }
  .print-head h1 { margin: 0 0 3px; }
  .print-head .sub { font-size: 11px; color: #4a5563; }
}

/* Only ever on paper. */
.print-head { display: none; }

/*
 * A player tagged on a play, as a line rather than a row of controls.
 *
 * What was recorded is read far more often than it is changed -- a coach
 * working down the film is checking the tag is right, not editing it -- so the
 * row states it and the editing is a click away.
 */
.tagged-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
/* Did something on the play -- carried, caught, tackled -- not only on it. */
.tagged-row.is-highlight {
  border-color: var(--penalty-line);
  background: var(--penalty-bg);
  box-shadow: 0 0 0 1px var(--penalty-line);
}
.tagged-who { flex: 1 1 auto; min-width: 0; }
.tagged-name { font-size: 13px; font-weight: 600; }
.tagged-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.tagged-acts { flex: 0 0 auto; display: flex; gap: 4px; }

/*
 * The one-tap ball carrier on a run, or catcher on a pass: the team's own
 * carriers, most carries first, each a number over a surname.
 */
.carrier-pick {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2);
}
.carrier-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); margin-right: 4px;
}
.carrier-chip {
  display: inline-flex; flex-direction: column; align-items: center; min-width: 56px;
  padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface);
  font: inherit; font-size: 15px; font-weight: 700; line-height: 1.15; color: var(--ink); cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.carrier-chip:hover { border-color: var(--accent); }
.carrier-name { font-size: 11px; font-weight: 500; color: var(--ink-3); max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carrier-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.carrier-chip.is-on .carrier-name { color: rgba(255, 255, 255, 0.85); }

/*
 * Picking every role a player had on one snap.
 *
 * Chips rather than a multi-select, because the list is fifteen long and the
 * question is "which of these" rather than "which one" -- a coach reads the
 * lit ones back at a glance and a multi-select makes them scroll to check.
 */
.role-pick { display: flex; flex-wrap: wrap; gap: 6px; }
/* Clear, after the role chips: every role off (since 2026-12-03). */
.role-clear { align-self: center; border: 0; background: none; padding: 4px 6px; color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.role-clear:hover { text-decoration: underline; }
.role-chip {
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font: inherit; font-size: 12px; color: var(--ink-2); cursor: pointer;
  white-space: nowrap;
}
.role-chip:hover { border-color: var(--accent); color: var(--accent-text); }
/* A hidden lookup is still listed here, and reads as switched off. */
/*
 * Narrowing a long lookup. The selects are sized to their content rather than
 * stretched: a filter that spans half the page reads as the subject of the
 * screen, and here it is a way of getting past a hundred rows.
 */
.lookup-filters { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; flex-wrap: wrap; }
.lookup-filters select { width: auto; min-width: 150px; }
.lookup-filters .count-of { font-size: 13px; color: var(--ink-3); white-space: nowrap; }

tr.is-hidden-row td:first-child > div { color: var(--ink-3); }
tr.is-hidden-row .badge { margin-left: 8px; }

.role-chip[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}

/* ---------- Cards & tables ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.card-head h2 { margin: 0; font-size: 14px; font-weight: 650; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; }

/*
 * A card folded to its heading.
 *
 * The heading's rule is the line between it and a body; with no body under it
 * the rule is the card's own bottom edge drawn twice, so it goes. The summary
 * beside the title is what the section is currently set to -- the reason a
 * shut page is still worth reading.
 */
.card.is-folded .card-head { border-bottom: none; }
.card-head .fold-summary { font-weight: 500; color: var(--ink-3); }
/* A count of what is under the heading, set quietly so the heading still reads
   as the heading. */
.card-count {
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* Four buttons and a heading do not fit a narrow window on one line. */
.card-head, .card-head .actions { flex-wrap: wrap; }
.card-body { padding: 16px; }
.card + .card { margin-top: 18px; }
/* Inside a grid the gap already separates them; the stacking margin would push
   every second card down a row and break the tops out of line. */
.grid > .card + .card { margin-top: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  font-weight: 650;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--head-bg);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-3); }
.nowrap { white-space: nowrap; }

/* ---------- Stat tiles ---------- */

.stat-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.tile .label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 650;
}
.tile .value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.tile .value small { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.tile .delta { font-size: 12px; margin-top: 3px; color: var(--ink-2); }
.tile.win { border-left: 3px solid var(--good); }
.tile.loss { border-left: 3px solid var(--bad); }

/* The Invitations tab's totals: each one a filter, lit while it is on. */
.invitations { display: grid; gap: 14px; }
.inv-tile { text-align: left; font: inherit; color: inherit; cursor: pointer; }
.inv-tile:hover { border-color: var(--line-strong); }
.inv-tile.is-on { outline: 2px solid var(--accent); outline-offset: -1px; }
.inv-table tr.is-inactive td { opacity: 0.6; }
.inv-table td .small { font-size: 12px; }
.inv-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* A cell number: the number calls it, Text beside it starts a message. */
.phone-links { display: inline-flex; gap: 8px; align-items: baseline; white-space: nowrap; }
.phone-links a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.phone-links a.phone-text { color: var(--accent-text, var(--accent)); text-decoration: none; font-weight: 600; font-size: 0.92em; }

/* The contact sheet: a person, then their family under the last column. */
.cs-table td { vertical-align: top; }
.cs-table .cs-num { font-variant-numeric: tabular-nums; font-weight: 700; width: 3em; }
.cs-family { display: grid; gap: 8px; }
.cs-contact { line-height: 1.35; }
.cs-table a[href^="mailto:"] { color: inherit; }
.contact-sheet .small { font-size: 12px; }
@media print {
  .phone-links a.phone-text { display: none; }
  .phone-links a, .cs-table a { text-decoration: none; }
  .cs-table { font-size: 10.5px; }
}

/* ---------- Help (views/help.js) ---------- */
.badge.warn { background: color-mix(in srgb, #b7791f 16%, var(--surface)); color: var(--warn-ink); }
.help-known {
  margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius);
  background: color-mix(in srgb, #b7791f 10%, var(--surface)); border: 1px solid color-mix(in srgb, #b7791f 30%, var(--line));
  font-size: 13.5px;
}
/* As wide as its tabs: stretched across the bar, the rest was an empty gray strip. */
.help-tabs { flex-wrap: wrap; align-self: flex-start; }

/* The bar that stays put; the body scrolls under it (.fill-scroll). */
.help-page { padding-bottom: 0; }
.help-bar {
  display: flex; flex-direction: column; gap: 12px;
  padding-bottom: 14px; margin-bottom: 0; border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.help-bar-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.help-bar-title { margin: 0; font-size: 22px; }
.help-back { font-weight: 600; }
.help-bar-search { margin-left: auto; width: min(320px, 100%); }
.help-scroll { padding-top: 18px; padding-bottom: 28px; }
@media (min-width: 861px) {
  .page.is-fill.help-page .help-scroll { flex: 1 1 auto; }
}
/* On a phone the whole page scrolls, so the bar pins itself instead. */
@media (max-width: 860px) {
  .help-bar { position: sticky; top: var(--demo-bar-h, 0px); z-index: 20; padding-top: 10px; }
  .help-bar-search { margin-left: 0; width: 100%; }
}

/* A guide: every guide down the side, this one open, the text beside it. */
.help-doc { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; align-items: start; }
/* On the lightest step, as a card is: the guide and its list read as one panel. */
.help-doc {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px 24px;
}
.help-doc-nav {
  position: sticky; top: 0; max-height: calc(100vh - 200px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px; font-size: 13.5px; padding-right: 6px;
}
.help-doc-all { color: var(--accent-text); font-weight: 600; text-decoration: none; }
.help-doc-group { display: flex; flex-direction: column; gap: 2px; }
.help-doc-section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 4px; }
.help-doc-link { color: var(--ink-2); text-decoration: none; padding: 4px 8px; border-radius: 6px; }
.help-doc-link:hover { background: var(--surface-2); color: var(--ink); }
.help-doc-link.is-current { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--accent-text); font-weight: 650; }
.help-doc-toc { display: flex; flex-direction: column; margin: 2px 0 6px 10px; border-left: 2px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.help-doc-toc-link {
  background: none; border: 0; text-align: left; cursor: pointer; font: inherit; font-size: 12.5px;
  color: var(--ink-2); padding: 3px 10px;
}
.help-doc-toc-link:hover { color: var(--accent-text); }
.help-guide-section { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.help-onpage { margin: 0 0 18px; font-size: 13px; line-height: 1.8; }
.help-onpage-link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--accent-text); }
.help-onpage-link:hover { text-decoration: underline; }
.md h3 { scroll-margin-top: 12px; }
.help-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.help-pager-link {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px;
}
.help-pager-link .muted { font-weight: 400; font-size: 12px; }
.help-pager-link.is-next { text-align: right; margin-left: auto; }
.help-pager-link:hover { border-color: var(--accent); }
/* Narrow screens: the guide alone (the bar's tabs and search still lead
   everywhere), and the tabs on one row that scrolls sideways. After the rules
   above, so it wins. */
@media (max-width: 960px) {
  .help-doc { grid-template-columns: 1fr; padding: 16px; }
  .help-doc-nav { display: none; }
}
@media (max-width: 860px) {
  .help-bar { gap: 8px; }
  .help-tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .help-tabs button { white-space: nowrap; flex: 0 0 auto; }
}
.help-section + .help-section { margin-top: 22px; }
.help-section-title { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.help-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.help-card {
  display: block; padding: 14px 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); color: inherit; text-decoration: none;
}
.help-card:hover { border-color: var(--accent); }
.help-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.help-card-title { font-weight: 650; margin-bottom: 4px; }
.help-card-summary { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
/* The tutorials, all in one player: first in Tutorials, marked as the way to watch them all. */
.help-card.is-playlist { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: inset 3px 0 0 var(--accent), var(--shadow); }
.help-card.is-playlist .help-card-title { color: var(--accent-text); }
/* Its page: as a guide's panel, the player across it (public/tutorials/playlist.js). */
.help-playlist {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px;
  --ddt-accent: var(--accent);
}
.help-playlist h1 { margin: 6px 0 6px; }
.help-playlist .help-lead { max-width: 760px; }
.help-playlist-stage { margin-top: 16px; }
@media (max-width: 960px) { .help-playlist { padding: 16px; } }

.help-guide { max-width: 760px; }
.help-guide h1 { margin: 6px 0 6px; }
.help-lead { margin: 0 0 18px; color: var(--ink-2); font-size: 15.5px; }
.md { line-height: 1.6; font-size: 14.5px; }
.md h3 { margin: 24px 0 8px; font-size: 17px; }
.md h4 { margin: 18px 0 6px; font-size: 15px; }
.md p { margin: 0 0 12px; }
/* A tutorial video in a guide: as wide as the text, never wider than the screen. */
.md-video { margin: 4px 0 18px; }
.md-video video { display: block; width: 100%; max-width: 960px; aspect-ratio: 16 / 9; height: auto; border-radius: var(--radius-sm); background: #000; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; }
.md li { margin-bottom: 4px; }
.md code { font-family: var(--mono, monospace); font-size: 0.92em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.md a { color: var(--accent-text); }
.md .table-wrap { margin: 0 0 14px; }
.md-table td { vertical-align: top; }
.md-table td:first-child { font-weight: 600; white-space: nowrap; }

/* ---------- The Library, in the Admin Portal (views/admin-library.js) ---------- */
.lib-list { display: grid; gap: 10px; max-width: 760px; }
.lib-item {
  display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); text-decoration: none;
}
.lib-item:hover { border-color: var(--accent); }
.lib-title { font-weight: 700; font-size: 15.5px; }
.lib-summary { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.lib-date { color: var(--ink-3); font-size: 12.5px; margin-top: 4px; }
.lib-page { max-width: 860px; }
.lib-page h1 { margin: 8px 0 2px; }
.lib-page .lib-date { margin: 0 0 14px; }
.lib-back { font-size: 13.5px; color: var(--accent-text); text-decoration: none; }
.lib-page.is-wide { max-width: 1180px; }
/* The logos page: one card per mark (views/admin-library.js). */
.logo-gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); margin-bottom: 16px; }
.logo-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.logo-card-head { display: flex; align-items: center; gap: 8px; }
.logo-card-head h3 { margin: 0; font-size: 16px; }
.logo-sizes { display: flex; align-items: flex-end; gap: 16px; }
.logo-size { display: grid; justify-items: center; gap: 4px; font-size: 11.5px; color: var(--ink-3); }
.logo-grounds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.logo-ground { display: grid; place-items: center; padding: 14px; border-radius: var(--radius); }
.logo-ground.is-light { background: #ffffff; border: 1px solid #e2e5ea; }
.logo-ground.is-dark { background: #1b2230; }
.logo-ground svg { display: block; }
.logo-downloads { display: flex; flex-wrap: wrap; gap: 6px; }
.md-tip {
  margin: 14px 0; padding: 10px 14px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.md-tip p:last-child { margin-bottom: 0; }
.help-vote { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13.5px; }

.ask { display: flex; flex-direction: column; gap: 12px; max-width: 820px; }
.ask-log {
  display: flex; flex-direction: column; gap: 10px; min-height: 220px; max-height: 56vh; overflow-y: auto;
  padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
}
.ask-hello p { margin: 0 0 10px; color: var(--ink-2); }

/* Share film: the dialog that emails a game's film outside the team. */
.share-film { display: flex; flex-direction: column; gap: 14px; }
.share-film form { display: flex; flex-direction: column; gap: 10px; }
.share-film-what {
  font-size: 13px; line-height: 1.5; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
.share-film-send { display: flex; justify-content: flex-end; gap: 8px; }
.share-film-list h3 { margin: 4px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); }
.share-film-row {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px;
}
.share-film-to { font-weight: 600; color: var(--ink); word-break: break-all; }

/* Ask Drilldown in the demo: what it would do, with an example. */
.ask-pitch { padding: 24px; display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.ask-pitch h2 { margin: 0; font-size: 21px; line-height: 1.25; color: var(--ink); text-wrap: balance; }
.ask-pitch-tag {
  align-self: flex-start; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.ask-pitch-lead { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; max-width: 62ch; }
.ask-pitch-example {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
}
.ask-pitch-example ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.ask-pitch-points { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.ask-pitch-points strong { color: var(--ink); }
.ask-pitch-next { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-size: 13px; }
.ask-starters { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-msg { max-width: 92%; padding: 10px 13px; border-radius: 12px; font-size: 14px; }
.ask-msg p:last-child, .ask-msg .md > :last-child { margin-bottom: 0; }
.ask-msg.is-user { align-self: flex-end; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.ask-msg.is-assistant { align-self: flex-start; background: var(--surface-2); }
.ask-msg .md { font-size: 14px; }
.ask-sources { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.ask-sources a { color: var(--accent-text); }
.ask-next { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ask-noted { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); font-style: italic; }
.ask-vote { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12.5px; }
.ask-form { display: flex; flex-direction: column; gap: 8px; }
.ask-input { resize: vertical; min-height: 54px; }
.ask-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.ask-left { margin-right: auto; font-size: 12.5px; }

/* X Factor Coach (views/coach.js): the coach's conversations beside the open one. */
.coach-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; max-width: 1100px; }
.coach-list { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 12px; }
.coach-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
/* Pinned and Recent scroll together in one box, so the list never runs off the screen. */
.coach-scroll { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 240px); min-height: 120px; overflow-y: auto; overscroll-behavior: contain; }
.coach-search { width: 100%; font-size: 13px; padding: 6px 9px; }
.coach-older { align-self: center; margin: 4px 0; }
.coach-new { align-self: flex-start; }
.coach-none { font-size: 12.5px; margin: 4px 0 0; }
.coach-group { margin: 6px 0 0; padding: 0 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.coach-li { position: relative; display: flex; align-items: center; border-radius: 8px; }
.coach-li:hover, .coach-li:focus-within { background: var(--surface-2); }
.coach-li.is-open { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.coach-item {
  flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; padding: 7px 4px 7px 10px;
  color: var(--ink); text-decoration: none; font-size: 13.5px;
}
.coach-li.is-open .coach-item { font-weight: 600; }
.coach-pin { flex: none; font-size: 11px; }
.coach-menu-wrap { position: relative; flex: none; }
.coach-more {
  width: 28px; height: 26px; margin-right: 4px; border: 0; border-radius: 6px; background: transparent;
  color: var(--ink-2); font-size: 16px; line-height: 1; cursor: pointer; opacity: 0;
}
.coach-li:hover .coach-more, .coach-li:focus-within .coach-more, .coach-li.is-open .coach-more,
.coach-more[aria-expanded="true"], .coach-head .coach-more { opacity: 1; }
.coach-more:hover, .coach-more[aria-expanded="true"] { background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink); }
@media (hover: none) { .coach-more { opacity: 1; } }
.coach-menu {
  position: fixed; z-index: 60; min-width: 160px; padding: 5px;
  display: flex; flex-direction: column; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.coach-menu-item {
  text-align: left; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent;
  color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer;
}
.coach-menu-item:hover, .coach-menu-item:focus-visible { background: var(--surface-2); outline: none; }
.coach-menu-item.is-danger { color: var(--bad); }
.coach-menu-rule { height: 1px; margin: 4px 2px; background: var(--line); }
/* A conversation's whole name, popped out over its row when the list cuts it short. */
.coach-name-tip {
  position: fixed; z-index: 55; pointer-events: none; display: flex; align-items: center; width: max-content;
  padding: 6px 12px 6px 8px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 13.5px; line-height: 1.35;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25); white-space: normal; overflow-wrap: anywhere;
}
.coach-item-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coach-item-when { font-size: 11.5px; color: var(--ink-3); flex: none; }
.coach-pane { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.coach-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.coach-head h2 { margin: 0; font-size: 17px; flex: 1; min-width: 0; text-wrap: balance; }
.coach-log { max-height: 62vh; min-height: 300px; }
.coach-log .ask-msg { max-width: 96%; }
.coach-log .md table { font-size: 13px; }
.coach-q { white-space: pre-wrap; margin: 0; }
.coach-meter { margin-right: auto; font-size: 12.5px; }
.coach-meter .ai-meter { margin: 0; }
.coach-full { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); }
.coach-full p { margin: 0; color: var(--ink-2); }
@media (max-width: 760px) {
  .coach-layout { grid-template-columns: minmax(0, 1fr); }
  .coach-list { position: static; }
  .coach-scroll { max-height: 34vh; }
}

.help-form { display: flex; flex-direction: column; gap: 12px; max-width: 680px; }
.help-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; }
.help-check input { margin-top: 3px; }
.help-form-acts { display: flex; gap: 8px; }
.help-questions { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.help-sent h2 { margin: 0 0 8px; }
.help-sent p { margin: 0 0 14px; color: var(--ink-2); max-width: 620px; }
.help-mine { display: flex; flex-direction: column; gap: 12px; max-width: 820px; }
.help-mine-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.help-mine-body { margin: 8px 0 0; color: var(--ink-2); white-space: pre-wrap; font-size: 13.5px; }
.help-mine-reply { margin: 8px 0 0; font-size: 13.5px; }

/* ---------- RSVPs and attendance (components/event-panel.js, public/rsvp.html) ---------- */
.ev-panel { display: flex; flex-direction: column; gap: 14px; }
.ev-facts { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.ev-notes { margin-top: 4px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); white-space: pre-wrap; }
.ev-counts { font-weight: 600; font-size: 14px; }
.ev-mine { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--line); }
.ev-mine-q { font-weight: 650; }
.ev-choices, .rsvp-choices { display: flex; gap: 8px; flex-wrap: wrap; }
.ev-choice, .rsvp-choice {
  flex: 1 1 0; min-width: 96px; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--line-strong); background: var(--surface); font: inherit; font-weight: 650;
}
.ev-choice.is-good.is-on, .rsvp-choice.is-good.is-on { background: color-mix(in srgb, var(--good) 14%, var(--surface)); border-color: var(--good); color: var(--good); }
.ev-choice.is-warn.is-on, .rsvp-choice.is-warn.is-on { background: color-mix(in srgb, #b7791f 14%, var(--surface)); border-color: #b7791f; color: var(--warn-ink); }
.ev-choice.is-bad.is-on, .rsvp-choice.is-bad.is-on { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); border-color: var(--bad); color: var(--bad); }
.ev-tabs { margin-bottom: 10px; }
.ev-list { display: flex; flex-direction: column; max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.ev-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 10px; font-size: 13.5px; }
.ev-row + .ev-row { border-top: 1px solid var(--line); }
.ev-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-note { font-size: 12.5px; line-height: 1.3; overflow-wrap: anywhere; }
/* On a phone, a family's note goes under the name rather than being cut off beside it. */
@media (max-width: 560px) {
  .ev-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .ev-row .ev-note { grid-column: 1; grid-row: 2; }
  .ev-row .ev-note:empty { display: none; }
  .ev-row .ev-select { grid-column: 2; grid-row: 1 / span 2; }
}
.ev-select { font: inherit; font-size: 13px; padding: 3px 6px; }
.ev-att-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 12.5px; }
/* Attendance: one dropdown a player, tinted by what is chosen. */
.ev-att { min-width: 112px; font-weight: 600; color: var(--ink-3); }
.ev-att.is-present { background: color-mix(in srgb, var(--good) 14%, var(--surface)); border-color: var(--good); color: var(--good); }
.ev-att.is-late { background: color-mix(in srgb, #b7791f 14%, var(--surface)); border-color: #b7791f; color: var(--warn-ink); }
.ev-att.is-absent { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); border-color: var(--bad); color: var(--bad); }
.ev-att.is-excused { background: color-mix(in srgb, #5b6b80 18%, var(--surface)); border-color: color-mix(in srgb, #5b6b80 60%, var(--ink)); color: color-mix(in srgb, #5b6b80 45%, var(--ink)); }
.ev-att option { color: var(--ink); background: var(--surface); }
.rsvp-body { background: var(--bg); min-height: 100vh; margin: 0; }
.rsvp-page { display: flex; justify-content: center; padding: 32px 16px; }
.rsvp-card {
  width: min(480px, 100%); background: var(--surface); border-radius: 16px; padding: 24px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px;
}
.rsvp-brand { display: flex; align-items: center; }
.rsvp-team { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.rsvp-card h1 { margin: 0; font-size: 24px; }
.rsvp-event { display: flex; flex-direction: column; gap: 3px; font-size: 14.5px; }
.rsvp-what { font-weight: 650; }
.rsvp-notes { margin-top: 4px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); white-space: pre-wrap; }
.rsvp-card .input { margin-top: 10px; width: 100%; }
/* The note box when declining needs a reason in it. */
.input.is-needed { border-color: var(--bad); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 25%, transparent); }
.rsvp-msg { margin: 0; font-weight: 600; }
.rsvp-counts, .rsvp-foot { margin: 0; font-size: 12.5px; }

/* ---------- Requests, in the Admin Portal (views/admin-requests.js) ---------- */
.req-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
/* Promo codes (views/admin-promo.js): the new-code form. */
.promo-form { display: grid; gap: 12px; }
.promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; }
.promo-tiers { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }
.promo-form .btn-primary { justify-self: start; }
.req-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .req-grid { grid-template-columns: 1fr; } }
.req-body { white-space: pre-wrap; margin: 0; font-size: 14px; }
.req-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13.5px; margin: 0; }
.req-facts dt { color: var(--ink-3); }
.req-facts dd { margin: 0; overflow-wrap: anywhere; }
.req-errors { margin: 0; padding-left: 18px; font-family: var(--mono, monospace); font-size: 12px; color: var(--ink-2); }
.req-controls { display: flex; flex-direction: column; gap: 12px; }
.req-asked { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }

/* ---------- Usage, in the Admin Portal (views/admin-usage.js) ---------- */
.usage-h { margin: 22px 0 10px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.usage-chart { display: flex; flex-direction: column; gap: 6px; }
.usage-bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding-bottom: 1px; border-bottom: 1px solid var(--line); }
.usage-bar { flex: 1 1 0; min-width: 2px; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.usage-bar.is-zero { background: var(--line); min-height: 1px; }
.usage-bar:hover { filter: brightness(1.15); }
.usage-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); }
.usage-peak { font-size: 12px; }
.usage-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 860px) { .usage-cols { grid-template-columns: 1fr; } }
.usage-ranked { display: flex; flex-direction: column; gap: 6px; }
.usage-row { display: grid; grid-template-columns: minmax(110px, 1.2fr) 2fr 44px auto; align-items: center; gap: 10px; font-size: 13.5px; }
.usage-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-track { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.usage-fill { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.usage-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.usage-extra { font-size: 12px; white-space: nowrap; }

/* Comparison rows: us vs them with a shared bar. */
.compare { display: flex; flex-direction: column; gap: 2px; }
.compare-row { display: grid; grid-template-columns: 62px 1fr 130px 1fr 62px; align-items: center; gap: 10px; padding: 7px 0; }
.compare-row + .compare-row { border-top: 1px solid var(--line); }
.compare-row .label {
  text-align: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  font-weight: 650;
}
.compare-row .v { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 14px; }
.compare-row .v.left { text-align: right; }
.compare-row .bar { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; display: flex; }
.compare-row .bar.left { justify-content: flex-end; }
.compare-row .bar i { display: block; height: 100%; }
.compare .v.left.team-label { color: var(--accent-text); }
.compare-row .bar.left i { background: var(--chart-us); }
.compare-row .bar.right i { background: var(--chart-them); }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  background: var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge.offense { background: color-mix(in srgb, var(--offense) 14%, var(--surface)); color: var(--offense); }
.badge.defense { background: color-mix(in srgb, var(--defense) 16%, var(--surface)); color: var(--defense); }
.badge.special_teams { background: color-mix(in srgb, var(--special) 14%, var(--surface)); color: var(--special); }
.badge.good { background: color-mix(in srgb, var(--good) 14%, var(--surface)); color: var(--good); }
/* A breakdown only the coaches can see yet. */
.publish-chip {
  display: inline-flex; align-items: center; vertical-align: middle;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: 0;
}
h1 .publish-chip { margin-left: 12px; font-size: 12px; }
.publish-chip.is-draft { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
/* Its opposite. Green rather than another grey: the pair is read at a glance
   from across the page, and two neutrals would need the words to tell apart. */
.publish-chip.is-published {
  background: color-mix(in srgb, var(--good) 12%, var(--surface)); color: var(--good);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 32%, var(--surface));
}
/* A flag on the play: the yellow of a penalty marker. */
.badge.penalty { background: var(--penalty-bg); color: var(--penalty-ink); box-shadow: inset 0 0 0 1px var(--penalty-line); }
.badge.bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad); }
.badge.pos { background: var(--surface-2); color: var(--ink-2); font-family: var(--mono); font-size: 10.5px; }
/* Where a game is played. Colours kept clear of the unit colours and of the
   win/loss green and red that sit a few columns over. */
.badge.loc-home { background: color-mix(in srgb, #0e7c86 14%, var(--surface)); color: var(--home-ink); }
.badge.loc-away { background: color-mix(in srgb, #b7791f 16%, var(--surface)); color: var(--warn-ink); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 11.5px;
}
.chip button {
  border: none; background: none; cursor: pointer;
  color: var(--ink-3); font-size: 13px; line-height: 1; padding: 0;
}
.chip button:hover { color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Play grid ---------- */

.play-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
}
.play-toolbar .spacer { margin-left: auto; }
/* The play count, now sitting with the tabs that narrow it. A little air on
   the left so it reads as a figure about the row rather than another tab. */
.play-toolbar .toolbar-count { margin-left: 4px; }
/*
 * Room between the two sets of tabs.
 *
 * When and what are separate questions -- the quarter narrows the film, the
 * unit narrows the kind of play -- and at the toolbar's own 8px the two sets
 * of buttons ran together into one strip a reader had to parse before they
 * could use it. This is the only thing saying they are two controls.
 *
 * An element rather than a margin on the second set, because the toolbar
 * wraps: a margin would survive the line break and indent the unit tabs under
 * the quarters, which reads as a hierarchy that is not there. A spacer simply
 * ends up at the end of the first line and takes no space on the second.
 */
.play-toolbar .toolbar-gap { flex: 0 0 8px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button {
  border: none;
  background: var(--surface);
  padding: 6px 11px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--ink-2);
}
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.active { background: var(--ink); color: var(--on-ink); font-weight: 600; }

table.plays { font-size: 12.5px; }
table.plays th, table.plays td { padding: 6px 8px; }
table.plays td.end-time { cursor: default; }
/* The play just added, picked out for a moment as it scrolls into view. */
table.plays tr.just-added td { animation: just-added 1.6s ease-out; }
@keyframes just-added { from { background: color-mix(in srgb, #e0b100 28%, transparent); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { table.plays tr.just-added td { animation: none; } }
table.plays td.seq { color: var(--ink-3); font-family: var(--mono); font-size: 11.5px; width: 56px; white-space: nowrap; }

table.plays tr.unit-offense td.unit-cell { box-shadow: inset 3px 0 0 var(--offense); }
table.plays tr.unit-defense td.unit-cell { box-shadow: inset 3px 0 0 var(--defense); }
table.plays tr.unit-special_teams td.unit-cell { box-shadow: inset 3px 0 0 var(--special); }
/*
 * The highlight star, beside the play number.
 *
 * Both halves of the cell keep a fixed width so the column has two invisible
 * tracks: numbers left, stars right. The number's track fits three digits,
 * which is every play any film has ever held; the star's is held open whether
 * there is a star in it or not, so the ones that exist line up down the page
 * instead of stepping in and out with the width of the number beside them.
 *
 * Bigger than the row's type on purpose -- it is a mark on the play, not a
 * value in a column, and at the table's own 11.5px it read as punctuation.
 * Line-height 1 keeps it from setting the row's height.
 */
table.plays td.seq .seq-n { display: inline-block; min-width: 21px; }
table.plays td.seq .seq-star {
  display: inline-block;
  width: 16px;
  margin-left: 4px;
  color: var(--highlight);
  font-size: 15px;
  line-height: 1;
  vertical-align: -2px;
  text-align: center;
}
table.plays tr.scoring { background: color-mix(in srgb, var(--good) 7%, transparent); }

/*
 * A punt's two distances, in the column a single yardage used to occupy.
 *
 * Smaller and not bold: it is two facts rather than one, and it should read
 * as a pair of small labels rather than compete with the gains above and
 * below it in the same column.
 */
table.plays td.punt-yards {
  white-space: nowrap; font-size: 11.5px; font-variant-numeric: tabular-nums;
  color: var(--ink-2, var(--ink-3));
}

/* Punt distance and return distance, side by side in the play editor. */
.punt-pair { display: flex; gap: 12px; }
.punt-pair > * { flex: 1 1 0; min-width: 0; }

/*
 * A value nobody has charted, while the quality check is on.
 *
 * The cell itself is tinted rather than a mark being added inside it: a dot or
 * an icon would move the number beside it, and a column that shifts when the
 * check is switched on is a column that has to be re-read. This way the grid
 * keeps its exact shape and the gaps light up in place, so a run of missing
 * end times reads as a stripe down one column -- which is how a coach decides
 * what to fix first.
 *
 * The left edge is scoped away from the unit cell, which already spends its
 * inset shadow on the unit colour and must keep it.
 */
table.plays td.qc-missing {
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  color: var(--warn-ink);
}
table.plays td.qc-missing:not(.unit-cell) {
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--warn) 70%, transparent);
}
/* The dash keeps its place but stops reading as "nothing to see here". */
table.plays td.qc-missing.muted { color: var(--warn-ink); }
table.plays tr.scoring td.qc-missing,
table.plays tr:hover td.qc-missing {
  background: color-mix(in srgb, var(--warn) 24%, transparent);
}

/* The summary the check opens with. */
.qc-lines { display: flex; flex-direction: column; gap: 1px; margin: 4px 0 2px; }
.qc-line {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 7px 10px; border-radius: var(--radius-sm);
}
.qc-line:nth-child(odd) { background: var(--surface-2); }
.qc-label { color: var(--ink-2, var(--ink-3)); }
.qc-count {
  font-variant-numeric: tabular-nums; font-weight: 650;
  color: var(--warn-ink);
}
.qc-clear { margin: 0; line-height: 1.55; font-weight: 600; color: var(--good); }
table.plays tr.selected { background: var(--accent-soft) !important; }
table.plays td.players { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.players-more { color: var(--ink-3); font-weight: 600; letter-spacing: 0.05em; }
table.plays td.notes { width: 1%; text-align: center; color: var(--ink-3); }
.note-mark { display: inline-flex; vertical-align: middle; cursor: help; }
.note-mark:hover { color: var(--ink); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.half-divider td {
  background: var(--ink);
  color: var(--on-ink);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 10px;
}

/* ---------- Drawer ---------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 16, 22, 0.42);
  display: flex;
  justify-content: flex-end;
  z-index: 50;
}
.drawer {
  width: min(560px, 100%);
  background: var(--surface);
  height: 100%;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}
.drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.drawer-head h2 { margin: 0; font-size: 16px; }
/*
 * The head's right-hand column: the buttons, and under them anything that
 * marks the record as a whole.
 *
 * Centred against the title while the buttons are all there is; pinned to the
 * top the moment something sits under them, so the row grows downward from
 * the close button rather than pushing it off centre.
 */
.drawer-head-side { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.drawer-head-buttons { display: flex; gap: 4px; }
.drawer-head.has-aside { align-items: flex-start; }
.drawer-body { padding: 20px; flex: 1; }
.drawer-foot {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
  background: var(--surface);
  /*
   * Above the content, the same way the head is.
   *
   * Every `th` in the application is sticky with a z-index of its own, so a
   * table scrolled through the drawer -- the analyser's breakdown, on a play
   * it filled in -- parked its column headings on top of Save and Cancel. The
   * foot was positioned but never given a level, and `z-index: auto` loses to
   * any number at all, whatever the DOM order says. The head has carried a 2
   * since it was written; the foot is the same piece of furniture and gets
   * the same one.
   */
  z-index: 2;
}
.drawer-foot .spacer { margin-left: auto; }

/* Full-screen mode: the drawer takes the viewport and the form's panels flow
   into as many columns as fit, so a long play form stops being a scroll. */
.drawer.expanded { width: 100%; }
.drawer.expanded .drawer-head,
.drawer.expanded .drawer-foot,
.drawer.expanded .drawer-body { padding-left: 28px; padding-right: 28px; }

.drawer-expand { font-size: 15px; line-height: 1; padding: 6px 9px; }

.play-form > .form-panel + .form-panel { margin-top: 4px; }

.drawer.expanded .play-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 4px 32px;
  align-items: start;
  max-width: 1700px;
  margin: 0 auto;
}
/* The roster rows need more room than a single narrow column gives them. */
.drawer.expanded .play-form > .form-panel.wide { grid-column: 1 / -1; }
/* Side by side, a panel's top is the grid's; the stacking margin would drop the
   second one below the first. */
.drawer.expanded .play-form > .form-panel + .form-panel { margin-top: 0; }
/*
 * Situation and The play share their row lines, so a field on the left sits
 * level with the one across from it however tall either side's row is (a hint
 * under Playbook play, a two-line unit button). Both panels are built as the
 * same five rows for this. When the columns stack, each simply keeps its own.
 */
.drawer.expanded .play-form > .form-panel.is-rows {
  display: grid;
  grid-row: span 5;
  grid-template-rows: subgrid;
  row-gap: 0;
  align-content: start;
}
.drawer.expanded .play-form > .form-panel.is-rows > * { align-self: start; min-width: 0; }
.drawer.expanded .play-form > .form-panel.wide .section-title { margin-top: 18px; }
.drawer.expanded textarea { min-height: 96px; }

@media (max-width: 700px) {
  .drawer.expanded .drawer-head,
  .drawer.expanded .drawer-foot,
  .drawer.expanded .drawer-body { padding-left: 16px; padding-right: 16px; }
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  margin: 22px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.section-title:first-child { margin-top: 0; }

/*
 * The highlight mark: one control that is both the switch and its state.
 *
 * A filled star and the word "Highlight" when the play is marked, an outline
 * and "Mark highlight" when it is not -- so the button says what is true now
 * and what clicking it would do, without a separate label to read.
 */
.star-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-3);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.7;
  cursor: pointer;
  white-space: nowrap;
}
.star-toggle .star-glyph { font-size: 13px; line-height: 1; }
.star-toggle:hover { border-color: var(--highlight); color: var(--highlight); }
.star-toggle.is-on {
  border-color: var(--highlight);
  color: var(--highlight);
  background: color-mix(in srgb, var(--highlight) 10%, var(--surface));
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 16, 22, 0.42);
  display: grid;
  place-items: center;
  /*
   * A narrow margin rather than a comfortable one. The gap around a dialog is
   * decoration; the bottom of a dialog is where its buttons are, and a window
   * that spends sixty pixels on breathing room at each end can push the one
   * button somebody came to press off the end of the scroll.
   */
  padding: 12px;
  z-index: 60;
  /*
   * A track that ignores what is in the dialog.
   *
   * The default `auto` track grows to the dialog's max-content width, and a
   * scroll container inside the dialog does not shrink that: the dialog kept
   * its 620 pixels, but the track behind it grew to the width of a 3,300
   * pixel scoreboard strip scrolling inside, and centring a 620 pixel box in
   * a 3,300 pixel track put its left edge 1,400 pixels in -- most of it past
   * the right of the screen, Confirm button included. Measured, not inferred.
   * `minmax(0, 1fr)` is the track's own width whatever the dialog holds.
   */
  grid-template-columns: minmax(0, 1fr);
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: min(520px, 100%);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
}
.modal-head { padding: 18px 20px 0; }
.modal-head h2 { margin: 0 0 4px; font-size: 17px; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }
/*
 * A dialog's boxes at 16px on a touch screen (since 2026-12-03). iPhone Safari zooms the page in on any
 * box under 16px when it's tapped, and a zoomed dialog slides sideways under the finger: Cancel and Add
 * went off the edge of the screen, and a dropdown took several taps to open (Add a player to this play).
 */
@media (pointer: coarse) {
  .modal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
  .modal select, .modal textarea, .modal .input { font-size: 16px; }
}

/* ---------- Toast ---------- */

.toast-root {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 80;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--on-ink);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.18s ease-out;
}
.toast.error { background: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Empty & misc ---------- */

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--ink-3);
}
.empty .big { font-size: 34px; margin-bottom: 10px; }
.empty h3 { margin: 0 0 6px; color: var(--ink); font-size: 15px; }
.empty p { margin: 0 auto 16px; max-width: 380px; font-size: 13px; line-height: 1.5; }

.loading { padding: 40px; text-align: center; color: var(--ink-3); font-size: 13px; }

.bar-list { display: flex; flex-direction: column; gap: 8px; }
.bar-item { display: grid; grid-template-columns: 108px 1fr 46px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-item .track { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar-item .track i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar-item .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

.split-bar { display: flex; height: 26px; border-radius: var(--radius-sm); overflow: hidden; font-size: 11px; font-weight: 650; }
.split-bar i { display: grid; place-items: center; color: #fff; font-style: normal; }
.split-bar i.run { background: var(--offense); }
.split-bar i.pass { background: var(--accent); }

/* ---------- Season report ---------- */

.scope-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 12px;
  color: var(--ink-2);
}
.scope-picker select { width: auto; min-width: 170px; }


.panel-note {
  margin: -4px 0 14px;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.5;
}

/* Findings */
.finding-list { display: flex; flex-direction: column; gap: 10px; }
.finding {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface-2);
}
.finding.major { border-left-color: var(--ink-2); }
.finding-head { display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.finding-gap {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.finding-body { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.5; }

.driver-list { display: flex; flex-direction: column; gap: 6px; }
.driver {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.driver:last-child { border-bottom: none; }
.driver .muted { margin-left: auto; font-size: 12px; }

/* Trends */
.trend-list { display: flex; flex-direction: column; gap: 2px; }
.trend {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.trend:last-child { border-bottom: none; }
.trend-values {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}
.trend-arrow { color: var(--ink-3); font-size: 11px; }

/* Charts */
/*
 * No scroll box around a chart. One that could scroll sideways also scrolled
 * up and down, so a hover tooltip or a bar's value poking a few pixels past
 * the edge put a scrollbar beside the bars. Only a phone is narrow enough for
 * the line chart's minimum width to need the sideways scroll.
 */
.chart-figure { position: relative; }
@media (max-width: 480px) {
  .chart-figure:not(.hbars) { overflow-x: auto; }
}
.chart { width: 100%; min-width: 320px; height: auto; display: block; }
.chart-axis-label { font-size: 11px; fill: var(--ink-3); font-family: var(--font); }
.chart-end-label {
  font-size: 11.5px;
  fill: var(--ink-2);
  font-family: var(--font);
  font-weight: 650;
}
.chart .chart-axis-label, .chart .chart-end-label { font-variant-numeric: tabular-nums; }
.chart rect:focus-visible, .chart circle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.chart-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--ink-2);
}
.chart-legend .key { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .key i { width: 10px; height: 10px; border-radius: 2px; display: block; }

.chart-tip {
  position: absolute;
  transform: translate(-50%, -100%) translateY(-8px);
  background: var(--ink);
  color: var(--on-ink);
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
  box-shadow: var(--shadow);
}

.chart-table { margin-top: 12px; }

/* Share bar */
.share-bar { display: flex; flex-direction: column; gap: 6px; }
.share-track {
  display: flex;
  height: 20px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  gap: 2px;
}
.share-track i { display: block; }
.share-ends {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* Grayscale mode: for pages that should not editorialise with colour. */
/*
 * Us and them, in one grey ramp.
 *
 * The two sides read as a pair rather than as a team colour against a stranger,
 * which is what a comparison is: the same measurement taken twice. Ours is the
 * lighter of the two -- the eye goes to the dark bar, and on a page about how a
 * season is going the number worth looking at is the one you are being beaten
 * by.
 *
 * Both sit clear of the track they run in, which is lighter again.
 */
.neutral .compare .v.left.team-label { color: var(--ink); }
.neutral .compare-row .bar.left i { background: var(--chart-us); }
.neutral .compare-row .bar.right i { background: var(--chart-them); }
.neutral .bar-item .track i { background: var(--ink-2); }
.neutral .split-bar i.run { background: var(--ink-2); }
.neutral .split-bar i.pass { background: var(--ink-3); }
.neutral .tile.win, .neutral .tile.loss { border-left-color: var(--line-strong); }

a.link { color: var(--offense); text-decoration: none; }
a.link:hover { text-decoration: underline; }

/* Film timestamps: subtle in the grid, obviously clickable on hover. */
a.film-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
  padding: 1px 4px;
  margin-left: -4px;
  white-space: nowrap;
}
a.film-link .play-icon {
  font-size: 8px;
  color: var(--accent-text);
  opacity: 0;
  transition: opacity 0.12s ease;
}
a.film-link:hover {
  color: var(--accent-text);
  background: var(--accent-soft);
  text-decoration: underline;
}
a.film-link:hover .play-icon { opacity: 1; }
a.film-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
tbody tr:hover a.film-link .play-icon { opacity: 0.55; }

a.film-jump {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: auto;
  min-height: 0;
  color: var(--accent-text);
  text-decoration: none;
  padding: 0 12px;
  line-height: 1;
}

/* Beside a film time: reads the viewer's position into the box. */
.film-capture { flex: 0 0 auto; height: auto; min-height: 0; padding: 0 10px; line-height: 1; }

@media (max-width: 860px) {
  /*
   * The bar its own height and the page the rest: left to share, a short page
   * gave the bar half the spare height and sat halfway down the screen.
   */
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .app.is-signed-out { grid-template-rows: 1fr; }
  .sidebar { position: static; height: auto; }
  .page { padding: 16px; }
}

/* ---------------------------------------------------------------------------
   Smart Video Analyzer
   --------------------------------------------------------------------------- */

/*
 * Tighter than the rest of the application's panels, on purpose.
 *
 * This dialog is four stacked blocks and a button, and the button is the whole
 * point of it. Every pixel of padding here is a pixel of the Analyze button's
 * chance of being on screen when somebody opens this on a laptop, and padding
 * loses that argument.
 */
.analyze .panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 10px;
}
.analyze .panel:last-child { margin-bottom: 0; }
/*
 * The one panel that is a decision rather than a description, held against the
 * bottom of the scroll so it is on screen whatever is above it. The shadow is
 * what says there is more behind it rather than that the list has ended.
 */
.analyze .panel.is-action {
  position: sticky;
  bottom: -1px;
  z-index: 1;
  background: var(--surface);
  box-shadow: 0 -10px 18px -12px rgb(16 24 40 / 0.28);
}
.analyze .section-title { margin-bottom: 8px; }

.row.gap { display: flex; gap: 10px; align-items: flex-start; }
.row.gap.between { justify-content: space-between; align-items: center; }

/*
 * A setup panel folded to a line while the run has the window.
 *
 * The whole row is the control -- it is one strip of text with nothing else on
 * it to click, and a chevron on the end would be a smaller target for the same
 * job. "Show" is there to say the row does something, not to be aimed at.
 */
/*
 * An offer: the button, and beside it the terms it commits you to.
 *
 * Side by side rather than stacked, so the button is the thing on the row and
 * the words are its footnote. The note takes whatever width is left and wraps
 * there; on a narrow window the row folds and the words go back underneath,
 * which is the only place they fit.
 */
.offer { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.offer > .btn { flex: 0 0 auto; }
/* What is said about the button, in one column beside it (smart-analyze.js offer). */
.offer-text { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.offer-text > .progress { margin: 0; }
/* In the column the note's width basis would become a height: each line takes only its own. */
.offer-text > .offer-note { flex: none; }
.offer-note {
  flex: 1 1 260px;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
}
/* How long a run takes, and that nobody has to watch it. */
.offer-eta {
  margin: 10px 0 0; padding: 8px 11px; border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 13px; line-height: 1.45; color: var(--ink-2);
}

.analyze .panel.is-folded {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 14px;
  background: var(--surface-2);
}
/* The heading at the start of the line is the button now (foldToggle), not the whole line. */
.analyze .panel.is-folded .section-title { margin: 0; flex: 0 0 auto; }
/* The filename is the one part that can be long, so it is the part that gives. */
.fold-say {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/*
 * Show and Hide are the same control in the same place: one is a word inside
 * the folded row, the other a button in the heading of the panel it opens into.
 * They are styled together so that toggling does not move anything.
 */
.fold-more {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--accent-text);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
button.fold-more:hover { text-decoration: underline; }

/* A heading with that control on the end of it. */
.analyze .section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.analyze .section-head .section-title { margin-bottom: 0; }

/* ---------------------------------------------------------------------------
   The banner at the top of the analyzer, and the play it runs

   Three states live in one box of fixed shape: the mark, the mark spinning,
   and the field. Fixed shape because they cross-fade over each other and a
   box that resized between them would shove the whole dialog up and down --
   so the height comes from an aspect ratio and every layer fills it.

   The field's colours are borrowed from the diagram tokens rather than
   reinvented: red is the ball, black is a man's path, and those mean something
   on a whiteboard. The grass is a tint of the interface's own green and not a
   picture of turf -- this sits above a table of results, and a saturated field
   would take the page away from them.
   --------------------------------------------------------------------------- */

.ab {
  --td-carry: #e8112d;
  --td-route: #111111;
  position: relative;
  aspect-ratio: 600 / 135;
  /*
   * The shape comes from the ratio; the floor comes from what is inside it.
   * On a narrow window the ratio alone made the box shorter than the mark, the
   * name and the line under them, and the line was clipped off the bottom.
   */
  min-height: 104px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
}

/* Both layers fill the box; which one is visible is the only thing that moves. */
.ab-plate, .ab .td-svg {
  position: absolute;
  inset: 0;
  transition: opacity 380ms ease;
}
.ab-plate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ab .td-svg { width: 100%; height: 100%; display: block; opacity: 0; }

.ab[data-state="scoring"] .ab-plate { opacity: 0; }
.ab[data-state="scoring"] .td-svg { opacity: 1; }

/*
 * The lockup as the rest of the application draws it, at this size, with the
 * analyser's line beside SPORTS. Perspective on the parent, so the tile turns
 * rather than squashing.
 */
.ab-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  perspective: 420px;
}
.ab-mark { display: block; }

/*
 * The tile turning while the film is read. One axis, no wobble and no easing:
 * a top that slowed down and sped up again would read as a stutter in the work
 * going on behind it, which is the opposite of what it is there to say.
 */
@keyframes ab-spin { to { transform: rotateY(360deg); } }
.ab[data-state="running"] .ab-mark {
  animation: ab-spin 2.8s linear infinite;
  transform-style: preserve-3d;
}

/* The field itself */
.td-grass { fill: color-mix(in srgb, var(--good) 6%, var(--surface)); }
.td-endzone {
  fill: color-mix(in srgb, var(--good) 15%, var(--surface));
  transition: fill 260ms ease;
}
.td-yard { stroke: var(--line); stroke-width: 1; }
.td-hash { stroke: var(--line); stroke-width: 1; }
.td-goal { stroke: var(--line-strong); stroke-width: 2; }
.td-los { stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 6 5; }

/* Painted on the grass: part of the field until it is earned, then lit. */
.td-word {
  /*
   * Sized to the window, not to the end zone. The zone is 200 deep on the field
   * this is drawn on and 135 of that is ever shown, so a word set to fill the
   * zone reads as a word with its ends cut off -- which is exactly how the
   * first version of this came out.
   */
  font: 800 14px/1 var(--font);
  letter-spacing: 0.08em;
  fill: color-mix(in srgb, var(--good) 34%, var(--surface));
  transition: fill 260ms ease;
}

.td-route {
  fill: none;
  stroke: var(--td-route);
  stroke-width: 3.5;
  stroke-linecap: round;
}
.td-carry {
  fill: none;
  stroke: var(--td-carry);
  stroke-width: 4;
  stroke-linecap: round;
}
.td-flight {
  stroke: var(--td-carry);
  stroke-width: 2.5;
  stroke-dasharray: 9 7;
  stroke-linecap: round;
}

.td-mark {
  /* The same token the play diagrams use, so both react to a theme together. */
  fill: var(--dg-player, #ffffff);
  stroke: var(--td-route);
  stroke-width: 2.5;
  filter: drop-shadow(0 2px 2px rgb(0 0 0 / 0.22));
}
.td-letter { font: 700 10px/1 var(--font); fill: var(--td-route); }
.td-cross { stroke: var(--dg-assign, #8b8b8b); stroke-width: 3.5; stroke-linecap: round; }
.td-flash { fill: none; stroke: var(--td-carry); stroke-width: 2.5; }
.td-tip { fill: var(--td-carry); opacity: 0; }

/* The end zone lights up, and the word on it stops being paint. */
.td-svg.is-scored .td-endzone { fill: var(--accent-soft); }
.td-svg.is-scored .td-word { fill: var(--accent); }

/*
 * Asked for less motion: the ball stands still and the play is already over.
 * The cross-fades stay -- an element appearing is not the kind of movement the
 * setting is about, and cutting between the two layers would be harsher than
 * the fade it replaced.
 */
@media (prefers-reduced-motion: reduce) {
  .ab[data-state="running"] .ab-mark { animation: none; }
  .td-endzone, .td-word { transition: none; }
}

/* Metadata about the linked film: label over value, wrapping as it needs to. */
/* One row, always. Five of these six values are short and fixed-width, so they
   take their natural size; the filename is the only variable one and is the
   only cell allowed to flex and truncate. Its full text stays on hover. */
.meta-grid {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  overflow-x: auto;
}
.meta-cell { flex: 0 0 auto; min-width: 0; }
.meta-cell:first-child { flex: 1 1 90px; }
.meta-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); white-space: nowrap; }
.meta-value {
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* A statement about the run rather than about the app: what an engine is, what
   it is measured to do, why something failed. */
.notice {
  margin-top: 10px;
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
}
.notice.good { border-color: color-mix(in srgb, var(--good) 35%, var(--line)); }
.notice.bad  { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); color: var(--bad); }

.progress {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
  margin: 12px 0;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/*
 * The same bar with nothing to measure: work with no percentage to report.
 *
 * Used while a film is searched for its scoreboard, which samples frames
 * across the whole film and either finds one or does not. A determinate bar
 * there would be inventing a number; a stripe travelling the track says
 * "working" and claims nothing else.
 */
.progress.is-seeking .progress-bar {
  width: 32%;
  transition: none;
  animation: seeking 1.5s ease-in-out infinite;
}
@keyframes seeking {
  0% { margin-left: -32%; }
  100% { margin-left: 100%; }
}
/* Somebody who has asked for less movement gets a still bar that still reads
 * as occupied, rather than a track that looks finished. */
@media (prefers-reduced-motion: reduce) {
  .progress.is-seeking .progress-bar { animation: none; width: 100%; opacity: 0.45; }
}

/* The diagnostic trail, folded away until someone wants it. */
details.log { margin-top: 10px; }
details.log summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-3);
  user-select: none;
}
.log-body {
  margin-top: 8px;
  max-height: 180px;
  overflow-y: auto;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 10px;
}
.log-line {
  display: flex;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-2);
}
.log-level {
  flex: 0 0 auto;
  width: 42px;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
  padding-top: 2px;
  color: var(--ink-3);
}
.log-level[data-level='error'] { color: var(--bad); }
.log-level[data-level='warn']  { color: var(--ink-1); }

table.mini { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 12.5px; }
table.mini th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  padding: 4px 8px 4px 0;
  border-bottom: 1px solid var(--line);
}
table.mini td { padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); }
table.mini .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Drilldown models: one block per installed version. */
.model-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
}
.model-row.active { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.model-caps { font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.model-row table.mini { margin-top: 10px; }

/* The wordmark lockup at the top of the sidebar. The mark inherits the sidebar's
   text colour, so it needs no second asset for the dark ground. */
/*
 * User Mode / Admin Mode, under the logo in the Admin Portal.
 *
 * Two halves of one control: each names a place, so it says where you can go
 * as well as where you are. Sized down and quiet -- it is a thing somebody
 * uses twice a day, not a thing they look at.
 */
.portal-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  /*
   * Beneath the logo, not beside it. The brand row is a flex line, so the
   * toggle claims the whole width and pushes itself onto the next one --
   * which is where it belongs: it is about the page, not about the mark.
   */
  flex: 0 0 100%;
  margin-top: 10px;
  padding: 2px;
  border-radius: 7px;
  background: var(--sidebar-raise);
}
.portal-modes button {
  border: 0;
  padding: 5px 4px;
  border-radius: 5px;
  background: transparent;
  color: var(--sidebar-ink-dim);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.portal-modes button:hover { color: var(--sidebar-ink); }
.portal-modes button.is-on {
  background: var(--sidebar-edge);
  color: #fff;
}
.portal-modes button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/*
 * Mark and name as one thing, not two things side by side.
 *
 * No gap at all, which is not as tight as it sounds. The football is drawn
 * 20 units wide inside a 32-unit box, so at a 30px mark there is already
 * about 5px of empty box to the right of the ball's widest point. Setting the
 * gap to zero closes the space the box was wasting and leaves the space the
 * drawing itself provides -- the D lands just past the curve, where the ball
 * has already begun falling away from it.
 *
 * The mark rides taller than the capitals on purpose: 22.5px of football
 * against 16.5px of cap. It reads as an emblem the name is set against rather
 * than as a word with a picture in front of it, which is the point of making
 * it bigger. Tracking stays tight so the name holds together under it.
 */
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-lockup .logo-mark, .brand-lockup .logo-tile { flex: 0 0 auto; display: block; }
/*
 * The name: condensed and heavy, DRILL in the colour of the ground and DOWN in
 * the brand red -- the same #c8102e as the tile beside it, on every ground.
 */
.wordmark {
  font-family: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1;
}
.wordmark > span { color: var(--accent); }
/*
 * The sidebar's lockup: the red tile, DRILL in white, DOWN in the brand red.
 * One red -- #c8102e, the tile's -- rather than a lighter one for the slate:
 * the tile carries the mark on any ground, so the red never has to change.
 */
/*
 * Semibold, not bold, so the name sits at the mark's weight.
 *
 * The football is drawn at 2.4 in a 32-unit grid, which is 1.65px on screen at
 * 22px. Bold put 3.75px of stem beside it -- more than twice the line it was
 * standing next to. The mark could not come up to meet it without losing the
 * three rules inside the ball, so the name comes down instead, which costs
 * nothing but a digit.
 */
.brand-word { font-weight: 600; font-size: 24px; letter-spacing: -0.02em; line-height: 1; }
.brand .wordmark { font-size: 27px; color: #fff; }
/*
 * The Drilldown Sports lockup (logoLockup()), wherever the logo and the name are
 * together. Each place sets the lockup's font-size and colour; nothing else.
 *
 * Everything is in em of the lockup's font-size -- the name's type size -- so
 * one number sizes it. The tile is 1em square with its top level with the top
 * of DRILLDOWN's line, which at line-height .9 centres it on the capitals.
 * SPORTS sits under DRILL at a third of the size, each letter its own box,
 * spread so the S starts under the D and the last S ends under the second L.
 */
.brand-lockup.has-sports { align-items: flex-start; gap: 0.21em; }
.brand-lockup.has-sports .logo-tile { width: 1em; height: 1em; }
.brand-lockup.has-sports .wordmark.has-sports {
  display: inline-grid; grid-template-columns: auto auto; row-gap: 0.096em;
  font-size: 1em; line-height: 0.9; letter-spacing: 0.03em; white-space: nowrap;
}
.wordmark.has-sports > b { font-weight: inherit; }
/* DRILL's box ends with the tracking after its L; the margin takes it back so SPORTS ends at the L. */
.wordmark > .wm-sports {
  grid-column: 1; display: flex; justify-content: space-between; margin-right: 0.03em;
  line-height: 1; color: color-mix(in srgb, currentColor 72%, transparent);
}
.wm-sports i { font: normal 600 0.327em/1 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif; letter-spacing: 0; }
/*
 * A line beside SPORTS, under DOWN (logoLockup({ aside })), the analyzer's
 * "with X Factor (AI)": SPORTS' size and line, a step clear of its last S, and
 * tracked so it ends under the N -- the tracking is what that takes at this
 * size, in em, so it holds at every size. "with" quiet and as written; the
 * rest in the brand red, the same as DOWN.
 */
.brand-lockup.has-sports .wordmark > .wm-aside {
  grid-column: 2; grid-row: 2; justify-self: start;
  font: 600 0.327em/1 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  letter-spacing: 0.047em; margin-left: 0.35em; margin-right: -0.047em;
  color: var(--accent);
}
.wm-aside .wm-with { text-transform: none; color: var(--ink-3); }
/* 28px: the tile and the name as large as they go with « beside them on the one line. */
/* 28px: the tile and the name as large as they go with « beside them on the one line. */
.brand .brand-lockup.has-sports { font-size: 28px; color: #fff; }
.si-brand .brand-lockup.has-sports { font-size: 32px; color: var(--ink); }
.rsvp-brand .brand-lockup.has-sports { font-size: 28px; color: var(--ink); }
/* The perspective the tile turns in (.ab-mark), on its own parent now. */
.ab .brand-lockup.has-sports { font-size: 52px; color: var(--ink); perspective: 420px; }
.import-reading-card .ab .brand-lockup.has-sports { font-size: 44px; }
@media (max-width: 420px) {
  .import-reading-card .ab .brand-lockup.has-sports { font-size: 34px; }
}
/* The brand's card in the Admin Portal's logo gallery takes the whole row: the lockup is wide. */
.logo-card.is-brand { grid-column: 1 / -1; }
.logo-ground .brand-lockup.has-sports { font-size: 34px; }
.logo-ground.is-light .brand-lockup.has-sports { color: #181c22; }
.logo-ground.is-dark .brand-lockup.has-sports { color: #fff; }

/* An input and its button as a single control. Stretching the row means the
   button inherits the input's height instead of being nudged level with it —
   the previous hand-alignment sat 12px low, because the label's bottom margin
   is part of the column that flex-end was measuring against. */
.input-with-button { display: flex; align-items: stretch; gap: 8px; }
.input-with-button > input { flex: 1; min-width: 0; width: auto; }
.input-with-button > .btn { flex: 0 0 auto; }

/* ---------------------------------------------------------------------------
 * Play diagrams
 *
 * The drawing keeps its own colour tokens rather than borrowing the interface's.
 * Red for the ball and black for motion are the coaching convention -- they mean
 * something on a whiteboard -- so they must not shift when the surrounding
 * palette is retuned. The field, by contrast, is chrome and follows the theme.
 * ------------------------------------------------------------------------- */
.dg {
  --dg-carry: #e8112d;
  --dg-motion: #111111;
  --dg-assign: #8b8b8b;
  --dg-line: #cbd1da;
  --dg-ghost: #b3b8c0;
  --dg-ink: #111111;
  --dg-player: #ffffff;
  display: block;
  width: 100%;
  height: auto;
  /*
   * White in the dark theme too. The marks are a whiteboard's -- black motion,
   * a red carrier, labels inside white players -- and on a dark field the
   * black would vanish. Kept as a lit board, the way a photo stays a photo.
   */
  background: #ffffff;
  border-radius: 6px;
}
.dg .dg-label { font: 600 15px/1 ui-sans-serif, system-ui, sans-serif; }
/*
 * A third character does not fit any of the marks at full size. It sets smaller
 * rather than the marks growing, because a mark's size is set by the distance
 * between the men either side of it and a letter is not a reason to move them.
 */
.dg .dg-label.is-tight, .dg .dg-name.is-tight { font-size: 11.5px; }
/*
 * A name written outside the mark rather than in it, which is where a
 * defender's goes: a cross has no inside. Lighter than the letter in a circle,
 * because at a glance the shapes should still be what reads first.
 */
.dg .dg-name { font: 600 12px/1 ui-sans-serif, system-ui, sans-serif; }
.dg .dg-gap { font: 400 15px/1 ui-serif, Georgia, serif; fill: var(--ink-3); }
.dg .dg-text {
  font: 700 17px/1 ui-serif, Georgia, serif;
  fill: var(--dg-ink);
  letter-spacing: 0.02em;
}
.dg .dg-player { filter: drop-shadow(0 2px 2px rgb(0 0 0 / 0.28)); }
.dg .dg-player.is-ghost { filter: none; }
.dg.is-interactive .dg-player { cursor: grab; }
.dg.is-interactive .dg-player:active { cursor: grabbing; }

.dg-frame { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.dg-frame.is-thumb { pointer-events: none; }

/* The editor */
.pm-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 208px; gap: 14px; align-items: start; }

/*
 * The settings that describe the field rather than the work: how deep the
 * quarterback stands, how much open field there is, whether the gaps are
 * numbered, and where the ball goes. Set once and left, so they sit beside the
 * picture they describe instead of in the bar of things reached for every few
 * seconds. The football is last because it is the last thing done: the players
 * go down, they get their assignments, and then the ball is put on them.
 */
/*
 * Parked under the bar rather than at the top of the window, so the two do not
 * overlap. The height comes from the bar itself, measured as it changes: it is
 * two rows on a play and one on a formation, and guessing would leave a gap on
 * one of them and a collision on the other.
 */
.pm-side {
  --pm-control: 24px;
  display: flex; flex-direction: column; gap: 10px;
  position: sticky; top: calc(var(--pm-bar-h, 0px) + 12px);
  /*
   * Never taller than the room left under the bar. Without this the column is
   * as tall as the play beside it, which leaves it nothing to travel through --
   * a sticky box that already fills its own row can never come unstuck from it.
   */
  max-height: calc(100vh - var(--demo-bar-h) - var(--pm-bar-h, 0px) - 28px);
  overflow-y: auto;
}
.pm-side .pm-group { padding: 7px 9px 9px; }
.pm-side .pm-group h4 { margin-bottom: 6px; }
.pm-side .pm-btns { gap: 4px; }
.pm-side .pm-btns button { flex: 0 0 auto; min-width: 0; padding: 4px 7px; font-size: 11.5px; }
.pm-side .pm-hint { font-size: 11.5px; }
.pm-side .pm-group > * + * { margin-top: 6px; }
/* The labels in the side column share a width, the same as the ones in the
   bar do, so the boxes beside them line up down the group. */
.pm-side .pm-inline { width: 100%; }
.pm-side .pm-inline > span { min-width: 66px; }
.pm-side .pm-inline > select { flex: 1 1 auto; width: auto; min-width: 0; }

/*
 * A switch, for the things that are simply on or off.
 *
 * A pressed button says the same and says it in the same red as every other
 * pressed button, so a coach has to work out that this one is a state rather
 * than an action. A switch is only ever a state.
 */
.pm-switch {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 11.5px; color: var(--ink-2);
}
.pm-track {
  position: relative; flex: 0 0 auto;
  width: 30px; height: 17px; border-radius: 999px;
  background: var(--line-strong); transition: background 120ms ease;
}
.pm-knob {
  position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  transition: transform 120ms ease;
}
/* A switch that is on is green, as on a phone (since 2026-11-30). */
.pm-switch[aria-checked="true"] .pm-track { background: #34c759; }
.pm-switch[aria-checked="true"] .pm-knob { transform: translateX(13px); }
.pm-switch:disabled { cursor: default; color: var(--ink-3); }
.pm-switch:disabled .pm-track { background: var(--line); }

@media (prefers-reduced-motion: reduce) {
  .pm-track, .pm-knob { transition: none; }
}

/*
 * Every control, across the top, in fixed groups.
 *
 * They used to be a column beside the field that appeared and vanished as the
 * selection changed, so the panel a coach reached for was rarely the panel that
 * was there. Groups wrap rather than scroll: a control below the fold is only
 * a slower kind of hidden.
 */
/*
 * Stuck to the top, because a control a coach has scrolled past is hidden
 * again -- which was the whole complaint. The play runs under it.
 *
 * The negative inline margin pulls the background out to the card's edges: the
 * card body is padded, and without it the play would show through the gutters
 * either side as it scrolled beneath.
 */
/* Under the demo's strip when the window is what scrolls; see --demo-bar-h. */
html:not(.fill-page) .pm-bar { top: var(--demo-bar-h); }
html:not(.fill-page) .pm-side { top: calc(var(--demo-bar-h) + var(--pm-bar-h, 0px) + 12px); }
.pm-bar {
  position: sticky; top: 0; z-index: 5;
  background: var(--surface);
  /* Close under the name row: the bar's own border already separates it from
     the play, and a rule as well was a line drawn to say what the gap said. */
  margin-inline: -16px; padding: 6px 16px 10px;
  border-bottom: 1px solid var(--line);
  /*
   * Flex, not a grid of equal columns. The grid gave every group the same width
   * whether it wanted it or not, which left dead space beside the narrow ones;
   * growing to fill the row leaves none.
   *
   * Not stretched, though: matching every group in a row to the tallest of them
   * only moves the waste inside the boxes, where it is emptier still.
   */
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: flex-start; margin-bottom: 14px;
  /*
   * One height for every control in the bar. A button and a text box are built
   * differently enough that the same padding gives two different heights, and
   * two pixels out is exactly the sort of thing that reads as untidy without
   * anyone being able to say why.
   */
  --pm-control: 24px;
}
/*
 * A basis well under the row width, so several groups share a row and then grow
 * to fill it. Sized from their content instead, each one asked for the whole
 * row and took it.
 */
.pm-bar .pm-group { flex: 1 1 240px; padding: 7px 9px 9px; }

/*
 * The Player group in two columns: who he is on the left, what he is called on
 * the right. The labels share a width so the boxes beside them line up, which
 * is the whole reason a column reads as a column.
 */
.pm-cols { display: flex; gap: 12px; align-items: flex-start; }
/*
 * The column is as wide as its last row -- Delete, Finish, Cancel side by
 * side -- and nothing wider. The boxes above take whatever that leaves after
 * their labels, so Name, Color and Extra all end where Cancel does: one right
 * edge down the column, and no box longer than the buttons under it.
 */
.pm-stack { display: flex; flex-direction: column; gap: 4px; align-items: stretch; width: min-content; }
.pm-stack > .pm-btns { justify-content: flex-start; flex-wrap: nowrap; }
.pm-stack > .pm-inline { display: flex; }
/*
 * The cells at the end of a grid's last row: Finish and Cancel in Draw,
 * Finish and Close in Selected line. They take the last two columns of
 * whatever row comes next, so they sit at the group's right edge on the same
 * row as the last of its buttons rather than a row below them.
 */
.pm-btns > .pm-row-end { grid-column: -3 / -1; justify-content: flex-end; flex-wrap: nowrap; }
.pm-btns.is-triples > .pm-row-end button,
.pm-btns.is-quads > .pm-row-end button { width: auto; text-align: center; }
/* The Circle's swatch is a ring, the way a zone is drawn. */
.pm-swatch.is-ring { background: transparent; border: 1.5px solid; border-radius: 50%; box-sizing: border-box; }
/* The pair that ends a group sits at the right of what it ends. */
.pm-btns.is-quads + .pm-btns,
.pm-btns.is-triples + .pm-btns,
.pm-btns.is-pairs + .pm-btns { justify-content: flex-end; }
.pm-stack > .pm-inline > span { min-width: 38px; }
/*
 * Every box in the column to one width, so it has one edge down both sides.
 * The width is what the buttons under them leave. `min-content` on the column
 * is what makes that so: a box's own size still counts towards a column sized
 * to fit its contents, but a box that may shrink to nothing adds nothing to
 * its narrowest, and the buttons, which do not wrap, are what is left.
 */
.pm-stack > .pm-inline > input.input,
.pm-stack > .pm-inline > select { width: 0; flex: 1 1 0; min-width: 0; }


/* Smaller here than in a panel: ten groups of controls only fit if each one
 * takes the room it needs and no more. */
.pm-bar .pm-btns { gap: 4px; }
.pm-bar .pm-group > .pm-btns + .pm-btns { margin-top: 4px; }
.pm-bar .pm-btns button { height: var(--pm-control); padding: 0 7px; font-size: 11.5px; }
.pm-bar .pm-hint { font-size: 11.5px; }
.pm-bar .field > label, .pm-bar label { font-size: 10px; }

/*
 * In the bar a button is its own width. Stretching them to fill made every
 * group as tall as the widest one, which is how ten groups became a wall a
 * coach had to scroll past to reach the field.
 */
.pm-bar .pm-btns button { flex: 0 0 auto; min-width: 0; }
/*
 * One row rhythm across the whole bar.
 *
 * A heading occupies exactly one row of it -- a control's height plus the gap
 * that follows every other row -- so a group without one simply starts a row
 * higher and everything below still lines up: Select where a heading would be,
 * then Add player level with Lineman and with Name, all the way down.
 *
 * The text sits at the bottom of that row so it stays close to what it labels.
 */
.pm-bar .pm-group h4 {
  height: var(--pm-control); margin: 0 0 4px;
  display: flex; align-items: flex-end;
}

/* Controls that belong to one thought, read across rather than down. */
.pm-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; }
.pm-row > * { margin: 0; }
/*
 * The name box, sized to what goes in it: three characters, at the height of
 * the buttons it sits among. Its label reads across rather than stacking above,
 * so the pair is one more control on the row instead of a column of its own.
 *
 * No placeholder either -- an empty box with grey example text in it looks like
 * a box with something already in it, and this one is three characters wide.
 */
.pm-inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.pm-inline > span {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--ink-2);
}
.pm-inline > input.input, .pm-inline > select {
  height: var(--pm-control); padding: 0 7px; font-size: 11.5px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}
.pm-inline > input.input { width: 46px; text-align: center; }
/*
 * Off looks off, box or dropdown alike. The rule that gave these their size
 * also gave them a background, which was specific enough to beat the general
 * disabled styling -- so the name box sat there looking typeable beside two
 * greyed dropdowns that were not.
 */
.pm-inline > input.input:disabled,
.pm-inline > select:disabled {
  background: var(--surface-2); border-color: var(--line); color: var(--ink-3);
  cursor: default;
}

/*
 * A group that does not apply now still says where it lives. Muted rather than
 * faded to nothing: being told a thing exists but is not for this moment is
 * worth more than being told nothing at all.
 */
.pm-group.is-off { background: var(--surface-2); border-style: dashed; }
.pm-group.is-off h4 { color: var(--ink-3); }
.pm-group.is-off .pm-hint { color: var(--ink-3); }

/* The tags: touched twice a play, so they sit out of the way. */
.pm-foot { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; margin-top: 16px; }
.pm-foot > *:first-child { flex: 1 1 260px; max-width: 420px; }
.pm-group { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.pm-group h4 {
  margin: 0 0 8px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.pm-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-btns button {
  flex: 1 1 auto; min-width: 62px; padding: 6px 8px; font-size: 12px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface);
  color: var(--ink-2);
}
.pm-btns button:hover { background: var(--surface-2); }

/*
 * One under another, all the width of the longest label.
 *
 * `fit-content` sizes the column to its widest child and `stretch` then gives
 * every other child that same width, so the set matches without any of them
 * being measured or a width being typed in that would go stale the moment a
 * label changed.
 */
.pm-btns.is-stacked { flex-direction: column; align-items: stretch; width: fit-content; }

/*
 * Two by two, on the same row rhythm as everything else in the bar. Both
 * columns take the width of the widest button so the block has two clean edges
 * rather than six buttons ending wherever their labels happen to.
 */
.pm-btns.is-pairs {
  display: grid; width: fit-content; gap: 4px;
  grid-template-columns: repeat(2, minmax(max-content, 1fr));
}
/*
 * Left, not centred. The buttons are all one width because the block wants two
 * edges, but that width is the longest label's -- centring the shorter ones in
 * it scatters the swatches across the column and there is nothing left to read
 * down.
 */
.pm-btns.is-pairs button { width: 100%; text-align: left; }

/*
 * Three across, for Draw.
 *
 * Seven buttons in two columns ran four rows deep and left the box hanging
 * below the ones beside it. Three columns bring it to three rows, level with
 * Player and Selected line. Nine buttons fill the grid exactly, in the order
 * DRAW_LAYOUT in views/playmaker.js writes them, so nothing is placed by hand.
 */
.pm-btns.is-triples {
  display: grid; width: fit-content; gap: 4px;
  grid-template-columns: repeat(3, minmax(max-content, 1fr));
}
.pm-btns.is-triples button { width: 100%; text-align: left; }

/* The same idea four across, for a group with more to say. */
.pm-btns.is-quads {
  display: grid; width: fit-content; gap: 4px;
  grid-template-columns: repeat(4, minmax(max-content, 1fr));
}
.pm-btns.is-quads button { width: 100%; text-align: left; }

/* A group that wants to be its contents' size, not a share of the row. */
.pm-bar .pm-group.is-snug { flex: 0 0 auto; }
.pm-btns.is-stacked button { text-align: center; }
.pm-btns button[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}

/*
 * Switched off, in colour rather than in opacity.
 *
 * Fading the whole button was the quick way and it was wrong twice: text at
 * 45% is hard to read whatever it sits on, and a red button faded to 45% is a
 * hollow red outline that still shouts for attention while saying nothing.
 * Muted ink on a muted ground stays legible and stops asking.
 */
.pm-btns button:disabled, .pm-btns button:disabled:hover {
  cursor: default;
  background: transparent;
  border-color: var(--line);
  color: var(--ink-3);
}

/*
 * Off is off, and every button off looks the same.
 *
 * Two goes were spent trying to keep the current choice legible while the row
 * was disabled -- first white, then a grey fill -- and both had the same fault:
 * a button that looks different looks like it does something different. A row
 * nobody can press has nothing to say about which of them is current, so it
 * says nothing, and the whole row reads as one dead thing.
 */
.pm-btns button[aria-pressed="true"]:disabled,
.pm-btns button[aria-pressed="true"]:disabled:hover {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-3);
  font-weight: 400;
}

/* Including the colour chips: a vivid square is the loudest thing in a row
 * that is meant to be quiet. */
.pm-btns button:disabled .pm-swatch { filter: grayscale(1); opacity: 0.5; }

/* The same for a box that cannot be typed in: greyed, not merely inert. */
.input:disabled, select:disabled {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink-3);
  cursor: default;
}
.pm-hint { font-size: 12px; color: var(--ink-2); line-height: 1.5; margin: 0; }
.pm-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

@media (max-width: 900px) {
  .pm-wrap { grid-template-columns: minmax(0, 1fr); }
  .pm-side { position: static; flex-direction: row; flex-wrap: wrap; }
}

/* Playbook list */
.pb-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.pb-card {
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  overflow: hidden; display: flex; flex-direction: column;
}
.pb-card .pb-head { padding: 10px 12px 4px; }
.pb-card h3 { margin: 0; font-size: 14px; }
.pb-card .pb-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.pb-card .pb-acts { display: flex; gap: 6px; padding: 8px 12px 12px; margin-top: auto; flex-wrap: wrap; }
/* Admin › Playmaker: a play already in the Drilldown playbook says so where its Add button would be. */
.op-in { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.pb-card .pb-note { padding: 0 12px; }
/* A Playmaker card's state: Draft until published into the playbook, with the button that changes it. */
.pb-card .pb-publish { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 0; }
.pb-publish-state {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
}
.pb-publish.is-draft .pb-publish-state { color: var(--ink-2); background: var(--surface-2); }
.pb-publish.is-published .pb-publish-state { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.pb-grid.is-sm .pb-card .pb-publish { padding: 6px 8px 0; flex-wrap: wrap; gap: 4px; }
.pb-grid.is-sm .pb-card .pb-publish .btn { padding: 3px 7px; font-size: 11px; }

/*
 * The Playmaker card's buttons, all one size.
 *
 * Every button is as wide as "Duplicate", the longest label, without a width
 * typed in anywhere: a hidden copy of that word sits in a zero-height second
 * row of each button, so its column is the wider of the two. Change the font
 * or the label and the width follows. They still wrap on a narrow card.
 */
.pb-acts.is-even .btn {
  display: inline-grid;
  grid-template-rows: auto 0;
  gap: 0;
  justify-items: center;
  align-content: center;
}
.pb-acts.is-even .btn::after {
  content: 'Duplicate';
  grid-row: 2;
  grid-column: 1;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: 600;
}

/*
 * Card size on the Playmaker list: three, five or eight across.
 *
 * The counts are fixed rather than fitted, because "five across" is the thing
 * being asked for -- but only while five across is readable. Below the widths
 * underneath, each size falls back to fitting as many as the screen can hold,
 * so a narrow window shows small cards rather than eight slivers.
 */
.pb-grid.is-lg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pb-grid.is-md { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pb-grid.is-sm { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }

/* Eight across is a thumbnail, so the chrome around the picture gives way. */
.pb-grid.is-sm .pb-card h3 { font-size: 12.5px; }
.pb-grid.is-sm .pb-card .pb-head { padding: 8px 8px 3px; }
.pb-grid.is-sm .pb-card .pb-teams,
.pb-grid.is-sm .pb-card .pb-note { padding: 0 8px; }
.pb-grid.is-sm .pb-card .pb-meta { font-size: 11px; }
.pb-grid.is-sm .pb-card .pb-acts { padding: 6px 8px 8px; gap: 4px; }
.pb-grid.is-sm .pb-card .pb-acts .btn { padding: 3px 7px; font-size: 11px; }

@media (max-width: 1500px) { .pb-grid.is-sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
@media (max-width: 1150px) { .pb-grid.is-md { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
@media (max-width: 780px)  { .pb-grid.is-lg { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }

/* Animation player */
.anim-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.anim-bar input[type="range"] { flex: 1; }
.anim-time { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--ink-2); min-width: 78px; white-space: nowrap; }


/* Team chips on a play card, and the assignment picker */
.pb-teams { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 12px; }
.pb-chip {
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  padding: 2px 7px; border-radius: 999px; text-decoration: none;
  background: var(--accent-soft); color: var(--accent-text); border: 1px solid transparent;
}
.pb-chip:hover { border-color: var(--accent); }
.pb-chip.is-none {
  background: transparent; color: var(--ink-3); border: 1px dashed var(--line-strong);
  font-weight: 400;
}

.pick-list { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.pick-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 11px; cursor: pointer;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.pick-row:last-child { border-bottom: 0; }
.pick-row:hover { background: var(--surface-2); }
.pick-row.is-already { cursor: default; color: var(--ink-3); }
.pick-row.is-already:hover { background: transparent; }
.pick-name { font-weight: 500; }
.pick-meta { margin-left: auto; font-size: 12px; color: var(--ink-3); }

/* Who on the roster can open the team (components/roster-access.js). */
.access-list { display: grid; gap: 4px; }
.access-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.access-list .access-row:last-child { border-bottom: 0; }
.access-name { font-weight: 600; }
.access-name .badge { margin-left: 4px; font-weight: 600; }
.access-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.access-record { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); margin-right: 4px; }
.access-group { margin: 12px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
tr.access-others-head td { background: var(--surface-2); padding-top: 12px; }

/* Admin › Library › Test accounts (views/admin-library.js). */
.test-accounts { display: grid; gap: 12px; margin-bottom: 16px; }
.test-accounts-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 14px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); }
.test-accounts td { vertical-align: middle; white-space: nowrap; }
.test-accounts code { font-size: 13px; }
.test-pw { display: inline-flex; gap: 4px; align-items: center; }

/* The film locker on Basic and Plus (views/film-locker.js). */
.locker-meter { margin-top: 8px; width: min(260px, 100%); height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.locker-meter i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.locker-note { margin: 0 0 12px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); font-size: 14px; line-height: 1.5; }
.locker-note.warn { background: var(--warn-bg); border-color: var(--warn); color: var(--warn-ink); }
.locker-list { display: grid; }
.locker-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.locker-row:last-child { border-bottom: 0; }
.locker-name { font-weight: 600; }
.locker-name .badge { margin-left: 6px; }
.locker-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.locker-video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border: 0; border-radius: 8px; }
.locker-how, .locker-replace { display: grid; gap: 8px; margin: 12px 0; }
.locker-how label, .locker-replace label { display: flex; gap: 6px; align-items: baseline; font-size: 14px; }
.locker-replace p { margin: 0; line-height: 1.5; }
.locker-replace-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* A film's controls in the locker, on one line at the row's end: Watch, Download, Replace, Remove. */
.locker-row-acts { text-align: right; white-space: nowrap; }
.locker-row-acts .btn + .btn { margin-left: 6px; }
.locker-upsell { margin: 14px 2px 0; font-size: 14px; color: var(--ink-2); }

/* A value the form shows but does not ask for: the team's level on Basic and Plus. */
input.is-fixed { background: var(--surface-2); color: var(--ink-2); cursor: default; }

/* Basic and Plus's Games page: the locker beside the heading, and each row's buttons. */
.games-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.locker-summary { display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.locker-summary .locker-meter { margin-top: 0; }
.locker-summary-note { font-size: 12.5px; margin-top: 2px; }
.locker-dialog-counts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 12px; font-size: 13.5px; color: var(--ink-2); }
.game-row-acts { text-align: right; white-space: nowrap; }
.game-row-acts .btn + .btn { margin-left: 6px; }

/* A game on Basic and Plus (views/game-lite.js). */
.game-lite .card + .card { margin-top: 14px; }
.game-lite-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.game-lite .card-head .game-lite-acts { justify-content: flex-end; }
.game-lite-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.game-lite-title .badge { font-size: 15px; padding: 3px 10px; }
/* The film as large as the window allows: 16:9, no taller than what is left below the heading. */
.game-lite .locker-video { width: min(100%, calc((100vh - 240px) * 16 / 9)); margin: 0 auto; }
.game-lite-source { margin: 8px 0 0; font-size: 13px; }

/*
 * Drilldown's plays, chosen by picture (components/play-library.js). The
 * grid scrolls inside the dialog so the filters and the Add button stay put.
 */
.lib { display: grid; gap: 12px; }
.lib-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lib-all { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.lib-grid {
  display: grid; gap: 12px; padding: 2px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  /*
   * Full-height rows. In a grid that scrolls, rows otherwise shrink to their
   * minimum -- and a clipped picture's minimum is nothing.
   */
  grid-auto-rows: max-content; align-content: start;
  max-height: min(62vh, 640px); overflow-y: auto;
}
.lib-card > .dg-frame { flex: none; }
.lib-new {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; vertical-align: 1px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--accent); color: #fff;
}
/* New plays and new formations, each under its own heading across the grid. */
.lib-section { grid-column: 1 / -1; margin: 6px 0 -4px; font-size: 13px; color: var(--ink-2); }
.lib-section:first-child { margin-top: 0; }
/* The announcement: a strip of what has arrived. */
.lib-news { display: grid; gap: 12px; }
.lib-news-strip { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.lib-news-item { margin: 0; }
.lib-news-item figcaption { margin-top: 4px; font-size: 12px; font-weight: 600; }
.lib-card {
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  overflow: hidden; display: flex; flex-direction: column; cursor: pointer;
}
.lib-card:hover { border-color: var(--ink-3); }
.lib-card.is-picked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.lib-card.is-have { cursor: default; opacity: 0.6; }
.lib-head { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px 2px; }
.lib-head input { margin-top: 3px; flex: none; }
.lib-name { font-weight: 600; font-size: 14px; }
.lib-meta { font-size: 12px; color: var(--ink-3); }
.lib-notes { margin: 2px 10px 10px; font-size: 12px; line-height: 1.4; color: var(--ink-2); }
.lib-foot { display: flex; gap: 8px; align-items: center; }
.lib-count { margin-right: auto; font-size: 13px; color: var(--ink-3); }

.pm-team {
  display: block; font-size: 12px; padding: 5px 8px; border-radius: 5px;
  text-decoration: none; color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--line);
}
.pm-team:hover { border-color: var(--accent); color: var(--accent-text); }

/*
 * The playback window.
 *
 * Capped by height rather than width: the diagram is 16:9, so a window sized
 * only by width runs off a laptop screen and puts the transport controls below
 * the fold, which is where the Play button is. Bounding the width by the height
 * it implies keeps the whole thing on screen at any window size.
 */
.dg-frame.is-playback { margin: 0 auto; }   /* max-width is set per play, from its own aspect */
.dg-frame.is-playback .dg { width: 100%; height: auto; }
.anim-bar .btn { min-width: 84px; }

.dg .dg-ball { filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.35)); }

/* Editing a drawn route */
.dg .dg-path.is-selected { filter: drop-shadow(0 0 4px var(--accent)); }
.pm-handle {
  fill: var(--surface); stroke: var(--accent); stroke-width: 4; cursor: grab;
}
.pm-handle:hover { fill: var(--accent); }
.pm-handle:active { cursor: grabbing; }
/* A zone while it is being dragged out: its outline, broken, until let go. */
.pm-zone-draft { stroke: var(--dg-assign, #8b8b8b); stroke-width: 4; stroke-dasharray: 10 8; }.pm-handle.is-anchor {
  fill: var(--accent); stroke: var(--surface); stroke-width: 3; cursor: default;
}

/* The route tree: ten short names, so let them pack tighter than normal buttons. */

/*
 * The row that describes a play: its name, then the three things that classify
 * it. The name gets twice the width because it is the only one a coach writes
 * rather than picks, and "Counter Trey Weak" does not fit in a quarter of a row.
 *
 * A select is a little taller than a text box by default -- the arrow well --
 * so the height is set on both rather than left to the browser to disagree.
 */
.play-meta {
  display: grid;
  gap: 12px;
  /* minmax(0, ...) because an fr column will not shrink below its content, and
     a select is as wide as its longest option -- "Trips Right" was quietly
     taking width from the name it was supposed to be narrower than. */
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: end;
  margin-bottom: 4px;
}
/* The grid's own gap does the spacing; a label's stock bottom margin was
   adding twelve more pixels under the row than anybody asked for. */
.play-meta .field { margin-bottom: 0; }
/* With a Team first -- a scouted play -- five on the row, the team narrow. */
.play-meta.has-team {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr);
}
.play-meta .field > input,
.play-meta .field select { height: 34px; }
@media (max-width: 820px) {
  .play-meta, .play-meta.has-team { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

/*
 * Inside the tool panel a stacked label costs a whole line each, and the panel
 * is 250px wide with a lot to say. The label goes in front of its control
 * instead: a select is short enough to share the row, and three of these in the
 * football group were three lines that are now none.
 *
 * Only in the panel. The header row keeps its labels above, where there is
 * width to spare and the stack reads as a form rather than a list of settings.
 */
.pm-group label.field { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.pm-group label.field > span {
  display: block;
  margin-bottom: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}
.pm-group label.field > select,
.pm-group label.field > .input { flex: 1 1 auto; min-width: 0; }

/*
 * The handle on the end of a motion line. Invisible until the pointer finds it,
 * because the diagram should read as a drawing rather than as a set of controls
 * -- but it has to be findable, so it lights up rather than merely working.
 */
.dg .dg-tail { fill: transparent; stroke: transparent; stroke-width: 2; }
.dg.is-interactive .dg-tail { cursor: crosshair; }
.dg.is-interactive .dg-tail:hover {
  fill: color-mix(in srgb, var(--accent) 16%, transparent);
  stroke: var(--accent);
}

/* A play card you can open by double-clicking it. */
.pb-card.is-openable > .dg-frame,
.pb-card.is-openable > .pb-head { cursor: pointer; }

/* The on/off switch on a formation card. */
.fm-toggle {
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  padding: 3px 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-3);
}
.fm-toggle[aria-pressed="true"] {
  background: var(--accent-soft); color: var(--accent-text); border-color: transparent;
}
.fm-toggle:hover { border-color: var(--accent); }
/*
 * Admin's formations say whether coaches can see one in traffic-light
 * colours: green when it is published, red when it is not. Red was the
 * published colour before, which read as a warning on the good state.
 */
.fm-toggle.is-status { color: var(--bad); background: color-mix(in srgb, var(--bad) 20%, transparent); border-color: transparent; }
.fm-toggle.is-status[aria-pressed="true"] { color: var(--good); background: color-mix(in srgb, var(--good) 20%, transparent); }
.fm-toggle.is-status:hover { border-color: currentColor; }
/*
 * Bringing a diagram in from a picture.
 *
 * The picture is shown at the size it will actually be read at, because that is
 * the thing a coach can judge: a photograph too blurred to read here is one the
 * reader will struggle with too, and seeing it beats being told afterwards.
 */
.import-drop {
  display: grid; gap: 10px; padding: 12px;
  border: 1px dashed var(--line-strong); border-radius: 10px;
  background: var(--surface-2, var(--surface));
}
.import-drop.is-over { border-color: var(--accent); border-style: solid; }
/* Choose a file, or paste one: side by side, the button under the box on a phone. */
.import-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.import-pick .input { flex: 1 1 220px; min-width: 0; }
/* While a picture is read: a note that stays up until it is done. */
/*
 * A play or formation being read from a picture: the Smart Video Analyzer's
 * mark, its tile turning, in the middle of the screen over the dimmed page.
 */
/* The clip a play is read from (components/film-clip-import.js). */
.import-clip { width: 100%; max-height: 42vh; background: #000; border-radius: var(--radius-sm); margin-top: 8px; }
/* Marking the ball on a paused clip (components/film-clip-import.js): a still over the picture, and a ring where it was clicked. */
.clip-stage { position: relative; }
/* Importing a formation: both ways round (components/import-diagram.js). */
.import-pair { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 14px; }
.import-pair input { margin-top: 3px; }
.clip-mark-still { position: absolute; cursor: crosshair; border-radius: var(--radius-sm); outline: 2px solid var(--accent); }
.clip-mark-ring { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border: 3px solid #ffd400; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6); pointer-events: none; }
.import-reading {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: color-mix(in srgb, #0b0e12 55%, transparent);
  backdrop-filter: blur(2px);
}
.import-reading-card {
  width: min(500px, 100%); padding: 20px 22px 18px; text-align: center;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-lg);
}
/*
 * The banner sized to the card rather than to its own ratio: the ratio with
 * its minimum height made it wider than the card, and it hung over the edge.
 * The mark and name are a little smaller to match.
 */
.import-reading-card .ab {
  width: 100%; aspect-ratio: auto; height: 112px; min-height: 0; margin-bottom: 14px;
}
.import-reading-title { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink); }
.import-reading-note { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
.import-reading-time { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .import-reading .ab-mark { animation: none !important; } }
.import-preview {
  display: block; width: 100%; max-height: 260px;
  object-fit: contain; border-radius: 8px;
  background: #fff; border: 1px solid var(--line);
}
.import-drop .pm-hint { margin: 0; }
.import-drop .pm-hint.is-bad { color: var(--accent-text); }

/*
 * Picking from the formations a program has just published.
 *
 * Tiles rather than a list of names: a formation is a shape, and a coach knows
 * one by looking at it far quicker than by reading what it is called. Each is a
 * button, so the keyboard reaches them and the pressed state is real rather
 * than drawn.
 */
.fm-pick-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.fm-pick {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  padding: 8px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: inherit; font: inherit;
}
.fm-pick:hover { border-color: var(--line-strong); }
.fm-pick.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.fm-pick .dg-frame { width: 100%; }
.fm-pick-name { font-size: 13px; font-weight: 600; }
.fm-pick-unit { font-size: 11.5px; color: var(--ink-3); }

/* The tick only exists once it means something. */
.fm-pick-mark {
  position: absolute; top: 6px; right: 6px; z-index: 1;
  width: 18px; height: 18px; border-radius: 999px;
  display: grid; place-items: center;
  font-size: 11px; line-height: 1; color: #fff;
  background: var(--accent); opacity: 0; transform: scale(0.7);
  transition: opacity 120ms ease, transform 120ms ease;
}
.fm-pick.is-on .fm-pick-mark { opacity: 1; transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
  .fm-pick-mark { transition: none; }
}

/* A formation that is off still has to be readable -- it is the thing you came
   here to switch back on -- so it is dimmed rather than greyed out. */
.pb-card.is-off .dg-frame, .pb-card.is-off .pb-head { opacity: 0.5; }

/*
 * The placement guide: where a line would sit, on a field that has none yet.
 * Faint enough to read as a suggestion rather than as players, and gone as soon
 * as there are real linemen to derive gap numbers from.
 */
.dg .dg-guide-spot {
  fill: none;
  stroke: var(--dg-line, #c8ccd2);
  stroke-width: 2;
  stroke-dasharray: 4 5;
}
.dg .dg-gap.is-guide { opacity: 0.55; }

/* One-sided figures: everything summed from our own tagged players. */
.tagged-groups {
  display: grid; gap: 18px 28px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.tagged-stat {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line);
}
.tagged-group .tagged-stat:last-child { border-bottom: 0; }
.tagged-stat-label { color: var(--ink-2); font-size: 13px; }
.tagged-stat-value { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Field goals by distance: five bands that add up to the total. */
.fg-ranges { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.fg-band {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2);
}
.fg-band-label { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.fg-band-value { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Raw data a calculation needs, entered in a form it cannot use. */
.field-warning {
  margin: -4px 0 10px; padding: 6px 10px; font-size: 12px; line-height: 1.4;
  color: var(--warn-ink); background: var(--warn-bg);
  border-left: 3px solid var(--warn); border-radius: 0 4px 4px 0;
}

/* A figure the application knows about and nobody has charted yet. */
.compare-row.is-blank, .tagged-stat.is-blank { opacity: 0.45; }
.compare-row.is-blank .bar i { background: var(--ink-3); }

/* A measurement typed in the units it is spoken in. */
.height-input { display: flex; align-items: center; gap: 6px; }
.height-input input { width: 72px; }
.height-input .unit { color: var(--ink-3); font-size: 12px; }
.check-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; }
.check-row input { width: auto; }
/* Notify Team, at the head of the calendar form: set apart, because it is what sends. */
.notify-box { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2, transparent); }
.notify-box .check-row { margin: 0 0 4px; }
/*
 * The calendar form in the iPhone app's groups: what it is, when, who
 * against, where, how often, who is coming, notes. Each is a box of its own.
 */
.entry-group { margin-bottom: 12px; padding: 10px 12px 0; border: 1px solid var(--line); border-radius: 10px; }
.entry-group.notify-box, .entry-group:has(> .check-row) { padding-bottom: 10px; }
.entry-group > .check-row { margin: 0 0 4px; }
.entry-group > .hint { margin: -4px 0 10px; }
.entry-group.entry-delete { padding: 6px 12px; }
.entry-group.entry-delete .btn { width: 100%; justify-content: center; }

/*
 * The delete-reason list: every reason at once, ticked rather than Ctrl-clicked.
 *
 * Bordered like the field it replaced, so it still reads as one list and not as
 * ten loose questions -- but with no height cap, because the whole point is
 * that nothing is hidden. Ten rows is about 300px, which the dialog carries
 * without scrolling on any screen a coach charts film on.
 */
.reason-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 4px;
}
.reason-row {
  display: flex;
  /* Not centred: a label that wraps should hang off its box, not straddle it. */
  align-items: flex-start;
  gap: 9px;
  padding: 6px 8px;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  line-height: 1.4;
}
.reason-row input { width: auto; margin: 2px 0 0; flex: 0 0 auto; }
.reason-row:hover { background: var(--surface-2); }
/* The whole row is the target, so the focus ring belongs to the row. */
.reason-row:focus-within { background: var(--surface-2); outline: 2px solid var(--accent); outline-offset: -2px; }
.badge.captain {
  margin-left: 6px; font-weight: 700; letter-spacing: 0.02em;
  background: var(--accent-soft); color: var(--accent-text);
}

/* A game's plays, folded away until somebody asks for them. */
tr.game-group { cursor: pointer; background: var(--surface-2); }
tr.game-group:hover { background: var(--line); }
tr.game-group td {
  font-weight: 650; padding: 9px 12px;
  border-top: 1px solid var(--line-strong, var(--line));
}
.disclosure {
  display: inline-block; width: 14px; color: var(--ink-3);
  font-size: 11px; transition: none;
}
.game-group-name { margin-right: 8px; }
.game-group-date, .game-group-count {
  font-weight: 400; font-size: 12px; color: var(--ink-3); margin-right: 10px;
}

/* The depth chart on paper: a sheet to hand round, not a screen shot. */
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  .print-head h1 { margin: 0 0 2px; font-size: 18pt; }
  .print-head .sub { color: #444; margin-bottom: 10px; }
  /* A select prints as a control with a chevron; on paper it is just a name. */
  .card select {
    appearance: none; -webkit-appearance: none;
    border: 0; padding: 0; background: none; font-size: 10pt; color: #000;
  }
}

/* Grouped bars lying down: a row per category, a thin bar per side. */
.hbars { position: relative; display: flex; flex-direction: column; gap: 12px; margin: 8px 0 6px; }
.hbar-row { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 12px; }
.hbar-label { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hbar-pair { display: flex; flex-direction: column; gap: 3px; }
.hbar { display: flex; align-items: center; gap: 8px; height: 11px; cursor: default; }
/* The track is what a hover or focus lands on, so the tooltip finds its label. */
.hbar > * { pointer-events: none; }
.hbar-fill { display: block; height: 100%; border-radius: 0 3px 3px 0; }
.hbar-value {
  font-size: 11.5px; line-height: 1; color: var(--ink-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.hbar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }


/* The Admin Portal's name beside the wordmark: a quiet label, not a badge. */
.brand-tag {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0.6; align-self: center;
  /*
   * Its own space, because the lockup's is now zero.
   *
   * The mark and the name are deliberately hard against each other -- the
   * football's own box supplies the only gap they need. ADMIN has no such box
   * and sat straight against the final N, reading as one word. This is the
   * gap the row used to give it, given here instead.
   */
  margin-left: 7px;
}

/*
 * Tabs across a page (Statistics: Team | Player). Underlined rather than boxed,
 * so they read as views of one page rather than as buttons that do something.
 */
.page-tabs {
  display: flex; gap: 4px; margin: -4px 0 18px;
  border-bottom: 1px solid var(--line);
}
.page-tabs a {
  padding: 8px 14px; margin-bottom: -1px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-3); text-decoration: none;
  border-bottom: 2px solid transparent;
}
.page-tabs a:hover { color: var(--ink); }
.page-tabs a.active { color: var(--ink); border-bottom-color: var(--accent); }
.page-tabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }

/* Players on this play, in the play viewer: a section title that folds. */
details.pv-players > summary {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; list-style: none; user-select: none;
}
details.pv-players > summary::-webkit-details-marker { display: none; }
details.pv-players > summary::before {
  content: ''; width: 0; height: 0; flex: 0 0 auto;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform 0.15s ease;
}
details.pv-players[open] > summary::before { transform: rotate(90deg); }
details.pv-players > summary:hover { color: var(--ink); }
details.pv-players > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
details.pv-players:not([open]) > summary { margin-bottom: 0; }
.pv-count { font-weight: 600; letter-spacing: 0; color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) {
  details.pv-players > summary::before { transition: none; }
}

/* A button that is only an icon: square-ish, the icon centred, the same height
   as the text buttons beside it (the icon is no taller than their line). */
.btn.btn-icon { padding-left: 7px; padding-right: 7px; justify-content: center; }
.btn.btn-icon .icon { display: block; flex: 0 0 auto; }

/*
 * The refresh beside a count, and what it does while it is working.
 *
 * Pulled back against the count it belongs to -- the head's own gap is set for
 * a heading next to a title, which is too much air between a number and the
 * button that re-reads it.
 *
 * The arrow turns while the request is out. Nothing else on the page says a
 * refresh is happening: the rows do not empty and the count does not clear, so
 * without this a slow network looks like a button that did nothing.
 */
.card-head .count-refresh { margin-left: -4px; color: var(--ink-3); }
.card-head .count-refresh:hover:not(:disabled) { color: var(--ink); }
@keyframes icon-spin { to { transform: rotate(360deg); } }
.btn.is-spinning .icon-refresh {
  animation: icon-spin 0.8s linear infinite;
  transform-origin: 50% 50%;
}
/* Asked for less motion: the button still disables, which is the other half of
   the answer and the half that does not move. */
@media (prefers-reduced-motion: reduce) {
  .btn.is-spinning .icon-refresh { animation: none; }
}
.icon-sparkle { fill: var(--accent); stroke: var(--accent); }
.btn:disabled .icon-sparkle { fill: currentColor; stroke: currentColor; }

/* The quieter end of a page title ("Games & Scrimmages"): charcoal, lighter. */
.title-aside { color: var(--ink-2); font-weight: 500; }

/* A window title with an icon in front of it (Smart Video Analyzer). */
.modal-head h2.has-icon { display: flex; align-items: center; gap: 9px; }
.modal-head h2.has-icon .icon { display: block; flex: 0 0 auto; }

/* ---------- Statistic abbreviations ---------- */

/*
 * A chip that explains itself: grey, bordered, a hint of lift, and a help
 * cursor -- so it reads as something to point at rather than a label.
 */
.stat-chip {
  display: inline-flex; align-items: center;
  padding: 1px 6px; border-radius: 5px;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line); box-shadow: 0 1px 0 rgb(20 24 31 / 0.06);
  font-size: 11px; font-weight: 650; letter-spacing: 0.02em; line-height: 1.5;
  text-transform: none; white-space: nowrap;
  cursor: help;
}
.stat-chip:hover, .stat-chip:focus-visible {
  background: var(--line); border-color: var(--line-strong); color: var(--ink); outline: none;
}
.stat-chip:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }

.stat-tip {
  position: fixed; z-index: 1000; max-width: 260px;
  padding: 8px 10px; border-radius: 8px;
  background: #1b2029; color: #fff;
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.22);
  font-size: 12px; line-height: 1.45; pointer-events: none;
}
.stat-tip-name { font-weight: 700; margin-bottom: 2px; }
.stat-tip-about { color: #d3d8e0; }

/* A player's line: each figure its chip and its number, wrapping as needed. */
.stat-line { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.stat-pair { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.stat-val { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Table headings keep their own weight; the chip sets its own. */
th .stat-chip { vertical-align: middle; }

/* The link beside the Statistics tabs. */
.page-tabs a.page-tabs-aside {
  margin-left: auto; border-bottom: 0; margin-bottom: 0; align-self: center; padding: 6px 2px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-3); text-decoration: none;
}
.page-tabs a.page-tabs-aside:hover { color: var(--accent-text); }

/* The glossary page. */
.glossary-search { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.glossary-search .input { flex: 1 1 auto; min-width: 0; max-width: 420px; }
.glossary-group + .glossary-group { margin-top: 6px; }
.glossary-row {
  display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid var(--line);
}
.glossary-row:last-child { border-bottom: 0; }
.glossary-abbr { padding-top: 1px; }
.glossary-name { font-weight: 600; font-size: 13.5px; }
.glossary-about { color: var(--ink-2); font-size: 13px; margin-top: 2px; max-width: 65ch; }
@media (max-width: 520px) {
  .glossary-row { grid-template-columns: 1fr; gap: 4px; }
  .glossary-search { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: no-preference) {
  .stat-chip { transition: background-color 0.1s ease, border-color 0.1s ease; }
}

/* Tabs can be buttons as well as links (Calendar | Schedule switch in place). */
.page-tabs button {
  padding: 8px 14px; margin-bottom: -1px; background: none; border: 0;
  border-bottom: 2px solid transparent; font: inherit;
  font-size: 13.5px; font-weight: 600; color: var(--ink-3); cursor: pointer;
}
.page-tabs button:hover { color: var(--ink); }
.page-tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.page-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.cal-tabs { margin: 0 0 14px; }

/* ---------- Schedule: the month as week cards ---------- */

/*
 * drilldownsports.com's "This week" (site/styles.css, .week): a dark card for
 * each week, its name and dates in small capitals along the top, and a row an
 * entry -- the day and time, what it is and where, who is coming. A game's
 * row carries the brand red and its red edge.
 */
.sched { display: grid; gap: 16px; }
.sched-week {
  background: var(--week-card); color: var(--week-ink); border: 1px solid var(--week-border);
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
}
.sched-week-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 14px 18px 10px;
  font: 700 15px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--week-muted);
}
.sched-week-head h2 { margin: 0; font: inherit; letter-spacing: inherit; color: inherit; }
.sched-week-head span { white-space: nowrap; }

.sched-row {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 18px; border-top: 1px solid var(--week-line);
  cursor: pointer;
}
.sched-row:hover { background: var(--week-hover); }
.sched-row:focus-visible { outline: 2px solid var(--week-today); outline-offset: -2px; }
.sched-row.is-fixture { background: var(--week-fixture); box-shadow: inset 3px 0 0 var(--accent); }
.sched-row.is-fixture:hover { background: var(--week-fixture-hover); }
/* Already held: still readable, a step back from what is coming up. */
.sched-row.is-past > * { opacity: 0.7; }
.sched-row.is-past:hover > *, .sched-row.is-past:focus-visible > * { opacity: 1; }

.sched-when { font-size: 13.5px; line-height: 1.25; color: var(--week-muted); font-variant-numeric: tabular-nums; }
.sched-day {
  display: block; margin-bottom: 2px;
  font: 700 21px/1 var(--display); letter-spacing: 0.04em; text-transform: uppercase; color: var(--week-ink);
}
.sched-day.is-today { color: var(--week-today); }
.sched-time { white-space: nowrap; }

.sched-what { min-width: 0; line-height: 1.3; }
.sched-name { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.sched-repeat { margin-left: 2px; font-size: 13px; font-weight: 400; color: var(--week-muted); white-space: nowrap; }
.sched-sub { margin-top: 2px; font-size: 13.5px; color: var(--week-muted); overflow-wrap: anywhere; }
.sched-place {
  color: inherit; text-decoration: underline; text-decoration-color: var(--week-line);
  text-underline-offset: 2px;
}
.sched-place:hover { color: var(--week-ink); text-decoration-color: currentColor; }
.sched-result { font-weight: 700; font-variant-numeric: tabular-nums; }
.sched-result.is-won { color: var(--week-won); }
.sched-result.is-lost { color: var(--week-lost); }
/* What the coach wrote on the entry, kept line breaks and all; the rest on hover. */
.sched-notes {
  margin-top: 5px; padding-left: 8px; border-left: 2px solid var(--week-line); max-width: 70ch;
  font-size: 13px; line-height: 1.4; color: var(--week-muted); white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}

/* Who is coming, in the site's rounded counts: "15 going". */
.sched-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.sched-pill {
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
  font-size: 12.5px; font-weight: 600;
  background: var(--week-pill); color: var(--week-ink);
}
.sched-pill.is-going { background: var(--week-going-bg); color: var(--week-going); }
.sched-pill.is-maybe { background: var(--week-maybe-bg); color: var(--week-maybe); }
.sched-pill.is-no { background: var(--week-no-bg); color: var(--week-no); }
.sched-pill.is-reply { background: transparent; box-shadow: inset 0 0 0 1px var(--week-muted); }

/* A phone: the pills go under the name rather than squeezing it. */
@media (max-width: 600px) {
  .page.cal-page { padding-inline: 16px; }
  .sched-week-head { padding: 13px 14px 9px; font-size: 14px; }
  .sched-row { grid-template-columns: 62px minmax(0, 1fr); gap: 4px 12px; padding: 12px 14px; }
  .sched-day { font-size: 19px; }
  .sched-pills { grid-column: 2; justify-content: flex-start; margin-top: 4px; }
}

/* An entry's repeat pattern in its edit dialog: a summary line until opened. */
.rep-pattern {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 2px 0 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2);
}
.rep-pattern.is-open { display: block; background: var(--surface); }
.rep-pattern-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rep-pattern-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-3); margin-bottom: 2px;
}
.rep-pattern-text { font-size: 13px; color: var(--ink); min-width: 0; }
.rep-pattern .hint { margin-top: 4px; }

/* ---------- Signing in ---------- */

/* The sign-in screen owns the window: no sidebar, nothing behind it. */
.app.is-signed-out { grid-template-columns: minmax(0, 1fr); }
.app.is-signed-out .sidebar { display: none; }

.si-page { display: flex; justify-content: center; padding: 8vh 20px 40px; }
.si-card {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); padding: 26px 26px 22px;
}
.si-brand { display: flex; align-items: center; }
.si-card h1 { font-size: 20px; margin: 18px 0 4px; }
.si-sub { margin: 0 0 18px; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
/* A heading with no line under it (Sign in): the same room before the form. */
.si-card h1 + .si-form { margin-top: 18px; }
.si-form { display: grid; gap: 12px; }
.si-field { display: grid; gap: 5px; }
.si-field > span {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3);
}
.si-note { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.si-message { font-size: 13px; line-height: 1.45; padding: 8px 10px; border-radius: 8px; }
.si-message.is-error { color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }
.si-go { width: 100%; justify-content: center; margin-top: 2px; }
.si-help { margin: 16px 0 0; font-size: 12px; color: var(--ink-3); line-height: 1.5; }

/* Who is signed in, at the foot of the sidebar. */
.sidebar-who { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.sidebar-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-who .btn { color: var(--sidebar-ink); border-color: transparent; background: transparent; }
.sidebar-who .btn:hover { background: var(--sidebar-raise); color: #fff; }

/* ---------- Subscriptions ---------- */

/* A page this team's tier does not license: named in the menu, not hidden. */
.nav a.is-locked { opacity: 0.62; }
.nav a.is-locked:hover { opacity: 0.85; }
.nav-lock { margin-left: auto; font-size: 10px; opacity: 0.8; }

/* Where the licence is, at the foot of the sidebar. */
.sidebar-sub {
  display: block; margin-top: 10px; font-size: 11.5px;
  color: var(--sidebar-ink-dim); text-decoration: none;
}
.sidebar-sub:hover { color: #fff; }

/* The season is away: said once, across the top. */
.off-season {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 28px; font-size: 13px;
  background: color-mix(in srgb, var(--warn) 14%, var(--surface));
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line));
  color: var(--warn-ink);
}
.off-season-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--warn) 30%, var(--surface));
}
.off-season a { color: inherit; font-weight: 600; }
/*
 * The same band for the plan's other states (app.js, billingNotice): a failed
 * payment in red, an ended plan in grey; ending soon and a free plan running
 * out keep the season's amber.
 */
.off-season.is-warn {
  background: color-mix(in srgb, var(--bad) 10%, var(--surface));
  border-bottom-color: color-mix(in srgb, var(--bad) 35%, var(--line));
  color: var(--bad);
}
.off-season.is-warn .off-season-tag { background: color-mix(in srgb, var(--bad) 18%, var(--surface)); }
.off-season.is-ended {
  background: var(--surface-2);
  border-bottom-color: var(--line);
  color: var(--ink-2);
}
.off-season.is-ended .off-season-tag { background: var(--line); }

/* The subscription page. */
.sub-now {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.sub-tier { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.sub-seats { text-align: right; font-size: 13px; }
/* A card plan's billing (views/subscription.js): Stripe's portal, subscribing again, a promo code. */
.sub-billing { display: grid; gap: 8px; padding-top: 14px; }
.sub-billing-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sub-billing p { margin: 0; font-size: 13px; max-width: 60ch; }
.sub-code { display: flex; gap: 6px; }
.sub-code .input { width: 150px; text-transform: uppercase; }
.sub-season { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 14px; }
.sub-season p { margin: 0; font-size: 13px; max-width: 60ch; }

.tiers { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
/* Monthly or Annual, above the tier cards (views/subscription.js). */
.sub-period { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 14px; }
.sub-period .muted { font-size: 13px; }
.tier {
  display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  background: var(--surface);
}
.tier.is-current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tier-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tier-head h3 { margin: 0; font-size: 17px; }
.tier-blurb { margin: 0; font-size: 13px; color: var(--ink-2); }
.tier-teams { font-size: 12px; font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
/* The price, set to read before the feature list rather than under it. */
.tier-price { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }

/*
 * An add-on: what it is on the left, what it costs and how to get it on the
 * right. A row rather than a card, because these are a list of small decisions
 * made one at a time and cards would give each of them the weight of a tier.
 */
.addon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.addon:last-child { border-bottom: 0; padding-bottom: 0; }
.addon-name { font-weight: 650; font-size: 14px; }
.addon-about { font-size: 13px; color: var(--ink-2); margin-top: 2px; max-width: 58ch; }
.addon-buy { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.addon-price { font-size: 14px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.tier-price .muted { font-size: 13px; font-weight: 400; }
.tier-offseason { font-size: 12px; margin-top: -4px; }
.tier-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: grid; gap: 4px; }
.tier .btn { margin-top: auto; justify-content: center; }

/* Sign-up: choosing a tier is three buttons rather than a dropdown. */
/* After the label rule it sits under, which would otherwise capitalise it. */
.si-hint, .si-field > .si-hint { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 400; text-transform: none; letter-spacing: 0; margin-top: 2px; }
/* One column per tier, however many there are: four since Plus. */
.si-tiers { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.si-tier {
  display: grid; gap: 2px; padding: 8px 6px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); font: inherit; text-align: center;
}
.si-tier:hover { border-color: var(--ink-3); }
.si-tier.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.si-tier-name { font-size: 13px; font-weight: 650; color: var(--ink); }
.si-tier-teams { font-size: 11px; color: var(--ink-3); }
.si-message.is-ok { color: var(--good); background: color-mix(in srgb, var(--good) 8%, var(--surface)); }
/*
 * Paying at sign-up (views/join.js): monthly or annual above the plans, a
 * promo code, and the terms said plainly above the button.
 */
.si-period { margin-bottom: 8px; }
.si-code { display: flex; gap: 8px; }
.si-code .input { flex: 1; text-transform: uppercase; }
.si-hint.is-ok { color: var(--good); }
.si-hint.is-bad { color: var(--bad); }
.si-have-code { font-size: 13px; justify-self: start; }
/* X Factor (AI), ticked at sign-up: the box, then what it is and costs. */
.si-ai { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.si-ai.is-info { cursor: default; }
.si-ai input { margin-top: 3px; }
.si-ai .si-hint { display: block; margin-top: 2px; }
/* X Factor (AI)'s month on the Subscription page, and the line beside each AI button (components/ai-meter.js). */
.ai-usage { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; margin: 4px 0 10px; font-size: 14px; }
.ai-meter { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.ai-meter.is-out { color: var(--bad); }
.si-terms { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }

/* The account page. */
.acct-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
/* Deleting the account (views/account.js): the warning, then the two confirmations. */
.acct-delete { display: grid; gap: 12px; }
.acct-delete .notice { margin: 0; }
.acct-unverified {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: -4px 0 12px; padding: 8px 10px; font-size: 13px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
  color: var(--warn-ink);
}
a.sidebar-name { color: inherit; text-decoration: none; }
a.sidebar-name:hover { color: #fff; text-decoration: underline; }

/* Above the formation tiles: how many there are, and one control for all. */
.fm-pick-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 0 0 10px; font-size: 12.5px;
}

/* ---------- A team's crest ---------- */
/*
 * `contain` rather than `cover`: a crest cropped to a square is a crest with
 * its edges cut off, and a badge is mostly edges.
 */
.team-logo-mark {
  width: 26px; height: 26px; flex: 0 0 auto;
  object-fit: contain; border-radius: 4px; background: var(--surface-2);
}
.team-logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.team-logo-preview {
  width: 56px; height: 56px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2);
  overflow: hidden;
}
.team-logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.team-logo-empty { font-size: 10.5px; color: var(--ink-3); }
.team-logo-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-logo-actions .hint { flex: 1 1 100%; margin: 0; }

/*
 * A player's picture: round, filled to the edge (`cover` -- a face, unlike a
 * crest, survives losing its corners), and an outline of a person when there
 * is no picture yet.
 */
.player-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; border-radius: 50%; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
  vertical-align: middle;
}
.player-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.player-avatar svg { width: 78%; height: 78%; margin-top: 18%; fill: var(--ink-3); opacity: 0.55; }
.avatar-cell { width: 44px; padding-right: 0 !important; }
.avatar-button {
  padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; display: inline-flex;
}
.avatar-button:hover .player-avatar { border-color: var(--accent); }
.avatar-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.player-photo-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.player-photo-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; }
.player-photo-actions .hint { flex: 1 1 100%; margin: 0; }

/* ---------- Admin: accounts ---------- */
.acct-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.badge.acct-admin { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent-text); }
.badge.acct-locked { background: color-mix(in srgb, var(--warn) 20%, var(--surface)); color: var(--warn-ink); }
.acct-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 14px; }
.acct-grid > div { display: grid; gap: 4px; font-size: 13.5px; }
.acct-k { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.acct-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Settings (a person's own) ---------- */
.prefs-page { max-width: 980px; }
.prefs-page .page-head { align-items: center; }
.pref-status { margin-left: auto; font-size: 12px; color: var(--ink-3); min-height: 1em; }
.prefs-page .card + .card { margin-top: 16px; }
.prefs-page .card.is-muted .pref-rows,
.prefs-page .card.is-muted .pref-preview { opacity: 0.55; }

.pref-hero { display: flex; gap: 24px; align-items: flex-start; padding: 20px 22px; }
.pref-hero-say { flex: 1 1 auto; min-width: 0; }
.pref-hero h2 { margin: 0 0 6px; font-size: 16px; letter-spacing: -0.01em; }
.pref-hero p { margin: 0; max-width: 66ch; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.pref-hero p + p { margin-top: 8px; }
.pref-fine { font-size: 12px !important; color: var(--ink-3) !important; }
.pref-hero-switch { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; padding-top: 2px; }
.pref-state { font-size: 12px; font-weight: 600; color: var(--ink-2); min-width: 22px; }

.pref-split { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 24px; padding: 4px 22px 20px; align-items: start; }
.prefs-page .card > .pref-rows { padding: 4px 22px 16px; }
.pref-rows { display: grid; }
.pref-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line);
}
/* The label and its control share a line; the explanation runs under both. */
.pref-say { display: contents; }
.pref-label { grid-column: 1; grid-row: 1; }
.pref-control { grid-column: 2; grid-row: 1; }
.pref-about { grid-column: 1 / -1; grid-row: 2; }
.pref-row:first-child { border-top: none; }
.pref-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.pref-about { font-size: 12px; color: var(--ink-3); margin-top: 4px; max-width: 64ch; line-height: 1.45; }
.pref-control { display: flex; justify-content: flex-end; }
.pref-seg button { white-space: nowrap; }
.pref-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.pref-switch { position: relative; display: inline-flex; cursor: pointer; }
.pref-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pref-track {
  width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong);
  position: relative; transition: background 0.15s ease;
}
.pref-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.25);
  transition: transform 0.15s ease;
}
/* On is green, not the brand red: a switch should report a state, and red
   reads as a warning next to controls that also use it for danger. */
.pref-switch input:checked + .pref-track { background: var(--good); }
.pref-switch input:checked + .pref-track::after { transform: translateX(16px); }
.pref-switch input:focus-visible + .pref-track { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .pref-track, .pref-track::after { transition: none; }
}

/* The viewer in miniature. */
.pref-preview {
  border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden;
  background: var(--surface-2); margin-top: 12px;
}
.pv-bar { display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--surface); }
.pv-bar b { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.pv-body { display: flex; gap: 6px; padding: 8px; height: 132px; }
.pv-film, .pv-data { flex-basis: 0; min-width: 0; border-radius: 4px; position: relative; display: flex; flex-direction: column; }
.pv-film { background: #1d232c; color: #c9d1d9; align-items: center; justify-content: center; gap: 4px; font-size: 10.5px; }
.pv-play { color: var(--accent-text); font-size: 18px; line-height: 1; }
.pv-data { background: var(--surface); border: 1px solid var(--line); padding: 8px; gap: 6px; }
.pv-data i { display: block; height: 6px; border-radius: 3px; background: var(--line); }
.pv-data i.short { width: 60%; }
.pv-body.is-compact .pv-data { gap: 3px; }
.pv-body.is-compact .pv-data i { height: 4px; }
.pv-data span { margin-top: auto; font-size: 10.5px; color: var(--ink-3); }

.film-viewer-open { margin-left: 2px; }

@media (max-width: 760px) {
  .pref-split { grid-template-columns: 1fr; }
  .pref-row { grid-template-columns: 1fr; row-gap: 8px; }
  .pref-control { grid-column: 1; grid-row: 2; justify-content: flex-start; }
  .pref-about { grid-row: 3; }
  .pref-hero { flex-direction: column-reverse; gap: 12px; }
}

/* ---------- One scroll: the page fits the window, its list scrolls ---------- */
/*
 * A page marked .is-fill does not scroll as a page. It is exactly the height
 * of the window; the heading, the filters and whatever sits above the list
 * stay where they are; and the one element marked .fill-scroll -- the roster,
 * the film's plays, the schedule -- takes the height that is left and scrolls
 * inside it. One scrollbar, where the rows are, with the column headings
 * pinned above them.
 *
 * Everything between the page and that list is stretched to pass the height
 * down (the :has rules), so a page opts in with two class names and no
 * wrapper of its own. When the top part alone is taller than the window --
 * a short laptop screen, the game's details expanded -- the list keeps a
 * usable minimum and the page scrolls after all, rather than squeezing the
 * rows to nothing. A short list stays its own height rather than stretching
 * a card of empty space down to the bottom of the window.
 *
 * Wide screens only: on a phone the sidebar sits above the page, and one long
 * page is what a phone does best.
 */
@media (min-width: 861px) {
  html.fill-page { scrollbar-gutter: auto; overflow: hidden; }
  html.fill-page body { height: 100vh; overflow: hidden; }
  html.fill-page .app { height: calc(100vh - var(--demo-bar-h)); min-height: 0; }
  html.fill-page .main { height: calc(100vh - var(--demo-bar-h)); overflow-y: auto; }

  .page.is-fill {
    flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column;
    padding-bottom: 20px;
  }
  /* Grows no taller than its content; shrinks to the window when longer. */
  .page.is-fill :has(.fill-scroll) {
    display: flex; flex-direction: column;
    flex: 0 1 auto; min-height: 0;
  }
  /* Whatever is beside the list's column keeps its own height. */
  .page.is-fill > :not(:has(.fill-scroll)):not(.fill-scroll),
  .page.is-fill :has(.fill-scroll) > :not(:has(.fill-scroll)):not(.fill-scroll) {
    flex-shrink: 0;
  }
  .page.is-fill .fill-scroll {
    flex: 0 1 auto;
    min-height: 180px;
    overflow: auto;
  }
  /*
   * What is in the list keeps its size and the list scrolls. A list that is
   * itself a flex column -- the schedule -- would otherwise squeeze every row
   * to fit the box rather than scroll it.
   */
  .page.is-fill .fill-scroll > * { flex-shrink: 0; }
  /* The same for a list laid out as a grid: each row its full height, from the top. */
  .page.is-fill .fill-scroll { grid-auto-rows: max-content; align-content: start; }
}

/* ---------- Uploading a film ---------- */
.film-drop {
  position: relative;
  display: grid; gap: 3px; padding: 13px 16px; cursor: pointer; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2);
}

/*
 * The same control once it has a film: a line rather than a target.
 *
 * It is still the file input -- the whole row is the label, so clicking
 * anywhere on it opens the picker -- but it has stopped asking. What it does
 * now is state which film this is and offer to change it, and that is a
 * sentence, not a drop zone.
 */
.film-chosen {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 12px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.film-chosen:hover { border-color: var(--line-strong); }
.film-chosen:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The picker covers the whole row, so a tap lands on it (as .film-drop's does). */
.film-chosen input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.film-chosen-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.film-chosen-swap { flex: 0 0 auto; font-size: 12px; color: var(--accent-text); }
.film-drop:hover { border-color: var(--ink-3); }
.film-drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The picker itself covers the box: a tap lands on it rather than being passed on by the label. */
.film-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.film-drop-say { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.film-drop-meta { font-size: 12px; color: var(--ink-3); }
.upload-progress { display: grid; gap: 6px; margin-top: 14px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.upload-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.upload-bar i { display: block; height: 100%; background: var(--accent); transition: width 0.2s ease; }
@media (prefers-reduced-motion: reduce) { .upload-bar i { transition: none; } }

/* ---------- Statistics: head to head beside the panels that explain it ---------- */
.h2h-layout {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 18px; align-items: stretch;
}
/*
 * Both columns end on the same line: each is as tall as the taller one, and
 * the last panel in the shorter one grows to meet it.
 */
.h2h-main, .h2h-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.h2h-main > :last-child, .h2h-side > :last-child { flex: 1 1 auto; }
.h2h-main > :last-child.card, .h2h-side > :last-child > .card { height: 100%; box-sizing: border-box; }
/* Two panels that fit side by side in the right column, and stack when not. */
.h2h-pair { gap: 18px; }
/* The comparison, tightened to its column: shorter rows, a narrower label. */
.h2h-main .compare-row {
  grid-template-columns: 58px minmax(0, 1fr) 112px minmax(0, 1fr) 58px;
  gap: 8px; padding: 5px 0; font-size: 12.5px;
}
.h2h-main .compare-row .label { font-size: 10.5px; }
@media (max-width: 1180px) {
  .h2h-layout { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .h2h-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Auditing the analyser (Drilldown admins only) ---------- */
/*
 * A toggle that is currently on, inverted so it reads as pressed.
 *
 * Two entry points to one look. `.btn.active` on its own was never styled,
 * which nobody noticed while every toggle carried a word -- the label stayed
 * readable whether or not the button changed. An icon has no such fallback:
 * without this, an icon-only toggle looks identical on and off.
 */
.audit-toggle.active,
.btn.is-on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.audit-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.audit-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--on-ink); background: var(--ink); border-radius: 999px; padding: 2px 9px;
}
.audit-progress { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.audit-acts { margin-left: auto; display: flex; gap: 6px; }
table.plays td.audit-cell { white-space: nowrap; }
.audit-mark { padding: 2px 8px; font-size: 13px; line-height: 1.2; }
.audit-mark.is-pass { background: color-mix(in srgb, var(--good) 14%, var(--surface)); color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--surface)); }
.audit-mark.is-fail { background: color-mix(in srgb, var(--bad) 10%, var(--surface)); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--surface)); }
.audit-note { padding: 2px 6px; color: var(--ink-3); }
.audit-note.has-note { color: var(--penalty-ink); background: var(--penalty-bg); }

.audit-headline { display: grid; gap: 10px; margin-bottom: 4px; }
.audit-score { display: flex; align-items: center; gap: 14px; }
.audit-pct { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.audit-grade {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; padding: 1px 8px; border-radius: 999px;
  font-weight: 700; font-size: 12.5px; background: var(--surface-2);
  border: 1px solid var(--line-strong); color: var(--ink-2);
}
/* Wide enough for a plus or a minus without losing the square block a bare
   letter makes: the width is a floor, and the padding lets "B+" grow past it. */
.audit-grade.is-big {
  min-width: 52px; height: 52px; padding: 0 10px;
  border-radius: 12px; font-size: 26px; letter-spacing: -0.5px;
}
.audit-grade.is-good { color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--surface)); border-color: color-mix(in srgb, var(--good) 30%, var(--surface)); }
.audit-grade.is-warn { color: var(--warn-ink); background: color-mix(in srgb, #b7791f 12%, var(--surface)); border-color: color-mix(in srgb, #b7791f 30%, var(--surface)); }
.audit-grade.is-bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 30%, var(--surface)); }

/* How sure the analyser was, read against the verdict beside it. */
table.plays td.conf-cell { font-variant-numeric: tabular-nums; font-weight: 600; }
table.plays td.conf-cell.is-high { color: var(--good); }
table.plays td.conf-cell.is-mid { color: var(--warn-ink); }
table.plays td.conf-cell.is-low { color: var(--bad); }

/* The grid's mark: a filled diamond once every field has been judged, a hollow
   one while there is still something to do, and the count of fields beside it. */
.conf-mark { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; }
.conf-mark-n { font-size: 11px; opacity: 0.75; }

/* ---------- Game diff ---------- */
/* One table for both versions, so the same play sits on the same line. The
   tint says what kind of row it is; the word in the middle says it in text. */
.diff-controls { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 14px; align-items: end; padding: 16px 18px 6px; }
.diff-pick .pref-row-name { margin-bottom: 6px; }
.diff-figures { grid-template-columns: repeat(6, 1fr); }
/* A play the auditor marked as missed by the analyser: the verdict this tool
   exists to surface, so it reads in the same red as a missing row. */
.badge.missed { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, var(--surface)); }
.diff-figures .audit-figure.is-missing .audit-figure-value { color: var(--bad); }
.diff-figures .audit-figure.is-extra .audit-figure-value { color: var(--warn-ink); }
/* Where the page does not fill the window, the table is its own scroll box.
   Where it does (see .page.is-fill), the fill layout sizes it instead. */
html:not(.fill-page) .diff-wrap { max-height: 70vh; overflow: auto; }
/* Two header rows, both pinned: the game names at the very top, the column
   names just under them. A second row pinned at the same top would slide
   under the first, so it is offset by the first row's fixed height. */
table.diff th { position: sticky; background: var(--surface); z-index: 1; }
table.diff thead tr:first-child th { top: 0; height: 32px; text-align: center; border-bottom: 0; }
table.diff thead tr:last-child th { top: 32px; box-shadow: 0 1px 0 var(--line); }
table.diff a.diff-time { color: var(--accent-text); text-decoration: none; border-bottom: 1px dotted currentColor; }
table.diff a.diff-time:hover { border-bottom-style: solid; }
table.diff td.diff-status { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
table.diff tr.is-missing td { background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }
table.diff tr.is-missing td.diff-status { color: var(--bad); }
table.diff tr.is-extra td { background: color-mix(in srgb, #b7791f 10%, var(--surface)); }
table.diff tr.is-extra td.diff-status { color: var(--warn-ink); }
table.diff tr.is-timing td.diff-status { color: var(--warn-ink); }
/*
 * Late: the one timing fault that costs the coach the play.
 *
 * Louder than the amber a plain offset gets, and carried on the offending
 * stamp rather than as a row wash -- a run that drifts late is late nearly
 * everywhere, and a table washed red row after row says no more than a table
 * washed nothing. The number is where the fault is, so the number is what is
 * marked; the word in the middle column names it.
 */
table.diff tr.is-late td.diff-status { color: var(--bad); }
table.diff td.mono.is-late-time {
  background: color-mix(in srgb, var(--bad) 13%, var(--surface));
  font-weight: 650;
  box-shadow: inset 2px 0 0 var(--bad);
}
table.diff td.mono.is-late-time,
table.diff td.mono.is-late-time .diff-time { color: var(--bad); }
.diff-figures .audit-figure.is-late .audit-figure-value { color: var(--bad); }
@media (max-width: 900px) { .diff-controls { grid-template-columns: 1fr 1fr; } .diff-figures { grid-template-columns: repeat(3, 1fr); } }

/* The breakdown inside a play. Its own panel so it reads as a separate job from
   charting the play, which is what it is. */
.audit-breakdown { margin-top: 12px; }
.audit-breakdown span.conf-cell { font-weight: 600; font-variant-numeric: tabular-nums; }
.audit-breakdown span.conf-cell.is-high { color: var(--good); }
.audit-breakdown span.conf-cell.is-mid { color: var(--warn-ink); }
.audit-breakdown span.conf-cell.is-low { color: var(--bad); }
.audit-breakdown .btn.is-pass { background: color-mix(in srgb, var(--good) 14%, var(--surface)); color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, var(--surface)); }
.audit-breakdown .btn.is-fail { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--surface)); }

/* Marking a play the analyser never found, and the report's three figures. */
.audit-missed.is-missed { background: color-mix(in srgb, var(--bad) 10%, var(--surface)); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--surface)); }
.audit-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 4px 0 14px; }
.audit-figure { background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; }
.audit-figure-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.audit-figure-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.audit-figure-about { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.4; }

/* ---------- The audit report, on paper ---------- */
/*
 * Printing the dialog rather than the page behind it: the application, the
 * dimmed backdrop and the dialog's own buttons all go, and the report itself
 * runs down the sheet at full width instead of scrolling inside a box.
 */
@media print {
  /*
   * The dialog lives in #modal-root, which the print stylesheet above hides
   * along with the rest of the application -- so printing the report without
   * this gave a blank sheet.
   */
  body.printing-audit #modal-root { display: block !important; }

  body.printing-audit .app,
  body.printing-audit #toast-root,
  body.printing-audit .modal-head,
  body.printing-audit .modal-foot { display: none !important; }

  body.printing-audit .modal-backdrop {
    position: static; display: block; background: none; padding: 0;
  }
  body.printing-audit .modal {
    width: 100% !important; max-width: none; max-height: none;
    box-shadow: none; border: 0; border-radius: 0;
  }
  body.printing-audit .modal-body {
    overflow: visible; max-height: none; padding: 0;
  }
  /* Figures and tables read as blocks; none of them should break in half. */
  body.printing-audit .audit-figure,
  body.printing-audit .table-wrap { break-inside: avoid; }
  body.printing-audit .audit-figures { grid-template-columns: repeat(3, 1fr); }
}

/*
 * Film timestamps are typed, never stepped.
 *
 * The fields are plain text so no browser should offer a stepper on them, but
 * saying so costs two rules and covers the ones that do it anyway -- a spinner
 * on a time is a click that lands on the wrong digit and a scroll wheel that
 * quietly changes a play a coach was only reading.
 */
.time-input { appearance: textfield; -moz-appearance: textfield; }
.time-input::-webkit-outer-spin-button,
.time-input::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }

/*
 * The pulse a dialog gives when somebody clicks beside it.
 *
 * Short, and only a shadow and a hair of scale -- enough to say the click
 * landed and the dialog is still there on purpose, without looking like an
 * error. Anyone who has asked for less motion gets none of it; the dialog
 * simply stays, which was the point.
 */
@keyframes dd-nudge {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.012); }
  100% { transform: scale(1); }
}
.modal.is-nudged,
.drawer.is-nudged {
  animation: dd-nudge 320ms ease-out;
  box-shadow: 0 0 0 2px var(--accent), 0 18px 48px rgba(0, 0, 0, 0.32);
}
@media (prefers-reduced-motion: reduce) {
  .modal.is-nudged,
  .drawer.is-nudged { animation: none; }
}

/*
 * The audit controls inside a diff row.
 *
 * Tight, because the row already carries two plays' worth of columns and the
 * marks have to fit beside them without pushing the times out of view. The
 * "missed" mark keeps its word rather than a tick: it says something different
 * from the other two -- that nothing was written here at all -- and a symbol
 * would read as a third opinion on a play that exists.
 */
/*
 * The down, while the down is what is being judged.
 *
 * The value keeps the column's alignment and the marks sit after it, so the
 * eye still reads a column of downs against the chart's column of downs and
 * the buttons are where the answer already is. Failing swaps the number for a
 * box in the same place, because the correction belongs where the wrong value
 * was rather than in a dialog somewhere else.
 */
/*
 * The unit, while the unit is what is being judged.
 *
 * The badge keeps its place and the marks sit after it, the same arrangement
 * as the down: the eye reads a column of units against the chart's column of
 * units, and the buttons are where the answer already is. Failing swaps the
 * badge for a picker rather than a text box, because there are only three
 * answers and one of them is "nobody can tell".
 */
.unit-audit { white-space: nowrap; }
.unit-audit .audit-mark { padding: 1px 5px; font-size: 12px; line-height: 1.3; margin-left: 3px; }
.unit-audit .unit-fix {
  /* max-width for the same reason the down's box uses it: the blanket rule
     that makes every input fill its container outranks a plain width here. */
  max-width: 116px;
  padding: 1px 4px;
  font-size: 11.5px;
  border-color: var(--accent);
}

.down-audit { white-space: nowrap; }
.down-audit .audit-mark,
.down-audit .audit-note { padding: 1px 5px; font-size: 12px; line-height: 1.3; margin-left: 3px; }
/*
 * The reason behind a failed down, on a button that appears only once there
 * is a verdict to explain. Coloured like every other note on the screen, so
 * an answered "why" reads the same here as it does in the audit column.
 */
.down-audit .down-why { padding: 1px 4px; }
.down-reason-hint { margin: 10px 0 0; }
.down-audit .down-said { display: inline-block; min-width: 10px; }
.down-audit .down-fix {
  /*
   * max-width, not width: the form rule that sets every input to fill its
   * container carries five :not() clauses and so outranks anything sensible
   * written here. A ceiling is not in that fight -- it holds the box to two
   * digits whatever the width underneath it says.
   */
  max-width: 42px;
  padding: 1px 4px;
  font-size: 12px;
  text-align: center;
  border-color: var(--accent);
}
.diff-audit-pick { align-self: end; }

.diff-audit { white-space: nowrap; }
.diff-audit .btn { padding: 1px 6px; font-size: 12px; line-height: 1.3; }
.diff-audit .audit-mark + .audit-mark,
.diff-audit .audit-note,
.diff-audit .diff-delete { margin-left: 3px; }

/*
 * Throwing out a detection, from the column where the detections are.
 *
 * Quiet until it is reached for: it sits beside two marks that get clicked all
 * the way down a game, and a red button among them would pull the eye to the
 * one action nobody should perform by reflex.
 */
.diff-audit .diff-delete { color: var(--ink-3); }
.diff-audit .diff-delete:hover:not(:disabled) {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.diff-audit .audit-missed,
.diff-audit .audit-mark.is-missed {
  background: color-mix(in srgb, var(--bad) 10%, var(--surface));
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 35%, var(--surface));
}

/*
 * The copy-across button in a diff row's middle column.
 *
 * Under the word rather than beside it: "Missing" is what the reader is
 * scanning for and the button is what they do about it, so the word keeps the
 * column's rhythm and the button sits out of the way until the eye stops on
 * that row.
 */
.diff-status .diff-add {
  display: block;
  margin: 3px auto 0;
  padding: 1px 6px;
  font-size: 11px;
  white-space: nowrap;
}
tr:not(:hover) .diff-status .diff-add { opacity: 0.55; }
.diff-status .diff-add:hover { opacity: 1; }

/*
 * The two wholesale judgements, under the diff's controls.
 *
 * On their own line rather than in the row of selectors: they act on every row
 * at once, and a control that does that should not sit shoulder to shoulder
 * with the ones that only change what is being looked at.
 */
.diff-bulk {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
}
.diff-bulk .hint { margin: 0; }

/*
 * The remove control at the end of an audited row.
 *
 * Faint until the row is under the pointer. It is the one destructive thing in
 * a grid whose rows are otherwise all clicked to open a play, so it should be
 * findable when wanted and invisible when not -- a column of crosses down the
 * edge of the breakdown would read as a warning about the plays themselves.
 */
.delete-cell { width: 1%; text-align: right; padding-right: 8px; }
.row-delete {
  padding: 1px 6px;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity 120ms ease-out, color 120ms ease-out;
}
tr:hover .row-delete,
.row-delete:focus-visible { opacity: 1; }
.row-delete:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }
@media (hover: none) {
  /* Nothing to hover with: show it rather than hide it from touch entirely. */
  .row-delete { opacity: 0.6; }
}

/* ---------- A drawn play on game film (components/film-links.js) ---------- */
.fl-panel { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.fl-head { display: flex; align-items: center; justify-content: space-between; }
/* Room under the heading only when the section is open. */
.fl-body { margin-top: 10px; }
/* How many snaps, kept apart from the words: it shows while the section is shut. */
.fl-head .pv-count:not(:empty) { margin-left: 8px; }
/* The one message, with the same chrome as a filled table would have. */
.fl-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 28px 16px; text-align: center; color: var(--ink-3);
  border: 1px dashed var(--line); border-radius: 10px; background: var(--surface);
}
.fl-empty p { margin: 0; max-width: 420px; font-size: 13px; line-height: 1.5; }

/* The Playbook page's two tabs: as wide as their words, with air before the filter bar. */
.pb-tabs { align-self: flex-start; margin-bottom: 12px; }

/* The play editor's picker: the playbook's cards, each one a button. */
.pb-grid.pb-pick { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); max-height: 62vh; overflow-y: auto; padding: 2px; }
.pb-pick-card { text-align: left; font: inherit; color: inherit; padding: 0; cursor: pointer; }
.pb-pick-card:hover, .pb-pick-card:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px; }
.pb-pick-card .pb-head { padding-bottom: 10px; }

/* The fouls on a play in the editor: one chip each, with its own remove. */
.penalty-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.penalty-chip { display: inline-flex; align-items: center; gap: 6px; }
.penalty-chip button { border: 0; background: none; color: inherit; font: inherit; line-height: 1; padding: 0 2px; cursor: pointer; opacity: 0.7; }
.penalty-chip button:hover { opacity: 1; }
/* Declined: a small toggle inside the chip; a declined flag's name is struck through. */
.penalty-chip button.penalty-declined {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 1px 5px; border: 1px solid currentColor; border-radius: 4px; opacity: 0.55;
}
.penalty-chip button.penalty-declined[aria-pressed="true"] { opacity: 1; background: color-mix(in srgb, currentColor 18%, transparent); }
.penalty-chip.is-declined { text-decoration: line-through; text-decoration-thickness: 1px; }
.penalty-chip.is-declined button { text-decoration: none; }

/* The analyser's doubt about a row, beside its number. */
table.plays td.seq .seq-doubt {
  display: inline-block; margin-left: 4px; min-width: 14px; text-align: center;
  font-size: 11px; font-weight: 700; line-height: 1.3; border-radius: 7px;
  background: var(--penalty-bg); color: var(--penalty-ink); box-shadow: inset 0 0 0 1px var(--penalty-line);
}

/* A drawing on the play, made in the Film Viewer: beside the number, after the star. */
table.plays td.seq .seq-draw {
  display: inline-block; margin-left: 4px; font-size: 13px; line-height: 1; color: var(--accent-text); cursor: pointer;
}
table.plays td.seq .seq-draw:hover { text-decoration: underline; }

/* Whether a play is on a playlist: an empty circle, or a green tick. Click to change. */
.pl-mark {
  width: 24px; height: 24px; border-radius: 50%; padding: 0; cursor: pointer; line-height: 1;
  border: 2px solid var(--ink-3, #888); background: transparent; color: var(--ink-3, #888);
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
}
.pl-mark:hover { border-color: var(--ink); color: var(--ink); }
/* Softer than the star: a tinted ring rather than a solid fill, matching the star's own treatment. */
.pl-mark.is-on { border-color: #4caf7d; color: #2e8b5e; background: color-mix(in srgb, #4caf7d 16%, var(--surface)); }
.pl-mark.is-on:hover { filter: brightness(1.08); }

/* Whether a play is a highlight: the star in a circle, gold when it is. Beside the playlist mark. */
.hl-mark {
  width: 24px; height: 24px; border-radius: 50%; padding: 0; cursor: pointer; line-height: 1;
  border: 2px solid var(--ink-3, #888); background: transparent; color: var(--ink-3, #888);
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
}
.hl-mark .star-glyph { font-size: 14px; line-height: 1; }
.hl-mark:hover { border-color: var(--highlight); color: var(--highlight); }
.hl-mark.is-on { border-color: var(--highlight); color: var(--highlight); background: color-mix(in srgb, var(--highlight) 14%, var(--surface)); }

/* The star state of the mark: gold, as the highlight has always been. */
.pl-mark.is-star { border-color: var(--highlight); color: var(--highlight); background: color-mix(in srgb, var(--highlight) 14%, var(--surface)); }
.pl-mark.is-static { cursor: default; }
.pl-mark:disabled { opacity: 1; }
table.plays td.seq .seq-star { width: auto; margin-left: 6px; vertical-align: middle; }
table.plays td.seq .pl-mark { width: 20px; height: 20px; font-size: 12px; border-width: 1.5px; }

/* ---------- Recruiting (the editor; the shared page has recruit.css) ---------- */

/* Every track may shrink below its content: a table scrolls in its own wrap
 * rather than pushing its card under the next one. */
.recruit-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.recruit-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 18px; align-items: start; }
.recruit-layout > *, .recruit-row > * { min-width: 0; }
.recruit-layout .card + .card, .recruit-row .card + .card { margin-top: 0; }
.share-row { display: flex; gap: 6px; align-items: center; }
.share-url { flex: 1 1 auto; min-width: 0; font-family: var(--mono); font-size: 12px; }
label.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.pick-game + .pick-game { margin-top: 14px; }
.pick-game-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.pick-game tr { cursor: pointer; }
.pick-game tr.is-chosen td { background: color-mix(in srgb, var(--accent) 7%, transparent); }

/* A scouting report's play shared with the team (views/playmaker.js), and its notes on the team's Scouting page. */
.pb-share { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); padding: 0 12px 8px; cursor: pointer; }
.pb-share.is-on { color: var(--good, #2bb673); font-weight: 600; }
.pb-notes { margin: 0; padding: 0 12px 8px; font-size: 12px; color: var(--ink-2); line-height: 1.4; white-space: pre-line; }

/* A recruiting reel, played (components/reel-player.js): on the page a
 * recruiting link opens, and in the player's profile. */
.recruit-section { display: grid; gap: 14px; }
.recruit-section-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.recruit-section-head h2 { margin: 0; font-size: 18px; }
.recruit-controls { display: flex; gap: 6px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.recruit-film { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.recruit-stage { background: #0b0d11; color: #d6dbe3; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.recruit-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.recruit-frame video, .recruit-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.recruit-link { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 10px; padding: 24px; }
.recruit-link p { margin: 0; color: #8b95a3; }
.recruit-caption { padding: 10px 14px 12px; display: grid; gap: 6px; font-size: 13px; }
.recruit-caption-main { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.recruit-caption-main .muted { color: #8b95a3; }
.recruit-caption-n { font-variant-numeric: tabular-nums; color: #8b95a3; }
.recruit-caption-note { color: #e8ecf1; line-height: 1.4; }

.recruit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 70vh; overflow-y: auto; }
.recruit-list li {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start;
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer;
}
.recruit-list li:hover { border-color: var(--line-strong); background: var(--surface-2); }
.recruit-list li.is-playing { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.recruit-list-n { font-variant-numeric: tabular-nums; color: var(--ink-3); font-weight: 600; padding-top: 1px; }
.recruit-list-body { display: grid; gap: 3px; min-width: 0; }
.recruit-list-body .small { font-size: 12px; }
.recruit-list-note { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.recruit-list-time { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 12px; padding-top: 2px; }

@media (max-width: 820px) {
  .recruit-film { grid-template-columns: 1fr; }
  .recruit-list { max-height: none; }
}
/* In a dialog, the list beside the film is no taller than the film's column. */
.reel-dialog .recruit-list { max-height: min(62vh, 640px); }

/* The spotlight editor (components/spotlight-editor.js): the film with the
 * ring over it, a timeline of the marks and how sure the tracking was, and
 * the ring's look. */
.spot-editor { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
/* No taller than leaves the controls in view: on a short or zoomed screen the film narrows rather than pushing them off. */
.spot-frame { position: relative; aspect-ratio: 16 / 9; width: min(100%, calc(52vh * 16 / 9)); margin: 0 auto; background: #000; border-radius: var(--radius); overflow: hidden; touch-action: none; }
.spot-note { font-size: 12px; color: var(--ink-2); max-width: 46ch; }
.spot-frame video, .spot-yt, .spot-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.spot-touch { position: absolute; inset: 0; z-index: 3; }
.spot-controls { display: flex; gap: 6px; align-items: center; }
.spot-time { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.spot-timeline { flex: 1 1 auto; min-width: 80px; height: 34px; cursor: pointer; touch-action: none; }
.spot-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.spot-progress { flex: 1 1 160px; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.spot-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.15s; }
.spot-status { font-size: 13px; min-height: 1.4em; }
.spot-look { display: flex; gap: 14px 20px; flex-wrap: wrap; align-items: flex-end; padding-top: 10px; border-top: 1px solid var(--line); }
.spot-field { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); }
.spot-field.spot-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.spot-swatches { display: flex; gap: 6px; }
.spot-swatches button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); cursor: pointer; padding: 0; }
.spot-swatches button.is-on { outline: 2px solid var(--accent); outline-offset: 2px; }
.spot-badge { margin-left: 4px; }

/* ---------- The Roster page's tabs (views/roster-page.js) ---------- */

/* The tabs on the left, the open tab's buttons on the right, one row. */
.roster-tab-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.roster-tab-row .roster-tabs { margin-bottom: 0; }
.roster-tab-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.roster-tab-actions:empty { display: none; }
/* Swapping tabs dims what is going rather than blanking the page. */
.roster-panel { transition: opacity 120ms ease; }
.roster-panel.is-loading { opacity: 0.45; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .roster-panel { transition: none; } }
/* A tab's one line about itself, where a page's subtitle would have been. */
.tab-intro { margin: 0 0 12px; color: var(--ink-2); font-size: 13px; }
/* A record opened under a tab -- a player's recruiting profile. */
.tab-subhead { margin-bottom: 14px; }
.tab-subhead h2 { margin: 0; font-size: 20px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.crumb .crumb-sep { color: var(--ink-3); }

/* ---------- A heading that folds what is under it (foldToggle, util.js) ---------- */
.fold-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer; text-align: left;
}
.fold-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.fold-caret { width: 12px; color: var(--ink-3); font-size: 12px; }
/* The title inside a fold toggle keeps the look of the heading it replaces. */
.fold-toggle h2, .fold-toggle h3 { margin: 0; }
.fold-toggle .section-title { margin: 0; }

/* ---------- The demo's strip across the top (app.js, showDemoBar) ---------- */
.demo-bar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 16px; background: #1b2230; color: #eef1f5; font-size: 14px;
  border-bottom: 3px solid var(--accent);
}
.demo-bar strong { color: #fff; }
.demo-bar .btn { background: #fff; color: #1b2230; border-color: #fff; }
/* The other plan's demo: offered, but quieter than the way out. */
.demo-bar .btn.demo-switch { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.6); }
@media print { .demo-bar { display: none; } }

/* ---------- The Smart Video Analyzer, as the demo shows it (components/analyzer-pitch.js) ---------- */
.svap { display: flex; flex-direction: column; gap: 12px; }
.svap-tag {
  align-self: flex-start; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.svap-head {
  margin: 0; font-family: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  font-weight: 800; font-size: 30px; line-height: 1; text-transform: uppercase; letter-spacing: 0.02em; color: var(--ink);
}
.svap-lead { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.svap-points { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.svap-points strong { color: var(--ink); }
.svap-foot { margin: 0; font-size: 13.5px; color: var(--ink-2); }

/* ---------- A finished analysis, said wherever the coach is (components/analysis-notice.js) ---------- */
.job-notices {
  position: fixed; right: 18px; bottom: 18px; z-index: 58;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
}
.job-notice {
  width: min(380px, calc(100vw - 36px));
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-left: 4px solid var(--good); border-radius: 10px; padding: 12px 14px;
  box-shadow: var(--shadow-lg);
}
.job-notice.is-bad { border-left-color: var(--bad); }
.job-notice .logo-tile { flex: none; margin-top: 2px; }
.job-notice-body { flex: 1; min-width: 0; }
.job-notice-title { font-weight: 700; font-size: 14px; }
.job-notice-say { margin: 3px 0 10px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.job-notice-acts { display: flex; gap: 8px; }
@media print { .job-notices { display: none; } }

/* ---------- Filming for the analyzer (components/filming-tips.js) ---------- */
.filming-tips { display: flex; flex-direction: column; gap: 14px; }
.filming-tips-group h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.filming-tips-group ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.filming-tips-group strong { color: var(--ink); }
.filming-tips-best {
  font-size: 14px; line-height: 1.5; color: var(--ink-2);
  border-left: 3px solid var(--good); padding: 8px 12px; border-radius: 6px; background: var(--surface-2, transparent);
}
.filming-tips-best strong { color: var(--ink); }
.filming-tips > p.muted { margin: 0; font-size: 13px; }
.modal-foot .filming-tips-hide { margin: 0 auto 0 0; font-size: 13.5px; }

/* ---------- The demo tour (components/demo-tour.js) ---------- */
/*
 * Bottom left of the page, just right of the sidebar: dialogs and the play
 * drawer put their buttons bottom right, and the sidebar's foot has End demo.
 * Beneath drawers (50) and dialogs (60), so nothing it sits near is covered.
 */
.tour { position: fixed; left: calc(248px + 18px); bottom: 18px; z-index: 45; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
@media (max-width: 860px) { .tour { left: 16px; bottom: 16px; } }
.tour-launch {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 8px 14px 8px 10px; border-radius: 999px; border: 0;
  background: #1b2230; color: #fff; font: inherit; font-size: 14px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(20, 24, 31, 0.28);
}
.tour-launch:hover { background: #262f40; }
.tour-launch .logo-tile { display: block; }
.tour-count { font-weight: 600; color: #b7c0cc; font-variant-numeric: tabular-nums; }
.tour-panel {
  width: min(380px, calc(100vw - 36px)); max-height: min(78vh, 640px); overflow-y: auto;
  background: var(--surface); color: var(--ink); border-radius: 14px; border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(20, 24, 31, 0.28);
}
.tour-head { display: flex; gap: 10px; align-items: flex-start; padding: 16px 16px 10px; background: #1b2230; color: #eef1f5; border-bottom: 3px solid var(--accent); }
.tour-head h2 { margin: 0; font-size: 17px; color: #fff; }
.tour-head p { margin: 4px 0 0; font-size: 13px; color: #b7c0cc; line-height: 1.45; }
.tour-x { margin-left: auto; border: 0; background: transparent; color: #b7c0cc; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; }
.tour-x:hover { color: #fff; }
.tour-progress { height: 4px; background: var(--line); }
.tour-progress span { display: block; height: 100%; background: var(--accent); transition: width 0.4s ease; }
.tour-steps { list-style: none; margin: 0; padding: 6px 0; }
.tour-steps li { display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.tour-steps li + li { border-top: 1px solid var(--line); }
.tour-check {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line-strong); font-size: 13px; font-weight: 800; color: #fff;
}
.tour-steps li.is-done .tour-check { background: var(--good); border-color: var(--good); }
.tour-steps li.is-fresh .tour-check { animation: tour-pop 0.5s ease; }
.tour-step-body { flex: 1; min-width: 0; }
.tour-step-title { font-size: 14px; font-weight: 700; }
.tour-steps li.is-done .tour-step-title { color: var(--ink-2); }
.tour-step-why { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; margin-top: 2px; }
.tour-foot { margin: 0; padding: 10px 16px 14px; font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); }
@keyframes tour-pop { 0% { transform: scale(0.4); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* The spotlight: a ring around the one control, the page dimmed around it. Clicks pass through. */
.tour-ring {
  display: none; position: fixed; z-index: 69; pointer-events: none; border-radius: 10px;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgba(20, 24, 31, 0.42);
  transition: left 0.15s ease, top 0.15s ease, width 0.15s ease, height 0.15s ease;
  animation: tour-pulse 1.6s ease-in-out infinite;
}
@keyframes tour-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgba(20, 24, 31, 0.42); }
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 0 9999px rgba(20, 24, 31, 0.42); }
}
.tour-bubble {
  position: fixed; z-index: 71; width: min(300px, calc(100vw - 24px));
  background: #1b2230; color: #eef1f5; border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 14px 36px rgba(20, 24, 31, 0.35); border-top: 3px solid var(--accent);
}
.tour-bubble.is-loose { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
.tour-bubble-title { font-weight: 700; font-size: 14.5px; color: #fff; }
.tour-bubble p { margin: 4px 0 10px; font-size: 13.5px; line-height: 1.45; color: #d4dae2; }
.tour-bubble-acts { display: flex; justify-content: flex-end; }
.tour-bubble .btn { background: #fff; color: #1b2230; border-color: #fff; }
@media (prefers-reduced-motion: reduce) {
  .tour-ring { animation: none; transition: none; }
  .tour-steps li.is-fresh .tour-check { animation: none; }
}
@media print { .tour, .tour-ring, .tour-bubble { display: none; } }

/* The depth chart's special teams units sit under one heading of their own. */
.dc-group {
  margin: 28px 0 0; font-size: 13px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-2);
}
/*
 * Adding and deleting a depth chart's rows. The delete is quiet until it is
 * reached for, like every delete that sits on a row people are working along.
 */
.dc-table .dc-row-tools { width: 1%; text-align: right; }
.dc-table .dc-delete { color: var(--ink-3); font-size: 16px; line-height: 1; }
.dc-table .dc-delete:hover:not(:disabled) {
  color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line));
}
.dc-table tfoot td { border-bottom: 0; }
.dc-add { color: var(--ink-2); }
.dc-add-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dc-add-form select { max-width: 240px; }
.dc-add-name { width: 200px; max-width: 100%; }
.dc-reset { margin-top: 8px; }
.dc-reset .btn { color: var(--ink-2); }

/* A shut section still prints: paper has no way to open it. */
@media print {
  .dc-fold .card-body[hidden] { display: block !important; }
  .dc-fold .fold-caret, .dc-fold .fold-summary { display: none; }
}

/* ---------------------------------------------------------------------------
   Phones

   The pages Basic is made of -- the schedule, the roster, games, opponents,
   their forms -- read on a phone's browser. Last in the file, so these win.
   The film and drawing tools are not here: they need a full-size screen.
   --------------------------------------------------------------------------- */

/* The sidebar's menu button: only where the sidebar is a bar across the top. */
.menu-toggle { display: none; }
.sidebar-menu { display: flex; flex-direction: column; flex: 1 1 auto; }

@media (max-width: 860px) {
  /*
   * The sidebar as a bar: the logo and a button naming the page that is open.
   * The team, the pages and the account open under it, over the page, rather
   * than all of it sitting above every page.
   */
  .sidebar { position: sticky; top: var(--demo-bar-h); z-index: 40; overflow: visible; }
  .sidebar .brand { flex-wrap: nowrap; padding: 10px 12px 10px 16px; }
  .sidebar .brand .wordmark { font-size: 22px; }
  .sidebar .brand .brand-lockup.has-sports { font-size: 26px; }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 10px; margin-left: auto; flex: 0 0 auto;
    padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--sidebar-edge);
    background: var(--sidebar-raise); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  }
  .menu-toggle-icon { font-size: 17px; line-height: 1; }
  .sidebar-menu {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    max-height: calc(100dvh - var(--demo-bar-h) - 60px); overflow-y: auto;
    background: var(--sidebar-bg); border-top: 1px solid var(--sidebar-edge);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  }
  .sidebar.is-open .sidebar-menu { display: flex; }
  /* Fingers, not a pointer: the links a little taller. */
  .sidebar-menu .nav a { padding-top: 11px; padding-bottom: 11px; font-size: 15px; }
  .sidebar-menu .team-switch select { font-size: 16px; }
  .sidebar-menu .sidebar-foot { margin-top: 8px; }
}

@media (max-width: 600px) {
  /* The demo's strip: its name and its two buttons, on one line. */
  .demo-bar { gap: 8px; padding: 6px 10px; font-size: 13px; flex-wrap: nowrap; }
  .demo-bar-about { display: none; }
  .demo-bar-say { margin-right: auto; white-space: nowrap; }

  /*
   * A table as cards (table.phone-cards). Each row is one card, its cells
   * flowing along it; the cells say where they go:
   *   .pc-grow   takes the room left on its line (a name)
   *   .pc-end    sits at the end of its line (a result, a rate)
   *   .pc-full   a line to itself
   *   .pc-after  after the rest of the first line, whatever order it was built in
   *   .pc-indent lines up under the name rather than the picture
   *   .pc-hide   not on a phone
   * The headings go: a card says what it is without them.
   */
  .table-wrap:has(> table.phone-cards) { overflow-x: visible; }
  table.phone-cards, table.phone-cards tbody { display: block; }
  table.phone-cards thead { display: none; }
  table.phone-cards tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
    padding: 10px 12px; border-bottom: 1px solid var(--line);
  }
  table.phone-cards tbody tr:last-child { border-bottom: 0; }
  table.phone-cards td { display: block; padding: 0; border: 0; min-width: 0; }
  table.phone-cards td[colspan] { flex: 1 1 100%; }
  table.phone-cards .pc-grow { flex: 1 1 0; }
  table.phone-cards .pc-end { margin-left: auto; text-align: right; }
  table.phone-cards .pc-full { flex: 1 1 100%; }
  table.phone-cards .pc-after { order: 2; }
  table.phone-cards .pc-hide { display: none; }
  table.phone-cards .pc-indent { padding-left: 54px; }
  table.phone-cards td .place-addr { max-width: 100%; }
  table.phone-cards .game-row-acts { text-align: right; }
  /* A game's date and kick-off on one line. */
  table.games-cards td.nowrap > div { display: inline; margin-left: 8px; }
  table.phone-cards .avatar-cell { width: auto; }
  /* The roster: number and name side by side, then the positions under them. */
  table.roster-cards td.num { min-width: 22px; }

  /*
   * Dialogs: nearly the whole screen, with less padding. The space round a
   * dialog and inside its boxes is width a phone does not have. The height is
   * the screen that can be seen (dvh), so iOS Safari's bars do not push the
   * buttons off the bottom.
   */
  .modal-backdrop { padding: 6px; }
  .modal { max-height: calc(100dvh - 12px); }
  /*
   * With the keyboard up, iOS Safari shrinks and moves the part of the screen
   * that can be seen (the visual viewport) while fixed things stay where they
   * were: a dialog centred on the whole screen ends up half under the keyboard
   * and slides about as each box is tapped. So the backdrop is laid over the
   * part that can be seen (--vv-top and --vv-height, from util.js), the dialog
   * fits inside it and scrolls within itself, and the page behind stays still.
   */
  .modal-backdrop, .drawer-backdrop { top: var(--vv-top, 0px); bottom: auto; height: var(--vv-height, 100dvh); }
  .modal { max-height: calc(var(--vv-height, 100dvh) - 12px); }
  .modal-body { overscroll-behavior: contain; }
  html.has-overlay, html.has-overlay body { overflow: hidden; }
  .modal-head { padding: 14px 14px 0; }
  .modal-body { padding: 12px 14px; }
  .modal-foot { padding: 10px 14px; }
  .entry-group { padding: 8px 10px 0; }
  .entry-group.notify-box, .entry-group:has(> .check-row) { padding-bottom: 8px; }
  /* The date and the start time side by side; the duration under them. */
  .entry-form .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  /*
   * 16px, so iOS does not zoom the page in when a box is tapped. The boxes'
   * own rule names five input types it leaves out, which makes it stronger
   * than a plain `input` here: without !important this lost, the boxes stayed
   * 13px, and every tap on a form zoomed the page and pushed it off the screen.
   */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
  select, textarea, .input { font-size: 16px !important; }
  .page { padding: 14px 12px 48px; }
}

/* ---------------------------------------------------------------------------
   The playbook on paper (components/print-playbook.js)

   US Letter, landscape. A cover, then a page per four plays: one bordered
   table, the formation in a grey bar across the top and each play's name in a
   grey bar over its diagram -- the layout of a coach's own Word playbook.
   Only ever shown while printing.
   --------------------------------------------------------------------------- */
.pbk { display: none; }

@page playbook { size: letter landscape; margin: 0.5in 0.75in; }

@media print {
  body.printing-playbook .app,
  body.printing-playbook .demo-bar,
  body.printing-playbook #modal-root,
  body.printing-playbook #toast-root,
  body.printing-playbook .import-reading,
  body.printing-playbook .tour { display: none !important; }
  body.printing-playbook .pbk { display: block; }

  .pbk { color: #000; font-family: Calibri, Carlito, 'Segoe UI', Arial, sans-serif; }
  .pbk-page {
    page: playbook;
    break-after: page; page-break-after: always;
    height: 7.45in; display: flex; flex-direction: column; justify-content: center;
  }
  .pbk-page:last-child { break-after: auto; page-break-after: auto; }

  .pbk-cover { align-items: center; gap: 0.25in; }
  .pbk-logo { max-width: 6.6in; max-height: 4.6in; object-fit: contain; }
  .pbk-title { margin: 0; font-size: 24pt; font-weight: 700; text-align: center; }

  .pbk-head {
    margin: 0; padding: 3pt 0; font-size: 15pt; font-weight: 700; text-align: center;
    background: #e8e8e8; border: 1pt solid #000; border-bottom: 0;
  }
  /*
   * The table's lines are the black showing through a gap between white cells,
   * one point wide like a Word table's -- a hairline vanishes once printed.
   */
  .pbk-grid {
    display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 3.5in 3.5in; gap: 1pt;
    background: #000; border: 1pt solid #000;
  }
  .pbk-play { margin: 0; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: #fff; overflow: hidden; }
  .pbk-name {
    padding: 2pt 4pt; font-size: 12pt; font-weight: 700; text-align: center;
    background: #e8e8e8; border-bottom: 1pt solid #000;
  }
  .pbk-diagram { flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; background: #fff; }
  .pbk-diagram svg { width: 100%; height: 100%; display: block; }
  .pbk-notes { margin: 0; padding: 2pt 6pt 4pt; font-size: 9pt; line-height: 1.25; }
}

/* ---------------------------------------------------------------------------
   Arranging the printed playbook (views/playbook-book.js)

   Laid out the way it prints: a section a card, two plays across, a page
   break after every four.
   --------------------------------------------------------------------------- */
.bk-page { max-width: 1100px; }
.bk-scopes { margin-bottom: 12px; }
.bk-options { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 22px; }
.bk-options .check-row { margin: 0 0 10px; }
.bk-title-field { flex: 1 1 320px; margin-bottom: 6px; }
.bk-summary { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); }
.bk-status { color: var(--ink-3); }

.bk-section { margin-top: 14px; }
.bk-section-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px;
  background: var(--surface-2); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}
.bk-heading { flex: 1 1 260px; max-width: 460px; font-weight: 700; font-size: 15px; }
.bk-heading-text { margin: 0; flex: 1 1 auto; font-size: 16px; }
.bk-count { font-size: 12.5px; }
.bk-section-acts { display: flex; gap: 4px; margin-left: auto; }
.bk-out .bk-section-head { background: transparent; }
.bk-out { border-style: dashed; }

.bk-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px;
  min-height: 90px; border-radius: 0 0 var(--radius) var(--radius); transition: background 0.1s;
}
.bk-grid.is-over { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.bk-empty {
  grid-column: 1 / -1; display: grid; place-items: center; min-height: 70px;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--ink-3); font-size: 13px;
}
/* Where the printed page turns over. */
.bk-break {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 10px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3);
}
.bk-break::before, .bk-break::after { content: ''; flex: 1; border-top: 1.5px dashed var(--line-strong); }

.bk-tile {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.bk-tile[draggable="true"] { cursor: grab; }
.bk-tile[draggable="true"]:hover { border-color: var(--line-strong); }
.bk-tile.is-dragging { opacity: 0.35; }
.bk-tile-name { font-weight: 700; font-size: 13.5px; text-align: center; }
.bk-tile .dg-frame { pointer-events: none; }
.bk-tile .dg-frame .dg { width: 100%; height: auto; display: block; }
.bk-tile-acts { display: flex; align-items: center; gap: 4px; }
.bk-move { margin-left: auto; max-width: 60%; font-size: 12.5px; padding: 3px 6px; }
/* Where a dragged play would land: a bar on the side it goes. */
.bk-tile.drop-before { box-shadow: -4px 0 0 0 var(--accent); }
.bk-tile.drop-after { box-shadow: 4px 0 0 0 var(--accent); }
.bk-add { margin-top: 12px; }

@media (max-width: 600px) {
  .bk-grid { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  /* The arranging page itself is not what prints: the book is. */
  .bk-page { display: none; }
}

/* ---------------------------------------------------------------------------
   A player's trading card (components/trading-card.js)
   --------------------------------------------------------------------------- */
.tcard-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tcard-sides figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tcard-sides figcaption { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
/* The canvas is drawn at print size; on screen it is shown at the dialog's width, in the card's shape. */
.tcard { width: 100%; max-width: 300px; height: auto; aspect-ratio: 5 / 7; border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
.tcard-options { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 14px; }
.tcard-options input[type="color"] { width: 72px; height: 38px; padding: 2px; }
.tcard-about { flex: 1 1 280px; }
.tcard-print { display: none; }

@media print {
  body.printing-card .app,
  body.printing-card .demo-bar,
  body.printing-card #modal-root,
  body.printing-card #toast-root,
  body.printing-card .tour { display: none !important; }
  /* Front beside back, each at a real card's size, to cut out and glue back to back. */
  body.printing-card .tcard-print { display: flex; gap: 0.25in; justify-content: center; padding-top: 0.25in; }
  .tcard-print img { width: 2.5in; height: 3.5in; }
}

/* ---------------------------------------------------------------------------
   The call sheet on paper (components/print-call-sheet.js)

   US Letter, landscape, as small as it reads: the situation boxes in
   columns, each a coloured bar over its numbered calls -- runs red, passes
   blue, screens green, the colours sideline sheets use. Only shown while
   printing.
   --------------------------------------------------------------------------- */
.cs-print { display: none; }

/* Its paper -- Letter, landscape or portrait -- is set while it prints (printCallSheet). */

@media print {
  body.printing-call-sheet .app,
  body.printing-call-sheet .demo-bar,
  body.printing-call-sheet #modal-root,
  body.printing-call-sheet #toast-root,
  body.printing-call-sheet .import-reading,
  body.printing-call-sheet .tour { display: none !important; }
  body.printing-call-sheet .cs-print { display: block; }

  .cs-page { break-after: page; page-break-after: always; }
  .cs-page:last-child { break-after: auto; page-break-after: auto; }
}

/* The sheet's look, on paper and while printCallSheet measures it to fit one
   page (as wide as the page it prints on: Letter, landscape or portrait, less the margins). --cs-scale shrinks the
   type when the boxes would run onto a second page. */
body.cs-measuring .cs-print {
  display: block; position: absolute; left: -10000px; top: 0; background: #fff;
}
.cs-print { color: #000; font-family: Arial, 'Helvetica Neue', sans-serif; }
.cs-print .cs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12pt; margin-bottom: 4pt; }
.cs-print .cs-title { margin: 0; font-size: calc(13pt * var(--cs-scale, 1)); font-weight: 700; }
.cs-print .cs-legend { display: flex; gap: 10pt; font-size: calc(8pt * var(--cs-scale, 1)); font-weight: 700; }
/* The inset keeps the last column's border inside the printable area. */
.cs-print .cs-boxes { column-gap: 5pt; padding: 0 1.5pt; }
/* The coach's columns, side by side: each box in the column it was put in. */
.cs-print .cs-cols { display: grid; gap: 5pt; align-items: start; padding: 0 1.5pt; }
.cs-print .cs-col { min-width: 0; }
.cs-print .cs-box { break-inside: avoid; page-break-inside: avoid; margin: 0 0 5pt; border: 1pt solid #000; }
.cs-print .cs-box-head {
  padding: 1pt 4pt; font-size: calc(8.5pt * var(--cs-size, 1) * var(--cs-scale, 1)); font-weight: 700; text-align: center; text-transform: uppercase;
  border-bottom: 1pt solid #000; -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
/* --cs-size is the coach's text size (8pt = 1); --cs-scale shrinks it, when need be, to fit one page. */
.cs-print .cs-table { width: 100%; border-collapse: collapse; font-size: calc(8pt * var(--cs-size, 1) * var(--cs-scale, 1)); line-height: 1.15; }
.cs-print .cs-table td { padding: 0.6pt 3pt; border-top: 0.5pt solid #999; vertical-align: top; text-align: left; background: #fff; }
.cs-print .cs-box .cs-table tr:first-child td { border-top: 0; }
.cs-print .cs-list .cs-table { border-bottom: 0.5pt solid #999; }
.cs-print .cs-table .cs-n { width: 1%; white-space: nowrap; font-weight: 700; color: #000; border-right: 0.5pt solid #999; text-align: right; }
.cs-print .cs-table .cs-f { white-space: nowrap; color: #000; font-weight: 400; }
.cs-print .cs-table .cs-p { font-weight: 700; text-transform: uppercase; overflow-wrap: anywhere; }
.cs-print .cs-list .cs-table tr { break-inside: avoid; }
/* Each play in the colour the coach chose for it; black otherwise. */
.cs-print .cs-pc-red .cs-p { color: #d00000; }
.cs-print .cs-pc-blue .cs-p { color: #0050c8; }
.cs-print .cs-pc-green .cs-p { color: #127a30; }
.cs-print .cs-pc-orange .cs-p { color: #d46b00; }
.cs-print .cs-pc-purple .cs-p { color: #6f2dbd; }
.cs-print .cs-run, .cs-print .cs-run .cs-p { color: #d00000; }
.cs-print .cs-pass, .cs-print .cs-pass .cs-p { color: #0050c8; }
.cs-print .cs-screen, .cs-print .cs-screen .cs-p { color: #127a30; }

/* Box header colours, on paper and on the page. */
.cs-color-yellow { background: #fff200; color: #000; }
.cs-color-red { background: #e0281e; color: #fff; }
.cs-color-blue { background: #1f5fd6; color: #fff; }
.cs-color-green { background: #2c9a44; color: #fff; }
.cs-color-orange { background: #f5a03a; color: #000; }
.cs-color-grey { background: #d6d6d6; color: #000; }

/* ---------------------------------------------------------------------------
   Laying out the call sheet (views/call-sheet.js)

   The boxes in the columns they print in, with the team's plays beside them
   to drag in.
   --------------------------------------------------------------------------- */
.cs-page-edit { max-width: 1500px; }

/* Which saved sheet this is, on the call sheet and wristband pages (components/saved-sheets.js). */
.cs-saved { margin-bottom: 12px; }
.cs-saved-body { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.cs-saved-pick { flex: 1 1 200px; max-width: 340px; min-width: 180px; }
.cs-saved .cs-saved-body .cs-saved-pick { margin: 0; }
.cs-saved-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-save { min-width: 92px; }
.cs-save:disabled { opacity: 1; color: var(--ink-3); cursor: default; }
.cs-key { display: inline-flex; gap: 10px; font-weight: 700; }
.cs-page-edit .cs-run { color: #c81e1e; }
.cs-page-edit .cs-pass { color: #1f5fd6; }
.cs-page-edit .cs-screen { color: #1f8a3c; }
.cs-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; margin-top: 14px; }
/* The columns as they print, each a place to drop boxes, with its own + Add box. */
.cs-cols-edit { display: grid; gap: 10px; align-items: start; }
/* A readable width for every column; on a narrow window the columns scroll sideways. */
.cs-page-edit .cs-main { min-width: 0; overflow-x: auto; padding-bottom: 4px; }
.cs-page-edit .cs-cols-edit { grid-auto-columns: minmax(200px, 1fr); }
/* The box's name sits on its coloured bar, not in a form field's box. */
.cs-edit-box .cs-edit-head input.cs-heading {
  width: auto; background: transparent !important; color: inherit !important; border-color: transparent !important; box-shadow: none;
}
.cs-edit-box .cs-edit-head input.cs-heading:hover, .cs-edit-box .cs-edit-head input.cs-heading:focus { border-color: currentColor !important; }
/* In a column: + Add a play across the box, the colour and arrows under it. */
.cs-col-edit .cs-edit-foot select.cs-add { flex: 1 1 100%; }
.cs-col-edit .cs-edit-foot select.cs-color { flex: 0 1 84px; }
.cs-col-edit .cs-edit-foot .btn-danger { margin-left: auto; }
.cs-col-edit {
  min-width: 0; display: flex; flex-direction: column; padding: 6px; min-height: 140px;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); transition: background 0.1s, border-color 0.1s;
}
.cs-col-edit.is-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.cs-col-head { display: flex; justify-content: space-between; gap: 6px; margin: 0 2px 6px; font-size: 12px; color: var(--ink-3); }
.cs-col-head strong { color: var(--ink-2); }
.cs-col-meter.is-over { color: var(--accent); font-weight: 700; }
.cs-col-add { width: 100%; margin-top: 2px; }
.cs-edit-box.drop-before { box-shadow: 0 -4px 0 0 var(--accent); }
.cs-edit-box.drop-after { box-shadow: 0 4px 0 0 var(--accent); }
.cs-edit-box.is-dragging { opacity: 0.4; }
.cs-edit-head { display: flex; align-items: center; gap: 2px; }
.cs-edit-head .cs-heading { flex: 1; min-width: 0; }
.cs-grip { flex: 0 0 auto; padding: 0 3px; cursor: grab; user-select: none; font-size: 15px; line-height: 1; opacity: 0.75; }
/* The whole box picks up: a grab hand on its bar and edges. */
.cs-edit-box[draggable="true"] { cursor: grab; }
.cs-edit-box[draggable="true"] input, .cs-edit-box[draggable="true"] select, .cs-edit-box[draggable="true"] button { cursor: auto; }
.cs-edit-box[draggable="true"] button { cursor: pointer; }
.cs-edit-box[draggable="true"] input.cs-heading { cursor: text; }
.cs-grip:hover { opacity: 1; }
.cs-edit-box {
  break-inside: avoid; margin: 0 0 10px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden;
}
.cs-edit-head { padding: 4px 6px; }
.cs-heading {
  width: 100%; box-sizing: border-box; padding: 3px 4px; border: 1px solid transparent; border-radius: 4px;
  background: transparent; color: inherit; font: inherit; font-weight: 800; font-size: 13px;
  text-align: center; text-transform: uppercase; display: block;
}
input.cs-heading:hover, input.cs-heading:focus { border-color: currentColor; outline: none; }
.cs-heading::placeholder { color: inherit; opacity: 0.6; text-transform: none; }
.cs-rows { min-height: 34px; padding: 2px 0; transition: background 0.1s; }
.cs-rows.is-over { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.cs-row, .cs-lib-row {
  display: flex; align-items: center; gap: 6px; padding: 3px 6px; font-size: 12.5px; line-height: 1.25;
  border-top: 1px solid var(--line);
}
.cs-row:first-child { border-top: 0; }
.cs-row[draggable="true"], .cs-lib-row[draggable="true"] { cursor: grab; }
.cs-row.is-dragging, .cs-lib-row.is-dragging { opacity: 0.35; }
.cs-row.drop-before { box-shadow: inset 0 3px 0 0 var(--accent); }
.cs-row.drop-after { box-shadow: inset 0 -3px 0 0 var(--accent); }
.cs-row-n { min-width: 2.2em; text-align: right; font-weight: 800; color: var(--ink); }
.cs-row-name { min-width: 0; font-weight: 700; text-transform: uppercase; overflow-wrap: anywhere; }
.cs-row-f { color: var(--ink-3); font-size: 11.5px; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.cs-x {
  margin-left: 4px; border: 0; background: none; color: var(--ink-3); font-size: 15px; line-height: 1;
  cursor: pointer; padding: 0 2px; border-radius: 4px;
}
.cs-row-f + .cs-x { margin-left: 4px; }
.cs-row-name + .cs-x { margin-left: auto; }
.cs-x:hover { color: var(--bad, #b42318); background: var(--surface-2); }
.cs-empty { padding: 8px; text-align: center; font-size: 12px; color: var(--ink-3); }
.cs-edit-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 5px 6px; background: var(--surface-2); border-top: 1px solid var(--line); }
.cs-add { flex: 1 1 0; min-width: 0; font-size: 12px; padding: 3px 4px; }
.cs-color { flex: 0 0 76px; min-width: 0; font-size: 12px; padding: 3px 4px; }

.cs-lib { position: sticky; top: 12px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; }
.cs-lib-head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.cs-lib-head h2 { margin: 0; font-size: 15px; }
/* The plays list's title, with its numbering button in the corner. */
.sp-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cs-lib-hint { font-size: 12px; }
.cs-lib-list { overflow-y: auto; padding-bottom: 6px; }
.cs-lib-row:first-child { border-top: 0; }
.cs-lib-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cs-lib-name .cs-row-f { margin-left: 0; max-width: none; }
.cs-lib-row input.cs-num { flex: 0 0 4.4em; min-width: 0; padding: 2px 4px; font-weight: 700; text-align: right; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--ink); }
.cs-lib-row input.cs-num.is-dup { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.cs-uses { font-size: 11px; color: var(--ink-3); }

@media (max-width: 900px) {
  .cs-layout { grid-template-columns: 1fr; }
  .cs-lib { position: static; max-height: 420px; }
}

/* ---------------------------------------------------------------------------
   Wristband cards (components/wristband.js, views/wristband.js)

   Each card at its real size in inches, a ruled table like a spreadsheet's:
   "# | Play" across, the header row grey. Black on white on the screen too,
   because the screen is showing the paper. Printed on Letter, the cards
   side by side to cut out.
   --------------------------------------------------------------------------- */
.wb-sheet { display: flex; flex-wrap: wrap; gap: 18px 0.25in; align-items: flex-start; }
/* A printed page: the cards in a grid, as many across and down as fit. */
.wb-sheet-page { display: grid; justify-content: center; align-content: start; }
.wb-card {
  box-sizing: border-box; overflow: hidden; background: #fff; color: #000;
  font-family: Calibri, Carlito, 'Segoe UI', Arial, sans-serif; outline: 1px dashed #999; outline-offset: 0.04in;
}
.wb-table { width: 100%; height: 100%; border-collapse: collapse; table-layout: fixed; }
.wb-col-n { width: 16%; }
.wb-table td, .wb-table th {
  height: var(--wb-line); padding: 0 0.03in; border: 0.75pt solid #000; background: #fff; color: #000;
  font-size: var(--wb-font); line-height: 1; white-space: nowrap; overflow: hidden; vertical-align: middle;
}
.wb-table th { background: #d9d9d9; font-weight: 700; text-align: center; text-transform: none; letter-spacing: normal; }
.wb-table td.wb-n { text-align: center; font-weight: 700; }
.wb-table td.wb-p > span { display: block; overflow: hidden; text-overflow: ellipsis; }
/* Each play in the colour the coach chose for it on the call sheet; black otherwise. */
.wb-table td.wb-pc-red { color: #d00000; }
.wb-table td.wb-pc-blue { color: #0050c8; }
.wb-table td.wb-pc-green { color: #127a30; }
.wb-table td.wb-pc-orange { color: #d46b00; }
.wb-table td.wb-pc-purple { color: #6f2dbd; }
.wb-head th, .wb-table td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/*
 * A picture card (components/wristband.js, pictureCardElement): the heading,
 * then a tile a play -- its number in a black corner badge, its drawing
 * (play-diagram.js, renderPicture), its name under it. Assignments near-black
 * and the ball's path red at this size; all black on a black-and-white card.
 * Sizes come from the card (--wbp-*), so bigger tiles draw everything bigger.
 */
.wbp {
  box-sizing: border-box; display: grid; overflow: hidden; background: #fff; color: #000;
  border: 0.75pt solid #000; outline: 1px dashed #999; outline-offset: 0.04in;
  font-family: Calibri, Carlito, 'Segoe UI', Arial, sans-serif;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.wbp-head {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden;
  background: #d9d9d9; border-bottom: 0.75pt solid #000; font-size: var(--wbp-head); font-weight: 700; line-height: 1; white-space: nowrap;
}
.wbp-tile {
  position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
  border-right: 0.75pt solid #000; border-bottom: 0.75pt solid #000; background: #fff;
}
.wbp-tile.is-last-col { border-right: 0; }
.wbp-tile.is-last-row { border-bottom: 0; }
.wbp-tile.is-head { align-items: center; justify-content: center; padding: 0 0.05in; background: #d9d9d9; font-size: var(--wbp-name); font-weight: 700; text-align: center; }
.wbp-n {
  position: absolute; left: 0; top: 0; z-index: 2; min-width: 1.6em; padding: 0 0.2em;
  background: #111; color: #fff; font-size: var(--wbp-badge); font-weight: 700; line-height: 1.15; text-align: center;
  border-bottom-right-radius: 0.3em;
}
/* The number in the play's call-sheet colour, so a coloured play stands out on a picture card too. */
.wbp-n.wbp-pc-red { background: #d00000; }
.wbp-n.wbp-pc-blue { background: #0050c8; }
.wbp-n.wbp-pc-green { background: #127a30; }
.wbp-n.wbp-pc-orange { background: #d46b00; }
.wbp-n.wbp-pc-purple { background: #6f2dbd; }
.wbp-pic { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0.02in 0.02in 0; }
.wbp-pic .dg { width: 100%; height: 100%; display: block; background: none; --dg-assign: #2b2b2b; --dg-motion: #111; }
.wbp-pic .dg .dg-player, .wbp-pic .dg .dg-ball { filter: none; }
.wbp.is-mono .wbp-pic .dg { --dg-carry: #000; --dg-assign: #6a6a6a; --dg-motion: #000; }
.wbp.is-mono .wbp-n { background: #111; }
.wbp-pic.is-words { padding: 0 0.06in; font-size: calc(var(--wbp-name) * 1.3); font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.wbp-name {
  padding: 0 0.03in 0.02in; font-size: var(--wbp-name); font-weight: 700; line-height: 1.1; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* A highlighted play: its name strip shaded, as its row is on a word card. */
.wbp-tile.wbp-hl-yellow .wbp-name { background: #fff200; }
.wbp-tile.wbp-hl-green .wbp-name { background: #b8f0b0; }
.wbp-tile.wbp-hl-blue .wbp-name { background: #bfe0ff; }
.wbp-tile.wbp-hl-pink .wbp-name { background: #ffc8e6; }
.wbp-tile.wbp-hl-orange .wbp-name { background: #ffd59e; }
.wb-options .wb-style { flex: 0 0 auto; margin-bottom: 12px; }
/* Each card's own Words / Pictures switch, small, in its header. */
.wb-editor-head .wb-card-style { flex: 0 0 auto; }
.wb-editor-head .wb-card-style button { padding: 3px 10px; font-size: 12px; }
.wb-options .check-row { align-self: flex-end; margin-bottom: 12px; }

/* Off screen but laid out, so the long names can be measured and fitted before printing. */
.wb-print { position: absolute; left: -10000px; top: 0; }
@page wristband { size: letter portrait; margin: 0.3in; }
@page wristband-landscape { size: letter landscape; margin: 0.3in; }
@media print {
  body.printing-wristband .app,
  body.printing-wristband .demo-bar,
  body.printing-wristband #modal-root,
  body.printing-wristband #toast-root,
  body.printing-wristband .import-reading,
  body.printing-wristband .tour { display: none !important; }
  .wb-print { display: none; }
  body.printing-wristband .wb-print { display: block; position: static; }
  .wb-sheet-page { page: wristband; break-after: page; page-break-after: always; }
  .wb-print.is-landscape .wb-sheet-page { page: wristband-landscape; }
  .wb-sheet-page:last-child { break-after: auto; page-break-after: auto; }
}

.wb-page { max-width: 1500px; }
.wb-options .wb-num-field { flex: 0 0 auto; margin-bottom: 6px; }
.wb-options .wb-num-field input { width: 90px; }
.wb-options > .btn { margin-bottom: 10px; }
.wb-h2 { margin: 6px 0 10px; font-size: 15px; }
.wb-note { margin: -4px 0 10px; font-size: 13px; }
.wb-preview { padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; overflow-x: auto; }
.wb-series-list { columns: 230px; column-gap: 10px; }
.wb-lib-acts { display: flex; gap: 6px; }
.wb-lib-row {
  display: flex; align-items: center; gap: 6px; padding: 3px 8px; border-top: 1px solid var(--line); font-size: 12.5px;
}
.wb-lib-row:first-child { border-top: 0; }
.wb-lib-row input[type="checkbox"] { flex: 0 0 auto; width: auto; }
.wb-lib-row input.cs-num { flex: 0 0 4.4em; min-width: 0; padding: 2px 4px; font-weight: 700; text-align: right; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--ink); }
.wb-lib-row input.cs-num.is-dup { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.wb-lib-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wb-lib-row input.wb-words { padding: 2px 5px; font-size: 12.5px; font-weight: 700; text-transform: none; }
.wb-lib-row.cs-run input.wb-words { color: #c81e1e; }
.wb-lib-row.cs-pass input.wb-words { color: #1f5fd6; }
.wb-lib-row.cs-screen input.wb-words { color: #1f8a3c; }
.wb-lib-row.is-off { opacity: 0.5; }
.wb-lib-row .cs-row-f { margin: 1px 0 0 5px; }
.wb-card-wrap { display: flex; flex-direction: column; gap: 6px; }
.wb-cap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; max-width: 3.4in; }
.wb-cap .wb-card-title { flex: 1 1 110px; min-width: 0; padding: 3px 6px; font-size: 12.5px; }
.wb-over { color: var(--accent); font-weight: 700; }
.wb-card-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 18px; }
.wb-chips { display: flex; gap: 3px; flex: 0 0 auto; }
.wb-chip {
  width: 22px; height: 22px; padding: 0; border-radius: 5px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-3); font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.wb-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.wb-chip:disabled { cursor: default; }
.wb-table th.wb-p > span { display: block; overflow: hidden; text-overflow: ellipsis; }

/* The playbook's own pages: the title, then a row of buttons with the way back at its far left. */
.pb-head { flex-direction: column; align-items: stretch; }
.pb-head .actions { width: 100%; justify-content: flex-end; }
.pb-head .actions > .help-back { margin-right: auto; }
.pb-titlebar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.pb-titlebar h1 { margin: 0; }

/* Filling the cards: each card a grid of numbered cells, a play in each. */
.wb-editors { display: grid; gap: 14px; margin-bottom: 12px; }
.wb-editor { padding: 0; overflow: hidden; }
.wb-editor-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 12px;
  background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 13px;
}
.wb-editor-head strong { font-size: 15px; }
.wb-editor-head .wb-card-title { flex: 0 1 220px; min-width: 0; padding: 4px 8px; font-size: 13px; }
.wb-editor-acts { display: flex; gap: 4px; margin-left: auto; }
.wb-grid { display: grid; gap: 0 14px; padding: 8px 12px 12px; }
.wb-col { display: grid; gap: 3px; min-width: 0; }
.wb-cell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.wb-cell-n { flex: 0 0 2.4em; text-align: right; font-weight: 800; font-size: 13px; color: var(--ink); }
.wb-cell-body {
  flex: 1; min-width: 0; min-height: 30px; display: flex; align-items: center;
  border: 1px dashed var(--line-strong); border-radius: 5px; transition: background 0.1s, border-color 0.1s;
}
.wb-cell-body.is-over { border-color: var(--accent); border-style: solid; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.wb-cell-body select.wb-pick {
  flex: 1 1 0; min-width: 0; border: 0; background: transparent; color: var(--ink-3); font-size: 12.5px; padding: 4px 6px; box-shadow: none;
}
.wb-slot { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; padding: 4px 6px; }
.wb-slot.is-filled { background: var(--surface); border-radius: 4px; cursor: grab; }
.wb-slot.is-dragging { opacity: 0.35; }
.wb-slot-name { flex: 1; min-width: 0; font-weight: 700; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-slot.cs-pc-red .wb-slot-name { color: #e0453a; }
.wb-slot.cs-pc-blue .wb-slot-name { color: #3f7fe8; }
.wb-slot.cs-pc-green .wb-slot-name { color: #2fa356; }
.wb-slot.cs-pc-orange .wb-slot-name { color: #e8862a; }
.wb-slot.cs-pc-purple .wb-slot-name { color: #9b6be0; }
.wb-slot .cs-x { margin-left: auto; }
.wb-where { flex: 0 0 4.2em; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.wb-where b { font-size: 13px; color: var(--ink); }
.wb-where small { font-size: 10.5px; color: var(--ink-3); }
.wb-lib-row[draggable="true"] { cursor: grab; }
.wb-lib .cs-lib-list.is-over { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.wb-off-only { margin: 0; font-size: 12.5px; }
.cs-num-fixed { flex: 0 0 4.4em; }
/* A header in a card's cell: typed in place, on the grey of the card's own header row. */
.wb-head-slot { background: var(--surface-2); }
.wb-head-slot input.wb-head-input {
  flex: 1; min-width: 0; padding: 2px 6px; border: 1px solid transparent; border-radius: 4px;
  background: transparent; color: var(--ink); font: inherit; font-weight: 800; font-size: 12.5px; text-align: center;
}
.wb-head-slot input.wb-head-input:hover, .wb-head-slot input.wb-head-input:focus { border-color: var(--line-strong); outline: none; }
/* A play typed in by hand: in place, like a play from the playbook. */
.wb-text-slot input.wb-text-input {
  flex: 1; min-width: 0; padding: 2px 6px; border: 1px solid transparent; border-radius: 4px;
  background: transparent; color: var(--ink); font: inherit; font-weight: 700; font-size: 12.5px;
}
.wb-text-slot input.wb-text-input:hover, .wb-text-slot input.wb-text-input:focus { border-color: var(--line-strong); outline: none; }
.wb-text-slot input.wb-text-input::placeholder { font-weight: 400; color: var(--ink-3); }
/* The wristband page: the cards across the page, no list beside them. */
.wb-body { margin-top: 14px; max-width: 1100px; }
/* A play's chosen colour on the page: the same colours, a shade lighter for a dark screen; black is the page's ink. */
.cs-page-edit .cs-pc-black .cs-row-name { color: var(--ink); }
.cs-page-edit .cs-pc-red .cs-row-name { color: #e0453a; }
.cs-page-edit .cs-pc-blue .cs-row-name { color: #3f7fe8; }
.cs-page-edit .cs-pc-green .cs-row-name { color: #2fa356; }
.cs-page-edit .cs-pc-orange .cs-row-name { color: #e8862a; }
.cs-page-edit .cs-pc-purple .cs-row-name { color: #9b6be0; }
.cs-lib-row select.cs-pc-pick { flex: 0 0 76px; min-width: 0; padding: 2px 4px; font-size: 12px; }
/* The plays list beside the call sheet and the wristband cards (components/sheet-plays.js). */
.sp-add { display: flex; gap: 6px; }
.sp-add .sp-add-input { flex: 1; min-width: 0; padding: 5px 8px; font-size: 13px; }
.sp-add .sp-add-number { flex: 0 0 4.2em; min-width: 0; padding: 5px 6px; font-size: 13px; }
.sp-add .btn { flex: 0 0 auto; }
.cs-lib-row.is-custom { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.cs-lib-row input.sp-name {
  width: 100%; padding: 1px 4px; border: 1px solid transparent; border-radius: 4px; background: transparent;
  color: inherit; font: inherit; font-weight: 700; text-transform: uppercase;
}
.cs-lib-row input.sp-name:hover, .cs-lib-row input.sp-name:focus { border-color: var(--line-strong); outline: none; }
.cs-page-edit .cs-pc-black input.sp-name, .wb-page .cs-pc-black input.sp-name { color: var(--ink); }
.cs-pc-red input.sp-name { color: #e0453a; }
.cs-pc-blue input.sp-name { color: #3f7fe8; }
.cs-pc-green input.sp-name { color: #2fa356; }
.cs-pc-orange input.sp-name { color: #e8862a; }
.cs-pc-purple input.sp-name { color: #9b6be0; }
/* The wristband page: the cards, and the plays list beside them. */
.wb-page .wb-body { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.wb-page .cs-pc-black .cs-row-name { color: var(--ink); }
.wb-page .cs-pc-red .cs-row-name { color: #e0453a; }
.wb-page .cs-pc-blue .cs-row-name { color: #3f7fe8; }
.wb-page .cs-pc-green .cs-row-name { color: #2fa356; }
.wb-page .cs-pc-orange .cs-row-name { color: #e8862a; }
.wb-page .cs-pc-purple .cs-row-name { color: #9b6be0; }
.wb-page .cs-lib-row select.cs-pc-pick { flex: 0 0 76px; min-width: 0; padding: 2px 4px; font-size: 12px; }
.wb-page .cs-lib-row input.cs-num { flex: 0 0 4.4em; min-width: 0; padding: 2px 4px; font-weight: 700; text-align: right; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--ink); }
.wb-page .cs-lib-row input.cs-num.is-dup { border-color: var(--accent); }
@media (max-width: 900px) { .wb-page .wb-body { grid-template-columns: 1fr; } }
/* A play's highlight: a shaded background and bold, on the call sheet, the cards and the pages. */
.cs-print tr.cs-hl-yellow td, .wb-table td.wb-hl-yellow { background: #fff200; }
.cs-print tr.cs-hl-green td, .wb-table td.wb-hl-green { background: #b8f0b0; }
.cs-print tr.cs-hl-blue td, .wb-table td.wb-hl-blue { background: #bfe0ff; }
.cs-print tr.cs-hl-pink td, .wb-table td.wb-hl-pink { background: #ffc8e6; }
.cs-print tr.cs-hl-orange td, .wb-table td.wb-hl-orange { background: #ffd59e; }
.cs-print tr[class*="cs-hl-"] td, .wb-table td[class*="wb-hl-"] {
  font-weight: 800; -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.cs-print tr.cs-hl-none td { font-weight: inherit; }
.cs-print tr.cs-hl-none td.cs-n { font-weight: 700; }
/* On the pages: the row shaded the same, its text dark so it reads on the shade. */
.cs-row.cs-hl-yellow, .cs-lib-row.cs-hl-yellow, .wb-slot.cs-hl-yellow { background: #fff200; }
.cs-row.cs-hl-green, .cs-lib-row.cs-hl-green, .wb-slot.cs-hl-green { background: #b8f0b0; }
.cs-row.cs-hl-blue, .cs-lib-row.cs-hl-blue, .wb-slot.cs-hl-blue { background: #bfe0ff; }
.cs-row.cs-hl-pink, .cs-lib-row.cs-hl-pink, .wb-slot.cs-hl-pink { background: #ffc8e6; }
.cs-row.cs-hl-orange, .cs-lib-row.cs-hl-orange, .wb-slot.cs-hl-orange { background: #ffd59e; }
:is(.cs-row, .cs-lib-row, .wb-slot):not(.cs-hl-none)[class*="cs-hl-"] :is(.cs-row-name, .wb-slot-name, .cs-row-n, input.sp-name) { font-weight: 800; }
:is(.cs-row, .cs-lib-row, .wb-slot).cs-pc-black:not(.cs-hl-none)[class*="cs-hl-"] :is(.cs-row-name, .wb-slot-name, .cs-row-n, input.sp-name, .cs-row-f) { color: #14181f; }
:is(.cs-row, .wb-slot):not(.cs-hl-none)[class*="cs-hl-"] .cs-x { color: #4a5563; }
.cs-lib-row:not(.cs-hl-none)[class*="cs-hl-"] .cs-row-f, .cs-lib-row:not(.cs-hl-none)[class*="cs-hl-"] .cs-uses { color: #4a5563; }
/* The colour and the highlight, one under the other beside the play. */
.sp-picks { flex: 0 0 auto; display: flex; flex-direction: column; gap: 2px; }
.cs-lib-row .sp-picks select { flex: none !important; width: 104px; min-width: 0; padding: 1px 4px; font-size: 11.5px; }
/* A password box's eye (components/password-eye.js): inside the box, on the right. */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { padding-right: 42px; }
.pw-eye {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--ink-3); cursor: pointer;
}
.pw-eye:hover { color: var(--ink); background: var(--surface-2); }
.pw-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pw-eye[aria-pressed="true"] { color: var(--ink); }

/* ---------- A new team's roster guide (views/roster.js) ---------- */
.roster-guide { margin-bottom: 14px; padding: 14px 18px 4px; border-left: 4px solid var(--accent); }
.roster-guide-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.roster-guide-head h3 { margin: 0 0 2px; font-size: 17px; }
.roster-guide-step { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.roster-guide-mark {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; background: var(--accent-soft); color: var(--accent);
}
.roster-guide-step.is-done .roster-guide-mark { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.roster-guide-text { flex: 1; min-width: 200px; }
.roster-guide-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.roster-guide-foot { display: flex; justify-content: flex-end; padding-top: 10px; border-top: 1px solid var(--line); }

/* The welcome on an account with no team yet (views/teams.js). */
.welcome-steps { list-style: none; margin: 14px auto 18px; padding: 0; display: grid; gap: 10px; max-width: 460px; text-align: left; }
.welcome-steps li { display: flex; gap: 12px; align-items: flex-start; }
.welcome-steps .roster-guide-mark { margin-top: 1px; }

/* A link dressed as a button (Open Messages): no underline. */
a.btn { text-decoration: none; }

/* Extra film storage, under the locker on Subscription. */
.sub-storage { display: grid; gap: 6px; margin-top: 8px; font-size: 13px; }
.sub-storage-acts { display: flex; gap: 8px; flex-wrap: wrap; }

/*
 * A locked feature, sold rather than padlocked (views/locked.js): what it does,
 * four reasons, a picture of it working, the plan's price and the way to it.
 */
.up { display: grid; gap: 22px; padding: 6px 4px; }
.up-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: center; }
.up-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em; background: var(--accent-soft); color: var(--accent);
}
.up-copy h2 { margin: 12px 0 8px; font-size: 26px; line-height: 1.15; color: var(--ink); }
.up-lead { margin: 0 0 14px; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.up-points { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 8px; }
.up-points li { position: relative; padding-left: 26px; color: var(--ink); font-size: 14.5px; line-height: 1.45; }
.up-points li::before {
  content: '✓'; position: absolute; left: 0; top: 1px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--good);
}
.up-price { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; }
.up-price b { color: var(--ink); }
.up-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.up-fine { margin: 12px 0 0; color: var(--ink-3); font-size: 13px; }
.up-picture { display: grid; gap: 6px; }
.up-example { color: var(--ink-3); font-size: 12px; text-align: right; }
.up-also { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.up-also a, .up-also .up-chip { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); text-decoration: none; }
.up-also a:hover { border-color: var(--accent); color: var(--accent); }
.up.is-tab { padding: 4px 0; }

/* The pictures: small, true-to-life panels of the feature working. */
.up-shot { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); overflow: hidden; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12); }
.up-shot table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.up-shot th { padding: 7px 9px; text-align: left; font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.up-shot td { padding: 6px 9px; border-bottom: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.up-shot td.num { text-align: right; font-variant-numeric: tabular-nums; }
.up-shot td.dim { color: var(--ink-3); }
.up-bd-bar, .up-plays-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.up-bd-bar b, .up-plays-head b { color: var(--ink); }
.up-bd-go { padding: 4px 9px; border-radius: 6px; background: var(--accent); color: #fff; font-weight: 600; font-size: 12px; }
.up-bd-found { padding: 8px 12px; background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--ink); font-size: 12.5px; border-bottom: 1px solid var(--line); }
.up-bd-q td { background: var(--head-bg); color: var(--ink); font-weight: 700; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.up-bd tr.u-off td:first-child { box-shadow: inset 3px 0 0 var(--offense); }
.up-bd tr.u-def td:first-child { box-shadow: inset 3px 0 0 var(--defense); }
.up-bd tr.u-st td:first-child { box-shadow: inset 3px 0 0 var(--special); }
.up-n { color: var(--ink-3); }
.up-pill { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.up-pill.u-off { background: color-mix(in srgb, var(--offense) 18%, transparent); color: var(--offense); }
.up-pill.u-def { background: color-mix(in srgb, var(--defense) 18%, transparent); color: var(--defense); }
.up-pill.u-st { background: color-mix(in srgb, var(--special) 20%, transparent); color: var(--special); }
.up-shot td.up-yds { font-family: ui-monospace, Consolas, monospace; font-weight: 600; color: var(--ink-3); }
.up-shot td.up-yds.gain { color: var(--good); }
.up-shot td.up-yds.loss { color: var(--bad); }
.up-shot td.up-call { color: var(--offense); white-space: nowrap; }
.up-shot td.up-n { color: var(--ink-3); }
.up-stats th:not(:first-child) { text-align: right; }
.up-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.up-tile { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface); }
.up-tile span { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.up-tile b { font-size: 26px; line-height: 1.05; color: var(--ink); }
.up-tile small { color: var(--ink-3); font-size: 12px; }
.up-plays-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; padding: 12px; }
.up-play { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.up-play img { display: block; width: 100%; aspect-ratio: 1023 / 720; object-fit: contain; background: #fff; }
.up-play figcaption { padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--ink); }
.up-pos { font-weight: 700; color: var(--accent); width: 48px; }
.up-reel-film { background: #0d1a12; }
.up-reel-film img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.up-reel-who { display: grid; gap: 4px; padding: 12px 14px; background: var(--surface); }
.up-reel-who b { font-size: 16px; color: var(--ink); }
.up-reel-who > span { font-size: 12.5px; color: var(--ink-3); }
.up-reel-stats, .up-reel-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.up-reel-stats span { padding: 3px 8px; border-radius: 6px; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--ink); }
.up-reel-acts span { padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.up-reel-acts .go { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 900px) {
  .up-main { grid-template-columns: 1fr; }
}

/* ---------- AI credits (components/ai-meter.js, views/subscription.js) ---------- */
/* The month's credits used, coloured by the warning reached: 50, 75, 90%. */
.credit-bar { height: 10px; border-radius: 5px; background: var(--surface-2, var(--line)); overflow: hidden; }
.credit-bar-fill { height: 100%; border-radius: 5px; background: var(--good); transition: width 0.3s; }
.credit-bar.is-mid .credit-bar-fill { background: var(--warn); }
.credit-bar.is-high .credit-bar-fill { background: color-mix(in srgb, var(--warn) 55%, var(--bad)); }
.credit-bar.is-bad .credit-bar-fill { background: var(--bad); }
.credit-meter { display: grid; gap: 6px; margin-bottom: 4px; }
.credit-meter-words { font-size: 13px; }
.credit-offers { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 12px; }
/* A pack to buy: the accent's red tile, its short name, the credits large and the price. */
.credit-offer {
  display: grid; justify-items: start; gap: 2px; min-width: 150px; padding: 10px 14px;
  border: 0; border-radius: 10px; background: var(--accent); color: #fff; cursor: pointer; text-align: left;
  font: inherit; box-shadow: var(--shadow);
}
.credit-offer:hover { filter: brightness(1.08); }
.credit-offer:disabled { opacity: 0.6; cursor: default; }
.credit-offer-name { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.9; }
.credit-offer-credits { font-size: 22px; font-weight: 800; line-height: 1.1; }
.credit-offer-credits small { font-size: 13px; font-weight: 600; opacity: 0.9; }
.credit-offer-price { font-size: 14px; font-weight: 700; }
/* The packs in the X Factor frame (components/x-factor.js), with the tiles' own spacing. */
.credit-offers .xf-group { gap: 10px; padding: 8px 8px 8px 12px; }
.credit-history { display: grid; gap: 8px; }
.credit-history summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.credit-uses { font-size: 13px; margin-top: 6px; }
.credit-packs { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.off-season-close { margin-left: auto; border: 0; background: none; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; opacity: 0.7; padding: 0 4px; }
.off-season-close:hover { opacity: 1; }
/* A field that has to be filled before the button works (components/formation-choice.js). */
.field-required { color: var(--bad); font-weight: 700; }
/*
 * X Factor (AI): the frame around every button that spends AI credits
 * (components/x-factor.js) -- red border, red wash, the label, the buttons.
 */
.xf-group {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 4px 5px 4px 10px; border: 1.5px solid var(--accent); border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
.xf-label {
  display: inline-flex; align-items: center; gap: 4px; margin-right: 2px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--accent-text); white-space: nowrap;
}
.xf-spark { font-size: 13px; }
.offer .xf-group { flex: none; }
/* The X Factor (AI) box in an AI dialog, holding the credits left (xFactorNote). */
.xf-note {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px;
  padding: 8px 12px; border: 1.5px solid var(--accent); border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
/* One baseline, the smaller capitals raised a pixel to sit centred beside the line. */
.xf-note .xf-label { align-items: baseline; position: relative; top: -1px; }
.xf-note-text { flex: 1 1 220px; min-width: 0; }
.xf-note .ai-meter { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.xf-note .ai-meter.is-out { color: var(--bad); }
.xf-ai { font-size: 11px; font-weight: 800; letter-spacing: 0.07em; color: var(--accent-text); vertical-align: 1px; }

/* How many plays the filters leave, beside them (views/playbook.js, views/playmaker.js). */
.play-count { font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }

/* What Plus adds, under free Basic's games (views/games.js, plusFilm). */
.plus-film { margin-top: 12px; flex: 0 0 auto; }
.plus-film-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.plus-film-list { margin: 0 0 12px; padding-left: 20px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }

/* ---------- Game report (views/game-report.js) ---------- */

.gr-page { max-width: 1080px; }
.gr-section { margin-top: 22px; }
.gr-title { font-size: 18px; font-weight: 700; margin: 0 0 4px; text-wrap: balance; }
.gr-lede { color: var(--ink-2); font-size: 13.5px; margin: 0 0 12px; max-width: 70ch; }

.gr-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 28px;
  align-items: center;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  box-shadow: var(--shadow);
}
.gr-score { display: flex; align-items: flex-end; gap: 14px; }
.gr-side { display: flex; flex-direction: column; align-items: center; min-width: 88px; }
.gr-name { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.gr-points { font-size: 44px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.gr-dash { font-size: 30px; color: var(--ink-3); padding-bottom: 6px; }
.gr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13px; }
.gr-result { font-weight: 750; font-size: 12px; padding: 3px 9px; border-radius: 999px; letter-spacing: 0.04em; text-transform: uppercase; }
.gr-result.is-W { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.gr-result.is-L { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }
.gr-result.is-T { background: var(--surface-2); color: var(--ink-2); }
.gr-ahead { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 6px; padding-left: 22px; border-left: 1px solid var(--line); font-size: 14px; }
.gr-ahead-label, .gr-tile-label, .gr-talk-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3);
}
.gr-days { display: flex; flex-wrap: wrap; gap: 6px; }
.gr-day { font-size: 12px; padding: 3px 8px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-2); }
.gr-day b { color: var(--ink); font-weight: 650; }

.gr-brief { padding: 16px; display: grid; gap: 14px; }
.gr-headline { margin: 0; font-size: 17px; font-weight: 650; line-height: 1.35; text-wrap: balance; }
.gr-summary { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; max-width: 75ch; }
.gr-bullets { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; line-height: 1.45; }
.gr-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.gr-tile { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--raised); }
.gr-tile-row { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.gr-tile-us { font-size: 20px; font-weight: 750; color: var(--chart-us); }
.gr-tile-them { font-size: 15px; font-weight: 600; color: var(--chart-them-dark); }
.gr-tile-key { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.gr-units { margin-top: 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gr-unit-card { padding: 14px 16px; border-top: 3px solid var(--line-strong); }
.gr-unit-card.is-offense { border-top-color: var(--offense); }
.gr-unit-card.is-defense { border-top-color: var(--defense); }
.gr-unit-card.is-special_teams { border-top-color: var(--special); }
.gr-unit-card h3 { margin: 0 0 8px; font-size: 14px; }
.gr-unit-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; }
.gr-unit-card dt { color: var(--ink-3); }
.gr-unit-card dd { margin: 0; font-weight: 550; }

.gr-unit { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: 0.03em; color: var(--on-ink); background: var(--ink-3); }
.gr-unit.is-offense { background: var(--offense); }
.gr-unit.is-defense { background: var(--defense); }
.gr-unit.is-special_teams { background: var(--special); }
.gr-sev { font-size: 11px; font-weight: 650; color: var(--ink-2); }
.gr-sev.is-high { color: var(--bad); }
.gr-focus-tags { display: flex; align-items: center; gap: 8px; }

.gr-focus { padding: 16px 18px; margin-top: 12px; display: grid; gap: 14px; }
.gr-focus-head { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.gr-rank {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 16px; background: var(--accent-soft); color: var(--accent-text);
}
.gr-focus h3 { margin: 6px 0 4px; font-size: 17px; }
.gr-why { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.gr-evidence-wrap { overflow-x: auto; }
.gr-evidence { border-collapse: collapse; font-size: 13px; min-width: 320px; }
.gr-evidence th, .gr-evidence td { padding: 5px 14px 5px 0; text-align: left; border-bottom: 1px solid var(--line); }
.gr-evidence thead th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); font-weight: 650; }
.gr-evidence th { background: none; position: static; }
.gr-evidence tbody th { font-weight: 500; color: var(--ink-2); text-transform: none; letter-spacing: 0; font-size: 13px; }
.gr-num { font-variant-numeric: tabular-nums; font-weight: 650; }
.gr-coach { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.gr-coach h4, .gr-check h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.gr-coach ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 13.5px; line-height: 1.45; }
.gr-drills li div { color: var(--ink-2); font-size: 13px; }
.gr-cue { font-style: italic; }
.gr-focus-foot { display: flex; gap: 8px; }

.gr-strengths { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.gr-strength { padding: 14px 16px; border-left: 4px solid var(--good); display: grid; gap: 6px; align-content: start; }
.gr-strength h3 { margin: 2px 0 0; font-size: 15px; }
.gr-strength p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.gr-strength .btn { justify-self: start; }

.gr-plan { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.gr-xf-tag { margin-left: auto; font-size: 11px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.gr-plan-body { padding: 16px; display: grid; gap: 16px; }
.gr-talk {
  margin: 0; padding: 12px 16px; border-left: 4px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14.5px; line-height: 1.55;
}
.gr-talk-label { margin-bottom: 4px; }
.gr-practices { display: grid; gap: 18px; }
.ps-scroll { overflow-x: auto; }
.ps-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; background: var(--raised); }
.ps-table th, .ps-table td { border: 1px solid var(--line-strong); padding: 4px 8px; vertical-align: middle; }
.ps-table thead th { background: var(--head-bg); color: var(--ink); text-align: center; font-weight: 700; font-size: 13.5px; text-transform: none; letter-spacing: 0; position: static; }
.ps-table thead .ps-title { font-size: 15px; padding: 8px; }
.ps-sub { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); margin-top: 2px; }
.ps-period { white-space: nowrap; width: 1%; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ps-activity { text-align: center; font-weight: 650; width: 26%; }
.ps-notes { text-align: center; color: var(--ink-2); line-height: 1.45; }
.ps-table tr.is-alt td { background: var(--surface-2); }
.ps-table tr.is-water td { background: var(--accent-soft); }
.gr-period-focus { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.gr-check ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
.gr-written { margin: 0; font-size: 12px; }
.gr-ask { display: grid; gap: 8px; }
.gr-note { width: 100%; resize: vertical; }
.gr-ask-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.gr-ask-row .ai-meter { margin: 0; }
.gr-busy { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.gr-spin {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong);
  border-top-color: var(--accent); animation: gr-spin 0.8s linear infinite;
}
@keyframes gr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gr-spin { animation-duration: 2.4s; } }

.gr-basis { margin: 22px 0 10px; font-size: 12.5px; display: grid; gap: 2px; }
.gr-basis p { margin: 0; }
.gr-empty { padding: 24px; }

@media (max-width: 760px) {
  .gr-hero { grid-template-columns: 1fr; }
  .gr-ahead { grid-column: auto; grid-row: auto; padding-left: 0; border-left: 0; padding-top: 10px; border-top: 1px solid var(--line); }
  .gr-units, .gr-coach { grid-template-columns: 1fr; }
  .gr-points { font-size: 36px; }
}

@media print {
  .gr-ask, .gr-focus-foot, .gr-strength .btn { display: none; }
  .gr-focus, .ps-wrap { break-inside: avoid; }
}

/* ---------- Scouting analysis (views/scouting-analysis.js, components/scout-cards.js) ---------- */

.sc-page { display: grid; gap: 16px; max-width: 1080px; }
.sc-link { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.sc-link.is-missing { background: var(--warn-bg); color: var(--warn-ink); }
.sc-link-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); }
.sc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 13px; }
.sc-next { font-weight: 700; color: var(--accent-text); }
.sc-section { margin-top: 22px; }
.gr-subtitle { font-size: 15px; margin: 18px 0 8px; }

.sc-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sc-col { padding: 14px 16px; border-top: 3px solid var(--line-strong); min-width: 0; }
.sc-col.is-offense { border-top-color: var(--offense); }
.sc-col.is-defense { border-top-color: var(--defense); }
.sc-col h3 { margin: 0 0 6px; font-size: 15px; }
.sc-col h4 { margin: 12px 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.sc-good { color: var(--good); }
.sc-bad { color: var(--bad); }
.sc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sc-finding { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--raised); border: 1px solid var(--line); border-left-width: 3px; }
.sc-finding.is-strength { border-left-color: var(--good); }
.sc-finding.is-weakness { border-left-color: var(--bad); }
.sc-finding-text { display: grid; gap: 2px; font-size: 13px; flex: 1; min-width: 0; }
.sc-finding-text span { color: var(--ink-2); }
.sc-none { margin: 0; font-size: 13px; }
.sc-watch { white-space: nowrap; flex: none; }

.sc-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.sc-box { padding: 14px 16px; min-width: 0; overflow-x: auto; }
.sc-box h3 { margin: 0 0 8px; font-size: 14px; }
.sc-tendencies { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.sc-tendencies dt { color: var(--ink-3); }
.sc-tendencies dd { margin: 0; font-weight: 550; }
.sc-figures { border-collapse: collapse; font-size: 13px; width: 100%; }
.sc-figures th, .sc-figures td { padding: 5px 10px 5px 0; text-align: left; border-bottom: 1px solid var(--line); background: none; }
.sc-figures thead th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); font-weight: 650; }
.sc-figures tbody th { font-weight: 500; color: var(--ink-2); text-transform: none; letter-spacing: 0; font-size: 13px; }

.sc-matchup { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sc-match-col { display: grid; gap: 10px; align-content: start; min-width: 0; }
.sc-match { padding: 12px 14px; border-left: 4px solid var(--line-strong); }
.sc-match.is-concern { border-left-color: var(--bad); }
.sc-match.is-opportunity { border-left-color: var(--good); }
.sc-match-tag { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.06em; }
.sc-match.is-concern .sc-match-tag { color: var(--bad); }
.sc-match.is-opportunity .sc-match-tag { color: var(--good); }
.sc-match h3 { margin: 4px 0 8px; font-size: 15px; }
.sc-match-rows { display: grid; gap: 6px; font-size: 13px; }
.sc-match-rows > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; color: var(--ink-2); }
.sc-who { font-weight: 700; color: var(--ink); }

.sc-keys h4, .sc-plan-col h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.sc-keys ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.sc-plan-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sc-plan-col { display: grid; gap: 10px; align-content: start; min-width: 0; }
.sc-idea { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--raised); }
.sc-idea p { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.sc-idea .sc-how { color: var(--ink); }

.gd-scouted { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 12px; font-size: 13px; }
.gd-scouted-label { font-weight: 650; color: var(--ink-2); }
.gd-scouted-link { padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink); text-decoration: none; }
.gd-scouted-link:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .sc-cols, .sc-two, .sc-matchup, .sc-plan-cols { grid-template-columns: 1fr; }
}
@media print {
  .sc-watch { display: none; }
  .sc-match, .sc-col, .sc-idea { break-inside: avoid; }
}

/* ---------- Practice agendas (views/agendas.js, views/practice-plan.js, components/practice-schedule.js) ---------- */

.pp-page { max-width: 1080px; }
.pp-body { display: grid; gap: 12px; }
.pp-meta { margin: 0; font-size: 12.5px; }
.pp-starts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.pp-start { padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: start; }
.pp-start-icon { font-size: 22px; line-height: 1; color: var(--accent-text); }
.pp-start h3 { margin: 0 0 4px; font-size: 15px; }
.pp-start p { margin: 0 0 8px; font-size: 13px; }
.pp-start .btn { grid-column: 2; justify-self: start; }
.pp-start select { margin-bottom: 8px; max-width: 100%; }
.pp-edit { padding: 14px 16px; }

/* The team's agendas, and an agenda's practices (views/agendas.js). */
.ag-bar { margin-bottom: 12px; }
/* One line per agenda: date, name and theme, length, last changed. */
.ag-table { padding: 0; overflow: hidden; }
.ag-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 64px 72px; gap: 12px; align-items: center; padding: 9px 16px; color: inherit; text-decoration: none; font-size: 13.5px; border-top: 1px solid var(--line); }
.ag-row:first-child { border-top: 0; }
a.ag-row:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.ag-head { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); padding-block: 7px; }
.ag-cell-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-cell-min, .ag-cell-changed { text-align: right; white-space: nowrap; }
.ag-cell-date { white-space: nowrap; }
@media (max-width: 640px) {
  .ag-row { grid-template-columns: 96px minmax(0, 1fr) 56px; }
  .ag-cell-changed { display: none; }
}
.ag-practices { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 4px; }
.ag-practice .btn { margin-left: 8px; }
.ag-link { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.ag-link .field { flex: 1 1 280px; margin: 0; }
.ag-note { margin: 0 0 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); font-size: 13px; }
.ag-name { margin-bottom: 12px; }
.ag-archived { margin-left: 10px; vertical-align: middle; font-size: 12px; }
.gr-practice-plan { display: grid; gap: 8px; }
.gr-practice-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.ev-practice-plan { align-self: flex-start; margin: 4px 0; }

.pe { display: grid; gap: 12px; }
.pe-field { display: grid; gap: 3px; min-width: 0; }
.pe-field > span { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.pe-field .input { width: 100%; }
.pe-field textarea { resize: vertical; min-height: 38px; }
.pe-rows { display: grid; gap: 8px; }
.pe-row {
  display: grid; grid-template-columns: 150px 80px minmax(140px, 1fr) minmax(200px, 2fr) auto;
  gap: 8px 10px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--raised);
}
.pe-row.is-water { background: var(--accent-soft); }
.pe-when { display: grid; gap: 2px; font-size: 12.5px; color: var(--ink-2); align-self: center; }
.pe-when b { color: var(--ink); font-size: 13px; }
.pe-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; justify-content: flex-end; }
.pe-x { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 4px; font-size: 13px; line-height: 1; }
.pe-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pe-total { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.pe-total.is-off { color: var(--warn-ink); }

@media (max-width: 900px) {
  .pe-row { grid-template-columns: 1fr 90px; }
  .pe-when { grid-column: 1 / -1; }
  .pe-act, .pe-notes { grid-column: 1 / -1; }
  .pe-min { grid-column: 2; grid-row: 1; }
  .pe-acts { grid-column: 1 / -1; }
}

/* Printing a practice: the sheet alone, as the staff hands it out. */
@media print {
  .pp-page .crumb, .pp-page .page-head, .pp-meta, .gr-practice-acts, .ag-page .pp-body > .card, .ag-note { display: none; }
  .pp-page .ps-table { min-width: 0; font-size: 11.5px; }
  .pp-page .ps-table th, .pp-page .ps-table td { padding: 2px 6px; }
  .ps-table tr.is-alt td { background: #e6e6e6 !important; color: #000; }
  .ps-table tr.is-water td { background: #f3e1e1 !important; color: #000; }
  .ps-table th, .ps-table td { border-color: #888 !important; color: #000; background: #fff; }
  .ps-table thead th { background: #d9d9d9 !important; }
}

/* The next opponent in the week's focus (views/game-report.js) */
.gr-opp {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--ink-2);
  padding: 8px 12px; border-radius: var(--radius-sm); border-left: 3px solid var(--line-strong); background: var(--surface-2);
}
.gr-opp.is-strength { border-left-color: var(--bad); }
.gr-opp.is-weakness { border-left-color: var(--good); }
.gr-opp-tag { font-weight: 750; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.gr-opp.is-strength .gr-opp-tag { color: var(--bad); }
.gr-opp.is-weakness .gr-opp-tag { color: var(--good); }
.gr-scout-link { padding: 14px 16px; display: grid; gap: 10px; }
.gr-scout-link p { margin: 0; font-size: 14px; color: var(--ink-2); }
.gr-scout-link b { color: var(--ink); }
.gr-scout-acts { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- The Drill Library's cards (components/drill-card.js) ---------- */

/*
 * A library drill named in a schedule: an outlined pill with a play mark, so
 * it stands out from the notes around it and is not taken for the filled
 * focus tag beside it (.gr-period-focus). Opens its card.
 */
.drill-link {
  color: var(--accent-text); border: 1.5px solid var(--accent); font-weight: 600; text-decoration: none;
  padding: 0 8px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.drill-link::before { content: '\25B6'; font-size: 0.65em; margin-right: 5px; vertical-align: 0.15em; }
.drill-link:hover { background: var(--accent); color: #fff; }
/* The same, under a block's notes in the practice editor (components/practice-schedule.js). */
.pe-drill-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.pe-drills { display: contents; }
.drill-pill {
  border: 1.5px solid var(--accent); background: none; color: var(--accent-text); font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 2px 10px; border-radius: 999px; cursor: pointer;
}
.drill-pill::before { content: '\25B6'; font-size: 0.65em; margin-right: 5px; vertical-align: 0.15em; }
.drill-pill:hover { background: var(--accent); color: #fff; }
.dc { display: grid; gap: 12px; font-size: 14px; line-height: 1.5; }
.dc-unreviewed { margin: 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; }
.dc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dc-tag, .dc-contact { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.dc-contact.is-none { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.dc-contact.is-bags { background: color-mix(in srgb, var(--offense) 14%, transparent); color: var(--offense); }
.dc-contact.is-thud { background: var(--warn-bg); color: var(--warn-ink); }
.dc-contact.is-live { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.dc-purpose { margin: 0; font-size: 15px; }
/* The steps get the larger share: they are what a coach reads. */
.dc-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.dc-grid p { margin: 8px 0 0; }
/* The picture's column holds its own play bar: the slider shrinks, and the time
   drops under it on a narrow card, rather than running into the steps. */
.dc-grid > * { min-width: 0; }
.dc-anim { min-width: 0; }
.dc-anim .anim-bar { flex-wrap: wrap; row-gap: 6px; }
.dc-anim .anim-bar input[type="range"] { min-width: 0; width: 100%; flex: 1 1 100px; }
.dc-anim .anim-bar .btn { min-width: 0; }
.dc-anim .anim-time { min-width: 0; }
.dc-sec h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.dc-sec ol, .dc-sec ul { margin: 0; padding-left: 20px; display: grid; gap: 3px; }
.dc-sec p { margin: 0; }
.dc-safety { padding: 8px 12px; border-left: 3px solid var(--bad); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.dc-explain { display: grid; gap: 12px; }
.dc-explain h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.dc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dc-status { margin: 0; font-size: 13px; min-height: 1em; }

.drill-diagram { width: 100%; max-width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }
.drill-diagram .dd-field { fill: color-mix(in srgb, var(--good) 16%, var(--surface)); stroke: var(--line-strong); stroke-width: 0.4; }
.drill-diagram .dd-yard { stroke: var(--line); stroke-width: 0.3; }
.drill-diagram .dd-path { fill: none; stroke: var(--ink-2); stroke-width: 0.7; }
.drill-diagram .dd-path.is-ball { stroke: var(--accent); stroke-dasharray: 1.5 1; }
.drill-diagram .dd-arrow-head { fill: var(--ink-2); }
.drill-diagram .dd-cone { fill: #f08c00; }
.drill-diagram .dd-bag { fill: var(--ink-3); }
.drill-diagram .dd-player circle { fill: var(--offense); stroke: var(--surface); stroke-width: 0.5; }
.drill-diagram .dd-player.is-coach circle { fill: var(--ink); }
.drill-diagram .dd-x { fill: var(--defense); font-size: 5.5px; font-weight: 800; text-anchor: middle; }
.drill-diagram .dd-label { fill: var(--ink); font-size: 2.8px; font-weight: 700; text-anchor: middle; }

.pp-print-cards { display: none; }

@media (max-width: 700px) {
  .dc-grid { grid-template-columns: 1fr; }
}
@media print {
  .pp-print-cards { display: block; }
  .pp-print-card { break-before: page; }
  .pp-print-card h2 { font-size: 18px; margin: 0 0 8px; }
  .drill-link { border-color: #999; color: #000; }
  .dc { font-size: 12px; }
  .drill-diagram { max-width: 340px; }
}

/* ---------- The Drill Library browser (components/drill-browser.js) ---------- */

.dl-page { max-width: 1600px; }
.db { display: grid; gap: 16px; }
.db-filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; }
/* A filter and its name above it (components/drill-browser.js, play-browser.js). */
.db-field { display: grid; gap: 4px; min-width: 150px; }
.db-field > span { font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.db-field:first-child { flex: 1 1 260px; max-width: 380px; }
.db-search { width: 100%; }
.db-count { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); display: flex; gap: 10px; align-items: baseline; }
.db-clear { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.db-clear:hover { text-decoration: underline; }
.db-grid { display: grid; gap: 22px; }
.db-group-title { margin: 0 0 10px; font-size: 15px; }
.db-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.db-card {
  display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; min-width: 0;
}
.db-pic {
  display: block; width: 100%; border: 0; padding: 0; background: #ffffff; cursor: pointer;
  aspect-ratio: 4 / 3; overflow: hidden; border-bottom: 1px solid var(--line);
}
.db-pic svg { width: 100%; height: 100%; display: block; }
.db-pic:hover { filter: brightness(0.97); }
.db-body { display: grid; gap: 6px; padding: 10px 12px 12px; align-content: start; }
.db-name { font-size: 14.5px; }
.db-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.db-purpose {
  margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.db-act { justify-self: start; margin-top: 2px; }
.pe-add-drill { justify-self: start; margin-top: 2px; }

/* The Library page (views/library.js): Plays and Drills tabs, and the plays browser (components/play-browser.js). */
.lb-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.lb-size { margin-left: auto; }
.lb-bar .lb-tabs { margin-bottom: 0; }

/* Large / Medium / Small in the Library (components/card-size.js): three, five or eight across. */
.db-cards.is-lg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.db-cards.is-md { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.db-cards.is-sm { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.db-cards.is-md .db-body { padding: 8px 10px 10px; gap: 5px; }
.db-cards.is-md .db-name { font-size: 13.5px; }
.db-cards.is-md .db-purpose { font-size: 12px; -webkit-line-clamp: 2; }
.db-cards.is-sm .db-body { padding: 6px 8px 8px; gap: 4px; }
.db-cards.is-sm .db-name { font-size: 12.5px; }
.db-cards.is-sm .db-tags .dc-tag, .db-cards.is-sm .db-tags .dc-contact, .db-cards.is-sm .db-tags .lib-new { font-size: 10.5px; padding: 1px 6px; }
.db-cards.is-sm .db-purpose { display: none; }
.db-cards.is-sm .db-act { padding: 3px 7px; font-size: 11px; }
@media (max-width: 1500px) { .db-cards.is-sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
@media (max-width: 1150px) { .db-cards.is-md { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
@media (max-width: 780px)  { .db-cards.is-lg { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }
.lb-section { display: grid; gap: 12px; }
.lb-about { margin: 0; }
.lb-about-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.lb-about-row .lb-about { flex: 1 1 360px; }
.lb-team { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.lb-team .input { max-width: 260px; }
.pb-count { margin: 0 0 8px; font-size: 13px; }
.pb-more { justify-self: center; margin-top: 14px; }
.pb-open { display: grid; gap: 12px; }
.pb-open-notes { margin: 0; font-size: 14px; line-height: 1.5; }
.pe-use-minutes { margin-bottom: 12px; font-size: 13.5px; }

@media (max-width: 600px) {
  .db-cards { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   Game day and Playing Time (views/game-day.js, views/playing-time.js): a
   soccer game's subs and minutes from the sideline, made for a phone. The
   pitch and the clock bar keep their own colours in both themes; the rest
   follows the app's.
   --------------------------------------------------------------------------- */
.gdy-page { max-width: 560px; margin: 0 auto; padding: 0 0 48px; --gd-warn: #e08a00; --gd-ahead: #7a8594; }
/* Playing Time, a tab of the Roster page: the gutters are the page's. */
.pt-panel { max-width: 900px; --gd-warn: #e08a00; --gd-ahead: #7a8594; }
/*
 * Beside the menu on a computer, as every other page is: anchored left with
 * the page's own gutter, not floating in the middle of a wide screen. A phone
 * keeps the full width it had (the rules above).
 */
@media (min-width: 601px) {
  .gdy-page { margin: 0; padding-left: 28px; padding-right: 28px; max-width: 616px; }
  /* Football and soccer: the cards as wide as the header and tab row above them (since 2026-12-02). */
  .gdy-page .gdy-body { padding-left: 0; padding-right: 0; }
}
.gdy-head { background: #1b2230; color: #fff; padding: 12px 16px 14px; border-radius: 0 0 14px 14px; }
/* Football and soccer: square where the header meets the tab row, no gap in the corners (since 2026-12-02). */
.gdy-page .gdy-head:has(+ .gdy-tabs) { border-radius: 0; }
.gdy-head-row { position: relative; display: flex; justify-content: space-between; align-items: center; min-height: 26px; }
/* The lock, and Cancel beside it: Game Day Live thrown away, as if it never started. */
.gdy-head-end { display: inline-flex; align-items: center; gap: 8px; }
/* Cancel and + Log shaped as the app's other buttons (since 2026-11-30): small rounded corners. */
.gdy-cancel { border: 1px solid rgba(255,255,255,.3); background: transparent; color: #e6e9ee; border-radius: var(--radius-sm); padding: 4px 10px; font: 700 12px system-ui, sans-serif; cursor: pointer; }
.gdy-cancel:hover { border-color: rgba(255,255,255,.6); color: #fff; }
/* Football's Start game, in Cancel's place until kickoff (since 2026-12-01). */
.gdy-cancel.gdy-start { border-color: var(--accent); background: var(--accent); color: #fff; }
.gdy-cancel.gdy-start:hover { filter: brightness(1.08); }
/* Soccer's Start game waits for a squad (since 2026-12-02). */
.gdy-cancel:disabled { opacity: .5; cursor: default; filter: none; }
/* The way back, as the app's other back links: quiet grey, underlined on hover (since 2026-11-30). */
.gdy-back { color: #b8c1cd; font-size: 14px; text-decoration: none; }
.gdy-back:hover { color: #fff; text-decoration: underline; }
/* Coaches only, as the app's other who-can-see chips (the breakdown's draft chip): neutral, outlined (since 2026-11-30). */
.gdy-lock { font-size: 11.5px; font-weight: 600; color: #b8c1cd; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); padding: 2px 9px; border-radius: 999px; }
/* Coaches only, centred in the header row: Schedule on the left, Cancel on the right. */
.gdy-head-row .gdy-lock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; }
/* Football's two buttons at the top right (End Q, End game): on a phone, Coaches only sits just left of them, not in the middle over End Q (since 2026-12-02). */
@media (max-width: 560px) { .gdy-page .gdy-head-row .gdy-lock { position: static; transform: none; } }
@media (max-width: 370px) { .gdy-page .gdy-head-row .gdy-lock { font-size: 10.5px; padding: 2px 7px; } }
/* The Drilldown tile in the sport's mark, turning while the clock runs (since 2026-12-01): just after the title, where
   the red dot was (since 2026-12-03), clear of the buttons at the right. */
.gdy-actions { position: relative; justify-content: flex-start; }
.gdy-actions .gdy-brand { flex: none; width: 24px; height: 24px; perspective: 200px; }
.gdy-actions .fgl-head-acts { margin-left: auto; }
/* End Q / the half's button beside Log, under Cancel (since 2026-12-03): at least as wide as Cancel, wider for soccer's words. */
.gdy-head .gdy-cancel.gdy-endq { width: auto; min-width: 84px; padding-inline: 10px; white-space: nowrap; }
/* As tall as Log beside it (since 2026-12-03). */
.gdy-actions .gdy-endq { align-self: stretch; }
.gdy-head { container-type: inline-size; }
/* On a phone, the title, the mark and the three buttons on one line: a slightly smaller title, End Q and Log as wide as their words. */
@container (max-width: 440px) {
  .gdy-actions:has(.gdy-endq) { gap: 6px; }
  .gdy-actions:has(.gdy-endq) .fgl-title { font-size: 18px; white-space: nowrap; flex: none; }
  .gdy-actions:has(.gdy-endq) .fgl-head-acts { gap: 6px; }
  .gdy-head .gdy-actions .gdy-endq, .gdy-actions:has(.gdy-endq) .gdy-logbtn { width: auto; min-width: 0; padding-inline: 10px; white-space: nowrap; }
}
.gdy-brand .logo-tile { display: block; }
.gdy-brand.is-spinning .logo-tile { animation: ab-spin 2.8s linear infinite; animation-delay: inherit; }
@media (prefers-reduced-motion: reduce) { .gdy-brand.is-spinning .logo-tile { animation: none; } }
.gdy-title { font: 800 26px/1.1 'Barlow Condensed', system-ui, sans-serif; text-transform: uppercase; letter-spacing: .02em; margin-top: 6px; }
.gdy-sub { color: #b8c1cd; font-size: 13px; margin-top: 2px; }
.gdy-clock { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.gdy-t { font: 800 46px/1 'Barlow Condensed', system-ui, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.gdy-per { font-size: 12px; font-weight: 700; color: #b8c1cd; text-transform: uppercase; letter-spacing: .1em; margin-top: 2px; }
.gdy-share { text-align: right; font-size: 12px; color: #b8c1cd; }
.gdy-share b { display: block; font: 800 24px/1 'Barlow Condensed', system-ui, sans-serif; color: #fff; }
.gdy-play { width: 54px; height: 54px; border-radius: 50%; border: 0; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.gdy-play.is-running::before { content: ""; width: 16px; height: 20px; border-left: 6px solid #1b2230; border-right: 6px solid #1b2230; box-sizing: border-box; }
/* Paused: the play button in the app's red, with a white triangle (since 2026-11-30). */
.gdy-play.is-paused { background: var(--accent); }
.gdy-play.is-paused::before { content: ""; margin-left: 5px; border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.gdy-tabs { display: flex; background: var(--surface); border-bottom: 1px solid var(--line); }
.gdy-tabs button { flex: 1; border: 0; background: none; padding: 11px 0; font-weight: 700; color: var(--ink-3); cursor: pointer; font-size: 14px; }
.gdy-tabs button.is-on { color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.gdy-body { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 12px 0; }
.gdy-card { padding: 10px 12px; margin: 0; }
.gdy-lab { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.gdy-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gdy-chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 99px; padding: 6px 12px; font-weight: 600; font-size: 13px; cursor: pointer; }
.gdy-chip.is-player { font-size: 12.5px; padding: 4px 10px; }
.gdy-chip.is-on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.gdy-chip:disabled { cursor: default; }
.gdy-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.gdy-row > .input, .gdy-row > select { flex: 1 1 120px; min-width: 0; }
.gdy-mins { display: flex; align-items: center; gap: 6px; font-weight: 600; flex: 0 0 auto; }
.gdy-mins .input { width: 64px; }
.gdy-custom { flex: 1 1 140px; }
.gdy-hint { background: #fff7d6; border: 1px solid #f3d36b; color: #6b5200; border-radius: 10px; padding: 7px 10px; font-size: 13px; margin-top: 8px; }
.gdy-hint.is-live { margin-top: 0; }
.gdy-fair { text-align: center; color: var(--ink-2); font-size: 13px; }
/* Setup's last row: the lineup button and the count beside it; the count alone is centred. */
.gdy-setfoot { display: flex; align-items: center; gap: 10px; }
.gdy-setfoot > .gdy-fair { flex: 1; min-width: 0; }
/* Start game: centred, a normal button's size (since 2026-11-30). */
.gdy-go { align-self: center; padding: 10px 32px; font-size: 15px; margin-inline: auto; }
.gdy-note { font-size: 12px; margin: 4px 0 0; }
.gdy-foot { text-align: center; padding: 12px; }
.gdy-saved { font-size: 12px; color: var(--ink-3); }
.gdy-saved.is-waiting { color: #b06a00; font-weight: 700; }
.gdy-periods > .gdy-saved { margin-left: 4px; }

/* The pitch, attacking up the screen. Its own greens in both themes. */
.gdy-pitch { position: relative; aspect-ratio: 68 / 76; width: 100%; border-radius: 14px; overflow: hidden;
  background: repeating-linear-gradient(180deg, #3f9a45 0 6%, #389040 6% 12%); }
.gdy-pitch::before { content: ""; position: absolute; inset: 2.2%; border: 2px solid rgba(255,255,255,.75); border-radius: 4px; pointer-events: none; }
/* Our half, as SubTime shows it (since 2026-11-30): the halfway line and centre circle near the top, our penalty and goal areas at the bottom. */
.gdy-half { position: absolute; left: 2.2%; right: 2.2%; top: 20%; border-top: 2px solid rgba(255,255,255,.75); }
.gdy-circle { position: absolute; left: 50%; top: 20%; width: 27%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 2px solid rgba(255,255,255,.75); border-radius: 50%; }
.gdy-box { position: absolute; left: 50%; bottom: 2.2%; width: 59%; height: 17%; transform: translateX(-50%); border: 2px solid rgba(255,255,255,.75); border-bottom: 0; }
/* The goal area inside the penalty area. */
.gdy-box::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 46%; height: 36%; transform: translateX(-50%); border: 2px solid rgba(255,255,255,.75); border-bottom: 0; }
/* The other half isn't shown, so neither is its box. */
.gdy-box.is-top { display: none; }
.gdy-form { position: absolute; left: 4%; top: 3.5%; background: rgba(0,0,0,.35); color: #fff; font: 700 13px 'Barlow Condensed', system-ui, sans-serif; padding: 2px 8px; border-radius: 6px; z-index: 1; }
.gdy-p { position: absolute; width: 76px; transform: translate(-50%, -32%); display: flex; flex-direction: column; align-items: center; background: none; border: 0; padding: 0; cursor: pointer; z-index: 2; color: #fff; }
.gdy-p:disabled { cursor: default; }
.gdy-dot { width: 42px; height: 42px; border-radius: 50%; background: #fff; color: #181c22; display: flex; align-items: center; justify-content: center;
  font: 800 17px 'Barlow Condensed', system-ui, sans-serif; border: 3px solid #1a8f3c; box-shadow: 0 2px 6px rgba(0,0,0,.25); position: relative; }
.gdy-dot.is-gk { background: #ffd447; border-color: #fff; }
.gdy-dot.is-warn { border-color: var(--gd-warn); }
.gdy-dot.is-bad { border-color: #d0162f; }
.gdy-dot.is-ahead { border-color: var(--gd-ahead); }
.gdy-pos { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font: 700 9.5px system-ui, sans-serif; background: #1b2230; color: #fff; padding: 0 4px; border-radius: 4px; }
.gdy-nm { font-weight: 700; font-size: 11.5px; text-shadow: 0 1px 2px rgba(0,0,0,.65); margin-top: 2px; white-space: nowrap; max-width: 76px; overflow: hidden; text-overflow: ellipsis; }
.gdy-mn { font: 700 10.5px system-ui, sans-serif; background: rgba(0,0,0,.45); border-radius: 6px; padding: 0 5px; }
.gdy-p.is-empty .gdy-dot { background: rgba(255,255,255,.25); border: 2px dashed #fff; color: #fff; box-shadow: none; }
.gdy-p.is-sel .gdy-dot { box-shadow: 0 0 0 4px #ffd447, 0 2px 6px rgba(0,0,0,.25); }
.gdy-legend { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-2); }
.gdy-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; border: 2.5px solid #1a8f3c; }
.gdy-legend .is-warn::before { border-color: var(--gd-warn); }
.gdy-legend .is-bad::before { border-color: #d0162f; }
.gdy-legend .is-ahead::before { border-color: var(--gd-ahead); }

/* The bench. */
.gdy-bench { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; padding-top: 6px; }
.gdy-b { position: relative; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px 6px; text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.gdy-b:disabled { cursor: default; }
.gdy-b.is-warn { border: 2px solid var(--gd-warn); }
.gdy-b.is-bad { border: 2px solid #d0162f; }
.gdy-b.is-sug { box-shadow: 0 0 0 3px #ffd447; }
.gdy-b.is-sel { box-shadow: 0 0 0 3px var(--accent); }
.gdy-tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); background: #ffd447; color: #181c22; font: 700 9.5px system-ui, sans-serif; padding: 1px 6px; border-radius: 99px; white-space: nowrap; }
.gdy-g { position: absolute; top: 5px; left: 6px; font: 700 10px system-ui, sans-serif; color: var(--surface); background: var(--ink); border-radius: 4px; padding: 0 4px; }
.gdy-bn { font: 800 18px 'Barlow Condensed', system-ui, sans-serif; }
.gdy-bnm { font-weight: 700; font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gdy-bmn { font-size: 11.5px; font-weight: 700; }
.gdy-b.is-warn .gdy-bmn { color: #b06a00; }
.gdy-b.is-bad .gdy-bmn { color: #d0162f; }

/* Queued subs. */
.gdy-queue { background: #1b2230; color: #fff; border-radius: 14px; padding: 10px 12px; }
.gdy-queue .gdy-lab { color: #b8c1cd; }
.gdy-q { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 14px; }
.gdy-q b { color: #7ddf9e; }
.gdy-q s { color: #ff8a9a; text-decoration: none; }
.gdy-qpos { color: #b8c1cd; font-size: 12px; }
.gdy-x { background: none; border: 0; color: #fff; font-size: 16px; cursor: pointer; padding: 4px 8px; }
.gdy-apply { width: 100%; margin-top: 8px; }
.gdy-periods { justify-content: center; }

/* Picking a starter. */
.gdy-pick { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; }
.gdy-pick-row { position: relative; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; font-size: 15px; }
.gdy-pick-row .gdy-g { position: static; margin-left: 8px; }

/* The summary and the season. */
.gdy-score { display: flex; justify-content: space-around; text-align: center; font-size: 13px; color: var(--ink-2); }
.gdy-score b { display: block; font: 800 26px/1.1 'Barlow Condensed', system-ui, sans-serif; color: var(--ink); }
.gdy-tablecard { padding: 4px 8px; overflow-x: auto; }
.gdy-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gdy-table th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 6px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.gdy-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.gdy-table .r { text-align: right; }
.gdy-grp { font-size: 11.5px; color: var(--ink-2); }
/* A plain tick in the page's ink: U+FE0E keeps phones from drawing the emoji. */
.gdy-tick { color: var(--ink); font-weight: 700; font-family: system-ui, sans-serif; }
.gdy-bar { position: relative; display: inline-block; width: 64px; height: 7px; background: var(--surface-2); border-radius: 4px; vertical-align: middle; }
.gdy-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: #1a8f3c; }
.gdy-bar i.is-warn { background: var(--gd-warn); }
.gdy-bar i.is-ahead { background: var(--gd-ahead); }
.gdy-mark { position: absolute; left: 66.7%; top: -2px; bottom: -2px; width: 2px; background: var(--ink); }
.pt-low { color: var(--bad); font-weight: 700; }
.pt-game { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.pt-game:first-of-type { border-top: 0; }

/* The timeline. */
.gdy-tl { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.gdy-tl b { color: #1a8f3c; }
.gdy-tl s { color: var(--accent); text-decoration: none; }
.gdy-tl.is-bad { background: color-mix(in srgb, var(--bad) 8%, transparent); }
.gdy-tl-t { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.gdy-tl-a { display: flex; gap: 2px; }
.gdy-tl-div { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 8px 0 4px; border-top: 1px solid var(--line); }
.gdy-tl-div:first-child { border-top: 0; }
.gdy-bad { color: var(--bad); font-weight: 600; }
.gdy-reset { align-self: center; margin-top: 6px; }

/* The Time tab: each player's time, and in each position. */
.gdy-time-sort { margin-top: 0; justify-content: space-between; }
.gdy-time-sort .gdy-lab { margin: 0; }
.gdy-time-sort select { flex: 0 0 auto; width: auto; }
.gdy-time { padding: 10px 0; border-top: 1px solid var(--line); }
.gdy-time:first-child { border-top: 0; }
.gdy-time-who { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.gdy-time-who > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gdy-time-total { font-variant-numeric: tabular-nums; }
.gdy-time-pos { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; }
.gdy-tp { display: flex; flex-direction: column; align-items: center; gap: 2px; }
/* The Timeline's slate (the other side's tags), white letters: one grey for every pill. */
.gdy-tp-l { font: 800 13px system-ui, sans-serif; letter-spacing: .02em; background: var(--gd-them); color: #fff; border-radius: 6px; padding: 4px 9px; cursor: default; }
/* The Summary's player stats: the name stays put while the numbers scroll. */
.gdy-tl-lab { margin: 6px 4px 2px; }
.gdy-pstats th:first-child, .gdy-pstats td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.gdy-pstats td.r, .gdy-pstats th.r { min-width: 30px; font-variant-numeric: tabular-nums; }
.gdy-zero { color: var(--ink-3); }
.gdy-pm { font-weight: 700; }
.gdy-pm.is-up { color: var(--accent-text); }
.gdy-legend-note { margin: 6px 4px 4px; white-space: normal; line-height: 1.5; }
/* Soccer's Statistics page: the Team and Players tabs, cards stacked. */
/* The game's MVPs. */
.gdy-mvp { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gdy-mvp-who { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.gdy-mvp-cup { font-size: 22px; line-height: 1; }
.gdy-mvp-sheet { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.gdy-mvp-sheet .gdy-pick { align-self: stretch; }
.gdy-mvp-said { font-size: 15px; font-weight: 600; }
.gdy-mvp-row { display: flex; align-items: center; gap: 10px; }
.gdy-mvp-row input { width: 20px; height: 20px; flex: 0 0 auto; }
.gdy-mvp-mark { margin-left: auto; }
.gs-stack { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.gs-stack .gdy-vs-head b { font-size: 18px; }
/* Players' tables (Game Day Live History, Roster › Playing Time): the Roster's toolbar on top, the table scrolling sideways under it. */
.gs-pcard { overflow: hidden; }
.gs-ptable { padding: 4px 8px; overflow-x: auto; }
.gs-per { display: block; font-size: 10.5px; font-weight: 500; color: var(--ink-3); }
.gdy-tp-t { font-size: 14px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Game day: dragging a player onto a spot, another player, or off the field. */
.gdy-drag { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.gdy-drag.is-lifted { opacity: .35; }
.gdy-page.is-dragging, .gdy-page.is-dragging * { cursor: grabbing; }
.gdy-ghost { position: fixed; z-index: 1000; pointer-events: none; transform: translate(-50%, calc(-100% - 26px)); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gdy-ghost-dot { width: 50px; height: 50px; border-radius: 50%; background: #fff; color: #181c22; display: flex; align-items: center; justify-content: center;
  font: 800 20px 'Barlow Condensed', system-ui, sans-serif; border: 3px solid #ffd447; box-shadow: 0 6px 16px rgba(0,0,0,.4); }
.gdy-ghost-nm { font: 700 12px system-ui, sans-serif; color: #fff; background: #1b2230; border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.gdy-p.is-over .gdy-dot { box-shadow: 0 0 0 5px #ffd447, 0 2px 6px rgba(0,0,0,.25); transform: scale(1.15); }
.gdy-b.is-over { box-shadow: 0 0 0 3px #ffd447; transform: scale(1.05); }
.gdy-out.is-over { outline: 2px dashed #ffd447; outline-offset: -2px; }
.gdy-b.is-setup { padding-top: 10px; }

/* Players who can't play today, from the attendance check: shown, never picked. */
.gdy-unavail-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gdy-unavail-head .gdy-lab { margin: 0; }
.gdy-unavail-list { padding-top: 8px; }
.gdy-b.is-out { cursor: default; opacity: .6; border-style: dashed; background: transparent; padding-top: 8px; }
.gdy-b.is-out .gdy-bnm { text-decoration: line-through; text-decoration-thickness: 1px; }
.gdy-why { font-size: 10.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.gdy-unavail .gdy-hint { margin-top: 8px; }

/* Game day: the score, + Log, the sub reminder, and the game's events (since 2026-11-29). */
/*
 * Our side and theirs, in the brand: crimson for us, slate for them (fills
 * that carry white text), and the theme's own crimson and quiet ink for text
 * on a card. On :root, as the Log sheet opens outside the page.
 */
:root { --gd-us: var(--accent); --gd-them: #66707d; --gd-us-text: var(--accent-text); --gd-them-text: var(--ink-3); }
/* The reminder and + Log on one row, then the two teams as the phone app shows a game: logo over name, the score between. */
.gdy-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.gdy-matchup { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; margin-top: 10px; }
.gdy-side { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.gdy-crest { width: 56px; height: 56px; object-fit: contain; }
.gdy-crest.is-blank { display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #d5dbe3; font: 800 20px system-ui, sans-serif; }
.gdy-side-nm { font-size: 16px; font-weight: 800; color: #fff; text-align: center; line-height: 1.2; max-width: 100%; overflow-wrap: anywhere; }
.gdy-mscore { font: 800 44px/56px 'Barlow Condensed', system-ui, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: .02em; }
.gdy-sub.is-final { text-align: center; margin-top: 8px; }
.gdy-remind { border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #b8c1cd; border-radius: 99px; padding: 5px 10px; font: 700 13px system-ui, sans-serif; font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap; }
.gdy-remind.is-on { color: #fff; border-color: #ffd447; }
.gdy-remind:disabled { cursor: default; }
.gdy-logbtn { border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: var(--radius-sm); padding: 8px 14px; font: 700 14px system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.gdy-logbtn:hover { filter: brightness(1.08); }
/* Log, off the Charting tab: grey (since 2026-12-03). */
.gdy-logbtn:disabled { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.14); color: rgba(255,255,255,.45); cursor: default; filter: none; }
/* Cancel and + Log the same width, one above the other at the right of the header. */
.gdy-head .gdy-cancel, .gdy-actions .gdy-logbtn { width: 84px; text-align: center; padding-inline: 0; }
/* Soccer's End 1st half / Start 2nd half: as wide as its words (since 2026-12-02). */
.gdy-head .gdy-cancel.gdy-wide { width: auto; padding-inline: 10px; white-space: nowrap; }
/* ‹ Schedule stays on one line; on the narrowest phones the top row's buttons sit a little closer. */
.gdy-head-row .gdy-back { white-space: nowrap; }
@media (max-width: 370px) { .gdy-page .gdy-head-end { gap: 5px; } .gdy-head .gdy-cancel.gdy-wide { padding-inline: 7px; } .gdy-page .gdy-head .gdy-cancel:not(.gdy-wide) { width: 72px; } }
.gdy-ring { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #ffd447; color: #181c22; border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 14px; animation: gdy-ring 1s ease-in-out 3; }
@keyframes gdy-ring { 50% { transform: scale(1.03); } }
.gdy-remind-btn { align-self: flex-start; margin-top: 8px; }
.gdy-remind-set { display: flex; flex-direction: column; gap: 12px; }
.gdy-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.gdy-check input { width: 18px; height: 18px; flex: 0 0 auto; }

/* The Log sheet: whose, then what. */
.gdy-log { display: flex; flex-direction: column; gap: 12px; }
.gdy-sides { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gdy-sides button { border: 0; background: var(--surface); color: var(--ink-2); padding: 10px 6px; font-weight: 700; font-size: 14px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gdy-sides button.is-us.is-on { background: var(--gd-us); color: #fff; }
.gdy-sides button.is-them.is-on { background: var(--gd-them); color: #fff; }
.gdy-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
/* Soccer's Charting: small tiles, four across, the code over the full name (since 2026-12-02). */
.gdy-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.gdy-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 58px; padding: 8px 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-2); font-size: 11.5px; font-weight: 600; line-height: 1.15; text-align: center; cursor: pointer; }
.gdy-tile:hover:not(:disabled) { border-color: var(--line-strong); color: var(--ink); }
.gdy-tile:active:not(:disabled) { transform: scale(.97); }
.gdy-tile b { font: 800 17px/1 'Barlow Condensed', system-ui, sans-serif; letter-spacing: .02em; color: var(--gd-us-text); }
.gdy-tile.is-them b { color: var(--gd-them-text); }
.gdy-tile b.is-yellow { color: #f5c518; }
.gdy-tile.is-goal { border-color: var(--gd-us); }
.gdy-tile.is-goal.is-them { border-color: var(--gd-them); }
.gdy-stat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 68px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.2; text-align: center; cursor: pointer; }
.gdy-stat b { font: 800 19px/1 'Barlow Condensed', system-ui, sans-serif; color: var(--gd-us-text); }
.gdy-stat.is-them b { color: var(--gd-them-text); }
.gdy-stat.is-goal { border-width: 2px; border-color: var(--gd-us); }
.gdy-stat.is-goal.is-them { border-color: var(--gd-them); }
.gdy-pick-lab { margin: 8px 0 0; }
.gdy-outcomes { grid-template-columns: repeat(3, 1fr); }
.gdy-outcomes .gdy-stat b { font-size: 22px; }

/* Events in the timeline. */
.gdy-ev { cursor: default; display: inline-block; min-width: 30px; text-align: center; font: 800 11px/18px system-ui, sans-serif; color: #fff; background: var(--gd-us); border-radius: 5px; padding: 0 4px; }
.gdy-ev.is-them { background: var(--gd-them); }
.gdy-tl strong { font-weight: 700; }
.gdy-tl-sc { font-weight: 800; font-variant-numeric: tabular-nums; }
/* The Timeline's filters, in the card's header row as football's Table | Story is (since 2026-12-02). */
.gdy-tl-card { padding-top: 0; overflow: hidden; }
.gdy-tl-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; margin: 0 -12px 4px; padding: 6px 12px; background: var(--head-bg); border-bottom: 1px solid var(--line-strong); }
.gdy-tl-head .gdy-check { font-size: 12px; font-weight: 650; color: var(--ink-2); gap: 6px; }
.gdy-tl-head .gdy-check input { width: 15px; height: 15px; }
.gdy-tl-none { margin: 10px 0 4px; }
/* Soccer's Table | Story, at the right of the Timeline's header row; the Story's lines as football's (since 2026-12-02). */
.gdy-tl-head .gdy-tl-toggle { margin-left: auto; }
.gdy-tl-card.fgl-story .gdy-tl-head { margin: 0; }
.gdy-tl-card.fgl-story .gdy-tl-none { margin: 10px 12px; }
.gdy-story-line.is-us { box-shadow: inset 3px 0 0 var(--gd-us); }
.gdy-story-line.is-them { box-shadow: inset 3px 0 0 var(--gd-them); }
.gdy-story-line.is-swap { box-shadow: inset 3px 0 0 var(--good); }
/* The Table's half band, edge to edge as the Story's (since 2026-12-02); the row under it needs no line. */
.gdy-tl-card:not(.fgl-story) .gdy-tl-q { margin: 0 -12px; }
.gdy-tl-card:not(.fgl-story) .gdy-tl-head + .gdy-tl-q { margin-top: -4px; }
.gdy-tl-q + .gdy-tl { border-top: 0; }
.gdy-story-line .gdy-story-t { flex: 0 0 38px; font-variant-numeric: tabular-nums; }

/* The two teams side by side. */
.gdy-vs-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 8px; font-weight: 700; font-size: 13px; }
.gdy-vs-head .is-us { color: var(--gd-us-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gdy-vs-head .is-them { color: var(--gd-them-text); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gdy-vs-head b { font: 800 28px/1 'Barlow Condensed', system-ui, sans-serif; color: var(--ink); }
.gdy-vs-row { display: grid; grid-template-columns: 24px 1fr auto 1fr 24px; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.gdy-vs-row > b { font-variant-numeric: tabular-nums; }
.gdy-vs-row > b:last-child { text-align: right; }
.gdy-vs-lab { text-align: center; color: var(--ink-2); font-weight: 600; min-width: 96px; }
.gdy-vs-bar { display: flex; height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.gdy-vs-bar.is-us { justify-content: flex-end; }
.gdy-vs-bar i { display: block; height: 100%; background: var(--gd-us); border-radius: 5px; }
.gdy-vs-bar.is-them i { background: var(--gd-them); }

/*
 * Game Day Live for tackle football (views/football-game-day.js): the
 * sideline's play log. Soccer's page, header, tabs and cards, with a pad of
 * big buttons to tap a play and the sheet that fills it in.
 */
.fgl-ball { font: 800 11px/18px system-ui, sans-serif; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--gd-us); border-radius: 5px; padding: 0 6px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: center; }
.fgl-ball.is-them { background: var(--gd-them); }
/* Our defense on the Summary: a tile for each. */
.gdy-score.fgl-def { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px 6px; }
.fgl-recent { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.fgl-recent:first-of-type { border-top: 0; }
.fgl-recent-w { min-width: 0; }

/* The play sheet. */
.fgl-sheet { display: flex; flex-direction: column; gap: 14px; }
.fgl-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fgl-chip { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 99px; padding: 7px 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.fgl-chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.fgl-flag.is-on { background: #ffd447; border-color: #e0b400; color: #181c22; }
.fgl-star { align-self: flex-start; }
.fgl-star.is-on { background: #ffd447; border-color: #e0b400; color: #181c22; }
.fgl-opt { font-weight: 500; text-transform: none; letter-spacing: 0; }
.fgl-spot-read { display: flex; align-items: baseline; gap: 10px; }
.fgl-spot-read b { font: 800 30px/1 'Barlow Condensed', system-ui, sans-serif; }
.fgl-spot-read span { font-weight: 700; color: var(--ink-2); }
.fgl-spot-read .is-up { color: var(--good); }
.fgl-spot-read .is-down { color: var(--bad); }
.fgl-range { width: 100%; margin: 10px 0 2px; accent-color: var(--accent); }
.fgl-range-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); gap: 8px; }
.fgl-range-ends span { max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fgl-nudge { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 8px; }
.fgl-nudge .fgl-chip { padding: 7px 0; font-variant-numeric: tabular-nums; }
.fgl-role { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.fgl-role-l { font-size: 13px; color: var(--ink-2); min-width: 96px; }
.fgl-nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; margin-top: 8px; max-height: 40vh; overflow-y: auto; }
.fgl-num { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; min-width: 0; }
.fgl-num b { font: 800 20px/1 'Barlow Condensed', system-ui, sans-serif; }
.fgl-num span { font-size: 11px; color: var(--ink-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fgl-num.is-on { border-color: var(--gd-us); box-shadow: 0 0 0 2px var(--gd-us); }
.fgl-flagbox { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 10px; }
.fgl-two { grid-template-columns: 1fr 1fr; }

/* The Timeline. */
.fgl-tl .gdy-tl-t { font-size: 12px; }
.fgl-tl.is-todo { background: color-mix(in srgb, #ffd447 14%, transparent); }
.fgl-tl-d { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.fgl-tl-team { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; white-space: nowrap; }
/* The Timeline's Table | Story toggle, in the header row right of Outcome, and the Story (since 2026-12-02). */
.fgl-plays th.fgl-tl-th { text-align: right; padding-block: 4px; }
/* The table scrolls sideways on a phone: the toggle stays in sight at the right of the header row. */
.fgl-plays th.fgl-tl-th { position: sticky; right: 0; z-index: 2; }
.fgl-tl-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; vertical-align: middle; }
.fgl-tl-toggle button { border: 0; background: var(--surface); color: var(--ink-2); padding: 3px 8px; font: 650 11px system-ui, sans-serif; text-transform: none; letter-spacing: 0; cursor: pointer; }
.fgl-tl-toggle button + button { border-left: 1px solid var(--line-strong); }
.fgl-tl-toggle button.is-on { background: var(--gd-us); color: #fff; }
.fgl-story-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px 4px 12px; background: var(--head-bg); border-bottom: 1px solid var(--line-strong); font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.fgl-story { padding: 0; overflow: hidden; }
.fgl-story-q { background: var(--ink); color: var(--on-ink); font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 5px 12px; }
.fgl-story-line { display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.fgl-story-line:last-child { border-bottom: 0; }
.fgl-story-line.unit-offense { box-shadow: inset 3px 0 0 var(--offense); }
.fgl-story-line.unit-defense { box-shadow: inset 3px 0 0 var(--defense); }
.fgl-story-line.unit-special_teams { box-shadow: inset 3px 0 0 var(--special); }
.fgl-story-down { flex: 0 0 30px; font-size: 12.5px; color: var(--ink-3); }
.fgl-story-text { min-width: 0; }
.fgl-story-score { margin-left: 6px; white-space: nowrap; }
.fgl-tl-d.is-todo { color: #8a6500; font-weight: 600; }
/* Last logged and the Timeline as the film breakdown's table (since 2026-12-01). */
.fgl-plays { width: 100%; }
.fgl-plays td.fgl-row-a { text-align: right; padding-block: 2px; }
.fgl-plays td.fgl-row-a .btn { padding-inline: 8px; }
.fgl-plays tr.is-todo td { background: color-mix(in srgb, #e0b100 8%, transparent); }
.fgl-plays .fgl-tl-d { white-space: normal; }

/* A game's film on Plus: the plays logged in Game Day Live, each a place to jump to. */
.fgl-marks { margin-top: 10px; }
.fgl-marks-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fgl-marks-head .gdy-lab { margin: 0; }
.fgl-marks-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-height: 220px; overflow-y: auto; }
.fgl-mark { border: 1px solid var(--line); border-left: 4px solid var(--gd-us); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 5px 9px; font-size: 13px; cursor: pointer; text-align: left; }
.fgl-mark.is-them { border-left-color: var(--gd-them); }
.fgl-mark-q { font-weight: 800; color: var(--ink-3); font-size: 11px; }
@media (max-width: 400px) {
  .fgl-pad-btn b { font-size: 18px; }
  .fgl-role-l { min-width: 80px; }
}

/*
 * Football's Game Day Live: who is on the field (views/football-game-day.js).
 * A unit's eleven as spots, the bench as chips, each with the player's plays;
 * a spot or chip is tapped or dragged (pointer events, so iPhones drag too).
 */
.fgl-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fgl-row label { font-size: 13px; color: var(--ink-2); }
.fgl-row .input { width: 80px; }
.gdy-table b.is-under, .gdy-table span.is-under { color: var(--bad); }
.gdy-table b.is-met { color: var(--good); }
.fgl-ok { color: var(--good); font-weight: 800; }
/* Soccer's Game Day Live without tracking who's on the field: + Log, big, in the middle of the screen. */
.gdy-logbig { display: block; width: 100%; margin-top: 12px; padding: 14px; font-size: 18px; border-radius: 12px; }

/* Football's Game Day Live, built as soccer's (since 2026-11-30): its title, the field with yard lines, the quiet track line. */
.fgl-title { display: flex; align-items: center; gap: 8px; font: 800 20px/1 'Barlow Condensed', system-ui, sans-serif; text-transform: uppercase; letter-spacing: .02em; color: #fff; }
.fgl-head-acts { display: flex; align-items: center; gap: 8px; }
.gdy-pitch.is-football .gdy-yl { position: absolute; left: 2.2%; right: 2.2%; border-top: 2px solid rgba(255,255,255,.7); pointer-events: none; }
/* Short and wide, as Playmaker's field: a unit lines up in five to fifteen yards. */
.gdy-pitch.is-football { aspect-ratio: 68 / 48; }
/* The formation's name in the bottom corner, clear of the line. */
.gdy-pitch.is-football .gdy-form { top: auto; bottom: 3.5%; }
.gdy-pitch.is-football .gdy-yl.is-los { border-top: 3px solid rgba(120,180,255,.85); }
.gdy-pitch.is-football .gdy-p { width: 48px; }
.gdy-pitch.is-football .gdy-dot { width: 32px; height: 32px; font-size: 14px; }
.gdy-pitch.is-football .gdy-nm { font-size: 10px; max-width: 48px; margin-top: 1px; }
/* The plays on the circle's corner, so a row is just the circle and the name and ten yards fit four rows. */
.gdy-pitch.is-football .gdy-mn { position: absolute; top: 19px; left: calc(50% + 8px); min-width: 14px; padding: 0 3px; font: 700 9.5px/13px system-ui, sans-serif; text-align: center; color: #fff; background: #1b2230; border: 1px solid rgba(255,255,255,.4); border-radius: 99px; }
.fgl-quiet { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); padding: 0 4px; }
.fgl-quiet-l { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.fgl-quiet .pm-switch { transform: scale(.8); transform-origin: left center; }
.fgl-quiet-n { width: 46px; height: 30px; padding: 2px 4px; text-align: center; font-size: 13px; }
/* Track lineups (and football's Min plays) at the bottom of the dark header before kickoff (since 2026-12-03). */
.gdy-head .gdy-head-track { margin-top: 2px; padding: 0; color: #c9ced6; }
/* Three columns on the date's line (since 2026-12-03): the date, Min plays under Coaches only, Track lineups at the right corner. */
.gdy-head .gdy-head-track { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.gdy-head .gdy-head-track.is-two { grid-template-columns: minmax(0, 1fr) auto; }
.gdy-head .gdy-head-track > .gdy-sub { margin: 0; min-width: 0; }
.gdy-head .gdy-head-track > :last-child { justify-self: end; }
.fgl-rules { text-align: left; }
.fgl-hint { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fgl-log-group + .fgl-log-group { margin-top: 12px; }
.fgl-log-group .gdy-lab { margin-bottom: 6px; }
.fgl-plays-head { justify-content: space-between; margin: 6px 4px 2px; }
.fgl-plays-head .gdy-lab { margin: 0; }
.fgl-plays-head select { width: auto; }
.fgl-benchzone.is-over { outline: 2px dashed #ffd447; outline-offset: 2px; border-radius: 12px; }
/* A big roster's bench: the unit's players or everyone, a number or name search, Show all. */
.fgl-benchbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 8px; }
.fgl-benchbar .gdy-chips { flex-wrap: nowrap; }
.fgl-benchbar .gdy-chip { white-space: nowrap; }
.fgl-search { flex: 1 1 90px; min-width: 90px; height: 34px; font-size: 13px; }
.fgl-more { width: 100%; margin-top: 8px; }
.fgl-none { margin: 6px 2px; font-size: 13px; }
/* Special teams: which of its units, beside the unit buttons. */
.fgl-units .fgl-special { width: auto; height: 34px; padding: 4px 28px 4px 10px; font-size: 13px; font-weight: 600; }
/* Football's Units line: the sub reminder in the middle, We kick off at the far right (since 2026-12-03).
   Also the Kickoff card's only line when lineups aren't tracked. */
.fgl-units-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 6px; }
.fgl-units-head.is-only { margin-bottom: 0; }
.fgl-units-head .gdy-lab { margin: 0; }
.fgl-units-head .gdy-remind-btn { margin: 0; }
.fgl-units-head .fgl-kick { justify-self: end; }
/* Soccer's Formation line, with the sub reminder at its far right (since 2026-12-03). */
.gdy-form-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.gdy-form-head .gdy-lab { margin: 0; min-width: 0; }
.gdy-form-head .gdy-remind-btn { margin: 0; flex: 0 0 auto; }
.fgl-kick { font-size: 13px; color: var(--ink-2); }
.fgl-kick .pm-switch { transform: scale(.8); transform-origin: right center; }
/* Football's Charting tab: the play form, laid out like the charting page (since 2026-11-30). */
/* Five tabs, each sized to its word, so they fit a phone: football's and soccer's alike. */
.gdy-page .gdy-tabs button { flex: 1 1 auto; font-size: 13px; padding-inline: 4px; white-space: nowrap; }
.fgl-chart { display: flex; flex-direction: column; gap: 12px; }
.fgl-flab { margin-bottom: 6px; }
.fgl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fgl-grid.is-yl { grid-template-columns: 1.4fr 1fr; }
/* Players on this play and Penalty share a row; each cell can shrink, and the section's heading sits level with Penalty's label. */
.fgl-who-row > * { min-width: 0; }
.fgl-who-row .fgl-players > :first-child { margin-top: 0; }
.fgl-yl { display: flex; gap: 8px; }
.fgl-yl select.input { flex: 1 1 auto; width: auto; min-width: 0; }
.fgl-yl .input.fgl-ylnum { flex: 0 0 64px; width: 64px; min-width: 0; text-align: center; padding-inline: 4px; }
/* The Charting form's number boxes without the browser's ▲▼ buttons (since 2026-12-01): typed on a phone's number pad. */
.fgl-chart input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.fgl-chart input[type="number"]::-webkit-inner-spin-button,
.fgl-chart input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* A box with nothing to ask on this play (Down and Distance on a kickoff or try): greyed, as the selects are. */
/* (input.input…:not() outranks the site's base input rule, whose :not() list counts five attributes.) */
.gdy-page .fgl-chart input.input:disabled:not([type="checkbox"]):not([type="radio"]), .gdy-page .fgl-chart select:disabled,
.fgl-chart-dialog input.input:disabled:not([type="checkbox"]):not([type="radio"]), .fgl-chart-dialog select:disabled { background: var(--surface-2); border-color: var(--line); color: var(--ink-3); opacity: .7; }
.fgl-helper { font-size: 13px; margin-top: -4px; }
.fgl-helper .is-up { color: var(--good); }
.fgl-helper .is-down { color: var(--bad); }
.fgl-seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.fgl-seg button { flex: 1; padding: 8px 4px; border: 0; border-left: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 13px system-ui, sans-serif; cursor: pointer; }
.fgl-seg button:first-child { border-left: 0; }
.fgl-seg button.is-on { background: var(--ink); color: var(--surface); }
.fgl-star-l { display: flex; align-items: center; gap: 8px; font-size: 14px; }
/* The score and clock, slimmed for a phone (since 2026-11-30): each logo beside its name on one line, a shorter clock row. */
.gdy-matchup { align-items: center; gap: 10px; margin-top: 8px; }
.gdy-side { flex-direction: row; justify-content: flex-start; gap: 8px; }
/* Each logo beside the score, its name outside it: Name [logo] 0 : 0 [logo] Name. */
.gdy-matchup .gdy-side:first-child { flex-direction: row-reverse; }
.gdy-matchup .gdy-side:first-child .gdy-side-nm { text-align: right; }
.gdy-crest { width: 34px; height: 34px; flex: none; }
.gdy-crest.is-blank { font-size: 13px; }
.gdy-side-nm { font-size: 14px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; overflow-wrap: normal; }
.gdy-matchup .gdy-side:last-child .gdy-side-nm { text-align: left; }
.gdy-mscore { font-size: 34px; line-height: 34px; }
.gdy-clock { margin-top: 8px; padding-top: 8px; gap: 8px; }
.gdy-t { font-size: 34px; }
.gdy-per { font-size: 11px; letter-spacing: .08em; }
.gdy-play { width: 42px; height: 42px; }
.gdy-play.is-running::before { width: 13px; height: 16px; border-left-width: 5px; border-right-width: 5px; }
.gdy-play.is-paused::before { margin-left: 4px; border-left-width: 14px; border-top-width: 9px; border-bottom-width: 9px; }
.gdy-share b { font-size: 20px; }
/* Player Time, one line a player: name, then each position over its time, then the total (since 2026-11-30). */
.gdy-time { display: grid; grid-template-columns: minmax(84px, 34%) 1fr auto; align-items: center; gap: 10px; padding: 7px 0; }
.gdy-time-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.gdy-time .gdy-time-pos { margin-top: 0; gap: 6px 8px; }
.gdy-time .gdy-tp-l { font-size: 11px; padding: 2px 6px; }
.gdy-time .gdy-tp-t { font-size: 11px; }
.gdy-time .gdy-time-total { font-size: 14px; }
