:root {
    --bg: #0b0b10;
    --panel: rgba(255, 255, 255, .06);
    --panel2: rgba(255, 255, 255, .09);
    --stroke: rgba(255, 255, 255, .10);
    --text: rgba(255, 255, 255, .92);
    --muted: rgba(255, 255, 255, .65);
    --danger: #ff3b7a;
    --ok: #2cffc7;
    --gradA: #ff3bbd;
    --gradB: #2ee5ff;
    --primary: #ffffff;
    /* High contrast for active state */
    --shadow: 0 18px 50px rgba(0, 0, 0, .55);

    /* Core Visual Tokens de EntrenApp */
    --brand-grad-start: #ff3bbd;
    --brand-grad-end: #2ee5ff;
    --brand-glow: 0 0 22px rgba(255, 59, 189, 0.18);
    --brand-glow-strong: 0 0 0 1px rgba(255, 59, 189, 0.55), 0 0 20px rgba(255, 59, 189, 0.34), 0 0 36px rgba(46, 229, 255, 0.28);
    --comment-active-cyan: #1d6f95;
    --btn-premium-border: rgba(255, 255, 255, 0.24);
    --btn-premium-bg: linear-gradient(135deg, rgba(255, 59, 189, 0.14), rgba(46, 229, 255, 0.12));
    --btn-premium-glow: 0 6px 16px rgba(0, 0, 0, 0.24), 0 0 14px rgba(46, 229, 255, 0.14);
    --btn-premium-glow-hover: 0 10px 24px rgba(0, 0, 0, 0.3), 0 0 18px rgba(255, 59, 189, 0.2), 0 0 24px rgba(46, 229, 255, 0.2);
    --btn-premium-primary-bg: linear-gradient(90deg, rgba(255, 59, 189, 0.92), rgba(46, 229, 255, 0.9));
    --btn-premium-primary-border: rgba(255, 255, 255, 0.36);
    --btn-premium-primary-shadow: 0 10px 24px rgba(255, 59, 189, 0.28), 0 6px 14px rgba(46, 229, 255, 0.22);

    /* Colores de Estado Neutro (Dark UI por defecto) */
    --bg-inactive-header: rgba(255, 255, 255, 0.08);
    --bg-card: #141722;
    --text-inactive-title: rgba(255, 255, 255, 0.92);
    --text-inactive-body: rgba(255, 255, 255, 0.74);
    --text-active: #ffffff;

    /* Home / Landing continuous background tokens */
    --home-bg-gradient:
        radial-gradient(circle at 12% 14%, rgba(255, 59, 189, 0.24), transparent 34rem),
        radial-gradient(circle at 88% 12%, rgba(46, 229, 255, 0.20), transparent 36rem),
        radial-gradient(circle at 14% 68%, rgba(255, 59, 189, 0.13), transparent 40rem),
        radial-gradient(circle at 86% 74%, rgba(46, 229, 255, 0.12), transparent 42rem),
        radial-gradient(circle at 52% 42%, rgba(46, 229, 255, 0.07), transparent 38rem),
        linear-gradient(135deg, #0f0b13 0%, #0b0d14 46%, #0a1116 100%);
    --home-fade:
        linear-gradient(to top, rgba(11, 11, 16, .88) 0%, rgba(11, 11, 16, 0) 100%);
}

/* Light Theme */
[data-theme="light"] {
    --bg: #f8f8fc;
    --panel: rgba(0, 0, 0, .04);
    --panel2: rgba(0, 0, 0, .06);
    --stroke: rgba(0, 0, 0, .12);
    --text: rgba(0, 0, 0, .88);
    --muted: rgba(0, 0, 0, .65);
    --danger: #ff3b7a;
    --ok: #00d4a1;
    --gradA: #ff3bbd;
    --gradB: #2ee5ff;
    --shadow: 0 8px 30px rgba(0, 0, 0, .12);

    /* Colores de Estado Neutro (Light UI) */
    --bg-inactive-header: #f3f4f6;
    --bg-card: #ffffff;
    --text-inactive-title: #374151;
    --text-inactive-body: #4b5563;
    --text-active: #ffffff;

    /* Home / Landing continuous background tokens (light theme) */
    --home-bg-gradient:
        radial-gradient(circle at 12% 18%, rgba(255, 59, 189, 0.16), transparent 34rem),
        radial-gradient(circle at 88% 16%, rgba(46, 229, 255, 0.15), transparent 36rem),
        radial-gradient(circle at 18% 64%, rgba(255, 59, 189, 0.10), transparent 38rem),
        radial-gradient(circle at 86% 72%, rgba(46, 229, 255, 0.12), transparent 40rem),
        linear-gradient(135deg, #fff7fd 0%, #f8fbff 45%, #effcff 100%);
    --home-fade:
        linear-gradient(to top, rgba(248, 248, 252, .92) 0%, rgba(248, 248, 252, 0) 100%);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial;
    background: var(--bg);
    background-repeat: no-repeat;
    background-size: auto;
    color: var(--text);

    /* Keep scroll attachment to avoid visible horizontal seam artifacts */
    background-attachment: scroll;

    /* Evita scroll horizontal por sombras/gradientes */
    overflow-x: hidden;

    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Light theme background adjustments */
[data-theme="light"] body {
    background: var(--bg);
    background-attachment: scroll;
}

/* Landing-only continuous background layer (full-width, independent from section blocks) */
#landingView {
    position: relative;
    isolation: isolate;
    background: transparent;
}

#landingView::before {
    content: "";
    position: absolute;
    inset: -40px calc(50% - 50vw) -60px calc(50% - 50vw);
    z-index: -1;
    pointer-events: none;
    background: var(--home-bg-gradient);
    background-repeat: no-repeat;
    background-size: auto;
    background-position: center top;
}

/* Ensure main landing section wrappers never paint full-width bands */
#landingView>div {
    background-color: transparent;
}

/* PLANES section: isolate card visuals to prevent full-width band artifacts */
#plansSection .plans-grid {
    background: transparent;
}

#plansSection .plan-card {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.10) !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#plansSection .plan-card.plan-lite {
    border-color: rgba(46, 229, 255, 0.34) !important;
    background: rgba(46, 229, 255, 0.08) !important;
}

#plansSection .plan-card.plan-pro {
    border-color: rgba(255, 59, 189, 0.38) !important;
    background: rgba(255, 59, 189, 0.09) !important;
}

[data-theme="light"] #plansSection .plan-card {
    background: rgba(255, 255, 255, 0.54) !important;
    border: 1px solid rgba(255, 90, 210, 0.35) !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.09) !important;
}

[data-theme="light"] #plansSection .plan-card.plan-lite {
    background: rgba(46, 229, 255, 0.12) !important;
    border-color: rgba(46, 229, 255, 0.44) !important;
}

[data-theme="light"] #plansSection .plan-card.plan-pro {
    background: rgba(255, 59, 189, 0.12) !important;
    border-color: rgba(255, 59, 189, 0.44) !important;
}

a {
    color: rgba(46, 229, 255, .95);
}

.app {
    max-width: 980px;
    margin: 0 auto;

    /* ✅ Safe area bottom (iOS) */
    padding: 18px 14px calc(40px + env(safe-area-inset-bottom));
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: linear-gradient(to bottom, rgba(11, 11, 16, .78), rgba(11, 11, 16, .35));
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    padding: 14px 14px 10px;
    margin: -18px -14px 14px;
}

/* Athlete shell: the top bar is deliberately limited to immediate actions.
   Navigation and account actions live in the app drawer below. */
