/* WDHC athlete portal polish (Milo audit 2026-10-03). Scoped, additive. */

/* P1-3: phone video uses the full card width; arrows float over the video instead of eating 80px of gutter */
@media (max-width: 480px) {
  #section-overview #hangVideoCarousel { position: relative; }
  #section-overview #hangVideoCarousel .hang-video-carousel-viewport { flex: 1 1 100%; width: 100%; min-width: 0; }
  #section-overview #hangVideoCarousel .hang-video-carousel-btn {
    position: absolute; top: 38%; z-index: 4; width: 44px; height: 44px;
    background: rgba(0, 0, 0, 0.55); border-radius: 50%;
  }
  #section-overview #hangVideoCarousel .hang-video-carousel-btn.prev { left: 6px; }
  #section-overview #hangVideoCarousel .hang-video-carousel-btn.next { right: 6px; }
}

/* P1-2: skeleton instead of bare "Loading..." text while a slide mounts */
.hang-video-slide-placeholder {
  display: block; min-height: 220px; border-radius: 10px; color: transparent !important; font-size: 0;
  background: linear-gradient(100deg, rgba(255,255,255,0.04) 20%, rgba(255,255,255,0.10) 40%, rgba(255,255,255,0.04) 60%);
  background-size: 200% 100%; animation: wdhcPortalSkel 1.3s linear infinite;
}
@keyframes wdhcPortalSkel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .hang-video-slide-placeholder { animation: none; }
  .featured-hang-aside, .featured-hang-aside * { animation: none !important; transition: none !important; }
}

