/* styles.css — visual layer only. No behaviour lives here. */

:root {
  --ink: #13161c;
  --ink-soft: #4b5361;
  --ink-faint: #8a93a3;
  --line: #e3e6eb;
  --line-strong: #cdd2da;
  --surface: #ffffff;
  --surface-sunken: #f6f7f9;
  --banner: #111111;
  --focus: #1f6fb2;
  --drop: #eaf4fc;
  --drop-line: #5aaee6;

  --accent: #8cc8f0;
  --accent-wash: #eaf4fc;
  --accent-strong: #1f6fb2;
  --nav: #111111;

  /* Sport icons are plain black; the card's top bar carries the light blue. */
  --run: #111111;
  --bike: #111111;
  --swim: #111111;
  --strength: #111111;
  --note: #555555;
  --rest: #8a93a3;
  --done-wash: #eaf4fc;
  --danger: #cf3535;

  --col-min: 168px;
  --summary-w: 296px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--surface);
  color: var(--ink);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------- nav --------------------------------- */

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 28px;
  padding: 0 24px;
  min-height: 52px;
  background: var(--nav);
  color: #ffffff;
}

.nav__brand {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.nav__tabs {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  justify-content: center;
  gap: 4px;
}

.nav__tab {
  padding: 8px 16px;
  border-radius: 6px;
  color: #bbbbbb;
  font-weight: 600;
  text-decoration: none;
}

.nav__tab--active { background: #333333; color: #ffffff; font-weight: 700; }
.nav__race { color: #bbbbbb; font-weight: 600; font-size: 13px; }

/* ------------------------------- toolbar ------------------------------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.toolbar h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.toolbar__spacer { flex: 1; }

.toolbar__hint {
  color: var(--ink-faint);
  font-size: 12.5px;
}

.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px;
  padding: 0 16px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover { background: var(--surface-sunken); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn[hidden] { display: none; }

.btn--primary {
  border-color: var(--banner);
  background: var(--banner);
  color: #fff;
}

.btn--primary:hover { background: #27334e; }
.btn:disabled { opacity: 0.55; cursor: wait; }

.account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-actions[hidden] { display: none; }
#account-email { color: var(--ink-soft); font-size: 12px; }
.strava-status { color: var(--ink-faint); font-size: 12px; }

.account-gate {
  min-height: 55vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: var(--surface-sunken);
}

.account-gate[hidden] { display: none; }

.account-card {
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(16, 22, 34, 0.08);
}

.account-card h2 { margin: 0 0 6px; font-size: 21px; }
.account-card > p { margin: 0 0 20px; color: var(--ink-soft); }
.account-card form { display: grid; gap: 8px; }
.account-card label { margin-top: 8px; font-weight: 600; }
.account-card input {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
}
.account-card input:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.account-error { margin: 6px 0 0; color: var(--danger); }
.account-form__actions { display: flex; gap: 10px; margin-top: 12px; }

@media (max-width: 800px) {
  .toolbar { flex-wrap: wrap; }
  .account-actions { width: 100%; flex-wrap: wrap; }
  .toolbar__hint { display: none; }
}

.status {
  min-height: 18px;
  padding: 0 20px 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* ------------------------------- calendar ------------------------------ */

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(var(--col-min), 1fr)) var(--summary-w);
  align-items: start;
  border-top: 1px solid var(--line);
}

.calendar[hidden] { display: none; }

.head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
  color: var(--ink-faint);
}

.head:first-child { border-left: 0; }
.head--summary { text-align: center; }

.head__date { font-weight: 600; color: var(--ink-soft); }

.head__load,
.head__progress {
  margin-top: 2px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  font-size: 11.5px;
  color: var(--ink-faint);
}

.head__progress--all { color: var(--accent-strong); }

