/*
 * Hero Hub shell: one top bar and a bottom bar on phones and tablets, the simplified menu on a computer, the account
 * menu behind the avatar, page titles and the tabs shared by Training (My Workouts, Programs, History).
 * Loaded after dashboard-redesign.css on every Hero Hub page.
 */

/* --hub-tabbar-h: the floating bottom bar plus its gap above the screen edge (room kept under the last card). */
.dash-body { --hub-tabbar-h: 80px; --hub-gutter: 16px; }

/* Free and Pro only content: hidden until the membership is known, so nobody sees the wrong offer flash. */
html:not(.membership-free) .hub-free-only { display: none !important; }
html:not(.membership-pro) .hub-pro-only { display: none !important; }

/* ── Computer: the menu beside the page ───────────────────────────── */
.dash-side-bottom > a.hub-side-pro, .hub-side-pro {
  display: grid; align-items: start; justify-items: start; gap: 4px; margin-top: 18px; padding: 14px 14px 13px; text-align: left;
  border: 3px solid var(--cw-ink); border-radius: 0; color: var(--cw-navy); background: var(--cw-bg); text-decoration: none;
}
.dash-side-bottom > a.hub-side-pro:hover { color: var(--cw-navy); background: var(--cw-blue-soft); }
.hub-side-pro__icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 4px; border: 2px solid var(--cw-ink); border-radius: 50%; background: var(--cw-surface); }
.hub-side-pro__icon svg { width: 18px; height: 18px; }
.hub-side-pro strong { font-size: .95rem; font-weight: 900; text-transform: uppercase; }
.hub-side-pro small { color: var(--cw-muted); font-size: .78rem; font-weight: 500; line-height: 1.35; }
.hub-side-pro b { margin-top: 6px; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-decoration: underline 2px; text-underline-offset: 4px; }

/* ── Phones and tablets: one top bar, the menu moves to the bottom ── */
.hub-tabbar { display: none; }
.hub-theme-button { display: none; }
.hub-topbar-brand { display: none; }
.hub-avatar-button { display: none; }

