/* ============================================================
   BattlePack™ — ATC Workout System
   bp-atc.css
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --atc-purple:     #a800ff;
    --atc-blue:       #00a8ff;
    --atc-teal:       #00ffc8;
    --atc-dark:       #0a0a0a;
    --atc-surface:    #ffffff;
    --atc-border:     #e6e6e6;
    --atc-text:       #2c3236;
    --atc-muted:      #64747d;
    --atc-stripe-odd: #f9f9f9;
    --atc-radius:     8px;
    --atc-radius-sm:  4px;
    --atc-font:       -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ── Wrapper ───────────────────────────────────────────────── */
.bp-atc-wrap {
    position: relative;
    font-size: 18px;
    color: var(--atc-text);
    max-width: 860px;
    margin: 0 auto;
}

/* ── INS popup trigger + modal ────────────────────────────────
   Sits in normal document flow, right-aligned, directly above
   the exercise-card list it belongs to (one per visible panel —
   harmless duplication since only one panel is ever shown). */
.bp-atc-ins-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.bp-atc-ins-source { display: none; }

.bp-atc-ins-trigger {
    width: 37px;
    height: 37px;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #a800ff;
    cursor: pointer;
    padding: 0;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}
.bp-atc-ins-trigger:hover,
.bp-atc-ins-trigger:focus,
.bp-atc-ins-trigger:active {
    background: transparent !important;
    color: #a800ff !important;
    border-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

.bp-atc-ins-modal-box {
    max-width: 640px;
    max-height: 82vh;
    overflow-y: auto;
    text-align: left;
}
.bp-atc-ins-modal-box .bp-atc-instructions { text-align: left; }

/* ── Back to top block ───────────────────────────────────────── */
.bp-atc-scroll-top:hover i { color: var(--atc-purple); }

.bp-atc-history-wrap,
.bp-ptk-wrap {
    font-size: 18px;
}

.bp-atc-error {
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--atc-radius);
    color: #856404;
    font-size: 18px;
}

.bp-atc-login-prompt {
    padding: 20px;
    text-align: center;
    color: var(--atc-muted);
}

/* ── Cycle banner ──────────────────────────────────────────── */
.bp-atc-cycle-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(0,0,0,0.03);
    border-radius: var(--atc-radius);
    margin-bottom: 20px;
    border: 1px solid var(--atc-border);
    border-left: 3px solid var(--phase-color, var(--atc-purple));
    flex-wrap: wrap;
    font-size: 14px;
}

/* No-cycle state: single compact line prompting action */
.bp-atc-no-cycle {
    border-left-color: var(--atc-muted);
    justify-content: flex-start;
    gap: 14px;
    padding: 8px 16px;
}

.bp-atc-no-cycle p {
    margin: 0;
    color: var(--atc-muted);
    font-size: 14px;
}

.bp-atc-cycle-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.bp-atc-cycle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bp-atc-cycle-num {
    font-weight: 700;
    font-size: 14px;
    color: var(--atc-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bp-atc-phase-badge,
.bp-atc-week-badge {
    font-size: 13px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(168, 0, 255, 0.1);
    color: var(--atc-purple);
    font-weight: 700;
}

.bp-atc-week-badge {
    background: rgba(0, 168, 255, 0.08);
    color: var(--atc-blue);
}

.bp-atc-cycle-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.bp-atc-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--atc-border);
    border-radius: 2px;
    overflow: hidden;
}

.bp-atc-progress-fill {
    height: 100%;
    background: var(--phase-color, var(--atc-purple));
    border-radius: 2px;
    transition: width 0.4s ease;
}

.bp-atc-progress-pct {
    font-size: 12px;
    color: var(--atc-muted);
    white-space: nowrap;
    min-width: 30px;
}

.bp-atc-cycle-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bp-atc-rest-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(237, 150, 21, 0.12);
    color: #ed9615;
    letter-spacing: 0.3px;
}

.bp-atc-auto-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 255, 200, 0.15);
    color: #006b52;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Buttons */
