/* Shared 1RM calculator pages (weighted pull-up, weighted dip, one rep max).
   Rules: "Calitracker Web Style Guide: Lessons from the 1RM Calculator" at the repo root.
   Brand palette only, dark theme only; anything else is a tint or a mix with the background. */

@font-face {
    font-family: 'Cooper Hewitt';
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: url('https://fonts.cdnfonts.com/s/21211/CooperHewitt-Bold.woff') format('woff');
}

.rm-page {
    --bg: #081217;
    --card: #091318;
    --accent: #F6AE2D;
    --sage: #9ABCA7;
    --tag: #D4F1DF;
    --over: #FE6757;
    --warn: #F0837D;
    --ink: #D9D9D9;
    --soft: #929292;
    --tag-fill: rgb(212 241 223 / 0.08);
    --tag-fill-2: rgb(212 241 223 / 0.14);

    /* base.css tokens, pointed at the brand palette */
    --gold: var(--accent);
    --gold-d: var(--accent);
    --coral: var(--warn);
    --panel: var(--card);
    --text: var(--ink);
    --body: color-mix(in srgb, var(--ink) 82%, var(--bg));
    --muted: var(--soft);
    --line: rgb(217 217 217 / 0.1);
    --line-soft: rgb(217 217 217 / 0.06);
    --display: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --text-font: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --label: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    background: var(--bg);
    color: var(--ink);
    font-family: var(--text-font);
}

.rm-page h1,
.rm-page h2,
.rm-page h3,
.rm-page h3.point {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.rm-page .accent {
    color: inherit;
}

/* No load animation on the title and intro: it flickered on some screens */
.rm-page .hero::before,
.rm-page .hero .breadcrumb,
.rm-page .hero h1,
.rm-page .hero .lede {
    animation: none;
}

/* ── One centred column ── */
.rm-page .hero--compact {
    padding: calc(var(--header-h) + 18px) 0 0;
    text-align: center;
}

.rm-page .hero--compact .wrap {
    max-width: 720px;
}

.rm-page .hero--compact h1 {
    margin-left: auto;
    margin-right: auto;   /* base.css caps the h1 width; without auto margins it sat left of centre */
    font-size: clamp(1.75rem, 5.4vw, 2.5rem);
    line-height: 1.1;
}

.rm-page .hero--compact .lede {
    max-width: 52ch;
    margin: 8px auto 0;
    color: var(--soft);
    font-size: 0.98rem;
}

.rm-page .breadcrumb {
    justify-content: center;
    color: var(--soft);
}

.rm-page .single {
    padding-top: 20px;
}

.rm-page .single .content {
    max-width: 720px;
    margin: 0 auto;
}

@media (min-width: 900px) {
    .rm-page .hero--compact {
        padding-top: calc(var(--header-h) + 30px);
    }
}

/* ── Shared controls ── */
.rmc input[type="radio"],
.rm-page .plan-form input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pill,
.toggle label,
.round,
.fpill {
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.pill span,
.pill select {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--tag-fill);
    color: var(--ink);
    font: 500 0.95rem/1 var(--text-font);
    transition: background-color 0.15s, color 0.15s;
}

.pill input:checked + span,
.pill--more.is-on select {
    background: var(--sage);
    color: var(--bg);
    font-weight: 600;
}

.pill input:focus-visible + span,
.toggle input:focus-visible + span,
.round input:focus-visible + span,
.fpill input:focus-visible + .fpill-in,
.pill select:focus-visible {
    outline: 2px solid var(--sage);
    outline-offset: 2px;
}

.pill--sm span {
    min-height: 34px;
    padding: 0 14px;
    font-size: 0.88rem;
}

.pill--more {
    display: inline-flex;
    align-items: center;
}

.pill--more select {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    padding-right: 34px;
    cursor: pointer;
}

.pill--more select option {
    background: var(--card);
    color: var(--ink);
}

.pill--more svg {
    position: absolute;
    right: 15px;
    pointer-events: none;
    color: currentColor;
}

.pill--more.is-on svg {
    color: var(--bg);
}

/* Two-segment toggle, like the app's calendar switch */
.toggle {
    display: inline-flex;
    padding: 4px;
    border-radius: 999px;
    background: var(--tag-fill);
}

.toggle span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    color: var(--soft);
    font: 600 0.88rem/1 var(--text-font);
    transition: background-color 0.15s, color 0.15s;
}

.toggle input:checked + span {
    background: var(--tag-fill-2);
    color: var(--ink);
}

.ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: var(--tag-fill);
    color: var(--ink);
    font: 500 0.88rem/1 var(--text-font);
    cursor: pointer;
}

.ghost svg {
    color: var(--sage);
}

.ghost:hover,
.step:hover {
    background: var(--tag-fill-2);
}

.ghost:focus-visible,
.step:focus-visible,
.btn-sage:focus-visible {
    outline: 2px solid var(--sage);
    outline-offset: 2px;
}

/* ── Surfaces ── */
.glass {
    position: relative;
    border-radius: 44px;
    background: linear-gradient(180deg, rgb(217 217 217 / 0.045), rgb(217 217 217 / 0) 120px), var(--card);
    border: 1px solid rgb(217 217 217 / 0.16);
    box-shadow: 0 0 48px rgb(154 188 167 / 0.07);
}

.panel {
    border-radius: 30px;
    background: var(--bg);
    border: 1px solid rgb(217 217 217 / 0.09);
}

/* ── Calculator ── */
.rmc {
    margin: 0;
    padding: 0;
    border: 0;
}

.rmc-ex {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 8px 0 14px;
}

.rmc-card {
    display: grid;
    gap: 18px;
    padding: 22px;
    text-align: center;
}

.rmc-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.rmc-actions {
    display: flex;
    gap: 8px;
}

/* Inputs: big tappable numbers with steppers (no sliders: exact kilos are typed or stepped) */
.tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.tile {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 14px 8px 12px;
    border-radius: 28px;
    background: var(--bg);
    border: 1px solid rgb(217 217 217 / 0.09);
}

.tile-label {
    color: var(--soft);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.2;
}

.tile-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    width: 100%;
}

.tile-num {
    width: 100%;
    max-width: 5.2ch;
    padding: 2px 0;
    border: 0;
    border-bottom: 1px dashed rgb(217 217 217 / 0.18);
    background: transparent;
    color: var(--ink);
    font: 700 1.75rem/1.1 var(--display);
    letter-spacing: -0.02em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.tile-num:focus {
    outline: none;
    border-bottom-color: var(--sage);
}

.tile-unit {
    color: var(--sage);
    font-size: 0.9rem;
    font-weight: 500;
}

.tile-steps {
    display: flex;
    gap: 8px;
}

.step {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--tag-fill);
    color: var(--ink);
    font: 500 1.25rem/1 var(--text-font);
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.step:active {
    background: var(--sage);
    color: var(--bg);
}

/* Result: the ring and the plates side by side */
.rmc-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 18px;
}

.ring-wrap {
    position: relative;
    width: 100%;
    max-width: 240px;
    justify-self: center;
    aspect-ratio: 1;
}

.ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring circle {
    fill: none;
    stroke-width: 12;
}

.ring-track {
    stroke: rgb(212 241 223 / 0.07);
}

.ring-lap {
    stroke-linecap: round;
    stroke-dasharray: 0 553;
    transition: stroke-dasharray 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.ring-lap--1 {
    stroke: var(--accent);
}

.ring-lap--2 {
    stroke: var(--over);
}

.ring-lap--3 {
    stroke: var(--warn);
}

.ring-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 2px;
}

.ring-label {
    color: var(--soft);
    font-size: 0.8rem;
    font-weight: 500;
}

