/* =====================================================================
   Theme layer — loaded last.
   One art direction: mauve/indigo primary, violet secondary, green = done.
   Gamified 3D buttons (solid bottom edge that collapses on press),
   unified series cards (normal / superset / unilateral) and micro-animations.
   ===================================================================== */

:root {
    --btn-depth: 4px;
    --btn-depth-sm: 3px;
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --tint-primary: rgba(99, 102, 241, 0.08);
    --tint-primary-strong: rgba(99, 102, 241, 0.14);
    --tint-purple: rgba(168, 85, 247, 0.1);
    --tint-success: rgba(34, 197, 94, 0.1);
}

/* ---------- Gamified buttons ---------- */

.btn {
    font-weight: 700;
    transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), background-color 0.2s ease, opacity 0.2s ease;
}

.btn:active {
    transform: translateY(var(--btn-depth-sm));
}

.btn-primary {
    background: var(--grad-primary);
    box-shadow: 0 var(--btn-depth) 0 var(--primary-3d), 0 10px 22px rgba(99, 102, 241, 0.25);
    text-shadow: 0 1px 0 rgba(49, 46, 129, 0.25);
}

.btn-primary::after {
    background: radial-gradient(circle at 50% 50%, rgba(196, 181, 253, 0.22) 0%, transparent 66%);
}

.btn-primary:active,
.btn-primary.is-pressed {
    transform: translateY(var(--btn-depth));
    box-shadow: 0 0 0 var(--primary-3d), 0 4px 10px rgba(99, 102, 241, 0.2);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--primary-dark);
    border: 2px solid #e4e4f7;
    box-shadow: 0 var(--btn-depth-sm) 0 #e4e4f7;
}

.btn-secondary:active {
    transform: translateY(var(--btn-depth-sm));
    box-shadow: 0 0 0 #e4e4f7;
}

.btn-outline {
    border-color: #e4e4f7;
    box-shadow: 0 var(--btn-depth-sm) 0 #e4e4f7;
}

.btn-outline:active {
    box-shadow: none;
}

/* Every "validate" action shares the same green 3D look */

.btn-series-done,
.btn-unilateral-validate,
.btn-superset-validate,
.btn-finish {
    background: var(--grad-success);
    color: #fff;
    border: none;
    box-shadow: 0 var(--btn-depth) 0 var(--success-3d), 0 10px 20px rgba(34, 197, 94, 0.22);
    text-shadow: 0 1px 0 rgba(21, 128, 61, 0.35);
    font-weight: 800;
    letter-spacing: 0.01em;
    min-height: 50px;
    border-radius: var(--radius-md);
}

.btn-series-done:active,
.btn-unilateral-validate:active,
.btn-superset-validate:active,
.btn-finish:active {
    transform: translateY(var(--btn-depth));
    box-shadow: 0 0 0 var(--success-3d), 0 4px 10px rgba(34, 197, 94, 0.2);
}

.header-session .btn-finish {
    box-shadow: 0 var(--btn-depth) 0 var(--success-3d), 0 10px 20px rgba(34, 197, 94, 0.2);
}

.btn-series-done:disabled,
.btn-unilateral-validate:disabled,
.btn-superset-validate:disabled {
    box-shadow: 0 var(--btn-depth) 0 #cbd5e1;
    background: #e2e8f0;
    color: var(--text-muted);
    text-shadow: none;
}

.btn-save-edit,
.btn-save-edit-superset,
.btn-save-edit-unilateral {
    width: 100%;
    min-height: 50px;
    border: 2px solid rgba(99, 102, 241, 0.28) !important;
    box-shadow: 0 var(--btn-depth-sm) 0 rgba(99, 102, 241, 0.28);
    font-weight: 800;
}

.btn-danger {
    box-shadow: 0 var(--btn-depth-sm) 0 #b91c1c;
}

.btn-danger:active {
    box-shadow: none;
}

.btn-continue-sets {
    box-shadow: 0 var(--btn-depth-sm) 0 rgba(99, 102, 241, 0.22);
}

.btn-continue-sets:active {
    transform: translateY(var(--btn-depth-sm));
    box-shadow: none;
}

/* Small square tool buttons (swap / edit on slot cards, header tools) */

.btn-icon,
.btn-back {
    transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out);
}

.btn-icon:active,
.btn-back:active {
    transform: scale(0.92);
}

/* ---------- Series cards: one visual system ---------- */

.series-card,
.superset-series-card-new,
.unilateral-series-card {
    border: 2px solid transparent;
    border-radius: 20px;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

#series-list.is-entering > * {
    animation: cardEnter 0.36s var(--ease-out) both;
}

#series-list.is-entering > *:nth-child(2) { animation-delay: 0.04s; }

#series-list.is-entering > *:nth-child(3) { animation-delay: 0.08s; }

#series-list.is-entering > *:nth-child(n+4) { animation-delay: 0.12s; }

.series-card.next-up,
.superset-series-card-new.next-up,
.unilateral-series-card.next-up {
    border-color: rgba(99, 102, 241, 0.32);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.07), 0 14px 30px rgba(99, 102, 241, 0.12);
}

.series-card.completed,
.superset-series-card-new.completed,
.unilateral-series-card.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.13), rgba(34, 197, 94, 0.04));
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.12);
    padding-top: 14px;
    padding-bottom: 14px;
}

.series-card.just-completed,
.superset-series-card-new.just-completed,
.unilateral-series-card.just-completed {
    animation: seriesDone 0.55s var(--ease-spring) both;
}

.series-card.just-completed .series-check,
.unilateral-series-card.just-completed .unilateral-series-check,
.superset-series-card-new.just-completed .superset-series-check {
    animation: checkPop 0.5s var(--ease-spring) both;
}

.series-card.completed .series-header,
.unilateral-series-card.completed .unilateral-series-header,
.superset-series-card-new.completed .superset-series-header {
    margin-bottom: 0;
}

.series-number,
.superset-series-number,
.unilateral-series-number {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.01em;
}

.series-card.completed .series-number,
.superset-series-card-new.completed .superset-series-number,
.unilateral-series-card.completed .unilateral-series-number {
    color: #15803d;
}

.series-check,
.superset-series-check,
.unilateral-series-check {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--grad-success);
    color: #fff;
    box-shadow: 0 3px 0 var(--success-3d);
    border: none;
}

.unilateral-series-check {
    width: auto;
    min-width: 30px;
    gap: 2px;
    padding: 0 4px 0 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
}

.unilateral-series-check > svg {
    width: 30px;
    height: 30px;
    padding: 6px;
    border-radius: 999px;
    background: var(--grad-success);
    color: #fff;
    box-shadow: 0 3px 0 var(--success-3d);
}

.series-card.editing,
.superset-series-card-new.editing,
.unilateral-series-card.editing {
    border-color: rgba(99, 102, 241, 0.45);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.07), rgba(255, 255, 255, 0.98));
}

/* Inputs: same look everywhere */

.input-group input,
.unilateral-input,
.superset-input-group input {
    border-radius: 14px;
    border: 2px solid #e4e4f7;
    background: #fbfbff;
    font-weight: 800;
    font-size: 20px;
    min-height: 52px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input-group input:focus,
.unilateral-input:focus,
.superset-input-group input:focus,
.block-left .unilateral-input:focus,
.block-right .unilateral-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.suggested-label {
    background: var(--tint-primary-strong);
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 2px 7px;
    font-weight: 800;
}

/* ---------- Unilateral: compact, same DA as a normal set ---------- */

.unilateral-series-card {
    padding: 16px;
}

.unilateral-series-header {
    margin-bottom: 12px;
}

.unilateral-series-target {
    background: var(--tint-primary);
    color: var(--primary-dark);
    font-weight: 700;
}

.uni-side {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 10px;
    padding: 10px 0;
}

.uni-side + .uni-side {
    border-top: 1.5px dashed #e4e4f7;
}

.uni-side-badge {
    align-self: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    margin-top: 18px;
}

.uni-side.side-left .uni-side-badge {
    background: var(--grad-side-left);
    box-shadow: 0 3px 0 var(--primary-3d);
}

.uni-side.side-right .uni-side-badge {
    background: var(--grad-side-right);
    box-shadow: 0 3px 0 var(--purple-dark);
}

.uni-side .unilateral-input-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 18px;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
}

.uni-side .suggested-label {
    text-transform: none;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uni-side.is-done {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
}

.uni-side.is-done .uni-side-badge {
    margin-top: 0;
}

.uni-side-result {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.uni-side-result small {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 12px;
    margin-left: 4px;
}

.uni-side-done {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--grad-success);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 2px 0 var(--success-3d);
    animation: checkPop 0.45s var(--ease-spring) both;
}

.uni-side.is-next::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 14px;
    bottom: 14px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--primary);
}

.unilateral-series-card .btn-unilateral-validate,
.unilateral-series-card .btn-save-edit-unilateral {
    margin-top: 12px;
}

.unilateral-series-card.partial {
    border-color: rgba(168, 85, 247, 0.35);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.07), #fff);
}

.unilateral-series-card.partial .unilateral-series-number {
    color: var(--purple-dark);
}

.uni-completed-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.uni-completed-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgba(34, 197, 94, 0.2);
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

.uni-completed-chip .uni-chip-badge {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.uni-completed-chip.side-left .uni-chip-badge { background: var(--grad-side-left); }

.uni-completed-chip.side-right .uni-chip-badge { background: var(--grad-side-right); }

.uni-balance-pill {
    margin-left: auto;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--tint-success);
    color: #15803d;
}

.uni-balance-pill.is-gap {
    background: var(--tint-purple);
    color: var(--purple-dark);
}

/* Unilateral coach card: same family as the main coach card */

.coaching-advice-unilateral {
    background: linear-gradient(145deg, #f3f2ff, #faf5ff);
    border: 1.5px solid rgba(99, 102, 241, 0.14);
}

.coaching-advice-unilateral .coaching-advice-icon {
    background: var(--grad-primary);
    color: #fff;
}

.uni-coach-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.uni-coach-side {
    padding: 12px;
    border-radius: 16px;
    background: #fff;
    border: 1.5px solid #ececfb;
    min-width: 0;
}

.uni-coach-side-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.uni-coach-side-head .uni-chip-badge {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.uni-coach-side.side-left .uni-chip-badge { background: var(--grad-side-left); }

.uni-coach-side.side-right .uni-chip-badge { background: var(--grad-side-right); }

.uni-coach-value {
    font-size: 20px;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.uni-coach-reps {
    margin-top: 2px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
}

.uni-coach-note {
    margin-top: 6px;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--text-muted);
}

.uni-coach-trend {
    font-size: 13px;
    margin-left: 4px;
}

.uni-coach-trend.up { color: #16a34a; }

.uni-coach-trend.down { color: var(--purple-dark); }

/* Superset B side = violet (no more orange) */

.superset-input-block.block-b,
.superset-completed-exercise.exercise-b {
    border-color: rgba(168, 85, 247, 0.25);
}

/* ---------- XP float ---------- */

.xp-float {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    font-family: 'Nunito', 'Inter', sans-serif;
    font-weight: 900;
    font-size: 20px;
    color: #fff;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--grad-primary);
    box-shadow: 0 3px 0 var(--primary-3d), 0 10px 24px rgba(99, 102, 241, 0.35);
    transform: translate(-50%, 0);
    animation: xpFloat 1.1s var(--ease-out) forwards;
}

.xp-float.is-pr {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    box-shadow: 0 3px 0 #c2410c, 0 10px 24px rgba(249, 115, 22, 0.35);
}

/* ---------- PR badge in series ---------- */

.series-pr-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fde68a, #fbbf24);
    color: #92400e;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 0 #d97706;
    animation: checkPop 0.5s var(--ease-spring) both;
}

/* ---------- Screens ---------- */

.screen.active {
    animation: screenEnter 0.32s var(--ease-out) both;
}

.sheet-content {
    animation: sheetUp 0.38s var(--ease-spring) both;
    box-shadow: 0 -12px 40px rgba(49, 46, 129, 0.16);
}

.sheet-backdrop {
    background: rgba(30, 27, 75, 0.42);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.sheet-handle {
    width: 44px;
    height: 5px;
    background: #dcdcf5;
}

.slot-card {
    animation: cardEnter 0.36s var(--ease-out) both;
}

.slot-card:nth-child(2) { animation-delay: 0.04s; }

.slot-card:nth-child(3) { animation-delay: 0.08s; }

.slot-card:nth-child(4) { animation-delay: 0.12s; }

.slot-card:nth-child(5) { animation-delay: 0.16s; }

.slot-card:nth-child(n+6) { animation-delay: 0.2s; }

/* ---------- Keyframes ---------- */

@keyframes cardEnter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes screenEnter {
    from { opacity: 0.4; transform: translateX(14px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes sheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes seriesDone {
    0% { transform: scale(0.98); }
    45% { transform: scale(1.025); }
    100% { transform: scale(1); }
}

@keyframes xpFloat {
    0% { opacity: 0; transform: translate(-50%, 8px) scale(0.7); }
    18% { opacity: 1; transform: translate(-50%, -6px) scale(1.08); }
    70% { opacity: 1; transform: translate(-50%, -34px) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -54px) scale(0.95); }
}

@media (prefers-reduced-motion: reduce) {
    *,
        *::before,
        *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.uni-lead-pill {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--tint-primary-strong);
    color: var(--primary-dark);
    font-size: 10px;
    letter-spacing: 0.02em;
}

.unilateral-quality-row {
    margin-top: 8px;
    gap: 8px;
}

.unilateral-quality-row .unilateral-completed-side {
    padding: 0;
    background: transparent;
    border: none !important;
    flex: 0 0 auto;
}

.unilateral-quality-row .unilateral-completed-side:empty {
    display: none;
}

/* ---------- Segmented control (gamified) ---------- */

.segmented-control {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 6px;
    padding: 5px;
    border-radius: 16px;
    background: #f1f1fb;
}

.segmented-btn {
    min-height: 42px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.segmented-btn.active {
    background: #fff;
    color: var(--primary-dark);
    box-shadow: 0 2px 0 #dcdcf5, 0 6px 14px rgba(99, 102, 241, 0.12);
}

.segmented-btn:active {
    transform: translateY(2px);
}

.type-btn {
    border-color: #e4e4f7;
    box-shadow: 0 3px 0 #e4e4f7;
    border-radius: 16px;
}

.type-btn.active {
    box-shadow: 0 3px 0 var(--primary);
}

.type-btn:active {
    transform: translateY(3px);
    box-shadow: none;
}

/* ---------- Exercise summary: same palette ---------- */

.comparison-card {
    border-radius: 18px;
    border: 1.5px solid transparent;
    animation: cardEnter 0.4s var(--ease-out) both 0.1s;
}

.comparison-card.positive {
    background: var(--tint-success);
    border-color: rgba(34, 197, 94, 0.2);
}

.comparison-card.neutral {
    background: var(--tint-primary);
    border-color: rgba(99, 102, 241, 0.16);
}

.comparison-card.negative {
    background: var(--tint-purple);
    border-color: rgba(168, 85, 247, 0.2);
}

.comparison-card.positive .comparison-text { color: #15803d; }

.comparison-card.neutral .comparison-text { color: var(--primary-dark); }

.comparison-card.negative .comparison-text { color: var(--purple-dark); }

.exercise-summary.active .summary-icon,
#exercise-summary.active #summary-icon {
    animation: summaryIconBounce 0.7s var(--ease-spring) both;
}

/* ---------- Session overview ---------- */

.slot-progress-pips {
    display: flex;
    gap: 5px;
    margin: 2px 0 12px;
}

.slot-progress-pips span {
    flex: 1;
    height: 7px;
    border-radius: 999px;
    background: #ececfb;
}

.slot-progress-pips span.is-done {
    background: var(--grad-success);
    animation: checkPop 0.4s var(--ease-spring) both;
}

.slot-card.completed .slot-name,
.slot-card .slot-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

/* Home header */

.header-home .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

@keyframes hero-drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(30px, 20px) scale(1.15); }
}

@keyframes hero-seg-fill {
    from { transform: scaleX(0.2); opacity: 0; }
    to { transform: none; opacity: 1; }
}

/* =====================================================================
   Coach & exercise stats — same language as the home hero:
   dark mauve card, glass tiles, 3D edges, green = win, gold = record.
   Scoped to #screen-exercise so it beats the per-advice-type rules.
   ===================================================================== */

#screen-exercise .coaching-advice {
    --coach-accent: #8b5cf6;
    --coach-accent-2: #c4b5fd;
    --coach-glow: rgba(139, 92, 246, 0.5);
    --coach-ink: rgba(221, 214, 254, 0.72);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin-top: 16px;
    padding: 18px 16px 14px;
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(120% 70% at 0% 0%, #3b2a8f 0%, transparent 55%),
        linear-gradient(160deg, #1e1b4b 0%, #2a1660 55%, #160f3a 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 5px 0 #120c33,
        0 18px 36px rgba(67, 56, 202, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: coachCardIn 0.5s var(--ease-out) both;
}

#screen-exercise .coaching-advice.coach-tone-boost {
    --coach-accent: #22c55e;
    --coach-accent-2: #86efac;
    --coach-glow: rgba(34, 197, 94, 0.45);
}

#screen-exercise .coaching-advice.coach-tone-recover {
    --coach-accent: #6366f1;
    --coach-accent-2: #a5b4fc;
    --coach-glow: rgba(99, 102, 241, 0.5);
}

#screen-exercise .coaching-advice.coach-tone-careful {
    --coach-accent: #d946ef;
    --coach-accent-2: #f0abfc;
    --coach-glow: rgba(217, 70, 239, 0.42);
}

.coach-card-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.coach-card-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(36px);
}

.coach-card-blob.blob-a {
    width: 200px;
    height: 200px;
    top: -70px;
    right: -50px;
    background: var(--coach-accent);
    opacity: 0.42;
    animation: hero-drift 10s ease-in-out infinite alternate;
}

.coach-card-blob.blob-b {
    width: 160px;
    height: 160px;
    left: -60px;
    bottom: -40px;
    background: #a855f7;
    opacity: 0.25;
    animation: hero-drift 12s ease-in-out infinite alternate-reverse;
}

.coach-card-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 60%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 60%);
}

