/* ==========================================================================
   FITFORGE — "Street Set" design system
   Concrete / spray-paint calisthenics aesthetic.
   Anton (display) + Manrope (body) + Space Mono (data/stats)
   ========================================================================== */

:root {
    --bg: #17181a;
    --bg-soft: #1e1f22;
    --bg2: #1e1f22; /* legacy alias used by inline styles */
    --card: #26272b;
    --card-2: #2c2d31;
    --bg3: #2c2d31; /* legacy alias */
    --line: #38393e;
    --chalk: #f2efe6;
    --muted: #8b8d93;
    --muted-2: #5c5e64;
    --accent: #ff5a2b;
    --accent-dim: #ff5a2b33;
    --accent-ink: #1a0e08;
    --lime: #d7f24c;
    --pink: #ff3d7a;
    --blue: #4ea6ff;
    --good: #57d38c;
    --warn: #f5b942;
    --danger: #ff4d5e;
    --purple: #b48cff;
    /* legacy aliases so any leftover inline var() references still resolve */
    --neon: var(--accent);
    --green: var(--good);
    --radius-lg: 26px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --font-display: 'Anton', sans-serif;
    --font-body: 'Manrope', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --shell-pad: 20px;
    --nav-size: 84px;
}

[data-theme="light"] {
    --bg: #f3f0e8;
    --bg-soft: #ebe7dc;
    --bg2: #ebe7dc;
    --card: #ffffff;
    --card-2: #e9e3d1;
    --bg3: #e9e3d1;
    --line: #cdc6ae;
    --chalk: #1b1a17;
    --muted: #6b6a63;
    --muted-2: #9a978a;
    --accent-ink: #1a0e08;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: radial-gradient(circle at 15% -10%, color-mix(in srgb, var(--card) 60%, transparent) 0%, transparent 55%), var(--bg);
    color: var(--chalk);
    font-family: var(--font-body);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .001s !important;
        transition-duration: .001s !important;
    }
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
}

::selection {
    background: var(--accent);
    color: var(--accent-ink);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 100px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* ---------------------------------------------------------------- shell */
.shell {
    display: flex;
    min-height: 100vh;
}

.main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 22px var(--shell-pad) calc(var(--nav-size) + 30px);
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
}

/* ---------------------------------------------------------------- nav */
.sidebar {
    position: fixed;
    z-index: 100;
    display: flex;
    background: color-mix(in srgb, var(--bg-soft) 92%, transparent);
    backdrop-filter: blur(16px);
    border: 1px solid var(--line);
}

    .sidebar .logo {
        font-family: var(--font-display);
        color: var(--accent-ink);
        background: linear-gradient(135deg, var(--accent), var(--pink));
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 14px;
        letter-spacing: .02em;
    }

    .sidebar .nav-item {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: var(--muted-2);
        position: relative;
        cursor: pointer;
        transition: color .15s ease;
    }

        .sidebar .nav-item svg {
            stroke: currentColor;
            fill: none;
            stroke-width: 1.8;
            transition: transform .15s ease;
        }

        .sidebar .nav-item span {
            font-family: var(--font-mono);
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: .04em;
        }

        .sidebar .nav-item.active {
            color: var(--accent);
        }

            .sidebar .nav-item.active svg {
                transform: translateY(-2px);
            }

            .sidebar .nav-item.active::after {
                content: "";
                position: absolute;
                border-radius: 50%;
                background: var(--accent);
            }

        .sidebar .nav-item:active svg {
            transform: scale(.85);
        }

        .sidebar .nav-item.logout {
            color: var(--pink);
        }

/* mobile: bottom tab bar */
@media (max-width:900px) {
    .sidebar {
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        border-left: none;
        border-right: none;
        border-bottom: none;
        border-radius: 24px 24px 0 0;
        padding: 8px 4px calc(10px + env(safe-area-inset-bottom));
    }

        .sidebar .logo {
            display: none;
        }

        .sidebar #pwa-install-btn {
            display: none !important;
        }

        .sidebar .nav-item {
            flex-direction: column;
            width: 56px;
            height: 52px;
            border-radius: 14px;
        }

            .sidebar .nav-item svg {
                width: 21px;
                height: 21px;
            }

            .sidebar .nav-item span {
                font-size: 9px;
            }

            .sidebar .nav-item.active::after {
                bottom: 2px;
                left: 50%;
                transform: translateX(-50%);
                width: 4px;
                height: 4px;
            }

    .main {
        padding-bottom: calc(var(--nav-size) + 18px);
    }
}
/* desktop: left rail */
@media (min-width:901px) {
    .sidebar {
        left: 16px;
        top: 16px;
        bottom: 16px;
        width: 78px;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: 16px 0;
        border-radius: 26px;
    }

        .sidebar .logo {
            width: 40px;
            height: 40px;
            font-size: 16px;
            margin-bottom: 10px;
        }

        .sidebar .nav-item {
            flex-direction: column;
            width: 58px;
            height: 58px;
            border-radius: 16px;
        }

            .sidebar .nav-item svg {
                width: 21px;
                height: 21px;
            }

            .sidebar .nav-item span {
                font-size: 9px;
            }

            .sidebar .nav-item.active {
                background: var(--accent-dim);
            }

                .sidebar .nav-item.active::after {
                    display: none;
                }

        .sidebar #pwa-install-btn {
            margin-top: auto;
        }

    .main {
        margin-left: 110px;
        padding-right: 24px;
    }

    .shell {
        justify-content: center;
    }
}

/* ---------------------------------------------------------------- type */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 0 20px;
    flex-wrap: wrap;
}

.page-title {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: .01em;
    font-size: 30px;
    line-height: .95;
    margin: 2px 0 4px;
}

.page-header .text-muted {
    margin: 0;
    font-size: 13px;
}

.section-title {
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 16px;
    letter-spacing: .02em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.text-muted {
    color: var(--muted);
}

.text-neon {
    color: var(--lime);
    font-family: var(--font-mono);
    font-weight: 700;
}

.text-green {
    color: var(--good);
}

.text-warn {
    color: var(--warn);
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.w-100 {
    width: 100%;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width:520px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------------------------------- cards */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 18px;
    position: relative;
    overflow: hidden;
}

.card-large {
    background: linear-gradient(135deg, var(--accent-dim), transparent 55%), var(--card);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 16px;
    align-items: start;
}

.stats-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@media (max-width:820px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------------------------------- buttons */
.btn {
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 800;
    border-radius: 100px;
    padding: 13px 20px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .12s ease, filter .12s ease, background .15s ease;
    touch-action: manipulation;
}

    .btn:active {
        transform: scale(.965);
    }

.btn-solid {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 10px 24px -10px var(--accent-dim);
}

    .btn-solid:active {
        filter: brightness(.92);
    }

.btn-outline {
    background: transparent;
    color: var(--chalk);
    border: 1.5px solid var(--line);
}

    .btn-outline:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

.btn-danger {
    background: var(--danger);
    color: #2a0308;
}

.btn-danger-outline {
    background: transparent;
    border: 1.5px solid var(--danger);
    color: var(--danger);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 12.5px;
}

.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--card-2);
    color: var(--chalk);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 800;
}

    .btn-icon:active {
        background: var(--accent);
        color: var(--accent-ink);
    }

/* ---------------------------------------------------------------- badges/pills */
.badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 100px;
    background: var(--card-2);
    border: 1px solid var(--line);
    color: var(--muted);
}

.badge-neon {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}

.badge-muted {
    opacity: .7;
}

.badge-danger {
    background: var(--danger);
    color: #2a0308;
    border-color: var(--danger);
}

