:root {
  --card: rgba(255, 252, 247, 0.9);
  --ink: #1f1d1a;
  --muted: #655d52;
  --line: rgba(62, 49, 35, 0.12);
  --accent: #0f766e;
  --accent-strong: #115e59;
  --secondary: #d97706;
  --danger: #b42318;
  --shadow: 0 20px 45px rgba(36, 29, 21, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(217, 119, 6, 0.16), transparent 26%),
    linear-gradient(135deg, #f8f1e7 0%, #efe6d9 100%);
}

a {
  color: inherit;
}

body.admin-mode-active .app-shell,
body.client-mode-active .app-shell {
  grid-template-columns: 1fr;
}

body.admin-mode-active .hero-panel,
body.client-mode-active .hero-panel {
  display: none;
}

body.admin-mode-active .content-panel,
body.client-mode-active .content-panel {
  padding: 18px 24px;
}

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

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  min-height: 100vh;
}

.hero-panel {
  padding: 48px 36px;
  background: linear-gradient(180deg, rgba(18, 94, 89, 0.94), rgba(11, 78, 74, 0.96));
  color: #f6f9f8;
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -80px -80px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 24px;
}

.eyebrow,
.section-tag,
.info-tag,
.phase-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 800;
}

.hero-copy h1,
.card h2,
.info-card h3,
.admin-list-header h3,
.admin-form h3,
.panel-intro h3,
.rehab-card h3,
.phase-card h4 {
  margin: 0;
}

.hero-copy h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  max-width: 10ch;
}

.hero-text,
.status-card p {
  color: rgba(255, 255, 255, 0.82);
}

.status-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.08);
}

.status-dot {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 999px;
  background: #7ef5cf;
  box-shadow: 0 0 0 8px rgba(126, 245, 207, 0.14);
}

.content-panel {
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view,
.admin-panel,
.client-panel,
.admin-mode-view {
  display: none;
}

.view.active,
.admin-panel.active,
.client-panel.active,
.admin-mode-view.active {
  display: block;
}

.card {
  width: min(100%, 1680px);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 30px 34px;
  backdrop-filter: blur(14px);
}

.card-header,
.admin-list-header,
.form-actions,
.panel-intro,
.tab-bar,
.mode-bar,
.section-header,
.action-row,
.rehab-card-header,
.phase-header,
.test-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.table-search {
  display: flex;
  align-items: center;
}

.table-search input {
  width: min(260px, 100%);
  min-width: 220px;
  height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
}

.stack,
.field,
.list-stack,
.client-panels,
.admin-list,
.admin-form,
.onboarding-list,
.admin-editor-stack,
.rehab-editor,
.phase-list,
.phase-tests,
.clients-planning-view,
.client-directory-list {
  display: grid;
  gap: 16px;
}

.field span,
.muted,
.phase-subtitle,
.phase-meta,
.phase-progress,
.test-meta {
  color: var(--muted);
}

.field span {
  font-size: 0.95rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18);
  border-color: rgba(15, 118, 110, 0.45);
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.field-inline input {
  width: auto;
  margin: 0;
}

.button,
.menu-button,
.tab-button,
.small-button {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.button:hover,
.menu-button:hover,
.tab-button:hover,
.small-button:hover {
  transform: translateY(-1px);
}

.button.primary,
.small-button.primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.button.secondary,
.small-button.secondary {
  color: white;
  background: linear-gradient(135deg, #c96b04, var(--secondary));
}

.button.ghost,
.small-button.ghost {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.button.danger,
.small-button.danger {
  color: white;
  background: var(--danger);
}

.small-button {
  padding: 10px 14px;
  font-size: 0.9rem;
}

.menu-button,
.tab-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.menu-button.active,
.tab-button.active {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
}

.demo-box,
.phase-banner,
.info-card,
.client-row,
.module-row,
.template-row,
.onboarding-card,
.preview-card,
.rehab-card,
.phase-card,
.test-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.74);
}

.demo-box,
.info-card,
.onboarding-card,
.preview-card,
.rehab-card,
.phase-card {
  padding: 22px;
}

.demo-box {
  margin-top: 28px;
}

.demo-title {
  margin-top: 0;
  font-weight: 800;
}

.message {
  min-height: 1.5em;
  color: var(--accent-strong);
}

.client-layout {
  display: grid;
  gap: 30px;
  margin-top: 24px;
}

.client-menu,
.tab-bar,
.mode-bar,
.action-row {
  flex-wrap: wrap;
}

.mode-bar {
  margin-top: 24px;
}

.coach-planning-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  margin-top: 24px;
}

.coach-sidebar {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.74);
}