.bp-atc-btn-primary,
.bp-atc-btn-secondary,
.bp-atc-btn-outline,
.bp-atc-btn-danger-outline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
}

.bp-atc-btn-primary {
    background: var(--atc-purple);
    color: #fff;
}

.bp-atc-btn-secondary {
    background: transparent;
    color: var(--atc-purple);
    border: 1px solid var(--atc-purple);
}

.bp-atc-btn-outline {
    background: transparent;
    color: var(--atc-text);
    border: 1px solid var(--atc-border);
}

.bp-atc-btn-danger-outline {
    background: transparent;
    color: #db222a;
    border: 1px solid #f3c8c9;
}

.bp-atc-btn-primary:hover,
.bp-atc-btn-secondary:hover,
.bp-atc-btn-outline:hover,
.bp-atc-btn-danger-outline:hover { opacity: 0.85; }

/* ── Tabs ──────────────────────────────────────────────────── */
.bp-atc-tabs { margin-bottom: 32px; position: relative; }

.bp-atc-tab-nav {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    margin-bottom: 0;
    padding-bottom: 4px;
    justify-content: safe center;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.bp-atc-tab-nav::-webkit-scrollbar { display: none; }

/* Default tab button — bordered pill. Used by tab bars that aren't day
   tabs or inner/phase tabs (MCS-C TYPE, AVF positions, RST-W, MCS-SK, etc). */
.bp-atc-tab-btn {
    padding: 8px 18px;
    border: 1.5px solid var(--atc-border);
    background: var(--atc-surface);
    color: var(--atc-muted);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 999px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.bp-atc-tab-btn:hover {
    border-color: var(--atc-purple);
    color: var(--atc-text);
}

.bp-atc-tab-btn.active {
    background: var(--atc-purple);
    border-color: var(--atc-purple);
    color: #fff;
}

.bp-atc-tab-panel { display: none; padding: 24px 0 0; }
.bp-atc-tab-panel.active { display: block; }

/* ── Day tabs — borderless pill buttons directly on the page background.
   Only the active day gets a filled pill; the row itself has no card,
   border, or background. ── */
.bp-atc-day-tabs .bp-atc-tab-nav.bp-atc-day-nav {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 6px 0;
    gap: 4px;
    justify-content: space-between;
}

.bp-atc-day-tabs .bp-atc-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
}

.bp-atc-day-tabs .bp-atc-tab-btn:hover {
    background: var(--atc-stripe-odd);
    border-color: transparent;
    color: var(--atc-text);
}

.bp-atc-day-tabs .bp-atc-tab-btn.active {
    background: var(--atc-purple);
    border-color: transparent;
    color: #fff;
}

/* ── Inner tabs (phase tabs nested under day/type tabs) — soft "filter
   chip" pills, centered, no border. Active state uses a translucent
   purple wash rather than a solid fill (matches the FlexDash nav-pill
   active treatment). ── */
.bp-atc-inner-tabs .bp-atc-tab-nav {
    margin-top: 16px;
    margin-bottom: 0;
    justify-content: center;
    gap: 8px;
}

.bp-atc-inner-tabs .bp-atc-tab-btn {
    font-size: 13px;
    font-weight: 800;
    padding: 8px 20px;
    border: none;
    border-radius: 999px;
    background: var(--atc-stripe-odd);
    color: var(--atc-muted);
    flex-shrink: 0;
}

.bp-atc-inner-tabs .bp-atc-tab-btn:hover {
    background: rgba(168, 0, 255, 0.08);
    color: var(--atc-purple);
}

.bp-atc-inner-tabs .bp-atc-tab-btn.active {
    background: rgba(168, 0, 255, 0.16);
    color: var(--atc-purple);
}

/* Current-phase marker when that tab isn't the one being viewed — a
   soft amber tint instead of the purple "currently viewing" wash, so
   "you are here" stays visible without competing with the active state. */
.bp-atc-current-phase:not(.active) {
    background: rgba(0, 255, 200, 0.14) !important;
    color: #00806a !important;
}

/* ── Phase header ──────────────────────────────────────────── */
.bp-atc-phase-header {
    margin-bottom: 16px;
    text-align: center;
}

.bp-atc-phase-header h3 {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--atc-text);
}

