/* Workout — Design System Tokens */
:root {
    /* Primary — deep magenta from getfitwithgaya.com */
    --wo-primary: #C2185B;
    --wo-primary-hover: #A11449;
    --wo-primary-light: #FCE4EC;
    --wo-primary-muted: rgba(194, 24, 91, 0.12);

    /* Surfaces */
    --wo-bg: #FFF8FA;
    --wo-surface: #FFFFFF;
    --wo-border: #F0E0E6;
    --wo-border-strong: #D4A0B0;

    /* Text — warm plum-tinted grays */
    --wo-text: #2D2D2D;
    --wo-text-secondary: #6B5460;
    --wo-text-tertiary: #9E8A93;

    /* Semantic */
    --wo-success: #4A7C59;
    --wo-warning: #E8A835;
    --wo-danger: #C45C3B;

    /* Shadows — warm-tinted */
    --wo-shadow-sm: 0 1px 3px rgba(194, 24, 91, 0.06);
    --wo-shadow-md: 0 4px 12px rgba(194, 24, 91, 0.08);
    --wo-shadow-lg: 0 8px 24px rgba(194, 24, 91, 0.10);

    /* Typography */
    --wo-font-display: 'Montserrat', sans-serif;
    --wo-font-body: 'Heebo', sans-serif;
    --wo-font-mono: 'Fira Code', monospace;

    /* Type scale */
    --wo-text-xs: 0.75rem;
    --wo-text-sm: 0.875rem;
    --wo-text-base: 1rem;
    --wo-text-lg: 1.125rem;
    --wo-text-xl: 1.5rem;
    --wo-text-2xl: 2rem;

    /* Bootstrap overrides */
    --bs-body-bg: var(--wo-bg);
    --bs-body-color: var(--wo-text);
    --bs-body-font-family: var(--wo-font-body);
    --bs-border-color: var(--wo-border);
    --bs-link-color: var(--wo-primary);
    --bs-link-hover-color: var(--wo-primary-hover);
}

/* ═══════════════════════════════════════
   Base
   ═══════════════════════════════════════ */

body {
    font-family: var(--wo-font-body);
    color: var(--wo-text);
    background: var(--wo-bg);
    -webkit-font-smoothing: antialiased;
}

.font-display { font-family: var(--wo-font-display); }
.font-body { font-family: var(--wo-font-body); }
.font-mono { font-family: var(--wo-font-mono); }

/* Spinner color override for overlay */
.spinner-border.text-primary {
    color: var(--wo-primary) !important;
}

/* Page overlay background */
.page-overlay {
    background: var(--wo-bg);
}

/* ═══════════════════════════════════════
   Components
   ═══════════════════════════════════════ */

/* Card */
.wo-card {
    background: var(--wo-surface);
    border-radius: 12px;
    box-shadow: var(--wo-shadow-sm);
    padding: 12px 16px;
    transition: box-shadow 0.15s ease;
}

.wo-card:hover {
    box-shadow: var(--wo-shadow-md);
}