#screen-exercise .coaching-advice .coaching-advice-header {
    flex-direction: row;
    align-items: center;
    margin-bottom: 14px;
}

#screen-exercise .coaching-advice .coaching-advice-title {
    font-size: 19px;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #fff;
    text-shadow: none;
}

#screen-exercise .coaching-advice .coaching-advice-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(145deg, var(--coach-accent-2) -40%, var(--coach-accent) 45%, color-mix(in srgb, var(--coach-accent) 55%, #000) 100%);
    box-shadow:
        0 4px 0 color-mix(in srgb, var(--coach-accent) 40%, #000),
        0 0 22px var(--coach-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#screen-exercise .coaching-advice .coaching-advice-icon::after {
    background: radial-gradient(circle, var(--coach-accent) 0%, transparent 68%);
    opacity: 0.35;
}

#screen-exercise .coaching-advice .coaching-advice-icon svg {
    width: 26px;
    height: 26px;
}

#screen-exercise .coaching-advice .coaching-advice-chip {
    align-self: flex-start;
    max-width: 44%;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--coach-accent-2);
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

/* Target tiles */

#screen-exercise .coaching-advice .coaching-suggestion-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
    gap: 10px;
    margin-bottom: 12px;
}

#screen-exercise .coaching-advice .coaching-suggestion {
    padding: 12px 12px 13px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 3px 0 rgba(10, 6, 30, 0.55);
    min-width: 0;
    animation: cardEnter 0.4s var(--ease-out) both 0.08s;
}

#screen-exercise .coaching-advice .coaching-suggestion-weight {
    background:
        radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--coach-accent) 35%, transparent) 0%, transparent 60%),
        rgba(255, 255, 255, 0.09);
    border-color: color-mix(in srgb, var(--coach-accent-2) 35%, transparent);
}

#screen-exercise .coaching-advice .coaching-suggestion-reps {
    animation-delay: 0.14s;
}

#screen-exercise .coaching-advice .coaching-suggestion-label {
    margin-bottom: 6px;
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--coach-ink);
}

#screen-exercise .coaching-advice .coaching-suggestion-value {
    flex-wrap: wrap;
    gap: 6px;
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1;
}

#screen-exercise .coaching-advice .coaching-suggestion-volume .coaching-suggestion-value,
#screen-exercise .coaching-advice .coaching-suggestion-backoff .coaching-suggestion-value {
    font-size: 18px;
}

#screen-exercise .coaching-advice .coaching-suggestion-subnote {
    color: var(--coach-ink);
}

#screen-exercise .coaching-advice .coaching-weight-trend {
    width: auto;
    min-width: 26px;
    height: 24px;
    padding: 0 7px;
    gap: 3px;
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    background: rgba(255, 255, 255, 0.12);
    color: var(--coach-ink);
}

#screen-exercise .coaching-advice .coaching-weight-trend svg {
    width: 12px;
    height: 12px;
    color: currentColor;
}

#screen-exercise .coaching-advice .coaching-weight-trend.trend-up {
    background: var(--grad-success);
    color: #fff;
    box-shadow: 0 2px 0 var(--success-3d), 0 0 12px rgba(34, 197, 94, 0.45);
}

#screen-exercise .coaching-advice .coaching-weight-trend.trend-down {
    background: rgba(217, 70, 239, 0.22);
    color: #f5d0fe;
}

/* Reps as one token per set */

.coach-rep-tokens {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(21px, 1fr));
    gap: 4px;
    width: 100%;
}

.coach-rep-token {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    height: 36px;
    padding: 10px 2px 0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    color: #fff;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.07));
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 3px 0 rgba(10, 6, 30, 0.6);
    animation: checkPop 0.45s var(--ease-spring) both;
    animation-delay: calc(0.2s + var(--i, 0) * 0.06s);
}

.coach-rep-token small {
    position: absolute;
    top: 3px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 7.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--coach-ink, rgba(221, 214, 254, 0.72));
}

/* Rule of the day = quest */

#screen-exercise .coaching-advice .coaching-advice-summary {
    gap: 8px;
    margin-bottom: 12px;
}

.coach-quest {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(255, 255, 255, 0.18);
}

.coach-quest-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    color: #1e1b4b;
    background: linear-gradient(135deg, #fde68a, #fbbf24);
    box-shadow: 0 3px 0 #b45309, 0 0 14px rgba(251, 191, 36, 0.35);
}

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

.coach-quest-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.coach-quest-kicker {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fcd34d;
}

.coach-quest-text {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.4;
    color: #f5f3ff;
}

.coach-reason-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.coach-reason-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.08);
    color: var(--coach-ink, #ddd6fe);
}

.coach-reason-chip::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.coach-reason-chip.is-up {
    background: rgba(34, 197, 94, 0.16);
    color: #86efac;
}

.coach-reason-chip.is-down {
    background: rgba(217, 70, 239, 0.18);
    color: #f5d0fe;
}

/* Status row: fatigue pill + energy meter */

#screen-exercise .coaching-advice .coaching-status-row {
    gap: 10px;
    margin-bottom: 4px;
}

#screen-exercise .coaching-advice .coaching-status-pill {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 0 10px;
    font-size: 11.5px;
    background: rgba(255, 255, 255, 0.1);
    color: #ddd6fe;
}

#screen-exercise .coaching-advice .coaching-status-pill.fatigue-low {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
}

#screen-exercise .coaching-advice .coaching-status-pill.fatigue-moderate {
    background: rgba(251, 191, 36, 0.16);
    color: #fcd34d;
}

#screen-exercise .coaching-advice .coaching-status-pill.fatigue-high {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.coach-energy {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.coach-energy[hidden] {
    display: none;
}

.coach-energy-segs {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
}

.coach-energy-segs span {
    height: 9px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.coach-energy-segs span.is-on {
    background: linear-gradient(180deg, #86efac, #22c55e);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    animation: hero-seg-fill 0.4s var(--ease-spring) both;
    animation-delay: calc(var(--i, 0) * 0.035s);
}

.coach-energy.is-mid .coach-energy-segs span.is-on {
    background: linear-gradient(180deg, #fde68a, #f59e0b);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.coach-energy.is-low .coach-energy-segs span.is-on {
    background: linear-gradient(180deg, #fca5a5, #ef4444);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.coach-energy-value {
    font-size: 13px;
    font-weight: 900;
    color: #fff;
    min-width: 24px;
    text-align: right;
}

#screen-exercise .coaching-advice .coaching-info-btn {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    color: #ddd6fe;
}

/* Settings drawer: stays a light panel so its controls keep their look */

#screen-exercise .coaching-advice .coaching-advice-drawer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#screen-exercise .coaching-advice .coaching-drawer-toggle {
    color: var(--coach-ink);
    font-weight: 800;
}

#screen-exercise .coaching-advice .coaching-advice-drawer-body {
    margin-top: 10px;
    padding: 12px;
    border-radius: 16px;
    background: #fff;
    color: var(--text-primary);
}

/* Superset + unilateral coach cards share the dark shell */

#screen-exercise .coaching-advice-superset,
#screen-exercise .coaching-advice-unilateral {
    margin-bottom: 20px;
}

#screen-exercise .coaching-advice-superset .coaching-advice-chip,
#screen-exercise .coaching-advice-unilateral .coaching-advice-chip {
    max-width: none;
}

#screen-exercise .coaching-advice-superset .coaching-dual-exercise {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#screen-exercise .coaching-advice-superset .coaching-suggestion {
    background: rgba(255, 255, 255, 0.08);
}

#screen-exercise .coaching-advice-superset .coaching-exercise-name {
    color: #fff;
    font-weight: 800;
}

#screen-exercise .coaching-advice-superset .coaching-dual-summary,
#screen-exercise .coaching-advice-superset .coaching-summary-primary,
#screen-exercise .coaching-advice-unilateral .coaching-advice-summary {
    color: var(--coach-ink);
}

#screen-exercise .coaching-advice-superset .coaching-advice-note {
    color: rgba(221, 214, 254, 0.55);
}

#screen-exercise .coaching-advice-superset strong {
    color: #fff;
}

#screen-exercise .coaching-advice-superset .coaching-dual-summary {
    margin: 8px 0 10px;
    font-size: 13px;
    line-height: 1.4;
}

#screen-exercise .coaching-advice-superset .coaching-suggestion-value {
    font-size: 22px;
}

#screen-exercise .coaching-advice-superset .coaching-divider {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}

#screen-exercise .coaching-advice-unilateral .uni-coach-side {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 3px 0 rgba(10, 6, 30, 0.55);
}

#screen-exercise .coaching-advice-unilateral .uni-coach-side-head {
    color: var(--coach-ink);
}

#screen-exercise .coaching-advice-unilateral .uni-coach-value {
    color: #fff;
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 24px;
}

#screen-exercise .coaching-advice-unilateral .uni-coach-reps {
    color: var(--coach-accent-2);
}

#screen-exercise .coaching-advice-unilateral .uni-coach-note {
    color: rgba(221, 214, 254, 0.6);
}

#screen-exercise .coaching-advice-unilateral .uni-coach-trend.up { color: #86efac; }

#screen-exercise .coaching-advice-unilateral .uni-coach-trend.down { color: #f0abfc; }

#screen-exercise .coaching-advice-unilateral .uni-lead-pill {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

/* ---------- Exercise stats card ---------- */

#screen-exercise .exercise-progress-card {
    position: relative;
    overflow: hidden;
    padding: 16px;
    border-radius: 24px;
    background: #fff;
    border: 2px solid #ececfb;
    box-shadow: 0 4px 0 #e4e4f7, 0 14px 28px rgba(99, 102, 241, 0.08);
    animation: cardEnter 0.4s var(--ease-out) both;
}

#screen-exercise .exercise-progress-card.is-record {
    border-color: rgba(251, 191, 36, 0.45);
    box-shadow: 0 4px 0 #fcd34d, 0 14px 28px rgba(245, 158, 11, 0.14);
}

#screen-exercise .exercise-progress-kicker {
    display: block;
    margin-bottom: 2px;
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary);
}

#screen-exercise .exercise-progress-title,
#screen-exercise .coach-decision-header h4 {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

#screen-exercise .exercise-progress-badge {
    padding: 6px 11px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#screen-exercise .exercise-progress-badge.positive {
    background: var(--grad-success);
    color: #fff;
    box-shadow: 0 3px 0 var(--success-3d);
}

#screen-exercise .exercise-progress-badge.neutral {
    background: var(--tint-primary-strong);
    color: var(--primary-dark);
    box-shadow: 0 3px 0 #dcdcf5;
}

#screen-exercise .exercise-progress-badge.negative {
    background: var(--tint-purple);
    color: var(--purple-dark);
    box-shadow: 0 3px 0 rgba(168, 85, 247, 0.25);
}

.xstats-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.xstats-tiles:empty {
    display: none;
}

.xstats-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 10px 10px 11px;
    border-radius: 16px;
    background: #f7f7ff;
    border: 1.5px solid #ececfb;
    box-shadow: 0 3px 0 #ececfb;
    animation: cardEnter 0.4s var(--ease-out) both;
    animation-delay: calc(0.05s + var(--i, 0) * 0.06s);
}

.xstats-tile-icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin-bottom: 3px;
    border-radius: 9px;
    color: #fff;
    background: var(--grad-primary);
    box-shadow: 0 2px 0 var(--primary-3d);
}

.xstats-tile-icon svg {
    width: 15px;
    height: 15px;
}

.xstats-tile.is-record .xstats-tile-icon {
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    color: #78350f;
    box-shadow: 0 2px 0 #b45309;
}

.xstats-tile.is-streak .xstats-tile-icon {
    background: linear-gradient(135deg, #c084fc, #a855f7);
    box-shadow: 0 2px 0 var(--purple-dark);
}

.xstats-tile-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xstats-tile-value {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    white-space: nowrap;
}

.xstats-tile-value small {
    margin-left: 2px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    color: var(--text-muted);
}

.xstats-tile-delta {
    position: absolute;
    top: 9px;
    right: 8px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
}

.xstats-tile-delta.is-up {
    background: var(--tint-success);
    color: #15803d;
}

.xstats-tile-delta.is-down {
    background: var(--tint-purple);
    color: var(--purple-dark);
}

.xstats-tile.is-highlight {
    background: linear-gradient(160deg, #fffbeb, #fef3c7);
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 0 3px 0 #fcd34d;
}

.xstats-tile.is-streak.is-highlight {
    background: linear-gradient(160deg, #faf5ff, #f3e8ff);
    border-color: rgba(168, 85, 247, 0.35);
    box-shadow: 0 3px 0 rgba(168, 85, 247, 0.3);
}

.xstats-tile.is-highlight .xstats-tile-icon {
    animation: coachIconFloat 2.6s ease-in-out infinite;
}

#screen-exercise .exercise-progress-body {
    gap: 6px;
    padding: 12px 10px 10px;
    border-radius: 18px;
    background: linear-gradient(180deg, #f7f7ff 0%, #fff 100%);
    border: 1.5px solid #ececfb;
}

.xstats-chart-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 0 2px;
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.xstats-chart-head strong {
    font-size: 12px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--primary-dark);
}

.xstats-chart-head strong.is-up { color: #16a34a; }

.xstats-chart-head strong.is-down { color: var(--purple-dark); }

#screen-exercise .exercise-progress-card #exercise-progress-sparkline {
    height: 104px;
}

.xstats-axis {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    padding: 0 2px;
}

.xstats-axis span {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.xstats-axis span.is-last {
    color: var(--primary-dark);
    font-weight: 900;
}

#screen-exercise .exercise-progress-meta {
    padding: 0 2px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.xstats-quest {
    margin-top: 12px;
    padding: 12px;
    border-radius: 18px;
    color: #fff;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(251, 191, 36, 0.25) 0%, transparent 55%),
        linear-gradient(160deg, #1e1b4b 0%, #2a1660 100%);
    box-shadow: 0 4px 0 #120c33, 0 12px 24px rgba(67, 56, 202, 0.2);
}

.xstats-quest[hidden] {
    display: none;
}

.xstats-quest-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.xstats-quest-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    color: #78350f;
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    box-shadow: 0 3px 0 #b45309, 0 0 16px rgba(251, 191, 36, 0.45);
}

.xstats-quest-icon svg {
    width: 18px;
    height: 18px;
}

.xstats-quest-kicker {
    display: block;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fcd34d;
}

.xstats-quest-text {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    color: #ede9fe;
}

.xstats-quest-text strong {
    font-weight: 900;
    color: #fff;
}

.xstats-quest-bar {
    margin-top: 11px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.xstats-quest-bar span {
    display: block;
    width: var(--fill, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f59e0b, #fde68a);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
    animation: xstatsBarFill 0.9s var(--ease-out) both 0.2s;
}

.xstats-quest-foot {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(221, 214, 254, 0.7);
}

.xstats-quest-foot span:last-child {
    color: #fde68a;
    font-weight: 900;
}

/* ---------- Logbook ---------- */

#screen-exercise .logbook-card {
    padding: 16px;
    border-radius: 24px;
    background: #fff;
    border: 2px solid #ececfb;
    box-shadow: 0 4px 0 #e4e4f7, 0 14px 28px rgba(99, 102, 241, 0.06);
}

#screen-exercise .logbook-title {
    font-size: 18px;
    font-weight: 900;
}

#screen-exercise .logbook-title svg {
    width: 30px;
    height: 30px;
    padding: 7px;
    border-radius: 10px;
    color: #fff;
    background: var(--grad-primary);
    box-shadow: 0 3px 0 var(--primary-3d);
}

#screen-exercise .logbook-date {
    background: var(--tint-primary);
    border: none;
    color: var(--primary-dark);
    font-weight: 800;
}

#screen-exercise .logbook-session {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

#screen-exercise .logbook-session-header .logbook-session-badge {
    margin: 0;
    padding: 3px 8px;
    font-size: 10px;
    background: var(--tint-primary-strong);
    color: var(--primary-dark);
}

#screen-exercise .logbook-session-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

#screen-exercise .logbook-session-label {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
}

#screen-exercise .logbook-session-date {
    margin-left: auto;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
}

#screen-exercise .logbook-session-latest .logbook-session-sets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

#screen-exercise .logbook-session-latest .logbook-set {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "num delta"
        "value value";
    align-items: center;
    row-gap: 6px;
    min-width: 0;
    padding: 9px 10px 10px;
    border-radius: 14px;
    background: #f7f7ff;
    border: 1.5px solid #ececfb;
    box-shadow: 0 3px 0 #ececfb;
    animation: cardEnter 0.35s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 0.05s);
}

#screen-exercise .logbook-set-number {
    grid-area: num;
    min-width: 0;
    width: auto;
    height: 20px;
    padding: 0 7px;
    border-radius: 7px;
    font-size: 10.5px;
    font-weight: 900;
    color: var(--primary-dark);
    background: var(--tint-primary-strong);
}

