:root {
  --ink: #15171d;
  --ink-soft: #262931;
  --muted: #707583;
  --muted-light: #9da1ac;
  --line: #e7e8ed;
  --line-strong: #dadce4;
  --surface: #ffffff;
  --background: #f4f5f9;
  --violet: #635bff;
  --violet-dark: #5047eb;
  --violet-soft: #eeecff;
  --red: #ee1b2e;
  --green: #0a8f61;
  --green-soft: #e8f7f0;
  --sidebar-width: 254px;
  --shadow: 0 18px 45px rgba(32, 34, 44, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 63% -10%, rgba(99, 91, 255, 0.06), transparent 29rem),
    var(--background);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(99, 91, 255, 0.24);
  outline-offset: 2px;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar-width);
  padding: 29px 20px 24px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.93);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  width: fit-content;
  margin: 0 10px 45px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -0.06em;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 6px;
  height: 6px;
  margin-bottom: 1px;
  background: var(--red);
  border-radius: 1px;
}

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

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #777b87;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: 160ms ease;
}

.nav-item svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.nav-item:hover {
  color: var(--ink);
  background: #f7f7fa;
}

.nav-item.is-active {
  color: var(--ink);
  background: #f0f0f5;
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 21px;
  border-radius: 0 4px 4px 0;
  background: var(--red);
}

.campaign-card {
  margin-top: 34px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfbfd;
}

.eyebrow,
.small-label {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.campaign-title-row {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.campaign-title-row strong {
  max-width: 120px;
  font-size: 13px;
  line-height: 1.35;
}

.campaign-title-row > span {
  color: var(--ink);
  font-size: 27px;
  line-height: 1;
  font-weight: 750;
  letter-spacing: -0.06em;
}

.progress-track {
  height: 4px;
  margin: 15px 0 9px;
  overflow: hidden;
  background: #e6e7ed;
  border-radius: 99px;
}

.progress-track span {
  display: block;
  width: 1%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), #9a79ff);
  transition: width 400ms ease;
}

.campaign-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.sidebar-footer {
  margin-top: auto;
}

.sidebar-footer > p {
  margin: 0 9px 20px;
  color: #858995;
  font: italic 12px/1.5 Georgia, serif;
}

.profile-row {
  padding-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.profile-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--ink);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
}

.profile-row > div:last-child {
  display: grid;
  gap: 3px;
}

.profile-row strong {
  font-size: 11px;
}

.profile-row span {
  color: var(--muted);
  font-size: 9px;
}

.main-column {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 73px;
  padding: 0 clamp(24px, 4vw, 61px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(244, 245, 249, 0.84);
  border-bottom: 1px solid rgba(222, 224, 231, 0.72);
  backdrop-filter: blur(16px);
}

.topbar-date {
  color: var(--ink);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar-message {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

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

.icon-button,
.timer-control {
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: 160ms ease;
}

.icon-button {
  width: 35px;
  height: 35px;
  border-radius: 9px;
}

.icon-button:hover,
.timer-control:hover {
  border-color: var(--line-strong);
  background: white;
  transform: translateY(-1px);
}

.icon-button svg,
.timer-control svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.timer-reopen {
  width: auto;
  padding: 0 10px;
  display: none;
  grid-auto-flow: column;
  gap: 7px;
  color: var(--violet);
}

.timer-reopen.is-visible {
  display: grid;
}

.timer-reopen-value {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.mobile-menu {
  display: none;
  border: 0;
  background: transparent;
}

.mobile-menu svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

main {
  width: min(1180px, calc(100% - clamp(48px, 8vw, 122px)));
  margin: 0 auto;
  padding: 34px 0 124px;
}

.view {
  display: none;
  animation: view-in 280ms ease both;
}

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

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(250px, 0.75fr);
  gap: 17px;
}

.hero-card,
.standard-card,
.insight-card,
.phase-card,
.weekly-template,
.restart-banner,
.metric-card,
.chart-card,
.checkin-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 17px;
}

.hero-card {
  min-height: 289px;
  padding: clamp(29px, 4.5vw, 54px);
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  overflow: hidden;
  position: relative;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -75px -135px auto;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(99, 91, 255, 0.08), transparent 68%);
}

.phase-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--violet-dark);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.phase-pill > span:first-child {
  width: 5px;
  height: 5px;
  background: var(--red);
  border-radius: 50%;
}

