:root {
  --primary: #4f46e5;
  --primary-alt: #6366f1;
  --accent: #7c3aed;
  --background: #f7f8fc;
  --surface: #ffffff;
  --surface-dark: #111827;
  --sidebar: #0f172a;
  --text: #111827;
  --muted: #64748b;
  --border: #e5e7eb;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --info: #2563eb;
  --teal: #0f766e;
  --card-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  --modal-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  --sidebar-width: 220px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --content-max: 1440px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-size: 14px;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.icon.small {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

/* Iron Claw Fitness logo: the crab mark, the name, and the slogan under it (app.js logoMarkup). */
.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.brand-text {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
  text-align: left;
}

.brand-slogan {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.72;
  white-space: nowrap;
}

.btn {
  min-height: 44px;
  min-width: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  background: transparent;
  font-weight: 700;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.22);
}

.btn-secondary {
  color: var(--primary);
  background: var(--surface);
  border-color: rgba(79, 70, 229, 0.45);
}

.btn-ghost {
  color: var(--text);
  background: transparent;
}

.marketing-header .btn-ghost,
.sidebar .btn-ghost,
.auth-visual .btn-ghost {
  color: inherit;
}

.btn-danger {
  color: #ffffff;
  background: var(--danger);
}

.btn.full {
  width: 100%;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-grid;
  place-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: #f1f5f9;
}

.badge.success {
  color: #166534;
  background: #dcfce7;
}

.badge.warning {
  color: #92400e;
  background: #fef3c7;
}

.badge.info {
  color: #1d4ed8;
  background: #dbeafe;
}

.badge.danger {
  color: #991b1b;
  background: #fee2e2;
}

.page {
  min-height: 100svh;
}

.marketing-page {
  background: var(--surface);
}

.marketing-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  backdrop-filter: blur(18px);
}

.marketing-header-inner {
  width: min(100%, 1200px);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.marketing-brand,
.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
}

.marketing-brand,
.sidebar-brand,
.nav-text {
  min-height: 44px;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
}

.nav-text {
  font-weight: 800;
}

.nav-text.inline {
  min-height: auto;
  color: var(--primary);
}

.marketing-nav {
  display: flex;
  gap: 22px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.marketing-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.hero {
  min-height: min(700px, calc(100svh - 168px));
  display: flex;
  align-items: center;
  color: #ffffff;
  background-image:
    linear-gradient(
      90deg,
      rgba(15, 23, 42, 0.9) 0%,
      rgba(15, 23, 42, 0.76) 38%,
      rgba(15, 23, 42, 0.28) 72%,
      rgba(15, 23, 42, 0.1) 100%
    ),
    radial-gradient(circle at 78% 45%, rgba(239, 68, 68, 0.28), transparent 45%);
  background-color: #0b1224;
}

.hero-inner {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 48px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  align-items: center;
  gap: 32px;
}

/* The member-aware crab picture (app.js heroImage). */
.hero-figure { display: block; justify-self: center; width: 100%; max-width: 460px; }
.hero-figure img { display: block; width: 100%; height: auto; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.45)); }

.hero-slogan {
  margin: 12px 0 0;
  color: #fca5a5;
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 800;
  letter-spacing: 0.04em;
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-figure { order: -1; max-width: 260px; }
}

.hero-copy {
  width: min(570px, 100%);
}

.hero-kicker {
  margin: 0 0 10px;
  color: #a7f3d0;
  font-weight: 800;
}

.hero h1 {
  margin: 0;
  font-size: clamp(40px, 6.5vw, 76px);
  line-height: 0.95;
  font-weight: 800;
}

.hero-subhead {
  margin: 18px 0 0;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
  max-width: 560px;
}

.hero-stat {
  min-height: 84px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(16px);
}

.hero-stat strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.hero-stat span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.feature-strip {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 28px 32px 56px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.feature-item,
.card,
.stat-card,
.schedule-card,
.pricing-card,
.meal-card,
.goal-card,
.exercise-mobile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
}

.feature-item {
  min-height: 142px;
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.feature-item .feature-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--primary);
  background: #eef2ff;
}

.feature-item h2 {
  margin: 0;
  font-size: 18px;
}

.feature-item p {
  margin: 0;
  color: var(--muted);
}

.auth-page {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  background: var(--surface);
}

.auth-visual {
  min-height: 100svh;
  color: #ffffff;
  background-image:
    linear-gradient(
      90deg,
      rgba(15, 23, 42, 0.86),
      rgba(15, 23, 42, 0.46)
    ),
    url("public/assets/fitai-hero.png");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: end;
  padding: 48px;
}

.auth-visual h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1;
}

.auth-visual p {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.82);
}

.auth-panel {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--background);
}

.auth-card {
  width: min(100%, 440px);
  padding: 28px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}

.auth-card h1 {
  margin: 18px 0 6px;
  font-size: 28px;
}

.auth-card > p {
  margin: 0 0 22px;
  color: var(--muted);
}

.form {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.check-field span {
  font-weight: 800;
}

.field input,
.field select,
.field textarea,
.checkout-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  background: #ffffff;
}

/* Password box with its eye button (app.js passwordToggle): the button sits inside the right edge of the input. */
.password-wrap {
  position: relative;
  display: block;
}

