:root {
  --topbar-height: 64px;
  --side-width: clamp(280px, 21vw, 336px);
  --output-width: clamp(320px, 27vw, 430px);
  --progress-exercise-width: 252px;
  --progress-week-width: 208px;
  --progress-table-width: 1500px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.8), transparent 34%),
    linear-gradient(32deg, rgba(112, 124, 136, 0.045), transparent 25% 62%, rgba(255, 255, 255, 0.48) 78%),
    var(--page);
  color: var(--ink);
  font: 400 var(--text-base)/1.45 var(--font);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  min-height: var(--control-height);
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  background: var(--accent);
  color: #fff;
  padding: 7px 11px;
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.2;
}

button:hover {
  background: var(--accent-dark);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid rgba(138, 16, 40, 0.34);
  outline-offset: 1px;
}

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

button.saved,
.quiet-button,
.ghost-button {
  border-color: var(--line);
  background: #fff;
  color: var(--accent);
}

.danger-button {
  background: var(--danger);
}

.danger-button:hover {
  background: #7e151b;
}

button.saved:hover,
.quiet-button:hover,
.ghost-button:hover {
  background: var(--soft);
}

button.unsaved {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  box-shadow: 0 0 0 2px rgba(138, 16, 40, 0.1);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: var(--control-shadow);
  font-size: var(--text-base);
  line-height: 1.3;
}

input,
select {
  min-height: var(--control-height);
  padding: 7px 9px;
}

select {
  padding-right: 30px;
}

textarea {
  min-height: 76px;
  overflow-y: hidden;
  padding: 9px;
  resize: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--title-font);
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  clip-path: inset(50%) !important;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(210px, auto) auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: var(--topbar-height);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 249, 250, 0.97);
  box-shadow: 0 2px 4px rgba(31, 35, 40, 0.1);
  padding: 8px 14px;
  backdrop-filter: blur(10px);
}

.brand-lockup {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  width: 25px;
  height: 39px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 1px;
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 600;
  text-transform: uppercase;
}

.command-title-row {
  display: flex;
  gap: 9px;
  align-items: baseline;
  min-width: 0;
}

.command-title-row h1 {
  flex: 0 0 auto;
  margin: 0;
  color: var(--accent);
  font-size: var(--text-display);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.command-title-row > span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-small);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
  box-shadow: var(--control-shadow);
  padding: 2px;
}

.workspace-tabs button,
.workspace-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 9px;
  font-size: var(--text-small);
  font-weight: 500;
  text-decoration: none;
}

.workspace-tabs button:hover,
.workspace-tabs a:hover {
  background: var(--soft);
  color: var(--ink);
}

.workspace-tabs button.active {
  background: var(--accent);
  color: #fff;
}

.command-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.command-icon {
  flex: 0 0 31px;
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  min-height: 31px;
  padding: 0;
  font-size: var(--text-section);
  line-height: 1;
}

.history-button {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.command-actions .save-state-note {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 30px;
  color: var(--muted);
  font-size: var(--text-secondary);
  white-space: nowrap;
}

.save-state-note::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.save-state-note.unsaved {
  color: var(--accent);
}

.save-state-note.unsaved::before {
  background: var(--accent);
}

.save-state-note.saved {
  color: var(--positive);
}

.save-state-note.saved::before {
  background: var(--positive);
}

.command-save {
  min-height: 32px;
  padding: 6px 11px;
  white-space: nowrap;
}

.topbar .status {
  max-width: 138px;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.programming-account-state {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status.error {
  color: var(--danger);
}

.app-layout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
  padding: 12px 12px 24px 0;
}

.dock-rail {
  position: sticky;
  top: calc(var(--topbar-height) + 12px);
  z-index: 30;
  display: none;
  flex: 0 0 44px;
  width: 44px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 var(--panel-radius) var(--panel-radius) 0;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 7px 5px;
}

.app-layout.sidebar-collapsed.output-collapsed .dock-rail {
  display: grid;
  gap: 7px;
  align-content: start;
}

.side-toggle,
.output-toggle.panel-toggle {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: 50%;
  padding: 0;
  font-size: 19px;
}

.dock-rail .dock-toggle {
  display: inline-grid;
  width: 34px;
  height: 34px;
  min-height: 34px;
  place-items: center;
  border-radius: 6px;
  padding: 0;
}

.dock-toggle-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-panel {
  position: sticky;
  top: calc(var(--topbar-height) + 12px);
  flex: 0 0 var(--side-width);
  width: var(--side-width);
  height: calc(100vh - var(--topbar-height) - 24px);
  max-height: calc(100vh - var(--topbar-height) - 24px);
  overflow: auto;
  scrollbar-width: thin;
}

.app-layout.sidebar-collapsed .side-panel {
  display: none;
}

.side-panel-content,
.programme-panel {
  min-height: 100%;
}

.programme-panel,
.overview-panel,
.builder-panel,
.progression-panel,
.output-panel,
.review-output-panel,
.review-health-panel,
.analytics-panel,
.weekly-grid {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.programme-panel {
  display: flex;
  flex-direction: column;
  border-radius: 0 var(--panel-radius) var(--panel-radius) 0;
}

.section-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border-bottom: 1px solid var(--fine-line);
  padding: 9px 11px;
}

.section-heading h2 {
  margin: 0;
  font-size: var(--text-section);
  font-weight: 700;
  text-transform: uppercase;
}

.panel-actions,
.overview-actions,
.builder-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  flex-wrap: wrap;
}

.side-panel .section-heading {
  position: relative;
  padding-right: 48px;
}

.side-panel .panel-toggle {
  position: absolute;
  top: 9px;
  right: 9px;
}

.saved-programmes,
.programme-controls,
.control-strip {
  display: grid;
  gap: 7px;
  border-bottom: 1px solid var(--fine-line);
  padding: 10px 11px;
}

.saved-programmes label,
.programme-controls label,
.control-strip label,
.control-strip > div,
.goals-grid label {
  display: grid;
  gap: 3px;
}

.saved-programmes span,
.programme-controls span,
.control-strip span,
.goals-grid span,
.builder-week-select span {
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 600;
  text-transform: uppercase;
}

.saved-programmes button,
.programme-controls button,
.control-strip button {
  width: 100%;
}

.saved-programmes {
  grid-template-columns: 1fr auto auto;
}

.saved-programmes label {
  grid-column: 1 / -1;
}

.saved-programmes button {
  min-height: 34px;
}

.saved-programmes #load-programme {
  grid-column: 1 / 3;
}

.backup-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  border-top: 1px solid var(--fine-line);
  padding-top: 7px;
}

.backup-actions button {
  min-height: 32px;
  font-size: var(--text-small);
  font-weight: 500;
}

.control-strip strong {
  display: flex;
  align-items: center;
  min-height: var(--control-height);
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
  padding: 7px 9px;
  font-weight: 500;
}

.sidebar-goals {
  padding: 10px 11px 14px;
}

.sidebar-section-heading {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sidebar-section-heading h3 {
  margin: 0;
  font-size: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
}

.sidebar-section-heading button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: var(--text-small);
}

.sidebar-goals .goals-grid {
  display: grid;
  gap: 7px;
}

.sidebar-goals textarea {
  min-height: 58px;
  font-size: var(--text-secondary);
}

.main-content {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

.session-context {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 38px;
  margin-bottom: 7px;
  border-bottom: 1px solid var(--line);
  padding: 0 4px;
}

.session-context > span {
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 500;
  text-transform: uppercase;
  white-space: nowrap;
}

.builder-session-tabs {
  display: flex;
  gap: 16px;
  min-width: 0;
}

.builder-session-tabs button {
  position: relative;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 2px 8px;
  font-size: var(--text-base);
  font-weight: 500;
}

.builder-session-tabs button::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
}

.builder-session-tabs button:hover {
  color: var(--ink);
}

.builder-session-tabs button.active {
  color: var(--accent);
  font-weight: 600;
}

.builder-session-tabs button.active::after {
  background: var(--accent);
}

.overview-panel {
  margin-bottom: 10px;
}

.overview-panel textarea {
  display: block;
  min-height: 82px;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: none;
  font-size: var(--text-base);
  line-height: 1.5;
}

.overview-actions button {
  min-height: 32px;
  font-size: var(--text-small);
}

#programme-management-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}

.programme-management-form [hidden] {
  display: none !important;
}

.programme-management-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.programme-management-form input,
.programme-management-form select {
  width: 100%;
  min-width: 0;
}

.programme-management-form .management-review {
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
}

.programme-management-form input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin: 2px 0 0;
  box-shadow: none;
}

.programme-management-form p {
  overflow-wrap: anywhere;
  margin: 0;
}

#programme-management-error {
  color: var(--danger);
}

.programme-management-form footer {
  flex-wrap: wrap;
}

.workspace {
  min-width: 0;
}

.programme-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(0, 1.65fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.programme-workspace.builder-pane-collapsed {
  grid-template-columns: 48px minmax(0, 1fr);
}

.programme-build-rail {
  position: sticky;
  top: calc(var(--topbar-height) + 8px);
  display: none;
  width: 48px;
  min-height: 156px;
  align-items: center;
  align-self: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 0 var(--panel-radius) var(--panel-radius) 0;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--brand);
  padding: 12px 8px;
}

.builder-pane-collapsed .programme-build-rail {
  display: flex;
  flex-direction: column;
}

.builder-pane-collapsed .programme-build-pane {
  display: none;
}

.programme-build-rail-icon {
  font-size: 24px;
  line-height: 1;
}

.programme-build-rail-label {
  font-size: var(--text-small);
  font-weight: 700;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.programme-build-pane {
  position: sticky;
  top: calc(var(--topbar-height) + 8px);
  display: flex;
  max-height: calc(100vh - var(--topbar-height) - 16px);
  flex-direction: column;
}

.programme-build-pane .builder-exercise-list {
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.programme-progress-pane {
  min-width: 0;
  overflow: visible;
}

.programme-progress-pane > .section-heading,
.programme-build-pane > .section-heading {
  align-items: flex-start;
}

.programme-build-pane > .section-heading {
  display: grid;
  flex-shrink: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.programme-build-pane > .section-heading .builder-actions {
  grid-column: 1 / -1;
}

.programme-build-toggle {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: 50%;
  padding: 0;
  font-size: 20px;
}

.panel-kicker {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 600;
  text-transform: uppercase;
}

.programme-build-pane .builder-actions {
  display: flex;
  flex-shrink: 0;
  justify-content: flex-start;
  align-items: center;
  padding: 10px 11px;
  border-bottom: 1px solid var(--fine-line);
}

.builder-edit-options {
  width: 100%;
  min-width: 0;
}

.builder-edit-options summary {
  cursor: pointer;
  color: var(--muted);
  font-size: var(--text-small);
}

.progression-scope-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.programme-build-pane .builder-edit-options .edit-scope-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  margin-top: 8px;
}

.programme-build-pane .builder-edit-options select {
  width: 100%;
  min-width: 0;
}

.programme-build-pane .overview-panel {
  border: 0;
  border-bottom: 1px solid var(--fine-line);
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.programme-build-pane .overview-panel .section-heading {
  flex-wrap: wrap;
  gap: 8px;
}

.programme-build-pane .overview-panel h2 {
  font-size: var(--text-secondary);
}

.programme-build-pane .edit-scope-controls {
  flex: 1 1 100%;
  justify-content: flex-end;
}

.programme-build-pane .edit-scope-controls label:last-child select {
  width: 158px;
}

.builder-panel {
  container: builder / inline-size;
}

.app-layout.progress-mode .builder-panel {
  overflow: visible;
}

.builder-panel > .section-heading {
  min-height: 48px;
}

.builder-actions button,
.builder-actions select,
.builder-actions .mode-pill {
  min-height: 32px;
  font-size: var(--text-small);
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-left: 2px solid var(--fine-line);
  padding: 5px 8px;
  color: var(--muted);
  font-size: var(--text-small);
}

.mode-pill[hidden] {
  display: none;
}

.mode-pill.week-mode {
  border-color: var(--accent);
  color: var(--accent);
}

.app-layout.progress-mode .builder-actions .build-action,
.app-layout.progress-mode #generate-all-notes {
  display: none;
}

.app-layout.progress-mode .edit-week-control {
  display: none;
}

.edit-scope-controls {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.edit-scope-controls label {
  display: grid;
  gap: 2px;
}

.edit-scope-controls label > span {
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 600;
  text-transform: uppercase;
}

.edit-scope-controls label:first-child select {
  width: 92px;
}

.edit-scope-controls label:last-child select {
  width: 174px;
}

.progression-analytics > summary::after,
.progression-session-panel > summary::after,
.builder-section-disclosure > summary::after,
.progression-base-editor details > summary::after,
.analytics-filter-drawer > summary::after,
.analytics-dropdown > summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 10px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
}

.progression-analytics[open] > summary::after,
.progression-session-panel[open] > summary::after,
.builder-section-disclosure[open] > summary::after,
.progression-base-editor details[open] > summary::after,
.analytics-filter-drawer[open] > summary::after,
.analytics-dropdown[open] > summary::after {
  transform: translateY(-35%) rotate(225deg);
}

.builder-exercise-list {
  padding: 6px;
}

.builder-exercise-list > div {
  display: grid;
  gap: 4px;
}

.builder-group-label {
  margin: 8px 4px 2px;
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 500;
  text-transform: uppercase;
}

.builder-exercise-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--fine-line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.68);
}