/* P1-1: highlight clip / full video switch */
.hang-video-clipswitch { display: flex; gap: 6px; justify-content: center; margin: 8px 0 2px; }
.hang-video-clipswitch button {
  min-height: 36px; padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 12px; letter-spacing: .04em;
  background: transparent; color: #d8d8de; border: 1px solid rgba(255,255,255,0.22); cursor: pointer;
}
.hang-video-clipswitch button.is-active { background: #d4af37; color: #0b0b0c; border-color: #d4af37; font-weight: 700; }

/* P1-7: unverified explanation */
.featured-hang-aside-unverified { display: block; flex-basis: 100%; margin-top: 8px; font-size: 12px; line-height: 1.45; color: #b9b9c2; }
.featured-hang-aside-unverified__cta {
  background: none; border: 0; padding: 0; margin-left: 2px; color: #d4af37; font: inherit; text-decoration: underline; cursor: pointer; min-height: 32px;
}

/* P2-5: bigger hit areas without changing how things look */
.hang-video-dot { position: relative; }
.hang-video-dot::after { content: ""; position: absolute; inset: -18px -8px; }
@media (pointer: coarse) {
  .wdhc-unit-btn { min-height: 40px; min-width: 44px; }
  #featuredHangVideoOpen, #featuredHangVideoHistoryBtn, .wdhc-training-coach__chip { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
}

/* P2-4: smallest labels to 12px */
.sidebar-nav-label, .sidebar-qs-meta { font-size: 12px; }

/* LOCK 20261004gripcard1 (audit): Chart.js sizes the Grip Age canvas to the card's full inner height, and the title then pushed the x-axis dates ~23px past the card border. The title now sits in the card's top padding so the canvas (and its dates) end inside the border. Outer card height is unchanged (280px / 360px). */
#section-progress .progress-charts-grid > .chart-container.card.progress-chart-gripage { padding-top: 52px; }
#section-progress .progress-charts-grid > .chart-container.card.progress-chart-gripage > .card-title { position: absolute; top: 14px; left: 16px; right: 16px; margin: 0; }

/* LOCK 20261004resid1 (QA residuals): phone fixes, portal-scoped. Main leaderboard page is not touched. */
@media (max-width: 420px) {
  /* Overview Training Log: date + label on the first line, value under the label (no overlap at 320) */
  .overview-train-log__list li { grid-template-columns: 4.4rem minmax(0, 1fr); row-gap: 2px; }
  .overview-train-log__list li > .overview-train-log__tm { grid-column: 2; white-space: normal; }
}
@media (max-width: 520px) {
  /* Coach chips wrap instead of being cut off */
  .wdhc-training-coach__pill { white-space: normal; max-width: 100%; overflow-wrap: anywhere; border-radius: 16px; line-height: 1.35; }
  /* Portal leaderboard tab: category dropdown gets its own row so its label fits */
  #section-leaderboard .portal-lb-controls { flex-wrap: wrap; }
  #section-leaderboard .portal-lb-select { flex: 1 1 100%; min-width: 0; max-width: 100%; text-overflow: ellipsis; font-size: 13px; letter-spacing: .04em; }
}

/* Weekly Submissions card: same fix as the Grip Age card. Title in the top padding so the chart and its week labels end inside the border (card height unchanged). */
#section-progress .progress-charts-grid > .chart-container.card.progress-chart-streak { padding-top: 52px; position: relative; }
#section-progress .progress-charts-grid > .chart-container.card.progress-chart-streak > .card-title { position: absolute; top: 14px; left: 16px; right: 16px; margin: 0; }
#section-progress .progress-charts-grid > .chart-container.card.progress-chart-streak > .streak-chart-wrap { height: 100%; min-height: 0; }

/* 20261004fmt1 - 44px tap targets on phones/tablets (audit #6), Around You YOU tag, board bottom clearance */
.overview-around-you__you { font-style: normal; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; margin-left: 8px; padding: 2px 7px; border-radius: 999px; border: 1px solid rgba(245,166,35,.65); color: #f5a623; vertical-align: middle; }
@media (max-width: 768px) {
  .mobile-logo { display: inline-flex; align-items: center; min-height: 44px; }
  .sidebar-profile-avatar { min-width: 44px; min-height: 44px; }
  #featuredHangVideoOpen, #featuredHangVideoHistoryBtn, .chart-btn, .achievement-filter-btn, .tl-filter-select, .tl-action-btn, .tl-export-link, .ach-share-btn, #portalLbSearch, .portal-lb-select, .portal-lb-controls button {
    min-height: 44px !important; height: auto !important;
  }
  .chart-btn, .achievement-filter-btn, .ach-share-btn, .tl-action-btn { min-width: 44px; }
  .overview-around-you__link, .overview-month-challenges__link, .overview-month-top3__link, .tl-export-link {
    display: inline-flex; align-items: center; min-height: 44px;
  }
  #section-overview a:not([class]), #section-your-gym a:not([class]), #section-settings a:not([class]),
  #section-training-log a:not([class]), #section-monthly-challenges a:not([class]), #section-progress a:not([class]) {
    display: inline-block; padding: 13px 0; margin: -13px 0;
  }
  #section-settings summary { min-height: 44px; display: flex; align-items: center; }
  #section-leaderboard { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  #section-overview .featured-hang-video-actions .btn-sm, #section-overview .featured-hang-video-actions a, #section-overview .featured-hang-video-actions button { min-height: 44px !important; height: auto !important; padding-top: 10px; padding-bottom: 10px; }
  a#featuredHangVideoOpen.btn-sm.btn-outline, button#featuredHangVideoHistoryBtn.btn-sm.btn-ghost { min-height: 44px !important; height: auto !important; }
}

/* ===== Batch 3 (20261004 b3) ===== */
/* #13 single number font on portal leaderboard: Oswald for every figure (rank, time, grip age, counts) */
#section-leaderboard .portal-rank-row__rank,
#section-leaderboard .portal-rank-row__time,
#section-leaderboard .portal-rank-row__substat,
#section-leaderboard .mono {
  font-family: 'Oswald', sans-serif !important;
  font-variant-numeric: tabular-nums;
}

/* #20 badge cards: no fake button, locked greyed with "How to earn", 44px Share */
.achievement-card .achievement-earned {
  display: block; margin-top: 10px; font-family: 'Rajdhani', 'Oswald', sans-serif; font-weight: 700;
  font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; color: #d9c27a;
}
.achievement-card .achievement-sub {
  font-family: 'Oswald', sans-serif; font-size: 0.82rem; letter-spacing: 0.06em; color: #b8b8b8; margin: -2px 0 6px;
}
.achievement-card.achievement-card--tier .achievement-name {
  text-transform: uppercase; letter-spacing: 0.08em; color: #FFE566;
}
.achievement-card.achievement-card--tier .tier-badge { display: none; }
.achievement-card.locked { opacity: 1; }
.achievement-card.locked .achievement-icon { filter: grayscale(1) brightness(0.55); }
.achievement-card.locked .achievement-name,
.achievement-card.locked .achievement-sub,
.achievement-card.locked .achievement-hang-type { color: #8a8a8a !important; }
.achievement-card .achievement-howto {
  display: block; margin: 10px auto 0; max-width: 220px; font-size: 0.8rem; line-height: 1.4; color: #b4b4b4;
}
.achievement-card .achievement-howto strong {
  display: block; font-family: 'Rajdhani', 'Oswald', sans-serif; font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: #d4af37; margin-bottom: 2px;
}
.achievement-card .ach-share-btn { min-height: 44px; min-width: 88px; }

/* #21 video caption above the native controls */
.hang-video-carousel .hang-video-caption {
  position: absolute; left: 50%; transform: translateX(-50%); z-index: 3; max-width: calc(100% - 96px);
  padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.62); color: #FFE566;
  font-family: 'Rajdhani', 'Oswald', sans-serif; font-weight: 700; font-size: 0.66rem; letter-spacing: 0.08em;
  text-transform: uppercase; text-align: center; line-height: 1.25; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; width: max-content; border-radius: 10px; pointer-events: none; transition: opacity 0.2s;
}
.hang-video-carousel .hang-video-caption[hidden] { display: none; }
.hang-video-carousel .hang-video-caption.is-playing { opacity: 0; }

