/*
  Exercise pages (build/exercises.py). Everything else comes from style.css;
  this only lays out the page and keeps the RepDB animation inside our own
  layout, well under the 70 % of the page its licence allows.
*/
.ex {
  padding-top: 28px;
  padding-bottom: 48px;
}
.crumbs {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.crumbs a {
  color: var(--muted);
}
.ex h1 {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 10px;
}
.ex .lede {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 0 22px;
}
.ex-demo {
  margin: 0 0 28px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}
.ex-demo video {
  display: block;
  width: 100%;
  height: auto;
}
.ex h2 {
  font-size: 1.2rem;
  margin: 0 0 12px;
}
.ex-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 32px;
}
@media (min-width: 640px) {
  .ex-grid {
    grid-template-columns: 3fr 2fr;
  }
}
.ex-steps {
  margin: 0;
  padding-inline-start: 1.3em;
}
.ex-steps li {
  margin-bottom: 10px;
  line-height: 1.55;
}
.ex-steps li::marker {
  color: var(--accent);
  font-weight: 700;
}
.ex-facts {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  align-self: start;
}
.ex-facts dl {
  margin: 0;
}
.ex-facts dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--faint);
  margin-top: 10px;
}
.ex-facts dt:first-child {
  margin-top: 0;
}
.ex-facts dd {
  margin: 2px 0 0;
  font-weight: 600;
}
.ex-cta {
  background: var(--accent-muted);
  border-radius: 18px;
  padding: 22px 22px 18px;
  margin-bottom: 32px;
}
.ex-cta p {
  margin: 0 0 16px;
}
.ex-cta .stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.ex-similar ul {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ex-similar li {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
}
.ex-similar a {
  color: var(--text);
  text-decoration: none;
}
[dir='rtl'] .ex-facts dt {
  text-transform: none;
  letter-spacing: 0;
}
.ex-dose {
  margin-bottom: 32px;
}
.ex-dose p {
  color: var(--muted);
  margin: 0 0 14px;
}
.ex-dose table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.ex-dose th,
.ex-dose td {
  text-align: start;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}
.ex-dose thead th {
  font-size: 0.8rem;
  color: var(--faint);
  font-weight: 600;
}
.ex-dose tbody th {
  font-weight: 600;
}
.ex-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}
.ex-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.ex-list a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.lvl {
  color: var(--faint);
  font-size: 0.9rem;
  font-weight: 400;
}
.ex-group h2 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.ex-group h2 a {
  color: var(--text);
}
/* Exercises not published yet: named, not linked, and visibly quieter. */
.ex-similar li:not(:has(a)) {
  color: var(--faint);
  border-style: dashed;
}
.about-sec {
  margin-bottom: 26px;
}
.about-sec h2 {
  margin-bottom: 8px;
}
.about-sec p {
  margin: 0 0 8px;
  line-height: 1.6;
}
/* Workout plans (build/plans.py) */
.plan-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0 0 24px;
}
.plan-facts div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
}
.plan-facts .wide {
  grid-column: 1 / -1;
}
.plan-facts dt {
  font-size: 0.8rem;
  color: var(--faint);
}
.plan-facts dd {
  margin: 2px 0 0;
  font-weight: 600;
}
@media (min-width: 640px) {
  .plan-facts {
    grid-template-columns: repeat(4, 1fr);
  }
}
.plan > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.goal-switch {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 22px;
}
.goal-switch label {
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}
#goal-m:checked ~ .goal-switch label[for='goal-m'],
#goal-f:checked ~ .goal-switch label[for='goal-f'] {
  background: var(--accent);
  color: var(--on-accent);
}
#goal-m:focus-visible ~ .goal-switch label[for='goal-m'],
#goal-f:focus-visible ~ .goal-switch label[for='goal-f'] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.plan .gf {
  display: none;
}
#goal-f:checked ~ .plan-day .gm {
  display: none;
}
#goal-f:checked ~ .plan-day .gf {
  display: inline;
}
.plan-week ul {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}
.plan-week li {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.plan-week .wd {
  width: 5.5em;
  color: var(--faint);
}
.plan-day {
  margin-bottom: 26px;
}
.plan-day h3 {
  margin: 0 0 10px;
}
.plan-day .same {
  color: var(--muted);
  margin: 0;
}
.plan-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.plan-table th,
.plan-table td {
  text-align: start;
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.plan-table thead th {
  font-size: 0.8rem;
  color: var(--faint);
  font-weight: 600;
}
.plan-table tbody th {
  font-weight: 600;
}
.plan-table tbody th a {
  color: var(--text);
}
.plan-table td {
  white-space: nowrap;
}
ul.plain {
  margin: 0;
  padding-inline-start: 1.2em;
  line-height: 1.6;
}
ul.plain-links {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}
ul.plain-links li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
ul.plain-links a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.plan-faq {
  margin-bottom: 28px;
}
.plan-faq details {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.plan-faq summary {
  font-weight: 600;
  cursor: pointer;
}
.plan-faq p {
  margin: 8px 0 0;
  color: var(--muted);
}
/* Comparisons (build/compare.py) */
.cmp {
  width: 100%;
  border-collapse: collapse;
}
.cmp th,
.cmp td {
  text-align: start;
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.cmp thead th {
  font-size: 0.8rem;
  color: var(--faint);
}
.cmp tbody th {
  font-weight: 600;
  width: 34%;
}
.cmp .ok {
  color: var(--accent);
  font-weight: 700;
}
.cmp .no {
  color: var(--faint);
  font-weight: 700;
}
.cmp-pick {
  display: grid;
  gap: 18px;
  margin-bottom: 28px;
}
@media (min-width: 640px) {
  .cmp-pick {
    grid-template-columns: 1fr 1fr;
  }
}
.cmp-pick section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 18px;
}
.cmp-pick h2 {
  font-size: 1.05rem;
  margin: 0 0 8px;
}
.sources a {
  color: var(--muted);
}
/* ---------------------------------------------------------------- design pass (27 Oct 2026) */

/* The app's equipment drawings: white line art, tinted like the app does. */
.eq-icon {
  display: inline-block;
  width: 40px;
  height: 40px;
  background: var(--accent);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  flex: none;
}
.eq-icons {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.eq-icons .eq-icon {
  width: 30px;
  height: 30px;
}

/* Get-the-app box: Grasp beside his bubble. */
.ex-cta {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  background: linear-gradient(135deg, var(--surface), var(--accent-muted));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px 20px 20px;
  margin-bottom: 32px;
  overflow: hidden;
}
.cta-grasp {
  width: 118px;
  height: auto;
  flex: none;
  margin-bottom: -20px;
}
.cta-body {
  flex: 1;
  min-width: 0;
}
.ex-cta .hero-bubble {
  margin: 0 0 10px;
  font-size: 1.15rem;
}
[dir='rtl'] .ex-cta .hero-bubble {
  border-end-end-radius: 18px;
  border-end-start-radius: 4px;
}
.ex-cta p {
  margin: 0 0 14px;
}
@media (max-width: 420px) {
  .cta-grasp {
    width: 92px;
  }
}

/* Plan header */
.plan-hero {
  position: relative;
  background: radial-gradient(120% 140% at 100% 0%, var(--glow), transparent 60%), var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px 20px 18px;
  margin-bottom: 18px;
}
.plan-hero h1 {
  margin-top: 6px;
}
.plan-hero .lede {
  margin-bottom: 0;
}
.hero-gear {
  display: flex;
  gap: 10px;
}
.hero-gear .eq-icon {
  width: 46px;
  height: 46px;
}

/* Days */
.plan-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px 14px 6px;
  margin-bottom: 16px;
}
.plan-day.repeat {
  padding-bottom: 14px;
}
.day-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.day-head h3 {
  margin: 0;
  flex: 1;
  font-size: 1.05rem;
}
.day-num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  flex: none;
}
.day-min {
  color: var(--faint);
  font-size: 0.85rem;
  white-space: nowrap;
}
.plan-day .same {
  margin: 0 0 0 40px;
}
[dir='rtl'] .plan-day .same {
  margin: 0 40px 0 0;
}
.plan-table tbody tr:last-child th,
.plan-table tbody tr:last-child td {
  border-bottom: 0;
}
.ex-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ex-thumb {
  width: 72px;
  height: 33px;
  border-radius: 8px;
  background: #16181b;
  object-fit: cover;
  flex: none;
}
@media (max-width: 480px) {
  .ex-thumb {
    width: 56px;
    height: 26px;
  }
  .plan-table th,
  .plan-table td {
    padding: 9px 4px;
    font-size: 0.95rem;
  }
}

/* Plans hub: a card per setup */
.setup-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  margin-bottom: 16px;
}
.setup-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.setup-head h2 {
  margin: 0;
}
/* The whole card opens the easiest plan; the day buttons sit above it. */
.setup-link {
  color: inherit;
  text-decoration: none;
}
.setup-link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.setup-card:hover {
  border-color: var(--accent);
}
.setup-pick {
  margin: 0 0 8px;
  color: var(--faint);
  font-size: 0.9rem;
}
.plan-tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.plan-tiles a {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
  padding: 10px 6px;
  border: 1.5px solid var(--accent);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.plan-tiles a::after {
  content: '→';
  position: absolute;
  top: 6px;
  inset-inline-end: 9px;
  color: var(--accent);
  font-size: 0.85rem;
}
[dir='rtl'] .plan-tiles a::after {
  content: '←';
}
.plan-tiles a:hover {
  background: var(--accent-soft, transparent);
}
.plan-tiles b {
  font-size: 1.3rem;
  margin-inline-end: 4px;
}
.plan-tiles small {
  display: block;
  color: var(--faint);
  font-weight: 400;
}
/* Comparisons: logos, all-apps table */
.app-logo {
  border-radius: 22%;
  vertical-align: middle;
  flex: none;
}
.cmp-hero {
  background: radial-gradient(120% 140% at 100% 0%, var(--glow), transparent 60%), var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px 20px 16px;
  margin-bottom: 22px;
}
.cmp-hero .vs {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--faint);
}
.cmp-hero h1 {
  margin-top: 12px;
}
.cmp thead th {
  white-space: nowrap;
}
.cmp thead .app-logo {
  margin-inline-end: 4px;
}
.table-scroll {
  overflow-x: auto;
  margin: 0 -4px;
}
.cmp-all {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}
.cmp-all th,
.cmp-all td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.cmp-all thead th {
  font-size: 0.78rem;
  color: var(--faint);
  font-weight: 600;
}
.cmp-all tbody th {
  text-align: start;
  position: sticky;
  inset-inline-start: 0;
  background: var(--bg);
  min-width: 150px;
}
.cmp-all tr.me th,
.cmp-all tr.me td {
  background: var(--accent-muted);
}
.app-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-cell a {
  color: var(--text);
}
.app-cell small {
  display: block;
  color: var(--faint);
  font-weight: 400;
  font-size: 0.78rem;
}
.sym {
  font-weight: 700;
}
.sym.ok {
  color: var(--accent);
}
.sym.paid {
  color: #c98a00;
}
.sym.no,
.sym.unk,
.sym.part {
  color: var(--faint);
}
.best-list,
.vs-cards {
  list-style: none;
  margin: 0;
  padding: 0;
}
.best-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.vs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.vs-cards a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  color: var(--text);
  text-decoration: none;
}
.vs-cards a span {
  color: var(--faint);
  font-size: 0.85rem;
}
.vs-cards b {
  margin-inline-start: 4px;
}
/* Bigger, cropped exercise thumbnails in plan tables */
.ex-thumb {
  width: 46px;
  height: 46px;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
}
@media (max-width: 480px) {
  .ex-thumb {
    width: 40px;
    height: 40px;
  }
}

