:root {
  --bg: #0a0a0a;
  --fg: #f4f6fb;
  --muted: #8b93a3;
  --brand: #2563EB;
  --brand-ink: #ffffff;
  --panel: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.1);
  --danger: #ff6b4a;
  --radius: 1.4rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--fg); }
html { background: var(--bg); }
body {
  font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.45;
}

h1, h2, .timer__clock, .done-card__num, .stat__value {
  font-family: Syne, Outfit, sans-serif;
  letter-spacing: -0.04em;
}

h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); line-height: 1.05; margin: 0.4rem 0 0; }
h2 { font-size: 1rem; margin: 0; }
p { margin: 0; }

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brand);
}

.brand-logo {
  display: block;
  width: auto;
  height: 2.35rem;
}
.brand-logo--lg {
  height: 4.4rem;
}
.page.is-live .brand-logo {
  height: 1.85rem;
}

.muted { color: var(--muted); font-size: 0.92rem; }
.lead { color: var(--muted); max-width: 28rem; }
.center { text-align: center; }

.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.shell__body {
  width: min(34rem, 100%);
  margin: 0 auto;
  padding: 2rem 1.25rem 7rem;
  flex: 1;
}

.page { display: flex; flex-direction: column; gap: 1.6rem; }
.page__header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.page__header--stack { flex-direction: column; }

.streak-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--panel);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-weight: 700;
}

.page.is-live .page__header h1,
.page.is-live .page__header #hoy-body {
  display: none;
}
.page.is-live .page__header {
  align-items: center;
}

