/* The Upgrade (js/upgrade*.js). Built on the quiz's tokens and components (styles.css): topbar, frame, overlay, opt,
   verdict, analysis, btn, headline. Everything here is up-* so nothing in the quiz, Skill tests or Learn changes. */
:root {
  --up-yellow-soft: #fff6cc;
  --up-yellow-ink: #6b5000;
  --up-good-line: rgba(34, 197, 94, 0.5);
  --up-miss-line: rgba(254, 0, 0, 0.32);
  --up-card: #0b0b0c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --up-yellow-soft: rgba(255, 214, 10, 0.12);
    --up-yellow-ink: #ffd60a;
    --up-good-line: rgba(34, 197, 94, 0.45);
    --up-miss-line: rgba(254, 0, 0, 0.4);
    --up-card: #141416;
  }
}
:root[data-theme="dark"] {
  --up-yellow-soft: rgba(255, 214, 10, 0.12);
  --up-yellow-ink: #ffd60a;
  --up-good-line: rgba(34, 197, 94, 0.45);
  --up-miss-line: rgba(254, 0, 0, 0.4);
  --up-card: #141416;
}

.up-glyph { display: inline-grid; place-items: center; flex: none; width: 1.2em; height: 1.2em; }
.up-glyph svg { width: 100%; height: 100%; }

