/* ==========================================================================
   Shoe rotation (owner 2026-10-17), js/shoe-rotation.js:
   - run page "Shoe choice": which of the runner's shoes suited this run;
   - Dashboard "Next run": pick the type of the next run, see the shoe to wear.
   A verdict line on top (the section's headline), then shoe tiles (.ri-tile--glow
   in the verdict's colour: green good, amber "worn the day before" / wrong job),
   each with its reasons as .ri-tag and a dot per day of the last week in it.
   ========================================================================== */
.rot-verdict { display: flex; align-items: center; gap: var(--ri-space-3, 12px); margin: 0 0 var(--ri-space-5, 20px); }
.rot-verdict-icon {
  --_v-rgb: var(--rot-verdict-rgb, 46, 209, 244);
  display: inline-grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, rgba(var(--_v-rgb), .26), rgba(var(--_v-rgb), .08) 70%);
  box-shadow: inset 0 0 0 1px rgba(var(--_v-rgb), .55), 0 0 14px rgba(var(--_v-rgb), .28);
  color: rgb(var(--_v-rgb));
}
.rot-verdict-icon .run-it-icon { width: 18px; height: 18px; --icon-muted: rgb(var(--_v-rgb)); --icon-accent: #fff; }
.rot-verdict-copy { display: grid; gap: 2px; min-width: 0; }
.rot-verdict-title { margin: 0; color: #fff; font-size: 22px; font-weight: var(--ri-weight-light, 300); line-height: 1.25; }
.rot-verdict-sub { margin: 0; color: var(--ri-text-muted); font-size: var(--ri-text-caption, 13px); line-height: 1.4; }
.rot-verdict--good { --rot-verdict-rgb: 52, 211, 153; }
.rot-verdict--warn { --rot-verdict-rgb: 251, 191, 36; }

/* The tile colour glides when a tile becomes the pick (or stops being it) while the advice changes
   under it (Next run, owner 2026-10-18: "it needs to be SMOOTH"). */
@property --rot-tile-color {
  syntax: "<color>";
  inherits: false;
  initial-value: rgb(46, 209, 244);
}
.rot-tiles { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ri-space-4, 16px); }
.rot-tile { --tile-color: var(--rot-tile-color); position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 18px 20px 16px; border-radius: var(--ri-radius-md, 12px); }
.rot-tile.ri-tile--glow { transition: var(--_tile-out), --rot-tile-color 480ms ease; }
.rot-tile.ri-tile--glow.is-selected { transition: var(--_tile-in), --rot-tile-color 480ms ease; }
.rot-tile-label { min-height: 16px; margin: 0; color: var(--ri-text-faint); font-size: var(--ri-text-caption, 13px); line-height: 16px; }
.rot-tile.is-selected .rot-tile-label { color: rgba(255, 255, 255, .86); }
.rot-shoe { display: flex; align-items: center; gap: 14px; min-width: 0; }
.rot-photo { position: relative; isolation: isolate; display: grid; flex: none; place-items: center; width: 92px; height: 62px; }
/* The soft white floor glow under every shoe photo (as on the Biomechanics shoe tiles). */
.rot-photo::after { content: ''; position: absolute; top: 58%; right: 4%; left: 4%; z-index: 0; height: 28%; border-radius: 50%; background: radial-gradient(ellipse at 50% 45%, rgba(214, 222, 236, .17) 0%, rgba(214, 222, 236, .07) 38%, transparent 70%); filter: blur(3px); pointer-events: none; }
.rot-photo img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45)); opacity: 0; transition: opacity .32s ease; }
.rot-photo img.is-ready { opacity: 1; }
/* No photo: the app's question mark, as on the other shoe photos. */
.rot-photo-empty { position: relative; z-index: 1; display: none; place-items: center; color: var(--ri-text-disabled, rgba(255, 255, 255, .38)); font-size: var(--ri-text-metric-lg, 24px); font-weight: var(--ri-weight-semibold, 600); line-height: 1; }
.rot-photo[data-image-state="failed"] img { display: none; }
.rot-photo[data-image-state="failed"] .rot-photo-empty { display: grid; }
.rot-name { display: grid; gap: 2px; min-width: 0; }
.rot-brand { overflow: hidden; color: var(--ri-text-faint); font-size: var(--ri-text-caption, 13px); line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
/* A long model name ("FuelCell SuperComp Elite v4") takes a second line before it is cut. */
.rot-model { display: -webkit-box; overflow: hidden; color: #fff; font-size: 18px; font-weight: var(--ri-weight-light, 300); line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.rot-km { color: var(--ri-text-faint); font-size: 12px; line-height: 16px; white-space: nowrap; }
.rot-reasons { display: flex; flex-wrap: wrap; gap: 8px; min-height: 24px; }

/* Option D (owner 2026-10-17): the why inside the tile. Score, rest and km as level lines; the
   line that decided is lit (cyan edge) in the pick's and the runner-up's tiles. */
.rot-why { display: grid; gap: 2px; margin: 0 -8px; }
.rot-why-row { position: relative; display: grid; grid-template-columns: 104px auto minmax(40px, 1fr); align-items: center; gap: 10px; min-height: 28px; padding: 4px 8px; border-radius: 8px; background-color: transparent; transition: background-color .32s ease; }
.rot-why-row.is-decides { background-color: rgba(46, 209, 244, .09); }
.rot-why-label { color: var(--ri-text-faint); font-size: 12px; line-height: 16px; }
.rot-why-value { color: rgba(255, 255, 255, .86); font-size: 13px; line-height: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; transition: color .32s ease; }
.rot-why-value.is-win { color: #fff; }
.rot-why-value.is-warn { color: #fbbf24; }
.rot-why-bar { display: block; height: 4px; border-radius: 2px; }
.rot-why-bar .ri-level-fill { display: block; height: 100%; border-radius: 2px; transition: width 480ms var(--ri-ease-out, cubic-bezier(0.22, 1, 0.36, 1)); }
.rot-why-rest { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.rot-why-rest i { height: 6px; border-radius: 2px; background-color: rgba(255, 255, 255, .08); box-shadow: 0 0 6px rgba(52, 211, 153, 0); transition: background-color .32s ease, box-shadow .32s ease; }
.rot-why-rest i.on { background-color: #34d399; box-shadow: 0 0 6px rgba(52, 211, 153, .5); }
.rot-week-head.is-decides { background-color: rgba(46, 209, 244, .09); }

/* The last week in this shoe (its recent load): runs and km, then one column per day, the
   newest (this run / today) at the right. */
.rot-week-wrap { display: grid; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .06); }
.rot-week-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 -8px; padding: 4px 8px; border-radius: 8px; background-color: transparent; color: var(--ri-text-faint); font-size: 12px; line-height: 16px; transition: background-color .32s ease; }
.rot-week-head b { color: var(--ri-text-muted); font-weight: var(--ri-weight-regular, 400); white-space: nowrap; }
.rot-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; }
.rot-day { display: grid; justify-items: center; gap: 6px; }
.rot-day b { color: var(--ri-text-faint); font-size: 11px; font-weight: var(--ri-weight-regular, 400); line-height: 12px; }
.rot-day.is-last b { color: rgba(255, 255, 255, .86); }
.rot-dot { display: block; width: var(--dot-size, 7px); height: var(--dot-size, 7px); margin: calc((14px - var(--dot-size, 7px)) / 2) 0; border-radius: 50%; background: rgb(var(--dot-rgb)); box-shadow: 0 0 8px rgba(var(--dot-rgb), .55); }
.rot-dot.is-empty { --dot-size: 4px; background: rgba(255, 255, 255, .16); box-shadow: none; }
.rot-dot.is-this { outline: 1.5px solid rgba(255, 255, 255, .92); outline-offset: 2px; }

/* Skeleton blocks in the tile's own layout, each as tall as what replaces it (the card keeps
   its size when the tiles arrive). */
.rot-tile--skeleton { --rot-tile-color: rgb(46, 209, 244); }
.rot-skel { display: block; border-radius: var(--ri-radius-sm, 8px); }
.rot-skel--label { width: 72px; height: 16px; }
.rot-skel--photo { width: 92px; height: 62px; flex: none; }
.rot-skel--brand { width: 56px; height: 11px; }
.rot-skel--model { width: 110px; height: 18px; }
.rot-skel--tag { width: 96px; height: 24px; border-radius: 999px; }
.rot-skel--row { height: 20px; margin: 4px 8px; }
.rot-skel--week { height: 79px; margin-top: auto; }
.rot-skel--verdict { width: min(320px, 70%); height: 28px; }
.rot-verdict:has(> .rot-skel--verdict) { min-height: 47.5px; }

/* Dashboard "Next run": one control strip (owner 2026-10-18, option B) in the filter-card look of
   My Runs and My Shoes (the dialog surface, ui-components.css "Filter card"): the run type, a thin
   line, how far. Which runs the scores use under it, then the shoe. Round run-type pills in their
   own colours (the Runs page chips; interval amber, long run the app cyan). Phones stack the two
   inside the strip. */
.rot-next-controls {
  display: grid;
  grid-template-columns: auto 1px minmax(0, 1fr);
  align-items: start;
  gap: 0 28px;
  margin: 0 0 10px;
  padding: 16px 22px 14px;
  border: 1px solid var(--ri-border-dialog, rgba(46, 209, 244, 0.2));
  border-radius: var(--ri-radius-lg, 16px);
  background: var(--ri-surface-dialog, var(--ri-surface-overlay, #120F22));
  box-shadow: var(--ri-shadow-overlay, 0 16px 48px rgba(0, 0, 0, 0.5));
}
.rot-next-rule { align-self: stretch; width: 1px; background: rgba(255, 255, 255, .08); }
.rot-next-ask { display: grid; justify-items: start; gap: 10px; min-width: 0; }
.rot-next-ask > span { color: var(--ri-text-faint); font-size: var(--ri-text-caption, 13px); line-height: 18px; }
.rot-type.ri-btn--interval { --_sel-1: 253, 224, 71; --_sel-2: 251, 191, 36; --_sel-3: 245, 158, 11; }
/* The Next run distance (owner 2026-10-17): My Shoes' distance slider look, in the app cyan; its
   head line as on My Shoes (the question left, the km right). */
.rot-next-distance { display: grid; gap: 10px 0; min-width: 0; }
.rot-next-distance[hidden] { display: none; }
.rot-distance-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 18px; }
/* The slider sits on the pills' line: a box as tall as a small pill (32 px), the track in its middle. */
.rot-next-distance .rot-distance-slider { height: 32px; }
.rot-next-distance .rot-bands { margin-top: -4px; }
.rot-distance-head > span { color: var(--ri-text-faint); font-size: var(--ri-text-caption, 13px); line-height: 18px; }
/* The bands under the slider, as wide as the km they span; the one in use lit. */
.rot-bands { display: flex; gap: 3px; }
/* Labels only, no bar above them (owner 2026-10-18). */
.rot-band { flex-basis: 0; min-width: 0; padding: 3px 0 0; color: var(--ri-text-faint); font-size: 11px; line-height: 14px; text-align: center; white-space: nowrap; transition: color .32s ease; }
.rot-band.is-on { color: #fff; }
/* Under the strip. One line kept while the scores load; two on phones, where the longer line wraps. */
.rot-distance-scope { min-height: 1.5em; margin: 0 0 var(--ri-space-6, 24px) 2px; color: var(--ri-text-faint); font-size: var(--ri-text-caption, 13px); line-height: 1.5; }
.rot-distance-value { color: #fff; font-size: 15px; font-weight: var(--ri-weight-regular, 400); line-height: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.rot-distance-slider {
  --bar-rgb: 46, 209, 244;
  --slider-fill: 0%;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
@media (pointer: coarse) {
  .rot-distance-slider, .rot-next-distance .rot-distance-slider { height: var(--ri-hit-min, 44px); margin-block: -6px; }
}
.rot-distance-slider:focus { outline: none; }
.rot-distance-slider:focus-visible { outline: 2px solid var(--ri-cyan, #2ED1F4); outline-offset: 4px; border-radius: var(--ri-radius-pill, 999px); }
.rot-distance-slider::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: var(--ri-radius-pill, 999px);
  background: linear-gradient(90deg, rgba(var(--bar-rgb), .06), rgba(var(--bar-rgb), .38)) left center / var(--slider-fill) 100% no-repeat, rgba(0, 0, 0, .32);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .75), inset 0 0 0 1px rgba(255, 255, 255, .05), 0 1px 0 rgba(255, 255, 255, .07);
}
.rot-distance-slider::-moz-range-track {
  height: 12px;
  border-radius: var(--ri-radius-pill, 999px);
  background: linear-gradient(90deg, rgba(var(--bar-rgb), .06), rgba(var(--bar-rgb), .38)) left center / var(--slider-fill) 100% no-repeat, rgba(0, 0, 0, .32);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .75), inset 0 0 0 1px rgba(255, 255, 255, .05), 0 1px 0 rgba(255, 255, 255, .07);
}
.rot-distance-slider::-webkit-slider-thumb {
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  margin-top: -5px;
  border: 2px solid rgba(var(--bar-rgb), .95);
  border-radius: 50%;
  background: #0d1222;
  box-shadow: 0 0 14px rgba(var(--bar-rgb), .4), 0 4px 10px rgba(0, 0, 0, .45);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s ease-out;
  -webkit-appearance: none;
  appearance: none;
}
.rot-distance-slider::-moz-range-thumb {
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(var(--bar-rgb), .95);
  border-radius: 50%;
  background: #0d1222;
  box-shadow: 0 0 14px rgba(var(--bar-rgb), .4), 0 4px 10px rgba(0, 0, 0, .45);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s ease-out;
}
.rot-distance-slider:hover::-webkit-slider-thumb, .rot-distance-slider:active::-webkit-slider-thumb { transform: scale(1.1); }
.rot-distance-slider:hover::-moz-range-thumb, .rot-distance-slider:active::-moz-range-thumb { transform: scale(1.1); }
/* Which runs the Shoe scores came from, under the tiles. */
.rot-scope { margin: var(--ri-space-3, 12px) 0 0; color: var(--ri-text-faint); font-size: var(--ri-text-caption, 13px); }

/* A race asks its distance: a second row of pills under the run types, in the race colour. */
.rot-next-race { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: -8px 0 var(--ri-space-5, 20px); }
.rot-next-race[hidden] { display: none; }
.rot-next-race > span { color: var(--ri-text-faint); font-size: var(--ri-text-caption, 13px); }
.rot-next-panel { position: relative; }
.rot-empty { margin: 0; color: var(--ri-text-muted); font-size: var(--ri-text-body, 15px); }

@media (max-width: 1024px) {
  .rot-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .rot-verdict-title { font-size: 20px; }
  .rot-tiles { grid-template-columns: minmax(0, 1fr); gap: var(--ri-space-3, 12px); }
  .rot-tile { padding: 16px; }
  .rot-next-ask { gap: 8px; }
}
@media (max-width: 640px) {
  .rot-next-controls { grid-template-columns: minmax(0, 1fr); gap: 14px 0; padding: 14px 12px 12px; }
  .rot-next-rule { width: auto; height: 1px; }
  .rot-distance-scope { min-height: 3em; }
  .rot-verdict:has(> .rot-skel--verdict) { min-height: 45px; }
}
/* The five pills stay on one line in the strip down to a 360 px phone. */
@media (max-width: 400px) {
  .rot-next-ask .rot-type { --_btn-px: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .rot-photo img, .rot-why-bar .ri-level-fill, .rot-why-row, .rot-why-rest i, .rot-band, .rot-week-head { transition: none; }
  .rot-tile.ri-tile--glow, .rot-tile.ri-tile--glow.is-selected { transition: box-shadow 240ms linear, opacity 240ms linear; }
  .rot-distance-slider::-webkit-slider-thumb, .rot-distance-slider::-moz-range-thumb { transition: none; }
}
