/*
  STYLES
  All colours and sizes are variables here at the top. Change one value and it
  changes everywhere. Dark mode is a second set of colour values, used
  automatically when the phone is set to dark.
*/

:root {
  --bg: #f6f4ef;          /* page background: warm off-white */
  --surface: #ffffff;     /* cards, inputs */
  --text: #22241f;
  --muted: #8a857a;       /* small labels, secondary text */
  --line: #e6e2d8;        /* borders and dividers */
  --accent: #2f6b4f;      /* buttons, ticks: calm deep green */
  --accent-text: #ffffff;
  --accent-soft: #e2ede6; /* ticked sets */
  --warning: #c2572f;
  --rest: #c08a2d;        /* the line around the picture while resting */
  --chart: #1f8a5a;       /* chart lines and dots (checked for contrast and colour-blindness) */

  --radius: 22px;
  --radius-small: 14px;
  --shadow: 0 8px 30px rgba(40, 35, 20, 0.08);
  --shadow-up: 0 -10px 40px rgba(40, 35, 20, 0.12); /* the dock while resting */
  --tap: 52px;            /* minimum height of anything you tap */
  --gutter: 20px;
}

/* Dark mode: same names, darker values. The phone's setting decides which is used. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151714;
    --surface: #222520;
    --text: #ecebe6;
    --muted: #9a968c;
    --line: #353930;
    --accent: #5fae86;      /* a lighter green, so it stands out on dark */
    --accent-text: #0f1a14;
    --accent-soft: #1f3328;
    --warning: #e07a52;
    --rest: #d9a441;
    --chart: #2fa86c;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-up: 0 -10px 40px rgba(0, 0, 0, 0.5);
  }
  /* The light "no picture yet" placeholder would glare on a dark screen. */
  img[src$="placeholder.svg"] { opacity: 0.3; }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  /* Stay clear of the notch and home bar on iPhones. */
  padding: env(safe-area-inset-top) var(--gutter) calc(110px + env(safe-area-inset-bottom));
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}
button:disabled { opacity: 0.35; cursor: default; }

.icon { width: 22px; height: 22px; flex-shrink: 0; }

/* ---------- Text styles ---------- */

.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.big-title { margin: 0; font-size: clamp(30px, 9vw, 40px); line-height: 1.1; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Buttons ---------- */

.primary-btn, .secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
}
.primary-btn { background: var(--accent); color: var(--accent-text); }
.secondary-btn { background: var(--surface); border: 1.5px solid var(--line); }

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

/* ---------- Home ---------- */

.home-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 0 18px;
  border-bottom: 1px solid var(--line);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.chip .icon { color: var(--accent); width: 20px; height: 20px; }

/* Swipe sideways between workouts. scroll-snap makes each card stop in place. */
.carousel {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin: 0 calc(-1 * var(--gutter));
  padding: 28px var(--gutter) 36px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }

.workout-card {
  flex: 0 0 86%;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 26px 22px 22px;
  border-radius: 32px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
}
.card-title { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-small);
  background: var(--line);
}

.last-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
}
.last-line .icon { width: 18px; height: 18px; }

/* ---------- Top bar (detail and player) ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 22px; }

/* ---------- Workout detail ---------- */

.detail-intro {
  padding: 20px 8px;
  border-bottom: 1px solid var(--line);
}
.detail-intro p { margin: 0 0 8px; }

.step-list { list-style: none; margin: 0; padding: 8px 0; }
.step-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
}
.step-thumb {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--radius-small);
  background: var(--line);
}
.step-name { flex: 1; font-weight: 600; }
.step-target { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* A bar fixed to the bottom of the screen, for the main button. */
.bottom-bar, .dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px var(--gutter) calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.bottom-bar .primary-btn { width: 100%; max-width: 440px; margin: 0 auto; }

/* ---------- Player ---------- */

.progress { height: 4px; background: var(--line); border-radius: 2px; margin-top: -1px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s; }

.player { display: flex; flex-direction: column; align-items: center; padding-top: 20px; }

/* The picture, with the progress line drawn just outside its edge. */
.art-wrap {
  position: relative;
  width: min(46vw, 200px);
  aspect-ratio: 1;
}
.player-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 36px;
  background: var(--line);
}
.ring {
  position: absolute;
  inset: -9px;
  width: calc(100% + 18px);
  height: calc(100% + 18px);
  overflow: visible;
  pointer-events: none;
}
.ring rect, .ring path {
  fill: none;
  stroke-width: 2.2; /* in the drawing's own units: about 5px on a phone */
  stroke-linecap: round;
}
.ring-track { stroke: var(--line); }
.ring-fill {
  stroke: var(--accent);
  stroke-dasharray: 100;
  transition: stroke-dashoffset 0.3s linear;
}
.resting .ring-fill { stroke: var(--rest); }
.exercise-name { margin: 0; font-size: 28px; letter-spacing: -0.01em; }
.target { margin: 2px 0 0; font-size: 20px; font-weight: 600; color: var(--accent); }
.cue { margin: 8px 0 0; text-align: center; color: var(--muted); }