@media (max-width: 1100px) {
  /* The site menu (logo, burger, day / night) gives way to the Hero Hub bar: one header instead of two. */
  body:has([data-app-sidebar]) :is(.nv, .nvm, .nvs) { display: none !important; }
  body:has([data-app-sidebar]).has-site-nav .dash-main { padding-top: 0; min-height: 100vh; }
  body:has([data-app-sidebar]) :is(.dash-side, .dash-overlay) { display: none !important; }

  body:has([data-app-sidebar]) .dash-topbar,
  body:has([data-app-sidebar]).has-site-nav .dash-topbar {
    position: sticky; top: 0; z-index: 55; display: flex; align-items: center; gap: 10px;
    height: auto; min-height: calc(60px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) var(--hub-gutter) 0;
    border-bottom: 3px solid var(--cw-ink); background: var(--cw-surface);
  }
  .dash-topbar :is(.dash-menu-button, .dash-topbar-copy) { display: none !important; }
  .hub-topbar-brand { display: flex; align-items: center; flex: none; min-height: 44px; }
  .hub-topbar-brand img { display: block; width: auto; height: 28px; }
  .dash-topbar .dash-top-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
  /* Day / night, the notifications and the avatar: same round buttons, icon centred. */
  .dash-topbar .hub-theme-button, .dash-topbar .dash-icon-button {
    position: relative; display: grid; place-items: center; flex: none; width: 38px; height: 38px; padding: 0;
    border: 2px solid var(--cw-ink); border-radius: 50%; color: var(--cw-navy); background: var(--cw-surface); cursor: pointer;
  }
  .dash-topbar .dash-icon-button svg, .dash-topbar .hub-theme-button svg { display: block; width: 19px; height: 19px; margin: 0; }
  .dash-topbar .hub-theme-button .hub-theme-moon { display: none; }
  .dash-topbar .hub-theme-button[aria-checked="false"] .dash-nav-icon { display: none; }
  .dash-topbar .hub-theme-button[aria-checked="false"] .hub-theme-moon { display: block; }
  .dash-topbar .hub-theme-button:hover, .dash-topbar .dash-icon-button:hover { border-color: var(--cw-ink); background: var(--cw-bg); }
  .dash-topbar .dash-streak-chip { height: 38px; padding: 0 10px 0 7px; border: 2px solid var(--cw-ink); background: var(--cw-surface); font-weight: 900; }
  .dash-topbar .dash-streak-chip svg { width: 19px; height: 19px; }
  .dash-topbar .dash-icon-button span { position: absolute; top: -5px; right: -5px; border: 2px solid var(--cw-surface); background: #e0533d; font-weight: 800; }
  .hub-avatar-button {
    display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0;
    border: 2px solid var(--cw-ink); border-radius: 50%; color: var(--cw-surface); background: var(--cw-navy); cursor: pointer;
  }
  .hub-avatar-button .nv__profile-avatar { display: contents; font-size: .82rem; font-weight: 900; letter-spacing: .02em; }
  .hub-avatar-button:hover { border-color: var(--cw-ink); background: var(--cw-navy-2); }

  /* The bottom bar: Home, Training, Progress, More. A floating navy bar with rounded ends, inset from the screen edges,
     so the page stays visible around it. */
  .hub-tabbar {
    position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 60;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; max-width: 440px; margin-inline: auto; padding: 5px;
    border: 3px solid var(--cw-ink); border-radius: 22px; background: var(--cw-navy); box-shadow: 4px 4px 0 var(--cw-ink);
  }
  .hub-tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px;
    border-radius: 16px; color: rgba(244, 247, 252, .74); text-decoration: none; font-size: .66rem; font-weight: 700; letter-spacing: .03em;
    -webkit-tap-highlight-color: transparent;
  }
  .hub-tabbar__icon { display: grid; place-items: center; width: 46px; height: 28px; border: 2px solid transparent; border-radius: 999px; transition: background .15s cubic-bezier(.4, 0, .2, 1); }
  .hub-tabbar__icon svg { width: 21px; height: 21px; }
  .hub-tabbar a:hover { color: var(--cw-surface); }
  .hub-tabbar a.is-active { color: var(--cw-surface); font-weight: 800; }
  .hub-tabbar a.is-active .hub-tabbar__icon { border-color: var(--cw-ink); color: var(--cw-ink); background: var(--cw-blue); }
  .hub-tabbar a:focus-visible { outline: 2px solid var(--cw-blue); outline-offset: 2px; border-radius: 12px; }

  /* Room for the bottom bar under the last card, and the floating bars sit above it. */
  body:has(.hub-tabbar) .dash-main { padding-bottom: calc(var(--hub-tabbar-h) + env(safe-area-inset-bottom, 0px) + 24px); }
  body.has-live-workout:has(.hub-tabbar) .dash-main { padding-bottom: calc(var(--hub-tabbar-h) + env(safe-area-inset-bottom, 0px) + 104px); }
  body:has(.hub-tabbar) .live-workout-bar { bottom: calc(var(--hub-tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px); }
  body:has(.hub-tabbar) .dash-toast { bottom: calc(var(--hub-tabbar-h) + env(safe-area-inset-bottom, 0px) + 14px); }
  /* A workout in progress takes the whole screen: no menu under the sets. */
  body:has([data-training-session]:not([hidden])) .hub-tabbar { display: none; }
  body:has([data-training-session]:not([hidden])) .dash-main { padding-bottom: 0; }

  /* Things that stuck under the old double header now stick under the single bar. */
  body:has([data-app-sidebar]) .ach-toolbar { top: 60px; }
  body:has([data-app-sidebar]) .training-session-bar { top: 66px; }
}
@media (max-width: 1100px) and (prefers-reduced-motion: reduce) { .hub-tabbar__icon { transition: none; } }

/* ── Account menu (avatar) ───────────────────────────────────────── */
.hub-account-sheet {
  width: min(420px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); margin: auto; padding: 18px 18px 14px;
  overflow: auto; color: var(--cw-navy); background: var(--cw-surface);
}
.hub-account-sheet::backdrop { background: rgba(44, 58, 82, .5); }
.hub-account-sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hub-account-sheet .hub-account-card { display: flex; align-items: center; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.hub-account-card .nv__profile-avatar {
  display: grid; place-items: center; flex: none; width: 52px; height: 52px; border: 2px solid var(--cw-ink); border-radius: 50%;
  color: var(--cw-surface); background: var(--cw-navy); font-size: 1rem; font-weight: 900;
}
.hub-account-card div { display: grid; gap: 2px; min-width: 0; }
.hub-account-card strong { overflow: hidden; color: var(--cw-navy); font-size: 1.1rem; font-weight: 900; white-space: nowrap; text-overflow: ellipsis; }
.hub-account-card div span { color: var(--cw-muted); font-size: .82rem; font-weight: 500; }
.hub-account-plan { display: grid; gap: 12px; margin: 16px 0 6px; padding: 14px; border: 3px solid var(--cw-ink); background: var(--cw-bg); }
.hub-account-plan p { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0; }
.hub-account-plan .dash-plan-badge { margin: 0; }
.hub-account-plan small { color: var(--cw-navy); font-size: .88rem; font-weight: 600; }
.hub-account-sheet .hub-account-upgrade { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; text-decoration: none; }
.hub-account-plan:not(:has(.hub-account-upgrade:not([hidden]))) { padding-block: 12px; }
.hub-account-links { display: grid; margin-top: 6px; }
.hub-account-row {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 0 4px;
  border: 0; border-bottom: 2px solid var(--cw-line); border-radius: 0; color: var(--cw-navy); background: none;
  font-size: 1rem; font-weight: 700; text-align: left; text-decoration: none; cursor: pointer;
}
.hub-account-row:hover { color: var(--cw-navy); background: var(--cw-bg); border-color: var(--cw-line); }
.hub-account-row > span { display: grid; place-items: center; flex: none; width: 22px; height: 22px; }
.hub-account-row > span svg { width: 21px; height: 21px; }
.hub-account-signout { border-bottom: 0; color: var(--cw-muted); }

@media (max-width: 560px) {
  /* On a phone the account menu rises from the bottom of the screen. */
  .hub-account-sheet {
    width: 100%; max-width: none; margin: auto 0 0; padding: 18px var(--hub-gutter) calc(14px + env(safe-area-inset-bottom, 0px));
    border-width: 3px 0 0 !important; box-shadow: none !important;
  }
  @media (prefers-reduced-motion: no-preference) {
    .hub-account-sheet[open] { animation: hubSheetUp .3s ease-out; }
  }
}
@keyframes hubSheetUp { from { transform: translateY(40px); opacity: 0; } }

/* ── Page titles and the Training tabs ───────────────────────────── */
.hub-page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 16px; }
.hub-page-head h1 {
  margin: 0; color: var(--cw-navy); font-family: var(--cw-font-display) !important; font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 900; letter-spacing: -.02em; line-height: .95; text-transform: uppercase;
}
.hub-page-head p { flex-basis: 100%; margin: 0; color: var(--cw-muted); font-size: .95rem; font-weight: 500; }
.hub-tabs {
  display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 4px; max-width: 560px; margin: 0 0 22px; padding: 4px;
  border: 3px solid var(--cw-ink); border-radius: 999px; background: var(--cw-surface);
}
.hub-tabs a, .hub-tabs button {
  display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 10px;
  border: 0; border-radius: 999px; color: var(--cw-navy); background: transparent; box-shadow: none;
  font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; white-space: nowrap; cursor: pointer;
}
.hub-tabs :is(a, button):hover { color: var(--cw-navy); background: var(--cw-bg); }
.hub-tabs :is(a, button).is-active, .hub-tabs :is(a, button)[aria-selected="true"] { color: var(--cw-surface); background: var(--cw-navy); }
.hub-tabs svg { width: 17px; height: 17px; flex: none; }
@media (max-width: 560px) {
  .hub-tabs { margin-bottom: 18px; }
  .hub-tabs a, .hub-tabs button { min-height: 40px; padding: 0 6px; font-size: .74rem; letter-spacing: .04em; }
  .hub-tabs svg { display: none; }
}

/* Stamp straddling the top edge of a plate, tilted like a sticker. */
/* A soft comic sunburst behind a promo plate (Pro cards): rays fading out from the lower right, halftone dots
   from the top left, over a paper-to-blue fade. Children paint above it. */
.hub-burst {
  position: relative; isolation: isolate;
  background: linear-gradient(155deg, var(--cw-surface) 30%, color-mix(in srgb, var(--cw-blue) 42%, var(--cw-surface)) 100%);
}
.hub-burst::before, .hub-burst::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hub-burst::before {
  background: repeating-conic-gradient(from 0deg at var(--burst-x, 80%) var(--burst-y, 88%), color-mix(in srgb, var(--cw-blue) 60%, transparent) 0deg 7deg, transparent 7deg 18deg);
  -webkit-mask-image: radial-gradient(circle at var(--burst-x, 80%) var(--burst-y, 88%), #000 0, rgba(0, 0, 0, .7) 24%, transparent 66%);
  mask-image: radial-gradient(circle at var(--burst-x, 80%) var(--burst-y, 88%), #000 0, rgba(0, 0, 0, .7) 24%, transparent 66%);
}
.hub-burst::after {
  background-image: radial-gradient(color-mix(in srgb, var(--cw-navy) 22%, transparent) 1.3px, transparent 1.7px);
  background-size: 9px 9px;
  -webkit-mask-image: linear-gradient(160deg, #000 0, transparent 40%);
  mask-image: linear-gradient(160deg, #000 0, transparent 40%);
}

.hub-stamp {
  position: absolute; top: -15px; left: 16px; z-index: 2; padding: 5px 11px; transform: rotate(-3deg);
  color: var(--cw-surface); background: var(--cw-navy); font-size: .72rem; font-weight: 800; letter-spacing: .14em; line-height: 1.2; text-transform: uppercase;
}
/* The gold stamp for a best seller, tilted the other way on the right of the same edge. */
.hub-stamp--best { left: auto; right: 16px; border: 2px solid var(--cw-ink); color: var(--cw-ink); background: #F2C94C; transform: rotate(3deg); }
/* Best seller seal: the gold starburst of the Hero Project sales page, tilted over the card's corner. */
.hub-seal {
  --hub-burst-shape: polygon(50% 0%, 59% 9%, 71% 4%, 75% 16%, 88% 15%, 87% 28%, 98% 34%, 92% 45%, 100% 55%, 90% 62%, 94% 75%, 81% 78%, 79% 91%, 67% 89%, 59% 100%, 50% 92%, 41% 100%, 33% 89%, 21% 91%, 19% 78%, 6% 75%, 10% 62%, 0% 55%, 8% 45%, 2% 34%, 13% 28%, 12% 15%, 25% 16%, 29% 4%, 41% 9%);
  position: absolute; top: -24px; right: -10px; z-index: 3; display: grid; place-items: center; width: 74px; aspect-ratio: 1;
  background: var(--cw-ink); transform: rotate(10deg); filter: drop-shadow(3px 3px 0 rgba(44, 58, 82, .45)); clip-path: var(--hub-burst-shape);
}
.hub-seal::before { content: ''; position: absolute; inset: 4px; background: linear-gradient(160deg, #ffe08a, #f3b93d); clip-path: var(--hub-burst-shape); }
.hub-seal span { position: relative; color: var(--cw-ink); font-size: .6rem; font-weight: 900; letter-spacing: .04em; line-height: 1.1; text-align: center; text-transform: uppercase; }
/* Member rating: five gold stars outlined in ink, the score, where it comes from. */
.hub-rating { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; margin: 0; color: var(--cw-navy); line-height: 1.2; }
.hub-rating svg { flex: none; width: 86px; height: 17px; }
.hub-rating b { color: var(--cw-navy); font-size: .95rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.hub-rating b span { color: var(--cw-muted); font-size: .78rem; font-weight: 800; }

/* A row that leads somewhere (More, Settings): icon, title and note, chevron. */
.hub-list { display: grid; margin: 0; padding: 0; border: 3px solid var(--cw-ink); background: var(--cw-surface); list-style: none; }
.hub-list > li + li { border-top: 2px solid var(--cw-line); }
.hub-list-row {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 14px;
  border: 0; border-radius: 0; color: var(--cw-navy); background: none; text-align: left; text-decoration: none; cursor: pointer;
}
.hub-list-row:hover { color: var(--cw-navy); background: var(--cw-bg); }
.hub-list-row__icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 2px solid var(--cw-ink); border-radius: 50%; background: var(--cw-bg); }
.hub-list-row__icon svg { width: 21px; height: 21px; }
.hub-list-row__copy { display: grid; gap: 1px; min-width: 0; flex: 1; }
.hub-list-row__copy strong { font-size: 1rem; font-weight: 800; }
.hub-list-row__copy small { color: var(--cw-muted); font-size: .84rem; font-weight: 500; line-height: 1.3; }
.hub-list-row__chevron { flex: none; width: 18px; height: 18px; color: var(--cw-navy); }
.hub-list-row .dash-pro-lock, .hub-list-row__tag {
  flex: none; padding: 3px 8px; border-radius: 0; color: var(--cw-surface); background: var(--cw-navy);
  font-size: .66rem; font-style: normal; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.hub-section-label { margin: 26px 0 10px; color: var(--cw-navy); font-size: .78rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.hub-section-label:first-child { margin-top: 0; }

/* Pill call to action (clickable = pill, hard ink shadow that collapses on press). Independent of app-pages.css. */
.hub-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border: 3px solid var(--cw-ink); border-radius: 999px; color: var(--cw-ink); background: var(--cw-blue); box-shadow: 4px 4px 0 var(--cw-ink);
  font-size: .88rem; font-weight: 800; letter-spacing: .06em; line-height: 1.1; text-align: center; text-decoration: none; text-transform: uppercase; white-space: nowrap; cursor: pointer;
}
.hub-cta:hover { border-color: var(--cw-ink); color: var(--cw-ink); background: var(--cw-blue); }
.hub-cta--dark, .hub-cta--dark:hover { color: var(--cw-surface); background: var(--cw-navy); }
.hub-cta--light, .hub-cta--light:hover { background: var(--cw-surface); }
.hub-cta--flat { box-shadow: none; }
@media (prefers-reduced-motion: no-preference) {
  .hub-cta { transition: transform 60ms ease-out, box-shadow 60ms ease-out; }
  .hub-cta:not(.hub-cta--flat):hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--cw-ink); }
  .hub-cta:not(.hub-cta--flat):active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--cw-ink); }
}
/* Steel glint on purchase buttons: a bright band slides across the fill every few seconds, like light on a blade. */
.btn-shine, .btn-shine:hover {
  background-image: linear-gradient(115deg, transparent 40%, var(--shine, rgba(255, 255, 255, .55)) 46.8%, var(--shine-core, #fff) 49%, var(--shine-core, #fff) 50.6%, var(--shine, rgba(255, 255, 255, .55)) 52.2%, transparent 55%, transparent 56.4%, var(--shine, rgba(255, 255, 255, .55)) 57.4%, transparent 58.8%);
  background-repeat: no-repeat; background-size: 260% 100%; background-position: 105% 0;
}
@media (prefers-reduced-motion: no-preference) {
  .btn-shine { animation: hubShine 4.6s cubic-bezier(.45, 0, .2, 1) 1s infinite; }
}
@keyframes hubShine { 0% { background-position: 105% 0; } 38%, 100% { background-position: -5% 0; } }
/* Secondary text link with an arrow (detour link). */
.hub-link { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; color: var(--cw-navy); background: none; font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-decoration: underline 2px; text-underline-offset: 4px; text-transform: uppercase; cursor: pointer; }
.hub-link:hover { color: var(--cw-navy); background: none; text-decoration-thickness: 3px; }

/* ── Add Hero Hub to the Home Screen ─────────────────────────────── */
html.is-standalone .hub-install-row { display: none !important; }
.hub-install-dialog { width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 20px 18px 18px; overflow: auto; color: var(--cw-navy); background: var(--cw-surface); }
.hub-install-dialog::backdrop { background: rgba(44, 58, 82, .5); }
.hub-install-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hub-install-dialog__kicker { margin: 0 0 6px; color: var(--cw-navy); font-size: .72rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.hub-install-dialog h2 { margin: 0; color: var(--cw-navy); font-size: 1.35rem; font-weight: 900; line-height: 1.05; text-transform: uppercase; }
.hub-install-dialog__lead { margin: 12px 0 14px; color: var(--cw-navy); font-size: .95rem; line-height: 1.45; }
.hub-install-dialog__warn { margin: 0 0 14px; padding: 10px 12px; border: 2px solid var(--cw-ink); background: var(--cw-bg); color: var(--cw-navy); font-size: .88rem; line-height: 1.4; }
.hub-install-dialog__native { width: 100%; margin-bottom: 16px; }
.hub-install-dialog__native[hidden] { display: none; }
.hub-install-dialog__tabs { max-width: none; margin-bottom: 14px; }
.hub-install-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.hub-install-steps[hidden] { display: none; }
.hub-install-steps li { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 12px; padding: 12px; border: 2px solid var(--cw-line); background: var(--cw-bg); color: var(--cw-navy); font-size: .95rem; line-height: 1.4; }
.hub-install-steps b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--cw-surface); background: var(--cw-navy); font-family: var(--cw-font-display) !important; font-size: 1rem; font-weight: 900; }
.hub-install-key { display: inline-grid; place-items: center; width: 28px; height: 28px; margin: 0 2px; vertical-align: middle; border: 2px solid var(--cw-ink); border-radius: 8px; background: var(--cw-surface); color: var(--cw-navy); }
.hub-install-key svg { width: 17px; height: 17px; }
.hub-install-dialog__foot { margin: 14px 0 0; color: var(--cw-muted); font-size: .85rem; line-height: 1.4; }

/* ── Contextual messages (hub-moments.js): in-page cards and the milestone window ── */
.training-moment[hidden], [data-dashboard-moment][hidden] { display: none; }
.training-moment { margin: 0 0 16px; }
.hub-moment {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 14px;
  padding: 16px 48px 16px 14px; border: 3px solid var(--cw-ink); color: var(--cw-navy); background: var(--cw-surface);
}
@media (prefers-reduced-motion: no-preference) { .hub-moment { animation: hubMomentIn .4s cubic-bezier(.16, 1, .3, 1); } }
@keyframes hubMomentIn { from { opacity: 0; transform: translateY(12px); } }
.hub-moment__close { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 2px solid var(--cw-ink); border-radius: 50%; color: var(--cw-ink); background: var(--cw-surface); cursor: pointer; }
.hub-moment__close:hover { border-color: var(--cw-ink); background: var(--cw-bg); }
.hub-moment__close svg { width: 15px; height: 15px; }
.hub-moment__art { width: 64px; height: auto; }
.hub-moment__medal { display: grid; place-items: center; width: 52px; height: 52px; border: 3px solid var(--cw-ink); border-radius: 50%; color: var(--cw-ink); background: #ffd24a; font-family: var(--cw-font-display) !important; font-size: 1.4rem; font-weight: 900; }
.hub-moment__copy { display: grid; gap: 4px; min-width: 0; }
.hub-moment__kicker { margin: 0; color: var(--cw-navy); font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.hub-moment__copy strong { color: var(--cw-navy); font-size: 1.05rem; font-weight: 900; line-height: 1.2; }
.hub-moment__copy small { color: var(--cw-muted); font-size: .86rem; line-height: 1.4; }
/* The Hero Project suggestion: the Captain over a soft sunburst, three ticks, one button. */
.hub-moment--offer { --burst-x: 14%; --burst-y: 50%; align-items: start; }
.hub-moment--offer .hub-moment__art { width: 78px; margin-top: 4px; }
.hub-moment__points { display: grid; gap: 4px; margin: 4px 0 0; padding: 0; list-style: none; }
.hub-moment__points li { position: relative; padding-left: 22px; color: var(--cw-navy); font-size: .86rem; font-weight: 600; line-height: 1.3; }
.hub-moment__points li::before {
  content: ''; position: absolute; left: 2px; top: .28em; width: 11px; height: 6px;
  border: solid var(--cw-navy); border-width: 0 0 3px 3px; transform: rotate(-45deg);
}
.hub-moment__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 8px; }
.hub-moment__actions .hub-cta { min-height: 42px; padding: 0 16px; font-size: .78rem; }

.hub-milestone { width: min(420px, calc(100vw - 24px)); padding: 26px 20px 20px; color: var(--cw-navy); background: var(--cw-surface); text-align: center; }
.hub-milestone::backdrop { background: rgba(44, 58, 82, .55); }
.hub-milestone > button[aria-label="Close"] { position: absolute; top: 10px; right: 10px; }
.hub-milestone__badge { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 12px; border: 3px solid var(--cw-ink); border-radius: 50%; color: var(--cw-ink); background: #ffd24a; font-family: var(--cw-font-display) !important; font-size: 2.2rem; font-weight: 900; }
.hub-milestone h2 { margin: 0; color: var(--cw-navy); font-size: 1.45rem; font-weight: 900; text-transform: uppercase; }
.hub-milestone__lead { margin: 6px auto 16px; max-width: 32ch; color: var(--cw-navy); font-size: .95rem; line-height: 1.45; }
.hub-milestone__offer { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 12px; padding: 12px; border: 2px solid var(--cw-ink); background: var(--cw-bg); text-align: left; }
.hub-milestone__offer img { width: 64px; height: auto; }
.hub-milestone__offer strong { display: block; color: var(--cw-navy); font-size: .98rem; font-weight: 900; }
.hub-milestone__offer small { display: block; margin-top: 3px; color: var(--cw-muted); font-size: .84rem; line-height: 1.35; }
.hub-milestone__actions { display: grid; justify-items: center; gap: 12px; margin-top: 16px; }
.hub-milestone__actions .hub-cta { width: 100%; }

/* Small round close button in the corner of a card (offers and invitations that can be dismissed). */
.hub-card-close { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 2px solid var(--cw-ink); border-radius: 50%; color: var(--cw-ink); background: var(--cw-surface); box-shadow: none; cursor: pointer; }
.hub-card-close:hover { border-color: var(--cw-ink); color: var(--cw-ink); background: var(--cw-bg); }
.hub-card-close svg { width: 15px; height: 15px; }

/* Back to More (phones and tablets only, where More is a tab). */
.hub-back { display: none; }
@media (max-width: 1100px) {
  .hub-back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; margin: -6px 0 6px -4px; padding: 0 6px 0 0; color: var(--cw-navy); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-decoration: none; text-transform: uppercase; }
  .hub-back:hover { color: var(--cw-navy); text-decoration: underline 2px; text-underline-offset: 4px; }
  .hub-back svg { width: 18px; height: 18px; }
}

/* Plan badge: FREE in muted blue-grey, PRO in navy. */
.dash-plan-badge:not(.is-pro) { background: var(--cw-muted); }

/* ── Weekly flame: fills up with each workout of the week; the texture flows while it fills, it flickers once full. ── */
.dash-body {
  --hub-flame-shape: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27%3E%3Cpath d=%27M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.07-2.14-.22-4.05 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.15.43-2.29 1-3a2.5 2.5 0 0 0 2.5 2.5z%27 fill=%27black%27/%3E%3C/svg%3E");
  --hub-flame-outline: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27%3E%3Cpath d=%27M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.07-2.14-.22-4.05 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.15.43-2.29 1-3a2.5 2.5 0 0 0 2.5 2.5z%27 fill=%27none%27 stroke=%27%23111111%27 stroke-width=%271.7%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E");
}
.hub-flame { --fill: 0%; position: relative; display: inline-block; flex: none; width: 30px; height: 30px; vertical-align: middle; }
.hub-flame::before, .hub-flame > i {
  content: ''; position: absolute; inset: 0;
  -webkit-mask: var(--hub-flame-shape) center / contain no-repeat; mask: var(--hub-flame-shape) center / contain no-repeat;
}
.hub-flame::before { background: var(--cw-track); }
/* The flame spans 75% of its box (12.5% free above and below), so 0% is empty and 100% is full: each workout
   raises it by one share of the week's goal (a third for 3 a week, a sixth for 6).
   The stripes are one 12px square tile, so sliding them by exactly one tile loops with no visible restart. */
.hub-flame > i {
  background-color: #ff5a26;
  background-image: linear-gradient(-45deg, #ffa53a 0 25%, #ff5a26 25% 50%, #ffa53a 50% 75%, #ff5a26 75% 100%);
  background-size: 12px 12px;
  clip-path: inset(calc(87.5% - var(--fill) * .75) 0 0 0);
  transition: clip-path 1.4s cubic-bezier(.22, 1, .36, 1);
}
.hub-flame.is-instant > i { transition: none; }
.hub-flame::after { content: ''; position: absolute; inset: 0; background: var(--hub-flame-outline) center / contain no-repeat; }
.hub-flame.is-full > i { background: linear-gradient(180deg, #ff4d2e 0%, #ff8a1f 55%, #ffc93c 100%); }
@media (prefers-reduced-motion: no-preference) {
  .hub-flame:not(.is-full) > i { animation: hubFlameFlow 1.6s linear infinite; }
  .hub-flame.is-full { animation: hubFlameFlicker 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
}
@keyframes hubFlameFlow { from { background-position: 0 0; } to { background-position: 0 -12px; } }
@keyframes hubFlameFlicker { 0%, 100% { transform: scale(1) rotate(0); } 40% { transform: scale(1.06, 1.1) rotate(-2deg); } 70% { transform: scale(.98, 1.04) rotate(1.5deg); } }

/* ── Member results: a small reel of real before / after photos that scrolls by itself (Hero Project offers). ── */
.hub-proof { display: grid; gap: 8px; min-width: 0; }
.hub-proof__title { margin: 0; color: var(--cw-navy); font-size: .88rem; line-height: 1.35; }
.hub-proof__title strong { font-weight: 900; }
.hub-proof__track { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%); }
.hub-proof__reel { display: flex; width: max-content; }
.hub-proof__copy { display: flex; }
.hub-proof__reel img { display: block; flex: none; width: 78px; height: 78px; margin-right: 8px; object-fit: cover; border: 2px solid var(--cw-ink); background: var(--cw-bg); }
@media (prefers-reduced-motion: no-preference) {
  .hub-proof__reel { animation: hubProofReel 30s linear infinite; }
  .hub-proof__track:hover .hub-proof__reel { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .hub-proof__track { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .hub-proof__copy { display: none; }
}
@keyframes hubProofReel { to { transform: translateX(-50%); } }

/* Nothing in a Hero Hub page may widen it: on a phone the page never slides left or right. */
.dash-body .dash-content { overflow-x: clip; }
