/* Favourites */
.fav-avatar,
.fav-avatar.social-person-avatar {
    position: relative;
    overflow: visible;
}
.fav-avatar img { border-radius: 50%; }
.social-post-avatar.fav-avatar,
.social-comment-avatar.fav-avatar,
.profile-avatar-frame.fav-avatar { position: relative; overflow: visible; }
.profile-avatar-frame.fav-avatar .profile-avatar-fallback { border-radius: 50%; }
.profile-avatar-frame.fav-avatar .fav-heart-badge { right: 0; bottom: 0; width: 28px; height: 28px; }
.profile-avatar-frame.fav-avatar .fav-heart-badge svg { width: 26px; height: 26px; }
.fav-heart-badge {
    position: absolute;
    right: -8px;
    bottom: -7px;
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    filter: drop-shadow(0 0 1.5px var(--panel-bg)) drop-shadow(0 0 1px var(--panel-bg));
}
.fav-heart-badge svg { width: 16px; height: 16px; fill: var(--accent); }
.fav-heart-badge.is-inline { position: static; display: inline-grid; width: 14px; height: 14px; margin-left: 5px; vertical-align: -2px; filter: none; }
.fav-heart-badge.is-inline svg { width: 13px; height: 13px; }

.favourite-toggle {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    padding: 0;
    color: var(--muted-text);
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}
.favourite-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.favourite-toggle:hover,
.favourite-toggle.is-favourite { color: var(--accent); }
.favourite-toggle.is-favourite svg { fill: var(--accent); }

.workout-friends-search {
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--soft-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
}

/* Body balance (Profile and Performance): one bar per body part, the most trained one in full green. */
.body-balance { display: grid; gap: 9px; }
.body-balance-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 38px; align-items: center; gap: 10px; }
.body-balance-label { color: var(--text); font-size: 12px; font-weight: 600; }
.body-balance-track { height: 8px; overflow: hidden; background: color-mix(in srgb, var(--text) 6%, transparent); border-radius: 999px; }
.body-balance-track span { display: block; height: 100%; background: color-mix(in srgb, var(--accent) 45%, transparent); border-radius: inherit; transition: width 400ms cubic-bezier(0.2, 0.75, 0.25, 1); }
.body-balance-row.is-top .body-balance-track span { background: var(--accent); }
.body-balance-value { color: var(--muted-text); font-size: 11px; font-weight: 600; text-align: right; }
.body-balance-row.is-top .body-balance-value { color: var(--accent); }
.body-balance-row.is-empty .body-balance-label { color: var(--muted-text); }
.body-balance-note,
.body-balance-empty { margin-top: 2px; color: var(--muted-text); font-size: 11px; line-height: 1.45; }
@media (prefers-reduced-motion: reduce) { .body-balance-track span { transition: none; } }

/* ----- Premium ----- */

/* "Go Premium" in the menu shares the Coach style (below), with filled text and crown. */

/* Account menu: Premium badge, or the free plan with an upgrade link. */
.account-plan { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; color: var(--muted-text); font-size: 11px; }
.account-plan a { color: var(--accent); font-weight: 600; text-decoration: none; }
.account-plan a:hover { text-decoration: underline; }
.account-premium-badge { padding: 2px 7px; color: var(--accent-ink); background: var(--accent); border-radius: 999px; font-size: 9px; font-weight: 700; letter-spacing: .6px; }

/* A Premium feature for free users: the content is faded out and a card explains it. */
.premium-locked { position: relative; }
.premium-locked-content { filter: blur(3px) grayscale(.4); opacity: .4; pointer-events: none; user-select: none; }
.premium-lock-overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: start center; padding: 32px 16px; }
.premium-lock-overlay[hidden] { display: none; }
.premium-lock-card {
    display: grid;
    justify-items: center;
    gap: 8px;
    width: min(100%, 420px);
    padding: 26px 24px;
    text-align: center;
    background: color-mix(in srgb, var(--panel-bg) 94%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
    border-radius: 14px;
    box-shadow: 0 18px 44px rgb(0 0 0 / 30%);
}
.premium-lock-icon { display: grid; width: 46px; height: 46px; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: 50%; }
.premium-lock-icon svg { width: 24px; height: 24px; fill: var(--accent); }
.premium-lock-kicker { color: var(--accent); font-size: 12px; font-weight: 700; }
.premium-lock-card h2 { color: var(--text); font-size: 20px; }
.premium-lock-text { color: var(--muted-text); font-size: 13px; line-height: 1.5; }
.premium-lock-button { margin-top: 6px; padding: 10px 18px; color: var(--accent-ink); background: var(--accent); border-radius: 999px; font-size: 13px; font-weight: 700; text-decoration: none; }
.premium-lock-button:hover { background: color-mix(in srgb, var(--accent) 88%, white); }
.premium-lock-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* The Premium crown: a small glowing chip that marks Premium members and features. */
.premium-crown {
    display: inline-grid;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    place-items: center;
    vertical-align: middle;
    background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--accent) 28%, transparent), color-mix(in srgb, var(--accent) 10%, transparent));
    border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border));
    border-radius: 50%;
    box-shadow: none;
}
.premium-crown svg { width: 55%; height: 55%; fill: var(--accent); }

/* A Premium feature the user has unlocked: an accent edge and a slow sheen, so it reads as special. */
.premium-surface {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    /* Pages whose panels set their own background reuse these, e.g. .some-panel.premium-surface { background: var(--premium-surface-bg); }. */
    --premium-surface-bg:
        radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%),
        radial-gradient(ellipse at 0% 100%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%),
        color-mix(in srgb, var(--panel-bg) 90%, transparent);
    --premium-surface-border: color-mix(in srgb, var(--accent) 45%, var(--border));
    --premium-surface-shadow: inset 0 1px 0 color-mix(in srgb, var(--accent) 22%, transparent), 0 0 32px color-mix(in srgb, var(--accent) 9%, transparent);
    background: var(--premium-surface-bg);
    border-color: var(--premium-surface-border);
    box-shadow: var(--premium-surface-shadow);
}
.premium-surface::after {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(110deg, transparent 35%, color-mix(in srgb, var(--accent) 9%, transparent) 50%, transparent 65%);
    background-size: 250% 100%;
    animation: premium-sheen 7s ease-in-out infinite;
    content: "";
    pointer-events: none;
}
@keyframes premium-sheen {
    0% { background-position: 120% 0; }
    60%, 100% { background-position: -120% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .premium-surface::after { animation: none; opacity: 0; }
}

/* Slim scrollbars in the accent colour for everything that scrolls inside a page (lists, tables, popups). Chrome, Edge and Safari use the
   ::-webkit-scrollbar rules (which also drop the arrow buttons); Firefox uses scrollbar-color.
   :where() adds no weight, so a list with its own scrollbar (or none) keeps it. */
:where(body *)::-webkit-scrollbar { width: 8px; height: 8px; }
:where(body *)::-webkit-scrollbar-track { background: transparent; }
:where(body *)::-webkit-scrollbar-button { display: none; }
:where(body *)::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 45%, var(--border)); border: 2px solid var(--panel-bg); border-radius: 999px; }
:where(body *)::-webkit-scrollbar-thumb:hover { background: var(--accent); }
@supports not selector(::-webkit-scrollbar) {
    :where(body *) { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 55%, var(--border)) transparent; }
}
/* The page's own scrollbar: slim and see-through, so it fits light and dark mode and every theme
   (the theme colours live on <body>, which the page scrollbar can't see). */