.badge-beginner {
    background: var(--good);
    color: #062112;
    border-color: var(--good);
}

.badge-intermediate {
    background: var(--warn);
    color: #241800;
    border-color: var(--warn);
}

.badge-advanced {
    background: var(--pink);
    color: #2a0413;
    border-color: var(--pink);
}

.badge-general, .badge-strength {
    background: var(--blue);
    color: #031524;
    border-color: var(--blue);
}

.badge-hypertrophy {
    background: var(--purple);
    color: #160a2c;
    border-color: var(--purple);
}

.badge-endurance {
    background: var(--good);
    color: #062112;
    border-color: var(--good);
}

.badge-fatloss {
    background: var(--pink);
    color: #2a0413;
    border-color: var(--pink);
}

.badge-skill {
    background: var(--lime);
    color: #1a1e02;
    border-color: var(--lime);
}

.badge-warmup {
    background: var(--warn);
    color: #241800;
    border-color: var(--warn);
}

.badge-working {
    background: var(--card-2);
    color: var(--muted);
    border-color: var(--line);
}

.badge-amrap {
    background: var(--blue);
    color: #031524;
    border-color: var(--blue);
}

.badge-drop {
    background: var(--pink);
    color: #2a0413;
    border-color: var(--pink);
}

.badge-tempo {
    background: var(--purple);
    color: #160a2c;
    border-color: var(--purple);
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13px;
    background: var(--card);
    border: 1px solid var(--line);
    padding: 8px 12px;
    border-radius: 100px;
}

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

.tab-bar, .tab-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-pill {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .03em;
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--muted);
    padding: 9px 15px;
    border-radius: 100px;
    cursor: pointer;
    transition: all .15s ease;
}

    .tab-pill:active {
        transform: scale(.95);
    }

    .tab-pill.active {
        background: var(--accent);
        color: var(--accent-ink);
        border-color: var(--accent);
    }

.ff-settype-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin: 10px 0 14px;
    padding-bottom: 4px;
}

    .ff-settype-row::-webkit-scrollbar {
        height: 4px;
    }

    .ff-settype-row::-webkit-scrollbar-track {
        background: var(--card);
        border-radius: 2px;
    }

    .ff-settype-row::-webkit-scrollbar-thumb {
        background: var(--accent);
        border-radius: 2px;
    }

.ff-settype-row {
    scrollbar-color: var(--accent) var(--card);
    scrollbar-width: thin;
}

.ff-settype-pill {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--muted);
    padding: 6px 13px;
    border-radius: 20px;
    transition: all .15s ease;
}

    .ff-settype-pill.active {
        background: var(--accent);
        color: var(--accent-ink);
        border-color: var(--accent);
    }

/* ---------------------------------------------------------------- alerts / empty */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid;
}

.alert-warn {
    background: #f5b94222;
    border-color: var(--warn);
    color: var(--warn);
}

.alert-danger {
    background: #ff4d5e1a;
    border-color: var(--danger);
    color: var(--danger);
}

.alert-success {
    background: #57d38c1a;
    border-color: var(--good);
    color: var(--good);
}

.auth-alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: #ff4d5e1a;
    border: 1px solid var(--danger);
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
}

.empty-state {
    text-align: center;
    padding: 36px 16px;
    color: var(--muted);
}

.empty-icon {
    font-size: 34px;
    margin-bottom: 10px;
    opacity: .7;
}

.loader, .loading-spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    animation: spin .7s linear infinite;
    margin: 24px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------------------------------------------------------------- forms */
.form-input, .form-control {
    width: 100%;
    background: var(--bg-soft);
    border: 1.5px solid var(--line);
    color: var(--chalk);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
}

    .form-input:focus, .form-control:focus {
        outline: none;
        border-color: var(--accent);
    }

.form-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
}

.form-group {
    margin-bottom: 12px;
}

.form-row {
    display: flex;
    gap: 10px;
}

    .form-row .form-group {
        flex: 1;
    }

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

select.form-input, select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b8d93' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 32px;
}

.radio-card {
    display: block;
    cursor: pointer;
    margin-bottom: 8px;
}

    .radio-card input {
        display: none;
    }

.radio-card-inner {
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    transition: all .15s ease;
    background: var(--bg-soft);
}

.radio-card input:checked + .radio-card-inner {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.radio-card-title {
    font-weight: 800;
    font-size: 13.5px;
}

.radio-card-desc {
    font-size: 12px;
    margin-top: 2px;
}

.progression-options {
    display: grid;
    gap: 8px;
}

/* ---------------------------------------------------------------- modal / sheet */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6,6,7,.66);
    backdrop-filter: blur(3px);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

@media (min-width:701px) {
    .modal-backdrop {
        align-items: center;
    }
}

.modal {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-bottom: none;
    border-radius: 26px 26px 0 0;
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -20px 60px -10px rgba(0,0,0,.6);
    animation: sheetup .3s cubic-bezier(.16,.9,.24,1.05);
}

@media (min-width:701px) {
    .modal {
        border-radius: 26px;
        border-bottom: 1px solid var(--line);
        max-height: 80vh;
    }
}

@keyframes sheetup {
    from {
        transform: translateY(60px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal::before {
    content: "";
    width: 38px;
    height: 4px;
    background: var(--line);
    border-radius: 100px;
    margin: 12px auto 0;
    display: block;
}

@media (min-width:701px) {
    .modal::before {
        display: none;
    }
}

.modal-large {
    max-width: 760px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px 10px;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 19px;
    text-transform: uppercase;
}

.modal-header span {
    font-weight: 800;
    font-size: 17px;
}

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--card-2);
    color: var(--muted);
    cursor: pointer;
}

.modal-body {
    padding: 6px 22px 22px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.modal-footer {
    padding: 14px 22px 22px;
    border-top: 1px solid var(--line);
}

.modal-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width:600px) {
    .modal-cols {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------------------------------- dashboard bits */
.rest-day-card {
    text-align: center;
    padding: 26px 10px;
}

.rest-icon {
    font-size: 36px;
}

.rest-label {
    font-family: var(--font-display);
    font-size: 22px;
    text-transform: uppercase;
    margin-top: 6px;
}

.rest-tips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 16px;
}

.rest-tip {
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 12px;
    font-weight: 700;
}

.session-active-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 12px;
}

.exercise-preview-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.exercise-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 9px 12px;
}

    .exercise-preview.flagged {
        border-color: var(--danger);
    }

.ex-thumb, .ex-thumb-sm {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.ex-thumb-fallback {
    font-size: 18px;
}

.ex-info, .ex-card-info {
    flex: 1;
    min-width: 0;
}

.ex-name, .ex-card-name {
    font-weight: 800;
    font-size: 13.5px;
}

.ex-meta, .ex-card-meta {
    font-size: 11.5px;
    font-family: var(--font-mono);
    margin-top: 2px;
}

.ex-rest {
    font-family: var(--font-mono);
    font-size: 11px;
}

.water-card .water-track {
    margin: 6px 0 12px;
}

.water-bar-wrap {
    height: 10px;
    border-radius: 100px;
    background: var(--card-2);
    border: 1px solid var(--line);
    overflow: hidden;
}

.water-bar-fill {
    height: 100%;
    background: linear-gradient(90deg,var(--blue),var(--lime));
    transition: width .5s cubic-bezier(.2,.8,.2,1);
}

.water-info {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: 8px;
    font-weight: 700;
}

.water-ml {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--blue);
}

.water-quick-btns {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 6px;
}