.builder-exercise-card:focus-within,
.builder-exercise-card:has(.typeahead-open) {
  z-index: 25;
}

.builder-exercise-card.focused-builder-row {
  border-color: rgba(138, 16, 40, 0.48);
  box-shadow: 0 0 0 2px rgba(138, 16, 40, 0.08);
}

.builder-exercise-card > details {
  border: 0;
}

.builder-exercise-card > details > summary {
  list-style: none;
}

.builder-exercise-card > details > summary::-webkit-details-marker {
  display: none;
}

.builder-exercise-card > details[open] {
  background: #fff;
}

.builder-exercise-summary {
  position: relative;
  display: grid;
  grid-template-columns:
    54px
    minmax(220px, 1.35fr)
    minmax(190px, 0.75fr)
    minmax(120px, 0.5fr)
    16px;
  gap: 9px;
  align-items: center;
  min-height: 52px;
  padding: 7px 10px;
  cursor: pointer;
}

.builder-exercise-summary:hover {
  background: rgba(237, 241, 244, 0.58);
}

.builder-exercise-card > details[open] > .builder-exercise-summary {
  border-bottom: 1px solid var(--fine-line);
  background: rgba(237, 241, 244, 0.45);
}

.builder-exercise-summary::after {
  content: "";
  grid-column: 5;
  grid-row: 1;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  justify-self: end;
  transform: translateY(-2px) rotate(45deg);
}

.builder-exercise-card > details[open] > .builder-exercise-summary::after {
  transform: translateY(2px) rotate(225deg);
}

.builder-section-label {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--accent);
  font-family: var(--title-font);
  font-size: var(--text-base);
  font-weight: 600;
}

.mobility-row .builder-exercise-summary {
  grid-template-columns:
    54px
    minmax(220px, 1.35fr)
    minmax(190px, 0.75fr)
    minmax(120px, 0.5fr)
    16px;
}

.mobility-section-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: rgba(138, 16, 40, 0.08);
}

.mobility-section-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.builder-exercise-name {
  display: grid;
  min-width: 0;
}

.builder-exercise-name strong {
  overflow-wrap: anywhere;
  font-family: var(--title-font);
  font-size: var(--text-emphasis);
  font-weight: 600;
  line-height: 1.28;
}

.builder-exercise-name small {
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--text-small);
}

.builder-prescription-summary {
  grid-column: 3;
  align-self: center;
  justify-self: stretch;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
}

.builder-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.builder-status-list:empty {
  display: none;
}

.builder-status {
  position: relative;
  padding-left: 9px;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.25;
  white-space: nowrap;
}

.builder-status::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  transform: translateY(-50%);
}

.builder-status.warning::before {
  background: var(--accent);
}

.builder-status.testing {
  color: var(--accent);
}

.builder-status.testing::before {
  background: var(--accent);
}

.builder-editor {
  display: grid;
  grid-template-columns:
    minmax(170px, 1fr)
    minmax(180px, 0.95fr)
    minmax(300px, 1.45fr)
    minmax(210px, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  background: rgba(247, 249, 250, 0.62);
  padding: 10px;
}

.builder-editor-section {
  min-width: 0;
}

.builder-editor-section + .builder-editor-section {
  border-left: 0;
  padding-left: 0;
}

.builder-notes-section {
  border-left: 1px solid var(--fine-line);
  padding-left: 10px;
}

.builder-editor-section > h3,
.builder-editor-heading h3 {
  margin: 0;
  color: var(--muted);
  font-family: var(--font);
  font-size: var(--text-small);
  font-weight: 500;
  text-transform: uppercase;
}

.builder-editor-heading {
  position: relative;
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
}

.builder-editor-heading .note-generate {
  display: inline-grid;
  width: 28px;
  height: 28px;
  min-height: 28px;
  place-items: center;
  border-radius: var(--control-radius);
  padding: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.builder-editor-heading .note-generate svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.builder-editor-heading .note-generate:hover {
  border-color: var(--accent);
  background: rgba(138, 16, 40, 0.06);
  color: var(--accent);
}

.builder-exercise-control-row,
.builder-notes-section > textarea {
  margin-top: 7px;
}

.builder-exercise-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  align-items: start;
  min-width: 0;
}

.builder-exercise-control-row .testing-priority-control {
  justify-self: start;
}

.testing-priority-control {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  min-height: 26px;
  border: 0;
  background: transparent;
  padding: 2px 0;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.testing-priority-control input {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  min-height: 15px;
  margin: 0;
  padding: 0;
  border-radius: 3px;
  box-shadow: none;
  accent-color: var(--accent);
}

.testing-priority-control > span {
  text-align: left;
  font-size: var(--text-secondary);
  font-weight: 500;
}

.testing-priority-control:has(input:checked) {
  color: var(--accent);
}

.builder-programming-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  border-top: 1px solid var(--fine-line);
  padding: 8px 0 0;
}

.builder-programming-grid .builder-scheme-field {
  grid-column: 1 / -1;
}

.builder-programming-grid label,
.filters-grid label,
.progression-control-group {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.builder-programming-grid label > span,
.filters-grid label > span,
.progression-control-group > span {
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 400;
  text-transform: uppercase;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  border-top: 1px solid var(--fine-line);
  padding: 8px 0 0;
}

.builder-section-disclosure,
.progression-base-editor details {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.builder-section-disclosure > summary,
.progression-base-editor details > summary {
  position: relative;
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
  border-bottom: 1px solid var(--line);
  padding: 3px 24px 5px 0;
  color: var(--ink);
  cursor: pointer;
  font-size: var(--text-small);
  font-weight: 500;
  list-style: none;
  text-transform: uppercase;
}

.builder-section-disclosure > summary::-webkit-details-marker,
.progression-base-editor details > summary::-webkit-details-marker {
  display: none;
}

.builder-section-disclosure > summary small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 400;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.builder-section-disclosure > summary:hover {
  border-color: var(--muted);
  color: var(--accent);
}

.builder-notes-section textarea {
  min-height: 92px;
}

.builder-copy-menu {
  position: relative;
  width: 32px;
  height: 26px;
}

.builder-copy-menu > summary {
  position: relative;
  display: flex;
  align-items: center;
  width: 32px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  padding: 0 13px 0 6px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.builder-copy-menu > summary::-webkit-details-marker {
  display: none;
}

.builder-copy-menu > summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 5px;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
}

.builder-copy-menu[open] > summary::after {
  transform: translateY(-35%) rotate(225deg);
}

.builder-copy-control {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  width: 220px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 7px;
}

.builder-copy-control button {
  min-height: 36px;
}

.builder-block-mode {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--fine-line);
  background: rgba(237, 241, 244, 0.62);
  padding: 8px 10px;
}

.builder-block-mode > div:first-child {
  display: grid;
}

.builder-block-mode strong {
  color: var(--accent);
  font-family: var(--title-font);
  font-size: var(--text-secondary);
  font-weight: 600;
}

.builder-block-mode span {
  color: var(--muted);
  font-size: var(--text-small);
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(76px, 1fr));
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
  padding: 2px;
}

.segmented button {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-small);
}

.segmented button.active {
  background: var(--accent);
  color: #fff;
}

.mobility-editor {
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.7fr);
}

.mobility-editor textarea {
  margin-top: 9px;
  min-height: 94px;
}

.typeahead-shell {
  position: relative;
  min-width: 0;
}

.typeahead-shell[data-typeahead-field="exercise"]::after,
.typeahead-shell[data-typeahead-field="scheme"]::after,
.typeahead-shell[data-typeahead-field="tempo"]::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  z-index: 2;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
}

.typeahead-shell[data-typeahead-field="exercise"].typeahead-open::after,
.typeahead-shell[data-typeahead-field="scheme"].typeahead-open::after,
.typeahead-shell[data-typeahead-field="tempo"].typeahead-open::after {
  transform: translateY(-35%) rotate(225deg);
}

.typeahead-shell[data-typeahead-field="exercise"] .typeahead-field,
.typeahead-shell[data-typeahead-field="scheme"] .typeahead-field,
.typeahead-shell[data-typeahead-field="tempo"] .typeahead-field {
  padding-right: 34px;
}

.typeahead-field-multiline {
  min-height: 48px;
  overflow-wrap: anywhere;
  resize: none;
}

.typeahead-results {
  position: absolute;
  top: calc(100% + 3px);
  right: 0;
  left: 0;
  z-index: 90;
  display: none;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 4px;
}

.typeahead-open .typeahead-results {
  display: grid;
}

.typeahead-shell.typeahead-open {
  z-index: 95;
}

.typeahead-results button {
  width: 100%;
  min-height: 31px;
  border: 0;
  background: #fff;
  color: var(--ink);
  padding: 6px 7px;
  text-align: left;
  font-size: var(--text-secondary);
  font-weight: 400;
}

.typeahead-results button:hover,
.typeahead-results button.typeahead-active {
  background: var(--soft);
  color: var(--accent);
}

.typeahead-empty {
  padding: 8px;
  color: var(--muted);
  font-size: var(--text-small);
}

.output-panel {
  position: sticky;
  top: calc(var(--topbar-height) + 12px);
  z-index: 30;
  flex: 0 0 var(--output-width);
  width: var(--output-width);
  height: calc(100vh - var(--topbar-height) - 24px);
  max-height: calc(100vh - var(--topbar-height) - 24px);
  border-radius: 0 var(--panel-radius) var(--panel-radius) 0;
  box-shadow: var(--shadow);
}

.app-layout.output-collapsed .output-panel {
  display: none;
}

.output-panel .section-heading {
  padding-right: 45px;
}

.output-panel .panel-toggle {
  position: absolute;
  top: 9px;
  right: 9px;
}

.output-panel-content {
  height: calc(100% - 49px);
  padding: 9px;
}

.week-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 8px;
}

.week-tabs button {
  flex: 1 0 42px;
  min-height: 32px;
  border-color: var(--line);
  background: #fff;
  color: var(--accent);
  padding: 5px;
  font-size: var(--text-small);
}

.week-tabs button.active {
  background: var(--accent);
  color: #fff;
}

.week-output {
  height: calc(100% - 42px);
  margin: 0;
  overflow: auto;
  border: 1px solid var(--fine-line);
  border-radius: var(--control-radius);
  background: rgba(255, 255, 255, 0.74);
  padding: 10px;
  color: var(--ink);
  font: 400 var(--text-secondary)/1.48 var(--font);
  white-space: pre-wrap;
}

.week-progression {
  display: grid;
  gap: 7px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 8px;
}

.progression-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 32px;
  padding: 0 2px 2px;
}

.progression-tools {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.progression-tools > span {
  color: var(--muted);
  font-size: var(--text-small);
  white-space: nowrap;
}

.progression-edit-state {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 26px;
  border-left: 2px solid var(--line);
  padding: 2px 8px;
  color: var(--muted);
  font-size: var(--text-small);
}

.progression-edit-state strong {
  color: var(--accent);
  font-size: var(--text-small);
  white-space: nowrap;
}

.progression-edit-state.week-mode {
  border-color: var(--accent);
  background: rgba(138, 16, 40, 0.035);
}

.progression-analytics,
.progression-session-panel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--fine-line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.62);
}

.progression-analytics > summary,
.progression-session-panel > summary {
  position: relative;
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 7px 32px 7px 10px;
  cursor: pointer;
  list-style: none;
}

.progression-analytics > summary::-webkit-details-marker,
.progression-session-panel > summary::-webkit-details-marker {
  display: none;
}

.progression-analytics > summary > span,
.progression-session-panel > summary > span {
  font-family: var(--title-font);
  font-size: var(--text-secondary);
  font-weight: 600;
}

.progression-analytics > summary small,
.progression-session-panel > summary small {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progression-analytics-session-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  padding: 10px;
}

.progression-analytics-session-picker > span {
  flex-basis: 100%;
  margin-right: 3px;
  color: var(--muted);
  font-size: var(--text-small);
  text-transform: uppercase;
}

.progression-analytics-session-picker label {
  position: relative;
  cursor: pointer;
}

.progression-analytics-session-picker input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
}

.progression-analytics-session-picker label span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
  padding: 4px 8px;
  color: var(--muted);
  font-size: var(--text-small);
}

.progression-analytics-session-picker input:checked + span {
  border-color: rgba(138, 16, 40, 0.3);
  background: rgba(138, 16, 40, 0.08);
  color: var(--accent);
}

.progression-analytics .analytics-line-chart {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 0;
}

.progression-analytics-scroll {
  width: calc(100% - 16px);
  max-width: calc(100% - 16px);
  margin: 8px;
  overflow-x: auto;
  border: 1px solid var(--fine-line);
  border-radius: var(--control-radius);
  overscroll-behavior-x: contain;
}

.progression-analytics-grid {
  display: grid;
  grid-template-columns:
    var(--progress-exercise-width)
    minmax(calc(var(--progress-table-width) - var(--progress-exercise-width)), 1fr);
  width: 100%;
  min-width: var(--progress-table-width);
  background: rgba(255, 255, 255, 0.48);
}

.progression-analytics-sidebar {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 0;
  border-right: 1px solid var(--fine-line);
  background: #fff;
}

