:root {
  --ink: #140f0c;
  --muted: #6b635c;
  --line: #e7e0d8;
  --bg: #f6f1ea;
  --card: #fffcf8;
  --accent: #c45c26;
  --accent-soft: #f3e0d2;
  --ok: #3f6212;
  --ok-soft: #ecfccb;
  --warn: #92400e;
  --warn-soft: #fef3c7;
  --shadow: 0 10px 30px rgba(20, 15, 12, 0.08);
  --radius: 18px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Segoe UI Semibold", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, #f7d9c4 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e8efe0 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  padding-bottom: 88px;
}

button, a { -webkit-tap-highlight-color: transparent; }

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px 0;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.brand {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.brand span { color: var(--accent); }

.date-line {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 6px;
}

.pill {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  box-shadow: var(--shadow);
}

.hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--session, var(--accent));
}
.hero-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}
.hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 4px 0 2px;
  line-height: 1.1;
}
.hero-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  background: var(--accent-soft);
  color: #7c2d12;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}
.progress-wrap {
  margin-top: 14px;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.bar {
  height: 10px;
  background: #efe8df;
  border-radius: 999px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #e08a4d);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.rules {
  display: grid;
  gap: 6px;
  margin: 12px 0 4px;
}
.rule {
  font-size: 0.82rem;
  color: var(--muted);
  padding-left: 14px;
  position: relative;
}
.rule::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  left: 0;
  top: 0.45em;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.card.done {
  opacity: 0.72;
  background: #f3f7ec;
  border-color: #d9e7c2;
}

.ex-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.check {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 2px solid #c4b8aa;
  background: #fff;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  cursor: pointer;
  margin-top: 2px;
}
.check[aria-pressed="true"] {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.check svg { width: 16px; height: 16px; opacity: 0; }
.check[aria-pressed="true"] svg { opacity: 1; }

.ex-name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.ex-sets {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2px;
}
.cue-box {
  margin-top: 12px;
  background: #fff7f0;
  border: 1px solid #f0d5c0;
  border-radius: 14px;
  padding: 12px;
}
.cue-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 4px;
}
.cue-text {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
}
.feel {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}
.feel b { color: var(--ink); }

.elbow-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--ok-soft);
  color: #3f6212;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}

.steps {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}
.step-num {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  margin-top: 1px;
}

.form-img {
  width: 100%;
  border-radius: 14px;
  margin-top: 12px;
  border: 1px solid var(--line);
  display: block;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 800;
  margin: 18px 0 8px;
}

.warmup {
  background: var(--warn-soft);
  border: 1px solid #f6e0a8;
  border-radius: 14px;
  padding: 12px;
  font-size: 0.9rem;
  margin-bottom: 12px;
  line-height: 1.4;
}

.week-list { display: grid; gap: 8px; }
.week-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
}
.week-row.today {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.week-day { font-weight: 800; }
.week-name { color: var(--muted); font-size: 0.88rem; }
.week-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
}

.stack-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.stack-item:last-child { border-bottom: 0; }
.stack-name { font-weight: 800; }
.stack-dose {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  margin-top: 2px;
}
.stack-note { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.dose-input {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

.disclaimer {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 16px 0 24px;
  padding: 12px;
  background: rgba(255,255,255,0.55);
  border-radius: 12px;
  border: 1px dashed var(--line);
}

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 252, 248, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
}
.nav button {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  padding: 8px 4px;
  border-radius: 12px;
  cursor: pointer;
}
.nav button.active {
  color: var(--ink);
  background: var(--accent-soft);
}

.hidden { display: none !important; }

.override {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.override .btn { padding: 8px 12px; font-size: 0.78rem; }

.macro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.macro {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.macro b {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}

@media (min-width: 600px) {
  .app { padding-top: 24px; }
}
