/* 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: auto; overscroll-behavior: contain; 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; }
/* Edit and + Add sit together, side by side, never in the same spot. */
ul.sessions .row-acts { display: inline-flex; flex: none; gap: 6px; align-items: center; }
.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: fixed; z-index: 20; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(760px, calc(100% - 32px)); margin: 0; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.day-scroll.placing { padding-bottom: 96px; } /* room to reach the last times above the Copying bar */
.day-times { position: sticky; left: 0; z-index: 2; background: var(--white); }
.day-corner { left: 0; z-index: 4; }

/* 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; }
.where-tag.road, .where-tag.gym, .where-tag.hotel_gym, .where-tag.hotel_room { background: #fff4e5; color: #8a4b00; }
@media print {
  body.print-home .sessions li[data-where="studio"] { display: none; }
  body.print-home .week:not(:has(li:not([data-where="studio"]))) { 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);list-style:none}
.ex-media summary::-webkit-details-marker{display:none}
.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; }
/* Wide screens: Business, Marketing and Settings sit under the cog at the right of the bar (on a phone, under More). */
.tabs a[data-cog] { display: none; }
.cog-wrap { position: relative; }
.tab-cog { display: grid; place-items: center; width: 40px; height: 40px; margin-right: 6px; border: 0; border-radius: var(--radius-s); background: none; color: #cfd3d8; cursor: pointer; }
.tab-cog svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-cog:hover, .tab-cog[aria-expanded="true"] { color: #fff; background: rgba(255,255,255,0.08); }
.tab-cog.current { color: #fff; background: rgba(255,255,255,0.14); box-shadow: inset 0 -3px 0 var(--red); }
.cog-menu { position: absolute; right: 6px; top: calc(100% + 8px); z-index: 60; min-width: 200px; padding: 6px; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-m, 10px); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.cog-menu a { display: block; padding: 11px 12px; border-radius: var(--radius-s); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; }
.cog-menu a:hover, .cog-menu a:focus-visible { background: var(--surface); outline: none; }
.cog-menu a[aria-current] { color: var(--red-text); box-shadow: inset 3px 0 0 var(--red); }
@media (max-width: 720px) { .cog-wrap { display: none !important; } }
.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; } }

/* Agreements in a scroll box: keep headings in proportion to the text. */
.scrollbox.legal h1, .scrollbox.legal h2 { font-size: 1.15rem; margin: 14px 0 6px; }
.scrollbox.legal h3, .scrollbox.legal h4 { font-size: 1rem; margin: 12px 0 4px; }

/* Settings › Activity */
.activity-row .title a { font-weight: 500; }
.activity-row.refused .title { color: #8c1220; }
.activity-changes { width: 100%; table-layout: fixed; border-collapse: collapse; margin-top: 8px; font-size: 14.5px; }
.activity-changes th, .activity-changes td { text-align: left; padding: 4px 8px 4px 0; border-top: 1px solid var(--line, #e3e5e2); vertical-align: top; word-break: break-word; }
.activity-changes th { color: var(--muted); font-weight: 500; }
.activity-changes code { font-size: 12.5px; white-space: pre-wrap; }
.activity-changes th:first-child { width: 34%; }
.cues-dd { margin: 6px 0; }
.cues-dd summary { cursor: pointer; font-size: 13.5px; color: var(--muted); }
.ex-actions [aria-pressed="true"] { border-color: var(--ink, #1d2321); }
.resp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.resp-table th, .resp-table td { text-align: left; padding: 4px 8px 4px 0; border-top: 1px solid var(--line, #e3e5e2); }
.tp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.tp-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .tp-grid { grid-template-columns: 1fr; } }
.low-week { border-left: 4px solid #d98a00; }
.wh-box { border: 1px solid var(--line, #e3e3e3); border-radius: 8px; padding: 10px 12px; margin-top: 12px; }
.wh-box legend { font-weight: 700; padding: 0 4px; }
.wh-box .cycle-box h3 { margin: 10px 0 4px; font-size: 15px; }
.wh-panel .warn-text { color: #b45309; font-weight: 600; }
.wh-box [hidden], .wh-box[hidden] { display: none !important; }
.wh-panel #cy-log input[type=date] { max-width: 180px; }
/* Phones get the install card on Today; the header button would crowd the tab bar. */
@media (max-width: 720px) { .admin .appbar #get-app { display: none; } }
/* Settings › Your app */
.brand-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.file-btn { cursor: pointer; display: inline-block; }
.br-home { background: linear-gradient(160deg, #4b6cb7, #182848); border-radius: 18px; padding: 28px; display: flex; justify-content: center; }
.br-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 96px; }
.br-tile img { width: 76px; height: 76px; border-radius: 18px; box-shadow: 0 2px 8px rgba(0,0,0,.25); background: #fff; }
.br-tile span { color: #fff; font-size: 13px; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.5); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Client record ⇄ Training: colored pills that stand out */
.rec-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.rec-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; font-weight: 700; text-decoration: none; border: 2px solid; font-size: 15px; }
.rec-pill::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.rec-client { color: #1d4ed8; border-color: #1d4ed8; background: #eef3ff; }
.rec-training { color: #15803d; border-color: #15803d; background: #ecfbf1; }
.rec-client[aria-current] { background: #1d4ed8; color: #fff; }
.rec-training[aria-current] { background: #15803d; color: #fff; }
.rec-wod { color: #fff; border-color: #c21a2c; background: #d42234; }
.rec-wod::before { background: #fff; }
.rec-pill[aria-current]::before { background: #fff; }
.rec-pill:hover { filter: brightness(.95); }
/* Set up your studio (its own class names: .steps and .setup-steps are the sign-up step bar and the PayPal guide) */
.setup-check .progress { height: 8px; background: #eceef1; border-radius: 99px; overflow: hidden; margin: 4px 0 12px; }
.setup-check .progress span { display: block; height: 100%; background: #15803d; }
.setup-check .check-steps { list-style: none; padding: 0; margin: 0; }
.setup-check .check-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line, #e5e5e5); }
.setup-check .tick { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c9cdd2; display: grid; place-items: center; font-size: 13px; color: #fff; }
.setup-check li.done .tick { background: #15803d; border-color: #15803d; }
.pay-setup { border: 1px solid var(--line, #e5e5e5); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.pay-setup.on { border-color: #9fd6b0; background: #f6fcf8; }
.pay-setup h3 { margin: 0 0 6px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* Client > Training plans: grouped by where they are. */
.plans-panel .plans-h { margin: 14px 0 2px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.plans-panel .list li { flex-wrap: wrap; }

/* Where a session happens: one day or the whole week. */
.loc-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.loc-pick select { width: auto; min-width: 150px; }
.week-loc { width: auto; margin-left: auto; }

/* A page still loading after a page change (admin.js freshView): the previous page shows greyed, not clickable. */
#view[aria-busy="true"] { opacity: 0.55; pointer-events: none; transition: opacity 0.15s 0.15s; }
/* Assessment: PAR-Q+ and add-on screens */
.parq { margin-bottom: 14px; }
.parq-q { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line, #e5e5e5); }
.parq-q .grow { flex: 1; }
.parq-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface, #f1f2f4); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
h3.sub { font-size: 16px; margin: 14px 0 6px; }
.extra { border: 1px solid var(--line, #e5e5e5); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.extra-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.extra-head [data-x-remove] { margin-left: auto; }
.extra .x-field { margin: 8px 0; }
.extra [data-x-note] { width: 100%; margin-top: 8px; }
@media (max-width: 600px) { .parq-q { flex-wrap: wrap; } .parq-q .segs { margin-left: 34px; } }
/* Workout cards (trainer): plan, sets / reps / weight / effort and notes always on screen, saved as you go */
.ex-dose .dose-edit { display: inline-flex; align-items: center; gap: 6px; font: inherit; }
.ex-dose .dose-edit input { font: 700 17px var(--display); color: var(--red-text); border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; width: 14ch; background: transparent; }
.ex-dose .dose-edit input:hover, .ex-dose .dose-edit input:focus { border-color: var(--line, #d7dade); background: #fff; }
.ex-fields { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin: 10px 0 6px; }
.ex-fields .exf { display: flex; flex-direction: column; gap: 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ex-fields .exf input { width: 78px; min-height: 40px; padding: 6px 8px; font-size: 16px; font-weight: 600; color: var(--ink); }
.ex-fields .exf input::placeholder { color: #a6abb2; font-weight: 400; }
.ex-fields .exf-load input { width: 96px; }
.ex-saved { color: var(--go); align-self: center; }
.ex-saved.err { color: var(--red-text); }
.ex-notes { display: block; margin: 4px 0 8px; }
.ex-notes textarea { width: 100%; min-height: 44px; font-size: 15px; margin-top: 2px; }
@media (max-width: 600px) { .ex-fields .exf input { width: 64px; } .ex-fields .exf-load input { width: 80px; } }
.ex-dose .dose-lbl { font: 600 12px var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
/* Workout: "Finished" pill — outlined until the session is recorded, solid green once it is */
.finish-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 16px; border-radius: 999px; border: 2px solid var(--go, #15803d); background: #fff; color: var(--go, #15803d); font: 700 15px var(--body); cursor: pointer; }
.finish-pill:hover { background: #ecf8ef; }
.finish-pill.done { background: var(--go, #15803d); color: #fff; }
.finish-pill.done:hover { filter: brightness(1.08); }
.finish-pill.skipped { border-color: #9aa0a6; color: #5f6368; }

/* Phase labels jump to their weeks (plan page). */
.phase-bar button.ph { border: 0; text-align: left; font: inherit; cursor: pointer; }
.phase-bar button.ph:hover { filter: brightness(1.12); }
.phase-bar button.ph:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.phase-link { padding: 0; border: 0; background: none; font: inherit; color: var(--red-text); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.week { scroll-margin-top: 72px; }
.week.flash { animation: week-flash 1.4s ease-out; }
@keyframes week-flash { 0% { box-shadow: 0 0 0 3px var(--red); } 100% { box-shadow: 0 0 0 3px transparent; } }
/* Pill buttons (plan page: Home equipment, Delete, Archive). */
.btn.pill { border-radius: 99px; background: var(--white); color: var(--ink); border: 1.5px solid #c9cdd2; }
.btn.pill:hover { background: var(--surface); }
.btn.pill.pill-danger { color: var(--red-text); border-color: #f0b8bf; }
.btn.pill.pill-danger:hover { background: var(--red-tint); }
@media (prefers-reduced-motion: reduce) { .week.flash { animation: none; } }

/* Workout feedback folded away on a client's Training page. */
details.feedback.fold > summary { cursor: pointer; display: flex; align-items: baseline; gap: 8px; list-style: none; }
details.feedback.fold > summary::-webkit-details-marker { display: none; }
details.feedback.fold > summary::before { content: '▸'; font-size: 14px; color: var(--muted); }
details.feedback.fold[open] > summary::before { content: '▾'; }
details.feedback.fold > summary h2 { margin: 0; display: inline; }

/* Today's session on the plan page. */
.sessions li.is-today { background: var(--go-tint); box-shadow: inset 4px 0 0 var(--go); border-radius: 6px; }
.today-tag { display: block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--go); }
.tax-box { border-top: 1px solid var(--line, #e5e5e5); margin-top: 14px; padding-top: 10px; }
.tax-box h3 { margin: 0 0 6px; }
.tax-box #tax-id { max-width: 14ch; }
/* signup.tonpr.com: a studio signs itself up */
body.signup-studio .wrap { max-width: 760px; }
body.signup-studio .slug-row { display: flex; align-items: center; gap: 6px; }
body.signup-studio .slug-row input { flex: 1; min-width: 0; }
body.signup-studio details.info { margin: 8px 0; }
body.signup-studio .legal-text { max-height: 320px; overflow: auto; }
body.signup-studio .err { color: var(--red-text); font-weight: 600; }

/* Training week: day checkboxes and rest days */
.day-pick { border: 0; padding: 0; margin: 8px 0; }
.day-checks { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.day-checks .check { margin: 0; min-width: 64px; }
.k-rest { --k: #d5d9de; }
.sessions li.rest-row { opacity: .8; }

/* Progress */
.pg h3 { margin: 16px 0 6px; }
.pg-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.pg-tile { border: 1px solid var(--line, #e3e6ea); border-radius: 10px; padding: 10px 12px; }
.pg-num { font: 700 24px var(--display, inherit); }
.pg-label { font-weight: 600; }
.pg-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-bottom: 18px; }
.pg-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 0; }
.pg-bar span { display: block; background: #8a9099; border-radius: 3px 3px 0 0; }
.pg-bar.spike span { background: #d08a00; }
.pg-bar em { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font: 10px var(--body, inherit); font-style: normal; color: #6b7178; overflow: hidden; white-space: nowrap; }
.pg-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pg-table th, .pg-table td { text-align: left; padding: 6px 6px 6px 0; border-top: 1px solid var(--line, #e3e6ea); vertical-align: top; }
.pg-table .up { color: #1f7a3a; font-weight: 600; } .pg-table .down { color: #a33; font-weight: 600; }
.pg-spark { width: 80px; height: 24px; color: #16181b; }
.pg-prs li { margin: 4px 0; }
@media (max-width: 480px) { .pg-trend { display: none; } .pg-bar em { font-size: 9px; } }

/* Calendar: what the client works on that session */
.day-ev .day-train { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-ev .day-train.none { font-weight: 400; opacity: .7; }
.today-train { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; }
.today-train h3 { margin: 4px 0 6px; }
.today-train .list li { align-items: center; }

/* Exercise library: tri-planar filters and tags */
.tp-filters .row { gap: 10px; align-items: flex-end; }
.tp-filters label { display: flex; flex-direction: column; gap: 2px; min-width: 140px; }
.lib-group li .tag { font-size: 11.5px; padding: 0 7px; margin: 2px 2px 0 0; }
.lib-group li details { margin-top: 4px; }
.lib-group li details p { margin: 4px 0; }
.tp-ladders { margin-top: 10px; }

/* Weekly training review (public/js/admin-review.js) */
.wr-card { border-left: 4px solid var(--line); }
.wr-card.wr-red { border-left-color: #d64545; }
.wr-card.wr-wrong, .wr-card.wr-goal { border-left-color: #e0a526; }
.wr-card.wr-easy, .wr-card.wr-clear { border-left-color: #2f9e6b; }
.wr-card .panel-head h2 { display: flex; flex-direction: column; gap: 2px; }
.wr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.wr-chips .tag { margin: 0; }
.wr-list > details > summary { cursor: pointer; margin: 8px 0; }

/* Plan weeks on a phone: the day, type and buttons share the top line and the session gets the full width below,
   instead of four side-by-side columns squeezing the text into a word-breaking sliver. */
@media (max-width: 640px) {
  ul.sessions li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "day kind log acts" "main main main main"; gap: 6px 8px; align-items: center; }
  ul.sessions li > .day { grid-area: day; width: auto; min-width: 36px; }
  ul.sessions li > .kind { grid-area: kind; width: auto; padding-top: 0; padding-left: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; letter-spacing: .02em; }
  ul.sessions li > .grow { grid-area: main; overflow-wrap: break-word; }
  ul.sessions li > a.btn { grid-area: log; }
  ul.sessions li > .row-acts { grid-area: acts; }
  ul.sessions .row-acts { gap: 2px; }
  ul.sessions .row-acts .btn, ul.sessions li > a.btn { min-height: 44px; padding-left: 8px; padding-right: 8px; }
  ul.sessions .mode-tag { border-radius: 10px; }
  .week-head .week-loc { flex: 1 1 180px; margin-left: 0; }
  .week-head .btn { margin-left: 0; }
}
/* Today's highlighted row: keep its text off the green edge. */
.sessions li.is-today { padding-left: 10px; padding-right: 10px; }
/* Phones: the bottom tab bar is moved out of the sticky top bar by admin.js (iOS Safari flickered with it nested);
   its own compositing layer keeps it steady while the page scrolls. */
@media (max-width: 720px) {
  .admin .tabs { transform: translateZ(0); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
}

/* Finding an exercise (public/js/exercise-search.js): search box, results, "add as a new exercise". */
.xp-q { width: 100%; font-size: 16px; }
.xp-list { max-height: min(52vh, 420px); overflow-y: auto; margin: 8px 0 0; }
.xp-list li[data-pick] { cursor: pointer; }
.xp-list .xp-head { padding-bottom: 0; border: 0; }
.xp-new { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.xp-new .btn { white-space: normal; text-align: left; }
.add-ex-opts { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.add-ex-opts select { flex: 1 1 auto; min-width: 0; }
.add-fwd { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; }
.add-fwd input { margin-top: 3px; }
.xp-list li .grow { min-width: 0; }
.not-done .nd-by { opacity: 0.8; }
dialog.xp-dialog .dlg { width: min(560px, 92vw); }

/* Tasks (public/js/admin-tasks.js) */
.tabs a[href="#tasks"] { position: relative; }
.tab-badge { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--red); color: #fff;
  font: 700 11.5px/18px var(--body); text-align: center; vertical-align: 1px; }
@media (max-width: 720px) {
  .admin .tabs .tab-badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; }
}
.task-filters { gap: 12px; align-items: center; margin: 0 0 12px; }
.tasks > li.task { align-items: flex-start; gap: 10px; }
.task-icon { width: 22px; flex: 0 0 22px; text-align: center; font-size: 16px; line-height: 1.4; }
.task .grow { min-width: 0; }
.task .title a { color: inherit; }
.task.urgent .title { color: var(--red-text); }
.task.closed .title { text-decoration: line-through; color: var(--muted); }
.task-meta { margin-top: 3px; }
.task-meta .late { color: var(--red-text); font-weight: 600; }
.task-hist { margin-top: 4px; }
.task-hist ol { margin: 4px 0 0; padding-left: 20px; }
.task-actions { flex: 0 0 auto; }
@media (max-width: 560px) {
  .tasks > li.task { flex-wrap: wrap; }
  .tasks > li.task .task-actions { width: 100%; padding-left: 32px; }
}
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; }
.checks-pick { border: 0; padding: 0; margin: 0 0 14px; }

/* Workout feedback by client (public/js/admin-feedback.js) */
.fb-clients li.pain { border-left: 3px solid var(--red); padding-left: 10px; }
.fb-clients .fb-why { color: var(--red-text); }
.fb-latest { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fb-filters { margin: 0 0 10px; }
/* What the client said (default, with "Pick what to show") or the full daily log. */
.fb-show { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.fb-pick { position: relative; }
.fb-pick > summary { list-style: none; }
.fb-pick > summary::-webkit-details-marker { display: none; }
.fb-pick > summary::after { content: ''; width: 6px; height: 6px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.fb-pick .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 5px; border-radius: 99px; background: var(--red-text); color: #fff; font-size: 12.5px; }
.fb-pick-menu { position: absolute; z-index: 30; left: 0; top: calc(100% + 6px); min-width: 230px; display: grid; gap: 6px; padding: 10px; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-m); box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.fb-pick-menu .check { margin: 0; }
.fb-pick-menu .link { justify-self: start; margin-top: 2px; }
@media (max-width: 720px) { .fb-pick { flex-basis: 100%; } .fb-pick-menu { position: static; margin-top: 8px; box-shadow: none; background: var(--surface); } }
.fb-dates { gap: 10px; align-items: flex-end; margin-top: 8px; }
.fb-dates input[type=date] { display: block; margin-top: 2px; width: 100%; min-width: 0; }
@media (max-width: 560px) {
  .fb-dates { display: grid; grid-template-columns: 1fr 1fr; }
  .fb-dates > label:nth-child(n+3) { grid-column: 1 / -1; }
  .fb-dates select { width: 100%; }
}
.fb-day h3 { font-size: 16px; margin: 16px 0 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.fb-items li { gap: 10px; align-items: flex-start; }
.fb-items li.pain { background: var(--red-tint); }
.fb-items li.unseen { font-weight: 600; }
.fb-items li.low .grow { color: var(--warn); }
.fb-time { width: 64px; flex: 0 0 64px; padding-top: 1px; }
.fb-attn ul { margin: 4px 0; padding-left: 18px; }

/* Trainer workout card: move up / down on the name line, out of the action row. */
.ex-title-row { display: flex; align-items: flex-start; gap: 8px; }
.ex-title-row .ex-name { flex: 1; min-width: 0; }
.ex-move { flex: none; display: inline-flex; gap: 4px; margin-top: -2px; }
.ex-arrow { width: 34px; height: 30px; border: 1px solid var(--line, #d9dcdb); border-radius: 8px; background: transparent; color: var(--ink, #1d2321); font: 700 16px/1 var(--display, inherit); cursor: pointer; padding: 0; }
.ex-arrow:hover:not(:disabled) { border-color: var(--ink, #1d2321); }
.ex-arrow:disabled { opacity: .3; cursor: default; }

/* Plan page: where the client is right now. The "Now" panel at the top, the phase they're in, this week and today. */
.now-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin: 14px 0 6px; padding: 14px 18px;
  background: var(--go-tint); border: 2px solid var(--go); border-radius: var(--radius-m); }
.now-panel.is-off { background: var(--white); border-color: var(--line); }
.now-eyebrow { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--go); }
.now-panel.is-off .now-eyebrow { color: var(--muted); }
.now-where { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.now-where .now-eyebrow { flex-basis: 100%; }
.now-week { font: 700 26px/1.1 var(--display); }
.now-of { font-size: 16px; font-weight: 600; color: var(--muted); }
.now-phase { color: #fff; font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 99px; background: #57606a; }
.now-today { flex: 1 1 260px; min-width: 0; }
.now-session { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 4px; }
.now-session strong { font-size: 17px; }
.now-panel [data-jump-today] { margin-left: auto; }

.phase-bar { position: relative; }
.phase-bar.has-now { overflow: visible; margin-top: 30px; }
.phase-bar.has-now .ph { opacity: .45; }
.phase-bar.has-now .ph.is-now { opacity: 1; box-shadow: inset 0 0 0 3px rgba(255,255,255,.85); }
.phase-bar.has-now .ph:hover { opacity: 1; }
.phase-now { position: absolute; top: -26px; bottom: -4px; width: 0; border-left: 3px solid var(--ink); z-index: 2; pointer-events: none; }
.phase-now > span { position: absolute; top: 0; left: -3px; transform: translateX(-50%); white-space: nowrap; font-size: 11.5px; font-weight: 700;
  color: #fff; background: var(--ink); padding: 2px 7px; border-radius: 99px; }

.week.current { box-shadow: 0 0 0 3px var(--go); background: color-mix(in srgb, var(--go) 4%, var(--white)); }
.week.current .week-head h2 { color: var(--go); }
.this-week-badge { display: inline-block; vertical-align: middle; font: 700 12px/1 var(--body); letter-spacing: .05em; text-transform: uppercase;
  color: #fff; background: var(--go); padding: 5px 9px; border-radius: 99px; margin-right: 4px; }
.week.past { opacity: .62; }
.week.past:hover, .week.past:focus-within { opacity: 1; }
.sessions li.past-day { opacity: .6; }

.sessions li.is-today { background: color-mix(in srgb, var(--go) 16%, var(--white)); box-shadow: inset 6px 0 0 var(--go), 0 0 0 2px var(--go);
  border-radius: 8px; scroll-margin: 90px 0; }
.sessions li.is-today .today-tag { display: inline-block; margin-top: 3px; color: #fff; background: var(--go); padding: 2px 7px; border-radius: 99px; }
.sessions li.flash { animation: today-flash 1.4s ease-out; }
@keyframes today-flash { 0% { box-shadow: inset 6px 0 0 var(--go), 0 0 0 7px color-mix(in srgb, var(--go) 45%, transparent); } 100% { box-shadow: inset 6px 0 0 var(--go), 0 0 0 2px var(--go); } }

.jump-today { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 40; border: 0; cursor: pointer;
  background: var(--go); color: #fff; font: 700 15px var(--body); padding: 11px 18px; border-radius: 99px; box-shadow: var(--shadow); }
.jump-today[hidden] { display: none; }
@media (max-width: 720px) {
  .jump-today { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .now-week { font-size: 22px; }
  .now-panel [data-jump-today] { margin-left: 0; }
  .phase-now { display: none; }
  .phase-bar.has-now { margin-top: 14px; }
}
@media (prefers-reduced-motion: reduce) { .sessions li.flash { animation: none; } }
@media print { .week.past, .sessions li.past-day, .phase-bar.has-now .ph { opacity: 1; } .phase-now, .jump-today { display: none; } }

/* Plan page: the event is over. What was trained, the result (entered by hand), and the next goal. */
.done-panel { border-color: var(--ink); background: var(--white); align-items: flex-start; }
.done-panel .now-eyebrow { color: var(--ink); }
.done-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.done-stat { display: flex; flex-direction: column; }
.done-stat strong { font: 700 22px/1.1 var(--display); }
.done-stat span { font-size: 12px; color: var(--muted); }
.done-result { flex: 1 1 280px; min-width: 0; }
.done-result-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: 4px; }
.done-time { font: 700 20px/1.1 var(--display); }
.done-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; align-self: center; }
@media (max-width: 720px) { .done-actions { margin-left: 0; } }

/* A finished plan's schedule, folded away under the completed panel. */
.plan-history { margin-top: 14px; }
.plan-history > summary { cursor: pointer; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); list-style: revert; }
.plan-history > summary .muted { font-size: 13px; }
.plan-history[open] > summary { margin-bottom: 14px; }

/* In-workout timers (public/js/timers.js) on the trainer's workout board: the same bar as the member app, fixed to
   the bottom, above the tab bar on phones (roadmap 7d). */
.timer-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 55;
  max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--ink, #1c1f23); color: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.timer-bar[hidden] { display: none; }
.timer-bar[data-kind="work"] { background: var(--red-text); }
.timer-bar[data-kind="wait"] { background: var(--go); }
.timer-bar .tb-main { flex: 1 1 140px; min-width: 0; }
.timer-bar .tb-label { font-size: 13px; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-bar .tb-time { font: 700 40px/1 var(--display); font-variant-numeric: tabular-nums; }
.timer-bar .tb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.timer-bar .btn { min-height: 44px; }
.timer-bar .btn.secondary, .timer-bar .btn.ghost { background: rgba(255,255,255,.14); color: #fff; border-color: transparent; }
body.has-timer main { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.ex-timer { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.ex-timer .auto-next { display: inline-flex; gap: 6px; align-items: center; min-height: 44px; }
@media (max-width: 720px) { .timer-bar { bottom: calc(78px + env(safe-area-inset-bottom)); } }

/* Metcon timer and result under the block heading (roadmap 7e). */
.metcon-result { color: var(--go); font-weight: 600; margin: 6px 0 0; }
.metcon-timer { margin-top: 8px; }
.metcon-tools { align-items: center; margin: 4px 0 8px; }

/* Session clock (roadmap 7f): a compact time in the top bar, left of Sign out, while a session's clock runs; its
   controls sit under the workout's title. */
.session-clock { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 10px; margin-right: 8px; border-radius: 99px;
  background: var(--go); color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; text-decoration: none; white-space: nowrap; }
.session-clock[hidden] { display: none; }
.session-clock.paused { background: rgba(255,255,255,.18); }
.clock-panel { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 4px; }
.clock-panel .clock-now { font-size: 18px; font-variant-numeric: tabular-nums; margin-right: 4px; }
/* During a running session the clock takes the place of "Install app", so the tabs keep their room. */
body:has(.session-clock:not([hidden])) #get-app { display: none; }
@media (max-width: 720px) { body:has(.session-clock:not([hidden])) .brand-sub { display: none; } }

/* Compact exercise card (trainer board): logging up front, the rest behind "More"; the ⠿ handle reorders. */
.ex-card .ex-head { align-items: flex-start; }
.ex-card .ex-head .grow { min-width: 0; }
.ex-title-row .rungs { margin: 6px 0 0 0; flex: none; }
.ex-state { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ex-state .btn { min-height: 40px; }
.ex-grip { flex: none; width: 28px; height: 40px; margin: -6px -4px 0 -8px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted, #6b7178); font: 20px/1 system-ui, sans-serif; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ex-grip:hover, .ex-grip:focus-visible { color: var(--ink, #1d2321); background: rgba(0, 0, 0, .05); }
.ex-card.dragging { position: relative; z-index: 5; box-shadow: 0 10px 28px rgba(0, 0, 0, .18); opacity: .97; transition: none; }
.ex-card.dragging .ex-grip { cursor: grabbing; }
body:has(.ex-card.dragging) { user-select: none; -webkit-user-select: none; }
.ex-card .ex-fields { margin: 8px 0 2px; }
.ex-card .ex-timer { margin: 6px 0 0; }
.ex-more { margin-top: 6px; border-top: 1px solid var(--line, #e3e5e8); }
.ex-more > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; }
.ex-more > summary::-webkit-details-marker { display: none; }
.ex-more > summary::before { content: '▸'; font-size: 13px; color: var(--muted, #6b7178); transition: transform .15s; }
.ex-more[open] > summary::before { transform: rotate(90deg); }
.ex-more-lbl { font-weight: 600; font-size: 14.5px; }
.ex-more[open] .ex-more-what { display: none; }
.ex-more > summary .tag { font-size: 12px; }
.ex-more-body { display: grid; gap: 6px; padding-bottom: 4px; }
.ex-more-body .ex-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ex-more-body .ex-actions { margin-top: 2px; }
@media (max-width: 600px) { .ex-state .btn { padding-left: 10px; padding-right: 10px; } }
.ex-card .ex-title-row { display: block; }
.ex-card .ex-title-row .rungs { margin: 0 0 0 6px; }
.ex-card .ex-dose { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.ex-card .ex-dose .dose-edit input { width: auto; max-width: 100%; }
.ex-card .ex-rest { font-size: 13.5px; color: var(--muted, #6b7178); }
.ex-card .ex-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); gap: 8px; }
.ex-card .ex-fields .exf input, .ex-card .ex-fields .exf-load input { width: 100%; }
.ex-card .ex-fields .ex-saved { grid-column: 1 / -1; }
.ex-card .ex-fields .ex-saved:empty { display: none; }

/* Workout board drawers: how they feel today (1–5) and the session outline, one line each when closed. */
.panel.drawer { padding-top: 0; padding-bottom: 0; }
.drawer > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 52px; cursor: pointer; }
.drawer > summary::-webkit-details-marker { display: none; }
.drawer > summary::before { content: '▸'; font-size: 13px; color: var(--muted, #6b7178); transition: transform .15s; }
.drawer[open] > summary::before { transform: rotate(90deg); }
.drawer[open] { padding-bottom: 14px; }
.drawer-title { font: 700 16px var(--display, inherit); }
.rd-now { font-size: 18px; font-weight: 700; }
.rd-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rd-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; padding: 6px 0; border: 1.5px solid var(--line, #d9dcdb); border-radius: 12px; background: transparent; cursor: pointer; font: inherit; color: var(--ink, #1d2321); }
.rd-btn .rd-icon { font-size: 26px; line-height: 1.1; }
.rd-btn .rd-n { font: 700 14px var(--display, inherit); color: var(--muted, #6b7178); }
.rd-btn[aria-pressed="true"] { border-color: var(--ink, #1d2321); background: rgba(0, 0, 0, .06); }
.rd-btn[aria-pressed="true"] .rd-n { color: var(--ink, #1d2321); }
.rd-legend { display: flex; justify-content: space-between; margin: 4px 2px 0; }
.drawer .loc-panel { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line, #e3e5e8); }

/* Workout board header: title left, session clock icon right; one action bar with a ⋯ menu. */
.wk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.wk-title { min-width: 0; }
.wk-title h1 { margin: 0 0 2px; line-height: 1.05; }
.wk-title p { margin: 0; font-size: 15px; }
.clock-panel.compact { flex: none; margin: 4px 0 0; gap: 4px; flex-wrap: nowrap; padding: 2px; border-radius: 999px; }
.clock-panel.compact:not(:has([data-clock="start"])) { border: 1.5px solid var(--line, #d9dcdb); padding: 2px 2px 2px 12px; background: var(--white, #fff); }
.clock-panel.compact.paused { opacity: .75; }
.clock-panel.compact .clock-now { font-size: 15px; margin: 0 2px 0 0; white-space: nowrap; }
.clock-ico { width: 40px; height: 40px; border-radius: 999px; border: 1.5px solid var(--line, #d9dcdb); background: var(--white, #fff); color: var(--ink, #1d2321); font-size: 18px; line-height: 1; display: grid; place-items: center; cursor: pointer; padding: 0; }
.clock-panel.compact:not(:has([data-clock="start"])) .clock-ico { width: 34px; height: 34px; border: 0; font-size: 15px; background: rgba(0, 0, 0, .05); }
.clock-ico:hover { border-color: var(--ink, #1d2321); }
.wk-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; position: relative; }
.wk-finish, .wk-btn, .wk-menu > summary { min-height: 44px; border-radius: 999px; font: 600 15px var(--body, inherit); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.wk-finish { padding: 0 18px; border: 0; background: var(--go, #1f7a4d); color: #fff; }
.wk-finish.done { background: var(--go-tint, #e7f4ec); color: var(--go, #1f7a4d); border: 1.5px solid #b7dfc8; }
.wk-finish.skipped { background: transparent; color: var(--muted, #6b7178); border: 1.5px solid var(--line, #d9dcdb); }
.wk-btn { padding: 0 16px; border: 1.5px solid var(--line, #d9dcdb); background: var(--white, #fff); color: var(--ink, #1d2321); }
.wk-btn:hover, .wk-menu > summary:hover { border-color: var(--ink, #1d2321); }
.wk-menu { margin-left: auto; position: relative; }
.wk-menu > summary { list-style: none; width: 44px; border: 1.5px solid var(--line, #d9dcdb); background: var(--white, #fff); font-size: 20px; letter-spacing: 1px; }
.wk-menu > summary::-webkit-details-marker { display: none; }
.wk-menu[open] > summary { border-color: var(--ink, #1d2321); }
.wk-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px; padding: 6px; display: grid; background: var(--white, #fff); border: 1px solid var(--line, #e3e5e8); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .16); }
.wk-menu-list > * { display: block; text-align: left; padding: 12px 14px; min-height: 44px; border: 0; border-radius: 10px; background: transparent; font: 500 15px var(--body, inherit); color: var(--ink, #1d2321); text-decoration: none; cursor: pointer; }
.wk-menu-list > *:hover, .wk-menu-list > *:focus-visible { background: rgba(0, 0, 0, .05); }
.wk-menu-list > .danger { color: var(--red-text, #b4232f); border-top: 1px solid var(--line, #e3e5e8); border-radius: 0 0 10px 10px; margin-top: 4px; }
.ex-card .ex-head .grow { flex: 1; }
.ex-card .ex-fields { grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); max-width: 520px; }
.ex-card .ex-dose .dose-edit { min-width: 0; max-width: 100%; }
.ex-card .ex-dose .dose-edit input { min-width: 0; max-width: 100%; flex: 1 1 auto; }
.ex-card, .ex-card .ex-head { min-width: 0; max-width: 100%; }
.role-block > .panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.role-block > .panel-head .ex-role { white-space: nowrap; margin: 0; }
.role-block > .panel-head .row-actions { margin-left: auto; flex-wrap: wrap; gap: 6px; }
.role-block > .panel-head .row-actions .btn { white-space: nowrap; }
@media (max-width: 600px) { .role-block > .panel-head .ex-role { font-size: 18px; } .role-block > .panel-head .row-actions .btn { padding-left: 10px; padding-right: 10px; } }
.ex-card > .ex-dose { margin: 6px 0 0; }

/* Never wider than the screen: a wide child would widen the whole page on a phone. */
.ex-card .ex-head, .role-block > .panel-head { min-width: 0; }

/* Card actions at the top of "More": Easier · Harder · ✓ Done · + Add, then Swap · Couldn't do · Remove · 👍 👎. */
.ex-more-body .ex-actions { display: grid; gap: 6px; margin: 0 0 4px; }
.ex-act-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.ex-act-row .btn { min-height: 44px; padding-left: 4px; padding-right: 4px; white-space: nowrap; width: 100%; justify-content: center; }
.ex-act-row .ex-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ex-state .tag { white-space: nowrap; }

/* Compact list on a phone (trainer feedback): tighter cards so more exercises fit on the screen. */
.role-block.panel { padding: 12px; margin: 10px 0; }
.role-block > .panel-head { margin-bottom: 6px; }
.role-block > p.small { margin-bottom: 6px; }
.role-block .ex-list { gap: 6px; }
.ex-card { padding: 8px 10px 4px; }
.ex-card .ex-head { gap: 8px; align-items: center; }
.ex-card .ex-num { width: 22px; height: 22px; font-size: 12.5px; }
.ex-card .ex-name { font-size: 16px; line-height: 1.2; }
.ex-grip { height: 32px; margin: 0 -4px 0 -6px; }
.ex-card > .ex-dose { margin: 2px 0 0; }
.ex-card .ex-dose .dose-lbl { font-size: 11px; }
.ex-card .ex-dose .dose-edit input { font-size: 15px; padding: 1px 4px; }
.ex-card .ex-rest { font-size: 12.5px; }
.ex-card .ex-fields { margin: 6px 0 0; gap: 6px; }
.ex-card .ex-fields .exf { font-size: 11px; gap: 1px; }
.ex-card .ex-fields .exf input { min-height: 36px; padding: 4px 8px; font-size: 15px; }
.ex-card .ex-timer { margin: 6px 0 0; }
.ex-card .ex-timer .btn { min-height: 36px; }
.ex-more { margin-top: 6px; }
.ex-more > summary { min-height: 36px; }
.ex-more-lbl { font-size: 14px; }
.ex-act-row .btn { min-height: 40px; }
.ex-act-row .btn.danger-text { color: var(--red-text, #b4232f); }
.ex-act-row .btn[aria-pressed="true"] { border-color: var(--ink, #1d2321); background: rgba(0, 0, 0, .06); }
.ex-card .ex-dose .dose-edit input { min-height: 0; height: 28px; line-height: 26px; }
.ex-card .ex-dose { min-height: 28px; }

/* Repeating sessions preview (public/js/admin-repeat.js) */
.repeat-preview .repeat-dates { max-height: 46vh; overflow-y: auto; margin: 8px 0; }
.repeat-preview .repeat-dates li { padding: 6px 0; }
.repeat-preview .repeat-dates li.blocked { opacity: .6; }

/* Repeating sessions: Yes / No on one line, the person search and who's picked. */
.yn-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 10px 0 6px; }
.yn-line .chip { min-height: 34px; padding: 0 16px; }
.yn-line.small .chip { min-height: 30px; padding: 0 12px; font-size: 14px; }
.rp-q { width: 100%; }
.rp-hits { margin: 6px 0 0; max-height: 320px; overflow-y: auto; }
.rp-hits li { display: flex; align-items: center; gap: 8px; }
.rp-person { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.rp-chips { margin: 4px 0; }

/* One-day workout dialog (admin.js dayWorkoutDialog): sport, level and time, then one session to pick. */
.day-dlg { max-height: calc(100dvh - 32px); }
.day-dlg .dlg { max-width: 560px; }
.day-dlg .dlg-actions { position: sticky; bottom: 0; background: var(--white); padding-top: 10px; margin-top: 4px; }
.day-dlg .field > span { display: block; font-weight: 600; margin-bottom: 6px; }
.day-dlg .field { margin-bottom: 14px; }
.day-dlg .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.day-opts { display: grid; gap: 8px; max-height: min(34vh, 320px); overflow-y: auto; padding: 2px; }
.day-opt { display: grid; gap: 2px; text-align: left; font: inherit; cursor: pointer; background: var(--white); color: var(--ink);
  border: 1.5px solid #d5d9de; border-left: 5px solid var(--k, #6b7178); border-radius: 10px; padding: 10px 12px; }
.day-opt:hover { border-color: var(--ink); border-left-color: var(--k, #6b7178); }
.day-opt[aria-checked=true] { background: #f3f6fa; border-color: var(--ink); border-left-color: var(--k, #6b7178); box-shadow: 0 0 0 2px var(--ink) inset; }
.day-opt-kind { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--k, #6b7178); }
.day-opt .small { color: #4b5157; }
.day-today { background: #fff6e5; border-radius: 8px; padding: 8px 10px; }

/* Settings › Sales tax: the taxable offers */
#tax-panel .checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 16px; }
#tax-panel .checks .check { margin: 4px 0; }

/* Calendar ‹ and › were 31 px wide: at least 36 px (October 22 review). */
.day-toolbar .btn.small[aria-label] { min-width: 36px; justify-content: center; }

/* Home equipment: the less common items, folded. */
.more-equip { margin-top: 6px; }
.more-equip > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }

/* ---------- Today as a dashboard ---------- */
.today-group + .today-group { margin-top: 14px; }
.today-group h3 { font: 700 13px var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 2px; }
#tg-late h3 { color: var(--warn); }
#tg-now h3 { color: #1a7650; }
#tg-late .list li { background: var(--warn-tint); border-radius: 10px; padding-inline: 8px; }
.today-earlier { border-top: 1px solid #e5e7ea; padding-top: 8px; margin-top: 14px; }
.today-earlier > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.today-earlier > summary::before { content: '▸'; color: var(--muted); }
.today-earlier[open] > summary::before { content: '▾'; }
.today-earlier > summary h3 { margin: 0; }
.today-earlier .list li { opacity: .85; }
.today-needs h2 { margin-bottom: 6px; }
.needs { list-style: none; margin: 0; padding: 0; }
.needs li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0 10px 12px; border-left: 3px solid #c9cdd2; }
.needs li + li { margin-top: 6px; }
.needs li.urgent { border-left-color: var(--warn); }
.needs a { color: inherit; }
.fold-more > summary { cursor: pointer; color: var(--red-text); font-size: 14px; padding: 6px 0; }
.today-links { color: var(--muted); margin-top: 10px; }
.task-line .grow { min-width: 0; }
.task-line .title a { overflow-wrap: anywhere; }

/* ---------- Calendar: ‹ Today › stay together; the Agenda list ---------- */
.day-nav { display: inline-flex; gap: 6px; }
@media (max-width: 720px) {
  .day-toolbar { flex-wrap: wrap; }
  .day-toolbar h1 { flex: 1 1 100%; font-size: 26px; }
}
.agenda-days { display: grid; gap: 12px; }
.ag-day { margin: 0; }
.ag-day.is-today { box-shadow: inset 4px 0 0 var(--red-text); }
.ag-day h2 { font-size: 20px; }
.ag-day h2 a { color: inherit; text-decoration: none; }
.ag-list li { padding: 0; }
.ag-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 4px; background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; min-height: 52px; border-radius: 8px; }
.ag-row:hover, .ag-row:focus-visible { background: #f3f4f6; }
.ag-row.past { opacity: .6; }
.ag-time { display: flex; flex-direction: column; width: 72px; flex: none; font: 600 16px var(--display); }
.ag-who { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ag-who .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* Gift cards (public/js/admin-gifts.js) */
.gc-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.04em; }
.gc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gc-filters { gap: 8px; flex-wrap: wrap; }
.gc-filters input[type="search"] { flex: 1 1 200px; }
.gc-find { margin: 4px 0 8px; }
.gc-or { margin: 6px 0 2px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.inline-form label { flex: 1 1 180px; }
.credit-line { font-size: 20px; margin: 0; }
/* Gift card credit, inside the client's Payments panel */
.credit-block { background: var(--surface); border-radius: var(--radius-s); padding: 10px 12px; margin: 0 0 12px; }
.credit-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.credit-label { font-weight: 600; }
.credit-head .btn { margin-left: auto; }
.credit-block .list li { background: none; }
.credit-more > summary { cursor: pointer; color: var(--red-text); font-size: 14.5px; margin-top: 6px; }
.credit-more[open] > summary { margin-bottom: 4px; }
/* Sections on a record that open with an arrow (client record: family, waiver, archive, erase). */
details.fold { border-top: 1px solid var(--line); margin-top: 14px; }
details.fold + details.fold { margin-top: 0; }
details.fold > summary { list-style: none; display: flex; align-items: baseline; gap: 10px; padding: 12px 0; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after, details.fold-panel > summary::after { content: ''; flex: none; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-3px) rotate(45deg); transition: transform .15s; align-self: center; }
details.fold[open] > summary::after, details.fold-panel[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
details.fold > summary:hover .fold-title { color: var(--red-text); }
.fold-title { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--ink); }
.fold-meta { color: var(--muted); font-size: 14.5px; }
details.fold > .fold-body { padding: 0 0 12px; }
details.fold.danger .fold-title { color: var(--red-text); }
#archive-panel h2 + details.fold { margin-top: 4px; }
/* A whole panel that opens with an arrow (client record: Workout feedback). */
details.fold-panel > summary { list-style: none; display: flex; align-items: baseline; gap: 10px; cursor: pointer; }
details.fold-panel > summary::-webkit-details-marker { display: none; }
details.fold-panel > summary h2 { margin: 0; }
details.fold-panel[open] > summary { margin-bottom: 10px; }
.gc-filters { display: flex; align-items: center; }
.gc-filters select { width: auto; flex: 0 0 auto; }
.gc-filters input[type="search"] { max-width: 360px; }

/* Marketing › Follow-ups and Announcements (public/js/admin-outreach.js) */
.fu-rules { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); margin-bottom: 14px; }
.fu-rules .panel { margin: 0; }
.fu-rule { border-left: 4px solid var(--line, #e3e5e8); }
.fu-rule.is-on { border-left-color: var(--go, #2e9e5b); }
.fu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fu-head .switch { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.fu-head .switch input { width: 20px; height: 20px; }
.fu-days { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.fu-days input { width: 5em; }
.fu-edit { margin-top: 6px; }
.fu-edit label { display: block; margin-top: 8px; }
.fu-edit textarea, .fu-edit input:not([type=checkbox]) { width: 100%; }
.an-aud { display: grid; gap: 6px; }
.an-body { white-space: pre-wrap; font: inherit; margin: 6px 0 0; }
.red-text { color: var(--red-text, #b3141f); }
@media (max-width: 640px) { .fu-rules { grid-template-columns: 1fr; } }
.fu-rules { align-items: start; }
.an-aud .check { padding-top: 8px; padding-bottom: 8px; }

/* Messages (public/js/admin-messages.js) */
.msg-layout { display: grid; gap: 14px; }
@media (min-width: 900px) { .msg-layout { grid-template-columns: minmax(280px, 360px) 1fr; align-items: start; } }
.msg-threads.hide { display: none; }
.msg-threads .toolbar { gap: 8px; }
.msg-threads input[type=search] { flex: 1; min-width: 0; }
.thread-list li { align-items: flex-start; }
.thread-list li.on { background: #f1f2f4; border-radius: 8px; }
.thread-list a { color: inherit; text-decoration: none; min-width: 0; }
.thread-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-thread { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m, 12px); padding: 14px; min-height: 200px; }
.msg-thread:empty { display: none; }
.msg-head { display: flex; align-items: center; gap: 10px; }
.msg-head h2 { margin: 0; }
.msg-list { list-style: none; margin: 8px 0; padding: 4px 2px; display: flex; flex-direction: column; gap: 10px; max-height: min(62vh, 620px); overflow-y: auto; }
.msg { max-width: 82%; }
.msg.mine { align-self: flex-end; text-align: right; }
.msg-meta { font-size: 12px; color: var(--muted, #6b7280); margin-bottom: 2px; }
.msg-body { display: inline-block; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; padding: 9px 12px; border-radius: 14px; background: #f1f2f4; line-height: 1.4; }
.msg.mine .msg-body { background: var(--ink, #1d2025); color: #fff; }
.msg-form { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 10px; }
.msg-form textarea { flex: 1; min-height: 44px; resize: vertical; }

/* Group chats (public/js/admin-messages.js) */
.msg-head { flex-wrap: wrap; }
.msg-head h2 { flex: 1; min-width: 0; overflow-wrap: break-word; }
.msg-head.stack { justify-content: space-between; }
.msg-head.stack h2 { order: 3; flex: 1 1 100%; }
.msg-body.removed { background: none; border: 1px dashed #c9cdd2; color: var(--muted, #6b7280); font-style: italic; }
.msg.mine .msg-body.removed { background: none; color: var(--muted, #6b7280); }
.msg-meta .link.small { font-size: 12px; }
/* Wide-screen top bar with Messages added: tighter tabs, and the "Studio admin" label only when there's room. */
.tabs a[href="#messages"] { position: relative; }
@media (min-width: 721px) and (max-width: 1440px) {
  .tabs a { padding: 8px 9px; font-size: 15px; }
  .admin .brand-sub { display: none; }
}
@media (min-width: 721px) and (max-width: 1180px) {
  .tabs a { padding: 8px 7px; font-size: 14px; }
  .admin #get-app { display: none; }
}

/* Training plan: weeks other than this week and next fold to their heading (public/js/admin-fitness.js) */
.weeks-tools { display: flex; justify-content: flex-end; margin: 0 0 6px; }
.week-head { position: relative; }
.week-toggle { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; margin-right: 4px; }
.week-toggle::before { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.15s; }
.week-toggle[aria-expanded="false"]::before { transform: rotate(-45deg); }
.week.folded > :not(.week-head) { display: none; }
.week.folded { padding-top: 10px; padding-bottom: 10px; }
.week.folded .week-head h2 { cursor: pointer; }
.week.folded .week-head select, .week.folded .week-head [data-week-edit] { display: none; }
@media print { .week.folded > * { display: revert; } }

/* Settings in sections (public/js/admin-settings.js sectionize) */
.settings-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 14px; }
.settings-nav .subtabs { margin: 0; flex: 1 1 auto; overflow-x: auto; }
.settings-nav input[type=search] { flex: 0 1 240px; min-width: 0; }
@media (max-width: 720px) { .settings-nav input[type=search] { flex: 1 1 100%; } }
@media (max-width: 720px) { .settings-nav .subtabs { flex-wrap: wrap; overflow: visible; } .settings-nav .subtabs a { padding-left: 10px; padding-right: 10px; } }

/* Staff 2-step sign-in (public/js/admin-twostep.js) */
.ts-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.ts-qr { width: 200px; max-width: 70vw; margin: 12px 0 6px; background: #fff; }
.ts-qr svg { width: 100%; height: auto; display: block; }
.ts-key { font-size: 15px; letter-spacing: 0.06em; word-break: break-all; }
.ts-backup { columns: 2; font-size: 16px; margin: 10px 0 16px; }
.ts-backup code { letter-spacing: 0.05em; }

/* Marketing › Website, reviews & referrals (public/js/admin-grow.js) */
.embed-preview { padding: 14px; border: 1px dashed var(--line); border-radius: 10px; margin: 8px 0 12px; background: #fff; }
.embed-code { margin-bottom: 12px; }
.embed-code h3 { margin: 0; font-size: 15px; }
.embed-code textarea { width: 100%; font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
#reviews-panel label input { width: 100%; }

/* Needs (Assessment & plan tab) */
.needs-panel h3 { margin: 14px 0 4px; font-size: 15px; }
.needs-panel .pain-area { margin-bottom: 10px; }
.needs-panel .pain-area p { margin: 6px 0; }
.needs-panel .pain-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.needs-panel .plain .tag { margin-left: 4px; }

/* Paying in parts, shared bills, Owed */
.split-box { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line, #e3e5e2); border-radius: 8px; background: #fafbfa; }
.split-box .parts { list-style: none; margin: 6px 0; padding: 0; }
.split-box .parts li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 5px 0; border-top: 1px solid var(--line, #eceeeb); font-size: 14px; }
.split-box .parts li:first-child { border-top: 0; }
.split-box .parts li.late .grow { color: var(--red, #b42318); }
.split-dlg { max-width: 640px; }
.split-dlg .seg { display: flex; gap: 6px; margin: 4px 0 12px; }
.split-dlg .seg-btn { flex: 1; padding: 8px 10px; border: 1px solid var(--line, #d6d9d4); border-radius: 8px; background: #fff; font: inherit; cursor: pointer; }
.split-dlg .seg-btn.on { border-color: var(--ink, #1a1a1a); background: var(--ink, #1a1a1a); color: #fff; }
.split-dlg .row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; }
.split-dlg .amt-in { width: 7em; text-align: right; }
.split-dlg .payer-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1fr) auto; gap: 0 8px; align-items: end; }
.split-dlg .payer-row:has(.payer-self) { grid-template-columns: minmax(0, 2.6fr) minmax(0, .8fr) minmax(0, 1fr) auto; }
.split-dlg .payer-self { padding: 10px 0; font-weight: 600; }
@media (max-width: 560px) { .split-dlg .row3, .split-dlg .payer-row, .split-dlg .payer-row:has(.payer-self) { grid-template-columns: minmax(0, 1fr); } }
.owed-table tr.late td:first-child { box-shadow: inset 3px 0 0 var(--red, #b42318); }
.owed-table .row-actions { white-space: nowrap; }
.two-ways { margin-top: 6px; }
.custom-field > label.check { display: flex; gap: 12px; font-weight: 400; }
.wh-panel .chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.wh-panel .chip-row .check { margin: 0; padding: 6px 10px; font-size: 14px; }
.wh-panel .cy-add { margin: 10px 0; }
.findings { margin: 4px 0 10px; padding-left: 20px; }
.findings li { margin: 6px 0; line-height: 1.45; }
.cor-panel .resp-table, #in-findings + section .resp-table { margin-top: 8px; }

/* Wins (src/wins.js): what they achieved in a workout, and the list under Your progress */
.wins li { margin: 6px 0; line-height: 1.4; }
.wins-box { border: 1px solid var(--line, #e3e6ea); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.wins-box p { margin: 0 0 2px; }
.wins-dlg .wins { margin: 4px 0 14px; }
.wins { list-style: none; padding-left: 0; }

/* Past sessions and invoices (public/js/admin-invoices.js): one line per session */
dialog:has(.inv-grid) { max-width: min(860px, calc(100% - 24px)); }
.inv-grid { overflow-x: auto; margin: 6px 0 8px; }
.inv-line { display: grid; grid-template-columns: 1.6em 10.5em 8em minmax(7em, 1fr) 6em 6em 5.5em 2.4em 1.6em; gap: 6px; align-items: center; min-width: 680px; padding: 5px 0; border-bottom: 1px solid var(--line, #e3e6e3); }
.inv-line.inv-pay-line { grid-template-columns: 2.4em 9em 6em minmax(7em, 1fr) 8em; min-width: 420px; }
.inv-grid:not(.paying) .pay-col { visibility: hidden; }
.pay-col { text-align: center; }
.inv-pay-row { display: flex; gap: 10px; flex-wrap: wrap; }
.inv-pay-row .field { min-width: 9em; }
.inv-pay-row .grow { flex: 1; }
.inv-pay-box { border-left: 3px solid var(--line, #e3e6e3); padding-left: 10px; margin-top: 6px; }
.inv-grid.no-price .inv-line > :nth-child(5), .inv-grid.no-price .inv-line > :nth-child(6), .inv-grid.no-price .inv-line > :nth-child(7) { visibility: hidden; }
.inv-head { font-size: 12px; font-weight: 600; color: var(--muted, #6b7075); text-transform: uppercase; letter-spacing: .03em; border-bottom: 1.5px solid var(--line, #e3e6e3); }
.inv-line .num { text-align: right; }
.inv-line input[type=date], .inv-line input[type=time], .inv-line input.money-in, .inv-line select { width: 100%; min-width: 0; min-height: 40px; padding: 6px 8px; font-size: 15px; }
.inv-line input[type=time] { border: 1.5px solid #c9cdd2; border-radius: var(--radius-s); font-family: inherit; color: var(--ink); background: var(--white); }
.inv-line input.money-in { text-align: right; }
.inv-line input[type=checkbox] { width: 18px; height: 18px; }
.inv-due-row { display: flex; gap: 10px; flex-wrap: wrap; }
.inv-due-row .field { min-width: 11em; }
.inv-due-row .grow { flex: 1; }
.inv-send { display: flex; gap: 18px; flex-wrap: wrap; }
.inv-actions { margin-top: 6px; flex-wrap: wrap; }
.inv-history { display: grid; gap: 8px; margin: 8px 0; }
.inv-notice-set { display: grid; gap: 4px; margin-top: 8px; }

/* Sell dialog: product, then discount | value | reason, then amount, then how they're paying. */
.sell-dlg { width: min(640px, 94vw); }
.sell-dlg .field { margin-bottom: 10px; }
.sell-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.sell-row > .field { flex: 1 1 150px; min-width: 0; }
.sell-row > .s-price { flex: 2 1 200px; margin: 0 0 14px; }
.sell-how { border: 0; padding: 0; margin: 4px 0 0; }
.sell-how legend { font-weight: 600; margin-bottom: 6px; }
.sell-how .seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.sell-how .seg-btn { flex: 1 1 auto; padding: 8px 10px; border: 1px solid #c9ccd1; border-radius: 8px; background: #fff; font: inherit; cursor: pointer; min-height: 40px; }
.sell-how .seg-btn.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.pay-qr { display: block; width: 240px; max-width: 70vw; margin: 12px auto; background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.ok-text { color: #15803d; }
.tag.green { background: #e7f6ec; color: #15803d; }
/* "N older payments / receipts": the rest of a long list, folded (moreList). */
.more-list { margin-top: 6px; }
.more-list > summary { cursor: pointer; padding: 10px 0; font-weight: 600; font-size: 14.5px; color: var(--ink-2, #4a5058); list-style: none; display: flex; align-items: center; gap: 6px; }
.more-list > summary::-webkit-details-marker { display: none; }
.more-list > summary::before { content: '▸'; display: inline-block; transition: transform 0.15s; }
.more-list[open] > summary::before { transform: rotate(90deg); }

