        * { margin: 0; padding: 0; box-sizing: border-box; }
        :root {
            --apex-bottom-nav-height: 68px;
        }
        body {
            font-family: 'Inter', sans-serif;
            background-color: #0a0a0f;
            color: #ffffff;
            min-height: 100dvh;
            overflow-x: hidden;
            -webkit-font-smoothing: antialiased;
        }
        ::-webkit-scrollbar { width: 4px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: #22222e; border-radius: 9999px; }

        /* ============================================================
           KEYFRAMES — defined here so animations work even without
           Tailwind CDN generating them from tailwind-config.js.
           ============================================================ */
        @keyframes fadeIn {
            0%   { opacity: 0; }
            100% { opacity: 1; }
        }
        @keyframes slideUp {
            0%   { opacity: 0; transform: translateY(30px); }
            100% { opacity: 1; transform: translateY(0); }
        }
        @keyframes slideInRight {
            0%   { opacity: 0; transform: translateX(40px); }
            100% { opacity: 1; transform: translateX(0); }
        }
        @keyframes pulseGlow {
            0%, 100% { box-shadow: 0 0 20px rgba(220, 38, 38, 0.2); }
            50%      { box-shadow: 0 0 40px rgba(220, 38, 38, 0.5); }
        }
        @keyframes counterTick {
            0%   { transform: scale(1); }
            50%  { transform: scale(1.15); }
            100% { transform: scale(1); }
        }
        @keyframes toastIn {
            0%   { opacity: 0; transform: translateX(100%) scale(0.95); }
            100% { opacity: 1; transform: translateX(0) scale(1); }
        }
        @keyframes toastOut {
            0%   { opacity: 0; transform: translateX(0) scale(1); }
            100% { opacity: 1; transform: translateX(100%) scale(0.95); }
        }
        @keyframes cardEnter {
            0%   { opacity: 0; transform: translateY(20px) scale(0.97); }
            100% { opacity: 1; transform: translateY(0) scale(1); }
        }

        /* === NEW: Micro-interaction keyframes === */
        @keyframes pressScale {
            0%   { transform: scale(1); }
            50%  { transform: scale(0.97); }
            100% { transform: scale(1); }
        }
        @keyframes navBounce {
            0%   { transform: scale(1); }
            40%  { transform: scale(0.88); }
            70%  { transform: scale(1.05); }
            100% { transform: scale(1); }
        }
        @keyframes heroGlow {
            0%, 100% { text-shadow: 0 0 20px rgba(220, 38, 38, 0.0), 0 0 60px rgba(220, 38, 38, 0.0); }
            50%      { text-shadow: 0 0 25px rgba(220, 38, 38, 0.3), 0 0 80px rgba(220, 38, 38, 0.15); }
        }
        @keyframes streakFireGlow {
            0%, 100% { box-shadow: 0 0 15px rgba(249, 115, 22, 0.2), 0 0 30px rgba(249, 115, 22, 0.05); }
            50%      { box-shadow: 0 0 25px rgba(249, 115, 22, 0.4), 0 0 50px rgba(249, 115, 22, 0.15); }
        }
        @keyframes chartDraw {
            0%   { stroke-dashoffset: 2000; }
            100% { stroke-dashoffset: 0; }
        }
        @keyframes dotPulse {
            0%, 100% { r: 3.5; opacity: 1; }
            50%      { r: 5; opacity: 0.7; }
        }
        @keyframes dotGlowPulse {
            0%, 100% { r: 6; opacity: 0.3; }
            50%      { r: 9; opacity: 0.1; }
        }
        @keyframes shimmer {
            0%   { background-position: -200% 0; }
            100% { background-position: 200% 0; }
        }
        @keyframes floatUp {
            0%   { opacity: 0; transform: translateY(10px); }
            100% { opacity: 1; transform: translateY(0); }
        }
        @keyframes ringProgress {
            0%   { --streak-pct: 0; }
        }

        /* Animation utility classes (hardened fallback for Tailwind CDN) */
        .animate-fade-in      { animation: fadeIn 0.5s ease-out forwards; }
        .animate-slide-up      { animation: slideUp 0.28s ease-out forwards; }
        .animate-slide-in-right{ animation: slideInRight 0.4s ease-out forwards; }
        .animate-pulse-glow    { animation: pulseGlow 2s ease-in-out infinite; }
        .animate-counter-tick  { animation: counterTick 0.3s ease-out; }
        .animate-toast-in      { animation: toastIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
        .animate-toast-out     { animation: toastOut 0.4s ease-in forwards; }
        .animate-card-enter    { animation: cardEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
        .animate-float-up      { animation: floatUp 0.6s ease-out forwards; }

        /* ============================================================
           VISUAL HIERARCHY — Card Layers
           ============================================================ */
        .card-primary {
            background-color: #1a1a26 !important;
            border: 1px solid rgba(255, 255, 255, 0.04);
            box-shadow: inset 0 2px 12px rgba(0,0,0,0.5), inset 0 0 1px rgba(255,255,255,0.03), 0 0 20px rgba(220, 38, 38, 0.04);
        }
        .card-secondary {
            background-color: #111118 !important;
            border: 1px solid rgba(255, 255, 255, 0.02);
            box-shadow: inset 0 2px 12px rgba(0,0,0,0.5), inset 0 0 1px rgba(255,255,255,0.02);
        }

        /* ============================================================
           MICRO-INTERACTIONS
           ============================================================ */
        .card-pressable {
            transition: transform 0.15s ease, box-shadow 0.15s ease;
            will-change: transform;
        }
        .card-pressable:active {
            transform: scale(0.97) !important;
        }

        /* Day-routine exercise dropdown cards should not pulse/scale on arrow tap */
        .routine-glass-card.exercise-card.card-pressable,
        .routine-glass-card.exercise-card.card-pressable:active {
            transform: none !important;
            filter: none !important;
        }
        .routine-glass-card.exercise-card > [data-overlay-toggle-id],
        .routine-glass-card.exercise-card > [data-overlay-toggle-id]:active {
            transform: none !important;
        }

        .btn-press {
            transition: transform 0.1s ease;
            will-change: transform;
        }
        .btn-press:active {
            transform: scale(0.95) !important;
        }

        button,
        a,
        [role="button"],
        .nav-item,
        .card-pressable,
        .btn-press,
        .filter-chip,
        .exercise-card,
        .day-chip,
        .timer-btn,
        .cta-button {
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
        }

        /* ============================================================
           EXISTING styles — preserved exactly
           ============================================================ */
        .inner-shadow {
            box-shadow: inset 0 2px 12px rgba(0,0,0,0.5), inset 0 0 1px rgba(255,255,255,0.03);
        }
        .card-glow:hover {
            box-shadow: 0 0 30px rgba(220, 38, 38, 0.12), inset 0 2px 12px rgba(0,0,0,0.5);
        }
        .anatomical-img {
            mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 60%, rgba(0,0,0,0));
            -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 60%, rgba(0,0,0,0));
        }
        .cta-button {
            background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
            transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
        }
        .cta-button:hover {
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            box-shadow: 0 0 30px rgba(220, 38, 38, 0.4);
            transform: translateY(-2px);
        }
        .cta-button:active { transform: translateY(0) scale(0.97); }

        .share-floating-cta {
            position: fixed;
            left: 50%;
            transform: translateX(-50%);
            bottom: calc(var(--apex-bottom-nav-height, 68px) + env(safe-area-inset-bottom, 0px) + 18px);
            z-index: 50;
            pointer-events: none;
        }
        .share-floating-cta-btn {
            pointer-events: auto;
            background: linear-gradient(145deg, #f5f5f5 0%, #dedede 100%);
            color: #050508;
            box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35), 0 0 18px rgba(255, 255, 255, 0.16);
            transition: transform 0.14s ease, box-shadow 0.2s ease, filter 0.2s ease;
            will-change: transform;
        }
        .share-floating-cta-btn:active {
            transform: scale(0.97);
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.32), 0 0 12px rgba(255, 255, 255, 0.12);
        }

        /* ============================================================
           NAVBAR — Premium Glow + Micro-interaction
           ============================================================ */
        .nav-item {
            transition: color 0.14s ease, transform 0.14s ease;
            position: relative;
        }
        .nav-item:active {
            animation: navBounce 0.35s ease;
        }
        .nav-item.active {
            color: #ffffff;
        }
        .nav-item.active svg {
            filter: drop-shadow(0 0 6px rgba(220, 38, 38, 0.6)) drop-shadow(0 0 12px rgba(220, 38, 38, 0.3));
            color: #ef4444;
        }
        .nav-item.active span {
            color: #ffffff;
        }
        .nav-item.active .nav-indicator {
            width: 20px;
            opacity: 1;
        }
        .nav-indicator {
            width: 0;
            height: 2px;
            background: linear-gradient(90deg, transparent, #dc2626, transparent);
            border-radius: 9999px;
            transition: width 0.2s ease, opacity 0.2s ease;
            opacity: 0;
            box-shadow: 0 0 8px rgba(220, 38, 38, 0.5);
        }

        input[type="number"]::-webkit-inner-spin-button,
        input[type="number"]::-webkit-inner-spin-button,
        input[type="number"]::-webkit-outer-spin-button {
            -webkit-appearance: none;
            appearance: none;
            margin: 0;
        }
        input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

        .toggle-bodyweight {
            transition: background-color 0.3s ease;
        }
        .toggle-bodyweight.active {
            background-color: #dc2626;
        }
        .toggle-knob {
            transition: transform 0.3s ease;
        }
        .toggle-bodyweight.active .toggle-knob {
            transform: translateX(20px);
        }

        /* ============================================================
           STREAK RING — Enhanced with fire glow
           ============================================================ */
        .streak-ring {
            background: conic-gradient(#dc2626 calc(var(--streak-pct, 0) * 1%), #22222e 0%);
            transition: --streak-pct 0.8s ease;
        }
        .streak-ring.has-streak {
            animation: streakFireGlow 2.5s ease-in-out infinite;
        }

        .view-transition {
            animation: fadeIn 0.18s ease-out;
        }

        /* ============================================================
           HERO SECTION — Animated Glow
           ============================================================ */
        .hero-glow {
            animation: heroGlow 3s ease-in-out infinite;
        }

        /* Timer Styles */
        .timer-display {
            font-variant-numeric: tabular-nums;
            text-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
        }
        .timer-btn {
            transition: all 0.2s ease;
        }
        .timer-btn:active { transform: scale(0.95); }
        .timer-btn.running {
            box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
        }

        /* Bar chart styles */
        .bar-fill {
            transition: height 0.8s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .bar-container:hover .bar-fill {
            filter: brightness(1.2);
        }

        /* ============================================================
           FILTER CHIPS — Refined (reduced red)
           ============================================================ */
        .filter-chip {
            transition: all 0.25s ease;
            position: relative;
        }
        .filter-chip.active {
            background-color: rgba(220, 38, 38, 0.12) !important;
            color: #ffffff !important;
            border-color: rgba(220, 38, 38, 0.4) !important;
        }

        /* ============================================================
           PLAN DAY CHIP — Refined (reduced red)
           ============================================================ */
        .day-chip {
            transition: all 0.2s ease;
        }
        .day-chip.active {
            background-color: rgba(220, 38, 38, 0.15);
            color: white;
            border-color: rgba(220, 38, 38, 0.5);
            box-shadow: 0 0 12px rgba(220, 38, 38, 0.15);
        }

        /* ============================================================
           STATS SEGMENTED CONTROL — Refined (reduced red)
           ============================================================ */
        .stats-tab-active {
            background: rgba(220, 38, 38, 0.15) !important;
            color: #ffffff !important;
            border: 1px solid rgba(220, 38, 38, 0.3);
            box-shadow: 0 0 15px rgba(220, 38, 38, 0.1);
        }

        /* Active Workout Overlay */
        .workout-overlay {
            position: fixed;
            inset: 0;
            z-index: 60;
            background: #0a0a0f;
            transform: translateY(100%);
            transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
            overflow-y: auto;
            overflow-x: hidden;
        }
        .workout-overlay.open {
            transform: translateY(0);
        }
        .workout-overlay::-webkit-scrollbar { width: 3px; }
        .workout-overlay::-webkit-scrollbar-thumb { background: #22222e; border-radius: 99px; }

        /* Sticky overlay header */
        .overlay-header {
            position: sticky;
            top: 0;
            z-index: 61;
            background: rgba(10, 10, 15, 0.92);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }

        /* Exercise panel floating reveal (transform + opacity only) */
        .routine-glass-card.exercise-card {
            position: relative;
        }
        .routine-glass-card.exercise-card.card-pressable {
            contain: layout;
            overflow: visible;
        }
        .routine-glass-card.exercise-card.open {
            z-index: 35;
        }
        .exercise-panel {
            position: absolute;
            left: 0;
            right: 0;
            top: calc(100% - 10px);
            overflow: visible;
            pointer-events: none;
        }
        .exercise-panel-inner {
            transform: translateY(-10px);
            opacity: 0;
            pointer-events: none;
            transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), opacity 150ms ease-out;
            will-change: transform, opacity;
        }
        .exercise-card.open > .exercise-panel > .exercise-panel-inner,
        .exercise-panel.open > .exercise-panel-inner {
            transform: translateY(0);
            opacity: 1;
            pointer-events: auto;
        }
        .exercise-panel-content {
            margin-top: 10px;
            padding: 14px 16px 16px;
            border-radius: 16px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            background: rgba(12, 13, 18, 0.985);
            backdrop-filter: blur(14px) saturate(112%);
            -webkit-backdrop-filter: blur(14px) saturate(112%);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
            isolation: isolate;
            contain: content;
            overflow: hidden;
            transform: translateZ(0);
        }

        /* Keep panel interactions lightweight for low-end phones */
        .exercise-panel .set-row {
            contain: layout paint;
            transition: border-color 0.12s ease, background-color 0.12s ease;
        }
        .exercise-panel .set-input {
            font-family: 'Inter', sans-serif;
            transition: border-color 0.12s ease, background-color 0.12s ease;
            box-shadow: none;
        }
        .exercise-panel .set-input:focus {
            box-shadow: none;
            border-color: rgba(239, 68, 68, 0.7);
            background: rgba(220, 38, 38, 0.08);
        }
        .exercise-panel .set-checkbox {
            transition: background-color 0.12s ease, border-color 0.12s ease;
        }

        /* Reduce paint-heavy effects only during panel animation window */
        .exercise-card.is-panel-animating > .exercise-panel,
        .exercise-card.is-panel-animating > .exercise-panel *,
        .exercise-card.is-panel-animating > .exercise-panel .exercise-panel-content,
        .exercise-card.is-panel-animating > .exercise-panel .exercise-panel-inner {
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
        }
        .exercise-card.is-panel-animating > .exercise-panel .exercise-panel-content,
        .exercise-card.is-panel-animating > .exercise-panel .set-row,
        .exercise-card.is-panel-animating > .exercise-panel .set-row.is-completed,
        .exercise-card.is-panel-animating > .exercise-panel .set-checkbox,
        .exercise-card.is-panel-animating > .exercise-panel .pr-badge {
            box-shadow: none !important;
            filter: none !important;
        }

        /* Set done animation */
        .set-done-flash {
            animation: setDone 0.4s ease;
        }
        @keyframes setDone {
            0% { background-color: rgba(220, 38, 38, 0.2); }
            100% { background-color: transparent; }
        }

        /* Horizontal scroll container */
        .h-scroll {
            overflow-x: auto;
            scroll-snap-type: x mandatory;
            -webkit-overflow-scrolling: touch;
        }
        .h-scroll::-webkit-scrollbar { height: 0; }
        .h-scroll > * { scroll-snap-align: start; }

        /* Sparkline */
        .sparkline-line {
            fill: none;
            stroke: #3b82f6;
            stroke-width: 1.5;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        /* ============================================================
           CHART ENHANCEMENTS — Draw animation + glowing dot
           ============================================================ */
        .chart-line-animated {
            stroke-dasharray: 2000;
            stroke-dashoffset: 2000;
            animation: chartDraw 1.5s ease-out forwards;
        }
        .chart-dot-pulse {
            animation: dotPulse 2s ease-in-out infinite;
        }
        .chart-dot-glow {
            animation: dotGlowPulse 2s ease-in-out infinite;
        }

        /* ============================================================
           DIFFICULTY BADGES
           ============================================================ */
        .badge {
            display: inline-flex;
            align-items: center;
            padding: 2px 8px;
            border-radius: 9999px;
            font-size: 7px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }
        .badge-beginner {
            background: rgba(34, 197, 94, 0.15);
            color: #4ade80;
            border: 1px solid rgba(34, 197, 94, 0.2);
        }
        .badge-intermediate {
            background: rgba(245, 158, 11, 0.15);
            color: #fbbf24;
            border: 1px solid rgba(245, 158, 11, 0.2);
        }
        .badge-advanced {
            background: rgba(239, 68, 68, 0.15);
            color: #f87171;
            border: 1px solid rgba(239, 68, 68, 0.2);
        }

        /* ============================================================
           EXERCISE CARD IMAGE OVERLAY
           ============================================================ */
        .card-img-gradient {
            position: absolute;
            inset: 0;
            background: linear-gradient(to bottom, rgba(10,10,15,0.5) 0%, transparent 40%, rgba(22,22,31,1) 95%);
            pointer-events: none;
        }

        /* ============================================================
           EMPTY STATE
           ============================================================ */
        .empty-state-icon {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background: linear-gradient(135deg, #1a1a26, #111118);
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 12px;
            border: 1px solid rgba(255,255,255,0.04);
        }

        /* ============================================================
           MOTIVATIONAL LINE — shimmer effect
           ============================================================ */
        .motivational-shimmer {
            background: linear-gradient(90deg, #71717a 0%, #a1a1aa 40%, #ffffff 50%, #a1a1aa 60%, #71717a 100%);
            background-size: 200% auto;
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: shimmer 4s linear infinite;
        }

        /* FAB */
        .fab {
            position: fixed;
            bottom: 80px;
            right: 20px;
            z-index: 35;
            transition: all 0.3s ease;
        }
        .fab:hover {
            transform: translateY(-3px);
            box-shadow: 0 0 30px rgba(220, 38, 38, 0.5);
        }
        .fab:active { transform: translateY(0); }

        @media (min-width: 768px) {
            .app-container { max-width: 480px; margin: 0 auto; }
            .fab { right: calc(50% - 220px); }
        }

        /* ============================================================
           SAFE AREA — Status bar overlap fix
           ============================================================ */
        .safe-area-top {
            padding-top: max(calc(env(safe-area-inset-top, 0px) + 16px), 52px) !important;
        }
        .safe-area-bottom {
            padding-bottom: env(safe-area-inset-bottom, 0px);
        }

        /* ============================================================
           WORKOUT CELEBRATION
           ============================================================ */
        @keyframes celebrationEnter {
            0% { opacity: 0; transform: scale(0.975); }
            100% { opacity: 1; transform: scale(1); }
        }
        @keyframes celebrationConfetti {
            0% { opacity: 0; transform: translate3d(0, -28px, 0) rotate(0deg) scale(0.9); }
            12% { opacity: 1; }
            100% { opacity: 0; transform: translate3d(0, 110vh, 0) rotate(260deg) scale(1); }
        }
        @keyframes trophyBounce {
            0%, 100% { transform: translateY(0) scale(1); }
            20% { transform: translateY(-10px) scale(1.03); }
            40% { transform: translateY(0) scale(0.99); }
            60% { transform: translateY(-4px) scale(1.01); }
        }
        @keyframes radialPulse {
            0%, 100% { opacity: 0.45; transform: scale(0.94); }
            50% { opacity: 0.7; transform: scale(1.04); }
        }

        .celebration-screen {
            background:
                radial-gradient(circle at top, rgba(251, 191, 36, 0.18), transparent 28%),
                radial-gradient(circle at bottom, rgba(220, 38, 38, 0.12), transparent 34%),
                linear-gradient(180deg, #050507 0%, #09090f 45%, #050507 100%);
            animation: celebrationEnter 0.3s ease-out forwards;
            transform-origin: center;
        }
        .celebration-grid {
            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: 28px 28px;
            mask-image: radial-gradient(circle at center, black, transparent 72%);
            -webkit-mask-image: radial-gradient(circle at center, black, transparent 72%);
            opacity: 0.25;
        }
        .celebration-particles {
            position: absolute;
            inset: 0;
            pointer-events: none;
            overflow: hidden;
        }
        .celebration-confetti {
            position: absolute;
            top: -8%;
            border-radius: 999px;
            box-shadow: 0 0 18px rgba(255, 215, 0, 0.22);
            animation: celebrationConfetti 1.6s ease-out forwards;
        }
        .celebration-trophy-wrap {
            position: relative;
            display: inline-flex;
            justify-content: center;
            align-items: center;
            width: 180px;
            height: 180px;
        }
        .celebration-radial-glow {
            position: absolute;
            inset: 22px;
            border-radius: 999px;
            background: radial-gradient(circle, rgba(251, 191, 36, 0.4) 0%, rgba(245, 158, 11, 0.18) 35%, rgba(251, 191, 36, 0) 70%);
            filter: blur(10px);
            animation: radialPulse 2.4s ease-in-out infinite;
        }
        .celebration-trophy {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 132px;
            height: 132px;
            border-radius: 999px;
            background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
            border: 1px solid rgba(255,255,255,0.08);
            box-shadow:
                0 24px 80px rgba(245, 158, 11, 0.18),
                inset 0 1px 0 rgba(255,255,255,0.1);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            animation: trophyBounce 2.8s ease-in-out infinite;
        }
        .celebration-summary-card,
        .celebration-pr-card {
            border-radius: 24px;
            border: 1px solid rgba(255,255,255,0.08);
            background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
            box-shadow:
                inset 0 1px 0 rgba(255,255,255,0.06),
                0 18px 40px rgba(0,0,0,0.3);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            padding: 18px;
        }
        .celebration-primary-btn {
            background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 45%, #facc15 100%);
            box-shadow: 0 18px 35px rgba(245, 158, 11, 0.2);
        }
        .celebration-primary-btn:hover {
            filter: brightness(1.04);
        }

        /* ============================================================
           ROUTINE HERO & REDESIGN
           ============================================================ */
        .routine-hero {
            position: relative;
            height: calc(200px + env(safe-area-inset-top, 0px));
            width: 100%;
            overflow: hidden;
        }
        .routine-hero-content {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: 20px;
            padding-top: max(calc(env(safe-area-inset-top, 0px) + 12px), 40px);
        }
        .routine-hero-topbar {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .routine-hero-timer {
            margin-left: auto;
            min-width: 126px;
            justify-content: center;
            padding: 0.55rem 1rem;
            gap: 0.58rem;
            border: 1px solid rgba(255, 255, 255, 0.16);
            background: linear-gradient(165deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.07) 100%);
            box-shadow: 0 0 20px rgba(239, 68, 68, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 8px 20px rgba(0, 0, 0, 0.32);
            transform: translate(10px, 4px);
        }
        .routine-hero-timer-value {
            font-variant-numeric: tabular-nums;
            font-size: 0.94rem;
            line-height: 1;
            letter-spacing: 0.17em;
        }
        .routine-hero-timer-dot {
            width: 9px;
            height: 9px;
            flex: 0 0 auto;
        }
        @media (max-width: 380px) {
            .routine-hero-timer {
                min-width: 120px;
                padding: 0.5rem 0.9rem;
                transform: translate(8px, 4px);
            }
            .routine-hero-timer-value {
                font-size: 0.88rem;
                letter-spacing: 0.15em;
            }
        }
        .routine-hero-bg {
            position: absolute;
            inset: 0;
            background-size: cover;
            background-position: center 20%;
            opacity: 0.6;
            filter: blur(1px);
        }
        .routine-hero-overlay {
            position: absolute;
            inset: 0;
            background: linear-gradient(180deg, rgba(10,10,15,0.4) 0%, rgba(10,10,15,0.6) 40%, rgba(10,10,15,1) 98%);
            pointer-events: none;
        }
        .routine-glass-pill {
            background: rgba(255,255,255,0.06);
            backdrop-filter: blur(7px);
            -webkit-backdrop-filter: blur(7px);
            border: 1px solid rgba(255,255,255,0.1);
            box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        }
        .routine-glass-card {
            background: rgba(20, 20, 29, 0.56);
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 20px;
            box-shadow: inset 0 2px 12px rgba(0,0,0,0.3), inset 0 0 1px rgba(255,255,255,0.04), 0 8px 24px rgba(0,0,0,0.22);
            transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease, transform 0.12s ease;
        }
        .routine-glass-card.card-pressable {
            contain: layout paint;
        }
        .routine-progress-card {
            border-radius: 18px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            padding: 14px 14px 12px;
            background: linear-gradient(180deg, rgba(34, 12, 14, 0.75) 0%, rgba(20, 20, 28, 0.85) 100%);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 14px 28px rgba(0,0,0,0.26);
        }
        .routine-progress-track {
            width: 100%;
            height: 8px;
            border-radius: 9999px;
            overflow: hidden;
            background: rgba(255, 255, 255, 0.07);
            border: 1px solid rgba(255, 255, 255, 0.06);
        }
        .routine-progress-fill {
            height: 100%;
            border-radius: 9999px;
            background: linear-gradient(90deg, #6f1111 0%, #b91c1c 48%, #ef4444 100%);
            box-shadow: 0 0 10px rgba(220, 38, 38, 0.35), 0 0 20px rgba(220, 38, 38, 0.12);
            transition: width 0.32s cubic-bezier(0.16, 1, 0.3, 1);
            will-change: width;
        }
        .routine-progress-fill.is-pulsing {
            animation: routineProgressPulse 0.7s ease-out 1;
        }
        @keyframes routineProgressPulse {
            0% { box-shadow: 0 0 8px rgba(220, 38, 38, 0.24), 0 0 14px rgba(220, 38, 38, 0.12); }
            50% { box-shadow: 0 0 14px rgba(239, 68, 68, 0.45), 0 0 22px rgba(239, 68, 68, 0.2); }
            100% { box-shadow: 0 0 10px rgba(220, 38, 38, 0.35), 0 0 20px rgba(220, 38, 38, 0.12); }
        }
        .routine-glass-card.card-pressable:not(.exercise-card):active {
            transform: scale(0.97) !important;
            filter: brightness(0.9);
        }
        .routine-glass-card.is-completed {
            border-color: rgba(248, 113, 113, 0.52);
            box-shadow: 0 0 24px rgba(239, 68, 68, 0.24), inset 0 2px 12px rgba(0,0,0,0.3);
            background: linear-gradient(180deg, rgba(127, 29, 29, 0.38) 0%, rgba(25, 25, 34, 0.82) 100%);
        }
        .routine-glass-card.is-fresh-complete {
            animation: exerciseCompleteGlow 0.85s ease-out 1;
        }
        @keyframes exerciseCompleteGlow {
            0% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
            50% { box-shadow: 0 0 42px rgba(239, 68, 68, 0.52), inset 0 0 0 1px rgba(248, 113, 113, 0.7); }
            100% { box-shadow: 0 0 24px rgba(239, 68, 68, 0.24), inset 0 0 0 1px rgba(248, 113, 113, 0.3); }
        }
        .set-table-header {
            display: grid;
            grid-template-columns: minmax(64px, 1fr) 76px 76px 44px;
            font-size: 9px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.15em;
            color: rgba(255, 255, 255, 0.4);
            padding-bottom: 8px;
            border-bottom: 1px solid rgba(255,255,255,0.08);
            margin-bottom: 8px;
            gap: 8px;
            align-items: center;
        }
        .set-row {
            display: grid;
            grid-template-columns: minmax(64px, 1fr) 76px 76px 44px;
            align-items: center;
            gap: 8px;
            padding: 8px 6px;
            border: 1px solid rgba(255,255,255,0.05);
            border-radius: 14px;
            background: rgba(255,255,255,0.02);
            position: relative;
            transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
        }
        .set-meta-col {
            display: flex;
            flex-direction: column;
            gap: 2px;
            min-width: 0;
        }
        .set-index {
            font-size: 10px;
            font-weight: 800;
            color: rgba(255, 255, 255, 0.74);
            line-height: 1.1;
            letter-spacing: 0.08em;
        }
        .set-prev {
            font-size: 9px;
            font-weight: 700;
            color: rgba(255, 255, 255, 0.38);
            letter-spacing: 0.05em;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .set-row-fresh {
            animation: setDoneFlash 0.45s ease-out 1;
        }
        @keyframes setDoneFlash {
            0% { box-shadow: 0 0 0 rgba(74, 222, 128, 0); }
            45% { box-shadow: 0 0 26px rgba(74, 222, 128, 0.35); }
            100% { box-shadow: 0 0 0 rgba(74, 222, 128, 0); }
        }
        .set-row.is-completed .set-input {
            opacity: 0.62;
            pointer-events: none;
        }
        .set-row.is-completed {
            border-color: rgba(74, 222, 128, 0.36);
            background: linear-gradient(90deg, rgba(22, 101, 52, 0.28) 0%, rgba(20, 20, 30, 0.9) 100%);
            box-shadow: 0 0 16px rgba(74, 222, 128, 0.22), inset 0 0 0 1px rgba(74, 222, 128, 0.2);
        }
        .set-row.is-completed .set-index {
            color: #4ade80;
        }
        .set-input {
            background: rgba(0,0,0,0.35);
            border: 1px solid rgba(255,255,255,0.1);
            height: 38px;
            border-radius: 11px;
            color: white;
            font-family: 'Orbitron', sans-serif;
            font-weight: 700;
            font-size: 14px;
            text-align: center;
            width: 100%;
            transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
            outline: none;
        }
        .set-input:focus {
            border-color: #ef4444;
            background: rgba(220,38,38,0.12);
            box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
        }
        .set-checkbox {
            width: 36px;
            height: 36px;
            border-radius: 12px;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
            margin-left: auto;
        }
        .set-row.is-completed .set-checkbox {
            background: linear-gradient(145deg, #7f1d1d 0%, #dc2626 60%, #ef4444 100%);
            border-color: rgba(248, 113, 113, 0.8);
            box-shadow: 0 0 14px rgba(239, 68, 68, 0.35);
        }
        .set-check-icon.animate-set-check {
            animation: setCheckPop 0.28s cubic-bezier(0.16, 1, 0.3, 1) 1;
        }
        @keyframes setCheckPop {
            0% { transform: scale(0.7); opacity: 0.3; }
            65% { transform: scale(1.15); opacity: 1; }
            100% { transform: scale(1); opacity: 1; }
        }
        .pr-badge {
            background: rgba(245, 158, 11, 0.2);
            color: #fbbf24;
            border: 1px solid rgba(245, 158, 11, 0.4);
            box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
            font-size: 8px;
            font-weight: 800;
            padding: 2px 6px;
            border-radius: 6px;
            margin-left: 6px;
            animation: prPulse 2s infinite;
        }
        @keyframes prPulse {
            0%, 100% { filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.4)); }
            50%      { filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.8)); }
        }
        .sticky-finish-bar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(180deg, rgba(10,10,15,0) 0%, rgba(10,10,15,0.9) 20%, rgba(10,10,15,1) 100%);
            padding: 34px 20px 18px 20px;
            z-index: 50;
            transform: translateY(120%);
            transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .sticky-finish-bar.visible {
            transform: translateY(0);
        }
        .finish-workout-btn {
            min-height: 60px;
            border: 1px solid rgba(248, 113, 113, 0.45);
            background: linear-gradient(130deg, #6f1111 0%, #b91c1c 42%, #ef4444 78%, #ff5c5c 100%);
            box-shadow: 0 14px 26px rgba(220, 38, 38, 0.33), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
            position: relative;
            overflow: hidden;
            transition: transform 0.12s ease, box-shadow 0.2s ease;
            will-change: transform;
        }
        .finish-workout-btn.is-active {
            animation: finishPulse 2.4s ease-in-out infinite;
        }
        .finish-workout-btn.is-workout-complete {
            animation: none;
            border-color: rgba(74, 222, 128, 0.55);
            background: linear-gradient(130deg, #14532d 0%, #15803d 45%, #22c55e 100%);
            box-shadow: 0 14px 28px rgba(34, 197, 94, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
        }
        .finish-workout-btn.is-pressed,
        .finish-workout-btn:active {
            transform: scale(0.96);
        }
        .finish-workout-btn-label {
            position: relative;
            z-index: 2;
            text-shadow: 0 0 14px rgba(255, 255, 255, 0.18);
        }
        .finish-btn-ripple {
            position: absolute;
            border-radius: 999px;
            pointer-events: none;
            z-index: 1;
            background: radial-gradient(circle, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.2) 30%, rgba(255,255,255,0) 70%);
            transform: scale(0);
            animation: finishRipple 0.55s ease-out forwards;
        }
        @keyframes finishPulse {
            0%, 100% { box-shadow: 0 14px 26px rgba(220, 38, 38, 0.28), 0 0 16px rgba(239, 68, 68, 0.16); }
            50% { box-shadow: 0 18px 34px rgba(239, 68, 68, 0.42), 0 0 26px rgba(239, 68, 68, 0.28); }
        }
        @keyframes finishRipple {
            0% { transform: scale(0); opacity: 0.65; }
            100% { transform: scale(1); opacity: 0; }
        }
        .set-checkbox,
        .finish-workout-btn,
        .routine-glass-pill,
        .routine-glass-card.card-pressable > button {
            touch-action: manipulation;
        }
        @media (prefers-reduced-motion: reduce) {
            .animate-slide-up,
            .routine-glass-card.is-fresh-complete,
            .set-row-fresh,
            .routine-progress-fill.is-pulsing,
            .finish-workout-btn.is-active,
            .pr-badge,
            .hero-glow {
                animation: none !important;
            }
            .workout-overlay,
            .exercise-panel-inner,
            .sticky-finish-bar,
            .routine-glass-card,
            .set-row,
            .set-input,
            .set-checkbox,
            .finish-workout-btn,
            .routine-progress-fill {
                transition-duration: 0.01ms !important;
            }
        }
        @media (max-width: 390px) {
            .set-table-header,
            .set-row {
                grid-template-columns: minmax(52px, 1fr) 68px 68px 40px;
                gap: 6px;
            }
            .set-input {
                height: 36px;
                font-size: 13px;
            }
            .finish-workout-btn {
                min-height: 56px;
            }
        }

