/* The Athlete Rating (SPEC 72 section 4o, training_rating.py): My PRs' rating (the Overall, the band, the four group
   scores, the four drop-downs), the Athlete Ratings board and the public try-it page. Mobile first; the site's colour
   tokens, so light and dark follow the theme. */

.trr { display: grid; gap: 12px; min-width: 0; }
.trr-head { gap: 14px; }
.trr-head-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.trr-title { margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: .02em;
  text-transform: uppercase; line-height: 1.1; }
.trr-honesty { margin: 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--surface-2);
  border-radius: 0 10px 10px 0; font-size: 14px; line-height: 1.5; font-style: italic; }
.trr-gender { display: grid; gap: 8px; padding: 12px; border-radius: 10px; background: var(--accent-soft); }
.trr-gender p { margin: 0; font-weight: 600; }
.trr-gender-picks { display: flex; gap: 8px; flex-wrap: wrap; }

.trr-overall-wrap { display: grid; gap: 6px; }
.trr-overall-box { margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.trr-overall-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.trr-overall { font-family: var(--font-display); font-size: 64px; font-weight: 800; line-height: .95; color: var(--accent-text);
  font-variant-numeric: tabular-nums; }
.trr-of { color: var(--text-2); font-size: 14px; font-weight: 600; }
.trr-band { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.45; }

.trr-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.trr-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 10px; }
.trr-bar-name { font-weight: 700; font-size: 14px; }
.trr-bar-value { font-variant-numeric: tabular-nums; font-size: 16px; }
.trr-bar-track { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.trr-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .25s ease; }
.trr-bar-tested { grid-column: 1 / -1; }
.trr-actions { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.trr-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.trr-private { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.trr-private p { margin: 0; }
.trr-private-go { display: flex; }
.trr.is-live .trr-private-go, .trr.is-live .trr-save, .trr-try-form.is-live .trr-save { display: none; }
.trr-lead { margin: 0; }

@media (min-width: 640px) {
  .trr-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; }
  .trr-head-top, .trr-honesty, .trr-gender, .trr-actions, .trr-private { grid-column: 1 / -1; }
  .trr-overall-wrap { align-content: start; }
}

/* the drop-downs */
.trr-group { background: var(--surface); border-radius: var(--radius); min-width: 0; }
.trr-group-head { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center;
  gap: 2px 12px; padding: 14px 16px; border-radius: var(--radius); }
.trr-group-head::-webkit-details-marker { display: none; }
.trr-group-head:hover { background: var(--hover); }
.trr-group-name { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: .01em; }
.trr-group-score { font-size: 20px; font-variant-numeric: tabular-nums; }
.trr-group-tested { grid-column: 1 / 2; grid-row: 2; font-size: 13px; color: var(--text-2); }
.trr-group-head > .icon { grid-row: 1 / span 2; grid-column: 3; color: var(--text-2); transition: transform .15s; }
.trr-group[open] > .trr-group-head > .icon { transform: rotate(180deg); }
.trr-form { display: grid; gap: 10px; padding: 0 16px 16px; }
.trr-pct-note { margin: 0; }
.trr-rows { list-style: none; margin: 0; padding: 0; display: grid; }
.trr-row { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.trr-row:first-child { border-top: 0; }
.trr-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.trr-name { font-weight: 700; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.trr-tier { flex: none; font-size: 13px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--surface-2);
  color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.trr-tier:not(.trr-t0):not(.trr-t1):not(.trr-none) { background: var(--accent-soft); color: var(--accent-text); }
.trr-tier.trr-t20 { background: var(--accent); color: #fff; }
.trr-tier.trr-none { font-weight: 600; }
.trr-entry { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.trr-box { flex: 0 1 160px; min-width: 110px; }
.trr-box-two { flex: 0 1 300px; display: flex; align-items: center; gap: 8px; }
.trr-box-two .tr-unit-box { flex: 1 1 0; }
.trr-or { color: var(--text-2); font-weight: 700; }
.trr-box input, .trr-add input { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); }
.trr-box .tr-unit-box input { padding-right: 52px; }
.trr-box input:focus, .trr-add input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.trr-box input.trr-clock, .trr-box-two input.trr-clock { max-width: none; font-size: 17px; font-weight: 700; text-align: center;
  font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.trr-box-two input.trr-clock { flex: 1 1 0; min-width: 0; width: 100%; box-sizing: border-box; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); }
.trr-box input[aria-invalid="true"] { border-color: var(--danger-text); }
.trr-scaled { font-size: 14px; }
.trr-when { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.trr-when[hidden] { display: none; }
.trr-when-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.trr-select { display: inline-block; }
.trr-select select { appearance: none; -webkit-appearance: none; font: inherit; font-size: 14px; padding: 6px 28px 6px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); cursor: pointer; }
.trr-select select option { background: var(--surface); color: var(--text); }
.trr-select .icon { right: 8px; }
.trr-meta { margin: 0; display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; font-size: 13px; }
.trr-meta:empty { display: none; }
.trr-logged, .trr-retest { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.trr-retest { background: var(--accent-soft); color: var(--accent-text); }
.trr-next { color: var(--text-2); }
.trr-help { margin: 0; }
.trr-note { margin: 0; font-size: 13px; color: var(--text-2); }
.trr-note.is-error { color: var(--danger-text); font-weight: 600; }
.trr-note .btn { margin-left: 6px; }
.trr-row.is-expired .trr-box input { color: var(--text-2); text-decoration: line-through; text-decoration-thickness: 1px; }
.trr-row.is-saving .trr-tier { opacity: .75; }
.trr-ladder > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-size: 13px;
  font-weight: 600; color: var(--text-2); }
.trr-ladder > summary::-webkit-details-marker { display: none; }
.trr-ladder[open] > summary .icon { transform: rotate(180deg); }
.trr-ladder-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 16px; font-size: 13px; font-variant-numeric: tabular-nums; }
.trr-ladder-list li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 6px; border-radius: 6px; }
.trr-ladder-list li.is-mine { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.trr-ladder-n { color: inherit; }
@media (min-width: 640px) {
  .trr-ladder-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .trr-ladder-list li { flex-direction: column; gap: 0; }
}
.trr-others { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.trr-others-title { margin: 0; font-size: 15px; }
.trr-others > p { margin: 0; }
.trr-add { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; }
.trr-add-fields { display: grid; gap: 10px; }
.trr-add-fields .field { margin: 0; }
.trr-add-fields .btn { justify-self: start; }
@media (min-width: 640px) {
  .trr-add-fields { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: end; }
  .trr-add-fields .trr-when, .trr-add-fields .btn { grid-column: 1 / -1; }
}
.trr-save { display: flex; justify-content: flex-end; }
.trr-how-list { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; line-height: 1.5; }

/* a Training profile's card */
.trr-profile .trr-overall { font-size: 48px; }
.trr-profile .trr-band { font-size: 15px; }
.trr-private-mark { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }

/* the Athlete Ratings board */
.trr-board-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin: -4px; scrollbar-width: none; }
.trr-board-tabs::-webkit-scrollbar { display: none; }
.trr-board-tabs .chip { flex: none; }
.trr-board-list { list-style: none; margin: 0; padding: 0; display: grid; }
.trr-board-row { display: grid; grid-template-columns: 34px 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 6px;
  border-radius: 10px; }
.trr-board-row.is-me { background: var(--accent-soft); }
.trr-board-place { font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.trr-board-who { display: grid; min-width: 0; }
.trr-board-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; }
.trr-board-name:hover { text-decoration: underline; }
.trr-board-sub { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trr-board-value { font-size: 18px; font-variant-numeric: tabular-nums; }
.trr-board-pinned { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; }

/* the public try-it page */
.trr-try { max-width: 760px; margin: 0 auto; display: grid; gap: 16px; }
.trr-try-head { display: grid; gap: 8px; }
.trr-try-head h1 { margin: 0; }
.trr-try-head p { margin: 0; }
.trr-try-picks { display: flex; gap: 16px 24px; flex-wrap: wrap; align-items: center; }
.trr-try-picks fieldset { border: 0; margin: 0; padding: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trr-try-picks legend { float: left; margin-right: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.trr-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.trr-seg label { position: relative; cursor: pointer; }
.trr-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.trr-seg span { display: block; padding: 6px 14px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.trr-seg input:checked + span { background: var(--text); color: var(--bg); }
.trr-seg input:focus-visible + span { box-shadow: inset 0 0 0 2px var(--focus); }
.trr-try-result { display: grid; gap: 8px; }
.trr-try-estimate { margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.trr-try-unlock { display: grid; gap: 10px; justify-items: start; background: var(--accent-soft); }
.trr-try-unlock p { margin: 0; }
.trr-try-unlock { justify-items: stretch; min-width: 0; }
.trr-try-unlock .btn { justify-self: start; max-width: 100%; height: auto; min-height: 38px; padding: 9px 16px;
  white-space: normal; text-align: left; line-height: 1.3; }

/* Touch screens (style.css's "Touch screens", 2026-10-29): the Men / Women and lb / kg switches, a test's "All tiers"
   and Unlock 44 px tall, the share links' 44 px from padding taken back by a negative margin */
@media (pointer: coarse) {
  .trr-seg span { display: grid; place-items: center; min-width: 44px; min-height: 44px; }
  .trr-ladder > summary, .trr-try-unlock .btn { min-height: 44px; }
  .trr-actions .link { display: inline-block; padding-block: 13px; margin-block: -13px; }
}

@media (forced-colors: active) {
  .trr-bar-fill { background: CanvasText; }
  .trr-tier { border: 1px solid CanvasText; }
}
@media (prefers-reduced-motion: reduce) {
  .trr-bar-fill, .trr-group-head > .icon { transition: none; }
}
