:root {
  --ink: #16211f;
  --muted: #68736f;
  --line: #dfe6e2;
  --bg: #f4f6f4;
  --panel: #ffffff;
  --brand: #075f46;
  --brand-2: #0d7a59;
  --accent: #f0a20b;
  --danger: #b44435;
}

.welcome-copy {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.client-entry {
  background: var(--entry-color, #ffe2e2) !important;
  border-color: #d96767 !important;
  color: #161616 !important;
  font-weight: 800;
}

.client-entry:disabled {
  background: #f2f3f3 !important;
  border-color: var(--line) !important;
  color: #8a9290 !important;
}

.shared-cell {
  vertical-align: middle;
  background: #f8faf9;
  border-bottom: 2px solid #b8c9c0;
}

.exercise-shared {
  min-width: 220px;
  font-weight: 700;
  overflow: hidden;
}

.exercise-shared .readonly {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  justify-content: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
}

.frequency-cell {
  background: #eef8f2;
  font-weight: 800;
  text-align: center;
}

.justification-select {
  min-width: 230px;
  background: #fff7dd;
  border-color: #d9a62e;
  color: #46330b;
  font-weight: 700;
}

.justification-select:disabled {
  background: #f2f3f3;
  border-color: var(--line);
  color: #8a9290;
}

.frequency-group-start > td {
  box-shadow: inset 0 3px 0 var(--brand);
}

.editable-help {
  margin: 12px;
  padding: 10px 12px;
  border-left: 4px solid #c94c4c;
  background: #fff0f0;
  color: #782d2d;
  font-weight: 800;
}

.coach-notes-card {
  margin-top: 14px;
}

.coach-notes-card summary,
.dashboard-inbox summary,
.coach-notes-panel summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 12px 0;
}

.unread-badge {
  min-width: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #c33f3f;
  color: white;
  text-align: center;
}

.table-details,
.table-details .table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.table-top-scroll {
  width: 100%;
  height: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 8px 0 2px;
  cursor: grab;
}

.table-top-scroll > div {
  height: 1px;
}

.table-wrap {
  cursor: grab;
}

.table-wrap input,
.table-wrap select,
.table-wrap button,
.table-wrap a {
  cursor: auto;
}

.table-wrap.is-dragging,
.table-top-scroll.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.table-details .table-wrap {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;
}

.table-details .training-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.training-table-wrap {
  max-height: none;
  overflow-x: auto !important;
  overflow-y: visible !important;
  position: relative;
}

.table-details .training-table thead th {
  position: static;
  background: #12342d;
  color: #fff;
}

.table-details .training-table tbody tr {
  height: 58px;
}

.table-details .training-table tbody td:not(.shared-cell) {
  height: 58px;
  min-height: 58px;
  vertical-align: middle;
}

.table-details .training-table .cell-input,
.table-details .training-table .readonly {
  box-sizing: border-box;
  min-height: 38px;
}

.table-details .training-table .cell-input {
  height: 38px;
}

.table-details .training-table .readonly {
  display: inline-flex;
  align-items: center;
}

.table-details .training-table .block-tone-a td:not(.shared-cell) {
  background: #ffffff;
}

.table-details .training-table .block-tone-b td:not(.shared-cell) {
  background: #f2f7f5;
}

.table-details .training-table .sticky-exercise {
  position: static;
  min-width: 240px;
  max-width: 240px;
  background: #e7f5ec;
  box-shadow: none;
}

.table-details .training-table thead th:nth-child(3) {
  position: static;
  min-width: 240px;
  max-width: 240px;
}

.schedule-input {
  min-width: 148px;
}

.schedule-display .readonly,
.shared-cell .readonly {
  min-width: 140px;
  white-space: nowrap;
}

.technique-input,
.technique-value {
  min-width: 170px;
  white-space: nowrap;
}

.training-table th {
  min-width: 118px;
  white-space: normal;
}

@media (max-width: 720px) {
  .top-app {
    grid-template-columns: 44px minmax(0, 1fr);
  }
  .language-control {
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }
  .language-select {
    width: 100%;
  }
  #trainingPanel > .toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

[hidden] { display: none !important; }

.app {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 10px;
  min-width: 0;
  overflow-x: clip;
}

.top-app {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0 14px;
  background: rgba(244, 246, 244, 0.94);
  backdrop-filter: blur(12px);
}

.icon-btn,
.language-select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 900;
}

.world-language-select {
  position: absolute;
  right: 10px;
  top: 72px;
  z-index: 20;
  width: min(260px, calc(100vw - 20px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 12px 30px rgba(15, 32, 28, 0.18);
}

.world-language-select select {
  width: 100%;
  min-height: 42px;
}

.language-control {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.language-select {
  width: 118px;
  padding: 0 8px;
  font-size: 12px;
}

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

.brand-pill span,
.drawer-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: linear-gradient(135deg, #0b6b4f, #064536);
  color: white;
  font-weight: 900;
}

.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: min(320px, 88vw);
  padding: 18px;
  background: white;
  border-right: 1px solid var(--line);
  box-shadow: 28px 0 60px rgba(15, 32, 28, 0.22);
  transform: translateX(-105%);
  transition: transform 180ms ease;
}

.drawer.open { transform: translateX(0); }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(17, 31, 28, 0.42);
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.drawer-nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 0;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
  padding: 0 12px;
  font-size: 17px;
}

.nav-item.active {
  background: #e8f5ee;
  color: var(--brand);
  font-weight: 900;
}

.nav-section {
  margin: 20px 10px 8px;
  color: #8b938f;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel,
.view,
.plan-card,
.routine-card,
.metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(24, 39, 51, 0.08);
}

.panel,
.view {
  padding: 14px;
}

.register-card {
  display: grid;
  gap: 12px;
  max-width: 560px;
  margin: 18px auto;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 { font-size: 32px; }
h2 { font-size: 24px; }

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.private-app {
  display: grid;
  gap: 14px;
}

.session-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 10px 12px;
  font-weight: 900;
}

.compact-btn {
  min-height: 36px;
  padding: 0 10px;
}

.view { display: none; }
.view.active-view { display: block; }

.section-title {
  display: grid;
  gap: 2px;
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: white;
  color: var(--ink);
}

button,
.link-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 900;
  text-decoration: none;
}

.primary-btn {
  background: var(--brand);
  color: white;
}

.ghost-btn {
  background: #eef4f1;
  color: var(--brand);
  border-color: #d4e7de;
}

.accent-btn {
  background: var(--accent);
  color: #1f1705;
}

.danger-btn {
  background: #fff4f1;
  color: var(--danger);
  border-color: #f0c7bd;
}

.full-btn { width: 100%; margin-top: 12px; }

.disabled {
  opacity: 0.48;
  pointer-events: none;
}

.toolbar {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.routine-list {
  display: grid;
  gap: 12px;
}

.routine-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  padding: 10px;
}

.routine-media {
  min-height: 112px;
  overflow: hidden;
  border-radius: 8px;
  background: #0b1613;
}

.exercise-media,
.media-placeholder,
.media-link {
  width: 100%;
  height: 100%;
  min-height: 128px;
  border: 0;
  display: grid;
  place-items: center;
  object-fit: cover;
  color: white;
  font-size: 34px;
}

.media-link {
  background: #0b1613;
  font-size: 16px;
  font-weight: 900;
  text-decoration: none;
}

.routine-info {
  min-width: 0;
  display: grid;
  gap: 8px;
  align-content: start;
}

.routine-info strong { font-size: 18px; }

.routine-info > span {
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chips span {
  border-radius: 6px;
  background: #f1f4f2;
  padding: 6px 8px;
  color: #3e4a46;
  font-size: 13px;
  font-weight: 800;
}

.objective-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.plan-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

#aiResult {
  white-space: pre-line;
  line-height: 1.45;
}

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

.custom-file-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.custom-file-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.custom-file-picker .ghost-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

#aiPhotoName {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.training-table thead th,
.training-table .sticky-exercise {
  position: static !important;
  left: auto !important;
  top: auto !important;
}

.unit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 8px;
}