.ring-fig {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.ring-fig b {
    font: 700 clamp(2.1rem, 9vw, 3.2rem)/1 'Cooper Hewitt', var(--display);
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.ring-fig small {
    color: var(--sage);
    font-size: 1rem;
    font-weight: 500;
}

.plates {
    margin: 0;
    min-width: 0;
}

.plates svg {
    display: block;
    width: 100%;
    max-width: 260px;
    height: auto;
    margin: 0 auto;
    overflow: visible;
}

.plates-line {
    fill: none;
    stroke: rgb(217 217 217 / 0.4);
    stroke-width: 2;
    stroke-linejoin: round;
}

.plates-label {
    fill: var(--ink);
    font: 500 12px var(--text-font);
}

.plates-bar,
.plates-empty {
    fill: var(--soft);
    font: 500 12px var(--text-font);
}

/* Rep targets */
.targets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.custom-reps {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--soft);
    font-size: 0.88rem;
}

.custom-reps[hidden] {
    display: none;
}

.custom-num {
    width: 3ch;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: var(--tag-fill);
    color: var(--ink);
    font: 600 0.95rem var(--text-font);
    text-align: center;
}

/* Three figures */
.figs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.fig {
    display: grid;
    gap: 4px;
    align-content: start;
}

.fig b {
    color: var(--ink);
    font: 700 1.2rem/1.15 var(--display);
    font-variant-numeric: tabular-nums;
}

.fig span {
    color: var(--soft);
    font-size: 0.78rem;
    line-height: 1.3;
}

.rm-warn {
    margin: -6px 0 0;
    color: var(--warn);
    font-size: 0.85rem;
}

/* Formulas */
.formulas {
    display: grid;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgb(217 217 217 / 0.08);
}

.rm-note,
.rm-avg {
    margin: 0;
    color: var(--soft);
    font-size: 0.86rem;
    line-height: 1.5;
}

.rm-note span {
    display: block;
}

.fpills {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.fpill-in {
    display: grid;
    gap: 3px;
    height: 100%;
    padding: 12px 8px;
    border-radius: 22px;
    background: var(--tag-fill);
    transition: background-color 0.15s, color 0.15s;
}

.fpill-in b {
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 600;
}

.fpill-in small {
    color: var(--soft);
    font-size: 0.68rem;
    line-height: 1.3;
}

.fpill-in em {
    color: var(--sage);
    font-style: normal;
    font-size: 0.95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.fpill input:checked + .fpill-in {
    background: var(--sage);
}

.fpill input:checked + .fpill-in b,
.fpill input:checked + .fpill-in small,
.fpill input:checked + .fpill-in em {
    color: var(--bg);
}

/* Reps in Reserve: round buttons, like the app's equipment picker */
.rir {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid rgb(217 217 217 / 0.08);
}

.rir-label {
    color: var(--soft);
    font-size: 0.86rem;
    font-weight: 500;
}

.rir-btns {
    display: flex;
    gap: 10px;
}

.round span {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--tag-fill);
    color: var(--ink);
    font: 600 1rem/1 var(--text-font);
    transition: background-color 0.15s, color 0.15s;
}

.round input:checked + span {
    background: var(--sage);
    color: var(--bg);
}

/* ── Where you stand: rank on the left, the ISF ladder on the right ── */
.rmc-rank {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
    align-items: center;
    gap: 28px;
    margin-top: 14px;
    padding: 36px 32px;
}

.rmc-rank[hidden] {
    display: none;
}

.rank-main {
    display: grid;
    justify-items: center;
    text-align: center;
}

.rank-main .toggle {
    margin-bottom: 18px;
}

.content p.rank-cls {
    margin: 0;
    color: var(--soft);
    font-size: 1rem;
}

.content p.rank-name {
    margin: 4px 0 8px;
    color: var(--soft);
    font: 700 clamp(2.6rem, 7vw, 3.6rem)/1.05 var(--display);
    letter-spacing: -0.045em;
}

.content p.rank-name.is-ranked {
    color: var(--accent);
}

.content p.rank-line {
    margin: 0;
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1.4;
}

.rank-diff {
    color: var(--sage);
}

.rank-bar {
    width: 100%;
    height: 9px;
    margin-top: 22px;
    border-radius: 999px;
    background: rgb(212 241 223 / 0.1);
    overflow: hidden;
}

.rank-bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--accent);
    transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.rank-ends {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 8px;
    color: var(--soft);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.rank-main .btn-sage {
    height: 52px;
    margin-top: 26px;
    padding: 0 30px;
    font-size: 1rem;
}

.content p.rank-src {
    margin: 14px 0 0;
    color: var(--soft);
    font-size: 0.72rem;
    line-height: 1.4;
}

/* The ladder: number squares like the app's set rows */
.content ol.rank-ladder {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rank-ladder li {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 54px;
    margin: 0;
    padding: 5px 12px 5px 6px;
    border: 1px solid transparent;
    border-radius: 20px;
    color: var(--ink);
}

.lad-sq {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgb(212 241 223 / 0.09);
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.lad-name {
    font-size: 1.06rem;
    line-height: 1.3;
}

.lad-kg {
    font-size: 1.06rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
}

.lad-kg em {
    color: var(--sage);
    font-style: normal;
}

.rank-ladder .is-above .lad-name,
.rank-ladder .is-above .lad-kg {
    color: var(--soft);
}

.rank-ladder .is-above.is-next .lad-kg {
    color: var(--ink);
}

.rank-ladder .is-below .lad-sq {
    color: var(--sage);
}

.rank-ladder .is-current {
    border-color: rgb(246 174 45 / 0.45);
    background: rgb(246 174 45 / 0.08);
}

.rank-ladder .is-current .lad-sq {
    background: var(--accent);
    color: var(--bg);
}

.rank-ladder .is-current .lad-name {
    font-weight: 700;
}

.btn-sage {
    margin-top: 6px;
    height: 42px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: var(--sage);
    color: var(--bg);
    font: 600 0.9rem/1 var(--text-font);
    cursor: pointer;
}

.content p.rm-foot {
    margin: 14px 0 0;
    color: var(--soft);
    font-size: 0.8rem;
    text-align: center;
}

/* ── App card: centred on phones; logo, text and a working QR code side by side on computers ── */
.rm-app {
    display: grid;
    justify-items: center;
    gap: 14px;
    margin: 28px 0 56px;
    padding: 26px 22px;
    text-align: center;
}

.rm-app-logo {
    width: 56px;
    height: 56px;
}

.content .rm-app h2 {
    margin: 0;
    font-size: 1.2rem;
}

.content .rm-app p {
    margin: 6px 0 0;
    color: var(--soft);
    font-size: 0.92rem;
}

.rm-app .store-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.rm-app .store-img {
    width: 150px;
    height: auto;
}

.rm-app .qr-code {
    width: 112px;
    height: 112px;
    padding: 8px;
}

.rm-app .qr-text b {
    color: var(--ink);
}

.rm-app .qr-alt {
    color: var(--soft);
    font-size: 0.8rem;
}

@media (min-width: 961px) {
    .rm-app.has-qr {
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 22px;
        padding: 24px 28px;
        text-align: left;
    }

    .rm-app.has-qr .qr-card {
        display: flex;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .rm-app.has-qr .qr-text {
        max-width: 180px;
    }

    .rm-app.has-qr .store-row {
        display: none;
    }
}

.content p.calc-app {
    margin: -42px 0 56px;
    color: var(--soft);
    font-size: 0.85rem;
    text-align: center;
}

.content h3.point {
    margin: 26px 0 6px;
    font-size: 1.05rem;
}

/* ── Streetlifting total: the same card, four lift panels ── */
.sl .tile--bw {
    justify-self: center;
    width: min(240px, 100%);
}

.lift-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.lift-panel {
    --lift: var(--accent);
    min-width: 0;
    margin: 0;
    padding: 12px 14px 14px;
    border-radius: 28px;
    background: var(--bg);
    border: 1px solid rgb(217 217 217 / 0.09);
}

.lift-panel[data-lift="pu"],
.share-list [data-lift="pu"] { --lift: var(--sage); }

.lift-panel[data-lift="dip"],
.share-list [data-lift="dip"] { --lift: var(--over); }

.lift-panel[data-lift="sq"],
.share-list [data-lift="sq"] { --lift: var(--ink); }

.lift-head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0;
    margin-bottom: 10px;
    float: left;
}

.lift-head + * {
    clear: both;
}

.lift-sq {
    display: grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--lift) 20%, var(--bg));
    color: var(--lift);
    font-size: 0.82rem;
    font-weight: 700;
}

.lift-name {
    flex: 1;
    min-width: 0;
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
}

.lift-out {
    color: var(--sage);
    font-size: 0.95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.lift-inputs {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 8px;
}

.mini {
    display: grid;
    gap: 4px;
    justify-items: center;
    min-width: 0;
}

.mini-label {
    color: var(--soft);
    font-size: 0.74rem;
    line-height: 1.2;
}

.mini-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mini .step {
    width: 34px;
    height: 34px;
    flex: none;
    font-size: 1.1rem;
}

.mini-val {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
    min-width: 0;
}

.mini-num {
    width: 4ch;
    padding: 2px 0;
    border: 0;
    border-bottom: 1px dashed rgb(217 217 217 / 0.18);
    background: transparent;
    color: var(--ink);
    font: 700 1.15rem/1.1 var(--display);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.mini-num:focus {
    outline: none;
    border-bottom-color: var(--sage);
}

.mini-unit {
    color: var(--sage);
    font-size: 0.75rem;
}

.lift-panel.is-off .lift-out,
.lift-panel.is-off .lift-name {
    color: var(--soft);
}

.sl-skip {
    margin-top: -6px !important;
}

.ring-seg {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dasharray 0.35s cubic-bezier(0.22, 1, 0.36, 1), stroke-dashoffset 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.content ul.share-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0 6px;
    list-style: none;
}

.share-list li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 9px 12px;
    border-radius: 14px;
    background: var(--tag-fill);
    font-size: 0.92rem;
}

.share-list li::before {
    display: none;
}

.share-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--lift, var(--accent));
}

.share-name {
    color: var(--ink);
    text-align: left;
}

.share-val {
    color: var(--ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.share-list li.is-off .share-name,
.share-list li.is-off .share-val {
    color: var(--soft);
}

@media (max-width: 640px) {
    .lift-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .lift-panel {
        padding: 10px 12px 12px;
        border-radius: 24px;
    }

    .content ul.share-list {
        padding: 0;
    }
}

/* ── Workout planner: choices in a glass card, each day as a card of numbered rows ── */
.rm-page .tool {
    margin-bottom: 0;
}

.rm-page .plan-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 24px 22px;
    border-bottom: 1px solid rgb(217 217 217 / 0.16);
    text-align: center;
}

.rm-page .plan-form .f-label {
    display: block;
    margin-bottom: 10px;
    color: var(--soft);
    font-size: 0.86rem;
    font-weight: 500;
}

.rm-page .opt-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.rm-page .plan-form .f-hint {
    margin-top: 8px;
    min-height: 0;
    color: var(--soft);
    font-size: 0.8rem;
}

.rm-page .plan-top {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-top: 30px;
    text-align: center;
}

.rm-page .plan-top .eyebrow {
    color: var(--soft);
    font-size: 0.86rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.rm-page .plan-title {
    margin-top: 6px;
    color: var(--ink);
    font: 700 clamp(1.5rem, 5vw, 2.1rem)/1.15 var(--display);
    letter-spacing: -0.02em;
}

.rm-page .plan-sum {
    color: var(--ink);
    font-size: 0.95rem;
}

.rm-page .plan-sum span {
    margin-top: 2px;
    color: var(--soft);
    font-size: 0.84rem;
}

.rm-page .plan-actions {
    justify-content: center;
    gap: 8px;
}

.rm-page .warmup {
    margin-top: 22px;
    padding: 12px 18px;
    border: 1px solid rgb(217 217 217 / 0.09);
    border-radius: 22px;
    background: var(--bg);
    color: var(--soft);
    font-size: 0.86rem;
    text-align: center;
}

.rm-page .days {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin-top: 16px;
}

@media (min-width: 760px) {
    .rm-page .days {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.rm-page .days.is-new {
    animation: none;
}

.rm-page .day {
    padding: 18px 16px 16px;
    border-radius: 36px;
    background: linear-gradient(180deg, rgb(217 217 217 / 0.045), rgb(217 217 217 / 0) 120px), var(--card);
    border: 1px solid rgb(217 217 217 / 0.16);
    box-shadow: 0 0 48px rgb(154 188 167 / 0.07);
}

.rm-page .day-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 4px 12px;
}

.rm-page .day-num {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--bg);
    -webkit-text-stroke: 0;
    font: 700 1rem/1 var(--display);
    letter-spacing: 0;
}

.rm-page .content .day-head h3 {
    color: var(--ink);
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.rm-page .day-meta {
    color: var(--soft);
    font-size: 0.8rem;
}

.rm-page .day .session,
.rm-page .day .session tbody {
    display: block;
    width: 100%;
    margin: 0;
}

.rm-page .day .session tr {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    padding: 10px 12px 10px 10px;
    border: 1px solid rgb(217 217 217 / 0.09);
    border-radius: 18px;
    background: var(--bg);
}

.rm-page .day .session th,
.rm-page .day .session td {
    display: block;
    padding: 0;
    border: 0;
    background: none;
}

.rm-page .day .session th {
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
}

.rm-page .day .session th a {
    color: var(--ink);
    text-decoration-color: rgb(154 188 167 / 0.45);
    text-underline-offset: 3px;
}

.rm-page .day .session th a:hover {
    color: var(--sage);
}

.rm-page .day .session .nx {
    display: block;
    margin-top: 2px;
    color: var(--soft);
    font-size: 0.74rem;
    font-weight: 400;
}

.rm-page .day .session td:last-child {
    color: var(--sage);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.rm-page .day .session td:last-child {
    display: grid;
    justify-items: end;
}

.rm-page .day .session td:last-child .nx {
    text-align: right;
}

.rm-page .hero .kicker {
    color: var(--soft);
    font-size: 0.95rem;
    font-weight: 500;
}

.rm-page .plan-form {
    margin-top: 14px;
}

.rm-page .ex-n span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: rgb(212 241 223 / 0.09);
    color: var(--ink);
    font-size: 0.76rem;
    font-weight: 600;
}

.rm-page .plan-note {
    margin-top: 16px;
    color: var(--soft);
    font-size: 0.84rem;
    text-align: center;
}

@media (max-width: 640px) {
    .rm-page .plan-form {
        padding: 20px 12px;
    }

    .rm-page .plan-form .pill span {
        padding: 0 14px;
        font-size: 0.88rem;
    }

    .rm-page .plan-actions .ghost span {
        position: static;
        width: auto;
        height: auto;
        clip: auto;
    }

    .rm-page .plan-actions .ghost {
        width: auto;
        padding: 0 14px;
    }

    .rm-page .day {
        padding: 16px 10px 12px;
        border-radius: 30px;
    }

    .rm-page .day .session tr {
        gap: 10px;
        padding: 9px 10px 9px 8px;
    }
}

@media print {
    .rm-page .day {
        padding: 0;
        border: 0;
        background: none;
        box-shadow: none;
        break-inside: avoid;
    }

    .rm-page .day-num {
        background: none;
        color: #000;
        border: 1.5px solid #000;
    }

    .rm-page .content .day-head h3,
    .rm-page .day .session th,
    .rm-page .day .session th a,
    .rm-page .day .session td:last-child,
    .rm-page .plan-title,
    .rm-page .plan-sum {
        color: #000;
    }

    .rm-page .day .session tr {
        border: 0;
        border-bottom: 1px solid #c6d0d2;
        border-radius: 0;
        background: none;
    }

    .rm-page .ex-n span {
        background: none;
        border: 1px solid #c6d0d2;
        color: #000;
    }

    .rm-page .warmup {
        background: none;
        color: #000;
    }

    .rm-page .rm-foot,
    .rm-page .rm-bar {
        display: none;
    }
}

/* ── Phone result bar, like the app's bottom nav ── */
.rm-bar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 34px;
    border: 1px solid rgb(217 217 217 / 0.16);
    background: rgb(9 19 24 / 0.86);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    color: var(--ink);
    font: 500 0.88rem var(--text-font);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.rm-bar.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.rm-bar-label {
    color: var(--soft);
}

.rm-bar-value {
    font: 700 1.25rem/1 'Cooper Hewitt', var(--display);
}

@media (min-width: 761px) {
    .rm-bar {
        display: none;
    }
}

/* ── Phones ── */
@media (max-width: 640px) {
    .rm-page .wrap {
        padding: 0 16px;
    }

    .glass {
        border-radius: 36px;
    }

    .targets {
        gap: 4px;
    }

    .pill--sm span {
        padding: 0 9px;
        font-size: 0.82rem;
    }

    .rmc-card {
        gap: 16px;
        padding: 16px 12px 20px;
    }

    .rmc-top {
        padding: 2px 4px 0;
    }

    .ghost {
        width: 40px;
        padding: 0;
        justify-content: center;
    }

    .ghost span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .tiles {
        gap: 6px;
    }

    .tile {
        padding: 12px 4px 10px;
        border-radius: 24px;
    }

    .tile-num {
        font-size: 1.45rem;
    }

    .tile-unit {
        font-size: 0.8rem;
    }

    .tile-steps {
        gap: 6px;
    }

    .step {
        width: 38px;
        height: 38px;
    }

    /* Ring on top, plates under it at full width, so the plate labels stay readable */
    .rmc-result {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 14px 12px 10px;
        border-radius: 28px;
    }

    .ring-wrap {
        max-width: 210px;
    }

    .plates svg {
        max-width: 280px;
        max-height: 150px;
    }

    .fpills {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rm-note,
    .rm-avg {
        font-size: 0.8rem;
    }

    .round span {
        width: 48px;
        height: 48px;
    }

    .rmc-rank {
        grid-template-columns: 1fr;
        gap: 22px;
        padding: 26px 14px 16px;
    }

    .rank-ladder li {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        gap: 12px;
        min-height: 50px;
    }

    .lad-sq {
        width: 40px;
        height: 40px;
        font-size: 0.78rem;
    }

    .lad-name,
    .lad-kg {
        font-size: 0.95rem;
    }
}

@media (max-width: 370px) {
    .step {
        width: 34px;
        height: 34px;
    }

    .rir-btns {
        gap: 6px;
    }

    .round span {
        width: 44px;
        height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ring-lap,
    .rank-bar span,
    .rm-bar {
        transition: none;
    }
}