.progression-analytics .analytics-line-chart svg {
  display: block;
  width: 100%;
  min-width: 0;
  height: 148px;
}

.progression-analytics .analytics-line-chart text {
  font: 500 var(--text-small)/1 var(--font);
}

.progression-analytics .analytics-line-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 8px;
  border-top: 1px solid var(--fine-line);
  margin: 0;
  padding: 10px;
  font-size: var(--text-small);
}

.progression-analytics .analytics-line-legend:empty {
  display: none;
}

.progression-analytics .analytics-line-legend i {
  width: 10px;
  height: 2px;
}

.progression-session-list {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.active-progress-session {
  overflow: visible;
}

.progression-session-content {
  min-width: 0;
  border-top: 1px solid var(--fine-line);
  padding: 7px;
}

.active-progress-session .progression-session-content {
  border-top: 0;
}

.progression-session-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  margin-bottom: 5px;
}

.progression-session-toolbar > span {
  color: var(--muted);
  font-size: var(--text-small);
}

.progression-session-toolbar button {
  min-height: 29px;
  padding: 4px 8px;
  font-size: var(--text-small);
}

.progression-session-empty {
  padding: 14px 5px;
  color: var(--muted);
}

.progression-session-empty span {
  color: var(--ink);
  font-weight: 600;
}

.progression-session-empty p {
  margin: 3px 0 0;
  font-size: var(--text-small);
}

.progression-scroll {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--fine-line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.48);
  overscroll-behavior-x: contain;
}

.progression-week-header-scroll {
  position: sticky;
  top: var(--topbar-height);
  z-index: 38;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  border: 1px solid var(--fine-line);
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  background: #e9edf0;
  box-shadow: 0 2px 3px rgba(31, 35, 40, 0.1);
}

.progression-week-header {
  display: grid;
  grid-template-columns: repeat(var(--progress-week-count, 6), minmax(var(--progress-week-width), 1fr));
  width: 100%;
  min-width: var(--progress-table-width);
}

.progression-week-header span {
  min-width: 0;
  border-right: 1px solid var(--fine-line);
  padding: 7px 8px;
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 500;
  text-align: left;
  text-transform: uppercase;
}

.progression-week-header span:last-child {
  border-right: 0;
}

.progression-week-header-scroll + .progression-scroll {
  border-top: 0;
  border-radius: 0 0 2px 2px;
}