.bp-atc-phase-desc,
.bp-atc-phase-note {
    font-size: 16px;
    color: var(--atc-muted);
    margin: 0 auto;
    max-width: 520px;
    line-height: 1.4;
}

/* ── Workout table ─────────────────────────────────────────── */
.bp-atc-table-wrap {
    overflow-x: visible;
    margin-bottom: 24px;
    border-radius: var(--atc-radius);
    border: 1px solid var(--atc-border);
}

.bp-atc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    table-layout: fixed;
}

.bp-atc-table thead th {
    background: var(--atc-surface);
    color: var(--atc-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 10px 8px;
    border-bottom: 2px solid var(--atc-border);
    text-align: left;
    word-break: keep-all;
}

.bp-atc-table thead th.bp-atc-col-reps,
.bp-atc-table thead th.bp-atc-col-sets,
.bp-atc-table thead th.bp-atc-col-pr,
.bp-atc-table thead th.bp-atc-col-video { text-align: center; }

.bp-atc-table tbody tr:nth-child(odd)  { background: var(--atc-stripe-odd); }
.bp-atc-table tbody tr:nth-child(even) { background: var(--atc-surface); }
.bp-atc-table tbody tr:hover           { background: rgba(168, 0, 255, 0.03); }

.bp-atc-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--atc-border);
    vertical-align: middle;
    color: var(--atc-text);
    font-size: 16px;
    word-break: normal;
}

.bp-atc-table td.bp-atc-col-reps,
.bp-atc-table td.bp-atc-col-sets,
.bp-atc-table td.bp-atc-col-pr,
.bp-atc-table td.bp-atc-col-video { text-align: center; }

/* Header rows (section labels within table) */
.bp-atc-row-header td {
    font-size: 19px;
    font-weight: 700;
    color: var(--atc-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: rgba(100, 116, 125, 0.06) !important;
    border-top: 2px solid var(--atc-border);
    padding: 8px 12px;
}

.bp-atc-col-exc  { width: auto; font-weight: 600; }
.bp-atc-col-video { width: 36px; text-align: center; }
.bp-atc-col-reps  { width: 100px; font-size: 15px; }
.bp-atc-col-sets  { width: 55px; font-size: 15px; }
.bp-atc-col-pr    { width: 65px; font-size: 15px; }

.bp-atc-note {
    display: block;
    font-size: 18px;
    font-weight: 400;
    color: var(--atc-muted);
    margin-top: 2px;
}

.bp-atc-pr-val {
    font-size: 19px;
    font-weight: 700;
    color: var(--atc-purple);
}

/* Recovery table */
.bp-atc-recovery-table .bp-atc-table thead th { width: 50%; }

/* ── Tracking form ─────────────────────────────────────────── */
.bp-atc-tracker-wrap {
    margin-top: 8px;
    padding: 20px;
    background: var(--atc-surface);
    border: 1px solid var(--atc-border);
    border-radius: var(--atc-radius);
}

.bp-atc-tracker-header {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.bp-atc-tracker-icon {
    opacity: 0.7;
}

.bp-atc-form-title {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--atc-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bp-atc-prev-note {
    font-size: 18px;
    font-weight: 400;
    color: var(--atc-blue);
    text-transform: none;
    letter-spacing: 0;
}

.bp-atc-form-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.bp-atc-field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bp-atc-field-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--atc-text);
}

.bp-atc-field-desc {
    font-size: 18px;
    color: var(--atc-muted);
}

.bp-atc-field-inputs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.bp-atc-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #ece7f2;
    border: 1px solid #dbaef5;
    border-radius: var(--atc-radius-sm);
    padding: 0 8px 0 0;
    overflow: hidden;
}

