/* ================================================
   Project Overload — Clean Theme
   ================================================ */

/* --- Design Tokens --- */
:root {
    --color-primary:       #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #eff6ff;
    --color-success:       #059669;
    --color-warning:       #d97706;
    --color-danger:        #dc2626;
    --color-info:          #0284c7;

    --sidebar-bg:          #1e293b;
    --sidebar-width:       256px;
    --sidebar-text:        rgba(255, 255, 255, 0.6);
    --sidebar-text-hover:  #ffffff;
    --sidebar-active-bg:   rgba(255, 255, 255, 0.1);
    --sidebar-active-text: #ffffff;
    --sidebar-border:      rgba(255, 255, 255, 0.07);

    --page-bg:       #f1f5f9;
    --card-bg:       #ffffff;
    --card-border:   #e2e8f0;
    --card-shadow:   0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.1);

    --text-base:    #0f172a;
    --text-muted:   #64748b;
    --text-label:   #475569;
    --border-color: #e2e8f0;

    --radius-sm: 0.5rem;
    --radius-md: 0.625rem;
    --radius-lg: 0.875rem;

    /* Bootstrap overrides */
    --bs-primary:        #2563eb;
    --bs-primary-rgb:    37, 99, 235;
    --bs-success:        #059669;
    --bs-success-rgb:    5, 150, 105;
    --bs-warning:        #d97706;
    --bs-warning-rgb:    217, 119, 6;
    --bs-danger:         #dc2626;
    --bs-danger-rgb:     220, 38, 38;
    --bs-info:           #0284c7;
    --bs-info-rgb:       2, 132, 199;
    --bs-body-bg:        var(--page-bg);
    --bs-body-color:     var(--text-base);
    --bs-border-color:   var(--border-color);
    --bs-secondary:      #64748b;
    --bs-secondary-rgb:  100, 116, 139;
}

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }

body.app-shell {
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
    background: var(--page-bg);
    color: var(--text-base);
    overflow-x: hidden;
    display: flex;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--color-primary);
}
a:hover {
    color: var(--color-primary-hover);
}

/* --- Sidebar --- */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1030;
    overflow-y: auto;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.app-sidebar__brand {
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.app-sidebar__logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: #ffffff;
    text-decoration: none;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.app-sidebar__logo i {
    color: #60a5fa;
    font-size: 1rem;
}

.app-sidebar__logo:hover { color: #ffffff; }

.app-sidebar__nav {
    flex: 1;
    padding: 0.875rem 0.75rem;
    overflow-y: auto;
}

.app-sidebar__section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    padding: 0.5rem 0.625rem 0.25rem;
    margin-top: 0.5rem;
}

.app-sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.675rem;
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.13s ease, color 0.13s ease;
    margin-bottom: 0.125rem;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.app-sidebar__link i {
    width: 1rem;
    text-align: center;
    font-size: 0.875rem;
    flex-shrink: 0;
    opacity: 0.8;
}

.app-sidebar__link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--sidebar-text-hover);
}

.app-sidebar__link:hover i { opacity: 1; }

.app-sidebar__link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.app-sidebar__link.active i {
    color: #60a5fa;
    opacity: 1;
}

.app-sidebar__divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 0.625rem 0.75rem;
}

.app-sidebar__footer {
    padding: 0.75rem;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

/* --- Sidebar overlay (mobile) --- */
.app-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1029;
    backdrop-filter: blur(2px);
}

.app-sidebar-overlay.is-visible {
    display: block;
}

/* --- Content wrapper --- */
.app-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-content.has-sidebar {
    margin-left: var(--sidebar-width);
}

/* --- Mobile topbar --- */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: 3.25rem;
    background: var(--sidebar-bg);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.app-topbar__toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 1rem;
    padding: 0.35rem 0.45rem;
    cursor: pointer;
    border-radius: 0.375rem;
    line-height: 1;
    transition: background 0.13s, color 0.13s;
}

.app-topbar__toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.app-topbar__brand {
    color: #ffffff;
    text-decoration: none;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 0.9375rem;
}