.water-btn {
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--chalk);
    padding: 9px 4px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    font-family: var(--font-body);
}

    .water-btn:active {
        background: var(--blue);
        color: #031524;
    }

.water-goal-row {
    display: flex;
    gap: 8px;
}

.water-entries {
    max-height: 150px;
    overflow-y: auto;
}

.water-entry-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.activity-stats {
    display: flex;
    gap: 20px;
}

.activity-val {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 700;
}

.recent-sessions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.recent-session-row {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    font-weight: 600;
    padding: 5px 0;
    border-top: 1px solid var(--line);
}

.streak-display {
    text-align: center;
    padding: 6px 0;
}

.streak-num {
    font-family: var(--font-display);
    font-size: 44px;
    line-height: 1;
}

.streak-best {
    font-size: 11.5px;
    margin-top: 4px;
}

.pr-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

    .pr-row:last-child {
        border-bottom: none;
    }

.pr-ex {
    font-weight: 700;
    font-size: 13px;
}

.pr-val {
    font-size: 13.5px;
}

.pr-ex-header {
    font-family: var(--font-display);
    font-size: 15px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.pr-ex-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

    .pr-ex-header-row .pr-ex-header {
        margin-bottom: 0;
    }

.pr-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
    flex-wrap: wrap;
}

.pr-sort-select {
    background: var(--card-2);
    border: 1px solid var(--line);
    color: var(--chalk);
    border-radius: 100px;
    padding: 6px 12px;
    font-size: 11.5px;
    font-family: var(--font-mono);
    font-weight: 700;
}

.badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: 100px;
    padding: 6px 11px;
    font-size: 11px;
    font-weight: 700;
}

.badge-chip-icon {
    font-size: 14px;
}

.badge-bronze {
    border-color: #b5652c;
}

.badge-silver {
    border-color: #c7c9cf;
}

.badge-gold {
    border-color: var(--warn);
}

.badge-diamond {
    border-color: var(--blue);
}

.badge-legend {
    border-color: var(--pink);
    box-shadow: 0 0 12px -2px var(--pink);
}

.skill-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.skill-mini-name {
    font-size: 11.5px;
    font-weight: 700;
    width: 76px;
    flex: 0 0 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.skill-mini-bar {
    flex: 1;
    height: 6px;
    border-radius: 100px;
    background: var(--card-2);
    border: 1px solid var(--line);
    overflow: hidden;
}

.skill-mini-fill {
    height: 100%;
    background: linear-gradient(90deg,var(--accent),var(--lime));
}

.skill-mini-pct {
    font-family: var(--font-mono);
    font-size: 10.5px;
    width: 32px;
    text-align: right;
}

.profile-stat-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 10px;
}

.profile-stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px 8px;
    text-align: center;
}

.profile-stat-val {
    font-family: var(--font-mono);
    font-size: 19px;
    font-weight: 700;
}

.profile-stat-lbl {
    font-size: 9.5px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
    margin-top: 4px;
}

@media (max-width:520px) {
    .profile-stat-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.avatar-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg,var(--accent),var(--pink));
    color: var(--accent-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 22px;
}

/* ---------------------------------------------------------------- calendar */
.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.cal-month-label {
    font-family: var(--font-display);
    font-size: 17px;
    text-transform: uppercase;
}

.cal-nav {
    width: 32px;
    height: 32px;
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7,1fr);
    text-align: center;
    margin-bottom: 8px;
}

.cal-wd {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--muted-2);
    font-weight: 700;
    letter-spacing: .04em;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7,1fr);
    gap: 10px;
}

.cal-loading {
    grid-column: 1/-1;
    text-align: center;
    color: var(--muted);
    padding: 20px;
}

.cal-cell {
    aspect-ratio: 1;
    border-radius: 16px;
    border: none;
    background: var(--card-2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    color: var(--muted-2);
    cursor: default;
}

    .cal-cell.cal-blank {
        background: none;
    }

    .cal-cell.cal-future {
        opacity: .45;
    }

    .cal-cell.cal-today {
        border: 2px dashed var(--accent);
        color: var(--accent);
        background: var(--card-2);
    }

    .cal-cell.cal-started {
        background: var(--accent-dim);
        color: var(--chalk);
    }

    .cal-cell.cal-done {
        background: var(--accent);
        color: var(--accent-ink);
        cursor: pointer;
        box-shadow: 0 4px 14px -6px var(--accent-dim);
    }

.cal-dot {
    position: absolute;
    bottom: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
}

.cal-marks {
    position: absolute;
    top: 2px;
    right: 2px;
    display: flex;
    gap: 1px;
    font-size: 7px;
}

.cal-day-tip {
    display: none;
}

.cal-cell:hover .cal-day-tip {
    display: block;
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--chalk);
    color: #141416;
    font-size: 10px;
    font-weight: 700;
    padding: 5px 8px;
    border-radius: 8px;
    white-space: nowrap;
    z-index: 5;
    font-family: var(--font-body);
}

.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
    align-items: center;
}

    .cal-legend .dot {
        width: 14px;
        height: 14px;
        border-radius: 5px;
        display: inline-block;
        margin-right: 6px;
        vertical-align: middle;
    }

        .cal-legend .dot.done {
            background: var(--accent);
        }

        .cal-legend .dot.rest {
            background: var(--card-2);
        }

        .cal-legend .dot.today {
            background: var(--card-2);
            border: 2px dashed var(--accent);
        }

        .cal-legend .dot.started {
            background: var(--accent-dim);
            border: 1px solid var(--accent);
        }

/* ---------------------------------------------------------------- sessions / history */
.session-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color .15s;
}

    .session-card:hover {
        border-color: var(--accent);
    }

.session-card-left {
    text-align: center;
    flex: 0 0 auto;
    width: 52px;
}

.session-date {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 12.5px;
}

.session-time {
    font-size: 10.5px;
}

.session-card-mid {
    flex: 1;
    min-width: 0;
}

.session-name {
    font-weight: 800;
    font-size: 13.5px;
}

.session-card-right {
    text-align: right;
    flex: 0 0 auto;
}

.session-dur {
    font-size: 13px;
}

.session-detail {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sess-ex {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.sess-ex-name {
    font-weight: 800;
    font-size: 13.5px;
    margin-bottom: 4px;
}

.sess-set {
    padding: 8px 0;
    border-bottom: 1px dashed var(--line);
}

    .sess-set:last-child {
        border-bottom: none;
    }

.sess-set-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sess-set-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
}

.sess-set-val {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--chalk);
}

    .sess-set-val b {
        color: var(--lime);
        font-family: var(--font-mono);
    }

[data-theme="light"] .sess-set-val b {
    color: #5c6f0e;
}

.sess-drop-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 6px 0 0 12px;
    padding-left: 10px;
    border-left: 2px solid var(--accent-dim);
    font-size: 12.5px;
}

.sess-drop-tag {
    color: var(--accent);
    font-weight: 800;
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------- PRs / badges page */
.badges-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(140px,1fr));
    gap: 12px;
}

.badge-card {
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: transform .12s;
}

    .badge-card:active {
        transform: scale(.97);
    }

.badge-card-icon {
    font-size: 28px;
}

.badge-card-name {
    font-weight: 800;
    font-size: 12.5px;
    margin-top: 6px;
}

.badge-card-tier {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: .05em;
    margin-top: 2px;
    color: var(--muted);
}

.badge-card-sub {
    font-size: 10.5px;
    margin-top: 4px;
}

.badge-prog-bar {
    height: 5px;
    border-radius: 100px;
    background: var(--card-2);
    margin-top: 8px;
    overflow: hidden;
}