/* Primary Button (pill + gradient) */
.wo-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    min-height: 48px;
    border: none;
    border-radius: 9999px;
    background: linear-gradient(135deg, #C2185B 0%, #A11449 100%);
    color: #fff;
    font-family: var(--wo-font-display);
    font-weight: 600;
    font-size: var(--wo-text-sm);
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.wo-btn-primary:hover {
    background: linear-gradient(135deg, #A11449 0%, #8A0F3D 100%);
    box-shadow: var(--wo-shadow-md);
    color: #fff;
}

/* Secondary Button */
.wo-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    min-height: 48px;
    border: 2px solid var(--wo-primary);
    border-radius: 9999px;
    background: transparent;
    color: var(--wo-primary);
    font-family: var(--wo-font-display);
    font-weight: 600;
    font-size: var(--wo-text-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.wo-btn-secondary:hover {
    background: var(--wo-primary-light);
    color: var(--wo-primary);
}

/* Ghost Button (tertiary) */
.wo-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--wo-text-secondary);
    font-size: var(--wo-text-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.wo-btn-ghost:hover {
    background: var(--wo-primary-light);
    color: var(--wo-primary);
}

.design-rename-btn {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.design-rename-btn.visible {
    opacity: 1;
}

/* Icon-only button */
.wo-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--wo-text-tertiary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.wo-btn-icon:hover {
    background: rgba(194, 24, 91, 0.08);
    color: var(--wo-danger);
}

/* Input */
.wo-input {
    padding: 8px 12px;
    border: 1.5px solid var(--wo-border);
    border-radius: 12px;
    background: var(--wo-surface);
    color: var(--wo-text);
    font-family: var(--wo-font-body);
    font-size: var(--wo-text-base);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.wo-input:focus {
    border-color: var(--wo-primary);
    box-shadow: 0 0 0 3px rgba(194, 24, 91, 0.15);
}

.wo-input-number {
    font-family: var(--wo-font-mono);
    text-align: center;
    width: 60px;
}

/* Pill / Chip */
.wo-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 9999px;
    font-family: var(--wo-font-body);
    font-size: var(--wo-text-sm);
    font-weight: 500;
    transition: all 0.15s ease;
}

.wo-pill-active {
    background: var(--wo-primary);
    color: #fff;
}

.wo-pill-inactive {
    background: var(--wo-primary-light);
    color: var(--wo-primary);
}

/* Section header label */
.wo-label {
    font-family: var(--wo-font-display);
    font-size: var(--wo-text-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wo-text-tertiary);
}

/* ═══════════════════════════════════════
   Top Navigation
   ═══════════════════════════════════════ */

.wo-nav-top {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 24px;
    background: var(--wo-surface);
    box-shadow: var(--wo-shadow-sm);
}

.wo-nav-brand {
    font-weight: 700;
    font-size: var(--wo-text-lg);
    color: var(--wo-primary);
}

.wo-nav-tabs {
    display: flex;
    gap: 4px;
}

.wo-nav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--wo-text-secondary);
    font-family: var(--wo-font-display);
    font-weight: 600;
    font-size: var(--wo-text-sm);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: all 0.15s ease;
}

.wo-nav-tab:hover {
    color: var(--wo-primary);
    background: var(--wo-primary-light);
}

.wo-nav-tab.active {
    color: var(--wo-primary);
    background: var(--wo-primary-muted);
}

.wo-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wo-nav-user {
    font-size: var(--wo-text-sm);
    color: var(--wo-text-secondary);
}

.wo-nav-link {
    font-size: var(--wo-text-sm);
    color: var(--wo-text-tertiary);
    text-decoration: none;
}

.wo-nav-link:hover {
    color: var(--wo-primary);
}

/* ═══════════════════════════════════════
   Bottom Navigation (Mobile)
   ═══════════════════════════════════════ */

.wo-nav-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    height: 56px;
    background: var(--wo-surface);
    box-shadow: 0 -2px 8px rgba(194, 24, 91, 0.06);
}

.wo-nav-bottom .wo-nav-tab {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    border-radius: 0;
    font-size: var(--wo-text-xs);
    gap: 2px;
    padding: 4px;
}

.wo-nav-bottom .wo-nav-tab i {
    font-size: 1.25rem;
}

/* ═══════════════════════════════════════
   Main Content
   ═══════════════════════════════════════ */

.wo-main {
    padding: 16px;
    padding-bottom: 72px; /* Space for mobile nav */
}

@media (min-width: 768px) {
    .wo-main {
        padding: 24px;
        padding-bottom: 24px;
    }
}

/* ═══════════════════════════════════════
   Design Screen: Two-Panel Layout
   ═══════════════════════════════════════ */

.design-container {
    display: flex;
    gap: 24px;
    height: calc(100vh - 120px);
}

/* Left Panel */
.design-left {
    width: 35%;
    min-width: 260px;
    overflow-y: auto;
}

.design-program-header {
    margin-bottom: 8px;
}

.design-program-name {
    flex: 1;
    font-weight: 700;
    font-size: var(--wo-text-xl);
    border: none;
    background: transparent;
    padding: 4px 0;
    color: var(--wo-text);
}

.design-program-name:focus {
    border: none;
    box-shadow: none;
    outline: none;
    border-bottom: 2px solid var(--wo-primary);
    border-radius: 0;
}

.design-section-header {
    padding: 8px 0 4px;
}

.design-workout-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.design-workout-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--wo-surface);
    border-radius: 12px;
    box-shadow: var(--wo-shadow-sm);
    transition: all 0.15s ease;
    cursor: pointer;
}