.nutrition-plan-list {
  display: grid;
  gap: 10px;
}

.supplement-library {
  display: grid;
  gap: 12px;
}

.supplement-disclaimer {
  margin: 0;
  padding: 11px 12px;
  border-left: 4px solid #e39a22;
  background: #fff8e9;
  color: #59451f;
  line-height: 1.45;
}

.supplement-glossary-list {
  display: grid;
  gap: 9px;
}

.supplement-info-card {
  border: 1px solid var(--line);
  background: #fff;
}

.supplement-info-card > summary {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.supplement-info-card > summary::-webkit-details-marker {
  display: none;
}

.supplement-info-card > summary::after {
  content: "+";
  color: var(--primary);
  font-size: 20px;
}

.supplement-info-card[open] > summary::after {
  content: "−";
}

.supplement-info-body {
  display: grid;
  gap: 10px;
  padding: 0 13px 13px;
  border-top: 1px solid var(--line);
}

.supplement-info-body section {
  padding-top: 10px;
}

.supplement-info-body p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-wrap;
}

.client-home-head,
.feature-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.client-home-head {
  padding: 18px;
  border-left: 5px solid var(--primary);
  background: #fff;
}

.client-home-head h2,
.feature-heading h3 {
  margin: 0;
}

.client-home-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.client-home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.home-metric {
  display: grid;
  gap: 8px;
  min-height: 145px;
  padding: 15px;
  border: 1px solid var(--line);
  background: #fff;
}