.badge-prog-fill {
    height: 100%;
    background: var(--accent);
}

.badge-prog-label {
    font-size: 9.5px;
    margin-top: 4px;
    font-family: var(--font-mono);
}

.badge-fill--bronze {
    background: #c9793f;
}

.badge-fill--silver {
    background: #c7c9cf;
}

.badge-fill--gold {
    background: var(--warn);
}

.badge-fill--diamond {
    background: var(--blue);
}

.badge-card--bronze {
    border-color: #b5652c;
}

.badge-card--silver {
    border-color: #c7c9cf;
}

.badge-card--gold {
    border-color: var(--warn);
}

.badge-card--diamond {
    border-color: var(--blue);
}

.badge-card--legend {
    border-color: var(--pink);
    box-shadow: 0 0 20px -6px var(--pink);
}

/* ---------------------------------------------------------------- skills */
.skill-category {
    margin-bottom: 22px;
}

.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(220px,1fr));
    gap: 12px;
}

.skill-card {
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: border-color .15s, transform .12s;
}

    .skill-card:active {
        transform: scale(.98);
    }

    .skill-card.skill-unlocked {
        border-color: var(--accent);
    }

    .skill-card.skill-mastered {
        border-color: var(--lime);
        box-shadow: 0 0 22px -8px var(--lime);
    }

.skill-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.skill-diff-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    padding: 4px 8px;
}

.skill-active-badge {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    color: var(--accent);
}

.skill-mastered-badge {
    font-size: 16px;
}

.skill-name {
    font-family: var(--font-display);
    font-size: 18px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.skill-desc {
    font-size: 12px;
    line-height: 1.4;
    min-height: 32px;
}

.skill-progress-wrap {
    margin-top: 12px;
}

.skill-progress-bar {
    height: 7px;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: 100px;
    overflow: hidden;
}

.skill-progress-fill {
    height: 100%;
    background: linear-gradient(90deg,var(--accent),var(--lime));
    transition: width .8s cubic-bezier(.2,.8,.2,1);
}

.skill-step-label {
    font-size: 10.5px;
    font-family: var(--font-mono);
    margin-top: 5px;
}

.skill-current-step {
    font-size: 11.5px;
    margin-top: 6px;
}

.skill-lock-state {
    font-size: 12px;
    margin-top: 10px;
}

.req-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    font-size: 12.5px;
    border-bottom: 1px solid var(--line);
}

.req-met {
    color: var(--good);
}

.req-unmet {
    color: var(--muted);
}

.step-row {
    display: flex;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--card-2);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    flex: 0 0 auto;
}

.step-row.step-current .step-num {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}

.step-row.step-done .step-num {
    background: var(--good);
    color: #062112;
    border-color: var(--good);
}

.step-title {
    font-weight: 800;
    font-size: 13px;
}

.step-inst {
    font-size: 11.5px;
    margin-top: 2px;
}

.tip-item {
    font-size: 12.5px;
    padding: 8px 10px;
    background: var(--card-2);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.video-placeholder {
    background: var(--card-2);
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    font-size: 12px;
}

/* ---------------------------------------------------------------- active workout */
.active-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    --pct: 0;
}

.active-title {
    font-family: var(--font-display);
    font-size: 24px;
    text-transform: uppercase;
}

.active-sub {
    font-size: 12px;
    margin-top: 2px;
}

.active-header-right {
    text-align: right;
}

.active-timer {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--lime);
}

.active-sets-pill {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    background: var(--card-2);
    border: 1px solid var(--line);
    padding: 4px 10px;
    border-radius: 100px;
    margin-top: 4px;
    display: inline-block;
}

.ex-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ex-card {
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.ex-card--flagged {
    border-color: var(--danger);
}

.ex-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    cursor: pointer;
}

.ex-card-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.ex-set-dots {
    display: flex;
    gap: 4px;
}

.set-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--line);
}

    .set-dot.dot-done {
        background: var(--good);
    }

    .set-dot.dot-skip {
        background: var(--muted-2);
    }

.ex-chevron {
    font-size: 11px;
    color: var(--muted-2);
}

.flag-dot {
    margin-left: 4px;
}

.injury-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #ff4d5e1a;
    border-top: 1px solid var(--danger);
    padding: 8px 16px;
    font-size: 11.5px;
    font-weight: 700;
}

.ex-card-body {
    padding: 0 16px 14px;
    border-top: 1px solid var(--line);
}

.set-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--line);
}

    .set-row.set-done {
        opacity: .55;
    }

    .set-row.set-skipped {
        opacity: .35;
        text-decoration: line-through;
    }

.set-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--card-2);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    flex: 0 0 auto;
}

.set-main {
    flex: 1;
    min-width: 0;
}

.set-target {
    font-size: 10.5px;
    font-family: var(--font-mono);
    margin-bottom: 5px;
}

.set-inputs {
    display: flex;
    gap: 6px;
}

.set-input {
    width: 72px;
    background: var(--bg-soft);
    border: 1.5px solid var(--line);
    border-radius: 10px;
    color: var(--chalk);
    padding: 8px 10px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
}

    .set-input:focus {
        outline: none;
        border-color: var(--accent);
    }

.set-input--weight {
    width: 64px;
}

.set-btns {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}

.btn-set-done, .btn-set-skip {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--line);
    background: var(--card-2);
    cursor: pointer;
    font-weight: 800;
    font-size: 14px;
}

.btn-set-done {
    color: var(--good);
}

    .btn-set-done:active {
        background: var(--good);
        color: #062112;
    }

.btn-set-skip {
    color: var(--muted-2);
}

    .btn-set-skip:active {
        background: var(--danger);
        color: #2a0308;
    }

    .btn-set-done:disabled, .btn-set-skip:disabled {
        opacity: .35;
        pointer-events: none;
    }

.ex-note {
    font-size: 11.5px;
    margin-top: 10px;
}

.rest-timer {
    text-align: center;
    padding: 14px 0 6px;
}

.rest-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.rest-progress-ring {
    width: 100px;
    height: 100px;
    position: relative;
}

    .rest-progress-ring svg {
        width: 100%;
        height: 100%;
        transition: stroke-dashoffset .3s linear;
    }

.rest-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.rest-label {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 700;
}

.rest-big {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    color: var(--lime);
}

.finish-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 0 16px calc(12px + env(safe-area-inset-bottom));
    pointer-events: none;
}

@media (min-width:901px) {
    .finish-bar {
        left: 110px;
    }
}

.finish-bar-inner {
    pointer-events: auto;
    background: color-mix(in srgb, var(--bg-soft) 94%, transparent);
    backdrop-filter: blur(14px);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 12px 14px;
    max-width: 760px;
    margin: 0 auto;
    box-shadow: 0 -10px 30px -10px rgba(0,0,0,.5);
}

@media (max-width:900px) {
    .finish-bar {
        padding-bottom: calc(var(--nav-size) + 12px);
    }
}

.finish-rpe {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    overflow-x: auto;
}

.rpe-lbl {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    flex: 0 0 auto;
}

.rpe-pills {
    display: flex;
    gap: 4px;
}

.rpe-pill {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--card-2);
    color: var(--chalk);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}

    .rpe-pill.active {
        background: var(--accent);
        border-color: var(--accent);
        color: var(--accent-ink);
    }

.finish-notes {
    width: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--chalk);
    padding: 9px 12px;
    font-family: var(--font-body);
    font-size: 12.5px;
    resize: none;
    margin-bottom: 8px;
}

.finish-btn {
    width: 100%;
}

/* ---------------------------------------------------------------- programs */
.program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(230px,1fr));
    gap: 12px;
}