/* ---------- journey bar: Test · Train · Retest ---------- */
.up-journey { flex: 1; display: flex; justify-content: center; min-width: 0; }
.up-journey__list { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-end; gap: 10px; }
.up-jstage { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.up-jstage__name { font: 800 10px/1 var(--f-head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); transition: color 0.3s; }
.up-jstage.is-now .up-jstage__name { color: var(--ink); }
.up-jstage.is-done .up-jstage__name { color: var(--green-ink); }
.up-pips { display: flex; align-items: center; gap: 5px; height: 22px; }
.up-pip { width: 9px; height: 9px; border-radius: 50%; background: var(--track); transition: background 0.3s, box-shadow 0.3s; }
.up-pip.is-done { background: var(--ink); }
.up-jstage.is-done .up-pip { background: var(--ink-2); }
.up-pip.is-now { background: var(--red); animation: up-pip 1.8s ease-in-out infinite; }
.up-jsep { width: 22px; height: 2px; margin-bottom: 10px; border-radius: 2px; background: var(--track); transition: background 0.3s; }
.up-jsep.is-done { background: var(--ink-2); }
@keyframes up-pip { 0%, 100% { box-shadow: 0 0 0 0 rgba(254, 0, 0, 0.35); } 50% { box-shadow: 0 0 0 5px rgba(254, 0, 0, 0); } }

/* lesson badges (the Train pips, and bigger in the lesson screens / results) */
.up-badge {
  display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--dash); color: var(--muted); background: transparent;
  font: 800 10.5px/1 var(--f-head); font-variant-numeric: tabular-nums;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.up-badge__icon { width: 12px; height: 12px; }
.up-badge.is-open { background: var(--yellow); border-color: var(--yellow); color: #0b0b0c; }
.up-badge.is-applied { background: var(--green-solid); border-color: var(--green-solid); color: #fff; }
.up-badge.is-now { border-color: var(--red); }
.up-badge.is-open.is-now { animation: up-pop 0.55s cubic-bezier(0.3, 0.7, 0.3, 1.4) both; box-shadow: 0 0 0 3px rgba(255, 214, 10, 0.3); border-color: var(--yellow); }
.up-badge--lg { width: 46px; height: 46px; border-width: 2.5px; }
.up-badge--lg .up-badge__icon { width: 22px; height: 22px; }
.up-badge--lg.is-open { background: #0b0b0c; color: var(--yellow); border-color: var(--yellow); }
.up-badge--lg.is-applied { background: var(--green-solid); color: #fff; }
@keyframes up-pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes up-rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- top bar ---------- */
.up-topbar { justify-content: space-between; gap: 12px; }
.up-close { margin-left: -8px; }
.up-topbar__name { flex: 1; text-align: center; font: 800 14px var(--f-head); }
.up-q .topbar .up-journey { justify-content: flex-end; }

/* ---------- the cue on a frame ---------- */
.up-cue { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; transition: opacity 0.25s; }
.frame.is-playing .up-cue, .frame.is-leading .up-cue { opacity: 0; }
.up-cue__outline { fill: none; stroke: #0b0b0c; stroke-width: 9px; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.up-cue__stroke { fill: none; stroke: var(--yellow); stroke-width: 4.5px; stroke-linecap: round; stroke-linejoin: round; }
.up-cue__dash { stroke-dasharray: 12px 9px; }
.up-cue__head { fill: var(--yellow); stroke: #0b0b0c; stroke-width: 4; stroke-linejoin: round; }
.up-cue__pulse { fill: none; stroke: var(--yellow); stroke-width: 3px; transform-box: fill-box; transform-origin: center; animation: up-cue 1.7s ease-out infinite; }
.up-cue--good .up-cue__stroke, .up-cue--good .up-cue__pulse { stroke: var(--green); }
.up-cue--good .up-cue__head { fill: var(--green); }
.up-cue--miss .up-cue__stroke { stroke: var(--red); }
.up-cue.is-still .up-cue__pulse { display: none; }
.up-cue.is-still .up-cue__outline { stroke-width: 6px; }
.up-cue.is-still .up-cue__stroke { stroke-width: 3px; }
@keyframes up-cue { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(1.55); opacity: 0; } }

.up-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: var(--pitch); box-shadow: var(--frame-shadow); }
.up-thumb__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }

.up-key {
  display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: #0b0b0c; color: #fff; border: 2.5px solid var(--yellow); font: 800 12px/1 var(--f-head);
}
.up-key--best { border-color: var(--green); }
.up-key--wrong { border-color: var(--red); }

.up-devbanner {
  display: inline-block; margin-top: 14px; padding: 6px 12px; border-radius: 8px;
  background: var(--tag-risky-bg); color: var(--tag-risky-fg); font: 700 12.5px/1.3 var(--f-head); letter-spacing: 0.02em;
}
.up-devtag {
  width: fit-content; margin: 0 0 12px; padding: 4px 10px; border-radius: 6px;
  background: var(--tag-risky-bg); color: var(--tag-risky-fg); font: 800 11px/1.3 var(--f-head); letter-spacing: 0.08em; text-transform: uppercase;
}

/* ---------- home card ---------- */
.up-home { padding: 52px 0 0; }
.up-hcard {
  position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  min-height: 320px; border-radius: 22px; background: var(--up-card); color: #fff; box-shadow: var(--card-shadow);
}
.up-hcard__media { position: relative; order: 2; overflow: hidden; background: #0b0b0c; }
.up-hcard__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); filter: saturate(0.9);
}
.up-hcard__media.has-img .up-hcard__img { opacity: 0.9; }
.up-hcard__media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--up-card) 0%, rgba(11, 11, 12, 0.55) 38%, rgba(11, 11, 12, 0) 75%),
    linear-gradient(0deg, rgba(11, 11, 12, 0.5) 0%, rgba(11, 11, 12, 0) 40%);
}
.up-hcard__streaks {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: screen;
  background:
    linear-gradient(90deg, transparent 0%, rgba(254, 0, 0, 0.5) 60%, transparent 100%) -10% 30% / 80% 4% no-repeat,
    linear-gradient(90deg, transparent 0%, rgba(74, 106, 230, 0.45) 60%, transparent 100%) 0 40% / 64% 2.5% no-repeat,
    linear-gradient(90deg, transparent 0%, rgba(254, 0, 0, 0.32) 60%, transparent 100%) 0 70% / 70% 3% no-repeat;
  filter: blur(5px); animation: streaks-in 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s both;
}
.up-hcard__body { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 36px 8px 36px 38px; }
.up-hcard__new { display: flex; align-items: center; gap: 10px; font: 800 12px/1 var(--f-head); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); }
.up-hcard__tag { padding: 5px 9px 4px; border-radius: 6px; background: var(--yellow); color: #0b0b0c; letter-spacing: 0.12em; }
.up-hcard__title { font: 500 clamp(40px, 5.2vw, 64px)/0.95 var(--f-head); letter-spacing: -0.045em; }
.up-hcard__title b { font-weight: 900; }
.up-hcard__title b::after { content: '.'; color: var(--red); }
.up-hcard__line { font-size: 17px; color: rgba(255, 255, 255, 0.82); max-width: 24em; }
.up-hcard__steps { list-style: none; margin: 2px 0 0; padding: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font: 700 13.5px/1 var(--f-head); }
.up-hcard__steps li { display: inline-flex; align-items: center; gap: 7px; }
.up-hcard__steps li + li::before { content: ''; width: 18px; height: 2px; margin-right: 1px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); }
.up-hcard__num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--yellow); font-size: 11px; }
.up-hcard__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-top: 8px; }
.up-hcard__best { font: 600 13.5px var(--f-head); color: rgba(255, 255, 255, 0.72); }
.up-hcard__best b { color: #fff; font-weight: 800; }
.up-hcard .up-devbanner { align-self: flex-start; margin-top: 4px; }
.up-hcard .btn--primary:focus-visible { outline-color: var(--yellow); }
@media (hover: hover) {
  .up-hcard:hover .up-hcard__img { transform: scale(1.03); }
}

/* ---------- intro ---------- */
.up-intro__hero { padding-bottom: 30px; }
.up-intro__hero .headline { font-size: clamp(48px, 8vw, 104px); }
.up-path { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-width: 1000px; }
.up-path__step { position: relative; padding: 22px 22px 24px; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); animation: up-rise 0.45s both; }
.up-path__step:nth-child(2) { animation-delay: 0.08s; }
.up-path__step:nth-child(3) { animation-delay: 0.16s; }
.up-path__num { display: block; font: 700 44px/1 var(--f-serif); color: var(--red); }
.up-path__name { margin-top: 10px; font: 900 22px/1.1 var(--f-head); letter-spacing: -0.02em; }
.up-path__line { margin-top: 6px; font-size: 14.5px; color: var(--ink-2); }
.up-path__badges { display: flex; gap: 6px; margin-top: 14px; }
.up-intro__go { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 34px 0 48px; text-align: center; }
.up-intro__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 6px; }
.up-intro__meta { font: 600 13px var(--f-head); color: var(--muted); }
.up-intro__meta b { color: var(--ink); }

