/* Copyright (c) 2026 Jumpball Pty Ltd. All rights reserved. Proprietary and confidential – see LICENSE.txt. */
/* ==========================================================================
   CoachHub – styles. Mobile-first, works in bright gyms (light) and at night (dark).
   ========================================================================== */
:root {
  color-scheme: light;
  --bg: #f7f1e6; --surface: #ffffff; --surface-2: #f4ecdd; --line: #e8dcc8; --line-strong: #cdbda1;
  --ink: #1b1710; --ink-2: #5a4f3f; --muted: #8b7f6c;
  --accent: #e8743c; --accent-ink: #ffffff; --accent-soft: #fdeee5;
  --navy: #0f1729; --navy-soft: #e7e9ef;
  --court: #0f1729; --court-soft: #e7e9ef;
  --display: "Barlow Semi Condensed", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --good: #0ca30c; --warn: #fab219; --bad: #d03b3b; --good-text: #006300;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #4a3aa7; --series-8: #e34948;
  --radius: 16px; --shadow: 0 1px 2px rgba(60,40,10,.05), 0 6px 18px rgba(60,40,10,.06);
  --nav-h: 62px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15120e; --surface: #1f1a14; --surface-2: #2a2319; --line: #352d22; --line-strong: #4a3f30;
  --ink: #f5efe5; --ink-2: #cfc4b2; --muted: #9a8d78;
  --accent: #f08a56; --accent-ink: #1a0f08; --accent-soft: #3a2418;
  --navy: #c9d2ea; --navy-soft: #1d2538;
  --court: #c9d2ea; --court-soft: #1d2538;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.45; font-size: 15px; }
/* a faint court – the centre circle and the key – sits behind every page */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5; background-repeat: no-repeat; background-position: right -120px top -140px; background-size: 560px 560px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 560 560'><g fill='none' stroke='%23cdbda1' stroke-width='3' opacity='.55'><circle cx='280' cy='280' r='120'/><circle cx='280' cy='280' r='18'/><path d='M40 280 H520'/><path d='M120 40 V520 M440 40 V520'/><path d='M120 160 A160 160 0 0 1 440 160'/><path d='M120 400 A160 160 0 0 0 440 400'/></g></svg>"); }
[data-theme="dark"] body::before { opacity: .18; }
.main, .modal-bg, .sidebar, .bottomnav, .topbar, .run { position: relative; z-index: 1; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--series-1); }
h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: 0; font-family: var(--display); text-transform: none; }
h2 { font-size: 19px; font-weight: 700; font-family: var(--display); letter-spacing: .01em; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; padding: 16px 16px calc(var(--nav-h) + 24px); max-width: 1100px; margin: 0 auto; width: 100%; }
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.topbar .brand { font-weight: 800; letter-spacing: .01em; font-size: 22px; font-family: var(--display); color: var(--navy); }
.brand-logo { width: 44px; height: 44px; border-radius: 11px; flex: none; box-shadow: 0 2px 8px rgba(15,23,41,.25); }
.brandrow { display: flex; align-items: center; gap: 10px; padding: 4px 10px 12px; }
.brandrow .brand { padding: 0 !important; }
.sidebar .brand-logo { width: 52px; height: 52px; border-radius: 13px; }
.topbar .brand span { color: var(--accent); }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; height: var(--nav-h); background: var(--surface); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; align-items: stretch; z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
.bottomnav button { flex: 1; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; }
.bottomnav button .ic { font-size: 20px; line-height: 1; }
.bottomnav button.active { color: var(--accent); }
@media (min-width: 900px) {
  .sidebar { display: flex; flex-direction: column; width: 220px; background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; gap: 4px; }
  .sidebar .brand { font-weight: 900; font-size: 22px; letter-spacing: -.02em; padding: 4px 10px 16px; }
  .sidebar .brand span { color: var(--accent); }
  .sidebar button { border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 10px; font-weight: 650; color: var(--ink-2); cursor: pointer; display: flex; gap: 10px; align-items: center; }
  .sidebar button:hover { background: var(--surface-2); }
  .sidebar button.active { background: var(--accent-soft); color: var(--ink); }
  .sidebar .foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 10px 12px; }
  .bottomnav { display: none; }
  .main { padding-bottom: 40px; }
}