#screen-exercise .logbook-session-latest .logbook-set-data {
    grid-area: value;
    display: block;
    min-width: 0;
}

#screen-exercise .logbook-session-latest .logbook-value strong {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.01em;
    white-space: nowrap;
    color: var(--text-primary);
}

#screen-exercise .logbook-session-latest .logbook-set-delta {
    grid-area: delta;
    justify-self: end;
}

#screen-exercise .logbook-session-latest .logbook-session-date {
    display: none;
}

#screen-exercise .logbook-content {
    gap: 12px;
}

#screen-exercise .logbook-session + .logbook-session {
    margin-top: 0;
}

.logbook-set-delta {
    flex: 0 0 auto;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.logbook-set-delta.is-up {
    background: var(--grad-success);
    color: #fff;
    box-shadow: 0 2px 0 var(--success-3d);
}

.logbook-set-delta.is-down {
    background: var(--tint-purple);
    color: var(--purple-dark);
}

.logbook-set-delta.is-same {
    background: #ececfb;
    color: var(--text-muted);
}

#screen-exercise .logbook-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
}

#screen-exercise .logbook-summary.logbook-summary-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

#screen-exercise .logbook-summary.logbook-summary-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

#screen-exercise .logbook-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 0;
    padding: 9px 4px;
    border-radius: 14px;
    background: linear-gradient(180deg, #eef0ff, #f7f7ff);
    border: none;
    text-align: center;
}

#screen-exercise .logbook-summary-item-derived {
    background: linear-gradient(180deg, #f5efff, #faf7ff);
}

#screen-exercise .logbook-summary-value {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    white-space: nowrap;
}

#screen-exercise .logbook-summary-value small {
    margin-left: 1px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
}

#screen-exercise .logbook-summary-label {
    margin: 0;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

#screen-exercise .logbook-session-annotations {
    margin-top: 8px;
}

#screen-exercise .logbook-session-annotations span {
    background: var(--tint-primary);
    border: none;
    color: var(--primary-dark);
    font-weight: 700;
}

#screen-exercise .logbook-session-compact {
    margin-top: 4px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fafaff;
    border: 1.5px dashed #e4e4f7;
    opacity: 1;
}

#screen-exercise .logbook-session-compact .logbook-session-header {
    margin-bottom: 4px;
}

#screen-exercise .logbook-session-compact .logbook-session-label {
    color: var(--text-muted);
}

.logbook-compact-sets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 2px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.5;
    color: var(--text-secondary);
}

.logbook-compact-sets > span {
    white-space: nowrap;
}

.logbook-compact-sets i {
    margin: 0 6px;
    font-style: normal;
    color: #c7c7ea;
}

#screen-exercise .logbook-trend {
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 14px;
    border: none;
    font-weight: 800;
}

#screen-exercise .logbook-trend-positive {
    background: var(--tint-success);
    color: #15803d;
}

#screen-exercise .logbook-trend-negative {
    background: var(--tint-purple);
    color: var(--purple-dark);
}

#screen-exercise .logbook-trend-neutral {
    background: var(--tint-primary);
    color: var(--primary-dark);
}

#screen-exercise .logbook-trend-icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 5px;
    border-radius: 9px;
    background: #fff;
}

/* ---------- Coach analysis ("pourquoi ce conseil") ---------- */

#screen-exercise .coach-decision-card {
    padding: 16px;
    border-radius: 24px;
    background: #fff;
    border: 2px solid #ececfb;
    box-shadow: 0 4px 0 #e4e4f7, 0 14px 28px rgba(99, 102, 241, 0.06);
}

#screen-exercise .coach-decision-header {
    align-items: center;
    margin-bottom: 14px;
}

#screen-exercise .coach-decision-confidence.has-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: transparent;
    color: var(--text-primary);
}

.coach-confidence-ring {
    width: 44px;
    height: 44px;
    transform: rotate(-90deg);
}

.coach-confidence-ring circle {
    fill: none;
    stroke-width: 4.5;
}

.coach-confidence-ring .ring-bg {
    stroke: #ececfb;
}

.coach-confidence-ring .ring-fill {
    stroke: var(--primary);
    stroke-linecap: round;
    animation: ringFill 1s var(--ease-out) both;
}

.coach-confidence-copy {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.coach-confidence-copy strong {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 900;
    color: var(--primary-dark);
}

.coach-confidence-copy small {
    margin-top: 2px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

#screen-exercise .coach-decision-grid {
    gap: 8px;
}

#screen-exercise .coach-decision-item {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    background: #f7f7ff;
    border: 1.5px solid #ececfb;
    animation: cardEnter 0.35s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 0.05s);
}

.coach-decision-item-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 11px;
    color: #fff;
    background: var(--grad-primary);
    box-shadow: 0 3px 0 var(--primary-3d);
}

.coach-decision-item-icon svg {
    width: 17px;
    height: 17px;
}

.coach-decision-item.tone-violet .coach-decision-item-icon {
    background: linear-gradient(135deg, #c084fc, #a855f7);
    box-shadow: 0 3px 0 var(--purple-dark);
}

.coach-decision-item.tone-green .coach-decision-item-icon {
    background: var(--grad-success);
    box-shadow: 0 3px 0 var(--success-3d);
}

.coach-decision-item.tone-amber .coach-decision-item-icon {
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    color: #78350f;
    box-shadow: 0 3px 0 #b45309;
}

.coach-decision-item-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

#screen-exercise .coach-decision-item-label {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

#screen-exercise .coach-decision-item-value {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-secondary);
}

#screen-exercise .coach-decision-item-value strong {
    font-weight: 900;
    color: var(--primary-dark);
}

@keyframes coachCardIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@keyframes xstatsBarFill {
    from { width: 0; }
}

@keyframes ringFill {
    from { stroke-dashoffset: 94.25; }
}

@media (max-width: 360px) {
    #screen-exercise .coaching-advice .coaching-suggestion-value { font-size: 24px; }

    .xstats-tile-value { font-size: 17px; }

    #screen-exercise .logbook-session-latest .logbook-session-sets { grid-template-columns: 1fr; }

    #screen-exercise .logbook-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .coach-card-blob,
        .xstats-tile.is-highlight .xstats-tile-icon {
        animation: none !important;
    }
}

/* Notes card: same white 3D card as the stats */

#screen-exercise .exercise-notes {
    padding: 16px;
    border-radius: 24px;
    background: #fff;
    border: 2px solid #ececfb;
    box-shadow: 0 4px 0 #e4e4f7;
}

#screen-exercise .exercise-note-input {
    border-radius: 14px;
    border: 2px solid #e4e4f7;
    background: #fbfbff;
}

#screen-exercise .exercise-note-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

/* =====================================================================
   Session list cards, active challenge, free control — same 3D language.
   ===================================================================== */

/* ---------- Session slot cards ---------- */

#screen-session .slot-card {
    padding: 16px;
    border-radius: 22px;
    background: #fff;
    border: 2px solid #ececfb;
    box-shadow: 0 4px 0 #e4e4f7, 0 12px 24px rgba(99, 102, 241, 0.06);
}

#screen-session .slot-card::before {
    display: none;
}

#screen-session .slot-card:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #e4e4f7;
}

#screen-session .slot-header {
    gap: 10px;
    margin-bottom: 10px;
}

#screen-session .slot-title {
    flex-wrap: wrap;
    row-gap: 6px;
    column-gap: 8px;
}

#screen-session .slot-id {
    display: grid;
    place-items: center;
    min-width: 30px;
    height: 28px;
    padding: 0 7px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 900;
    background: var(--grad-primary);
    box-shadow: 0 3px 0 var(--primary-3d);
}

#screen-session .slot-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

#screen-session .slot-details {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 12px;
}

#screen-session .slot-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 0;
    padding: 7px 4px 6px;
    border-radius: 12px;
    background: #f4f4ff;
    text-align: center;
}

#screen-session .slot-detail strong {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.1;
    color: var(--text-primary);
    white-space: nowrap;
}

#screen-session .slot-detail-mode {
    justify-content: center;
}

#screen-session .slot-detail-mode strong {
    font-size: 12.5px;
    letter-spacing: -0.01em;
}

#screen-session .slot-detail small {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

#screen-session .slot-actions .btn-edit-slot,
#screen-session .slot-actions .btn-pool-trigger,
#screen-session .slot-actions .btn-launch-individual {
    width: 48px;
    border-radius: 14px;
    background: #f4f4ff;
    color: var(--primary-dark);
    border: 2px solid #ececfb;
    box-shadow: 0 3px 0 #e4e4f7;
}

#screen-session .slot-actions .btn-edit-slot:active,
#screen-session .slot-actions .btn-pool-trigger:active,
#screen-session .slot-actions .btn-launch-individual:active {
    transform: translateY(3px);
    box-shadow: none;
}

#screen-session .slot-card.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), #fff 70%);
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 0 4px 0 rgba(34, 197, 94, 0.35), 0 12px 24px rgba(34, 197, 94, 0.1);
}

#screen-session .slot-card.completed .slot-id {
    background: var(--grad-success);
    box-shadow: 0 3px 0 var(--success-3d);
    border: none;
}

#screen-session .slot-card.challenge-target {
    border-color: rgba(124, 58, 237, 0.32);
    box-shadow: 0 4px 0 rgba(124, 58, 237, 0.3), 0 14px 28px rgba(124, 58, 237, 0.12);
    animation: none;
}

#screen-session .slot-card.challenge-target.completed {
    border-color: rgba(34, 197, 94, 0.3);
}

#screen-session .challenge-badge {
    min-height: 22px;
    padding: 0 8px;
    background: linear-gradient(135deg, #fde68a, #fbbf24);
    color: #78350f;
    box-shadow: 0 2px 0 #d97706;
}

#screen-session .challenge-badge.completed {
    background: var(--grad-success);
    color: #fff;
    box-shadow: 0 2px 0 var(--success-3d);
}

#screen-session .slot-challenge-note,
.slot-challenge-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    padding: 10px 10px 10px 10px;
    border-radius: 16px;
    background: linear-gradient(135deg, #faf5ff, #f5f3ff);
    border: 1.5px dashed rgba(124, 58, 237, 0.3);
    box-shadow: none;
    color: var(--challenge-dark, #5b21b6);
    font-size: 12.5px;
    font-weight: 750;
    line-height: 1.35;
}

.slot-challenge-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    color: #78350f;
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    box-shadow: 0 3px 0 #b45309;
}

.slot-challenge-icon svg {
    width: 16px;
    height: 16px;
}

.slot-challenge-text {
    flex: 1;
    min-width: 0;
}

.slot-challenge-xp {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    color: #fff;
    background: var(--grad-primary);
    box-shadow: 0 2px 0 var(--primary-3d);
}

/* ---------- Active challenge (exercise screen) ---------- */

#screen-exercise .exercise-challenge-card {
    gap: 12px;
    margin: 0 0 14px;
    padding: 14px;
    border-radius: 20px;
    background:
        radial-gradient(120% 100% at 100% 0%, rgba(251, 191, 36, 0.16) 0%, transparent 55%),
        linear-gradient(135deg, #faf5ff, #fff);
    border: 2px solid rgba(124, 58, 237, 0.22);
    box-shadow: 0 4px 0 rgba(124, 58, 237, 0.22), 0 12px 24px rgba(124, 58, 237, 0.08);
    animation: cardEnter 0.4s var(--ease-out) both;
}

#screen-exercise .exercise-challenge-card::before {
    display: none;
}

#screen-exercise .exercise-challenge-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: #78350f;
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    box-shadow: 0 4px 0 #b45309, 0 0 18px rgba(251, 191, 36, 0.4);
}

#screen-exercise .exercise-challenge-icon svg {
    width: 22px;
    height: 22px;
}

#screen-exercise .exercise-challenge-copy {
    flex: 1;
}

.exercise-challenge-kicker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}

#screen-exercise .exercise-challenge-kicker {
    margin: 0;
    font-size: 10.5px;
    letter-spacing: 0.14em;
    color: var(--challenge, #7c3aed);
}

.exercise-challenge-xp {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    color: #fff;
    background: var(--grad-primary);
    box-shadow: 0 2px 0 var(--primary-3d);
}

.exercise-challenge-xp[hidden],
.exercise-challenge-meter[hidden],
#screen-exercise .exercise-challenge-title[hidden],
#screen-exercise .exercise-challenge-progress[hidden] {
    display: none;
}

#screen-exercise .exercise-challenge-target {
    margin-top: 0;
    font-size: 14.5px;
    font-weight: 800;
    line-height: 1.35;
    color: var(--text-primary);
}

.exercise-challenge-meter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.exercise-challenge-bar {
    flex: 1;
    height: 10px;
    border-radius: 999px;
    background: #ede9fe;
    box-shadow: inset 0 1px 2px rgba(91, 33, 182, 0.15);
    overflow: hidden;
}

.exercise-challenge-bar span {
    display: block;
    width: 0;
    min-width: 10px;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #8b5cf6, #c084fc);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    transition: width 0.6s var(--ease-spring);
}

.exercise-challenge-meter strong {
    min-width: 38px;
    text-align: right;
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 900;
    color: var(--challenge-dark, #5b21b6);
}

#screen-exercise .exercise-challenge-progress {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

#screen-exercise .exercise-challenge-card.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), #fff);
    border-color: rgba(34, 197, 94, 0.32);
    box-shadow: 0 4px 0 rgba(34, 197, 94, 0.35);
}

#screen-exercise .exercise-challenge-card.completed .exercise-challenge-icon {
    background: var(--grad-success);
    color: #fff;
    box-shadow: 0 4px 0 var(--success-3d);
}

#screen-exercise .exercise-challenge-card.completed .exercise-challenge-bar span {
    background: var(--grad-success);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

#screen-exercise .exercise-challenge-card.completed .exercise-challenge-meter strong {
    color: #15803d;
}

/* ---------- Free control: series stepper ---------- */

#screen-exercise .exercise-control-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
    border-radius: 22px;
    background: #fff;
    border: 2px solid #ececfb;
    box-shadow: 0 4px 0 #e4e4f7;
}

#screen-exercise #exercise-volume-value {
    font-size: 16px;
    font-weight: 900;
}

#screen-exercise .exercise-control-actions {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    justify-content: stretch;
}

.exercise-control-stepper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 16px;
    background: #f1f1fb;
}

#screen-exercise .btn-control-step {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    border: none;
    background: #fff;
    color: var(--primary-dark);
    font-size: 22px;
    font-weight: 800;
    box-shadow: 0 3px 0 #dcdcf5;
}

#screen-exercise .btn-control-step:active:not(:disabled) {
    transform: translateY(3px);
    box-shadow: none;
}

#screen-exercise .btn-control-step:disabled {
    opacity: 0.4;
    box-shadow: none;
}

.exercise-control-count {
    min-width: 34px;
    text-align: center;
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 900;
    color: var(--text-primary);
}

#screen-exercise .btn-skip-exercise {
    min-height: 48px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 800;
    color: var(--primary-dark);
}

/* =====================================================================
   Home progression zone — player card (dark mauve like the hero),
   quests, trophies, lifts, weekly activity and physique.
   Light cards share the 3D edge of the secondary buttons.
   ===================================================================== */

/* =====================================================================
   Home progression zone: shared card head, chips and lifts.
   Light cards share the 3D edge of the secondary buttons.
   ===================================================================== */
.stats-section.progress-zone {
    margin-top: 28px;
    padding: 0;
    background: none;
    box-shadow: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.progress-zone-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 4px;
}

.progress-zone-kicker,
.pz-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary);
}

.progress-zone-head h3 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* ---------- Muscle badge (shared) ---------- */