.coach-nav-button {
  width: 100%;
  justify-content: flex-start;
}

.coach-content {
  min-width: 0;
}

.clients-planning-view {
  margin-top: 24px;
}

.client-directory-card {
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.74);
  display: grid;
  gap: 14px;
}

.client-directory-head,
.client-directory-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(220px, 1fr) minmax(240px, 1fr);
  gap: 24px;
  align-items: center;
}

.client-directory-head {
  padding: 0 8px 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--line);
}

.client-directory-row {
  width: 100%;
  padding: 16px 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.client-directory-row:hover,
.client-directory-row.active {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.36);
  background: rgba(215, 240, 235, 0.55);
}

.client-directory-row strong,
.client-directory-row span {
  display: block;
}

.client-directory-row span {
  color: var(--muted);
}

#client-detail-view {
  margin-top: 4px;
}

.subview-hidden {
  display: none !important;
}

.phase-banner {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(215, 240, 235, 0.9));
  margin-bottom: 8px;
  padding: 26px 28px;
  overflow: hidden;
}

.phase-banner-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
}

.phase-banner-copy {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.phase-value {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.08;
  font-weight: 800;
}

.phase-subtitle {
  margin: 0;
  font-size: 1rem;
}

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

.phase-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(15, 118, 110, 0.1);
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 700;
}

.phase-banner-progress {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-phase-ring {
  width: 118px;
  height: 118px;
}

.hero-phase-ring .phase-progress-ring-inner {
  width: 86px;
  height: 86px;
  background: rgba(255, 249, 241, 0.96);
}

.hero-phase-ring .phase-progress-ring-inner strong {
  font-size: 1.3rem;
}

.phase-timeline {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.timeline-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(62, 49, 35, 0.08);
}

.timeline-step-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-weight: 800;
  background: rgba(62, 49, 35, 0.08);
  color: var(--muted);
}

.timeline-step-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.timeline-step-copy strong,
.timeline-step-copy span {
  display: block;
}

.timeline-step-copy strong {
  font-size: 0.95rem;
  line-height: 1.25;
}

.timeline-step-copy span {
  color: var(--muted);
  font-size: 0.82rem;
}

.timeline-step.complete {
  background: rgba(223, 245, 229, 0.9);
}

.timeline-step.complete .timeline-step-dot {
  background: linear-gradient(135deg, #218c5b, #3bbf77);
  color: white;
}

.timeline-step.active {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(15, 118, 110, 0.24);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.08);
}

.timeline-step.active .timeline-step-dot {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
}

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

.rehab-card {
  margin-top: 8px;
}

.panel-intro {
  align-items: end;
}

.onboarding-card {
  display: grid;
  gap: 12px;
}

.onboarding-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.order-pill,
.phase-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  border-radius: 999px;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, #c96b04, var(--secondary));
}

.embed-frame iframe,
.embed-preview iframe {
  width: 100%;
  min-height: 320px;
  border: none;
  border-radius: 18px;
  background: #d9ddd8;
}

.embed-placeholder {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.54);
}

.admin-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 28px;
  margin-top: 24px;
}

.quick-test-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.quick-test-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.client-row,
.module-row,
.template-row,
.quick-test-client-row {
  width: 100%;
  padding: 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
  border: 1px solid var(--line);
}

.client-row:hover,
.client-row.active,
.module-row:hover,
.module-row.active,
.template-row:hover,
.template-row.active,
.quick-test-client-row:hover,
.quick-test-client-row.active {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.36);
  background: rgba(215, 240, 235, 0.55);
}

.client-row strong,
.client-row span,
.module-row strong,
.module-row span,
.template-row strong,
.template-row span,
.quick-test-client-row strong,
.quick-test-client-row span {
  display: block;
}

.client-row span,
.module-row span,
.template-row span,
.quick-test-client-row span {
  color: var(--muted);
  margin-top: 6px;
  font-size: 0.92rem;
}

.quick-test-panel {
  display: grid;
  gap: 18px;
}

