/* KRUFC Session Builder. Phone-first single column. Club green and red. */
:root {
  --green: #006A31; --red: #C70000; --brand: #006A31; --brand-ink: #FFFFFF;
  --light: #EAF2EA; --tint: #FBEAEA; --rule: #C9D8C5; --ink: #1F2A22;
  --bg: #F6F8F5; --surface: #FFFFFF; --muted: #5B6B5F; --on-accent: #FFFFFF;
  --ok: #006A31; --warn: #9A5B00; --warn-bg: #FFF2DB; --blue: #1F5C99; --blue-bg: #E4EEF8;
  --display: Cambria, "Cambria Math", Georgia, "Times New Roman", serif;
  --body: Calibri, Carlito, "Segoe UI", system-ui, -apple-system, sans-serif;
  --p-green: #1E5631; --p-red: #B01B2E; --p-light: #EFF4EE; --p-tint: #FBEAEC; --p-rule: #C9D8C5; --p-ink: #1F2A22; --p-white: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  :root {
    --green: #6CCB8E; --red: #FF7A7A; --brand: #00511F; --light: #1D2C21; --tint: #3A1D1D; --rule: #34473A;
    --ink: #E6EEE7; --bg: #111813; --surface: #18221B; --muted: #9DB0A2; --on-accent: #0E1510;
    --ok: #6CCB8E; --warn: #F2B65A; --warn-bg: #3A2C12; --blue: #8DB8E8; --blue-bg: #18283A; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
[hidden] { display: none !important; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; line-height: 1.15; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
p { margin: 0; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.eyebrow { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.note { font-size: .9rem; color: var(--muted); }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Header: one compact line so the plan starts near the top of the screen */
.top { background: var(--brand); color: var(--brand-ink); border-bottom: 3px solid var(--brand-bar, var(--red)); }
.top .inner { max-width: 820px; margin: 0 auto; padding-block: 8px; display: flex; align-items: center; gap: 10px; }
.top .ttl { min-width: 0; flex: 1; }
.top h1, .top p { color: var(--brand-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top h1 { font-size: 1.15rem; }
.top p { font-size: .8rem; opacity: .92; }
.crest { width: 38px; height: 38px; flex: none; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }

/* Bottom tab bar, within thumb reach. Fixed, above the iPhone home bar. */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--rule); padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -2px 10px rgba(0,0,0,.06); }
.tabs .inner { max-width: 820px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.tabs .tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; padding: 6px 2px; background: none; border: 0; border-top: 3px solid transparent; color: var(--muted); font-size: .74rem; font-weight: 700; }
.tabs .tab svg { width: 24px; height: 24px; }
.tabs .tab[aria-selected="true"] { color: var(--green); border-top-color: var(--brand-bar, var(--red)); }
.badge { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: .68rem; line-height: 18px; text-align: center; }

/* More sheet: slides up from the bottom */
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { width: 100%; max-width: 560px; max-height: 85vh; overflow: auto; background: var(--surface); border-radius: 16px 16px 0 0; padding: 4px 0 calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--rule); margin: 6px auto 6px; }
.sheet .tab { display: flex; align-items: center; min-height: 54px; padding: 0 20px; background: none; border: 0; border-bottom: 1px solid var(--rule); font-size: 1.05rem; font-weight: 700; color: var(--ink); text-align: left; }
.sheet .tab[aria-selected="true"] { color: var(--green); }
.sheet .who { padding: 16px 20px 0; display: grid; gap: 10px; }

main { max-width: 820px; margin: 0 auto; padding-block: 12px calc(96px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 16px; }
main > * { min-width: 0; }
.view { display: grid; gap: 16px; }
.view > * { min-width: 0; }

/* Panels and fields */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 16px; display: grid; gap: 12px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.grid > * { min-width: 0; }
.field { display: grid; gap: 4px; min-width: 0; }
.field label, .field .lab { font-size: .8rem; font-weight: 700; color: var(--muted); }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=date], input[type=time], select, textarea { width: 100%; max-width: 100%; padding: 9px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); }
textarea { min-height: 70px; resize: vertical; line-height: 1.4; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--rule); background: var(--bg); padding: 6px 11px; border-radius: 99px; font-size: .9rem; }
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--on-accent); }
.toggle { display: flex; align-items: center; gap: 8px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--red); }
.btn { border: 2px solid var(--green); background: var(--surface); color: var(--green); border-radius: 10px; padding: 10px 14px; font-weight: 700; }
.btn.primary { background: var(--green); color: var(--on-accent); }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.small { padding: 5px 10px; font-size: .86rem; border-width: 1px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.iconbtn { border: 1px solid var(--rule); background: var(--bg); border-radius: 6px; width: 34px; height: 34px; font-weight: 700; color: var(--ink); }

/* Season banner */
.season { background: var(--light); border: 1px solid var(--rule); border-radius: 10px; padding: 16px; display: grid; gap: 12px; }
.season-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.season-head > div { min-width: 0; }
.call { font-family: var(--display); font-weight: 700; font-size: 2rem; color: var(--red); line-height: 1; }
.call small { display: block; font-family: var(--body); font-size: .8rem; color: var(--muted); font-weight: 400; margin-top: 4px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 8px 16px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.facts dd { margin: 0; }
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 700; border: 1px solid currentColor; white-space: nowrap; }
.pill.touch { color: var(--ok); }
.pill.light { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.pill.full { color: var(--red); background: var(--tint); border-color: transparent; }
.safety { font-size: .9rem; border-left: 3px solid var(--red); padding: 2px 0 2px 10px; }
.gameline { font-size: .9rem; border-left: 3px solid var(--blue); padding: 2px 0 2px 10px; }
.cancelled-note { font-size: .9rem; background: var(--tint); border-left: 3px solid var(--red); padding: 6px 10px; border-radius: 6px; }
.tile .tmeta { font-size: .7rem; opacity: .85; } .tile .tgame { color: var(--blue); font-weight: 600; }
.small.warn { color: var(--warn); }
#fxPaste { width: 100%; box-sizing: border-box; font: inherit; }
.weekbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Timeline bar */
.tl { display: flex; height: 30px; border-radius: 6px; overflow: hidden; border: 1px solid var(--rule); }
.tl span { display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; color: var(--ink); border-right: 1px solid var(--surface); overflow: hidden; white-space: nowrap; min-width: 0; }
.tl .k-fixed { background: var(--light); }
.tl .k-drill { background: var(--blue-bg); }
.tl .k-free { background: var(--warn-bg); }
.tl .k-split { background: var(--tint); }
.total { font-size: .9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.total.over { color: var(--red); } .total.ok { color: var(--ok); } .total.under { color: var(--warn); }

/* Rows */
.rows { display: grid; gap: 10px; }
.row { border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); padding: 12px; display: grid; gap: 8px; border-left-width: 5px; }
.row.k-fixed { border-left-color: var(--rule); }
.row.k-drill { border-left-color: var(--blue); }
.row.k-free { border-left-color: var(--warn); }
.row.k-split { border-left-color: var(--red); }
.row-top { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--green); font-size: .92rem; }
.time small { display: block; color: var(--muted); font-weight: 400; }
.row-title { display: grid; gap: 6px; min-width: 0; }
.row-title input[type=text] { font-weight: 700; }
.row-tools { display: flex; gap: 4px; }
.row-meta { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; }
.mins { display: flex; align-items: center; gap: 4px; }
.mins input { width: 56px; text-align: center; padding: 6px 4px; }
.lanes { display: grid; gap: 8px; padding-left: 10px; border-left: 2px dashed var(--rule); }
.lane { display: grid; gap: 6px; }
.lane-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: .88rem; font-weight: 700; }
.addrow { display: flex; gap: 8px; flex-wrap: wrap; }
details.drill > summary { cursor: pointer; color: var(--green); font-weight: 700; font-size: .88rem; list-style: none; }
details.drill > summary::-webkit-details-marker { display: none; }
details.drill > summary::before { content: "+ "; }
details.drill[open] > summary::before { content: "− "; }
.card-rows { display: grid; gap: 5px; margin-top: 6px; font-size: .93rem; }
.card-rows b { color: var(--green); }
.readonly .row-tools, .readonly .addrow { display: none; }