.home-metric > span,
.home-metric small {
  color: var(--muted);
}

.home-metric strong {
  font-size: 24px;
}

.metric-progress,
.water-progress {
  position: relative;
  overflow: hidden;
  min-height: 12px;
  background: #e8efec;
}

.metric-progress i {
  display: block;
  width: 0;
  height: 12px;
  background: var(--primary);
  transition: width .3s ease;
}

.feature-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.feature-list article {
  padding: 11px 12px;
  border-left: 3px solid var(--primary);
  background: var(--soft);
}

.feature-list article p,
.feature-list article small {
  margin: 3px 0 0;
  color: var(--muted);
}

.progress-photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.progress-photo-card {
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.progress-photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.progress-photo-card div {
  padding: 10px;
}

.water-panel {
  display: grid;
  gap: 16px;
}

.water-progress {
  min-height: 74px;
  display: grid;
  place-items: center;
}

.water-progress > div {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: #48a9e6;
  transition: width .25s ease;
}

.water-progress strong {
  position: relative;
  z-index: 1;
}

.water-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.water-actions button {
  min-height: 48px;
  border: 1px solid #8cc9ec;
  background: #eaf7ff;
  color: #15587d;
  font-weight: 900;
}

.assistant-panel,
.assistant-conversation {
  display: grid;
  gap: 10px;
}

.assistant-conversation {
  min-height: 220px;
  max-height: 420px;
  overflow-y: auto;
  padding: 12px;
  background: var(--soft);
}

.assistant-message {
  max-width: 85%;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.assistant-message.user {
  justify-self: end;
  background: #e6f5ee;
}

.assistant-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.assistant-compose textarea {
  min-width: 0;
}

.mobile-bottom-nav {
  display: none;
}

.measure-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.measure-chart-card {
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.measure-chart-card svg {
  display: block;
  width: 100%;
  height: 150px;
}

@media (max-width: 900px) {
  .client-home-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  body { padding-bottom: 70px; }
  .client-home-head,
  .feature-heading { align-items: stretch; flex-direction: column; }
  .client-home-grid { grid-template-columns: 1fr; }
  .home-metric { min-height: 120px; }
  .assistant-compose { grid-template-columns: 1fr; }
  .water-actions { grid-template-columns: 1fr; }
  .mobile-bottom-nav {
    position: fixed;
    z-index: 60;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 62px;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 -8px 24px rgba(20,34,30,.1);
  }
  .mobile-bottom-nav button {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }
  .mobile-bottom-nav button.active { color: var(--primary); }
}

.nutrition-plan-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  padding: 12px;
}

.nutrition-plan-item small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.metric-grid,
.measure-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  padding: 14px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 26px;
}

.table-details,
.routine-video-details {
  margin-top: 14px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.table-details summary,
.routine-video-details summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 900;
}

.routine-video-details .routine-list {
  margin-top: 12px;
}

.video-na {
  display: inline-flex;
  min-width: 46px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f1f4f3;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  cursor: default;
  user-select: none;
}

.no-video-message {
  padding: 18px;
  border: 1px dashed var(--line);
  background: #f7f9f8;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.input-error {
  outline: 2px solid #c62828;
  background: #fff1f1 !important;
}

.table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 10px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  scroll-behavior: auto;
}