.bp-atc-input {
    width: 64px;
    height: 36px;
    border: none !important;
    background: transparent !important;
    padding: 0 8px;
    font-size: 19px;
    font-weight: 700;
    color: var(--atc-text);
    text-align: right;
    outline: none;
    -moz-appearance: textfield;
}

.bp-atc-input::-webkit-outer-spin-button,
.bp-atc-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.bp-atc-unit {
    font-size: 18px;
    font-weight: 600;
    color: var(--atc-muted);
    white-space: nowrap;
}

/* Form footer */
.bp-atc-form-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.bp-atc-date {
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--atc-border);
    border-radius: var(--atc-radius-sm);
    font-size: 16px;
    color: var(--atc-text);
    background: var(--atc-surface);
    cursor: pointer;
}

.bp-atc-submit {
    padding: 10px 24px;
    background: var(--atc-purple);
    color: #fff;
    border: none;
    border-radius: var(--atc-radius-sm);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
}

.bp-atc-submit:hover { opacity: 0.85; }
.bp-atc-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.bp-atc-form-msg {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--atc-radius-sm);
    font-size: 16px;
    font-weight: 600;
}

.bp-atc-form-msg.success {
    background: rgba(0, 255, 200, 0.1);
    border: 1px solid var(--atc-teal);
    color: #006b52;
}

.bp-atc-form-msg.error {
    background: rgba(219, 34, 42, 0.08);
    border: 1px solid #db222a;
    color: #db222a;
}

/* ── Exercise cards (new format) ──────────────────────────────
   Replaces the old <table>-based workout_table()/tracking_form()
   combo for programs rebuilt to the standard ATC layout. */

.bp-atc-card-section {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--atc-muted);
    margin: 18px 0 8px;
}
.bp-atc-card-section:first-child { margin-top: 0; }

.bp-atc-exercise-card {
    background: var(--atc-surface);
    border: 1px solid var(--atc-border);
    border-radius: var(--atc-radius);
    margin-bottom: 12px;
    overflow: hidden;
}
.bp-atc-exercise-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    flex-wrap: nowrap;
    background: #ecf0f3;
}

.bp-atc-exercise-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex-shrink: 1;
}

.bp-atc-exercise-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--atc-text);
    white-space: nowrap;
}

.bp-atc-exercise-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
}

.bp-atc-icon-btn {
    width: 26px;
    height: 26px;
    border: none !important;
    background: transparent !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--atc-muted);
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}
.bp-atc-icon-btn:hover,
.bp-atc-icon-btn:focus,
.bp-atc-icon-btn:active {
    background: transparent !important;
    color: var(--atc-muted) !important;
    border-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}
.bp-atc-icon-btn img { width: 23px; height: 23px; display: block; }

.bp-atc-target-stats {
    display: flex;
    gap: 10px;
    margin-left: auto;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.bp-atc-target-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bp-atc-target-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: var(--atc-muted);
    text-transform: uppercase;
}

.bp-atc-target-val {
    font-size: 14px;
    font-weight: 800;
    color: var(--atc-text);
    background: #f7f9fa;
    border-radius: 6px;
    padding: 3px 9px;
    white-space: nowrap;
}

.bp-atc-track-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #ced9df;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.bp-atc-track-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--atc-muted);
    text-transform: uppercase;
}

.bp-atc-pr-badge {
    margin-left: auto;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.bp-atc-pr-badge .bp-atc-pr-val {
    font-size: 18px;
}

.bp-atc-pr-badge.is-new .bp-atc-pr-val {
    color: #00a32a;
}

.bp-atc-pr-flag {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.4px;
    background: #00a32a;
    color: #fff;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.bp-atc-pr-caption,
.bp-atc-pr-empty {
    font-size: 11px;
    color: var(--atc-muted);
    white-space: nowrap;
}

.bp-atc-pr-empty { font-style: italic; }

.bp-atc-instructions-card {
    background: var(--atc-surface);
    border: 1px solid var(--atc-border);
    border-radius: var(--atc-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 16px;
    color: var(--atc-text);
}
.bp-atc-instructions-card h3 { margin-top: 0; }
.bp-atc-instructions-card > *:last-child { margin-bottom: 0; }

/* Recovery day cards — simpler shape, no tracking/target chips */
.bp-atc-recovery-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: var(--atc-surface);
    border: 1px solid var(--atc-border);
    border-radius: var(--atc-radius);
    margin-bottom: 8px;
}

.bp-atc-recovery-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--atc-text);
}