.muscle-badge {
    --muscle: #8b5cf6;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 3px 10px 3px 3px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--muscle) 12%, #fff);
    border: 1.5px solid color-mix(in srgb, var(--muscle) 26%, #fff);
    color: color-mix(in srgb, var(--muscle) 72%, #1e1b4b);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.muscle-badge-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, color-mix(in srgb, var(--muscle) 80%, #fff), var(--muscle));
    box-shadow: 0 2px 0 color-mix(in srgb, var(--muscle) 60%, #000);
}

.muscle-badge-icon svg {
    width: 13px;
    height: 13px;
}

/* Illustrated muscle (PNG pack): fills the whole chip on a cream disc. */

.muscle-badge-icon:has(img) {
    background: color-mix(in srgb, var(--muscle) 22%, transparent);
    border: none;
    box-shadow: none;
    overflow: hidden;
    width: 24px;
    height: 24px;
}

.muscle-badge-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(1.18);
    pointer-events: none;
}

.muscle-badge-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.muscle-badge-md {
    padding: 4px 11px 4px 4px;
    font-size: 13px;
}

.muscle-badge-md .muscle-badge-icon,
.muscle-badge-md .muscle-badge-icon:has(img) {
    width: 28px;
    height: 28px;
}

.muscle-badge-md .muscle-badge-icon svg {
    width: 15px;
    height: 15px;
}

.muscle-badge-lg {
    padding: 0;
    border: none;
    background: none;
}

.muscle-badge-lg .muscle-badge-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    box-shadow: 0 3px 0 color-mix(in srgb, var(--muscle) 60%, #000);
}

.muscle-badge-lg .muscle-badge-icon:has(img) {
    box-shadow: none;
    width: 48px;
    height: 48px;
    border-radius: 16px;
}

.muscle-badge-lg .muscle-badge-icon svg {
    width: 22px;
    height: 22px;
}

.muscle-badge-dark {
    background: color-mix(in srgb, var(--muscle) 22%, transparent);
    border-color: color-mix(in srgb, var(--muscle) 45%, transparent);
    color: #fff;
}

.player-xp-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(221, 214, 254, 0.8);
}

.player-xp-row strong {
    color: #fff;
}

.player-xp-track {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.player-xp-track span {
    display: block;
    height: 100%;
    min-width: 12px;
    border-radius: inherit;
    background: linear-gradient(90deg, #a78bfa, #f0abfc);
    box-shadow: 0 0 14px rgba(240, 171, 252, 0.6), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
    animation: pz-grow 1s var(--ease-out) both;
    transform-origin: left center;
}

/* ---------- Light cards ---------- */

.pz-card {
    padding: 16px;
    border-radius: 24px;
    background: var(--card-bg);
    border: 2px solid #ececfb;
    box-shadow: 0 4px 0 #e4e4f7, 0 12px 28px rgba(79, 70, 229, 0.06);
}

.pz-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.pz-card-head h4 {
    margin-top: 2px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.pz-chip {
    flex: none;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    color: var(--primary-dark);
    background: var(--tint-primary);
    white-space: nowrap;
}

.pz-chip.is-gold { color: #92400e; background: #fef3c7; }

.pz-chip.is-up { color: #15803d; background: var(--tint-success); }

.pz-chip.is-down { color: #b45309; background: #fef3c7; }

.pz-empty {
    padding: 14px;
    border-radius: 16px;
    background: var(--bg-secondary);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.pz-more {
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    border: none;
    border-radius: 14px;
    background: var(--tint-primary);
    color: var(--primary-dark);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.quest-track {
    height: 8px;
    border-radius: 999px;
    background: #e8e8f7;
    overflow: hidden;
}

.quest-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--grad-primary);
    transform-origin: left center;
    animation: pz-grow 0.9s var(--ease-out) both;
}

/* ---------- Lifts ---------- */

.lift-crown {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(120% 120% at 0% 0%, #3b2a8f 0%, transparent 60%),
        linear-gradient(160deg, #1e1b4b, #2a1660);
    box-shadow: 0 4px 0 #120c33;
}

.lift-crown-medal {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 24px;
    background: radial-gradient(circle at 35% 30%, #fff7d6, #fbbf24 70%, #d97706);
    box-shadow: 0 3px 0 #92400e, 0 0 18px rgba(251, 191, 36, 0.45);
}

.lift-crown-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lift-crown-main span {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(221, 214, 254, 0.7);
}

.lift-crown-main strong {
    font-size: 15px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lift-crown-main small {
    font-size: 12px;
    font-weight: 600;
    color: rgba(221, 214, 254, 0.75);
}

.lift-crown-value {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.lift-crown-value strong {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
    color: #fcd34d;
    text-shadow: 0 0 18px rgba(252, 211, 77, 0.45);
}

.lift-crown-value span {
    font-size: 11px;
    font-weight: 700;
    color: rgba(221, 214, 254, 0.7);
}

.lift-section-label {
    margin: 14px 2px 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.lift-list {
    display: flex;
    flex-direction: column;
}

.lift-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 2px;
}

.lift-row + .lift-row {
    border-top: 1px solid var(--border-light);
}

.lift-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lift-row-main strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lift-row-main small {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.lift-row .spark {
    flex: none;
}

.lift-delta {
    flex: none;
    min-width: 66px;
    padding: 5px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
    white-space: nowrap;
}

.lift-delta.is-up { color: #15803d; background: var(--tint-success); }

.lift-delta.is-down { color: #b45309; background: #fef3c7; }

/* ---------- Weekly activity ---------- */

.activity-chart {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    align-items: end;
}

.activity-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.activity-value {
    min-height: 13px;
    font-size: 10px;
    font-weight: 800;
    color: var(--text-secondary);
}

.activity-bar {
    position: relative;
    width: 100%;
    max-width: 30px;
    height: 110px;
    border-radius: 10px;
    background: var(--tint-primary);
    overflow: hidden;
}

.activity-bar span {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, #c4b5fd, #8b5cf6);
    transform-origin: bottom center;
    animation: pz-rise 0.8s var(--ease-out) both;
}

.activity-col.is-current .activity-bar span {
    background: linear-gradient(180deg, #a78bfa, #4f46e5);
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.45);
}

.activity-col.is-current .activity-value,
.activity-col.is-current .activity-label {
    color: var(--primary-dark);
}

.activity-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    max-width: 30px;
    min-height: 6px;
}

.activity-dots i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #e2e2f0;
}

.activity-dots i.on { background: var(--primary-light); }

.activity-col.is-goal .activity-dots i.on { background: var(--success); }

.activity-label {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.activity-legend {
    display: flex;
    gap: 14px;
    margin-top: 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.activity-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.legend-bar {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: linear-gradient(180deg, #c4b5fd, #8b5cf6);
}

.legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 14px;
}

.kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--bg-secondary);
}

.kpi strong {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 900;
    color: var(--text-primary);
}

.kpi span {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

/* ---------- Physique ---------- */

.physique-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.physique-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "badge value" "meter meter";
    align-items: center;
    gap: 6px 10px;
}

.physique-row .muscle-badge { grid-area: badge; }

.physique-row .physique-meter { grid-area: meter; }

.physique-row .physique-value { grid-area: value; }

.physique-row .muscle-badge {
    justify-self: start;
    max-width: 100%;
}

.physique-meter {
    position: relative;
    height: 12px;
    border-radius: 999px;
    background: #ededf7;
    overflow: hidden;
}

.physique-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    background: repeating-linear-gradient(135deg, rgba(34, 197, 94, 0.22) 0 4px, rgba(34, 197, 94, 0.1) 4px 8px);
    border-left: 2px solid rgba(34, 197, 94, 0.55);
    border-right: 2px solid rgba(34, 197, 94, 0.55);
}

.physique-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-radius: 999px;
    background: var(--muscle);
    transform-origin: left center;
    animation: pz-grow 0.9s var(--ease-out) both;
}

.physique-value {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.physique-value strong {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.05;
    color: var(--text-primary);
}

.physique-value span {
    font-size: 10.5px;
    font-weight: 800;
    color: var(--text-muted);
}

.physique-row.zone-grow .physique-value span { color: #16a34a; }

.physique-row.zone-intense .physique-value span { color: #7c3aed; }

.physique-row.zone-overload .physique-value span { color: #dc2626; }

.physique-row.zone-wake .physique-value span { color: #d97706; }

.physique-row.zone-idle .physique-value strong { color: var(--text-muted); }

.physique-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.physique-legend i {
    width: 16px;
    height: 8px;
    border-radius: 3px;
    background: repeating-linear-gradient(135deg, rgba(34, 197, 94, 0.35) 0 3px, rgba(34, 197, 94, 0.15) 3px 6px);
}

@keyframes pz-grow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes pz-rise {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
    .player-xp-track span,
    .quest-track span,
    .activity-bar span,
    .physique-fill {
        animation: none;
    }
}

/* ---------- Home tabs: Séance / Parcours ---------- */
.header-home .home-tabs {
    margin-top: 12px;
}

.home-tabs .segmented-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
}

.home-tab-dot {
    position: absolute;
    top: 8px;
    right: 14px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 2px #fff, 0 0 10px rgba(34, 197, 94, 0.7);
    animation: quest-dot 1.4s ease-in-out infinite;
}

.home-content[data-tab="session"] .progress-zone,
.home-content[data-tab="progress"] > :not(.progress-zone) {
    display: none !important;
}

.home-content[data-tab="progress"] .progress-zone {
    margin-top: 4px;
    animation: screenEnter 0.35s var(--ease-out) both;
}

@keyframes quest-dot {
    50% { transform: scale(1.25); }
}

/* =====================================================================
   Exercise screen — decluttered top: header carries muscle + targets,
   the old info grid is hidden (kept as data source), coach is tighter
   and the challenge becomes a slim gold strip right under it.
   ===================================================================== */

#screen-exercise .exercise-header-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
}

#screen-exercise .exercise-targets-chip {
    min-height: 26px;
    padding: 4px 10px;
    border: 1.5px solid #e4e4f7;
    background: #fff;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

#screen-exercise .exercise-targets-chip[hidden] {
    display: none;
}

#screen-exercise .exercise-header-tag-format {
    min-height: 26px;
    font-size: 11px;
    font-weight: 800;
}

#screen-exercise .exercise-info-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
}

#screen-exercise .exercise-info-card .info-grid {
    display: none;
}

#screen-exercise .exercise-info-card > .coaching-advice {
    order: 1;
    margin-top: 0;
}

#screen-exercise .exercise-info-card > .exercise-challenge-card {
    order: 2;
}

/* Coach: tighter */

#screen-exercise .coaching-advice {
    padding: 14px 14px 12px;
}

#screen-exercise .coaching-advice .coaching-advice-header {
    margin-bottom: 12px;
}

#screen-exercise .coaching-advice .coaching-advice-icon {
    width: 38px;
    height: 38px;
    border-radius: 13px;
}

#screen-exercise .coaching-advice .coaching-advice-icon svg {
    width: 20px;
    height: 20px;
}

#screen-exercise .coaching-advice .coaching-advice-title {
    font-size: 17px;
}

#screen-exercise .coaching-advice .coaching-suggestion-grid {
    gap: 8px;
    margin-bottom: 10px;
}

#screen-exercise .coaching-advice .coaching-suggestion {
    padding: 10px 11px 11px;
    border-radius: 16px;
}

#screen-exercise .coaching-advice .coaching-suggestion-label {
    margin-bottom: 5px;
}

#screen-exercise .coaching-advice .coaching-suggestion-value {
    font-size: 26px;
}

#screen-exercise .coaching-advice .coach-quest {
    align-items: center;
    padding: 0;
    background: none;
    border: none;
}

#screen-exercise .coaching-advice .coach-quest-icon {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    box-shadow: 0 2px 0 #b45309;
}

#screen-exercise .coaching-advice .coach-quest-icon svg {
    width: 14px;
    height: 14px;
}

#screen-exercise .coaching-advice .coach-quest-kicker {
    display: none;
}

#screen-exercise .coaching-advice .coach-quest-text {
    font-size: 13px;
    line-height: 1.35;
    color: rgba(245, 243, 255, 0.92);
}

#screen-exercise .coaching-advice .coaching-advice-drawer {
    margin-top: 8px;
    padding-top: 6px;
}

#screen-exercise .coaching-advice .coaching-drawer-toggle {
    min-height: 28px;
    font-size: 12px;
}

/* Challenge: slim gold strip */

#screen-exercise .exercise-challenge-card {
    align-items: center;
    gap: 10px;
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1.5px solid #fde68a;
    box-shadow: 0 3px 0 #fcd34d;
}

#screen-exercise .exercise-challenge-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    box-shadow: 0 3px 0 #b45309;
}

#screen-exercise .exercise-challenge-icon svg {
    width: 18px;
    height: 18px;
}

#screen-exercise .exercise-challenge-kicker {
    color: #b45309;
}

#screen-exercise .exercise-challenge-title {
    font-size: 14px;
    line-height: 1.3;
    color: #78350f;
}

#screen-exercise .exercise-challenge-target,
#screen-exercise .exercise-challenge-progress {
    font-size: 12px;
    color: #92400e;
}

#screen-exercise .exercise-challenge-xp {
    color: #78350f;
    background: linear-gradient(180deg, #fde68a, #f59e0b);
    box-shadow: 0 2px 0 #b45309;
}

/* ---------- Technique: header button, teaser, sheet ---------- */

.exercise-technique-btn {
    color: var(--primary-dark);
}

.exercise-technique-btn svg {
    width: 20px;
    height: 20px;
}

.exercise-technique-btn[hidden] {
    display: none !important;
}

.technique-sheet .technique-switch {
    margin: 0 0 12px;
}

.technique-sheet .technique-switch[hidden] {
    display: none;
}

.technique-switch .segmented-btn {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 8px;
}

.technique-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 12px;
}

.technique-media {
    position: relative;
    display: grid;
    place-items: center;
    height: 220px;
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
}

.technique-media img {
    position: absolute;
    inset: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    object-fit: contain;
}

.technique-media-fallback {
    display: none;
    width: 56px;
    height: 56px;
    color: var(--text-muted);
}

.technique-media.is-missing img { display: none; }

.technique-media.is-missing .technique-media-fallback { display: block; }

.technique-muscles {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.technique-also {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.technique-equipment {
    display: inline-block;
    margin-left: auto;
}

.technique-equipment::first-letter,
.technique-result small::first-letter {
    text-transform: uppercase;
}

.technique-cue {
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--tint-primary);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--text-secondary);
}

.technique-cue strong {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 800;
    color: var(--primary-dark);
}

.technique-steps-block h4 {
    margin: 4px 0 2px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.technique-steps {
    list-style: none;
    counter-reset: step;
    margin: 0;
    padding: 0;
}

.technique-steps li {
    counter-increment: step;
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--text-primary);
}

.technique-steps li:last-child {
    border-bottom: none;
}

.technique-steps li::before {
    content: counter(step);
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.1;
    color: var(--primary);
}

.technique-source {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.technique-source span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.technique-change {
    flex: none;
    align-self: center;
    min-height: 36px;
    padding: 0 14px;
    border: none;
    border-radius: 999px;
    background: var(--tint-primary);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    color: var(--primary-dark);
    cursor: pointer;
}

.technique-search {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.technique-search-label {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.technique-search-input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 2px solid #e4e4f7;
    border-radius: 16px;
    font: inherit;
    font-size: 16px;
    color: var(--text-primary);
    background: #fff;
}

.technique-search-input:focus {
    outline: none;
    border-color: var(--primary-light);
}

.technique-results {
    display: flex;
    flex-direction: column;
}

.technique-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    background: none;
    font: inherit;
    text-align: left;
    color: var(--text-muted);
    cursor: pointer;
}

.technique-result:last-child {
    border-bottom: none;
}

.technique-result img {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    background: #fff;
    border: 2px solid #ececfb;
}

.technique-result span {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.technique-result strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.technique-result small {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.technique-result svg {
    flex: none;
    width: 18px;
    height: 18px;
}

.technique-results-empty {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-muted);
}

.technique-search .technique-change {
    align-self: center;
}

.technique-credit {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

.technique-loading {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 40px 0;
}

.technique-loading span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-light);
    animation: technique-dot 0.9s ease-in-out infinite;
}

.technique-loading span:nth-child(2) { animation-delay: 0.15s; }

.technique-loading span:nth-child(3) { animation-delay: 0.3s; }

@keyframes technique-dot {
    50% { transform: translateY(-6px); opacity: 0.5; }
}

/* =====================================================================
   Rest overlay — same dark mauve world as the home hero and the coach.
   Order: set track → recap of the validated set → ring → next set →
   feeling → controls. Decorative ornaments are dropped (clutter).
   ===================================================================== */

#timer-overlay {
    --timer-accent: #a78bfa;
    --timer-accent-soft: #ddd6fe;
    --timer-accent-deep: #6d28d9;
    --timer-accent-rgb: 167, 139, 250;
    align-items: flex-start;
    background:
        radial-gradient(90% 50% at 50% 0%, rgba(139, 92, 246, 0.35) 0%, transparent 70%),
        radial-gradient(70% 40% at 100% 100%, rgba(168, 85, 247, 0.22) 0%, transparent 70%),
        linear-gradient(170deg, #1e1b4b 0%, #24124f 50%, #120c33 100%);
}

#timer-overlay::before,
#timer-overlay::after {
    opacity: 0.6;
}

#timer-overlay .timer-content {
    width: min(100%, 380px);
    margin: auto 0;
    gap: 14px;
    padding: 4px 2px 6px;
}

#timer-overlay .timer-ring-ornaments,
#timer-overlay .timer-ring-core-fx,
#timer-overlay .timer-ring::after {
    display: none;
}

/* The ring label names the timer stage. */

/* Recap of the validated set */

.timer-done-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 0 rgba(10, 6, 30, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: timer-done-pop 0.5s var(--ease-spring) both;
}

.timer-done-card[hidden] {
    display: none;
}

.timer-done-check {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    color: #fff;
    background: var(--grad-success);
    box-shadow: 0 3px 0 var(--success-3d), 0 0 18px rgba(34, 197, 94, 0.45);
}

.timer-done-check svg {
    width: 20px;
    height: 20px;
}

.timer-done-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.timer-done-kicker {
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #86efac;
}

.timer-done-values {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 12px;
}

.timer-done-values strong {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.1;
    color: #fff;
    white-space: nowrap;
}

.timer-done-values em {
    margin-right: 5px;
    font-style: normal;
    font-size: 12px;
    color: #c4b5fd;
}

.timer-done-versus {
    font-size: 12px;
    font-weight: 700;
    color: rgba(221, 214, 254, 0.75);
}

.timer-done-versus.is-up { color: #86efac; }

.timer-done-versus.is-down { color: #f9a8d4; }

.timer-done-xp {
    flex: none;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 900;
    color: #2e1065;
    background: linear-gradient(180deg, #ddd6fe, #a78bfa);
    box-shadow: 0 3px 0 #5b21b6;
}

.timer-done-card.is-pr {
    border-color: rgba(252, 211, 77, 0.6);
    box-shadow: 0 4px 0 rgba(146, 64, 14, 0.6), 0 0 26px rgba(251, 191, 36, 0.35);
}

.timer-done-card.is-pr .timer-done-kicker { color: #fcd34d; }

.timer-done-card.is-pr .timer-done-xp {
    color: #78350f;
    background: linear-gradient(180deg, #fde68a, #f59e0b);
    box-shadow: 0 3px 0 #b45309;
    animation: quest-dot 1.2s ease-in-out infinite;
}

/* Ring */

#timer-overlay .timer-ring {
    width: 216px;
    height: 216px;
}

#timer-overlay .timer-ring::before {
    opacity: 0.5;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.35) 0%, rgba(139, 92, 246, 0.1) 45%, transparent 72%);
}

#timer-overlay .timer-ring-bg {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 13;
}