html::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-button { display: none; }
html::-webkit-scrollbar-thumb { background: rgb(128 128 140 / 38%); border: 3px solid transparent; border-radius: 999px; background-clip: padding-box; }
html::-webkit-scrollbar-thumb:hover { background-color: rgb(128 128 140 / 62%); }
@supports not selector(::-webkit-scrollbar) {
    html { scrollbar-width: thin; scrollbar-color: rgb(128 128 140 / 45%) transparent; }
}

/* "Saved" confirmation on a button: it pops and sends out one ring of the accent colour. */
.save-confirmed { position: relative; animation: save-confirmed-pop 460ms cubic-bezier(0.2, 0.75, 0.25, 1.3); }
.save-confirmed::after {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    content: "";
    pointer-events: none;
    animation: save-confirmed-ring 750ms ease-out forwards;
}
@keyframes save-confirmed-pop {
    0% { transform: scale(1); }
    35% { transform: scale(0.94); }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
@keyframes save-confirmed-ring {
    from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
    to { box-shadow: 0 0 0 16px color-mix(in srgb, var(--accent) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
    .save-confirmed,
    .save-confirmed::after { animation: none; }
}

/* Welcome screen */
.welcome-screen {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding: 10vh 32px 48px;
    text-align: center;
}

.welcome-screen::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: -12%;
    left: -35%;
    width: 170%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--accent) 8%, transparent) 30%, color-mix(in srgb, var(--accent) 90%, transparent) 50%, color-mix(in srgb, var(--accent) 8%, transparent) 70%, transparent 100%);
    box-shadow: none;
    transform: rotate(-18deg) translateX(-45%);
    animation: light-beam-travel 8s ease-in-out infinite;
    pointer-events: none;
}

.welcome-screen::after {
    content: "";
    position: absolute;
    z-index: 1;
    right: -30%;
    bottom: 18%;
    width: 120%;
    height: 1px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 35%, transparent), transparent);
    box-shadow: none;
    transform: rotate(-18deg) translateX(30%);
    animation: light-beam-secondary 11s ease-in-out 1s infinite;
    pointer-events: none;
}

.welcome-background-fade {
    position: absolute;
    z-index: 0;
    inset: 0;
    background-color: rgb(3 5 3 / 82%);
    animation: background-reveal 1500ms ease-out forwards;
    pointer-events: none;
}

.welcome-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    flex-direction: column;
    max-width: 560px;
}

.welcome-intro {
    animation: welcome-rise 900ms cubic-bezier(.2, .8, .2, 1) both;
}

.welcome-logo {
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
    object-fit: contain;
    filter: drop-shadow(0 0 16px color-mix(in srgb, var(--accent) 38%, transparent));
    animation: logo-glow 2.8s ease-in-out infinite;
}

.welcome-content h1 {
    color: var(--text);
    font-size: clamp(42px, 8vw, 76px);
    letter-spacing: 1px;
}

.welcome-content p {
    margin-top: 14px;
    color: var(--muted-text);
    font-size: 16px;
    line-height: 1.5;
}

.welcome-features {
    width: 100%;
    margin-top: 58px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    animation: welcome-reveal 700ms ease-out 600ms both;
}

.welcome-features-kicker {
    margin-top: 0 !important;
    color: var(--accent) !important;
    font-size: 12px !important;
    font-weight: 600;
}

.welcome-features h2 {
    margin-top: 9px;
    color: var(--text);
    font-size: 22px;
    line-height: 1.25;
}