.quick-test-client-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.quick-test-client-card:hover,
.quick-test-client-card.active {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.36);
  background: rgba(215, 240, 235, 0.55);
}

.quick-test-client-card strong,
.quick-test-client-card span {
  display: block;
}

.quick-test-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.quick-test-progress-badge {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong) !important;
  font-weight: 800;
  font-size: 1rem;
}

.quick-test-client-card span {
  margin-top: 8px;
  color: var(--muted);
}

.quick-test-progress-row {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.quick-test-progress-bar {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(62, 49, 35, 0.12);
  overflow: hidden;
}

.quick-test-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #3bbfb4);
}

.quick-test-progress-label {
  margin-top: 0 !important;
  font-size: 0.82rem !important;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.quick-test-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.quick-test-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.quick-test-checklist {
  display: grid;
  gap: 12px;
}

.quick-test-phase {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.quick-test-phase.active {
  border-color: rgba(15, 118, 110, 0.36);
  background: rgba(215, 240, 235, 0.4);
}

.quick-test-phase.completed {
  border-color: rgba(47, 128, 74, 0.4);
  background: rgba(223, 245, 229, 0.9);
}

.quick-test-phase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.quick-test-phase-toggle {
  width: 100%;
  padding: 0;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
}

.quick-test-phase-meta {
  margin-top: 6px;
  color: var(--muted);
}

.quick-test-item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.quick-test-item.done {
  background: rgba(215, 240, 235, 0.65);
}

.quick-test-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-weight: 800;
}

.quick-test-toggle input {
  width: 22px;
  height: 22px;
}

.quick-test-notes {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.quick-test-notes span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quick-test-notes textarea {
  min-height: 84px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  resize: vertical;
}

.notes-toggle-button {
  margin-top: 14px;
  width: 100%;
  padding: 12px 14px;
  border: 1px dashed rgba(15, 118, 110, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-strong);
  text-align: left;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.notes-toggle-button:hover {
  border-color: rgba(15, 118, 110, 0.42);
  background: rgba(215, 240, 235, 0.38);
}

.progress-ring {
  min-width: 94px;
  min-height: 94px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #fff9f1 50%, rgba(15, 118, 110, 0.16) 51%);
  display: grid;
  place-items: center;
  text-align: center;
}

.progress-ring strong {
  font-size: 1.4rem;
}

.progress-ring span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(62, 49, 35, 0.1);
  overflow: hidden;
}

.progress-bar-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #36b39b);
}

.rehab-progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.phase-list {
  margin-top: 8px;
}

.phase-card.active {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.08);
}

.phase-header {
  align-items: start;
}

.phase-toggle-button {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.phase-toggle-button:disabled {
  cursor: default;
}

.phase-header-side {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.phase-progress-ring {
  --progress: 0;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--progress) * 1%), rgba(15, 118, 110, 0.14) 0);
  display: grid;
  place-items: center;
}

.phase-progress-ring-inner {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #fff9f1;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1.1;
}

.phase-progress-ring-inner strong {
  font-size: 1.05rem;
}

