:root {
  --bg: #f5f6f2;
  --surface: #fff;
  --ink: #172e2c;
  --muted: #6d7976;
  --line: #e4e8e1;
  --mint: #d7f68d;
  --dark: #132c2b;
  --red: #a63131;
  --radius: 20px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  min-height: 46px;
  padding: 10px 17px;
  font-weight: 600;
}
button:hover {
  border-color: #8faaa0;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #669c39;
  outline-offset: 3px;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.12;
  letter-spacing: -1.5px;
  margin-bottom: 12px;
  font-weight: 650;
}
h2 {
  font-size: 22px;
  letter-spacing: -0.5px;
}
h3 {
  font-size: 17px;
  line-height: 1.4;
  margin-bottom: 8px;
}
.muted {
  color: var(--muted);
}
.small,
.footnote {
  font-size: 12px;
  color: var(--muted);
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.7px;
  color: var(--muted);
  margin-bottom: 13px;
}
.app {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 36px 23px;
  display: flex;
  flex-direction: column;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 9px;
  font-weight: 750;
  font-size: 25px;
  letter-spacing: -1px;
}
.brand .dot {
  margin-left: -8px;
}
.dot {
  color: #7b9f39;
}
.brand-icon {
  background: var(--dark);
  color: var(--mint);
  border-radius: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 23px;
  transform: rotate(-5deg);
}
.nav-caption {
  margin: 49px 10px 14px;
  font-size: 9px;
}
nav {
  display: grid;
  gap: 8px;
}
nav button {
  display: flex;
  gap: 15px;
  align-items: center;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 13px 14px;
  font-size: 14px;
}
nav button span {
  font-size: 23px;
  width: 25px;
  line-height: 1;
}
nav button.selected {
  background: #edf4e6;
  color: var(--ink);
}
.sidebar-bottom {
  margin-top: auto;
  padding: 30px 10px 0;
}
.sidebar-bottom p {
  font-size: 16px;
  color: #8b9690;
  line-height: 1.7;
}
.sidebar-bottom strong {
  font-weight: 500;
  color: var(--ink);
}
.sidebar-bottom .small {
  font-size: 8px;
  letter-spacing: 1px;
}
.main-wrap {
  margin-left: 236px;
  width: calc(100% - 236px);
}
header {
  height: 87px;
  padding: 0 46px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.private-label {
  font-size: 12px;
  color: #59765e;
}
.icon-button {
  background: transparent;
  min-width: 44px;
  padding: 8px;
  font-size: 22px;
}
.mobile-brand {
  display: none;
}
main#content {
  max-width: 1240px;
  margin: auto;
  padding: 38px 46px 24px;
  min-height: calc(100vh - 150px);
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 30px;
  gap: 16px;
}
.page-heading p {
  margin-bottom: 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #edf2e6;
  border: 1px solid #dce6d0;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  white-space: nowrap;
}
.dashboard {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 24px;
}
.hero {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  border-radius: var(--radius);
  background: var(--dark);
  color: white;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.hero .eyebrow {
  color: #b1c4ba;
}
.hero h2 {
  font-size: 35px;
  letter-spacing: -1px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.hero p {
  color: #adbfba;
  max-width: 300px;
}
.hero .primary {
  margin-top: auto;
  position: relative;
  z-index: 1;
  min-width: 220px;
}
.hero-art {
  position: absolute;
  right: -30px;
  bottom: 20px;
  width: 220px;
  height: 230px;
  opacity: 0.15;
  transform: rotate(-30deg);
}
.hero-art:before {
  content: "";
  position: absolute;
  left: 95px;
  top: 10px;
  width: 35px;
  height: 210px;
  background: var(--mint);
  border-radius: 12px;
}
.hero-art:after {
  content: "";
  position: absolute;
  top: 86px;
  left: 0;
  width: 240px;
  height: 55px;
  background: var(--mint);
  border-radius: 12px;
  box-shadow:
    0 -25px 0 -10px var(--mint),
    0 25px 0 -10px var(--mint);
}
.primary {
  background: var(--mint);
  border-color: var(--mint);
  color: var(--dark);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-weight: 700;
}
.primary span {
  font-size: 22px;
}
.dark-button {
  background: var(--dark);
  color: white;
  border-color: var(--dark);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
}
.dashboard .card {
  margin: 0;
}
.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.week {
  display: flex;
  justify-content: space-between;
  margin: 25px 0;
}
.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}
.day b {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f4f5f1;
  color: #9ba59c;
  font-size: 13px;
  font-weight: 500;
}
.day.planned b {
  background: #e8f3dc;
  color: var(--ink);
}
.day.current b {
  background: var(--dark);
  color: white;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 22px 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 24px 0;
}
.stat {
  padding: 21px 23px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.stat .value {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -1px;
  margin: 4px 0;
}
.stat .value span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 7px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 16px;
}
.section-heading h2 {
  margin: 0;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  padding: 5px;
  min-height: 40px;
}
.exercise-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.preview {
  padding: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.preview .num {
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  width: 30px;
  height: 30px;
  background: #f1f4ed;
  border-radius: 9px;
  margin-bottom: 16px;
}
.preview h3 {
  font-size: 14px;
  min-height: 42px;
}
.preview p {
  font-size: 12px;
  margin-bottom: 0;
}
.note {
  background: #edf1e7;
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 13px;
  color: #526451;
  margin: 18px 0;
}
.note.warning {
  background: #fff3e0;
  color: #805f25;
}
.desktop-footer {
  padding: 20px 46px;
  font-size: 11px;
  color: #8a948b;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}
label {
  display: block;
  font-size: 13px;
  font-weight: 550;
  color: #4f625c;
  margin-bottom: 16px;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #d6ddd4;
  background: white;
  color: var(--ink);
  border-radius: 10px;
  padding: 12px;
  min-height: 48px;
  font-size: 16px;
  margin-top: 6px;
}
textarea {
  min-height: 90px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #a6c87a;
  border-color: #a6c87a;
}
input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-height: 0;
  accent-color: var(--dark);
  margin: 0;
}
.check {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 44px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.flex {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child {
  border-bottom: 0;
}
.row p {
  margin-bottom: 0;
}
.pill {
  padding: 5px 9px;
  background: #f0f3ed;
  border-radius: 8px;
  font-size: 11px;
  color: var(--muted);
}
.tabs {
  display: flex;
  gap: 10px;
  margin: 18px 0;
}
.tabs .active {
  background: var(--dark);
  color: white;
}
.filters {
  display: flex;
  gap: 14px;
  margin: 20px 0;
}
.filters label {
  flex: 1;
}
.library-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.library-grid .card {
  margin: 0;
}
details {
  margin: 14px 0;
}
summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  min-height: 35px;
}
details p {
  font-size: 14px;
}
.plan-item {
  background: #f7f8f4;
  padding: 18px;
  border-radius: 14px;
  margin: 14px 0;
}
.plan-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.plan-controls label {
  margin-bottom: 0;
}
.danger {
  color: var(--red);
}
.set-row {
  display: grid;
  grid-template-columns: 42px 1.1fr 1fr 0.8fr 48px;
  gap: 10px;
  align-items: end;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.set-row input {
  padding: 11px 5px;
  text-align: center;
}
.set-row label {
  margin-bottom: 0;
  font-size: 11px;
  text-align: center;
}
.set-index {
  align-self: center;
  text-align: center;
  font-size: 13px;
}
.set-row.done input {
  background: #edf6e4;
  border-color: #c4d9b0;
}
.set-row.skipped {
  opacity: 0.5;
}
.done-button {
  padding: 0;
  font-size: 22px;
  height: 48px;
}
.done .done-button {
  background: var(--dark);
  color: var(--mint);
}
.set-tools {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.set-tools button {
  font-size: 11px;
  min-height: 36px;
  padding: 4px 8px;
  background: transparent;
  border: 0;
}
.workout-title {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}
.workout-title h2 {
  font-size: 21px;
  margin-bottom: 5px;
}
.previous {
  background: #f4f6f0;
  padding: 12px 15px;
  border-radius: 10px;
  font-size: 12px;
  margin: 15px 0;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.actions > * {
  flex: 1;
}
.empty {
  padding: 45px 24px;
  text-align: center;
  border: 1px dashed #cbd5c5;
  border-radius: 16px;
}
.empty p {
  max-width: 400px;
  margin: 10px auto 20px;
}
.chart {
  width: 100%;
  height: auto;
  max-height: 260px;
  overflow: visible;
}
.chart text {
  fill: var(--muted);
  font-size: 11px;
}
.chart polyline {
  fill: none;
  stroke: #6c9852;
  stroke-width: 3;
}
.chart circle {
  fill: var(--dark);
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
td,
th {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
th {
  font-weight: 600;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 105px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: white;
  border-radius: 12px;
  padding: 12px 20px;
  max-width: 90vw;
  z-index: 30;
  display: none;
  font-size: 13px;
}
#save-status {
  position: fixed;
  bottom: 10px;
  right: 20px;
  font-size: 11px;
  padding: 7px 12px;
  border-radius: 12px;
  background: #edf4e6;
  z-index: 10;
  max-width: 90vw;
}
#save-status:empty {
  display: none;
}
#save-status.error {
  background: #fff0de;
  color: #8b5224;
}
#timer {
  position: fixed;
  bottom: 45px;
  right: 20px;
  background: var(--dark);
  color: white;
  border-radius: 14px;
  padding: 12px 18px;
  z-index: 15;
  box-shadow: 0 5px 25px #132c2b25;
  font-variant-numeric: tabular-nums;
}
#timer button {
  background: transparent;
  color: white;
  border: 0;
  min-height: 28px;
  padding: 0 0 0 18px;
}
.login {
  max-width: 460px;
  margin: 10vh auto;
  padding: 30px;
}
.login .brand {
  margin-bottom: 50px;
}
.login h1 {
  font-size: 46px;
}
.login form {
  margin-top: 30px;
}
.login .primary {
  width: 100%;
}
.login .footnote {
  margin-top: 30px;
}
.error {
  color: var(--red);
}
.summary-values {
  display: flex;
  gap: 35px;
  margin: 25px 0;
}
.summary-values strong {
  font-size: 30px;
  display: block;
}
.days-checks {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}
.days-checks label {
  display: flex;
  align-items: center;
  gap: 7px;
}
.history-status {
  font-size: 11px;
  color: var(--muted);
}
.file-label {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
}
.file-label input {
  display: none;
}
button.link-look {
  border: none;
  background: transparent;
  text-decoration: underline;
}
.conflict {
  border: 1px solid #bd7a45;
  background: #fff5e5;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 18px;
}
@media (min-width: 1400px) {
  main#content {
    padding-top: 48px;
  }
  .hero {
    min-height: 345px;
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 205px;
    padding: 30px 15px;
  }
  .main-wrap {
    margin-left: 205px;
    width: calc(100% - 205px);
  }
  header {
    padding: 0 28px;
  }
  main#content {
    padding: 30px 28px;
  }
  .dashboard {
    grid-template-columns: 1.3fr 1fr;
    gap: 16px;
  }
  .hero {
    padding: 24px;
  }
  .hero h2 {
    font-size: 29px;
  }
  .hero-art {
    right: -85px;
  }
  .card {
    padding: 20px;
  }
  .exercise-preview {
    grid-template-columns: 1fr 1fr;
  }
  .plan-controls {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    width: 100%;
    height: 78px;
    padding: 0 7px;
    padding-bottom: env(safe-area-inset-bottom);
    border-right: 0;
    border-top: 1px solid var(--line);
    background: #fffffff5;
    backdrop-filter: blur(12px);
  }
  .sidebar > .brand,
  .nav-caption,
  .sidebar-bottom {
    display: none;
  }
  nav {
    display: flex;
    justify-content: space-around;
    gap: 0;
    height: 62px;
  }
  nav button {
    flex: 1;
    flex-direction: column;
    gap: 3px;
    padding: 8px 0 5px;
    font-size: 9px;
    border-radius: 0;
    min-width: 0;
  }
  nav button span {
    font-size: 22px;
    width: auto;
  }
  nav button.selected {
    background: transparent;
    color: #3f6c2d;
    box-shadow: inset 0 3px #87a860;
  }
  .main-wrap {
    margin-left: 0;
    width: 100%;
  }
  header {
    height: 68px;
    padding: 0 20px;
  }
  .mobile-brand {
    display: block;
    font-size: 23px;
    font-weight: 750;
    letter-spacing: -1px;
  }
  .desktop-date {
    display: none;
  }
  .private-label {
    font-size: 10px;
  }
  .header-actions {
    gap: 12px;
  }
  .icon-button {
    font-size: 22px;
    border: 0;
  }
  main#content {
    padding: 26px 20px 135px;
    min-height: calc(100vh - 68px);
  }
  .page-heading {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 23px;
  }
  .page-heading .badge {
    font-size: 9px;
    padding: 5px 8px;
  }
  .page-heading h1 {
    font-size: 33px;
  }
  .page-heading p {
    font-size: 13px;
  }
  .page-heading .eyebrow {
    font-size: 10px;
  }
  .dashboard {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .hero {
    min-height: 285px;
    padding: 25px;
  }
  .hero h2 {
    font-size: 33px;
  }
  .hero .primary {
    width: 100%;
  }
  .hero-art {
    right: -20px;
    bottom: 55px;
  }
  .stats {
    gap: 8px;
    margin: 18px 0;
  }
  .stat {
    padding: 15px 12px;
    border-radius: 13px;
  }
  .stat .value {
    font-size: 25px;
  }
  .stat .value span {
    font-size: 10px;
    margin-left: 3px;
  }
  .stat .small {
    font-size: 10px;
  }
  .exercise-preview {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .preview {
    padding: 15px;
  }
  .preview h3 {
    font-size: 13px;
  }
  .section-heading h2 {
    font-size: 20px;
  }
  .card {
    padding: 19px;
    border-radius: 16px;
  }
  .library-grid,
  .grid2 {
    grid-template-columns: 1fr;
  }
  .filters {
    gap: 10px;
  }
  .filters select {
    font-size: 14px;
    padding: 10px;
  }
  .set-row {
    gap: 7px;
    grid-template-columns: 28px 1fr 0.9fr 0.8fr 45px;
  }
  .set-row input {
    min-width: 0;
  }
  .set-row label {
    font-size: 10px;
  }
  .set-row .done-button {
    height: 50px;
  }
  .set-tools button {
    min-height: 40px;
  }
  .workout-title h2 {
    font-size: 19px;
  }
  .plan-controls {
    gap: 10px;
  }
  .desktop-footer {
    display: none;
  }
  #save-status {
    bottom: 81px;
    right: 10px;
    font-size: 10px;
  }
  #timer {
    bottom: 116px;
    right: 10px;
  }
  #toast {
    bottom: 170px;
  }
  .actions {
    gap: 8px;
  }
  .actions button {
    padding: 10px;
    font-size: 13px;
  }
  .login {
    margin: 4vh auto;
  }
  .login h1 {
    font-size: 42px;
  }
  .week {
    margin: 20px 0;
  }
  .day b {
    width: 36px;
    height: 36px;
  }
  .summary-values {
    gap: 20px;
  }
  .summary-values strong {
    font-size: 26px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition:
      background 0.15s,
      border 0.15s;
  }
  main#content {
    animation: appear 0.2s ease;
  }
  @keyframes appear {
    from {
      opacity: 0.6;
      transform: translateY(3px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
/* Standalone iPhone safe areas: keep controls above the home indicator. */
@media (max-width: 760px) {
  header { padding-top: env(safe-area-inset-top); height: calc(68px + env(safe-area-inset-top)); }
  .sidebar { height: calc(64px + env(safe-area-inset-bottom)); }
  nav { height: 64px; flex-shrink: 0; }
  #save-status { bottom: calc(68px + env(safe-area-inset-bottom)); }
  #timer { bottom: calc(103px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(155px + env(safe-area-inset-bottom)); }
}