#timer-overlay .timer-ring-progress {
    stroke: url(#timerGradient);
    stroke-width: 13;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.55));
}

#timer-overlay .timer-label {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.2em;
    color: #c4b5fd;
}

#timer-overlay .timer-countdown {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 70px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow: 0 4px 0 rgba(18, 12, 51, 0.9), 0 0 24px rgba(139, 92, 246, 0.45);
}

.timer-total {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(221, 214, 254, 0.6);
    font-variant-numeric: tabular-nums;
}

#timer-overlay.ready .timer-total {
    visibility: hidden;
}

#timer-overlay.ready .timer-ring-progress {
    stroke: #22c55e;
    filter: drop-shadow(0 0 14px rgba(34, 197, 94, 0.6));
}

#timer-overlay.ready .timer-countdown,
#timer-overlay.ready .timer-label {
    color: #86efac;
}

/* Next set */

#timer-overlay .timer-context-card {
    padding: 12px 14px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-items: stretch;
    text-align: left;
    gap: 8px;
}

#timer-overlay .timer-context-header {
    justify-content: space-between;
}

#timer-overlay .timer-context-kicker {
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #c4b5fd;
}

#timer-overlay .timer-context-progress {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    color: #ddd6fe;
    background: rgba(255, 255, 255, 0.1);
}

#timer-overlay .timer-context-title {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    text-align: left;
}

#timer-overlay .timer-context-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    justify-content: stretch;
}

#timer-overlay .timer-context-metric {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 9px 11px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#timer-overlay .timer-context-metric::before,
#timer-overlay .timer-context-metric::after {
    display: none;
}

#timer-overlay .timer-context-metric-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(221, 214, 254, 0.65);
}

#timer-overlay .timer-context-metric-value {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 900;
    color: #fff;
}

#timer-overlay .timer-context-note {
    font-size: 12px;
    color: rgba(221, 214, 254, 0.7);
    text-align: left;
}

/* Feeling */

#timer-overlay .rpe-section[hidden] {
    display: none !important;
}

#timer-overlay .rpe-section {
    max-width: none;
}

#timer-overlay .rpe-question {
    font-size: 10.5px;
    font-weight: 900;
    color: rgba(221, 214, 254, 0.7);
}

#timer-overlay .rpe-chip {
    min-height: 40px;
    padding: 0 4px;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 3px 0 rgba(10, 6, 30, 0.5);
    flex-direction: column;
    gap: 3px;
}

#timer-overlay .rpe-chip:active {
    transform: translateY(3px);
    box-shadow: none;
}

#timer-overlay .rpe-chip.active {
    background: var(--grad-primary);
    border-color: transparent;
    box-shadow: 0 3px 0 var(--primary-3d), 0 0 16px rgba(139, 92, 246, 0.45);
}

#timer-overlay .rpe-chip-label {
    font-size: 11px;
}

#timer-overlay .rpe-description {
    font-size: 11.5px;
}

/* Controls */

#timer-overlay .btn-timer {
    min-height: 52px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    box-shadow: 0 4px 0 rgba(10, 6, 30, 0.6);
}

#timer-overlay .btn-timer:active {
    transform: translateY(4px);
    box-shadow: none;
}

#timer-overlay .btn-timer-skip {
    border: none;
    background: var(--grad-primary);
    box-shadow: 0 4px 0 var(--primary-3d), 0 10px 24px rgba(99, 102, 241, 0.35);
}

#timer-overlay.ready .btn-timer-skip {
    background: var(--grad-success);
    box-shadow: 0 4px 0 var(--success-3d), 0 10px 24px rgba(34, 197, 94, 0.35);
    animation: quest-pulse 1.4s ease-in-out infinite;
}

#timer-overlay .btn-timer-stop {
    color: rgba(221, 214, 254, 0.6);
    font-weight: 700;
}

#timer-overlay .btn-timer-notification {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(221, 214, 254, 0.75);
    font-size: 12px;
    min-height: 40px;
}

@keyframes timer-done-pop {
    0% { opacity: 0; transform: translateY(-8px) scale(0.96); }
    100% { opacity: 1; transform: none; }
}

@media (max-height: 720px) {
    #timer-overlay .timer-ring {
        width: 180px;
        height: 180px;
    }

    #timer-overlay .timer-countdown {
        font-size: 58px;
    }

    #timer-overlay .timer-content {
        gap: 10px;
    }
}

/* ---------- Rest overlay: decluttered layout ---------- */

/* The ring label already names the stage. */

#timer-overlay .timer-content {
    gap: 18px;
}

/* Validated set: one quiet row instead of a heavy card */

.timer-done-card {
    gap: 10px;
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.timer-done-check {
    width: 32px;
    height: 32px;
    border-radius: 11px;
    box-shadow: 0 2px 0 var(--success-3d);
}

.timer-done-check svg {
    width: 16px;
    height: 16px;
}

.timer-done-main {
    gap: 1px;
}

.timer-done-kicker {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timer-done-values strong {
    font-size: 17px;
}

.timer-done-versus {
    font-size: 11.5px;
}

.timer-done-xp {
    padding: 5px 9px;
    border-radius: 10px;
    font-size: 12px;
    box-shadow: 0 2px 0 #5b21b6;
}

.timer-done-card.is-pr {
    background: rgba(251, 191, 36, 0.07);
    border-color: rgba(252, 211, 77, 0.35);
    box-shadow: 0 0 22px rgba(251, 191, 36, 0.18);
}

.timer-done-card.is-pr .timer-done-xp {
    box-shadow: 0 2px 0 #b45309;
    animation: none;
}

/* Next set: flat summary, no nested boxes */

#timer-overlay .timer-context-card {
    padding: 12px 16px;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.07);
}

#timer-overlay .timer-context-kicker {
    font-size: 10px;
    color: rgba(196, 181, 253, 0.8);
}

#timer-overlay .timer-context-progress {
    padding: 0;
    background: none;
    font-size: 11px;
    color: rgba(221, 214, 254, 0.6);
}

#timer-overlay .timer-context-title {
    font-size: 15px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
}

#timer-overlay .timer-context-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 28px;
    margin-top: 4px;
}

#timer-overlay .timer-context-metric {
    gap: 1px;
    padding: 0;
    background: none;
    border: none;
}

#timer-overlay .timer-context-metric-label {
    font-size: 10px;
    letter-spacing: 0.08em;
}

#timer-overlay .timer-context-metric-value {
    font-size: 24px;
    line-height: 1.1;
}

/* Feeling: text-only chips, hint hidden until something is picked */

#timer-overlay .rpe-section {
    gap: 8px;
}

#timer-overlay .rpe-chip-icon {
    display: none;
}

#timer-overlay .rpe-chip {
    min-height: 36px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

#timer-overlay .rpe-chip:active {
    transform: scale(0.96);
}

#timer-overlay .rpe-chip-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

#timer-overlay .rpe-chip.active .rpe-chip-label {
    color: #fff;
}

#timer-overlay .rpe-section[data-touched="false"] .rpe-feedback {
    display: none;
}

.series-card.completed {
    padding: 12px 12px 12px 14px;
    border-radius: 20px;
    background: linear-gradient(135deg, #f0fdf4, #fff 70%);
    border: 2px solid #bbf7d0;
    box-shadow: 0 4px 0 #bbf7d0;
}

.series-card.completed::before,
.series-card.completed::after {
    display: none;
}

.series-done-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.series-done-badge {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    color: #fff;
    background: var(--grad-success);
    box-shadow: 0 3px 0 var(--success-3d), 0 6px 14px rgba(34, 197, 94, 0.25);
}

.series-done-badge svg {
    width: 20px;
    height: 20px;
}

.series-card.just-completed .series-done-badge {
    animation: checkPop 0.5s var(--ease-spring) both;
}

.series-done-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.series-card.completed .series-done-main .series-number {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #16a34a;
}

.series-card.completed .series-done-main .series-result {
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 21px;
    font-weight: 900;
    line-height: 1.15;
    color: var(--text-primary);
}

.series-done-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.series-done-chip {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-secondary);
    background: #fff;
    border: 1px solid #e2e8f0;
}