.design-workout-card:hover {
    box-shadow: var(--wo-shadow-md);
}

.design-workout-card.selected {
    background: var(--wo-primary-muted);
    border-left: 4px solid var(--wo-primary);
    padding-left: 8px;
}

.workout-drag-handle {
    color: var(--wo-text-tertiary);
    cursor: grab;
    padding: 4px;
}

.design-workout-link {
    flex: 1;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.design-workout-name {
    font-weight: 600;
    font-size: var(--wo-text-sm);
    color: var(--wo-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.design-workout-meta {
    font-size: var(--wo-text-xs);
    color: var(--wo-text-tertiary);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.meta-dot { color: var(--wo-border-strong); }

.design-workout-delete .wo-btn-icon {
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.design-workout-card:hover .design-workout-delete .wo-btn-icon {
    opacity: 0.5;
}

.design-workout-card:hover .design-workout-delete .wo-btn-icon:hover {
    opacity: 1;
    color: var(--wo-danger);
}

.design-add-workout {
    padding-top: 8px;
}

/* Right Panel */
.design-right {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.design-workout-title {
    width: 100%;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: var(--wo-text-xl);
    padding: 4px 0;
    margin-bottom: 12px;
    color: var(--wo-text);
}

.design-workout-title:focus {
    border: none;
    box-shadow: none;
    outline: none;
    border-bottom: 2px solid var(--wo-primary);
    border-radius: 0;
}

.design-meta-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.design-meta-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.design-location-select {
    min-width: 140px;
}

/* Difficulty Segmented Control */
.design-difficulty {
    display: flex;
    border: 1.5px solid var(--wo-border);
    border-radius: 9999px;
    overflow: hidden;
}

.design-diff-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    cursor: pointer;
    font-family: var(--wo-font-mono);
    font-size: var(--wo-text-sm);
    color: var(--wo-text-secondary);
    transition: all 0.15s ease;
    margin: 0;
}

.design-diff-option input[type="radio"] { display: none; }

.design-diff-option:not(:last-child) {
    border-right: 1.5px solid var(--wo-border);
}

.design-diff-option.active {
    background: var(--wo-primary);
    color: #fff;
}

.design-diff-option:hover:not(.active) {
    background: var(--wo-primary-light);
}

/* Exercise Cards */
.design-exercise-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.design-exercise-card {
    background: var(--wo-surface);
    border-radius: 12px;
    box-shadow: var(--wo-shadow-sm);
    padding: 12px 16px;
}

.design-exercise-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.exercise-drag-handle {
    color: var(--wo-text-tertiary);
    cursor: grab;
    padding: 2px;
}

.design-exercise-header .wo-btn-icon {
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.design-exercise-card:hover .design-exercise-header .wo-btn-icon {
    opacity: 0.5;
}

.design-exercise-card:hover .design-exercise-header .wo-btn-icon:hover {
    opacity: 1;
    color: var(--wo-danger);
}

.design-exercise-name {
    flex: 1;
    font-weight: 600;
    font-size: var(--wo-text-base);
    color: var(--wo-text);
    text-decoration: none;
}

.design-exercise-name:hover {
    color: var(--wo-primary);
}

.design-exercise-config {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.design-config-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.design-config-toggles {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

.design-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: var(--wo-text-xs);
    color: var(--wo-text-tertiary);
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid var(--wo-border);
    margin: 0;
}

.design-toggle input[type="checkbox"] { display: none; }

.design-toggle.active,
.design-toggle:has(input:checked) {
    background: var(--wo-primary);
    color: #fff;
    border-color: var(--wo-primary);
}

/* Save Row */
.design-save-row {
    padding: 16px 0;
    display: flex;
}

/* Add Exercise */
.design-add-exercise {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding-top: 16px;
    border-top: 1px solid var(--wo-border);
}

.design-add-exercise form {
    flex-shrink: 0;
}

.design-search-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.design-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wo-text-tertiary);
    font-size: var(--wo-text-sm);
}

.design-search-input {
    width: 100%;
    padding-left: 36px;
}

.design-search-results {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--wo-surface);
    border-radius: 12px;
    box-shadow: var(--wo-shadow-lg);
    margin-bottom: 4px;
    max-height: 240px;
    overflow-y: auto;
}

.design-search-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: var(--wo-text-sm);
    transition: background 0.1s ease;
}

.design-search-item:hover {
    background: var(--wo-primary-light);
    color: var(--wo-primary);
}

.design-search-item:first-child { border-radius: 12px 12px 0 0; }
.design-search-item:last-child { border-radius: 0 0 12px 12px; }
.design-search-create { color: var(--wo-primary); font-weight: 500; }

/* Empty State */
.design-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

/* SortableJS ghost */
.sortable-ghost {
    opacity: 0.4;
}

/* ═══════════════════════════════════════
   Responsive: Mobile (<768px)
   ═══════════════════════════════════════ */

@media (max-width: 767.98px) {
    .design-container {
        flex-direction: column;
        gap: 16px;
        height: auto;
        min-height: calc(100vh - 180px); /* account for header + bottom nav */
    }

    .design-left {
        width: 100%;
        min-width: 0;
        padding-bottom: 8px;
    }

    .design-right {
        overflow-y: visible;
    }

    .design-meta-row {
        flex-direction: column;
        gap: 12px;
    }

    .design-config-toggles {
        margin-left: 0;
        margin-top: 4px;
    }
}

/* ═══════════════════════════════════════
   Responsive: Tablet (768-1199px)
   ═══════════════════════════════════════ */

@media (min-width: 768px) and (max-width: 1199.98px) {
    .design-left {
        width: 30%;
    }

    .design-exercise-config {
        flex-wrap: wrap;
    }

    .design-config-toggles {
        width: 100%;
        margin-left: 0;
        margin-top: 4px;
    }
}

/* ═══════════════════════════════════════
   Config Screen
   ═══════════════════════════════════════ */

/* Sub-tabs */
.config-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.config-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 9999px;
    font-family: var(--wo-font-body);
    font-size: var(--wo-text-sm);
    font-weight: 500;
    text-decoration: none;
    color: var(--wo-text-secondary);
    border: 1px solid var(--wo-border);
    transition: all 0.15s ease;
}

.config-tab:hover {
    color: var(--wo-primary);
    border-color: var(--wo-primary);
    background: var(--wo-primary-light);
}

.config-tab.active {
    background: var(--wo-primary);
    color: #fff;
    border-color: var(--wo-primary);
}

/* Two-panel layout */
.config-container {
    display: flex;
    gap: 24px;
    height: calc(100vh - 160px);
}

.config-left {
    width: 35%;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.config-right {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

/* Search */
.config-search-form {
    margin-bottom: 4px;
}

.config-search-wrap {
    position: relative;
}

.config-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wo-text-tertiary);
    font-size: var(--wo-text-sm);
    pointer-events: none;
}

.config-search-input {
    padding-left: 36px !important;
    font-size: var(--wo-text-sm);
}

/* Section header */
.config-section-header {
    padding: 4px 0;
}

/* Exercise list (left panel) */
.config-exercise-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.config-exercise-card {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.config-exercise-card:hover {
    background: var(--wo-primary-light);
    box-shadow: var(--wo-shadow-sm);
}

.config-exercise-card.selected {
    background: var(--wo-primary-muted);
    border-left: 4px solid var(--wo-primary);
}

.config-exercise-name {
    font-size: var(--wo-text-sm);
    font-weight: 600;
    color: var(--wo-text);
    margin-bottom: 2px;
}

.config-exercise-meta {
    font-size: var(--wo-text-xs);
    color: var(--wo-text-tertiary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.config-no-bodyparts {
    color: var(--wo-warning);
    font-style: italic;
}

/* Add exercise form */
.config-add-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--wo-border);
    margin-top: 8px;
}

/* Right panel */
.config-item-title {
    width: 100%;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: var(--wo-text-xl);
    padding: 4px 0;
    margin-bottom: 12px;
    color: var(--wo-text);
}

.config-item-title:focus {
    border: none;
    box-shadow: none;
    outline: none;
    border-bottom: 2px solid var(--wo-primary);
    border-radius: 0;
}

.config-field {
    margin-bottom: 20px;
}

.config-field .wo-label {
    display: block;
    margin-bottom: 8px;
}

/* Bodypart checkboxes grid */
.config-bodypart-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.config-bodypart-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    font-family: var(--wo-font-body);
    font-size: var(--wo-text-sm);
    font-weight: 400;
    cursor: pointer;
    border: 1px solid var(--wo-border);
    color: var(--wo-text-secondary);
    transition: all 0.15s ease;
    user-select: none;
}

.config-bodypart-check:hover {
    border-color: var(--wo-primary);
    color: var(--wo-primary);
}

.config-bodypart-check.active {
    background: var(--wo-primary);
    color: #fff;
    border-color: var(--wo-primary);
}

.config-bodypart-check input[type="checkbox"] {
    display: none;
}

/* Workout usage */
.config-usage-section {
    border-top: 1px solid var(--wo-border);
    padding-top: 20px;
}

.config-usage-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.config-usage-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--wo-text);
    border: 1px solid var(--wo-border);
    transition: all 0.15s ease;
}