.progression-table {
  width: 100%;
  min-width: var(--progress-table-width);
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.progression-table th,
.progression-table td {
  border-right: 1px solid var(--fine-line);
  border-bottom: 1px solid var(--fine-line);
  padding: 7px;
  vertical-align: top;
}

.progression-table tr:last-child th,
.progression-table tr:last-child td {
  border-bottom: 0;
}

.progression-table th:last-child,
.progression-table td:last-child {
  border-right: 0;
}

.progression-layout-head th {
  height: 0;
  width: auto;
  min-width: var(--progress-week-width);
  overflow: hidden;
  border-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  color: transparent;
  font-size: 0;
  line-height: 0;
}

.progression-table tbody tr:hover > td:not(.edited) {
  background: #f0f3f5;
}

.progression-cell {
  width: auto;
  min-width: var(--progress-week-width);
  background: rgba(255, 255, 255, 0.7);
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.progression-cell.edited {
  background: rgba(138, 16, 40, 0.045);
  box-shadow: inset 2px 0 0 var(--accent);
}

.progression-cell:focus-within {
  background: rgba(237, 241, 244, 0.72);
  box-shadow: inset 2px 0 0 var(--accent);
}

.progression-base-editor {
  display: grid;
  gap: 0;
  min-width: 0;
}

.progression-row-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.progression-row-identity > span {
  color: var(--accent);
  font-size: var(--text-small);
  font-weight: 700;
}

.progression-row-identity > strong,
.progression-row-identity > small,
.progression-row-identity > em {
  overflow-wrap: anywhere;
}

.progression-row-identity > strong {
  font-family: var(--title-font);
  font-size: var(--text-base);
}

.progression-row-identity > small {
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 400;
}

.progression-row-identity > em {
  color: var(--accent);
  font-size: var(--text-small);
  font-style: normal;
  font-weight: 400;
}

.progression-row-identity > button {
  width: max-content;
  min-height: 27px;
  margin-top: 3px;
  padding: 4px 8px;
  font-size: var(--text-small);
}

.progression-base-heading {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 5px 8px;
  align-items: start;
  min-width: 0;
  text-align: left;
}

.progression-base-heading > span {
  align-self: center;
  color: var(--accent);
  font-size: var(--text-small);
  font-weight: 600;
}

.progression-title-control {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.progression-title-control .typeahead-shell {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.progression-title-control .typeahead-field {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: var(--control-height);
  overflow-y: hidden;
  overflow-wrap: anywhere;
  font-family: var(--title-font);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.3;
  resize: none;
  white-space: pre-wrap;
}

.progression-base-heading small {
  color: var(--muted);
  font-size: var(--text-small);
}

.progression-base-meta {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding-top: 0;
}

.progression-base-meta small {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 26px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.progression-base-meta .testing-priority-control {
  align-self: center;
  padding-block: 0;
}

.progression-base-heading em {
  grid-column: 1 / -1;
  color: var(--accent);
  font-size: var(--text-small);
  font-style: normal;
}

.progression-base-editor > details {
  border-width: 1px 0 0;
  border-radius: 0;
  background: transparent;
}

.progression-base-editor > details > summary {
  min-height: 32px;
  padding-left: 0;
}

.progression-base-prescription {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 7px 0 2px;
}

.progression-prescription {
  min-height: 32px;
  margin-bottom: 7px;
  border-left: 2px solid var(--accent);
  background: #eef1f3;
  padding: 6px 8px;
  color: var(--ink);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.35;
}

.progression-edit-link {
  min-height: 0;
  margin: -2px 0 7px;
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-size: var(--text-small);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.progression-edit-link:hover {
  background: transparent;
  color: var(--accent-dark);
}

.progression-week-badge {
  position: relative;
  margin-bottom: 4px;
  padding-left: 9px;
  color: var(--accent);
  font-size: var(--text-small);
}

.progression-week-badge::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
}

.progression-week-badge.notes-stale {
  color: var(--danger);
}

.progression-week-badge.notes-stale::before {
  background: var(--danger);
}

.progression-week-badge.field-overrides,
.progression-week-badge.exercise-override {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 5px;
  align-items: center;
  color: var(--accent);
  padding-left: 0;
}

.progression-week-badge.exercise-override {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: start;
}

.progression-week-badge.exercise-override span {
  overflow-wrap: anywhere;
}

.progression-week-badge.exercise-override::before,
.progression-week-badge.field-overrides::before {
  content: none;
}

.progression-override-details {
  margin-bottom: 8px;
  font-size: var(--text-small);
  color: var(--muted);
}

.progression-override-details summary {
  cursor: pointer;
}

.progression-number-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.progression-number-controls label {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.progression-number-controls label > span {
  color: var(--muted);
  font-size: var(--text-small);
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .progression-number-controls {
    grid-template-columns: minmax(0, 1fr);
  }
}

.progression-week-badge.field-overrides::before {
  background: var(--accent);
}

.progression-week-badge.field-overrides button,
.progression-week-badge.exercise-override button {
  min-height: 0;
  border: 0;
  border-radius: 2px;
  background: #e9edf0;
  padding: 1px 4px;
  color: var(--muted);
  font: inherit;
  line-height: 1.35;
}

.progression-week-badge.field-overrides button:hover,
.progression-week-badge.exercise-override button:hover {
  background: #dfe4e8;
  color: var(--ink);
}

.progression-cell > label {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  margin-top: 5px;
}

.progression-cell > label > span,
.progression-note-box label {
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 400;
  text-transform: uppercase;
}

.progression-cell input[type="number"] {
  min-height: 30px;
  color: var(--accent);
  font-weight: 600;
}

.progression-cell input[type="range"] {
  min-height: 24px;
  padding: 0;
  accent-color: var(--accent);
  box-shadow: none;
}

.progression-cell > label strong {
  min-width: 34px;
  color: var(--accent);
  font-size: var(--text-base);
  font-weight: 600;
  text-align: right;
}

.progression-note-box {
  display: grid;
  gap: 2px;
  margin-bottom: 5px;
}

.progression-note-box textarea {
  min-height: 50px;
  overflow: hidden;
  resize: none;
  font-size: var(--text-secondary);
  line-height: 1.4;
}

.progression-note-box textarea:focus-visible {
  outline-color: rgba(77, 89, 99, 0.34);
}

.progression-reset {
  width: 100%;
  min-height: 27px;
  margin-top: 6px;
  border-color: var(--line);
  background: #fff;
  color: var(--accent);
  padding: 4px;
  font-size: var(--text-small);
}

.progression-reset:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.progression-reset:disabled,
.progression-reset:disabled:hover {
  border-color: var(--fine-line);
  background: #f4f6f7;
  color: var(--muted);
  opacity: 1;
}

.progression-cell > p {
  margin: 5px 0;
  color: var(--muted);
  font-size: var(--text-small);
}

.review-view {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
}

.review-panel-heading {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.review-panel-content {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.review-output-panel > .section-heading {
  min-height: 42px;
  padding-block: 6px;
}

.review-version-actions {
  display: flex;
  min-width: 0;
  margin-left: auto;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.review-version-actions button {
  min-height: 30px;
  border-radius: 3px;
  padding: 5px 9px;
  font-size: var(--text-small);
  line-height: 1.15;
  white-space: nowrap;
}

.workspace-maximise {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.client-preview-view {
  min-height: calc(100vh - var(--topbar-height) - 24px);
}

.app-layout.gym-mode .side-panel,
.app-layout.gym-mode .output-panel,
.app-layout.gym-mode .dock-rail {
  display: none;
}

body[data-app-route="client"],
body[data-app-route="gym"] {
  --topbar-height: 0px;
}

body[data-app-route="client"] .topbar,
body[data-app-route="gym"] .topbar {
  display: none;
}

body[data-app-route="client"] .side-panel,
body[data-app-route="client"] .output-panel,
body[data-app-route="client"] .dock-rail {
  display: none;
}

body[data-app-route="client"] .app-layout {
  display: block;
  min-height: 100dvh;
  padding: 0;
}

body[data-app-route="client"] .client-preview-stage {
  display: block;
  min-height: 100dvh;
  padding: 0;
}

body[data-app-route="client"] .client-preview-note {
  display: none;
}

body[data-app-route="client"] .client-phone {
  width: min(100%, 480px);
  height: 100dvh;
  max-width: none;
  margin: 0 auto;
  border-block: 0;
  border-radius: 0;
  box-shadow: 0 0 24px rgba(31, 35, 40, .12);
}

body[data-app-route="gym"] .app-layout {
  min-height: 100dvh;
  padding: 0;
}

body[data-app-route="gym"] .gym-tv,
body[data-app-route="gym"] .gym-preview-view {
  min-height: 100dvh;
  border: 0;
  border-radius: 0;
}

.app-layout.gym-mode {
  padding-left: 12px;
}

.gym-preview-view {
  min-height: calc(100vh - var(--topbar-height) - 24px);
}

.gym-tv {
  min-width: 920px;
  min-height: calc(100vh - var(--topbar-height) - 24px);
  overflow: hidden;
  border: 1px solid #cbd1d6;
  border-radius: 8px;
  background: #edf0f2;
  box-shadow: var(--shadow);
}

.gym-tv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  border-bottom: 1px solid #cbd1d6;
  background: #fff;
  padding: 12px 18px;
}

.gym-tv-brand,
.gym-tv-meta,
.gym-client-header {
  display: flex;
  align-items: center;
}

.gym-tv-brand {
  gap: 13px;
}

.gym-tv-brand img {
  width: 118px;
  height: 38px;
  object-fit: contain;
}

.gym-tv-brand span,
.gym-client-header label span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.gym-tv-brand h2 {
  margin: 1px 0 0;
  font-size: 20px;
}

.gym-tv-meta {
  gap: 7px;
}

.preview-back-button {
  min-height: 32px;
  margin-right: 10px;
  border-color: var(--line);
  background: #fff;
  color: var(--accent);
  box-shadow: none;
  padding: 5px 10px;
  font-size: 10px;
}

.preview-back-button:hover {
  background: var(--soft);
  color: var(--accent);
}

.gym-tv-meta small {
  margin-left: 5px;
  color: var(--muted);
}

.gym-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 0 4px rgba(63, 107, 85, 0.12);
}

.gym-client-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}

.gym-client-panel {
  display: flex;
  min-width: 0;
  min-height: calc(100vh - var(--topbar-height) - 124px);
  flex-direction: column;
  border: 1px solid #cbd1d6;
  border-top: 4px solid var(--client-colour);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.gym-client-header {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  padding: 12px;
}

.gym-programme-pickers {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(130px, .8fr);
  gap: 8px;
}

.gym-client-picker {
  grid-template-columns: 42px 1fr;
}

.gym-client-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: var(--client-colour);
  color: #fff;
  font: 600 12px/1 var(--title-font);
}

.gym-client-header h3 {
  margin: 0;
  font-size: 16px;
}

.gym-client-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.gym-client-header label {
  display: grid;
  gap: 3px;
}

.gym-client-header select {
  min-height: 34px;
  font-size: 11px;
}

.gym-session-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--fine-line);
  padding: 8px 12px;
}

.gym-session-title h3 {
  margin: 0;
  font-size: 13px;
}

.gym-session-title p,
.gym-session-title small {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.gym-session-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border-block: 1px solid var(--fine-line);
  background: #f7f8f9;
  padding: 8px 12px;
}

.gym-session-progress::before {
  content: "";
  grid-area: 1 / 1;
  height: 5px;
  border-radius: 3px;
  background: #dce1e5;
}

.gym-session-progress span {
  z-index: 1;
  grid-area: 1 / 1;
  width: 33%;
  height: 5px;
  border-radius: 3px;
  background: var(--client-colour);
}

.gym-session-progress small {
  color: var(--muted);
  font-size: 10px;
}

.gym-session-context,
.gym-warmup-panel {
  margin: 10px 10px 0;
  border: 1px solid #d4d9de;
  border-left: 3px solid var(--client-colour);
  border-radius: 4px;
  background: #fff;
  padding: 9px 10px;
}

.gym-session-context {
  height: 82px;
  overflow: auto;
}

.gym-session-context > span,
.gym-warmup-panel header > span,
.gym-coach-notes > span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.gym-session-context p,
.gym-warmup-panel p,
.gym-coach-notes p {
  margin: 4px 0 0;
  font-size: 10px;
  line-height: 1.42;
}

.gym-warmup-panel {
  height: 118px;
  overflow: auto;
  background: #f8f9fa;
}

.gym-warmup-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gym-warmup-panel header strong {
  font-size: 10px;
}

.gym-warmup-panel small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.gym-exercise-list {
  display: grid;
  grid-auto-rows: 250px;
  gap: 8px;
  align-content: start;
  padding: 10px;
}

.gym-exercise-card {
  position: relative;
  display: flex;
  min-height: 250px;
  flex-direction: column;
  border: 1px solid #d4d9de;
  border-radius: 5px;
  background: #fff;
  overflow: hidden;
}

.gym-exercise-card.complete {
  border-color: rgba(63, 107, 85, 0.55);
}

.gym-superset-card {
  border-left: 5px solid var(--client-colour);
  overflow: visible;
}

.gym-superset-first::after {
  content: "";
  position: absolute;
  bottom: -13px;
  left: 15px;
  z-index: 2;
  width: 5px;
  height: 13px;
  background: var(--client-colour);
}

.gym-section-code {
  display: grid;
  gap: 2px;
  justify-items: start;
}

.gym-section-code small {
  display: grid;
  width: 22px;
  height: 17px;
  place-items: center;
  border-radius: 3px;
  background: var(--client-colour);
  color: #fff;
  font-size: 9px;
  line-height: 1;
}

.gym-exercise-header-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.gym-empty-exercise {
  min-height: 92px;
  border-color: transparent;
  background: transparent;
}

.gym-exercise-card > header {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 8px;
  align-items: center;
  background: #f5f6f7;
  padding: 8px 9px;
}

.gym-exercise-card > header > span {
  color: var(--client-colour);
  font-weight: 700;
}

.gym-exercise-card h4 {
  margin: 0;
  font-size: 12px;
}

.gym-exercise-card header p {
  margin: 1px 0 0;
  color: var(--client-colour);
  font: 600 13px/1.35 var(--title-font);
}

.gym-history-button,
.gym-complete-button {
  min-height: 30px;
  border-color: #cbd1d6;
  background: #fff;
  color: var(--client-colour);
  box-shadow: none;
  padding: 5px 9px;
  font-size: 10px;
}

.gym-history-drawer {
  display: none;
  gap: 3px;
  border-bottom: 1px solid var(--fine-line);
  background: #fff8ea;
  padding: 8px 12px 8px 47px;
}

.gym-exercise-card.history-open .gym-history-drawer {
  display: grid;
}

.gym-history-drawer strong,
.gym-history-drawer span {
  font-size: 10px;
}

.gym-history-drawer span {
  color: var(--muted);
}

.gym-coach-notes {
  min-width: 0;
  border-left: 2px solid var(--client-colour);
  background: #fbfbfc;
  padding: 7px 10px 8px 12px;
  overflow: auto;
}

.gym-exercise-content {
  display: grid;
  grid-template-columns: minmax(135px, .85fr) minmax(255px, 1.5fr);
  gap: 8px;
  min-height: 0;
  padding: 8px 9px 4px;
}

.gym-score-entry {
  min-width: 0;
}

.gym-score-headings,
.gym-score-row {
  display: grid;
  grid-template-columns: 30px minmax(55px, .7fr) minmax(80px, 1fr) minmax(85px, 1fr);
  gap: 7px;
  align-items: center;
  padding-inline: 9px;
}

.gym-score-headings {
  padding-top: 7px;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.gym-score-row {
  padding-block: 4px;
}

.gym-score-row > strong {
  color: var(--client-colour);
  text-align: center;
}

.gym-score-row input,
.gym-score-row select {
  min-height: 32px;
  padding: 5px 7px;
  font-size: 11px;
}

.gym-score-row label {
  position: relative;
}

.gym-score-row label input {
  width: 100%;
  padding-right: 25px;
}

.gym-score-row label span {
  position: absolute;
  top: 9px;
  right: 7px;
  color: var(--muted);
  font-size: 9px;
}

.gym-complete-button {
  align-self: flex-end;
  margin: auto 9px 9px;
}

.gym-exercise-card.complete .gym-complete-button {
  border-color: var(--positive);
  background: var(--positive);
  color: #fff;
}

.gym-client-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  border-top: 1px solid var(--fine-line);
  padding: 10px 12px;
}

.gym-save-status {
  color: var(--muted);
  font-size: 10px;
}

.gym-client-footer button {
  background: var(--client-colour);
}

/* TV presentation scale: readable across the gym without nested scroll areas. */
.gym-tv {
  font-size: 15px;
}

.gym-tv-brand img {
  width: 150px;
  height: 48px;
}

.gym-tv-brand span,
.gym-client-header label span,
.gym-session-context > span,
.gym-warmup-panel header > span,
.gym-coach-notes > span,
.gym-score-headings {
  font-size: 12px;
}

.gym-tv-brand h2 {
  font-size: 26px;
}

.gym-tv-meta small,
.gym-session-title p,
.gym-session-title small,
.gym-session-progress small,
.gym-warmup-panel header strong,
.gym-history-drawer strong,
.gym-history-drawer span,
.gym-save-status {
  font-size: 13px;
}

.preview-back-button {
  min-height: 40px;
  padding: 8px 13px;
  font-size: 13px;
}

.gym-client-avatar {
  width: 48px;
  height: 48px;
  font-size: 15px;
}

.gym-client-header {
  grid-template-columns: 50px 1fr;
  gap: 12px;
  padding: 15px;
}

.gym-client-header select {
  min-height: 42px;
  font-size: 14px;
}

.gym-session-title {
  padding: 11px 15px;
}

.gym-session-title h3 {
  font-size: 17px;
}

.gym-session-context,
.gym-warmup-panel {
  height: auto;
  overflow: visible;
  padding: 12px 13px;
}

.gym-session-context {
  min-height: 104px;
}

.gym-warmup-panel {
  min-height: 142px;
}

.gym-session-context p,
.gym-warmup-panel p,
.gym-coach-notes p {
  font-size: 14px;
  line-height: 1.5;
}

.gym-warmup-panel small {
  font-size: 12px;
}

.gym-exercise-list {
  grid-auto-rows: minmax(310px, auto);
  gap: 12px;
  padding: 12px;
}

.gym-exercise-card {
  min-height: 310px;
}

.gym-exercise-card > header {
  grid-template-columns: 40px 1fr auto;
  padding: 11px 12px;
}

.gym-exercise-card > header > span {
  font-size: 16px;
}

.gym-exercise-card h4 {
  font-size: 21px;
  line-height: 1.25;
}

.gym-exercise-card header p {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.3;
}

.gym-history-button,
.gym-complete-button {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 13px;
}

.gym-coach-notes {
  overflow: visible;
  padding: 10px 12px 11px 14px;
}

.gym-exercise-content {
  grid-template-columns: minmax(180px, .9fr) minmax(330px, 1.6fr);
  gap: 12px;
  padding: 11px 12px 6px;
}

.gym-score-row input,
.gym-score-row select {
  min-height: 42px;
  padding: 7px 9px;
  font-size: 14px;
}

.gym-score-row > strong {
  font-size: 14px;
}

.gym-score-row label span {
  top: 13px;
  font-size: 11px;
}

.gym-client-footer {
  padding: 13px 15px;
}

.gym-client-footer button {
  min-height: 43px;
  font-size: 14px;
}

.client-preview-stage {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(320px, 390px);
  gap: 32px;
  align-items: start;
  justify-content: center;
  padding: 28px 18px 60px;
}

.client-preview-note {
  position: sticky;
  top: calc(var(--topbar-height) + 24px);
  border-left: 3px solid var(--accent);
  padding: 5px 0 5px 14px;
}

.client-preview-note span,
.client-preview-note p {
  color: var(--muted);
  font-size: var(--text-secondary);
}

.client-preview-note span {
  display: block;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.client-preview-note strong {
  display: block;
  margin-bottom: 7px;
  font: 600 var(--text-section)/1.3 var(--title-font);
}

.client-preview-note p {
  margin: 0;
}

.client-phone {
  width: 390px;
  max-width: 100%;
  height: clamp(620px, calc(100vh - var(--topbar-height) - 56px), 844px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(102, 113, 123, 0.45) transparent;
  scrollbar-width: thin;
  border: 1px solid #c8ced4;
  border-radius: 28px;
  background: #f4f5f6;
  box-shadow: 0 12px 30px rgba(31, 35, 40, 0.2);
  color: #20242a;
}

.client-phone::-webkit-scrollbar {
  width: 5px;
}

.client-phone::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: rgba(102, 113, 123, 0.45);
}

.client-device-status {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  background: #fff;
  padding: 5px 18px 3px;
  font-size: 8px;
}

.client-device-status span {
  color: var(--ink);
  font-size: 7px;
  letter-spacing: 2px;
}

.client-app-header {
  position: sticky;
  top: 24px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 18px 18px 14px;
}

.client-brand-lockup {
  min-width: 0;
}

.client-brand-lockup img {
  display: block;
  width: 94px;
  height: auto;
}

.client-app-header h2 {
  margin: 7px 0 0;
  color: var(--accent);
  font-size: 17px;
  line-height: 1.2;
}

.client-avatar {
  width: 38px;
  min-height: 38px;
  border-radius: 50%;
  padding: 0;
}

.client-builder-back {
  min-height: 30px;
  margin-left: auto;
  margin-right: 8px;
  border-color: var(--line);
  background: #fff;
  color: var(--accent);
  box-shadow: none;
  padding: 5px 8px;
  font-size: 9px;
}

.client-builder-back:hover {
  background: var(--soft);
  color: var(--accent);
}

.client-app-content {
  display: grid;
  gap: 12px;
  padding: 14px 14px 84px;
}

.client-programme-heading {
  padding: 5px 2px 2px;
}

.client-programme-heading > span {
  color: var(--accent);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}

.client-programme-heading h3 {
  margin: 3px 0 4px;
  font-size: 20px;
}

.client-programme-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.client-programme-boards {
  display: grid;
  gap: 9px;
}

.client-programme-board {
  overflow: hidden;
  border: 1px solid #d5dbe0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 35, 40, 0.08);
}

.client-programme-board.ready {
  border-color: rgba(63, 107, 85, 0.45);
}

.client-board-summary {
  display: grid;
  grid-template-columns: 38px 1fr 52px 18px;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 70px;
  border: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
  padding: 11px 12px;
  text-align: left;
}

.client-board-summary:hover {
  background: #f7f8f9;
}

.client-board-week,
.client-board-title {
  display: grid;
}

.client-board-week {
  justify-items: center;
  border-right: 1px solid var(--fine-line);
}

.client-board-week small,
.client-board-title small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 400;
}

.client-board-week strong {
  color: var(--accent);
  font-size: 15px;
}

.client-board-title strong {
  font: 600 12px/1.3 var(--title-font);
}

.client-board-progress {
  position: relative;
  display: block;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: #e5e9ed;
}

.client-board-progress i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.client-programme-board.ready .client-board-progress i {
  background: var(--positive);
}

.client-board-chevron {
  color: var(--accent);
  font-size: 16px;
  text-align: center;
}

.client-workout-screen {
  display: grid;
  gap: 10px;
}

.client-workout-header {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 2px 0 7px;
}

.client-workout-header > button {
  display: grid;
  place-items: center;
  width: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.1);
  padding: 0 1px 2px 0;
  font-size: 22px;
}

.client-workout-header > div {
  display: grid;
  min-width: 0;
}

.client-workout-header span {
  color: var(--accent);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}

.client-workout-header h3 {
  margin: 1px 0 0;
  font-size: 19px;
}

.client-workout-header > strong {
  display: grid;
  place-items: center;
  min-width: 38px;
  min-height: 28px;
  border-radius: 14px;
  background: rgba(138, 16, 40, 0.08);
  color: var(--accent);
  font-size: 10px;
}

.client-workout-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: #dfe4e8;
}

.client-workout-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.client-workout-list {
  display: grid;
  gap: 10px;
}

.client-board-overview {
  border-left: 2px solid var(--accent);
  background: #fff;
  padding: 9px 10px;
}

.client-board-overview span {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.client-board-overview p {
  margin: 3px 0 0;
  font-size: 10px;
  line-height: 1.45;
}

.client-finish-session {
  width: 100%;
  background: var(--positive);
}

.client-finish-session:hover {
  background: #315542;
}

.client-finish-hint {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.client-programme-complete {
  padding: 38px 18px;
}

.client-welcome {
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 16px;
}

.client-welcome > span,
.client-welcome p {
  font-size: 10px;
  opacity: 0.82;
}

.client-welcome h3 {
  margin: 3px 0 5px;
  font-size: 17px;
}

.client-welcome p {
  margin: 0 0 10px;
}

.client-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
}

.client-progress span {
  display: block;
  height: 100%;
  background: #fff;
  transition: width 180ms ease;
}

.client-session-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.client-session-tabs button,
.client-week-picker button {
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
  box-shadow: none;
  font-size: 10px;
}

.client-session-tabs button.active,
.client-week-picker button.active {
  border-color: var(--accent);
  background: rgba(138, 16, 40, 0.08);
  color: var(--accent);
}

.client-week-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.client-week-picker button {
  min-height: 32px;
  padding: 4px;
}

.client-overview,
.client-exercise-card,
.client-empty-state {
  border: 1px solid #d9dee3;
  border-radius: 7px;
  background: #fff;
}

.client-overview summary {
  padding: 12px 14px;
  color: var(--accent);
  font-weight: 600;
}

.client-overview > div {
  border-top: 1px solid #e7eaed;
  padding: 0 14px 13px;
  padding-top: 11px;
  color: #4f5962;
  font-size: 11px;
  line-height: 1.5;
}

.client-workout-list {
  display: grid;
  gap: 8px;
}

.client-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 4px 1px 0;
}

.client-section-title h3 {
  margin: 0;
  font-size: 14px;
}

.client-section-title span {
  color: var(--muted);
  font-size: 10px;
}

.client-exercise-card.complete {
  border-color: rgba(63, 107, 85, 0.42);
}

.client-superset-card {
  position: relative;
  overflow: visible;
  border-left: 4px solid var(--accent);
}

.client-superset-first::after {
  content: "";
  position: absolute;
  bottom: -11px;
  left: 13px;
  z-index: 2;
  width: 4px;
  height: 11px;
  background: var(--accent);
}

.client-exercise-card.partial {
  border-color: rgba(198, 116, 28, 0.48);
}

.client-exercise-card summary {
  display: grid;
  grid-template-columns: 34px 1fr 24px;
  gap: 9px;
  align-items: center;
  padding: 13px;
  cursor: pointer;
  list-style: none;
}

.client-exercise-card summary::-webkit-details-marker {
  display: none;
}

.client-exercise-number {
  display: grid;
  gap: 3px;
  justify-items: start;
  color: var(--accent);
  font-weight: 600;
}

.client-exercise-number small {
  display: grid;
  width: 21px;
  height: 16px;
  place-items: center;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  font-size: 8px;
  line-height: 1;
}

.client-mobility-icon {
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: rgba(138, 16, 40, 0.08);
}

.client-mobility-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.client-exercise-heading {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.client-exercise-heading strong {
  font: 600 12px/1.35 var(--title-font);
}

.client-exercise-heading small {
  color: var(--muted);
  font-size: 10px;
}

.client-complete-mark {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--positive);
  font-weight: 700;
}

.client-exercise-card.complete .client-complete-mark {
  border-color: rgba(63, 107, 85, 0.25);
  background: rgba(63, 107, 85, 0.12);
}

.client-exercise-card.partial .client-complete-mark {
  border-color: rgba(198, 116, 28, 0.35);
  background: rgba(198, 116, 28, 0.14);
  color: #a45c12;
  font-size: 18px;
  line-height: 1;
}

.client-exercise-body {
  display: grid;
  gap: 11px;
  border-top: 1px solid #e7eaed;
  padding: 13px;
}

.client-prescription-meta,
.client-result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.client-prescription-meta span {
  display: grid;
  gap: 2px;
  border-left: 2px solid var(--accent);
  background: #f1f3f5;
  padding: 8px 9px;
}

.client-prescription-meta small,
.client-result-grid label > span,
.client-effort-field > span,
.client-result-note > span,
.client-coach-note > span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.client-prescription-meta strong {
  font-size: 11px;
}

.client-coach-note {
  border-left: 2px solid #cbd1d6;
  padding-left: 9px;
}

.client-coach-note p {
  margin: 3px 0 0;
  font-size: 11px;
  line-height: 1.45;
}

.client-history-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
  box-shadow: none;
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 400;
}

.client-history-button:hover {
  background: var(--soft);
  color: var(--ink);
}

.client-history-button strong {
  color: var(--accent);
  font-size: 10px;
}

.client-history-empty {
  display: grid;
  gap: 3px;
  border-left: 2px solid #cbd1d6;
  background: #f3f5f6;
  padding: 10px;
}

.client-history-empty strong {
  font-size: 10px;
}

.client-history-empty span {
  color: var(--muted);
  font-size: 9px;
}

.client-result-grid label,
.client-effort-field,
.client-result-note {
  display: grid;
  gap: 4px;
}

.client-result-grid input,
.client-result-grid select,
.client-effort-field select {
  min-height: 38px;
  font-size: 11px;
}

.client-set-results {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.client-set-results legend {
  margin-bottom: 6px;
  padding: 0;
  color: var(--ink);
  font: 600 11px/1.3 var(--title-font);
}

.client-set-headings,
.client-set-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 7px;
  align-items: center;
}

.client-set-headings {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.client-set-headings span:first-child,
.client-set-row > strong {
  text-align: center;
}

.client-set-row {
  border-top: 1px solid var(--fine-line);
  padding-top: 6px;
}

.client-set-row > strong {
  color: var(--accent);
  font-size: 11px;
}

.client-set-row input {
  min-height: 38px;
  padding: 7px 8px;
  font-size: 11px;
}

.client-result-note textarea {
  min-height: 58px;
  font-size: 11px;
}

.client-complete-button {
  width: 100%;
}

.client-exercise-card.complete .client-complete-button {
  background: var(--positive);
}

.client-exercise-card.partial .client-complete-button {
  border-color: #b96c1b;
  background: #b96c1b;
  color: #fff;
}

.client-exercise-card.partial .client-complete-button:hover {
  background: #985713;
}

.client-empty-state {
  display: grid;
  gap: 4px;
  padding: 24px 16px;
  text-align: center;
}

.client-empty-state span {
  color: var(--muted);
  font-size: 10px;
}

.client-bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #d9dee3;
  background: rgba(255, 255, 255, 0.97);
  padding: 7px 9px 9px;
}

.client-home-page {
  align-content: start;
}

.client-home-welcome {
  padding: 4px 2px 2px;
}

.client-home-welcome > span {
  color: var(--accent);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}

.client-home-welcome h3 {
  margin: 3px 0 4px;
  font-size: 21px;
}

.client-home-welcome p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.client-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #d9dee3;
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.client-snapshot-grid article {
  position: relative;
  display: grid;
  min-height: 112px;
  align-content: center;
  justify-items: center;
  border-right: 1px solid var(--fine-line);
  border-bottom: 1px solid var(--fine-line);
  background: #fff;
  padding: 17px 13px 13px;
  text-align: center;
}

.client-snapshot-grid article::before {
  content: "";
  position: absolute;
  top: 12px;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.client-snapshot-grid article:nth-child(2) {
  background: #f7f8f9;
}

.client-snapshot-grid article:nth-child(3) {
  background: #f3f5f6;
}

.client-snapshot-grid article:nth-child(4) {
  background: #fafafa;
}

.client-snapshot-grid article:nth-child(2n) {
  border-right: 0;
}

.client-snapshot-grid article:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.client-snapshot-grid span,
.client-snapshot-grid small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}

.client-rpe-card {
  justify-items: center;
  text-align: center;
}

.client-rpe-card::before {
  background: var(--positive);
}

.client-rpe-ring {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 8px 0 3px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--positive) var(--rpe-fill), #dfe4e2 0);
}

.client-rpe-ring::before {
  content: "";
  grid-area: 1 / 1;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fafafa;
}

.client-rpe-ring i {
  z-index: 1;
  grid-area: 1 / 1;
  display: flex;
  align-items: baseline;
  font-style: normal;
}

.client-rpe-ring strong {
  margin: 0;
  color: var(--positive);
  font-size: 18px;
}

.client-rpe-ring small {
  margin-left: 1px;
  font-size: 7px;
}

.client-snapshot-grid strong {
  margin: 7px 0 2px;
  color: var(--accent);
  font: 600 27px/1.05 var(--title-font);
}

.client-snapshot-grid small {
  font-size: 8px;
  font-weight: 400;
  text-transform: none;
}

.client-snapshot-grid .client-rpe-ring strong {
  margin: 0;
  color: var(--positive);
  font-size: 18px;
}

.client-snapshot-grid .client-rpe-ring small {
  margin-left: 1px;
  font-size: 7px;
}

.client-active-phase,
.client-phase-pathway {
  display: grid;
  gap: 7px;
}

.client-phase-hero {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr 20px;
  gap: 11px;
  align-items: center;
  min-height: 132px;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 3px 9px rgba(31, 35, 40, 0.18);
  padding: 16px 15px 23px;
  text-align: left;
}

.client-phase-hero:hover {
  background: #741023;
}

.client-phase-hero > img {
  width: 48px;
  height: 61px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.client-phase-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.client-phase-copy small,
.client-phase-copy b {
  font-size: 9px;
  font-weight: 400;
  opacity: 0.82;
}

.client-phase-copy strong {
  overflow-wrap: anywhere;
  font: 600 15px/1.3 var(--title-font);
}

.client-phase-arrow {
  font-size: 24px;
  text-align: center;
}

.client-phase-hero > i {
  position: absolute;
  right: 15px;
  bottom: 12px;
  left: 15px;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
}

.client-phase-hero > i span {
  display: block;
  height: 100%;
  background: #fff;
}

.client-phase-list {
  display: grid;
  border: 1px solid #d9dee3;
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.client-phase-list article {
  position: relative;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid var(--fine-line);
  padding: 9px 11px;
}

.client-phase-list article:last-child {
  border-bottom: 0;
}

.client-phase-list article.current {
  border-left: 3px solid var(--accent);
  background: rgba(138, 16, 40, 0.04);
}

.client-phase-list span,
.client-phase-list small {
  color: var(--muted);
  font-size: 8px;
}

.client-phase-list strong {
  overflow-wrap: anywhere;
  font: 600 10px/1.3 var(--title-font);
}

.client-phase-list article.complete span {
  color: var(--positive);
}

.client-bottom-nav button {
  display: grid;
  gap: 2px;
  justify-items: center;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px;
  font-size: 9px;
}

.client-bottom-nav button.active {
  color: var(--accent);
}

.client-history-page {
  align-content: start;
}

.client-history-view-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-bottom: 1px solid var(--line);
}

.client-history-view-tabs button {
  position: relative;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 10px;
}

.client-history-view-tabs button::after {
  content: "";
  position: absolute;
  right: 20%;
  bottom: -1px;
  left: 20%;
  height: 2px;
  background: transparent;
}

.client-history-view-tabs button.active {
  color: var(--accent);
}

.client-history-view-tabs button.active::after {
  background: var(--accent);
}

.client-page-heading {
  padding: 5px 2px 2px;
}

.client-page-heading > span {
  color: var(--accent);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}

.client-page-heading h3 {
  margin: 3px 0 4px;
  font-size: 20px;
}

.client-page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.client-history-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid #d9dee3;
  border-radius: 7px;
  background: #fff;
}

.client-history-stats div {
  display: grid;
  gap: 2px;
  justify-items: center;
  border-right: 1px solid var(--fine-line);
  padding: 12px 5px;
}

.client-history-stats div:last-child {
  border-right: 0;
}

.client-history-stats strong {
  color: var(--accent);
  font: 600 15px/1 var(--title-font);
}

.client-history-stats span {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.client-history-list {
  display: grid;
  gap: 8px;
}

.client-history-card {
  overflow: hidden;
  border: 1px solid #d9dee3;
  border-radius: 7px;
  background: #fff;
}

.client-history-card summary {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.client-history-card summary::-webkit-details-marker {
  display: none;
}

.client-history-date,
.client-history-heading {
  display: grid;
}

.client-history-date {
  justify-items: center;
  border-right: 1px solid var(--fine-line);
}

.client-history-date strong {
  color: var(--accent);
  font-size: 15px;
}

.client-history-date small,
.client-history-heading small {
  color: var(--muted);
  font-size: 9px;
}

.client-history-heading strong {
  font: 600 11px/1.35 var(--title-font);
}

.client-history-status {
  border-radius: 10px;
  background: rgba(63, 107, 85, 0.12);
  color: var(--positive);
  padding: 4px 6px;
  font-size: 8px;
  text-transform: uppercase;
}

.client-history-card-body {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--fine-line);
  padding: 4px 12px 12px;
}

.client-history-exercise {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--fine-line);
  padding: 9px 0;
}

.client-history-exercise > span {
  display: grid;
}

.client-history-exercise strong,
.client-history-exercise b {
  font-size: 10px;
}

.client-history-exercise small {
  color: var(--muted);
  font-size: 9px;
}

.client-history-exercise b {
  color: var(--accent);
}

.client-history-feedback {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  font-size: 9px;
}

.client-history-feedback span {
  color: var(--muted);
}

.client-exercise-history-view {
  display: grid;
  gap: 12px;
}

.client-history-exercise-select {
  display: grid;
  gap: 4px;
}

.client-history-exercise-select > span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.client-history-exercise-select select {
  min-height: 42px;
  font-weight: 600;
}

.client-lift-summary {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  overflow: hidden;
  border: 1px solid #d9dee3;
  border-radius: 7px;
  background: #fff;
}

.client-lift-summary div {
  display: grid;
  gap: 3px;
  border-right: 1px solid var(--fine-line);
  padding: 11px 8px;
}

.client-lift-summary div:last-child {
  border-right: 0;
}

.client-lift-summary span {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.client-lift-summary strong {
  color: var(--accent);
  font: 600 12px/1.2 var(--title-font);
}

.client-lift-chart-card,
.client-lift-log {
  border: 1px solid #d9dee3;
  border-radius: 7px;
  background: #fff;
  padding: 12px;
}

.client-lift-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  align-items: end;
  height: 168px;
  padding-top: 12px;
}

.client-lift-bar-column {
  display: grid;
  grid-template-rows: 16px 1fr 20px;
  gap: 3px;
  align-items: end;
  height: 100%;
  text-align: center;
}

.client-lift-value {
  color: var(--ink);
  font-size: 8px;
}

.client-lift-bar-track {
  position: relative;
  width: 100%;
  height: 100%;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to top, rgba(211, 217, 223, 0.24) 1px, transparent 1px) 0 0 / 100% 25%;
}