.series-done-chip.is-up { color: #15803d; background: #dcfce7; border-color: #bbf7d0; }

.series-done-chip.is-down { color: #be185d; background: #fce7f3; border-color: #fbcfe8; }

.series-done-chip.is-same { color: var(--primary-dark); background: var(--tint-primary); border-color: transparent; }

.series-done-chip.is-pr { color: #92400e; background: #fef3c7; border-color: #fde68a; }

.series-done-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.series-done-actions .btn-edit-set {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1.5px solid #e4e4f7;
    background: #fff;
    color: var(--primary-dark);
    box-shadow: 0 2px 0 #e4e4f7;
}

.series-done-actions .set-quality-details > summary {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}

.unilateral-series-card.completed,
.superset-series-card-new.completed {
    border-radius: 20px;
    background: linear-gradient(135deg, #f0fdf4, #fff 70%);
    border: 2px solid #bbf7d0;
    box-shadow: 0 4px 0 #bbf7d0;
}

/* perf: no 300ms tap delay, skip layout of offscreen sections */

button, a, input, select, label, [role="button"] { touch-action: manipulation; }

/* ===== v5.5 — Écran de fin de séance (épuré, sombre, or) ===== */

.stimulus-score-overlay.fin-screen {
    --fin-gold: #facc15;
    --fin-gold-soft: #fde68a;
    --fin-orange: #f97316;
    --fin-text: #f5f3ff;
    --fin-muted: rgba(237, 233, 254, 0.56);
    --fin-line: rgba(255, 255, 255, 0.08);
    display: block;
    padding: 0;
    color: var(--fin-text);
    background:
        radial-gradient(90% 45% at 50% 0%, rgba(124, 58, 237, 0.38), transparent 70%),
        radial-gradient(70% 35% at 50% 100%, rgba(249, 115, 22, 0.16), transparent 70%),
        #08070f;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.fin-shell {
    max-width: 480px;
    margin: 0 auto;
    padding: max(28px, calc(var(--safe-top, 0px) + 20px)) 20px 0;
}

.fin-header { text-align: center; }

.fin-kicker {
    display: inline-block;
    padding: 6px 14px; border-radius: 8px;
    font-size: 0.74rem; font-weight: 900; font-style: italic; letter-spacing: 0.2em; text-transform: uppercase;
    color: #120c02;
    background: linear-gradient(90deg, var(--fin-gold), var(--fin-orange));
    transform: skewX(-10deg);
    box-shadow: 0 0 22px rgba(250, 204, 21, 0.35);
}

.fin-title {
    margin: 14px 0 6px;
    font-family: 'Nunito', 'Inter', sans-serif; font-weight: 900; font-size: 2rem; line-height: 1.05;
    text-transform: uppercase; letter-spacing: -0.01em; color: #fff;
    text-shadow: 0 0 28px rgba(167, 139, 250, 0.55);
}

.fin-summary { margin: 0; font-size: 0.85rem; color: var(--fin-muted); line-height: 1.45; }

.fin-hero { display: flex; flex-direction: column; align-items: center; padding: 26px 0 8px; }

.fin-ring { position: relative; width: 176px; height: 176px; }

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

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

.fin-ring-track { stroke: rgba(255, 255, 255, 0.07); }

.fin-ring-progress {
    stroke: url(#finRingGold); stroke-linecap: round;
    stroke-dashoffset: var(--fin-ring-offset);
    filter: drop-shadow(0 0 10px rgba(236, 72, 153, 0.55));
    animation: finRing 1.4s 0.2s cubic-bezier(.2, .9, .3, 1) backwards;
}

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

.fin-ring-center .score-number {
    font-family: 'Nunito', 'Inter', sans-serif; font-weight: 900; font-size: 3.4rem; line-height: 1; color: #fff;
    text-shadow: 0 0 22px rgba(250, 204, 21, 0.35);
}

.fin-ring-center small { margin-top: 4px; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.24em; text-transform: uppercase; color: var(--fin-muted); }

.fin-rank {
    position: absolute; right: -6px; top: 4px;
    width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%;
    font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.5rem; color: #120c02;
    background: linear-gradient(135deg, var(--fin-gold-soft), var(--fin-gold) 50%, var(--fin-orange));
    box-shadow: 0 0 0 4px #08070f, 0 0 24px rgba(250, 204, 21, 0.75);
    animation: finStamp 0.55s 1.2s cubic-bezier(.2, 1.8, .4, 1) backwards;
}

.fin-rank.rank-b, .fin-rank.rank-c {
    background: linear-gradient(135deg, #e2e8f0, #94a3b8); box-shadow: 0 0 0 4px #08070f;
}

.fin-quality {
    margin-top: 16px; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.15rem;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--fin-gold);
}

/* XP */

.fin-xp { margin: 22px 0 6px; }

.fin-xp-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }

.fin-xp-level { font-weight: 800; font-size: 0.85rem; color: var(--fin-text); }

.fin-xp-gain {
    font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.1rem; color: var(--fin-gold);
    text-shadow: 0 0 14px rgba(250, 204, 21, 0.6);
}

.fin-xp-track { position: relative; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }

.fin-xp-base, .fin-xp-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: inherit; }

.fin-xp-base { background: rgba(250, 204, 21, 0.35); }

.fin-xp-fill {
    width: var(--fin-xp-to);
    background: linear-gradient(90deg, var(--fin-gold), var(--fin-orange));
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.8);
    animation: finXpFill 1.3s 0.8s cubic-bezier(.2, .9, .3, 1) backwards;
}

.fin-xp-note { margin-top: 6px; font-size: 0.72rem; color: var(--fin-muted); }

.fin-xp.is-level-up .fin-xp-note { color: var(--fin-gold); font-weight: 900; letter-spacing: 0.14em; }

/* Stats */

.fin-stats {
    display: grid; grid-template-columns: repeat(4, 1fr);
    margin: 18px 0 0; padding: 18px 0;
    border-top: 1px solid var(--fin-line); border-bottom: 1px solid var(--fin-line);
}

.fin-stat { --fin-stat-color: #a78bfa; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }

.fin-stat + .fin-stat::before { content: ''; position: absolute; left: 0; top: 10%; bottom: 10%; width: 1px; background: var(--fin-line); }

.fin-stat.duration { --fin-stat-color: #22d3ee; }

.fin-stat.volume, .fin-stat.cardio { --fin-stat-color: var(--fin-orange); }

.fin-stat.record { --fin-stat-color: var(--fin-gold); }

.fin-stat.intensity { --fin-stat-color: #ec4899; }

.fin-stat-icon { color: var(--fin-stat-color); display: grid; place-items: center; filter: drop-shadow(0 0 6px var(--fin-stat-color)); }

.fin-stat-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.fin-stat-value { font-family: 'Nunito', 'Inter', sans-serif; font-weight: 900; font-size: 1.25rem; line-height: 1; color: #fff; white-space: nowrap; }

.fin-stat-value small { font-size: 0.6rem; font-weight: 800; margin-left: 2px; color: var(--fin-muted); }

.fin-stat.record .fin-stat-value { color: var(--fin-gold); }

.fin-stat-label { font-size: 0.56rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fin-muted); }

/* Sections */

.fin-charts { display: block; }

.fin-section { padding: 22px 0; border-bottom: 1px solid var(--fin-line); }

.fin-heading {
    display: flex; align-items: center; gap: 8px; margin: 0 0 14px;
    font-size: 0.66rem; font-weight: 900; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(253, 230, 138, 0.8);
}

.fin-heading span { color: #120c02; background: var(--fin-gold); border-radius: 999px; padding: 1px 7px; letter-spacing: 0; }

.fin-heading-spaced { margin-top: 20px; }

.fin-chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }

.fin-chart-kicker { font-size: 0.66rem; font-weight: 900; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(253, 230, 138, 0.8); white-space: nowrap; }

.fin-section > .fin-chart-kicker { margin-bottom: 4px; }

.fin-chart-big { margin-top: 6px; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.7rem; line-height: 1; color: #fff; }

.fin-chart-big small { font-size: 0.8rem; color: var(--fin-muted); }

.fin-delta { font-size: 0.7rem; font-weight: 900; white-space: nowrap; }

.fin-delta.up { color: #4ade80; }

.fin-delta.down { color: #fb7185; }

.fin-trend-svg { width: 100%; height: auto; display: block; overflow: visible; }

.fin-trend-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(236, 72, 153, 0.5)); }

.fin-trend-dot { fill: #08070f; stroke: #a78bfa; stroke-width: 2; }

.fin-trend-last { fill: var(--fin-gold); stroke: #08070f; stroke-width: 2; }

.fin-trend-pulse { fill: rgba(250, 204, 21, 0.3); transform-box: fill-box; transform-origin: center; animation: finPulse 1.8s ease-out infinite; }

.fin-legend-ghost { font-size: 0.64rem; font-weight: 700; color: var(--fin-muted); white-space: nowrap; }

.fin-bars { display: grid; gap: 14px; }

.fin-bar-label { display: flex; justify-content: space-between; gap: 10px; font-size: 0.8rem; font-weight: 700; color: var(--fin-text); margin-bottom: 6px; }

.fin-bar-label > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fin-bar-value { font-weight: 900; white-space: nowrap; }

.fin-bar-value em { font-style: normal; font-size: 0.68rem; margin-left: 4px; }

.fin-bar-value em.up { color: #4ade80; }

.fin-bar-value em.down { color: #fb7185; }

.fin-bar-track { position: relative; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); }

.fin-bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6366f1, #a78bfa); transform-origin: left; animation: finGrowX 0.8s var(--fin-delay, 0.2s) cubic-bezier(.2, .9, .3, 1) backwards; }

.fin-bar-fill.is-up { background: linear-gradient(90deg, #a78bfa, var(--fin-gold)); box-shadow: 0 0 8px rgba(250, 204, 21, 0.45); }

.fin-bar-ghost { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: rgba(255, 255, 255, 0.7); }

.fin-rpe-legend { display: flex; align-items: center; gap: 3px; font-size: 0.6rem; font-weight: 800; color: var(--fin-muted); white-space: nowrap; }

.fin-rpe-legend i { width: 7px; height: 7px; border-radius: 50%; margin-left: 5px; }

.fin-eq { display: flex; align-items: flex-end; gap: 3px; height: 84px; }

.fin-eq-bar { flex: 1; min-width: 3px; border-radius: 3px 3px 1px 1px; transform-origin: bottom; animation: finGrowY 0.5s cubic-bezier(.2, 1.4, .4, 1) backwards; }

.fin-eq-bar.is-new-group { margin-left: 7px; }

.fin-eq-bar.low, .fin-rpe-legend .low { background: #22d3ee; }

.fin-eq-bar.mid, .fin-rpe-legend .mid { background: #8b5cf6; }

.fin-eq-bar.high, .fin-rpe-legend .high { background: #ec4899; }

.fin-eq-bar.max, .fin-rpe-legend .max { background: var(--fin-orange); }

.fin-donut-wrap { display: flex; align-items: center; gap: 20px; margin-top: 10px; }

.fin-donut { position: relative; width: 112px; height: 112px; flex-shrink: 0; }

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

.fin-donut circle { fill: none; stroke-width: 10; }

.fin-donut-track { stroke: rgba(255, 255, 255, 0.06); }

.fin-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

.fin-donut-center strong { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.3rem; color: #fff; }

.fin-donut-center span { font-size: 0.56rem; font-weight: 800; color: var(--fin-muted); text-transform: uppercase; letter-spacing: 0.06em; max-width: 72px; line-height: 1.2; }

.fin-donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; flex: 1; min-width: 0; }

.fin-donut-legend li { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; color: var(--fin-text); }

.fin-donut-legend li i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.fin-donut-legend li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fin-donut-legend li b { font-weight: 900; }

/* Listes */

.fin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }

.fin-list li { display: flex; align-items: center; gap: 12px; }

.fin-list-copy { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }

.fin-list-copy strong { font-size: 0.88rem; font-weight: 800; color: #fff; }

.fin-list-copy small { font-size: 0.76rem; color: var(--fin-muted); line-height: 1.35; }

.fin-achievement-icon {
    width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; font-size: 1.1rem;
    background: radial-gradient(circle at 30% 30%, rgba(253, 230, 138, 0.35), rgba(250, 204, 21, 0.08));
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.5), 0 0 16px rgba(250, 204, 21, 0.35);
}

.fin-trend-item { padding-left: 12px; border-left: 2px solid #4ade80; }

.fin-trend-item.warn { border-left-color: #fb7185; }

.fin-trend-item em { font-style: normal; font-size: 0.75rem; font-weight: 900; }

.fin-trend-item em.up { color: #4ade80; }

.fin-trend-item em.down { color: #fb7185; }

.fin-verdict { margin: 0; font-size: 0.95rem; font-weight: 600; line-height: 1.5; color: var(--fin-text); }

/* Action */

.fin-action {
    position: sticky; bottom: 0; margin: 0 -20px; padding: 28px 20px max(20px, calc(var(--safe-bottom, 0px) + 14px));
    background: linear-gradient(180deg, rgba(8, 7, 15, 0), #08070f 45%);
}

.fin-continue {
    width: 100%; height: 56px; border: 0; border-radius: 16px; cursor: pointer;
    font-family: 'Nunito', 'Inter', sans-serif; font-size: 1rem; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase;
    color: #120c02;
    background: linear-gradient(90deg, var(--fin-gold-soft), var(--fin-gold) 45%, var(--fin-orange));
    box-shadow: 0 4px 0 #b45309, 0 12px 30px -10px rgba(250, 204, 21, 0.7);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.fin-continue:active { transform: translateY(3px); box-shadow: 0 1px 0 #b45309, 0 6px 16px -10px rgba(250, 204, 21, 0.7); }

@keyframes finRing { from { stroke-dashoffset: var(--fin-ring-full); } }

@keyframes finStamp { from { transform: scale(2.6) rotate(-25deg); opacity: 0; } }

@keyframes finXpFill { from { width: var(--fin-xp-from); } }

@keyframes finGrowX { from { transform: scaleX(0); } }

@keyframes finGrowY { from { transform: scaleY(0); } }

@keyframes finPulse { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(2.2); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .fin-screen * { animation: none !important; }
}

/* ===== v5.5 — Reps cible épurées ===== */

.coach-rep-flat { display: inline-flex; align-items: baseline; gap: 4px; color: #fff; }

.coach-rep-flat b { font-family: 'Nunito', 'Inter', sans-serif; font-weight: 900; font-size: 1.6rem; line-height: 1; }

.coach-rep-flat i { font-style: normal; font-weight: 800; font-size: 1rem; opacity: 0.5; }

.coach-rep-flat small { margin-left: 2px; font-size: 0.7rem; font-weight: 800; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.08em; }

.coach-rep-steps { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }

.coach-rep-step { display: flex; flex-direction: column; align-items: center; gap: 3px; animation: checkPop 0.4s var(--ease-spring) both; animation-delay: calc(0.15s + var(--i, 0) * 0.05s); }

.coach-rep-step b { font-family: 'Nunito', 'Inter', sans-serif; font-weight: 900; font-size: 1.35rem; line-height: 1; color: #fff; }

.coach-rep-step small { font-size: 0.56rem; font-weight: 800; letter-spacing: 0.1em; color: var(--coach-ink, rgba(221, 214, 254, 0.6)); }

.coach-rep-step + .coach-rep-step { position: relative; }

.coach-rep-step + .coach-rep-step::before { content: ''; position: absolute; left: -7px; top: 4px; height: 14px; width: 1px; background: rgba(255, 255, 255, 0.18); }

/* ===== v5.5 — Modale défi (quête sombre / or) ===== */

#modal-session-challenge .modal-session-challenge {
    --q-gold: #facc15; --q-orange: #f97316;
    max-width: 360px; padding: 30px 24px 22px; text-align: center; color: #f5f3ff;
    border-radius: 26px; border: 1px solid rgba(250, 204, 21, 0.28);
    background:
        radial-gradient(90% 55% at 50% 0%, rgba(124, 58, 237, 0.45), transparent 70%),
        radial-gradient(80% 40% at 50% 100%, rgba(249, 115, 22, 0.14), transparent 70%),
        #0b0916;
    box-shadow: 0 30px 80px -20px rgba(124, 58, 237, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

#modal-session-challenge .modal-session-challenge::before { display: none; }

.challenge-modal-emblem {
    width: 64px; height: 64px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%;
    color: #120c02; background: linear-gradient(135deg, #fde68a, var(--q-gold) 50%, var(--q-orange));
    box-shadow: 0 0 0 6px rgba(250, 204, 21, 0.12), 0 0 32px rgba(250, 204, 21, 0.55);
    animation: finStamp 0.55s 0.1s cubic-bezier(.2, 1.8, .4, 1) backwards;
}

.challenge-modal-emblem svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

#modal-session-challenge .challenge-modal-kicker {
    display: inline-block; margin: 0 0 12px; padding: 5px 12px; border-radius: 7px;
    font-size: 0.66rem; font-weight: 900; font-style: italic; letter-spacing: 0.2em; text-transform: uppercase;
    color: #120c02; background: linear-gradient(90deg, var(--q-gold), var(--q-orange)); transform: skewX(-10deg);
    border: 0; box-shadow: none;
}

#modal-session-challenge h3 {
    margin: 0 0 16px; font-family: 'Nunito', 'Inter', sans-serif; font-weight: 900; font-size: 1.45rem; line-height: 1.15; color: #fff;
}

#modal-session-challenge .challenge-modal-title-exercise {
    background: linear-gradient(90deg, #c4b5fd, #f0abfc); -webkit-background-clip: text; background-clip: text; color: transparent;
}

#modal-session-challenge .challenge-modal-target {
    margin: 0 0 14px; padding: 14px 0; border: 0; border-radius: 0; background: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08); border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.95rem; font-weight: 800; line-height: 1.4; color: #fde68a;
}

#modal-session-challenge p { margin: 0 0 20px; font-size: 0.84rem; line-height: 1.5; color: rgba(237, 233, 254, 0.6); }

#modal-session-challenge .challenge-modal-reward {
    display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0 0 20px; padding: 0; border: 0; background: none;
}

.challenge-modal-reward-xp {
    font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 2rem; line-height: 1; color: var(--q-gold);
    text-shadow: 0 0 22px rgba(250, 204, 21, 0.6);
}

.challenge-modal-reward-label { font-size: 0.64rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(237, 233, 254, 0.5); }

.challenge-modal-accept {
    width: 100%; height: 54px; border: 0; border-radius: 16px; cursor: pointer;
    font-family: 'Nunito', 'Inter', sans-serif; font-size: 0.95rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase;
    color: #120c02; background: linear-gradient(90deg, #fde68a, var(--q-gold) 45%, var(--q-orange));
    box-shadow: 0 4px 0 #b45309, 0 12px 28px -10px rgba(250, 204, 21, 0.7);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.challenge-modal-accept:active { transform: translateY(3px); box-shadow: 0 1px 0 #b45309; }

/* Entrée du pop-up défi : fond qui se fond, carte qui monte, contenu en cascade */
#modal-session-challenge.active .modal-backdrop { animation: challengeFade 0.35s ease-out both; }

#modal-session-challenge.active .modal-session-challenge { animation: challengeRise 0.6s cubic-bezier(.16, 1.1, .3, 1) both; }

#modal-session-challenge.active .challenge-modal-emblem { animation: challengeEmblem 0.7s 0.18s cubic-bezier(.2, 1.6, .4, 1) both; }

#modal-session-challenge.active .challenge-modal-kicker,
#modal-session-challenge.active h3,
#modal-session-challenge.active .challenge-modal-target,
#modal-session-challenge.active p,
#modal-session-challenge.active .challenge-modal-reward,
#modal-session-challenge.active .challenge-modal-accept { animation: challengeItem 0.45s cubic-bezier(.2, .9, .3, 1) both; }

#modal-session-challenge.active .challenge-modal-kicker { animation-delay: 0.3s; }
#modal-session-challenge.active h3 { animation-delay: 0.36s; }
#modal-session-challenge.active .challenge-modal-target { animation-delay: 0.42s; }
#modal-session-challenge.active p { animation-delay: 0.48s; }
#modal-session-challenge.active .challenge-modal-reward { animation-delay: 0.54s; }
#modal-session-challenge.active .challenge-modal-reward-xp { animation: challengeXp 0.6s 0.6s cubic-bezier(.2, 1.7, .4, 1) both; }
#modal-session-challenge.active .challenge-modal-accept { animation-delay: 0.68s; }

@keyframes challengeFade { from { opacity: 0; } }
@keyframes challengeRise { from { opacity: 0; transform: translateY(48px) scale(0.9); } 60% { opacity: 1; } }
@keyframes challengeEmblem { from { opacity: 0; transform: scale(0.2) rotate(-30deg); } 60% { transform: scale(1.12) rotate(6deg); } }
@keyframes challengeItem { from { opacity: 0; transform: translateY(14px); } }
@keyframes challengeXp { from { opacity: 0; transform: scale(0.5); } }

@media (prefers-reduced-motion: reduce) {
    #modal-session-challenge.active .modal-backdrop,
    #modal-session-challenge.active .modal-session-challenge,
    #modal-session-challenge.active .modal-session-challenge * { animation-duration: 0.01ms !important; animation-delay: 0s !important; }
}

/* ===== v5.5 — Check-in récupération épuré ===== */

#sheet-lms .cycle-checkin-kicker,
#sheet-lms .cycle-checkin-objective,
#sheet-lms .cycle-checkin-note,
#sheet-lms .cycle-checkin-deload-copy p,
#sheet-lms .lms-labels > span small,
#sheet-lms .lms-feedback-desc { display: none !important; }

#sheet-lms .lms-header { margin-bottom: 18px; }

/* Cycle : une ligne, sans cadre */

#sheet-lms .cycle-checkin-card {
    padding: 0 0 18px; margin: 0 0 6px; border: 0; border-radius: 0; background: none; box-shadow: none;
    border-bottom: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
}

#sheet-lms .cycle-checkin-top { display: flex !important; flex-direction: row !important; align-items: center; justify-content: space-between; gap: 10px; text-align: left; }

#sheet-lms .cycle-checkin-top > div { text-align: left; }

#sheet-lms .cycle-checkin-card h4 { margin: 0; font-size: 1.05rem; font-weight: 800; }

#sheet-lms .cycle-checkin-phase { margin: 0; }

#sheet-lms .cycle-checkin-progress { margin: 10px 0 0; }

#sheet-lms .cycle-checkin-deload { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 0; border: 0; background: none; box-shadow: none; }

#sheet-lms .cycle-checkin-deload-copy { flex: 1; min-width: 0; text-align: left; }

#sheet-lms .cycle-checkin-deload-copy strong { font-size: 0.85rem; font-weight: 700; color: var(--text-secondary, #64748b); line-height: 1.3; }

#sheet-lms .cycle-deload-selector { flex-shrink: 0; }

/* Muscles : sans cadre, nom + état sur une ligne, curseur coloré */

#sheet-lms .lms-muscle-list { gap: 0; }

#sheet-lms .lms-muscle-item {
    display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name state" "slider slider";
    align-items: center; row-gap: 12px;
    padding: 18px 0; margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
    border-bottom: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
}

#sheet-lms .lms-muscle-item:last-child { border-bottom: 0; }

#sheet-lms .lms-muscle-name { grid-area: name; margin: 0; }

#sheet-lms .lms-muscle-label { font-size: 1rem; font-weight: 800; }

#sheet-lms .lms-feedback { grid-area: state; margin: 0; padding: 0; border: 0; background: none; }

#sheet-lms .lms-feedback-label {
    display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 800;
    background: rgba(99, 102, 241, 0.12); color: #4338ca;
}

#sheet-lms .lms-muscle-item[data-level="0"] .lms-feedback-label { background: rgba(34, 197, 94, 0.14); color: #15803d; }

#sheet-lms .lms-muscle-item[data-level="2"] .lms-feedback-label { background: rgba(249, 115, 22, 0.14); color: #c2410c; }

#sheet-lms .lms-muscle-item[data-level="3"] .lms-feedback-label { background: rgba(239, 68, 68, 0.14); color: #b91c1c; }

#sheet-lms .lms-slider-container { grid-area: slider; }

#sheet-lms .lms-labels { margin-top: 8px; }

#sheet-lms .lms-labels > span { opacity: 0.35; transform: none; }

#sheet-lms .lms-labels > span.active { opacity: 1; transform: scale(1.15); }

#sheet-lms #btn-confirm-lms { width: 100%; margin-top: 8px; }

/* =====================================================================
   v5.6 — Next session "quest" card, exercise header tools, FX layer
   ===================================================================== */

/* ---------- Exercise header: grouped tools capsule ---------- */

#screen-exercise .header-exercise {
    gap: 10px;
}

#screen-exercise .header-center {
    min-width: 0;
}

#btn-back-session {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 15px;
    background: #fff;
    border: 1.5px solid #e4e4f7;
    box-shadow: 0 3px 0 #e4e4f7;
    color: var(--text-primary);
}

#btn-back-session svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.6;
}

#btn-back-session:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 #e4e4f7;
}

#screen-exercise .exercise-header-actions {
    flex: none;
    display: flex;
    width: 44px;
}

#btn-exercise-more {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 15px;
    background: #fff;
    border: 1.5px solid #e4e4f7;
    box-shadow: 0 3px 0 #e4e4f7;
    color: var(--text-primary);
    cursor: pointer;
}

#btn-exercise-more svg {
    width: 20px;
    height: 20px;
}

#btn-exercise-more:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 #e4e4f7;
}

/* ---------- Exercise action sheet (header "⋯") ---------- */

.exo-actions-sheet {
    padding-bottom: calc(16px + var(--safe-bottom));
}

.exo-actions-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 4px;
}

.exo-action {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 8px;
    border: none;
    border-radius: 14px;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.exo-action[hidden] {
    display: none;
}

.exo-action:active {
    background: var(--bg-tertiary);
}

.exo-action svg {
    flex: none;
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.exo-action span {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.exo-action strong {
    font-size: 16px;
    font-weight: 700;
}

.exo-action small {
    font-size: 13px;
    color: var(--text-muted);
}

/* ---------- FX layer ---------- */

.fx-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10001;
    pointer-events: none;
}

.xp-float.is-combo {
    font-size: 17px;
    white-space: nowrap;
    background: linear-gradient(135deg, #f43f5e, #f97316 60%, #f59e0b);
    box-shadow: 0 3px 0 #be123c, 0 12px 26px rgba(244, 63, 94, 0.35);
    animation-duration: 1.6s;
}

/* Session list: "stamp" when a finished exercise card comes back into view */

.slot-card.just-finished {
    animation: slotStamp 0.7s var(--ease-spring) both;
}

.slot-card.just-finished::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
    animation: slotStampRing 0.9s var(--ease-out) 0.15s both;
}

@keyframes slotStamp {
    0% { transform: scale(0.96); }
    45% { transform: scale(1.025); }
    100% { transform: scale(1); }
}

@keyframes slotStampRing {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
    100% { box-shadow: 0 0 0 14px rgba(34, 197, 94, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .slot-card.just-finished,
        .slot-card.just-finished::after {
        animation: none;
    }
}

/* ---------- Exercise summary: victory screen ---------- */

#exercise-summary {
    background:
        radial-gradient(90% 55% at 50% 18%, rgba(139, 92, 246, 0.55), transparent 70%),
        radial-gradient(70% 45% at 50% 100%, rgba(99, 102, 241, 0.35), transparent 70%),
        linear-gradient(180deg, #1e1b4b 0%, #262063 55%, #17143d 100%);
    color: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

#exercise-summary.active {
    animation: victoryIn 0.35s var(--ease-out) both;
}

@keyframes victoryIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#exercise-summary .summary-content > * {
    animation: victoryRise 0.5s var(--ease-out) both;
}

#exercise-summary .summary-content > :nth-child(2) { animation-delay: 0.12s; }

#exercise-summary .summary-content > :nth-child(3) { animation-delay: 0.18s; }

#exercise-summary .summary-content > :nth-child(4) { animation-delay: 0.3s; }

#exercise-summary .summary-content > :nth-child(5) { animation-delay: 0.38s; }

#exercise-summary .summary-content > :nth-child(6) { animation-delay: 0.46s; }

#exercise-summary .summary-content > :nth-child(n + 7) { animation-delay: 0.54s; }

@keyframes victoryRise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.summary-medal {
    position: relative;
    display: grid;
    place-items: center;
    width: 132px;
    height: 132px;
    margin: 8px auto 22px;
}

.summary-rays {
    position: absolute;
    inset: -46px;
    border-radius: 50%;
    background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.13) 0deg 9deg, transparent 9deg 24deg);
    -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%);
    mask: radial-gradient(circle, #000 18%, transparent 68%);
    animation: victoryRays 14s linear infinite;
}

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

#exercise-summary .summary-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 112px;
    height: 112px;
    margin: 0;
    border-radius: 50%;
    font-size: 54px;
    line-height: 1;
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.85), transparent 42%),
        linear-gradient(160deg, #fde68a 0%, #fbbf24 45%, #f59e0b 100%);
    box-shadow:
        0 7px 0 #b45309,
        0 0 0 6px rgba(253, 230, 138, 0.18),
        0 22px 48px rgba(245, 158, 11, 0.45);
}

#exercise-summary.active #summary-icon {
    animation: victoryMedal 0.8s var(--ease-spring) both 0.05s;
}

@keyframes victoryMedal {
    0% { transform: scale(0) rotate(-25deg); }
    60% { transform: scale(1.12) rotate(6deg); }
    100% { transform: scale(1) rotate(0); }
}

.summary-kicker {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #c4b5fd;
}

.summary-kicker:empty {
    display: none;
}

#exercise-summary .summary-content h3 {
    margin-bottom: 14px;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #fff;
}

.summary-xp {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 auto 22px;
    padding: 7px 16px;
    border-radius: 999px;
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 900;
    color: #78350f;
    background: linear-gradient(180deg, #fde68a, #f59e0b);
    box-shadow: 0 4px 0 #b45309, 0 12px 26px rgba(245, 158, 11, 0.35);
    font-variant-numeric: tabular-nums;
}

.summary-xp[hidden] {
    display: none;
}

#exercise-summary .summary-xp {
    animation: victoryXp 0.6s var(--ease-spring) both 0.3s;
}

@keyframes victoryXp {
    from { opacity: 0; transform: scale(0.4); }
    to { opacity: 1; transform: scale(1); }
}

#exercise-summary .summary-stats {
    gap: 10px;
    margin-bottom: 14px;
}

#exercise-summary .stat {
    padding: 14px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22);
}

