#mrt-workout-form-preview {
    width: 100%;
    margin: 0 auto 20px;
}

/* Section label */
#mrt-workout-form-preview .mrt-form-section-label-wrapper {
    margin-bottom: 10px;
}

#mrt-workout-form-preview .mrt-form-section-label {
    color: #6c757d;
    font-weight: 500;
    display: block;
}

/* Exercise Type Toggle */
#mrt-workout-form-preview .mrt-exercise-type-toggle {
    position: relative;
    display: flex;
    background: #edf2f7;
    border-radius: 18px;
    padding: 3px;
    border: 1px solid var(--mrt-border-light, #cbd5e0);
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    height: 44px;
    align-items: center;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
}

#mrt-workout-form-preview .mrt-exercise-type-toggle input[type="radio"] {
    display: none;
}

#mrt-workout-form-preview .mrt-toggle-option {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
    font-size: 12px;
    color: #64748b;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
}

#mrt-workout-form-preview
    .mrt-exercise-type-toggle
    input[type="radio"]:checked
    + label {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#mrt-workout-form-preview .mrt-toggle-slider {
    position: absolute;
    height: calc(100% - 6px);
    width: calc(50% - 3px);
    border-radius: 15px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(135deg, #4f33ff 0%, #3b1fe0 100%);
    box-shadow: none;
    z-index: 1;
    left: 3px;
}

#mrt-showcase-type-weighted:checked ~ .mrt-toggle-slider {
    transform: translateX(0);
}

#mrt-showcase-type-calisthenics:checked ~ .mrt-toggle-slider {
    transform: translateX(100%);
}

#mrt-workout-form-preview .mrt-toggle-option:active {
    transform: scale(0.97);
}

#mrt-workout-form-preview .mrt-toggle-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    margin-left: 6px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    line-height: 1;
    vertical-align: middle;
}

#mrt-workout-form-preview
    input[type="radio"]:checked
    + .mrt-toggle-option
    .mrt-toggle-count {
    background: rgba(255, 255, 255, 0.25);
}

/* Toggle Dark Mode */
html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-exercise-type-toggle {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--maxreptracker-dark-border) !important;
}

html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-toggle-count {
    background: rgba(255, 255, 255, 0.12);
}

html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    input[type="radio"]:checked
    + .mrt-toggle-option
    .mrt-toggle-count {
    background: rgba(255, 255, 255, 0.25);
}

/* Category Buttons */
#mrt-workout-form-preview .mrt-category-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    margin-bottom: 20px;
    width: 100%;
}

#mrt-workout-form-preview .mrt-colored-category-btn {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b !important;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    text-transform: capitalize;
    letter-spacing: normal;
    min-width: 80px;
    backdrop-filter: none;
}

#mrt-workout-form-preview .mrt-colored-category-btn:hover {
    background-color: #f1f5f9;
    color: #1e293b !important;
    transform: translateY(-1px);
    box-shadow: none;
}

#mrt-workout-form-preview .mrt-colored-category-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

#mrt-workout-form-preview .mrt-colored-category-btn.active {
    color: white !important;
    box-shadow: none;
    border-color: transparent !important;
    transform: none;
    z-index: 1;
}

#mrt-workout-form-preview .mrt-colored-category-btn.mrt-btn-blue.active {
    background-color: #3182ce !important;
    border-color: #3182ce !important;
    color: white !important;
}

#mrt-workout-form-preview .mrt-colored-category-btn.mrt-btn-green.active {
    background-color: #38a169 !important;
    border-color: #38a169 !important;
    color: white !important;
}

#mrt-workout-form-preview .mrt-colored-category-btn.mrt-btn-orange.active {
    background-color: #dd6b20 !important;
    border-color: #dd6b20 !important;
    color: white !important;
}

#mrt-workout-form-preview .mrt-colored-category-btn.active:hover {
    filter: brightness(1.1);
    opacity: 1;
}

/* Category Buttons Dark Mode */
html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-colored-category-btn {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #cbd5e0 !important;
}

html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-colored-category-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white !important;
}

/* Muscle Group Filter Pills */
#mrt-workout-form-preview .mrt-mg-filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    margin-bottom: 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    padding-bottom: 4px;
}

#mrt-workout-form-preview .mrt-mg-filters::-webkit-scrollbar {
    display: none;
}

