:root {
  --ink: #101827;
  --muted: #667085;
  --blue: #5c8ce7;
  --navy: #101a2d;
  --card-border: #e3e8f0;
  --page: #eef4fb;
  --wake: #eef6ff;
  --breakfast: #fff5ea;
  --pre: #fffbea;
  --post: #effcf3;
  --lunch: #eafbf4;
  --dinner: #f4f1ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.86), transparent 32rem),
    var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.35;
}

.plan-shell {
  width: min(1720px, calc(100% - 48px));
  margin: 6vw auto;
  padding: 28px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(16, 24, 39, 0.08);
  border-radius: 32px;
  box-shadow: 0 28px 70px rgba(23, 35, 56, 0.16);
}

.plan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid #dfe5ee;
}

h1,
h2,
p {
  margin: 0;
}

.plan-header h1 {
  font-size: clamp(2.5rem, 5vw, 4.4rem);
  letter-spacing: 0;
  line-height: 0.95;
}

.plan-header p {
  margin-top: 8px;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.25vw, 1.25rem);
  font-weight: 700;
}

.plan-pill,
.meal-total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 16px;
  border-radius: 999px;
  background: #e6f7ff;
  color: #12637e;
  font-weight: 800;
  white-space: nowrap;
}

.plan-actions {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 10px;
}

.version-pill,
.history-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d9e2ec;
  background: rgba(255, 255, 255, 0.82);
  color: #344054;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.history-link {
  color: #12637e;
}

.history-link.primary {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.client-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #dfe5ee;
}

.client-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #d9e2ec;
  border-radius: 999px;
  color: #344054;
  background: #fff;
  font-weight: 900;
  text-decoration: none;
}

.client-nav a.active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.macro-grid {
  display: grid;
  grid-template-columns: 1.35fr repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.macro-card,
.estimate-grid article {
  min-height: 116px;
  padding: 20px;
  border-radius: 18px;
  color: #fff;
  background: var(--navy);
}

.macro-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.macro-card span,
.estimate-grid span,
.tag {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 900;
}

.macro-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.45rem, 2vw, 2.05rem);
  line-height: 1;
}

.macro-card.large strong {
  font-size: clamp(1.7rem, 2.3vw, 2.35rem);
}

.macro-card p {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
  font-size: 1.08rem;
}

.meal-layout {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.span-3 {
  grid-column: span 3;
}

.span-6 {
  grid-column: span 6;
}

.span-12 {
  grid-column: span 12;
}

.meal-card {
  min-height: 236px;
  padding: 22px;
  border: 1px solid var(--card-border);
  border-radius: 20px;
}

.wake {
  background: var(--wake);
}

.breakfast {
  background: var(--breakfast);
}

.pre {
  background: var(--pre);
}

.post {
  background: var(--post);
}

.lunch {
  background: var(--lunch);
}

.dinner {
  min-height: 260px;
  background: var(--dinner);
}

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

.meal-heading.compact {
  gap: 10px;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 6px 18px rgba(31, 41, 55, 0.06);
}

h2 {
  font-size: clamp(1.25rem, 1.8vw, 1.65rem);
  line-height: 1.08;
}

.compact h2 {
  font-size: clamp(1.18rem, 1.55vw, 1.55rem);
}

.meal-total {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #e5ebf2;
  background: rgba(255, 255, 255, 0.78);
  color: #344054;
  font-size: 0.96rem;
}

.tag {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #344054;
}

.meal-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 16px 0 0;
  list-style: none;
  color: #283346;
  font-size: clamp(1rem, 1.25vw, 1.22rem);
}

.meal-list li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  padding-left: 20px;
}

.meal-list li::before {
  content: "";
  position: absolute;
  top: 0.65em;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
}

.meal-list strong {
  color: #111827;
  font-weight: 900;
}

.meal-list b {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #344054;
  font-size: 0.9rem;
  white-space: nowrap;
}

.dinner-list {
  max-width: 65%;
}

.estimate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.estimate-grid article {
  min-height: 82px;
  padding: 18px 20px;
}

.estimate-grid strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(0.98rem, 1.2vw, 1.15rem);
  line-height: 1.1;
}

.version-panel {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid #dfe5ee;
  border-radius: 18px;
  background: #f8fbff;
}

.version-panel span,
.history-list article span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.version-panel strong {
  display: block;
  margin-top: 4px;
}

.version-panel a,
.history-actions a {
  color: #12637e;
  font-weight: 900;
  text-decoration: none;
}

.history-shell {
  max-width: 980px;
}

.history-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.history-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 20px;
  border: 1px solid #dfe5ee;
  border-radius: 18px;
  background: #fff;
}

.history-list h2 {
  margin-top: 6px;
}

.history-list p {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.history-actions {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 10px;
}

.workout-shell {
  max-width: 1360px;
}

.workout-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.workout-summary article {
  min-height: 118px;
  padding: 20px;
  border-radius: 18px;
  color: #fff;
  background: var(--navy);
}

.workout-summary span,
.day-heading span {
  display: block;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.workout-summary strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.55rem, 2vw, 2.25rem);
  line-height: 1;
}