.config-usage-link:hover {
    border-color: var(--wo-primary);
    background: var(--wo-primary-light);
}

.config-usage-workout {
    font-weight: 500;
    font-family: var(--wo-font-display);
}

.config-usage-program {
    font-size: var(--wo-text-xs);
    color: var(--wo-text-tertiary);
}

.config-usage-badge {
    margin-left: auto;
    font-size: var(--wo-text-xs);
    color: var(--wo-success);
    font-weight: 500;
}

/* Save / Delete rows */
.config-save-row {
    margin-bottom: 20px;
}

.config-delete-row {
    border-top: 1px solid var(--wo-border);
    padding-top: 16px;
    margin-top: 8px;
}

.config-delete-btn {
    color: var(--wo-text-tertiary) !important;
    font-size: var(--wo-text-sm);
}

.config-delete-btn:hover {
    color: var(--wo-danger) !important;
}

/* Empty state */
.config-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
}

/* ─── Bodyparts Tab ─── */

.config-bodypart-list {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-bodypart-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--wo-surface);
    border-radius: 12px;
    border: 1px solid var(--wo-border);
}

.config-bodypart-form {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-bodypart-name {
    flex: 1;
    font-size: var(--wo-text-base);
    font-weight: 600;
    border: none;
    background: transparent;
    padding: 4px 8px;
}

.config-bodypart-name:focus {
    outline: none;
    background: var(--wo-primary-light);
    border-radius: 8px;
}

.config-bodypart-count {
    font-size: var(--wo-text-xs);
    color: var(--wo-text-tertiary);
    white-space: nowrap;
}

.config-rename-btn {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.config-bodypart-row:focus-within .config-rename-btn,
.config-rename-btn.visible {
    opacity: 1;
}

.config-add-bodypart {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--wo-border);
    margin-top: 8px;
}

.config-add-bodypart .wo-input {
    flex: 1;
}

/* ─── Config Responsive: Mobile (<768px) ─── */

@media (max-width: 767.98px) {
    .config-container {
        flex-direction: column;
        height: auto;
    }

    .config-left {
        width: 100%;
        min-width: 0;
        max-height: none;
    }

    .config-exercise-list {
        max-height: 300px;
    }
}

/* ═══════════════════════════════════════
   Train Screen (Home)
   ═══════════════════════════════════════ */

.train-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.train-program-name {
    font-weight: 700;
    font-size: var(--wo-text-xl);
    color: var(--wo-text);
    margin: 0;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Filter Pills */
.train-filter-row {
    margin-bottom: 12px;
}

.train-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.train-pills-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.train-pills-scroll::-webkit-scrollbar {
    display: none;
}

.train-pills .wo-pill {
    cursor: pointer;
    border: 1.5px solid var(--wo-border);
    white-space: nowrap;
    flex-shrink: 0;
    padding: 6px 14px;
    min-height: 36px;
}

.train-pills .wo-pill.wo-pill-active {
    background: var(--wo-primary);
    color: #fff;
    border-color: var(--wo-primary);
}

.train-pills .wo-pill.wo-pill-inactive {
    background: var(--wo-surface);
    color: var(--wo-text-secondary);
}

.train-pills .wo-pill.wo-pill-inactive:hover {
    background: var(--wo-primary-light);
    color: var(--wo-primary);
    border-color: var(--wo-primary-light);
}

/* Bodypart pill two-line layout */
.train-pills .wo-pill {
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.pill-label {
    font-weight: 500;
}

.pill-sub {
    font-size: var(--wo-text-xs);
    opacity: 0.8;
}

/* Section Headers */
.train-section {
    margin-bottom: 20px;
}

.train-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 8px;
}

.train-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 9999px;
    background: var(--wo-warning);
    color: #fff;
    font-family: var(--wo-font-mono);
    font-size: var(--wo-text-xs);
    font-weight: 600;
}

/* Workout Cards */
.train-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--wo-surface);
    border-radius: 12px;
    box-shadow: var(--wo-shadow-sm);
    margin-bottom: 8px;
    min-height: 64px;
    transition: box-shadow 0.15s ease;
}