.field .password-wrap input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--text);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field-hint,
.field-error,
.form-note {
  color: var(--muted);
  font-size: 12px;
}

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

/* Sign-up CAPTCHA (membership-ui.js): the provider's widget, then its error line. */
.captcha-field { display: grid; gap: 6px; }
.captcha-widget { min-height: 78px; max-width: 100%; overflow: hidden; }

.check-field {
  min-height: 44px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text);
}

.check-field input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--border);
}

.app-shell {
  min-height: 100svh;
  display: flex;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-width);
  color: #e5e7eb;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
}

.sidebar-brand {
  min-height: 44px;
  padding: 0 8px;
  color: #ffffff;
}

.nav-list {
  display: grid;
  gap: 4px;
  margin-top: 22px;
}

.nav-link {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #cbd5e1;
  background: transparent;
  font-weight: 800;
  text-align: left;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.profile-footer {
  margin-top: auto;
  padding: 12px 8px;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--teal), var(--primary));
  font-weight: 800;
}

.profile-footer strong {
  display: block;
  color: #ffffff;
}

.profile-footer span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
}

.content-shell {
  width: 100%;
  min-height: 100svh;
  margin-left: var(--sidebar-width);
}

.mobile-topbar {
  display: none;
}

.content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 32px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-header h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
}

.page-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tabs {
  min-height: 48px;
  display: flex;
  align-items: end;
  gap: 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  overflow-x: auto;
}

.tab {
  min-height: 48px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  white-space: nowrap;
}

.tab.active {
  color: var(--primary);
  border-color: var(--primary);
}

.dashboard-grid,
.macro-grid,
.progress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.two-column-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 16px;
  align-items: start;
}

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

.card {
  padding: 20px;
}

.card h2,
.card h3,
.pricing-card h2,
.meal-card h3 {
  margin: 0;
}

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

.section-title {
  margin: 26px 0 14px;
  font-size: 20px;
}

.stat-card {
  min-height: 132px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.stat-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: var(--primary);
}

.stat-card.success .stat-icon {
  color: var(--success);
  background: #dcfce7;
}

.stat-card.warning .stat-icon {
  color: var(--warning);
  background: #fef3c7;
}

.stat-card.info .stat-icon {
  color: var(--info);
  background: #dbeafe;
}

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

.stat-value {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  line-height: 1.05;
  font-weight: 800;
}

.delta {
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.schedule-card {
  min-height: 150px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.schedule-card.rest {
  background: #f8fafc;
}

.schedule-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.schedule-day strong {
  font-size: 18px;
}

.schedule-card p {
  margin: 0;
  color: var(--text);
  font-weight: 800;
}

.schedule-card small {
  color: var(--muted);
  font-weight: 700;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
}

.timeline-dot {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 800;
}

.timeline-item h3 {
  margin: 0;
  font-size: 15px;
}

.timeline-item p {
  margin: 3px 0 0;
}

.research-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.research-list li {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid var(--border);
}

.workout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) 340px;
  gap: 16px;
  align-items: start;
}

.breadcrumbs {
  min-height: 34px;
  border: 0;
  padding: 0;
  color: var(--primary);
  background: transparent;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.metadata-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.table-wrap {
  overflow-x: auto;
}

.exercise-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.exercise-table th,
.exercise-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.exercise-table th {
  color: var(--muted);
  font-size: 12px;
}

.exercise-table td strong {
  display: block;
}

.exercise-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-action {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text);
  background: #ffffff;
  font-weight: 800;
}

.exercise-mobile-list {
  display: none;
  gap: 12px;
}

.exercise-mobile-card {
  padding: 16px;
}

.exercise-mobile-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 12px 0;
}

.exercise-mobile-card dt {
  color: var(--muted);
  font-weight: 800;
}

.exercise-mobile-card dd {
  margin: 0;
}

.muscle-map {
  min-height: 290px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: center;
}

.body-map {
  position: relative;
  width: 108px;
  height: 228px;
  margin: 0 auto;
}

.body-map span {
  position: absolute;
  display: block;
  background: #cbd5e1;
}

.body-map .head {
  left: 38px;
  top: 2px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
}

.body-map .torso {
  left: 28px;
  top: 40px;
  width: 52px;
  height: 78px;
  border-radius: 20px 20px 12px 12px;
}

.body-map .arm-l,
.body-map .arm-r {
  top: 48px;
  width: 20px;
  height: 94px;
  border-radius: 999px;
}

.body-map .arm-l {
  left: 4px;
  transform: rotate(12deg);
}

.body-map .arm-r {
  right: 4px;
  transform: rotate(-12deg);
}

.body-map .leg-l,
.body-map .leg-r {
  top: 116px;
  width: 24px;
  height: 108px;
  border-radius: 999px;
}

.body-map .leg-l {
  left: 28px;
}

.body-map .leg-r {
  right: 28px;
}

.body-map .active {
  background: linear-gradient(180deg, var(--primary), var(--success));
}

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

.trainer-tip {
  border-left: 4px solid var(--teal);
  padding-left: 14px;
}

.wizard-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
}