/* Exercise name with the small (i) button next to it. */
.name-row { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; }
.name-row .exercise-name { margin: 0; }
.info-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-right: -44px; /* keep the name itself centred */
  color: var(--muted);
}
.info-btn .icon { width: 24px; height: 24px; }

/* The exercise info sheet. */
.info-sheet { position: fixed; inset: 0; z-index: 50; }
.info-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); animation: fade-in 0.2s; }
.info-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  max-height: 88vh;
  margin: 0 auto;
  overflow-y: auto;
  padding: 4px var(--gutter) calc(28px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: sheet-up 0.25s ease-out;
}
.info-panel .topbar { width: 100%; position: sticky; top: -4px; z-index: 1; background: var(--bg); }
.info-art { width: min(56vw, 220px); aspect-ratio: 1; object-fit: cover; border-radius: 32px; margin-top: 18px; background: var(--line); }
.info-steps { align-self: stretch; margin: 16px 0 0; padding: 0; list-style: none; counter-reset: step; }
.info-steps li {
  counter-increment: step;
  position: relative;
  padding: 12px 14px 12px 52px;
  margin-bottom: 8px;
  border-radius: var(--radius-small);
  background: var(--surface);
}
.info-steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 11px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }

.last-time {
  width: 100%;
  margin: 8px 0 12px;
  padding: 12px 16px;
  border-radius: var(--radius-small);
  background: var(--surface);
  font-size: 15px;
}