#exercise-summary .stat-label {
    font-weight: 800;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.6);
}

#exercise-summary .stat-value {
    font-size: 30px;
    font-weight: 900;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

#exercise-summary .summary-comparison {
    margin-bottom: 14px;
}

#exercise-summary .comparison-card {
    justify-content: flex-start;
    text-align: left;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
}

#exercise-summary .comparison-card.positive {
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(74, 222, 128, 0.35);
}

#exercise-summary .comparison-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    font-size: 21px;
    background: rgba(255, 255, 255, 0.12);
}

#exercise-summary .comparison-text,
#exercise-summary .comparison-card.positive .comparison-text,
#exercise-summary .comparison-card.neutral .comparison-text,
#exercise-summary .comparison-card.negative .comparison-text {
    font-size: 14px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
}

#exercise-summary .comparison-text span {
    color: #86efac;
}

#exercise-summary .summary-analysis-note {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

#exercise-summary .summary-pr-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(251, 191, 36, 0.12));
    border-color: rgba(251, 191, 36, 0.45);
}

#exercise-summary .summary-pr-title { color: #fcd34d; }

#exercise-summary .summary-pr-value { color: #fff; }

#exercise-summary .summary-pr-detail { color: rgba(255, 255, 255, 0.75); }

#exercise-summary .summary-badge-chip,
#exercise-summary .summary-badge-chip.neutral,
#exercise-summary .summary-badge-chip.progress,
#exercise-summary .summary-badge-chip.record {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
}

#exercise-summary .summary-badge-chip.record {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.4);
}

#exercise-summary .summary-continue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 58px;
    margin-top: 6px;
    border-radius: 18px;
    font-size: 17px;
    font-weight: 900;
    color: #312e81;
    text-shadow: none;
    background: linear-gradient(180deg, #fff, #ede9fe);
    box-shadow: 0 5px 0 #a5b4fc, 0 16px 34px rgba(0, 0, 0, 0.35);
}

#exercise-summary .summary-continue:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 #a5b4fc, 0 6px 14px rgba(0, 0, 0, 0.3);
}

#exercise-summary .summary-continue svg {
    transition: transform 0.2s var(--ease-out);
}

#exercise-summary .summary-continue:active svg {
    transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
    .summary-rays,
        #exercise-summary .summary-content > *,
        #exercise-summary.active #summary-icon,
        #exercise-summary .summary-xp {
        animation: none;
    }
}

/* Light exercise header: title + targets chip only */

#screen-exercise .exercise-slot-label {
    display: none;
}

/* ---------- Exercise summary: progression panel ---------- */

.prog-panel {
    --tone: #a5b4fc;
    --tone-2: #6366f1;
    text-align: left;
    padding: 14px 14px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.07);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22);
}

.prog-panel + .prog-panel {
    margin-top: 10px;
}