.program-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.program-name {
    font-family: var(--font-display);
    font-size: 17px;
    text-transform: uppercase;
}

.program-desc {
    font-size: 12.5px;
    margin-top: 6px;
    min-height: 34px;
}

.program-meta {
    font-size: 10.5px;
    font-family: var(--font-mono);
    margin-top: 8px;
}

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

.preset-card {
    border-color: var(--accent);
}

.schedule-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-slot {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

.slot-day {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 12px;
    width: 38px;
    flex: 0 0 auto;
}

.slot-select {
    flex: 1;
}

.builder-day {
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
}

.builder-day-header {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

    .builder-day-header .day-name-input {
        flex: 2;
        min-width: 140px;
    }

    .builder-day-header .day-type-select {
        flex: 1;
        min-width: 110px;
    }

.day-exercises {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.builder-exercise {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px;
}

.ex-filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.bex-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.bex-select {
    flex: 2;
    min-width: 160px;
}

.bex-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 0 0 66px;
}

.bex-field-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--text-muted);
    white-space: nowrap;
}

.bex-weight-wrap.bex-field {
    flex: 0 0 90px;
}

.builder-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.prog-day-block {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.prog-day-header {
    font-size: 13.5px;
    margin-bottom: 6px;
}

.prog-ex-row {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    padding: 5px 0;
}

/* ---------------------------------------------------------------- profile: measurements/calc */
.meas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(80px,1fr));
    gap: 10px;
}

.meas-item {
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.meas-val {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 15px;
}

.meas-lbl {
    font-size: 9.5px;
    color: var(--muted);
    margin-top: 3px;
    text-transform: uppercase;
}

.meas-history-row {
    display: flex;
    gap: 10px;
    font-size: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.meas-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.orm-result, .macro-result {
    margin-top: 14px;
    text-align: center;
}

.orm-val {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 700;
}

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

.macro-box {
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 4px;
    text-align: center;
}

.macro-val {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
}

.macro-lbl {
    font-size: 9px;
    color: var(--muted);
    margin-top: 3px;
    text-transform: uppercase;
}

@media (max-width:480px) {
    .macro-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---------------------------------------------------------------- injuries */
.injury-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    font-size: 12.5px;
}

    .injury-row button {
        background: var(--good);
        color: #062112;
        border: none;
        border-radius: 50%;
        width: 28px;
        height: 28px;
        cursor: pointer;
        font-weight: 800;
    }

/* ---------------------------------------------------------------- journey / achievements */
.journey-card {
    background: linear-gradient(135deg,var(--accent-dim),transparent 60%),var(--card);
}

.journey-title {
    font-family: var(--font-display);
    font-size: 26px;
    text-transform: uppercase;
    color: var(--accent);
}

.journey-points {
    font-size: 12px;
    margin-top: 2px;
}

.ach-overall-bar {
    height: 9px;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: 100px;
    overflow: hidden;
}

.ach-overall-fill {
    height: 100%;
    background: linear-gradient(90deg,var(--accent),var(--lime));
    transition: width 1s cubic-bezier(.2,.8,.2,1);
}

.ach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(120px,1fr));
    gap: 10px;
}

.ach-tile {
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
}

    .ach-tile.ach-locked {
        opacity: .45;
    }

    .ach-tile.ach-unlocked {
        border-color: var(--accent);
    }

.ach-tile-icon {
    font-size: 26px;
}

.ach-tile-name {
    font-weight: 800;
    font-size: 11.5px;
    margin-top: 6px;
}

.ach-tile-rarity {
    font-family: var(--font-mono);
    font-size: 8.5px;
    margin-top: 3px;
    font-weight: 700;
}

.ach-tile-date {
    font-size: 9px;
    margin-top: 3px;
}

.ach-rarity--common {
    color: var(--muted);
}

.ach-rarity--rare {
    color: var(--blue);
}

.ach-rarity--epic {
    color: var(--purple);
}

.ach-rarity--legendary {
    color: var(--pink);
}

/* overlay (defined in _Layout) */
.ach-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(6,6,7,.75);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
}

.ach-card {
    position: relative;
    width: min(340px,86vw);
    background: var(--card);
    border: 1.5px solid var(--accent);
    border-radius: 28px;
    padding: 32px 24px;
    text-align: center;
    overflow: hidden;
}

.ach-glow {
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle, var(--accent-dim), transparent 60%);
    pointer-events: none;
}

.ach-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: .12em;
    color: var(--accent);
    font-weight: 700;
    position: relative;
}

.ach-icon {
    font-size: 48px;
    margin: 14px 0;
    position: relative;
}

.ach-name {
    font-family: var(--font-display);
    font-size: 22px;
    text-transform: uppercase;
    position: relative;
}

.ach-rarity {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    margin-top: 6px;
    position: relative;
}

.ach-pop {
    animation: achpop .5s cubic-bezier(.2,.9,.25,1.3);
}

@keyframes achpop {
    from {
        transform: scale(.7);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ---------------------------------------------------------------- toast */
.ff-update-banner {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    z-index: 600;
    background: var(--card);
    border: 0.5px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.28);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    transform: translateY(calc(-100% - 24px));
    transition: transform .28s ease;
}

    .ff-update-banner.show {
        transform: translateY(0);
    }

.ff-update-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    flex-shrink: 0;
    background: var(--accent-dim);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ff-update-text {
    flex: 1;
    min-width: 0;
}

.ff-update-title {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--chalk);
}

.ff-update-subtitle {
    font-size: 12px;
    color: var(--muted);
}

.ff-update-banner .btn {
    flex-shrink: 0;
}

#toast-stack {
    position: fixed;
    top: calc(16px + env(safe-area-inset-top));
    left: 0;
    right: 0;
    z-index: 150;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.stack-toast {
    background: var(--chalk);
    color: #141416;
    font-weight: 800;
    font-size: 13px;
    padding: 11px 18px;
    border-radius: 100px;
    box-shadow: 0 14px 30px -8px rgba(0,0,0,.5);
    transform: translateY(-140%);
    opacity: 0;
    transition: all .35s cubic-bezier(.2,.9,.2,1.2);
}

    .stack-toast.visible {
        transform: translateY(0);
        opacity: 1;
    }

    .stack-toast.success {
        background: var(--good);
    }

    .stack-toast.danger {
        background: var(--danger);
        color: #fff;
    }

.toast {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: calc(var(--nav-size) + 16px);
    z-index: 150;
    max-width: 420px;
    margin: 0 auto;
    background: var(--chalk);
    color: #141416;
    border-radius: 16px;
    padding: 13px 18px;
    font-weight: 800;
    font-size: 13.5px;
    transform: translateY(160%);
    transition: transform .4s cubic-bezier(.2,.9,.2,1.2);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,.5);
}

    .toast.show {
        transform: translateY(0);
    }

    .toast.success {
        background: var(--good);
    }

    .toast.danger {
        background: var(--danger);
        color: #fff;
    }

@media (min-width:901px) {
    .toast {
        left: 126px;
        bottom: 24px;
    }
}

/* ---------------------------------------------------------------- confetti (JS-spawned) */
.ff-confetti-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 450;
    overflow: hidden;
}

.ff-confetto {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: ffburst .9s cubic-bezier(.15,.7,.3,1) forwards;
}

@keyframes ffburst {
    to {
        transform: translate(var(--dx),var(--dy)) rotate(var(--rot));
        opacity: 0;
    }
}

/* ---------------------------------------------------------------- accent swatches (Profile > Settings) */
.accent-row {
    display: flex;
    gap: 12px;
}