.train-card:hover {
    box-shadow: var(--wo-shadow-md);
}

.train-card-inprogress {
    border-left: 4px solid var(--wo-warning);
    padding-left: 12px;
}

.train-card-body {
    flex: 1;
    min-width: 0;
}

.train-card-name {
    font-weight: 600;
    font-size: var(--wo-text-base);
    color: var(--wo-text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.train-card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--wo-text-xs);
    color: var(--wo-text-tertiary);
    flex-wrap: wrap;
}

.train-card-meta i {
    font-size: 0.7rem;
}

.train-card-ago {
    color: var(--wo-text-tertiary);
}

.train-badge-inprogress {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 9999px;
    background: rgba(232, 168, 53, 0.15);
    color: #A87A10;
    font-size: var(--wo-text-xs);
    font-weight: 600;
    white-space: nowrap;
}

/* Hidden cards (filtered out by JS) */
.train-card[hidden] {
    display: none !important;
}

/* Empty / No-match States */
.train-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 300px;
    color: var(--wo-text-tertiary);
    text-align: center;
}

.train-empty i {
    color: var(--wo-border-strong);
}

.train-empty-hint {
    color: var(--wo-text-tertiary);
    font-size: var(--wo-text-sm);
    padding: 8px 0;
}

.train-no-match {
    text-align: center;
    color: var(--wo-text-tertiary);
    padding: 40px 16px;
}