/* #19 five-item phone bottom bar */
.portal-compete-subnav { display: none; }
@media (max-width: 900px) {
  .portal-bottom-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); padding-left: 4px; padding-right: 4px; }
  .portal-bottom-nav__item { font-size: 0.7rem; letter-spacing: 0.04em; padding: 8px 2px; }
  .portal-compete-subnav { display: flex; gap: 8px; margin: 0 0 14px; }
  .portal-compete-subnav a {
    flex: 1 1 0; min-height: 44px; display: flex; align-items: center; justify-content: center; text-align: center;
    border: 1px solid rgba(212, 175, 55, 0.4); border-radius: 999px; color: #c4bfb2; text-decoration: none;
    font-family: 'Rajdhani', 'Oswald', sans-serif; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  }
  .portal-compete-subnav a.is-active { color: #FFE566; background: rgba(212, 175, 55, 0.14); border-color: #d4af37; }
}

/* 20261007portalqa1 (A): compete sub-tab pills stay 44px on every Compete tab. The phone tap-target rule
   (#section-monthly-challenges / #section-your-gym a:not([class])) was stretching the unselected pills to 70px. */
@media (max-width: 900px) {
  #section-leaderboard nav.portal-compete-subnav > a,
  #section-monthly-challenges nav.portal-compete-subnav > a,
  #section-your-gym nav.portal-compete-subnav > a { display: flex; padding: 0; margin: 0; }
}
/* 20261007portalqa1 (L): gym picker text centered to match the centered Train With a Crew card */
#portalJoinGymSelect { text-align: center; text-align-last: center; }

/* 20261007portalqa2: Training Log pending pill (submission still in review) */
.tl-badge.tl-badge-pending { background: rgba(156, 163, 175, 0.14); color: #c9cdd4; border: 1px solid rgba(156, 163, 175, 0.4); }
/* 20261007portalqa2: tier path note when the featured hang is still in review */
#section-overview .hang-path__meta.hang-path__meta--pending { display: block !important; margin-top: 6px; color: #b9b3a3; font-size: 0.82rem; line-height: 1.4; }
/* 20261007portalqa2: "hang under review" card sits right under Welcome back (was below the badges) */
#section-overview > #pendingReviewBanner { order: 1; }
/* 20261007portalqa2: phone badge row shows whole badges (no label cut at the screen edge); swipe for more */
@media (max-width: 480px) {
  #overviewAchievementsStrip .overview-ach-item { width: calc((100% - 24px) / 3); min-width: 0; padding-left: 2px; padding-right: 2px; }
}
/* 20261007portalqa2: calculator prefill note */
.gripage-prefill-hint { display: block; margin-top: 6px; }

/* portalqa2 sweep: calculator result card breathing room */
#portal-gripage-calculator .gripage-result-section.has-result { padding: 16px 0 20px; border-radius: 16px; }
/* portalqa2 sweep: tier pills fit the share-badge chip */
#section-achievements .ach-share-chip .tier-badge--compact { min-width: 0; width: 96px; max-width: 96px; padding: 0 6px 0 10px; justify-content: center; }
/* portalqa2 sweep: training log volume pill keeps m/s lowercase */
.tl-pill .tl-pill-vol { text-transform: none; }
/* portalqa2 sweep: referrals card copy matches sibling cards */
#portalReferralsCard > #portalReferralsCount { font-size: 0.88rem; line-height: 1.6; font-weight: 600; color: #d0d0d0; margin: 0 0 4px; }
#portalReferralsCard > #portalReferralsNote { font-size: 0.88rem; line-height: 1.6; color: #b8b0a0; margin: 0 0 10px; }
#portalReferralsCard > label { display: block; margin-bottom: 6px; }