.bp-atc-recovery-detail {
    font-size: 14px;
    color: var(--atc-muted);
    font-weight: 600;
    white-space: nowrap;
}

/* ── History page ──────────────────────────────────────────── */
.bp-atc-history-wrap { max-width: 960px; margin: 0 auto; }

.bp-atc-section {
    margin-bottom: 40px;
}

.bp-atc-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--atc-text);
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--atc-border);
}

.bp-atc-empty {
    color: var(--atc-muted);
    font-size: 18px;
    padding: 20px;
    text-align: center;
    background: var(--atc-stripe-odd);
    border-radius: var(--atc-radius);
}

/* Cycle History — collapsed by default, expand on click */
.bp-atc-cycle-history-details {
    border: none;
}

.bp-atc-cycle-history-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bp-atc-cycle-history-summary::-webkit-details-marker {
    display: none;
}

.bp-atc-cycle-history-summary::after {
    content: '▼';
    font-size: 12px;
    color: var(--atc-muted);
    margin-left: 8px;
}

.bp-atc-cycle-history-details[open] .bp-atc-cycle-history-summary::after {
    content: '▲';
}

.bp-atc-cycle-history-details > .bp-atc-cycle-history-card {
    margin-top: 20px;
}

/* Cycle history — per-cycle Phase 1/2/3 progression */
.bp-atc-cycle-history-card {
    background: var(--atc-surface);
    border: 1px solid var(--atc-border);
    border-radius: var(--atc-radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.bp-atc-cycle-history-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--atc-stripe-odd);
    border-bottom: 1px solid var(--atc-border);
}

.bp-atc-cycle-history-num {
    font-size: 16px;
    font-weight: 800;
    color: var(--atc-text);
}

.bp-atc-cycle-history-status {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 2px 9px;
    border-radius: 10px;
    background: rgba(100, 116, 125, 0.12);
    color: var(--atc-muted);
}

.bp-atc-cycle-history-status.bp-atc-status-active {
    background: rgba(0, 168, 255, 0.12);
    color: var(--atc-blue);
}

.bp-atc-cycle-history-status.bp-atc-status-complete {
    background: rgba(0, 163, 42, 0.12);
    color: #00a32a;
}

.bp-atc-cycle-history-status.bp-atc-status-rest {
    background: rgba(237, 150, 21, 0.12);
    color: #ed9615;
}

.bp-atc-cycle-history-dates {
    margin-left: auto;
    font-size: 13px;
    color: var(--atc-muted);
}

.bp-atc-phase-block {
    padding: 14px 16px;
    border-bottom: 1px solid var(--atc-border);
}
.bp-atc-phase-block:last-child { border-bottom: none; }
.bp-atc-phase-block.is-pending { opacity: 0.5; }

.bp-atc-phase-block-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.bp-atc-phase-block-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 2px 9px;
    border-radius: 10px;
}

.bp-atc-phase-block-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--atc-muted);
}

.bp-atc-phase-block-status {
    margin-left: auto;
    font-size: 12px;
    font-weight: 700;
    color: var(--atc-muted);
}

.bp-atc-phase-progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 15px;
    padding: 5px 0;
}

.bp-atc-phase-progress-exercise {
    font-weight: 700;
    color: var(--atc-text);
    min-width: 140px;
}

