:root {
  --ink: #171a1b;
  --muted: #626a6c;
  --teal: #378d93;
  --teal-dark: #247b83;
  --teal-pale: #e4f0f1;
  --cream: #f3f5f4;
  --white: #fff;
  --line: #dce1e0;
  --danger: #d95252;
  --shadow: 0 18px 50px rgba(23, 26, 27, .07);
}

/* v51 display refinements */
.rag-dot.teal { background: #04D9FF; }
.rag-dot.green { background: #5dd916; }
.rag-dot.amber { background: #f0b865; }
.rag-dot.red { background: #d95252; }

.calendar-legend .complete { border-color: #5dd916; }
.calendar-legend .moved { border-color: #f0b865; }
.calendar-legend .missed { border-color: #d95252; }
.calendar-legend .scheduled { border-color: #5de1e2; }
.calendar-event.complete {
  background: #5dd916;
  border-color: #5dd916;
  color: #fff;
}
.calendar-event.moved {
  background: #f0b865;
  border-color: #f0b865;
  color: #fff;
}
.calendar-event.missed {
  background: #d95252;
  border-color: #d95252;
  color: #fff;
}
.calendar-event.scheduled {
  background: #5de1e2;
  border-color: #5de1e2;
  color: #4D4848;
}
.calendar-event-wrap { display: grid; gap: .2rem; }
.calendar-event-actions {
  display: flex;
  gap: .2rem;
  flex-wrap: wrap;
}
.calendar-event-actions .mini-button {
  min-height: 22px;
  padding: .1rem .35rem;
  font-size: 8px;
}

.client-summary-card.gender-female { border-color: #008080; border-left-color: #008080; }
.client-summary-card.gender-male { border-color: #4D4848; border-left-color: #4D4848; }
.client-summary-card .compact-stats {
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
}

.exercise-list-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .45rem .6rem;
}
.exercise-row-actions {
  display: flex;
  gap: .35rem;
  align-items: center;
  flex-wrap: wrap;
}
.exercise-row-actions .mini-button {
  min-height: 26px;
  padding: .18rem .5rem;
}
.exercise-edit-panel {
  margin-top: .65rem;
  padding: .75rem;
  border: 1px solid var(--line);
  background: #fbffff;
}

.progress-measurements-section .responsive-table {
  overflow-x: auto;
}
.progress-measurements-section .responsive-table table {
  width: max-content;
  min-width: 100%;
}
.progress-measurements-section .responsive-table th,
.progress-measurements-section .responsive-table td {
  padding: .18rem .28rem;
  font-size: 10px;
  white-space: nowrap;
}
.progress-measurements-section .measurement-detail-cell {
  max-width: none;
}
.capture-measurements-form {
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.progress-measurements-section form.grid-form {
  grid-template-columns: repeat(auto-fit, minmax(80px, max-content));
  gap: .45rem;
}
.progress-measurements-section input[type="number"] {
  width: 7ch;
  min-width: 7ch;
  max-width: 7ch;
}
.progress-measurements-section .measurement-grid {
  grid-template-columns: repeat(auto-fit, minmax(84px, max-content));
  gap: .35rem;
}

.planned-actual-table th,
.planned-actual-table td {
  padding: .28rem .35rem;
  white-space: nowrap;
}

.calendar-event.goal,
.calendar-legend .goal {
  background: #BC13FE;
  border-color: #BC13FE;
  color: #fff;
}

.calendar-event-panel,
.complex-workout-guide {
  border: 1px solid var(--line);
  background: #fff;
  padding: .75rem;
  margin: .75rem 0;
}

.complex-workout-guide ul {
  margin: .5rem 0 0;
  padding-left: 1.1rem;
}

.workout-type-builder {
  display: block;
}

.workout-builder-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  padding: 1rem;
  background: var(--teal-pale);
  border-left: 3px solid var(--teal);
}

.workout-builder-card h3,
.workout-builder-card p {
  grid-column: 1 / -1;
  margin-bottom: .2rem;
}

.workout-builder-card .time-parts {
  background: var(--white);
}

.workout-builder-card .time-parts legend {
  font-size: .7rem;
}

.workout-exercise-picker {
  background: var(--white);
  border: 1px solid rgba(36, 123, 131, .22);
  padding: .75rem;
}

.workout-exercise-picker legend {
  color: var(--teal-dark);
  font-weight: 700;
}

.workout-exercise-picker p {
  margin: 0 0 .55rem;
}

@media (max-width: 720px) {
  .workout-builder-card {
    grid-template-columns: 1fr;
  }
}

.workout-order-actions {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  align-items: center;
}

.time-parts {
  display: flex;
  align-items: end;
  gap: .3rem;
  padding: .25rem;
  border: 1px solid var(--line);
  background: #fff;
}

.time-parts legend {
  padding: 0 .2rem;
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.time-parts label {
  margin: 0;
  font-size: 9px;
}

.tiny-number,
.time-parts input[type="number"] {
  width: 4ch;
  min-width: 4ch;
  max-width: 48px;
  min-height: 24px;
  padding: .12rem .16rem;
  text-align: left;
}

.previous-load-note {
  margin: .25rem 0 0;
  color: var(--teal-dark);
  font-size: 11px;
}

.exercise-complete-planned {
  margin: .35rem 0;
}

.muscle-chart-card {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: .8rem;
}

.muscle-chart-card .section-heading {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: start;
  margin-bottom: .35rem;
}

.muscle-legend {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.muscle-legend i {
  display: inline-block;
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: #008080;
}

.muscle-chart {
  display: block;
  width: min(100%, 560px);
  height: auto;
  margin: .25rem auto;
  background: #fff;
}

.muscle-chart-image-wrap {
  position: relative;
  width: min(100%, 560px);
  margin: .25rem auto;
  background: #fff;
  overflow: hidden;
}

.muscle-chart-image-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

.muscle-vector-wrap {
  width: min(100%, 560px);
  margin: .25rem auto;
}

.muscle-vector-chart {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.muscle-heatmap-grid {
  width: min(100%, 620px);
  margin: .25rem auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  align-items: start;
}

.muscle-heatmap-panel {
  position: relative;
  margin: 0;
  background: #fff;
}

.muscle-heatmap-base,
.muscle-mask-layer {
  display: block;
  width: 100%;
  height: auto;
}

.muscle-mask-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  filter: saturate(.95) blur(.25px);
  opacity: .92;
  mix-blend-mode: multiply;
}

.heatmap-bg {
  fill: #fff;
}

.heatmap-outline {
  fill: #f7f8f8;
  stroke: #4D4848;
  stroke-width: .65;
  vector-effect: non-scaling-stroke;
}

.heatmap-muscle {
  fill: #4D4848;
  stroke: #f7f8f8;
  stroke-width: .45;
  vector-effect: non-scaling-stroke;
  transition: fill .15s ease;
}

.heatmap-muscle.active {
  fill: #008080;
}

.muscle-heatmap-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.muscle-hotspot {
  fill: rgba(0, 128, 128, .78);
  stroke: rgba(255, 255, 255, .65);
  stroke-width: .35;
  vector-effect: non-scaling-stroke;
}

.muscle-chart .body-base {
  fill: #b8b8b8;
  stroke: #f3f5f4;
  stroke-width: 2;
}

.muscle-chart .muscle {
  fill: #111;
  stroke: #f3f5f4;
  stroke-width: 2;
  transition: fill .15s ease;
}

.muscle-chart .muscle.active {
  fill: #008080;
}

.muscle-summary {
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: 11px;
}

.weekly-muscle-history {
  margin-top: 1rem;
  background: var(--cream);
}

.weekly-muscle-history .muscle-chart-card {
  margin-top: .75rem;
  box-shadow: none;
}

.login-credential-card {
  width: fit-content;
  max-width: 100%;
  margin: .65rem 0;
  padding: .55rem .7rem;
  background: var(--teal-pale);
  border-left: 3px solid var(--teal);
  font-size: 11px;
}

.login-credential-card p {
  margin: .15rem 0;
}

.login-credential-card code {
  font-size: 10px;
  overflow-wrap: anywhere;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font: 400 1rem/1.7 "Poppins", Arial, sans-serif;
}
.loading-state { min-height: 45vh; display: grid; place-items: center; text-align: center; }
.toast { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 50; max-width: 420px; padding: 1rem 1.25rem; color: #fff; background: var(--teal-dark); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }
.nav-logout { min-height: 0; padding: 0; color: var(--ink); background: transparent; border: 0; font-size: .72rem; }
.nav-logout:hover { color: var(--teal-dark); background: transparent; }
.exercise-library-grid { display: grid; gap: 1rem; }
.exercise-library-card { padding: 1rem; display: grid; grid-template-columns: 190px 1fr; gap: 1.5rem; background: var(--teal-pale); border-left: 3px solid var(--teal); }
.exercise-library-card > a { display: block; }
.exercise-library-card > a img { width: 190px; max-height: 250px; display: block; object-fit: cover; object-position: top; background: var(--white); }
@media print { header, .actions, form, button, .toast { display: none !important; } body { background: #fff; } main { width: 100%; padding: 0; } section { break-inside: avoid; border: 0; } }
@media (max-width: 720px) { .exercise-library-card { grid-template-columns: 1fr; } .exercise-library-card > a img { width: 100%; max-height: none; } }
a { color: var(--teal-dark); font-weight: 600; text-decoration: none; }
a:hover { color: var(--ink); }
header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 96px;
  padding: 1rem clamp(1.25rem, 5vw, 4rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--line);
}
.portal-brand { display: flex; align-items: center; gap: 1.1rem; color: var(--ink); }
.portal-brand img { width: clamp(175px, 18vw, 245px); display: block; }
.portal-brand small { padding-left: 1.1rem; color: var(--muted); border-left: 1px solid var(--line); font-size: .68rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(1rem, 2.4vw, 2.2rem); font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
nav a { color: var(--ink); }
nav a:hover { color: var(--teal-dark); }
main { width: min(calc(100% - 2rem), 1240px); margin: 0 auto; padding: clamp(2rem, 5vw, 4.5rem) 0 6rem; }
section { margin-bottom: 1.5rem; padding: clamp(1.5rem, 4vw, 3.25rem); background: var(--white); border: 1px solid var(--line); }
h1, h2, h3 { margin: 0 0 .8rem; font-family: "Poppins", Arial, sans-serif; font-weight: 700; letter-spacing: -.035em; line-height: 1.12; }
h1 { max-width: 900px; font-size: clamp(1.45rem, 2.2vw, 1.9rem); }
h2 { font-size: clamp(1.2rem, 1.7vw, 1.45rem); }
h3 { font-size: 1.12rem; }
p { color: var(--muted); }
.eyebrow { margin: 0 0 1.1rem; color: var(--teal-dark); font-size: .68rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.login-card { max-width: 980px; margin: 3rem auto; padding: 0; display: grid; grid-template-columns: .95fr 1.05fr; overflow: hidden; border-top: 5px solid var(--teal); box-shadow: var(--shadow); }
.login-image img { width: 100%; height: 100%; min-height: 560px; display: block; object-fit: cover; }
.login-copy { padding: clamp(2rem, 5vw, 4rem); align-self: center; }
.login-consultation { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.registration-panel { margin-top: 1rem; padding: 1rem; background: var(--teal-pale); }
.registration-panel summary { color: var(--teal-dark); font-weight: 700; cursor: pointer; }
.registration-panel form { margin-top: 1rem; }
.password-reset-panel { margin-top: 1rem; padding: .85rem 1rem; background: var(--teal-pale); }
.password-reset-panel summary { color: var(--teal-dark); font-weight: 700; cursor: pointer; }
.password-reset-panel form { margin-top: 1rem; }
.dashboard-tools { display: grid; grid-template-columns: minmax(0, 1fr); }
.dashboard-tools article { max-width: 900px; }
.compact-form { align-items: end; }
.contact-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.exercise-log-row { padding: 1rem 0; border-top: 1px solid var(--line); }
.exercise-log-row h3 { margin: 0 0 .75rem; }
.exercise-record-strip { padding-bottom: .5rem; display: flex; gap: .75rem; overflow-x: auto; }
.exercise-date-record { min-width: 170px; padding: .9rem; display: grid; gap: .4rem; background: var(--teal-pale); border-left: 3px solid var(--teal); }
.exercise-date-record strong, .exercise-date-record span, .exercise-date-record b { display: block; }
.exercise-date-record span { color: var(--muted); font-size: .72rem; }
.exercise-date-record b { margin-top: .15rem; color: var(--ink); font-size: .95rem; }
.exercise-date-record.personal-best { min-width: 210px; color: var(--white); background: var(--ink); border-left-color: var(--teal); }
.exercise-date-record.personal-best span { color: #cfd6d6; }
.exercise-date-record.personal-best b { color: var(--white); }
.print-exercise-layout { margin-top: 1rem; display: grid; grid-template-columns: minmax(180px,230px) minmax(0,1fr); gap: 1.25rem; align-items: start; }
.print-exercise-layout.no-card { grid-template-columns: 1fr; }
.exercise-card-print { margin: 0; padding: .5rem; background: var(--white); border: 1px solid var(--line); }
.exercise-card-print img { width: 100%; max-height: 315px; display: block; object-fit: contain; }
.measurement-group { padding: 1rem; border: 1px solid var(--line); }
.measurement-group legend { padding: 0 .45rem; font-weight: 700; }
.measurement-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
.measurement-grid small { display: block; margin-top: .25rem; color: var(--muted); font-size: .68rem; }
.measurement-details summary { color: var(--teal-dark); cursor: pointer; font-weight: 700; }
.measurement-details > div { min-width: 220px; padding-top: .5rem; display: grid; gap: .4rem; }
.measurement-details span { font-size: .72rem; }
.measurement-details strong { margin-right: .35rem; }
.impact-stats article strong .fatigue-indicator { font-size: .85rem; }
.login-consultation .eyebrow { margin-bottom: .45rem; }
.login-consultation h3 { margin-bottom: .35rem; }
.login-consultation p { margin-top: 0; }
form { display: grid; gap: 1rem; }
form > button { align-self: end; justify-self: start; }
.inline-form { display: inline; margin: 0; }
.grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: grid; gap: .4rem; font-size: .82rem; font-weight: 600; letter-spacing: .02em; }
input, textarea, select { width: 100%; padding: .9rem 1rem; color: var(--ink); background: var(--white); border: 1px solid #cbd3d2; border-radius: 0; font: inherit; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(55,141,147,.12); }
textarea { min-height: 100px; }
button, .button { width: max-content; min-height: 44px; padding: .7rem 1.15rem; display: inline-flex; align-items: center; justify-content: center; color: var(--white); background: var(--teal-dark); border: 1px solid var(--teal-dark); border-radius: 0; font: 600 .7rem "Poppins", Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
button:hover, .button:hover { color: var(--white); background: var(--ink); border-color: var(--ink); }
.button.subtle { color: var(--ink); background: var(--white); border-color: var(--line); }
.button.subtle:hover { color: var(--white); background: var(--ink); }
.danger-button { background: var(--white); color: var(--danger); border-color: #dfbcbc; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.table-actions { display: flex; align-items: center; flex-wrap: nowrap; gap: .45rem; }
.table-actions > a,
.table-actions .text-button {
  min-height: 34px;
  padding: .42rem .72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--teal-dark);
  background: var(--white);
  border: 1px solid var(--teal);
  font: 600 .62rem "Poppins", Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.table-actions > a:hover,
.table-actions .text-button:hover { color: var(--white); background: var(--teal-dark); border-color: var(--teal-dark); }
.text-button { min-height: 0; width: auto; padding: 0; color: var(--teal-dark); background: transparent; border: 0; font: 600 1rem "Poppins", sans-serif; letter-spacing: 0; text-transform: none; }
.text-button.danger { color: var(--danger); border-color: #dfbcbc; }
.text-button.danger:hover { color: var(--white); background: var(--danger); border-color: var(--danger); }
.programme-title-link { color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--teal); }
.protected-action { color: var(--muted); font-size: .78rem; }
.status-badge { display: inline-flex; padding: .3rem .65rem; color: var(--teal-dark); background: var(--teal-pale); font-size: .67rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.status-badge.inactive { color: #775b5b; background: #f4e8e8; }
.status-toggle { display: inline-flex; border: 1px solid var(--teal); }
.status-toggle form { display: inline; }
.status-toggle button { min-height: 32px; padding: .35rem .65rem; color: var(--teal-dark); background: var(--white); border: 0; font-size: .6rem; }
.status-toggle form + form button { border-left: 1px solid var(--teal); }
.status-toggle button.selected { color: var(--white); background: var(--teal-dark); }
.athlete-sort-form { max-width: 720px; margin: 1.5rem 0; padding: 1rem; grid-template-columns: 1fr 1fr auto; align-items: end; background: var(--cream); border-left: 3px solid var(--teal); }
.central-programme-grid { display: grid; gap: 1rem; }
.central-programme-card { padding: 1.35rem; display: grid; grid-template-columns: minmax(0,1fr) minmax(300px,.65fr); gap: 2rem; background: var(--teal-pale); border-left: 3px solid var(--teal); }
.central-programme-card details { align-self: center; padding: 1rem; background: var(--white); }
.athlete-selection { padding: 1rem; border: 1px solid var(--line); }
.athlete-selection legend { padding: 0 .4rem; font-weight: 700; }
.checkbox-grid { margin: .8rem 0 1rem; display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: .55rem; }
.checkbox-grid label { padding: .65rem .75rem; display: flex; align-items: center; gap: .55rem; background: var(--white); border: 1px solid var(--line); cursor: pointer; }
.checkbox-grid input { width: auto; flex: 0 0 auto; }
.wide-field { grid-column: 1 / -1; }
.exercise-search-form { max-width: 700px; margin: 1rem 0 1.5rem; grid-template-columns: minmax(260px,1fr) auto; align-items: end; }
.fatigue-indicator { min-width: 145px; display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 2rem 0; }
.coach-dashboard-hero { padding: 0; display: grid; grid-template-columns: 1fr minmax(320px, .8fr); align-items: stretch; overflow: hidden; border-top: 5px solid var(--ink); }
.coach-dashboard-hero > div { padding: clamp(2rem, 5vw, 4rem); align-self: center; }
.coach-dashboard-hero > img { width: 100%; height: 100%; min-height: 290px; display: block; object-fit: cover; }
.athlete-dashboard-welcome { padding: 0; display: grid; grid-template-columns: 1fr minmax(320px, .8fr); align-items: stretch; overflow: hidden; border-top: 5px solid var(--teal); }
.athlete-dashboard-welcome > div { padding: clamp(2rem, 5vw, 4rem); align-self: center; }
.athlete-dashboard-welcome > img { width: 100%; height: 100%; min-height: 290px; display: block; object-fit: cover; }
.strength-note { margin: -1.5rem 0 1.5rem; padding: 1.2rem clamp(1.5rem, 4vw, 3rem); display: flex; align-items: center; gap: clamp(1rem, 4vw, 3rem); color: var(--white); background: var(--ink); }
.strength-note span { flex: 0 0 auto; color: #88c7cb; font-size: .64rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.strength-note blockquote { margin: 0; font-size: clamp(1rem, 2vw, 1.3rem); font-weight: 600; line-height: 1.45; }
.recent-workouts ul { margin: 0; padding: 0; list-style: none; }
.recent-workouts li { border-top: 1px solid var(--line); }
.recent-workouts li:last-child { border-bottom: 1px solid var(--line); }
.recent-workouts li a { padding: 1rem .25rem; display: flex; align-items: center; gap: .75rem; color: var(--ink); }
.recent-workouts li a:hover { color: var(--teal-dark); background: var(--cream); }
.recent-workouts li span { color: var(--muted); font-size: .78rem; }
.stats article, .card-grid article, .profile-grid article, .workout-exercise { padding: 1.4rem; background: var(--teal-pale); border: 0; border-left: 3px solid var(--teal); }
.stats strong { display: block; font-size: 2.5rem; line-height: 1; }
.stats span { color: var(--muted); font-size: .67rem; letter-spacing: .08em; text-transform: uppercase; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.programme-hero { padding-top: clamp(2rem, 6vw, 5rem); border-top: 5px solid var(--ink); }
.programme-builder-hero { padding: 0; display: grid; grid-template-columns: 1.2fr minmax(300px, .8fr); overflow: hidden; }
.programme-builder-hero > div { padding: clamp(2rem, 5vw, 4rem); align-self: center; }
.programme-builder-hero > img { width: 100%; height: 100%; min-height: 430px; display: block; object-fit: cover; }
.athlete-programme-hero { padding: 0; display: grid; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); overflow: hidden; }
.athlete-programme-hero > img { width: 100%; height: 100%; min-height: 430px; display: block; object-fit: cover; object-position: 72% center; }
.athlete-programme-copy { padding: clamp(2rem, 5vw, 4rem); }
.programme-guidelines { max-width: 800px; margin-top: 2rem; padding: 1.25rem 1.5rem; background: var(--teal-pale); border-left: 3px solid var(--teal); }
.programme-guidelines p { margin-bottom: 0; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.programme-session { box-shadow: var(--shadow); }
.builder-session { padding: clamp(1.25rem, 3vw, 2.4rem); }
.builder-heading-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.assigned-exercises { display: grid; gap: 1rem; margin: 1.5rem 0; }
.workout-visual-layout {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
}
.workout-visual-layout h3 {
  margin-bottom: .75rem;
}
.visual-block {
  margin: .75rem 0;
  padding: .85rem;
  background: var(--cream);
  border: 1px solid var(--line);
}
.visual-block h4 {
  margin-bottom: .55rem;
  color: var(--teal-dark);
}
.visual-round {
  margin: .6rem 0;
  padding: .75rem;
  background: var(--white);
  border-left: 2px solid var(--teal);
}
.visual-block ul,
.visual-round ul {
  margin: .4rem 0;
  padding: 0;
  list-style: none;
}
.visual-block li,
.visual-round li {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .35rem 0;
  border-bottom: 1px solid var(--line);
}
.visual-block li:last-child,
.visual-round li:last-child {
  border-bottom: 0;
}
.visual-block li span {
  color: var(--muted);
  text-align: right;
}
.builder-exercise { padding: 1.25rem; background: var(--teal-pale); border-left: 3px solid var(--teal); }
.builder-exercise-heading { display: flex; align-items: flex-start; gap: 1rem; }
.builder-exercise-heading h3 { margin-bottom: .3rem; }
.builder-exercise-heading p { margin-top: 0; }
.coach-note { padding: .55rem .75rem; color: var(--ink); background: var(--white); border-left: 2px solid var(--teal); font-size: .82rem; }
.push-right { margin-left: auto; }
.exercise-thumb { width: 94px; height: 94px; flex: 0 0 94px; display: block; overflow: hidden; background: var(--white); border: 1px solid var(--line); }
.exercise-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: top; }
.athlete-thumb { width: 130px; height: 130px; flex-basis: 130px; }
.set-table { margin-bottom: 1rem; background: var(--white); }
.editable-set-row input { min-width: 105px; padding: .52rem .62rem; }
.editable-set-row td:nth-child(2) input { width: 90px; min-width: 75px; }
.rest-input { min-width: 115px; display: flex; align-items: center; gap: .4rem; }
.rest-input input { width: 78px; min-width: 70px; }
.rest-input span { color: var(--muted); font-size: .72rem; }
.set-actions { min-width: 190px; display: flex; align-items: center; gap: .35rem; }
.subtle-mini { color: var(--teal-dark); background: var(--white); border-color: var(--teal); }
.subtle-mini:hover { color: var(--white); background: var(--teal-dark); }
.set-builder { grid-template-columns: repeat(3,minmax(0,1fr)); align-items: end; gap: 1rem; padding-top: 1rem; border-top: 1px solid rgba(36,123,131,.25); }
.add-exercise-form { grid-template-columns: 1.3fr 1fr auto; align-items: end; margin-top: 1.5rem; padding: 1.25rem; background: var(--cream); border-top: 1px solid var(--line); }
.builder-session button, .programme-builder-hero button { min-height: 44px; }
.schedule-panel { margin: 1rem 0; padding: 1rem; display: flex; align-items: end; justify-content: space-between; gap: 1rem; background: var(--cream); border: 1px solid var(--line); }
.schedule-workout-form { display: flex; align-items: end; gap: .75rem; }
.schedule-workout-form label { margin: 0; }
.scheduled-dates { display: flex; flex-wrap: wrap; gap: .5rem; }
.scheduled-dates > span { padding: .4rem .55rem; display: inline-flex; align-items: center; gap: .4rem; background: var(--white); border: 1px solid var(--line); }
.add-workout { border-top: 5px solid var(--teal); }
.mini-button { min-height: 32px; width: auto; padding: .35rem .65rem; font-size: .58rem; }
.mini-button.danger { color: var(--danger); background: var(--white); border-color: #dfbcbc; }
.mini-button.danger:hover { color: var(--white); background: var(--danger); border-color: var(--danger); }
.empty-state { padding: 1rem; background: var(--cream); }
.responsive-table { width: 100%; overflow-x: auto; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: rgba(0, 128, 128, 0.08); }
.set-entry-table input { min-width: 105px; padding: .55rem .65rem; }
.athlete-exercise { margin-bottom: 1.25rem; padding: clamp(1.25rem, 3vw, 2rem); }
.prescription { margin: 1.2rem 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid rgba(36,123,131,.25); border-bottom: 1px solid rgba(36,123,131,.25); }
.prescription span { padding: .8rem 1rem; border-right: 1px solid rgba(36,123,131,.25); }
.prescription span:last-child { border-right: 0; }
.prescription small, .prescription strong { display: block; }
.prescription small { color: var(--muted); font-size: .62rem; letter-spacing: .09em; text-transform: uppercase; }
.workout-date { padding-block: 1.25rem; border-left: 3px solid var(--teal); }
.workout-date label { max-width: 300px; }
.timing-fields { grid-template-columns: repeat(5, minmax(0,1fr)); display: grid; align-items: end; gap: 1rem; }
.timing-fields label { max-width: none; }
.timing-or { padding-bottom: 1rem; color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-align: center; text-transform: uppercase; }
.timing-help { grid-column: 1 / -1; margin: 0; font-size: .76rem; }
.workout-meta { margin: .5rem 0; color: var(--teal-dark); font-size: .78rem; font-weight: 600; }
.rpe-scale { margin: 1.5rem 0; padding: 1.25rem; background: var(--teal-pale); border: 0; border-left: 3px solid var(--teal); }
.rpe-scale legend { padding: 0; font-weight: 700; }
.rpe-scale p { margin: .3rem 0 .8rem; }
.rpe-endpoints { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .72rem; }
.rpe-options { margin-top: .65rem; display: grid; grid-template-columns: repeat(10,minmax(0,1fr)); gap: .35rem; }
.rpe-options label { display: block; cursor: pointer; }
.rpe-options input { position: absolute; opacity: 0; pointer-events: none; }
.rpe-options span { min-height: 42px; display: grid; place-items: center; color: var(--teal-dark); background: var(--white); border: 1px solid var(--teal); font-weight: 700; }
.rpe-options input:checked + span { color: var(--white); background: var(--teal-dark); }
.rpe-options input:focus-visible + span { outline: 3px solid rgba(55,141,147,.25); }
.impact-stats { margin-bottom: 1rem; }
.recovery-guidance { max-width: 900px; margin: 0 0 1.5rem; padding: 1.2rem 1.35rem; background: var(--teal-pale); border-left: 3px solid var(--teal); }
.recovery-guidance .eyebrow { margin-bottom: .45rem; }
.recovery-guidance h3 { margin-bottom: .35rem; }
.recovery-guidance p { margin: .35rem 0; }
.recovery-guidance small { display: block; margin-top: .75rem; color: var(--muted); }
.workout-history { padding: 1rem 0; border-top: 1px solid var(--line); }
.workout-history summary { color: var(--ink); }
.workout-detail-card { margin-bottom: 1rem; padding: 1.25rem; background: var(--teal-pale); border-left: 3px solid var(--teal); }
.volume-total { text-align: right; }
.volume-total small, .volume-total strong { display: block; }
.volume-total small { color: var(--muted); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; }
.client-feedback-line { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; padding: .75rem 1rem; background: var(--white); }
.calculation-note { max-width: 800px; font-size: .78rem; }
.indicator-line { display: flex; align-items: baseline; gap: .35rem; line-height: 1.45; }
.rag-dot { width: .62rem; height: .62rem; flex: 0 0 .62rem; display: inline-block; border-radius: 50%; }
.rag-dot.teal { background: #04D9FF; }
.rag-dot.green { background: #5dd916; }
.rag-dot.amber { background: #f0b865; }
.rag-dot.red { background: #d95252; }
.indicator-note { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; font-size: .7rem; }
.indicator-note span { display: inline-flex; align-items: center; gap: .35rem; }
.mini-link-button { padding: .35rem .65rem; display: inline-flex; color: var(--teal-dark); border: 1px solid var(--teal); font-size: .62rem; letter-spacing: .07em; text-transform: uppercase; }
.report-filter-form { grid-template-columns: 1.3fr 1fr 1fr auto; align-items: end; }
.section-banner { margin: calc(clamp(1.5rem, 4vw, 3.25rem) * -1) calc(clamp(1.5rem, 4vw, 3.25rem) * -1) 2rem; display: grid; grid-template-columns: 1fr minmax(280px, .7fr); overflow: hidden; background: var(--ink); }
.section-banner > div { padding: clamp(1.75rem, 4vw, 3rem); align-self: center; }
.section-banner h1 { margin: 0; color: var(--white); }
.section-banner > img { width: 100%; height: 100%; min-height: 230px; display: block; object-fit: cover; }
.banner-actions { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.banner-actions a { padding: .55rem .8rem; color: var(--white); border: 1px solid var(--teal); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; }
.banner-actions a:hover { color: var(--ink); background: var(--white); border-color: var(--white); }
#upload-card, #create-card { scroll-margin-top: 120px; }
.report-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; }
.report-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.report-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px,1fr)); gap: .75rem; margin: 1rem 0 2rem; }
.report-stats article { padding: 1rem; background: var(--teal-pale); border-left: 3px solid var(--teal); }
.report-stats span, .report-stats strong { display: block; }
.report-stats span { color: var(--muted); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; }
.report-stats strong { margin-top: .3rem; font-size: 1.25rem; }
.report-chart { margin: 1.25rem 0 2rem; padding: 1.25rem; background: #fbfcfc; border: 1px solid var(--line); break-inside: avoid; }
.report-chart h3 { margin-bottom: .35rem; }
.empty-chart { min-height: 130px; display: grid; align-content: center; }
.empty-chart p { margin: 0; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .45rem 1rem; margin: .5rem 0 .2rem; color: var(--muted); font-size: .68rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.chart-legend i { width: .65rem; height: .65rem; display: inline-block; border-radius: 50%; }
.progress-chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: #e4e8e7; stroke-width: 1; }
.chart-axis-line { stroke: #929b9c; stroke-width: 1; }
.chart-axis { fill: #626a6c; font: 10px "Poppins", Arial, sans-serif; }
.chart-axis-title { fill: #626a6c; font: 600 10px "Poppins", Arial, sans-serif; letter-spacing: .04em; }
.visual-section-banner { margin-bottom: 1.5rem; padding: 0; display: grid; grid-template-columns: 1fr minmax(250px,.55fr); overflow: hidden; background: var(--ink); }
.visual-section-banner > div { padding: clamp(1.5rem,4vw,3rem); align-self: center; }
.visual-section-banner h1, .visual-section-banner h2 { color: var(--white); }
.visual-section-banner p { color: #c8d1d1; }
.visual-section-banner img { width: 100%; height: 100%; min-height: 220px; display: block; object-fit: cover; }
table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; }
th, td { padding: .9rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--teal-dark); font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; }
.library-count { max-width: 760px; margin-bottom: 2rem; }
.exercise-search-label { max-width: 680px; margin-bottom: .75rem; }
.exercise-name-list { max-width: 850px; border: 1px solid var(--line); background: var(--white); }
.exercise-library-card { margin: .75rem 0; padding: .5rem; background: var(--white); border: 1px solid var(--line); }
.exercise-library-card img { display: block; width: min(100%, 680px); height: auto; }
.exercise-name-row { min-height: 58px; padding: .75rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.exercise-name-row:last-child { border-bottom: 0; }
.exercise-name-row a, .exercise-name-row > span { font-weight: 700; }
.exercise-name-row small { color: var(--muted); font-size: .7rem; text-align: right; }
.exercise-name-row[hidden] { display: none; }
.exercise-edit-row { align-items: start; }
.exercise-row-title { min-width: 190px; display: grid; gap: .2rem; }
.exercise-row-title a, .exercise-row-title span { font-weight: 700; }
.exercise-muscles-form { flex: 1; display: grid; grid-template-columns: minmax(180px,1fr) auto; gap: .45rem; align-items: end; }
.exercise-muscles-form label { margin: 0; font-size: 10px; }
.exercise-muscles-form textarea { min-height: 44px; padding: .35rem .45rem; font-size: 11px; resize: vertical; }
.progress-switcher { display: flex; flex-wrap: wrap; gap: .75rem; }

@media (max-width: 640px) {
  .exercise-edit-row,
  .exercise-muscles-form {
    display: grid;
    grid-template-columns: 1fr;
  }
}

.section-print-action { display: flex; justify-content: flex-end; }
.exercise-log-search-label { max-width: 620px; margin-bottom: 1rem; }
.message-list { display: grid; gap: .75rem; }
.message-list article { padding: 1rem; background: var(--teal-pale); border-left: 3px solid var(--teal); }
.message-card-heading,
.client-summary-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: flex-start;
}
.client-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .75rem;
}
.client-summary-card {
  border: 1px solid var(--border);
  background: #fff;
  padding: .85rem;
}
.compact-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
  margin: .6rem 0;
}
.compact-stats article {
  padding: .6rem;
}
.client-summary-detail,
.health-metrics-summary {
  display: grid;
  gap: .35rem;
}
.dashboard-jump-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .75rem;
}
.contact-form { margin-top: 1rem; }
.calendar-controls, .calendar-legend { display: flex; flex-wrap: wrap; gap: .5rem; }
.calendar-legend span { padding: .35rem .55rem; border-left: 4px solid; font-size: .7rem; }
.calendar-legend .complete { border-color: #5dd916; }.calendar-legend .moved { border-color: #f0b865; }.calendar-legend .missed { border-color: #d95252; }.calendar-legend .scheduled { border-color: #5de1e2; }
.training-calendar { margin-top: 1rem; display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.calendar-weekday { padding: .5rem; color: var(--teal-dark); background: var(--cream); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .65rem; font-weight: 700; text-transform: uppercase; }
.calendar-day { min-height: 120px; padding: .5rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calendar-day.outside { background: var(--cream); }.calendar-day.today { box-shadow: inset 0 0 0 2px var(--teal); }
.calendar-event { margin-top: .35rem; padding: .35rem; display: block; border-left: 4px solid; background: var(--cream); font-size: .68rem; line-height: 1.35; }
.calendar-event.complete { border-color: #5dd916; background: #efffe9; }.calendar-event.moved { border-color: #f0b865; background: #fff6df; }.calendar-event.missed { border-color: #d95252; background: #fdeaea; }.calendar-event.scheduled { border-color: #5de1e2; background: var(--teal-pale); }
.workout-type-label { width: fit-content; margin: .35rem 0 .6rem; padding: .25rem .55rem; color: var(--teal-dark); background: var(--teal-pale); font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.technique-group-picker { padding: 1rem; border: 1px solid var(--teal); background: var(--teal-pale); }
.technique-group-picker[hidden] { display: none; }
.technique-group-picker legend { padding: 0 .4rem; font-weight: 700; }
.exercise-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.exercise-image-card { overflow: hidden; background: var(--white); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(23,26,27,.04); }
.exercise-image-card a { display: block; aspect-ratio: 1 / 1.16; overflow: hidden; background: var(--cream); }
.exercise-image-card img { width: 100%; height: 100%; display: block; object-fit: contain; transition: transform .25s ease; }
.exercise-image-card a:hover img { transform: scale(1.025); }
.exercise-image-card h3 { margin: 0; padding: 1rem 1.1rem 1.2rem; font-size: .95rem; }
.library-tools { display: grid; grid-template-columns: minmax(260px,.65fr) minmax(0,1.35fr); gap: 1rem; align-items: start; }
.library-tools > article { padding: 1.4rem; background: var(--teal-pale); border-left: 3px solid var(--teal); }
.library-tools input[type="file"] { padding: .7rem; background: var(--white); }
.create-card-form .wide-field { grid-column: 1 / -1; }
.error { padding: .9rem 1rem; color: #812b2b; background: #fff0f0; border-left: 3px solid var(--danger); }
.hint { font-size: .82rem; }
details { margin-top: .75rem; }
summary { cursor: pointer; font-weight: 600; }
.workout-order-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.workout-edit-panel { padding: 1rem; border: 1px solid var(--line); background: var(--cream); }
.athlete-card { width: min(100%, 520px); margin: 0 0 1rem; background: var(--white); border: 1px solid var(--line); }
.athlete-card img { width: 100%; display: block; object-fit: contain; }
.add-extra-set { margin-top: .75rem; }
.password-tools { display: flex; align-items: end; gap: .75rem; flex-wrap: wrap; }
.password-tools label { display: flex; align-items: center; gap: .45rem; margin: 0; }

/* v20 compact premium refresh */
:root {
  --ink: #4D4848;
  --muted: #6d6868;
  --teal: #008080;
  --teal-dark: #007474;
  --teal-pale: #eaf8f8;
  --cream: #fff;
  --white: #fff;
  --line: #e5e8e8;
  --shadow: 0 8px 22px rgba(77,72,72,.06);
}
body { color: var(--ink); background: var(--white); font-size: 12px; line-height: 1.45; }
main { width: min(calc(100% - 1.25rem), 1180px); padding: 1.1rem 0 3rem; }
header { min-height: 72px; padding: .65rem clamp(.75rem,3vw,2rem); gap: 1rem; background: #fff; }
.portal-brand img { width: clamp(145px,16vw,210px); }
.portal-brand small, nav { font-size: 10px; letter-spacing: .12em; }
nav { gap: .75rem 1.15rem; }
section { margin-bottom: .8rem; padding: clamp(.8rem,2vw,1.4rem); border-color: var(--line); box-shadow: none; }
h1, h2, h3 { margin-bottom: .45rem; color: var(--ink); letter-spacing: -.015em; line-height: 1.2; }
h1 { font-size: 18px; max-width: 780px; }
h2 { font-size: 16px; }
h3, .subheading { font-size: 14px; }
p, li, td, th, label, input, textarea, select, summary { font-size: 12px; }
p { margin: .35rem 0 .65rem; }
.eyebrow, .workout-type-label, th, .status-badge, .mini-link-button { font-size: 10px; letter-spacing: .12em; }
.eyebrow { margin-bottom: .45rem; color: var(--teal); }
form { gap: .55rem; }
label { gap: .18rem; color: var(--ink); font-size: 11px; letter-spacing: .01em; }
input, textarea, select {
  min-height: 32px;
  padding: .42rem .52rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9dddd;
  border-radius: 3px;
  line-height: 1.3;
  text-align: left;
  vertical-align: top;
}
textarea { min-height: 68px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9a9696; }
input:focus, textarea:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(0,128,128,.12); }
button, .button,
.table-actions > a,
.table-actions .text-button,
.mini-button,
.mini-link-button,
.banner-actions a {
  min-height: 34px;
  padding: .42rem .95rem;
  color: var(--teal);
  background: #fff;
  border: 1px solid var(--teal);
  border-radius: 999px;
  font: 700 11px "Poppins", Arial, sans-serif;
  letter-spacing: .01em;
  text-transform: none;
  box-shadow: none;
}
button:hover, .button:hover,
.table-actions > a:hover,
.table-actions .text-button:hover,
.mini-link-button:hover,
.banner-actions a:hover {
  color: var(--teal);
  background: #fff;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(0,128,128,.12);
}
button:active, .button:active,
button.active, .button.active,
.status-toggle button.selected,
.rpe-options input:checked + span {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}
button:disabled, .button:disabled, .mini-button:disabled {
  color: #858080;
  background: #ededed;
  border-color: #ededed;
  cursor: not-allowed;
}
.button.subtle, .subtle-mini { color: var(--teal); background: #fff; border-color: var(--teal); }
.button.subtle:hover, .subtle-mini:hover { color: var(--teal); background: #fff; }
.danger-button, .mini-button.danger, .text-button.danger { color: #d95252; background: #fff; border-color: #efc8c8; }
.actions, .form-actions, .contact-actions, .banner-actions, .progress-switcher { gap: .45rem; margin-top: .8rem; }
.stats { gap: .55rem; margin: .8rem 0; }
.stats article, .card-grid article, .profile-grid article, .workout-exercise,
.builder-exercise, .exercise-date-record, .message-list article, .report-stats article,
.central-programme-card, .recovery-guidance, .programme-guidelines, .library-tools > article {
  padding: .75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  box-shadow: var(--shadow);
}
.stats strong { font-size: 22px; color: var(--teal); }
.stats span, .report-stats span { font-size: 10px; }
.card-grid, .profile-grid, .assigned-exercises, .central-programme-grid, .message-list { gap: .6rem; }
.profile-grid { margin-top: .75rem; }
.login-card, .coach-dashboard-hero, .athlete-dashboard-welcome, .programme-builder-hero,
.athlete-programme-hero, .section-banner, .visual-section-banner {
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  box-shadow: var(--shadow);
}
.login-copy, .coach-dashboard-hero > div, .athlete-dashboard-welcome > div,
.programme-builder-hero > div, .athlete-programme-copy, .section-banner > div,
.visual-section-banner > div { padding: clamp(1rem,3vw,2rem); }
.login-image img { min-height: 380px; }
.coach-dashboard-hero > img, .athlete-dashboard-welcome > img { min-height: 220px; }
.programme-builder-hero > img, .athlete-programme-hero > img { min-height: 300px; }
.section-banner, .visual-section-banner { background: var(--ink); }
.section-banner > img, .visual-section-banner img { min-height: 170px; }
table { margin: .65rem 0; background: #fff; }
th, td { padding: .48rem .5rem; vertical-align: top; }
th { color: var(--teal); background: #fbffff; }
.responsive-table { border: 1px solid var(--line); background: #fff; }
.responsive-table table { margin: 0; }
.set-entry-table input, .editable-set-row input { min-width: 72px; padding: .35rem .45rem; }
.builder-session { padding: .85rem; }
.builder-exercise-heading { gap: .65rem; }
.exercise-thumb { width: 70px; height: 70px; flex-basis: 70px; }
.athlete-thumb { width: 95px; height: 95px; flex-basis: 95px; }
.set-builder, .add-exercise-form, .schedule-panel, .workout-edit-panel, .rpe-scale {
  padding: .75rem;
  background: #fbffff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
}
.rpe-options span { min-height: 32px; border-radius: 999px; color: var(--teal); }
.rpe-endpoints { font-size: 11px; }
.training-calendar {
  gap: .25rem;
  border: 0;
  background: #fff;
}
.calendar-weekday {
  padding: .35rem .2rem;
  color: var(--teal);
  background: #fff;
  border: 0;
  text-align: center;
  font-size: 10px;
}
.calendar-day {
  min-height: 88px;
  padding: .35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(77,72,72,.035);
}
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--teal); }
.calendar-event {
  margin-top: .25rem;
  padding: .22rem .32rem;
  color: #fff;
  background: var(--teal);
  border: 0;
  border-radius: 3px;
  font-size: 9px;
  line-height: 1.25;
}
.calendar-event.scheduled, .calendar-event.complete, .calendar-event.moved { background: var(--teal); }
.calendar-event.missed { background: #d95252; }
.calendar-legend span { font-size: 10px; border-left-width: 3px; }
.athlete-exercise {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 0;
}
.athlete-card { width: min(100%, 420px); padding: .35rem; }
.workout-date { padding-block: .75rem; }
.timing-fields { gap: .55rem; }
.exercise-name-row { min-height: 42px; padding: .48rem .65rem; }
.library-tools { gap: .65rem; }
.library-tools { padding-bottom: 45vh; }
.empty-state, .client-feedback-line { padding: .65rem; background: #fbffff; }

@media (max-width: 820px) {
  body { font-size: 12px; }
  h1 { font-size: 18px; }
  h2 { font-size: 16px; }
  h3 { font-size: 14px; }
  header { min-height: 0; padding: .55rem .75rem; gap: .45rem; }
  nav { gap: .45rem .75rem; font-size: 9px; }
  main { width: min(calc(100% - .75rem), 1240px); padding-top: .65rem; }
  section { padding: .75rem; margin-bottom: .6rem; }
  input, textarea, select { min-height: 30px; padding: .36rem .45rem; }
  button, .button { min-height: 32px; width: 100%; justify-content: center; }
  .measurement-grid { grid-template-columns: 1fr 1fr; }
  header { position: static; align-items: flex-start; flex-direction: column; }
  .portal-brand small { display: none; }
  .grid-form, .compact, .profile-grid, .stats { grid-template-columns: 1fr; }
  .prescription { grid-template-columns: 1fr; }
  .prescription span { border-right: 0; border-bottom: 1px solid rgba(36,123,131,.25); }
  .table-actions > a, .table-actions .text-button { width: auto; }
  table { display: block; overflow-x: auto; }
  .exercise-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .library-tools { grid-template-columns: 1fr; }
  .set-builder, .add-exercise-form { grid-template-columns: 1fr; }
  .print-exercise-layout { grid-template-columns: 1fr; }
  .exercise-card-print { width: min(100%, 460px); margin: 0 auto 1rem; }
  .print-exercise-layout .responsive-table { width: 100%; overflow-x: auto; }
  .print-exercise-layout .set-table { min-width: 760px; margin-top: 0; }
  .timing-fields { grid-template-columns: 1fr 1fr; }
  .timing-or { display: none; }
  .builder-exercise-heading { flex-wrap: wrap; }
  .push-right { margin-left: 0; }
  .athlete-programme-hero { grid-template-columns: 1fr; }
  .athlete-programme-hero > img { min-height: 230px; max-height: 320px; }
  .coach-dashboard-hero { grid-template-columns: 1fr; }
  .coach-dashboard-hero > img { min-height: 220px; max-height: 300px; }
  .athlete-dashboard-welcome { grid-template-columns: 1fr; }
  .athlete-dashboard-welcome > img { min-height: 220px; max-height: 300px; }
  .strength-note { margin-top: -1.5rem; align-items: flex-start; flex-direction: column; gap: .5rem; }
  .login-card { grid-template-columns: 1fr; }
  .login-image img { min-height: 220px; max-height: 280px; }
  .report-filter-form, .report-stats { grid-template-columns: 1fr; }
  .athlete-sort-form { grid-template-columns: 1fr; }
  .central-programme-card, .exercise-search-form { grid-template-columns: 1fr; }
  .report-heading { flex-direction: column; }
  .visual-section-banner { grid-template-columns: 1fr; }
  .visual-section-banner img { min-height: 200px; max-height: 280px; }
  .programme-builder-hero, .section-banner { grid-template-columns: 1fr; }
  .programme-builder-hero > img, .section-banner > img { min-height: 220px; max-height: 300px; }
  .calendar-day { min-height: 74px; padding: .25rem; }
  .calendar-event { font-size: 8px; }
  .rpe-options { gap: .25rem; }
  .rpe-options span { min-height: 28px; font-size: 10px; }
  .athlete-exercise { padding: .75rem; }
}

@media print {
  header, .report-filter, .report-actions { display: none !important; }
  body, main { background: #fff; }
  main { width: 100%; padding: 0; }
  .report-sheet { border: 0; padding: 0; }
  .report-sheet table { display: table; font-size: 9pt; }
  .no-print, .coach-contact-panel, .dashboard-tools, .schedule-panel, .add-workout { display: none !important; }
  body[data-print-progress] [data-progress-panel] { display: none !important; }
  body[data-print-progress="body"] [data-progress-panel="body"], body[data-print-progress="training"] [data-progress-panel="training"], body[data-print-progress="performance"] [data-progress-panel="performance"] { display: block !important; }
  body.printing-programme main > :not(.programme-print-sheet) { display: none !important; }
  body.printing-programme .programme-print-sheet { display: block !important; border: 0; box-shadow: none; padding: 0; }
  body.printing-programme .programme-print-sheet table { display: table; }
  .print-exercise-layout { display: block; }
  .print-exercise-layout.no-card { grid-template-columns: 1fr; }
  .exercise-card-print { width: 210px; margin: 0 auto 6mm; }
  .exercise-card-print img { max-height: 270px; }
  .set-table { margin-top: 4mm; font-size: 8pt; }
  .set-table td:nth-last-child(2) { font-size: 7pt; line-height: 1.25; }
  .builder-exercise { break-inside: avoid; }
}

@media (max-width: 480px) {
  .measurement-grid { grid-template-columns: 1fr; }
  main { width: min(calc(100% - 1rem), 1240px); padding-top: 1rem; }
  section { padding: .65rem; }
  .exercise-library-grid { grid-template-columns: 1fr; }
  .training-calendar { min-width: 0; }
  .portal-brand img { width: 150px; }
  .login-card { margin: .6rem auto; }
  .login-image img { min-height: 170px; }
  .coach-dashboard-hero > img, .athlete-dashboard-welcome > img,
  .programme-builder-hero > img, .section-banner > img,
  .visual-section-banner img { min-height: 150px; max-height: 210px; }
  .stats strong { font-size: 18px; }
  th, td { padding: .38rem .42rem; }
}

.calendar-event.scheduled {
  background: #dff4ff;
  color: #4D4848;
  border: 1px solid #a8dff2;
}

.calendar-event.moved {
  background: #fff1cc;
  color: #7a4b00;
  border: 1px solid #e4b44a;
}

.programme-print-sheet {
  display: none;
}

.programme-print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.programme-print-table th,
.programme-print-table td {
  padding: .28rem .35rem;
  vertical-align: top;
}

.print-workout-detail,
.print-exercise-detail {
  break-inside: avoid;
}

.progress-measurements-section form.grid-form {
  grid-template-columns: repeat(auto-fit, minmax(90px, max-content));
  align-items: end;
}

.progress-measurements-section input[type="number"] {
  width: 7ch;
  min-width: 7ch;
}

.progress-measurements-section input[type="date"] {
  width: 13ch;
}

.progress-measurements-section textarea {
  min-width: 180px;
}

.progress-measurements-section .measurement-grid {
  grid-template-columns: repeat(auto-fit, minmax(92px, max-content));
}

.progress-measurements-section .responsive-table table {
  width: auto;
  min-width: 0;
}

.progress-measurements-section .responsive-table th,
.progress-measurements-section .responsive-table td {
  padding: .3rem .45rem;
  white-space: nowrap;
}

.progress-report-section .responsive-table table {
  width: auto;
  min-width: 0;
}

.progress-report-section .responsive-table th,
.progress-report-section .responsive-table td {
  padding: .3rem .45rem;
  white-space: nowrap;
}

.calendar-event.goal,
.calendar-legend .goal {
  background: #BC13FE;
  border-color: #BC13FE;
  color: #fff;
}

.builder-exercise.is-collapsed .print-exercise-layout,
.builder-exercise.is-collapsed .responsive-table,
.builder-exercise.is-collapsed .set-form,
.athlete-exercise.is-collapsed .athlete-card,
.athlete-exercise.is-collapsed .exercise-method-heading,
.athlete-exercise.is-collapsed .responsive-table,
.athlete-exercise.is-collapsed .grid-form,
.athlete-exercise.is-collapsed .add-extra-set {
  display: none;
}

.editable-set-row input {
  min-width: 76px;
}

.builder-session,
.workout-exercise {
  background: #fff;
}

.builder-session .section-heading,
.builder-exercise-heading {
  align-items: flex-start;
  gap: .45rem;
}

.builder-session .section-heading h2,
.builder-exercise-heading h3 {
  margin-bottom: .18rem;
}

.set-table,
.set-entry-table {
  width: auto;
  min-width: 0;
  table-layout: auto;
}

.set-table th,
.set-table td,
.set-entry-table th,
.set-entry-table td {
  padding: .32rem .36rem;
  line-height: 1.25;
  white-space: nowrap;
}

.set-table .editable-set-row input[name="reps"],
.set-table .editable-set-row input[name="time_seconds"],
.set-table .editable-set-row input[name="distance"],
.set-table .editable-set-row input[name="recommended_load"],
.set-table .editable-set-row input[name="rest_seconds"],
.set-entry-table input[name^="reps_"],
.set-entry-table input[name^="time_"],
.set-entry-table input[name^="distance_"],
.set-entry-table input[name^="load_"] {
  width: 5.5ch;
  min-width: 5.5ch;
  max-width: 64px;
  min-height: 26px;
  padding: .22rem .28rem;
  text-align: left;
}

.set-table .mini-button {
  min-height: 26px;
  padding: .22rem .5rem;
  font-size: 10px;
}

.set-builder,
.workout-edit-panel,
.schedule-panel {
  padding: .55rem;
}

.install-app-button {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: .35rem 0 .25rem;
}

.install-app-button img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

@media (max-width: 640px) {
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }

  main {
    width: 100%;
    padding-left: .45rem;
    padding-right: .45rem;
  }

  .training-calendar {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .12rem;
  }

  .calendar-weekday {
    padding: .22rem 0;
    font-size: 8px;
    letter-spacing: 0;
  }

  .calendar-day {
    min-width: 0;
    min-height: 54px;
    padding: .16rem;
    border-radius: 5px;
  }

  .calendar-day strong {
    font-size: 9px;
  }

  .calendar-event {
    max-width: 100%;
    padding: .12rem .14rem;
    font-size: 7px;
    line-height: 1.1;
    white-space: normal;
    word-break: break-word;
  }

  .calendar-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .28rem;
    width: 100%;
  }

  .calendar-controls button {
    min-width: 0;
    padding-left: .35rem;
    padding-right: .35rem;
  }

  .athlete-exercise,
  .workout-exercise {
    width: 100%;
    overflow: hidden;
  }

  .athlete-exercise .responsive-table {
    overflow-x: visible;
    border: 0;
  }

  .athlete-exercise .set-entry-table,
  .athlete-exercise .set-entry-table tbody,
  .athlete-exercise .set-entry-table tr,
  .athlete-exercise .set-entry-table td {
    display: block;
    width: 100%;
  }

  .athlete-exercise .set-entry-table th {
    display: none;
  }

  .athlete-exercise .set-entry-table tr {
    margin-bottom: .45rem;
    padding: .45rem;
    background: #fff;
    border: 1px solid var(--line);
    border-left: 3px solid var(--teal);
  }

  .athlete-exercise .set-entry-table td {
    padding: .18rem 0;
    border: 0;
    white-space: normal;
  }

  .athlete-exercise .set-entry-table td:first-child {
    color: var(--teal);
    font-weight: 700;
  }

  .athlete-exercise .set-entry-table input[name^="reps_"],
  .athlete-exercise .set-entry-table input[name^="time_"],
  .athlete-exercise .set-entry-table input[name^="distance_"],
  .athlete-exercise .set-entry-table input[name^="load_"] {
    width: 7ch;
    min-width: 7ch;
    max-width: 74px;
  }

  .workout-date.timing-fields {
    grid-template-columns: 1fr;
  }
}

.definition-button,
.exercise-method-heading .definition-button {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--teal);
  background: transparent;
  font-size: inherit;
  font-weight: 700;
  text-decoration: underline;
  box-shadow: none;
}

.exercise-method-heading {
  margin: .25rem 0 .35rem;
  font-size: 11px;
}

.training-history-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
  align-items: end;
  margin: .45rem 0 .65rem;
}

.list-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin: .65rem 0;
  padding: .55rem;
  background: #fbffff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
}

.compact-number,
.set-builder input[name="set_count"],
.set-builder input[name="reps"],
.set-builder input[name="time_seconds"],
.set-builder input[name="distance"],
.set-builder input[name="recommended_load"],
.set-builder input[name="rest_seconds"],
.editable-set-row input[name="reps"],
.editable-set-row input[name="time_seconds"],
.editable-set-row input[name="distance"],
.editable-set-row input[name="recommended_load"],
.editable-set-row input[name="rest_seconds"] {
  width: 6ch;
  min-width: 6ch;
  max-width: 68px;
}

.set-builder {
  grid-template-columns: repeat(auto-fit, minmax(92px, max-content));
  align-items: end;
}

.set-builder .wide-field,
.set-builder fieldset {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .compact-workout-list,
  .athlete-programme-hero + section .card-grid {
    gap: .35rem;
  }

  .compact-workout-list article,
  .athlete-programme-hero + section .card-grid article,
  .athlete-exercise {
    padding: .45rem;
    margin-bottom: .35rem;
  }

  .athlete-exercise .builder-exercise-heading {
    gap: .25rem;
  }

  .athlete-exercise .builder-exercise-heading h3 {
    font-size: 13px;
    margin-bottom: .1rem;
  }

  .athlete-exercise .builder-exercise-heading p {
    margin: .15rem 0;
    font-size: 10px;
    line-height: 1.25;
  }

  .athlete-exercise .set-entry-table {
    display: table;
    width: 100%;
    table-layout: auto;
    font-size: 9px;
  }

  .athlete-exercise .set-entry-table tbody {
    display: table-row-group;
  }

  .athlete-exercise .set-entry-table tr {
    display: table-row;
    margin: 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .athlete-exercise .set-entry-table th {
    display: table-cell;
    padding: .16rem .12rem;
    font-size: 8px;
    letter-spacing: .02em;
    white-space: normal;
  }

  .athlete-exercise .set-entry-table td {
    display: table-cell;
    width: auto;
    padding: .12rem .1rem;
    border: 0;
    white-space: nowrap;
    vertical-align: middle;
    font-size: 9px;
  }

  .athlete-exercise .set-entry-table td:first-child {
    font-size: 9px;
    font-weight: 700;
  }

  .athlete-exercise .set-entry-table input[name^="reps_"],
  .athlete-exercise .set-entry-table input[name^="time_"],
  .athlete-exercise .set-entry-table input[name^="distance_"],
  .athlete-exercise .set-entry-table input[name^="load_"] {
    width: 5ch;
    min-width: 5ch;
    max-width: 54px;
    min-height: 23px;
    padding: .1rem .14rem;
    font-size: 10px;
  }

  .exercise-card-print.athlete-card {
    margin-bottom: .35rem;
  }

  .training-history-filter {
    grid-template-columns: 1fr;
  }

  .list-filter {
    grid-template-columns: 1fr;
  }
}

/* v51 final production overrides */
.rag-dot.teal { background: #04D9FF; }
.rag-dot.green { background: #5dd916; }
.rag-dot.amber { background: #f0b865; }
.rag-dot.red { background: #d95252; }
.calendar-legend .complete { border-color: #5dd916; }
.calendar-legend .moved { border-color: #f0b865; }
.calendar-legend .missed { border-color: #d95252; }
.calendar-legend .scheduled { border-color: #5de1e2; }
.calendar-event.complete { background: #5dd916; border-color: #5dd916; color: #fff; }
.calendar-event.moved { background: #f0b865; border-color: #f0b865; color: #4D4848; }
.calendar-event.missed { background: #d95252; border-color: #d95252; color: #fff; }
.calendar-event.scheduled { background: #5de1e2; border-color: #5de1e2; color: #4D4848; }
.calendar-event-wrap { display: grid; gap: .2rem; }
.calendar-event-actions { display: flex; gap: .2rem; flex-wrap: wrap; }
.calendar-event-actions .mini-button { min-height: 22px; padding: .1rem .35rem; font-size: 8px; }
.client-summary-card.gender-female { border-color: #008080; border-left-color: #008080; }
.client-summary-card.gender-male { border-color: #4D4848; border-left-color: #4D4848; }
.client-summary-card .compact-stats { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }
.client-week-comments {
  margin-top: .6rem;
  padding-top: .55rem;
  border-top: 1px solid var(--line);
}
.client-week-comments ul {
  margin: .35rem 0 0;
  padding-left: 1rem;
}
.client-week-comments li {
  margin-bottom: .35rem;
}
.exercise-list-item summary { display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding: .45rem .6rem; }
.exercise-row-actions { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.exercise-row-actions .mini-button { min-height: 26px; padding: .18rem .5rem; }
.exercise-edit-panel { margin-top: .65rem; padding: .75rem; border: 1px solid var(--line); background: #fbffff; }
.button.is-disabled,
button:disabled {
  color: #777;
  background: #ededed;
  border-color: #d8d8d8;
  cursor: not-allowed;
  opacity: .75;
}
.progress-measurements-section .responsive-table { overflow-x: auto; }
.progress-measurements-section .responsive-table table { width: max-content; min-width: 100%; }
.progress-measurements-section .responsive-table th,
.progress-measurements-section .responsive-table td { padding: .18rem .28rem; font-size: 10px; white-space: nowrap; }
.progress-measurements-section .measurement-detail-cell { max-width: none; white-space: nowrap; }
.measurement-detail-cell span { display: inline; }
.capture-measurements-form { margin-top: 1.35rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.progress-measurements-section form.grid-form { grid-template-columns: repeat(auto-fit, minmax(80px, max-content)); gap: .45rem; }
.progress-measurements-section input[type="number"] { width: 7ch; min-width: 7ch; max-width: 7ch; }
.progress-measurements-section .measurement-grid { grid-template-columns: repeat(auto-fit, minmax(84px, max-content)); gap: .35rem; }

/* v54 athlete usability refinements */
.calendar-shell {
  max-width: 1100px;
  margin-inline: auto;
}

.calendar-add-actions {
  margin: .65rem 0 1rem;
}

.calendar-action-panel {
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  background: #fff;
  padding: .75rem;
  margin: .75rem 0 1rem;
}

.calendar-action-panel[hidden] {
  display: none;
}

.compact-heading {
  margin-bottom: .55rem;
}

.unplanned-workout-table th,
.unplanned-workout-table td {
  padding: .22rem .28rem;
  vertical-align: top;
}

.unplanned-workout-table input,
.unplanned-workout-table select {
  min-height: 28px;
  padding: .22rem .35rem;
}

.unplanned-workout-table select[multiple] {
  min-width: 14rem;
  height: 5.6rem;
  padding: .18rem .25rem;
}

.unplanned-workout-table input[name*="_sets_"],
.unplanned-workout-table input[name*="_reps_"],
.unplanned-workout-table input[name*="_time_"],
.unplanned-workout-table input[name*="_load_"] {
  width: 8ch;
  min-width: 8ch;
}

.progress-measurements-section {
  max-width: 1100px;
  margin-inline: auto;
}

.progress-measurements-section .measurement-group {
  padding: .55rem;
}

.progress-measurements-section .measurement-grid label {
  display: grid;
  gap: .2rem;
}

.progress-measurements-section .measurement-grid small {
  max-width: 13rem;
  line-height: 1.25;
}

.progress-measurements-section .capture-measurements-form {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
}

.progress-measurements-section textarea {
  min-height: 70px;
}
.planned-actual-table th,
.planned-actual-table td { padding: .28rem .35rem; white-space: nowrap; }

.tight-table th,
.tight-table td {
  padding: .32rem .45rem;
  vertical-align: top;
}

.tight-table small,
.workout-library-table small {
  display: block;
  margin-top: .15rem;
  color: var(--muted);
  line-height: 1.25;
}

.workout-library-table td:first-child {
  min-width: 18rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}

.assignment-panel {
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  background: #fff;
  padding: .8rem;
  margin: .75rem 0 1rem;
}

.assignment-panel h3 {
  margin: .15rem 0 .55rem;
}

.assignment-panel[hidden] {
  display: none;
}

.coach-report-sheet {
  max-width: 1120px;
  margin-inline: auto;
}

.coach-report-sheet .report-heading,
.coach-report-sheet .report-stats,
.compact-profile-grid {
  margin-bottom: .9rem;
}

.compact-profile-grid {
  gap: .45rem;
}

.compact-profile-grid article {
  padding: .55rem;
}

.report-stats article {
  min-height: 74px;
  padding: .65rem;
}

.report-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.is-disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* v58 weekly compliance badges, Progress Wall and report editor */
.weekly-progress-wall {
  max-width: 1120px;
  margin-inline: auto;
}
.weekly-badge-wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .85rem;
  margin-top: 1rem;
}
.weekly-badge-wall-card {
  display: grid;
  gap: .55rem;
  align-content: start;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: .75rem;
  transition: transform .15s ease, box-shadow .15s ease;
}
.weekly-badge-wall-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}
.weekly-badge-wall-card img {
  width: 100%;
  max-height: 190px;
  object-fit: contain;
}
.weekly-badge-wall-card div {
  display: grid;
  gap: .15rem;
}
.weekly-badge-wall-card span {
  color: var(--muted);
  font-size: .88rem;
}
.dashboard-latest-badge {
  display: grid;
  grid-template-columns: 1fr minmax(150px, 260px);
  align-items: center;
  gap: 1rem;
  border-left: 4px solid var(--teal);
}
.dashboard-latest-badge img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}
.client-weekly-report-actions {
  margin-top: .8rem;
  padding-top: .7rem;
  border-top: 1px solid var(--line);
}
.weekly-report-manager {
  border-left: 4px solid var(--teal);
}
.weekly-report-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  max-width: 1120px;
  margin: 0 auto .75rem;
}
.weekly-draft-notice {
  max-width: 1120px;
  margin: 0 auto .75rem;
  padding: .75rem 1rem;
  border: 1px solid #d7ad55;
  border-left: 4px solid #d7ad55;
  background: #fff9e9;
}
.weekly-draft-notice p { margin-bottom: 0; }
.weekly-report-shell {
  max-width: 1120px;
  margin-inline: auto;
}
.weekly-report-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,.07);
}
.weekly-report-sheet > section,
.weekly-report-heading,
.weekly-report-footer {
  padding: 1.1rem 1.25rem;
}
.weekly-report-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #f7ffff 0%, #ffffff 70%);
}
.weekly-report-heading img {
  width: 190px;
  max-width: 38%;
  height: auto;
}
.weekly-report-heading h1 { margin-bottom: .2rem; }
.weekly-badge-message {
  display: grid;
  grid-template-columns: minmax(220px, 36%) 1fr;
  gap: 1.25rem;
  align-items: start;
  border-bottom: 1px solid var(--line);
}
.weekly-badge-message > img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}
.weekly-badge-message p { margin: 0 0 .7rem; }
.weekly-report-stats {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}
.weekly-workout-status {
  display: inline-block;
  padding: .18rem .48rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  background: #eef2f3;
}
.weekly-workout-status.completed { background: #ddf5ec; color: #075b46; }
.weekly-workout-status.missed { background: #fde7e7; color: #8b1f1f; }
.weekly-workout-status.additional-activity { background: #e7eefb; color: #274f88; }
.weekly-coach-feedback {
  background: #f8fbfb;
  border-top: 1px solid var(--line);
}
.weekly-report-footer {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  border-top: 1px solid var(--line);
}
.weekly-report-editor {
  max-width: 1120px;
  margin: 1rem auto 0;
  border-left: 4px solid var(--teal);
}
.weekly-report-editor form {
  display: grid;
  gap: .8rem;
}
.weekly-report-editor textarea {
  width: 100%;
  min-height: 150px;
}
.weekly-report-editor .danger {
  margin-left: auto;
}

@media (max-width: 760px) {
  .dashboard-latest-badge,
  .weekly-badge-message {
    grid-template-columns: 1fr;
  }
  .dashboard-latest-badge img {
    max-width: 230px;
    justify-self: center;
  }
  .weekly-report-heading {
    align-items: flex-start;
  }
  .weekly-report-heading img {
    width: 130px;
  }
  .weekly-report-stats {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }
}

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body.printing-weekly-report #portal-header,
  body.printing-weekly-report .no-print,
  body.printing-weekly-report .weekly-report-editor,
  body.printing-weekly-report main > :not(.weekly-report-shell) {
    display: none !important;
  }
  body.printing-weekly-report .weekly-report-shell {
    display: block !important;
    max-width: none;
    margin: 0;
  }
  body.printing-weekly-report .weekly-report-sheet {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  body.printing-weekly-report .weekly-report-sheet > section,
  body.printing-weekly-report .weekly-report-heading,
  body.printing-weekly-report .weekly-report-footer {
    padding: 6mm 7mm;
  }
  body.printing-weekly-report .weekly-badge-message {
    grid-template-columns: 34% 1fr;
    gap: 6mm;
  }
  body.printing-weekly-report .weekly-badge-message > img {
    max-height: 78mm;
  }
  body.printing-weekly-report .weekly-report-heading img {
    width: 42mm;
  }
  body.printing-weekly-report table {
    font-size: 8.5pt;
  }
  body.printing-weekly-report .weekly-badge-message,
  body.printing-weekly-report .weekly-report-stats,
  body.printing-weekly-report .weekly-coach-feedback,
  body.printing-weekly-report tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  body.printing-weekly-report a {
    color: inherit;
    text-decoration: none;
  }
}


/* v58.3 coach dashboard client-card tidy-up */
.client-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}
.client-summary-card {
  min-width: 0;
  padding: 1rem;
  border: 8px solid transparent;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(40, 46, 46, .07);
}
.client-summary-card.gender-female {
  border-color: #d7f0f0;
  border-left-color: #d7f0f0;
}
.client-summary-card.gender-male {
  border-color: #dedada;
  border-left-color: #dedada;
}
.client-summary-card.gender-neutral {
  border-color: #e8e8e8;
  border-left-color: #e8e8e8;
}
.client-summary-head {
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
}
.client-summary-head h3 {
  margin-bottom: .15rem;
}
.client-summary-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .4rem;
  flex: 0 0 auto;
}
.client-summary-card-actions .button,
.client-summary-card-actions button {
  min-height: 34px;
  padding: .38rem .7rem;
  font-size: .68rem;
  white-space: nowrap;
}
.client-summary-card .compact-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.client-summary-card .compact-stats article {
  background: #fff;
}
.client-weekly-report-actions {
  padding-top: .8rem;
  margin-top: .8rem;
  border-top: 1px solid var(--line);
}
.dashboard-manage-clients {
  margin-top: .8rem;
}
@media (max-width: 1120px) {
  .client-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .client-summary-grid { grid-template-columns: 1fr; gap: 1rem; }
  .client-summary-head { align-items: flex-start; }
  .client-summary-card-actions { align-items: stretch; }
}

/* v58.4 programme and workout library tidy-up */
.central-programme-card.is-filtered-out,
.workout-library-row.is-filtered-out {
  display: none !important;
}

.programme-filter-count,
.workout-filter-count {
  margin: .45rem 0 .8rem;
  color: var(--muted);
  font-size: .9rem;
}

.workout-library-list {
  display: grid;
  gap: .65rem;
}

.workout-library-row {
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 12px;
  background: var(--white);
}

.workout-library-primary {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.workout-library-name {
  flex: 0 1 360px;
  min-width: 180px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.workout-row-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: .1rem 0;
}

.workout-row-actions .mini-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.workout-library-meta,
.workout-library-notes {
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .86rem;
}

.workout-library-notes {
  margin-top: .2rem;
}

@media (max-width: 760px) {
  .workout-library-primary {
    align-items: flex-start;
    flex-direction: column;
    gap: .55rem;
  }

  .workout-library-name {
    min-width: 0;
  }

  .workout-row-actions {
    width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

/* v58.5 workout search and filtering tools */
.workout-tool-buttons {
  margin-top: 1rem;
}

.workout-tool-buttons button:not(.subtle) {
  color: var(--white);
  background: var(--teal);
  border-color: var(--teal);
}

.workout-tool-panel {
  scroll-margin-top: 110px;
  border-left: 4px solid var(--teal);
}

.workout-tool-panel[hidden] {
  display: none !important;
}

.workout-search-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: .75rem;
  align-items: end;
}

#workout-filter-form {
  grid-template-columns: repeat(4, minmax(170px, 1fr)) auto;
  align-items: end;
}

#workout-filter-form > button,
.workout-search-controls > button {
  align-self: end;
}

@media (max-width: 1080px) {
  #workout-filter-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 620px) {
  .workout-search-controls,
  #workout-filter-form {
    grid-template-columns: 1fr;
  }

  .workout-tool-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workout-tool-buttons button {
    width: 100%;
  }
}

/* v58.6 structured workout builder */
.workout-type-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
  margin-top: 1rem;
}

.workout-type-choice {
  min-height: 150px;
  padding: 1rem;
  text-align: left;
  border: 1px solid rgba(36, 123, 131, .28);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(29, 48, 52, .06);
}

.workout-type-choice:hover,
.workout-type-choice:focus-visible,
.workout-type-choice.is-selected {
  border-color: var(--teal);
  background: var(--teal-pale);
  transform: translateY(-1px);
}

.workout-type-choice strong,
.workout-type-choice span {
  display: block;
}

.workout-type-choice strong {
  margin-bottom: .55rem;
  color: var(--teal-dark);
  font-size: 1.02rem;
}

.workout-type-choice span {
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.45;
}

.structured-workout-create[hidden] {
  display: none !important;
}

.exercise-picker-search {
  display: block;
  margin-bottom: .65rem;
}

.exercise-picker-search-row {
  display: flex;
  align-items: end;
  gap: .55rem;
  margin-bottom: .35rem;
}

.exercise-picker-search-row .exercise-picker-search {
  flex: 1 1 320px;
  margin-bottom: 0;
}

.exercise-picker-clear {
  flex: 0 0 auto;
  margin-bottom: .08rem;
}

.exercise-picker-result-count {
  margin: .15rem 0 .45rem;
  color: var(--muted);
  font-size: .86rem;
}

.exercise-picker-no-results {
  margin: .45rem 0;
  padding: .7rem .8rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--teal-pale);
  color: var(--teal-dark);
}

.exercise-picker-grid .is-exercise-search-hidden {
  display: none !important;
}

@media (max-width: 620px) {
  .exercise-picker-search-row {
    align-items: stretch;
    flex-direction: column;
  }

  .exercise-picker-clear {
    align-self: flex-start;
  }
}

.exercise-picker-grid {
  max-height: 320px;
  overflow-y: auto;
  align-content: start;
  padding: .35rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.exercise-picker-grid label {
  min-height: 42px;
  align-items: center;
}

.selected-exercise-count {
  color: var(--teal-dark);
  font-weight: 700;
}

.structured-block-editor {
  border: 1px solid rgba(36, 123, 131, .24);
  border-left: 5px solid var(--teal);
  background: #fff;
}

.structured-block-editor + .structured-block-editor {
  margin-top: 1.2rem;
}

.structured-block-exercises {
  display: grid;
  gap: .8rem;
  margin-top: 1rem;
}

.structured-exercise-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.structured-workout-layout {
  border: 1px solid rgba(36, 123, 131, .2);
  background: linear-gradient(180deg, var(--teal-pale), #fff);
}

.structured-workout-layout .visual-block {
  padding: .8rem;
  border: 1px solid rgba(36, 123, 131, .2);
  border-radius: 12px;
  background: rgba(255,255,255,.88);
}

.structured-workout-layout .visual-block + .visual-block {
  margin-top: .9rem;
}

.structured-workout-layout .visual-round {
  padding: .7rem .8rem;
  margin-top: .65rem;
  border-left: 3px solid var(--teal);
  background: #fff;
}

.structured-workout-layout .visual-round > strong {
  color: var(--teal-dark);
}

.structured-workout-layout .visual-round ul {
  display: grid;
  gap: .35rem;
  margin: .55rem 0;
  padding: 0;
  list-style: none;
}

.structured-workout-layout .visual-round li {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) 1fr;
  gap: .75rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid rgba(36, 123, 131, .12);
}

.structured-workout-layout .visual-round li span,
.structured-workout-layout .visual-round p {
  color: var(--muted);
  font-size: .88rem;
}

.workout-entry-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.workout-entry-actions > div {
  max-width: 720px;
}

.mysql-block-exercise-form {
  margin-top: .8rem;
}

@media (max-width: 1050px) {
  .workout-type-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .workout-type-choice-grid {
    grid-template-columns: 1fr;
  }

  .workout-type-choice {
    min-height: 0;
  }

  .structured-workout-layout .visual-round li {
    grid-template-columns: 1fr;
    gap: .15rem;
  }

  .workout-entry-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .workout-entry-actions button {
    width: 100%;
  }
}

.selected-exercise-order {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0 0 .7rem;
  padding: 0;
  counter-reset: selected-exercise;
  list-style: none;
}

.selected-exercise-order[hidden] {
  display: none;
}

.selected-exercise-order li {
  counter-increment: selected-exercise;
  padding: .35rem .55rem;
  border: 1px solid rgba(36, 123, 131, .22);
  border-radius: 999px;
  background: var(--teal-pale);
  color: var(--teal-dark);
  font-size: .8rem;
}

.selected-exercise-order li::before {
  content: counter(selected-exercise) ". ";
  font-weight: 700;
}

/* v58.6.1 compact workout type selector */
.workout-type-choice-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  margin-top: .85rem;
}

.workout-type-choice {
  position: relative;
  flex: 0 0 auto;
  width: auto !important;
  min-width: 0;
  min-height: 42px;
  padding: .58rem .9rem;
  text-align: center;
  border-radius: 999px;
  box-shadow: none;
}

.workout-type-choice strong {
  display: inline;
  margin: 0;
  font-size: .78rem;
  line-height: 1.2;
  white-space: nowrap;
}

/* Keep the useful description available to screen readers without making the selector oversized. */
.workout-type-choice span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.workout-type-choice:hover,
.workout-type-choice:focus-visible,
.workout-type-choice.is-selected {
  transform: none;
}

@media (max-width: 520px) {
  .workout-type-choice-grid {
    gap: .5rem;
  }

  .workout-type-choice {
    padding: .55rem .75rem;
  }

  .workout-type-choice strong {
    white-space: normal;
  }
}

/* v58.7 Workout Cupboard */
.workout-library-row.is-archived-workout {
  background: #f5f7f7;
  border-style: dashed;
}

.workout-library-row.is-archived-workout .workout-library-meta::first-line {
  font-weight: 700;
}

/* v58.8 Jackson-Pollock 7-site body-fat calculator */
.jackson-pollock-fields {
  border-color: rgba(55, 141, 147, .45);
  background: rgba(228, 240, 241, .35);
}

.jackson-pollock-result {
  margin-top: .75rem;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(23, 26, 27, .04);
}

.jackson-pollock-result p,
.jackson-pollock-result small {
  margin: .25rem 0 0;
}

.jackson-pollock-result.complete strong {
  color: var(--teal-dark);
  font-size: 1.08rem;
}

.jackson-pollock-result.warning {
  border-left-color: #f0b865;
  background: #fffaf1;
}

input.calculated-value[readonly] {
  background: var(--teal-pale);
  border-color: var(--teal);
  color: var(--teal-dark);
  font-weight: 700;
}

.measurement-method {
  display: block;
  margin-top: .15rem;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.2;
}

/* v58.9 measurement day records and client editing */
.measurement-row-actions {
  display: flex;
  gap: .35rem;
  align-items: center;
}
.measurement-row-actions .mini-button {
  white-space: nowrap;
}
.measurement-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
}
.capture-measurements-form form[data-mode="edit"] {
  padding: 1rem;
  border: 2px solid rgba(0, 139, 139, .35);
  border-radius: 18px;
  background: #f8ffff;
}
@media (max-width: 720px) {
  .measurement-row-actions {
    min-width: 120px;
  }
  .measurement-form-actions > button,
  .measurement-row-actions > button {
    width: auto;
  }
}


/* v58.10 RAG health indicators */
.measurement-health-cell { min-width: 180px; }
.measurement-health-cell .indicator-line,
.dashboard-health-indicators .indicator-line { margin: .12rem 0; }
.dashboard-health-indicators { margin-top: .45rem; padding: .55rem .65rem; background: rgba(0, 128, 128, .06); border-left: 2px solid var(--teal); }
.client-compliance-overview > .indicator-note { margin: .5rem 0 1rem; }
.progress-measurements-section > .indicator-note { margin: .75rem 0 1.25rem; }

/* v58.11 Standard workout bulk exercise builder */
.standard-exercise-selection {
  padding-bottom: .9rem;
}

.standard-exercise-picker-panel {
  margin-top: .8rem;
  border: 1px solid rgba(36, 123, 131, .24);
  border-radius: 12px;
  background: var(--white);
  overflow: hidden;
}

.standard-exercise-picker-panel > summary {
  padding: .8rem 1rem;
  color: var(--teal-dark);
  font-weight: 700;
  cursor: pointer;
  background: var(--teal-pale);
}

.standard-exercise-picker-panel[open] > summary {
  border-bottom: 1px solid rgba(36, 123, 131, .18);
}

.standard-exercise-picker-panel > form {
  padding: .9rem;
}

.standard-exercise-list {
  display: grid;
  gap: .75rem;
}

.standard-exercise-card {
  border: 1px solid rgba(36, 123, 131, .2);
  border-left: 4px solid var(--teal);
  border-radius: 10px;
  background: var(--white);
}

.standard-exercise-card .set-form {
  margin-top: .85rem;
}

.standard-exercise-card h4 {
  margin: 0 0 .25rem;
}

/* v58.12 coach calendar, week copy/paste and drag-and-drop */
.coach-calendar-client-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: .75rem 0 1rem;
  padding: .8rem 1rem;
  background: var(--teal-pale);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
}

.coach-calendar-client-bar label {
  width: min(100%, 420px);
  margin: 0;
  font-weight: 700;
}

.coach-calendar-client-bar select {
  margin-top: .3rem;
}

.calendar-week-tool-panel {
  max-width: 760px;
}

.calendar-clipboard-summary {
  margin: 0 0 .75rem;
  padding: .65rem .75rem;
  background: var(--cream);
  border-left: 3px solid var(--teal);
}

.calendar-drag-hint {
  margin: .35rem 0 .65rem;
  font-size: .78rem;
  color: var(--charcoal);
}

.calendar-event-wrap.is-draggable {
  cursor: grab;
}

.calendar-event-wrap.is-draggable:active {
  cursor: grabbing;
}

.calendar-event-wrap.is-dragging {
  opacity: .45;
}

.calendar-day[data-calendar-drop-date] {
  transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.calendar-day.is-drop-target {
  background: var(--teal-pale);
  box-shadow: inset 0 0 0 2px var(--teal);
  transform: translateY(-1px);
}

.calendar-event.goal {
  background: #4D4848;
  border-color: #4D4848;
  color: #fff;
}

.calendar-legend .goal {
  border-color: #4D4848;
}

@media (max-width: 720px) {
  .coach-calendar-client-bar {
    display: grid;
    align-items: stretch;
  }

  .coach-calendar-client-bar label {
    width: 100%;
  }

  .calendar-drag-hint {
    display: none;
  }
}

/* v58.13: clients record structured workouts directly in sequence order */
.structured-sequence-entry {
  border: 1px solid rgba(36, 123, 131, .2);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--teal-pale), #fff 220px);
}

.sequence-workout-block {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(36, 123, 131, .2);
  border-radius: 14px;
  background: rgba(255,255,255,.9);
}

.sequence-workout-block > h3 {
  margin: 0 0 .75rem;
  color: var(--teal-dark);
}

.sequence-round-entry {
  margin-top: .85rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 12px;
  background: #fff;
}

.sequence-round-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .8rem;
  background: rgba(36, 123, 131, .08);
}

.sequence-round-heading h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--teal-dark);
}

.sequence-round-exercises {
  display: grid;
}

.sequence-exercise-step {
  padding: .85rem;
  border-top: 1px solid rgba(36, 123, 131, .13);
}

.sequence-exercise-step:first-child {
  border-top: 0;
}

.sequence-step-heading {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  margin-bottom: .65rem;
}

.sequence-step-heading > span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  font-size: .82rem;
}

.sequence-step-heading h4 {
  margin: 0;
  color: var(--charcoal);
}

.sequence-step-heading p {
  margin: .2rem 0 0;
  color: var(--muted);
  font-size: .85rem;
}

.sequence-set-entry {
  display: flex;
  align-items: flex-end;
  gap: .65rem;
  margin-top: .55rem;
  padding: .65rem;
  border: 1px solid rgba(36, 123, 131, .16);
  border-radius: 10px;
  background: #fbfefe;
}

.sequence-side-badge {
  align-self: center;
  min-width: 54px;
  padding: .3rem .5rem;
  border-radius: 999px;
  background: rgba(36, 123, 131, .12);
  color: var(--teal-dark);
  font-size: .76rem;
  font-weight: 800;
  text-align: center;
}

.sequence-actual-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: .55rem;
  width: 100%;
}

.sequence-actual-field {
  display: grid;
  gap: .18rem;
}

.sequence-actual-field > span {
  font-size: .76rem;
  font-weight: 800;
  color: var(--charcoal);
}

.sequence-actual-field small {
  color: var(--muted);
  font-size: .7rem;
}

.sequence-actual-field input {
  width: 100%;
  min-width: 0;
  padding: .48rem .55rem;
}

.sequence-transition {
  margin: .55rem 0 0;
  color: var(--muted);
  font-size: .8rem;
  font-style: italic;
}

.sequence-overall-rest {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem .85rem;
  border-top: 1px solid rgba(36, 123, 131, .18);
  background: var(--teal-pale);
  color: var(--teal-dark);
}

.sequence-notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}

.sequence-note-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.sequence-note-card summary {
  padding: .7rem .8rem;
  cursor: pointer;
  color: var(--teal-dark);
  font-weight: 800;
}

.sequence-note-card .grid-form {
  padding: 0 .8rem .8rem;
}

.workout-completion-summary {
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .sequence-actual-fields {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }
}

@media (max-width: 680px) {
  .structured-sequence-entry,
  .sequence-workout-block {
    padding-left: .65rem;
    padding-right: .65rem;
  }

  .sequence-round-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .sequence-round-heading .mini-button {
    width: 100%;
  }

  .sequence-set-entry {
    align-items: stretch;
    flex-direction: column;
  }

  .sequence-side-badge {
    align-self: flex-start;
  }

  .sequence-actual-fields,
  .sequence-notes-grid {
    grid-template-columns: 1fr;
  }
}

/* v58.13.1: compact, collapsed client sequence sections */
.sequence-unit > .sequence-unit-body {
  display: block;
}

.sequence-unit.is-collapsed > .sequence-unit-body {
  display: none;
}

.sequence-unit-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.sequence-unit-heading h3 {
  margin: 0;
}

.sequence-unit-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
  flex-wrap: wrap;
}

.sequence-workout-block.sequence-unit {
  padding: 0;
  overflow: hidden;
}

.sequence-group-heading {
  padding: .75rem .85rem;
  background: rgba(36, 123, 131, .08);
}

.sequence-group-body {
  padding: 0 .85rem .85rem;
}

.sequence-round-entry.sequence-unit .sequence-unit-body {
  border-top: 1px solid rgba(36, 123, 131, .13);
}

.sequence-round-entry.sequence-unit.is-collapsed {
  min-height: 0;
}

.sequence-round-entry.sequence-unit.is-collapsed .sequence-round-heading,
.sequence-workout-block.sequence-unit.is-collapsed .sequence-group-heading {
  background: rgba(36, 123, 131, .06);
}

.sequence-unit-toggle {
  min-width: 62px;
}

@media (max-width: 680px) {
  .structured-sequence-entry {
    padding: .7rem;
  }

  .sequence-workout-block {
    padding: .6rem;
  }

  .sequence-workout-block.sequence-unit {
    padding: 0;
  }

  .sequence-unit-heading,
  .sequence-round-heading.sequence-unit-heading {
    align-items: stretch;
    flex-direction: column;
    padding: .65rem;
  }

  .sequence-unit-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .sequence-unit-actions .mini-button {
    width: auto;
    min-height: 38px;
  }

  .sequence-unit-actions .mini-button:first-child {
    width: 100%;
  }

  .sequence-group-body {
    padding: 0 .55rem .55rem;
  }

  .sequence-round-within-group .sequence-round-heading {
    gap: .45rem;
    padding: .6rem;
  }
}
