/* metatrain · shared style v0.1
 * dark-first · 深墨绿 / 焦糖橙 / 米黄浅
 */

:root {
  --bg: #0a1a16;
  --bg-2: #0f241f;
  --bg-3: #163029;
  --line: #1e3a32;
  --line-2: #244a40;
  --ink: #f7f4ee;
  --ink-2: #d9d2c2;
  --ink-3: #8c9a93;
  --ink-4: #4a5a54;
  --accent: #ff7a45;       /* 焦糖橙 */
  --accent-2: #ffa377;
  --accent-soft: rgba(255,122,69,.16);
  --green: #4dd6a8;
  --warn: #ffcf6b;
  --bad:  #ff6864;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 8px 28px rgba(0,0,0,.35);
  --t: 200ms cubic-bezier(.2,.7,.2,1);
  --tnum: "tnum" 1, "lnum" 1;
}

[data-theme="light"] {
  --bg: #f7f4ee;
  --bg-2: #ffffff;
  --bg-3: #efe9dc;
  --line: #e2dccd;
  --line-2: #cdc4ad;
  --ink: #1a2622;
  --ink-2: #354740;
  --ink-3: #6a7770;
  --ink-4: #a6b0aa;
  --accent: #d9551f;
  --accent-2: #ff7a45;
  --accent-soft: rgba(217,85,31,.12);
  --green: #1f8a64;
  --shadow: 0 6px 22px rgba(60,40,20,.10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "HarmonyOS Sans SC", "Helvetica Neue", Inter, "Segoe UI",
               Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  font-size: 15px;
  min-height: 100vh;
  transition: background var(--t), color var(--t);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
button { font-family: inherit; }
img { max-width: 100%; display: block; }

.num { font-feature-settings: var(--tnum); font-variant-numeric: tabular-nums lining-nums; }

/* ===== app frame (mobile-first, centered on desktop) ===== */
.frame {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
@media (max-width: 460px) {
  .frame { border-left: 0; border-right: 0; }
}

.wide {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--t), background var(--t), border-color var(--t), color var(--t);
}
.btn:hover { background: var(--bg-3); }
.btn:active { transform: scale(.96); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; }
.btn.big { height: 56px; font-size: 17px; padding: 0 28px; }
.btn.block { width: 100%; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--t);
}
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--t);
  font-size: 16px;
}
.icon-btn:hover { background: var(--bg-3); }
.icon-btn:active { transform: scale(.92); }

/* ===== card ===== */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

/* ===== top bar (app frame) ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10,26,22,.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
[data-theme="light"] .topbar { background: rgba(247,244,238,.85); }

.topbar .title {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.topbar .title .t1 { font-weight: 600; font-size: 15px; }
.topbar .title .t2 { font-size: 12px; color: var(--ink-3); font-feature-settings: var(--tnum); }

.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  font-feature-settings: var(--tnum);
}
.timer-pill::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* ===== logo ===== */
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.logo-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #d94a1a);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800;
  box-shadow: 0 4px 12px rgba(255,122,69,.35);
  font-size: 13px;
}

/* ===== landing ===== */
.landing-nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(10,26,22,.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
[data-theme="light"] .landing-nav { background: rgba(247,244,238,.85); }
.landing-nav .row {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 0;
}
.landing-nav .links {
  display: flex; gap: 22px;
  font-size: 14px;
  margin-left: auto;
}
.landing-nav .links a { color: var(--ink-2); }
.landing-nav .links a:hover { color: var(--ink); }

.hero {
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -20% -20% auto auto;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,122,69,.18), transparent 60%);
  filter: blur(30px);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  font-weight: 800;
}
.hero h1 .accent { color: var(--accent); }
.hero p.lead {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 580px;
  margin: 0 0 32px;
  line-height: 1.6;
}
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .meta {
  margin-top: 36px;
  color: var(--ink-3);
  font-size: 13px;
  display: flex; gap: 18px; flex-wrap: wrap;
}
.hero .meta b { color: var(--ink-2); font-weight: 600; }