.accent-swatch {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .accent-swatch.active {
        border-color: var(--chalk);
    }

    .accent-swatch svg {
        width: 14px;
        height: 14px;
        opacity: 0;
    }

    .accent-swatch.active svg {
        opacity: 1;
    }

.theme-toggle-row {
    display: flex;
    gap: 10px;
}

/* ---------------------------------------------------------------- auth (login/register) */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-wrap {
    width: 100%;
    max-width: 400px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    justify-content: center;
}

.auth-logo-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg,var(--accent),var(--pink));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    color: var(--accent-ink);
    font-size: 18px;
}

.auth-logo-text {
    font-family: var(--font-display);
    font-size: 22px;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
}

.auth-sub {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin: -6px 0 18px;
}

.auth-label {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 700;
    display: block;
    margin: 0 0 6px;
}

.auth-switch {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin-top: 16px;
}

    .auth-switch a {
        color: var(--accent);
        font-weight: 700;
    }

.pw-field {
    position: relative;
}

.pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 700;
}

.pw-bar {
    height: 4px;
    border-radius: 100px;
    background: var(--card-2);
    margin-top: 8px;
    overflow: hidden;
}

.pw-strength {
    height: 100%;
    width: 0%;
    background: var(--danger);
    transition: all .25s ease;
}

.pw-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.pw-rule {
    font-family: var(--font-mono);
    font-size: 9.5px;
    padding: 3px 8px;
    border-radius: 100px;
    background: var(--card-2);
    color: var(--muted);
    border: 1px solid var(--line);
}

    .pw-rule.met {
        color: var(--good);
        border-color: var(--good);
    }

/* ---------------------------------------------------------------- active workout v2: bottom-sheet logger */
.session-progresswrap {
    margin: 14px 0 18px;
}

.session-progressbar {
    height: 8px;
    border-radius: 100px;
    background: var(--card-2);
    overflow: hidden;
    border: 1px solid var(--line);
}

    .session-progressbar .fill {
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, var(--accent), var(--lime));
        transition: width .5s cubic-bezier(.2,.8,.2,1);
    }

.session-progresswrap .cap {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 10.5px;
    color: var(--muted);
    font-weight: 700;
    font-family: var(--font-mono);
}

.exrow {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-lg);
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color .15s ease;
}

.exrow-main {
    display: none; /* icon/name/target header — redundant now, hero card shows this */
}

/* Hero carousel replaced the flat per-row list — nothing was deleted (dots,
   rest timer, flag note all keep their real ids and every existing
   set-logging/warm-up/drop-set/tempo/edit-set function untouched), it's just
   not shown in place. JS moves the currently-focused exercise's real .exrow
   node into #hero-dots-slot (an actual DOM move, not a clone — set states,
   rest countdowns, and flag notes all keep working exactly as before). Every
   other .exrow just stays put, off-screen, until it's its turn. */
.exrow {
    display: none;
}

#hero-dots-slot .exrow {
    display: flex;
    background: none;
    border: none;
    border-radius: 0;
    margin-bottom: 0;
}

.active-divider {
    height: 1px;
    background: var(--line);
    margin: 4px 0 16px;
}

.hero-card {
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 12px;
    cursor: pointer;
}

.hero-imgwrap {
    width: 100%;
    background: var(--card-2);
    overflow: hidden;
    position: relative;
    line-height: 0;
}

    .hero-imgwrap.ff-loading::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--chalk) 8%, transparent), transparent);
        animation: ff-shimmer 1.3s ease-in-out infinite;
    }

@keyframes ff-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.hero-imgwrap img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity .18s ease;
}

.hero-thumb-fallback {
    font-size: 48px;
}

.hero-meta {
    padding: 14px 16px 10px;
    transition: opacity .18s ease;
}

.hero-name {
    font-family: var(--font-display);
    font-size: 19px;
    text-transform: uppercase;
    color: var(--chalk);
    margin-bottom: 8px;
}

.hero-dots-slot .exsets {
    padding: 0;
}

.hero-nav {
    display: flex;
    border-top: 1px solid var(--line);
    margin-top: 12px;
}

.hero-nav-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: var(--chalk);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .1s ease, background .1s ease;
}

    .hero-nav-btn:first-child {
        border-right: 1px solid var(--line);
    }

    .hero-nav-btn:active {
        transform: scale(.96);
        background: var(--card-2);
    }

    .hero-nav-btn.hidden {
        visibility: hidden;
    }

.bubble-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    overflow-x: auto;
    padding: 2px 2px 14px;
    scrollbar-width: none;
}

    .bubble-row::-webkit-scrollbar {
        display: none;
    }

.bubble {
    flex: 0 0 auto;
    width: 60px;
    text-align: center;
    cursor: pointer;
    transition: transform .1s ease;
}

    .bubble:active {
        transform: scale(.92);
    }

.bubble-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--card-2);
    border: 2px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 4px;
    overflow: hidden;
    position: relative;
    transition: border-color .15s ease;
}

    .bubble-icon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.bubble.active .bubble-icon {
    border-color: var(--accent);
}

.bubble-check {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--good);
    color: var(--bg);
    font-size: 10px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bubble-label {
    font-size: 9px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bubble.active .bubble-label {
    color: var(--chalk);
    font-weight: 700;
}

.exrow.complete {
    border-color: var(--good);
}

.exrow.resting {
    border-color: var(--accent);
}

.exicon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: var(--card-2);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
}

    .exicon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.exmeta {
    flex: 1;
    min-width: 0;
}

    .exmeta .n {
        font-weight: 800;
        font-size: 14.5px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .exmeta .s {
        font-size: 11.5px;
        color: var(--muted);
        font-family: var(--font-mono);
        margin-top: 2px;
    }

.exsets {
    display: flex;
    gap: 4px;
}

.setdot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--line);
    transition: transform .1s ease, background .15s ease;
}

    .setdot:active {
        transform: scale(1.6);
    }

    .setdot.on {
        background: var(--good);
    }

    .setdot.skip {
        background: var(--muted-2);
    }

    .setdot.warmupdot {
        border: 1px solid var(--warn);
        background: none;
        margin-right: 2px;
    }

        .setdot.warmupdot.on {
            background: var(--warn);
        }

.chev {
    color: var(--muted-2);
    font-size: 18px;
    flex: 0 0 auto;
}

.exrow-flagnote {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #ff4d5e1a;
    border-top: 1px solid var(--danger);
    padding: 8px 15px;
    font-size: 11.5px;
    font-weight: 700;
}

.exrow-restbar {
    padding: 0 15px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .exrow-restbar .rb-track {
        flex: 1;
        height: 6px;
        border-radius: 100px;
        background: var(--card-2);
        overflow: hidden;
    }

    .exrow-restbar .rb-fill {
        height: 100%;
        background: var(--accent);
        transition: width 1s linear;
    }

    .exrow-restbar .rb-txt {
        font-family: var(--font-mono);
        font-size: 11px;
        font-weight: 700;
        color: var(--accent);
        flex: 0 0 auto;
    }

    .exrow-restbar .rb-skip {
        font-family: var(--font-mono);
        font-size: 10px;
        font-weight: 700;
        color: var(--muted);
        background: none;
        border: none;
        cursor: pointer;
        text-decoration: underline;
    }

/* the reusable logging sheet */
.ff-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6,6,7,.62);
    backdrop-filter: blur(2px);
    z-index: 210;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

    .ff-sheet-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }

@media (min-width:701px) {
    .ff-sheet-backdrop {
        align-items: center;
    }
}