.client-lift-bar-track span {
  position: absolute;
  right: 18%;
  bottom: 0;
  left: 18%;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
}

.client-lift-bar-column small {
  color: var(--muted);
  font-size: 7px;
  white-space: nowrap;
}

.client-lift-log {
  display: grid;
  gap: 0;
}

.client-lift-log article {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--fine-line);
  padding: 9px 0;
}

.client-lift-log time,
.client-lift-log small {
  color: var(--muted);
  font-size: 8px;
}

.client-lift-log article > span {
  display: grid;
}

.client-lift-log article strong,
.client-lift-log article b {
  font-size: 9px;
}

.client-lift-log article b {
  color: var(--accent);
}

.programme-health {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.programme-health-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.programme-health-heading > div {
  display: grid;
  gap: 2px;
}

.programme-health-heading > div > span {
  color: var(--muted);
  font-size: var(--text-small);
  text-transform: uppercase;
}

.programme-health-heading > div > strong {
  font-family: var(--title-font);
  font-size: var(--text-emphasis);
}

.programme-health-score {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 13px;
  padding: 4px 8px;
  font-size: var(--text-small);
  font-weight: 600;
  text-transform: uppercase;
}

.programme-health-score.complete {
  background: rgba(63, 107, 85, 0.12);
  color: var(--positive);
}

.programme-health-score.warning {
  background: rgba(138, 16, 40, 0.08);
  color: var(--accent);
}

.programme-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 5px;
}