.client-topbar-actions { display:flex; gap:10px; align-items:center; position:relative; }
.client-shell-legacy { display:none !important; }
.client-nav-backdrop { position:fixed; inset:0; z-index:89; background:rgba(0,0,0,.48); backdrop-filter:blur(2px); -webkit-backdrop-filter:blur(2px); }
.client-nav-backdrop[hidden] { display:none; }
.client-nav-drawer { position:fixed; inset:0 auto 0 0; width:min(360px, 88vw); z-index:90; display:flex; flex-direction:column; background:linear-gradient(180deg, rgba(17,17,26,.99), rgba(8,9,15,.99)); border-right:1px solid rgba(255,255,255,.14); box-shadow:12px 0 36px rgba(0,0,0,.42); transform:translateX(-104%); transition:transform .2s ease; padding:calc(12px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)); }
.client-nav-drawer.open { transform:translateX(0); }
.client-nav-drawer__header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:8px 2px 17px; border-bottom:1px solid rgba(255,255,255,.12); }
.client-nav-drawer__header strong { display:block; margin-top:5px; font-size:18px; }.client-nav-drawer__header small { display:block; margin-top:3px; color:var(--muted); font-size:12px; }
.client-nav-drawer__eyebrow { color:var(--gradB); font-size:10px; letter-spacing:.09em; font-weight:900; }
.client-nav-drawer__links { display:grid; gap:6px; padding-top:16px; }
.client-nav-drawer__links button, .client-nav-drawer__footer button, .client-nav-drawer__footer a { border:0; background:transparent; color:var(--text); padding:12px 10px; width:100%; border-radius:12px; display:flex; align-items:center; gap:12px; text-align:left; text-decoration:none; font:inherit; cursor:pointer; }
.client-nav-drawer__links button:hover, .client-nav-drawer__links button:focus-visible, .client-nav-drawer__footer button:hover, .client-nav-drawer__footer a:hover { background:rgba(46,229,255,.10); outline:none; }
.client-nav-drawer__links span, .client-nav-drawer__footer span { width:20px; text-align:center; color:var(--gradB); }.client-nav-drawer__footer { margin-top:auto; padding-top:14px; border-top:1px solid rgba(255,255,255,.12); display:grid; gap:3px; }.client-nav-drawer__footer .is-danger { color:#ff809d; }
[data-theme="light"] .client-nav-drawer { background:linear-gradient(180deg, rgba(253,253,255,.99), rgba(244,245,251,.99)); border-color:rgba(0,0,0,.12); box-shadow:12px 0 36px rgba(0,0,0,.18); }.client-nav-drawer__footer .is-danger { color:#b20e47; }

[data-theme="light"] .topbar {
    background: linear-gradient(to bottom, rgba(248, 248, 252, .92), rgba(248, 248, 252, .65));
    border-bottom: 1px solid rgba(0, 0, 0, .10);
}

.brand {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
}

.title {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: .2px;
    margin: 0;
    line-height: 1.1;
    background: linear-gradient(90deg, var(--gradA), var(--gradB));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 22px rgba(255, 59, 189, .18);
}

.subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.pill {
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .06);
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--muted);
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    white-space: nowrap;
}

.appVersionBadge {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .4px;
    color: var(--gradB);
    border: 1px solid rgba(46, 229, 255, .35);
    background: rgba(46, 229, 255, .10);
}

[data-theme="light"] .appVersionBadge {
    color: #0d6f80;
    border-color: rgba(13, 111, 128, .35);
    background: rgba(13, 111, 128, .10);
}

/* Mobile Optimizations for Topbar */
@media (max-width: 600px) {
    .topbar {
        padding: 10px 12px 8px;
        /* Reduce padding */
    }

    .brand {
        align-items: center;
        /* Center vertically */
    }

    .topbar .title {
        font-size: 18px;
        /* Smaller title */
        margin-bottom: 2px;
    }

    .topbar .subtitle {
        font-size: 11px;
        /* Smaller subtitle */
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        /* Limit to 2 lines max */
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-top: 2px;
    }

    #pill {
        max-width: 80px;
        /* Force pill to be smaller */
        font-size: 10px;
        padding: 4px 8px;
    }

    #btnLogout {
        padding: 6px 8px !important;
        font-size: 11px !important;
    }

    .appVersionBadge {
        margin-top: 6px;
        font-size: 9px;
        padding: 2px 7px;
    }
}

.dates {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    overflow: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}

.dateBtn {
    flex: 0 0 auto;
    border: 1px solid var(--btn-premium-border);
    background: var(--btn-premium-bg);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 13px;
    cursor: pointer;
    transition: .2s transform, .2s background, .2s border, .2s box-shadow;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.dateBtn:hover {
    transform: translateY(-2px);
    box-shadow: var(--btn-premium-glow-hover);
}

.dateBtn.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    opacity: 1;
}

.dateBtn.completed {
    background-color: rgba(0, 255, 127, 0.2);
    /* Low opacity green */
    color: var(--ok);
    border: 1px solid var(--ok);
}

.dateBtn.active.completed {
    background-color: var(--ok);
    color: #000;
    box-shadow: 0 0 10px var(--ok);
}

.dateBtn.review-pending {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffd54f;
    border: 1px solid #ffc107;
}

.dateBtn.active.review-pending {
    background-color: #ffc107;
    color: #000;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.55);
    border-color: #ffc107;
}

.dateBtn.review-reviewed {
    background-color: rgba(0, 255, 127, 0.2);
    color: var(--ok);
    border: 1px solid var(--ok);
}

.dateBtn.active.review-reviewed {
    background-color: var(--ok);
    color: #000;
    box-shadow: 0 0 10px var(--ok);
    border-color: var(--ok);
}

[data-theme="light"] .dateBtn {
    border: 1px solid rgba(255, 59, 189, .24);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(245, 247, 252, 0.92));
    color: rgba(0, 0, 0, .85);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08), 0 0 10px rgba(255, 59, 189, 0.08);
}

[data-theme="light"] .dateBtn.active {
    border: 2px solid rgba(255, 59, 189, .55);
    background: linear-gradient(135deg, rgba(255, 59, 189, .25), rgba(46, 229, 255, .20));
    color: rgba(0, 0, 0, .92);
    box-shadow: 0 4px 12px rgba(255, 59, 189, .25), 0 2px 6px rgba(46, 229, 255, .15);
    font-weight: 900;
}

[data-theme="light"] .dateBtn.completed {
    background-color: rgba(0, 212, 161, 0.15);
    color: var(--ok);
    border: 1px solid var(--ok);
}

[data-theme="light"] .dateBtn.active.completed {
    background-color: var(--ok);
    color: #fff;
    /* White text on green background for better contrast */
    box-shadow: 0 4px 12px rgba(0, 212, 161, 0.4);
    border-color: var(--ok);
}

[data-theme="light"] .dateBtn.review-pending {
    background-color: rgba(255, 193, 7, 0.2);
    color: #8a6d00;
    border: 1px solid #e0a800;
}

[data-theme="light"] .dateBtn.active.review-pending {
    background-color: #ffc107;
    color: #000;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.45);
    border-color: #e0a800;
}

[data-theme="light"] .dateBtn.review-reviewed {
    background-color: rgba(0, 212, 161, 0.15);
    color: var(--ok);
    border: 1px solid var(--ok);
}

[data-theme="light"] .dateBtn.active.review-reviewed {
    background-color: var(--ok);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 212, 161, 0.4);
    border-color: var(--ok);
}

.historyCalendarBox {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.historyCalendarPanel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    padding: 10px;
}

.historyCalendarToolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.historyCalendarNavBtn {
    min-width: 36px;
    padding: 8px 10px;
}

.historyCalendarMonthLabel {
    flex: 1;
    text-align: center;
}

.historyCalendarGrid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.historyCalendarWeekday {
    font-size: 11px;
    text-align: center;
    opacity: .72;
    font-weight: 800;
    letter-spacing: .4px;
}

.historyCalendarDay {
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .05);
    color: var(--text);
    border-radius: 10px;
    min-height: 34px;
    font-size: 12px;
    cursor: pointer;
    transition: .15s transform, .15s background, .15s border;
}

.historyCalendarDay:hover {
    transform: translateY(-1px);
}

.historyCalendarDay.empty {
    border-color: transparent;
    background: transparent;
    cursor: default;
}

.historyCalendarDay.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    font-weight: 800;
}

.historyCalendarDay.today {
    box-shadow: inset 0 0 0 1px rgba(46, 229, 255, 0.42);
}

.historyCalendarDay.has-workout {
    border-color: var(--gradB);
    box-shadow: inset 0 0 0 1px rgba(46, 229, 255, 0.35);
}

.historyCalendarDay.review-pending {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffd54f;
    border: 1px solid #ffc107;
}

.historyCalendarDay.active.review-pending {
    background-color: #ffc107;
    color: #000;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.55);
    border-color: #ffc107;
}

.historyCalendarDay.review-reviewed,
.historyCalendarDay.completed {
    background-color: rgba(0, 255, 127, 0.2);
    color: var(--ok);
    border: 1px solid var(--ok);
}

.historyCalendarDay.active.review-reviewed,
.historyCalendarDay.active.completed {
    background-color: var(--ok);
    color: #000;
    box-shadow: 0 0 10px var(--ok);
    border-color: var(--ok);
}

.copyWeekTargetPicker {
    position: relative;
}

.copyWeekTargetPickerBtn {
    width: 100%;
    justify-content: flex-start;
    min-height: 42px;
    font-weight: 700;
    padding: 8px 12px;
    line-height: 1.2;
}

.copyWeekTargetPickerBtn.is-empty {
    color: var(--muted);
    font-weight: 600;
}

.copyWeekTargetCalendarPanel {
    position: fixed;
    top: 0;
    left: 0;
    width: 360px;
    max-width: calc(100vw - 16px);
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 10px;
    background: rgba(7, 10, 14, 0.96);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 8px;
    z-index: 1200;
    visibility: hidden;
    pointer-events: none;
}