.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.section .sub {
  color: var(--ink-3);
  margin: 0 0 32px;
  font-size: 15px;
}

.promise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.promise-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: transform var(--t), border-color var(--t);
}
.promise-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.promise-card .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}
.promise-card h3 { margin: 0 0 8px; font-size: 18px; }
.promise-card p { margin: 0; color: var(--ink-3); font-size: 14px; line-height: 1.7; }

/* compare table */
.compare {
  width: 100%; border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
  background: var(--bg-2);
}
.compare th, .compare td {
  padding: 14px 16px; text-align: left;
  border-bottom: 1px solid var(--line);
}
.compare th { font-weight: 600; color: var(--ink-2); background: var(--bg-3); }
.compare tr:last-child td { border-bottom: 0; }
.compare td.us { color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.compare td.yes { color: var(--green); }
.compare td.no { color: var(--bad); }
.compare td.meh { color: var(--warn); }

/* timeline */
.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.tl-item {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
}
.tl-item .tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-3);
  color: var(--ink-3);
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}
.tl-item.now .tag { background: var(--accent); color: #fff; }
.tl-item h4 { margin: 0 0 6px; font-size: 15px; }
.tl-item p { margin: 0; font-size: 13px; color: var(--ink-3); line-height: 1.6; }

@media (max-width: 720px) {
  .timeline { grid-template-columns: 1fr 1fr; }
}

.footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  color: var(--ink-3);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ===== app · workout ===== */
.workout-area { padding: 16px; padding-bottom: 120px; }

.exercise-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.exercise-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.exercise-head h2 {
  margin: 0 0 4px;
  font-size: 28px;
  letter-spacing: -0.01em;
  font-weight: 700;
}
.exercise-head .muscle { font-size: 12px; color: var(--ink-3); }
.exercise-head .stats {
  display: flex; gap: 12px;
  font-size: 12px;
  color: var(--ink-3);
  font-feature-settings: var(--tnum);
}
.exercise-head .stats b { display: block; color: var(--accent); font-size: 14px; font-weight: 700; }

.set-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-feature-settings: var(--tnum);
}
.set-table thead th {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 4px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.set-table thead th:first-child { text-align: left; padding-left: 8px; }
.set-table tbody td {
  padding: 0;
  vertical-align: middle;
}
.set-row {
  position: relative;
  transition: background var(--t), opacity var(--t);
}
.set-row td { border-bottom: 1px solid var(--line); }
.set-row.done { background: rgba(77,214,168,.06); }
.set-row.done td { color: var(--ink-3); }
.set-row.swipe { animation: swipeDone 360ms ease forwards; }
@keyframes swipeDone {
  0% { transform: translateX(0); background: transparent; }
  40% { transform: translateX(40px); background: rgba(77,214,168,.18); }
  100% { transform: translateX(0); background: rgba(77,214,168,.06); }
}

.set-row .col-idx {
  width: 38px;
  text-align: center;
  padding: 14px 4px 14px 8px;
  font-weight: 600;
  color: var(--ink-2);
}
.set-row .col-prev {
  font-size: 12px;
  color: var(--ink-3);
  padding: 10px 4px;
  text-align: center;
  white-space: nowrap;
}
.set-row .col-input {
  padding: 8px 4px;
}
.cell-input {
  width: 72px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-3);
  color: var(--ink);
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  font-feature-settings: var(--tnum);
  cursor: pointer;
  transition: all var(--t);
}
.cell-input:hover { border-color: var(--accent); }
.cell-input.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cell-input.placeholder { color: var(--ink-3); font-weight: 400; }

.col-done { width: 56px; text-align: center; padding-right: 8px; }
.done-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--ink-3);
  cursor: pointer;
  font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--t);
}
.done-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.done-btn:active { transform: scale(.9); }
.set-row.done .done-btn {
  background: var(--green);
  border-color: var(--green);
  color: #0a1a16;
}