#mrt-workout-form-preview .mrt-mg-filters.mrt-filter-scrolling {
    cursor: grabbing;
    user-select: none;
}

#mrt-workout-form-preview .mrt-filter-pill {
    background-color: #edf2f7;
    border: 1px solid #cbd5e0;
    color: #4a5568;
    padding: 8px 15px;
    border-radius: var(--mrt-radius, 18px);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    flex: 0 0 auto;
    white-space: nowrap;
}

#mrt-workout-form-preview .mrt-filter-pill:hover {
    background-color: var(--mrt-primary, #4f33ff);
    color: white;
    border-color: var(--mrt-primary, #4f33ff);
}

#mrt-workout-form-preview .mrt-filter-pill.active {
    background-color: var(--mrt-primary, #4f33ff);
    color: white;
    border-color: var(--mrt-primary, #4f33ff);
    box-shadow: none;
}

/* Filter Pills Dark Mode (idle handled by dark-mode plugin; keep active/hover primary) */
html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-filter-pill:hover,
html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-filter-pill.active {
    background: #4f33ff !important;
    color: white !important;
    border-color: #4f33ff !important;
}

/* Empty State */
#mrt-workout-form-preview .mrt-showcase-no-results {
    text-align: center;
    padding: 32px 20px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 400;
    font-style: italic;
    grid-column: 1 / -1;
    align-self: center;
}

html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-showcase-no-results {
    color: #64748b;
}

/* Exercise Grids */
#mrt-workout-form-preview .mrt-existing-exercises-grid {
    transition: opacity 0.3s ease;
}

#mrt-workout-form-preview .mrt-grid-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    min-height: 100px;
    align-content: start;
}

/* Existing Exercise Buttons */
#mrt-workout-form-preview .mrt-existing-exercise-btn,
#mrt-workout-form-preview .mrt-exercise-tile-style {
    color: #2d3748 !important;
    background: #e9ecef;
    border: 1px solid #ced4da;
    padding: 10px;
    border-radius: 18px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    display: block;
    width: 100%;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

#mrt-workout-form-preview .mrt-existing-exercise-btn:hover {
    background-color: #cee1f9;
    transform: translateY(-1px);
    box-shadow: none;
}

#mrt-workout-form-preview .mrt-existing-exercise-btn:active {
    background-color: #cbd5e0;
    transform: translateY(0);
    box-shadow: none;
    outline: 1px solid #4a4181;
    outline-offset: 1px;
}

#mrt-workout-form-preview .mrt-existing-exercise-btn:focus {
    outline: none;
    box-shadow: none;
}

#mrt-workout-form-preview
    .mrt-existing-exercise-btn:focus:not(:active):not(:hover) {
    background-color: #edf2f7 !important;
}

#mrt-workout-form-preview .mrt-existing-exercise-btn.active,
#mrt-workout-form-preview .mrt-existing-exercise-btn.selected {
    box-shadow: none;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

#mrt-workout-form-preview .mrt-existing-exercise-btn.active::before,
#mrt-workout-form-preview .mrt-existing-exercise-btn.selected::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-top: 8px solid #a0aec0;
    border-left: 8px solid transparent;
}

#mrt-workout-form-preview .mrt-existing-exercise-btn.active::after,
#mrt-workout-form-preview .mrt-existing-exercise-btn.selected::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-bottom: 8px solid #a0aec0;
    border-right: 8px solid transparent;
}

#mrt-workout-form-preview .mrt-existing-exercise-btn .exercise-name {
    display: block;
    margin-bottom: 4px;
    line-height: 1.2;
    text-align: center;
}

#mrt-workout-form-preview .mrt-existing-exercise-btn .exercise-data {
    display: block;
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

#mrt-workout-form-preview .mrt-existing-exercise-btn .exercise-data-reps {
    color: #3182ce;
    font-weight: 600;
}

#mrt-workout-form-preview .mrt-existing-exercise-btn .exercise-data-weight {
    color: #dd6b20;
    font-weight: 600;
}

/* Exercise Buttons Dark Mode */
html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-existing-exercise-btn {
    color: #e2e8f0 !important;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1) !important;
}