/* ═══════════════════════════════════════
   Train: Desktop (wider cards)
   ═══════════════════════════════════════ */

@media (min-width: 768px) {
    .train-header {
        margin-bottom: 20px;
    }

    .train-program-name {
        font-size: var(--wo-text-2xl);
    }

    .train-card {
        max-width: 600px;
    }

    .train-card-name {
        font-size: var(--wo-text-lg);
    }

    .train-card-meta {
        font-size: var(--wo-text-sm);
    }
}

/* Train card links */
.train-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* ═══════════════════════════════════════
   Workout Session Screen
   ═══════════════════════════════════════ */

.session-container {
    max-width: 600px;
    margin: 0 auto;
}

/* Sticky Header */
.session-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 16px;
    background: var(--wo-surface);
    box-shadow: var(--wo-shadow-sm);
}

.session-header-left {
    flex: 1;
    min-width: 0;
}

.session-workout-name {
    font-weight: 600;
    font-size: var(--wo-text-base);
    color: var(--wo-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.session-timer {
    font-size: var(--wo-text-sm);
    color: var(--wo-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.session-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--wo-text-tertiary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.session-close-btn:hover {
    background: rgba(194, 24, 91, 0.08);
    color: var(--wo-danger);
}

/* Progress Bar */
.session-progress-track {
    width: 100%;
    height: 4px;
    background: var(--wo-primary-light);
}

.session-progress-fill {
    height: 100%;
    background: var(--wo-primary);
    transition: width 0.3s ease;
}

/* Exercise Tab Strip */
.session-tabs {
    position: sticky;
    top: 52px;
    z-index: 40;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--wo-surface);
    border-bottom: 1px solid var(--wo-border);
}

.session-tabs::-webkit-scrollbar {
    display: none;
}

.session-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 80px;
    padding: 6px 12px;
    border: 1.5px solid var(--wo-border);
    border-radius: 12px;
    background: var(--wo-surface);
    color: var(--wo-text-secondary);
    font-family: var(--wo-font-body);
    font-size: var(--wo-text-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.session-tab:active {
    transform: scale(0.95);
}

.session-tab.complete {
    background: var(--wo-primary-light);
    border-color: var(--wo-primary-light);
    color: var(--wo-primary);
}

.session-tab-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

.session-tab-dots {
    display: flex;
    gap: 3px;
}

.session-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    opacity: 0.5;
}

.session-dot.filled {
    background: currentColor;
    opacity: 1;
}

/* Stacked Exercise Cards */
.session-card {
    background: var(--wo-surface);
    border-radius: 12px;
    box-shadow: var(--wo-shadow-sm);
    margin: 8px 16px;
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}

.session-card.expanded {
    box-shadow: var(--wo-shadow-md);
}

.session-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.session-card-header-left {
    text-align: center;
}

.session-card-name {
    font-weight: 600;
    font-size: var(--wo-text-base);
    color: var(--wo-text);
    margin: 0;
}

.session-card-summary {
    font-size: var(--wo-text-sm);
    color: var(--wo-text-secondary);
    display: block;
    margin-top: 2px;
}

.session-card-header-right {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
}

.session-card-prev {
    font-family: var(--wo-font-body);
    font-size: var(--wo-text-xs);
    color: var(--wo-text-tertiary);
    white-space: nowrap;
    display: none;
}

.session-card.expanded .session-card-prev {
    display: inline;
}

.session-card-chevron {
    font-size: var(--wo-text-sm);
    color: var(--wo-text-tertiary);
    transition: transform 0.2s ease;
}

.session-card.expanded .session-card-chevron {
    transform: rotate(180deg);
}

.session-modifier-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 9999px;
    background: var(--wo-primary-light);
    color: var(--wo-primary);
    font-size: var(--wo-text-xs);
    font-weight: 600;
    margin-top: 4px;
}

/* Expandable body */
.session-card-body {
    display: none;
    padding: 0 16px 16px;
}

.session-card.expanded .session-card-body {
    display: block;
}

/* Set buttons in card context */
.session-card .session-set-buttons {
    padding: 0 16px 12px;
}

/* Compact set buttons (smaller) */
.session-card:not(.expanded) .session-set-btn {
    width: 40px;
    height: 40px;
    font-size: var(--wo-text-sm);
    border-radius: 10px;
}

/* Compact dropset button */
.session-card:not(.expanded) .session-dropset-btn {
    font-size: var(--wo-text-sm);
    padding: 8px 14px;
}

.session-card:not(.expanded) .session-dropset-check {
    width: 22px;
    height: 22px;
}

/* Input Card */
.session-input-card {
    margin-bottom: 20px;
}

.session-input-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 8px 0;
}

.session-input-row-secondary {
    border-top: 1px solid var(--wo-border);
    margin-top: 8px;
    padding-top: 12px;
}

.session-input-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.session-input-label {
    font-family: var(--wo-font-body);
    font-size: var(--wo-text-xs);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wo-text-tertiary);
}

