:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #59636e;
  --border: #d1d9e0;
  --accent: #111214;
  --accent-ink: #ffffff;
  --danger: #cf222e;
  --warn-bg: #fff8c5;
  --yes: #1a7f37;
  --no: #cf222e;
  --maybe: #9a6700;
  --pending: #59636e;
  --turf: #2f7d32;
  --turf-line: rgba(255, 255, 255, .55);
  --chrome: #111214;
  --chrome-2: #232528;
  --chrome-line: #3a3d42;
  --chrome-text: #d4d6da;
  --chrome-dim: #9a9ea5;
  --highlight: #c9ccd1;
  --highlight-soft: rgba(201,204,209,.16);
  --radius: 10px;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); }
h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 0 0 .25rem; }
h3 { font-size: 1rem; margin: 0; }
a { color: #0969da; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; color: var(--muted); margin: 0 0 .2rem; }
.view { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 16px; background: var(--chrome); color: #fff; }
.topbar .brand { color: var(--highlight); font: 700 20px "Barlow Condensed", "Arial Narrow", sans-serif; letter-spacing: .06em; text-decoration: none; }
.topbar nav { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }
.topbar nav a { color: var(--chrome-text); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-weight: 600; }
.topbar nav a.active, .topbar nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.role-pill { margin-left: 6px; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--highlight-soft); color: var(--highlight); }
.topbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.topbar .who { color: var(--chrome-text); font-size: .9rem; }
.topbar select { width: auto; max-width: 220px; background: var(--chrome-2); color: #fff; border-color: var(--chrome-line); }
.topbar .link { color: var(--chrome-text); }
.banner { background: var(--warn-bg); border-bottom: 1px solid #e3d48a; padding: 8px 16px; text-align: center; font-size: .9rem; }

/* controls */
input, select, textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: inherit; }
textarea { resize: vertical; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: auto; }
.label-text { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; }
@media (hover: hover) { button:hover, .button:hover { background: #eef1f4; } }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (hover: hover) { button.primary:hover, .button.primary:hover { background: #31453a; } }
button.danger { color: var(--danger); }
button.small { padding: 4px 10px; font-size: .85rem; }
button.link { border: 0; background: none; padding: 0; color: #0969da; font-weight: 400; }
button.link.danger { color: var(--danger); }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
legend { font-weight: 600; font-size: .9rem; padding: 0 4px; }

/* layout */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card.narrow { max-width: 440px; margin: 40px auto; }
.narrow-wide { max-width: 860px; margin: 30px auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.grid3 > label { min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head .row input, .page-head .row select { width: auto; }
.section { margin: 24px 0 10px; }
.auth h1 { margin-bottom: 4px; }
.warn { background: var(--warn-bg); padding: 8px 12px; border-radius: 6px; }
.notes { white-space: pre-wrap; }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #eef1f4; color: var(--muted); }
.tag.game { background: #ffebe9; color: var(--danger); }
.tag.practice { background: #dafbe1; color: var(--yes); }
.tag.ok { background: #dafbe1; color: var(--yes); }
.error-text { color: var(--danger); }
ul.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }

/* plays grid */
.play-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.play-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; padding: 10px; }
.play-card:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.play-meta { display: flex; flex-direction: column; gap: 2px; }
.empty { grid-column: 1 / -1; text-align: center; padding: 40px; }

/* play editor / viewer (designer styles live in apps/playbook/designer.css) */
.editor { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.play-view { display: grid; grid-template-columns: minmax(0, 560px) minmax(240px, 1fr); gap: 16px; align-items: start; }
.play-name { font: 700 18px "Barlow Condensed", "Arial Narrow", sans-serif; text-transform: uppercase; letter-spacing: .03em; }
.display { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; text-transform: uppercase; letter-spacing: .03em; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--chrome); color: #fff; }
.seg button.yes[aria-pressed="true"] { background: var(--yes); }
.seg button.no[aria-pressed="true"] { background: var(--no); }
.seg button.maybe[aria-pressed="true"] { background: var(--maybe); }
.my-rsvp { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.versions { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; margin: 12px 0; }
.version { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; padding: 8px; }
/* home + settings */
.space-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.space-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; min-height: 80px; justify-content: center; }
.space-card:hover { border-color: var(--accent); }
.space-card.add { align-items: center; color: var(--muted); border-style: dashed; font-weight: 600; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.invites li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.roles-help ul { margin: 6px 0 0; padding-left: 18px; }
.roles-help summary { cursor: pointer; color: #0969da; }

/* roster */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
td.right { text-align: right; }
.contact-row { display: grid; grid-template-columns: 1fr 100px 1.4fr 1fr auto; gap: 6px; margin-bottom: 6px; align-items: center; }
/* roster as a list: one row per player with parent, email and cell visible without opening them */
.roster-table { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.rt-row { display: grid; grid-template-columns: minmax(150px, 1.1fr) 1fr 1.6fr 1fr; gap: 4px 16px; align-items: start; width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; text-align: left; font: inherit; font-weight: 400; white-space: normal; color: inherit; min-height: 0; }
.rt-row:last-child { border-bottom: 0; }
button.rt-row { cursor: pointer; }
@media (hover: hover) { button.rt-row:hover { background: var(--bg); } }
.rt-head { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--bg); }
.rt-cell { min-width: 0; overflow-wrap: anywhere; }
.rt-cell > div + div { margin-top: 3px; }
.rt-label { display: none; }

/* schedule */
.event-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.event-card:hover { border-color: var(--accent); }
.event-card .tag { justify-self: start; }
[hidden] { display: none !important; }
.counts { display: flex; gap: 10px; font-size: .85rem; font-weight: 600; flex-wrap: wrap; }
.counts.big { font-size: 1rem; }
.yes { color: var(--yes); } .no { color: var(--no); } .maybe { color: var(--maybe); } .pending { color: var(--pending); }
select.status { width: auto; font-weight: 600; }
select.status.yes { color: var(--yes); } select.status.no { color: var(--no); } select.status.maybe { color: var(--maybe); }

/* messages */
.grid-messages { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.checklist { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.history-item { display: flex; flex-direction: column; align-items: flex-start; text-align: left; white-space: normal; font-weight: 400; gap: 2px; }
.status-pill { font-size: .8rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #eef1f4; }
.status-pill.sent { background: #dafbe1; color: var(--yes); }
.status-pill.failed { background: #ffebe9; color: var(--danger); }
.status-pill.logged { background: var(--warn-bg); color: #7d4e00; }
#preview { width: 100%; height: 340px; border: 1px solid var(--border); border-radius: 8px; margin-top: 12px; background: #fff; }

/* team */
.copy-row { display: flex; gap: 6px; }
.join-code { font: 700 1.8rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .15em; background: #eef1f4; padding: 12px; border-radius: 8px; text-align: center; margin: 0; }

/* modal + toast */
dialog { border: 0; border-radius: 12px; padding: 20px; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 40px); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(15, 23, 32, .45); }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 120px); background: #1f2328; color: #fff; padding: 10px 16px; border-radius: 8px; transition: transform .2s; max-width: calc(100vw - 32px); z-index: 50; }
#toast.show { transform: translate(-50%, 0); }
#toast.error { background: var(--danger); }

/* public pages */
body.public { background: #eef3ef; }
.public h1 { margin-bottom: .3rem; }
.public-plays { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.public-play .pd-title { font-size: 20px; }
.public-play { display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 16px; }
.public-play.highlight { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,127,55,.25); }
.toc { margin-bottom: 8px; }
.flash { background: #dafbe1; border: 1px solid #aceebb; padding: 10px 12px; border-radius: 8px; margin: 12px 0; }
.rsvp-options { display: flex; flex-direction: column; gap: 8px; }
.rsvp-option { flex-direction: row; align-items: center; gap: 10px; border: 2px solid var(--border); border-radius: 8px; padding: 12px; cursor: pointer; font-size: 1rem; }
.rsvp-option input { width: auto; }
.rsvp-option.yes:has(input:checked) { border-color: var(--yes); background: #dafbe1; }
.rsvp-option.no:has(input:checked) { border-color: var(--no); background: #ffebe9; }
.rsvp-option.maybe:has(input:checked) { border-color: var(--maybe); background: var(--warn-bg); }
.when { font-weight: 600; }

@media (max-width: 860px) {
  .topbar { position: static; }
  .play-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .play-card { padding: 8px; }
  .editor, .grid-messages, .play-view { grid-template-columns: 1fr; }
  .topbar .who { display: none; }
  .event-card { grid-template-columns: 1fr; gap: 6px; }
  .topbar select { max-width: none; }
  .contact-row { grid-template-columns: 1fr 1fr; }
  .contact-row input[type=email], .contact-row input[type=tel] { grid-column: 1 / -1; }
  .topbar-right { margin-left: 0; width: 100%; }
  .topbar select { flex: 1; }
}

/* ---------- lists shared by phone and desktop ---------- */
.att-list { display: flex; flex-direction: column; }
.att-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.att-row:last-child { border-bottom: 0; }
.seg button { min-height: 40px; }
.roster-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.roster-card { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%; text-align: left; font: inherit; font-weight: 400; white-space: normal; cursor: default; }
button.roster-card { cursor: pointer; }
@media (hover: hover) { button.roster-card:hover { border-color: var(--accent); background: var(--surface); } }
.roster-head { display: flex; gap: 12px; align-items: center; }
.jersey { flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--chrome); color: var(--highlight); display: grid; place-items: center; font: 700 17px "Barlow Condensed", "Arial Narrow", sans-serif; }
.chev { margin-left: auto; font-size: 26px; line-height: 1; color: var(--muted); }
.roster-contacts { display: flex; flex-direction: column; gap: 4px; padding-left: 52px; }
.roster-contacts > div { display: flex; flex-wrap: wrap; gap: 0 6px; align-items: center; }
.roster-contacts .email { color: var(--muted); overflow-wrap: anywhere; }
.mobile-only, .bottomnav, .account { display: none; }
.banner .short { display: none; }

/* ---------- phones ---------- */
@media (max-width: 720px) {
  :root { --nav-h: 62px; }
  .desktop-only { display: none !important; }
  .mobile-only { display: flex; }
  body { font-size: 16px; }
  /* 16px+ text in fields stops iPhones from zooming in when you tap one. */
  input, select, textarea { font-size: 16px; }
  button, .button { min-height: 44px; }
  h1 { font-size: 1.5rem; }
  .view { padding: 14px 14px 32px; }
  body.has-bottomnav .view { padding-bottom: calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); }

  /* slim header: brand, team switcher, account button */
  .topbar { position: sticky; top: 0; flex-wrap: nowrap; gap: 8px; padding: calc(6px + env(safe-area-inset-top)) 12px 6px; }
  .topbar #tabs, .topbar .who, .topbar #logout { display: none; }
  .topbar .brand { font-size: 18px; }
  .topbar select { flex: 1; min-width: 0; max-width: none; height: 40px; }
  .topbar-right { margin-left: 0; width: auto; }
  .account { display: inline-flex; flex: 0 0 40px; width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--highlight); color: var(--chrome); font-weight: 800; }

  /* bottom tab bar */
  .bottomnav:not([hidden]) { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--chrome); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 12px rgba(0,0,0,.15); }
  .bottomnav a { flex: 1; min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--chrome-dim); text-decoration: none; font-size: 11px; font-weight: 600; border-radius: 10px; -webkit-tap-highlight-color: transparent; }
  .bottomnav a svg { width: 24px; height: 24px; }
  .bottomnav a.active { color: var(--highlight); }

  .banner { font-size: 13px; padding: 6px 12px; }
  .banner .long { display: none; }
  .banner .short { display: inline; }
  #toast { bottom: calc(var(--nav-h) + 76px + env(safe-area-inset-bottom)); }

  /* page headers: controls take full rows */
  .page-head { align-items: stretch; margin-bottom: 10px; }
  .page-head > .row { width: 100%; }
  .page-head input[type=search] { flex: 1 1 100%; width: auto; }
  .page-head .row > .primary { flex: 1; }
  .action-row { width: 100%; }
  .action-row > * { flex: 1 1 100%; }

  /* play editor: Save stays reachable above the tab bar */
  .save-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 15; gap: 8px; padding: 8px 12px; background: rgba(244,246,248,.97); border-top: 1px solid var(--border); }
  .save-bar .primary { flex: 1; font-size: 16px; }
  .save-bar #m-more { flex: 0 0 96px; }
  .editor { gap: 12px; }
  .editor > .card { padding: 10px; }

  /* pop-ups slide up from the bottom */
  dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 16px 16px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 88vh; }
  .sheet-actions button { width: 100%; min-height: 50px; font-size: 16px; }
  .contact-row { grid-template-columns: 1fr 1fr auto; padding: 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
  .contact-row [data-rm] { grid-column: 3; grid-row: 1; min-width: 44px; }
  .contact-row input[type=email] { grid-column: 1 / -1; grid-row: 2; }
  .contact-row input[type=tel] { grid-column: 1 / -1; grid-row: 3; }
  .rt-head { display: none; }
  .rt-row { grid-template-columns: 1fr; gap: 2px; padding: 12px 14px; }
  .rt-label { display: inline; color: var(--muted); font-size: .8rem; margin-right: 6px; }
  #compose textarea { height: 140px; }
  .grid3 { grid-template-columns: 1fr 90px; }

  /* attendance and schedule: big full-width answer buttons */
  .att-row { grid-template-columns: 1fr; }
  .att-row .seg, .my-rsvp .seg { display: flex; width: 100%; }
  .att-row .seg button, .my-rsvp .seg button { flex: 1; min-height: 48px; font-size: 16px; }
  .my-rsvp { align-items: stretch; }
  .counts.big { font-size: .95rem; }

  /* tables become stacked cards */
  .stack-table thead { display: none; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
  .stack-table tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .stack-table td { border: 0; padding: 4px 0; }
  .stack-table td.right { text-align: left; }
  .settings-grid, .grid2 { grid-template-columns: 1fr; }
  .roster-list { grid-template-columns: 1fr; }
}

/* Grid/flex children default to "at least as wide as their content", which let the
   designer's sideways-scrolling rows push the page wider than a phone. */
.editor > *, .play-view > *, .pd, .pd-picker, .pd-picker-grid { min-width: 0; }
@media (max-width: 860px) {
  .editor, .play-view, .grid-messages { grid-template-columns: minmax(0, 1fr); }
}
/* A hidden toast must never block taps (it sits over the phone tab bar). */
#toast { pointer-events: none; }
#toast:not(.show) { visibility: hidden; transition: transform .2s, visibility 0s .2s; }

/* ---------- share sheet + group-chat attendance page ---------- */
.share-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.share-buttons button { min-height: 48px; }
.share-buttons .whatsapp { background: #1f8f4e; border-color: #1f8f4e; color: #fff; }
.share-sheet textarea { font-size: 16px; }
.group-rsvp { max-width: 640px; }
.group-rsvp > .card:first-child { margin-bottom: 12px; }
.group-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; scroll-margin-top: 16px; }
.group-who { display: flex; align-items: center; gap: 10px; }
.group-row .seg button { min-height: 44px; min-width: 72px; }
@media (max-width: 720px) {
  .group-row .seg { display: flex; width: 100%; }
  .group-row .seg button { flex: 1; min-height: 48px; font-size: 16px; }
}

/* sign-in code */
.code-input { font: 700 28px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .35em; text-align: center; }
/* Text-style links inside sentences keep normal line height on phones. */
@media (max-width: 720px) { button.link { min-height: 0; } }

/* ---------- HoopsHQ: Team Gray palette (inside a HoopsHQ team, and on its no-login pages) ---------- */
body.app-hoophq, body.hoophq {
  --bg: #eef0f2;
  --accent: #3b4048;
  --chrome: #2b2e33;
  --chrome-2: #3a3e45;
  --chrome-line: #4f545c;
  --chrome-text: #d9dce1;
  --chrome-dim: #a3a8b0;
  --highlight: #d5d9df;
  --highlight-soft: rgba(213,217,223,.16);
}
.rules-group ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.rules-group li { margin: .25rem 0; }
.name-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.name-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* hover/focus help bubble (e.g. the Save as ICS instructions) */
.tip-wrap { position: relative; display: inline-block; }
.tip { display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(340px, 86vw); padding: 12px 14px; background: #1f2328; color: #fff; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.25); font-size: .85rem; line-height: 1.4; text-align: left; font-weight: 400; }
.tip span { display: block; }
.tip span + span { margin-top: 5px; }
.tip span:first-child { font-weight: 700; }
.tip-wrap:hover .tip, .tip-wrap:focus-within .tip { display: block; }
/* Phones: the button sits near the left edge, so a bubble anchored to its right edge ran off-screen.
   Pin it to the screen instead, full width with margins, and let it scroll if it is tall. */
@media (max-width: 640px) {
  .tip { position: fixed; left: 12px; right: 12px; top: auto; width: auto; max-height: 70vh; overflow-y: auto; box-sizing: border-box; font-size: .9rem; }
}

/* FlagHQ keeps the original green and gold (the platform default above is black and gray). */
body.app-playbook, body.playbook {
  --accent: #1d2a1f;
  --chrome: #1d2a1f;
  --chrome-2: #2a3a2c;
  --chrome-line: #3d4f40;
  --chrome-text: #d6dccf;
  --chrome-dim: #aab4a6;
  --highlight: #ffd23f;
  --highlight-soft: rgba(255,210,63,.18);
}

/* ---------- availability, season, game-day tracker ---------- */
.avail { padding: 8px 12px; border-radius: 8px; margin-bottom: 8px; background: #dafbe1; color: var(--yes); }
.avail.warn { background: var(--warn-bg); color: var(--maybe); }
.avail.bad { background: #ffebe9; color: var(--no); }
.avail-group { display: flex; gap: 8px; padding: 4px 0; align-items: baseline; flex-wrap: wrap; }
.avail-h { flex: 0 0 120px; font-weight: 700; font-size: .85rem; }
.avail-h.yes { color: var(--yes); } .avail-h.no { color: var(--no); } .avail-h.maybe { color: var(--maybe); } .avail-h.pending { color: var(--pending); }
.avail-name { display: inline-block; margin: 0 10px 2px 0; }
.avail-flag { font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--maybe); }
.avail-flag.bad { background: #ffebe9; color: var(--no); }
.next-up { border-left: 4px solid var(--accent); margin-bottom: 14px; }
.record-big { font: 800 2.4rem/1.1 "Barlow Condensed", "Arial Narrow", sans-serif; letter-spacing: .02em; }
.record-big.small { font-size: 1.6rem; }
.game-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.game-res { display: flex; align-items: center; gap: 8px; }
.grid-table { border-collapse: collapse; font-size: .85rem; }
.grid-table th, .grid-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.grid-table .gcell { text-align: center; min-width: 40px; }
.grid-table td.yes { color: var(--yes); font-weight: 700; } .grid-table td.no { color: var(--no); font-weight: 700; } .grid-table td.maybe { color: var(--maybe); font-weight: 700; } .grid-table td.pending { color: var(--pending); }

.gt { max-width: 640px; margin: 0 auto; -webkit-user-select: none; user-select: none; }
.gt button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.gt-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.gt-title { display: flex; flex-direction: column; min-width: 0; }
.gt-score { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; }
.gt-side { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.gt-label { font-weight: 700; font-size: .85rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gt-pts { font: 800 3rem/1 "Barlow Condensed", "Arial Narrow", sans-serif; }
.gt-pm { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; width: 100%; }
.gt-pm button { min-height: 44px; padding: 0; font-weight: 700; font-size: 16px; }
.gt-rule { margin: 8px 2px; }
.gt-sel { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px dashed var(--border); min-height: 48px; }
.gt-sel.on { background: var(--highlight-soft); border: 1px solid var(--accent); }
.gt-sel span { flex: 1 1 160px; }
.gt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gt-cell { display: flex; gap: 4px; min-width: 0; }
.gt-tile { flex: 1; min-width: 0; min-height: 72px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; padding: 8px 10px; text-align: left; border: 2px solid var(--border); border-radius: 10px; background: var(--surface); }
.gt-top { display: flex; align-items: baseline; gap: 6px; }
.gt-num { color: var(--muted); font-size: .8rem; }
.gt-name { flex: 1; font-weight: 700; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gt-time { font: 700 1.05rem "Barlow Condensed", "Arial Narrow", sans-serif; font-variant-numeric: tabular-nums; }
.gt-note { font-size: .78rem; min-height: 1.1em; color: var(--muted); }
.gt-bar { position: relative; height: 6px; border-radius: 3px; background: var(--border); }
.gt-bar i { display: block; height: 100%; border-radius: 3px; background: var(--yes); }
.gt-bar b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); }
.gt-tile.low { border-color: var(--maybe); } .gt-tile.low .gt-note { color: var(--maybe); } .gt-tile.low .gt-bar i { background: var(--maybe); }
.gt-tile.must { border-color: var(--no); background: #fff1f0; } .gt-tile.must .gt-note { color: var(--no); font-weight: 700; } .gt-tile.must .gt-bar i { background: var(--no); }
.gt-tile.near { border-color: var(--maybe); } .gt-tile.near .gt-note { color: var(--maybe); font-weight: 700; }
.gt-tile.max { border-color: var(--no); background: #fff1f0; } .gt-tile.max .gt-note { color: var(--no); font-weight: 700; } .gt-tile.max .gt-bar i { background: var(--no); }
.gt-tile.suggest { box-shadow: 0 0 0 3px #1a7f3755; border-color: var(--yes); }
.gt-tile.sel { border-color: var(--accent); background: var(--highlight-soft); box-shadow: 0 0 0 3px var(--accent); }
.gt-foul { flex: 0 0 46px; min-height: 72px; padding: 0; border-radius: 10px; font: 700 1.1rem "Barlow Condensed", "Arial Narrow", sans-serif; line-height: 1; }
.gt-foul small { display: block; font-size: .65rem; color: var(--muted); }
.gt-foul.warn { background: var(--warn-bg); } .gt-foul.out { background: var(--no); color: #fff; } .gt-foul.out small { color: #fff; }
.gt-tools { margin-top: 14px; gap: 8px; }
.gt-tools button { flex: 1 1 140px; }
.gt-spacer { height: 110px; }
.gt-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; gap: 10px; align-items: center; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -2px 12px rgba(0,0,0,.12); }
.gt-clock { display: flex; flex-direction: column; align-items: center; min-width: 110px; }
.gt-q { font-weight: 800; font-size: .85rem; color: var(--muted); }
.gt-time-left { font: 800 2.6rem/1 "Barlow Condensed", "Arial Narrow", sans-serif; font-variant-numeric: tabular-nums; }
.gt-time-left.low { color: var(--no); }
.gt-go { flex: 1; min-height: 64px; font-size: 1.2rem; font-weight: 800; }
.gt-go.running { background: var(--no); border-color: var(--no); }
@media (max-width: 720px) {
  .gt-dock { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: 10px; }
  .gt-spacer { height: 130px; }
  .avail-h { flex-basis: 100%; }
}

/* Sent-email log (admin page and HoopHQ Messages tab) */
.email-log { width: 100%; border-collapse: collapse; font-size: .85rem; }
.email-log th, .email-log td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line, #ddd); vertical-align: top; }
.email-log td:nth-child(1) { white-space: nowrap; }