.programme-health-check {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 58px;
  border: 1px solid var(--fine-line);
  border-radius: var(--control-radius);
  background: rgba(255, 255, 255, 0.68);
  padding: 7px;
}

.programme-health-check > span {
  color: var(--muted);
  font-size: var(--text-small);
  text-transform: uppercase;
}

.programme-health-check > strong {
  overflow-wrap: anywhere;
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.35;
}

.programme-health-check.warning {
  border-color: rgba(138, 16, 40, 0.2);
  background: rgba(138, 16, 40, 0.04);
}

.programme-health-check.warning > strong {
  color: var(--accent);
}

.programme-health-check > summary {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style-position: inside;
}

.programme-health-check > summary > span {
  color: var(--muted);
  font-size: var(--text-small);
  text-transform: uppercase;
}

.programme-health-check > summary > strong {
  color: var(--accent);
  font-size: var(--text-small);
  white-space: nowrap;
}

.programme-health-issues {
  display: grid;
  gap: 5px;
  max-height: 260px;
  overflow-y: auto;
  border-top: 1px solid rgba(138, 16, 40, 0.14);
  padding-top: 7px;
}

.programme-health-issues button {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 0;
  border: 1px solid var(--fine-line);
  border-radius: var(--control-radius);
  background: #fff;
  padding: 7px 9px;
  color: var(--ink);
  text-align: left;
}

.programme-health-issues button:hover,
.programme-health-issues button:focus-visible {
  border-color: var(--accent);
  background: rgba(138, 16, 40, 0.035);
}

.programme-health-issues button strong {
  color: var(--accent);
  font-size: var(--text-small);
}

.programme-health-issues button span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.35;
}

.review-output-panel .weekly-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 10px;
}

.weekly-grid article {
  flex: 0 0 min(400px, 84vw);
  min-width: 0;
  border: 1px solid var(--fine-line);
  border-radius: var(--control-radius);
  background: #fff;
  padding: 10px;
}

.weekly-grid article h3 {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: var(--text-emphasis);
  font-weight: 600;
}

.weekly-grid article pre {
  margin: 0;
  font: 400 var(--text-small)/1.45 var(--font);
  white-space: pre-wrap;
}

.analytics-panel .section-heading {
  overflow: visible;
}

.analytics-filter-drawer {
  position: relative;
}

.analytics-filter-drawer > summary {
  position: relative;
  display: flex;
  align-items: center;
  width: 82px;
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
  padding: 5px 24px 5px 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: var(--text-small);
  list-style: none;
}

.analytics-filter-drawer > summary::-webkit-details-marker {
  display: none;
}

.analytics-filter-drawer .analytics-controls {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 60;
  width: min(560px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: #fff;
  box-shadow: 0 4px 12px rgba(24, 31, 38, 0.2);
  isolation: isolate;
  padding: 9px;
}

.analytics-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.analytics-controls > div {
  display: grid;
  gap: 4px;
}

.analytics-controls > div > span {
  color: var(--muted);
  font-size: var(--text-small);
  text-transform: uppercase;
}

.analytics-dropdown {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
}

.analytics-dropdown > summary {
  position: relative;
  min-height: 34px;
  padding: 7px 25px 7px 8px;
  cursor: pointer;
  font-size: var(--text-small);
  list-style: none;
}

.analytics-dropdown > summary::-webkit-details-marker {
  display: none;
}

.analytics-menu-list {
  display: grid;
  gap: 3px;
  max-height: 220px;
  overflow: auto;
  border-top: 1px solid var(--fine-line);
  padding: 5px;
}

.analytics-menu-item {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: var(--text-small);
}

.analytics-menu-item input {
  width: 14px;
  min-height: 14px;
  box-shadow: none;
}

.analytics-view-tabs {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--fine-line);
  padding: 0 10px;
}

.analytics-view-tabs button {
  position: relative;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 1px 8px;
  font-size: var(--text-small);
  font-weight: 500;
  white-space: nowrap;
}

.analytics-view-tabs button.active {
  color: var(--accent);
}

.analytics-view-tabs button.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
}

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  border-bottom: 1px solid var(--fine-line);
}

.analytics-kpi {
  display: grid;
  gap: 2px;
  min-height: 58px;
  border-right: 1px solid var(--fine-line);
  padding: 9px;
}

.analytics-kpi:last-child {
  border-right: 0;
}

.analytics-kpi span {
  color: var(--muted);
  font-size: var(--text-small);
  text-transform: uppercase;
}

.analytics-kpi strong {
  font-family: var(--title-font);
  font-size: var(--text-section);
  font-weight: 600;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.analytics-grid article {
  min-width: 0;
  border: 1px solid var(--fine-line);
  border-radius: var(--control-radius);
  background: rgba(255, 255, 255, 0.72);
  padding: 9px;
}

.analytics-grid article h3 {
  margin: 0 0 7px;
  color: var(--muted);
  font-family: var(--font);
  font-size: var(--text-small);
  font-weight: 600;
  text-transform: uppercase;
}

.analytics-grid .movement-volume-panel {
  grid-column: 1 / -1;
  padding: 0;
}

.movement-volume-heading {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--fine-line);
  padding: 9px 10px;
}

.analytics-grid .movement-volume-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: var(--text-secondary);
  text-transform: none;
}

.movement-volume-heading span {
  color: var(--muted);
  font-size: var(--text-small);
}

.movement-volume-chart {
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
}

.movement-volume-axis,
.movement-volume-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(420px, 2fr) 52px;
  gap: 10px;
  min-width: 650px;
  align-items: center;
}

.movement-volume-axis {
  border-bottom: 1px solid var(--fine-line);
  padding: 7px 10px;
  color: var(--muted);
  font-size: var(--text-small);
  text-transform: uppercase;
}

.movement-volume-axis .movement-volume-scale,
.movement-volume-week {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
}

.movement-volume-scale > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.movement-volume-scale > span:last-child {
  text-align: right;
}

.movement-volume-axis strong {
  color: var(--muted);
  font-weight: 500;
}

.movement-volume-row {
  min-height: 96px;
  border-bottom: 1px solid var(--fine-line);
  padding: 8px 10px;
}

.movement-volume-row:last-child {
  border-bottom: 0;
}

.movement-volume-label {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: var(--text-small);
  font-weight: 600;
}

.movement-volume-label i {
  width: 8px;
  height: 8px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--series-color);
}

.movement-volume-plot {
  min-width: 0;
}

.movement-volume-bars {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.movement-volume-week {
  min-height: 24px;
  min-width: 0;
  border-radius: 3px;
}

.movement-volume-track {
  height: 14px;
  overflow: hidden;
  border-radius: 3px;
  background-color: var(--soft);
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: 25% 100%;
}

.movement-volume-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: var(--series-color);
  opacity: 0.82;
}

.movement-volume-week:hover .movement-volume-track > span,
.movement-volume-week:focus-visible .movement-volume-track > span {
  opacity: 1;
}

.movement-volume-week:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.movement-volume-week small,
.movement-volume-week > strong {
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 500;
  white-space: nowrap;
}

.movement-volume-week > strong {
  color: var(--ink);
  text-align: right;
}

.movement-volume-row > strong {
  color: var(--ink);
  font-size: var(--text-small);
  font-weight: 600;
  text-align: right;
}

@media (max-width: 760px) {
  .movement-volume-axis,
  .movement-volume-row {
    grid-template-columns: minmax(0, 1fr) 52px;
    min-width: 0;
    gap: 8px;
  }

  .movement-volume-axis > span,
  .movement-volume-label {
    grid-column: 1;
    grid-row: 1;
  }

  .movement-volume-axis > strong,
  .movement-volume-row > strong {
    grid-column: 2;
    grid-row: 1;
  }

  .movement-volume-axis .movement-volume-scale,
  .movement-volume-plot {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.analytics-line-chart {
  min-height: 150px;
  overflow: auto;
}

.analytics-line-chart svg {
  display: block;
  min-width: 620px;
  width: 100%;
  height: auto;
  max-height: 240px;
}

.analytics-line-chart text {
  font: 500 var(--text-small)/1 var(--font);
}

.analytics-grid-line {
  stroke: #e4e8ec;
  stroke-width: 0.8;
}

.analytics-axis {
  stroke: #aeb7bf;
  stroke-width: 0.9;
}

.analytics-line-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--text-small);
}

.analytics-line-legend span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.analytics-line-legend i {
  background: var(--series-color);
  display: inline-block;
  width: 12px;
  height: 2px;
}

.review-analytics-line-panel {
  margin: 0 10px 10px;
  border: 1px solid var(--fine-line);
  border-radius: var(--control-radius);
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
}

.review-analytics-line-heading {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.review-analytics-line-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: var(--text-secondary);
  font-weight: 600;
}

.review-analytics-line-heading span {
  color: var(--muted);
  font-size: var(--text-small);
}

.review-analytics-line-panel .analytics-line-chart {
  min-height: 160px;
  overflow-x: auto;
}

.review-analytics-line-panel .analytics-line-chart svg {
  min-width: 720px;
  max-height: 210px;
}

.analytics-bars {
  display: grid;
  gap: 6px;
}

.analytics-bar-row {
  display: grid;
  grid-template-columns: minmax(88px, 0.8fr) minmax(100px, 1.5fr) 40px;
  gap: 7px;
  align-items: center;
  font-size: var(--text-small);
}

.analytics-bar-row > span {
  overflow-wrap: anywhere;
}

.analytics-bar-row strong {
  font-size: var(--text-small);
  font-weight: 500;
  text-align: right;
}

.analytics-bar-track {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--soft);
}

.analytics-bar-track > div {
  display: block;
  height: 100%;
  background: var(--accent);
}

.analytics-empty,
.analytics-note {
  color: var(--muted);
  font-size: var(--text-small);
}

.analytics-note-card {
  grid-column: 1 / -1;
}

.analytics-unmapped-list,
.analytics-unmapped-section {
  display: grid;
  gap: 5px;
}

.analytics-unmapped-section h4 {
  margin: 0;
  color: var(--accent);
  font-size: var(--text-small);
  font-weight: 600;
}

.analytics-unmapped-section ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: var(--text-small);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(31, 35, 40, 0.52);
  padding: 18px;
}