/* Exercise page: the plans that use it */
.used-in { margin-bottom: 28px; }
.used-in a { display: flex; align-items: center; gap: 10px; }
.used-in .eq-icons { margin: 0; }
.used-in .eq-icon { width: 26px; height: 26px; }

/* ---------------------------------------------------------------- plan page v2 (mobile first) */
.plan-hero .hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0 0;
}
.hero-stats div {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
}
.hero-stats dt {
  font-size: 0.75rem;
  color: var(--faint);
}
.hero-stats dd {
  margin: 2px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
}

/* goal switch: full width and stuck to the top while you scroll the days */
.goal-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  margin-bottom: 8px;
  background: var(--bg);
}
.goal-q {
  font-size: 0.85rem;
  color: var(--faint);
  white-space: nowrap;
}
.goal-bar .goal-switch {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
}
.goal-bar .goal-switch label {
  text-align: center;
  padding: 9px 8px;
}

/* the week as seven days */
.week-strip {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.week-strip li {
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
  min-height: 74px;
}
.week-strip li > a,
.week-strip li {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  padding: 7px 2px;
  color: var(--faint);
  text-decoration: none;
}
.week-strip li.on {
  padding: 0;
  border-color: transparent;
  background: var(--accent);
}
.week-strip li.on a {
  width: 100%;
  height: 100%;
  color: var(--on-accent);
}
.week-strip .wd {
  font-size: 0.7rem;
  opacity: 0.85;
}
.week-strip b {
  font-size: 1.1rem;
  line-height: 1.2;
}
.week-strip .lb {
  font-size: 0.62rem;
  line-height: 1.15;
}

/* a day: numbered exercise cards, not a cramped table */
.plan-day {
  padding: 14px 12px 4px;
}
.day-head {
  align-items: flex-start;
}
.day-head > div {
  flex: 1;
}
.day-head h3 {
  font-size: 1.08rem;
}
.day-head .day-min {
  display: block;
  margin-top: 2px;
}
.exr-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}
.exr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.exr-img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: #16181b;
  flex: none;
}
.exr-draw {
  display: grid;
  place-items: center;
}
.exr-draw .eq-icon {
  width: 34px;
  height: 34px;
}
.exr-main {
  flex: 1;
  min-width: 0;
}
.exr-name {
  display: block;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
}
a.exr-name::after {
  content: ' ›';
  color: var(--faint);
}
[dir='rtl'] a.exr-name::after {
  content: ' ‹';
}
.exr-meta {
  display: block;
  margin-top: 3px;
  font-size: 0.88rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.exr-n {
  color: var(--faint);
  font-size: 0.8rem;
  font-weight: 700;
  width: 1.4em;
  text-align: center;
  flex: none;
}
.plan-day.repeat .same {
  display: inline-block;
  margin: 2px 0 12px 40px;
  color: var(--muted);
}
[dir='rtl'] .plan-day.repeat .same {
  margin: 2px 40px 12px 0;
}
.plan .gm,
#goal-f:checked ~ .plan-day .gf {
  display: inline;
}
.plan .gf,
#goal-f:checked ~ .plan-day .gm {
  display: none;
}