html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-existing-exercise-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-existing-exercise-btn:focus:not(:active):not(:hover) {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-existing-exercise-btn
    .exercise-data {
    color: #94a3b8;
}

html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-existing-exercise-btn
    .exercise-data-reps {
    color: #60a5fa;
}

html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-existing-exercise-btn
    .exercise-data-weight {
    color: #fb923c;
}

/* Exercise Name Display */
#mrt-workout-form-preview .mrt-exercise-name-display {
    background: #faf9f6;
    font-family: "Merriweather", "Georgia", serif;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
    border: none;
    padding: 25px 16px;
    border-radius: 18px;
    box-shadow: none;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    margin-bottom: 20px;
    margin-top: 20px;
    transition: all 0.2s ease;
    border-left: 4px solid #94a3b8 !important;
    border-right: 4px solid #94a3b8 !important;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mrt-workout-form-preview
    .mrt-exercise-name-display
    .exercise-name-placeholder {
    color: #a0aec0;
    font-weight: 400;
    font-style: italic;
}

/* Name Display Dark Mode */
html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-exercise-name-display {
    background: rgba(255, 255, 255, 0.03);
    box-shadow: none;
    color: #e2e8f0;
    border-left-color: #64748b !important;
    border-right-color: #64748b !important;
}

/* Phase border colors (matching core --mrt-strength / --mrt-hypertrophy / --mrt-endurance) */
#mrt-workout-form-preview .mrt-exercise-name-display.phase-strength {
    border-left-color: #10b981 !important;
    border-right-color: #10b981 !important;
}

#mrt-workout-form-preview .mrt-exercise-name-display.phase-hypertrophy {
    border-left-color: #3b82f6 !important;
    border-right-color: #3b82f6 !important;
}

#mrt-workout-form-preview .mrt-exercise-name-display.phase-endurance {
    border-left-color: #ef44d2 !important;
    border-right-color: #ef44d2 !important;
}

/* Dark mode phase overrides — higher specificity to beat html.maxreptracker-dark-mode-enabled .mrt-exercise-name-display rule */
html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-exercise-name-display.phase-strength {
    border-left-color: #10b981 !important;
    border-right-color: #10b981 !important;
}

html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-exercise-name-display.phase-hypertrophy {
    border-left-color: #3b82f6 !important;
    border-right-color: #3b82f6 !important;
}

html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-exercise-name-display.phase-endurance {
    border-left-color: #ef44d2 !important;
    border-right-color: #ef44d2 !important;
}

/* Responsive */
@media (max-width: 600px) {
    #mrt-workout-form-preview .mrt-exercise-type-toggle {
        margin-bottom: 16px;
    }

    #mrt-workout-form-preview .mrt-grid-wrapper {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    #mrt-workout-form-preview .mrt-category-buttons {
        gap: 8px;
        margin-top: 16px;
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    #mrt-workout-form-preview .mrt-grid-wrapper {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    #mrt-workout-form-preview .mrt-existing-exercise-btn {
        padding: 10px 8px;
        font-size: 13px;
    }

    #mrt-workout-form-preview .mrt-colored-category-btn {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 70px;
    }
}

@media (max-width: 380px) {
    #mrt-workout-form-preview .mrt-grid-wrapper {
        grid-template-columns: 1fr;
    }
}

/* ── Clear Button ─────────────────────────────────────────────── */

#mrt-workout-form-preview .mrt-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: fit-content;
    min-height: 44px;
    padding: 8px 16px;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    background: #ffffff;
    color: #718096;
    border: 1px solid #e2e8f0;
    box-shadow: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    outline: none !important;
    line-height: 1.2;
    margin: 12px auto 12px;
}

#mrt-workout-form-preview .mrt-clear-btn svg {
    flex-shrink: 0;
}

#mrt-workout-form-preview .mrt-clear-btn:hover {
    color: #2d3748 !important;
    border-color: #cbd5e0 !important;
    background: #f7fafc !important;
    box-shadow: none !important;
}

#mrt-workout-form-preview .mrt-clear-btn:active {
    transform: translateY(0) scale(0.96) !important;
    box-shadow: none !important;
    background: #edf2f7 !important;
}

html.maxreptracker-dark-mode-enabled #mrt-workout-form-preview .mrt-clear-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    color: #94a3b8;
}

html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-clear-btn:hover {
    color: #cbd5e0 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

html.maxreptracker-dark-mode-enabled
    #mrt-workout-form-preview
    .mrt-clear-btn:active {
    background: rgba(255, 255, 255, 0.05) !important;
}