.prog-panel.is-up { --tone: #4ade80; --tone-2: #16a34a; }

.prog-panel.is-record { --tone: #fde047; --tone-2: #f59e0b; }

.prog-panel.is-down { --tone: #fb923c; --tone-2: #ea580c; }

.prog-panel.is-stable { --tone: #a5b4fc; --tone-2: #6366f1; }

.prog-panel.is-first { --tone: #c4b5fd; --tone-2: #8b5cf6; }

.prog-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.prog-panel-title {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.prog-panel-title strong {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prog-panel-title span {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.prog-verdict {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 900;
    color: #0f0a2e;
    background: var(--tone);
    box-shadow: 0 3px 0 var(--tone-2);
    font-variant-numeric: tabular-nums;
    animation: progVerdictPop 0.5s var(--ease-spring) both 0.7s;
}

.prog-verdict i {
    font-style: normal;
    font-size: 11px;
}

.prog-verdict.is-record i {
    font-size: 14px;
}

@keyframes progVerdictPop {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.prog-chart {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.prog-grad-top { stop-color: var(--tone); }

.prog-grad-bottom { stop-color: var(--tone-2); }

.prog-bar:not(.is-today) rect {
    fill: rgba(255, 255, 255, 0.16);
}

.prog-bar rect {
    transform-box: fill-box;
    transform-origin: bottom;
    animation: progBarGrow 0.6s var(--ease-out) both;
    animation-delay: calc(0.35s + var(--i) * 0.06s);
}

.prog-bar.is-today rect {
    filter: drop-shadow(0 0 8px color-mix(in srgb, var(--tone) 55%, transparent));
}

@keyframes progBarGrow {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

.prog-bar-value {
    font-size: 13px;
    font-weight: 900;
    fill: #fff;
    font-variant-numeric: tabular-nums;
    animation: victoryRise 0.4s var(--ease-out) both 0.9s;
}

.prog-bar-date {
    font-size: 9.5px;
    font-weight: 700;
    fill: rgba(255, 255, 255, 0.45);
}

.prog-bar.is-today .prog-bar-date {
    fill: #fff;
    font-weight: 900;
}

.prog-prev-line {
    stroke: rgba(255, 255, 255, 0.35);
    stroke-width: 1.2;
    stroke-dasharray: 3 4;
}

.prog-deltas {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.prog-deltas-label {
    width: 100%;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.prog-deltas.is-first {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.prog-delta {
    flex: 1 1 0;
    min-width: 0;
    display: grid;
    gap: 1px;
    padding: 7px 9px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
}

.prog-delta small {
    font-size: 10.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.55);
}

.prog-delta b {
    font-size: 15px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.prog-delta.is-up b { color: #4ade80; }

.prog-delta.is-down b { color: #fb923c; }

.prog-delta.is-flat b { color: rgba(255, 255, 255, 0.8); }

.prog-panel.is-compact .prog-delta b {
    font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
    .prog-verdict,
        .prog-bar rect,
        .prog-bar-value {
        animation: none;
    }
}

/* Technique sheet: database failed to load */

.technique-db-error {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-radius: 20px;
    border: 2px dashed #e4e4f7;
    text-align: center;
}

.technique-db-error p {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* =====================================================================
   v5.7 — Couleur par séance : calendrier, carte d'accueil, sélecteur
   ===================================================================== */

/* ---------- Calendrier accueil ---------- */

.history-calendar-section {
    margin-top: 20px;
    padding: 18px 16px 16px;
    border-radius: 24px;
    background: #fff;
    border: 1.5px solid #ececfb;
    box-shadow: 0 4px 0 #ececfb, 0 14px 30px -20px rgba(15, 23, 42, 0.35);
}

.history-calendar-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.history-calendar-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.history-calendar-kicker { color: var(--primary); }

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

.history-calendar-summary::before {
    content: '·';
    margin-right: 8px;
}

#history-calendar-title {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.02em;
    text-transform: capitalize;
    color: var(--text-primary);
}

.history-calendar-nav {
    display: flex;
    gap: 6px;
}

.calendar-nav-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1.5px solid #ececfb;
    border-radius: 12px;
    background: #f6f6fe;
    color: var(--text-secondary);
    cursor: pointer;
    transition: transform 0.15s ease, color 0.15s ease;
}

.calendar-nav-btn:active { transform: scale(0.9); }

.calendar-nav-btn:disabled { opacity: 0.35; cursor: default; transform: none; }

.history-calendar-weekdays,
.history-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.history-calendar-weekdays { margin-bottom: 6px; }

.history-calendar-weekdays span {
    text-align: center;
    font-size: 10.5px;
    font-weight: 800;
    color: var(--text-muted);
}

.calendar-day {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: 12px;
    background: #f6f6fa;
}

.calendar-day.empty { background: transparent; }

.calendar-day-number {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.calendar-day.is-future { background: transparent; }

.calendar-day.is-future .calendar-day-number { color: var(--text-muted); opacity: 0.6; }

.calendar-day.has-workout {
    background: var(--calendar-fill, var(--calendar-accent));
    box-shadow: 0 3px 0 color-mix(in srgb, var(--calendar-accent) 70%, #000 30%);
    animation: calPop 0.35s cubic-bezier(.34, 1.56, .64, 1) both;
}

.calendar-day.has-workout .calendar-day-number {
    color: #fff;
    font-weight: 900;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}

.calendar-day-count {
    position: absolute;
    top: -5px;
    right: -4px;
    padding: 1px 4px;
    border-radius: 999px;
    background: #1e1b4b;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.3;
}

.calendar-day.is-today {
    box-shadow: inset 0 0 0 2px var(--text-primary);
}

.calendar-day.is-today .calendar-day-number {
    color: var(--text-primary);
    font-weight: 900;
}

.calendar-day.is-today.has-workout {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--calendar-accent);
}

.calendar-day.is-today.has-workout .calendar-day-number { color: #fff; }

.history-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 12px;
}

.history-calendar-legend[hidden] { display: none; }

.calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-legend-item::before {
    content: '';
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--legend-accent);
}

.history-calendar-empty {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

@keyframes calPop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Sélecteur de séance ---------- */

#sheet-change-session h3 { margin-bottom: 4px; }

.session-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.session-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px 12px 12px;
    border-radius: 18px;
    border: 1.5px solid #ececfb;
    background: #fff;
    box-shadow: 0 3px 0 #ececfb;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.2s ease;
}

.session-option:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #ececfb;
}

.session-option-swatch {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--session-accent);
    box-shadow: 0 3px 0 color-mix(in srgb, var(--session-accent) 70%, #000 30%);
    color: #fff;
    font-size: 19px;
    font-weight: 900;
}

.session-option-body {
    display: grid;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.session-option-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.session-option-name {
    font-size: 16.5px;
    font-weight: 900;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-option-badge {
    flex: none;
    padding: 2px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--session-accent) 14%, #fff);
    color: color-mix(in srgb, var(--session-accent) 80%, #000);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.session-option-meta {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-option-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.session-option-check {
    flex: none;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #e4e4f0;
    color: transparent;
}

.session-option.current {
    border-color: var(--session-accent);
    background: color-mix(in srgb, var(--session-accent) 7%, #fff);
    box-shadow: 0 3px 0 color-mix(in srgb, var(--session-accent) 45%, #fff);
}

.session-option.current .session-option-check {
    border-color: var(--session-accent);
    background: var(--session-accent);
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    .calendar-day { animation: none !important; }
}

/* =====================================================================
   Session & exercise editor (Mes séances) — simple first, details later.
   ===================================================================== */

.se-head { text-align: center; margin-bottom: 16px; }

.se-head .se-title { margin-bottom: 4px; font-size: 20px; font-weight: 800; }

.se-sub, .se-hint { font-size: 13px; color: var(--text-secondary); line-height: 1.45; }

.se-hint { margin: 2px 0 12px; }

.se-hint-tight { margin: 8px 0 0; font-size: 12px; color: var(--text-muted); }

.se-label, .se-section-title, .se-block-title {
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary);
    margin: 0 0 8px;
}

.se-section-title { margin-top: 20px; }

.se-chevron { display: inline-flex; color: #c4c4e4; flex-shrink: 0; }

/* --- Sessions list --- */

#edit-session-list { gap: 0; }

.se-session-card.session-reorder-item,
.se-slot-card.edit-slot-detail-card { padding: 0; gap: 0; align-items: stretch; cursor: default; border-radius: 18px; }

.se-session-list, .se-slot-list { display: flex; flex-direction: column; gap: 10px; }

.se-session-card, .se-slot-card {
    --accent: var(--violet);
    position: relative;
    display: flex;
    align-items: stretch;
    background: var(--card-bg);
    border: 2px solid #ececfa;
    border-radius: 18px;
    box-shadow: 0 3px 0 #ececfa;
    overflow: hidden;
    animation: cardEnter 0.32s var(--ease-out) both;
    transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), border-color 0.2s ease;
}

.se-session-card:active, .se-slot-card:active { transform: translateY(2px); box-shadow: 0 1px 0 #ececfa; }

.se-session-card.is-dragging, .se-slot-card.is-dragging { border-color: var(--primary-light); box-shadow: 0 10px 24px rgba(99, 102, 241, 0.22); }

.se-grip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    flex-shrink: 0;
    color: #c7c7e2;
    cursor: grab;
    touch-action: none;
}

.se-session-main, .se-slot-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 0;
    background: none;
    border: none;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.se-session-index, .se-slot-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 11px;
    font-weight: 900;
    font-size: 14px;
    color: #fff;
    background: var(--accent);
    box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 60%, #1e1b4b);
}

.se-session-body, .se-slot-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.se-session-name, .se-slot-name {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.se-slot-name { font-size: 15px; }

.se-session-meta, .se-slot-meta { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }

.se-add-session { width: 100%; margin-top: 18px; gap: 8px; }

.se-empty {
    text-align: center;
    padding: 26px 18px;
    border: 2px dashed #e0e0f5;
    border-radius: 20px;
    background: var(--tint-primary);
    color: var(--text-secondary);
    font-size: 13.5px;
}

.se-empty strong { display: block; font-size: 16px; color: var(--text-primary); margin-bottom: 4px; }

.se-empty-emoji { font-size: 34px; margin-bottom: 6px; }

/* --- New session --- */

.se-name-field { font-size: 17px; font-weight: 700; }

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

.se-template {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 12px;
    min-height: 112px;
    text-align: left;
    font: inherit;
    color: var(--text-primary);
    background: var(--card-bg);
    border: 2px solid #ececfa;
    border-radius: 18px;
    box-shadow: 0 3px 0 #ececfa;
    cursor: pointer;
    transition: transform 0.12s var(--ease-out), border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.12s var(--ease-out);
}

.se-template:active { transform: translateY(2px); box-shadow: 0 1px 0 #ececfa; }

.se-template.is-selected {
    border-color: var(--primary);
    background: var(--tint-primary);
    box-shadow: 0 3px 0 var(--primary);
}

.se-template-emoji { font-size: 24px; line-height: 1; margin-bottom: 6px; }

.se-template-name { font-size: 15px; font-weight: 800; }

.se-template-hint { font-size: 12px; color: var(--text-secondary); line-height: 1.35; }

.se-template-meta { margin-top: auto; padding-top: 6px; font-size: 11.5px; font-weight: 800; color: var(--primary); }

.se-template-blank { border-style: dashed; }

.se-sticky-footer {
    position: sticky;
    bottom: calc(-1 * (var(--safe-bottom) + 20px));
    margin: 18px -20px calc(-1 * (var(--safe-bottom) + 20px));
    padding: 14px 20px calc(var(--safe-bottom) + 20px);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, var(--card-bg) 22%);
    z-index: 2;
}

.se-sticky-footer .btn { width: 100%; }

/* --- Session detail --- */

.se-session-hero, .se-ex-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 16px 16px 14px;
    border-radius: 22px;
    color: #fff;
    background:
        radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent, #8b5cf6) 55%, transparent) 0%, transparent 60%),
        linear-gradient(160deg, #1e1b4b 0%, #2a1660 55%, #160f3a 100%);
    box-shadow: 0 5px 0 #120c33, 0 16px 32px rgba(67, 56, 202, 0.24);
}

.se-hero-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(221, 214, 254, 0.7);
    margin-bottom: 4px;
}

.se-hero-name {
    width: 100%;
    padding: 8px 10px;
    font: inherit;
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px dashed rgba(221, 214, 254, 0.35);
    border-radius: 12px;
    outline: none;
}

.se-hero-name:focus { border-style: solid; border-color: #c4b5fd; background: rgba(255, 255, 255, 0.1); }

.se-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }

.se-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.se-stat strong { font-size: 20px; font-weight: 900; line-height: 1.1; }

.se-stat span { font-size: 11px; font-weight: 700; color: rgba(221, 214, 254, 0.72); }

.se-slot-card { --accent: var(--primary); }

.se-slot-card.in-superset { border-color: #ddd6fe; background: linear-gradient(90deg, #faf7ff, #fff); }

.se-slot-card.in-superset .se-slot-num { --accent: var(--violet); }

.se-slot-muscle { flex-shrink: 0; padding: 3px; }

.se-slot-list { gap: 0; }

.se-link, .se-link-spacer { height: 10px; }

.se-link {
    align-self: center;
    height: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
    padding: 4px 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1.5px dashed #dcdcf0;
    border-radius: 999px;
    cursor: pointer;
}

.se-link.is-linked {
    color: #6d28d9;
    background: #f3e8ff;
    border: 1.5px solid #d8b4fe;
}

.se-link small { font-size: 11px; font-weight: 700; color: #a78bfa; }

.se-link.se-link-add {
    width: 30px;
    height: 30px;
    justify-content: center;
    padding: 0;
    margin: -10px 0;
    position: relative;
    z-index: 1;
    font-size: 13px;
    background: #fff;
    opacity: 0.85;
}

.se-link.se-link-add:active { background: #f3e8ff; border-color: #d8b4fe; }

.se-add-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 14px;
    padding: 16px;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    color: var(--primary-dark);
    background: var(--tint-primary);
    border: 2px dashed #c7d2fe;
    border-radius: 18px;
    cursor: pointer;
    transition: transform 0.12s var(--ease-out), background-color 0.2s ease;
}

.se-add-slot:active { transform: scale(0.98); background: var(--tint-primary-strong); }

.se-add-slot-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    color: #fff;
    background: var(--grad-primary);
    box-shadow: 0 3px 0 var(--primary-3d);
}

.se-tip { margin-top: 12px; font-size: 12px; color: var(--text-muted); text-align: center; line-height: 1.5; }

.se-tip-grip { display: inline-flex; vertical-align: -2px; color: #a5a5d0; }

.se-danger-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 18px;
    padding: 12px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--danger);
    background: none;
    border: none;
    border-radius: 14px;
    cursor: pointer;
}

.se-danger-link:active { background: rgba(239, 68, 68, 0.08); }

/* --- Exercise editor --- */

.se-ex-hero { margin-bottom: 16px; }

.se-ex-hero-badge:empty { display: none; }

.se-ex-hero-badge { margin-bottom: 8px; }

.se-ex-hero-badge .muscle-badge { background: rgba(255, 255, 255, 0.92); }

.se-ex-hero .se-ex-hero-name { font-size: 22px; font-weight: 900; line-height: 1.2; color: #fff; }

.se-ex-hero-meta { margin-top: 4px; font-size: 13px; font-weight: 600; color: rgba(221, 214, 254, 0.8); }

.btn.se-ex-change {
    margin-top: 12px;
    min-height: 40px;
    padding: 8px 14px;
    gap: 8px;
    font-size: 13.5px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}

.btn.se-ex-change:active { box-shadow: none; }

.se-block { margin-bottom: 16px; }

.se-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.se-preset {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 10px 4px;
    font: inherit;
    color: var(--text-primary);
    background: var(--card-bg);
    border: 2px solid #ececfa;
    border-radius: 16px;
    box-shadow: 0 3px 0 #ececfa;
    cursor: pointer;
    transition: transform 0.12s var(--ease-out), border-color 0.2s ease, background-color 0.2s ease;
}

.se-preset:active { transform: translateY(2px); box-shadow: 0 1px 0 #ececfa; }

.se-preset strong { font-size: 14px; font-weight: 800; }

.se-preset small { font-size: 11.5px; font-weight: 700; color: var(--text-muted); }

.se-preset-emoji { font-size: 20px; line-height: 1.2; }

.se-preset.active { border-color: var(--primary); background: var(--tint-primary); box-shadow: 0 3px 0 var(--primary); }

.se-preset.active small { color: var(--primary); }

#edit-slot-numbers {
    padding: 4px 14px;
    background: var(--card-bg);
    border: 2px solid #ececfa;
    border-radius: 20px;
}

.se-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1.5px solid #f1f1fa;
}

.se-row:last-of-type { border-bottom: none; }

.se-row-stack { flex-direction: column; align-items: stretch; }

.se-row-label { display: flex; flex-direction: column; min-width: 0; }

.se-row-label strong { font-size: 15px; font-weight: 800; }

.se-row-label small { font-size: 12px; color: var(--text-muted); line-height: 1.35; }

.se-stepper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: 14px;
    flex-shrink: 0;
}

.se-step-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: var(--primary-dark);
    background: #fff;
    border: none;
    border-radius: 11px;
    box-shadow: 0 2px 0 #dcdcf0;
    cursor: pointer;
    transition: transform 0.1s var(--ease-out), box-shadow 0.1s var(--ease-out);
}

.se-step-btn:active { transform: translateY(2px); box-shadow: none; }

.se-step-value {
    width: 54px;
    min-width: 54px;
    padding: 0;
    font: inherit;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
    color: var(--text-primary);
    background: none;
    border: none;
    outline: none;
    -moz-appearance: textfield;
}

output.se-step-value { width: auto; min-width: 74px; font-size: 15px; white-space: nowrap; }

.se-step-value::-webkit-outer-spin-button,
.se-step-value::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.se-range { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; margin-top: 10px; }

.se-range-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.se-range-col .se-step-value { width: 40px; min-width: 40px; }

.se-range-col .se-step-btn { width: 34px; }

.se-range-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }

.se-range-sep { padding-bottom: 14px; font-size: 13px; font-weight: 700; color: var(--text-muted); }

.se-effort { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-top: 10px; }

.se-effort-btn {
    padding: 9px 2px;
    font: inherit;
    font-size: 11.5px;
    font-weight: 800;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
}

.se-effort-btn.active { color: #fff; background: var(--grad-primary); box-shadow: 0 3px 0 var(--primary-3d); }

#edit-slot-form[data-tracking="cardio"] .se-strength-only,
#edit-slot-form[data-tracking="timed"] .se-strength-only { display: none; }

#edit-slot-form[data-tracking="timed"] .se-range-col .se-step-value {
    width: 50px;
    min-width: 50px;
    font-size: 15px;
}

.info-item.is-hidden { display: none; }

.se-advanced {
    margin-top: 4px;
    border: 2px solid #ececfa;
    border-radius: 18px;
    background: var(--card-bg);
}

.se-advanced summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px;
    list-style: none;
    cursor: pointer;
}

.se-advanced summary::-webkit-details-marker { display: none; }

.se-advanced summary strong { display: block; font-size: 15px; font-weight: 800; }

.se-advanced summary small { display: block; font-size: 12px; color: var(--text-muted); }

.se-advanced[open] summary .se-chevron { transform: rotate(90deg); }

.se-advanced summary .se-chevron { transition: transform 0.2s var(--ease-out); }

.se-advanced-content { padding: 0 14px 14px; }

.se-inline-field { display: flex; gap: 8px; }

.se-inline-field .form-input { flex: 1; min-width: 0; }

/* =====================================================================
   Fiches perso d'exercice (recherche dans Parcours + bottom sheet)
   ===================================================================== */
button.lift-crown {
    width: 100%;
    border: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out);
}

button.lift-crown:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #120c33;
}

.lift-row.is-clickable {
    cursor: pointer;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
}

.lift-row.is-clickable:active {
    background: var(--tint-primary);
}

.lift-delta.is-flat {
    color: var(--text-muted);
    background: var(--bg-secondary);
    text-align: center;
}

.exo-search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    min-height: 50px;
    border-radius: 16px;
    background: var(--bg-secondary);
    border: 2px solid #ececfb;
    box-shadow: inset 0 2px 0 rgba(79, 70, 229, 0.04);
    color: var(--text-muted);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.exo-search-field:focus-within {
    border-color: #a78bfa;
    background: var(--card-bg);
    color: var(--primary-dark);
}

.exo-search-field svg {
    flex: none;
    width: 20px;
    height: 20px;
}

.exo-search-field input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.exo-search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.exo-search-results .lift-section-label {
    margin: 6px 2px 0;
}

.exo-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 18px;
    border: 2px solid #ececfb;
    background: var(--card-bg);
    box-shadow: 0 3px 0 #e4e4f7;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out);
    animation: exo-pop 0.28s var(--ease-out) both;
}

.exo-row:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 #e4e4f7;
}

.exo-row-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--tint-primary);
    font-size: 18px;
}

.exo-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.exo-row-main strong {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exo-row-main small {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.exo-row-chevron {
    flex: none;
    width: 18px;
    height: 18px;
    color: #c4b5fd;
}

.exo-tier {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 18px;
    background: #fef3c7;
    box-shadow: 0 2px 0 #fcd34d;
}

.exo-tier.tier-none {
    background: var(--bg-secondary);
    box-shadow: 0 2px 0 #e2e8f0;
    filter: grayscale(1);
    opacity: 0.7;
}

.exo-tier.tier-diamond,
.exo-tier.tier-platinum {
    background: #e0f2fe;
    box-shadow: 0 2px 0 #7dd3fc;
}

.exo-tier.tier-legend {
    background: linear-gradient(180deg, #fde68a, #f59e0b);
    box-shadow: 0 2px 0 #92400e, 0 0 14px rgba(251, 191, 36, 0.5);
}

@keyframes exo-pop {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

/* ---------- Sheet ---------- */

.exo-profile-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 24px;
}

.exo-hero {
    position: relative;
    overflow: hidden;
    padding: 18px;
    border-radius: 26px;
    color: #fff;
    background:
        radial-gradient(120% 80% at 100% 0%, #3b2a8f 0%, transparent 55%),
        linear-gradient(160deg, #1e1b4b 0%, #2a1660 55%, #160f3a 100%);
    box-shadow: 0 6px 0 #120c33, 0 20px 40px rgba(67, 56, 202, 0.24);
    animation: exo-pop 0.35s var(--ease-out) both;
}

.exo-hero-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.exo-hero-tier {
    flex: none;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 22px;
    font-size: 34px;
    background: linear-gradient(145deg, #8b5cf6, #5b21b6);
    box-shadow: 0 4px 0 #3b0f8a, 0 0 24px rgba(139, 92, 246, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    animation: exo-tier-bounce 0.6s var(--ease-spring) both 0.1s;
}

.exo-hero-tier.tier-none {
    filter: grayscale(0.6);
}

@keyframes exo-tier-bounce {
    from { transform: scale(0.4) rotate(-12deg); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.exo-hero-identity {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.exo-hero-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(221, 214, 254, 0.72);
}

.exo-hero-identity h2 {
    margin: 0;
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.1;
    color: #fff;
    overflow-wrap: anywhere;
}

.exo-hero .muscle-badge {
    background: rgba(255, 255, 255, 0.92);
}

.exo-mastery {
    margin-top: 16px;
}

.exo-comeback {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 18px;
    background: #eef2ff;
    border: 2px solid #c7d2fe;
    font-size: 13px;
    font-weight: 600;
    color: #3730a3;
}

.exo-comeback span {
    font-size: 20px;
    line-height: 1.2;
}

.exo-comeback p {
    margin: 0;
}

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

.exo-tile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 12px 10px;
    border-radius: 18px;
    background: var(--card-bg);
    border: 2px solid #ececfb;
    box-shadow: 0 3px 0 #e4e4f7;
}

.exo-tile span {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.exo-tile strong {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 19px;
    font-weight: 900;
    line-height: 1.15;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exo-tile small {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exo-tile.is-gold {
    background: linear-gradient(180deg, #fffbeb, #fef3c7);
    border-color: #fde68a;
    box-shadow: 0 3px 0 #fcd34d;
}

.exo-tile.is-gold strong {
    color: #b45309;
}

.exo-quest {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 20px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #fcd34d;
    box-shadow: 0 4px 0 #f59e0b;
}

.exo-quest-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 24px;
    background: #fff;
    box-shadow: 0 3px 0 #f59e0b;
}

.exo-quest > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.exo-quest-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #92400e;
}

.exo-quest strong {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 900;
    color: #78350f;
}

.exo-quest small {
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
}

.exo-card {
    position: relative;
}

.exo-chart {
    display: block;
    width: 100%;
    height: 120px;
    overflow: visible;
}

.exo-chart-dots {
    position: relative;
    height: 120px;
    margin-top: -120px;
    pointer-events: none;
}

.exo-chart-dots i {
    position: absolute;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #7c3aed;
    box-sizing: border-box;
}

.exo-chart-dots i.is-record {
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    background: #fbbf24;
    border-color: #fff;
    box-shadow: 0 0 0 2px #f59e0b, 0 0 12px rgba(251, 191, 36, 0.7);
}

.exo-chart-axis {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.exo-legend-record {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 3px;
    border-radius: 50%;
    background: #fbbf24;
    box-shadow: 0 0 0 1.5px #f59e0b;
    vertical-align: -1px;
}

.exo-balance {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.exo-balance-side {
    display: grid;
    grid-template-columns: 26px 1fr auto;
    align-items: center;
    gap: 10px;
}

.exo-balance-side > span {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 900;
    color: #fff;
    background: #6366f1;
}

.exo-balance-side.side-right > span {
    background: #8b5cf6;
}

.exo-balance-track {
    height: 12px;
    border-radius: 999px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.exo-balance-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #818cf8, #6366f1);
    animation: pz-grow 0.9s var(--ease-out) both;
    transform-origin: left center;
}

.exo-balance-side.side-right .exo-balance-track i {
    background: linear-gradient(90deg, #a78bfa, #8b5cf6);
}

.exo-balance-side strong {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

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

.exo-medal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 6px 10px;
    border-radius: 18px;
    background: var(--bg-secondary);
    text-align: center;
    min-width: 0;
}

.exo-medal .quest-track {
    width: 100%;
}

.exo-medal-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 22px;
    background: #e2e8f0;
    filter: grayscale(1);
    opacity: 0.55;
}

.exo-medal strong {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-secondary);
    line-height: 1.2;
}

.exo-medal small {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
}

.exo-medal.is-unlocked {
    background: linear-gradient(180deg, #fffbeb, #fef3c7);
    box-shadow: 0 3px 0 #fcd34d;
}

.exo-medal.is-unlocked .exo-medal-icon {
    filter: none;
    opacity: 1;
    background: radial-gradient(circle at 35% 30%, #fff7d6, #fbbf24 70%, #d97706);
    box-shadow: 0 3px 0 #92400e, 0 0 14px rgba(251, 191, 36, 0.45);
}

.exo-medal.is-unlocked strong {
    color: #92400e;
}

.exo-pr {
    font-size: 12px;
}

.exo-technique-btn {
    width: 100%;
    min-height: 50px;
    gap: 8px;
}

@media (prefers-reduced-motion: reduce) {
    .exo-row,
        .exo-hero,
        .exo-hero-tier,
        .exo-balance-track i {
        animation: none;
    }
}

/* ---------- Cardio : champs facultatifs (distance, pente, calories) ---------- */

.cardio-extras {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    border-radius: 16px;
    background: var(--tint-primary);
    border: 1.5px dashed rgba(99, 102, 241, 0.25);
}

.cardio-extra {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cardio-extra > span {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary-dark);
}

.cardio-extra small {
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
}

.cardio-extra input {
    width: 100%;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 12px;
    border: 2px solid #e4e4f7;
    background: var(--card-bg);
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    box-shadow: 0 2px 0 #e4e4f7;
}

.cardio-extra input:focus {
    outline: none;
    border-color: #a78bfa;
}

.cardio-extra input::placeholder {
    color: #c4c4dc;
    font-weight: 700;
}

.input-weight-bodyweight::placeholder {
    color: var(--primary-dark);
    opacity: 0.55;
    font-weight: 800;
}