/* Season tiles */
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .82rem; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--c); border: 1px solid var(--b, var(--rule)); }
.blockgroup { display: grid; gap: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.tile { border: 1px solid var(--rule); background: var(--surface); border-radius: 8px; padding: 7px 6px; text-align: center; display: grid; gap: 1px; font-size: .78rem; color: var(--ink); }
.tile b { font-size: .9rem; }
.tile.s-done { background: var(--light); border-color: var(--green); }
.tile.s-swapped { background: var(--warn-bg); border-color: var(--warn); }
.tile.s-adhoc { background: var(--blue-bg); border-color: var(--blue); }
.tile.s-cancelled { background: var(--tint); border-color: var(--red); border-style: dashed; }
.tile.today { box-shadow: 0 0 0 3px var(--red); }
.tile[aria-pressed="true"] { outline: 3px solid var(--ink); }

/* Library */
.drill-item { border-top: 1px solid var(--rule); padding-block: 10px; display: grid; gap: 6px; }
.drill-item:first-child { border-top: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--light); color: var(--green); }

/* Share */
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; min-height: 200px; }
.toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 700; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 20; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; }
.saved { font-size: .8rem; color: var(--muted); }

/* Sign in */
.signin { max-width: 440px; margin: 40px auto; }
.center { text-align: center; }
.motto { text-align: center; font-family: var(--display); color: var(--muted); font-style: italic; }

