:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --panel: #ffffff;
  --ink: #14211c;
  --muted: #66736d;
  --line: #dce5df;
  --green: #176f50;
  --green-2: #25a06f;
  --amber: #f1a538;
  --blue: #2d6cdf;
  --shadow: 0 18px 50px rgba(20, 33, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(160deg, rgba(37, 160, 111, 0.14), transparent 34%),
    linear-gradient(25deg, rgba(45, 108, 223, 0.12), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.training-panel {
  width: min(100%, 440px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(220, 229, 223, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.topbar,
.round-line,
.controls,
.section-title,
.toggle-row,
.range-row,
.move-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.15;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfa;
  cursor: pointer;
}

.status-card {
  background: #eef8f3;
  border: 1px solid #cfe5da;
  border-radius: 8px;
  padding: 18px;
}

.round-line {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

#phaseLabel {
  color: var(--green);
}

#currentMove {
  margin-top: 18px;
  font-size: 30px;
  line-height: 1.18;
}

.step-detail {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.move-side { display: block; font-size: 21px; line-height: 1.5; margin-top: 4px; color: #31423b; }

.duration-settings {
  border-block: 1px solid var(--line);
  padding: 12px 0;
  color: var(--muted);
  font-size: 14px;
}

.duration-settings summary { cursor: pointer; min-height: 28px; }
.duration-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; }
.duration-row input { width: 80px; min-height: 44px; border: 1px solid var(--line); border-radius: 4px; padding: 8px; color: var(--ink); background: white; }
.duration-row input:disabled { background: #edf0ef; color: var(--muted); }

.timer {
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
  font-size: 76px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.progress-track {
  height: 10px;
  margin-top: 18px;
  overflow: hidden;
  background: rgba(20, 33, 28, 0.11);
  border-radius: 999px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--green-2));
  transition: width 0.25s linear;
}

.coach-line {
  min-height: 44px;
  margin-top: 14px;
  color: #31423b;
  font-size: 15px;
  line-height: 1.45;
}

.controls {
  margin: 16px 0;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  font-weight: 750;
}

.primary-button {
  flex: 1;
  color: #fff;
  background: var(--green);
}

.secondary-button {
  width: 92px;
  color: var(--ink);
  background: #e8eee9;
}

.settings {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.settings.is-hidden,
.move-list.is-hidden {
  display: none;
}

.toggle-row,
.range-row {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--green);
}

input[type="range"] {
  width: 160px;
  accent-color: var(--green);
}

.checkin-card {
  margin: 18px 0;
  padding: 20px;
  border-radius: 8px;
  background: #fffaf0;
  border: 1px solid #f0d8a8;
}

.checkin-card[hidden] {
  display: none;
}

.checkin-eyebrow {
  color: var(--amber);
  font-size: 13px;
  font-weight: 800;
}

.checkin-card h2 {
  margin-top: 6px;
  font-size: 29px;
  line-height: 1.15;
}

.checkin-stats {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

.checkin-stats div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #f2dfba;
  border-radius: 8px;
}

.checkin-stats dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.checkin-stats dd {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  text-align: right;
}

.checkin-note {
  margin-top: 18px;
  color: var(--green);
  font-size: 22px;
  font-weight: 850;
}

.move-list {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.section-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

ol {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 8px;
}

.move-item {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.move-item.active {
  border-color: rgba(23, 111, 80, 0.45);
  background: #f0faf5;
}

.move-name {
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.move-name small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 5px; }

.move-meta {
  color: var(--muted);
  font-size: 13px;
  flex-shrink: 0;
  text-align: right;
}

.move-item { padding-block: 10px; }
#jumpTarget { width: 100%; min-width: 0; height: 44px; font: inherit; font-size: 14px; border: 1px solid #ccdcd5; border-radius: 6px; background: white; color: #172b22; }
#jumpButton { width: 100%; min-height: 44px; }
.section-title { flex-wrap: wrap; }

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

  .training-panel {
    padding: 14px;
  }

  #currentMove {
    font-size: 25px;
  }

  .timer {
    font-size: 62px;
  }

  input[type="range"] {
    width: 126px;
  }

  .checkin-card h2 {
    font-size: 25px;
  }
}
