/* uphill.fit - page-specific layout.
   One block per page, appended in page order. Tokens live in app.css, shared
   cards, tables and controls in components.css. */

/* compare */

.capsule {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--strong);
  background: var(--control);
  border: 1px solid var(--hairline);
  border-radius: var(--round);
  padding: 6px 12px;
  cursor: pointer;
}

.capsule:hover {
  border-color: var(--subtle);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.compare-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.compare-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--strong);
}

.compare-scope {
  margin-left: auto;
}

.compare-body {
  display: grid;
  grid-template-columns: minmax(280px, 5fr) minmax(0, 7fr);
  gap: 26px;
  align-items: start;
}

.compare-table th[scope="col"] {
  padding-inline: 0 0;
}

.compare-year {
  font-size: 12px;
  font-weight: 700;
}

.compare-metric {
  font-weight: 500;
  color: var(--text);
}

.compare-pct {
  font-weight: 500;
  opacity: 0.75;
}

.compare-chart {
  min-width: 0;
}

.year-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.year-link:hover {
  color: var(--brand);
}

.planned-row {
  display: flex;
  gap: var(--gap);
  flex-wrap: wrap;
}

.planned-row .card {
  flex: 1 1 280px;
}

/* calendar */

.heat {
  display: grid;
  grid-template-columns: 44px repeat(12, 1fr);
  gap: 5px;
  align-items: center;
}

.heat-month,
.heat-year {
  font-size: 11px;
  color: var(--subtle);
  text-align: center;
}

.heat-year {
  font-size: 12px;
  font-weight: 600;
  color: var(--strong);
  text-align: right;
}

.heat-cell {
  height: 28px;
  border-radius: 9px;
  display: block;
}

.heat-cell:not(.heat-cell--future):hover {
  outline: 1px solid var(--subtle);
}

.heat-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 11px;
  color: var(--subtle);
}

.heat-ramp {
  width: 90px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--tint), var(--brand));
}