.bp-atc-phase-progress-vals {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.bp-atc-phase-progress-vals .val {
    font-weight: 800;
    color: var(--atc-text);
}

.bp-atc-phase-progress-vals .arrow {
    color: var(--atc-muted);
}

.bp-atc-phase-progress-delta {
    font-size: 13px;
    font-weight: 700;
    margin-left: auto;
    white-space: nowrap;
}

.bp-atc-phase-progress-delta.up   { color: #00a32a; }
.bp-atc-phase-progress-delta.down { color: #d63638; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
    .bp-atc-cycle-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .bp-atc-form-fields {
        grid-template-columns: repeat(2, 1fr);
    }

    .bp-atc-tab-btn {
        padding: 6px 10px;
        font-size: 19px;
    }

    .bp-atc-cycle-card-meta {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 400px) {
    .bp-atc-form-fields {
        grid-template-columns: 1fr;
    }
}

/* ── MCS MPH note ──────────────────────────────────────────── */
.bp-atc-mcs-mph-note {
    margin: 12px 0;
    padding: 10px 14px;
    background: rgba(168, 0, 255, 0.05);
    border-left: 3px solid var(--atc-purple);
    border-radius: 0 4px 4px 0;
    font-size: 16px;
    color: var(--atc-muted);
}

/* ── Force play button size ────────────────────────────────── */
.bp-atc-col-video img,
.bp-atc-col-video a img {
    width: 25px !important;
    height: 25px !important;
    min-width: 25px !important;
    display: block;
    margin: 0 auto;
}

/* ── AWU two-table divider ────────────────────────────────────────────────── */
.bp-atc-table-divider {
    height: 24px;
    border-top: 1px solid #e2e4e7;
    margin: 8px 0;
}

/* ── Instruction images ──────────────────────────────────────────────────── */
.bp-atc-instructions img.bp-atc-img,
.bp-atc-instructions .bp-atc-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
    display: block;
}

/* ── Video wrap ──────────────────────────────────────────────────────────── */
.bp-atc-video-wrap {
    margin: 16px 0;
}

.bp-atc-video-wrap video {
    max-width: 100%;
    border-radius: 8px;
}

/* ── Focus table ─────────────────────────────────────────────────────────── */
.bp-atc-focus-table-wrap {
    overflow-x: auto;
    margin: 16px 0;
}

.bp-atc-focus-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.bp-atc-focus-table th {
    background: #2c3236;
    color: #abb8c3;
    padding: 8px 12px;
    text-align: left;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.bp-atc-focus-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e2e4e7;
    vertical-align: top;
    line-height: 1.4;
}

.bp-atc-focus-table tr:last-child td { border-bottom: none; }
.bp-atc-focus-table tr:nth-child(even) td { background: #f9f9fb; }

/* ── Timing table ────────────────────────────────────────────────────────── */
.bp-atc-timing-table {
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
}

.bp-atc-timing-table th,
.bp-atc-timing-table td {
    padding: 8px 20px;
    border: 1px solid #e2e4e7;
    text-align: center;
    font-weight: 600;
}

.bp-atc-timing-table th {
    background: #2c3236;
    color: #fff;
}

/* ── Coming soon placeholder ─────────────────────────────────────────────── */
.bp-atc-coming-soon {
    color: #64747d;
    font-style: italic;
    font-size: 14px;
    padding: 20px 0;
}

/* ── RST-W table ─────────────────────────────────────────────────────────── */
.bp-rst-table .bp-rst-muscles {
    font-size: 12px;
    color: #64747d;
}

.bp-rst-img-link {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bp-rst-img-link:hover { color: #a800ff; }
.bp-rst-img-icon { font-size: 14px; }

/* ── RST-W image modal ───────────────────────────────────────────────────── */
.bp-rst-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bp-rst-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    cursor: pointer;
}

.bp-rst-modal-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 480px;
    width: 90%;
    z-index: 1;
    text-align: center;
}

.bp-rst-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #64747d;
    line-height: 1;
    padding: 4px 8px;
}

.bp-rst-modal-close:hover { color: #2c3236; }

.bp-rst-modal-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 16px;
    display: block;
}

.bp-rst-modal-name {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #2c3236;
    margin-bottom: 6px;
}

.bp-rst-modal-notes {
    font-size: 13px;
    color: #64747d;
}