.join-now-button {
    margin-top: 28px;
    padding: 12px 18px;
    background-color: var(--accent);
    color: var(--accent-ink);
    border: 1px solid var(--accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    animation: welcome-reveal 700ms ease-out 850ms both;
}

.join-now-button:hover {
    background-color: transparent;
    color: var(--accent);
}

.welcome-privacy-link {
    margin-top: 16px;
    padding: 0;
    background: transparent;
    color: var(--text);
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    text-decoration: underline;
    text-underline-offset: 3px;
    animation: welcome-reveal 700ms ease-out 1050ms both;
    transition: color 160ms ease, transform 160ms ease;
}

.welcome-privacy-link:hover { color: var(--accent); transform: translateY(-2px); }
.welcome-privacy-link:active { transform: translateY(0); }
.welcome-privacy-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

@keyframes welcome-rise {
    from { opacity: 0; transform: translateY(35vh); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes logo-glow {
    0%, 100% { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 22%, transparent)); }
    50% { filter: drop-shadow(0 0 22px color-mix(in srgb, var(--accent) 52%, transparent)); }
}

@keyframes background-reveal {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes welcome-reveal {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes light-beam-travel {
    0%, 100% { opacity: 0; transform: rotate(-18deg) translateX(-45%); }
    18%, 78% { opacity: 1; }
    50% { transform: rotate(-18deg) translateX(45%); }
}

@keyframes light-beam-secondary {
    0%, 100% { opacity: 0; transform: rotate(-18deg) translateX(30%); }
    24%, 72% { opacity: 0.8; }
    50% { transform: rotate(-18deg) translateX(-35%); }
}

@media (prefers-reduced-motion: reduce) {
    .welcome-intro,
    .welcome-logo,
    .brand-logo,
    .welcome-features,
    .join-now-button,
    .welcome-privacy-link,
    .welcome-background-fade,
    .welcome-screen::before,
    .welcome-screen::after {
        animation: none;
    }
}

/* Scrollable welcome landing */
.welcome-screen {
    display: block;
    min-height: 100vh;
    min-height: 100svh;
    overflow: clip;
    padding: 0;
    background-color: var(--page-bg);
    text-align: left;
}
/* The background photo sits in a fixed layer a bit taller than the screen (at least 130%, or the
   2:3 photo's full height at this width) and drifts from its top to its bottom as the page scrolls.
   The drift is a scroll-linked transform, so the browser only moves the finished layer instead of
   repainting the photo every frame, and lvh keeps it steady while a phone's address bar slides away.
   Browsers without scroll-linked animations show the top of the photo, still. */
.welcome-screen::before {
    content: "";
    position: fixed;
    z-index: -1;
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    width: auto;
    height: max(130vh, 150vw);
    height: max(130lvh, 150vw);
    background: linear-gradient(rgb(7 9 7 / 46%), rgb(7 9 7 / 46%)), url("../images/landing-page-2026.webp") center / cover no-repeat;
    transform: none;
    animation: none;
    pointer-events: none;
}
@supports (animation-timeline: scroll()) {
    @media (prefers-reduced-motion: no-preference) {
        .welcome-screen::before {
            will-change: transform;
            animation: welcome-background-drift linear both;
            animation-timeline: scroll(root block);
        }
    }
}
@keyframes welcome-background-drift {
    to { transform: translate3d(0, calc(100lvh - max(130lvh, 150vw)), 0); }
}
.welcome-screen::after { display: none; }
.welcome-hero {
    position: relative;
    z-index: 2;
    isolation: isolate;
    display: grid;
    min-height: 100vh;
    min-height: 100svh;
    align-content: center;
    justify-items: center;
    padding: 44px 24px;
    overflow: hidden;
    background: transparent;
    text-align: center;
}
.welcome-background-fade {
    position: absolute;
    z-index: 0;
    inset: 0;
    background: linear-gradient(180deg, rgb(7 9 7 / 24%), rgb(7 9 7 / 42%));
    animation: background-reveal 1500ms ease-out forwards;
    pointer-events: none;
}
.welcome-light-field {
    position: absolute;
    z-index: 1;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.welcome-light-streak {
    position: absolute;
    top: var(--streak-top);
    left: var(--streak-left);
    width: var(--streak-width);
    height: 2px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 12%, transparent) 24%, color-mix(in srgb, var(--accent) 72%, transparent) 50%, color-mix(in srgb, var(--accent) 18%, transparent) 76%, transparent);
    border-radius: 999px;
    box-shadow: 0 0 var(--streak-blur) color-mix(in srgb, var(--accent) 52%, transparent);
    filter: blur(.35px);
    opacity: 0;
    mix-blend-mode: screen;
    transform: translate3d(-5vw, 0, 0) rotate(var(--streak-angle)) scaleX(.76);
    animation: welcome-random-light var(--streak-duration) ease-in-out var(--streak-delay) infinite alternate;
}
.welcome-content {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(880px, 100%);
    max-width: none;
    align-items: center;
    flex-direction: column;
}
.welcome-brand { display: grid; justify-items: center; gap: 9px; }
.welcome-hero-reveal { opacity: 0; animation: welcome-hero-arrive 700ms cubic-bezier(0.2, 0.75, 0.25, 1) both; }
.welcome-hero-reveal--brand { animation-delay: 180ms; }
.welcome-hero-reveal--tagline { animation-delay: 460ms; }
.welcome-hero-reveal--action { animation-delay: 720ms; }
.welcome-logo { width: 72px; height: 72px; margin: 0; }
.welcome-content h1 { color: var(--text); font-size: 82px; line-height: 1; }
.welcome-content p { margin-top: 0; color: var(--muted-text); }
.welcome-tagline { max-width: 560px; margin-top: 24px !important; color: var(--muted-text) !important; font-size: 16px !important; line-height: 1.55; font-weight: 400; }
.welcome-content .join-now-button,
.welcome-bottom-cta .join-now-button { min-height: 44px; margin-top: 24px; padding: 12px 22px; }
.welcome-scroll-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 30px;
    color: var(--text);
    font-size: 12px;
    text-decoration: none;
}
.welcome-scroll-link span { color: var(--accent); font-size: 18px; }
.welcome-scroll-link:hover { color: var(--accent); }
.welcome-scroll-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.welcome-features {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 64px 38px 34px;
    border: 0;
}
.welcome-features-heading { max-width: 540px; margin: 0 auto; text-align: center; }
.welcome-features-kicker { margin: 0 !important; color: var(--accent) !important; font-size: 12px !important; font-weight: 600; }
.welcome-features h2 { margin-top: 10px; color: var(--text); font-size: 32px; line-height: 1.2; }
.welcome-feature-track {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    margin-top: 46px;
}
.welcome-feature-route {
    position: absolute;
    z-index: 0;
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: calc(100% - var(--welcome-route-end-gap, 44px));
    overflow: visible;
    pointer-events: none;
    /* The line fades in from nothing at the top instead of starting at a hard point. */
    -webkit-mask-image: linear-gradient(transparent, #000 90px);
    mask-image: linear-gradient(transparent, #000 90px);
}
.welcome-feature-route-glow,
.welcome-feature-route-line { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; }
.welcome-feature-route-glow,
.welcome-feature-route-line { stroke-dasharray: 1000; stroke-dashoffset: 1000; }
.welcome-feature-route-glow { stroke-width: 13; opacity: .2; filter: blur(5px); }
.welcome-feature-route-line { stroke-width: 2; opacity: .86; filter: drop-shadow(0 0 7px color-mix(in srgb, var(--accent) 72%, transparent)); }
.welcome-feature-section {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(48%, 500px);
    min-height: 176px;
    grid-template-columns: 38px minmax(0, 1fr);
    align-content: start;
    gap: 15px;
    padding: 21px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--panel-bg) 82%, transparent), color-mix(in srgb, var(--panel-bg) 90%, transparent));
    border: 1px solid color-mix(in srgb, var(--border) 72%, var(--accent) 28%);
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 5%), 0 14px 36px rgb(0 0 0 / 20%);
    opacity: 1;
    transform: translateY(0);
    transition: opacity 520ms ease, transform 520ms cubic-bezier(0.2, 0.75, 0.25, 1);
}
.welcome-screen.has-scroll-reveal .welcome-feature-section:not(.is-visible) { opacity: 0; transform: translateY(18px); }
.welcome-feature-section:nth-of-type(odd) { grid-column: 1; justify-self: start; }
.welcome-feature-section:nth-of-type(even) { grid-column: 1; justify-self: end; }
.welcome-feature-section:nth-of-type(1) { animation-delay: 160ms; }
.welcome-feature-section:nth-of-type(2) { animation-delay: 280ms; }
.welcome-feature-section:nth-of-type(3) { animation-delay: 400ms; }
.welcome-feature-section:nth-of-type(4) { animation-delay: 520ms; }
.welcome-feature-section:nth-of-type(5) { animation-delay: 640ms; }
.welcome-feature-number {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--border));
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}
.welcome-feature-label { margin: 1px 0 7px !important; color: var(--accent) !important; font-size: 12px !important; font-weight: 600; }
.welcome-feature-section h3 { color: var(--text); font-size: 18px; line-height: 1.25; }
.welcome-feature-section div > p:not(.welcome-feature-label) { margin-top: 9px !important; color: var(--muted-text); font-size: 13px !important; line-height: 1.55; }
.welcome-bottom-cta {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 16px;
    margin-top: 54px;
    padding: 0 20px;
    text-align: center;
}
.welcome-bottom-cta p {
    position: relative;
    z-index: 1;
    color: var(--muted-text);
    font-size: 16px;
    line-height: 1.55;
    font-weight: 400;
}
.welcome-bottom-cta .join-now-button {
    position: relative;
    z-index: 1;
    margin-top: 0;
    box-shadow: 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent);
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 240ms ease, transform 180ms ease;
}
.welcome-bottom-cta.is-route-complete .join-now-button {
    box-shadow: none;
}
.welcome-bottom-cta .join-now-button:hover {
    background-color: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
    box-shadow: none;
    transform: translateY(-1px);
}
.welcome-footer {
    display: flex;
    justify-content: center;
    padding: 14px 20px max(22px, env(safe-area-inset-bottom));
    background: transparent;
    border-top: 1px solid var(--border);
}
.welcome-privacy-link { margin: 0; color: var(--muted-text); font-size: 12px; animation: none; }