.horizontal-help {
  margin: 6px 0 12px;
  color: var(--brand);
  font-weight: 700;
}

.frequency-open-btn {
  width: 46px;
  height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: white;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.frequency-open-btn:disabled {
  background: #d7dee1;
  color: #66737b;
  cursor: not-allowed;
}

.frequency-dialog {
  width: min(620px, calc(100vw - 24px));
  max-height: min(780px, calc(100vh - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  overflow: auto;
}

.frequency-dialog::backdrop {
  background: rgba(10, 22, 29, 0.58);
}

.frequency-dialog form {
  padding: 18px;
}

.frequency-dialog-header,
.quick-set-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.frequency-dialog-header h3 {
  margin: 2px 0 0;
}

.frequency-dialog-sets {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.quick-set-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) repeat(3, minmax(100px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.quick-set-heading {
  display: grid;
}

.quick-set-row label {
  display: grid;
  gap: 5px;
  font-size: 0.84rem;
  font-weight: 700;
}

.quick-entry {
  width: 100%;
  min-height: 44px;
  border: 1px solid #ed9b9b;
  border-radius: 5px;
  background: #fff0f0;
  padding: 8px;
  font-size: 1rem;
}

@media (max-width: 720px) {
  .table-top-scroll {
    display: none;
  }

  .table-details .table-wrap {
    touch-action: pan-x pan-y;
    overscroll-behavior-y: auto;
  }

  .quick-set-row {
    grid-template-columns: 1fr;
  }
}

table {
  border-collapse: collapse;
  width: 100%;
}

.training-table { min-width: 5700px; }

#privateApp,
#trainingPanel,
.view {
  min-width: 0;
  max-width: 100%;
}

.progress-distribution-card h3 {
  margin-top: 0;
}

.progress-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.progress-summary-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.progress-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.progress-summary-card strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 25px;
}

.exercise-progress-card,
.progress-history-card {
  margin-top: 14px;
}

.progress-card-head {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.progress-card-head h3,
.progress-card-head .eyebrow {
  margin: 0;
}

.progress-card-head h3 {
  margin-top: 4px;
}

.progress-exercise-filter {
  width: min(100%, 300px);
}

.progress-exercise-filter span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.progress-exercise-filter select {
  width: 100%;
}

.exercise-volume-chart {
  min-height: 245px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.progress-chart-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.progress-bars {
  display: flex;
  height: 185px;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
  padding-top: 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.progress-bar-column {
  display: grid;
  flex: 1 0 48px;
  height: 100%;
  grid-template-rows: 22px minmax(0, 1fr) 28px;
  align-items: end;
  text-align: center;
}

.progress-bar-column strong {
  align-self: start;
  color: var(--muted);
  font-size: 10px;
}

.progress-bar-column span {
  width: min(30px, 70%);
  min-height: 4px;
  max-height: 100%;
  margin: 0 auto;
  border-radius: 5px 5px 0 0;
  background: var(--brand);
}

.progress-bar-column small {
  padding-top: 7px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.exercise-comparison-wrap {
  margin-top: 14px;
}

.progress-table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.progress-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

.progress-table th,
.progress-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.progress-table th {
  background: #f1f5f3;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.progress-change {
  display: inline-flex;
  min-width: 72px;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 6px;
  background: #edf1ef;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.progress-change.positive {
  background: #dcf5e7;
  color: #08743f;
}

.progress-change.negative {
  background: #fde5e2;
  color: #a12d22;
}

.client-session-history {
  display: grid;
  gap: 10px;
}

.session-history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.session-history-item summary {
  display: flex;
  min-height: 66px;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.session-history-item summary::-webkit-details-marker {
  display: none;
}

.session-history-item summary span {
  display: grid;
  gap: 3px;
}

.session-history-item summary small {
  color: var(--muted);
}

.session-history-item summary b {
  color: var(--brand);
}

.session-history-body {
  display: grid;
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.session-history-exercise {
  display: grid;
  grid-template-columns: minmax(170px, 1.4fr) minmax(100px, .7fr) minmax(190px, 1fr) minmax(80px, .5fr);
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  background: #fff;
}

.session-history-exercise span {
  color: var(--muted);
  font-size: 13px;
}

.progress-empty {
  display: grid;
  min-height: 130px;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.donut-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

@media (max-width: 760px) {
  .progress-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .progress-card-head {
    display: grid;
    align-items: stretch;
  }

  .progress-exercise-filter {
    width: 100%;
  }

  .session-history-exercise {
    grid-template-columns: 1fr auto;
  }

  .session-history-exercise span {
    grid-column: 1 / -1;
  }
}

.donut {
  width: 180px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#dfe6e2 0 100%);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: white;
}

.legend {
  display: grid;
  gap: 10px;
}

.legend span {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.legend b {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend i {
  font-style: normal;
}

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

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

@media (min-width: 900px) {
  .routine-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .view {
    max-height: calc(100vh - 86px);
    overflow: auto;
  }
}

th,
td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #edf3f2;
  color: #35424d;
  font-size: 12px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.cell-input {
  min-width: 92px;
  border: 0;
  border-radius: 4px;
  background: #f4f7f8;
}

.exercise-cell {
  min-width: 240px;
  display: grid;
  gap: 6px;
}

.exercise-picker {
  min-width: 100%;
  border: 1px solid #d7e9dd;
  background: #eaf8ef;
  color: var(--brand);
}

.readonly {
  min-width: 70px;
  min-height: 38px;
  border-radius: 4px;
  background: #f6f8f9;
  display: grid;
  align-items: center;
  padding: 8px;
  font-weight: 800;
}

.table-details .training-table .exercise-shared {
  width: 320px;
  min-width: 320px;
  max-width: 320px;
  overflow: visible;
}

.table-details .training-table .exercise-shared .readonly {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: 38px;
  padding: 10px;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  text-align: center;
}

.status {
  color: var(--muted);
  font-weight: 800;
}

.status.success { color: var(--brand); }
.status.warning { color: #9a5b00; }

.app-notice {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  width: min(520px, calc(100% - 28px));
  border: 1px solid #bfe7cf;
  border-radius: 10px;
  background: #eaf8ef;
  color: #0b5f35;
  box-shadow: 0 18px 44px rgba(24, 39, 51, 0.18);
  font-weight: 900;
  line-height: 1.35;
  padding: 14px 16px;
}

.app-notice.warning {
  border-color: #f4d38a;
  background: #fff7df;
  color: #8a5a00;
}

@media (max-width: 720px) {
  .app { padding: 10px; }
  .top-app { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .language-select { width: 104px; }
  .toolbar,
  .metric-grid,
  .measure-grid {
    grid-template-columns: 1fr;
  }
  .routine-card {
    grid-template-columns: 112px 1fr;
    gap: 10px;
    padding: 10px;
  }
  .donut-row,
  .appointment-grid {
    grid-template-columns: 1fr;
  }
  .donut { margin: 0 auto; }
  .routine-info strong { font-size: 18px; }
  .set-row {
    grid-template-columns: 1fr;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
  }
}
/* Session-wide reason is separate from an exercise-specific justification. */
.session-justification {
  display: grid;
  gap: 6px;
  max-width: 760px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.session-justification select {
  width: 100%;
  min-height: 44px;
}