.ff-sheet {
    width: 100%;
    max-width: 480px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-bottom: none;
    border-radius: 28px 28px 0 0;
    padding: 10px 22px 26px;
    transform: translateY(100%);
    transition: transform .34s cubic-bezier(.16,.9,.24,1.05);
    box-shadow: 0 -20px 50px -10px rgba(0,0,0,.6);
}

.ff-sheet-backdrop.show .ff-sheet {
    transform: translateY(0);
}

@media (min-width:701px) {
    .ff-sheet {
        border-radius: 28px;
        border-bottom: 1px solid var(--line);
    }
}

.ff-sheet-handle {
    width: 38px;
    height: 4px;
    background: var(--line);
    border-radius: 100px;
    margin: 0 auto 14px;
}

.ff-sheet-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

    .ff-sheet-head .n {
        font-size: 19px;
        font-weight: 800;
    }

    .ff-sheet-head .setno {
        font-family: var(--font-mono);
        font-size: 12px;
        color: var(--accent);
        font-weight: 700;
        background: var(--accent-dim);
        padding: 4px 9px;
        border-radius: 100px;
        flex: 0 0 auto;
    }

.ff-last-time {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--muted);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 100px;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
}

    .ff-last-time b {
        color: var(--lime);
        font-weight: 700;
    }

.ff-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
    margin: 22px 0 6px;
}

.ff-stepbtn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--card-2);
    border: 1px solid var(--line);
    color: var(--chalk);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    user-select: none;
}

    .ff-stepbtn:active {
        background: var(--accent);
        color: var(--accent-ink);
        transform: scale(.92);
    }

.ff-repnum {
    font-family: var(--font-mono);
    font-size: 56px;
    font-weight: 700;
    min-width: 110px;
    text-align: center;
    color: var(--lime);
}

.ff-repcap {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 20px;
}

.ff-fieldrow {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.ff-field {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

    .ff-field .flbl {
        font-size: 9.5px;
        color: var(--muted);
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .06em;
    }

    .ff-field .fval {
        font-family: var(--font-mono);
        font-size: 16px;
        font-weight: 700;
        margin-top: 2px;
        background: none;
        border: none;
        color: var(--chalk);
        width: 100%;
        padding: 0;
    }

        .ff-field .fval:focus {
            outline: none;
        }

.ff-rpewrap {
    margin-bottom: 22px;
}

.ff-rpe-head {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 8px;
}

    .ff-rpe-head b {
        color: var(--chalk);
        font-family: var(--font-mono);
    }

.ff-sheet input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--good), var(--accent) 60%, var(--pink));
}

    .ff-sheet input[type=range]::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: var(--chalk);
        border: 4px solid var(--bg-soft);
        cursor: pointer;
        margin-top: -8px;
        box-shadow: 0 4px 10px rgba(0,0,0,.4);
    }

.ff-rest-view {
    text-align: center;
    padding: 10px 0 4px;
}

.ff-rest-ring {
    width: 120px;
    height: 120px;
    margin: 6px auto 14px;
    position: relative;
}

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

.ff-rest-ring-bg {
    fill: none;
    stroke: var(--line);
    stroke-width: 8;
}

.ff-rest-ring-fg {
    fill: none;
    stroke: var(--accent);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.ff-rest-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

    .ff-rest-ring-center .lbl {
        font-family: var(--font-mono);
        font-size: 9px;
        letter-spacing: .1em;
        color: var(--muted);
        font-weight: 700;
    }

    .ff-rest-ring-center .num {
        font-family: var(--font-mono);
        font-size: 26px;
        font-weight: 700;
        color: var(--lime);
    }

.active-finish-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 0 16px calc(12px + env(safe-area-inset-bottom));
    pointer-events: none;
}

@media (min-width:901px) {
    .active-finish-bar {
        left: 110px;
    }
}

.active-finish-inner {
    pointer-events: auto;
    background: color-mix(in srgb, var(--bg-soft) 94%, transparent);
    backdrop-filter: blur(14px);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 12px 14px;
    max-width: 760px;
    margin: 0 auto;
    box-shadow: 0 -10px 30px -10px rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width:900px) {
    .active-finish-bar {
        padding-bottom: calc(var(--nav-size) + 12px);
    }
}

.active-finish-inner .btn {
    width: 100%;
}

.discard-session-btn {
    display: block;
    pointer-events: auto;
    margin: 10px auto 0;
    background: none;
    border: none;
    color: var(--danger);
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: opacity .1s ease;
}

    .discard-session-btn:active {
        opacity: .6;
    }

/* ---------------------------------------------------------------- dashboard v2: hero layout */
.dash-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0 18px;
    flex-wrap: wrap;
}

.dash-greet-eyebrow {
    margin-bottom: 4px;
}

.dash-greet {
    font-size: 28px;
}

.dash-streakpill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--card);
    border: 1px solid var(--line);
    padding: 8px 12px 8px 10px;
    border-radius: 100px;
}

.dash-flame {
    width: 16px;
    height: 16px;
    display: block;
    filter: drop-shadow(0 0 6px var(--accent-dim));
    animation: ffflicker 1.6s ease-in-out infinite;
}

@keyframes ffflicker {
    0%,100% {
        transform: scale(1) rotate(0deg);
    }

    30% {
        transform: scale(1.08) rotate(-3deg);
    }

    60% {
        transform: scale(.96) rotate(2deg);
    }
}

.dash-streakpill b {
    font-family: var(--font-mono);
    font-size: 14px;
}

.dash-hero {
    background: linear-gradient(135deg, var(--accent-dim), transparent 55%), var(--card);
    border: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}

    .dash-hero::after {
        content: "";
        position: absolute;
        right: -30px;
        top: -30px;
        width: 160px;
        height: 160px;
        background: radial-gradient(circle, var(--accent-dim), transparent 70%);
        pointer-events: none;
    }

.dash-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    position: relative;
}

.dash-hero-title {
    font-size: 32px;
    margin: 4px 0 2px;
}

.dash-hero-sub {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
}

.dash-tagchip {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 5px 9px;
    border-radius: 100px;
    text-transform: uppercase;
    flex: 0 0 auto;
}

.dash-chiplist {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 14px 0 16px;
    position: relative;
}

    .dash-chiplist span {
        font-size: 11px;
        color: var(--muted);
        background: var(--card-2);
        border: 1px solid var(--line);
        padding: 5px 9px;
        border-radius: 100px;
    }

        .dash-chiplist span.flagged {
            color: var(--danger);
            border-color: var(--danger);
        }