.app-topbar__brand:hover { color: #ffffff; }

/* --- Public navbar (unauthenticated pages) --- */
.app-navbar {
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--sidebar-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.app-navbar .navbar-brand {
    color: #ffffff;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 1rem;
}

.app-navbar .navbar-brand:hover { color: #ffffff; }

.app-navbar .navbar-nav .nav-link {
    color: var(--sidebar-text);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.7rem;
    font-size: 0.875rem;
    transition: background 0.13s, color 0.13s;
}

.app-navbar .navbar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.app-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.2);
}

/* --- Main content area --- */
.app-main {
    flex: 1;
    padding-top: 1.75rem;
    padding-bottom: 2.5rem;
    animation: page-enter 0.22s ease-out;
}

@keyframes page-enter {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Footer --- */
.app-footer {
    background: transparent;
    border-top: 1px solid var(--border-color);
    padding: 0.875rem 0;
}

.app-footer .text-muted {
    color: var(--text-muted) !important;
    font-size: 0.8125rem;
}

/* --- Page header --- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.page-header > div:first-child {
    min-width: 0;
    flex: 1 1 280px;
}

.page-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.page-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.page-actions form { margin: 0; }

/* --- Cards --- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--card-border);
    padding: 0.875rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

.card .text-muted { color: var(--text-muted) !important; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.45rem 1rem;
    letter-spacing: 0.01em;
    border: 1.5px solid transparent;
    transition: background-color 0.13s ease, border-color 0.13s ease,
                box-shadow 0.13s ease, transform 0.13s ease;
    box-shadow: none;
}

.btn:hover { transform: translateY(-1px); }

.btn-sm {
    font-size: 0.8rem;
    padding: 0.275rem 0.7rem;
}

.btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    color: #fff;
}

.btn-secondary {
    background: #fff;
    border-color: var(--border-color);
    color: var(--text-label);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text-base);
}

.btn-success {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #fff;
    box-shadow: 0 1px 3px rgba(5, 150, 105, 0.28);
}

.btn-success:hover {
    background: #047857;
    border-color: #047857;
    color: #fff;
}

.btn-danger {
    background: var(--color-danger);
    border-color: var(--color-danger);
    color: #fff;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.28);
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

.btn-info {
    background: var(--color-info);
    border-color: var(--color-info);
    color: #fff;
}

.btn-outline-secondary {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-muted);
}

.btn-outline-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--text-base);
}

.btn-outline-secondary.active,
.btn-outline-secondary:active {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: #fff !important;
}

.btn-outline-danger {
    background: transparent;
    border-color: #fca5a5;
    color: var(--color-danger);
}

.btn-outline-danger:hover {
    background: #fef2f2;
    border-color: var(--color-danger);
    color: var(--color-danger);
}

/* --- Forms --- */
.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-label);
    margin-bottom: 0.3rem;
}

.form-control,
.form-select {
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-base);
    font-size: 0.9rem;
    transition: border-color 0.13s ease, box-shadow 0.13s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

.form-check-input {
    border-color: #cbd5e1;
}

.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    border-color: #93c5fd;
}

/* --- Tables --- */
.table-responsive {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #fff;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-base);
    --bs-table-hover-bg: #f8fafc;
    --bs-table-border-color: var(--border-color);
}

.table thead th {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 0.625rem 0.875rem;
}

.table > :not(caption) > * > * {
    padding: 0.75rem 0.875rem;
    vertical-align: middle;
}

/* --- Badges --- */
.badge {
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3em 0.65em;
    letter-spacing: 0.02em;
}

.badge.bg-light {
    color: var(--text-label);
    background: #f1f5f9 !important;
    border: 1px solid var(--border-color);
}

