/* Web app (library, reader, club dashboard). Shared tokens live in /assets/site.css. */
main#app { padding-top: 28px; padding-bottom: 20px; min-height: 60vh; }
h1 { font-size: 30px; letter-spacing: -.02em; margin: 0 0 4px; }
h2 { font-size: 19px; margin: 0 0 12px; letter-spacing: -.01em; }
.back { color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--text); }
.spread { justify-content: space-between; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { display: block; text-decoration: none; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--muted); transform: translateY(-1px); }
.section-title { margin: 34px 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 20px 0; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 550; }
.tabs a.on { color: var(--text); border-color: var(--accent); }
.bar { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.code { font: 750 30px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .1em; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; }
.thumb { width: 104px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: var(--soft); display: block; }
.tag.draft { background: rgba(245,165,36,.16); color: var(--warn); }
.tag.live { background: rgba(24,160,92,.14); color: #138a4e; }
@media (prefers-color-scheme: dark) { .tag.live { color: #4fd88f; } }

/* library */
.lib-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 18px 0 20px; }
.search { flex: 1; min-width: 220px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: 5px 12px; font-size: 14px; cursor: pointer; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.gcard { padding: 0; overflow: hidden; }
.gcard .cover { aspect-ratio: 16/9; background: var(--soft) center/cover no-repeat; }
.gcard .body { padding: 14px 16px 16px; }
.gcard h3 { margin: 0 0 4px; font-size: 16.5px; line-height: 1.3; }

/* reader */
.reader { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 14px; }
.player { position: sticky; top: 76px; }
.player video { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 14px; display: block; }
.player .tech-switch { margin-top: 10px; }
.steps { display: flex; flex-direction: column; gap: 10px; }
.stepcard { display: grid; grid-template-columns: 128px 1fr; gap: 14px; padding: 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; text-align: left; width: 100%; }
.stepcard:hover { border-color: var(--muted); }
.stepcard.now { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.stepcard img, .stepcard .noimg { width: 128px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: var(--soft); }
.stepcard b { display: block; margin-bottom: 2px; }
.stepcard ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--text); color: var(--bg);
  font-size: 12px; font-weight: 700; margin-right: 6px; }
.box { background: var(--soft); border-radius: 12px; padding: 12px 16px; margin-top: 12px; }
.box b { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.box ul { margin: 6px 0 0; padding-left: 18px; }

/* forms + misc */
label { display: block; font-size: 13.5px; color: var(--muted); margin: 14px 0 5px; font-weight: 550; }
input[type=text], input[type=email], textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
textarea { min-height: 76px; resize: vertical; }
.step { display: grid; grid-template-columns: 200px 1fr auto; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.step img { width: 100%; border-radius: 10px; }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.plan { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 8px; background: var(--panel); }
.plan.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan .big { font-size: 26px; font-weight: 750; }
.notice { background: var(--soft); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.notice.warn { background: rgba(245,165,36,.14); color: var(--warn); }
.auth { max-width: 460px; margin: 24px auto 0; }
.auth .panel { padding: 28px; }
.auth h1 { text-align: center; }
.auth .lede { text-align: center; color: var(--muted); margin: 0 0 18px; }
.auth .or { text-align: center; color: var(--muted); font-size: 13px; margin: 22px 0 10px; display: flex; align-items: center; gap: 10px; }
.auth .or::before, .auth .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.codebox { font: 700 22px ui-monospace, "SF Mono", Menlo, monospace !important; letter-spacing: .12em; text-align: center; }
.err { color: var(--bad); min-height: 1.3em; font-size: 14px; margin: 8px 0 0; }
.empty { text-align: center; padding: 48px 20px; }
.empty .ic { font-size: 40px; }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 10px; z-index: 30; font-weight: 550; box-shadow: var(--shadow); }
@media (max-width: 860px) {
  .reader { grid-template-columns: 1fr; }
  .player { position: static; }
}
@media (max-width: 640px) {
  .step { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .stepcard { grid-template-columns: 104px 1fr; }
  .stepcard img, .stepcard .noimg { width: 104px; }
  h1 { font-size: 25px; }
}
@media print {
  .site-top, footer.site, .noprint { display: none !important; }
  .panel { border: 0; box-shadow: none; }
  .step { break-inside: avoid; }
}

/* ---------- gym: timetable, bookings, members, registers ---------- */
.seg { display: flex; background: var(--soft); border-radius: 11px; padding: 3px; margin: 0 0 20px; }
.seg a { flex: 1; text-align: center; text-decoration: none; padding: 8px 6px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.seg a.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.dayhead { font-size: 13px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 26px 0 10px; font-weight: 700; }
.classes { display: flex; flex-direction: column; gap: 8px; }
.classcard { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; }
.classcard.is-mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.classcard.is-off { opacity: .6; }
.classcard .time { display: flex; flex-direction: column; line-height: 1.2; }
.classcard .time b { font-size: 17px; font-variant-numeric: tabular-nums; }
.classcard .time span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.classcard .act { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; text-align: right; }
.kind { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; letter-spacing: .02em; white-space: nowrap; background: var(--soft); color: var(--muted); }
.k-gi { --k: #2f6bff; } .k-nogi { --k: #f07c1b; } .k-kids { --k: #d4a106; } .k-fundamentals { --k: #18a05c; } .k-open { --k: #7b8794; } .k-comp { --k: #d8332b; } .k-other { --k: #8e44c9; }
.kind[class*="k-"] { background: color-mix(in srgb, var(--k) 15%, transparent); color: color-mix(in srgb, var(--k) 80%, var(--text)); }
.tag.bad { background: rgba(216,51,43,.13); color: var(--bad); }
.warn-t { color: var(--warn); }
.panel.mine { margin-bottom: 6px; }
.minerow { padding: 8px 0; border-top: 1px solid var(--line); }
.minerow:first-of-type { border-top: 0; }
.beltbar { display: inline-flex; justify-content: flex-end; width: 54px; height: 14px; border-radius: 3px; vertical-align: middle;
  border: 1px solid rgba(127,127,127,.4); background: var(--bc); position: relative; }
.beltbar i { display: flex; gap: 2px; justify-content: flex-start; align-items: stretch; width: 18px; height: 100%; background: #111; padding: 0 2px; }
.beltbar.b-black i { background: #c8302a; }
.beltbar s { width: 2px; background: #fff; text-decoration: none; }
.b-white { --bc: #f4f4f4; } .b-blue { --bc: #1f5fd6; } .b-purple { --bc: #7d3cbf; } .b-brown { --bc: #7a4b26; } .b-black { --bc: #111; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stats .panel { padding: 16px 18px; }
.big { font-size: 30px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.stats2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv span { color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.regrow { display: grid; grid-template-columns: 56px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line); text-decoration: none; }
.regrow:first-of-type { border-top: 0; }
.regrow:hover { background: var(--soft); border-radius: 8px; }
.regrow .t { font-weight: 700; font-variant-numeric: tabular-nums; }
.regrow .n { font-size: 14px; color: var(--muted); }
.regrow .go { color: var(--accent); font-weight: 600; font-size: 14px; }
.notice.action { display: block; text-decoration: none; background: rgba(245,165,36,.14); color: var(--warn); font-weight: 600; }
.setup { margin-bottom: 16px; }
.checklist { margin: 0; padding-left: 22px; } .checklist li { padding: 4px 0; }
.checklist li.done { color: var(--muted); text-decoration: line-through; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.wday h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.wday { display: flex; flex-direction: column; gap: 8px; }
.wclass { text-align: left; border: 1px solid var(--line); border-left: 4px solid var(--k, var(--line)); background: var(--panel); border-radius: 10px;
  padding: 9px 10px; cursor: pointer; font-size: 14px; line-height: 1.35; }
.wclass:hover { border-color: var(--muted); border-left-color: var(--k); }
.wclass span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--soft); }
button.plan { text-align: left; cursor: pointer; font: inherit; color: inherit; }
button.plan:hover { border-color: var(--muted); }
.plan.archived { opacity: .55; }
.panel.pending { margin-bottom: 16px; border-color: rgba(245,165,36,.5); }
dialog { border: 0; border-radius: 16px; padding: 0; width: min(460px, calc(100vw - 32px)); background: var(--panel); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog.wide { width: min(620px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 15, 20, .45); backdrop-filter: blur(2px); }
.dlg { padding: 22px 24px 18px; max-height: calc(100vh - 40px); overflow: auto; }
.dlg h2 { margin-bottom: 4px; }
.dlg-actions { margin-top: 20px; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
select, input[type=time], input[type=number], input[type=password], input[type=tel] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font: inherit; color: inherit; }
select.btn { width: auto; }
input:disabled, select:disabled, textarea:disabled { opacity: .7; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; margin: 0; font-weight: 500; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.tick { width: 22px; height: 22px; accent-color: var(--accent); }
@media (max-width: 900px) {
  .week { grid-template-columns: 1fr; }
  .wday { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .wday h3 { width: 44px; margin: 0; }
}
@media (max-width: 640px) {
  .classcard { grid-template-columns: 52px 1fr; }
  .classcard .act { grid-column: 1 / -1; justify-content: flex-start; }
  .cols3 { grid-template-columns: 1fr; }
  .regrow { grid-template-columns: 48px 1fr; }
  .regrow .n, .regrow .go { grid-column: 2; }
  .seg a { font-size: 13px; padding: 8px 2px; }
}
.seg.small { margin: 8px 0 0; }
.seg.small a { padding: 4px 6px; font-size: 12.5px; }
/* calendar */
.cal .wday { background: var(--soft); border-radius: 12px; padding: 10px 8px; min-height: 140px; }
.cal .wday.today { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--panel); }
.cal .wday.past { opacity: .8; }
.cal .wday h3 span { color: var(--text); font-size: 15px; letter-spacing: 0; margin-left: 2px; }
.cal .wclass { display: block; text-decoration: none; color: inherit; }
.cal .wclass.off { opacity: .55; text-decoration: line-through; }
.cal .wclass .here { color: #18a05c; }
em.oneoff { font-style: normal; font-size: 11px; font-weight: 700; background: rgba(31,79,214,.12); color: var(--accent); padding: 1px 6px; border-radius: 99px; white-space: nowrap; }
.addday { border: 1px dashed var(--line); background: none; border-radius: 10px; padding: 6px; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.addday:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 900px) { .cal .wday { min-height: 0; } }
/* register */
.regbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; position: sticky; top: 8px; z-index: 5; margin: 18px 0 10px; padding: 12px 14px; }
.regstats { display: flex; gap: 16px; } .regstats b { font-size: 22px; margin-right: 3px; } .regstats b.g { color: #18a05c; }
.reglist { padding: 2px 6px; }
.regp { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px 6px; border-top: 1px solid var(--line); cursor: pointer; margin: 0; color: var(--text); font-weight: 400; }
.regp:first-child { border-top: 0; }
.regp:hover { background: var(--soft); border-radius: 8px; }
.regp .who b { margin-right: 4px; } .regp .who .muted { display: block; }
.regp[hidden] { display: none; }
.calopts { display: grid; gap: 10px; margin-top: 14px; }
.calopts .btn { justify-content: center; text-align: center; }
.minerow .row { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
/* month planner (in the style of TeamTotals' calendar) */
.planhead { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.weeknav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.weeknav h2 { margin: 0 0 0 8px; font-size: 22px; }
.pstats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.pstats > div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.pstats b { display: block; font-size: 24px; letter-spacing: -.02em; }
.pstats span { color: var(--muted); font-size: 13px; }
.green { color: #18a05c; } .red { color: var(--bad); } .fc { color: var(--accent); }
.pweek { margin-bottom: 16px; }
.week-head { display: flex; gap: 14px; align-items: baseline; margin: 0 2px 6px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.week-head b { color: var(--text); font-size: 15px; }
.pgrid { display: grid; gap: 6px; }
.pday { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; min-height: 110px; padding: 6px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pday.past { background: var(--soft); }
.pday.other { opacity: .5; }
.pday.today { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(31,79,214,.18); }
.pdname { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }
.pday.today .pdname { color: var(--accent); font-weight: 700; }
.pdname b { color: var(--text); }
.padd { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 6px; cursor: pointer; opacity: 0; }
.pday:hover .padd, .pday.empty .padd { opacity: .7; } .padd:hover { color: var(--accent); opacity: 1; }
.scard { display: block; text-decoration: none; color: inherit; border-radius: 9px; padding: 6px 8px; font-size: 13px; line-height: 1.3;
  border: 1px solid var(--line); border-left: 4px solid var(--k, var(--line)); background: var(--panel); }
.scard:hover { border-color: var(--muted); border-left-color: var(--k); }
.scard.planned { border-style: dashed; border-left-style: solid; }
.scard.off { opacity: .55; } .scard.off .stop b { text-decoration: line-through; }
.scard .stop { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.scard .stime { font-variant-numeric: tabular-nums; }
.scard .ssub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.who { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 3px; }
.who li { font-size: 12px; }
.who .wn { display: inline-block; background: rgba(24,160,92,.12); color: #12784a; border-radius: 4px; padding: 0 5px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.who.expected .wn { background: none; color: var(--muted); border: 1px dotted var(--muted); }
.who .more { color: var(--muted); padding: 0 3px; }
@media (max-width: 900px) {
  .pstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pgrid { grid-template-columns: 1fr !important; gap: 4px; }
  .pday { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .pday .pdname { flex: 0 0 72px; }
  .pday .scard { flex: 1 1 220px; }
  .pday.empty { padding: 3px 6px; opacity: .7; }
  .pday.other.empty { display: none; }
  .padd { opacity: .7; }
}
em.kidtag { font-style: normal; font-size: 11px; font-weight: 700; background: rgba(212,161,6,.18); color: #8a6a00; padding: 1px 6px; border-radius: 99px; white-space: nowrap; }
.kidsfilter { margin: 14px 0 -4px; font-size: 14px; color: var(--muted); }
