/* ============================================================================
   EXERCISE LIBRARY PAGE STYLES
   ============================================================================ */

/* Container */
.ex-lib-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Filters Section */
.ex-lib-filters {
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.ex-lib-filter-group {
    margin-bottom: 1.5rem;
}

.ex-lib-filter-group:last-child {
    margin-bottom: 0;
}

.ex-lib-filter-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.ex-lib-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ex-lib-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ex-lib-filter-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
}

.ex-lib-filter-btn.active {
    background: rgba(200, 160, 60,0.2);
    border-color: var(--crimson, #c8a03c);
    color: var(--white);
}

/* Search */
.ex-lib-search {
    margin-bottom: 1.5rem;
}

.ex-lib-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.ex-lib-search-input:focus {
    outline: none;
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.2);
}

.ex-lib-search-input::placeholder {
    color: rgba(255,255,255,0.3);
}

/* Actions */
.ex-lib-actions {
    display: flex;
    gap: 0.75rem;
}

/* Exercise Grid */
.ex-lib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

/* Exercise Card */
.ex-card {
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.ex-card:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.ex-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.ex-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    margin: 0;
    flex: 1;
    line-height: 1.4;
}

.ex-card-video-link {
    flex-shrink: 0;
    margin-left: 0.5rem;
    color: rgba(255,255,255,0.4);
    transition: color 0.2s ease;
}

.ex-card-video-link:hover {
    color: rgba(255,255,255,0.7);
}