@media (max-width: 520px) {
  .row-top { grid-template-columns: 64px minmax(0, 1fr); }
  .row-tools { grid-column: 1 / -1; justify-content: flex-end; }
  .row-meta { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* Print: two A4 pages in the club house style */
#print { display: none; }
@page { size: A4; margin: 11mm 12mm; }
@media print {
  html, body { background: var(--p-white) !important; color: var(--p-ink) !important; padding: 0 !important; }
  body > *:not(#print) { display: none !important; }
  #print { display: block !important; font-family: var(--body); font-size: 9.4pt; line-height: 1.3; color: var(--p-ink); }
  #print * { color: var(--p-ink); }
  .pp { break-after: page; display: grid; gap: 7px; }
  .pp:last-child { break-after: auto; }
  .ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 3px solid var(--p-green); padding-bottom: 6px; }
  .ph h1 { font-family: var(--display); font-size: 17pt; color: var(--p-green); }
  .ph p { font-size: 10pt; margin-top: 2px; }
  .ph img { width: 54px; height: 54px; object-fit: contain; }
  .pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
  .ptab { width: 100%; border-collapse: collapse; }
  .ptab th, .ptab td { border: 1px solid var(--p-rule); padding: 3px 6px; text-align: left; vertical-align: top; }
  .ptab th { background: var(--p-light); font-weight: 700; width: 34%; }
  .psess th { background: var(--p-green); color: var(--p-white) !important; width: auto; }
  .psess td:first-child { white-space: nowrap; font-weight: 700; color: var(--p-green); }
  .psess td ul { margin: 0; padding-left: 1.1em; }
  .psafe { border-left: 4px solid var(--p-red); background: var(--p-tint); padding: 4px 8px; }
  .pcheck { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; margin: 0; padding: 0; list-style: none; }
  .pcheck li::before { content: "☐ "; }
  .pcards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .pcard { border: 1.5px solid var(--p-green); border-radius: 6px; padding: 7px 9px; break-inside: avoid; display: grid; gap: 4px; align-content: start; }
  .pcard .lbl { font-size: 8pt; font-weight: 700; letter-spacing: .08em; color: var(--p-red); }
  .pcard h2 { font-family: var(--display); font-size: 12.5pt; color: var(--p-green); }
  .pcard .pwho { font-size: 8.5pt; }
  .pcard b { color: var(--p-green); }
  .pask { background: var(--p-light); padding: 3px 6px; border-radius: 4px; }
  .pfoot { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--p-rule); padding-top: 5px; font-size: 8.5pt; }
  .pfoot i { font-family: var(--display); }
}

/* Keep long drill names inside the card on narrow screens */
.row, .lanes, .lane, .row-title, .panel { grid-template-columns: minmax(0, 1fr); }
.row > *, .lanes > *, .lane > *, .row-title > *, .panel > * { min-width: 0; }
select { min-width: 0; text-overflow: ellipsis; }
.lane-head select { flex: 1 1 auto; width: auto; }
.row-top { grid-template-columns: 78px minmax(0, 1fr) auto; }
@media (max-width: 520px) { .row-top { grid-template-columns: 64px minmax(0, 1fr) auto; } .row-tools { grid-column: auto; } .iconbtn { width: 30px; height: 30px; } }

/* Forwards and backs lanes */
.tl .k-units { background: repeating-linear-gradient(135deg, var(--blue-bg) 0 8px, var(--warn-bg) 8px 16px); }
.lane.unit-forwards { border-left: 4px solid var(--blue); padding-left: 8px; }
.lane.unit-backs { border-left: 4px solid var(--warn); padding-left: 8px; }
.lane.unit-all { border-left: 4px solid var(--rule); padding-left: 8px; }
.lane-head select:first-child { flex: 0 1 140px; font-weight: 700; }

/* Install and passkey prompts */
.install { border-color: var(--green); border-width: 2px; background: var(--light); }
.ios-share { display: inline-block; border: 1px solid var(--muted); border-radius: 4px; padding: 0 5px; font-weight: 700; }
.security { display: grid; gap: 8px; }

/* Post-training review */
.rv-block { border: 1px solid var(--rule); border-left: 5px solid var(--blue); border-radius: 10px; padding: 10px; display: grid; gap: 7px; }
.rv-head { display: grid; gap: 2px; }
.rv-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; align-items: center; font-size: .9rem; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dot { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--rule); background: var(--bg); font-weight: 700; color: var(--muted); }
.dot.on { background: var(--green); border-color: var(--green); color: var(--on-accent); }
.seg { display: flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; border: 0; border-right: 1px solid var(--rule); background: var(--bg); padding: 8px 4px; font-size: .82rem; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--warn-bg); color: var(--warn); font-weight: 700; }
.carry { border-color: var(--warn); border-width: 2px; background: var(--warn-bg); }
.rating { font-size: .88rem; color: var(--muted); }
.flag { font-size: .88rem; color: var(--red); font-weight: 700; }
.insights h3 { font-size: 1rem; }
.ilist { margin: 4px 0 0; padding-left: 1.1em; display: grid; gap: 3px; }
.gbadge { font-size: .72rem; font-weight: 700; color: var(--muted); }
.gbadge.hi { color: var(--ok); } .gbadge.lo { color: var(--red); }
@media (max-width: 520px) { .rv-row { grid-template-columns: 1fr; gap: 4px; } }