/* Top bar: the name on the left, a quiet Sign in on the right. */
.welcome-topbar {
    position: absolute;
    z-index: 5;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: max(16px, env(safe-area-inset-top)) max(clamp(16px, 2.2vw, 32px), env(safe-area-inset-right)) 0 max(clamp(16px, 2.2vw, 32px), env(safe-area-inset-left));
}
.welcome-topbar-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-size: 16px; font-weight: bold; letter-spacing: .2px; }
.welcome-topbar-brand img { width: 28px; height: 28px; }
.welcome-topbar .join-now-button {
    min-height: 36px;
    margin: 0;
    padding: 8px 16px;
    color: var(--text);
    background: color-mix(in srgb, var(--panel-bg) 55%, transparent);
    border: 1px solid color-mix(in srgb, var(--text) 22%, transparent);
    font-size: 13px;
    animation: none;
    backdrop-filter: blur(6px);
}
.welcome-topbar .join-now-button:hover { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* Hero: the main button, the explore link next to it, and three short highlights below. */
.welcome-hero-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 26px; margin-top: 30px; }
.welcome-content .welcome-hero-actions .join-now-button {
    min-height: 48px;
    margin: 0;
    padding: 13px 26px;
    color: var(--accent-ink);
    background: var(--accent);
    border-color: var(--accent);
    font-size: 15px;
    animation: none;
    box-shadow: none;
}
.welcome-content .welcome-hero-actions .join-now-button:hover { transform: translateY(-1px); box-shadow: none; }
.welcome-hero-actions .welcome-scroll-link { margin-top: 0; font-size: 13px; }

/* Small feature tags under each route section. */
.welcome-feature-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.welcome-feature-tags li {
    padding: 4px 9px;
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.3;
}