/* ---------- team switcher ---------- */
.teamswitch { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 8px; cursor: pointer; max-width: 100%; }
.teamswitch .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.teamswitch b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .t, .stat .v { font-family: var(--display); }
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; } .levels > div { border-radius: 10px; padding: 8px 10px; font-size: 13px; } .levels .easier { background: var(--court-soft); } .levels .harder { background: var(--accent-soft); } .levels b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
@media (max-width: 480px) { .levels { grid-template-columns: 1fr; } }
.run .levels { margin-top: 10px; } .run .levels > div { background: rgba(255,255,255,.08); color: inherit; }
.card + .card { margin-top: 12px; }
.card.flat { box-shadow: none; }
.card h2 { margin-bottom: 10px; }
.card .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tile { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow); transition: transform .1s; }
.tile:active { transform: scale(.99); }
.tile .t { font-weight: 750; font-size: 16px; }
.tile .s { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tile.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tile.accent .s { color: var(--accent-ink); opacity: .85; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .v { font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.stat .d { font-size: 12px; margin-top: 4px; }
.stat .d.up { color: var(--good-text); } .stat .d.down { color: var(--bad); }
.hero { font-size: 48px; font-weight: 800; line-height: 1; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 9px 14px; border-radius: 10px; font-weight: 650; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.court { background: var(--surface); border-color: var(--navy); color: var(--navy); font-weight: 700; }
.btn.court:hover { background: var(--navy-soft); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.xs { padding: 3px 8px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.iconbtn { border: 0; background: none; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--ink-2); font-size: 16px; line-height: 1; }
.iconbtn:hover { background: var(--surface-2); }
.helpbtn { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 800 17px/1 var(--display); cursor: pointer; margin-right: 8px; box-shadow: var(--shadow); }
.helpbtn:hover, .helpbtn:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.help-tips { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 8px; }
.help-ask { border-top: 1px solid var(--line); padding-top: 12px; }
.help-answer { margin-top: 10px; background: var(--surface-2); border-radius: 12px; padding: 10px 14px; }
.help-answer ol, .help-answer ul { margin: 6px 0; padding-left: 20px; display: grid; gap: 4px; }
.help-answer p { margin: 4px 0; }

/* ---------- forms ---------- */
label.f { display: block; font-size: 13px; font-weight: 650; color: var(--ink-2); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
input[type=text], input[type=number], input[type=date], input[type=password], input[type=url], input[type=search], input[type=time], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 70px; resize: vertical; }
input.initial { width: 64px; text-align: center; text-transform: uppercase; font-weight: 800; }
.inline-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 4px 11px; font-size: 13px; cursor: pointer; font-weight: 600; }
.chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip.tag { cursor: default; background: var(--surface-2); border-color: transparent; font-weight: 600; font-size: 12px; }
.chip.cat { cursor: default; border-color: transparent; font-size: 12px; font-weight: 700; }
.toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.toggle button { border: 0; background: var(--surface); padding: 7px 12px; cursor: pointer; font-weight: 650; color: var(--ink-2); }
.toggle button.on { background: var(--ink); color: var(--surface); }

/* rating dots 1-5 */
.rate { display: inline-flex; gap: 4px; }
.rate button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 800; cursor: pointer; color: var(--muted); }
.rate button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rate.sm button { width: 28px; height: 28px; font-size: 12px; }
@media (max-width: 420px) { .rate button { width: 30px; height: 30px; } }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.item:hover { border-color: var(--line-strong); }
.item .body { flex: 1; min-width: 0; }
.item .t { font-weight: 700; }
.item .s { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .r { text-align: right; font-size: 13px; color: var(--ink-2); flex: none; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.badge.done { background: var(--court-soft); color: var(--good-text); }
.badge.planned { background: #e8f0fb; color: #1c5cab; }
[data-theme="dark"] .badge.planned { background: #1b2c44; color: #86b6ef; }
.badge.today { background: var(--accent); color: var(--accent-ink); }
.pill-cat { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; color: #fff; white-space: nowrap; }

/* ---------- session builder ---------- */
.blocks { display: flex; flex-direction: column; gap: 8px; }
.block { display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.block.break { background: var(--surface-2); }
.block .mins { width: 56px; text-align: center; font-weight: 800; padding: 8px 4px; }
.block .name { font-weight: 700; margin-bottom: 4px; }
.block .emph { font-size: 13px; color: var(--ink-2); white-space: pre-wrap; }
.block .tools { display: flex; flex-direction: column; gap: 2px; }
.block textarea.emph-edit { min-height: 44px; font-size: 13px; }
.timebar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; display: flex; margin: 8px 0 4px; }
.timebar i { display: block; height: 100%; }
.timebar i + i { margin-left: 2px; }
.total { font-weight: 800; }
.total.over { color: var(--bad); }
.total.under { color: var(--warn); }
.total.ok { color: var(--good-text); }
.dragging { opacity: .4; }
.dropzone { border-top: 3px solid var(--accent); }

/* ---------- run mode ---------- */
.run { position: fixed; inset: 0; background: var(--ink); color: var(--surface); z-index: 60; display: flex; flex-direction: column; padding: 18px; }
[data-theme="dark"] .run { background: #0a0d0b; color: #f4f6f1; }
.run .clock { font-size: clamp(64px, 20vw, 140px); font-weight: 900; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; }
.run .clock.warn { color: var(--warn); } .run .clock.over { color: #ff7b7b; }
.run .now { text-align: center; font-size: clamp(22px, 5vw, 34px); font-weight: 800; margin-top: 10px; }
.run .emph { text-align: center; opacity: .8; max-width: 640px; margin: 10px auto; white-space: pre-wrap; }
.run .next { text-align: center; opacity: .6; margin-top: auto; }
.run .ctrls { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.run .ctrls .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); color: inherit; padding: 14px 22px; font-size: 16px; }
.run .ctrls .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.run .prog { display: flex; gap: 3px; margin-bottom: 12px; }
.run .prog i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.2); }
.run .prog i.done { background: var(--court); } .run .prog i.cur { background: var(--accent); }

/* ---------- modal / sheet ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--surface); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 18px 26px; }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 18px; max-height: 88vh; } }
.modal .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 14px); transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 999px; font-weight: 650; z-index: 70; box-shadow: var(--shadow); max-width: 92vw; }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { font-size: 11px; fill: var(--muted); font-family: inherit; font-variant-numeric: tabular-nums; }
.chart .value { font-size: 12px; fill: var(--ink-2); font-weight: 650; font-family: inherit; }
.chart .endlabel { font-size: 12px; fill: var(--ink-2); font-weight: 700; font-family: inherit; }
.chart .ring { fill: var(--surface); }
.chart-tip { position: absolute; background: var(--ink); color: var(--surface); font-size: 12px; padding: 6px 9px; border-radius: 8px; pointer-events: none; z-index: 5; white-space: nowrap; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.chart-empty { color: var(--muted); padding: 24px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 12px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl th { color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
table.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tblwrap { overflow-x: auto; }

/* ---------- week grid ---------- */
.weeks { display: flex; flex-direction: column; gap: 10px; }
.week { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.week .wh { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); font-weight: 750; }
.week .wh .muted { font-weight: 500; }
.week .wb { padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.week.current { border-color: var(--accent); }

/* ---------- help ---------- */
.help h3 { margin-top: 16px; }
.help ol, .help ul { padding-left: 20px; }
.help li { margin-bottom: 4px; }
.notice { background: var(--court-soft); border-left: 4px solid var(--court); padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.notice.warn { background: var(--accent-soft); border-color: var(--accent); }

/* ---------- lock screen ---------- */
.lock { position: fixed; inset: 0; background: var(--bg); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lock .card { width: 100%; max-width: 360px; text-align: center; }

/* ---------- print ---------- */
@media print {
  .sidebar, .bottomnav, .topbar, .noprint, .btn, .iconbtn { display: none !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #999; break-inside: avoid; }
  .block { break-inside: avoid; border-color: #bbb; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
.badge.loss { background: #fbe4e4; color: #9c1f1f; }
[data-theme="dark"] .badge.loss { background: #3d1d1d; color: #f0a0a0; }

/* ---------- diagrams ---------- */
.dg-wrap { max-width: 420px; margin: 0 auto; }
.dg-wrap.full { max-width: 720px; }
.dg-preview { margin-top: 10px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.dg-wrap.edit { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.dg-wrap.full.zoomed { max-width: 420px; }
.dg-selbar { min-height: 34px; margin-top: 8px; margin-bottom: 0; padding: 4px 6px; background: var(--surface-2); border-radius: 10px; }
@media (hover: none) { .dg-tools .btn.xs { padding: 7px 10px; font-size: 13px; } }
svg.diagram { width: 100%; height: auto; display: block; border-radius: 10px; overflow: visible; }
svg.diagram .floor { fill: #f3e2c8; }
svg.diagram .apron { fill: #e4d2b6; }
[data-theme="dark"] svg.diagram .floor { fill: #3a2f22; }
[data-theme="dark"] svg.diagram .apron { fill: #2c241a; }
svg.diagram .ln { fill: none; stroke: #8a6a3f; stroke-width: 0.8; }
svg.diagram .ln.thick { stroke-width: 1.6; }
svg.diagram .o { fill: var(--accent); stroke: #fff; stroke-width: 0.8; }
svg.diagram .x { stroke: var(--series-1); stroke-width: 2; fill: none; stroke-linecap: round; }
svg.diagram .c { fill: var(--ink); }
svg.diagram .cone { fill: var(--series-4); }
svg.diagram .lbl { font-size: 5.5px; font-weight: 800; text-anchor: middle; fill: #fff; font-family: inherit; pointer-events: none; }
svg.diagram .lbl.x-lbl { fill: var(--series-1); text-anchor: start; font-size: 4.5px; }
svg.diagram .hit { fill: transparent; }
svg.diagram .ghost { opacity: .28; pointer-events: none; }
svg.diagram.edit .ball { cursor: grab; }
.dg-frames .chip.noball { border-style: dashed; }
.dg-warn { font-size: 12px; color: #9a4b00; font-weight: 600; width: 100%; }
[data-theme="dark"] .dg-warn { color: #f5b26b; }
.dg-pick { width: auto; max-width: 100%; padding: 5px 8px; font-size: 12px; border-radius: 7px; }
.dg-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.dg-help { margin-top: 6px; }
.form-more { margin: 4px 0 12px; } .form-more > summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); padding: 8px 0; } .form-more[open] > summary { margin-bottom: 6px; }
.whatsnew { border-left: 4px solid var(--accent); }
.modal.dropping { outline: 3px dashed var(--accent); outline-offset: -6px; }
.ct-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ct-clock { font-size: 44px; font-weight: 800; letter-spacing: .02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ct-go { min-width: 110px; padding: 14px 16px; font-size: 16px; }
.ct-list { display: flex; flex-direction: column; gap: 6px; }
.ct-row { display: grid; grid-template-columns: 1fr 90px 54px 72px; gap: 10px; align-items: center; padding: 12px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; user-select: none; }
.ct-row.on { background: var(--accent-soft, #fff3ec); border-color: var(--accent); }
.ct-row .ct-name { font-weight: 700; } .ct-row .ct-time { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.ct-row .ct-btn { font-size: 12px; text-align: center; padding: 6px 4px; border-radius: 999px; background: var(--surface-2); } .ct-row.on .ct-btn { background: var(--accent); color: #fff; }
.ct-bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; } .ct-bar i { display: block; height: 100%; background: var(--accent); }
@media (max-width: 480px) { .ct-row { grid-template-columns: 1fr 64px 48px 64px; gap: 6px; padding: 10px 8px; } .ct-clock { font-size: 36px; } }
.dg-speed { width: auto; padding: 4px 6px; font-size: 12px; border-radius: 7px; }
.dg-roster summary { list-style: none; } .dg-roster summary::-webkit-details-marker { display: none; }
.pb-plays { margin: 6px 0; } .pb-playsbox .pb-dg { margin: 8px 0 12px; } .dg-help summary { font-size: 12px; color: var(--muted); cursor: pointer; }
svg.diagram.edit .piece { cursor: grab; }
svg.diagram .selring { fill: none; stroke: var(--ink); stroke-width: 0.8; stroke-dasharray: 2 1.5; }
svg.diagram .mv { fill: none; stroke: var(--ink); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
svg.diagram .mv.thick { stroke-width: 1.8; }
svg.diagram .mv.pass { stroke-dasharray: 3 2; }
svg.diagram .arrow.head { fill: var(--ink); }
svg.diagram .ballc { fill: #e8743c; stroke: #5a2d0c; stroke-width: 0.5; }
svg.diagram .balll { stroke: #5a2d0c; stroke-width: 0.5; fill: none; }
.dg-bar { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.dg-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.dg-frames { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- team playbook ---------- */
.pb .card { margin-top: 12px; }
.pb-header { display: flex; align-items: center; gap: 14px; padding: 18px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-left: 8px solid var(--team, var(--accent)); }
.pb-header h1 { margin: 0; }
.pb-badge { width: 52px; height: 52px; border-radius: 14px; background: var(--team, var(--accent)); color: #fff; font-weight: 900; font-size: 24px; display: flex; align-items: center; justify-content: center; flex: none; }
.pb-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.pb-two .card { margin-top: 12px; }
.pb ul { padding-left: 20px; margin: 4px 0 0; }
.pb li { margin-bottom: 4px; }
.pb-play { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.pb-play:first-of-type { border-top: 0; }
.pb-play h3 { margin: 0; font-size: 17px; }
.pb-play h4 { margin: 10px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pb-play-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.pb-num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.pb-dg { margin: 8px 0; }
.pb-video { aspect-ratio: 16/9; max-width: 100%; border-radius: 10px; overflow: hidden; margin: 8px 0; }
.pb-video iframe { width: 100%; height: 100%; }
.pb-foot { text-align: center; margin-top: 20px; }
.pb-foot .pb-made { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 6px; }
.pb-foot .pb-made img { width: 28px; height: 28px; border-radius: 8px; }
.pb-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.pb-item .n { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 13px; }
@media print { .pb-header { border: 0; padding: 0 0 10px; } .pb .card { border: 0; box-shadow: none; padding: 0; margin-top: 16px; } .dg-bar { display: none !important; } .pb-play { break-inside: avoid; } }
.pb-motto { font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: var(--team, var(--accent)); margin-top: 6px; }
.pb-motto-end { text-align: center; font-size: 22px; margin-top: 24px; }
.pb-nn { border-left: 6px solid var(--team, var(--accent)); }
.pb-nn ol { padding-left: 0; margin: 6px 0 0; list-style: none; counter-reset: nn; }
.pb-nn li { counter-increment: nn; display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.pb-nn li::before { content: counter(nn); width: 26px; height: 26px; border-radius: 50%; background: var(--team, var(--accent)); color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
.dg-note { text-align: center; font-weight: 600; margin-top: 8px; padding: 6px 10px; background: var(--surface-2); border-radius: 8px; }
.dg-notes-print { padding-left: 20px; margin: 8px 0 0; font-size: 12px; }

.brand .byline { display: block; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); line-height: 1; margin-top: 1px; }
.sidebar .brand .byline { font-size: 11px; }

/* ==========================================================================
   Look and feel: court-inspired backgrounds and the sign-in / welcome screens
   ========================================================================== */
:root { --court-deep: #0c1f1a; --court-deep-2: #12362c; }
/* faint court lines behind the whole app */
body { background-color: var(--bg); background-image:
  radial-gradient(1200px 500px at 50% -200px, rgba(232,116,60,.10), transparent 70%),
  url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='560' viewBox='0 0 600 560'><g fill='none' stroke='%23000' stroke-opacity='0.045' stroke-width='2'><rect x='20' y='20' width='560' height='520'/><rect x='202' y='20' width='196' height='232'/><circle cx='300' cy='252' r='72'/><path d='M56 20 v90 a244 244 0 0 0 488 0 v-90'/><circle cx='300' cy='83' r='9'/><path d='M228 540 a72 72 0 0 1 144 0'/></g></svg>");
  background-repeat: no-repeat, repeat; background-position: top center, center 40px; background-size: auto, 600px 560px; }
[data-theme="dark"] body { background-image: radial-gradient(1200px 500px at 50% -200px, rgba(240,138,86,.12), transparent 70%),
  url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='560' viewBox='0 0 600 560'><g fill='none' stroke='%23fff' stroke-opacity='0.05' stroke-width='2'><rect x='20' y='20' width='560' height='520'/><rect x='202' y='20' width='196' height='232'/><circle cx='300' cy='252' r='72'/><path d='M56 20 v90 a244 244 0 0 0 488 0 v-90'/><circle cx='300' cy='83' r='9'/><path d='M228 540 a72 72 0 0 1 144 0'/></g></svg>"); }

/* sign-in and PIN screens: full-bleed court */
.lock { background: radial-gradient(120% 80% at 50% -10%, var(--court-deep-2), var(--court-deep) 60%); color: #f4f6f1; overflow: auto; }
.lock::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .9; background-image:
  url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='1400' height='900' viewBox='0 0 1400 900'><g fill='none' stroke='%23ffffff' stroke-opacity='0.10' stroke-width='3'><rect x='60' y='40' width='1280' height='820'/><line x1='700' y1='40' x2='700' y2='860'/><circle cx='700' cy='450' r='120'/><rect x='60' y='290' width='320' height='320'/><rect x='1020' y='290' width='320' height='320'/><path d='M60 120 h60 a330 330 0 0 1 0 660 h-60'/><path d='M1340 120 h-60 a330 330 0 0 0 0 660 h60'/><circle cx='150' cy='450' r='15'/><circle cx='1250' cy='450' r='15'/><path d='M380 330 a120 120 0 0 1 0 240'/><path d='M1020 330 a120 120 0 0 0 0 240'/></g></svg>");
  background-size: cover; background-position: center; }
.lock::after { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; bottom: -200px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 35% 35%, #ff9a5c, #e8743c 45%, #8a3d16 100%); opacity: .35;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><circle cx='50' cy='50' r='50' fill='black'/><g stroke='white' stroke-width='2.5' fill='none'><line x1='50' y1='0' x2='50' y2='100'/><line x1='0' y1='50' x2='100' y2='50'/><path d='M15 15 c20 20 50 20 70 0 M15 85 c20 -20 50 -20 70 0'/></g></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><circle cx='50' cy='50' r='50' fill='black'/><g stroke='white' stroke-width='2.5' fill='none'><line x1='50' y1='0' x2='50' y2='100'/><line x1='0' y1='50' x2='100' y2='50'/><path d='M15 15 c20 20 50 20 70 0 M15 85 c20 -20 50 -20 70 0'/></g></svg>") center/contain no-repeat; }
.lock .wrap { position: relative; z-index: 1; width: 100%; max-width: 420px; }
.lock .card { position: relative; z-index: 1; background: rgba(255,255,255,.97); color: var(--ink); border: 0; box-shadow: 0 30px 80px rgba(0,0,0,.45); border-radius: 22px; padding: 26px 24px 22px; width: 100%; max-width: none; text-align: left; }
[data-theme="dark"] .lock .card { background: rgba(26,32,29,.97); color: #f4f6f1; }
.lock .card h1 { font-size: 30px; letter-spacing: -.02em; margin: 0; }
.lock .card .brandmark { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 4px; }
.lock .card .brandmark img { width: 46px; height: 46px; border-radius: 12px; box-shadow: 0 4px 12px rgba(15,23,41,.35); }
.lock .card .brand-banner { display: block; width: 100%; border-radius: 14px; margin: -6px 0 14px; box-shadow: 0 8px 24px rgba(15,23,41,.35); }
.lock .tagline { text-align: center; color: var(--muted); font-size: 14px; margin: 8px 0 16px; }
.lock .feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 4px; }
.lock .feats div { background: var(--surface-2); border-radius: 10px; padding: 8px 6px; text-align: center; font-size: 11.5px; font-weight: 650; color: var(--ink-2); line-height: 1.25; }
.lock .feats span { display: block; font-size: 18px; margin-bottom: 2px; }
.lock .foot { position: relative; z-index: 1; text-align: center; color: rgba(255,255,255,.55); font-size: 12px; margin-top: 14px; }

/* welcome (first screen after sign-in) */
.welcome { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 50% -10%, var(--court-deep-2), var(--court-deep) 65%); color: #f4f6f1; border: 0; border-radius: 22px; padding: 28px 22px 22px; }
.welcome::before { content: ""; position: absolute; inset: 0; opacity: .8; pointer-events: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='1400' height='900' viewBox='0 0 1400 900'><g fill='none' stroke='%23ffffff' stroke-opacity='0.10' stroke-width='3'><rect x='60' y='40' width='1280' height='820'/><line x1='700' y1='40' x2='700' y2='860'/><circle cx='700' cy='450' r='120'/><rect x='60' y='290' width='320' height='320'/><rect x='1020' y='290' width='320' height='320'/><path d='M60 120 h60 a330 330 0 0 1 0 660 h-60'/><path d='M1340 120 h-60 a330 330 0 0 0 0 660 h60'/></g></svg>"); background-size: cover; background-position: center; }
.welcome > * { position: relative; }
.welcome h1 { color: #fff; font-size: 30px; }
.welcome p { color: rgba(255,255,255,.8); max-width: 560px; }
.welcome .tile { background: rgba(255,255,255,.96); color: var(--ink); border: 0; }
.welcome .tile .s { color: var(--muted); }
.welcome .tile.accent { background: var(--accent); color: var(--accent-ink); }
.welcome .tile.accent .s { color: var(--accent-ink); }
.welcome .kicker { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #ffb27a; margin-bottom: 8px; }

/* team page (schedule, notices, RSVP) */
.pb-tabs { display: flex; gap: 6px; margin: 0 0 12px; }
.pb-tabs button { flex: 1; border: 1px solid var(--line-strong); background: var(--surface); padding: 10px; border-radius: 12px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.pb-tabs button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pb-notice { border-top: 1px solid var(--line); padding: 10px 0; }
.pb-notice:first-of-type { border-top: 0; padding-top: 4px; }
.pb-event { display: grid; grid-template-columns: 78px 1fr; gap: 12px; border-top: 1px solid var(--line); padding: 12px 0; }
.pb-event:first-of-type { border-top: 0; }
.pb-event-when .d { font-weight: 800; }
.pb-event-when .t { color: var(--ink-2); font-size: 14px; }
.pb-rsvp { margin-top: 8px; }
.pb-rsvp-list { margin-top: 6px; }
.pb-next { background: var(--accent-soft); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-weight: 600; }

/* team page chat (Heja style) */
.pb-chat { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.pb-msg { max-width: 92%; background: var(--surface-2, #f3f1ec); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 8px 12px; font-size: 14px; }
.pb-msg.coach { background: var(--accent-soft); border-color: var(--accent); }
.pb-msg.mine { align-self: flex-end; border-radius: 14px 14px 4px 14px; }
.pb-msg .who { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.pb-msg .txt { white-space: pre-wrap; word-break: break-word; }
.pb-compose { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.pb-compose textarea { flex: 1; min-height: 44px; }
.pb-cbtn { margin-top: 8px; }
.pb-thread { margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.pb-att { display: flex; gap: 8px; margin-top: 4px; line-height: 1.35; }
.pb-att b { flex: 0 0 auto; min-width: 118px; }
.pb-sched { display: grid; grid-template-columns: 76px 1fr 96px 1fr auto; gap: 6px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.pb-sched:first-of-type { border-top: 0; }
.pb-sched input { padding: 6px 8px; font-size: 13px; }
@media (max-width: 640px) { .pb-sched { grid-template-columns: 1fr 1fr; } .pb-sched .k, .pb-sched .v { grid-column: 1 / -1; } }

.btn.disabled { opacity: .5; }

/* team logos */
.team-logo { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); padding: 3px; }
.logo-prev { width: 72px; height: 72px; border-radius: 12px; border: 1px dashed var(--line-strong); display: grid; place-items: center; overflow: hidden; background: var(--surface); flex: 0 0 auto; }
.logo-prev img { width: 100%; height: 100%; object-fit: contain; }
.pb-logo { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; flex: 0 0 auto; }
.pb-scorers { margin-top: 6px; line-height: 1.5; }
.pb-push { }
.jb-footer { text-align: center; margin: 28px 0 8px; }
.jb-footer .jb-banner { box-shadow: 0 8px 22px rgba(15,23,41,.28); }
.jb-footer .small { margin-top: 8px; }
@media (min-width: 768px) { .jb-footer .jb-banner { max-width: 560px !important; } .pb-foot .jb-banner { max-width: 440px !important; } }
.pb-pack { margin-top: 4px; line-height: 1.5; }
.pb-skills { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.pb-skills th, .pb-skills td { text-align: left; padding: 5px 4px; border-top: 1px solid var(--line); }
.pb-skills th:first-child, .pb-skills td:first-child { width: 45%; }
.pb-bar { display: inline-block; width: 60px; height: 8px; background: var(--surface-2, #eee); border-radius: 4px; vertical-align: middle; overflow: hidden; }
.pb-bar i { display: block; height: 100%; background: var(--accent); }
@media print { .gameday-print .noprint { display: none; } }
/* Home: up next first, What's new as one line */
.upnext { cursor: pointer; }
.upnext .upnext-when { font-size: 13px; font-weight: 700; letter-spacing: .02em; opacity: .9; margin-bottom: 2px; }
.upnext .t { font-size: 20px; }
.upnext .btn.upnext-run { background: #fff; color: var(--accent); border-color: #fff; font-weight: 800; padding: 10px 18px; font-size: 16px; }
.upnext .btn.upnext-open { background: transparent; color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent-ink) 55%, transparent); }
.wn-compact { padding: 10px 14px; }
.wn-compact > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.wn-compact > summary::-webkit-details-marker { display: none; }
.wn-compact .wn-see { color: var(--accent); font-weight: 700; font-size: 13px; white-space: nowrap; }
.wn-compact[open] .wn-see { display: none; }
/* Session page: header with the big actions, ⋯ More menu, folded details */
.sess-head .btn.big-run { padding: 12px 20px; font-size: 16px; font-weight: 800; }
.actmenu { position: relative; }
.actmenu > summary { list-style: none; cursor: pointer; }
.actmenu > summary::-webkit-details-marker { display: none; }
.actmenu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.actmenu-panel button { background: none; border: 0; text-align: left; padding: 11px 12px; border-radius: 8px; font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; }
.actmenu-panel button:hover { background: var(--accent-soft); }
.actmenu-panel button.danger { color: var(--bad); border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; }
.sess-details > summary { font-size: 15px; padding: 2px 0; }
.block .name-edit { flex: 1 1 160px !important; min-width: 0; }   /* drill name keeps room on a phone; the category drops below when needed */
.block .name-edit + select { max-width: 100%; }
/* More screen: four folded groups */
.more-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 10px; }
.more-group > summary { list-style: none; cursor: pointer; padding: 16px 44px 16px 16px; position: relative; display: flex; flex-direction: column; gap: 2px; }
.more-group > summary::-webkit-details-marker { display: none; }
.more-group > summary::after { content: '›'; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 24px; color: var(--muted); transition: transform .15s; }
.more-group[open] > summary::after { transform: translateY(-50%) rotate(90deg); }
.more-group .mg-t { font-family: var(--display); font-weight: 750; font-size: 18px; }
.more-group .mg-s { color: var(--muted); font-size: 13px; }
.more-group .mg-body { padding: 0 10px 2px; }
.more-group .mg-body > .card { box-shadow: none; }
/* Plan screen: earlier weeks and season tools folded */
.early-weeks, .season-tools { margin-bottom: 12px; }
.early-weeks > summary, .season-tools > summary { cursor: pointer; font-weight: 700; font-size: 15px; }
.early-weeks[open] > summary { margin-bottom: 10px; }
.season-tools { margin-top: 12px; }
/* Line icons (js/icons.js draws every emoji as one of these) */
.ji { width: 1.2em; height: 1.2em; vertical-align: -0.22em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1 .ji, h2 .ji, h3 .ji, .more-group .mg-t .ji { color: var(--accent); }
.tile.accent .ji, .btn.primary .ji, .notice .ji { color: inherit; }
.bottomnav button .ic .ji { width: 24px; height: 24px; vertical-align: middle; }
.sidebar button .ji { width: 20px; height: 20px; }
.sidebar button.active .ji { color: var(--accent); }
.ji-circle-check { color: var(--good, #2e9e5b); }