/* --- Alerts --- */
.alert {
    border-radius: var(--radius-md);
    border-width: 1px;
    font-size: 0.9rem;
    box-shadow: none;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-danger, .alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.alert-primary {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* --- List groups --- */
.list-group-item {
    border-color: var(--border-color);
    color: var(--text-base);
    background: transparent;
}

.list-group-item-action:hover,
.list-group-item-action:focus {
    background: #f8fafc;
    color: var(--text-base);
}

/* --- Modals --- */
.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom-color: var(--border-color);
    padding: 1rem 1.25rem;
}

.modal-footer {
    border-top-color: var(--border-color);
    padding: 0.875rem 1.25rem;
}

/* --- Pagination --- */
.pagination { gap: 0.15rem; }

.pagination .page-link {
    border-radius: var(--radius-sm);
    color: var(--text-label);
    border-color: var(--border-color);
    font-size: 0.875rem;
}

.pagination .page-link:hover {
    color: var(--color-primary);
    background: var(--color-primary-light);
    border-color: #bfdbfe;
}

.pagination .active > .page-link {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.pagination .disabled > .page-link {
    color: #94a3b8;
    background: #f8fafc;
}

/* --- Text utilities --- */
.text-muted { color: var(--text-muted) !important; }

/* --- Workout Builder --- */
.workout-builder__available,
.workout-builder__selected {
    max-height: 22rem;
    overflow-y: auto;
}

.workout-builder .list-group-item { background: #fff; }
.workout-builder__option.is-selected { opacity: 0.55; }
.workout-builder__order { display: inline-block; min-width: 1.6rem; color: var(--text-muted); }
.workout-builder__selected-item .btn-group .btn { min-width: 2rem; }

/* --- Workout Runner --- */
.workout-runner .workout-exercise-card .card-body { padding: 1rem 1.25rem 0.85rem; }
.workout-runner .card-title { font-size: 1rem; }

.workout-runner .input-group-text {
    min-width: 5.5rem;
    justify-content: center;
    font-weight: 600;
    font-size: 0.84rem;
    background: #f8fafc;
    border-color: var(--border-color);
}

.workout-runner .set-input {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.workout-runner .set-input.active-rep-input {
    border-color: #93c5fd;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.workout-runner .workout-status { margin-bottom: 0.85rem; }

.workout-runner .plate-config {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    padding: 0.75rem;
}

.workout-runner .plate-config p:last-child,
.workout-runner .plate-config .small > div:last-child {
    margin-bottom: 0;
}

.workout-actions {
    position: sticky;
    bottom: 0.75rem;
    z-index: 1020;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 0.9rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.workout-runner .workout-form { padding-bottom: 7rem; }
.workout-actions__prompt { flex: 1 1 270px; min-width: 210px; }
.workout-actions__prompt .fw-semibold { line-height: 1.3; }

.workout-actions__progress {
    width: 100%;
    height: 0.375rem;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.workout-actions__progress-fill {
    height: 100%;
    width: 0%;
    background: var(--color-primary);
    transition: width 0.22s ease;
}

.workout-actions__rep-controls,
.workout-actions__submit {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.workout-actions__rep-controls .btn { min-width: 7rem; }

.workout-actions__session {
    flex: 0 1 13.5rem;
    min-width: 12rem;
    margin-left: auto;
}

.workout-actions__session summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: 999px;
    background: #f8fafc;
    color: var(--text-label);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.13s, border-color 0.13s, color 0.13s;
}

.workout-actions__session summary::-webkit-details-marker { display: none; }

.workout-actions__session[open] summary {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1e40af;
}

.workout-actions__session .workout-actions__submit { justify-content: flex-end; }
.workout-actions form { margin: 0; }
.workout-runner-v2 { max-width: 940px; margin: 0 auto; }

/* --- Coach Cards --- */
.coach-workout-form { margin-bottom: 1rem; }
.coach-card .card-body { padding: 1.05rem 1.25rem 1.15rem; }

.coach-card__header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.7rem 1rem;
}

.coach-card__kicker {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.22rem;
}

.coach-card__target {
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: #f8fafc;
    padding: 0.625rem 0.75rem;
    color: var(--text-label);
    font-size: 0.89rem;
    font-weight: 600;
}

.coach-inline-alert { margin-bottom: 0; }

.coach-stage {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    padding: 0.875rem;
}

.coach-stage__actions { display: flex; align-items: center; gap: 0.5rem; }
.coach-stage__actions .btn { width: 100%; }
.coach-stage__quick { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.coach-set-label {
    font-weight: 700;
    color: var(--text-label);
    margin-bottom: 0.42rem;
}

.coach-rest__time {
    font-size: 2rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
}

.coach-plate-preview {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.75rem;
    background: var(--color-primary-light);
}

.coach-session-card .card-body { padding-top: 0.88rem; }

.coach-log-exercise {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    background: #fff;
}

.coach-log-exercise + .coach-log-exercise { margin-top: 0.75rem; }

.coach-log-exercise.is-active {
    border-color: #93c5fd;
    background: #eff6ff;
}

.coach-log-exercise__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.55rem;
}

.coach-log-exercise__title {
    font-weight: 700;
    color: var(--text-base);
}

.coach-log-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.625rem;
}

.coach-log-pill {
    border: 1.5px solid var(--border-color);
    border-radius: 999px;
    background: #f8fafc;
    color: var(--text-label);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.coach-log-pill.is-pending { opacity: 0.8; }
.coach-log-pill.is-hit    { border-color: #6ee7b7; background: #f0fdf4; color: #065f46; }
.coach-log-pill.is-above  { border-color: #93c5fd; background: #eff6ff; color: #1e40af; }
.coach-log-pill.is-below  { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.coach-log-pill.is-active { border-color: #93c5fd; background: #dbeafe; color: #1e3a8a; }

.coach-cancel-form { margin-bottom: 0.35rem; }

/* --- Filter groups --- */
.filter-group .btn { font-size: 0.8125rem; }

/* --- Code --- */
pre, code { border-radius: var(--radius-sm); }

/* --- Focus skip link --- */
.visually-hidden-focusable:focus {
    z-index: 1081;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* ======================
   Responsive
   ====================== */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width)));
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .app-content.has-sidebar {
        margin-left: 0;
    }

    .app-main {
        padding-top: 1.25rem;
        padding-bottom: 2rem;
    }
}

@media (max-width: 767.98px) {
    .page-header { align-items: stretch; }
    .page-header > div:first-child { flex-basis: 100%; }

    .page-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    .page-actions > .btn,
    .page-actions > a.btn,
    .page-actions > button.btn,
    .page-actions > form,
    .page-actions > .btn-group { width: 100%; }

    .page-actions > form .btn { width: 100%; }

    .page-actions > .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.45rem;
    }

    .page-actions > .btn-group .btn { width: 100%; }

    .filter-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        width: 100%;
    }

    .filter-group .btn {
        flex: 1 1 calc(50% - 0.35rem);
        min-width: 100px;
    }

    .filter-group.btn-group > .btn,
    .filter-group.btn-group > .btn-group {
        margin-left: 0;
        border-radius: 999px !important;
    }

    .filter-group.filter-group-compact .btn {
        flex: 1 1 calc(33.333% - 0.35rem);
        min-width: 88px;
    }

    .workout-runner-v2 { max-width: 100%; }
    .coach-card .card-body { padding: 0.9rem 1rem 0.95rem; }

    .coach-card__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.52rem;
    }

    .coach-card__target,
    .coach-stage { padding: 0.75rem; }

    .coach-rest__time { font-size: 1.75rem; }

    .coach-stage__quick {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
    }

    .coach-stage__quick .btn { width: 100%; }
    #coachLogZeroBtn { grid-column: 1 / -1; }

    .coach-stage__actions .btn,
    .coach-cancel-form .btn { min-height: 2.8rem; }

    .coach-log-exercise { padding: 0.625rem; }

    .coach-log-exercise__head {
        flex-direction: column;
        align-items: stretch;
    }

    .coach-log-exercise__head .btn { width: 100%; }
    .coach-log-pill { flex: 1 1 calc(50% - 0.4rem); text-align: center; }

    .workout-runner .workout-exercise-card .card-body { padding: 0.85rem 0.9rem 0.8rem; }

    .workout-runner .input-group-text {
        min-width: 4.5rem;
        font-size: 0.78rem;
        padding-left: 0.45rem;
        padding-right: 0.45rem;
    }

    .workout-runner .set-input,
    .workout-runner input[type="number"] {
        min-height: 2.72rem;
        font-size: 1rem;
    }

    .workout-runner .workout-form { padding-bottom: 16rem; }

    .workout-actions {
        bottom: max(0.55rem, env(safe-area-inset-bottom));
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    .workout-actions__prompt,
    .workout-actions__rep-controls,
    .workout-actions__submit,
    .workout-actions__session { width: 100%; }

    .workout-actions__rep-controls,
    .workout-actions__submit {
        flex-direction: column;
        align-items: stretch;
    }

    .workout-actions__rep-controls .btn,
    .workout-actions__submit .btn,
    .workout-actions__submit form,
    .workout-actions__submit form .btn { width: 100%; }

    .workout-actions__session { min-width: 0; margin-left: 0; }
    .workout-actions__session summary { min-height: 2.6rem; }
    .workout-actions.is-editing .workout-actions__session { display: none; }
    .workout-actions .btn { min-height: 2.85rem; }

    .card:hover,
    .btn:hover { transform: none; }

    .table > :not(caption) > * > * { padding: 0.625rem 0.75rem; }

    /* Touch targets — ensure small buttons are at least 44px tall */
    .btn-sm { min-height: 2.75rem; }

    /* Tighter icon-only buttons inside tables */
    .table .btn-sm, .table .btn-group-sm > .btn { min-height: 2.5rem; padding-left: 0.5rem; padding-right: 0.5rem; }

    /* Tighter card padding on mobile */
    .card-body { padding: 0.875rem; }
    .card-header { padding: 0.75rem 0.875rem; }

    /* Page header: reduce h1 size */
    .page-header h1 { font-size: 1.25rem; }
}

/* Reps stepper buttons (+/−) in the set stage */
.coach-reps-stepper {
    min-width: 3.5rem;
    font-size: 1.1rem;
}
@media (max-width: 767px) {
    /* On mobile fingers need a big tap target — make them square and chunky */
    .coach-reps-stepper {
        min-width: 4.5rem;
        min-height: 3.75rem;
        font-size: 1.4rem;
    }
}

/* Rest timer done — pulse animation on coach card */
@keyframes rest-done-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5); }
    40%  { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0.2); }
    70%  { box-shadow: 0 0 0 20px rgba(37, 99, 235, 0.05); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
.rest-done-pulse {
    animation: rest-done-pulse 0.6s ease-out;
}