.head--today { background: #cfe6f7; }
.day--today { background: #f4f9fd; }

.day {
  min-height: 78vh;
  padding: 8px 8px 40px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day:first-of-type { border-left: 0; }

.day__date {
  font-size: 12px;
  color: var(--ink-faint);
  padding-left: 2px;
}

.day--over {
  background: var(--drop);
  box-shadow: inset 0 0 0 2px var(--drop-line);
  border-radius: 6px;
}

.day__empty {
  margin-top: 4px;
  padding: 14px 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--ink-faint);
  font-size: 12px;
  text-align: center;
}

/* --------------------------------- card -------------------------------- */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(16, 22, 34, 0.06);
  cursor: grab;
  overflow: hidden;
}

.card:active { cursor: grabbing; }
.card:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.card--dragging { opacity: 0.4; }

.card--done { background: var(--done-wash); }

.card--done .card__title {
  text-decoration: line-through;
  text-decoration-color: var(--ink-faint);
  color: var(--ink-soft);
}

.card--done .card__metrics,
.card--done .card__desc,
.card--done .card__exercises,
.card--done .card__sets { opacity: 0.66; }

.card__done-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  padding: 1px 7px 1px 5px;
  border-radius: 99px;
  background: #111111;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.card__done-flag svg { width: 11px; height: 11px; stroke: var(--accent); }

.card--drop-before { box-shadow: 0 -3px 0 0 var(--drop-line); }
.card--drop-after { box-shadow: 0 3px 0 0 var(--drop-line); }

.card__banner {
  height: 5px;
  background: var(--accent);
}

.card__banner--note { background: var(--banner); }
.card__banner--rest { background: #bbbbbb; }

.card__body { padding: 9px 10px 10px; }

.card__top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}

.card__sport {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.card__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}

.card__grip {
  color: var(--line-strong);
  letter-spacing: 1px;
  font-size: 13px;
  line-height: 1;
  padding-left: 1px;
}

/* Revealed on hover or keyboard focus so fifteen cards stay readable. */
.card__action {
  appearance: none;
  width: 21px;
  height: 21px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 90ms linear;
}

.card__action svg { width: 13px; height: 13px; }

.card:hover .card__action,
.card:focus-within .card__action,
.card:focus .card__action,
.card__action:focus-visible {
  opacity: 1;
}

.card__action:hover {
  background: var(--surface-sunken);
  border-color: var(--line);
}

.card__action--done:hover { color: var(--accent-strong); }
.card__action--delete:hover { color: var(--danger); }

.card__action:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

/* A completed card keeps its check visible whether or not you hover it. */
.card__action--done[aria-pressed="true"] {
  opacity: 1;
  color: var(--accent-strong);
}

.icon { width: 17px; height: 17px; flex: none; display: block; }

.card__title {
  margin: 0 0 6px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.1px;
}

.card__metrics {
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.45;
}

.card__metric { display: block; }
.card__metric b { font-weight: 700; }
.card__metric span { color: var(--ink-soft); font-weight: 500; }

.card__sets {
  display: flex;
  gap: 18px;
  margin-bottom: 6px;
  font-size: 13px;
}

.card__sets b { font-weight: 700; }
.card__sets span { color: var(--ink-soft); }

.card__desc {
  margin: 0;
  font-size: 12.8px;
  color: var(--ink-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.card:not(.card--open) .card__desc {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__desc a { color: var(--focus); }

.card__partial {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--ink-faint);
  font-style: italic;
}

.card__exercises {
  list-style: none;
  margin: 7px 0 0;
  padding: 0;
  font-size: 12.8px;
}

.card__exercise {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}

.card__exercise-key {
  width: 19px;
  height: 19px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.card__more {
  margin-top: 5px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.card__chart {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 22px;
  margin: 9px -10px -10px;
  padding: 0 10px 0;
  background: var(--surface-sunken);
}

.card__chart i {
  flex: 1;
  background: var(--line-strong);
  min-height: 3px;
}

.card__bar {
  height: 12px;
  margin: 9px -10px -10px;
  background: var(--surface-sunken);
}

/* ------------------------------- summary ------------------------------- */

.summary {
  padding: 12px 16px 40px;
  border-left: 1px solid var(--line);
}

.summary__tsb {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.summary__tsb div { flex: 1; text-align: center; font-size: 11px; }
.summary__tsb strong { display: block; font-weight: 600; color: var(--ink-faint); }
.summary__tsb em { font-style: normal; font-weight: 700; color: var(--ink-faint); }

.summary__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.summary__row:last-child { border-bottom: 0; }
.summary__row dt { color: var(--ink-soft); }
.summary__row dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary dl { margin: 0; }

.summary__heading {
  margin: 16px 0 2px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.summary__note {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--ink-faint);
}

@media (max-width: 1100px) {
  .calendar { grid-template-columns: repeat(7, minmax(150px, 1fr)) var(--summary-w); }
  :root { --col-min: 150px; }
}

/* ---------------------------- strava activities ------------------------ */

:root {
  --strava: #fc4c02;
  --strava-wash: #fff6f2;
  --strava-line: #ffd9c9;
}

.btn--strava[aria-pressed="true"] {
  border-color: var(--strava);
  color: var(--strava);
}

.activity {
  background: var(--strava-wash);
  border: 1px solid var(--strava-line);
  border-left: 3px solid var(--strava);
  border-radius: 3px;
  padding: 8px 10px 9px;
}

.activity:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.activity__top { display: flex; align-items: center; gap: 6px; }

.activity__source {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--strava);
}

.activity__time { margin-left: auto; font-size: 11.5px; color: var(--ink-faint); }

.activity__title { margin: 4px 0 6px; font-size: 13.5px; font-weight: 600; }

.activity__stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.activity__stat b { font-variant-numeric: tabular-nums; }
.activity__stat span { color: var(--ink-faint); font-size: 11.5px; }

.activity__details,
.activity__where { margin-top: 4px; font-size: 11.5px; color: var(--ink-soft); }

.activity__tags { display: flex; gap: 6px; margin-top: 6px; }

.activity__tag {
  padding: 1px 7px;
  border-radius: 99px;
  background: #fff;
  border: 1px solid var(--strava-line);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.activity__tag--pr { background: var(--strava); border-color: var(--strava); color: #fff; }

.summary__heading--strava { color: var(--strava); }

.activity__match {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--ink-soft);
}

.activity__match b { color: var(--strava); font-variant-numeric: tabular-nums; }

/* ------------------------- edit a planned workout ---------------------- */

.wv__edit-btn {
  padding: 4px 14px;
  border: 1px solid #5a6a8c;
  border-radius: 99px;
  background: transparent;
  color: #dbe2f0;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.wv__edit-btn:hover { background: #2a3550; }
.wv__edit-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.wv__edit { max-width: 560px; display: grid; gap: 14px; }
.wv__edit label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.wv__edit input, .wv__edit textarea {
  font: inherit; font-weight: 400; padding: 8px 10px;
  border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink);
}
.wv__edit input:focus-visible, .wv__edit textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.wv__edit-note { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.wv__edit-error { margin: 0; min-height: 1.2em; font-size: 13px; color: #b3261e; }
.wv__edit-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.wv__edit-actions button { font: inherit; padding: 7px 16px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); cursor: pointer; }
.wv__edit-actions .wv__primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.wv__edit-actions button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ------------------------- merged planned + Strava card ---------------- */

.card--merged { border-left-color: var(--strava); }

.card__actual {
  margin: 6px 0 2px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #fff4ee;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink);
}

.card__actual-label { display: block; font-size: 10.5px; color: var(--strava); font-weight: 600; }
.card__actual b { font-variant-numeric: tabular-nums; }
.card__actual-pct { color: var(--ink-soft); }

.card__unlink {
  display: block;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 11px;
  color: var(--focus);
  text-decoration: underline;
  cursor: pointer;
}

.activity__attach { display: block; margin-top: 6px; font-size: 11px; color: var(--ink-soft); }
.activity__attach select { display: block; width: 100%; margin-top: 2px; font: inherit; font-size: 11.5px; padding: 3px 4px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); }

/* ------------------------- connection banner / demo -------------------- */


.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 20px 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-sunken);
  font-size: 13px;
}

.banner[hidden] { display: none; }
.banner__text { flex: 1; }
.banner__text span { color: var(--ink-soft); }
.banner[data-tone="neutral"] { border-color: var(--strava-line); background: var(--strava-wash); }
.banner[data-tone="error"] { border-color: #f0c2c2; background: #fdf3f3; }
.banner[data-tone="error"] strong { color: var(--danger); }
.banner__action { border-color: var(--strava); color: var(--strava); }

.banner__spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--strava-line);
  border-top-color: var(--strava);
  border-radius: 50%;
  animation: banner-spin 0.8s linear infinite;
}

@keyframes banner-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) { .banner__spinner { animation: none; } }

/* ---------------------------- planned vs actual ------------------------ */

.pva { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.pva__line { display: flex; justify-content: space-between; font-weight: 600; }
.pva__pct { font-variant-numeric: tabular-nums; }
.pva__bar { height: 6px; margin-top: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pva__bar i { display: block; height: 100%; background: var(--strava); }
.pva__nums { margin-top: 3px; font-size: 11.5px; color: var(--ink-soft); }
.pva__flags { color: var(--strava); font-weight: 600; }

/* ------------------------- full-screen workout view -------------------- */

.activity { cursor: pointer; }

body.wv-open { overflow: hidden; }

.wv {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--surface-sunken);
}

.wv[hidden] { display: none; }

.wv__bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: var(--banner);
  color: #fff;
}

.wv__id { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.wv__id .icon { width: 30px; height: 30px; flex: none; background: #fff; border-radius: 6px; padding: 4px; }
.wv__bar h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.2px; }
.wv__sub { margin: 2px 0 0; font-size: 13px; color: #aab3c5; }

.wv__status {
  padding: 3px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  background: #2a3550;
  color: #dbe2f0;
}

.wv__status--completed { background: var(--run); color: #fff; }
.wv__status--strava { background: var(--strava); color: #fff; }

.wv__nav { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #aab3c5; }

.wv__nav button,
.wv__close {
  appearance: none;
  border: 1px solid #3a4666;
  background: transparent;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.wv__nav button:hover,
.wv__close:hover { background: #2a3550; }
.wv__nav button:focus-visible,
.wv__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.wv__body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 20px;
  padding: 20px 24px 32px;
  overflow: auto;
}

.wv__main,
.wv__panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 22px;
}

.wv__main { align-self: start; }
.wv__side { display: flex; flex-direction: column; gap: 16px; align-self: start; }

.wv h3 {
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.wv__main > h3:first-child,
.wv__panel > h3:first-child { margin-top: 0; }

.wv__strava-title { color: var(--strava); }

.wv__linked { margin: 0 0 10px; font-size: 13px; color: var(--ink-soft); }

.wv__table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wv__table th,
.wv__table td { padding: 9px 4px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.wv__table thead th { font-size: 12px; font-weight: 700; color: var(--ink-faint); }
.wv__table tbody th { text-align: left; font-weight: 500; color: var(--ink-soft); }
.wv__table td { font-weight: 700; }
.wv__none { color: var(--ink-faint); font-weight: 400; }
.wv__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.wv__percent { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--ink-soft); }
.wv__percent-bar { flex: 1; max-width: 280px; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.wv__percent-bar i { display: block; height: 100%; background: var(--run); }

.wv__desc { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: var(--ink-soft); }
.wv__desc a { color: var(--focus); }

.wv__sets { margin: 0 0 8px; font-size: 14px; color: var(--ink-soft); }
.wv__exercises { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.wv__exercises li { display: flex; align-items: center; gap: 10px; }
.wv__key { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-sunken); border: 1px solid var(--line); font-size: 11px; font-weight: 700; }
.wv__more { color: var(--ink-faint); }

.wv__panel dl { margin: 0; }
.wv__panel dl div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.wv__panel dt { color: var(--ink-soft); }
.wv__panel dd { margin: 0; font-weight: 700; }
.wv__link { display: inline-block; margin-top: 12px; font-weight: 600; color: var(--strava); }
.wv__panel--soon { background: transparent; border-style: dashed; color: var(--ink-faint); font-size: 13px; }
.wv__panel--soon p { margin: 0; }

@media (max-width: 860px) {
  .wv__body { grid-template-columns: 1fr; }
  .wv__nav span { display: none; }
}

/* ------------------------ activity detail sections --------------------- */

.charts { display: grid; gap: 16px; }

.chart { margin: 0; }
.chart figcaption { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.chart__avg { font-weight: 500; color: var(--ink-soft); }

.chart__plot { position: relative; }
.chart__plot svg { display: block; width: 100%; height: 150px; touch-action: pan-y; }

.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__avgline { stroke: var(--ink-faint); stroke-width: 1; stroke-dasharray: 4 4; }
.chart__line { fill: none; stroke: var(--strava); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart__area { fill: var(--strava-wash); stroke: none; }
.chart__cross { stroke: var(--ink-faint); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart__dot { fill: var(--strava); stroke: var(--surface); stroke-width: 2; }

.chart__y,
.chart__x { position: absolute; font-size: 11px; color: var(--ink-faint); pointer-events: none; }
.chart__y { left: 0; }
.chart__y--top { top: 4px; }
.chart__y--bottom { bottom: 18px; }
.chart__x { bottom: 0; }
.chart__x--start { left: 7%; }
.chart__x--end { right: 0; }

.chart__tip {
  position: absolute;
  top: -2px;
  transform: translateX(8px);
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}

.chart__tip--flip { transform: translateX(calc(-100% - 8px)); }

.chart__data { margin-top: 4px; font-size: 12px; color: var(--ink-soft); }
.chart__data summary { cursor: pointer; }
.chart__data table { margin-top: 6px; border-collapse: collapse; }
.chart__data th,
.chart__data td { padding: 2px 14px 2px 0; text-align: left; font-weight: 400; }

.dtable { overflow-x: auto; max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: 4px; }
.dtable table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dtable th,
.dtable td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtable thead th { position: sticky; top: 0; background: var(--surface-sunken); font-size: 11.5px; color: var(--ink-faint); }
.dtable tbody th { text-align: left; font-weight: 500; white-space: normal; }
.dtable thead th:first-child { text-align: left; }

.tag--pr { display: inline-block; padding: 0 6px; border-radius: 99px; background: var(--strava); color: #fff; font-size: 10.5px; font-weight: 700; }

.zones { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.zones__line { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.zones__range { color: var(--ink-faint); font-size: 11.5px; }
.zones__bar { height: 6px; margin-top: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.zones__bar i { display: block; height: 100%; background: var(--strava); }

.chart__cross[hidden],
.chart__dot[hidden] { display: none; }

/* ------------------------------ friends menu --------------------------- */

.nav__who { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; margin-right: 1.25rem; color: #bbbbbb; font-size: 13px; }
.nav__who select { font: inherit; padding: 4px 8px; border: 1px solid #444444; border-radius: 6px; background: #1c1c1c; color: #ffffff; }
.nav__who select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------- week switcher ---------------------------- */

.weeknav { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; }
.weeknav__arrow { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 1.1rem; line-height: 1; }
.weeknav__arrow:hover { background: var(--surface-sunken); }
.weeknav__arrow--off { opacity: 0.35; }
.weeknav__name { color: var(--ink-soft); }
.weeknav__link { color: var(--accent-strong); font-weight: 600; }
.weeknav a:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
