:root {
  --violet-1: #7c6fe8;
  --violet-2: #5b4fc4;
  --bg: #f4f3fb;
  --card: #ffffff;
  --text: #241f3d;
  --muted: #8a86a3;
  --danger: #e8637a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  height: 100%;
  overscroll-behavior-y: contain;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px;
  background: var(--bg);
}

.top-title {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 18px;
}

.icon-btn {
  width: 36px; height: 36px;
  border: none;
  background: none;
  font-size: 20px;
  color: var(--text);
  visibility: hidden;
}
.icon-btn.visible { visibility: visible; }
.icon-btn-spacer { width: 36px; }

main { padding: 0 16px 32px; max-width: 480px; margin: 0 auto; }

/* ─── Списки карточек ─── */
.card-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

.level-card {
  background: var(--card);
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(90, 70, 180, .06);
}
.level-card.locked { opacity: .45; }
.level-card .name { font-weight: 600; font-size: 16px; }
.level-card .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.badge-done {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--violet-1), var(--violet-2));
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px;
}

.exercise-row {
  background: var(--card);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(90, 70, 180, .05);
}
.exercise-row .thumb {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, #ece9ff, #e2ddfb);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.exercise-row .name { font-weight: 600; font-size: 15px; }
.exercise-row .value { color: var(--muted); font-size: 13px; margin-top: 2px; }

.hero {
  border-radius: 20px;
  padding: 26px 18px;
  text-align: center;
  color: #fff;
  background: linear-gradient(160deg, var(--violet-1), var(--violet-2));
  margin-top: 8px;
}
.hero .day { font-size: 30px; font-weight: 800; margin: 4px 0 12px; }
.hero .timepill {
  display: inline-block;
  background: rgba(0,0,0,.18);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 15px;
}

.section-title { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 10px; font-weight: 700; font-size: 18px; }
.section-title .count { color: var(--muted); font-weight: 500; font-size: 15px; }

.hint {
  background: #efeefc; color: #6c6690; border-radius: 14px;
  padding: 12px 14px; font-size: 13px; display: flex; gap: 8px; align-items: center;
  margin-top: 10px;
}

.big-btn {
  display: block; width: 100%;
  margin-top: 26px;
  padding: 16px;
  border: none; border-radius: 999px;
  background: linear-gradient(135deg, var(--violet-1), var(--violet-2));
  color: #fff; font-size: 17px; font-weight: 700;
  letter-spacing: .03em;
}
.big-btn:active { filter: brightness(.92); }
.big-btn.secondary {
  background: var(--card); color: var(--violet-2);
  box-shadow: inset 0 0 0 2px #e4e0fb;
}

/* ─── Экран тренировки ─── */
.workout-progress { color: var(--muted); font-size: 13px; text-align: center; margin-top: 4px; }
.workout-card {
  margin-top: 18px;
  border-radius: 24px;
  padding: 34px 20px;
  text-align: center;
  background: var(--card);
  box-shadow: 0 4px 20px rgba(90, 70, 180, .08);
}
.workout-card .ex-name { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.workout-card .ex-phase { color: var(--violet-2); font-weight: 600; margin-bottom: 18px; min-height: 20px; }
.workout-card .ring {
  width: 160px; height: 160px; margin: 0 auto 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--violet-1) calc(var(--pct, 0) * 1%), #eeecfb 0);
}
.workout-card .ring-inner {
  width: 132px; height: 132px; border-radius: 50%;
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 800;
}
.workout-controls { display: flex; gap: 10px; margin-top: 22px; }
.workout-controls button {
  flex: 1; border: none; border-radius: 999px; padding: 14px;
  font-weight: 700; font-size: 15px;
}
.btn-done { background: linear-gradient(135deg, var(--violet-1), var(--violet-2)); color: #fff; }
.btn-skip { background: #efeefc; color: #6c6690; }

/* ─── Сводка ─── */
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.summary-tile {
  background: var(--card); border-radius: 16px; padding: 16px;
  box-shadow: 0 2px 10px rgba(90,70,180,.06);
}
.summary-tile .num { font-size: 24px; font-weight: 800; color: var(--violet-2); }
.summary-tile .label { color: var(--muted); font-size: 13px; margin-top: 2px; }