.copyWeekTargetCalendarPanel.open {
    visibility: visible;
    pointer-events: auto;
}

.copyWeekTargetCalendarToolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.copyWeekTargetCalendarToolbar .historyCalendarMonthLabel {
    font-size: 14px;
    padding: 6px 8px;
}

.copyWeekTargetCalendarToolbar .historyCalendarNavBtn {
    min-width: 32px;
    padding: 6px 8px;
}

.copyWeekTargetCalendarGrid {
    gap: 4px;
}

.copyWeekTargetCalendarGrid .historyCalendarWeekday {
    font-size: 10px;
}

.copyWeekTargetCalendarGrid .historyCalendarDay {
    min-height: 30px;
    font-size: 11px;
    border-radius: 8px;
}

.copyWeekTargetCalendarDay.has-workout {
    border-color: var(--gradB);
    box-shadow: inset 0 0 0 1px rgba(46, 229, 255, 0.42);
}

[data-theme="light"] .historyCalendarPanel {
    border: 1px solid rgba(0, 0, 0, .14);
    background: rgba(255, 255, 255, .88);
}

[data-theme="light"] .historyCalendarDay {
    border: 1px solid rgba(0, 0, 0, .15);
    background: rgba(255, 255, 255, .85);
    color: rgba(0, 0, 0, .85);
}

[data-theme="light"] .historyCalendarDay.has-workout {
    border-color: rgba(46, 229, 255, .7);
    box-shadow: inset 0 0 0 1px rgba(46, 229, 255, 0.35);
}

[data-theme="light"] .historyCalendarDay.review-pending {
    background-color: rgba(255, 193, 7, 0.2);
    color: #8a6d00;
    border: 1px solid #e0a800;
}

[data-theme="light"] .historyCalendarDay.active.review-pending {
    background-color: #ffc107;
    color: #000;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.45);
    border-color: #e0a800;
}

[data-theme="light"] .historyCalendarDay.review-reviewed,
[data-theme="light"] .historyCalendarDay.completed {
    background-color: rgba(0, 212, 161, 0.15);
    color: var(--ok);
    border: 1px solid var(--ok);
}

[data-theme="light"] .historyCalendarDay.active.review-reviewed,
[data-theme="light"] .historyCalendarDay.active.completed {
    background-color: var(--ok);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 212, 161, 0.4);
    border-color: var(--ok);
}

[data-theme="light"] .copyWeekTargetCalendarPanel {
    border-color: rgba(0, 0, 0, .16);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
}

[data-theme="light"] .copyWeekTargetCalendarDay.has-workout {
    border-color: rgba(46, 229, 255, .9);
    box-shadow: inset 0 0 0 1px rgba(46, 229, 255, 0.45);
}

.grid {
    display: grid;
    gap: 12px;
}

@media(min-width: 860px) {
    .grid {
        grid-template-columns: 1fr 1fr;
    }

    .grid .full {
        grid-column: 1 / -1;
    }
}

/* =========================================
   ESTADO BASE (INACTIVO / GRIS)
   ========================================= */

.training-block {
    background-color: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Cabecera Inactiva */
.training-block .block-header {
    background: var(--bg-inactive-header);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.training-block .block-title {
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial;
    font-weight: 900;
    color: var(--text-inactive-title);
    margin: 0;
    font-size: 1.25rem;
    transition: color 0.3s ease;
}

.training-block .block-date {
    background: var(--bg-card);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-inactive-body);
}

/* Contenido de la tarjeta */
.training-block .block-content {
    padding: 16px;
    color: var(--text-inactive-body);
}

.training-block .comment-label {
    margin: 14px 0 8px;
    font-size: 12px;
    color: var(--text-inactive-body);
    font-weight: 700;
    letter-spacing: 0.2px;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* Botón de Guardado Inactivo */
.training-block .save-btn {
    background: var(--bg-inactive-header);
    color: var(--text-inactive-title);
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* =========================================
   ESTADO ACTIVO (.is-active)
   ========================================= */

/* Borde / Resplandor de la Tarjeta Activa */
.training-block.is-active {
    border-color: rgba(255, 59, 189, 0.65);
    box-shadow: var(--brand-glow-strong), 0 10px 22px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Fondo de Cabecera con Degradado Corporativo */
.training-block.is-active .block-header {
    background: linear-gradient(90deg, var(--brand-grad-start), var(--brand-grad-end));
}

/* Texto de Cabecera Blanco */
.training-block.is-active .block-title {
    color: var(--text-active);
}

/* Botón de Guardado con Degradado Corporativo y Glow */
.training-block.is-active .save-btn {
    background: linear-gradient(90deg, var(--brand-grad-start), var(--brand-grad-end));
    color: var(--text-active);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.26), 0 0 16px rgba(255, 59, 189, 0.52), 0 0 26px rgba(46, 229, 255, 0.42);
}

.training-block.is-active .comment-label {
    color: var(--comment-active-cyan);
    text-shadow: 0 0 10px rgba(29, 111, 149, 0.22);
}

.card {
    border: 1px solid var(--stroke);
    background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .04));
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Allow destination-week dropdown calendar to escape card bounds */
#workoutEditorCard,
#workoutEditorCard .cardBody {
    overflow: visible;
}

.editorMainActionsRow {
    justify-content: flex-start;
}

.editorMainActionsRow #btnCloseEditor {
    margin-left: auto;
}

[data-theme="light"] .card {
    border: 2px solid rgba(0, 0, 0, .12);
    background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(248, 248, 252, .85));
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08), 0 2px 6px rgba(0, 0, 0, .04);
}

.cardHeader {
    padding: 14px 14px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.badge {
    font-weight: 900;
    font-size: 13px;
    letter-spacing: .6px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
}

[data-theme="light"] .badge {
    background: rgba(0, 0, 0, .05);
    border: 1px solid rgba(0, 0, 0, .15);
    color: rgba(0, 0, 0, .85);
}

.badge.neon {
    background: linear-gradient(90deg, rgba(255, 59, 189, .22), rgba(46, 229, 255, .18));
    border-color: rgba(255, 255, 255, .14);
    box-shadow: 0 0 22px rgba(46, 229, 255, .12);
}

[data-theme="light"] .badge.neon {
    background: linear-gradient(90deg, rgba(255, 59, 189, .35), rgba(46, 229, 255, .28));
    border: 2px solid rgba(255, 59, 189, .45);
    box-shadow: 0 4px 12px rgba(255, 59, 189, .25), 0 0 20px rgba(46, 229, 255, .15);
    color: rgba(0, 0, 0, .92);
}

.cardBody {
    padding: 14px;
}

.video-library-scroll-list {
    --video-library-item-height: 118px;
    margin-top: 12px;
    display: grid;
    gap: 10px;
    max-height: 374px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-right: 4px;
}

.video-library-card {
    min-height: var(--video-library-item-height);
}

.content {
    white-space: pre-wrap;
    line-height: 1.45;
    color: rgba(255, 255, 255, .90);
    font-size: 14px;
}

[data-theme="light"] .content {
    color: rgba(0, 0, 0, .88);
}

.content a {
    text-decoration: underline;
    text-underline-offset: 3px;
    word-break: break-word;
}

.label {
    margin: 14px 0 8px;
    font-size: 12px;
    color: var(--muted);
}

textarea,
input,
select {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(0, 0, 0, .25);
    color: var(--text);
    padding: 12px 12px;
    outline: none;
}

[data-theme="light"] textarea,
[data-theme="light"] input,
[data-theme="light"] select {
    border: 1px solid rgba(0, 0, 0, .20);
    background: rgba(255, 255, 255, .85);
    color: rgba(0, 0, 0, .88);
}

textarea {
    min-height: 92px;
    resize: vertical;
}

textarea:focus,
input:focus,
select:focus {
    border-color: rgba(46, 229, 255, .35);
    box-shadow: 0 0 0 4px rgba(46, 229, 255, .10);
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    flex-wrap: wrap;
}

.btn {
    border: 1px solid var(--btn-premium-border);
    background: var(--btn-premium-bg);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    transition: .2s transform, .2s background, .2s border, .2s box-shadow, .2s filter;
    box-shadow: var(--btn-premium-glow);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

[data-theme="light"] .btn {
    border: 1px solid rgba(255, 59, 189, .26);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 253, 0.95));
    color: rgba(0, 0, 0, .88);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08), 0 0 12px rgba(255, 59, 189, .10);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--btn-premium-glow-hover);
    filter: saturate(1.08);
}

[data-theme="light"] .btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, .30);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .10), 0 2px 4px rgba(0, 0, 0, .06);
}

