@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap");

:root {
  color-scheme: light;
  --bg: #f5f4ee;
  --surface: #fffefa;
  --surface-2: #e9e8df;
  --ink: #152019;
  --muted: #68716b;
  --line: #d9d9d0;
  --accent: #dff83f;
  --accent-ink: #17210f;
  --forest: #17231c;
  --forest-2: #263b2f;
  --orange: #ff7a45;
  --blue: #5a7cff;
  --red: #d84b44;
  --shadow: 0 18px 50px rgb(28 38 31 / 9%);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --sidebar: 244px;
  font-family: "DM Sans", system-ui, sans-serif;
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1512;
  --surface: #18201c;
  --surface-2: #242e29;
  --ink: #f5f6ee;
  --muted: #aab4ad;
  --line: #344039;
  --forest: #dff83f;
  --forest-2: #b8ce35;
  --accent-ink: #10160f;
  --shadow: 0 18px 50px rgb(0 0 0 / 24%);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 4%, rgb(223 248 63 / 10%), transparent 25rem),
    var(--bg);
  color: var(--ink);
}

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

button {
  color: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgb(90 124 255 / 35%);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4,
.brand {
  font-family: "Manrope", "DM Sans", sans-serif;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--muted);
}

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

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

:root[data-theme="dark"] .sidebar {
  background: #111814;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 28px;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.brand img {
  width: 36px;
  height: 36px;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-link {
  width: 100%;
  border: 0;
  border-radius: 13px;
  padding: 12px 13px;
  background: transparent;
  color: #abb9b0;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
}

.nav-link:hover {
  background: rgb(255 255 255 / 6%);
  color: #fff;
}

.nav-link.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.nav-link svg {
  width: 21px;
  height: 21px;
  flex: none;
}

.sidebar-foot {
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid rgb(255 255 255 / 10%);
}

.mini-profile {
  border: 0;
  background: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 2px;
  cursor: pointer;
  text-align: left;
}

.avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: "Manrope", sans-serif;
  font-weight: 800;
}

.avatar.lg {
  width: 68px;
  height: 68px;
  font-size: 24px;
}

.mini-profile strong,
.mini-profile span {
  display: block;
}

.mini-profile strong {
  font-size: 14px;
  color: #fff;
}

.mini-profile span {
  color: #9aa99f;
  font-size: 12px;
  margin-top: 2px;
}

.main {
  margin-left: var(--sidebar);
  min-height: 100vh;
  padding: 0 42px 54px;
}

.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.mobile-brand {
  display: none;
}

.topbar-context {
  color: var(--muted);
  font-size: 14px;
  text-transform: capitalize;
}

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

.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--muted);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.page {
  width: min(1180px, 100%);
  margin: 0 auto;
  animation: page-in 240ms ease;
}

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

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  margin-bottom: 7px;
  color: #69735c;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

:root[data-theme="dark"] .eyebrow {
  color: var(--accent);
}

.page-heading h1,
.hero-copy h1 {
  margin-bottom: 7px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -1.7px;
}

.page-heading p,
.subtle {
  color: var(--muted);
}

.page-heading p {
  margin-bottom: 0;
}

.btn {
  min-height: 45px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 11px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--forest);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

:root[data-theme="dark"] .btn {
  color: var(--accent-ink);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 22px rgb(27 35 29 / 16%);
}