.days {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.days-row {
  display: grid;
  grid-template-columns: 44px 1fr 72px;
  gap: 12px;
  align-items: center;
}

.days-year {
  font-size: 13px;
  font-weight: 600;
  color: var(--strong);
}

.days-track {
  height: 12px;
  border-radius: var(--round);
  background: var(--tint);
  overflow: hidden;
}

.days-fill {
  display: block;
  height: 100%;
  border-radius: var(--round);
  transition: width 0.35s ease;
}

.days-value {
  font-size: 12px;
  color: var(--subtle);
  text-align: right;
}

/* gear */

.gear-layout {
  display: flex;
  gap: var(--gap);
  flex-wrap: wrap;
  align-items: flex-start;
}

.gear-table-card {
  flex: 1.7 1 440px;
  min-width: 0;
}

.gear-bars-card {
  flex: 1 1 280px;
}

.gear-last {
  color: var(--subtle);
  font-size: 12px;
}

.gear-bars {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 14px;
}

.gear-bar {
  display: grid;
  grid-template-columns: 104px 1fr 74px;
  gap: 10px;
  align-items: center;
}

.gear-name {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gear-track {
  height: 11px;
  border-radius: var(--round);
  background: var(--tint);
  overflow: hidden;
}

.gear-fill {
  display: block;
  height: 100%;
  border-radius: var(--round);
  background: var(--line);
  transition: width 0.35s ease;
}

.gear-fill.is-current {
  background: var(--accent);
}

.gear-value {
  font-size: 12px;
  color: var(--subtle);
  text-align: right;
}

/* log */

.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.log-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.log-picker .capsule {
  font-size: 14px;
}

.button--off {
  color: var(--subtle);
  cursor: default;
}

.button--off:hover {
  border-color: var(--hairline);
}

.sport {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.log-gear {
  color: var(--subtle);
}

.log-chip {
  font-size: 12px;
  color: var(--subtle);
  background: var(--canvas);
  border: 1px dashed var(--line);
  border-radius: var(--round);
  padding: 4px 12px;
}

@media (max-width: 900px) {
  .compare-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
}

@media (max-width: 720px) {
  .heat {
    grid-template-columns: 34px repeat(12, 1fr);
    gap: 3px;
  }

  .heat-cell {
    height: 20px;
    border-radius: 6px;
  }

  .heat-month {
    font-size: 9px;
  }

  .gear-bar {
    grid-template-columns: 84px 1fr 66px;
  }
}
/* overview */

.ov-top {
  display: flex;
  gap: var(--gap);
  flex-wrap: wrap;
  align-items: stretch;
}

.ov-hero {
  flex: 1.05 1 320px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
}

.ov-mini {
  flex: 1.55 1 430px;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: stretch;
}

.ov-years {
  grid-column: span 2;
}

.hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 6px;
}

.hero-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.hero-menu {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgb(20 21 23 / 0.35);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.hero-streak {
  margin: 2px 6px;
  padding: 8px 14px;
  background: rgb(20 21 23 / 0.4);
  border-radius: var(--round);
  font-size: 12.5px;
  font-weight: 500;
}

.hero-pills {
  margin: 8px 6px 4px;
}

.hero-pills fieldset {
  margin: 0;
  padding: 4px;
  border: 0;
  display: flex;
  gap: 3px;
  width: fit-content;
  background: rgb(20 21 23 / 0.4);
  border-radius: var(--round);
}

.hero-pill {
  cursor: pointer;
  user-select: none;
}

.hero-pill input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.hero-pill span {
  display: block;
  padding: 5px 14px;
  border-radius: var(--round);
  font-size: 12px;
  font-weight: 500;
  color: rgb(255 255 255 / 0.85);
  transition: background var(--speed) ease, color var(--speed) ease;
}

.hero-pill:has(input:checked) span {
  background: #f9f9f9;
  color: #1b1d22;
  font-weight: 600;
}

.hero-range {
  padding: 6px 12px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.hero-range-label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.hero-chip {
  font-size: 11.5px;
  background: rgb(20 21 23 / 0.35);
  border-radius: var(--round);
  padding: 2px 10px;
  white-space: nowrap;
}

.hero-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 130px;
  padding: 10px 12px 4px;
  /* basis auto keeps the 130px height when the card is content-sized (phone),
     grow fills the card when the row stretches it (desktop). */
  flex: 1 1 auto;
}

.hero-bar {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  border-radius: 9px;
  transition: background var(--speed) ease;
}

.hero-bar:hover {
  background: rgb(255 255 255 / 0.14);
}

.hero-bar-fill {
  border-radius: 7px;
  background: rgb(255 255 255 / 0.9);
  min-height: 4px;
  transition: filter var(--speed) ease, height 0.35s ease;
}

.hero-bar:hover .hero-bar-fill {
  filter: brightness(1.12);
}

/* The period still in progress: diagonal warm stripes, never a series colour. */
.hero-bar-fill.is-current {
  background: repeating-linear-gradient(
    -45deg,
    var(--warm) 0 5px,
    color-mix(in srgb, var(--warm) 45%, transparent) 5px 10px
  );
}

/* Every week of the year: thin bars, no labels of their own, one axis row under them. */
.hero-bars--weeks {
  gap: 2px;
}

.hero-bars--weeks .hero-bar {
  border-radius: 3px;
}

.hero-bars--weeks .hero-bar-fill {
  border-radius: 2px;
}

.hero-axis {
  display: flex;
  justify-content: space-between;
  padding: 0 12px 4px;
  font-size: 10px;
  color: rgb(255 255 255 / 0.75);
}

.hero-bar-fill.is-future {
  background: rgb(20 21 23 / 0.25);
  max-height: 4px;
}

.hero-bar-label {
  min-height: 15px;
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  color: rgb(255 255 255 / 0.75);
}

.hero-latest {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 6px 0;
  padding: 8px 12px 10px;
  font-size: 12.5px;
  color: #fff;
  border-top: 1px solid rgb(255 255 255 / 0.25);
}

.hero-latest:hover {
  color: #fff;
  text-decoration: underline;
}

.hero-latest-note {
  opacity: 0.85;
}

.hero-latest-value {
  margin-left: auto;
}

.card--mini h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--strong);
}

.card--mini .card-head {
  margin-bottom: 8px;
}

.mini--stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.mini--stack .card-head {
  align-self: stretch;
}

.ring {
  position: relative;
  width: 112px;
}

.ring svg,
.gauge svg,
.hypno svg {
  width: 100%;
  display: block;
}

.ring-track {
  fill: none;
  stroke: var(--tint);
}

.ring-progress {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dasharray 0.35s ease;
}

.ring-center {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.ring-value {
  font-size: 19px;
  font-weight: 700;
  color: var(--strong);
}

.ring-unit {
  font-size: 10px;
  color: var(--subtle);
}

.ring-bare {
  margin: 0;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hypno {
  position: relative;
}

.hypno-label {
  font-size: 10px;
  fill: var(--subtle);
}

.hypno-grid {
  stroke: var(--hairline);
  stroke-dasharray: 2 5;
}

.hypno-path {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Invisible week columns over the plot; hovering one highlights it and names the week. */
.hypno-weeks {
  position: absolute;
  inset: 0 2% 0 14.67%;
  display: flex;
}

.hypno-week {
  flex: 1;
  border-radius: 4px;
  transition: background var(--speed) ease;
}

.hypno-week:hover {
  background: color-mix(in srgb, var(--subtle) 18%, transparent);
}

.hypno-ticks {
  position: relative;
  height: 15px;
  margin: 2px 0 0;
  font-size: 10.5px;
  color: var(--subtle);
}

.hypno-ticks span {
  position: absolute;
  transform: translateX(-50%);
}

.gauge {
  position: relative;
  width: 118px;
}

.gauge-track {
  fill: none;
  stroke: var(--tint);
  stroke-linecap: round;
}

.gauge-progress {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dasharray 0.35s ease;
}

.gauge-center {
  position: absolute;
  inset: 0;
  margin: 0;
  padding-bottom: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.gauge-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--strong);
}

.mini--fill {
  display: flex;
  flex-direction: column;
}

.strips {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 60px;
  flex: none;
  margin: auto 0 6px;
}

.strip-bar {
  flex: 1;
  border-radius: var(--round);
  background: var(--tint);
  min-height: 3px;
}

.strip-bar--accent {
  background: var(--int4);
}

.strip-bar--warm {
  background: var(--int3);
}

.strip-bar--muted {
  background: var(--int1);
}

.year-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.year-row {
  display: grid;
  grid-template-columns: 44px 1fr 88px 62px;
  gap: 12px;
  align-items: center;
  padding: 2px 4px;
  border-radius: 8px;
  color: var(--text);
}

.year-row:hover {
  background: var(--tint);
  color: var(--text);
}

.year-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--strong);
}

.year-row .pill-bar {
  height: 9px;
  min-width: 0;
}

.year-value {
  font-size: 12px;
  text-align: right;
}

.year-delta {
  font-size: 11.5px;
  font-weight: 600;
  text-align: right;
}

.ov-yoy .card-head {
  margin-bottom: 4px;
  align-items: baseline;
}

.ov-yoy .segmented {
  padding: 3px;
  background: var(--tint);
}

.segmented-inner {
  display: flex;
  gap: 3px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.ov-yoy .segment span {
  font-size: 11.5px;
  padding: 4px 12px;
}

.ov-yoy .caption b {
  color: var(--strong);
}

/* The projection sentence with its pace slider: a view parameter next to what it drives. */
.yoy-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.blend {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--subtle);
  white-space: nowrap;
}

.blend-slider {
  width: 130px;
  accent-color: var(--brand);
}

/* profile */

.pr-top,
.pr-bottom {
  display: flex;
  gap: var(--gap);
  flex-wrap: wrap;
  align-items: stretch;
}

.pr-radar {
  flex: 1 1 300px;
}

.pr-mix {
  flex: 1.4 1 360px;
  display: flex;
  flex-direction: column;
}

.pr-years {
  display: flex;
  gap: 12px;
}

.pr-year {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--subtle);
}