.btn.primary {
    border-color: var(--btn-premium-primary-border);
    background: var(--btn-premium-primary-bg);
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
    box-shadow: var(--btn-premium-primary-shadow);
}

[data-theme="light"] .btn.primary {
    border: 1px solid rgba(255, 59, 189, .48);
    background: linear-gradient(90deg, rgba(255, 59, 189, .86), rgba(46, 229, 255, .82));
    color: #fff;
    box-shadow: 0 8px 18px rgba(255, 59, 189, .26), 0 4px 10px rgba(46, 229, 255, .18);
    font-weight: 900;
}

.btn.danger {
    border-color: rgba(255, 59, 122, .45);
    background: rgba(255, 59, 122, .12);
}

[data-theme="light"] .btn.danger {
    border: 2px solid rgba(255, 59, 122, .60);
    background: rgba(255, 59, 122, .22);
    color: rgba(0, 0, 0, .92);
    box-shadow: 0 4px 12px rgba(255, 59, 122, .25), 0 2px 4px rgba(255, 59, 122, .12);
    font-weight: 900;
}

.toast {
    position: fixed;
    left: 50%;

    /* ✅ Safe area bottom (iOS) */
    bottom: calc(18px + env(safe-area-inset-bottom));

    transform: translateX(-50%);
    background: rgba(0, 0, 0, .60);
    border: 1px solid rgba(255, 255, 255, .14);
    padding: 10px 12px;
    border-radius: 999px;
    color: var(--text);
    font-size: 13px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    z-index: 20;
}

/* ✅ Overlay grande */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 18px;
}

.overlay.show {
    display: flex;
}

.overlayCard {
    width: min(520px, 100%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .06));
    box-shadow: 0 18px 60px rgba(0, 0, 0, .55);
    padding: 18px 16px;
    text-align: center;
}

.overlayTitle {
    margin: 0;
    font-weight: 1000;
    font-size: 18px;
    letter-spacing: .2px;
    background: linear-gradient(90deg, rgba(255, 59, 189, .95), rgba(46, 229, 255, .95));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.overlaySub {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, .78);
    font-size: 14px;
    line-height: 1.35;
}

.whats-new-card {
    text-align: left;
}

.whats-new-list {
    margin: 14px 0 0;
    padding-left: 20px;
    display: grid;
    gap: 9px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
}

.whats-new-list li::marker {
    color: var(--gradB);
}

.whats-new-checkbox {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
}

.whats-new-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--gradA);
}

.whats-new-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

[data-theme="light"] .whats-new-list {
    color: rgba(0, 0, 0, 0.84);
}

[data-theme="light"] .whats-new-checkbox {
    color: rgba(0, 0, 0, 0.68);
}

.spinner {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, .20);
    border-top-color: rgba(46, 229, 255, .90);
    margin: 14px auto 0;
    animation: spin .9s linear infinite;
}

/* Theme Toggle Button */
.themeToggle {
    border: 1px solid var(--btn-premium-border);
    background: var(--btn-premium-bg);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 16px;
    transition: .2s transform, .2s background, .2s border, .2s box-shadow;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    box-shadow: var(--btn-premium-glow);
}

.themeToggle:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: var(--btn-premium-glow-hover);
}

.themeToggle:active {
    transform: scale(0.95);
}

[data-theme="light"] .themeToggle {
    border-color: rgba(255, 59, 189, .28);
    background: linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(246, 248, 253, .95));
    box-shadow: 0 3px 10px rgba(0, 0, 0, .08), 0 0 10px rgba(255, 59, 189, .10);
}

[data-theme="light"] .themeToggle:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(250, 252, 255, 0.98));
}

.client-checkin-btn {
    width: 100%;
    margin-top: 20px;
    padding: 14px 16px;
    font-size: 1.05rem;
    font-weight: 900;
    border-radius: 16px;
}

.client-checkin-btn.is-pending {
    border-color: rgba(255, 255, 255, 0.3);
}

.client-checkin-btn.is-completed {
    border-color: rgba(0, 212, 161, 0.62);
    background: linear-gradient(90deg, rgba(0, 212, 161, 0.94), rgba(46, 229, 255, 0.84));
    color: #001e17;
    box-shadow: 0 10px 24px rgba(0, 212, 161, 0.24), 0 0 16px rgba(46, 229, 255, 0.18);
}

[data-theme="light"] .client-checkin-btn.is-completed {
    color: #05312a;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Client Info Styles in Coach Panel */
.clientInfoContent {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--stroke);
    color: var(--text);
}

.notesSection {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--stroke);
    font-size: 0.95em;
    color: var(--muted);
    line-height: 1.4;
}

[data-theme="light"] .clientInfoContent {
    background: rgba(0, 0, 0, 0.03);
    color: #333;
}

[data-theme="light"] .notesSection {
    color: #555;
}

/* Mobile Optimizations for Coach Topbar */
@media (max-width: 768px) {
    .topbar .brand {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Primera línea: Título y Editar */
    .topbar .brand>div:first-child {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
    }

    .topbar .title {
        font-size: 18px;
    }

    .topbar .subtitle {
        display: none;
    }

    /* Segunda línea: Botones de herramientas */
    .topbar .brand>div:last-child {
        width: 100%;
        justify-content: space-between;
        margin-top: 4px;
    }

    #pill {
        display: none !important;
    }

    #btnEditBrand {
        padding: 4px 8px;
        font-size: 10px;
    }

    #themeToggle,
    #btnLogout {
        padding: 6px 10px;
        font-size: 11px;
    }

    #planPill {
        font-size: 10px;
        padding: 2px 6px;
        white-space: nowrap;
        flex-shrink: 0;
        margin-left: auto;
    }
}

/* Demo Button Styles (Always Visible) */
#btnDemo {
    background: var(--gradB);
    /* Cyan/Blue High Visibility */
    color: #000000;
    /* Dark text for contrast */
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(46, 229, 255, 0.4);
}

#btnDemo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 229, 255, 0.6);
}

