:root {
  --bg: #101522;
  --panel: #171d2e;
  --panel-2: #1d2438;
  --border: #232a3d;
  --text: #f7f8fc;
  --muted: #8b93aa;
  --accent: #ff6b8b;
  --accent-ink: #ffb0c1;
  --olive: #8fae5e;
  --blue: #6bb8ff;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 1.75rem 1.5rem 4rem;
}

.back { color: var(--muted); font-size: .8rem; text-decoration: none; }
.back:hover { color: var(--text); }

header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 1000px;
  margin: 0 auto 1.5rem;
}

h1 { font-size: 1.5rem; margin: .4rem 0 .3rem; }
.subtitle { color: var(--muted); font-size: .85rem; }

#week-picker {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: .85rem;
  padding: .55rem .8rem;
}

.progress-section, main {
  max-width: 1000px;
  margin: 0 auto;
}

.empty-state { color: var(--muted); text-align: center; padding: 3rem 1rem; }

.section-title {
  font-size: 1.05rem;
  margin: 1.75rem 0 .8rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.section-title .hint { color: var(--muted); font-size: .78rem; font-weight: 400; }

/* progression chart */
.progress-chart {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.2rem .8rem;
  display: flex;
  align-items: flex-end;
  gap: .4rem;
  overflow-x: auto;
}
.progress-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  flex: 1 0 44px;
  min-width: 44px;
}
.progress-bar-track {
  height: 130px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.progress-bar {
  width: 60%;
  border-radius: 5px 5px 2px 2px;
  background: var(--olive);
  min-height: 3px;
  transition: background .15s;
}
.progress-bar-wrap.active .progress-bar { background: var(--accent); }
.progress-bar-wrap.race .progress-bar { background: var(--blue); }
.progress-bar-km { font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-bar-label { font-size: .62rem; color: var(--muted); text-align: center; line-height: 1.2; }
.progress-bar-wrap.active .progress-bar-label { color: var(--accent-ink); font-weight: 600; }

/* week detail */
.week-meta {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.pill {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .3rem .8rem;
  font-size: .74rem;
  color: var(--muted);
}
.pill.phase { color: var(--accent-ink); border-color: var(--accent); }

.days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .85rem;
}
.day-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.day-card h3 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 0;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.session {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.session .badge {
  align-self: flex-start;
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 999px;
}
.badge.fuerza { background: rgba(107,184,255,.15); color: var(--blue); }
.badge.carrera { background: rgba(143,174,94,.18); color: var(--olive); }
.badge.descanso { background: var(--panel-2); color: var(--muted); }
.session .title { font-weight: 600; font-size: .88rem; }
.session .desc { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.day-card.rest { opacity: .6; }

.notes {
  color: var(--muted);
  font-size: .8rem;
  margin-top: 2rem;
  line-height: 1.6;
  max-width: 70ch;
}
