:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #5b6472;
  --paper: #f5f7fb;
  --panel: #ffffff;
  --line: #dce2ea;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warm: #f59e0b;
  --done: #16a34a;
  --shadow: 0 14px 34px rgba(17, 24, 39, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.app {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 20px 14px 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 2px 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  line-height: 1.05;
}

.reset-button,
.day-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.reset-button {
  flex: 0 0 auto;
  padding: 0 16px;
  font-weight: 800;
}

.day-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.day-button {
  font-weight: 900;
}

.day-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}

.summary p {
  margin: 0 0 6px;
  color: #cbd5e1;
  font-weight: 800;
}

.summary h2 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 2rem);
  line-height: 1.1;
}

.progress-ring {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  border: 7px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--warm);
  border-radius: 50%;
  font-weight: 900;
}

.progress-track {
  height: 10px;
  margin: 14px 0 18px;
  border-radius: 999px;
  overflow: hidden;
  background: #d8dee8;
}

#progressFill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  transition: width 180ms ease;
}

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

.exercise-card {
  display: grid;
  grid-template-columns: 52px minmax(96px, 150px) 1fr;
  gap: 14px;
  align-items: center;
  min-height: 154px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
  transition: border-color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.exercise-card.current {
  border-color: var(--warm);
  transform: translateY(-1px);
}

.exercise-card.done {
  border-color: rgba(22, 163, 74, 0.42);
  opacity: 0.72;
}

.check-wrap {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  cursor: pointer;
}

.exercise-check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.custom-check {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 3px solid #9aa6b2;
  border-radius: 8px;
  background: #fff;
}

.exercise-check:checked + .custom-check {
  border-color: var(--done);
  background: var(--done);
}

.exercise-check:checked + .custom-check::after {
  content: "";
  width: 10px;
  height: 18px;
  border: solid #fff;
  border-width: 0 4px 4px 0;
  transform: rotate(45deg) translate(-1px, -2px);
}

.image-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5eaf0;
  background: #eef2f7;
}

.image-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.exercise-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.order {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #edf7f6;
  color: var(--accent-dark);
  font-weight: 900;
}

.exercise-card.current .order {
  background: #fff4d6;
  color: #92400e;
}

h3 {
  margin: 1px 0 10px;
  font-size: clamp(1rem, 2.8vw, 1.25rem);
  line-height: 1.2;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 850;
  background: #eef2f7;
  color: #263241;
}

.sets {
  background: #e8f6f3;
  color: var(--accent-dark);
}

.rest {
  background: #fff3d2;
  color: #8a5300;
}

.note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

@media (max-width: 620px) {
  .app {
    padding-inline: 10px;
  }

  .topbar {
    align-items: flex-start;
  }

  .exercise-card {
    grid-template-columns: 48px 104px 1fr;
    gap: 10px;
    padding: 10px;
  }

  .custom-check {
    width: 34px;
    height: 34px;
  }

  .pill {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 430px) {
  .exercise-card {
    grid-template-columns: 44px 88px 1fr;
  }

  .summary {
    padding: 15px;
  }

  .progress-ring {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
    border-width: 6px;
  }
}