/* Feedback Details UI */
.feedback-details {
    margin-top: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

[data-theme="light"] .feedback-details {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.feedback-details summary {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--muted);
    transition: background 0.2s, color 0.2s;
    user-select: none;
    outline: none;
    /* Hide default arrow in modern browsers */
    list-style: none;
}

.feedback-details summary::-webkit-details-marker {
    display: none;
}

.feedback-details summary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

[data-theme="light"] .feedback-details summary:hover {
    background: rgba(0, 0, 0, 0.03);
}

.feedback-details.empty summary {
    cursor: default;
}

.feedback-details.empty summary:hover {
    background: transparent;
}

.feedback-content {
    padding: 12px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .feedback-content {
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Coach Reply UI */
.coach-message details {
    border: none;
    box-shadow: 0 4px 15px rgba(46, 229, 255, 0.15);
}

.coach-message summary {
    font-weight: 800;
    transition: all 0.2s;
}

.coach-message summary:hover {
    background: rgba(46, 229, 255, 0.1);
}

[data-theme="light"] .coach-message details {
    background: rgba(46, 229, 255, 0.1) !important;
    box-shadow: 0 4px 15px rgba(46, 229, 255, 0.2);
}

[data-theme="light"] .coach-message .feedback-content {
    background: transparent !important;
    border-top: 1px solid rgba(46, 229, 255, 0.3) !important;
}

textarea#coachReplyInput:focus {
    border-color: var(--gradB);
    box-shadow: 0 0 0 4px rgba(46, 229, 255, 0.15);
}

/* Notifications UI */
.coach-global-notif-dropdown {
    position: absolute;
    top: 120%;
    right: 0;
    width: min(420px, 94vw);
    max-height: min(72vh, 560px);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    flex-direction: column;
    overflow: hidden;
}

.coach-global-notif-header {
    padding: 14px 18px;
    font-weight: 900;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: 1.12rem;
    line-height: 1.1;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.coach-global-notif-list {
    max-height: min(56vh, 430px);
    overflow-y: auto;
}

.coach-global-notif-empty {
    padding: 18px;
    text-align: center;
    opacity: 0.75;
    font-size: 14px;
    color: var(--text);
}

.coach-global-notif-item {
    width: 100%;
    padding: 12px 16px;
    cursor: pointer;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    transition: background 0.2s;
    border: none;
    background: transparent;
    color: var(--text);
    text-align: left;
}

.coach-global-notif-icon {
    font-size: 1.25rem;
    line-height: 1;
    align-self: start;
    margin-top: 3px;
}

.coach-global-notif-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.coach-global-notif-athlete {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coach-global-notif-summary {
    font-size: 0.98rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coach-global-notif-count {
    color: #ff3bbd;
    font-weight: 900;
}

.coach-global-notif-day {
    color: #14d8f8;
    font-weight: 900;
}

.coach-global-notif-tags {
    opacity: 0.8;
    font-size: 0.82rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.notif-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* inline overridden if needed */
}

/* Light theme for Notifications */
[data-theme="light"] .notif-dropdown {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] .coach-global-notif-header {
    border-bottom-color: rgba(0, 0, 0, 0.1);
    color: #202125;
}

[data-theme="light"] .coach-global-notif-athlete,
[data-theme="light"] .coach-global-notif-summary {
    color: #2a2d35;
}

[data-theme="light"] .coach-global-notif-tags {
    color: #595f6c;
    opacity: 1;
}

[data-theme="light"] .notif-dropdown>div:first-child {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .notif-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .notif-item:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

/* Coach Notes Floating Window */
.coach-notes-window {
    position: fixed;
    right: 16px;
    top: 96px;
    width: min(520px, calc(100vw - 24px));
    max-height: calc(100dvh - 110px);
    display: none;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(16, 16, 22, 0.97), rgba(10, 10, 16, 0.98));
    box-shadow: 0 18px 56px rgba(0, 0, 0, 0.52);
    z-index: 95;
    overflow: hidden;
}

.coach-notes-window.open {
    display: flex;
}

.coach-notes-window.dragging {
    user-select: none;
    cursor: grabbing;
}

.coach-notes-window.resizing {
    user-select: none;
}

.coach-notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.03);
    cursor: grab;
}

.coach-notes-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.coach-notes-subtitle {
    font-size: 12px;
    color: var(--muted);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.coach-notes-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.coach-notes-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    flex: 1;
    padding: 10px;
}

.coach-note-modal-card {
    width: min(680px, 96vw);
    max-width: 96vw;
    text-align: left;
}

.coach-note-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.coach-note-modal-date {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.coach-note-modal-body {
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    padding: 10px;
    max-height: min(58dvh, 460px);
    overflow: auto;
    line-height: 1.4;
}

.coach-notes-editor {
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.coach-notes-editor .label {
    margin-top: 6px;
}

.coach-notes-editor .label:first-child {
    margin-top: 0;
}

.coach-notes-list {
    min-height: 120px;
    max-height: calc(100dvh - 355px);
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding-right: 2px;
}

.coach-notes-empty {
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 11px;
    padding: 12px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.coach-note-item {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 11px;
    padding: 9px;
    cursor: pointer;
}

.coach-note-item:focus-visible {
    outline: 2px solid var(--gradB);
    outline-offset: 1px;
}

.coach-note-item.active {
    border-color: rgba(83, 191, 255, 0.55);
    background: rgba(83, 191, 255, 0.10);
}

.coach-note-item.pending {
    border-style: dashed;
    opacity: 0.78;
}

.coach-note-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.coach-note-item-head strong {
    font-size: 14px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coach-note-item-head span {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}

.coach-note-item-body {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.35;
    color: var(--text);
    white-space: normal;
    overflow-wrap: anywhere;
}

.coach-note-item-actions {
    margin-top: 8px;
    display: inline-flex;
    gap: 7px;
}

.coach-notes-resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 22px;
    height: 22px;
    cursor: nwse-resize;
    border-top-left-radius: 8px;
    background:
        linear-gradient(135deg,
            transparent 0,
            transparent 38%,
            rgba(255, 255, 255, 0.42) 39%,
            rgba(255, 255, 255, 0.42) 45%,
            transparent 46%,
            transparent 56%,
            rgba(255, 255, 255, 0.42) 57%,
            rgba(255, 255, 255, 0.42) 63%,
            transparent 64%,
            transparent 74%,
            rgba(255, 255, 255, 0.42) 75%,
            rgba(255, 255, 255, 0.42) 81%,
            transparent 82%);
    opacity: 0.78;
}

.coach-notes-resize-handle:focus-visible {
    outline: 2px solid var(--gradB);
    outline-offset: -2px;
}

@media (max-width: 899px) {
    .coach-notes-window {
        left: 0;
        right: 0;
        top: 0;
        width: 100vw;
        max-height: 100dvh;
        height: 100dvh;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .coach-notes-header {
        cursor: default;
    }

    .coach-notes-list {
        max-height: none;
        flex: 1;
    }

    .coach-notes-resize-handle {
        display: none;
    }
}

[data-theme="light"] .coach-notes-window {
    background: linear-gradient(180deg, rgba(252, 252, 255, 0.99), rgba(246, 247, 252, 0.99));
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.14);
}

[data-theme="light"] .coach-notes-header {
    border-bottom-color: rgba(0, 0, 0, 0.10);
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .coach-notes-empty {
    border-color: rgba(0, 0, 0, 0.14);
}

[data-theme="light"] .coach-notes-editor,
[data-theme="light"] .coach-note-item {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .coach-note-modal-body {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.015);
}

[data-theme="light"] .coach-note-item.active {
    border-color: rgba(19, 123, 185, 0.4);
    background: rgba(19, 123, 185, 0.08);
}

[data-theme="light"] .coach-notes-resize-handle {
    background:
        linear-gradient(135deg,
            transparent 0,
            transparent 38%,
            rgba(0, 0, 0, 0.28) 39%,
            rgba(0, 0, 0, 0.28) 45%,
            transparent 46%,
            transparent 56%,
            rgba(0, 0, 0, 0.28) 57%,
            rgba(0, 0, 0, 0.28) 63%,
            transparent 64%,
            transparent 74%,
            rgba(0, 0, 0, 0.28) 75%,
            rgba(0, 0, 0, 0.28) 81%,
            transparent 82%);
}

/* Chat Drawer UI */
.chat-drawer {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    height: 100dvh;
    width: min(420px, 94vw);
    background: linear-gradient(180deg, rgba(15, 15, 20, 0.96), rgba(9, 9, 14, 0.98));
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: -10px 0 28px rgba(0, 0, 0, 0.45);
    z-index: 80;
    transform: translateX(100%);
    transition: transform .22s ease;
    display: flex;
    flex-direction: column;
}

/* Profile and conversations are routes, not cramped side drawers. Their
   existing nodes remain in place so established data/event logic is reused. */
.chat-drawer.client-route-page { left:0; right:0; width:100%; max-width:none; border-left:0; box-shadow:none; transform:translateX(102%); z-index:88; }
.chat-drawer.client-route-page.open { transform:translateX(0); }
.chat-drawer.client-route-page .chat-drawer-header { padding:calc(13px + env(safe-area-inset-top)) max(16px, calc((100vw - 980px) / 2 + 16px)) 12px; background:var(--bg); border-bottom:1px solid var(--border); }
.chat-drawer.client-route-page .chat-messages, .chat-drawer.client-route-page .client-profile-body { width:min(980px, 100%); margin:0 auto; box-sizing:border-box; padding:18px max(16px, calc((100vw - 980px) / 2 + 16px)); }
.chat-drawer.client-route-page .chat-composer { padding:12px max(16px, calc((100vw - 980px) / 2 + 16px)) calc(14px + env(safe-area-inset-bottom)); background:var(--bg); }
.chat-drawer.client-route-page .client-profile-body { overflow-y:auto; align-content:start; max-width:980px; }
@media (max-width:600px) { .topbar { margin-bottom:8px; }.topbar .brand>div:first-child { width:auto; }.topbar .subtitle, .topbar .appVersionBadge { display:none; }.topbar .brand { align-items:center; }.client-topbar-actions { gap:7px; }.chat-drawer.client-route-page .chat-messages { padding:12px; }.chat-drawer.client-route-page .chat-composer { padding:9px 12px calc(10px + env(safe-area-inset-bottom)); }.chat-drawer.client-route-page .client-profile-body { padding:12px; } }

/* Client Timer Drawer UI */
.client-timer-drawer {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 50dvh;
    max-height: 50dvh;
    z-index: 82;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    background:
        linear-gradient(180deg, rgba(13, 14, 24, 0.97), rgba(8, 9, 15, 0.98)),
        radial-gradient(110% 120% at 0% 0%, rgba(255, 59, 189, 0.16), transparent 62%),
        radial-gradient(110% 120% at 100% 0%, rgba(46, 229, 255, 0.14), transparent 60%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform: translateY(-104%);
    transition: transform .22s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: env(safe-area-inset-top);
}

.client-timer-drawer.open {
    transform: translateY(0);
}

.client-timer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.client-timer-header .btn {
    min-height: 40px;
    min-width: 44px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1;
}

.client-timer-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 12px;
    display: grid;
    grid-template-rows: auto auto auto auto;
    gap: 10px;
    scrollbar-width: thin;
}

.client-timer-display-wrap,
.client-timer-config,
.client-timer-hint {
    transition: opacity .16s ease;
}

.client-timer-display-wrap {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.28);
}

.client-timer-display {
    font-size: clamp(44px, 10.8vw, 68px);
    line-height: 0.95;
    letter-spacing: 0.02em;
    font-weight: 1000;
    font-variant-numeric: tabular-nums;
    text-align: center;
    color: #f6fdff;
    text-shadow:
        0 2px 0 rgba(0, 0, 0, 0.45),
        0 0 14px rgba(46, 229, 255, 0.24),
        0 0 18px rgba(255, 59, 189, 0.14);
    user-select: none;
}

.client-timer-status {
    margin-top: 8px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.client-timer-config {
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
}

.client-timer-config select {
    min-height: 42px;
}

.client-timer-config-block {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.client-timer-input-group {
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    padding: 8px;
}

.client-timer-input-title {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}

.client-timer-minsec {
    display: flex;
    align-items: center;
    gap: 6px;
}

.client-timer-minsec input {
    text-align: center;
    font-weight: 800;
    min-height: 40px;
    padding: 10px 8px;
}

.client-timer-minsec span {
    font-size: 20px;
    font-weight: 900;
    color: var(--text);
    line-height: 1;
    margin-top: -2px;
}

.client-timer-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.client-timer-controls .btn {
    min-height: 42px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.2;
}

.client-timer-drawer.timer-config-state .client-timer-display-wrap {
    display: none;
}

.client-timer-drawer.timer-config-state .client-timer-body {
    grid-template-rows: auto auto auto;
    align-content: start;
}

.client-timer-drawer.timer-active-state .client-timer-config,
.client-timer-drawer.timer-active-state .client-timer-hint {
    display: none;
}

.client-timer-drawer.timer-active-state .client-timer-body {
    grid-template-rows: 1fr auto;
    align-content: stretch;
    padding-top: 10px;
}

.client-timer-drawer.timer-active-state .client-timer-display-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    padding: 16px 12px;
}

.client-timer-drawer.timer-active-state .client-timer-display {
    font-size: clamp(72px, 22vw, 132px);
    line-height: 0.88;
}

.client-timer-drawer.timer-active-state .client-timer-status {
    margin-top: 10px;
    font-size: 14px;
}

.client-timer-drawer.timer-active-state .client-timer-controls {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 10px;
}

.client-timer-drawer.timer-active-state .client-timer-controls .btn {
    min-height: 48px;
    font-size: 15px;
    font-weight: 900;
}

.client-timer-hint {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.35;
    border-top: 1px dashed rgba(255, 255, 255, 0.16);
    padding-top: 8px;
}

#timerToggleBtn.active {
    border-color: rgba(46, 229, 255, 0.72);
    box-shadow:
        0 0 0 2px rgba(46, 229, 255, 0.22),
        inset 0 0 20px rgba(46, 229, 255, 0.10);
}

[data-theme="light"] .client-timer-drawer {
    background:
        linear-gradient(180deg, rgba(249, 251, 255, 0.98), rgba(242, 245, 252, 0.98)),
        radial-gradient(110% 120% at 0% 0%, rgba(255, 59, 189, 0.11), transparent 62%),
        radial-gradient(110% 120% at 100% 0%, rgba(46, 229, 255, 0.11), transparent 60%);
    border-bottom-color: rgba(0, 0, 0, 0.14);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.17);
}

[data-theme="light"] .client-timer-header {
    border-bottom-color: rgba(0, 0, 0, 0.10);
}

[data-theme="light"] .client-timer-display-wrap {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.78);
}

[data-theme="light"] .client-timer-display {
    color: #12161d;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6),
        0 0 10px rgba(46, 229, 255, 0.16);
}

[data-theme="light"] .client-timer-config {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.72);
}

[data-theme="light"] .client-timer-input-group {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.92);
}

[data-theme="light"] .client-timer-input-title,
[data-theme="light"] .client-timer-status,
[data-theme="light"] .client-timer-hint {
    color: rgba(0, 0, 0, 0.68);
}

[data-theme="light"] #timerToggleBtn.active {
    border-color: rgba(13, 111, 128, 0.75);
    box-shadow:
        0 0 0 2px rgba(13, 111, 128, 0.18),
        inset 0 0 16px rgba(13, 111, 128, 0.08);
}

@media (max-width: 700px) {
    .client-timer-body {
        padding: 10px;
        gap: 8px;
    }

    .client-timer-display-wrap {
        padding: 10px;
    }

    .client-timer-display {
        font-size: clamp(40px, 12.5vw, 60px);
    }

    .client-timer-status {
        margin-top: 6px;
        font-size: 11px;
    }

    .client-timer-config {
        padding: 8px;
    }

    .client-timer-input-group {
        padding: 7px;
    }

    .client-timer-minsec input {
        min-height: 38px;
        padding: 9px 8px;
    }

    .client-timer-controls {
        gap: 6px;
    }

    .client-timer-controls .btn {
        min-height: 40px;
        font-size: 12px;
    }

    .client-timer-drawer.timer-active-state .client-timer-display {
        font-size: clamp(68px, 24vw, 120px);
    }

    .client-timer-drawer.timer-active-state .client-timer-status {
        font-size: 13px;
    }

    .client-timer-drawer.timer-active-state .client-timer-controls .btn {
        min-height: 46px;
        font-size: 14px;
    }
}

@media (min-width: 901px) {
    .client-timer-drawer {
        left: auto;
        right: 14px;
        top: calc(84px + env(safe-area-inset-top));
        width: min(480px, calc(100vw - 28px));
        height: min(50dvh, 520px);
        max-height: min(50dvh, 520px);
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 16px;
        box-shadow: 0 18px 44px rgba(0, 0, 0, 0.44);
        transform: translateY(-130%);
        padding-top: 0;
    }

    [data-theme="light"] .client-timer-drawer {
        border-color: rgba(0, 0, 0, 0.14);
        box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14);
    }
}