/* "Also in Zevrik": a grid of smaller things worth knowing about. */
.welcome-more { width: 100%; max-width: 1100px; margin: 0 auto; padding: 40px 38px 70px; }
/* "Free means free": a highlighted panel that makes clear logging and splits cost nothing. */
.welcome-free {
    padding: 34px 36px;
    text-align: center;
    background: color-mix(in srgb, var(--panel-bg) 88%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
    border-radius: 10px;
}
.welcome-free h2 { margin-top: 10px; color: var(--text); font-size: 30px; line-height: 1.2; }
.welcome-free > p:not(.welcome-features-kicker) { max-width: 620px; margin: 12px auto 0; color: var(--muted-text); font-size: 15px; line-height: 1.6; }
.welcome-free-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px; max-width: 760px; margin: 24px auto 0; padding: 0; list-style: none; }
.welcome-free-list li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}
.welcome-free-list li::before { content: "\2713"; color: var(--accent); font-weight: bold; }
.welcome-more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.welcome-more-grid article {
    padding: 20px;
    background: color-mix(in srgb, var(--panel-bg) 86%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.welcome-more-grid article.is-premium { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.welcome-more-icon { display: grid; width: 36px; height: 36px; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 8px; }
.welcome-more-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.welcome-more-grid h3 { margin-top: 14px; color: var(--text); font-size: 15px; }
.welcome-more-grid p { margin: 6px 0 0; color: var(--muted-text); font-size: 13px; line-height: 1.55; }

.welcome-footer { flex-wrap: wrap; align-items: center; gap: 8px 22px; color: var(--muted-text); font-size: 12px; }
a.welcome-privacy-link { text-decoration: none; }

@keyframes welcome-random-light {
    0%, 100% { opacity: 0; transform: translate3d(-5vw, 0, 0) rotate(var(--streak-angle)) scaleX(.76); }
    35% { opacity: var(--streak-peak); }
    65% { opacity: calc(var(--streak-peak) * .65); transform: translate3d(5vw, 0, 0) rotate(var(--streak-angle)) scaleX(1); }
}

@keyframes welcome-hero-arrive {
    from { opacity: 0; transform: translateY(22px); filter: blur(5px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@media (max-width: 700px) {
    .welcome-hero { min-height: 100svh; padding: 32px 20px; }
    .welcome-logo { width: 58px; height: 58px; }
    .welcome-content h1 { font-size: 62px; }
    .welcome-tagline { max-width: 380px; margin-top: 20px !important; font-size: 15px !important; }
    .welcome-bottom-cta p { font-size: 15px; }
    .welcome-features { padding: 56px 20px 26px; }
    .welcome-features h2 { font-size: 26px; }
    .welcome-feature-track { gap: 18px; margin-top: 32px; padding-left: 0; }
    .welcome-feature-section,
    .welcome-feature-section:nth-of-type(odd),
    .welcome-feature-section:nth-of-type(even) {
        width: 88%;
        min-height: 0;
        grid-column: 1;
        justify-self: start;
        padding: 17px 15px;
    }
    .welcome-feature-section:nth-of-type(even) { justify-self: end; }
    .welcome-feature-section::before,
    .welcome-feature-section::after { content: none; }
    .welcome-feature-section h3 { font-size: 16px; }
    .welcome-bottom-cta {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        gap: 12px;
        margin-top: 32px;
        padding: 0;
        text-align: center;
    }
    .welcome-bottom-cta > p,
    .welcome-bottom-cta > .join-now-button { grid-column: 1; justify-self: center; }
    .welcome-hero-actions { flex-direction: column; gap: 16px; }
    .welcome-more { padding: 30px 20px 50px; }
    .welcome-free { padding: 26px 18px; text-align: left; }
    .welcome-free h2 { font-size: 24px; }
    .welcome-free > p:not(.welcome-features-kicker) { font-size: 14px; }
    /* On phones the pills become an even two-column checklist, so the rows line up. */
    .welcome-free-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
    .welcome-free-list li { align-items: flex-start; gap: 8px; padding: 0; background: none; border: 0; border-radius: 0; font-size: 13px; line-height: 1.35; }
    .welcome-more-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 20px; }
    .welcome-more-grid article { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 14px; padding: 16px; }
    .welcome-more-icon { grid-row: span 2; }
    .welcome-more-grid h3 { margin-top: 0; }
}

@media (min-width: 701px) and (max-width: 960px) {
    .welcome-more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
    .welcome-free-list { grid-template-columns: minmax(0, 1fr); }
    .welcome-hero { padding-inline: 16px; }
    .welcome-feature-section { grid-template-columns: 30px minmax(0, 1fr); gap: 11px; padding: 15px 12px; }
    .welcome-feature-number { width: 28px; height: 28px; }
    .welcome-feature-section h3 { font-size: 15px; }
    .welcome-feature-section div > p:not(.welcome-feature-label) { font-size: 12px !important; }
}

@media (prefers-reduced-motion: reduce) {
    .welcome-light-streak { animation: none; opacity: .08; transform: rotate(var(--streak-angle)); }
    .welcome-screen::before,
    .welcome-screen::after,
    .welcome-background-fade,
    .welcome-intro,
    .welcome-hero-reveal,
    .welcome-logo,
    .welcome-features,
    .welcome-feature-section,
    .welcome-feature-route,
    .join-now-button,
    .welcome-scroll-link,
    .welcome-privacy-link {
        animation: none;
        transition: none;
    }
    .welcome-screen.has-scroll-reveal .welcome-feature-section { opacity: 1; transform: none; }
    .welcome-feature-route-glow,
    .welcome-feature-route-line { stroke-dashoffset: 0 !important; }
}

/* Sidebar and navigation */
.sidebar {
    position: fixed;
    z-index: 50;
    display: flex;
    flex-direction: column;
    left: 0;
    top: 0;
    width: 44px;
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
    background-color: var(--panel-bg);
    border-right: 1px solid var(--border);
    padding: max(12px, env(safe-area-inset-top)) 2px max(12px, env(safe-area-inset-bottom));
    transition: width 260ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

body.sidebar-expanded .sidebar {
    width: 170px;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    min-height: 36px;
    margin: 0 0 34px;
    padding: 0;
    white-space: nowrap;
}

.brand-toggle {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.brand-toggle:hover {
    background-color: var(--soft-bg);
}

.brand-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.brand-logo {
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 22%, transparent));
    animation: logo-glow 2.8s ease-in-out infinite;
}

.brand-name {
    overflow: hidden;
    max-width: 0;
    opacity: 0;
    color: var(--text);
    font-size: 20px;
    font-weight: bold;
    transition: max-width 260ms cubic-bezier(0.2, 0.75, 0.25, 1), opacity 140ms ease;
}

body.sidebar-expanded .brand-name {
    max-width: 120px;
    opacity: 1;
}

.menu-title {
    overflow: hidden;
    max-height: 0;
    margin: 0;
    opacity: 0;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #555566;
    white-space: nowrap;
    transition: max-height 220ms cubic-bezier(0.2, 0.75, 0.25, 1), margin 220ms cubic-bezier(0.2, 0.75, 0.25, 1), opacity 140ms ease;
}

body.sidebar-expanded .menu-title {
    max-height: 20px;
    margin: 0 0 12px 10px;
    opacity: 1;
}

.sidebar-nav {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar { display: none; }

.sidebar-footer-nav {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    min-height: 40px;
    padding: 9px 6px 9px 11px;
    border-radius: 8px;
    color: var(--muted-text);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.nav-link > span:not(.nav-icon) {
    overflow: hidden;
    max-width: 0;
    opacity: 0;
    white-space: nowrap;
    transition: max-width 260ms cubic-bezier(0.2, 0.75, 0.25, 1), opacity 140ms ease;
}

.nav-link-settings { margin-top: 0; }

/* Coach and Go Premium stand out a little: a faint accent wash, a glowing icon and a slow sheen. */
.nav-link-coach,
.nav-link-premium {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: color-mix(in srgb, var(--accent) 35%, var(--muted-text));
    background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 5%, transparent), transparent 75%);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 9%, transparent);
}
.nav-link-coach .nav-icon svg,
.nav-link-premium .nav-icon svg { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--accent) 30%, transparent)); }
.nav-link-coach::after,
.nav-link-premium::after {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(110deg, transparent 35%, color-mix(in srgb, var(--accent) 7%, transparent) 50%, transparent 65%);
    background-size: 250% 100%;
    animation: premium-sheen 9s ease-in-out infinite;
    content: "";
    pointer-events: none;
}
/* Go Premium: the text itself and the crown are filled with the accent colour, without the outline. */
.nav-link.nav-link-premium { color: var(--accent); box-shadow: none; }
.nav-link.nav-link-premium .nav-icon svg { fill: var(--accent); }
@media (prefers-reduced-motion: reduce) {
    .nav-link-coach::after,
    .nav-link-premium::after { animation: none; opacity: 0; }
}

body.sidebar-expanded .nav-link > span:not(.nav-icon) {
    max-width: 140px;
    opacity: 1;
}

body.sidebar-expanded .nav-link > .coach-beta-badge {
    max-width: none;
    flex: 0 0 auto;
    margin-left: auto;
    padding: 2px 4px;
    overflow: visible;
    color: var(--accent-ink);
    background: var(--accent);
    border: 1px solid var(--accent);
    box-shadow: none;
    border-radius: 4px;
    font-size: 8px;
    font-weight: bold;
    letter-spacing: .4px;
    line-height: 1.2;
    opacity: 1;
}

.nav-link:hover {
    background-color: var(--soft-bg);
    color: var(--text);
}

.nav-link[aria-current="page"] {
    background-color: color-mix(in srgb, var(--accent) 13%, transparent);
    color: var(--accent);
    box-shadow: inset 2px 0 var(--accent), 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
}

.nav-link[aria-current="page"]:hover {
    background-color: color-mix(in srgb, var(--accent) 20%, transparent);
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    min-width: 18px;
    font-size: 16px;
    line-height: 1;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .page-content,
    .brand-name,
    .menu-title,
    .nav-link > span:not(.nav-icon) {
        transition: none;
    }
}

@media (max-width: 600px) {
    .sidebar {
        top: calc(12px + env(safe-area-inset-top, 0px));
        left: 10px;
        width: 42px;
        height: auto;
        max-height: 42px;
        overflow: hidden;
        padding: 2px;
        background: var(--panel-bg);
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: 0 8px 24px rgb(0 0 0 / 24%);
        transition: width 240ms cubic-bezier(0.2, 0.75, 0.25, 1), max-height 260ms cubic-bezier(0.2, 0.75, 0.25, 1), border-radius 240ms ease, box-shadow 240ms ease;
    }

    body.sidebar-expanded .sidebar {
        width: min(280px, calc(100vw - 20px));
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
        overflow-x: hidden;
        overflow-y: auto;
        padding: 8px;
        border-radius: 12px;
        box-shadow: 0 18px 48px rgb(0 0 0 / 45%);
    }

    .brand { min-height: 36px; margin: 0 0 8px; }
    .menu-title,
    .sidebar-nav,
    .sidebar-footer-nav {
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-6px);
        transition: opacity 140ms ease, transform 200ms ease, visibility 0s linear 200ms;
    }

    body.sidebar-expanded .menu-title,
    body.sidebar-expanded .sidebar-nav,
    body.sidebar-expanded .sidebar-footer-nav {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        transition-delay: 40ms, 40ms, 0s;
    }

    .sidebar-nav { flex: 0 0 auto; min-height: auto; overflow: visible; gap: 3px; }
    .sidebar-footer-nav { margin-top: 8px; padding-top: 8px; }
    .nav-link { min-height: 42px; padding: 9px 10px; }

    .page-content > header { min-height: 40px; padding-left: 50px; gap: 10px; }
}

@media (max-width: 600px) and (prefers-reduced-motion: reduce) {
    .sidebar,
    .menu-title,
    .sidebar-nav,
    .sidebar-footer-nav { transition: none; }
}

header {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.account-menu {
    position: relative;
    z-index: 21;
}

.account-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    background-color: transparent;
    color: var(--muted-text);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
}

.account-button:hover,
.account-button[aria-expanded="true"] {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--soft-bg);
}