.pr-year::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pr-year--current::before {
  background: var(--brand);
}

.pr-year--previous::before {
  background: var(--year-1);
}

.radar {
  width: 100%;
  max-width: 330px;
  display: block;
  margin: 0 auto;
}

.radar-ring,
.radar-axis {
  fill: none;
  stroke: var(--hairline);
}

.radar-label {
  font-size: 11px;
  font-weight: 600;
  fill: var(--subtle);
}

.radar-shape {
  stroke-width: 2;
  stroke-linejoin: round;
}

.radar-shape--current {
  stroke: var(--brand);
  fill: color-mix(in srgb, var(--brand) 18%, transparent);
}

.radar-shape--previous {
  stroke: var(--year-1);
  fill: color-mix(in srgb, var(--year-1) 14%, transparent);
}

.pr-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--subtle);
}

.pr-share {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pr-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.mix-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  justify-content: center;
  margin-top: 16px;
}

.mix-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
}

.mix-year {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--strong);
}

.mix-bar {
  display: flex;
  height: 16px;
  gap: 2px;
  border-radius: var(--round);
  overflow: hidden;
}

.mix-segment {
  display: block;
  transition: opacity var(--speed) ease, filter var(--speed) ease;
}

.mix-bar:hover .mix-segment:not(:hover) {
  opacity: 0.45;
}

.mix-segment:hover {
  filter: brightness(1.12);
}

.pr-records {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.pr-record-label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--subtle);
}

.pr-record .stat-value {
  margin: 3px 0 1px;
  letter-spacing: -0.02em;
}

.pr-record .stat-value a {
  color: var(--strong);
}

.pr-record .stat-value a:hover {
  color: var(--brand);
}

.pr-record-unit {
  margin-left: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--subtle);
}

.pr-rhythm {
  flex: 1.2 1 340px;
}

.pr-planned {
  flex: 1 1 280px;
}

.rhythm-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 120px;
  margin-top: 14px;
}

.rhythm-column {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
}

.rhythm-fill {
  border-radius: 8px;
  background: var(--tint);
  min-height: 3px;
  transition: filter var(--speed) ease;
}

.rhythm-column:hover .rhythm-fill {
  filter: brightness(1.15);
}

.rhythm-fill.is-weekend {
  background: var(--accent);
}

.rhythm-label {
  font-size: 10.5px;
  color: var(--subtle);
  text-align: center;
}

@media (max-width: 720px) {
  .ov-mini {
    grid-template-columns: minmax(0, 1fr);
  }

  .ov-years {
    grid-column: span 1;
  }

  .year-row {
    grid-template-columns: 38px 1fr 72px 54px;
    gap: 8px;
  }
}
