/* Admin-only styles */
body.admin { background: var(--surface); }
.admin .panel { background: var(--white); }

.tabs { display: flex; gap: 2px; margin-left: 18px; overflow-x: auto; }
.tabs a { color: #cfd3d8; text-decoration: none; padding: 8px 12px; border-radius: var(--radius-s); font-weight: 600; font-size: 15.5px; white-space: nowrap; }
.tabs a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.tabs a[aria-current=page] { color: #fff; background: rgba(255,255,255,0.14); box-shadow: inset 0 -3px 0 var(--red); }
@media (max-width: 720px) {
  .appbar-inner { flex-wrap: wrap; }
  .tabs { order: 3; width: 100%; margin: 6px 0 0; }
}
@media (max-width: 380px) { .admin .brand span { display: none; } }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar h1 { margin: 0 auto 0 0; font-size: 34px; }
.toolbar input[type=search] { max-width: 300px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--line); border: 1.5px solid var(--line); border-radius: var(--radius-m); overflow: hidden; margin-bottom: 16px; }
.stat { background: var(--white); padding: 14px 16px; }
.stat .v { font: 700 30px/1 var(--display); font-variant-numeric: tabular-nums; }
.stat .k { color: var(--muted); font-size: 14.5px; margin-top: 6px; }
.stat.attention .v { color: var(--warn); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid2 > .panel { margin: 0; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

table.data { width: 100%; border-collapse: collapse; font-size: 15.5px; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); font-size: 14px; padding: 8px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: #fafbfb; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
@media (max-width: 640px) { table.data .hide-sm { display: none; } }

/* Quick check-in */
.quick { position: relative; }
.quick-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 10; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow); margin-top: 4px; max-height: 320px; overflow: auto; }
.quick-results button { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; text-align: left; cursor: pointer; }
.quick-results button:hover, .quick-results button:focus { background: var(--surface); }

/* Calendar */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .cal-wrap { grid-template-columns: 1fr; } }
.cal { background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.cal-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1.5px solid var(--line); }
.cal-head h2 { margin: 0 auto 0 4px; font-size: 26px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow { font-size: 13px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.cal-day { min-height: 96px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; background: #fff; text-align: left; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 3px; border-top: 0; border-left: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: #fafbfb; color: #9aa0a7; }
.cal-day .d { font: 600 16px var(--display); }
.cal-day.today .d { color: #fff; background: var(--red); border-radius: 99px; width: 26px; height: 26px; display: grid; place-items: center; }
.cal-day[aria-pressed=true] { box-shadow: inset 0 0 0 2px var(--ink); }
.cal-ev { font-size: 12.5px; line-height: 1.25; padding: 2px 5px; border-radius: 4px; background: var(--surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.checked_in { background: var(--go-tint); color: var(--go); }
.cal-ev.late_cancel, .cal-ev.no_show { background: var(--warn-tint); color: var(--warn); }
.cal-ev.cancelled { text-decoration: line-through; color: #9aa0a7; }
.cal-more { font-size: 12px; color: var(--muted); }
@media (max-width: 640px) { .cal-day { min-height: 58px; } .cal-ev { display: none; } .cal-day .count { font-size: 12px; color: var(--red-text); font-weight: 600; } }
@media (min-width: 641px) { .cal-day .count { display: none; } }

.agenda .list li { align-items: flex-start; }
.agenda .time { font: 600 18px var(--display); width: 70px; flex: none; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.detail-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 4px; }
.detail-head h1 { margin: 0 auto 0 0; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 15.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.back { display: inline-block; margin-bottom: 10px; font-size: 15px; }

.login { max-width: 380px; margin: 8vh auto; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin: 0; }
.filters input, .filters select { min-height: 42px; padding: 8px 10px; font-size: 15.5px; }

.row-actions { align-items: center; }
.admin a.title { color: var(--ink); text-decoration: none; }
.admin a.title:hover { color: var(--red-text); text-decoration: underline; }
.grid2 > div > .panel:first-child { margin-top: 0; }
@media (max-width: 640px) {
  .admin .list > li { flex-wrap: wrap; }
  .admin .list > li > .row-actions { width: 100%; padding-left: 82px; }
  .agenda .time { width: 70px; }
}

/* Settings */
.settings-summary { background: var(--surface); border-radius: var(--radius-s); padding: 10px 14px; font-weight: 500; }
.setting { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 8px 24px; padding: 16px 0; border-top: 1px solid var(--line); }
.setting:first-of-type { border-top: 0; }
.setting-label .label { margin-bottom: 2px; }
.setting-label .hint { display: block; color: var(--muted); font-size: 14px; line-height: 1.45; }
.setting-input { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
@media (max-width: 720px) { .setting { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1.5px solid #c9cdd2; background: var(--white); font: 600 15px var(--body); color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.inline-num { display: inline-flex; align-items: center; gap: 8px; font-size: 15.5px; color: var(--muted); }
.inline-num input { width: 96px; min-height: 40px; padding: 6px 10px; }
.warn-text { color: var(--warn); max-width: 460px; }

.week { display: grid; gap: 0; }
.day-row { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.day-row:first-child { border-top: 0; }
.day-name { display: flex; align-items: center; gap: 10px; font-weight: 600; min-height: 42px; cursor: pointer; }
.day-name input { width: 20px; height: 20px; accent-color: var(--red); margin: 0; }
.day-ranges { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.range input[type=time] { width: 140px; min-height: 42px; padding: 6px 10px; }
.day-preview { color: var(--muted); }
.day-preview summary { cursor: pointer; }
.time-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.time-chips span { font-size: 13px; background: var(--surface); border-radius: 4px; padding: 2px 7px; color: var(--ink); }
.add-range { padding-left: 0; }
@media (max-width: 560px) { .day-row { grid-template-columns: 1fr; } }

.closed-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.closed-add input[type=date] { width: 180px; min-height: 42px; padding: 6px 10px; }
.closed-add input[type=text] { flex: 1; min-width: 200px; min-height: 42px; padding: 6px 10px; }

.savebar { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30; display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap;
  background: var(--graphite); color: #fff; padding: 10px 12px 10px 18px; border-radius: var(--radius-m); box-shadow: var(--shadow); margin-top: 16px; }
.savebar span { margin-right: auto; }
.savebar .btn.secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }

.admin .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

.danger-zone { border-color: #f3c2c7; }
.danger-zone p { color: var(--muted); }
.btn.danger { background: #b3192b; border-color: #b3192b; color: #fff; }
.btn.danger:hover:not(:disabled) { background: #96121f; }
dialog ul { margin: 0 0 10px; padding-left: 20px; }

code.code { font: 600 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface); padding: 3px 6px; border-radius: 4px; }

/* PayPal setup */
.setup-status { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 0 0 8px; }
.setup-status li { display: flex; gap: 6px; align-items: center; color: var(--muted); font-weight: 500; }
.setup-status li span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 99px; background: var(--surface); font-size: 13px; }
.setup-status li.ok { color: var(--go); }
.setup-status li.ok span { background: var(--go); color: #fff; }
.setup-steps { list-style: none; padding: 0; margin: 0; counter-reset: step; max-width: 720px; }
.setup-steps > li { counter-increment: step; position: relative; padding-left: 64px; }
.setup-steps > li::before { content: counter(step); position: absolute; left: 18px; top: 16px; width: 30px; height: 30px; border-radius: 99px; background: var(--ink); color: #fff; display: grid; place-items: center; font: 700 17px var(--display); }
.setup-steps > li.locked { opacity: 0.6; }
.setup-steps h2 { font-size: 24px; }
.setup-steps ol { padding-left: 20px; }
.setup-steps ol li { margin-bottom: 4px; }
.env-choice { border: 0; padding: 0; margin: 12px 0; }
.env-choice .check { margin: 6px 0; }
.inline-form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 220px; min-height: 40px; padding: 6px 10px; }
.ok-line { color: var(--go); font-weight: 600; }
.howto { margin-bottom: 8px; }
.howto summary, .setup-steps details summary { cursor: pointer; color: var(--red-text); }
.file-btn { cursor: pointer; }
@media (max-width: 560px) { .setup-steps > li { padding-left: 18px; padding-top: 56px; } }
.setup-status li.pending { color: var(--warn); }
.setup-status li.pending span { background: var(--warn-tint); }

.whoami { color: #cfd3d8; font-size: 14.5px; white-space: nowrap; }

/* Notes form and documents drop zone */
.note-form textarea { width: 100%; }
.note-form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.note-form-row select { flex: 1; min-width: 200px; min-height: 40px; padding: 6px 10px; font-size: 15px; }
.note-form-row .check { margin: 0; }
.note-form-row .btn { margin-left: auto; }
.note-form .hint, #sd-note + .hint { color: var(--muted); font-size: 13.5px; margin: 8px 0 4px; }
#sd-note { margin-top: 8px; }
#sd-note textarea { width: 100%; }
.dropzone { border: 2px dashed #c9cdd2; border-radius: var(--radius-m); padding: 16px; text-align: center; margin-bottom: 12px; transition: border-color .15s, background .15s; }
.dropzone p { margin-bottom: 10px; }
.dropzone.over { border-color: var(--red); background: var(--red-tint); }
.dropzone.busy { opacity: 0.6; pointer-events: none; }
.drop-options { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center; margin-top: 12px; }
.drop-options input[type=text] { flex: 1; min-width: 200px; max-width: 360px; min-height: 40px; padding: 6px 10px; }
.drop-options .check { margin: 0; }

/* Trainers */
.trainers .trainer { align-items: flex-start; }
.swatch { width: 14px; height: 14px; border-radius: 99px; flex: none; margin-top: 6px; }
.trainer .title .tag { margin-left: 4px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches input { position: absolute; opacity: 0; }
.swatches span { display: block; width: 32px; height: 32px; border-radius: 99px; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.6); }
.swatches input:checked + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.swatches input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }
.th-week { border-top: 1px solid var(--line); margin-top: 6px; }
.th-day { display: flex; gap: 8px 14px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.th-day .check { margin: 0; min-width: 72px; }
.th-ranges { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--muted); font-size: 14.5px; }
.th-range input[type=time] { width: 118px; min-height: 38px; padding: 4px 8px; }
.th-day:has([data-works]:not(:checked)) .th-ranges { opacity: 0.35; pointer-events: none; }

/* Day view */
.day-toolbar h1 { font-size: 30px; }
.day-legend { margin: -4px 0 10px; }
.day-scroll { overflow-x: auto; background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-m); }
.day-grid { display: grid; position: relative; min-width: min-content; }
.day-corner, .day-head { position: sticky; top: 0; z-index: 3; background: var(--white); border-bottom: 1.5px solid var(--line); }
.day-head { padding: 8px 10px; border-left: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-weight: 600; }
.day-head .dot { width: 10px; height: 10px; border-radius: 99px; background: var(--c); }
.day-head small { width: 100%; color: var(--muted); font-weight: 400; font-size: 13px; }
.day-times { position: relative; }
.day-times span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.day-times span:first-child { transform: none; }
.day-col { position: relative; border-left: 1px solid var(--line); background: repeating-linear-gradient(-45deg, #f6f7f8 0 6px, #eff1f3 6px 12px); }
.day-open { position: absolute; left: 0; right: 0; background: var(--white); }
.day-col::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1; background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% calc(60px * 1.3); }
.day-slot { position: absolute; left: 3px; right: 3px; z-index: 1; border: 0; background: transparent; border-radius: 6px; cursor: pointer; text-align: left; padding: 2px 8px; font: 600 13px var(--body); color: transparent; }
.day-slot:hover, .day-slot:focus-visible { background: color-mix(in srgb, var(--c) 10%, transparent); color: var(--ink); outline: 1.5px dashed var(--c); outline-offset: -1.5px; }
.day-slot.past:hover { color: var(--muted); }
.day-ev { position: absolute; z-index: 2; border: 0; border-left: 4px solid var(--c); border-radius: 6px; background: color-mix(in srgb, var(--c) 13%, white); text-align: left; padding: 3px 7px; font: inherit; font-size: 13.5px; line-height: 1.25; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; gap: 1px; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.day-ev strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-ev span { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-ev .tag { align-self: flex-start; font-size: 11.5px; padding: 0 6px; }
.day-ev:hover { box-shadow: 0 0 0 2px var(--c); }
.day-ev.checked_in { background: color-mix(in srgb, var(--go) 14%, white); }
.day-ev.no_show, .day-ev.late_cancel { opacity: 0.7; }
.day-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 3; pointer-events: none; }
.day-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 99px; background: var(--red); }

/* Client page sections */
.subtabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin: 6px 0 16px; overflow-x: auto; }
.subtabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
.subtabs a:hover { color: var(--ink); }
.subtabs a[aria-current=page] { color: var(--ink); border-bottom-color: var(--red); }
.subtabs .count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--surface); font-size: 13px; text-align: center; color: var(--muted); }
.tab-body { max-width: 820px; }
.tab-body > .panel { margin-top: 0; }

/* Assessment & plan */
.tab-body.wide { max-width: none; }
.fit-toolbar { margin-bottom: 12px; }
.fit h3 { margin-top: 16px; }
.alert.stop { background: #fdecee; border-color: #f3b6bd; color: #8f1422; }
.screen-out { padding: 10px 12px; border-radius: var(--radius-s); background: var(--surface); margin: 10px 0; }
.screen-out.ok { background: var(--go-tint); color: var(--go); }
.screen-out.warn { background: var(--warn-tint); color: var(--warn); }
.screen-out.stop { background: #fdecee; color: #8f1422; font-weight: 600; }
.fit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; }
@media (max-width: 860px) { .fit-grid { grid-template-columns: 1fr; } }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain > li { padding: 6px 0; }
ul.focus { list-style: none; padding: 0; margin: 0; }
ul.focus > li { padding: 8px 10px; border-left: 3px solid var(--ink); background: var(--surface); border-radius: 0 6px 6px 0; margin-bottom: 8px; }
ul.focus > li.pain { border-left-color: #b3192b; background: #fdecee; }
ul.focus ul { margin: 2px 0 4px; padding-left: 18px; }
table.tests th[scope=row] { font-weight: 500; color: var(--ink); font-size: 15px; white-space: normal; }
table.tests td { font-variant-numeric: tabular-nums; }
.sym.low { color: var(--warn); font-weight: 700; }
.up { color: var(--go); font-weight: 600; font-size: 13.5px; }
.down { color: var(--red-text); font-weight: 600; font-size: 13.5px; }
.screen-st { white-space: nowrap; font-size: 14px; }
details.older { border-top: 1px solid var(--line); padding: 10px 0; }
details.older summary { cursor: pointer; }
details.older .results { border: 0; padding: 0; margin: 8px 0 0; box-shadow: none; }

.assess .form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.assess .form-row .field { flex: 1; min-width: 160px; margin-bottom: 10px; }
.assess .checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 16px; margin-bottom: 10px; }
.assess .checks .check { margin: 4px 0; }
.assess .label { display: block; margin: 12px 0 4px; }
.bp { display: flex; align-items: center; gap: 6px; }
.bp input { width: 90px; }
.pattern { padding: 12px 0; border-top: 1px solid var(--line); }
.pattern-name { font-weight: 600; margin-bottom: 6px; }
.pattern-side { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.pattern-side .side { width: 40px; font-weight: 600; color: var(--muted); font-size: 14px; }
.segs { display: inline-flex; border: 1.5px solid #c9cdd2; border-radius: 99px; overflow: hidden; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 6px 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.seg + .seg span { border-left: 1px solid #e1e3e6; }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input[value=comp]:checked + span { background: var(--warn); }
.seg input[value=pain]:checked + span { background: #b3192b; }
.seg input:focus-visible + span { outline: 3px solid var(--red); outline-offset: -3px; }
.chip-check input { position: absolute; opacity: 0; }
.chip-check span { display: inline-block; padding: 4px 10px; border-radius: 99px; border: 1px solid #c9cdd2; font-size: 13.5px; cursor: pointer; }
.chip-check input:checked + span { background: var(--warn-tint); border-color: var(--warn); color: var(--warn); font-weight: 600; }
.chip-check input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 1px; }
.pattern input[data-note] { width: 100%; max-width: 520px; min-height: 36px; padding: 4px 10px; font-size: 14.5px; }
.test-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 10px 0; border-top: 1px solid var(--line); align-items: center; }
.test-row .last { color: var(--ink); font-weight: 500; }
.test-inputs { display: flex; gap: 8px; align-items: center; }
.test-inputs label { display: flex; gap: 4px; align-items: center; font-weight: 600; color: var(--muted); font-size: 14px; }
.test-inputs input { width: 92px; min-height: 40px; padding: 6px 8px; text-align: right; }
.test-inputs .unit { color: var(--muted); font-size: 13.5px; width: 44px; }
@media (max-width: 640px) { .test-row { grid-template-columns: 1fr; } }
#add-test { max-width: 320px; margin-top: 10px; }

/* Plan */
.plan-head h1 { margin-bottom: 4px; }
.phase-bar { display: flex; gap: 3px; margin: 14px 0 16px; border-radius: var(--radius-s); overflow: hidden; }
.phase-bar .ph { padding: 8px 10px; color: #fff; min-width: 0; background: #57606a; }
.phase-bar .ph strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phase-bar .ph span { font-size: 12px; opacity: 0.85; white-space: nowrap; }
.ph-base, .ph-foundation, .ph-progress, .ph-offseason, .ph-accumulate { background: #1f6feb !important; }
.ph-build, .ph-preseason, .ph-intensify { background: #8250df !important; }
.ph-peak, .ph-sharpen, .ph-realize { background: #d81f33 !important; }
.ph-taper { background: #1a7f37 !important; }
.plan-top { margin-bottom: 16px; }
.plan-top .panel { margin: 0; }
#client-note { width: 100%; }
.week.current { box-shadow: inset 4px 0 0 var(--red); }
.week-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.week-head h2 { margin: 0; font-size: 24px; }
.week-head .btn { margin-left: auto; }
ul.sessions { list-style: none; padding: 0; margin: 8px 0; }
ul.sessions li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); }
ul.sessions .day { font: 700 16px var(--display); width: 36px; flex: none; padding-top: 1px; }
ul.sessions .kind { flex: none; width: 74px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 3px 0 0 8px; border-left: 4px solid var(--k, #57606a); color: var(--muted); }
.k-strength { --k: #1f6feb; } .k-cardio { --k: #1a7f37; } .k-intensity { --k: #d81f33; } .k-long { --k: #8250df; }
.k-skill { --k: #9a6700; } .k-mobility { --k: #8a9099; } .k-race { --k: #16181b; }
.k-race strong { color: var(--red-text); }

@media print {
  .appbar, .no-print, .toast, .savebar, .subtabs { display: none !important; }
  body.admin, .admin .panel { background: #fff; }
  .panel { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .week { break-inside: avoid; }
  .phase-bar .ph { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  main { padding: 0; }
}
ul.sessions .grow { flex: 1; min-width: 0; }
.feedback li.unseen { background: #fffdf5; }
.feedback li.pain { box-shadow: inset 3px 0 0 #b3192b; padding-left: 10px; }
.ladders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 20px; }
.ladder strong { text-transform: capitalize; }
.ladder ol { margin: 4px 0 0; padding-left: 20px; font-size: 14px; }
#add-pick { flex: 2; min-width: 240px; }
#add-role { flex: 1; min-width: 140px; }

/* Calendar: Month / Week / Day switch, week grid, moving and copying */
.viewseg { display: inline-flex; border: 1.5px solid #c9cdd2; border-radius: 99px; overflow: hidden; background: var(--white); }
.viewseg a { padding: 6px 14px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--muted); }
.viewseg a + a { border-left: 1px solid #e1e3e6; }
.viewseg a[aria-current=page] { background: var(--ink); color: var(--white); }
.day-toolbar select { width: auto; min-height: 36px; padding: 4px 10px; }
.day-grid.week .day-head { justify-content: center; text-align: center; }
.day-head.is-today { box-shadow: inset 0 -3px 0 var(--red); }
.day-head .day-link { color: inherit; text-decoration: none; font-weight: 600; }
.day-head .day-link b { font-size: 18px; margin-left: 2px; }
.day-head .day-link:hover { color: var(--red-text); }
.day-col.is-today .day-open { background: #fffdf7; }
.day-ev { user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.day-ev.movable { cursor: grab; }
.day-ev.dragging { opacity: 0.45; cursor: grabbing; }
.day-ev.clipped { outline: 2px dashed var(--ink); outline-offset: 1px; }
.day-ghost { position: absolute; left: 3px; right: 3px; z-index: 4; border: 2px dashed var(--c); border-radius: 6px; background: color-mix(in srgb, var(--c) 18%, white); font: 600 13px var(--body); padding: 3px 7px; pointer-events: none; }
.day-scroll.placing .day-col { cursor: copy; }
.day-scroll.placing .day-slot { color: var(--ink); }
.clip-bar { position: sticky; top: 8px; z-index: 5; }

/* Marketing */
.offers .offer.retired .title { color: var(--muted); }
.offer-stats { color: var(--go); margin-top: 2px; }
.tips li { margin: 6px 0; }

/* Business */
.period { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.period select, .period input { width: auto; min-height: 36px; padding: 4px 10px; }
.kpi-h { font-size: 22px; margin: 22px 0 8px; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hbars li { display: grid; grid-template-columns: minmax(110px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 14.5px; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.hb-label .dot { width: 10px; height: 10px; border-radius: 99px; flex: none; }
.hb-track { height: 12px; background: var(--surface); border-radius: 99px; overflow: hidden; }
.hb-bar { display: block; height: 100%; border-radius: 99px; }
.hb-val { white-space: nowrap; text-align: right; }
.vbars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 190px; align-items: end; padding-top: 8px; }
.vb { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.vb-bar { width: 70%; background: var(--ink); border-radius: 4px 4px 0 0; }
.vb:last-child .vb-bar { background: var(--red); }
.vb-val { font-size: 11px; color: var(--muted); white-space: nowrap; }
.vb-m { font-size: 12.5px; color: var(--muted); }
.filters-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters-row input[type=search] { flex: 1 1 240px; }
.filters-row select { width: auto; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 10px 0 30px; }
@media (max-width: 560px) { .hbars li { grid-template-columns: 1fr auto; } .hb-track { grid-column: 1 / -1; grid-row: 2; } .vb-val { display: none; } }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px; }
.check-grid .check { margin: 0; padding: 6px 0; border: 0; background: none; }
fieldset.field { border: 0; padding: 0; margin: 0 0 14px; }
.fit-list li .tag { margin-left: 6px; }
.fit-box { background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-m); padding: 8px 14px; margin: 4px 0 10px; }
.fit-box summary { cursor: pointer; }
.fit-box .dot { display: inline-block; width: 9px; height: 9px; border-radius: 99px; margin: 0 4px 0 2px; }
.avatar { width: 40px; height: 40px; border-radius: 99px; object-fit: cover; border: 2.5px solid var(--line); flex: none; }
.avatar.lg { width: 72px; height: 72px; }
.photo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rating { color: #b7791f; font-weight: 600; margin-left: 6px; }
.stars { color: #d69e2e; letter-spacing: 1px; }
.stars-off { color: #d9dce0; }
.cert-row { display: grid; grid-template-columns: 1fr 170px auto; gap: 8px; margin-bottom: 6px; }
.rating-reply { margin: 6px 0 0 12px; padding: 6px 10px; border-left: 3px solid var(--line); font-size: 14.5px; }
.units { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.units input { width: 74px; }
.units > span { color: var(--muted); font-size: 14px; }
.units .or { margin: 0 4px; color: var(--muted); }
.body-row .field { min-width: 0; }
.bmi-out { display: block; font-weight: 600; font-size: 18px; padding: 10px 0; }
.form-row.body-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) 80px; gap: 12px 18px; align-items: start; }
.body-row .label { display: block; margin-bottom: 6px; }
@media (max-width: 900px) { .form-row.body-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .form-row.body-row { grid-template-columns: 1fr; } }
.where-tag { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--surface); color: var(--muted); margin-left: 4px; }
.where-tag.own { background: #eef6ff; color: #1d4f91; }
@media print {
  body.print-home .sessions li[data-where="studio"] { display: none; }
  body.print-home .week:not(:has(li[data-where="own"])) { display: none; }
  body.print-home .plan-top { display: none; }
}

.ex-rest { font-weight: 500; color: var(--muted); font-size: 0.9em; }

.icf { border: 1.5px solid var(--line); border-radius: var(--radius-m); padding: 8px 14px; margin: 10px 0 14px; background: var(--white); }
.icf summary { cursor: pointer; }
.icf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 22px; margin-top: 10px; }
.icf-row h4 { margin: 6px 0 4px; font-size: 15px; }

.safety-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.bp-history summary { cursor: pointer; }
.hold-banner { margin: 8px 0 12px; }

.bp-levels { display: flex; flex-direction: column; gap: 8px; }
.bp-levels input { width: 80px; display: inline-block; }

/* Exercise demos */
.ex-media{margin:6px 0}
.ex-media summary{cursor:pointer;font-weight:600;color:var(--accent,#1f6f5c)}
.ex-media-list{display:grid;gap:8px;margin-top:6px}
.ex-media figure{margin:0}
.ex-media video,.ex-media img{width:100%;max-height:340px;object-fit:contain;background:#000;border-radius:8px}
.lib-media{display:flex;gap:6px;flex-wrap:wrap;margin-top:4px}.lib-thumb{position:relative;display:inline-flex;align-items:center;gap:2px;border:1px solid var(--line,#ddd);border-radius:6px;padding:2px}.lib-thumb img{width:48px;height:48px;object-fit:cover;border-radius:4px}.lib-thumb .vid{font-size:12px;padding:0 4px}
.intake-box summary { cursor: pointer; }
.intake-box .flags { margin: 10px 0; padding-left: 18px; }
.intake-box .flags li.stop { color: var(--red-text, #b42318); font-weight: 600; }
.intake-box .flags li.warn { color: var(--warn, #9a6700); }
.ik-table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 8px 0; }
.ik-table th { text-align: left; color: var(--muted); font-weight: 500; width: 170px; vertical-align: top; padding: 4px 8px 4px 0; }
.ik-table td { padding: 4px 0; overflow-wrap: anywhere; }
.notice { background: #eef6ff; border: 1px solid #b6d4f5; border-radius: 8px; padding: 8px 12px; }
.lead-notes { min-height: 38px; height: 38px; margin-top: 6px; }
.scrollbox.legal-text { max-height: 55vh; overflow: auto; border: 1px solid var(--line, #ddd); border-radius: 8px; padding: 12px 16px; background: #fff; }
.legal-text h1 { font-size: 22px; } .legal-text h2 { font-size: 17px; margin-top: 16px; } .legal-text h3 { font-size: 15px; }
.legal-gate { max-width: 860px; margin: 0 auto; } .legal-gate form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
/* Group programs */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.board-card { background: #fff; border: 1px solid var(--line, #ddd); border-radius: 10px; padding: 12px 14px; }
.board-card h2 { font-size: 20px; margin: 0 0 6px; }
.board-card ol { padding-left: 18px; margin: 0; } .board-card li { margin: 6px 0; }
.board-card .dose { font-weight: 600; } .board-card .sugg { color: #1f6f5c; }
.board-card.hold { border-color: var(--red-text, #b42318); } .board-hold { color: var(--red-text, #b42318); font-weight: 700; }
.board-card.skip { opacity: .55; }
.board-effort { font-size: 18px; }
.sched h4 { margin: 12px 0 4px; } .sessions li.skipped { opacity: .55; } .change { color: #7a5a00; }
body.tv-mode #tabs, body.tv-mode header, body.tv-mode .topbar { display: none !important; }
body.tv-mode main, body.tv-mode #view { max-width: none; }
body.tv-mode .board { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
body.tv-mode .board-card { font-size: 20px; } body.tv-mode .board-card h2 { font-size: 28px; } body.tv-mode .board-head h1 { font-size: 44px; }
.btn.btn-go { background: #1f7a4d; border-color: #1f7a4d; color: #fff; }
.btn.btn-go:hover:not(:disabled) { background: #17603c; }
.btn.btn-go:disabled { background: #9cc7b2; border-color: #9cc7b2; }
.btn.btn-blue { background: #1f5fbf; border-color: #1f5fbf; color: #fff; }
.btn.btn-blue:hover { background: #184c99; }
.btn.btn-amber { background: #f2b33d; border-color: #e0a12a; color: #1d2321; }
.btn.btn-amber:hover { background: #e3a22b; }
.eq-h { font-size: 15px; margin: 14px 0 6px; color: var(--muted); }
.eq-add { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; } .eq-add input { flex: 1; min-width: 220px; }
.eq-custom { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Menu: top tabs on wide screens, a bottom tab bar on phones ---------- */
.tabs svg { display: none; }
.tabs .tab-more { display: none; }
@media (max-width: 720px) {
  .appbar-inner { flex-wrap: nowrap; }
  .admin .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; width: auto; order: 0;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; overflow: visible;
    background: var(--graphite); border-top: 1px solid rgba(255,255,255,.08);
    padding: 4px max(4px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)); }
  .admin .tabs[hidden] { display: none; }
  .admin .tabs a.tab-extra { display: none; }
  .admin .tabs a, .admin .tabs .tab-more { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 4px; font-size: 11.5px; font-weight: 600;
    color: #aeb3ba; background: none; border: 0; border-radius: 8px; box-shadow: none; font-family: var(--body); cursor: pointer; min-height: 52px; justify-content: center; }
  .admin .tabs svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .admin .tabs .tab-more svg { fill: currentColor; stroke: none; }
  .admin .tabs a[aria-current=page], .admin .tabs .tab-more.current { color: #fff; background: none; box-shadow: none; }
  .admin .tabs a[aria-current=page] svg, .admin .tabs .tab-more.current svg { color: var(--red); }
  body.admin main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .savebar { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .admin .toast, .admin .update-bar { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .admin .appbar { padding-top: calc(env(safe-area-inset-top) + 6px); padding-bottom: 6px; }
}
dialog.more-sheet .sheet-list { list-style: none; margin: 0; padding: 0; }
dialog.more-sheet .sheet-list a, dialog.more-sheet .sheet-list button { display: block; width: 100%; text-align: left; padding: 15px 6px; font: 600 17px var(--body);
  color: var(--ink); text-decoration: none; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
dialog.more-sheet .sheet-list a[aria-current] { color: var(--red-text); }
dialog.more-sheet .sheet-list button { color: var(--muted); }

/* Plan weeks: long session text wraps instead of pushing the page wider than a phone. */
.week > * { min-width: 0; }
ul.sessions li > div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .phase-bar { flex-wrap: wrap; }
  .phase-bar .ph { flex: 1 1 40% !important; }
}
/* Tables in a panel scroll sideways on a phone rather than widening the page. */
.panel.flush { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* TonPR subscription: active members and the estimated bill. */
.bill-estimate { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
.bill-estimate > div { flex: 1 1 140px; background: var(--surface); border-radius: var(--radius-s); padding: 10px 12px; }
.bill-estimate span { display: block; }
.bill-estimate strong { font: 700 26px/1.1 var(--display); font-variant-numeric: tabular-nums; }
/* Two-column form on wide screens, one column on phones. */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
