:root {
  color-scheme: light;
  --bg: #f7f5f0;
  --bg-soft: #fafaf7;
  --surface: rgba(255, 255, 255, 0.8);
  --text: #202124;
  --muted: #6b6b73;
  --soft: #44464f;
  --line: rgba(32, 33, 36, 0.08);
  --line-strong: rgba(32, 33, 36, 0.14);
  --shadow: 0 20px 56px rgba(42, 43, 47, 0.1);
  --radius: 8px;
  --max: 1180px;
  --exercise: #2196F3;
  --danger: #c76f6f;
  --rest: #00BCD4;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background-color: #fafaf7;
  color: #202124;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 14% 0%, rgba(123, 196, 189, 0.22), transparent 30rem),
    radial-gradient(circle at 92% 12%, rgba(139, 92, 246, 0.13), transparent 28rem),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 54%, #f3f0ea 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select { font: inherit; }

a { color: inherit; }

.page {
  width: min(100% - 40px, var(--max));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(32, 33, 36, 0.07);
  background: rgba(250, 250, 247, 0.82);
  backdrop-filter: blur(18px);
}

.nav {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 32px;
  gap: 5px;
}

.brand-mark span {
  display: block;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, #b16cf0, #13bdbd);
}

.brand-mark span:nth-child(1) { width: 30px; }
.brand-mark span:nth-child(2) { width: 20px; }
.brand-mark span:nth-child(3) { width: 26px; }
.brand-mark span:nth-child(4) { width: 12px; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 22px rgba(42, 43, 47, 0.05);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 680;
  text-decoration: none;
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #1976D2, #42A5F5);
  box-shadow: 0 14px 28px rgba(33, 150, 243, 0.18);
  color: #fff;
}

.language-toggle { min-width: 74px; }

.status-chip {
  display: inline-flex;
  min-height: 40px;
  max-width: 220px;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 14px;
  font-weight: 520;
  line-height: 1;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--rest);
  opacity: 0.85;
}

.status-chip span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

main { padding: 36px 0 76px; }

h1,
h2,
h3,
p { margin-top: 0; }

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.ex-hero { padding: 28px 0 24px; }

.ex-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: #1976D2;
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.ex-kicker::before {
  width: 28px;
  height: 1px;
  content: "";
  background: var(--exercise);
}

.ex-hero h1 {
  margin-bottom: 0;
  font-size: clamp(36px, 6vw, 66px);
  line-height: 1;
}

.ex-section {
  margin-top: 12px;
  padding-bottom: 64px;
}

.ex-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.ex-section-head h2 {
  margin-bottom: 4px;
  font-size: clamp(20px, 3vw, 28px);
}

.ex-yesterday { margin-top: 14px; }

.ex-yesterday-label {
  display: block;
  margin-bottom: 8px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 680;
}

.ex-yesterday-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ex-yesterday-chip {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(33, 150, 243, 0.08);
  color: var(--text);
  font-size: 13px;
  font-weight: 560;
}

.ex-yesterday-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ex-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.ex-filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
}

.ex-filter-btn.active {
  background: var(--exercise);
  border-color: var(--exercise);
  color: #fff;
  font-weight: 680;
}

.ex-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.ex-card-head { padding: 18px 18px 0; }

.ex-card-head h3 {
  margin-bottom: 5px;
  font-size: 18px;
}

.ex-card-stats {
  color: var(--text);
  font-size: 14px;
  font-weight: 580;
  margin-bottom: 0;
  line-height: 1.5;
}

.ex-card-breakdown {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.ex-change-up { color: #1976D2; font-weight: 680; }
.ex-change-down { color: var(--danger); font-weight: 680; }

.ex-card-body { padding: 16px 18px 18px; }

.ex-trend-head { margin-bottom: 10px; }

.ex-trend-title,
.ex-detail-title {
  font-size: 11px;
  font-weight: 760;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ex-chart-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.46);
}

.ex-chart {
  display: grid;
  gap: 0;
}

.ex-day-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.ex-day-row:last-child { border-bottom: 0; }

.ex-day-row-empty {
  color: rgba(32, 33, 36, 0.34);
}

.ex-day-label {
  color: var(--soft);
  font-size: 12px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ex-day-bars {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.ex-set-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(44px, auto);
  gap: 8px;
  align-items: center;
}

.ex-set-label {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.ex-set-track {
  height: 16px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(32, 33, 36, 0.07);
}

.ex-set-bar {
  width: var(--w, 0%);
  min-width: 3px;
  height: 100%;
  border-radius: inherit;
  background: var(--color);
}

.ex-set-value {
  color: var(--soft);
  font-size: 11px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.ex-day-total {
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ex-detail-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 18px;
}

.ex-detail-title { margin-bottom: 10px; }

.ex-detail-list { display: grid; gap: 0; }

.ex-detail-row {
  display: grid;
  grid-template-columns: 3.2em 5em 1fr;
  gap: 0 10px;
  align-items: baseline;
  font-size: 13px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}

.ex-detail-row.has-rir {
  grid-template-columns: 3.2em 5em 5.5em 1fr;
}

.ex-detail-row:last-child { border-bottom: 0; }

.ex-detail-setnum {
  color: var(--muted);
  font-weight: 560;
  font-size: 12px;
}

.ex-detail-reps {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 560;
}

.ex-detail-rir,
.ex-detail-int {
  color: var(--muted);
  font-size: 12px;
}

.intensity-hard { color: #E64A19; }
.intensity-easy { color: #558B2F; }

.ex-detail-missing span { color: var(--muted); }

.ex-signin-prompt {
  max-width: 440px;
  margin: 48px auto;
  padding: 32px 28px;
  text-align: center;
}

.ex-signin-prompt h3 { margin-bottom: 10px; }
.ex-signin-prompt p { color: var(--muted); margin: 0; line-height: 1.65; }

.ex-empty {
  padding: 32px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.error { color: var(--danger); }

@media (max-width: 660px) {
  .page { width: min(100% - 28px, var(--max)); }
  .site-header { position: static; }
  .nav,
  .ex-section-head {
    align-items: start;
    flex-direction: column;
  }
  .nav-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .status-chip {
    max-width: 142px;
    padding: 0 12px;
    font-size: 13px;
  }
  .button { flex: 1 1 auto; }
  .ex-card-body { padding: 16px 14px 18px; }
  .ex-day-row {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 10px;
  }
  .ex-day-total {
    grid-column: 2;
    justify-self: start;
  }
  .ex-set-row {
    grid-template-columns: 36px minmax(0, 1fr) minmax(38px, auto);
    gap: 6px;
  }
  .ex-detail-row,
  .ex-detail-row.has-rir {
    grid-template-columns: 3.2em 5em minmax(0, 1fr);
  }
  .ex-detail-row.has-rir .ex-detail-rir {
    grid-column: 2;
    padding-top: 2px;
  }
}

@media (min-width: 900px) {
  .ex-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