/* ---------- stage cards ---------- */
.up-stage { padding-bottom: 32px; text-align: center; }
.up-stage__head { max-width: 760px; margin: 0 auto; padding: 26px 0 6px; }
.up-stage__title { margin-top: 14px; font-size: clamp(44px, 6.6vw, 84px); }
.up-stage__lead { margin: 18px auto 0; max-width: 34em; font-size: clamp(16px, 1.5vw, 18.5px); color: var(--ink-2); }
.up-picks, .up-habits--cards {
  list-style: none; margin: 32px auto 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px; max-width: 1000px; text-align: left;
}
.up-pickcard, .up-habitcard { animation: up-rise 0.45s both; }
.up-pickcard__who { margin-top: 12px; font: 800 11.5px/1 var(--f-head); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.up-pickcard__pick { display: flex; align-items: center; gap: 9px; margin-top: 8px; font: 700 15px/1.3 var(--f-head); }
.up-habitcard { padding: 20px; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.up-habitcard__name { margin-top: 14px; font: 800 15.5px/1.25 var(--f-head); }
.up-habitcard__line { margin-top: 6px; font-size: 14.5px; color: var(--ink-2); }
.up-stage__go { display: flex; justify-content: center; margin: 36px 0 8px; }

/* ---------- a moment (the quiz screen) ---------- */
.up-qeyebrow { margin: 0 0 14px; font: 800 11.5px/1.2 var(--f-head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--red-ink); }
.opt.up-picked { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt.up-picked .opt__key { background: var(--yellow); color: #0b0b0c; }
.verdict__title--neutral { color: var(--ink); }
.up-verdict-note { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.up-lessonline {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--paper); box-shadow: var(--shadow); font-size: 14.5px; line-height: 1.45; color: var(--ink-2);
}
.up-lessonline b { color: var(--ink); font-family: var(--f-head); font-weight: 800; }
.up-lessonline__icon { width: 22px; height: 22px; margin-top: -1px; color: var(--red); }
.up-cueprompt {
  margin: 0 0 16px; padding: 13px 16px 14px; border-radius: 12px; border-left: 4px solid var(--yellow); background: var(--up-yellow-soft);
  animation: up-rise 0.4s 0.15s both;
}
.up-cueprompt__tag { display: flex; align-items: center; gap: 8px; font: 800 11px/1.2 var(--f-head); letter-spacing: 0.12em; text-transform: uppercase; color: var(--up-yellow-ink); }
.up-cueprompt__icon { width: 17px; height: 17px; }
.up-cueprompt__text { margin-top: 6px; font: 700 16px/1.35 var(--f-head); color: var(--ink); }
.up-leadhint { margin: 0 0 12px; font: 600 13.5px/1.4 var(--f-head); color: var(--muted); }
.up-q .analysis.is-in { margin-top: 32px; }

/* ---------- lesson: the hook ---------- */
.up-hook__layout {
  display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); grid-template-rows: auto 1fr;
  grid-template-areas: 'media intro' 'media body'; column-gap: 32px; align-items: start; padding-top: 6px;
}
.up-hook__media { grid-area: media; position: sticky; top: 12px; }
.up-hook__intro { grid-area: intro; }
.up-hook__body { grid-area: body; }
.up-hook .overlay.up-hidden { opacity: 0; }
.up-hook__title { margin-top: 12px; font: 400 clamp(30px, 3.2vw, 42px)/1.08 var(--f-serif); letter-spacing: -0.02em; }
.up-hook__title b { font-weight: 700; }
.up-hook__title:focus { outline: none; }
.up-hook__sub { margin-top: 8px; font-size: 16px; color: var(--ink-2); }
.up-cuecap {
  display: flex; align-items: flex-start; gap: 11px; margin-top: 14px; padding: 13px 16px; border-radius: 12px;
  background: var(--up-yellow-soft); font-size: 15.5px; line-height: 1.45; color: var(--ink); animation: up-rise 0.4s 0.2s both;
}
.up-cuecap b { font-family: var(--f-head); font-weight: 800; }
.up-cuecap__dot { flex: none; width: 15px; height: 15px; margin-top: 3px; border-radius: 50%; border: 3.5px solid var(--yellow); box-shadow: 0 0 0 1.5px #0b0b0c; }
.up-hook__watch { margin-top: 12px; min-height: 44px; padding: 10px 18px; font-size: 14px; }
.up-seen { margin-top: 20px; padding: 14px 16px; border-left: 3px solid var(--red); border-radius: 0 12px 12px 0; background: var(--paper); box-shadow: var(--shadow); }
.up-seen__tag, .up-why__tag, .up-habit__loopname, .up-habit__lead {
  font: 800 10.5px/1.2 var(--f-head); letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted);
}
.up-seen__text { margin-top: 6px; font-size: 15px; }
.up-whys { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 16px; }
.up-why { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
.up-why__tag { display: block; margin-bottom: 3px; }
.up-why--best .up-why__tag { color: var(--green-ink); }
.up-why--wrong .up-why__tag { color: var(--red-ink); }
.up-why__head strong { font: 700 16px/1.3 var(--f-head); }
.up-why__text { margin-top: 4px; font-size: 14.5px; color: var(--ink-2); }
.up-hook__go { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* pick lesson: upside × likelihood */
.up-weigh { margin-top: 20px; padding: 12px 16px 14px; border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); }
.up-weigh__head, .up-weigh__row { display: grid; grid-template-columns: minmax(0, 1fr) 76px 76px; gap: 10px; align-items: center; }
.up-weigh__head { padding: 2px 0 8px; border-bottom: 1px solid var(--line); font: 800 10px/1 var(--f-head); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.up-short { display: none; }
.up-weigh__list { list-style: none; margin: 0; padding: 0; }
.up-weigh__row { padding: 9px 0; border-bottom: 1px solid var(--line); }
.up-weigh__row:last-child { border-bottom: 0; }
.up-weigh__opt { display: flex; align-items: center; gap: 9px; min-width: 0; font: 700 14px/1.25 var(--f-head); }
.up-weigh__label { min-width: 0; }
.up-weigh__row.is-best .up-key { border-color: var(--green); }
.up-weigh__row.is-mine .up-key { border-color: var(--red); }
.up-weigh__tag {
  display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 99px; vertical-align: 1px;
  font: 800 9.5px/1.3 var(--f-head); letter-spacing: 0.08em; text-transform: uppercase; box-shadow: inset 0 0 0 1.5px var(--ink);
}
.up-weigh__tag--best { background: var(--green-solid); color: #fff; box-shadow: none; }
.up-meter { display: flex; align-items: center; gap: 3px; }
.up-meter__seg { width: 13px; height: 8px; border-radius: 2px; background: var(--track); }
.up-meter__seg.is-on { background: var(--ink-2); }
.is-best .up-meter__seg.is-on { background: var(--green); }
.is-mine .up-meter__seg.is-on { background: var(--red); }
.up-meter__text { margin-left: 5px; font: 600 11px var(--f-head); color: var(--muted); }
.up-weigh__foot { margin-top: 10px; font: 700 13.5px/1.35 var(--f-head); }

/* ---------- lesson: the habit ---------- */
.up-habit__card { max-width: 820px; margin: 0 auto; padding: 24px 0 40px; text-align: center; }
.up-unlock {
  display: inline-flex; align-items: center; gap: 12px; padding: 7px 20px 7px 7px; border-radius: 999px;
  background: var(--paper); box-shadow: var(--shadow); text-align: left; animation: up-rise 0.45s both;
}
.up-unlock .up-badge { animation: up-pop 0.6s 0.25s cubic-bezier(0.3, 0.7, 0.3, 1.4) both; }
.up-unlock b { display: block; font: 800 10.5px/1.2 var(--f-head); letter-spacing: 0.13em; text-transform: uppercase; color: var(--red-ink); }
.up-unlock__name { display: block; margin-top: 2px; font: 800 15px/1.2 var(--f-head); }
.up-habit__loopname { margin-top: 30px; }
.up-loop { list-style: none; margin: 10px 0 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.up-loop__step { position: relative; padding: 7px 13px; border-radius: 999px; background: var(--hover); color: var(--muted); font: 700 13px/1 var(--f-head); }
.up-loop__step + .up-loop__step::before { content: ''; position: absolute; left: -8px; top: 50%; width: 8px; height: 2px; background: var(--dash); }
.up-loop__step.is-now { background: var(--red-btn); color: #fff; }
.up-habit__title { margin-top: 22px; font-size: clamp(36px, 5.4vw, 64px); }
.up-habit__mech { margin: 18px auto 0; max-width: 36em; font-size: clamp(16px, 1.5vw, 18.5px); color: var(--ink-2); }
.up-habit__lead { margin-top: 34px; }
.up-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; text-align: left; }
.up-step { padding: 18px 18px 20px; border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); animation: up-rise 0.45s both; }
.up-step__num { display: block; font: 700 40px/1 var(--f-serif); color: var(--red); }
.up-step__k { margin-top: 10px; font: 800 17px/1.2 var(--f-head); }
.up-step__t { margin-top: 4px; font-size: 14px; color: var(--muted); }
.up-habit__go { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 32px; }
.up-habit__note { font: 600 13px var(--f-head); color: var(--muted); }

/* ---------- results ---------- */
.up-rhero { position: relative; isolation: isolate; padding: 30px 0 4px; text-align: center; }
.up-rings { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 4vw, 44px); margin-top: 24px; }
.up-ring { position: relative; display: grid; place-items: center; width: clamp(128px, 20vw, 176px); aspect-ratio: 1; }
.up-ring__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.up-ring__track { fill: none; stroke: var(--track); stroke-width: 9; }
.up-ring__arc { fill: none; stroke: var(--ink-2); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(0.3, 0.7, 0.3, 1); }
.up-ring--up .up-ring__arc { stroke: var(--green); }
.up-ring--flat .up-ring__arc { stroke: var(--yellow); }
.up-ring__score { font: 900 clamp(40px, 5.6vw, 56px)/1 var(--f-head); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.up-ring__of { font-weight: 600; font-size: 0.45em; letter-spacing: 0; color: var(--muted); }
.up-ring__label { position: absolute; bottom: -28px; left: 0; right: 0; font: 800 11.5px/1 var(--f-head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.up-rings__arrow { width: clamp(46px, 8vw, 92px); height: 26px; color: var(--red); }
.up-rings__arrow .icon { width: 100%; height: 100%; }
.up-rhero__title { margin-top: 54px; font-size: clamp(40px, 6vw, 78px); }
.up-rhero__line { margin: 14px auto 0; max-width: 34em; font-size: 18px; color: var(--ink-2); }
.up-rhero__notes { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; justify-items: center; font: 700 15px/1.35 var(--f-head); color: var(--red-ink); }
.up-newbest { display: inline-block; margin-top: 16px; padding: 6px 14px; border-radius: 999px; background: var(--yellow); color: #0b0b0c; font: 800 13px/1.2 var(--f-head); }
.up-rhero__best { margin-top: 14px; font: 600 13px var(--f-head); color: var(--muted); }
.up-rblock { margin-top: 56px; }
.up-rrows { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 22px; }
.up-rrow { padding: 22px; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); animation: up-rise 0.45s both; }
.up-rrow:nth-child(2) { animation-delay: 0.08s; }
.up-rrow:nth-child(3) { animation-delay: 0.16s; }
.up-rrow__head { display: flex; align-items: center; gap: 14px; }
.up-rrow__title { flex: 1; min-width: 0; }
.up-rrow__n { font: 800 10.5px/1.2 var(--f-head); letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.up-rrow__name { margin-top: 3px; font: 800 20px/1.15 var(--f-head); letter-spacing: -0.01em; }
.up-status { flex: none; padding: 6px 12px; border-radius: 999px; font: 800 11px/1.1 var(--f-head); letter-spacing: 0.06em; text-transform: uppercase; }
.up-status--good { background: var(--green-solid); color: #fff; }
.up-status--kept { background: var(--pill-mid-bg); color: var(--pill-mid-fg); }
.up-status--miss { background: var(--tag-poor-bg); color: var(--tag-poor-fg); }
.up-status--mid { background: var(--tag-risky-bg); color: var(--tag-risky-fg); }
.up-rrow__pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 14px; margin-top: 18px; }
.up-rrow__arrow { width: 50px; height: 18px; color: var(--red); }
.up-rrow__arrow .icon { width: 100%; height: 100%; }
.up-rcard {
  display: grid; grid-template-columns: 44% minmax(0, 1fr); gap: 14px; align-items: center; height: 100%;
  padding: 10px; border-radius: 14px; background: var(--bg); border: 1.5px solid var(--line);
}
.up-rcard--good { border-color: var(--up-good-line); }
.up-rcard--miss { border-color: var(--up-miss-line); }
.up-rcard .up-thumb { border-radius: 9px; box-shadow: none; }
.up-rcard__stage { font: 800 10.5px/1.2 var(--f-head); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.up-rcard__stage span { letter-spacing: 0.02em; text-transform: none; font-weight: 600; }
.up-rcard__pick { display: flex; align-items: flex-start; gap: 7px; margin-top: 6px; font: 700 14.5px/1.3 var(--f-head); }
.up-mark { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; margin-top: -1px; border-radius: 50%; color: #fff; }
.up-mark .icon { width: 12px; height: 12px; }
.up-mark--good { background: var(--green); }
.up-mark--miss { background: var(--red-btn); }
.up-rcard__line { margin-top: 6px; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
.up-rrow__replay { margin-top: 12px; font: 600 13.5px var(--f-head); color: var(--ink-2); }
.up-rrow__foot { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 16px; }
.up-rrow__note { font: 700 14.5px/1.35 var(--f-head); color: var(--red-ink); }
.up-replay { gap: 8px; min-height: 44px; margin-left: auto; padding: 8px 16px; font-size: 13.5px; }
.up-replay__icon { width: 16px; height: 16px; }
.up-takeaways { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.up-takeaway { display: flex; gap: 14px; padding: 18px; border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.up-takeaway__icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; background: #0b0b0c; color: var(--yellow); border: 2.5px solid var(--yellow); }
.up-takeaway__icon .up-glyph { width: 21px; height: 21px; }
.up-takeaway__name { font: 800 15px/1.25 var(--f-head); }
.up-takeaway__line { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.up-integrity { margin-top: 22px; max-width: 60em; padding-left: 12px; border-left: 3px solid var(--line); font-size: 13.5px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 979px) {
  .up-hcard { grid-template-columns: 1fr; min-height: 0; }
  .up-hcard__media { order: 0; aspect-ratio: 16 / 8; }
  .up-hcard__media::after { background: linear-gradient(0deg, var(--up-card) 0%, rgba(11, 11, 12, 0.35) 45%, rgba(11, 11, 12, 0) 80%); }
  .up-hcard__body { padding: 0 26px 28px; margin-top: -36px; }
  .up-hook__layout { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  .up-hook__media { position: static; order: 2; }
  .up-hook__intro { order: 1; }
  .up-hook__body { order: 3; }
  .up-hook__body .up-seen:first-child, .up-hook__body .up-weigh:first-child { margin-top: 4px; }
  .up-qeyebrow { order: 0; margin: 0; }
  .up-q .up-devtag { order: 0; margin: 0; }
  .up-cueprompt, .up-leadhint { order: 3; margin: 0; }
  .up-takeaways { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .up-path, .up-picks, .up-habits--cards, .up-steps { grid-template-columns: 1fr; gap: 12px; }
  .up-path__step { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; padding: 16px 18px; }
  .up-path__num { grid-row: span 3; font-size: 36px; }
  .up-path__name { margin-top: 0; font-size: 19px; }
  .up-path__badges { grid-column: 2; margin-top: 10px; }
  .up-pickcard { display: grid; grid-template-columns: 42% minmax(0, 1fr); column-gap: 12px; align-items: center; }
  .up-pickcard .up-thumb { grid-row: span 2; }
  .up-pickcard__who { margin-top: 0; }
  .up-habitcard { display: grid; grid-template-columns: 46px minmax(0, 1fr); column-gap: 14px; align-items: center; padding: 14px 16px; }
  .up-habitcard .up-badge { grid-row: span 2; }
  .up-habitcard__name { margin-top: 0; }
  .up-step { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 10px; padding: 14px 16px; }
  .up-step__num { grid-row: span 2; font-size: 32px; }
  .up-step__k { margin-top: 0; }
  .up-rrow__pair { grid-template-columns: 1fr; gap: 6px; }
  .up-rrow__arrow { justify-self: center; transform: rotate(90deg); width: 34px; height: 14px; }
}

@media (max-width: 600px) {
  .up-home { padding-top: 44px; }
  .up-hcard { border-radius: 18px; }
  .up-hcard__body { padding: 0 20px 22px; gap: 12px; }
  .up-hcard__title { font-size: 44px; }
  .up-hcard__line { font-size: 15.5px; }
  .up-hcard__cta { width: 100%; }
  .up-journey__list { gap: 7px; }
  .up-jsep { width: 12px; }
  .up-pips { gap: 4px; }
  .up-pip { width: 8px; height: 8px; }
  .up-badge { width: 20px; height: 20px; font-size: 10px; }
  .up-badge--lg { width: 42px; height: 42px; }
  .up-q .topbar .up-journey { justify-content: flex-start; }
  .up-stage__head, .up-habit__card { padding-top: 14px; }
  .up-stage__title { font-size: clamp(40px, 12vw, 56px); }
  .up-habit__title { font-size: clamp(32px, 9.4vw, 44px); }
  .up-intro__hero .headline { font-size: clamp(44px, 13vw, 60px); }
  .up-hook__title { font-size: 28px; }
  .up-weigh { padding: 10px 12px 12px; }
  .up-weigh__head, .up-weigh__row { grid-template-columns: minmax(0, 1fr) 46px 46px; gap: 8px; }
  .up-meter__seg { width: 12px; height: 7px; }
  .up-meter__text { display: none; }
  .up-long { display: none; }
  .up-short { display: inline; }
  .up-weigh__opt { font-size: 13px; gap: 7px; }
  .up-weigh__opt .up-key { width: 24px; height: 24px; font-size: 11px; }
  .up-weigh__tag { display: none; }
  .up-rrow { padding: 16px; border-radius: 16px; }
  .up-rrow__name { font-size: 17px; }
  .up-rcard { grid-template-columns: 40% minmax(0, 1fr); gap: 10px; padding: 8px; }
  .up-rcard__pick { font-size: 13.5px; }
  .up-rcard__line { font-size: 12.5px; }
  .up-replay { margin-left: 0; width: 100%; }
  .up-rhero__line { font-size: 16.5px; }
  .up-rhero__title { margin-top: 50px; }
  .up-ring { width: 124px; }
}

/* the retest's light reminder of the habit (not the answer) */
.up-reminder {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin: 0 0 14px; padding: 7px 13px 7px 9px;
  border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink-2);
  font: 700 13.5px/1.3 var(--f-head); box-shadow: var(--shadow);
}
.up-reminder__icon { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--yellow); color: #0b0b0c; }
.up-reminder__icon svg { width: 15px; height: 15px; }
@media (max-width: 979px) { .up-reminder { order: 3; margin: 0; } }

/* ---------- share my result (js/upgradeshare.js): the image preview sheet ---------- */
.up-share-open, .up-share-open body { overflow: hidden; }
.up-share {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(11, 11, 12, 0.62); backdrop-filter: blur(6px); animation: up-fade 0.2s both;
}
.up-share__box {
  display: flex; flex-direction: column; gap: 14px; width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  padding: 20px; border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: var(--card-shadow);
}
.up-share__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.up-share__title { font: 400 28px/1.1 var(--f-serif); letter-spacing: -0.02em; }
.up-share__title b { font-weight: 700; }
.up-share__title:focus { outline: none; }
.up-share__tabs { display: flex; gap: 8px; }
.up-share__tab {
  flex: 1; min-height: 44px; border-radius: 999px; border: 1.5px solid var(--dash); background: var(--paper); color: var(--ink);
  font: 700 13.5px/1 var(--f-head); cursor: pointer;
}
.up-share__tab[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.up-share__preview { display: grid; place-items: center; min-height: 200px; border-radius: 14px; background: #0b0b0c; overflow: hidden; }
.up-share__img { display: block; width: 100%; height: auto; max-height: 52dvh; object-fit: contain; }
.up-share__img:not([src]), .up-share__img[src=""] { visibility: hidden; aspect-ratio: 4 / 5; }
.up-share__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.up-share__actions .btn { flex: 1 1 180px; }
.up-share__actions .btn[hidden] { display: none; }
.up-share__status { font: 600 14px/1.45 var(--f-body); color: var(--green-ink); overflow-wrap: anywhere; }
.up-share__status:empty { display: none; }
.up-share__fine { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
@keyframes up-fade { from { opacity: 0; } }
@media (max-width: 600px) {
  .up-share { padding: 10px; align-items: flex-end; }
  .up-share__box { padding: 16px; border-radius: 20px; max-height: calc(100dvh - 20px); }
  .up-share__img { max-height: 46dvh; }
}
@media (prefers-reduced-motion: reduce) { .up-share { animation: none; } }

/* ---------- the standalone site (upgrade-site/, IQ_CONFIG.standalone) ---------- */
.up-introbar .wordmark { min-width: 0; }
.up-namechip { max-width: 180px; }
.up-ractions--solo { justify-content: center; }
.up-ractions--solo .btn { min-width: min(100%, 280px); }
.up-introbar .theme-btn { flex: none; }
@media (max-width: 520px) {
  .up-introbar { gap: 10px; }
  .up-introbar .wordmark { font-size: 16.5px; }
  .up-introbar .topbar__end { gap: 6px; }
  .up-namechip { max-width: 124px; min-height: 44px; }
  .up-namechip .pf-chip__avatar { width: 27px; height: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  .up-cue__pulse { display: none; }
  .up-pip.is-now, .up-badge.is-open.is-now { animation: none; }
  .up-ring__arc { transition: none; }
}