.phase-progress-ring-inner span {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.phase-tests {
  margin-top: 8px;
}

.phase-collapsed-note {
  margin-top: 8px;
  color: var(--muted);
}

.test-card {
  padding: 14px 16px;
}

.test-card.done {
  background: rgba(215, 240, 235, 0.65);
}

.test-row {
  align-items: center;
}

.test-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.test-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.test-check input {
  width: auto;
  margin: 0;
}

.test-title {
  line-height: 1.35;
}

.cycle-summary {
  display: grid;
  gap: 16px;
}

.cycle-stack {
  display: grid;
  gap: 12px;
}

.cycle-section {
  display: grid;
  gap: 14px;
}

.cycle-collapsed-note {
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
}

.cycle-timeline-shell {
  overflow-x: auto;
  padding-bottom: 6px;
}

.cycle-timeline-grid {
  min-width: 1080px;
  display: grid;
  grid-template-columns: 180px minmax(880px, 1fr);
  gap: 12px;
  align-items: start;
}

.cycle-row-label {
  padding-top: 10px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.cycle-week-row,
.cycle-bar-lane {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.cycle-week-head {
  min-height: 52px;
  padding: 14px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(62, 49, 35, 0.08);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.cycle-week-head.current {
  background: rgba(223, 245, 229, 0.96);
  border-color: rgba(47, 128, 74, 0.24);
  color: #1d6f44;
  box-shadow: 0 8px 18px rgba(47, 128, 74, 0.12);
}

.cycle-week-note textarea {
  min-height: 102px;
  padding: 12px;
  border-radius: 12px;
  font-size: 0.84rem;
  background: rgba(255, 255, 255, 0.86);
}

.cycle-bar-lane {
  align-items: start;
}

.cycle-bar {
  min-height: 52px;
  padding: 10px 12px;
  border-radius: 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
}

.cycle-bar-phase {
  background: rgba(248, 220, 126, 0.7);
  border-color: rgba(188, 144, 35, 0.18);
}

.cycle-bar-phase-0 {
  background: rgba(248, 220, 126, 0.74);
  border-color: rgba(188, 144, 35, 0.18);
}

.cycle-bar-phase-1 {
  background: rgba(163, 211, 168, 0.78);
  border-color: rgba(73, 137, 82, 0.18);
}

.cycle-bar-phase-2 {
  background: rgba(155, 202, 236, 0.8);
  border-color: rgba(70, 118, 168, 0.18);
}

.cycle-bar-phase-3 {
  background: rgba(215, 193, 241, 0.82);
  border-color: rgba(123, 87, 167, 0.18);
}

.cycle-bar-limitation {
  background: rgba(239, 162, 166, 0.72);
  border-color: rgba(177, 72, 82, 0.18);
}

.cycle-bar-open {
  grid-column: 1 / -1 !important;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(62, 49, 35, 0.18);
}

.cycle-bar-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  font-weight: 800;
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.68);
}

.cycle-bar-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.cycle-bar-copy strong {
  font-size: 0.92rem;
  line-height: 1.2;
}

.cycle-bar-copy span {
  color: rgba(31, 29, 26, 0.7);
  font-size: 0.8rem;
}

.cycle-row,
.cycle-entry-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.cycle-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(160px, 0.6fr) minmax(160px, 0.6fr);
  gap: 14px;
  align-items: end;
}

.cycle-row-heading {
  display: grid;
  gap: 4px;
}

.cycle-row-heading span {
  color: var(--muted);
  font-size: 0.88rem;
}

.cycle-entry-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
  gap: 14px;
}

.cycle-entry-grid-limitation {
  grid-template-columns: minmax(150px, 0.5fr) minmax(150px, 0.5fr) minmax(240px, 1fr);
}

.limitation-text-field {
  min-width: 0;
}

.rehab-editor {
  margin-top: 12px;
}

.editor-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
}

.template-summary {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(15, 118, 110, 0.08);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .content-panel {
    padding: 10px;
  }

  body.admin-mode-active .content-panel,
  body.client-mode-active .content-panel {
    padding: 6px;
  }

  .card {
    width: 100%;
    padding: 22px 18px;
    border-radius: 24px;
  }

  .admin-layout,
  .coach-planning-layout,
  .quick-test-layout,
  .grid.two-up,
  .phase-banner-top,
  .cycle-row,
  .cycle-entry-grid,
  .cycle-entry-grid-limitation {
    grid-template-columns: 1fr;
  }

  .card-header,
  .panel-intro,
  .rehab-card-header,
  .phase-header,
  .test-row {
    align-items: start;
    flex-direction: column;
  }

  .phase-header-side {
    justify-items: start;
  }

  .coach-sidebar {
    grid-auto-flow: column;
    overflow-x: auto;
  }

  .client-directory-head,
  .client-directory-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .phase-banner-progress {
    justify-content: start;
  }
}

@media (max-width: 640px) {
  .content-panel {
    padding: 4px;
  }

  body.admin-mode-active .content-panel,
  body.client-mode-active .content-panel {
    padding: 0;
  }

  .card {
    width: 100%;
    min-height: 100vh;
    padding: 20px 14px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .client-layout {
    gap: 22px;
  }

  .grid.two-up {
    gap: 18px;
  }

  .phase-banner {
    padding: 20px 16px;
  }

  .phase-value {
    font-size: clamp(1.65rem, 9vw, 2.35rem);
  }

  .hero-phase-ring {
    width: 104px;
    height: 104px;
  }

  .hero-phase-ring .phase-progress-ring-inner {
    width: 76px;
    height: 76px;
  }

  .phase-timeline {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