.session-stage {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.session-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}
.session-media {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.session-media img {
  width: min(100%, 22rem);
  max-height: min(52vh, 22rem);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 1.2rem;
  background: #101510;
  margin: 0 auto;
}

.timer {
  position: relative;
  display: grid;
  place-items: center;
  margin: 0 auto;
}
.timer__ring {
  width: min(72vw, 20rem);
  height: min(72vw, 20rem);
  transform: rotate(-90deg);
}
.timer__track, .timer__progress {
  fill: none;
  stroke-width: 10;
}
.timer__track { stroke: rgba(255,255,255,0.1); }
.timer__progress {
  stroke: var(--brand);
  stroke-linecap: round;
  stroke-dasharray: 816.81;
  stroke-dashoffset: 816.81;
  transition: stroke-dashoffset 0.2s linear;
}
.timer__face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}
.timer__clock {
  font-size: clamp(3.4rem, 14vw, 5rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.done-card {
  border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  border-radius: 2rem;
  padding: 2.4rem 1.5rem;
  text-align: center;
}
.done-card__num {
  font-size: 4.2rem;
  font-weight: 800;
  line-height: 1;
}

.actions { display: flex; flex-direction: column; gap: 0.6rem; }
.actions--split { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  min-height: 2.75rem;
  padding: 0.7rem 1.2rem;
  font-weight: 600;
}
.btn--primary { background: var(--brand); color: var(--brand-ink); }
.btn--ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn--danger { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.btn--block { width: 100%; min-height: 3.5rem; font-size: 1.02rem; }
.btn--sm { min-height: 2.1rem; font-size: 0.85rem; padding: 0.4rem 0.9rem; }
.icon-btn {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font-size: 1.3rem;
  line-height: 1;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1rem;
}
.panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
}

.week, .cal {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}
.week { text-align: center; }
.week__day { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.4rem; }
.dot {
  width: 2.2rem;
  height: 2.2rem;
  margin: 0 auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}
.dot.is-done { background: var(--brand); color: var(--brand-ink); }
.dot.is-today { box-shadow: 0 0 0 2px var(--brand); color: var(--fg); background: transparent; }
.dot.is-future { background: transparent; color: color-mix(in srgb, var(--muted) 50%, transparent); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.stat {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1rem;
}
.stat__value {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.9rem;
  font-weight: 800;
  margin-top: 0.2rem;
}

.cal-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.cal__cell {
  aspect-ratio: 1;
  border-radius: 0.8rem;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}
.cal__cell.is-empty { background: transparent; }
.cal__cell.is-done { background: var(--brand); color: var(--brand-ink); }
.cal__cell.is-today { box-shadow: 0 0 0 2px var(--brand); background: transparent; color: var(--fg); }
.cal__cell.is-future { background: transparent; color: color-mix(in srgb, var(--muted) 40%, transparent); }

.workout-strip, .workout-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.workout-card {
  display: grid;
  grid-template-columns: 5.4rem 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.4rem;
  border-radius: 1rem;
  background: rgba(255,255,255,0.03);
}
.workout-card.is-active {
  outline: 2px solid var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}
.workout-card img {
  width: 100%;
  border-radius: 0.8rem;
  background: #101510;
  aspect-ratio: 1;
  object-fit: cover;
}
.workout-card__name { font-weight: 650; font-size: 0.95rem; }
.featured {
  text-align: center;
  display: grid;
  gap: 0.2rem;
  width: 100%;
}
.featured__phase {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
}
.featured__name {
  font-family: Syne, Outfit, sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
}

.session-stage.is-live .session-media {
  max-width: min(100%, 22rem);
  margin: 0 auto;
}
.session-stage.is-live .timer {
  position: relative;
  z-index: 2;
  margin-top: 0.55rem;
  background: rgba(10, 10, 10, 0.78);
  border-radius: 999px;
  padding: 0.2rem 0.35rem 0.25rem;
}
.session-stage.is-live .timer__ring {
  width: 5.6rem;
  height: 5.6rem;
  transition: width 0.28s ease, height 0.28s ease;
}
.session-stage.is-live .timer__clock {
  font-size: 1.15rem;
  color: var(--fg);
  transition: font-size 0.28s ease, color 0.28s ease;
}
.session-stage.is-live #timer-label {
  font-size: 0.62rem;
  line-height: 1.1;
  max-width: 6.5rem;
}

.session-stage.is-countdown .timer {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}
.session-stage.is-countdown .timer__ring {
  width: min(70vw, 20rem);
  height: min(70vw, 20rem);
}
.session-stage.is-countdown .timer__clock {
  font-size: clamp(4.6rem, 26vw, 7.4rem);
  color: var(--brand);
  text-shadow: 0 0 28px color-mix(in srgb, var(--brand) 50%, transparent);
}
.session-stage.is-countdown #timer-label { display: none; }
.session-stage.is-countdown .session-media img {
  filter: brightness(0.38);
}
.session-stage.is-rest:not(.is-countdown) .session-media img {
  filter: grayscale(0.15) brightness(0.88);
}
.workout-list .workout-card {
  grid-template-columns: 7rem 1fr;
  align-items: start;
}
.steps { margin: 0.4rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.88rem; }

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 34rem;
  margin: 0 auto;
  padding: 0.4rem 0.5rem max(0.5rem, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.45rem 0;
}
.nav__item svg { width: 1.25rem; height: 1.25rem; }
.nav__item.is-active { color: var(--brand); }

.onboarding {
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
}
.onboarding__inner {
  width: min(34rem, 100%);
  margin: 0 auto;
  padding: 2.4rem 1.4rem max(2rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
}
.onboarding h1 { font-size: clamp(2.4rem, 9vw, 3.6rem); max-width: 11ch; }
.rules { list-style: none; padding: 0; margin: 0 0 1.2rem; color: var(--muted); }
.rules li { position: relative; padding-left: 1rem; margin: 0.7rem 0; }
.rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 99px;
  background: var(--brand);
}

.row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.row__title { font-weight: 600; margin-bottom: 0.25rem; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.copy-block { display: flex; flex-direction: column; gap: 0.8rem; color: var(--muted); font-size: 0.95rem; }

.switch { position: relative; display: inline-flex; }
.switch input { position: absolute; opacity: 0; }
.switch__ui {
  width: 2.1rem;
  height: 1.2rem;
  border-radius: 999px;
  background: #3a4038;
  display: block;
  position: relative;
}
.switch__ui::after {
  content: "";
  position: absolute;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 99px;
  background: #fff;
  top: 0.12rem;
  left: 0.12rem;
  transition: transform 0.15s ease;
}
.switch input:checked + .switch__ui { background: var(--brand); }
.switch input:checked + .switch__ui::after { transform: translateX(0.9rem); background: var(--brand-ink); }

.install {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.install__title { font-weight: 700; }
.install__actions { display: flex; gap: 0.4rem; }

.dialog {
  border: 0;
  border-radius: 1.1rem;
  background: #161c17;
  color: var(--fg);
  padding: 1.2rem;
  width: min(22rem, calc(100% - 2rem));
}
.dialog::backdrop { background: rgba(0,0,0,0.55); }
.dialog h2 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.1rem; }

[hidden] { display: none !important; }