.set-add {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px;
  background: transparent;
  border: 1px dashed var(--line-2);
  color: var(--ink-3);
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  width: 100%;
  justify-content: center;
  transition: all var(--t);
}
.set-add:hover { border-color: var(--accent); color: var(--accent); }

/* exercise tabs */
.ex-tabs {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 0 16px 8px;
  margin-bottom: 4px;
  scrollbar-width: none;
}
.ex-tabs::-webkit-scrollbar { display: none; }
.ex-tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t);
  display: inline-flex; align-items: center; gap: 6px;
}
.ex-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.ex-tab.completed::before { content: "✓"; color: var(--green); font-weight: 700; }
.ex-tab.active.completed::before { color: #fff; }

/* fab */
.fab {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: min(380px, calc(100vw - 32px));
}
.fab .btn { box-shadow: var(--shadow); }

/* ===== numpad sheet ===== */
.sheet-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}
.sheet-mask.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 100%);
  width: min(440px, 100%);
  background: var(--bg-2);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border-top: 1px solid var(--line);
  z-index: 50;
  transition: transform 280ms cubic-bezier(.2,.7,.2,1);
  padding: 12px 16px 24px;
  max-height: 86vh;
  overflow-y: auto;
}
.sheet.open { transform: translate(-50%, 0); }

.sheet-handle {
  width: 40px; height: 4px;
  background: var(--line-2);
  border-radius: 2px;
  margin: 4px auto 14px;
}
.sheet-title {
  font-size: 16px; font-weight: 600;
  margin: 0 0 4px;
  display: flex; align-items: center; justify-content: space-between;
}
.sheet-sub { font-size: 12px; color: var(--ink-3); margin-bottom: 14px; }

.numpad-display {
  display: flex; gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
  align-items: center;
}
.numpad-field {
  flex: 1;
  text-align: center;
  cursor: pointer;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: border-color var(--t);
}
.numpad-field.active { border-color: var(--accent); background: rgba(255,122,69,.06); }
.numpad-field .lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.numpad-field .val {
  font-size: 36px;
  font-weight: 700;
  font-feature-settings: var(--tnum);
  letter-spacing: -0.02em;
}

.numpad-step {
  display: flex; gap: 6px;
  margin-bottom: 12px;
  justify-content: center;
}
.numpad-step .btn {
  height: 36px; padding: 0 12px; font-size: 13px; font-weight: 600;
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.numpad button {
  height: 56px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  font-feature-settings: var(--tnum);
  cursor: pointer;
  transition: all 120ms ease;
}
.numpad button:hover { background: var(--bg); }
.numpad button:active { transform: scale(.94); background: var(--accent-soft); border-color: var(--accent); }
.numpad button.action {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  grid-column: span 1;
}

/* rest timer */
.rest-overlay {
  position: fixed; inset: 0;
  background: rgba(10,26,22,.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 60;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 28px;
  opacity: 0; pointer-events: none;
  transition: opacity 220ms ease;
}
.rest-overlay.open { opacity: 1; pointer-events: auto; }
.rest-overlay .label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-3);
}
.rest-overlay .countdown {
  font-size: 120px;
  font-weight: 800;
  font-feature-settings: var(--tnum);
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
}
.rest-overlay .countdown.warn { color: var(--warn); }
.rest-overlay .controls { display: flex; gap: 12px; }
.rest-overlay .controls .btn { min-width: 88px; }
.rest-overlay .hint { color: var(--ink-3); font-size: 13px; }

/* PR toast */
.toast-stack {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  width: min(380px, calc(100vw - 24px));
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: linear-gradient(135deg, #ff7a45, #d9551f);
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 12px 30px rgba(255,122,69,.35);
  font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 260ms cubic-bezier(.2,.7,.2,1);
  pointer-events: auto;
}
.toast .icon { font-size: 20px; }
.toast b { font-weight: 700; }
.toast.fade-out { animation: toastOut 240ms ease forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-12px); }
}