#clientChatDrawer.chat-drawer.open,
#clientGeneralChatDrawer.chat-drawer.open,
#clientProfileDrawer.chat-drawer.open,
#coachChatDrawer.chat-drawer.open {
    transform: translateX(0);
}

#profileToggleBtn.active {
    border-color: rgba(255, 59, 189, 0.72);
    box-shadow:
        0 0 0 2px rgba(255, 59, 189, 0.20),
        inset 0 0 18px rgba(255, 59, 189, 0.10);
}

.client-profile-drawer {
    z-index: 81;
}

.client-profile-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 12px;
    display: grid;
    gap: 12px;
    align-content: start;
}

.client-profile-section {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
}

.client-profile-section-title {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.client-pr-composer-section .client-profile-section-title {
    margin-bottom: 0;
}

.client-pr-composer-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 2px 0;
    cursor: pointer;
}

.client-pr-composer-toggle-right {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.client-pr-composer-toggle-meta {
    font-size: 11px;
    letter-spacing: 0.03em;
    font-weight: 700;
    color: var(--muted);
}

.client-pr-composer-toggle-icon {
    font-size: 14px;
    line-height: 1;
    color: var(--muted);
}

.client-pr-composer-body {
    margin-top: 10px;
}

.client-pr-composer-section.expanded {
    border-color: rgba(255, 59, 189, 0.28);
}

.client-profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.client-profile-grid.two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-profile-body textarea {
    min-height: 72px;
}

.client-pr-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-bottom: 8px;
}

.client-pr-toolbar select {
    min-height: 40px;
}

.client-pr-list {
    display: grid;
    gap: 8px;
}

.client-pr-item {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 9px 10px;
}

.client-pr-item-header {
    display: flex;
    gap: 8px;
    align-items: baseline;
    justify-content: space-between;
}

.client-pr-item-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
}

.client-pr-item-title span {
    color: var(--muted);
    font-weight: 700;
}

.client-pr-item-result {
    font-size: 13px;
    font-weight: 900;
    color: var(--gradB);
}

.client-pr-item-meta {
    margin-top: 4px;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.03em;
}

.client-pr-notes {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text);
    opacity: 0.9;
    line-height: 1.35;
    white-space: pre-wrap;
}

.client-pr-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.client-pr-item.editing {
    border-color: rgba(255, 59, 189, 0.5);
    box-shadow: 0 0 0 1px rgba(255, 59, 189, 0.18) inset;
}

.client-pr-inline-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.client-pr-inline-grid .full {
    grid-column: 1 / -1;
}

.client-pr-inline-grid input,
.client-pr-inline-grid select,
.client-pr-inline-grid textarea {
    width: 100%;
}

.client-pr-inline-grid textarea {
    min-height: 66px;
}