.field { width: 100%; display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field span { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

input {
  font: inherit;
  color: inherit;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 17px; /* 16px or more stops iPhones zooming in when you type */
}
input:focus { outline: none; border-color: var(--accent); }
input:disabled { background: transparent; border-color: transparent; color: var(--text); opacity: 1; -webkit-text-fill-color: var(--text); }
input.needs-value { border-color: var(--warning); }

/* ---------- The set card: one set at a time ---------- */

.set-card {
  width: 100%;
  margin-top: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.set-card p { margin: 0; }
.set-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}
.set-note .icon { width: 18px; height: 18px; }
.set-card.all-done { flex-direction: row; text-align: left; background: var(--accent-soft); box-shadow: none; }
.set-card.all-done > .icon { color: var(--accent); width: 28px; height: 28px; }
.set-card.all-done p .icon { width: 16px; height: 16px; vertical-align: -3px; }

/* − [ 45 kg ] + */
.stepper { width: 100%; display: flex; align-items: center; gap: 12px; }
.step-btn {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--line);
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
  touch-action: manipulation; /* no double-tap zoom when tapping fast */
  user-select: none;
  -webkit-user-select: none;
}
.step-btn:active { background: var(--accent-soft); border-color: var(--accent); }
.step-value { flex: 1; display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.step-value input {
  width: 3.6em;
  min-height: 0;
  padding: 0;
  border: 0;
  border-bottom: 2px dashed transparent;
  border-radius: 0;
  background: transparent;
  text-align: right;
  font-size: 38px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.step-value input:focus { border-bottom-color: var(--accent); }
.step-value span { width: 3em; font-size: 16px; font-weight: 600; color: var(--muted); }

.step-size { min-height: 36px; font-size: 13px; color: var(--muted); }
.step-size strong { color: var(--text); }

/* Warm-up and set chips under the card. */
.chip-row { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 4px; }
.chip-set {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px dashed var(--line);
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.chip-set .icon { width: 16px; height: 16px; }
.chip-set.current { border-style: solid; border-color: var(--accent); color: var(--accent); }
.chip-set.done { border: 1.5px solid transparent; background: var(--accent-soft); color: var(--accent); }

/* The big "Done set" button in the middle of the dock. */
.done-set-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 170px;
  height: 64px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 19px;
  font-weight: 800;
  box-shadow: var(--shadow);
}
.done-set-btn .icon { width: 24px; height: 24px; }

.countdown {
  margin: 16px 0;
  font-size: 72px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  line-height: 1;
}
.countdown.finished { color: var(--accent); }

.round-btn {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.round-btn .icon { width: 32px; height: 32px; fill: currentColor; }



/* A quick flash when a timer ends. */
body.flash::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: var(--accent);
  animation: flash 0.8s ease-out forwards;
}
@keyframes flash { from { opacity: 0.35; } to { opacity: 0; } }

/* ---------- Done ---------- */

.done-screen { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 80px; }
.done-screen .done-icon { color: var(--accent); }
.done-screen .done-icon .icon { width: 88px; height: 88px; stroke-width: 1.5; }
.done-screen .big-title { margin-top: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin-top: 32px; }
.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 10px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.stat strong { font-size: 22px; }

.skipped { margin-top: 20px; font-size: 15px; }

/* ---------- Home: sections ---------- */

.section-title {
  margin: 32px 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 2px solid transparent;
  text-align: left;
}
.plan-card.active { border-color: var(--accent); }
.plan-card .eyebrow { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.plan-card .eyebrow .icon { width: 14px; height: 14px; color: var(--accent); }
.plan-name { font-size: 18px; font-weight: 800; }

.tile-grid { display: grid; gap: 10px; }
.tile-grid.three { grid-template-columns: repeat(3, 1fr); }
.tile-grid.two { grid-template-columns: repeat(2, 1fr); }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 700;
  font-size: 15px;
}
.tile-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 18px;
  background: var(--line);
}

/* ---------- Lists on the browse screens ---------- */

.row-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 10px 10px;
  border-radius: var(--radius-small);
  background: var(--surface);
  text-align: left;
}
.list-row > .icon { color: var(--muted); }
.row-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 12px;
  background: var(--line);
}
.row-text { flex: 1; display: flex; flex-direction: column; }
.row-title { font-weight: 700; }
.row-sub { font-size: 14px; color: var(--muted); }

/* ---------- Player: the control dock at the bottom ---------- */

.dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
}
.dock.with-rest {
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  box-shadow: var(--shadow-up);
  padding-top: 16px;
}
.controls { display: flex; align-items: center; justify-content: center; gap: 20px; }

.round-btn { width: 56px; height: 56px; }
.round-btn.big { width: 76px; height: 76px; }
.round-btn:disabled { box-shadow: none; }
.round-btn .icon { width: 24px; height: 24px; fill: currentColor; }
.round-btn.big .icon { width: 30px; height: 30px; }
/* The tick in the middle: outline only (no fill), green when you can move on. */
.round-btn [d="M20 6 9 17l-5-5"] { fill: none; }
.round-btn.go { background: var(--accent); color: var(--accent-text); }

.rest-row {
  width: 100%;
  max-width: 440px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.rest-row p { margin: 0; }
.rest-clock { font-size: 40px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--rest); }
.rest-buttons { display: flex; gap: 6px; }
.small-btn {
  min-width: 52px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  font-weight: 700;
  font-size: 15px;
}

/* Leave room at the bottom so the dock never covers the last set. */
#app:has(.dock) { padding-bottom: calc(130px + env(safe-area-inset-bottom)); }
#app:has(.dock.with-rest) { padding-bottom: calc(240px + env(safe-area-inset-bottom)); }

/* "Time to go up" nudge (the progression rule). */
.nudge {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 8px 0 0;
  padding: 12px 16px;
  border-radius: var(--radius-small);
  background: var(--accent-soft);
  text-align: left;
  font-size: 15px;
}
.nudge p { margin: 0; }
.nudge .icon { color: var(--accent); margin-top: 1px; }
.done-nudge { margin-top: 24px; }

/* ---------- Tab bar (Home, Me) ---------- */

.tab-bar {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  z-index: 5;
}
.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  font-size: 15px;
}
.tab.active { background: var(--accent-soft); color: var(--accent); }

/* ---------- Me ---------- */

.me-stats { margin-top: 20px; }
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
}
.card p { margin: 0; }
.backup-status { font-weight: 700; color: var(--accent); }
.backup-status.due { color: var(--warning); }
.backup-message { padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 15px; }
.file-btn { cursor: pointer; }
.file-btn input { display: none; }