.wizard-rail {
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  gap: 12px;
}

.wizard-step {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}

.wizard-step span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: #f1f5f9;
}

.wizard-step.active {
  color: var(--text);
}

.wizard-step.active span {
  color: #ffffff;
  background: var(--primary);
}

.goal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.goal-card {
  min-height: 126px;
  padding: 16px;
  border-color: var(--border);
  display: grid;
  align-content: space-between;
  text-align: left;
}

.goal-card:hover,
.goal-card.active {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.18);
}

/* One line of intent under each goal name (training-ui.js goalIntents). */
.goal-intent { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.4; font-weight: 400; }

.goal-card.active .stat-icon {
  color: #ffffff;
  background: var(--primary);
}

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

.meal-card {
  overflow: hidden;
}

.meal-visual {
  min-height: 134px;
  background:
    radial-gradient(circle at 22% 30%, rgba(255, 255, 255, 0.88) 0 12%, transparent 13%),
    radial-gradient(circle at 74% 42%, rgba(22, 163, 74, 0.8) 0 14%, transparent 15%),
    radial-gradient(circle at 47% 70%, rgba(245, 158, 11, 0.72) 0 13%, transparent 14%),
    linear-gradient(135deg, #0f766e, #f8fafc 48%, #4f46e5);
}

.meal-card:nth-child(2) .meal-visual {
  background:
    radial-gradient(circle at 30% 62%, rgba(255, 255, 255, 0.9) 0 15%, transparent 16%),
    radial-gradient(circle at 68% 38%, rgba(220, 38, 38, 0.74) 0 12%, transparent 13%),
    radial-gradient(circle at 48% 28%, rgba(37, 99, 235, 0.55) 0 8%, transparent 9%),
    linear-gradient(135deg, #f59e0b, #ffffff 50%, #16a34a);
}

.meal-card:nth-child(3) .meal-visual {
  background:
    radial-gradient(circle at 28% 38%, rgba(255, 255, 255, 0.88) 0 16%, transparent 17%),
    radial-gradient(circle at 69% 65%, rgba(15, 118, 110, 0.8) 0 13%, transparent 14%),
    radial-gradient(circle at 58% 32%, rgba(124, 58, 237, 0.48) 0 10%, transparent 11%),
    linear-gradient(135deg, #111827, #e2e8f0 47%, #f59e0b);
}

.meal-card:nth-child(4) .meal-visual {
  background:
    radial-gradient(circle at 36% 36%, rgba(255, 255, 255, 0.86) 0 16%, transparent 17%),
    radial-gradient(circle at 70% 65%, rgba(79, 70, 229, 0.72) 0 12%, transparent 13%),
    radial-gradient(circle at 62% 30%, rgba(22, 163, 74, 0.72) 0 10%, transparent 11%),
    linear-gradient(135deg, #64748b, #f8fafc 45%, #0f766e);
}

.meal-body {
  padding: 16px;
}

.macro-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.macro-row span {
  padding: 8px;
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 800;
}

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

.chart-card {
  min-height: 320px;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.line-chart,
.bar-chart {
  width: 100%;
  height: 220px;
}

.line-chart path,
.line-chart polyline {
  fill: none;
  stroke: var(--primary);
  stroke-width: 4;
}

.line-chart .area {
  fill: rgba(79, 70, 229, 0.12);
  stroke: none;
}

.bar-chart rect {
  fill: var(--teal);
  rx: 5;
}

.pricing-page,
.checkout-page {
  min-height: 100svh;
  background: var(--background);
}

.pricing-wrap,
.checkout-wrap {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 32px;
}

.pricing-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.pricing-header h1,
.checkout-header h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.05;
}

.pricing-header p,
.checkout-header p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.pricing-card {
  position: relative;
  min-height: 410px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pricing-card.featured {
  border-color: rgba(79, 70, 229, 0.5);
  box-shadow: 0 14px 34px rgba(79, 70, 229, 0.18);
}

.price {
  display: flex;
  align-items: end;
  gap: 5px;
}

.price strong {
  font-size: 42px;
  line-height: 1;
}

.pricing-card ul,
.summary-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pricing-card li,
.summary-list li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  color: var(--muted);
}

.pricing-card .btn {
  margin-top: auto;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.payment-methods {
  display: flex;
  gap: 10px;
  margin: 18px 0;
}

.payment-method {
  min-height: 44px;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-weight: 800;
}

.payment-method.active {
  border-color: var(--primary);
  color: var(--primary);
  background: #eef2ff;
}

.provider-box {
  min-height: 94px;
  padding: 14px;
  border: 1px dashed #94a3b8;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--muted);
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.summary-row.total {
  border-bottom: 0;
  font-size: 18px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.58);
}

.modal {
  width: min(100%, 560px);
  max-height: calc(100svh - 40px);
  overflow: auto;
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--modal-shadow);
}

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

.modal h2 {
  margin: 0;
}

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

#toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: grid;
  gap: 10px;
}

.toast {
  width: min(360px, calc(100vw - 36px));
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: #ffffff;
  background: var(--surface-dark);
  box-shadow: var(--modal-shadow);
}


.trainer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 360px;
  gap: 16px;
  align-items: start;
}

.trainer-chat-panel {
  min-height: 660px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
}

.trainer-chat-header,
.trainer-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.trainer-chat-header h2,
.trainer-card-heading h2 {
  margin: 0;
}

.trainer-chat-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.trainer-messages {
  min-height: 430px;
  max-height: 56svh;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid var(--border);
}

.trainer-message {
  width: min(78%, 620px);
  display: grid;
  gap: 5px;
}

.trainer-message.user {
  justify-self: end;
}

.trainer-message span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trainer-message p {
  margin: 0;
  white-space: pre-line; /* trainer replies list exercises one per line */
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
}

.trainer-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trainer-suggestion {
  padding: 7px 12px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  color: var(--primary);
  background: #ffffff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.trainer-suggestion:hover,
.trainer-suggestion:focus-visible {
  color: #ffffff;
  background: var(--primary);
}

.trainer-message.user p {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

.trainer-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.trainer-input input {
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #ffffff;
}

.trainer-sidebar,
.trainer-review-grid {
  display: grid;
  gap: 16px;
}

.trainer-review-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.trainer-metric-card {
  display: grid;
  gap: 14px;
}

.readiness-score {
  display: flex;
  align-items: end;
  gap: 8px;
}

.readiness-score strong {
  font-size: 56px;
  line-height: 0.95;
}

.readiness-score span {
  color: var(--muted);
  font-weight: 800;
}

.trainer-focus {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

/* Weekly Trainer Review (app.js renderWeeklyReviewCard): the week's dates, last week, hints for blank figures, the log button. */
/* "1 / 4" stays on one line in the narrow cards. */
.trainer-card-heading .badge {
  white-space: nowrap;
  flex-shrink: 0;
}

.trainer-review-range {
  margin: 0 0 10px;
}

.trainer-review-last {
  margin: 10px 0 0;
  font-size: 14px;
}

.trainer-review-hints {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted, #64748b);
}

.trainer-review-actions {
  margin-top: 12px;
}

.trainer-review-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.trainer-review-stats span {
  min-height: 72px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 800;
}

.trainer-review-stats strong {
  display: block;
  color: var(--text);
  font-size: 20px;
}

.insight-bars {
  height: 160px;
  display: flex;
  align-items: end;
  gap: 10px;
  margin-top: 18px;
}

.insight-bars span {
  flex: 1;
  min-width: 32px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: linear-gradient(180deg, var(--teal), var(--primary));
}

.substitution-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.substitution-option {
  min-height: 74px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  text-align: left;
  background: #ffffff;
}

.substitution-option:hover {
  border-color: var(--primary);
  background: #eef2ff;
}

.substitution-option span {
  color: var(--muted);
}

.substitution-option em {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--primary);
  font-style: normal;
  font-weight: 800;
}

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

.drawer-backdrop {
  display: none;
}

.placeholder-panel {
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
}

.placeholder-panel p {
  max-width: 520px;
  margin: 8px auto 0;
}

@media (max-width: 1180px) {
  .feature-strip,
  .dashboard-grid,
  .macro-grid,
  .progress-grid,
  .meal-grid,
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-grid {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
  }

  .workout-layout,
  .two-column-grid,
  .checkout-layout,
  .trainer-layout,
  .trainer-review-grid {
    /* minmax(0, …): a plain 1fr never shrinks below its widest content, which pushed cards past a phone screen. */
    grid-template-columns: minmax(0, 1fr);
  }

  .wizard-layout {
    grid-template-columns: 1fr;
  }

  .wizard-rail {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .marketing-nav {
    display: none;
  }

  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 280px;
  }

  .auth-panel {
    min-height: auto;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

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

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    background: rgba(15, 23, 42, 0.5);
  }

  .content-shell {
    margin-left: 0;
    padding-bottom: 74px;
  }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 25;
    height: 64px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(247, 248, 252, 0.9);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
  }

  .content {
    padding: 24px;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    min-height: 64px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    background: #ffffff;
    border-top: 1px solid var(--border);
  }

  .bottom-nav-link {
    border: 0;
    background: transparent;
    color: var(--muted);
    display: grid;
    place-items: center;
    gap: 2px;
    padding: 7px 4px;
    font-size: 11px;
    font-weight: 800;
  }

  .bottom-nav-link.active {
    color: var(--primary);
  }

  .page-header,
  .pricing-header {
    display: grid;
  }

  .hero {
    min-height: min(680px, calc(100svh - 178px));
    background-position: center;
  }
}

@media (max-width: 680px) {
  .marketing-header-inner {
    padding: 0 16px;
  }

  .marketing-actions .btn-secondary {
    display: none;
  }

  .hero-inner {
    padding: 36px 16px;
  }

  .hero h1 {
    font-size: 52px;
  }

  .hero-subhead {
    font-size: 16px;
  }

  .hero-stats,
  .feature-strip,
  .dashboard-grid,
  .macro-grid,
  .progress-grid,
  .meal-grid,
  .pricing-grid,
  .chart-grid,
  .trainer-review-stats,
  .goal-grid,
  .social-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .feature-strip,
  .pricing-wrap,
  .checkout-wrap,
  .content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-header h1,
  .pricing-header h1,
  .checkout-header h1 {
    font-size: 28px;
  }

  .tabs {
    gap: 16px;
  }

  .wizard-rail {
    grid-template-columns: 1fr 1fr;
  }

  .table-wrap {
    display: none;
  }

  .exercise-mobile-list {
    display: grid;
  }

  .pricing-card {
    min-height: auto;
  }
}

/* Saved profiles and personal training plans. */
.training-fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
.training-fieldset legend { font-weight: 800; }
.training-step-content { display: grid; gap: 18px; }
.training-step-content > .badge { justify-self: start; }
.training-step-content h2, .training-step-content p { margin: 0; }
.training-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.training-goal { position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.training-goal input { position: absolute; top: 14px; right: 14px; width: 18px; height: 18px; accent-color: var(--primary); }
.training-goal:focus-within { outline: 3px solid var(--primary); outline-offset: 3px; }
.training-goal .stat-icon { margin-bottom: 12px; }
.training-bulk { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } /* Select all / Clear all above a checkbox grid */
.equipment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.training-equipment { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.training-equipment:has(input:checked) { border-color: var(--primary); background: #f5f3ff; }
.training-equipment input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--primary); }
.training-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.training-summary { display: grid; gap: 0; margin: 0; }
.training-summary > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.training-summary dt { color: var(--muted); }
.training-summary dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.training-error { padding: 14px; color: var(--danger); background: #fff1f2; border-radius: var(--radius-sm); }
.training-empty { max-width: 680px; padding: 32px; }
.training-empty .training-actions { justify-content: flex-start; }
.training-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.training-schedule { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.training-session { display: flex; flex-direction: column; text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.training-session:hover { border-color: var(--primary); box-shadow: 0 8px 24px rgba(79, 70, 229, .10); }
.training-session h3 { margin-top: 20px; }
.training-session-link { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; color: var(--primary); font-weight: 700; }
.training-plan-notes { margin: 24px 0; }
.training-exercises { display: grid; gap: 0; }
.training-exercise { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; padding: 22px 0; border-top: 1px solid var(--border); }
.training-exercise h3 { margin: 0 0 10px; }
.training-prescription { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); }
.training-exercise .exercise-order { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #f1f5f9; font-weight: 800; }
.training-step-content:disabled { opacity: .7; }
@media (max-width: 1100px) {
  .equipment-grid, .training-schedule { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .training-fields, .training-stats, .training-schedule { grid-template-columns: 1fr; }
  .training-summary > div { grid-template-columns: 90px minmax(0, 1fr); gap: 10px; }
  .training-onboarding { padding: 18px; }
  .training-onboarding .goal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .training-actions > .btn { flex: 1; }
}

/* Knowledge-engine additions: limitations, session notes, exercise how-to. */
.training-limitations { margin-top: 22px; }
.training-session-notes { margin-bottom: 18px; }
.training-howto { margin-top: 12px; }
.training-howto > summary { cursor: pointer; font-weight: 700; color: var(--primary, inherit); }
.training-howto-body { margin-top: 10px; display: grid; gap: 8px; }
.training-howto-body h4 { margin: 10px 0 0; }
.training-howto-body ol, .training-howto-body ul { margin: 0; padding-left: 20px; }
.training-diagram { max-width: min(100%, 420px); height: auto; border: 1px solid var(--border); border-radius: 10px; background: #fff; }

/* Goals & Preferences page: one editable page, sticky save bar. */
.nav-link span { overflow-wrap: anywhere; line-height: 1.2; }
.training-preferences .card { margin-bottom: 16px; }
.training-current-plan { margin-bottom: 16px; }
.training-savebar {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 14px 16px; margin-top: 8px; background: var(--surface, #fff); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.08);
}
.training-savebar .badge { margin-right: auto; }
.training-weeks { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.training-weeks input { width: 72px; }

/* Language switcher (i18n.js). */
.language-switch { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface, #fff); }
.language-option { border-radius: 999px; padding: 6px 12px; font-weight: 700; }
.language-option[aria-pressed="true"] { background: var(--primary, #2563eb); color: #fff; }
.language-switch-sidebar { margin: 12px 14px; align-self: flex-start; background: transparent; border-color: rgba(255, 255, 255, 0.25); }
.language-switch-sidebar .language-option { color: #cbd5e1; }
.language-switch-sidebar .language-option[aria-pressed="true"] { color: #fff; }
.language-switch-header { margin-right: 8px; }


/* Exercise figure (exercise-figure.js): a rotatable schematic figure in "How to do it". */
.exercise-figure { margin: 0; display: grid; gap: 8px; }
.fig-stage { border: 1px solid var(--border); border-radius: 12px; background: #fff; touch-action: pan-y; cursor: grab; max-width: min(100%, 460px); }
.fig-stage:active { cursor: grabbing; }
.fig-stage:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.fig-svg { display: block; width: 100%; height: auto; }
.fig-controls { display: flex; flex-wrap: wrap; gap: 6px; }
.fig-controls .btn { padding: 6px 12px; min-height: 36px; }
.fig-controls [aria-pressed="true"] { border-color: var(--primary); color: var(--primary); }
.fig-note { margin: 0; }
.fig-floor { fill: #eef2ff; stroke: #c7d2fe; stroke-width: 1; }
.fig-shadow { opacity: 0.16; }
.fig-shadow-part { fill: #0f172a; stroke: none; }
.fig-outline { fill: #1e1b4b; stroke: #1e1b4b; stroke-linejoin: round; }
.fig-skin, .fig-skin-far, .fig-shirt, .fig-shirt-far, .fig-shorts, .fig-shorts-far, .fig-shoe, .fig-shoe-far, .fig-hair, .fig-nose { stroke-width: 1; stroke-linejoin: round; }
.fig-skin { fill: #f1c7a3; stroke: #9a6a4a; }
.fig-skin-far { fill: #d9a983; stroke: #8a5d40; }
.fig-shirt { fill: #4f46e5; stroke: #4f46e5; }
.fig-shirt-far { fill: #3f38c4; stroke: #3f38c4; }
.fig-shorts { fill: #334155; stroke: #334155; }
.fig-shorts-far { fill: #243042; stroke: #243042; }
.fig-shoe { fill: #f8fafc; stroke: #64748b; }
.fig-shoe-far { fill: #cbd5e1; stroke: #64748b; }
.fig-hair { fill: #3b2a20; stroke: #2a1d15; }
.fig-nose { fill: #e0a882; stroke: none; }
.fig-eye { fill: #1f2937; stroke: none; }
.fig-prop { stroke: #111827; stroke-linecap: round; }
.fig-plate { stroke: #334155; fill: #334155; stroke-linecap: round; }
.fig-frame { stroke: #64748b; fill: #64748b; stroke-linecap: round; }
.fig-cable { stroke: #94a3b8; fill: none; stroke-linecap: round; }
.fig-box-top { fill: #cbd5e1; stroke: #64748b; }
.fig-box-side { fill: #94a3b8; stroke: #64748b; }

/* Anatomy illustration (exercise-anatomy.js): a dark card in the style of the reference infographic. */
.exercise-figure.anat { background: linear-gradient(180deg, #14171c, #0b0d10); color: #f5f7fa; border: 1px solid #262a31; border-radius: 16px; padding: 16px; gap: 0; }
.anat-title { margin: 0; font-size: clamp(22px, 4.2vw, 34px); font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; color: #fff; }
.anat-sub { margin: 2px 0 12px; color: #a5abb6; font-size: 15px; }
.anat-grid { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; }
.anat .fig-stage { background: #0c0e12; border: 1px solid #262a31; max-width: none; overflow: hidden; }
.an-svg { display: block; width: 100%; height: auto; }
.anat-side { display: grid; gap: 8px; align-content: start; }
.anat-inset { margin: 0; background: #101318; border: 1px solid #262a31; border-radius: 12px; overflow: hidden; text-align: center; }
.anat-inset figcaption { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #a5abb6; padding: 2px 0 7px; }
.anat-mini svg { display: block; width: 100%; height: auto; }
.anat-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.anat-key { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.anat-key.primary { background: #ea5733; } .anat-key.secondary { background: #f0a04b; }
.anat-legend ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; }
.anat-chip { background: #1b1f26; border: 1px solid #2b3038; border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.anat-none { color: #8b93a0; }
.anat-points { counter-reset: pt; list-style: none; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 14px 0 0; padding: 12px; border: 1px solid #262a31; border-radius: 14px; background: #101318; }
.anat-points li { counter-increment: pt; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.35; }
.anat-points li::before { content: counter(pt); flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #cfd4db; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.anat .fig-controls { margin-top: 12px; }
.anat .fig-controls .btn { background: #1b1f26; color: #e8ebf0; border: 1px solid #2b3038; }
.anat .fig-controls [aria-pressed="true"] { border-color: #34d399; color: #34d399; }
.anat .fig-note { color: #8b93a0; margin-top: 8px; }
@media (max-width: 640px) { .anat-grid { grid-template-columns: 1fr; } .anat-side { grid-template-columns: repeat(4, 1fr); } }
.an-floor { fill: #1a1d23; stroke: none; }
.an-skin { stroke: #23262c; stroke-width: 1; stroke-linejoin: round; }
.an-hint { fill: #767c86; fill-opacity: 0.42; stroke: #1e2126; stroke-opacity: 0.35; stroke-width: 0.7; stroke-linejoin: round; }
.an-fibre { stroke: #3c140a; stroke-opacity: 0.3; stroke-width: 1; }
.an-arrow { stroke: #34d399; stroke-width: 3; stroke-dasharray: 7 5; stroke-linecap: round; }
.an-arrowhead { fill: #34d399; }
.an-leader { stroke: #dfe3ea; stroke-width: 1; }
.an-dot { fill: #fff; stroke: #23262c; stroke-width: 1; }
.an-name { font: 700 15px Inter, ui-sans-serif, system-ui, sans-serif; fill: #f5f7fa; }
.an-where { font: 400 12px Inter, ui-sans-serif, system-ui, sans-serif; fill: #a5abb6; }
.an-tag { font: 700 11px Inter, ui-sans-serif, system-ui, sans-serif; fill: #34d399; letter-spacing: 0.08em; }
.an-prop { stroke: #cfd4db; stroke-linecap: round; }
.an-plate { stroke: #8b95a3; fill: #8b95a3; stroke-linecap: round; }
.an-frame { stroke: #7c8796; fill: #7c8796; stroke-linecap: round; }
.an-cable { stroke: #8f99a8; fill: none; stroke-linecap: round; }
.an-box-top { fill: #5a6472; stroke: #8f99a8; }
.an-box-side { fill: #414a56; stroke: #8f99a8; }

/* Optional photoreal illustration (docs/exercise-images/README.md), shown above the animated figure. */
.training-photo { margin: 0 0 12px; }
/* Natural size up to the panel's 560 px: a posture exercise's picture is one panel of its chart (366-1532 px wide, see
   tools/posture/build_images.py) and would blur if stretched; every other exercise photo is wider than 560 px anyway. */
.training-photo img { display: block; width: auto; max-width: min(100%, 560px); height: auto; border-radius: 14px; border: 1px solid #262a31; background: #0c0e12; }
.training-photo figcaption { margin-top: 6px; font-size: 13px; color: var(--muted, #64748b); }

/* Week planner on the plan page (training-ui.js weekPlanner): this week and next week, Monday to Sunday. */
.planner-weeks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 12px 0 28px; }
.planner-week { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.planner-week.cleared .planner-days { opacity: .6; }
.planner-week-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.planner-week-header h3 { margin: 0 0 2px; }
.planner-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.planner-day { display: grid; grid-template-columns: 165px minmax(0, 1fr) auto; align-items: baseline; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.planner-day.today { background: color-mix(in srgb, var(--primary) 8%, transparent); border-radius: 8px; padding-inline: 8px; margin-inline: -8px; }
.planner-weekday { display: flex; gap: 8px; align-items: baseline; }
.planner-weekday span, .planner-meta, .planner-rest { color: var(--muted); font-size: 13px; }
.planner-day a { font-weight: 700; color: var(--primary); text-decoration: none; overflow-wrap: anywhere; }
.planner-day.rest .planner-rest { grid-column: 2 / span 2; }
.planner-week .clear-list-question { margin: 0; }
@media (max-width: 900px) {
  .planner-weeks { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .planner-day { grid-template-columns: 1fr auto; }
  .planner-weekday { grid-column: 1 / -1; }
  .planner-day.rest .planner-rest { grid-column: 1 / -1; }
}

/* Daily energy card on Goals & Preferences (training-ui.js energyCard). The person's own activity level is highlighted. */
.training-energy p { margin: 0 0 10px; }
.energy-band { margin: 4px 0 8px; }
.energy-band > div.current { background: color-mix(in srgb, var(--primary) 8%, transparent); border-radius: 8px; padding-inline: 8px; margin-inline: -8px; font-weight: 700; }
.energy-band > div { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); }

/* Rebrand layout fixes (2026-09-25). */
/* The header's language switch sits on the dark header: like the sidebar one, light text on a clear background (the inactive
   language was white on white, so "Русский" could not be seen). */
.language-switch-header { background: transparent; border-color: rgba(255, 255, 255, 0.3); }
.language-switch-header .language-option { color: #cbd5e1; }
.language-switch-header .language-option[aria-pressed="true"] { color: #fff; }
/* The sidebar is narrow: the slogan wraps inside it instead of running into the page. */
.sidebar-brand { max-width: 100%; }
.sidebar-brand .brand-slogan { white-space: normal; }
@media (max-width: 680px) {
  /* On a phone the header keeps the crab and the name (the slogan is in the hero right below) and its buttons may wrap. */
  .marketing-header { height: auto; min-height: 64px; }
  .marketing-header-inner { flex-wrap: wrap; row-gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .marketing-brand .brand-slogan { display: none; }
  .marketing-actions { flex-wrap: wrap; justify-content: flex-end; }
}

/* Log out, at the bottom of the sidebar under the member's name (app.js renderSidebar). Spans the whole card width. */
.sidebar-logout {
  grid-column: 1 / -1;
  justify-content: flex-start;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
}
.sidebar-logout:hover, .sidebar-logout:focus-visible { color: #ffffff; background: rgba(255, 255, 255, 0.08); }
/* Phone menu: when the drawer is open it sits above the bottom navigation bar (which covered its profile card and Log out), and
   it scrolls on short screens so the bottom of it can always be reached. */
.sidebar { overflow-y: auto; }
@media (max-width: 900px) {
  .sidebar.open { z-index: 60; }
}

/* Progress page (progress-ui.js, stage PR1). */
.progress-stats { margin-bottom: 16px; }
.progress-welcome { margin-bottom: 16px; border-left: 4px solid var(--primary); }
.progress-logs { margin-bottom: 16px; align-items: start; }
.progress-log h2 { margin-top: 0; }
.progress-done { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--success, #16a34a); }
.progress-done strong { color: var(--text); }
.progress-other { margin-top: 14px; }
.progress-detail { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.progress-exercise { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px 12px; margin: 0; }
.progress-exercise legend { font-weight: 700; padding: 0 6px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.progress-set { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; margin-top: 6px; }
.progress-set span { color: var(--muted); font-size: 13px; }
.progress-set input { width: 100%; min-height: 40px; }
.progress-entries { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 0; }
.progress-entries li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 6px 0; border-top: 1px solid var(--border); }
.progress-entries li span { color: var(--muted); }
.progress-chart { margin-bottom: 16px; }
.progress-chart svg { width: 100%; height: auto; display: block; }
.progress-chart .grid { stroke: var(--border); stroke-width: 1; }
.progress-chart .axis { fill: var(--muted); }  /* size set per screen in progress-ui.js WeightChart */
.progress-chart .line { fill: none; stroke: var(--primary); stroke-width: 2.5; }
.progress-chart .avg { fill: none; stroke: #f59e0b; stroke-width: 2; stroke-dasharray: 6 5; }
.progress-chart circle { fill: var(--primary); }
.progress-chart .legend { display: inline-block; width: 18px; height: 0; vertical-align: middle; margin: 0 4px 0 10px; border-top: 3px solid var(--primary); }
.progress-chart .legend.avg { border-top: 3px dashed #f59e0b; }
@media (max-width: 640px) {
  .progress-set { grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr); }
}
.progress-recent-list { list-style: none; margin: 0; padding: 0; gap: 0; }
.progress-recent-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.progress-recent-list li div { display: flex; flex-direction: column; }
.progress-recent-list li div span, .progress-recent-list p { color: var(--muted); font-size: 13px; }
.progress-recent-list p { grid-column: 1; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.progress-recent-list .btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

/* Progress page stage PR2: period picker, goal headline, consistency calendar, strength. */
.progress-range { min-width: 180px; margin: 0; }
.progress-headline { margin-bottom: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-left: 4px solid var(--warning); }
.progress-headline.good { border-left-color: var(--success); }
.progress-headline p { margin: 0; font-weight: 600; flex: 1 1 320px; }
.progress-calendar { margin-bottom: 16px; }
.progress-calendar .section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.progress-streak { margin: 0; color: var(--muted); font-weight: 600; }
.progress-cal-scroll { overflow-x: auto; padding-bottom: 4px; }
.progress-cal { display: flex; gap: 4px; width: max-content; }
.progress-cal-week { display: grid; grid-template-rows: repeat(7, auto); gap: 4px; }
.progress-cal.large .cell { width: 24px; height: 24px; }
.progress-cal.small .cell { width: 11px; height: 11px; }
.progress-cal-week.labels span { height: 24px; font-size: 11px; color: var(--muted); display: flex; align-items: center; padding-right: 4px; }
.cell { display: inline-block; border-radius: 4px; background: #eef2f7; }
.cell.done { background: var(--success); }
.cell.missed { background: #fca5a5; }
.cell.extra { background: #818cf8; }
.cell.rest { background: #eef2f7; }
.cell.holiday { background: repeating-linear-gradient(45deg, #fde68a, #fde68a 3px, #fef3c7 3px, #fef3c7 6px); }
.cell.today, .cell.planned_upcoming { background: #ffffff; box-shadow: inset 0 0 0 2px var(--success); }
.cell.upcoming, .cell.outside, .cell.before_plan { background: transparent; box-shadow: inset 0 0 0 1px #e5e7eb; }
.progress-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 4px; font-size: 13px; color: var(--muted); }
.progress-legend span { display: inline-flex; align-items: center; gap: 6px; }
.progress-legend i.cell { width: 14px; height: 14px; }
.progress-charts { margin-bottom: 16px; align-items: start; }
.progress-charts .progress-chart { margin-bottom: 0; }
.progress-lifts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.progress-lift { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.progress-lift-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.progress-lift-value { margin: 6px 0 2px; font-size: 22px; font-weight: 800; }
.progress-lift p { margin: 0 0 4px; }
/* Progress stage PR3: planned meals against targets */
.progress-nutrition-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 12px 0; }
.progress-nutrition-stat { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.progress-nutrition-stat strong { font-size: 20px; }
.progress-nutrition-stat small, .progress-nutrition-stat span { color: var(--muted); font-size: 13px; }
.progress-nutrition-days { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.progress-nutrition-days li { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 6px 14px; align-items: center; border-top: 1px solid var(--border); padding-top: 8px; }
.progress-nutrition-days li div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.progress-bar { position: relative; flex-basis: 100%; height: 6px; border-radius: 3px; background: var(--border); }
.progress-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--primary); }
.progress-bar b { position: absolute; top: -2px; bottom: -2px; left: 66.7%; width: 2px; background: var(--text); }
.progress-nutrition .field-hint span { display: block; }
@media (max-width: 640px) { .progress-nutrition-days li { grid-template-columns: 1fr; } }
.progress-spark { width: 100%; height: 34px; margin: 4px 0; }
.progress-spark polyline { fill: none; stroke: var(--primary); stroke-width: 2; }
@media (max-width: 640px) {
  .progress-range { min-width: 0; width: 100%; }
}
.progress-lift-facts { display: flex; flex-direction: column; gap: 2px; }
.progress-streak { display: flex; gap: 4px 14px; flex-wrap: wrap; }
.progress-strength { margin-bottom: 16px; }
.progress-strength .progress-lifts { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