/* how to progress: three steps */
.plan-steps {
  margin: 8px 0 28px;
}
.plan-steps ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.plan-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
}
.plan-steps p {
  margin: 0;
}
.step-n {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  flex: none;
}

/* related plans: cards you can swipe */
.rel-cards {
  list-style: none;
  margin: 0 -16px 28px;
  padding: 2px 16px 8px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.rel-cards li {
  flex: 0 0 168px;
  scroll-snap-align: start;
}
.rel-cards a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text);
  text-decoration: none;
}
.rel-cards a:hover {
  border-color: var(--accent);
}
.rel-cards span:last-child {
  color: var(--faint);
  font-size: 0.85rem;
}

/* a bar at the bottom of the phone screen: the one thing to do next */
.sticky-cta {
  display: none;
}
@media (max-width: 720px) {
  body.exercise:has(.sticky-cta) {
    padding-bottom: 76px;
  }
  .sticky-cta {
    position: fixed;
    inset-inline: 10px;
    bottom: 10px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 9px 9px 12px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    color: var(--text);
    text-decoration: none;
  }
  .sticky-cta img {
    border-radius: 9px;
  }
  .sticky-cta span {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.25;
  }
  .sticky-cta b {
    background: var(--accent);
    color: var(--on-accent);
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 0.88rem;
    white-space: nowrap;
  }
}

/* simple plans: training days under the stats */
.train-on {
  margin: 12px 0 0;
  font-weight: 600;
}
.train-on span {
  color: var(--faint);
  font-weight: 400;
  margin-inline-end: 6px;
}