.hero-copy h1,
.page-heading h1 {
  margin: 15px 0 12px;
  font-size: clamp(37px, 4.4vw, 54px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-copy > p {
  max-width: 465px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.hero-actions {
  margin-top: 25px;
  display: flex;
  align-items: center;
  gap: 17px;
}

.button {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 10px;
  font-weight: 760;
  cursor: pointer;
  transition: 160ms ease;
}

.button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.button-dark {
  color: white;
  background: var(--ink);
  box-shadow: 0 8px 18px rgba(21, 23, 29, 0.14);
}

.button-dark:hover {
  background: #2a2d35;
  transform: translateY(-1px);
}

.button-ghost {
  color: #4d515d;
  background: white;
  border-color: var(--line-strong);
}

.button-ghost:hover {
  color: var(--ink);
  border-color: #c8cad3;
  transform: translateY(-1px);
}

.hero-note {
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.hero-note::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 1px;
  margin: 0 7px 3px 0;
  background: var(--red);
}

.hero-visual {
  min-height: 180px;
  display: grid;
  place-content: center;
  position: relative;
  color: var(--ink);
}

.orbit {
  position: absolute;
  inset: 50% auto auto 50%;
  border: 1px solid rgba(99, 91, 255, 0.18);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.orbit-one {
  width: 154px;
  height: 154px;
  background: radial-gradient(circle at 40% 36%, #fff, rgba(238, 236, 255, 0.55));
}

.orbit-two {
  width: 120px;
  height: 120px;
  border-color: rgba(99, 91, 255, 0.3);
}

.orbit-two::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 21px;
  width: 7px;
  height: 7px;
  background: var(--red);
  border: 3px solid white;
  border-radius: 50%;
}

.hero-number,
.hero-number-label {
  position: relative;
  z-index: 2;
  text-align: center;
}

.hero-number {
  font-size: 44px;
  line-height: 1;
  font-weight: 780;
  letter-spacing: -0.06em;
}

.hero-number small {
  color: var(--muted-light);
  font-size: 13px;
  letter-spacing: -0.02em;
}

.hero-number-label {
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.standard-card {
  min-height: 289px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  color: white;
  background:
    radial-gradient(circle at 110% -10%, rgba(99, 91, 255, 0.65), transparent 48%),
    #171922;
  border-color: #171922;
}

.standard-card-header,
.standard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.standard-card .small-label {
  color: #9397a4;
}

.status-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #a7acb8;
  font-size: 8px;
  font-weight: 650;
}

.status-dot::before {
  content: "";
  width: 5px;
  height: 5px;
  background: #42d39b;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(66, 211, 155, 0.12);
}

.standard-card blockquote {
  margin: auto 0;
  font: italic 25px/1.25 Georgia, serif;
  letter-spacing: -0.03em;
}

.standard-rule {
  height: 1px;
  margin-bottom: 16px;
  background: linear-gradient(90deg, var(--red) 18px, rgba(255,255,255,.13) 18px);
}

.standard-footer {
  color: #a5a9b4;
  font-size: 8px;
}

.standard-footer svg {
  width: 16px;
  fill: none;
  stroke: #817aff;
  stroke-width: 2;
}

.workout-section,
.weekly-template {
  margin-top: 42px;
}

.section-heading-row,
.page-heading,
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.section-heading-row h2,
.page-heading h1,
.weekly-template h2,
.restart-banner h2,
.chart-card h2,
.checkin-card h2 {
  color: var(--ink);
}

.section-heading-row h2 {
  margin: 7px 0 0;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.duration-chip {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  background: rgba(255,255,255,.66);
  font-size: 9px;
  font-weight: 700;
}

.duration-chip svg {
  width: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.exercise-list {
  margin-top: 15px;
  display: grid;
  gap: 8px;
}

.exercise-row {
  min-height: 74px;
  padding: 11px 18px 11px 11px;
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: 180ms ease;
}

.exercise-row:hover {
  border-color: #d7d9e1;
  box-shadow: 0 7px 18px rgba(31, 33, 42, 0.045);
  transform: translateY(-1px);
}

.exercise-row.is-complete {
  background: #fafbfb;
  border-color: #e1ebe6;
}

.exercise-row.is-complete .exercise-name {
  color: #8f948f;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.exercise-index {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: #8d919c;
  background: #f5f5f8;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 750;
}

.exercise-row.is-complete .exercise-index {
  color: var(--green);
  background: var(--green-soft);
}

.exercise-info {
  min-width: 0;
}

.exercise-name {
  margin: 0 0 5px;
  overflow: hidden;
  color: #2a2d35;
  font-size: 12px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exercise-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
}

.category-pill {
  padding: 3px 6px;
  border-radius: 4px;
  color: #646875;
  background: #f1f1f5;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.exercise-load {
  min-width: 90px;
  padding: 0 16px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.guide-button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #656a76;
  background: #fafafd;
  font-size: 8px;
  font-weight: 750;
  cursor: pointer;
  transition: 160ms ease;
}

.guide-button:hover {
  color: var(--violet);
  background: var(--violet-soft);
  border-color: #d8d4ff;
}

.guide-button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.complete-button {
  width: 28px;
  height: 28px;
  border: 1px solid #d7d9e0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: transparent;
  background: white;
  cursor: pointer;
  transition: 160ms ease;
}

.complete-button:hover {
  color: var(--violet);
  border-color: var(--violet);
}

.complete-button svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.exercise-row.is-complete .complete-button {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

.add-exercise-button {
  width: 100%;
  min-height: 65px;
  margin-top: 8px;
  padding: 10px 15px;
  border: 1px dashed #ced0d9;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--muted);
  background: rgba(255,255,255,.42);
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}

.add-exercise-button:hover {
  color: var(--ink);
  background: white;
  border-color: #a8aab5;
}

.add-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  color: var(--violet);
  background: var(--violet-soft);
  border-radius: 8px;
  font-size: 18px;
  font-weight: 350;
}

.add-exercise-button > span:last-child {
  display: grid;
  gap: 3px;
}

.add-exercise-button strong {
  color: #414550;
  font-size: 10px;
}

.add-exercise-button small {
  color: #979ba6;
  font-size: 8px;
}

.insight-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
}

.insight-card {
  min-height: 134px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 19px;
}

.insight-icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--violet);
  background: var(--violet-soft);
  border-radius: 12px;
}

.insight-icon svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.insight-card h3 {
  margin: 7px 0 6px;
  font-size: 16px;
  letter-spacing: -0.03em;
}

.insight-card p {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.next-card {
  justify-content: space-between;
  background: #f9f9fc;
}

.next-arrow {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.next-arrow svg {
  width: 15px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.8;
}

.page-heading {
  align-items: flex-end;
  margin-bottom: 34px;
}

.page-heading h1 {
  margin-bottom: 8px;
  font-size: clamp(36px, 4.6vw, 58px);
}

.page-heading p {
  max-width: 590px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

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

.phase-card {
  min-height: 350px;
  padding: 27px;
  position: relative;
  overflow: hidden;
}

.phase-card.is-current {
  background: linear-gradient(145deg, #ffffff, #faf9ff);
  border-color: #d9d5ff;
  box-shadow: 0 15px 35px rgba(99, 91, 255, .08);
}

.phase-index {
  position: absolute;
  top: 14px;
  right: 17px;
  color: #eeeeF3;
  font-size: 60px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.08em;
}

.phase-card.is-current .phase-index {
  color: #eeecff;
}

.phase-range {
  color: var(--violet);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.phase-card h2 {
  max-width: 190px;
  margin: 46px 0 13px;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -.045em;
}

.phase-card > p {
  min-height: 62px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.phase-card ul {
  margin: 21px 0 0;
  padding: 17px 0 0;
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  list-style: none;
}

.phase-card li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #565a65;
  font-size: 9px;
}

.phase-card li::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--red);
  border-radius: 50%;
}

.current-phase-label {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 7px 10px;
  color: white;
  background: var(--violet);
  border-radius: 9px 0 0 0;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.weekly-template {
  padding: 28px;
}

.weekly-template h2,
.restart-banner h2,
.chart-card h2,
.checkin-card h2 {
  margin: 6px 0 0;
  font-size: 21px;
  letter-spacing: -.035em;
}

.quiet-note {
  color: var(--muted);
  font-size: 9px;
}

.week-list {
  margin-top: 21px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.week-day {
  min-height: 112px;
  padding: 13px 11px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafafd;
}

.week-day.is-today {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.week-day.is-rest {
  background: #f5f5f7;
}

.week-day-name {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.week-day.is-today .week-day-name {
  color: #b4b7c1;
}

.week-day strong {
  margin-top: auto;
  font-size: 10px;
  line-height: 1.4;
}

.week-day small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.week-day.is-today small {
  color: #a7abb7;
}

.restart-banner {
  margin-top: 14px;
  padding: 29px;
  display: flex;
  align-items: center;
  gap: 22px;
  color: white;
  background:
    radial-gradient(circle at 88% 10%, rgba(99,91,255,.4), transparent 22rem),
    var(--ink);
  border-color: var(--ink);
}

.restart-mark {
  flex: 0 0 auto;
  width: 53px;
  height: 53px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  font: italic 25px Georgia, serif;
}

.restart-banner .small-label {
  color: #9fa3af;
}

.restart-banner h2 {
  color: white;
}

.restart-banner p {
  margin: 8px 0 0;
  color: #aeb1bb;
  font-size: 10px;
  line-height: 1.6;
}

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

.metric-card {
  min-height: 145px;
  padding: 21px;
  display: flex;
  flex-direction: column;
}

.metric-card > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.metric-card strong {
  margin-top: auto;
  font-size: 39px;
  line-height: 1;
  letter-spacing: -.06em;
}

.metric-card small {
  margin-top: 8px;
  color: var(--muted-light);
  font-size: 8px;
}

.metric-card.metric-dark {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.metric-dark > span,
.metric-dark small {
  color: #a6aab5;
}

.progress-layout {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1.6fr .85fr;
  gap: 14px;
}

.chart-card,
.checkin-card {
  padding: 27px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 8px;
}

.legend i {
  width: 6px;
  height: 6px;
  background: var(--violet);
  border-radius: 2px;
}

.bar-chart {
  height: 205px;
  margin-top: 29px;
  padding-top: 8px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: clamp(8px, 3vw, 24px);
  border-bottom: 1px solid var(--line);
}

.bar-column {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.bar {
  width: min(24px, 70%);
  min-height: 7px;
  background: #e7e5ff;
  border-radius: 6px 6px 2px 2px;
  transition: height 400ms ease;
}

.bar.is-complete {
  background: linear-gradient(180deg, #8a84ff, var(--violet));
}

.bar-label {
  margin-bottom: -23px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
}

.checkin-list {
  margin-top: 25px;
  display: grid;
  gap: 11px;
}

.checkin-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4e525d;
  font-size: 10px;
  cursor: pointer;
}

.checkin-list input {
  width: 16px;
  height: 16px;
  accent-color: var(--violet);
}

.checkin-footnote {
  margin: 25px 0 0;
  padding-top: 17px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font: italic 11px/1.55 Georgia, serif;
}

.timer-panel {
  position: fixed;
  z-index: 45;
  left: calc(50% + var(--sidebar-width) / 2);
  bottom: 22px;
  width: min(480px, calc(100vw - var(--sidebar-width) - 42px));
  min-height: 58px;
  padding: 8px 9px 8px 17px;
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  color: white;
  background: rgba(22, 24, 31, .96);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(19, 21, 28, .25);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.timer-panel.is-hidden {
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 18px);
}

.timer-progress {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--violet), #a383ff);
  transform-origin: left;
  transition: transform 1s linear;
}

.timer-copy {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: start;
  gap: 11px;
}

.timer-label {
  color: #9da1ac;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.timer-copy strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
}

.timer-control {
  width: 32px;
  height: 32px;
  color: #aeb2bd;
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.1);
  border-radius: 8px;
}

.timer-play {
  color: white;
  background: var(--violet);
  border-color: var(--violet);
}

.timer-play:hover {
  background: #766fff;
  border-color: #766fff;
}

.timer-play .pause-icon {
  display: none;
}

.timer-play.is-running .play-icon {
  display: none;
}

.timer-play.is-running .pause-icon {
  display: block;
}

.timer-text-button {
  min-height: 32px;
  padding: 0 8px;
  color: #aeb2bd;
  background: transparent;
  border: 0;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}

.timer-text-button:hover {
  color: white;
}

.timer-close {
  border: 0;
  background: transparent;
}

.timer-close:hover {
  background: rgba(255,255,255,.07);
}

.modal {
  width: min(520px, calc(100vw - 30px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--ink);
  background: white;
  box-shadow: var(--shadow);
}

.compact-modal {
  width: min(440px, calc(100vw - 30px));
}

.modal::backdrop {
  background: rgba(18, 20, 27, .38);
  backdrop-filter: blur(4px);
}

.modal form {
  padding: 27px;
}

.guide-modal {
  width: min(600px, calc(100vw - 30px));
  max-height: min(820px, calc(100vh - 30px));
  overflow: auto;
}

.guide-modal-shell {
  padding: 29px;
}

.modal-header.guide-header {
  margin-bottom: 18px;
}

.guide-header .category-pill {
  display: inline-flex;
  color: var(--violet-dark);
  background: var(--violet-soft);
}

.modal-header.guide-header h2 {
  margin-top: 10px;
  font-size: 30px;
}

.guide-summary {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.guide-facts {
  margin-top: 23px;
  padding: 17px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 20px;
  background: #f7f7fa;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.guide-facts > div {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.guide-facts > div + div {
  padding-left: 20px;
  border-left: 1px solid var(--line-strong);
}

.guide-facts strong {
  color: #3d414c;
  font-size: 10px;
  line-height: 1.45;
}

.guide-steps {
  margin-top: 25px;
}

.guide-steps ol {
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
  counter-reset: guide-steps;
}

.guide-steps li {
  min-height: 46px;
  display: grid;
  grid-template-columns: 29px 1fr;
  align-items: center;
  gap: 11px;
  color: #4c505b;
  font-size: 10px;
  line-height: 1.55;
  counter-increment: guide-steps;
}

.guide-steps li::before {
  content: counter(guide-steps);
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  color: var(--violet);
  background: var(--violet-soft);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 800;
}

.guide-safety {
  margin-top: 22px;
  padding: 15px;
  display: grid;
  grid-template-columns: 29px 1fr;
  gap: 11px;
  color: #6d4b12;
  background: #fff9ec;
  border: 1px solid #f2e3bc;
  border-radius: 10px;
}

.guide-safety svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: #b68122;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.guide-safety span {
  display: block;
  margin-bottom: 4px;
  font-size: 9px;
  font-weight: 800;
}

.guide-safety p {
  margin: 0;
  color: #806534;
  font-size: 9px;
  line-height: 1.55;
}

.guide-actions {
  margin-top: 23px;
  padding-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.guide-link {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 9px;
  font-weight: 760;
  text-decoration: none;
  transition: 160ms ease;
}

.guide-link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.guide-link-secondary {
  color: #50545f;
  background: white;
  border: 1px solid var(--line-strong);
}

.guide-link-primary {
  color: white;
  background: var(--ink);
  border: 1px solid var(--ink);
}

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

.modal-header {
  margin-bottom: 25px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.modal-header h2 {
  margin: 6px 0 0;
  font-size: 24px;
  letter-spacing: -.04em;
}

.modal-close {
  flex: 0 0 auto;
  border: 0;
  background: #f5f5f7;
}

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

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

.full-field + .field-grid,
.field-grid + .full-field,
.full-field + .full-field {
  margin-top: 15px;
}

.field > span {
  color: #555965;
  font-size: 9px;
  font-weight: 700;
}

.field em {
  margin-left: 4px;
  color: var(--muted-light);
  font-size: 8px;
  font-style: normal;
  font-weight: 500;
}

.field input,
.field select {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  color: var(--ink);
  background: #fafafd;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 11px;
}

.field input::placeholder {
  color: #aaaeb8;
}

.field input[type="range"] {
  padding: 0;
  accent-color: var(--violet);
}

.modal-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.modal-actions {
  margin-top: 25px;
  padding-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  z-index: 70;
  right: 22px;
  bottom: 23px;
  min-width: 230px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: white;
  background: var(--ink);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
  font-size: 10px;
}

.toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.toast button {
  padding: 0;
  color: #9a94ff;
  background: transparent;
  border: 0;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

@media (max-width: 980px) {
  :root { --sidebar-width: 220px; }
  .hero-grid { grid-template-columns: 1fr; }
  .standard-card { min-height: 220px; }
  .phase-grid { grid-template-columns: 1fr; }
  .phase-card { min-height: 290px; }
  .phase-card > p { min-height: 0; }
  .phase-card h2 { margin-top: 34px; }
  .week-list { grid-template-columns: repeat(4, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .progress-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --sidebar-width: 0px; }
  .sidebar {
    width: min(285px, calc(100vw - 44px));
    box-shadow: 20px 0 50px rgba(22,24,31,.14);
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }
  .sidebar.is-open { transform: translateX(0); }
  .main-column { margin-left: 0; }
  .mobile-menu {
    width: 34px;
    height: 34px;
    margin-left: -6px;
    display: grid;
    place-items: center;
    cursor: pointer;
  }
  .topbar { padding: 0 19px; }
  .topbar > div:nth-child(2) { flex: 1; margin-left: 8px; }
  main { width: calc(100% - 30px); padding-top: 18px; }
  .hero-card { grid-template-columns: 1fr; padding: 27px; }
  .hero-visual { min-height: 190px; }
  .section-heading-row,
  .page-heading { align-items: flex-start; flex-direction: column; }
  .section-actions { width: 100%; }
  .section-actions .button { flex: 1; }
  .exercise-row { grid-template-columns: 39px minmax(0, 1fr) auto auto; gap: 10px; padding-right: 12px; }
  .exercise-load { display: none; }
  .guide-button {
    width: 30px;
    padding: 0;
    justify-content: center;
  }
  .guide-button span { display: none; }
  .insight-grid { grid-template-columns: 1fr; }
  .week-list { grid-template-columns: repeat(2, 1fr); }
  .timer-panel { left: 15px; right: 15px; width: auto; transform: none; grid-template-columns: 1fr auto auto auto; }
  .timer-panel.is-hidden { transform: translateY(18px); }
  .timer-text-button { display: none; }
  .toast { right: 15px; bottom: 15px; }
}

@media (max-width: 480px) {
  .topbar-message { display: none; }
  .hero-copy h1 { font-size: 39px; }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .hero-note { margin-left: 2px; }
  .standard-card { min-height: 240px; }
  .workout-section { margin-top: 32px; }
  .section-actions { align-items: stretch; flex-direction: column; }
  .duration-chip { justify-content: center; }
  .exercise-row { min-height: 79px; }
  .exercise-name { white-space: normal; }
  .metric-grid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .field + .field { margin-top: 15px; }
  .guide-modal-shell { padding: 23px 20px; }
  .modal-header.guide-header h2 { font-size: 25px; }
  .guide-facts { grid-template-columns: 1fr; }
  .guide-facts > div + div { padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line-strong); }
  .guide-actions { align-items: stretch; flex-direction: column-reverse; }
  .guide-link { width: 100%; }
  .timer-panel { grid-template-columns: 1fr auto auto auto; }
  .timer-label { display: none; }
}

@media print {
  body { background: white; }
  .sidebar,
  .topbar,
  .timer-panel,
  .toast,
  .page-heading .button { display: none !important; }
  .main-column { margin: 0; }
  main { width: 100%; padding: 0; }
  .view { display: none !important; }
  .view[data-view="plan"] { display: block !important; }
  .phase-grid { grid-template-columns: repeat(3, 1fr); }
  .phase-card { min-height: 0; break-inside: avoid; }
  .weekly-template,
  .restart-banner { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