.account-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.account-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.account-panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    padding: 16px;
    background-color: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgb(0 0 0 / 18%);
}

@keyframes account-panel-open {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.account-panel:not([hidden]) {
    transform-origin: top right;
    animation: account-panel-open 180ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

@media (prefers-reduced-motion: reduce) {
    .account-panel:not([hidden]) { animation: none; }
}

.account-panel-label {
    margin-bottom: 6px;
    color: var(--muted-text);
    font-size: 12px;
    font-weight: 600;
}

.account-email {
    overflow: hidden;
    margin-bottom: 14px;
    color: var(--text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-button {
    width: 100%;
    padding: 9px 10px;
    background-color: transparent;
    color: var(--muted-text);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    text-align: left;
}

.profile-button {
    width: 100%;
    margin-bottom: 8px;
    padding: 9px 10px;
    background-color: var(--accent);
    color: var(--accent-ink);
    border: 1px solid var(--accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    text-align: left;
}

.profile-button:hover {
    background-color: transparent;
    color: var(--accent);
}

.logout-button:hover {
    color: var(--text);
    border-color: var(--accent);
}

/* Toast: a short message at the bottom of the screen (js/ui/toast.js), like "Workout deleted · Undo". */
.zevrik-toast {
    position: fixed;
    z-index: 1000;
    bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
    left: 50%;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: calc(100vw - 32px);
    padding: 11px 12px 11px 16px;
    color: var(--text);
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 35%);
    font-size: 14px;
    transform: translateX(-50%);
    animation: zevrik-toast-in 220ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}
.zevrik-toast.is-leaving { opacity: 0; transform: translate(-50%, 8px); transition: opacity 200ms ease, transform 200ms ease; }
.zevrik-toast-action {
    padding: 6px 12px;
    color: var(--accent);
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.zevrik-toast-action:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
body[data-mode="light"] .zevrik-toast-action:not(#toast) { color: var(--accent); }
@keyframes zevrik-toast-in {
    from { opacity: 0; transform: translate(-50%, 12px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .zevrik-toast { animation: none; }
}

/* Pull to refresh (js/ui/pullToRefresh.js): a circle that follows the finger down from the top. */
.pull-refresh {
    --pull: 0px;
    --pull-turn: 0deg;
    position: fixed;
    z-index: 1000;
    top: calc(env(safe-area-inset-top) - 44px);
    left: 50%;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: var(--muted-text);
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    box-shadow: 0 6px 18px rgb(0 0 0 / 30%);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, var(--pull));
    transition: transform 220ms ease, opacity 220ms ease;
}
.pull-refresh.is-pulling,
.pull-refresh.is-refreshing { opacity: 1; }
.pull-refresh.is-pulling { transition: none; }
.pull-refresh.is-ready,
.pull-refresh.is-refreshing { color: var(--accent); }
.pull-refresh svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform: rotate(var(--pull-turn)); }
.pull-refresh.is-refreshing svg { animation: pull-refresh-spin 800ms linear infinite; }
@keyframes pull-refresh-spin { to { transform: rotate(360deg); } }

/* ----- Phones: bottom tab bar (js/ui/mobileNav.js) instead of the side menu ----- */
.mobile-tabbar,
.mobile-section-switch { display: none; }

.mobile-sheet {
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    max-height: 85dvh;
    margin: auto 0 0;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    color: var(--text);
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 16px 18px 0 0;
}
.mobile-sheet[open] { animation: mobile-sheet-up 240ms cubic-bezier(0.2, 0.75, 0.25, 1) both; }
.mobile-sheet::backdrop { background: rgb(5 7 10 / 55%); }
.mobile-sheet:focus { outline: none; }
.mobile-sheet-handle { width: 38px; height: 4px; margin: 2px auto 14px; background: var(--border); border-radius: 999px; }
/* Your picture and name open your profile. */
.mobile-sheet-account { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; padding: 8px 8px 14px; color: var(--text); border-bottom: 1px solid var(--border); text-decoration: none; }
.mobile-sheet-account:active { background: var(--soft-bg); border-radius: 10px; }
.mobile-sheet-who { min-width: 0; flex: 1; }
.mobile-sheet-profile-hint { color: var(--accent); font-size: 12px; font-weight: 700; white-space: nowrap; }
.mobile-sheet-avatar,
.mobile-sheet-avatar-fallback { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; object-fit: cover; color: var(--muted-text); background: var(--soft-bg); border-radius: 50%; }
.mobile-sheet-avatar[hidden],
.mobile-sheet-avatar-fallback[hidden] { display: none; }
.mobile-sheet-avatar-fallback svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.mobile-sheet-account strong { display: block; font-size: 15px; }
.mobile-sheet-plan { color: var(--muted-text); font-size: 12px; }
.mobile-sheet-links { display: grid; gap: 2px; padding: 10px 0; }
.mobile-sheet-link { display: flex; align-items: center; gap: 14px; padding: 12px 8px; color: var(--text); border-radius: 10px; font-size: 15px; font-weight: 600; text-decoration: none; }
.mobile-sheet-link:active,
.mobile-sheet-link[aria-current="page"] { background: var(--soft-bg); }
.mobile-sheet-link[aria-current="page"] { color: var(--accent); }
.mobile-sheet-icon svg { display: block; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* :not(#…) outranks the light-mode rule for buttons in settings.css. */
.mobile-sheet-signout:not(#signout) {
    width: 100%;
    min-height: 46px;
    margin-top: 4px;
    color: #ff737b;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
@keyframes mobile-sheet-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media (max-width: 600px) {
    .sidebar,
    body.sidebar-expanded::before { display: none; }
    .page-content > header { padding-left: 0; }
    .page-content > header .account-menu { display: none; }
    body.has-mobile-tabbar .page-content { padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px)); }
    body.has-mobile-tabbar .zevrik-toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
    /* The tab bar is the bottom of the page on phones; the "© Zevrik" line only shows on computers. */
    body.has-mobile-tabbar .page-content > footer { display: none; }

    /* A rounded bar floating just above the bottom edge (and above the iPhone home bar). */
    .mobile-tabbar {
        position: fixed;
        z-index: 60;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        left: 10px;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: end;
        padding: 6px 4px 5px;
        background: color-mix(in srgb, var(--panel-bg) 92%, transparent);
        border: 1px solid var(--border);
        border-radius: 16px;
        box-shadow: 0 10px 30px rgb(0 0 0 / 35%);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
    .mobile-tab:not(#tab) {
        display: flex;
        min-width: 0;
        align-items: center;
        flex-direction: column;
        gap: 3px;
        padding: 5px 0 2px;
        color: var(--muted-text);
        background: none;
        border: 0;
        font: inherit;
        font-size: 11px;
        font-weight: 600;
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-tab.is-active:not(#tab) { color: var(--accent); }
    .mobile-tab-icon { display: grid; width: 26px; height: 26px; place-items: center; }
    .mobile-tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .mobile-tab svg.is-filled { fill: currentColor; stroke: none; }
    /* The "+" in the middle: logging is the main action. */
    .mobile-tab.is-primary .mobile-tab-icon {
        width: 48px;
        height: 48px;
        margin-top: -20px;
        color: var(--accent-ink);
        background: var(--accent);
        border: 3px solid var(--page-bg);
        border-radius: 50%;
        box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
    }
    .mobile-tab.is-primary svg { width: 24px; height: 24px; stroke-width: 2.4; }
    .mobile-tab-avatar { width: 24px; height: 24px; object-fit: cover; border-radius: 50%; }
    .mobile-tab.is-active .mobile-tab-avatar { outline: 2px solid var(--accent); outline-offset: 1px; }

    /* Stays at the top while scrolling, so switching page doesn't need a scroll back up first. */
    .mobile-section-switch {
        position: sticky;
        top: calc(8px + env(safe-area-inset-top, 0px));
        /* Above page titles (40 on some pages), below the tab bar (60). */
        z-index: 50;
        display: flex;
        gap: 4px;
        margin: 0 0 14px;
        padding: 4px;
        background: var(--soft-bg);
        border: 1px solid var(--border);
        border-radius: 10px;
        box-shadow: 0 6px 16px rgb(0 0 0 / 28%);
    }
    .mobile-section-switch a {
        flex: 1;
        padding: 8px 6px;
        color: var(--muted-text);
        border-radius: 6px;
        font-size: 13px;
        font-weight: 700;
        text-align: center;
        text-decoration: none;
    }
    .mobile-section-crown { width: 17px; height: 17px; margin-left: 4px; vertical-align: -3px; fill: var(--accent); }
    .mobile-section-switch a[aria-current="page"] { color: var(--text); background: var(--panel-bg); box-shadow: 0 1px 4px rgb(0 0 0 / 22%); }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-sheet[open] { animation: none; }
}

/* ----- Launch screen when Zevrik opens from the home screen (js/ui/launchScreen.js) ----- */
html.is-launching { overflow: hidden; }
.launch-screen {
    position: fixed;
    z-index: 2000;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--page-bg);
}
.launch-stage { position: relative; display: grid; justify-items: center; gap: 18px; }
.launch-glow {
    position: absolute;
    top: -62px;
    left: 50%;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 34%, transparent), transparent 64%);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
    animation: launch-glow-in 900ms ease-out 150ms both, launch-breathe 2400ms ease-in-out 1100ms infinite;
}
.launch-mark { position: relative; display: block; width: 104px; height: 104px; animation: launch-logo-in 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.launch-mark img { display: block; width: 100%; height: 100%; }
/* A light sweeping across the logo, cut to the logo's shape. */
.launch-mark::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 70%) 50%, transparent 65%) no-repeat;
    background-size: 260% 100%;
    background-position: 130% 0;
    content: "";
    -webkit-mask: var(--launch-logo) center / contain no-repeat;
    mask: var(--launch-logo) center / contain no-repeat;
    animation: launch-shine 1100ms ease-in-out 650ms both;
}
.launch-word { display: flex; margin: 0; padding-left: .42em; color: var(--text); font-size: 20px; font-weight: 800; letter-spacing: .42em; }
.launch-word span { display: inline-block; opacity: 0; transform: translateY(10px); animation: launch-letter 500ms cubic-bezier(0.2, 0.8, 0.2, 1) calc(450ms + var(--i) * 60ms) both; }
.launch-progress { position: relative; width: 120px; height: 3px; overflow: hidden; background: var(--soft-bg); border-radius: 999px; opacity: 0; animation: launch-fade 400ms ease 800ms both; }
.launch-progress i { position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: var(--accent); border-radius: 999px; animation: launch-progress 1100ms ease-in-out 800ms infinite; }
/* Leaving: the logo comes towards you while the screen fades into the dashboard. */
.launch-screen.is-leaving { animation: launch-out 650ms ease forwards; }
.launch-screen.is-leaving .launch-stage { animation: launch-zoom 650ms cubic-bezier(0.5, 0, 0.75, 0) forwards; }
body[data-style="elegant"] .launch-glow { display: none; }
body[data-style="elegant"] .launch-word { font-family: var(--elegant-serif); font-weight: 600; }

@keyframes launch-logo-in {
    from { opacity: 0; transform: scale(.6); filter: blur(8px); }
    to { opacity: 1; transform: scale(1); filter: blur(0); }
}
@keyframes launch-glow-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes launch-breathe { 50% { opacity: .55; } }
@keyframes launch-shine { to { background-position: -30% 0; } }
@keyframes launch-letter { to { opacity: 1; transform: translateY(0); } }
@keyframes launch-fade { to { opacity: 1; } }
@keyframes launch-progress {
    from { transform: translateX(-100%); }
    to { transform: translateX(250%); }
}
@keyframes launch-out { to { opacity: 0; visibility: hidden; } }
@keyframes launch-zoom { to { transform: scale(1.6); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .launch-glow,
    .launch-mark,
    .launch-mark::after,
    .launch-word span,
    .launch-progress,
    .launch-progress i,
    .launch-screen.is-leaving .launch-stage { animation: none; }
    .launch-glow,
    .launch-word span,
    .launch-progress { opacity: 1; transform: none; }
    .launch-glow { transform: translateX(-50%); }
    .launch-screen.is-leaving { animation: launch-out 300ms ease forwards; }
}

/* ----- Dropdowns (js/ui/customSelect.js) -----
   Every select gets the same chevron, and opens Zevrik's own list instead of the browser's. */
select:not([multiple]):not([size]) {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b919c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 14px !important;
    cursor: pointer;
}
select:disabled { cursor: not-allowed; opacity: .6; }
select.is-custom-select-open { border-color: var(--accent) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
select.is-invalid { border-color: #e95d68 !important; }

.custom-select-panel {
    position: fixed;
    z-index: 1000;
    display: flex;
    min-width: 0;
    max-height: 320px;
    flex-direction: column;
    overflow: hidden;
    color: var(--text);
    background: var(--panel-bg);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
    border-radius: 12px;
    box-shadow: 0 18px 44px rgb(0 0 0 / 45%), 0 0 0 1px rgb(0 0 0 / 15%);
}
.custom-select-panel.is-open { animation: custom-select-in 140ms cubic-bezier(0.2, 0.75, 0.25, 1); }
.custom-select-panel.is-above.is-open { animation-name: custom-select-in-above; }
.custom-select-search { position: relative; flex: 0 0 auto; padding: 8px 8px 4px; }
.custom-select-search svg { position: absolute; top: 50%; left: 19px; width: 15px; height: 15px; fill: none; stroke: var(--muted-text); stroke-width: 2.2; stroke-linecap: round; transform: translateY(-35%); pointer-events: none; }
.custom-select-search input { width: 100%; margin: 0; padding: 9px 10px 9px 34px; color: var(--text); background: var(--soft-bg); border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 13px; }
.custom-select-search input:focus { outline: none; border-color: var(--accent); }
.custom-select-list { flex: 1 1 auto; min-height: 0; margin: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; list-style: none; }
.custom-select-group { padding: 10px 10px 4px; color: var(--muted-text); font-size: 12px; font-weight: 600; }
.custom-select-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; line-height: 1.3; }
.custom-select-option svg { flex: 0 0 auto; width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.custom-select-option.is-active { background: color-mix(in srgb, var(--accent) 12%, var(--soft-bg)); }
.custom-select-option[aria-selected="true"] { color: var(--accent); font-weight: 700; }
.custom-select-option[aria-selected="true"] svg { opacity: 1; }
.custom-select-option[aria-disabled="true"] { cursor: default; opacity: .45; }
.custom-select-option[hidden], .custom-select-group[hidden], .custom-select-empty[hidden] { display: none; }
.custom-select-empty { flex: 1 1 auto; align-content: center; gap: 4px; margin: 0; padding: 14px 16px 18px; color: var(--muted-text); font-size: 12px; text-align: center; }
.custom-select-empty:not([hidden]) { display: grid; }
.custom-select-empty strong { color: var(--text); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
body[data-mode="light"] .custom-select-option[aria-selected="true"] { color: var(--text); }
body[data-mode="light"] .custom-select-panel { box-shadow: 0 18px 40px rgb(0 0 0 / 18%); }

/* On phones the list comes up from the bottom, with the select's name on top. */
.custom-select-backdrop { position: fixed; z-index: 999; inset: 0; background: rgb(0 0 0 / 55%); animation: custom-select-fade 160ms ease; }
.custom-select-panel.is-sheet { top: auto; right: 0; bottom: 0; left: 0; width: auto; max-height: min(72vh, 560px); max-height: min(72dvh, 560px); padding-bottom: env(safe-area-inset-bottom); border-width: 1px 0 0; border-radius: 16px 18px 0 0; }
.custom-select-panel.is-sheet.is-open { animation: custom-select-sheet-in 220ms cubic-bezier(0.2, 0.75, 0.25, 1); }
.custom-select-sheet-head { display: grid; flex: 0 0 auto; justify-items: center; gap: 10px; padding: 10px 16px 6px; cursor: grab; touch-action: none; user-select: none; }
.custom-select-panel.is-sheet { transition: height 200ms cubic-bezier(0.2, 0.75, 0.25, 1), transform 200ms cubic-bezier(0.2, 0.75, 0.25, 1); }
.custom-select-panel.is-sheet.is-dragging { transition: none; }
.custom-select-panel.is-sheet.is-full { padding-top: env(safe-area-inset-top); border-radius: 0; }
.custom-select-panel.is-sheet.is-closing { transform: translateY(calc(100% + 12px)) !important; transition: transform 220ms cubic-bezier(0.4, 0, 1, 1); }
.custom-select-backdrop { transition: opacity 220ms ease; }
.custom-select-backdrop.is-closing { opacity: 0; }
.custom-select-grabber { width: 38px; height: 4px; background: var(--border); border-radius: 999px; }
.custom-select-sheet-head strong { justify-self: start; font-size: 16px; }
.custom-select-panel.is-sheet .custom-select-search { padding: 4px 12px 6px; }
.custom-select-panel.is-sheet .custom-select-list { padding: 4px 10px 14px; }
.custom-select-panel.is-sheet .custom-select-option { min-height: 48px; font-size: 15px; }
/* Closing: the list fades and lifts back towards its box; nothing in it can be tapped any more. */
.custom-select-panel.is-closing { pointer-events: none; }
.custom-select-panel.is-closing:not(.is-sheet) { animation: custom-select-out 170ms cubic-bezier(0.4, 0, 1, 1) forwards; }
.custom-select-panel.is-above.is-closing:not(.is-sheet) { animation-name: custom-select-out-above; }
.custom-select-backdrop.is-closing { pointer-events: none; }
@keyframes custom-select-out { to { opacity: 0; transform: translateY(-6px) scale(0.98); } }
@keyframes custom-select-out-above { to { opacity: 0; transform: translateY(6px) scale(0.98); } }
@keyframes custom-select-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes custom-select-in-above { from { opacity: 0; transform: translateY(6px); } }
@keyframes custom-select-sheet-in { from { transform: translateY(100%); } }
@keyframes custom-select-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .custom-select-panel.is-open, .custom-select-backdrop { animation: none; }
}

/* Confirmation dialogs: deleting a split, starting a workout over, removing a friend. */
.workout-delete-dialog {
    width: min(440px, calc(100vw - 32px));
    max-width: 100%;
    margin: auto;
    padding: 24px;
    overflow: hidden;
    background: radial-gradient(ellipse at 100% 0%, color-mix(in srgb, #e95d68 10%, transparent), transparent 68%), var(--panel-bg);
    color: var(--text);
    border: 1px solid color-mix(in srgb, #e95d68 36%, var(--border));
    border-radius: 12px;
    box-shadow: 0 24px 72px rgb(0 0 0 / 48%), inset 0 1px 0 color-mix(in srgb, var(--text) 7%, transparent);
}
.workout-delete-dialog:not([open]) { display: none; }
.workout-delete-dialog::backdrop { background: rgb(7 9 13 / 68%); backdrop-filter: blur(5px); }
.workout-delete-dialog[open] { animation: confirm-dialog-enter 200ms cubic-bezier(0.2, 0.75, 0.25, 1) both; }
.workout-delete-dialog form { display: grid; gap: 16px; }
.workout-delete-dialog-heading { display: flex; align-items: center; gap: 12px; }
.workout-delete-symbol { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; color: #ff737b; background: color-mix(in srgb, #e95d68 14%, transparent); border: 1px solid color-mix(in srgb, #e95d68 36%, var(--border)); border-radius: 10px; }
.workout-delete-symbol svg { width: 21px; height: 21px; }
.workout-delete-kicker { margin: 0 0 3px; color: #ff737b; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.workout-delete-dialog h2 { margin: 0; color: var(--text); font-size: 19px; }
.workout-delete-description { margin: 0; color: var(--muted-text); font-size: 13px; line-height: 1.5; }
.workout-delete-context { margin: 0; padding: 10px 12px; color: var(--text); background: color-mix(in srgb, var(--soft-bg) 88%, transparent); border: 1px solid var(--border); border-radius: 7px; font-size: 13px; font-weight: 600; }
.workout-delete-context:empty { display: none; }
.workout-delete-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.workout-delete-actions button { min-height: 40px; padding: 8px 14px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 700; transition: background-color 140ms ease, border-color 140ms ease; }
.workout-delete-keep { color: var(--text); background: var(--soft-bg); border-color: var(--border) !important; }
.workout-delete-keep:hover { background: color-mix(in srgb, var(--soft-bg) 76%, var(--text)); }
.workout-delete-confirm { color: white; background: #bd3742; border-color: #bd3742 !important; }
.workout-delete-confirm:hover { background: #d44854; }
.workout-delete-actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@keyframes confirm-dialog-enter {
    from { opacity: 0; transform: translateY(8px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .workout-delete-dialog[open] { animation: none; }
    .workout-delete-actions button { transition: none; }
}

/* Time fields (js/ui/timeInput.js): how the typed digits are read, under the field. */
.time-input-hint { display: block; margin-top: 4px; color: var(--muted-text); font-size: 11px; font-weight: 600; }
.time-input-hint[hidden] { display: none; }