.confirm-modal {
  position: relative;
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 35, 40, 0.3);
  padding: 18px;
}

.confirm-modal h2 {
  margin-bottom: 7px;
  font-size: var(--text-heading);
}

.confirm-modal p {
  color: var(--muted);
}

.uploader-handoff-modal {
  width: min(660px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow-y: auto;
}

.uploader-handoff-context,
.uploader-handoff-session {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.55fr);
  gap: 10px;
}

.uploader-handoff-context label,
.uploader-handoff-session label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.uploader-handoff-context span,
.uploader-handoff-session span {
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 600;
  text-transform: uppercase;
}

.uploader-handoff-sessions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.uploader-handoff-session {
  border-top: 1px solid var(--fine-line);
  padding-top: 8px;
}

.uploader-handoff-session strong {
  grid-column: 1 / -1;
  font-size: var(--text-secondary);
}

.uploader-handoff-status {
  min-height: 20px;
  margin-bottom: 0;
  font-size: var(--text-small);
}

.uploader-handoff-athlete-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.uploader-handoff-athlete-confirm input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.uploader-handoff-status[data-status="error"] {
  color: var(--accent);
  font-weight: 600;
}

.progression-scope-modal {
  width: min(540px, calc(100vw - 28px));
}

.progression-week-picker {
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
}

.progression-week-picker > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--control-height);
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
}

.progression-week-picker > summary::-webkit-details-marker {
  display: none;
}

.progression-week-picker > summary span {
  color: var(--muted);
}

.progression-week-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 5px;
  max-height: min(42vh, 320px);
  overflow-y: auto;
  border-top: 1px solid var(--fine-line);
  padding: 8px;
}

.progression-week-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 7px;
}

.progression-week-options input {
  width: 16px;
  min-height: 16px;
  box-shadow: none;
}

.progression-scope-warning {
  border-left: 3px solid var(--accent);
  background: var(--soft);
  padding: 7px 9px;
  color: var(--accent-dark);
}

.app-layout.progress-mode .edit-scope-target-control {
  display: none;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.notes-confirm-modal {
  width: min(520px, 100%);
}

.notes-generation-options {
  display: grid;
  gap: 7px;
  margin: 14px 0;
}

.notes-generation-options button {
  display: grid;
  gap: 3px;
  min-height: 54px;
  padding: 9px 11px;
  text-align: left;
}

.notes-generation-options button strong {
  font-family: var(--title-font);
  font-size: var(--text-base);
}

.notes-generation-options button span {
  font-size: var(--text-small);
  font-weight: 400;
}

@container builder (max-width: 1120px) {
  .builder-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "exercise notes"
      "filters notes"
      "programming notes";
  }

  .builder-editor-section + .builder-editor-section {
    border-left: 0;
    padding-left: 0;
  }

  .builder-exercise-select {
    grid-area: exercise;
  }

  .builder-filter-section {
    grid-area: filters;
  }

  .builder-programming-section {
    grid-area: programming;
  }

  .builder-notes-section {
    grid-area: notes;
    border-left: 1px solid var(--fine-line);
    padding-left: 10px;
  }

  .mobility-editor {
    grid-template-areas: "mobility notes";
  }

  .mobility-editor > .builder-editor-section:first-child {
    grid-area: mobility;
  }

  .builder-exercise-summary {
    grid-template-columns: 48px minmax(150px, 1fr) minmax(120px, 0.65fr) 16px;
  }

  .mobility-row .builder-exercise-summary {
    grid-template-columns: 48px minmax(150px, 1fr) minmax(120px, 0.65fr) 16px;
  }

  .builder-status-list {
    display: none;
  }

  .builder-exercise-summary::after {
    grid-column: 4;
  }
}

@container builder (max-width: 680px) {
  .builder-editor,
  .mobility-editor {
    grid-template-columns: 1fr;
    grid-template-areas:
      "exercise"
      "filters"
      "programming"
      "notes";
  }

  .mobility-editor {
    grid-template-areas:
      "mobility"
      "notes";
  }

  .builder-programming-grid,
  .filters-grid {
    grid-template-columns: 1fr;
  }

  .builder-exercise-control-row {
    grid-template-columns: 1fr;
  }

  .builder-notes-section {
    border-left: 0;
    padding-left: 0;
  }

  .builder-exercise-summary {
    grid-template-columns: 42px minmax(0, 1fr) 16px;
  }

  .mobility-row .builder-exercise-summary {
    grid-template-columns: 42px minmax(0, 1fr) 16px;
  }

  .builder-prescription-summary {
    display: none;
  }

  .builder-exercise-summary::after {
    grid-column: 3;
  }
}

@media (min-width: 1600px) {
  :root {
    --text-small: 11px;
    --text-secondary: 12px;
  }
}

@media (max-width: 1220px) and (min-width: 701px) {
  .programme-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: auto 1fr;
  }

  .brand-lockup {
    display: none;
  }

  .command-actions .save-state-note,
  .command-actions .status,
  .programming-account-state {
    display: none;
  }

  .programme-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .programme-workspace.builder-pane-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .builder-pane-collapsed .programme-build-rail {
    position: static;
    width: 100%;
    min-height: 44px;
    flex-direction: row;
    justify-content: flex-start;
    border-radius: var(--panel-radius);
    padding: 7px 12px;
  }

  .programme-build-rail-label {
    writing-mode: horizontal-tb;
    transform: none;
  }

  .programme-build-pane {
    position: static;
    max-height: none;
  }

  .programme-build-pane .builder-exercise-list {
    overflow-y: visible;
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-height: 104px;
    --progress-exercise-width: 220px;
    --progress-week-width: 184px;
    --progress-table-width: 1324px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 7px 9px;
  }

  .uploader-handoff-context,
  .uploader-handoff-session {
    grid-template-columns: 1fr;
  }

  .uploader-handoff-session strong {
    grid-column: auto;
  }

  .workspace-tabs {
    width: 100%;
  }

  .client-preview-stage {
    grid-template-columns: 1fr;
    padding: 12px 0 40px;
  }

  .client-preview-note {
    position: static;
  }

  .client-phone {
    width: 100%;
    max-width: 390px;
    height: calc(100dvh - var(--topbar-height) - 30px);
    min-height: 520px;
    margin: 0 auto;
    border-radius: 18px;
  }

  .command-actions {
    justify-content: stretch;
  }

  .command-save {
    flex: 1 1 auto;
  }

  .history-button {
    display: none;
  }

  .app-layout {
    display: block;
    padding: 9px;
  }

  .dock-rail {
    position: fixed;
    top: calc(var(--topbar-height) + 9px);
    left: 0;
    z-index: 46;
  }

  .side-panel {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    z-index: 45;
    width: min(336px, calc(100vw - 26px));
    height: calc(100vh - var(--topbar-height));
    max-height: calc(100vh - var(--topbar-height));
    box-shadow: 5px 0 12px rgba(31, 35, 40, 0.2);
  }

  .session-context {
    overflow-x: auto;
  }

  .section-heading {
    align-items: flex-start;
  }

  .builder-panel > .section-heading {
    flex-direction: column;
  }

  .builder-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .programme-build-pane .edit-scope-controls {
    justify-content: flex-start;
  }

  .builder-actions > button {
    flex: 1 1 150px;
  }

  .edit-scope-controls {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }

  .edit-scope-controls label:last-child {
    flex: 1 1 190px;
  }

  .edit-scope-controls label:last-child select {
    width: 100%;
  }

  .output-panel {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    z-index: 45;
    width: min(100%, 430px);
    height: calc(100vh - var(--topbar-height));
    max-height: calc(100vh - var(--topbar-height));
    border-radius: 0 var(--panel-radius) 0 0;
    box-shadow: 5px 0 12px rgba(31, 35, 40, 0.2);
  }

  .progression-intro {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .progression-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .programme-health-grid,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-filter-drawer .analytics-controls {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    left: auto;
    width: min(360px, calc(100vw - 24px));
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .session-context {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }

  .builder-session-tabs {
    width: 100%;
  }

  .builder-session-tabs button {
    flex: 1 1 0;
  }

  .overview-panel .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .overview-actions button {
    width: 100%;
  }

  .analytics-kpis {
    grid-template-columns: 1fr;
  }

  .analytics-bar-row {
    grid-template-columns: 1fr;
  }

  .analytics-bar-row strong {
    text-align: left;
  }
}

/* Cross-screen continuity and responsive cleanup. */
.topbar,
.section-heading,
.session-context,
.builder-exercise-summary,
.progression-intro,
.programme-health-heading,
.review-analytics-line-heading {
  min-width: 0;
}

.workspace-tabs,
.command-actions,
.command-actions > *,
.panel-actions,
.builder-actions,
.edit-scope-controls {
  min-width: 0;
}

.topbar .status {
  flex: 0 1 138px;
}

.section-heading h2,
.workspace-title,
.programme-health-heading strong {
  line-height: 1.25;
}

body[data-app-route="client"] .dock-rail,
body[data-app-route="gym"] .dock-rail,
.app-layout.client-mode .dock-rail,
.app-layout.gym-mode .dock-rail {
  display: none !important;
}

.programme-health-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 7px;
}

.programme-health-check {
  min-height: 68px;
  padding: 9px;
}

.programme-health-check.warning {
  grid-column: span 2;
}

.review-output-panel .weekly-grid {
  scroll-snap-type: x proximity;
  scrollbar-gutter: stable;
}

.session-tabs,
.week-tabs,
.progression-week-header-scroll,
.progression-scroll {
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
}

.weekly-grid article {
  scroll-snap-align: start;
}

.analytics-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

.analytics-kpis {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.analytics-kpi:last-child {
  border-right: 0;
}

.analytics-filter-drawer .analytics-controls,
.analytics-menu-list {
  overscroll-behavior: contain;
}

.client-phone,
.gym-tv,
.side-panel,
.output-panel {
  scrollbar-gutter: stable;
}

@media (max-width: 1180px) and (min-width: 761px) {
  .topbar {
    grid-template-columns: minmax(350px, auto) minmax(0, 1fr);
  }

  .workspace-tabs {
    justify-self: start;
  }

  .command-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .programme-health-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    overflow: visible;
  }

  .workspace-tabs {
    grid-template-columns: repeat(3, minmax(78px, 1fr));
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .workspace-tabs::-webkit-scrollbar {
    display: none;
  }

  .workspace-tabs button,
  .workspace-tabs a {
    padding-inline: 6px;
    white-space: normal;
  }

  .session-tabs,
  .week-tabs {
    scroll-snap-type: x proximity;
  }

  .session-tabs button,
  .week-tabs button {
    scroll-snap-align: start;
  }

  .command-actions {
    width: 100%;
  }

  .command-save {
    width: 100%;
  }

  .builder-actions > button {
    padding-inline: 8px;
    white-space: nowrap;
  }

  .app-layout.sidebar-collapsed.output-collapsed:not(.client-mode):not(.gym-mode) {
    padding-left: 48px;
  }

  .dock-rail {
    top: calc(var(--topbar-height) + 10px);
  }

  .programme-health-check.warning {
    grid-column: span 1;
  }

  .programme-health-grid,
  .analytics-grid,
  .analytics-kpis {
    grid-template-columns: 1fr;
  }

  .analytics-filter-drawer .analytics-controls {
    max-height: calc(100dvh - var(--topbar-height) - 20px);
    overflow-y: auto;
  }

  .review-output-panel .weekly-grid {
    padding-inline: 8px;
  }

  .weekly-grid article {
    flex-basis: calc(100vw - 82px);
  }

  body[data-app-route="client"] .client-phone {
    width: 100%;
    height: 100dvh;
    max-width: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body[data-app-route="gym"] .app-layout,
  .app-layout.gym-mode {
    display: block;
    width: 100%;
    padding: 0;
  }

  body[data-app-route="gym"] .gym-preview-view,
  body[data-app-route="gym"] .gym-tv,
  .app-layout.gym-mode .gym-preview-view,
  .app-layout.gym-mode .gym-tv {
    width: 100%;
    min-width: 0;
    min-height: 100dvh;
    height: auto;
    overflow: visible;
  }

  .gym-tv-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 64px;
    padding: 9px 12px;
  }

  .gym-tv-brand {
    gap: 8px;
    min-width: 0;
  }

  .gym-tv-brand img {
    width: 88px;
    height: 32px;
  }

  .gym-tv-brand span {
    font-size: 9px;
  }

  .gym-tv-brand h2 {
    overflow-wrap: anywhere;
    font-size: 17px;
  }

  .gym-tv-meta {
    gap: 6px;
  }

  .gym-tv-meta .preview-back-button {
    min-height: 36px;
    margin: 0;
    padding: 7px 9px;
    font-size: 11px;
  }

  .gym-tv-meta .gym-live-dot,
  .gym-tv-meta strong,
  .gym-tv-meta small {
    display: none;
  }

  .gym-client-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .gym-client-panel {
    min-height: 520px;
  }

  .gym-client-header {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 9px;
    padding: 11px;
  }

  .gym-client-avatar {
    width: 42px;
    height: 42px;
    font-size: 13px;
  }

  .gym-programme-pickers {
    grid-template-columns: minmax(0, 1fr);
  }

  .gym-client-header select {
    width: 100%;
    min-height: 42px;
    font-size: 13px;
  }

  .gym-session-context,
  .gym-warmup-panel {
    min-height: 0;
  }

  .gym-exercise-list {
    grid-auto-rows: auto;
  }

  .gym-exercise-card {
    min-height: 0;
  }

  .gym-exercise-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .gym-coach-notes {
    min-height: 80px;
  }

  .gym-score-headings,
  .gym-score-row {
    grid-template-columns: 26px minmax(52px, .7fr) minmax(72px, 1fr) minmax(76px, 1fr);
    gap: 5px;
    padding-inline: 4px;
  }
}

@media (max-width: 430px) {
  .section-heading,
  .programme-health-heading,
  .review-analytics-line-heading {
    align-items: flex-start;
  }

  .programme-health-heading,
  .review-analytics-line-heading {
    flex-direction: column;
  }

  .builder-panel > .section-heading {
    padding: 9px;
  }

  .weekly-grid article {
    flex-basis: calc(100vw - 72px);
  }

  .gym-tv-brand img {
    display: none;
  }
}

.pdf-export {
  display: none;
  color: #20242a;
  font-family: Verdana, Arial, sans-serif;
}

body.printing-programme .pdf-export {
  position: fixed;
  top: 0;
  left: -200vw;
  display: block;
  visibility: hidden;
  width: 11.29in;
  pointer-events: none;
}

.pdf-session-page {
  width: 11.29in;
  height: 7.87in;
  overflow: hidden;
  break-after: page;
  page-break-after: always;
}

.pdf-session-page:last-child {
  break-after: auto;
  page-break-after: auto;
}

.pdf-session-fit {
  width: 100%;
  transform-origin: top left;
}

.pdf-programme-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 6.6pt;
  line-height: 1.22;
}