.client-pr-inline-label {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 4px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.client-pr-inline-result {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.client-pr-inline-meta {
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.03em;
}

[data-theme="light"] .client-profile-section {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.78);
}

[data-theme="light"] .client-pr-composer-section.expanded {
    border-color: rgba(183, 24, 108, 0.24);
}

[data-theme="light"] .client-pr-item {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .client-pr-item.editing {
    border-color: rgba(183, 24, 108, 0.42);
    box-shadow: 0 0 0 1px rgba(183, 24, 108, 0.14) inset;
}

[data-theme="light"] #profileToggleBtn.active {
    border-color: rgba(183, 24, 108, 0.62);
    box-shadow:
        0 0 0 2px rgba(183, 24, 108, 0.16),
        inset 0 0 14px rgba(183, 24, 108, 0.08);
}

@media (max-width: 700px) {
    .client-profile-body {
        padding: 10px;
        gap: 10px;
    }

    .client-profile-grid.two-cols {
        grid-template-columns: 1fr;
    }

    .client-pr-toolbar {
        grid-template-columns: 1fr;
    }

    .client-pr-inline-grid,
    .client-pr-inline-result {
        grid-template-columns: 1fr;
    }
}

.coach-chat-resize-handle {
    display: none;
}

@media (min-width: 1024px) {
    #coachChatDrawer.coach-chat-window {
        top: 96px;
        right: 12px;
        left: auto;
        width: min(420px, calc(100vw - 24px));
        height: min(680px, calc(100dvh - 110px));
        max-height: calc(100dvh - 24px);
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 16px;
        box-shadow: 0 18px 56px rgba(0, 0, 0, 0.52);
        transform: none;
        transition: none;
        display: none;
        overflow: hidden;
        z-index: 94;
    }

    #coachChatDrawer.coach-chat-window.open {
        display: flex;
    }

    #coachChatDrawer.coach-chat-window .chat-drawer-header {
        cursor: grab;
    }

    #coachChatDrawer.coach-chat-window.dragging {
        user-select: none;
        cursor: grabbing;
    }

    #coachChatDrawer.coach-chat-window.resizing {
        user-select: none;
    }

    #coachChatDrawer.coach-chat-window .chat-messages {
        min-height: 0;
    }

    #coachChatDrawer.coach-chat-window .coach-chat-resize-handle {
        display: block;
        position: absolute;
        right: 0;
        bottom: 0;
        width: 22px;
        height: 22px;
        cursor: nwse-resize;
        border-top-left-radius: 8px;
        background:
            linear-gradient(135deg,
                transparent 0,
                transparent 38%,
                rgba(255, 255, 255, 0.42) 39%,
                rgba(255, 255, 255, 0.42) 45%,
                transparent 46%,
                transparent 56%,
                rgba(255, 255, 255, 0.42) 57%,
                rgba(255, 255, 255, 0.42) 63%,
                transparent 64%,
                transparent 74%,
                rgba(255, 255, 255, 0.42) 75%,
                rgba(255, 255, 255, 0.42) 81%,
                transparent 82%);
        opacity: 0.78;
    }

    #coachChatDrawer.coach-chat-window .coach-chat-resize-handle:focus-visible {
        outline: 2px solid var(--gradB);
        outline-offset: -2px;
    }
}

.chat-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.chat-drawer-actions {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.chat-drawer-actions .btn {
    white-space: nowrap;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.2;
    min-height: 36px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#clientGeneralChatDrawer .chat-messages {
    scrollbar-width: thin;
    scrollbar-color: rgba(46, 229, 255, 0.55) rgba(255, 255, 255, 0.12);
}

#clientGeneralChatDrawer .chat-messages::-webkit-scrollbar { width: 10px; }
#clientGeneralChatDrawer .chat-messages::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.10); border-radius: 999px; }
#clientGeneralChatDrawer .chat-messages::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(46, 229, 255, 0.78), rgba(255, 59, 189, 0.72)); border-radius: 999px; border: 2px solid rgba(0, 0, 0, 0.22); }

/* Scoped chat scrollbar visibility (coach + client) */
#coachChatDrawer .chat-messages,
#clientChatDrawer .chat-messages {
    scrollbar-width: thin;
    scrollbar-color: rgba(46, 229, 255, 0.55) rgba(255, 255, 255, 0.12);
}

#coachChatDrawer .chat-messages::-webkit-scrollbar,
#clientChatDrawer .chat-messages::-webkit-scrollbar {
    width: 10px;
}

#coachChatDrawer .chat-messages::-webkit-scrollbar-track,
#clientChatDrawer .chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.10);
    border-radius: 999px;
}

#coachChatDrawer .chat-messages::-webkit-scrollbar-thumb,
#clientChatDrawer .chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(46, 229, 255, 0.78), rgba(255, 59, 189, 0.72));
    border-radius: 999px;
    border: 2px solid rgba(0, 0, 0, 0.22);
}

#coachChatDrawer .chat-messages::-webkit-scrollbar-thumb:hover,
#clientChatDrawer .chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(46, 229, 255, 0.92), rgba(255, 59, 189, 0.86));
}

.chat-message {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 8px 10px;
}

.chat-message.mine {
    border-color: rgba(46, 229, 255, 0.45);
    background: rgba(46, 229, 255, 0.08);
}

.chat-message.theirs {
    border-color: rgba(255, 59, 189, 0.38);
    background: rgba(255, 59, 189, 0.07);
}

.chat-message.selected {
    border-color: rgba(255, 214, 74, 0.95);
    box-shadow:
        0 0 0 2px rgba(255, 214, 74, 0.24),
        0 8px 18px rgba(0, 0, 0, 0.28);
}

.chat-message-meta {
    font-size: 11px;
    opacity: 0.8;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.chat-message-selected-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 214, 74, 0.9);
    background: rgba(255, 214, 74, 0.18);
    color: #ffe28d;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.chat-message-body {
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.chat-media-thumb {
    max-width: 100%;
    max-height: 230px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-composer {
    padding: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(0, 0, 0, 0.22);
}

.chat-recorder {
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 7px;
    background: rgba(255, 255, 255, 0.03);
}

.chat-recorder .btn {
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.2;
    min-height: 36px;
}

.chat-recorder-timer {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    font-size: 11px;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 3px 7px;
}

.chat-recorder-timer.recording {
    color: #ff6b81;
    border-color: rgba(255, 107, 129, 0.65);
    box-shadow: 0 0 0 3px rgba(255, 107, 129, 0.18);
}

.chat-wave-track {
    margin-top: 8px;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.chat-wave-level {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(255, 59, 189, 0.85), rgba(46, 229, 255, 0.9));
    transition: width .12s linear;
}

.chat-recorder-hint {
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.35;
    color: var(--muted);
}

.chat-audio-preview {
    margin-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.18);
    padding-top: 8px;
}

.chat-audio-preview audio {
    width: 100%;
}

/* Aggressive compact mode only for coach chat */
#coachChatDrawer .chat-composer {
    padding: 4px 5px 5px;
}

#coachChatDrawer #coachChatInput {
    padding: 7px 9px;
    border-radius: 9px;
    font-size: 12px;
}

#coachChatDrawer .chat-recorder {
    margin-top: 4px;
    padding: 4px;
    border-radius: 8px;
}

#coachChatDrawer .chat-recorder.is-collapsed {
    padding: 0;
    margin-top: 3px;
    border: 0;
    background: transparent;
}

#coachChatDrawer .chat-recorder.is-collapsed .chat-wave-track,
#coachChatDrawer .chat-recorder.is-collapsed .chat-recorder-hint,
#coachChatDrawer .chat-recorder.is-collapsed .chat-audio-preview {
    display: none !important;
}

#coachChatDrawer .chat-recorder.is-collapsed .row {
    margin-top: 0 !important;
}

#coachChatDrawer .chat-recorder.is-collapsed .chat-recorder-timer {
    min-width: 42px;
    text-align: center;
}

#coachChatDrawer .chat-recorder.is-expanded,
#coachChatDrawer .chat-recorder.is-unavailable {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

#coachChatDrawer .chat-recorder .btn,
#coachChatDrawer .chat-composer>.row .btn {
    padding: 4px 7px;
    border-radius: 9px;
    font-size: 10.5px;
    line-height: 1.15;
    min-height: 28px;
    font-weight: 700;
}

#coachChatDrawer .chat-recorder-timer {
    font-size: 9.5px;
    padding: 1px 5px;
}

#coachChatDrawer .chat-wave-track {
    margin-top: 4px;
    height: 5px;
}

#coachChatDrawer .chat-recorder-hint {
    margin-top: 3px;
    font-size: 9.5px;
    line-height: 1.2;
}

#coachChatDrawer .chat-audio-preview {
    margin-top: 4px;
    padding-top: 4px;
}

#coachChatDrawer .chat-audio-preview audio {
    height: 28px;
}

[data-theme="light"] #coachChatDrawer .chat-composer>.row .btn,
[data-theme="light"] #coachChatDrawer .chat-recorder .btn {
    border-width: 1px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