.bento {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

    .bento .stat {
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: var(--radius-md);
        padding: 13px 10px;
        text-align: left;
    }

        .bento .stat .num {
            font-family: var(--font-mono);
            font-size: 21px;
            font-weight: 700;
            color: var(--lime);
        }

        .bento .stat .lbl {
            font-size: 9.5px;
            color: var(--muted);
            margin-top: 3px;
            font-weight: 700;
            letter-spacing: .02em;
            text-transform: uppercase;
        }

.weekrow {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.daydot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

    .daydot .lbl {
        font-size: 10px;
        color: var(--muted-2);
        font-weight: 700;
    }

    .daydot .dot {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        border: 2px solid var(--line);
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .daydot .dot.done {
            background: var(--accent);
            border-color: var(--accent);
            box-shadow: 0 0 0 4px var(--accent-dim);
        }

        .daydot .dot.today {
            border-color: var(--lime);
            border-style: dashed;
        }

        .daydot .dot.missed {
            border-color: var(--danger);
        }

        .daydot .dot.rest {
            border-style: dotted;
            opacity: 0.55;
        }

        .daydot .dot.upcoming {
            border-color: var(--line);
        }

        .daydot .dot.istoday {
            box-shadow: inset 0 0 0 2px var(--lime);
        }

        .daydot .dot svg {
            width: 12px;
            height: 12px;
        }

.dash-water-head {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    color: var(--blue);
}

.dash-water-goal {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
}

.water-pillrow {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.ring-wrap {
    position: relative;
    width: 60px;
    height: 60px;
    flex: 0 0 auto;
}

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

.ring-bg {
    fill: none;
    stroke: var(--line);
    stroke-width: 7;
}

.ring-fg {
    fill: none;
    stroke: var(--accent);
    stroke-width: 7;
    stroke-linecap: round;
}

.ring-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 12.5px;
}

.skillcard-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.skillcard-meta {
    flex: 1;
    min-width: 0;
}

/* ---------------------------------------------------------------- onboarding tour */
.ff-tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 600;
}

.ff-tour-spot {
    position: absolute;
    border-radius: 20px;
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(6,6,7,.78);
    transition: left .3s cubic-bezier(.2,.8,.2,1), top .3s cubic-bezier(.2,.8,.2,1), width .3s cubic-bezier(.2,.8,.2,1), height .3s cubic-bezier(.2,.8,.2,1);
    border: 2px solid var(--accent);
}

.ff-tour-card {
    position: fixed;
    transform: translateX(-50%);
    width: min(320px, 88vw);
    background: var(--card);
    border: 1px solid var(--accent);
    border-radius: 20px;
    padding: 18px 20px;
    box-shadow: 0 20px 50px -10px rgba(0,0,0,.6);
    transition: top .3s cubic-bezier(.2,.8,.2,1);
}

.ff-tour-card--center {
    top: 50% !important;
    transform: translate(-50%,-50%);
    text-align: center;
}

.ff-tour-dots {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    justify-content: center;
}

.ff-tour-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--line);
}

    .ff-tour-dot.active {
        background: var(--accent);
        width: 16px;
        border-radius: 100px;
    }

.ff-tour-title {
    font-family: var(--font-display);
    font-size: 19px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.ff-tour-text {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

.ff-tour-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ff-tour-card--center .ff-tour-actions {
    flex-direction: column-reverse;
}

.ff-tour-skip {
    background: none;
    border: none;
    color: var(--muted-2);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

/* ---------------------------------------------------------------- AI Coach */
.coach-orb {
    position: fixed;
    right: 20px;
    bottom: calc(var(--nav-size) + 18px);
    z-index: 150;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 70%, white), var(--accent) 60%);
    box-shadow: 0 8px 24px -6px var(--accent-dim), 0 0 0 1px rgba(255,255,255,.12) inset;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: right .55s cubic-bezier(.22,.9,.3,1), bottom .55s cubic-bezier(.22,.9,.3,1), transform .2s ease, opacity .2s ease;
    animation: coachBreathe 3.4s ease-in-out infinite;
}

@media (min-width:901px) {
    .coach-orb {
        right: 32px;
        bottom: 32px;
    }
}

.coach-orb svg {
    width: 24px;
    height: 24px;
}

.coach-orb:active {
    transform: scale(.92);
}

.coach-orb.coach-hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.coach-orb-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--danger);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--bg);
}

@keyframes coachBreathe {
    0%,100% {
        box-shadow: 0 8px 24px -6px var(--accent-dim), 0 0 0 1px rgba(255,255,255,.12) inset;
    }

    50% {
        box-shadow: 0 8px 30px -3px var(--accent-dim), 0 0 0 1px rgba(255,255,255,.18) inset;
    }
}

.coach-backdrop {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(6,6,7,.55);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

    .coach-backdrop.open {
        opacity: 1;
        pointer-events: auto;
    }

@media (min-width:701px) {
    .coach-backdrop {
        align-items: center;
    }
}

.coach-panel {
    width: 100%;
    max-width: 440px;
    height: min(640px,86vh);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-bottom: none;
    border-radius: 26px 26px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform .4s cubic-bezier(.22,.9,.3,1);
    box-shadow: 0 -20px 60px -10px rgba(0,0,0,.6);
}

.coach-backdrop.open .coach-panel {
    transform: translateY(0);
}

@media (min-width:701px) {
    .coach-panel {
        border-radius: 26px;
        border-bottom: 1px solid var(--line);
    }
}

.coach-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
}

.coach-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 70%, white), var(--accent) 60%);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .coach-avatar svg {
        width: 18px;
        height: 18px;
    }

.coach-title {
    font-family: var(--font-display);
    font-size: 16px;
    text-transform: uppercase;
}

.coach-sub {
    font-size: 11px;
    color: var(--good);
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
}

    .coach-sub::before {
        content: "";
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--good);
    }

.coach-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
}

.coach-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.coach-msg {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
}

    .coach-msg.bot {
        background: var(--card-2);
        border: 1px solid var(--line);
        border-bottom-left-radius: 4px;
        align-self: flex-start;
    }

    .coach-msg.user {
        background: var(--accent);
        color: var(--accent-ink);
        font-weight: 600;
        border-bottom-right-radius: 4px;
        align-self: flex-end;
    }

    .coach-msg.typing {
        font-family: var(--font-mono);
        letter-spacing: .1em;
    }

.coach-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-self: flex-start;
    max-width: 100%;
}

.coach-chip {
    background: var(--card-2);
    border: 1px solid var(--line);
    color: var(--chalk);
    font-size: 12.5px;
    font-weight: 600;
    padding: 8px 13px;
    border-radius: 20px;
    cursor: pointer;
    transition: .15s ease;
}

    .coach-chip:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

.coach-propose {
    background: var(--card-2);
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 14px;
    align-self: stretch;
}

.coach-propose-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.coach-propose-title {
    font-family: var(--font-display);
    font-size: 15px;
    text-transform: uppercase;
}

.coach-propose-days {
    font-size: 10px;
    color: var(--muted);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.coach-propose-day {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--accent);
    margin: 8px 0 2px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.coach-propose-ex {
    font-size: 12.5px;
    padding: 6px 0;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
}

    .coach-propose-ex:first-of-type {
        border-top: none;
    }

.coach-propose-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.coach-applied {
    align-self: flex-start;
    font-size: 11.5px;
    color: var(--good);
    font-weight: 700;
    padding: 4px 0;
}

.coach-input-row {
    display: flex;
    gap: 8px;
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    flex: 0 0 auto;
}

.coach-input {
    flex: 1;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 11px 16px;
    color: var(--chalk);
    font-size: 13.5px;
    outline: none;
    font-family: var(--font-body);
}

    .coach-input:focus {
        border-color: var(--accent);
    }

.coach-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}

    .coach-send svg {
        width: 16px;
        height: 16px;
    }

/* Tutorial orb — a second copy of the orb that visually "guides" the tour,
   positioned next to whichever element the spotlight is highlighting */
.ff-tour-guide-orb {
    position: fixed;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    z-index: 601;
    background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 70%, white), var(--accent) 60%);
    box-shadow: 0 8px 20px -4px var(--accent-dim), 0 0 0 1px rgba(255,255,255,.12) inset;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left .45s cubic-bezier(.22,.9,.3,1), top .45s cubic-bezier(.22,.9,.3,1);
    opacity: 0;
    pointer-events: none;
}

    .ff-tour-guide-orb.show {
        opacity: 1;
    }

    .ff-tour-guide-orb svg {
        width: 20px;
        height: 20px;
    }

/* ---------------------------------------------------------------- misc */
.text-danger {
    color: var(--danger);
}