.btn:active {
  transform: translateY(0);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn.accent {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

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

.btn.small {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 11px;
  font-size: 13px;
}

.btn.wide {
  width: 100%;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 20px;
  margin-bottom: 20px;
}

.hero-card {
  min-height: 310px;
  padding: clamp(26px, 4vw, 42px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 88% 18%, rgb(223 248 63 / 22%), transparent 12rem),
    linear-gradient(135deg, #17231c, #24392d);
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -45px;
  bottom: -80px;
  width: 250px;
  height: 250px;
  border: 42px solid rgb(255 255 255 / 5%);
  border-radius: 50%;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
}

.hero-copy .eyebrow {
  color: var(--accent);
}

.hero-copy h1 {
  font-size: clamp(33px, 5vw, 52px);
  margin-bottom: 14px;
}

.hero-copy p {
  max-width: 520px;
  color: #bcc9c0;
  line-height: 1.55;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  align-items: center;
}

.hero-meta {
  color: #b4c1b8;
  font-size: 13px;
}

.readiness-card,
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.readiness-card {
  padding: 25px;
  display: flex;
  flex-direction: column;
}

.card {
  padding: 23px;
}

.card.flat {
  box-shadow: none;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.card-head h2,
.card-head h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.45px;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.text-btn:hover {
  color: var(--ink);
}

.readiness-score {
  margin: 8px 0 18px;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.readiness-score strong {
  font-family: "Manrope", sans-serif;
  font-size: 55px;
  letter-spacing: -3px;
  line-height: 1;
}

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

.readiness-bars {
  display: grid;
  gap: 15px;
  margin-top: auto;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: 12px;
  color: var(--muted);
}

.meter {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.meter > span {
  display: block;
  width: var(--value, 50%);
  height: 100%;
  border-radius: inherit;
  background: var(--forest);
}

:root[data-theme="dark"] .meter > span {
  background: var(--accent);
}

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

.stat-card {
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 19px;
}

.stat-icon {
  width: 35px;
  height: 35px;
  margin-bottom: 14px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--surface-2);
}

.stat-icon svg {
  width: 18px;
  height: 18px;
}

.stat-card strong {
  display: block;
  font-family: "Manrope", sans-serif;
  font-size: 24px;
  letter-spacing: -0.8px;
}

.stat-card > span:last-child {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 20px;
}

.workout-list,
.activity-list,
.exercise-list,
.setting-list {
  display: grid;
  gap: 10px;
}

.workout-row,
.activity-row,
.exercise-row {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--surface);
}

.workout-row.clickable,
.activity-row.clickable,
.exercise-row.clickable {
  cursor: pointer;
}

.workout-row.clickable:hover,
.activity-row.clickable:hover,
.exercise-row.clickable:hover {
  border-color: #aeb1a5;
  transform: translateY(-1px);
}

.date-tile,
.exercise-glyph,
.program-icon {
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
}

.date-tile {
  width: 48px;
  height: 50px;
  background: var(--surface-2);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
}

.date-tile strong {
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-size: 17px;
}

.exercise-glyph,
.program-icon {
  width: 46px;
  height: 46px;
  background: var(--accent);
  color: var(--accent-ink);
}

.program-icon {
  background: var(--program-color, var(--accent));
  color: #17231c;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
}

.workout-row-main,
.activity-row-main,
.exercise-row-main {
  min-width: 0;
  flex: 1;
}

.workout-row strong,
.activity-row strong,
.exercise-row strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}

.workout-row span,
.activity-row span,
.exercise-row span {
  color: var(--muted);
  font-size: 12px;
}

.row-value {
  text-align: right;
}

.row-value strong {
  font-family: "Manrope", sans-serif;
}

.row-value span {
  white-space: nowrap;
}

.empty-state {
  padding: 38px 22px;
  border: 1px dashed var(--line);
  border-radius: 17px;
  text-align: center;
  color: var(--muted);
}

.empty-state h3 {
  margin: 11px 0 7px;
  color: var(--ink);
}

.empty-state svg {
  width: 33px;
  height: 33px;
}

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

.program-card {
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  padding: 21px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.program-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--program-color, var(--accent));
}

.program-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.program-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.program-card h3 {
  margin: 0 0 7px;
  font-size: 20px;
  letter-spacing: -0.6px;
}

.program-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.program-meta {
  display: flex;
  gap: 14px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.program-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.program-meta svg {
  width: 15px;
  height: 15px;
}

.detail-header {
  padding: 28px;
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  background: var(--forest);
  color: #fff;
}

:root[data-theme="dark"] .detail-header {
  background: #1c2821;
}

.back-btn {
  border: 0;
  padding: 0;
  margin-bottom: 24px;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  background: transparent;
  color: #b8c4bb;
  cursor: pointer;
  font-weight: 600;
}

.back-btn svg {
  width: 18px;
  height: 18px;
}

.detail-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.detail-header h1 {
  margin-bottom: 7px;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -1.2px;
}

.detail-header p {
  margin: 0;
  color: #b7c2ba;
}

.session-stack {
  display: grid;
  gap: 14px;
}

.session-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.session-card-head {
  padding: 19px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.session-card-head h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.session-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.session-exercises {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 35%, transparent);
  padding: 8px 20px;
}

.session-exercise-row {
  min-height: 54px;
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font-size: 13px;
}

.session-exercise-row:hover {
  color: var(--forest-2);
}

.session-exercise-row:last-child {
  border-bottom: 0;
}

.session-exercise-row .order {
  color: var(--muted);
  font-size: 11px;
}

.session-exercise-row span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.calendar-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.calendar-toolbar {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-toolbar h2 {
  margin: 0;
  font-size: 19px;
  text-transform: capitalize;
}

.calendar-nav {
  display: flex;
  gap: 7px;
}

.calendar-nav button {
  width: 37px;
  height: 37px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-weekday {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 114px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day:hover {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}

.calendar-day.outside {
  opacity: 0.42;
}

.calendar-day.today .day-number {
  background: var(--forest);
  color: #fff;
}

:root[data-theme="dark"] .calendar-day.today .day-number {
  color: var(--accent-ink);
}

.day-number {
  width: 27px;
  height: 27px;
  margin-bottom: 8px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.calendar-event {
  margin-top: 5px;
  padding: 6px 7px;
  overflow: hidden;
  border-radius: 7px;
  background: var(--event-color, var(--accent));
  color: #17231c;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event.completed {
  background: var(--forest-2);
  color: #fff;
}

.history-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 20px;
}

.chart-bars {
  height: 210px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding-top: 20px;
}

.chart-column {
  min-width: 0;
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
}

.chart-bar {
  width: min(28px, 70%);
  min-height: 3px;
  height: var(--height);
  border-radius: 8px 8px 3px 3px;
  background: var(--accent);
  position: relative;
}

.chart-column span {
  color: var(--muted);
  font-size: 10px;
}

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

.summary-item {
  padding: 16px;
  border-radius: 15px;
  background: var(--surface-2);
}

.summary-item strong,
.summary-item span {
  display: block;
}

.summary-item strong {
  margin-bottom: 3px;
  font-family: "Manrope", sans-serif;
  font-size: 20px;
}

.summary-item span {
  color: var(--muted);
  font-size: 11px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
}

.profile-card {
  text-align: center;
}

.profile-card .avatar {
  margin: 5px auto 15px;
}

.profile-card h2 {
  margin-bottom: 4px;
}

.profile-card p {
  color: var(--muted);
  font-size: 13px;
}

.profile-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.badge.success {
  background: rgb(72 162 92 / 14%);
  color: #368149;
}

.badge.warning {
  background: rgb(255 122 69 / 14%);
  color: #c65e34;
}

.setting-section + .setting-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.setting-section h3 {
  margin-bottom: 15px;
  font-size: 15px;
}

.setting-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
}

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

.setting-row strong {
  font-size: 13px;
}

.setting-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.switch {
  width: 45px;
  height: 26px;
  padding: 3px;
  border: 0;
  border-radius: 99px;
  background: var(--surface-2);
  cursor: pointer;
}

.switch::after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 5px rgb(0 0 0 / 18%);
  transition: transform 160ms ease;
}

.switch.on {
  background: var(--accent);
}

.switch.on::after {
  transform: translateX(19px);
  background: var(--accent-ink);
}

.segmented {
  padding: 3px;
  border-radius: 11px;
  background: var(--surface-2);
  display: flex;
}

.segmented button {
  min-width: 45px;
  border: 0;
  border-radius: 8px;
  padding: 6px 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.segmented button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 7px rgb(0 0 0 / 8%);
}

.workout-mode {
  min-height: 100vh;
  background: var(--bg);
}

.workout-topbar {
  min-height: 76px;
  padding: 14px clamp(16px, 5vw, 54px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

.workout-topbar > div:last-child {
  justify-self: end;
}

.workout-title strong,
.workout-title span {
  display: block;
}

.workout-title strong {
  font-family: "Manrope", sans-serif;
}

.workout-title span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.session-clock {
  font-family: "Manrope", sans-serif;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.workout-main {
  width: min(800px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 150px;
}

.workout-progress-line {
  display: flex;
  gap: 5px;
  margin-bottom: 24px;
}

.workout-progress-line span {
  height: 5px;
  flex: 1;
  border-radius: 999px;
  background: var(--surface-2);
}

.workout-progress-line span.done,
.workout-progress-line span.active {
  background: var(--forest);
}

:root[data-theme="dark"] .workout-progress-line span.done,
:root[data-theme="dark"] .workout-progress-line span.active {
  background: var(--accent);
}

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

.exercise-focus-head h1 {
  margin: 3px 0 7px;
  font-size: clamp(28px, 6vw, 42px);
  letter-spacing: -1.4px;
}

.exercise-focus-head p {
  margin: 0;
  color: var(--muted);
}

.exercise-focus-number {
  color: var(--muted);
  font-family: "Manrope", sans-serif;
  font-size: 12px;
}

.set-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.set-row {
  min-height: 68px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(0, 1fr) 100px;
  align-items: center;
  gap: 10px;
}

.set-row:last-child {
  border-bottom: 0;
}

.set-row.header {
  min-height: 42px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.set-row.current {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.set-index {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
}

.set-row.done .set-index {
  background: var(--accent);
  color: var(--accent-ink);
}

.set-cell strong,
.set-cell span {
  display: block;
}

.set-cell strong {
  font-family: "Manrope", sans-serif;
  font-size: 15px;
}

.set-cell span {
  color: var(--muted);
  font-size: 10px;
}

.set-status {
  justify-self: end;
}

.check-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
}

.workout-command {
  position: fixed;
  inset: auto 0 0;
  z-index: 12;
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  backdrop-filter: blur(16px);
}

.workout-command-inner {
  width: min(800px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(200px, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.start-set-btn {
  min-height: 60px;
  border-radius: 17px;
  font-size: 16px;
}

.active-set-panel {
  padding: 18px;
  margin-top: 16px;
  border-radius: var(--radius);
  background: var(--forest);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

:root[data-theme="dark"] .active-set-panel {
  background: #24332a;
}

.active-set-panel span,
.rest-panel span {
  display: block;
  color: #b6c3ba;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.set-clock,
.rest-clock {
  margin-top: 3px;
  font-family: "Manrope", sans-serif;
  font-size: 35px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}

.rest-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 19px;
  background: var(--surface);
}

.rest-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.rest-panel span {
  color: var(--muted);
}

.rest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.rest-progress {
  height: 6px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.rest-progress span {
  height: 100%;
  width: var(--value);
  border-radius: inherit;
  background: var(--accent);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 22px;
  overflow-y: auto;
  background: rgb(13 19 15 / 55%);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  animation: fade-in 140ms ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgb(0 0 0 / 22%);
  animation: modal-in 180ms ease;
}

.modal.wide {
  width: min(760px, 100%);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  padding: 22px 23px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.modal-head h2 {
  margin: 0 0 5px;
  font-size: 21px;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-close {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 11px;
  background: var(--surface-2);
  cursor: pointer;
  font-size: 19px;
}

.modal-body {
  padding: 8px 23px 23px;
}

.modal-foot {
  padding: 16px 23px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

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

.field + .field {
  margin-top: 14px;
}

.field-grid .field + .field {
  margin-top: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
.field-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.choice {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.choice.selected,
.choice:hover {
  border-color: var(--forest);
  background: var(--accent);
  color: var(--accent-ink);
}

.color-options {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.color-option {
  width: 34px;
  height: 34px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--color);
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}

.color-option.selected {
  box-shadow: 0 0 0 2px var(--ink);
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 8px;
}

.toast {
  width: min(360px, calc(100vw - 32px));
  padding: 13px 15px;
  border-radius: 13px;
  background: var(--forest);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: toast-in 180ms ease;
}

:root[data-theme="dark"] .toast {
  background: var(--accent);
  color: var(--accent-ink);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.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;
}

.desktop-only {
  display: initial;
}

@media (max-width: 1020px) {
  :root { --sidebar: 210px; }
  .main { padding-inline: 28px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .program-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .sidebar {
    inset: auto 0 0;
    width: auto;
    height: calc(66px + env(safe-area-inset-bottom));
    padding: 7px 8px env(safe-area-inset-bottom);
    border-top: 1px solid rgb(255 255 255 / 9%);
  }
  .brand,
  .sidebar-foot { display: none; }
  .nav-list { height: 100%; grid-template-columns: repeat(5, 1fr); gap: 2px; }
  .nav-link { height: 100%; padding: 6px 3px; border-radius: 10px; justify-content: center; flex-direction: column; gap: 2px; font-size: 9px; }
  .nav-link svg { width: 20px; height: 20px; }
  .main { margin: 0; padding: 0 16px 28px; }
  .topbar { height: 69px; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; font-family: "Manrope", sans-serif; font-weight: 800; }
  .mobile-brand img { width: 29px; height: 29px; }
  .topbar-context { display: none; }
  .page-heading { align-items: flex-start; margin-bottom: 22px; }
  .page-heading h1 { font-size: 31px; }
  .page-heading > .btn span { display: none; }
  .page-heading > .btn { width: 45px; padding: 0; }
  .hero-grid,
  .content-grid,
  .history-layout,
  .profile-grid { grid-template-columns: 1fr; }
  .hero-card { min-height: 330px; padding: 26px; }
  .hero-copy h1 { font-size: 36px; }
  .stats-grid { gap: 10px; }
  .stat-card { min-height: 116px; padding: 15px; }
  .stat-card strong { font-size: 21px; }
  .program-grid { grid-template-columns: 1fr; }
  .program-card { min-height: 225px; }
  .detail-header { padding: 22px; }
  .detail-title-row { display: block; }
  .detail-title-row .btn { margin-top: 18px; }
  .calendar-day { min-height: 74px; padding: 5px; }
  .calendar-weekday { font-size: 8px; }
  .calendar-event { width: 7px; height: 7px; border-radius: 50%; padding: 0; font-size: 0; }
  .workout-topbar { grid-template-columns: 1fr auto; padding-inline: 16px; }
  .session-clock { display: none; }
  .workout-main { padding-top: 20px; }
  .workout-command-inner { grid-template-columns: 45px 1fr 45px; }
  .workout-command .btn.secondary { width: 45px; padding: 0; }
  .workout-command .btn.secondary span { display: none; }
  .set-row { grid-template-columns: 36px 1fr 1fr 52px; padding-inline: 11px; }
  .field-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .choice-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal,
  .modal.wide { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; }
  .toast-region { right: 16px; bottom: calc(82px + env(safe-area-inset-bottom)); }
  .desktop-only { display: none; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 110px; }
  .hero-actions .hero-meta { width: 100%; }
  .session-card-head { align-items: flex-start; }
  .session-card-head .btn { width: 40px; padding: 0; }
  .session-card-head .btn span { display: none; }
}

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