[data-theme="light"] #coachChatDrawer .chat-recorder.is-collapsed {
    border: 0;
    background: transparent;
}

[data-theme="light"] #coachChatDrawer .chat-recorder.is-expanded,
[data-theme="light"] #coachChatDrawer .chat-recorder.is-unavailable {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.03);
}

@media (max-width: 700px) {
    .chat-drawer-header {
        padding: 10px;
    }

    .chat-composer {
        padding: 9px;
    }

    .chat-drawer-actions .btn,
    .chat-recorder .btn {
        min-height: 40px;
        padding: 9px 12px;
        font-size: 13px;
    }

    #coachChatDrawer .chat-composer {
        padding: 5px 6px;
    }

    #coachChatDrawer #coachChatInput {
        padding: 8px 9px;
    }

    #coachChatDrawer .chat-recorder .btn,
    #coachChatDrawer .chat-composer>.row .btn {
        min-height: 30px;
        padding: 5px 8px;
        font-size: 10.5px;
    }

    #coachChatDrawer .chat-audio-preview audio {
        height: 30px;
    }
}

[data-theme="light"] .chat-drawer {
    background: linear-gradient(180deg, rgba(252, 252, 255, 0.99), rgba(246, 247, 252, 0.99));
    border-left: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] #coachChatDrawer.coach-chat-window {
    background: linear-gradient(180deg, rgba(252, 252, 255, 0.99), rgba(246, 247, 252, 0.99));
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.14);
}

[data-theme="light"] #coachChatDrawer.coach-chat-window .coach-chat-resize-handle {
    background:
        linear-gradient(135deg,
            transparent 0,
            transparent 38%,
            rgba(0, 0, 0, 0.28) 39%,
            rgba(0, 0, 0, 0.28) 45%,
            transparent 46%,
            transparent 56%,
            rgba(0, 0, 0, 0.28) 57%,
            rgba(0, 0, 0, 0.28) 63%,
            transparent 64%,
            transparent 74%,
            rgba(0, 0, 0, 0.28) 75%,
            rgba(0, 0, 0, 0.28) 81%,
            transparent 82%);
}

[data-theme="light"] .chat-message {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .chat-message.mine {
    border-color: rgba(46, 229, 255, 0.55);
    background: rgba(46, 229, 255, 0.14);
}

[data-theme="light"] .chat-message.theirs {
    border-color: rgba(255, 59, 189, 0.45);
    background: rgba(255, 59, 189, 0.10);
}

[data-theme="light"] .chat-message.selected {
    border-color: rgba(210, 140, 0, 0.95);
    box-shadow:
        0 0 0 2px rgba(210, 140, 0, 0.24),
        0 8px 18px rgba(0, 0, 0, 0.14);
}

[data-theme="light"] .chat-message-selected-badge {
    border-color: rgba(210, 140, 0, 0.95);
    background: rgba(210, 140, 0, 0.12);
    color: rgba(90, 56, 0, 0.98);
}

[data-theme="light"] #coachChatDrawer .chat-messages,
[data-theme="light"] #clientChatDrawer .chat-messages {
    scrollbar-color: rgba(255, 59, 189, 0.52) rgba(0, 0, 0, 0.10);
}

[data-theme="light"] #coachChatDrawer .chat-messages::-webkit-scrollbar-track,
[data-theme="light"] #clientChatDrawer .chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.10);
}

[data-theme="light"] #coachChatDrawer .chat-messages::-webkit-scrollbar-thumb,
[data-theme="light"] #clientChatDrawer .chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255, 59, 189, 0.68), rgba(46, 229, 255, 0.62));
    border: 2px solid rgba(255, 255, 255, 0.42);
}

[data-theme="light"] #coachChatDrawer .chat-messages::-webkit-scrollbar-thumb:hover,
[data-theme="light"] #clientChatDrawer .chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(255, 59, 189, 0.8), rgba(46, 229, 255, 0.74));
}

/* Coach hard override on real scroller id */
#coachChatMessages {
    overflow-y: scroll;
    scrollbar-gutter: stable;
    scrollbar-width: auto;
    scrollbar-color: rgba(46, 229, 255, 0.98) rgba(255, 255, 255, 0.22);
}

#coachChatMessages::-webkit-scrollbar {
    width: 12px;
}

#coachChatMessages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

#coachChatMessages::-webkit-scrollbar-thumb {
    background: rgba(46, 229, 255, 0.98);
    border: 2px solid rgba(0, 0, 0, 0.28);
    border-radius: 999px;
    min-height: 36px;
}

#coachChatMessages::-webkit-scrollbar-thumb:hover {
    background: rgba(46, 229, 255, 1);
}

[data-theme="light"] #coachChatMessages {
    scrollbar-color: rgba(255, 59, 189, 0.98) rgba(0, 0, 0, 0.18);
}

[data-theme="light"] #coachChatMessages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.18);
}

[data-theme="light"] #coachChatMessages::-webkit-scrollbar-thumb {
    background: rgba(255, 59, 189, 0.98);
    border: 2px solid rgba(255, 255, 255, 0.55);
}

[data-theme="light"] #coachChatMessages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 59, 189, 1);
}

[data-theme="light"] .chat-recorder {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .chat-recorder-timer {
    border-color: rgba(0, 0, 0, 0.16);
}

[data-theme="light"] .chat-wave-track {
    background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .chat-audio-preview {
    border-top-color: rgba(0, 0, 0, 0.2);
}
/* Classes reservations: mobile-first cards, intentionally isolated from workout UI. */
.class-classes-app { min-height: 100vh; }
.class-day-heading { display:grid; gap:2px; margin-top:16px; }.class-day-heading span { color:var(--muted); font-size:.7rem; font-weight:800; letter-spacing:.12em; }.class-day-heading strong { text-transform:capitalize; font-size:1.12rem; }.class-week-nav { display:flex; align-items:center; min-width:0; gap:5px; margin-top:12px; }.class-week-nav > .btn { flex:0 0 34px; width:34px; min-width:34px; padding:9px 0; }.class-day-picker-list { display:grid; min-width:0; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; flex:1; }.class-day-picker { display:grid; min-width:0; gap:3px; place-items:center; min-height:52px; padding:6px 2px; border:1px solid var(--stroke); border-radius:10px; background:rgba(255,255,255,.035); color:var(--muted); font:inherit; cursor:pointer; }.class-day-picker small { font-size:.68rem; font-weight:800; }.class-day-picker strong { font-size:1.02rem; }.class-day-picker.is-selected { color:#fff; border-color:var(--gradB); background:linear-gradient(135deg,var(--gradA),var(--gradB)); box-shadow:0 5px 16px rgba(0,194,255,.2); }.class-days { display:grid; gap:18px; padding:18px 0 34px; }
.class-day { display:grid; gap:10px; }
.class-day h2 { margin:0; font-size:1rem; text-transform:capitalize; }
.class-session { border:1px solid rgba(255,255,255,.12); border-top:4px solid var(--class-color); border-radius:16px; background:rgba(255,255,255,.045); padding:14px; box-shadow:var(--shadow); }
.class-session__top { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:1.15rem; }
.class-session__top time { font-size:1.35rem; font-weight:900; white-space:nowrap; }
.class-session__accent { display:inline-block; width:5px; height:24px; margin-right:9px; vertical-align:middle; border-radius:99px; background:var(--class-color); }
.class-session__meta { margin:8px 0 12px; color:var(--muted); font-size:.9rem; }
.class-session__avatars { min-height:44px; display:flex; flex-wrap:wrap; gap:7px; align-items:center; }.class-session__slots { padding:2px 0; }
.class-avatar { width:40px; height:40px; border-radius:9px; object-fit:cover; border:2px solid var(--class-color); background:#24232c; }
.class-avatar--fallback { display:grid; place-items:center; color:white; font-weight:800; }
.class-avatar--empty { border-color:transparent; background:rgba(255,255,255,.08); }
.class-session__actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; margin-top:12px; }
.class-session__closed { color:var(--muted); font-size:.9rem; padding:8px 0; }
.class-back { margin-bottom:10px; }
.class-wod-modal .overlayCard { width:min(620px, 94vw); max-height:85vh; overflow:auto; text-align:left; }
.class-wod-modal__head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.class-wod-block { margin-top:12px; padding:12px; border-left:4px solid var(--gradB); background:rgba(255,255,255,.05); border-radius:8px; }
.class-wod-block p { margin:8px 0 0; line-height:1.5; }
@media (min-width: 760px) { .class-days { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:380px) { .class-day-picker { min-height:47px; }.class-day-picker small { font-size:.61rem; }.class-day-picker strong { font-size:.9rem; }.class-week-nav > .btn { flex-basis:30px; width:30px; min-width:30px; } }