.pdf-programme-table caption {
  padding: 0 0 5px;
  text-align: left;
}

.pdf-programme-table caption span,
.pdf-programme-table caption strong {
  display: block;
  font-family: Montserrat, Verdana, Arial, sans-serif;
}

.pdf-programme-table caption .pdf-brand-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.pdf-programme-table caption .pdf-brand-row img {
  width: 72px;
  height: auto;
}

.pdf-programme-table caption .pdf-brand-row > span {
  min-width: 0;
  color: #68737d;
  font-size: 7pt;
  text-align: right;
  text-transform: uppercase;
}

.pdf-programme-table caption span {
  color: #68737d;
  font-size: 7pt;
  font-weight: 600;
  text-transform: uppercase;
}

.pdf-programme-table caption strong {
  color: #8a1028;
  font-size: 12pt;
  font-weight: 700;
}

.pdf-programme-table .pdf-exercise-column {
  width: 17%;
}

.pdf-programme-table .pdf-week-column {
  width: 13.833%;
}

.pdf-programme-table th,
.pdf-programme-table td {
  border: 0.5pt solid #cfd5da;
  padding: 4px;
  vertical-align: top;
  overflow-wrap: anywhere;
  text-align: left;
}

.pdf-programme-table thead th {
  background: #edf0f2;
  color: #59636d;
  font-family: Montserrat, Verdana, Arial, sans-serif;
  font-size: 6.5pt;
  font-weight: 600;
  text-transform: uppercase;
}

.pdf-programme-table tbody th {
  background: #fafbfb;
}

.pdf-programme-table tbody tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-programme-table tbody th > strong,
.pdf-programme-table tbody th > small,
.pdf-programme-table .pdf-section-label,
.pdf-programme-table .pdf-prescription,
.pdf-programme-table .pdf-rest,
.pdf-programme-table .pdf-exercise-change,
.pdf-programme-table .pdf-coach-notes span {
  display: block;
}

.pdf-programme-table tbody th > strong {
  margin-top: 2px;
  font-family: Montserrat, Verdana, Arial, sans-serif;
  font-size: 7.2pt;
  font-weight: 700;
}

.pdf-programme-table tbody th > small {
  margin-top: 3px;
  color: #68737d;
  font-size: 6.2pt;
}

.pdf-section-label,
.pdf-exercise-change {
  color: #8a1028;
  font-weight: 600;
}

.pdf-prescription {
  margin-bottom: 2px;
  font-weight: 700;
}

.pdf-rest {
  margin-bottom: 3px;
  color: #68737d;
}

.pdf-exercise-change {
  margin-bottom: 3px;
  font-size: 6.1pt;
}

.pdf-coach-notes {
  margin-top: 3px;
  white-space: normal;
}

.pdf-coach-notes span {
  margin-bottom: 1px;
  color: #68737d;
  font-size: 5.8pt;
  text-transform: uppercase;
}

@page {
  size: A4 landscape;
  margin: 0.2in;
}

@media print {
  body.printing-programme {
    margin: 0;
    background: #fff;
  }

  body.printing-programme .app-shell,
  body.printing-programme .modal-backdrop {
    display: none !important;
  }

  body.printing-programme .pdf-export {
    position: static;
    display: block;
    visibility: visible;
    width: 11.29in;
    pointer-events: auto;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* Keep weekly exercise choices readable above the prescription. */
.progression-cell > .progression-exercise-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.progression-exercise-editor .typeahead-field {
  width: 100%;
  min-height: 54px;
  line-height: 1.4;
}

.progression-cell:has(.typeahead-open) {
  position: relative;
  z-index: 5;
}

/* Shared heading row keeps Endurance inputs aligned at wide panel widths. */
.builder-editor.endurance-editor {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas: "help help" "workout notes";
  align-items: start;
}
.endurance-editor-help { grid-area: help; margin: 0; }
.endurance-workout-section { grid-area: workout; }
.endurance-editor > .builder-notes-section { grid-area: notes; padding-left: 0; border-left: 0; }
.endurance-editor textarea { margin-top: 9px; min-height: 94px; width: 100%; box-sizing: border-box; }
@container builder (max-width: 680px) {
  .builder-editor.endurance-editor {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "help" "workout" "notes";
  }
}

.progression-range-control {
  display: flex;
  position: relative;
  min-width: 0;
}

.progression-range-control input {
  min-width: 0;
  width: 100%;
  padding-right: 28px;
  color: var(--accent);
  font-weight: 600;
}

.progression-range-arrows {
  position: absolute;
  right: 2px;
  top: 2px;
  bottom: 2px;
  display: grid;
  grid-template-rows: 1fr 1fr;
}

.progression-range-arrows button {
  min-height: 0;
  padding: 0 6px;
  line-height: 1;
  font-size: 12px;
}

/* Studio appearance only. Keep layout, interaction states and print output intact. */
@media screen {
  body.programming-app {
    --cf-color-page: #ffffff;
    --cf-color-paper: #f8f9f9;
    --cf-color-surface: #ffffff;
    --cf-color-panel: #ffffff;
    --cf-color-soft: #f5f7f7;
    --cf-color-line: #dfe3e5;
    --cf-color-line-subtle: #e8ebec;
    --cf-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --cf-font-title: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --cf-shadow-control: none;
    --cf-shadow-panel: none;
    --page: var(--cf-color-page);
    --paper: var(--cf-color-paper);
    --panel: var(--cf-color-panel);
    --soft: var(--cf-color-soft);
    --line: var(--cf-color-line);
    --fine-line: var(--cf-color-line-subtle);
    --font: var(--cf-font-body);
    --title-font: var(--cf-font-title);
    --control-shadow: var(--cf-shadow-control);
    --shadow: var(--cf-shadow-panel);
    background: #ffffff;
  }

  .programming-app .topbar {
    background: #ffffff;
    border-bottom-color: #e2e6e8;
    box-shadow: none;
    backdrop-filter: none;
  }

  .programming-app .command-title-row h1 {
    color: #292d30;
    font-weight: 600;
    text-transform: none;
    line-height: 1.25;
  }

  .programming-app .command-title-row > span {
    color: #657075;
    font-size: 12px;
  }

  .programming-app .workspace-tabs {
    border-color: transparent;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  .programming-app .workspace-tabs button,
  .programming-app .workspace-tabs a {
    background: transparent;
    border-radius: 0;
    color: #657075;
    font-weight: 500;
  }

  .programming-app .workspace-tabs button.active {
    background: transparent;
    color: #8a1028;
    box-shadow: inset 0 -2px #8a1028;
  }

  .programming-app .workspace-tabs button:hover,
  .programming-app .workspace-tabs a:hover {
    background: #faf3f5;
    color: #8a1028;
  }

  .programming-app .programme-panel,
  .programming-app .builder-panel,
  .programming-app .progression-panel,
  .programming-app .overview-panel,
  .programming-app .review-output-panel,
  .programming-app .analytics-panel,
  .programming-app .weekly-grid {
    border-color: transparent;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
  }

  .programming-app .programme-build-pane {
    border-right-color: #e2e6e8;
  }

  .programming-app .programme-panel {
    border-right-color: #e2e6e8;
  }

  .programming-app .section-heading {
    background: #ffffff;
    border-bottom-color: #e8ebec;
  }

  .programming-app .section-heading h2 {
    font-weight: 600;
    text-transform: none;
  }

  .programming-app .panel-kicker,
  .programming-app .builder-group-label {
    color: #657075;
    font-weight: 500;
  }

  .programming-app .builder-session-tabs button {
    border-color: transparent;
    border-radius: 3px;
    box-shadow: none;
    background: transparent;
    color: #657075;
    font-weight: 500;
  }

  .programming-app .builder-session-tabs button.active {
    background: #faf3f5;
    color: #8a1028;
  }

  .programming-app .builder-session-tabs button.active::after {
    background: #8a1028;
  }

  .programming-app .overview-panel textarea {
    border-color: #e8ebec;
    background: #f8f9f9;
    box-shadow: none;
  }

  .programming-app .builder-exercise-card {
    border-color: transparent;
    border-top-color: #e2e6e8;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
  }

  .programming-app .builder-exercise-card.focused-builder-row {
    border-color: #bd7a88;
    box-shadow: inset 2px 0 #8a1028;
  }

  .programming-app .builder-exercise-card > details[open] > .builder-exercise-summary {
    background: #fafbfb;
    border-bottom-color: #e8ebec;
  }

  .programming-app .builder-exercise-summary:hover {
    background: #f5f7f7;
  }

  .programming-app .builder-exercise-name strong,
  .programming-app .builder-prescription-summary {
    font-weight: 500;
  }

  .programming-app .builder-editor {
    background: #ffffff;
  }

  .programming-app .builder-section-disclosure,
  .programming-app .progression-base-editor details {
    border-color: #e8ebec;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
  }

  .programming-app .builder-section-disclosure > summary,
  .programming-app .builder-editor-heading h3 {
    font-weight: 500;
    text-transform: none;
  }

  .programming-app .typeahead-results {
    border-color: #dfe3e5;
    border-radius: 4px;
    box-shadow: 0 8px 24px #292d3018;
    background: #ffffff;
  }

  .programming-app .typeahead-results button:hover,
  .programming-app .typeahead-results button.typeahead-active {
    background: #faf3f5;
    color: #8a1028;
  }

  .programming-app .progression-analytics,
  .programming-app .progression-session-panel {
    border-color: #e2e6e8;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
  }

  .programming-app .progression-analytics > summary,
  .programming-app .progression-session-panel > summary {
    background: #ffffff;
    font-weight: 500;
  }

  .programming-app .progression-week-header-scroll {
    background: #f5f7f7;
    border-color: #e2e6e8;
    border-radius: 0;
    box-shadow: 0 1px #e8ebec;
  }

  .programming-app .progression-scroll {
    border-color: #e2e6e8;
    border-radius: 0;
    background: #ffffff;
  }

  .programming-app .progression-table tbody th,
  .programming-app .progression-cell {
    background: #ffffff;
  }

  .programming-app .progression-table tbody tr:hover > th,
  .programming-app .progression-table tbody tr:hover > td:not(.edited) {
    background: #f5f8f7;
  }

  .programming-app .progression-cell.edited {
    background: #fcf6f8;
    box-shadow: inset 2px 0 #8a1028;
  }

  .programming-app .progression-cell:focus-within {
    background: #f4f8f7;
    box-shadow: inset 2px 0 #35796f;
  }

  .programming-app .progression-row-identity > strong {
    font-weight: 500;
  }

  .programming-app .progression-note-box textarea {
    border-color: #e2e6e8;
    background: #ffffff;
    box-shadow: none;
  }

  .programming-app .dock-rail,
  .programming-app .programme-build-rail {
    border-color: #e2e6e8;
    border-radius: 0 4px 4px 0;
    box-shadow: none;
    background: #ffffff;
  }

  .programming-app button:focus-visible,
  .programming-app input:focus-visible,
  .programming-app select:focus-visible,
  .programming-app textarea:focus-visible,
  .programming-app summary:focus-visible {
    outline: 2px solid #35796f;
    outline-offset: 2px;
  }
}

#prescription-comparison { padding: 18px; background: #fff; border: 1px solid #d4dbe0; overflow-x: auto; }
#prescription-comparison p { color: #63717d; font-size: 12px; line-height: 1.6; }
.prescription-comparison-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr)); gap: 24px; }
#prescription-comparison table { width: 100%; border-collapse: collapse; font-size: 12px; }
#prescription-comparison th, #prescription-comparison td { text-align: left; padding: 9px 7px; border-bottom: 1px solid #e3e7e9; }