.workout-summary p {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.workout-week {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.workout-controls {
  display: none;
}

.workout-enhanced .workout-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #dfe5ee;
  border-radius: 18px;
  background: #f8fbff;
}

.workout-controls button,
.day-tabs button {
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid #d9e2ec;
  border-radius: 999px;
  color: #344054;
  background: #fff;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 900;
  cursor: pointer;
}

.workout-controls button:hover,
.day-tabs button:hover,
.day-tabs button.active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.day-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.workout-enhanced .workout-week {
  grid-template-columns: minmax(0, 1fr);
}

.workout-enhanced .workout-day {
  display: none;
}

.workout-enhanced .workout-day.active {
  display: flex;
}

.workout-day {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 20px;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  background: #fff;
}

.workout-day:nth-child(3n + 1) {
  background: #eef6ff;
}

.workout-day:nth-child(3n + 2) {
  background: #eafbf4;
}

.workout-day:nth-child(3n) {
  background: #fff5ea;
}

.day-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(16, 24, 39, 0.1);
}

.day-heading span {
  color: #12637e;
}

.day-heading strong {
  max-width: 56%;
  text-align: right;
  color: #344054;
  font-size: 0.98rem;
}

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

.exercise-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.exercise-list span {
  color: #1f2937;
  font-weight: 800;
}

.exercise-list b,
.cardio-note {
  align-self: start;
  padding: 5px 9px;
  border-radius: 999px;
  color: #344054;
  background: #fff;
  font-size: 0.9rem;
  white-space: nowrap;
}

.cardio-note {
  margin-top: auto;
  margin-bottom: 0;
  justify-self: flex-start;
  color: #12637e;
  font-weight: 900;
}

.check-in-shell {
  max-width: 980px;
}

.check-in-panel {
  display: grid;
  gap: 20px;
  margin-top: 16px;
  padding: 24px;
  border: 1px solid #dfe5ee;
  border-radius: 18px;
  background: #f8fbff;
}

.check-in-panel span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.check-in-panel h2 {
  margin-top: 8px;
}

.check-in-panel p {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 700;
}

.check-in-panel a {
  color: #12637e;
  font-weight: 900;
  text-decoration: none;
}

.check-in-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.check-in-form {
  display: grid;
  gap: 22px;
}

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

.check-in-form label,
.photo-fields {
  display: grid;
  gap: 8px;
}

.check-in-form label span,
.photo-fields legend {
  color: #344054;
  font-size: 0.86rem;
  font-weight: 900;
}

.check-in-form input,
.check-in-form select,
.check-in-form textarea {
  width: 100%;
  border: 1px solid #cfd9e6;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
}

.check-in-form input,
.check-in-form select {
  min-height: 46px;
  padding: 10px 12px;
}

.check-in-form textarea {
  min-height: 136px;
  padding: 12px;
  resize: vertical;
}

.check-in-form input[type='file'] {
  padding: 9px;
  font-size: 0.92rem;
}

.photo-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
  border: 0;
}

.photo-fields legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}

.notes-field {
  display: grid;
}

.hidden-field {
  display: none;
}

.form-note,
.form-status {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.form-status {
  min-height: 24px;
  color: #12637e;
}

.check-in-panel .check-in-button {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 999px;
  color: #fff;
  background: var(--navy);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
}

.home-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.home-shell {
  width: min(720px, 100%);
}

.home-panel {
  padding: 36px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(23, 35, 56, 0.16);
}

.eyebrow {
  color: #12637e;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.home-panel h1 {
  margin-top: 8px;
  font-size: clamp(2.3rem, 6vw, 4rem);
  line-height: 1;
}

.home-copy {
  margin-top: 12px;
  color: var(--muted);
  font-weight: 700;
}

.home-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.client-link {
  display: inline-flex;
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  background: var(--navy);
  font-weight: 900;
  text-decoration: none;
}

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

  .macro-card.large {
    grid-column: span 2;
  }

  .span-3,
  .span-6 {
    grid-column: span 6;
  }

  .estimate-grid {
    grid-template-columns: 1fr;
  }

  .workout-week,
  .workout-summary {
    grid-template-columns: 1fr;
  }

  .dinner-list {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .plan-shell {
    width: min(100% - 24px, 1720px);
    margin: 12px auto;
    padding: 18px;
    border-radius: 22px;
  }

  .plan-header,
  .meal-heading,
  .history-list article {
    flex-direction: column;
  }

  .history-list article {
    display: flex;
    align-items: flex-start;
  }

  .plan-actions,
  .history-actions {
    align-items: flex-start;
  }

  .plan-pill,
  .meal-total {
    white-space: normal;
  }

  .macro-grid,
  .meal-layout,
  .form-grid,
  .photo-fields {
    grid-template-columns: 1fr;
  }

  .macro-card.large,
  .span-3,
  .span-6,
  .span-12 {
    grid-column: span 1;
  }

  .meal-card {
    padding: 18px;
  }

  .meal-list li {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .meal-list b {
    justify-self: start;
  }

  .version-panel {
    grid-template-columns: 1fr;
  }

  .workout-enhanced .workout-controls {
    grid-template-columns: 1fr;
  }

  .day-tabs {
    justify-content: flex-start;
  }

  .day-heading,
  .exercise-list li {
    grid-template-columns: 1fr;
  }

  .day-heading {
    display: grid;
  }

  .day-heading strong {
    max-width: none;
    text-align: left;
  }

  .exercise-list b {
    justify-self: start;
    white-space: normal;
  }
}