/* Drill diagrams */
.dgbox { margin: 2px 0 6px; }
.dgm { display: block; width: 100%; max-width: 360px; max-height: 340px; height: auto; margin: 0 auto; border-radius: 6px; }
.dgkey { font-size: .78rem; color: var(--muted, #5b6b60); text-align: center; margin-top: 4px; }
.dgkey i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 3px 0 8px; vertical-align: -1px; }
.dgkey i.tri { border-radius: 0; background: #FF8A00; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
@media print {
  .pdg { text-align: center; }
  .pdg .dgm { max-height: 34mm; width: auto; max-width: 100%; display: inline-block; }
}

/* Inbox */
.inbox-item { display: grid; gap: 8px; }
.votes { font-size: .9rem; background: var(--light, #EEF5EF); border-radius: 8px; padding: 8px 10px; }
.head-decide { border-top: 1px dashed var(--rule, #D5DED7); padding-top: 8px; align-items: center; }
.ideas { display: grid; gap: 6px; margin-top: 10px; }
.idea { display: flex; justify-content: space-between; gap: 10px; align-items: center; border: 1px solid var(--rule, #D5DED7); border-radius: 8px; padding: 8px 10px; }
.idea > span:first-child { min-width: 0; overflow-wrap: anywhere; }

/* Laws */
.laws { display: grid; gap: 10px; }
details.law { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; }
details.law > summary { display: grid; gap: 3px; cursor: pointer; list-style: none; }
details.law > summary::-webkit-details-marker { display: none; }
details.law > summary::after { content: "Show more ▾"; font-size: .8rem; font-weight: 700; color: var(--green); }
details.law[open] > summary::after { content: "Show less ▴"; }
.ltitle { font-family: var(--display); font-size: 1.12rem; font-weight: 700; }
.lsum { color: var(--muted); }
.lpills { display: flex; flex-wrap: wrap; gap: 6px; }
.lbody { display: grid; gap: 14px; margin-top: 12px; }
.lsec h4 { margin: 0 0 6px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lsec ul, .lsec ol, .agebox ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.lsec ol li::marker { font-weight: 700; color: var(--green); }
.agebox { border-left: 5px solid var(--green); background: var(--light); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; }
.agebox.none { border-left-color: var(--rule); background: var(--bg); }
.signals { margin-top: 8px; display: grid; gap: 4px; font-size: .92rem; }
.pill.law-ok { color: var(--ok); } .pill.law-same { color: var(--blue); } .pill.law-off { color: var(--muted); }
.vid { margin: 0 0 10px; display: grid; gap: 4px; }
.vid figcaption { display: grid; gap: 2px; font-size: .9rem; }
.vthumb { position: relative; display: block; width: 100%; max-width: 480px; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: #000; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.vplay { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; background: var(--red); color: #fff; font-size: 26px; display: grid; place-items: center; }
.vframe { position: relative; width: 100%; max-width: 480px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; }
.vframe iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.official { margin: 0 0 6px; padding: 8px 12px; border-left: 4px solid var(--rule); font-style: italic; }

/* Small supporting text (inbox votes, law sources) */
.small { font-size: .86rem; }

/* ---------- Mobile first: session modes, run sheet, big tap targets ---------- */
.btn { min-height: 44px; }
.btn.small { min-height: 40px; }
.chip { min-height: 40px; }
.iconbtn { width: 44px; height: 44px; }
.row .mins input { height: 44px; }
.datebar { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 8px; align-items: center; }
.datebar .iconbtn { width: 48px; height: 48px; font-size: 1.5rem; line-height: 1; }
.datebar input { min-height: 48px; font-weight: 700; text-align: center; background: var(--surface); }
.modes { position: sticky; top: 0; z-index: 4; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.modes button { min-height: 44px; border: 0; border-radius: 9px; background: none; font-weight: 700; color: var(--muted); }
.modes button[aria-selected="true"] { background: var(--green); color: var(--on-accent); }
.pane { display: grid; gap: 16px; min-width: 0; }
.pane > * { min-width: 0; }
.weekmore > summary { cursor: pointer; list-style: none; min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-weight: 700; font-size: .9rem; color: var(--green); }
.weekmore > summary::-webkit-details-marker { display: none; }
.weekmore[open] { display: grid; gap: 10px; }
.runs { display: grid; gap: 8px; }
.run { border: 1px solid var(--rule); border-left-width: 5px; border-radius: 10px; background: var(--surface); min-width: 0; }
.run.k-drill { border-left-color: var(--blue); }
.run.k-free { border-left-color: var(--warn); }
.run.k-split { border-left-color: var(--red); }
.run.k-fixed { border-left-color: var(--rule); }
.run > summary, .run-sum { display: grid; grid-template-columns: 62px minmax(0, 1fr) 20px; gap: 10px; align-items: center; padding: 12px; min-height: 60px; }
.run-sum { grid-template-columns: 62px minmax(0, 1fr); }
.run > summary { cursor: pointer; list-style: none; }
.run > summary::-webkit-details-marker { display: none; }
.run-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--green); }
.run-main { display: grid; gap: 2px; min-width: 0; }
.run-main b { font-size: 1.05rem; line-height: 1.25; }
.run-sub, .run-who { font-size: .88rem; color: var(--muted); }
.run-who::before { content: "Coach: "; }
.run-chev::after { content: "▾"; color: var(--green); font-size: 1.1rem; }
.run[open] > summary .run-chev::after { content: "▴"; }
.run-body { padding: 0 12px 12px; display: grid; gap: 8px; }
.run-lanes { display: grid; gap: 6px; padding: 0 8px 8px; }
.run-lanes .run { border-left-width: 1px; }
.run.k-lane .run-time { font-size: .8rem; line-height: 1.2; }
@media (min-width: 700px) { .run > summary, .run-sum { grid-template-columns: 90px minmax(0, 1fr) 20px; } .run-sum { grid-template-columns: 90px minmax(0, 1fr); } }
details.law > summary::before { content: none; }
summary { min-height: 44px; }
details.drill:not(.law) > summary { display: flex; align-items: center; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.chip { min-width: 44px; }
.dot { width: 44px; height: 44px; }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--green); }
.lawbar { position: sticky; top: 0; z-index: 4; display: grid; gap: 8px; padding: 10px 12px; margin: 0 -4px; background: var(--bg); border-bottom: 1px solid var(--rule); }
.lawbar input { min-height: 48px; font-size: 1.05rem; background: var(--surface); }

/* Live mode */
.live { border-radius: 12px; padding: 14px; display: grid; gap: 6px; }
#liveBox:empty { display: none; }
.live.idle { background: var(--light); border: 1px solid var(--rule); grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.live.done { background: var(--light); border: 1px solid var(--green); }
.live.on { background: var(--brand); color: var(--brand-ink); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.live.on .note, .live.on .eyebrow { color: var(--brand-ink); opacity: .85; }
.live-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.live-left { font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.live-title { font-family: var(--display); font-size: 1.5rem; line-height: 1.15; }
.live-rot { font-weight: 700; }
.live-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.25); overflow: hidden; }
.live-bar i { display: block; height: 100%; background: var(--brand-bar, #fff); transition: width 1s linear; }
.live-next { font-size: .95rem; }
.live-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.live.on .btn { background: rgba(255,255,255,.12); color: var(--brand-ink); border-color: rgba(255,255,255,.55); }
.run.is-now { border-color: var(--green); box-shadow: 0 0 0 2px var(--green); }
.run.is-past { opacity: .55; }
.live.on.warn { background: #8A4B00; }
.live-warn { justify-self: start; background: #FFD54A; color: #2A1A00; font-weight: 700; border-radius: 99px; padding: 2px 10px; font-size: .85rem; }

/* Club tab */
.brandprev { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: #fff; margin-bottom: 8px; }
.brandprev img { width: 32px; height: 32px; object-fit: contain; }
input[type=color] { width: 100%; min-height: 44px; padding: 2px; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); }
input[type=file] { min-height: 44px; max-width: 100%; }
.themes { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.theme { font-size: .85rem; background: var(--blue-bg); color: var(--ink); border-radius: 6px; padding: 4px 8px; }
.theme b { color: var(--blue); }
#view-club .btnrow input, #view-club .btnrow select { flex: 1 1 160px; min-height: 44px; }

/* Demo club */
.demobar { background: var(--warn-bg); color: var(--ink); border-bottom: 1px solid var(--rule); font-size: .9rem; }
.demobar .inner { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding-top: 8px; padding-bottom: 8px; }
.demobar .viewas { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.demobar select { width: auto; min-height: 44px; }
.demobar .btn { min-height: 44px; }
fieldset.plainset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plainset[disabled] { opacity: .6; }
.demo-note { background: var(--warn-bg); padding: 8px 10px; border-radius: 8px; }