/* ---------- Swap and "where is it" ---------- */

.where {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.where .icon, .rest-where .icon, .step-where .icon { width: 16px; height: 16px; color: var(--accent); }
.rest-where, .step-where { display: flex; align-items: center; gap: 4px; }
.step-where { font-weight: 400; }

.swap-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  margin-top: 6px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.swap-btn .icon { width: 16px; height: 16px; }

.sheet-intro { margin: 12px 0 0; }
.sheet-list { align-self: stretch; }
.sheet-list .list-row > .icon { color: var(--accent); }

/* ---------- Progress ---------- */

.tab { padding: 0 16px; }
.streak-note { margin: 10px 8px 0; }
.empty-state { margin-top: 20px; align-items: center; text-align: center; }
.empty-state > .icon { width: 36px; height: 36px; color: var(--accent); }

.calendar { margin-top: 24px; gap: 8px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-dow { font-size: 12px; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.cal-day {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.cal-day.trained { background: var(--accent); color: var(--accent-text); font-weight: 800; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); color: var(--text); font-weight: 800; }
.cal-day.trained.today { box-shadow: inset 0 0 0 2px var(--accent-text), 0 0 0 2px var(--accent); color: var(--accent-text); }

.date-badge {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}
.date-badge strong { font-size: 20px; }

.pb-grid { margin-top: 20px; }
.stat-grid.two { grid-template-columns: repeat(2, 1fr); }
.stat .row-sub { font-size: 12px; }

.chart-card { gap: 4px; }
.chart-readout { font-weight: 700; font-variant-numeric: tabular-nums; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-hit { fill: transparent; cursor: pointer; }
/* Dots: the line's colour with a ring in the card colour, bigger when picked. */
.chart-dot { fill: var(--chart); stroke: var(--surface); stroke-width: 2; pointer-events: none; transition: r 0.15s; }
.chart-point.active .chart-dot { r: 6.5; }

/* ---------- Featured cards and building a workout ---------- */

.create-card { justify-content: center; align-items: flex-start; gap: 8px; border: 2px dashed var(--line); box-shadow: none; background: transparent; }
.create-plus { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.wide-btn { width: 100%; margin-top: 10px; }
.danger-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); border-radius: 999px; color: var(--warning); font-weight: 700;
}

.builder-name { margin-top: 16px; }
.toggle-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--tap);
  margin-top: 10px;
  padding: 0 16px;
  border-radius: var(--radius-small);
  background: var(--surface);
  font-weight: 600;
  text-align: left;
}
.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; transition: background 0.2s; }
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--surface); transition: transform 0.2s;
}
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(18px); }

.builder-row { padding: 10px 6px 12px 10px; border-radius: var(--radius-small); background: var(--surface); }
.builder-top { display: flex; align-items: center; gap: 10px; }
.builder-top .icon-btn { width: 36px; color: var(--muted); }
.builder-controls { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-left: 4px; flex-wrap: wrap; }
.mini-stepper { display: inline-flex; align-items: center; gap: 8px; }
.mini-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line); }
.mini-btn .icon { width: 18px; height: 18px; }

.pick-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line); color: transparent; }
.pick-mark .icon { width: 18px; height: 18px; }
.pick-row.picked .pick-mark { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.sheet-done { position: sticky; bottom: 0; margin-top: 16px; }

/* ---------- Fuller exercise info ---------- */

.step-row { width: 100%; text-align: left; }
.info-title { align-self: stretch; margin: 22px 0 10px; }
.info-best { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 15px; }
.info-best .icon { width: 18px; height: 18px; color: var(--accent); }
.muscle-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.muscle-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.muscle-chip.main { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.info-steps { margin-top: 0; }
.info-list { align-self: stretch; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.info-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-small);
  background: var(--surface);
}
.info-list .icon { width: 20px; height: 20px; margin-top: 1px; flex-shrink: 0; }
.info-list.tips .icon { color: var(--accent); }
.info-list.mistakes .icon { color: var(--warning); }

/* ---------- Clean up ---------- */
.danger-outline { color: var(--warning); border-color: var(--warning); }
.card .danger-btn { min-height: 44px; }
.info-panel .danger-btn { margin-top: 18px; }
