:root {
  --bg: #050505;
  --app: #0b0b0b;
  --card: #171717;
  --line: #2a2a2a;
  --text: #f4f4f4;
  --muted: #8d8d8d;
  --lime: #d8ff3a;
  --lime-dim: #c5d64e;
  --olive: #3a4616;
  --olive-2: #24300f;
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --phone: 430px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
html { touch-action: manipulation; }
body {
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea {
  background: #121212;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 10px 8px;
  width: 100%;
  font-size: 16px;
}
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}
#app {
  max-width: var(--phone);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--app);
  position: relative;
}
.boot { color: var(--muted); text-align: center; padding: 40vh 20px 0; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(10px + var(--safe-top)) 14px 8px;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1b1b1b;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #eee;
}
.icon-btn.lime { background: var(--lime); color: #111; width: 46px; height: 46px; }
.icon-btn:disabled, .icon-btn.disabled { opacity: .35; }
.hdr-title { text-align: center; flex: 1; min-width: 0; }
.hdr-title h1 { margin: 0; font-size: 18px; font-weight: 750; letter-spacing: -.02em; }
.hdr-title p, .week-nav { margin: 2px 0 0; color: var(--lime); font-size: 14px; font-weight: 650; }
.week-nav { display: flex; align-items: center; justify-content: center; gap: 8px; }
.week-nav button { color: var(--lime); font-size: 18px; width: 28px; height: 28px; }
.time-center { margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; color: #eee; font-weight: 700; }

.week { padding: 6px 14px 108px; display: flex; flex-direction: column; gap: 10px; }
.day-row { display: grid; grid-template-columns: 46px 1fr; gap: 8px; align-items: stretch; }
.day-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.day-rail .num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 750;
  color: var(--text);
  font-size: 15px;
}
.day-rail.today { color: var(--lime); }
.day-rail.today .num { background: #c5d64a; color: #161616; }

.card-wrap { position: relative; min-width: 0; }
.card {
  width: 100%;
  background: var(--card);
  border: 1px solid #222;
  border-radius: var(--radius);
  padding: 12px 40px 12px 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 86px;
  text-align: left;
  color: inherit;
}
.card.dash {
  border: 1.5px dashed #3a3a3a;
  background: transparent;
  color: #bdbdbd;
  padding-right: 52px;
}
.quiet-rest {
  margin: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
  color: #6a6a6a;
  font-size: 14px;
  font-weight: 650;
}
.train-any {
  color: var(--lime);
  font-weight: 750;
  font-size: 14px;
  min-height: 36px;
  padding: 0 8px;
}
.week-hint {
  margin: 2px 0 12px;
  color: #8d8d8d;
  font-size: 13px;
  line-height: 1.35;
}
.checkin-quiet {
  align-self: flex-start;
  color: #7d7d7d;
  font-size: 13px;
  font-weight: 700;
  min-height: 36px;
  padding: 0 2px;
}
.checkin-due, .checkin-trend {
  background: #141414;
  border: 1px solid #242424;
  border-radius: 16px;
  padding: 12px;
}
.checkin-due p { margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
.checkin-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.checkin-head b { font-size: 15px; }
.checkin-head button { color: var(--muted); font-size: 13px; font-weight: 700; min-height: 32px; }
.checkin-fields { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.checkin-fields label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.checkin-save {
  background: var(--lime);
  color: #141414;
  font-weight: 800;
  border-radius: 12px;
  min-height: 44px;
  padding: 0 14px;
}
.checkin-trend {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  color: inherit;
}
.checkin-trend.static { margin: 12px 0; }
.checkin-trend span { display: flex; flex-direction: column; gap: 2px; min-width: 72px; }
.checkin-trend b { font-size: 16px; }
.checkin-trend small { color: var(--muted); font-size: 12px; font-weight: 700; }
.spark { margin-left: auto; flex: 0 0 auto; }
.spark polyline { fill: none; stroke: var(--lime); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.screen.checkin { padding: 4px 16px 40px; }
.day-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.day-chip {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  background: #1b1b1b;
  color: #ddd;
  font-size: 13px;
  font-weight: 750;
}
.day-chip.on { background: var(--lime); color: #141414; }
.remind {
  display: block;
  width: 100%;
  text-align: left;
  margin: 12px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  min-height: 40px;
}
.remind.on { color: var(--lime); }
.checkin-label { margin: 18px 0 8px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.checkin-due.plain { background: transparent; border: 0; padding: 0; }
.checkin-list { display: flex; flex-direction: column; }
.checkin-row {
  display: grid;
  grid-template-columns: 1fr auto auto 32px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #1c1c1c;
  font-size: 14px;
}
.checkin-row span { color: var(--muted); }
.checkin-row button { color: #888; min-height: 32px; }
.card.done { opacity: .82; }
.thumb {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: linear-gradient(160deg, #2a2a2a, #101010);
  display: grid;
  place-items: center;
  font-size: 26px;
  flex: 0 0 auto;
}
.thumb.lg { width: 64px; height: 64px; border-radius: 14px; font-size: 30px; }
.meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.meta .row { display: flex; align-items: center; gap: 8px; min-height: 18px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  background: #2a3314;
  color: var(--lime);
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 750;
}
.pill.dim { background: #242424; color: #cfcfcf; }
.dur { font-size: 12px; color: var(--muted); font-weight: 650; }
.meta .title { font-size: 16px; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-row .meta .title { white-space: normal; overflow: visible; text-overflow: unset; }
.meta .sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more, .plus {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  color: #b5b5b5;
  display: grid;
  place-items: center;
}
.plus { font-size: 28px; font-weight: 400; color: #d0d0d0; }

.menu {
  position: absolute;
  right: 8px;
  top: 48px;
  background: #242424;
  border-radius: 14px;
  min-width: 196px;
  z-index: 6;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
.menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid #333;
  font-size: 14px;
}
.menu button:last-child { border-bottom: 0; }

.week-foot, .start-wrap, .clock-row, .live-bar, .j-foot {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--phone), 100%);
  z-index: 8;
}
.week-foot {
  bottom: 0;
  padding: 10px 14px calc(12px + var(--safe-bot));
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(11, 11, 11, 0), #0b0b0b 28%);
}
.chip {
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  padding: 10px 14px;
  color: #eee;
  background: #141414;
  font-size: 14px;
}
.nav { display: flex; gap: 8px; }

.screen.preview { padding: 4px 16px 168px; }
.screen.history { padding: 0 14px 48px; }
.screen.done { padding: 18vh 22px 40px; }
.screen.journal { padding: 8px 12px 140px; min-height: 100dvh; }
.kicker { margin: 8px 0 0; color: var(--muted); font-size: 13px; font-weight: 650; }
.shoulder {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #1c1a12;
  color: #e6c15a;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 650;
}
.caution { display: block; color: #e6c15a; font-size: 12px; font-weight: 700; margin-top: 3px; }
.coach {
  background: #1a1a1a;
  border-radius: 16px;
  padding: 14px 14px 12px;
  margin: 14px 0 4px;
  position: relative;
}
.coach b { display: block; margin-bottom: 4px; }
.coach p { margin: 0; color: #c8c8c8; font-size: 14px; line-height: 1.35; }
.coach .x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  color: #aaa;
}
.section-h { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 8px; }
.section-h h2 { margin: 0; font-size: 30px; letter-spacing: -.03em; font-weight: 800; }
.ex-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #1c1c1c;
  width: 100%;
  text-align: left;
  color: inherit;
}
.eq {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1f1f1f;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  color: #eee;
}
.rx { margin-left: auto; text-align: right; font-size: 14px; color: #ddd; font-weight: 650; }
.rx small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.last-line { color: var(--lime-dim); font-size: 12px; margin: 4px 0 0; }
.note { color: #cfcfcf; font-size: 13px; line-height: 1.4; }
.start-wrap {
  bottom: 0;
  padding: 12px 16px calc(16px + var(--safe-bot));
  background: linear-gradient(180deg, rgba(11, 11, 11, 0), #0b0b0b 24%);
}
.start {
  width: 100%;
  background: var(--lime);
  color: #141414;
  font-weight: 850;
  letter-spacing: .06em;
  border-radius: 999px;
  padding: 16px;
  font-size: 16px;
}
.start:disabled { background: #2a2a2a; color: #777; }
.block-note { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 8px; }

.player { padding: 8px 16px 230px; min-height: 100dvh; }
.prog-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.prog-mid { font-size: 18px; font-weight: 750; }
.back-mini, .skip-sec { color: #ddd; font-weight: 650; font-size: 15px; min-height: 44px; padding: 0 4px; }
.back-mini { font-size: 28px; line-height: 1; width: 32px; }
.pips { display: flex; gap: 4px; margin: 12px 0 18px; align-items: center; }
.pips i { flex: 1; height: 4px; background: #2a2a2a; border-radius: 99px; position: relative; }
.pips i.on { background: var(--lime); }
.pips i.now { background: #6d7a32; }
.pips i.now::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  transform: translateY(-50%);
}
.section-title { margin: 0 0 10px; font-size: 34px; letter-spacing: -.04em; font-weight: 820; }
.tool-line { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.equip-menu { display: flex; gap: 6px; overflow: auto; padding-bottom: 8px; }
.equip-menu button { background: #222; border-radius: 999px; padding: 8px 10px; font-size: 12px; white-space: nowrap; }
.equip-menu button.on { background: var(--lime); color: #111; font-weight: 750; }
.live-list { margin-top: 8px; }
.ex-live { padding: 11px 12px; border-radius: 10px; margin: 0 -8px; }
.ex-live .name { font-weight: 750; font-size: 18px; }
.ex-live .sub { color: #cfcfcf; font-size: 14px; margin-top: 2px; }
.ex-live.now {
  background: linear-gradient(90deg, #3d4a12 0%, #1a1f0c 72%, transparent 100%);
}
.ex-live.now .name { color: var(--lime); }
.ex-live.done { opacity: .4; }
.skip-row { display: flex; gap: 8px; padding: 8px 0 0; }
.skip-row button { color: #d0d0d0; font-size: 15px; font-weight: 700; min-height: 44px; padding: 10px 12px; }

.clock-row {
  bottom: calc(78px + var(--safe-bot));
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}
.clock-row button, .clock-row .set-done, .clock-row .ghost { pointer-events: auto; }
.clock-block { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.phase-label { color: #8d8d8d; font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.phase-label.rest { color: var(--lime); }
.clock {
  font-size: 72px;
  font-weight: 820;
  letter-spacing: -3px;
  font-variant-numeric: tabular-nums;
  line-height: .9;
}
.clock.rest { color: var(--lime); }
.set-done {
  background: var(--lime);
  color: #141414;
  font-weight: 850;
  border-radius: 999px;
  padding: 12px 18px;
  min-height: 44px;
  font-size: 15px;
}
.ghost { color: var(--lime); font-weight: 750; font-size: 14px; }
.round {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px dashed var(--lime);
  background: #2a2a2a;
  display: grid;
  place-items: center;
  pointer-events: auto;
}
.round.off { border-color: #444; color: #888; }
.live-bar {
  bottom: calc(10px + var(--safe-bot));
  width: min(calc(var(--phone) - 20px), calc(100% - 20px));
  background: #1a1a1a;
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.live-bar button { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; font-size: 16px; }
.live-bar .track { color: var(--lime); }

.journal { min-height: 100dvh; }
.j-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(8px + var(--safe-top)) 6px 10px;
}
.j-head button { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 750; color: #ddd; }
.j-head button.on { color: var(--lime); }
.j-card {
  background: #161616;
  border-radius: 18px;
  padding: 14px 12px 12px;
  margin-bottom: 12px;
}
.j-card h3 { margin: 0 0 8px; font-size: 18px; display: flex; gap: 10px; align-items: center; }
.j-tools { display: flex; gap: 8px; overflow: auto; margin: 8px 0 10px; }
.j-tools button, .j-tools span {
  background: #2a2a2a;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  white-space: nowrap;
  color: #eee;
}
.cols, .set-row {
  display: grid;
  grid-template-columns: 42px repeat(4, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}
.cols { color: var(--lime-dim); font-size: 11px; font-weight: 700; padding: 0 2px 6px; }
.cols span:nth-child(1) { color: var(--lime); }
.set-row { margin-bottom: 6px; }
.set-row input { padding: 10px 4px; text-align: center; border-radius: 12px; }
.set-row.on {
  background: var(--olive-2);
  border-radius: 12px;
  padding: 6px 4px;
  box-shadow: inset 3px 0 0 var(--lime);
}
.set-row.on input { background: #1a220e; border-color: #3d4a18; }
.set-row.skipped { opacity: .45; }
.set-no {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.5px solid #666;
  margin: 0 auto;
  font-weight: 750;
}
.set-row.on .set-no { border-color: var(--lime); }
.j-foot {
  bottom: 0;
  padding: 10px 14px calc(12px + var(--safe-bot));
  display: grid;
  grid-template-columns: 44px 1fr 46px;
  gap: 10px;
  align-items: center;
  background: linear-gradient(180deg, rgba(11, 11, 11, 0), #0b0b0b 20%);
}
.j-stat { text-align: center; }
.j-stat .pct { color: #ddd; font-size: 14px; }
.j-stat .reps { color: var(--lime); font-weight: 800; font-size: 18px; }
.note-box { margin-top: 8px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 2px;
  border-bottom: 1px solid #222;
}
.summary-row b { font-weight: 700; }
.summary-row span { color: var(--muted); }

.history { padding: 0 14px 40px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 16px; }
.stat {
  background: #161616;
  border: 1px solid #262626;
  border-radius: 14px;
  padding: 10px 4px;
  text-align: center;
  min-width: 0;
}
.stat b { display: block; font-size: 14px; font-weight: 750; }
.stat b small { font-size: 11px; font-weight: 650; color: #ddd; }
.stat span { color: var(--muted); font-size: 10px; line-height: 1.2; display: block; margin-top: 4px; }
.hist-bar { display: flex; justify-content: space-between; align-items: center; margin: 8px 0; }
.hist-bar h2 { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 8px; }
.unit-btn { color: var(--lime); font-weight: 800; font-size: 16px; }
.link { color: var(--lime); font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--muted); text-align: left; padding: 8px 4px; border-bottom: 1px solid #222; font-weight: 650; }
td { padding: 10px 4px; border-bottom: 1px solid #191919; white-space: nowrap; }
td input { padding: 8px 4px; text-align: center; }
.empty { color: var(--muted); padding: 28px 10px; text-align: center; }

.done { padding: 18vh 22px 40px; text-align: center; }
.done h1 { margin: 8px 0; font-size: 32px; letter-spacing: -.03em; }
.done .big { font-size: 48px; margin: 0; }
.done-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0; text-align: left; }
.done-stats div { background: #161616; border-radius: 14px; padding: 12px; }
.done-stats b { display: block; font-size: 18px; }
.done-stats span { color: var(--muted); font-size: 12px; }

.toast {
  position: fixed;
  top: calc(14px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: var(--lime);
  padding: 10px 14px;
  border-radius: 12px;
  z-index: 40;
  width: max-content;
  max-width: min(360px, calc(100% - 24px));
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}
.confirm-back {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.confirm {
  width: min(var(--phone), 100%);
  background: #161616;
  border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + var(--safe-bot));
}
.confirm h3 { margin: 0 0 8px; }
.confirm p { margin: 0 0 14px; color: #ccc; line-height: 1.4; }
.confirm .row { display: flex; gap: 8px; }
.confirm .row button { flex: 1; border-radius: 999px; padding: 12px; font-weight: 800; background: #2a2a2a; }
.confirm .row .yes { background: var(--lime); color: #141414; }

.muted { color: var(--muted); }
svg { display: block; }