.session-input-lg {
    width: 120px;
    font-size: 24px !important;
    padding: 8px;
}

.session-sets-display {
    font-size: 24px;
    color: var(--wo-text);
    padding: 8px;
    min-width: 80px;
    text-align: center;
}

.session-sets-current {
    color: var(--wo-primary);
    font-weight: 600;
}

/* Set Buttons */
.session-set-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.session-set-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: 2px solid var(--wo-border);
    border-radius: 12px;
    background: var(--wo-surface);
    color: var(--wo-text-tertiary);
    font-family: var(--wo-font-mono);
    font-size: var(--wo-text-lg);
    cursor: pointer;
    transition: all 0.15s ease;
}

.session-set-btn:active {
    transform: scale(0.95);
}

.session-set-btn.done {
    background: var(--wo-primary);
    border-color: var(--wo-primary);
    color: #fff;
}

/* Dropset Button */
.session-dropset-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border: 2px solid var(--wo-border);
    border-radius: 12px;
    background: var(--wo-surface);
    color: var(--wo-text-secondary);
    font-family: var(--wo-font-body);
    font-size: var(--wo-text-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.session-dropset-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px solid var(--wo-border);
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.session-dropset-btn.done {
    border-color: var(--wo-primary);
    color: var(--wo-primary);
}

.session-dropset-btn.done .session-dropset-check {
    background: var(--wo-primary);
    border-color: var(--wo-primary);
    color: #fff;
}

.session-dropset-btn:active {
    transform: scale(0.97);
}

/* Difficulty */
.session-difficulty {
    display: flex;
    border: 1.5px solid var(--wo-border);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 20px;
}

.session-diff-btn {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: transparent;
    color: var(--wo-text-secondary);
    font-family: var(--wo-font-body);
    font-size: var(--wo-text-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.session-diff-btn:not(:last-child) {
    border-right: 1.5px solid var(--wo-border);
}

.session-diff-btn.active {
    background: var(--wo-primary);
    color: #fff;
}

.session-diff-btn:hover:not(.active) {
    background: var(--wo-primary-light);
}

/* Notes */
.session-notes-section {
    margin-bottom: 20px;
}

.session-notes-input {
    width: 100%;
    min-height: 60px;
    resize: vertical;
    margin-top: 4px;
}

/* Footer */
.session-footer {
    padding: 20px 16px 40px;
    text-align: center;
}

.session-finish-btn {
    width: 100%;
    min-height: 52px;
    font-size: var(--wo-text-base) !important;
    letter-spacing: 0.04em;
    margin-bottom: 16px;
}

.session-abandon-link {
    border: none;
    background: transparent;
    color: var(--wo-danger);
    font-size: var(--wo-text-sm);
    cursor: pointer;
    padding: 8px;
}

.session-abandon-link:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════
   Session: Rest Timer
   ═══════════════════════════════════════ */

.rest-timer {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    animation: rest-timer-in 0.3s ease;
}

@keyframes rest-timer-in {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.rest-timer-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 10px 12px;
    background: var(--wo-surface);
    border-radius: 9999px;
    box-shadow: var(--wo-shadow-lg);
    border: 1.5px solid var(--wo-border);
}

.rest-timer-ring {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    transform: rotate(-90deg);
}

.rest-timer-ring-track {
    fill: none;
    stroke: var(--wo-primary-light);
    stroke-width: 4;
}

.rest-timer-ring-fill {
    fill: none;
    stroke: var(--wo-primary);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 125.66;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.rest-timer-text {
    font-size: var(--wo-text-lg);
    color: var(--wo-text);
    min-width: 40px;
    text-align: center;
}

.rest-timer-dismiss {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--wo-text-tertiary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.rest-timer-dismiss:hover {
    background: var(--wo-primary-light);
    color: var(--wo-primary);
}

.rest-timer.complete .rest-timer-ring-fill {
    stroke: var(--wo-success);
}

.rest-timer.complete .rest-timer-text {
    color: var(--wo-success);
    font-weight: 700;
}

/* ═══════════════════════════════════════
   Session: Desktop (centered, wider inputs)
   ═══════════════════════════════════════ */

/* Scroll padding for sticky header + pill strip */
html:has(.session-container) {
    scroll-padding-top: 130px;
}

@media (min-width: 768px) {
    .session-card-name {
        font-size: var(--wo-text-lg);
    }

    .session-input-row {
        gap: 40px;
    }
}

/* ═══════════════════════════════════════
   Login / User Select Screen
   ═══════════════════════════════════════ */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 32px 24px;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-header .wo-nav-brand {
    font-size: var(--wo-text-2xl);
    display: block;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--wo-text-secondary);
    font-size: var(--wo-text-sm);
    margin: 0;
}

.login-users {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-user-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--wo-border);
    border-radius: 12px;
    background: var(--wo-surface);
    cursor: pointer;
    transition: all 0.15s ease;
}

.login-user-btn:hover {
    border-color: var(--wo-primary);
    background: var(--wo-primary-light);
}

.login-user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--wo-primary);
    color: #fff;
    font-weight: 700;
    font-size: var(--wo-text-lg);
    flex-shrink: 0;
}

.login-user-name {
    flex: 1;
    text-align: left;
    font-weight: 500;
    color: var(--wo-text);
}

.login-user-arrow {
    color: var(--wo-text-tertiary);
    font-size: var(--wo-text-sm);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--wo-text-tertiary);
    font-size: var(--wo-text-sm);
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--wo-border);
}

.login-create-row {
    display: flex;
    gap: 8px;
}

.login-create-input {
    flex: 1;
}

.login-create-btn {
    min-height: 42px;
    padding: 8px 20px;
}