/* confetti */
.confetti {
  position: fixed; pointer-events: none;
  inset: 0;
  z-index: 70;
  overflow: hidden;
}
.confetti span {
  position: absolute;
  top: -10vh;
  width: 8px; height: 14px;
  border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(120vh) rotate(720deg); opacity: 0; }
}

/* summary modal */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 90;
  display: flex; align-items: flex-end;
  justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t);
}
.modal-mask.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--bg-2);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  width: min(440px, 100%);
  padding: 28px 22px 28px;
  max-height: 92vh; overflow-y: auto;
  transform: translateY(100%);
  transition: transform 320ms cubic-bezier(.2,.7,.2,1);
}
.modal-mask.open .modal { transform: translateY(0); }
.modal h2 { margin: 0 0 6px; font-size: 24px; }
.modal .summary-quote {
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-radius: 12px;
  line-height: 1.5;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.sm-stat {
  background: var(--bg-3);
  border-radius: 12px;
  padding: 14px;
}
.sm-stat .v {
  font-size: 28px;
  font-weight: 700;
  font-feature-settings: var(--tnum);
  letter-spacing: -0.01em;
}
.sm-stat .l { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* bottom sheet (exercise switcher) */
.sheet-list { margin: 4px 0 12px; }
.sheet-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  border-radius: 10px;
  transition: background var(--t);
}
.sheet-row:hover { background: var(--bg-3); }
.sheet-row.active { background: var(--accent-soft); }
.sheet-row .num-circle {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-3);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.sheet-row.completed .num-circle {
  background: var(--green); color: #0a1a16; border-color: var(--green);
}
.sheet-row .nm { flex: 1; }
.sheet-row .nm .n1 { font-size: 15px; font-weight: 500; }
.sheet-row .nm .n2 { font-size: 12px; color: var(--ink-3); }

/* ===== dashboard ===== */
.dash {
  padding: 16px;
}
.dash h2 { font-size: 22px; margin: 24px 0 12px; letter-spacing: -0.01em; }
.dash h2:first-child { margin-top: 8px; }

.month-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 16px;
  padding: 12px 0 8px;
}
.month-nav .m {
  font-size: 18px; font-weight: 600;
  font-feature-settings: var(--tnum);
  min-width: 100px; text-align: center;
}

.weekly-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.weekly-grid .sm-stat .v { font-size: 22px; }

.heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.heatmap .day {
  aspect-ratio: 1/1;
  border-radius: 6px;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  color: var(--ink-4);
  font-feature-settings: var(--tnum);
  cursor: pointer;
  transition: transform var(--t);
}
.heatmap .day:hover { transform: scale(1.08); }
.heatmap .day.l1 { background: rgba(255,122,69,.20); color: var(--ink-2); }
.heatmap .day.l2 { background: rgba(255,122,69,.45); color: #fff; }
.heatmap .day.l3 { background: rgba(255,122,69,.75); color: #fff; }
.heatmap .day.l4 { background: var(--accent); color: #fff; }
.heatmap .dow {
  background: transparent; color: var(--ink-4);
  font-size: 11px;
}

.pr-line {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.pr-line .pr-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
}
.pr-line .pr-name { font-weight: 600; font-size: 14px; }
.pr-line .pr-val {
  font-size: 20px; font-weight: 700; color: var(--accent);
  font-feature-settings: var(--tnum);
}
.pr-line .pr-val small { font-size: 12px; color: var(--ink-3); font-weight: 500; margin-left: 4px; }
.pr-line svg { display: block; width: 100%; height: 60px; }

.bodymap-wrap {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.bodymap-wrap svg { width: 140px; height: 220px; flex: 0 0 auto; }
.bodymap-legend { flex: 1; font-size: 13px; }
.bodymap-legend ul { margin: 0; padding: 0; list-style: none; }
.bodymap-legend li {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; color: var(--ink-2);
}
.bodymap-legend .dot {
  width: 10px; height: 10px; border-radius: 50%;
}

/* ===== onboarding ===== */
.onb {
  min-height: 100vh;
  display: flex; flex-direction: column;
  padding: 20px 16px;
  max-width: 440px; margin: 0 auto;
}
.onb-progress {
  display: flex; gap: 6px;
  margin-bottom: 28px;
}
.onb-progress .seg {
  flex: 1; height: 4px;
  border-radius: 2px;
  background: var(--bg-3);
  transition: background var(--t);
}
.onb-progress .seg.active { background: var(--accent); }
.onb-progress .seg.done { background: var(--accent); }
.onb-step h2 { font-size: 28px; margin: 0 0 8px; letter-spacing: -0.01em; }
.onb-step p.sub { color: var(--ink-3); margin: 0 0 28px; }
.onb-step .opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.onb-step .opts.cols-3 { grid-template-columns: repeat(3, 1fr); }
.onb-step .opt {
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 20px 14px;
  cursor: pointer;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  transition: all var(--t);
}
.onb-step .opt .em { font-size: 28px; display: block; margin-bottom: 8px; }
.onb-step .opt:hover { border-color: var(--line-2); }
.onb-step .opt.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dial {
  display: flex; align-items: center; justify-content: center;
  gap: 24px; padding: 24px 0;
}
.dial .arrow {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--bg-2); border: 1px solid var(--line);
  font-size: 24px; cursor: pointer; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.dial .arrow:active { transform: scale(.92); }
.dial .v {
  font-size: 100px;
  font-weight: 800;
  color: var(--accent);
  font-feature-settings: var(--tnum);
  letter-spacing: -0.04em;
  min-width: 140px; text-align: center;
}
.dial .unit { color: var(--ink-3); font-size: 14px; text-align: center; margin-top: -8px; }

.onb-cta { margin-top: auto; padding-top: 24px; }

/* ===== exercise library ===== */
.lib-search {
  display: flex; gap: 8px;
  padding: 12px 16px;
  position: sticky; top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 5;
}
.lib-search input {
  flex: 1;
  height: 40px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--ink);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.lib-search input:focus { border-color: var(--accent); }
.lib-cats {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 10px 16px;
  scrollbar-width: none;
}
.lib-cats::-webkit-scrollbar { display: none; }

.lib-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 8px 16px 32px;
}
.lib-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all var(--t);
}
.lib-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.lib-card .ph {
  aspect-ratio: 1.2/1;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--bg-3), var(--bg));
  margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  color: var(--ink-3);
}
.lib-card .nm { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.lib-card .mt { font-size: 11px; color: var(--ink-3); }

.modal-center {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t);
}
.modal-center.open { opacity: 1; pointer-events: auto; }
.modal-center .box {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  width: min(420px, 100%);
  padding: 22px;
  max-height: 84vh; overflow-y: auto;
  transform: scale(.96);
  transition: transform var(--t);
}
.modal-center.open .box { transform: scale(1); }
.modal-center h3 { margin: 0 0 6px; font-size: 20px; }
.modal-center .ms { color: var(--ink-3); font-size: 13px; margin-bottom: 16px; }

.sub-list { margin: 12px 0 0; }
.sub-list .row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.sub-list .row:last-child { border-bottom: 0; }

/* small svg trend */
.mini-trend { width: 100%; height: 60px; }

/* misc helpers */
.row-between { display: flex; align-items: center; justify-content: space-between; }
.gap-12 { gap: 12px; }
.muted { color: var(--ink-3); }
.spacer { flex: 1; }
.center { text-align: center; }
.hidden { display: none !important; }
.mt-12 { margin-top: 12px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }

/* ===== theme toggle floating ===== */
.theme-toggle {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 25;
}

.tag-pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--ink-3);
  margin-right: 4px;
}

@media (max-width: 380px) {
  .hero h1 { font-size: 32px; }
  .numpad button { height: 50px; font-size: 20px; }
  .rest-overlay .countdown { font-size: 90px; }
  .exercise-head h2 { font-size: 24px; }
}