.ex-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ex-card-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Category badges — unified on-theme gold (navy/gold/white identity). */
.ex-card-badge-strength,
.ex-card-badge-cardio,
.ex-card-badge-swimming,
.ex-card-badge-mobility,
.ex-card-badge-plyometric,
.ex-card-badge-balance,
.ex-card-badge-rehab { background: rgba(200,160,60,0.16); color: #c8a03c; }

/* Difficulty — restrained ramp: neutral → gold → muted danger (red is the one
   semantic exception in the theme). */
.ex-card-badge-diff-beginner { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.82); }
.ex-card-badge-diff-intermediate { background: rgba(200,160,60,0.18); color: #c8a03c; }
.ex-card-badge-diff-advanced { background: rgba(200,160,60,0.16); color: #e8c87a; }

.ex-card-badge-eq {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
}

.ex-card-muscles {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.75rem;
}

.ex-card-muscles strong {
    color: rgba(255,255,255,0.7);
}

.ex-card-desc {
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgba(255,255,255,0.6);
    margin-bottom: 1rem;
}

.ex-card-actions {
    display: flex;
    gap: 0.5rem;
}

.ex-card-btn {
    flex: 1;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.ex-card-btn-view {
    background: rgba(255,255,255,0.08);
    color: var(--white);
    border-color: rgba(255,255,255,0.1);
}

.ex-card-btn-view:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.2);
}

.ex-card-btn-add {
    flex: 0 0 48px;
    background: rgba(200, 160, 60,0.2);
    color: var(--crimson, #c8a03c);
    border-color: rgba(200, 160, 60,0.3);
    font-size: 1.25rem;
    padding: 0;
}

.ex-card-btn-add:hover {
    background: rgba(200, 160, 60,0.3);
    border-color: var(--crimson, #c8a03c);
}

/* Empty State */
.ex-lib-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.ex-lib-empty h3 {
    margin: 1rem 0 0.5rem;
    color: var(--white);
}

.ex-lib-empty p {
    color: rgba(255,255,255,0.5);
    font-size: 0.875rem;
}

/* Exercise Detail Modal */
.ex-detail-modal {
    max-width: 600px;
}

.ex-detail-header {
    margin-bottom: 1.5rem;
}

.ex-detail-header h2 {
    font-size: 1.5rem;
    margin: 0 0 0.75rem;
    color: var(--white);
}

.ex-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ex-detail-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ex-detail-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.ex-detail-section h3 {
    font-size: 0.875rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem;
}

.ex-detail-section p {
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.7);
    margin: 0;
}

.ex-detail-section p + p {
    margin-top: 0.5rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ex-lib-container {
        padding: 1rem;
    }

    .ex-lib-filters {
        padding: 1rem;
    }

    .ex-lib-filter-buttons {
        gap: 0.375rem;
    }

    .ex-lib-filter-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .ex-lib-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .ex-card {
        padding: 1rem;
    }

    .ex-card-title {
        font-size: 0.9375rem;
    }

    .ex-card-badge {
        font-size: 0.6875rem;
    }
}

@media (max-width: 480px) {
    /* NOTE: previously hid .ex-lib-filter-btn span:first-child to drop a leading ICON,
       but the buttons now have only the LABEL span — hiding it left the filter chips
       blank on mobile. Rule removed so the labels (Resistance Training, Cardio, etc.) show. */

    .ex-card-header {
        flex-direction: column;
    }

    .ex-card-video-link {
        align-self: flex-end;
        margin: 0.5rem 0 0;
    }

    .ex-card-actions {
        flex-direction: column;
    }

    .ex-card-btn-add {
        flex: 0 0 auto;
        width: 100%;
    }
}

/* ============================================================================
   VIEW TOGGLE & LIST VIEW STYLES
   ============================================================================ */

/* Search Row with View Toggle */
.ex-lib-search-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.ex-lib-search-row .ex-lib-search-input {
    flex: 1;
    margin-bottom: 0;
}

/* View Toggle Buttons */
.ex-lib-view-toggle {
    display: flex;
    gap: 0.5rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 0.25rem;
}

.ex-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ex-view-btn:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
}

.ex-view-btn.active {
    background: rgba(200, 160, 60,0.2);
    color: var(--crimson, #c8a03c);
}

/* List View Styles */
.ex-lib-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ex-lib-grid.list-view .ex-card {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr auto;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.ex-lib-grid.list-view .ex-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.ex-lib-grid.list-view .ex-card-header {
    flex: none;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ex-lib-grid.list-view .ex-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.ex-lib-grid.list-view .ex-card-video-link {
    display: none; /* Hide video icon in list view for cleaner look */
}

.ex-lib-grid.list-view .ex-card-meta {
    margin-bottom: 0;
    gap: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.ex-lib-grid.list-view .ex-card-badge {
    font-size: 0.6875rem;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-weight: 600;
}

.ex-lib-grid.list-view .ex-card-muscles {
    margin-bottom: 0;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.4;
}

.ex-lib-grid.list-view .ex-card-muscles strong {
    display: none; /* Hide "Targets:" label in list view */
}

.ex-lib-grid.list-view .ex-card-desc {
    display: none; /* Hide description in list view */
}

.ex-lib-grid.list-view .ex-card-actions {
    display: flex;
    gap: 0.625rem;
    justify-content: flex-end;
    align-items: center;
}

.ex-lib-grid.list-view .ex-card-btn-view {
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.ex-lib-grid.list-view .ex-card-btn-view:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.ex-lib-grid.list-view .ex-card-btn-add {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile adjustments for list view */
@media (max-width: 768px) {
    .ex-lib-search-row {
        flex-direction: column;
    }

    .ex-lib-view-toggle {
        width: 100%;
        justify-content: center;
    }

    .ex-lib-grid.list-view {
        gap: 1rem;
    }

    .ex-lib-grid.list-view .ex-card {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }

    .ex-lib-grid.list-view .ex-card:hover {
        transform: none; /* Disable slide effect on mobile */
    }

    .ex-lib-grid.list-view .ex-card-header {
        gap: 0.5rem;
    }

    .ex-lib-grid.list-view .ex-card-actions {
        justify-content: stretch;
        gap: 0.5rem;
    }

    .ex-lib-grid.list-view .ex-card-btn-view {
        flex: 1;
    }

    .ex-lib-grid.list-view .ex-card-btn-add {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
    }
}

/* ===== Exercise Library v2 — muscle-group card grid (free-exercise-db) ===== */
.exlib-container { padding-top: 0.25rem; }
.exlib-toolbar { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 1rem; }
.exlib-search-input {
    flex: 1; min-width: 0; padding: 0.7rem 0.9rem;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px; color: #fff; font-size: 0.95rem;
}
.exlib-search-input::placeholder { color: rgba(255,255,255,0.45); }
.exlib-search-input:focus { outline: none; border-color: var(--gold, #d4af37); background: rgba(255,255,255,0.09); }

.exlib-section-title { font-size: 1.05rem; font-weight: 700; color: #fff; margin: 0.4rem 0 0.85rem; }
.exlib-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.exlib-muted { color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.exlib-loading, .exlib-empty { padding: 2rem 1rem; text-align: center; color: rgba(255,255,255,0.6); }

.exlib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }
.exlib-card {
    display: flex; flex-direction: column; padding: 0; text-align: left; cursor: pointer;
    background: #121a2e; border: 1px solid rgba(255,255,255,0.08); border-radius: 14px;
    overflow: hidden; transition: border-color .15s ease, transform .15s ease;
}
.exlib-card:hover, .exlib-card:active { border-color: var(--gold, #d4af37); transform: translateY(-2px); }
.exlib-card-img { display: block; width: 100%; aspect-ratio: 4 / 3; background: #0b1222; }
.exlib-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.exlib-card-meta { padding: 0.6rem 0.7rem 0.75rem; }
.exlib-card-name { display: block; font-weight: 700; color: #fff; font-size: 0.95rem; }
.exlib-card-count { display: block; color: var(--gold, #d4af37); font-size: 0.78rem; margin-top: 0.15rem; }

.exlib-ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }
.exlib-ex-card {
    display: flex; flex-direction: column; padding: 0; text-align: left; cursor: pointer;
    background: #121a2e; border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; overflow: hidden;
    transition: border-color .15s ease, transform .15s ease;
}
.exlib-ex-card:hover, .exlib-ex-card:active { border-color: var(--gold, #d4af37); transform: translateY(-2px); }
.exlib-ex-img { display: block; width: 100%; aspect-ratio: 1 / 1; background: #0b1222; }
.exlib-ex-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.exlib-ex-info { padding: 0.55rem 0.65rem 0.7rem; }
.exlib-ex-name { display: block; font-weight: 600; color: #fff; font-size: 0.85rem; line-height: 1.25; }
.exlib-ex-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }
.exlib-tag {
    font-size: 0.68rem; text-transform: capitalize; color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.08); padding: 0.15rem 0.45rem; border-radius: 6px;
}
.exlib-count-pill {
    font-size: 0.75rem; color: var(--gold, #d4af37); background: rgba(212,175,55,0.12);
    padding: 0.1rem 0.5rem; border-radius: 999px; vertical-align: middle; margin-left: 0.35rem;
}

.exlib-back {
    display: inline-flex; align-items: center; gap: 0.35rem; margin-bottom: 0.9rem;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
    color: #fff; padding: 0.45rem 0.85rem; border-radius: 999px; font-size: 0.85rem; cursor: pointer;
}
.exlib-back:hover, .exlib-back:active { border-color: var(--gold, #d4af37); color: var(--gold, #d4af37); }

.exlib-detail { color: #fff; }
.exlib-detail-name { font-size: 1.3rem; font-weight: 700; color: #fff; margin: 0 0 0.5rem; text-transform: capitalize; }
.exlib-detail-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.exlib-detail-media { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.exlib-detail-img { width: 100%; border-radius: 12px; background: #0b1222; display: block; }
.exlib-detail-video { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 0 0 1rem; border-radius: 12px; overflow: hidden; background: #000; }
.exlib-video-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.exlib-pin-btn { display: inline-block; margin: 0 0 1rem; padding: 0.45rem 0.9rem; font-size: 0.82rem; background: rgba(200,160,60,0.14); color: var(--gold, #c8a03c); border: 1px solid rgba(200,160,60,0.4); border-radius: 10px; cursor: pointer; }
.exlib-pin-btn:hover, .exlib-pin-btn:active { background: rgba(200,160,60,0.24); }
.exlib-detail-muscles { color: rgba(255,255,255,0.8); font-size: 0.9rem; margin: 0.25rem 0; }
.exlib-detail-muscles strong { color: #fff; }
.exlib-yt-btn {
    display: inline-flex; align-items: center; gap: 0.5rem; margin: 0 0 1rem; text-decoration: none;
    padding: 0.6rem 1rem; border-radius: 10px; font-weight: 600; font-size: 0.9rem;
    background: rgba(255,0,0,0.12); border: 1px solid rgba(255,0,0,0.4); color: #ff6b6b;
}
.exlib-yt-btn:hover, .exlib-yt-btn:active { background: rgba(255,0,0,0.22); color: #ff8585; }
.exlib-steps-title { margin-top: 1.1rem; }
.exlib-steps { margin: 0; padding-left: 1.2rem; color: rgba(255,255,255,0.85); font-size: 0.92rem; line-height: 1.6; }
.exlib-steps li { margin-bottom: 0.5rem; }

.exlib-prog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.custom-prog-card {
    background: #121a2e; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
    padding: 1.1rem; cursor: pointer; transition: border-color .15s ease;
}
.custom-prog-card:hover { border-color: var(--gold, #d4af37); }
.cpc-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.6rem; gap: 0.5rem; }
.cpc-name { font-size: 1.05rem; font-weight: 600; color: #fff; margin: 0; }
.cpc-badge { padding: 0.2rem 0.55rem; background: rgba(212,175,55,0.15); color: var(--gold, #d4af37); border-radius: 6px; font-size: 0.7rem; align-self: flex-start; }
.cpc-desc { font-size: 0.85rem; color: rgba(255,255,255,0.65); margin: 0 0 0.9rem; line-height: 1.5; }
.cpc-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 0.7rem; border-top: 1px solid rgba(255,255,255,0.08); }

@media (min-width: 640px) {
    .exlib-grid, .exlib-ex-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

/* Programme card hero image (reuses .exlib-card-img img rules) */
.prog-card { overflow: hidden; }
.prog-card .prog-card-img { aspect-ratio: 16 / 9; border-radius: 10px; margin-bottom: 0.85rem; overflow: hidden; }

/* Training/Assess pathway category card grid (replaces the swipe strip) */
.pathway-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; overflow: visible; margin-bottom: 1.25rem; }
.pathway-card {
    display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer; overflow: hidden;
    background: #121a2e; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
    transition: border-color .15s ease, transform .15s ease;
}
.pathway-card:hover, .pathway-card:active { transform: translateY(-2px); }
.pathway-card .exlib-card-img { aspect-ratio: 16 / 9; }
.pathway-card-body { padding: 0.6rem 0.75rem 0.75rem; }
.pathway-card-title { display: block; font-weight: 700; color: #fff; font-size: 0.92rem; }
.pathway-card-desc { display: block; color: rgba(255,255,255,0.6); font-size: 0.78rem; margin-top: 0.2rem; line-height: 1.3; }
.pathway-card.active { border-color: var(--gold, #d4af37); box-shadow: 0 0 0 2px var(--gold, #d4af37); }
@media (max-width: 767px) {
    .pathway-card-grid { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
    .pathway-card { min-width: 150px; scroll-snap-align: start; }
}

/* Training/Assess category selector — compact dropdown (panels below stay card grids) */
.pathway-nav { margin-bottom: 1.25rem; }
/* The legacy tab strip is kept in the DOM (hidden) purely so the existing click
   handlers still drive the panels — never show it. Overrides .pathway-tabs flex. */
.pathway-nav .pathway-tabs { display: none !important; }
.pathway-select-wrap { position: relative; display: inline-block; width: 100%; max-width: 360px; }
/* Bold gold down-triangle so it's obviously a dropdown (CSS border trick = renders everywhere) */
.pathway-select-wrap::after {
    content: ""; position: absolute; right: 1rem; top: 50%; margin-top: -3px; pointer-events: none;
    width: 0; height: 0;
    border-left: 6px solid transparent; border-right: 6px solid transparent;
    border-top: 7px solid var(--gold, #d4af37);
}
.pathway-select {
    width: 100%; padding: 0.7rem 2.4rem 0.7rem 0.9rem;
    background-color: #121a2e; color: #fff; font-size: 0.95rem; font-weight: 600; cursor: pointer;
    border: 1px solid rgba(255,255,255,0.15); border-radius: 10px;
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
.pathway-select:focus { outline: none; border-color: var(--gold, #d4af37); }
.pathway-select option { background: #16233c; color: #fff; }

/* ===== Tools / calculators ===== */
.tools-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tool-card { padding: 0; }
.tool-card-body { display: block; padding: 1rem 1.1rem 1.15rem; }
.tool-card-name { display: block; font-weight: 700; color: #fff; font-size: 1rem; }
.tool-card-blurb { display: block; color: rgba(255,255,255,0.6); font-size: 0.82rem; margin-top: 0.4rem; line-height: 1.45; }
.tool-modal .modal-body { display: flex; flex-direction: column; gap: 0.85rem; }
.tool-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.tool-row label { color: rgba(255,255,255,0.8); font-size: 0.9rem; }
.tool-row input, .tool-row select {
    width: 140px; padding: 0.6rem 0.7rem; background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.18); border-radius: 8px; color: #fff; font-size: 0.95rem;
}
.tool-row input:focus, .tool-row select:focus { outline: none; border-color: var(--gold, #d4af37); }
.tool-row select option { background: #16233c; color: #fff; }
.tool-note { color: rgba(255,255,255,0.5); font-size: 0.78rem; margin: 0; }
.tool-calc-btn { width: 100%; margin-top: 0.5rem; }
.tool-result { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; }
.tool-result:empty { display: none; border-top: none; margin: 0; padding: 0; }
.tool-headline { font-size: 2rem; font-weight: 800; color: var(--gold, #d4af37); line-height: 1.15; }
.tool-sub { color: rgba(255,255,255,0.7); font-size: 0.85rem; margin-bottom: 0.5rem; }
.tool-table { width: 100%; margin-top: 0.85rem; border-collapse: collapse; }
.tool-table th, .tool-table td { padding: 0.4rem 0.6rem; font-size: 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.07); color: rgba(255,255,255,0.85); text-align: left; }
.tool-table th { color: rgba(255,255,255,0.5); font-weight: 600; }
.tool-err { color: #ff6b6b; font-size: 0.88rem; }

/* ===== Imported programmes (PDF/URL) in the custom builder ===== */
.imported-prog-card { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 0.75rem; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; margin-bottom: 0.5rem; }
.imported-prog-meta { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.imported-prog-name { color: #fff; font-size: 0.9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imported-prog-tag { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gold, #d4af37); background: rgba(212,175,55,0.12); padding: 0.1rem 0.4rem; border-radius: 4px; flex: 0 0 auto; }
.imported-prog-actions { display: flex; gap: 0.4rem; flex: 0 0 auto; }
